瀏覽代碼

留言未完善

li 7 年之前
父節點
當前提交
22617e6717
共有 6 個文件被更改,包括 439 次插入182 次删除
  1. 98 0
      app/html/guide.html
  2. 48 0
      app/html/inform.html
  3. 1 5
      app/html/professorArticle.html
  4. 14 1
      app/index.html
  5. 6 176
      app/js/articleShow.js
  6. 272 0
      app/js/leaveWords.js

+ 98 - 0
app/html/guide.html

@ -0,0 +1,98 @@
1
<!DOCTYPE html>
2
<html>
3

4
	<head>
5
		<meta charset="UTF-8">
6
		<title></title>
7
		<style>
8
			.box {
9
				position: absolute;
10
				z-index: 2;
11
				top: 0;
12
				bottom: 0;
13
				left: 0;
14
				overflow: hidden;
15
				width: 100%;
16
				background-color: #ffffff;
17
			}
18
			
19
			.header {
20
				width: 100%;
21
			}
22
			
23
			.header img {
24
				width: 100%;
25
			}
26
			
27
			.footer {
28
				background-color: #ffffff;
29
				height: 370px;
30
				width: 100%;
31
				display: flex;
32
				align-items: center;
33
				justify-content: center;
34
				position: absolute;
35
				bottom: 0;
36
			}
37
			
38
			.footer img {
39
				width: 180px;
40
				height: 120px;
41
			}
42
			
43
			.skip {
44
				position: fixed;
45
				top: 42px;
46
				right: 28px;
47
				height: 60px;
48
				width: 180px;
49
				background: rgba(0, 0, 0, 0.15);
50
				text-align: center;
51
				line-height: 60px;
52
				color: #fff;
53
				z-index: 2;
54
				font-size: 30px;
55
				border-radius: 40px;
56
			}
57
		</style>
58
	</head>
59

60
	<body>
61
		<div class="box">
62
			<div class="header">
63
				<img src="../images/20171220113002.jpg" />
64
			</div>
65
			<div class="footer">
66
				<img src="../images/logo.png" alt="" />
67
			</div>
68
		</div>
69
		<div class="skip" id="close">跳过广告</div>
70
	</body>
71
	<script src="../js/public/mui.min.js"></script>
72
	<script>
73
		mui.init();
74
		mui.ready(function() {
75
			mui.plusReady(function() {
76
				plus.navigator.setFullscreen(true);
77
				plus.navigator.closeSplashscreen();
78
			});
79
			document.getElementById("close").addEventListener('tap', function(event) {
80
				plus.navigator.setFullscreen(false);
81
				plus.webview.currentWebview().close();
82
			}, false);
83
			//setTimeMiu(5)
84

85
			function setTimeMiu(n) {
86
				var i = 0;
87
				var Timer = setInterval(function() {
88
					i++;
89
					if(i == n - 1) {
90
						plus.webview.currentWebview().close();
91
						clearInterval(Timer);
92
					}
93
				}, 1000);
94
			}
95
		})
96
	</script>
97

98
</html>

+ 48 - 0
app/html/inform.html

@ -0,0 +1,48 @@
1
<!DOCTYPE html>
2
<html>
3

4
	<head>
5
		<meta charset="utf-8">
6
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
7
		<title>通知</title>
8
		<link href="../css/mui.min.css" rel="stylesheet" />
9
		<link rel="stylesheet" type="text/css" href="../css/iconfont.css" />
10
		<link href="../css/app.css" rel="stylesheet" />
11
	</head>
12

13
	<body>
14
		<div id="zixunpullrefresh" class="mui-content mui-scroll-wrapper">
15
			<div class="mui-scroll">
16
				<div class="infocon madiaBlock">
17
					<ul class="mui-table-view consultList" id="consultList">
18
						<li class="mui-table-view-cell" style="height:80px;">
19
							<div class="madiaHead useHead" style="background-image:url(../images/default-photo.jpg)"></div>
20
							<div class="madiaInfo">
21

22
								<div class="h2Font mui-ellipsis-2" style="color: #333;font-weight: 400;">这里显示对话的最后一条消息,天个人似乎突然今天个人似<span style="color:#ff9900">记得记得就到家</span>乎突然今天跟顶顶顶顶付付毒贩夫妇付付i</div>
23
								<div class="h3Font" style="margin: 5px 0;">
24
									8月17日 18:00
25
								</div>
26
							</div>
27
						</li>
28
						<li class="mui-table-view-cell" style="height:80px;">
29
							<div class="madiaHead useHead" style="background-image:url(../images/default-photo.jpg)"></div>
30
							<div class="madiaInfo">
31

32
								<div class="h2Font mui-ellipsis-2" style="color: #333;font-weight: 400;">这里显示对话的最后一条消息,天个人似乎突然今天个人似<span style="color:#ff9900">记得记得就到家</span>乎突然今天跟顶顶顶顶付付毒贩夫妇付付i</div>
33
								<div class="h3Font" style="margin: 5px 0;">
34
									8月17日 18:00
35
								</div>
36
							</div>
37
						</li>
38
					</ul>
39
				</div>
40
			</div>
41
			<div style="position:absolute;top:50%;width:100%;text-align:center;" class="displayNone">暂无通知</div>
42
		</div>
43
		<script src="../js/public/mui.min.js"></script>
44
		<script src="../js/public/base.js"></script>
45
		<script src="../js/inform.js"></script>
46
	</body>
47

48
</html>

+ 1 - 5
app/html/professorArticle.html

@ -151,11 +151,6 @@
151 151
			})
152 152
			//处理iOS下弹出软键盘后头部会随页面的滚动条消失问题
153 153
		    iosheader();
154
		    mui("body").on("tap",".mui-content",function(){
155
		    	document.getElementById("textInput").style.display="none";
156
		    	document.getElementById("operCol").style.display="block";
157
		    })
158
		    
159 154
		    //var BtnMore=document.getElementById("BtnMore");
160 155
		    var shareOut=document.getElementById("shareOut");
161 156
		    var cancelShare=document.getElementById("cancelShare");
@ -181,6 +176,7 @@
181 176
		    })
182 177
		</script>
183 178
		<script type="text/javascript" src="../js/articleShow.js"></script>
179
		<script type="text/javascript" src="../js/leaveWords.js"></script>
184 180
	</body>
185 181

186 182
</html>

+ 14 - 1
app/index.html

@ -39,7 +39,20 @@
39 39
	};
40 40
	var aniShow = {};
41 41
	//创建子页面,首个选项卡页面显示,其它均隐藏;
42
	mui.plusReady(function() {
42
	mui.plusReady(function() {
43
		mui.openWindow({
44
						id: 'guide.html',
45
						url: '/html/guide.html',
46
						styles: {
47
							popGesture: "none"
48
						},
49
						show: {
50
							aniShow: 'none'
51
						},
52
						waiting: {
53
							autoShow: false
54
						}
55
					});
43 56
		var self = plus.webview.currentWebview();
44 57
		for(var i = 0; i < 4; i++) {
45 58
			var temp = {};

+ 6 - 176
app/js/articleShow.js

@ -1,104 +1,13 @@
1
//var createTime = "",
2
//	orderKey = "";
3
//mui.init({
4
//	pullRefresh: {
5
//		container: '#pullrefresh',
6
//		up: {
7
//			contentrefresh: '正在加载...',
8
//			callback: pullupRefresh
9
//		}
10
//	}
11
//});
12
//
13
//function pullupRefresh() {
14
//	setTimeout(function() {
15
//		leword(1, 0);
16
//	}, 1000);
17
//}
18
leword(500, 1);
1

2

19 3
var stt;
20
function leword(row, aa) {
21
	mui.plusReady(function() {
22
		var af = aa,
23
			stt;
24
		var obj = {};
25
		obj.articleId = plus.webview.currentWebview().articleId;
26
		/*obj.createTime = createTime;
27
		obj.orderKey = orderKey;*/
28
		obj.rows = row;
29
		mui.ajax(baseUrl + "/ajax/leaveWord/ql", {
30
			data: obj,
31
			dataType: 'json', //服务器返回json格式数据
32
			type: 'get', //HTTP请求类型
33
			timeout: 10000, //超时时间设置为10秒;
34
			traditional: true,
35
			success: function(data) {
36
				console.log(JSON.stringify(data))
37
				if(data.success) {
38
					/*if(af == 1) {*/
39
					document.getElementsByClassName('commentBlock')[0].innerHTML = ""
40
					if(data.data.length == 0) {
41
						//mui('#pullrefresh').pullRefresh().disablePullupToRefresh(true);
42
						return;
43
					}
44
					/*} else {
45
						if(data.data.length == 0) {
46
							mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
47
							return;
48
						}
49
					}*/
50
					var id = plus.storage.getItem('userid');
51
					/*createTime = data.data[data.data.length - 1].createTime;
52
					orderKey = data.data[data.data.length - 1].orderKey;*/
53
					/*if(data.data.length == row) {
54
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(false);
55
					} else {
56
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
57
					}*/
58
					for(var i = 0; i < data.data.length; i++) {
59
						var oText = ""
60
						if(id == data.data[i].professor.id) {
61
							oText = "删除"
62
						}
63
						var userType = autho(data.data[i].professor.authType, data.data[i].professor.orgAuth, data.data[i].professor.authStatus);
64
						var baImg = "../images/default-photo.jpg";
65
						if(data.data[i].professor.hasHeadImage == 1) {
66
							baImg = baseUrl + "/images/head/" + data.data[i].professor.id + "_l.jpg";
67
						}
68
						var li = document.createElement("li");
69
						li.className = "mui-table-view-cell";
70
						li.innerHTML = '<div class="flexCenter mui-clearfix">' +
71
							'<div class="madiaHead useHead" style="background-image:url(' + baImg + ')" data-id="' + data.data[i].professor.id + '"></div>' +
72
							'<div class="madiaInfo">' +
73
							'<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>' +
74
							'</div>' +
75
							'</div>' +
76
							'<div class="madiaInfo">' +
77
							'<p class="h2Font">' + data.data[i].content + '</p>' +
78
							'<p class="operateSpan">' +
79
							'<span class="commenttime">' + commenTime(data.data[i].createTime) + '</span>' +
80
							'<span data-id="' + data.data[i].id + '" class="dele">' + oText + '</span>' +
81
							'</p>' +
82
							'</div>'
83
						document.getElementsByClassName("commentBlock")[0].appendChild(li);
84
					}
85 4

86
				} else {
87
					/*mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);*/
88
				}
89
			},
90
			error: function(xhr, type, errorThrown) {
91
				//异常处理;
92
				plus.nativeUI.toast("服务器链接超时", toastStyle);
93
			}
94
		});
95
	})
96
}
97 5

98 6
mui.plusReady(function() {
99 7
	mui('#articleContent').on('tap','a',function(){
100 8
		plus.runtime.openURL( this.href);
101 9
	});
10
	
102 11
	var ffl=false;
103 12
	var oCurren = {
104 13
		self: plus.webview.currentWebview(),
@ -122,11 +31,6 @@ mui.plusReady(function() {
122 31
		},
123 32
		sendLeaveWord: function($data) {
124 33
			console.log(JSON.stringify($data));
125
		},
126
		leaveWordTotal: function($data) {
127
			if($data>0){
128
				document.getElementsByClassName('mui-badge')[0].innerHTML = $data
129
			}
130 34
		}
131 35
	}
132 36
	
@ -601,7 +505,7 @@ mui.plusReady(function() {
601 505
		});
602 506
	})
603 507
	/*留言*/
604
	mui('.commentBlock').on('tap', '.useHead,.h1Font', function() {
508
	mui('.commentBlock').on('tap', '.useHead', function() {
605 509
		var id = this.getAttribute("data-id");
606 510
		plus.nativeUI.showWaiting(); //显示原生等待框
607 511
		plus.webview.create("../html/userInforShow.html", 'userInforShow.html', {}, {
@ -739,9 +643,7 @@ mui.plusReady(function() {
739 643
		  
740 644
		return str.replace(/(^\s*)|(\s*$)/g, "");  
741 645
	}
742
	oArticleModule.oAjaxGet(baseUrl + "/ajax/leaveWord/lwCount", {
743
		"articleId": oArticleModule.articleId
744
	}, "get", leaveWord.leaveWordTotal);
646
	
745 647
	document.getElementById("textInputThis").addEventListener("input", function() {
746 648
		var length = trim(this.value);
747 649
		if(length) {
@ -752,79 +654,7 @@ mui.plusReady(function() {
752 654
		}
753 655
		
754 656
	})
755
	document.getElementsByClassName("mui-btn")[0].addEventListener("tap", function() {
756
		if(document.getElementById("textInputThis").value.length>200) {
757
				plus.nativeUI.toast("留言不得超过200个字", toastStyle);
758
				return;
759
			}
760
		mui.ajax(baseUrl + "/ajax/leaveWord", {
761
			data: {
762
				"articleId": plus.webview.currentWebview().articleId,
763
				"sender": plus.storage.getItem('userid'),
764
				"content": document.getElementById("textInputThis").value
765
			},
766
			dataType: 'json', //服务器返回json格式数据
767
			type: 'post', //HTTP请求类型
768
			timeout: 10000, //超时时间设置为10秒;
769
			success: function(data) {
770
				if(data.success) {
771
					document.getElementById("textInputThis").value = "";
772
					//					createTime = "";
773
					//					orderKey = "";
774
					//					mui('#pullrefresh').pullRefresh().enablePullupToRefresh();
775
					document.getElementById('textInput').style.display = "none";
776
					document.getElementById('operCol').style.display = "block";
777
					leword(500, 1);
778
					oArticleModule.oAjaxGet(baseUrl + "/ajax/leaveWord/lwCount", {
779
						"articleId": oArticleModule.articleId
780
					}, "get", leaveWord.leaveWordTotal)
781
				}
782
			},
783
			error: function(xhr, type, errorThrown) {
784
				//异常处理;
785
				plus.nativeUI.toast("服务器链接超时", toastStyle);
786
			},
787
			beforeSend: function(data) {
788
				console.log(JSON.stringify(data));
789
			}
790
		});
791
	})
792
	mui(".commentBlock").on("tap", ".dele", function() {
793
		var $this = this;
794
		mui.ajax(baseUrl + "/ajax/leaveWord/delete", {
795
			data: {
796
				"id": this.getAttribute("data-id"),
797
			},
798
			dataType: 'json', //服务器返回json格式数据
799
			type: 'post', //HTTP请求类型
800
			timeout: 10000, //超时时间设置为10秒;
801
			success: function(data) {
802
				if(data.success) {
803
					document.getElementsByClassName("commentBlock")[0].removeChild($this.parentNode.parentNode.parentNode);
804
					//					createTime = "";
805
					//					orderKey = "";
806
					//					mui('#pullrefresh').pullRefresh().enablePullupToRefresh();
807
					leword(500, 1);
808
					oArticleModule.oAjaxGet(baseUrl + "/ajax/leaveWord/lwCount", {
809
						"articleId": oArticleModule.articleId
810
					}, "get", leaveWord.leaveWordTotal)
811
				}
812
			},
813
			error: function(xhr, type, errorThrown) {
814
				//异常处理;
815
				plus.nativeUI.toast("服务器链接超时", toastStyle);
816
			}
817
		});
818
	})
819
	mui(".artfoot").on("tap", ".inputShow", function() {
820
		if(!plus.storage.getItem('userid')) {
821
			oCurren.login();
822
			return;
823
		}
824
		document.getElementById("textInput").style.display = "block";
825
		document.getElementById("operCol").style.display = "none";
826
		document.getElementById("textInputThis").focus();
827
	})
657
	
828 658

829 659
	/*微信及微信朋友圈分享专家*/
830 660
	var auths, shares;

+ 272 - 0
app/js/leaveWords.js

@ -0,0 +1,272 @@
1
mui.ready(function() {
2
	mui.plusReady(function() {
3
		function ajaxRequist(url, obj, type, fn) {
4
			mui.ajax(url, {
5
				data: obj,
6
				dataType: 'json', //服务器返回json格式数据
7
				type: type, //支持'GET'和'POST'
8
				traditional: true,
9
				success: function(data) {
10
					if(data.success) {
11
						fn(data.data)
12
					}
13
				},
14
				error: function(xhr, type, errorThrown) {
15
					plus.nativeUI.toast("服务器链接超时", toastStyle);
16
				}
17
			});
18
		}
19
		var LeaveWord = function() {
20
			var self = this;
21
			self.sid = module.sid;
22
			self.stype = module.stype;
23

24
			self.init({
25
				sid: self.sid,
26
				stype: self.stype,
27
				time: 0,
28
				id: 0,
29
				rows: 500
30
			});
31
			self.bindEvent();
32
			self.LwordTotal();
33
		}
34

35
		function lgin() {
36
			if(plus.storage.getItem('userid')) {
37
				return true;
38
			}
39
			mui.openWindow({
40
				url: '../html/login.html',
41
				id: '../html/login.html',
42
				show: {
43
					aniShow: "slide-in-bottom"
44
				},
45
				extras: {
46
					ourl: plus.webview.currentWebview().id
47
				}
48
			});
49
			return false;
50
		}
51
		LeaveWord.prototype.init = function(obj) {
52
			var self = this;
53
			ajaxRequist(baseUrl + "/ajax/leavemsg/subject", obj, "GET", function(data) {
54
				document.getElementsByClassName('commentBlock')[0].innerHTML = ""
55
				if(data.length == 0) {
56
					return;
57
				}
58
				var id = plus.storage.getItem('userid');
59
				for(var i = 0; i < data.length; i++) {
60
					var oText = "",
61
						reply = "",
62
						re = '<span class="replyLew" style="margin-right:10px;" data-id="' + data[i].id + '">回复</span>' + '<span class="mui-icon iconfont plusbtn icon-appreciate"style="padding-left:10px;margin-right:10px;font-size:14px;" data-id="' + data[i].id + '">' + data[i].agreeCount + '赞</span>';
63
					if(id == data[i].sender) {
64
						oText = "删除";
65
						re = "";
66
					}
67
					if(data[i].reciver) {
68
						reply = " 回复 " + "<span class='reply2'></span>"
69
					}
70
					var baImg = "../images/default-photo.jpg";
71
					var li = document.createElement("li");
72
					li.className = "mui-table-view-cell";
73
					li.innerHTML = '<div class="flexCenter mui-clearfix">' +
74
						'<div class="madiaHead useHead" style="background-image:url(' + baImg + ')" data-id="' + data[i].sender + '"></div>' +
75
						'<div class="madiaInfo">' +
76
						'<p><span class="replay1"></span>' + reply + '</p>' +
77
						'</div>' +
78
						'</div>' +
79
						'<div class="madiaInfo">' +
80
						'<p class="h2Font">' + data[i].cnt + '</p>' +
81
						'<p class="operateSpan">' +
82
						'<span class="commenttime">' + commenTime(data[i].createTime) + '</span>' + re +
83
						'<span data-id="' + data[i].id + '" class="dele">' + oText + '</span>' +
84
						'</p>' +
85
						'</div>'
86
					document.getElementsByClassName("commentBlock")[0].appendChild(li);
87
					if(data[i].reciver) {
88
						self.userInfo(data[i].sender, li, 1);
89
						self.userInfo(data[i].reciver, li, 2)
90
					} else {
91
						self.userInfo(data[i].sender, li, 1);
92
					}
93
					self.referThup(data[i].id, li);
94
				}
95
			})
96
		}
97
		LeaveWord.prototype.userInfo = function(uId, li, parNum) {
98
			ajaxRequist(baseUrl + "/ajax/professor/editBaseInfo/" + uId, {}, "GET", function($data) {
99
				if(parNum == 1) {
100
					if($data.hasHeadImage == 1) {
101
						li.getElementsByClassName("useHead")[0].style.backgroundImage = "url(" + baseUrl + "/images/head/" + $data.id + "_l.jpg" + ")";
102
					}
103
				}
104
				var userType = autho($data.authType, $data.orgAuth, $data.authStatus);
105
				var str = '<span class="h1Font" >' + $data.name + '</span><em class="authicon ' + userType.sty + '" title="科袖认证专家"></em>'
106
				if(parNum == 1) {
107
					li.getElementsByClassName("replay1")[0].innerHTML = str;
108
				} else {
109
					li.getElementsByClassName("reply2")[0].innerHTML = str;
110
				}
111
				if(li.getElementsByClassName("replyLew")[0])
112
				li.getElementsByClassName("replyLew")[0].setAttribute("name", "回复 " + $data.name + ":");
113
			})
114
		}
115
		LeaveWord.prototype.size = function() {
116
			if(document.getElementById("textInputThis").value.length > 200) {
117
				plus.nativeUI.toast("留言不得超过200个字", toastStyle);
118
				return false;
119
			}
120
			return true;
121
		}
122
		LeaveWord.prototype.topLw = function() {
123
			var self = this;
124
			if(!self.size) {
125
				return;
126
			}
127
			ajaxRequist(baseUrl + "/ajax/leavemsg", {
128
				cnt: document.getElementById("textInputThis").value,
129
				refId: self.sid,
130
				refType: self.stype,
131
				sender: plus.storage.getItem('userid'),
132
				uname: plus.storage.getItem('name')
133
			}, "POST", function() {
134
				document.getElementById("textInputThis").value = "";
135
				document.getElementById('textInput').style.display = "none";
136
				document.getElementById('operCol').style.display = "block";
137
				self.init({
138
					sid: self.sid,
139
					stype: self.stype,
140
					time: 0,
141
					id: 0,
142
					rows: 500
143
				});
144
			})
145
		}
146
		LeaveWord.prototype.bindEvent = function() {
147
			var self = this;
148
			document.getElementsByClassName("mui-btn")[0].addEventListener("tap", function() {
149
				if(!lgin()) {
150
					return;
151
				}
152
				if(document.getElementById("textInputThis").getAttribute("oid")) {
153
					self.replyLword(document.getElementById("textInputThis").getAttribute("oid"));
154
					return;
155
				}
156
				self.topLw();
157
			});
158
			mui(".commentBlock").on("tap", ".plusbtn", function() {
159
				if(!lgin()) {
160
					return;
161
				}
162
				self.thub.call(this, this.getAttribute("data-id"));
163
			})
164
			mui(".commentBlock").on("tap", ".replyLew", function() {
165
				if(!lgin()) {
166
					return;
167
				}
168
				var oid = this.getAttribute("data-id")
169
				document.getElementById("operCol").style.display = "none";
170
				document.getElementById("textInput").style.display = "block";
171
				document.getElementById("textInputThis").focus();
172
				document.getElementById("textInputThis").placeholder = this.getAttribute("name");
173
				document.getElementById("textInputThis").setAttribute("oid", oid);
174
				return false;
175
			})
176
			mui("body").on("tap", ".mui-content", function() {
177
				document.getElementById("textInput").style.display = "none";
178
				document.getElementById("operCol").style.display = "block";
179
				document.getElementById("textInputThis").placeholder = "说点什么吧...";
180
				if(document.getElementById("textInputThis").getAttribute("oid")) {
181
					document.getElementById("textInputThis").removeAttribute("oid")
182
				}
183
			})
184
			mui(".commentBlock").on("tap", ".dele", function() {
185
				self.LwordDel(this, this.getAttribute("data-id"));
186
			});
187
			mui(".artfoot").on("tap", ".inputShow", function() {
188
				if(!lgin()) {
189
					return;
190
				}
191
				document.getElementById("textInput").style.display = "block";
192
				document.getElementById("operCol").style.display = "none";
193
				document.getElementById("textInputThis").focus();
194
			})
195
		}
196
		LeaveWord.prototype.referThup = function(lid, li) {
197
			ajaxRequist(baseUrl + "/ajax/leavemsg/agree", {
198
				id: lid,
199
				uid: plus.storage.getItem('userid')
200
			}, "GET", function(data) {
201
				if(data) {
202
					li.getElementsByClassName("plusbtn")[0].classList.add("icon-appreciatefill");
203
				}
204
			})
205
		}
206
		LeaveWord.prototype.thub = function(lid) {
207
			var self = this;
208
			ajaxRequist(baseUrl + "/ajax/leavemsg/agree", {
209
				id: lid,
210
				uid: plus.storage.getItem('userid'),
211
				uname: plus.storage.getItem('name')
212
			}, "POST", function(data) {
213
				self.classList.add("icon-appreciatefill");
214
			})
215
		}
216
		LeaveWord.prototype.replyLword = function(lid) {
217
			var self = this;
218
			if(!self.size) {
219
				return;
220
			}
221
			ajaxRequist(baseUrl + "/ajax/leavemsg/reply", {
222
				cnt: document.getElementById("textInputThis").value,
223
				id: lid,
224
				uid: plus.storage.getItem('userid'),
225
				uname: plus.storage.getItem('name')
226
			}, "POST", function(data) {
227
				document.getElementById("textInputThis").value = "";
228
				document.getElementById('textInput').style.display = "none";
229
				document.getElementById('operCol').style.display = "block";
230
				document.getElementById("textInputThis").removeAttribute("replyLword");
231
				document.getElementById("textInputThis").placeholder = "说点什么吧...";
232
				self.init({
233
					sid: self.sid,
234
					stype: self.stype,
235
					time: 0,
236
					id: 0,
237
					rows: 500
238
				});
239
				self.LwordTotal();
240
			})
241
		}
242
		LeaveWord.prototype.LwordDel = function($this, lid) {
243
			var self = this;
244
			ajaxRequist(baseUrl + "/ajax/leavemsg/del", {
245
				id: lid
246
			}, "GET", function(data) {
247
				document.getElementsByClassName("commentBlock")[0].removeChild($this.parentNode.parentNode.parentNode);
248
				self.LwordTotal();
249
			})
250
		}
251
		LeaveWord.prototype.LwordTotal = function() {
252
			var self = this;
253
			ajaxRequist(baseUrl + "/ajax/leavemsg/count", {
254
				sid: self.sid,
255
				stype: self.stype
256
			}, "get", function($data) {
257
				if($data > 0) {
258
					document.getElementsByClassName('mui-badge')[0].innerHTML = $data;
259
				}
260
			})
261
		}
262

263
		var module = {
264
			lWord: function(sid, stype) {
265
				this.sid = sid;
266
				this.stype = stype;
267
				var lw = new LeaveWord();
268
			}
269
		}
270
		module.lWord(plus.webview.currentWebview().articleId, 1);
271
	})
272
})