U.D.Blog.R.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. Namespace.register("U.MD.D.Blog.R"); //朋友圈评论
  2. //#region 评论
  3. //打印内容
  4. U.MD.D.Blog.R.PBPGBL = function (UDE, UDOD) {
  5. var i, _UDE = ["block", "none"], _UDCD = $(UDOD).childg(0).Child();
  6. if (!UDE && UDE["KZ"]) { _UDE.reverse(); } //取消
  7. else {//打印
  8. var i, _UTL, _UDTD, _UDFD = $$("frag"),
  9. _UDAD = $("div", _UDCD[0]),
  10. _UDID = U.UF.M.SetElement(UDE.ArticleContent, "img", "De"),
  11. UTH = _UDID[1].innerText; _UDCD[0].scrollTop = 0;
  12. _UDAD[16].innerText = _UDAD[2].innerText = _UDAD[8].innerText = "";
  13. _UDAD[5].innerText = UDE.UserNickName || UDE.UserName;
  14. _UDAD[6].innerText = U.UF.D.getDateInterval(UDE.ArticleAddTime);
  15. _UDAD[7].innerText = UTH || "图片分享";
  16. _UDAD.addAttrArray({ "innerText": (UDE.ArticleZFN === undefined ? UDE.AricitleReadNumber : UDE.ArticleZFN), "onclick": [[U.UF.M.StopBubble], [U.MD.D.Blog.A.PAZF, [UDE]]] }, 11);
  17. $$("img", { "onerror": U.UF.M.ImgError, "onclick": [[U.MD.U.I.ViewOtherUserInfo, [UDE.UserID]]], "src": U.UF.M.GetImgU(UDE.UserThumbnailImageHead), "title": "点击查看" }, _UDAD[2]); //用户头像
  18. //用户发表的图片展示 _UDID[0][i].onclick ||
  19. if ((_UTL = _UDID[0].length)) {
  20. for (i = 0; i < _UTL; i++) {
  21. $$("img", { "src": _UDID[0][i].src, "onclick": [[U.UF.M.StopBubble], [U.MD.I.Img, [UDE, [{ "Thm": _UDID[0][i].src, "Img": _UDID[0][i].alt.indexOf(US.FILESYSTEMURL) > -1 ? _UDID[0][i].alt : _UDID[0][i].src}]]]] }, _UDFD);
  22. } _UDAD[8].appendChild(_UDFD);
  23. }
  24. (_UDTD = _UDAD["UD_SYBNO"]).onclick = U.UF.M.apply(null, [[U.MD.D.Blog.R.FBHFRGBL, [UDE, _UDTD, null]]]);
  25. }
  26. for (i = 0; i < _UDE.length; i++) { _UDCD[i].style.display = _UDE[i]; } return _UDAD;
  27. }
  28. //滚动回复数据
  29. U.MD.D.Blog.R.GDHFRGBL = function (UDE, UDOD) {
  30. U.MD.D.Blog.R.HFRGBL(UDE, UDOD, this.P + 2);
  31. }
  32. //用户回复数据
  33. U.MD.D.Blog.R.HFRGBL = function (UDE, UDOD, P) {
  34. var _UDAD, _UGD = [undefined],
  35. _UET = U.MD.D.D.FYGBL(UDE.Reply, P),
  36. _UDTD = $(".UD_SYBAOO", UDOD)[0]; //获取回复数据
  37. if (_UET[0]) {
  38. _UDAD = $("div", _UDTD);
  39. (P == 1) && (_UDAD["UD_SYBF"].innerText = "", _UDAD[14].innerText = UDE["ArticleReplayNumber"] || 0);
  40. if (_UET[0].length > 0) {
  41. (P == 1) && (U.MD.D.Blog.R.PHFRGBLPL(_UET[0], _UDAD[16]), _UGD[0] = U.UF.M.SSCH({ 'AF': U.UF.M.apply(null, [[U.MD.D.Blog.R.GDHFRGBL, [UDE, UDOD]]]) }).SCH());
  42. U.MD.D.Blog.R.PHFRGBL(_UET[0], _UDAD["UD_SYBF"], null, UDE);
  43. } else { _UGD[0] = null; } (_UGD[0] !== undefined) && (_UDTD.onscroll = _UGD[0]);
  44. } //打印评论数据
  45. else {
  46. U.UF.A.Request(US.CROSSDOMAIN, [US.DB, "UseStudio_Blog", "UB_P_S_SelectArticleAllReply", UDE.ArticleID, (_UET[1] - 1) * 100, _UET[1] * 100]), U.MD.D.Blog.R.AsynHFRGBL, ["", UDE, UDOD, P, _UET[1]];
  47. // U.UF.A.Request(US.AUTH,"pb.ReplyList", [UDE.ArticleID, (_UET[1] - 1) * 100, _UET[1] * 100]), U.MD.D.Blog.R.AsynHFRGBL, ["", UDE, UDOD, P, _UET[1]];
  48. } //获取评论数据
  49. }
  50. //异步获取回复数据
  51. U.MD.D.Blog.R.AsynHFRGBL = function (r) {
  52. var i, context = r.context, _UDE = context[1], _UDOD = context[2], _UP = context[3], _UTP = context[4]; r = r.value; (_UDE.Reply == null) && (_UDE.Reply = []); _UDE.Reply[_UTP] = [];
  53. for (i = 0; i < r.length; i++) {
  54. if (!r[i].ReplyParentID) {
  55. _UDE.Reply[_UTP].push(r[i]);
  56. r[i]["RR"] = _$(r).Select({ "ReplyParentID": r[i].ReplyID });
  57. }
  58. }
  59. U.MD.D.Blog.R.HFRGBL(_UDE, _UDOD, _UP);
  60. }
  61. //打印评论好友
  62. U.MD.D.Blog.R.PHFRGBLPL = function (UDE, UDOD) {
  63. var i, _UET = {}, UDFD = $$("frag");
  64. for (i = 0; i < UDE.length; i++) { if (!_UET[UDE[i].ReplyAddUserID]) { $$("img", { "onerror": U.UF.M.ImgError, "src": U.UF.M.GetImgU(UDE[i].UserThumbnailImageHead), "title": UDE[i].UserNickName, "onclick": [[U.UF.M.StopBubble], [U.MD.U.I.ViewOtherUserInfo, [UDE[i].ReplyAddUserID]]] }, UDFD); _UET[UDE[i].ReplyAddUserID] = "Yes"; } }
  65. UDOD.appendChild(UDFD)
  66. }
  67. //打印回复数据
  68. U.MD.D.Blog.R.PHFRGBL = function (UDE, UDPD, TF, UAE, UPE) {
  69. var i, j, _UME, _UKE, _UDTD, _UDSD, _UDFD = $$("frag"); _UKE = UDE.length == 1 ? UAE["Reply"][1] : UDE
  70. for (i = 0; i < UDE.length; i++) {
  71. _UDTD = U.MD.D.Blog.R.YSPHFRGBL(UDE[i], _UDFD, UAE, UPE || UDE[i], UPE ? UDPD : null, _UKE); _UME = UDE[i]["RR"]; //打印回复
  72. for (j = 0; (_UME && j < _UME.length); j++) {
  73. U.MD.D.Blog.R.YSPHFRGBL(_UME[j], _UDTD, UAE, UDE[i], _UDTD, _UME);
  74. } //打印回复的回复
  75. }
  76. if (TF && UDPD.firstChild) { UDPD.insertBefore(_UDFD, UDPD.firstChild); } else { UDPD.appendChild(_UDFD); }
  77. }
  78. //样式使用
  79. U.MD.D.Blog.R.YSPHFRGBL = function (UDE, UDOD, UAE, UPE, UDMD, UME) {
  80. var _UDTD, _UDMD, _UDSD, _UDED, _UDGD, _UDJD, _UTF = UDE.ReplyAddUserID == US.userInfo.userid;
  81. _UDTD = $$("div", { "className": "UD_SYBFO" }, UDOD);
  82. _UDSD = $$("div", { "className": "UD_SYBFOI" }, _UDTD);
  83. $$("img", { "onerror": U.UF.M.ImgError, "title": UDE.UserNickName, "src": U.UF.M.GetImgU(UDE.UserThumbnailImageHead), "onclick": [[U.UF.M.StopBubble], [U.MD.U.I.ViewOtherUserInfo, [UDE.ReplyAddUserID]]] }, _UDSD);
  84. _UDED = $$("div", { "className": "UD_SYBFOZ" }, _UDTD);
  85. _UDGD = $$("div", { "className": "UD_SYBFOZK" }, _UDED);
  86. $$("div", { "className": "UD_SYBFOZTN", "innerHTML": UDE.UserNickName, "onclick": [[U.UF.M.StopBubble], [U.MD.U.I.ViewOtherUserInfo, [UDE.ReplyAddUserID]]] }, _UDGD);
  87. _UDJD = $$("div", { "className": "UD_SYBFOZTO" }, _UDGD);
  88. $$("div", { "className": "UD_SYBFOZT", "innerHTML": U.UF.D.getDateInterval(UDE.ReplyAddTime) }, _UDJD);
  89. _UDSD = $$("div", { "className": "UD_SYBFT" }, _UDTD);
  90. $$("div", { "className": "UD_SYBFOZTK" + (_UTF ? " UD_SYBFOZTKO" : ""), "title": _UTF ? "删除" : "回复", "innerHTML": _UTF ? "删除" : "回复", "onclick": _UTF ? [[U.UF.UI.Confirm, ["是否撤销评论", [U.MD.D.Blog.R.SCPHFRGBL, [UME, UDE, UAE, _UDTD]]]]] : [[U.MD.D.Blog.R.TCPHFRGBL, [UAE, _UDSD, UPE, UDMD]]] }, _UDJD);
  91. (UDE.ParentUserNickName) && ($$("div", { "className": "UD_SYBFOZKT", "innerHTML": "回复" }, _UDGD), $$("div", { "className": "UD_SYBFOZKO", "innerHTML": "@" + UDE.ParentUserNickName, "onclick": [[U.UF.M.StopBubble], [U.MD.U.I.ViewOtherUserInfo, [UDE.ParentUserId]]] }, _UDGD));
  92. $$("div", { "className": "UD_SYBFOZC UC_TF", "innerHTML": UDE.ReplyContent, "onselectstart": [[U.UF.M.StopBubble], [U.UF.M.apply(this, "return true")]] }, _UDED);
  93. return _UDSD;
  94. }
  95. //评论查看
  96. U.MD.D.Blog.R.PLCKBL = function (UDOD) {
  97. if (!U.MD.U.L.isLogin(3)) { U.UF.MR.InputTip(UDOD, ["发表回复...", ""]); } //发表回复
  98. else { UDOD = $($(UDOD).Parent(6)); U.MD.D.H.ET.DLHD = [U.UF.M.apply(UDOD, [[UDOD.addAttrArray, [{ "style": { "display": "block"}}]]])]; } //评论查看
  99. }
  100. //删除评论
  101. U.MD.D.Blog.R.SCPHFRGBL = function (UPE, UDE, UAE, UDOD) {
  102. if (!U.MD.U.L.isLogin(3)) {
  103. var _URID, _UAID, _UCB;
  104. if (U.UF.Ut.isString(UPE)) { _URID = UPE; _UAID = UDE || US.EMPTYGUID; _UCB = UAE; }
  105. else {
  106. UPE.splice(UPE.indexOf(UDE), 1);
  107. $("#UD_SYBK&div")[4].innerText -= 1 + (UDE["RR"] ? UDE["RR"].length : 0);
  108. $(UDOD).remove();
  109. _URID = UDE.ReplyID;
  110. _UAID = UAE.ArticleID;
  111. } //移除评论 //移除元素 //评论数-1
  112. U.UF.A.Request(US.CROSSDOMAIN, [US.DB, "UseStudio_Blog", "UB_P_D_DeleteOneReplyAndAllChildReply", US.userInfo.userid, _URID, _UAID || US.EMPTYGUID]), _UCB || U.UF.M.apply, [""]; //服务器同步
  113. // U.UF.A.Request(US.AUTH,"pb.DeleteOneReplyAndChildReply", [US.userInfo.userid, _URID, UAID || US.EMPTYGUID]), _UCB || U.UF.M.apply, [""]; //服务器同步
  114. }
  115. }
  116. //弹出回复的回复框
  117. U.MD.D.Blog.R.TCPHFRGBL = function (UAE, UDOD, UPE, UDMD) {
  118. if (!U.MD.U.L.isLogin(3)) {
  119. var _UDAD, _UDTD = $("#UD_SYBNK")[0];
  120. if (!_UDTD) {
  121. _UDTD = $("#UD_SYBN")[0].parentNode.cloneNode(true);
  122. _UDTD.id = "UD_SYBNK"; $(_UDTD).Child()[0].onblur = U.MD.D.Blog.R.YCTCPHFRGBL;
  123. };
  124. $($(_UDTD).Child()[0]).addAttrArray({ "id": "", "innerHTML": "" });
  125. _UDTD.style.display = "block";
  126. _UDAD = $(_UDTD).Child();
  127. _UDAD[1].onclick = U.UF.M.apply(this, [[U.MD.D.Blog.R.FBHFRGBL, [UAE, _UDAD[1], UPE, _UDTD, UDMD]]]); UDOD.insertBefore(_UDTD, UDOD.firstChild);
  128. _UDAD[0].focus();
  129. }
  130. }
  131. //移除评论框
  132. U.MD.D.Blog.R.YCTCPHFRGBL = function () {
  133. var _UDTD = $(this.parentNode);
  134. setTimeout(U.UF.M.apply(_UDTD, [[_UDTD.addAttrArray, [{ "style": { "display": "none"}}]]]), 500); //延迟执行
  135. }
  136. //发表评论
  137. U.MD.D.Blog.R.FBHFRGBL = function (UAE, UDOD, UPE, UDTD, UDMD) {
  138. var _UDED = U.UF.M.GTCN(UDOD.parentNode.childNodes)[0], _UHT = _UDED.innerHTML;
  139. if (_UHT != "发表回复..." && _UHT != "") {
  140. U.UF.A.Request(US.AUTH, ["ReportReply", UAE.ArticleID, _UDED.innerHTML, UPE ? (UPE.ReplyParentID || UPE.ReplyID) : "", UPE ? UPE.ReplyAddUserID : ""]), U.MD.D.Blog.R.AsynFBHFRGBL, ["", UAE, _UDED.innerHTML, UPE, UDTD, UDMD];
  141. (UDTD) && (UDTD.style.display = "none"); _UDED.innerText = "发表回复..."; U.Alert("正在发送中...");
  142. }
  143. }
  144. //添加回复
  145. U.MD.D.Blog.R.TJFBHFRG = function (UAID, UTH) {
  146. if (!U.MD.U.L.isLogin(3)) {
  147. var _UCB, _UPID = "",
  148. _UUID = "", _UDE = arguments;
  149. if (_UDE.length < 4) { _UCB = _UDE[2]; }
  150. else {
  151. _UPID = _UDE[3]; _UUID = _UDE[4]; _UCB = _UDE[5];
  152. }
  153. U.UF.A.Request(US.AUTH, ["ReportReply", US.userInfo.userid, UAID, UTH, _UPID, _UUID], U.MD.D.Blog.R.AsynTJFBHFRG, ["", _UCB]); //添加回复到后台
  154. }
  155. }
  156. //添加回复异步
  157. U.MD.D.Blog.R.AsynTJFBHFRG = function (r) {
  158. var context = r.context,
  159. _UCB = context[1];
  160. r = r.value; (_UCB) && (_UCB(r));
  161. }
  162. //发表评论成功异步
  163. U.MD.D.Blog.R.AsynFBHFRGBL = function (reuqest) {
  164. var _UKE, _UME, UPE, _UTH, _UAE, _UDOD, _UDMD, _UDP;
  165. context = reuqest.context;
  166. reuqest = reuqest.value;
  167. _UAE = context[1];
  168. _UTH = context[2];
  169. UPE = context[3];
  170. _UDOD = context[4];
  171. _UDMD = context[5];
  172. _UDPD = $("#UD_SYB" + _UAE.ArticleID).find("div")["UD_SYBF"];
  173. (_UKE = (UPE ? UPE["RR"] : _UAE["Reply"][1])).unshift((_UME = new U.MD.D.Blog.R.FRGBLET[_UKE[0] ? (_UKE[0].AllCount + 1) : 1, UPE ? UPE.UserNickName : "", U.UF.D.toTimeStamp(new Date()), US.userInfo.userid, _UTH, reuqest, UPE ? UPE.ReplyID : "", UPE ? UPE.ReplyAddUserID : "", US.userInfo.UserNickName, US.userInfo.UserThumbnailImageHead])); //添加新的类
  174. (!UPE) && (_UME["RR"] = []);
  175. U.MD.D.Blog.R.PHFRGBL([_UME], (UPE ? (_UDMD || _UDOD.parentNode) : _UDPD), true, _UAE, UPE);
  176. $("div", _UDPD.parentNode)[14].innerText = _UME.AllCount; //添加回复
  177. }
  178. //回复的实体
  179. U.MD.D.Blog.R.FRGBLET = function (UDE) {
  180. var i = UDE.length, _UET = ["AllCount", "ParentUserNickName", "ReplyAddTime", "ReplyAddUserID", "ReplyContent", "ReplyID", "ReplyParentID", "ReplyVerifyUserID", "UserNickName", "UserThumbnailImageHead"]
  181. while (i--) { this[_UET[i]] = UDE[i] }
  182. }
  183. //展开缩小消息发送
  184. U.MD.D.Blog.R.SGBL = function (UDOD, TF) {
  185. var _UDPD = UDOD.parentNode, _UDE = ["block", { "width": "310px", "height": "25px" }, "none", "UD_SYSXZLRSSV UD_SYI"], _UDAD = $(_UDPD).Child(), _UDCD = $("div", _UDAD[1]); UDOD = $(UDOD);
  186. (TF) && (_UDE[0] = "none", _UDE[1] = { "width": "100%", "height": "100px" }, _UDE[2] = "block", _UDE[3] = "UD_SYSXZLRSSVA");
  187. UDOD.addAttrArray({ "style": _UDE[1] }); _UDAD[1].className = _UDE[3]; _UDCD[0].style.display = _UDE[2]; //U.MD.D.H.DTGBL(_UDCD[1], true);
  188. }
  189. //#endregion