BlogMessage.js 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. Namespace.register("U.MD.D.Blog.N"); //消息信息朋友圈
  2. //#region 登录pbblog消息查看区域
  3. //消息察看区域
  4. U.MD.D.Blog.N.PNXX = function () {
  5. var _UEL, _UBE, _UPE, _UKE, _UDAD, _UDMD, _UDE = US.forum.news[0], _UDOD = $("#UD_TBCMOF");
  6. if (_UDOD[0]) {
  7. _UDAD = _UDOD.Child(); _UDMD = $(_UDAD[2]).Child()[1];
  8. if ((_UEL = _UDAD[1].innerHTML = _UDE.length)) { //判断是否有消息通知
  9. U.MD.D.Blog.N.PNWB(_UDE);
  10. _UBE = U.Json.select(_UDE, { "NF": null });
  11. _UPE = U.Json.select(_UDE, { "NF": US.FORUMROOTID });
  12. _UKE = U.Json.select(_UDE, { "NF": US.EMPTYGUID }); //朋友圈消息 pb消息 申请消息
  13. if (_UBE.length) {
  14. U.MD.D.Blog.N.PNSXX(_UBE, _UDMD);
  15. }
  16. if (_UPE.length || _UKE.length) {
  17. U.MD.D.Blog.N.BNXX(_UPE, _UDMD);
  18. U.MD.D.Blog.N.SQBNXX(_UKE, _UDAD[1]);
  19. }
  20. }
  21. _UDAD[2].style.display = _UEL ? "block" : "none";
  22. }
  23. }
  24. //查看详细消息
  25. U.MD.D.Blog.N.PNXXD = function () {
  26. }
  27. //发送消息在客户端
  28. U.MD.D.Blog.N.PNWB = function (UDE) {
  29. var i, _UET, _UCE = [];
  30. for (i = 0; i < UDE.length; i++) {
  31. _UCE.push({ "UsParamet": [UDE[i].NF, UDE[i].ArticleID, UDE[i].ReplyID],
  32. "UsImag": U.MD.C.getHeadImage(UDE[i].UserThumbnailImageHead),
  33. "UsName": UDE[i].UserName,
  34. "UsType": "UPBR",
  35. "UsSYScontent": UDE[i].ReplyContent
  36. });
  37. }
  38. if ((_UET = window.external)) {
  39. try {
  40. window.external.news(U.UF.C.jsonToStr(_UCE));
  41. }
  42. catch (e) {
  43. }
  44. }
  45. }
  46. //查看PB数据
  47. U.MD.D.Blog.N.BNXX = function (UDE, UDOD) {
  48. var i, _UDTD, _UDID, _UDSD, _UDED, _UDWD,
  49. _UEL = UDE.length,
  50. _UDFD = $$("frag");
  51. $(UDOD).addAttrArray({ "style": { "display": "block" }, "innerText": "" });
  52. for (i = 0; i < _UEL; i++) {
  53. UDE[i].PublishedDirectoryID = UDE[i].NF;
  54. _UDTD = $$("div",
  55. {
  56. "className": "UD_SYXTXOOT",
  57. "onclick": function () {
  58. U.UF.EV.stopBubble();
  59. U.MD.D.PB.A.WAPMHBK(UDE[i]);
  60. U.MD.D.Blog.N.SNXX(UDE[i].ArticleID, UDE, this);
  61. },
  62. "title": UDE[i].ArticleTitle
  63. },
  64. _UDFD);
  65. _UDID = $$("div",{"className": "UD_SYXTXOOTL"},_UDTD);
  66. $$("img",
  67. { "onerror": U.MD.C.imgError,
  68. "title": "点击查看",
  69. "src": U.MD.C.getHeadImage(UDE[i].UserThumbnailImageHead)
  70. },
  71. _UDID); //U.MD.D.Blog.F.GSHGBL
  72. _UDSD = $$("div",{"className": "UD_SYXTXOOTR UTDF"},_UDTD);
  73. _UDED = $$("div",{"className": "UD_SYXTXOOTRS"},_UDSD);
  74. $$("div",{"className": "UD_SYXTXOOTRSN UTDF","innerHTML": UDE[i].UserName},_UDED);
  75. _UDWD = $$("div",{"className": "UD_SYXTXOOTRSC UTDF","innerHTML": UDE[i].ArticleContentBrief},_UDED);
  76. _UDWD.innerText = _UDWD.innerText.trim();
  77. _UDWD = $$("div",{"className": "UD_SYXTXOOTRX UTDF","innerHTML": UDE[i].ReplyContent},_UDSD);
  78. _UDWD.innerText = _UDWD.innerText.trim();
  79. $$("div",{"className": "UD_SYSSRXOMS UD_SYXTXOOTC","innerHTML": "查看"},_UDTD);
  80. }
  81. UDOD.appendChild(_UDFD);
  82. }
  83. //查看pb申请版块消息
  84. U.MD.D.Blog.N.SQBNXX = function (UDE, UDOD) {
  85. var _UTF, _UDTD, _UDFD = $$("frag");
  86. for (i = 0; i < UDE.length; i++) {
  87. _UTF = function () {
  88. U.UF.EV.stopBubble();
  89. U.MD.D.Blog.N.SNXX(UDE[i].ArticleID, UDE, this);
  90. };
  91. if (UDE[i].ArticleTitle != "0") {
  92. //#error
  93. // _UTF = function(){U.MD.D.PB.DJPBCKMU({ "ArticleID": "", "PublishedDirectoryID": UDE[i].ArticleID }, null, [U.MD.D.H.HDSY, [["block", "none"], [false("block", "none", false]]]) ;}.concat(_UTF));
  94. }
  95. _UDTD = $$("div",
  96. {
  97. "className": "UD_SYXTXOOO",
  98. "onclick": _UTF
  99. },
  100. _UDFD);
  101. $$("div",{"className": "UD_SYXTXOOOL U_Boom_Img_ys2017"},_UDTD);
  102. $$("div",{"className": "UD_SYXTXOOOZ","innerHTML": "您申请的版块 \"<span>" + UDE[i].ArticleContentBrief + "</span>\" " + UDE[i].ReplyContent},_UDTD);
  103. $$("div",
  104. {
  105. "className": "UD_SYXTXOOOR" + (_UTF ? " UD_SYXTXOOORO" : ""),
  106. "innerHTML": _UTF ? "关闭" : "查看",
  107. "onclick": _UTF ? function () {
  108. U.UF.EV.stopBubble();
  109. U.MD.D.Blog.N.SNXX(UDE[i].ArticleID, UDE, _UDTD);
  110. } : null
  111. },
  112. _UDTD);
  113. }
  114. UDOD.appendChild(_UDFD);
  115. }
  116. //查看Blog消息到上面区域
  117. U.MD.D.Blog.N.PNSXX = function (UDE, UDOD) {
  118. var i, _UDTD, _UDSD,
  119. _UDFD = $$("frag");
  120. $(UDOD).addAttrArray({ "style": { "display": "block" }, "innerText": "" });
  121. for (i = 0; i < UDE.length; i++) {
  122. _UDTD = $$("div",
  123. {
  124. "className": "UD_SYSXZLRSRA",
  125. "style": i ? {} : {
  126. "marginLeft": "0px"
  127. },
  128. "title": UDE[i].UserName,
  129. "onclick": function () {
  130. U.UF.EV.stopBubble();
  131. U.MD.D.Blog.F.GSHGBL(UDE[i]);
  132. U.MD.D.Blog.N.SNXX(UDE[i].ArticleID, UDE, this);
  133. }
  134. },
  135. _UDFD);
  136. _UDSD = $$("div",{"className": "UD_SYSXZLRSRAI"},_UDTD);
  137. $$("img",
  138. {
  139. "onerror": U.MD.C.imgError,
  140. "src": U.MD.C.getHeadImage(UDE[i].UserThumbnailImageHead)
  141. },
  142. _UDSD);
  143. $$("div",{"className": "UD_SYSXZLRSRAT U_Boom_Img_ys2017","innerHTML": UDE[i].UCN},_UDTD);
  144. }
  145. UDOD.appendChild(_UDFD);
  146. }
  147. //消息太多打印下面区域
  148. U.MD.D.Blog.N.PNXXX = function (UDOD, UDE) {
  149. var i, _UDOD, _UDTD, _UDGD, _UDID, _UDFD = $$("frag"); UDOD.innerText = "";
  150. for (i = 0; i < UDE.length; i++) {
  151. _UDOD = $$("div",
  152. {
  153. "className": "UD_SYSXZLRSROO",
  154. "onclick": function () {
  155. U.UF.EV.stopBubble();
  156. U.MD.D.Blog.F.GSHGBL(UDE[i]);
  157. U.MD.D.Blog.N.SNXX(UDE[i].ArticleID, UDE, this);
  158. }
  159. },
  160. _UDFD);
  161. _UDTD = $$("div",{"className": "UD_SYSXZLRSROOL"},_UDOD);
  162. $$("img",
  163. {
  164. "onerror": U.MD.C.imgError,
  165. "title": "点击查看",
  166. "src": U.MD.C.getHeadImage(UDE[i].UserThumbnailImageHead),
  167. "onclick": function () {
  168. U.UF.EV.stopBubble();
  169. U.MD.U.V.ViewOtherUserInfo(UDE[i].ReplyAddUserID);
  170. }
  171. },
  172. _UDTD);
  173. _UDGD = $$("div",{"className": "UD_SYSXZLRSROOR"},_UDOD);
  174. _UDID = $$("div",{"className": "UD_SYSXZLRSROORS"},_UDGD);
  175. $$("div",{"className": "UD_SYSXZLRSROORSN","innerHTML": UDE[i].UserName},_UDID);
  176. $$("div",{"className": "UD_SYSXZLRSROORSN","innerHTML": U.UF.D.getDateInterval(UDE[i].ReplyAddTime)},_UDID);
  177. $$("div",{"className": "UD_SYSXZLRSROORX","innerHTML": UDE[i].ReplyContent},_UDGD);
  178. }
  179. UDOD.appendChild(_UDFD);
  180. }
  181. //消息取消
  182. U.MD.D.Blog.N.SNXX = function (UMID, UDE, UDOD) {
  183. var i,
  184. _UBE = US.forum.news[0],
  185. _UMID = UMID || U.Json.toKeyArray(UDE, "ArticleID"),
  186. UDPD = UDOD ? UDOD.parentNode : ""; (UMID) && (_UMID = [_UMID]);
  187. for (i = 0; i < _UMID.length; i++) { //移除消息的ID
  188. U.Json.del([UDE, _UBE], { "ArticleID": _UMID[i] });
  189. };
  190. _UMID = _UMID.join(",");
  191. if (UMID && UDOD) { //移除消息
  192. if (UDE.length) {
  193. $(UDOD).remove();
  194. }
  195. else {
  196. UDOD = UDOD.parentNode; UDPD = UDOD.parentNode;
  197. };
  198. }
  199. if (!UMID || !UDE.length) { UDOD && (UDOD.innerText = "", UDPD.style.display = "none") }; //所有消息消除
  200. U.MD.D.Blog.N.PNXX();
  201. U.A.Request(US.CD, [US.DB, "UseStudio_Blog", "UB_B_U_ModifyOneNewsState", _UMID, 0, 1, 2], function () { }, []); //重新打印消息 //将未读消息设为已读
  202. }
  203. //#endregion