jack 8 年 前
コミット
8626a07091
共有3 個のファイルを変更した36 個の追加1 個の削除を含む
  1. 1 1
      app/html/professorArticle.html
  2. 8 0
      app/js/articalMessage.js
  3. 27 0
      app/js/professorArticle.js

+ 1 - 1
app/html/professorArticle.html

@ -33,7 +33,7 @@
33 33
		    </a>
34 34
		    <a class="mui-tab-item" id="leaveWord">
35 35
		        <span class="mui-icon iconfont icon-community"></span>
36
		        <span class="mui-tab-label">留言</span>
36
		        <span class="mui-tab-label" id="leaveWord"></span>
37 37
		    </a>
38 38
		    <a class="mui-tab-item" id="collect">
39 39
		        <span class="mui-icon iconfont icon-favor" id="yesExpert"></span>

+ 8 - 0
app/js/articalMessage.js

@ -87,6 +87,10 @@ mui.plusReady(function() {
87 87
					document.getElementsByTagName("textarea")[0].value = "";
88 88
					document.getElementById("msg-type").classList.remove("addColor");
89 89
					proInfoMain();
90
					var web = plus.webview.getWebviewById("professorArticle.html");
91
							mui.fire(web, "newId", {
92
								rd: 1
93
							});
90 94
				}
91 95
			},
92 96
			error: function() {
@ -109,6 +113,10 @@ mui.plusReady(function() {
109 113
			success: function(data) {
110 114
				if(data.success) {
111 115
					document.getElementsByClassName(" protable")[0].removeChild(oRemo.parentNode.parentNode.parentNode.parentNode);
116
					var web = plus.webview.getWebviewById("professorArticle.html");
117
							mui.fire(web, "newId", {
118
								rd: 1
119
							});
112 120
				}
113 121
			},
114 122
			error: function() {

+ 27 - 0
app/js/professorArticle.js

@ -397,9 +397,36 @@ mui.plusReady(function() {
397 397
				}
398 398
			})
399 399
		}
400
		/*文章留言总数*/
401
		function leaveWord(){
402
			mui.ajax(baseUrl + "/ajax/leaveWord/lwCount", {
403
				type: "GET",
404
				timeout: 10000,
405
				dataType: "json",
406
				data: {
407
					"articleId": proId,
408
				},
409
				success: function(data) {
410
					if(data.success) {
411
						document.getElementById('leaveWord').innerHTML="留言"+"("+data.data+")";
412
					}
413
				},
414
				error: function(XMLHttpRequest, textStats, errorThrown) {
415
					plus.nativeUI.toast("服务器链接超时", toastStyle);
416
					return;
417
				}
418
			})
419
		}
420
		leaveWord();
400 421
		window.addEventListener("newId", function(event) {
422
			var fl = event.detail.rd;
423
			if(fl==1){
424
				leaveWord();
425
			}else{
401 426
			attentionArticle();
402 427
			isAgreeArticle();
428
			}
429
			
403 430
		})
404 431
		/*微信及微信朋友圈分享专家*/
405 432
	var auths, shares;