Browse Source

问答留言问题

luyanan 7 years ago
parent
commit
232c3a1f42
3 changed files with 15 additions and 46 deletions
  1. 7 13
      js/answerLeaveW.js
  2. 4 22
      js/informLeaveW.js
  3. 4 11
      js/leaveWord.js

+ 7 - 13
js/answerLeaveW.js

@ -68,6 +68,8 @@
68 68
						time:data[data.length-1].createTime,
69 69
						id:data[data.length-1].id
70 70
					})
71
				}else{
72
					$strer.find(".js-load-more").addClass("displayNone")
71 73
				}
72 74
			}else{
73 75
				if(data.length>4){
@ -100,7 +102,7 @@
100 102
				if(data[i].reciver) {
101 103
					reply = '<span class="huifu">回复 </span><a href="userInforShow.html?professorId='+data[i].reciver+'" class="userhref"><span class="h2Font messageName">张某某</span><em class="authiconNew" title="科袖认证专家"></em></a>'
102 104
				}
103
				var itemlist = '<li>';
105
				var itemlist = '<li class="li-item">';
104 106
				itemlist += '<a href class="userhref"> <div class="madiaHead useHead useHeadMsg"></div></a>';
105 107
				itemlist += '<div class="madiaInfo">';
106 108
				itemlist += '<p><a href="userInforShow.html?professorId='+data[i].sender+'" class="userhref"><span class="h2Font messageName">张某某</span></a><em class="authiconNew" title="科袖认证专家"></em>'+reply+'<span class="commenttime" style="float:right;">'+commenTime(data[i].createTime)+'</span></p>';
@ -165,21 +167,12 @@
165 167
            beforeSend: function() {
166 168
            	$(".list-hold-list .ifLoginOn input").attr("disabled","true");
167 169
            },
168
            complete:function () {
169
                $(".list-hold-list").on('click',".ifLogin input",function() {
170
                    if(!lgin()) {
171
                        return;
172
                    }
173
                    self.topLw(this);
174
                    self.LwordTotal($(this),$(this).data("ouse"));
175
                });
176
            },
177 170
            traditional: true,
178 171
            success: function (data) {
179 172
                if (data.success) {
180 173
                    $($this).siblings(".msgContbox").find("textarea").val("").siblings(".msgconNum").find("em").text(0);
181 174
                    ajaxRequist("/ajax/leavemsg/qo", {id: data.data}, "GET", function (data) {
182
                        self.topHtml($($this).parents(".ifLogin").siblings(".commentsArea").find("ul"), data)
175
                        self.topHtml($($this).parents(".ifLogin").siblings(".commentsArea").find("ul"), [data])
183 176
                    })
184 177
                }
185 178
            }
@ -279,14 +272,15 @@
279 272
		})
280 273
	}
281 274
	LeaveWord.prototype.LwordDel = function($this, lid) {
282
		
283 275
		var self = this;
284 276
		ajaxRequist("/ajax/leavemsg/del", {
285 277
			id: lid.id
286 278
		}, "GET", function(data) {
287 279
			self.LwordTotal($($this).parents(".commentList"),{sid:lid.refId,stype:lid.refType});
288
			$($this).parents(".flexCenter").remove();
280
			$($this).parents(".li-item").remove();
281
			
289 282
		})
283
		
290 284
	}
291 285
	LeaveWord.prototype.LwordBack = function($this, lid) {
292 286
		$(".replyLeword").each(function(item){

+ 4 - 22
js/informLeaveW.js

@ -53,7 +53,7 @@
53 53
				if(data[i].state =="0") {
54 54
					data[i].cnt="该留言已被其本人删除。";
55 55
				}
56
				var itemlist = '<li>';
56
				var itemlist = '<li class="li-item">';
57 57
				itemlist += '<a class="madiaHead useHead useHeadMsg userhref" href="userInforShow.html?professorId=' + data[i].sender + '"></a>';
58 58
				itemlist += '<div class="madiaInfo">';
59 59
				itemlist += '<p><a href="userInforShow.html?professorId=' + data[i].sender + '" class="userhref"><span class="h2Font messageName">张某某</span><em class="authiconNew" title="科袖认证专家"></em></a>' + reply + '<span class="commenttime" style="float:right;">' + commenTime(data[i].createTime) + '</span></p>';
@ -188,28 +188,10 @@
188 188
            dataType: 'json',
189 189
            type: "POST",
190 190
            beforeSend: function() {
191
               $(".list-hold-list .ifLoginOn input").attr("disabled","true");
191
               $($th).attr("disabled","true");
192 192
            },
193 193
            complete:function () {
194
//				$(".commentList").on("click", "li", function(e) {
195
//					if(!lgin()) {
196
//						return;
197
//					}
198
//					var obj=JSON.parse($(this).attr("data-obj")),
199
//					target=e.target;
200
//					switch (target.className){
201
//						case "dzthumb dzthumbCan":self.thub.call(target, obj.id,obj.agreeCount);
202
//							break;
203
//						case "callBack":self.LwordBack(target, obj);
204
//							break;
205
//						case "messageDel":self.LwordDel(target, obj.id);
206
//							break;
207
//						case "hReply btnModel":self.replyLword(target,obj.id)
208
//							break;
209
//						case "qCancel": $(target).parent().siblings("textarea").val("").parents(".replyLeword").addClass("displayNone").siblings(".operateSpan").removeClass("displayNone")
210
//							break;
211
//					}
212
//				});
194

213 195
            },
214 196
            traditional: true,
215 197
            success: function (data) {
@ -228,7 +210,7 @@
228 210
		ajaxRequist("/ajax/leavemsg/del", {
229 211
			id: lid
230 212
		}, "GET", function(data) {
231
			$($this).parents("li").remove();
213
			$($this).parents(".li-item").remove();
232 214
		})
233 215
	}
234 216
	LeaveWord.prototype.LwordBack = function($this, lid) {

+ 4 - 11
js/leaveWord.js

@ -59,7 +59,7 @@
59 59
				if(data[i].reciver) {
60 60
					reply = '<span class="huifu">回复 </span><a href="userInforShow.html?professorId='+data[i].reciver+'" class="userhref"><span class="h2Font messageName">张某某</span><em class="authiconNew" title="科袖认证专家"></em></a>'
61 61
				}
62
				var itemlist = '<li>';
62
				var itemlist = '<li class="li-item">';
63 63
				itemlist += '<a href class="userhref"> <div class="madiaHead useHead useHeadMsg"></div></a>';
64 64
				itemlist += '<div class="madiaInfo">';
65 65
				itemlist += '<p><a href="userInforShow.html?professorId='+data[i].sender+'" class="userhref"><span class="h2Font messageName">张某某</span><em class="authiconNew" title="科袖认证专家"></em></a>'+reply+'<span class="commenttime" style="float:right;">'+commenTime(data[i].createTime)+'</span></p>';
@ -125,16 +125,9 @@
125 125
            dataType: 'json',
126 126
            type: "POST",
127 127
            beforeSend: function() {
128
            	$(".list-hold-list .ifLoginOn input").attr("disabled","true");
129
            },
130
            complete:function () {
131
                $("#meSendtt").click(function() {
132
                    if(!lgin()) {
133
                        return;
134
                    }
135
                    self.topLw();
136
                });
128
            	$(".commentList").parent().siblings(".ifLogin").find(" .ifLoginOn input").attr("disabled","true");
137 129
            },
130
            
138 131
            traditional: true,
139 132
            success: function (data) {
140 133
                if (data.success) {
@ -258,7 +251,7 @@
258 251
		ajaxRequist("/ajax/leavemsg/del", {
259 252
			id: lid
260 253
		}, "GET", function(data) {
261
			$($this).parents("li").remove();
254
			$($this).parents(".li-item").remove();
262 255
			self.LwordTotal();
263 256
		})
264 257
	}