Browse Source

留言修改

li 7 years ago
parent
commit
7916f4c7c2
1 changed files with 10 additions and 3 deletions
  1. 10 3
      app/js/leaveWords.js

+ 10 - 3
app/js/leaveWords.js

59
				for(var i = 0; i < data.length; i++) {
59
				for(var i = 0; i < data.length; i++) {
60
					var oText = "",
60
					var oText = "",
61
						reply = "",
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>';
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-num="' + data[i].agreeCount + '"></span><span  class="zan"style="display:'+(data[i].agreeCount?"inline-block":"none")+'">' + data[i].agreeCount + '  </span>';
63
					if(id == data[i].sender) {
63
					if(id == data[i].sender) {
64
						oText = "删除";
64
						oText = "删除";
65
						re = "";
65
						re = "";
90
					} else {
90
					} else {
91
						self.userInfo(data[i].sender, li, 1);
91
						self.userInfo(data[i].sender, li, 1);
92
					}
92
					}
93
					self.referThup(data[i].id, li);
93
					if(data[i].agreeCount)
94
					self.referThup(data[i].id, li,data[i].agreeCount);
94
				}
95
				}
95
			})
96
			})
96
		}
97
		}
159
				if(!lgin()) {
160
				if(!lgin()) {
160
					return;
161
					return;
161
				}
162
				}
163
				if(this.classList.contains('icon-appreciatefill')==true) {
164
					return;
165
				}
162
				self.thub.call(this, this.getAttribute("data-id"));
166
				self.thub.call(this, this.getAttribute("data-id"));
163
			})
167
			})
164
			mui(".commentBlock").on("tap", ".replyLew", function() {
168
			mui(".commentBlock").on("tap", ".replyLew", function() {
193
				document.getElementById("textInputThis").focus();
197
				document.getElementById("textInputThis").focus();
194
			})
198
			})
195
		}
199
		}
196
		LeaveWord.prototype.referThup = function(lid, li) {
200
		LeaveWord.prototype.referThup = function(lid, li,num) {
197
			ajaxRequist(baseUrl + "/ajax/leavemsg/agree", {
201
			ajaxRequist(baseUrl + "/ajax/leavemsg/agree", {
198
				id: lid,
202
				id: lid,
199
				uid: plus.storage.getItem('userid')
203
				uid: plus.storage.getItem('userid')
200
			}, "GET", function(data) {
204
			}, "GET", function(data) {
201
				if(data) {
205
				if(data) {
202
					li.getElementsByClassName("plusbtn")[0].classList.add("icon-appreciatefill");
206
					li.getElementsByClassName("plusbtn")[0].classList.add("icon-appreciatefill");
207
					li.getElementsByClassName("zan")[0].innerHTML="已赞" +num;
203
				}
208
				}
204
			})
209
			})
205
		}
210
		}
211
				uname: plus.storage.getItem('name')
216
				uname: plus.storage.getItem('name')
212
			}, "POST", function(data) {
217
			}, "POST", function(data) {
213
				self.classList.add("icon-appreciatefill");
218
				self.classList.add("icon-appreciatefill");
219
				self.nextElementSibling.innerHTML="已赞" +(Number(self.getAttribute("data-num"))+1);
220
				self.nextElementSibling.style.display="inline-block";
214
			})
221
			})
215
		}
222
		}
216
		LeaveWord.prototype.replyLword = function(lid) {
223
		LeaveWord.prototype.replyLword = function(lid) {