//点击发送发表新评论
sendComment(needid,bywhostu,towho);
//评论回复
mui('#messagecontainer').on('tap','.msgreply',function(){
//打开蒙板
var mask=mui.createMask(function(){
document.getElementById("replyto").innerHTML='';
});
mask.show();
//填充收件人昵称
var replycontainer=document.getElementById("replycontainer");
var replytowho=this.getAttribute('data-towho');
html="<div class='replyto' id='replyto'>@"+replytowho+"</div>";
replycontainer.insertAdjacentHTML('afterBegin',html);
//点击发送评论回复
sendComment(needid,bywhostu,replytowho);
});
评论回复和评论使用同样的写入函数,在评论回复的时候,总是会同时调用发布新评论。
每次都会产生2条同样,对象不同的评论回复。
求大大神指导。怎么阻止全局中函数的执行。
感觉把逻辑拆分一下比较好,由前端来实现【发送评论】的基本逻辑, 后端来实现具体的【评论处理】