|
@ -249,6 +249,7 @@ mui.plusReady(function() {
|
249
|
249
|
userid = plus.storage.getItem('userid');
|
250
|
250
|
getRecourceMe();
|
251
|
251
|
ifcollectionAbout(patentId,4);
|
|
252
|
isAgree();
|
252
|
253
|
});
|
253
|
254
|
function leadIn(sel) {
|
254
|
255
|
mui.ajax(baseUrl + "/ajax/ppatent/ass", {
|
|
@ -656,7 +657,7 @@ mui.plusReady(function() {
|
656
|
657
|
}
|
657
|
658
|
},
|
658
|
659
|
error: function() {
|
659
|
|
//$.MsgBox.Alert('提示',"服务器链接超时");
|
|
660
|
plus.nativeUI.toast("服务器链接超时", toastStyle);
|
660
|
661
|
}
|
661
|
662
|
});
|
662
|
663
|
}
|
|
@ -680,7 +681,7 @@ function isAgree() {
|
680
|
681
|
}
|
681
|
682
|
},
|
682
|
683
|
error: function() {
|
683
|
|
//$.MsgBox.Alert('提示',"服务器链接超时");
|
|
684
|
plus.nativeUI.toast("服务器链接超时", toastStyle);
|
684
|
685
|
}
|
685
|
686
|
});
|
686
|
687
|
}
|
|
@ -709,8 +710,155 @@ function addAgree() {
|
709
|
710
|
}
|
710
|
711
|
},
|
711
|
712
|
error: function() {
|
712
|
|
//$.MsgBox.Alert('提示',"服务器链接超时");
|
|
713
|
plus.nativeUI.toast("服务器链接超时", toastStyle);
|
713
|
714
|
}
|
714
|
715
|
});
|
715
|
716
|
}
|
716
|
|
});
|
|
717
|
mui(".artfoot").on("tap", ".inputShow", function() {
|
|
718
|
if(!isLogin) {
|
|
719
|
document.getElementById("textInput").style.display = "block";
|
|
720
|
document.getElementById("operCol").style.display = "none";
|
|
721
|
document.getElementById("textInputThis").focus();
|
|
722
|
}
|
|
723
|
|
|
724
|
})
|
|
725
|
leword();
|
|
726
|
|
|
727
|
function leword() {
|
|
728
|
var data = {"patentId": patentId,"rows": 500}
|
|
729
|
mui.ajax(baseUrl + "/ajax/leaveWord/ql/patent", {
|
|
730
|
data: obj,
|
|
731
|
dataType: 'json', //服务器返回json格式数据
|
|
732
|
type: 'get', //HTTP请求类型
|
|
733
|
timeout: 10000, //超时时间设置为10秒;
|
|
734
|
traditional: true,
|
|
735
|
success: function(data) {
|
|
736
|
console.log(JSON.stringify(data))
|
|
737
|
if(data.success) {
|
|
738
|
document.getElementsByClassName('commentBlock')[0].innerHTML = ""
|
|
739
|
if(data.data.length == 0) {
|
|
740
|
return;
|
|
741
|
}
|
|
742
|
var id = plus.storage.getItem('userid');
|
|
743
|
for(var i = 0; i < data.data.length; i++) {
|
|
744
|
var oText = ""
|
|
745
|
if(id == data.data[i].professor.id) {
|
|
746
|
oText = "删除"
|
|
747
|
}
|
|
748
|
var userType = autho(data.data[i].professor.authType, data.data[i].professor.orgAuth, data.data[i].professor.authStatus);
|
|
749
|
var baImg = "../images/default-photo.jpg";
|
|
750
|
if(data.data[i].professor.hasHeadImage == 1) {
|
|
751
|
baImg = baseUrl + "/images/head/" + data.data[i].professor.id + "_l.jpg";
|
|
752
|
}
|
|
753
|
var li = document.createElement("li");
|
|
754
|
li.className = "mui-table-view-cell";
|
|
755
|
li.innerHTML = '<div class="flexCenter mui-clearfix">' +
|
|
756
|
'<div class="madiaHead useHead" style="background-image:url(' + baImg + ')" data-id="' + data.data[i].professor.id + '"></div>' +
|
|
757
|
'<div class="madiaInfo">' +
|
|
758
|
'<p><span class="h1Font" data-id="' + data.data[i].professor.id + '">' + data.data[i].professor.name + '</span><em class="authicon ' + userType.sty + '" title="科袖认证专家"></em></p>' +
|
|
759
|
'</div>' +
|
|
760
|
'</div>' +
|
|
761
|
'<div class="madiaInfo">' +
|
|
762
|
'<p class="h2Font">' + data.data[i].content + '</p>' +
|
|
763
|
'<p class="operateSpan">' +
|
|
764
|
'<span class="commenttime">' + commenTime(data.data[i].createTime) + '</span>' +
|
|
765
|
'<span data-id="' + data.data[i].id + '" class="dele">' + oText + '</span>' +
|
|
766
|
'</p>' +
|
|
767
|
'</div>'
|
|
768
|
document.getElementsByClassName("commentBlock")[0].appendChild(li);
|
|
769
|
}
|
|
770
|
|
|
771
|
} else {
|
|
772
|
}
|
|
773
|
},
|
|
774
|
error: function(xhr, type, errorThrown) {
|
|
775
|
//异常处理;
|
|
776
|
plus.nativeUI.toast("服务器链接超时", toastStyle);
|
|
777
|
}
|
|
778
|
});
|
|
779
|
}
|
|
780
|
lewordNum();
|
|
781
|
function lewordNum() {
|
|
782
|
var data = {"patentId": patentId}
|
|
783
|
mui.ajax(baseUrl + "/ajax/leaveWord/lwCount/patent", {
|
|
784
|
data: obj,
|
|
785
|
dataType: 'json', //服务器返回json格式数据
|
|
786
|
type: 'get', //HTTP请求类型
|
|
787
|
timeout: 10000, //超时时间设置为10秒;
|
|
788
|
traditional: true,
|
|
789
|
success: function(data) {
|
|
790
|
if(data.success) {
|
|
791
|
document.getElementsByClassName("mui-badge")[0].innerHTML=data.data;
|
|
792
|
}
|
|
793
|
|
|
794
|
|
|
795
|
},
|
|
796
|
error: function(xhr, type, errorThrown) {
|
|
797
|
//异常处理;
|
|
798
|
plus.nativeUI.toast("服务器链接超时", toastStyle);
|
|
799
|
}
|
|
800
|
});
|
|
801
|
}
|
|
802
|
function trim(str) { //删除左右两端的空格
|
|
803
|
|
|
804
|
return str.replace(/(^\s*)|(\s*$)/g, "");
|
|
805
|
}
|
|
806
|
document.getElementById("textInputThis").addEventListener("input", function() {
|
|
807
|
var length = trim(this.value);
|
|
808
|
if(length) {
|
|
809
|
document.getElementsByClassName("mui-btn")[0].removeAttribute("disabled")
|
|
810
|
} else {
|
|
811
|
document.getElementsByClassName("mui-btn")[0].setAttribute("disabled", "true")
|
|
812
|
}
|
|
813
|
})
|
|
814
|
document.getElementsByClassName("mui-btn")[0].addEventListener("tap", function() {
|
|
815
|
mui.ajax(baseUrl + "/ajax/leaveWord/patent", {
|
|
816
|
data: {
|
|
817
|
"patentId": patentId,
|
|
818
|
"sender": plus.storage.getItem('userid'),
|
|
819
|
"content": document.getElementById("textInputThis").value
|
|
820
|
},
|
|
821
|
dataType: 'json', //服务器返回json格式数据
|
|
822
|
type: 'post', //HTTP请求类型
|
|
823
|
timeout: 10000, //超时时间设置为10秒;
|
|
824
|
success: function(data) {
|
|
825
|
if(data.success) {
|
|
826
|
document.getElementById("textInputThis").value = "";
|
|
827
|
document.getElementById('textInput').style.display = "none";
|
|
828
|
document.getElementById('operCol').style.display = "block";
|
|
829
|
leword();
|
|
830
|
lewordNum();
|
|
831
|
}
|
|
832
|
},
|
|
833
|
error: function(xhr, type, errorThrown) {
|
|
834
|
//异常处理;
|
|
835
|
plus.nativeUI.toast("服务器链接超时", toastStyle);
|
|
836
|
},
|
|
837
|
beforeSend: function(data) {
|
|
838
|
console.log(JSON.stringify(data));
|
|
839
|
}
|
|
840
|
});
|
|
841
|
})
|
|
842
|
mui(".commentBlock").on("tap", ".dele", function() {
|
|
843
|
var $this = this;
|
|
844
|
mui.ajax(baseUrl + "/ajax/leaveWord/delete", {
|
|
845
|
data: {
|
|
846
|
"id": this.getAttribute("data-id"),
|
|
847
|
},
|
|
848
|
dataType: 'json', //服务器返回json格式数据
|
|
849
|
type: 'post', //HTTP请求类型
|
|
850
|
timeout: 10000, //超时时间设置为10秒;
|
|
851
|
success: function(data) {
|
|
852
|
if(data.success) {
|
|
853
|
document.getElementsByClassName("commentBlock")[0].removeChild($this.parentNode.parentNode.parentNode);
|
|
854
|
leword();
|
|
855
|
lewordNum();
|
|
856
|
}
|
|
857
|
},
|
|
858
|
error: function(xhr, type, errorThrown) {
|
|
859
|
//异常处理;
|
|
860
|
plus.nativeUI.toast("服务器链接超时", toastStyle);
|
|
861
|
}
|
|
862
|
});
|
|
863
|
})
|
|
864
|
});
|