U.D.Blog.A.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. Namespace.register("U.D.Blog.A");
  2. //Blog帖子处理
  3. //#region 朋友圈发表
  4. //blog首页点击我要发布
  5. U.D.Blog.A.FBCKME = function () {
  6. U.U.L.SYDLHD(U.M.apply(null, [[U.UI.EditorLoad, ([{
  7. imgt: 9,
  8. style: {
  9. width: "600px",
  10. height: "500px"
  11. },
  12. title: false,
  13. name: "朋友圈",
  14. car: {
  15. onpaste: "U.D.SY.CPTATGBL(this);"
  16. },
  17. fcb: U.D.Blog.A.FBGBL,
  18. upload: true
  19. }])]]));
  20. }
  21. //发帖子变化
  22. U.D.Blog.A.BHFBGBL = function (UDOD, UTF) {
  23. if (!UTF || !U.U.L.DLTC(3)) {
  24. var i, j, _UDTD, _UDAD, _UMT = UTF ? "removeClass" : "addClass", _UDE = ["UD_SYSXZLRSAAO", "UD_SYSXZLRSAOO", "UD_SYSXZLRSATO"];
  25. UDOD = UDOD.length ? UDOD : [UDOD];
  26. for (i = 0; i < UDOD.length; i++) {
  27. _UDAD = (_UDTD = U.selectEl(UDOD[i])).Child();
  28. _UDTD[_UMT](_UDE[0], 0);
  29. for (j = 1; j < _UDAD.length; j++) {
  30. U.selectEl(_UDAD[j])[_UMT](_UDE[j]);
  31. }
  32. ; (UTF) && (_UDAD[1].focus());
  33. }
  34. }
  35. }
  36. //发表文章字限制
  37. U.D.Blog.A.OKFBGBL = function (UDOD) {
  38. var _UHT = UDOD.innerText;
  39. if (!_UHT.SubstrN(300)) {
  40. U.M.StopDefault();
  41. U.Alert("文字输入无法大于150");
  42. }
  43. //阻止输出
  44. }
  45. //发表文章
  46. U.D.Blog.A.FBGBL = function (UCT, UTI, UIMG) {
  47. var i;
  48. UCT = UCT.SubstrU(300);
  49. if (UIMG) {
  50. for (i = 0; i < UIMG.length; i++) {
  51. UCT += UIMG[i].outerHTML;
  52. }
  53. }
  54. //添加图片
  55. U.Alert("发表中...");
  56. U.A.Request("pb.addArticle", ([US.PID, "", UCT, "blog"]), U.D.Blog.A.AsynFBGBL, (["", UCT]));
  57. //发送文章
  58. }
  59. //发表文章异步
  60. U.D.Blog.A.AsynFBGBL = function (request) {
  61. var _UDE, _UKE, _UDTD, _UDOD = U.selectEl("#UD_SYSXZBR")[0], _UID = US.userInfo.userid, context = request.context;
  62. request = request.value;
  63. if (request) {
  64. _UDE = U.D.Blog.A.BLEI([request, 0, 0, U.MT.SetDT(new Date()), context[1], context[1].substr(0, 100), US.userInfo.userid, US.userInfo.username, US.userInfo.UserThumbnailImageHead, 0]);
  65. //添加实体
  66. _UKE = U.D.SY.ET["UL"]["HY"][_UID];
  67. (_UKE && (_UKE = _UKE[1])) && ((!_UKE.length) && (_UDOD.innerText = ""),
  68. _UKE.push(_UDE));
  69. U.D.Blog.PGBL(_UDOD, [_UDE], null, 0, true);
  70. U.Alert("成功发表");
  71. }
  72. }
  73. //朋友圈的实体
  74. U.D.Blog.A.BLEI = function (UTE) {
  75. var i, _UDE = ["ArticleID", "AricitleReadNumber", "ArticleReplayNumber", "ArticleAddTime", "ArticleContent", "ArticleContentBrief", "UserID", "UserName", "UserThumbnailImageHead", "ArticleZFN"];
  76. return _$().NL(_UDE, UTE);
  77. }
  78. //#endregion
  79. //#region 转发朋友圈
  80. //转发朋友圈
  81. U.D.Blog.A.PAZF = function (UDE, UDMD) {
  82. if (U.U.L.DLTC(3)) {
  83. var _UDTD, _UDSD, _UDOD = U.selectEl("#UD_SYR"), _UDAD = _UDOD.Child()
  84. _UDOD.css("display", "block");
  85. U.UI.Form({
  86. draw: false,
  87. max: false,
  88. id: "UD_SYRA",
  89. title: "<div class='UD_SYF_STI'>转发使用</div>",
  90. content: _UDOD[0],
  91. style: {
  92. width: "500px",
  93. height: "360px"
  94. },
  95. hst: {
  96. style: {
  97. padding: "0"
  98. }
  99. }
  100. }).be;
  101. (_UDSD = U.selectEl("div", _UDAD[1])[0]).innerHTML = "可添加内容...";
  102. U.D.Blog.A.PAZFP(UDE, _UDAD[2]);
  103. (_UDTD = U.selectEl(_UDAD[3]).Child())[1].onclick = U.M.apply(_UDTD, [[U.D.Blog.A.SPAZFF, ([UDE, _UDSD, UDMD])], [_UDTD[0].onclick]]);
  104. _UDSD.focus();
  105. }
  106. }
  107. //打印
  108. U.D.Blog.A.PAZFP = function (UDE, UDOD) {
  109. UDOD.innerHTML = "";
  110. var _UTC, _UDSD, _UDMD, _UDTD = $$("div", {
  111. "className": "UD_SYRML"
  112. }, UDOD);
  113. $$("img", {
  114. "onerror": U.M.ImgError,
  115. "title": "点击查看",
  116. "onclick": [[U.M.StopBubble], [U.U.I.UIFZX, ([UDE.UserID])]],
  117. "src": U.M.GetImgU(UDE.UserThumbnailImageHead)
  118. }, _UDTD);
  119. _UDTD = $$("div", {
  120. "className": "UD_SYRMR"
  121. }, UDOD);
  122. _UDSD = $$("div", {
  123. "className": "UD_SYRMRS"
  124. }, _UDTD);
  125. $$("div", {
  126. "className": "UD_SYRMRSL",
  127. "innerHTML": UDE.UserNickName || UDE.UserName
  128. }, _UDSD);
  129. $$("div", {
  130. "className": "UD_SYRMRSR",
  131. "innerHTML": U.MT.getTDInterval(UDE.ArticleAddTime)
  132. }, _UDSD);
  133. _UDSD = $$("div", {
  134. "className": "UD_SYRMRX",
  135. "innerHTML": (_UTC = UDE["ArticleContentBrief"])
  136. }, _UDTD);
  137. _UDSD.innerText = (_UTC = _UDSD.innerText).length > 30 ? _UTC.substr(0, 50) + "..." : _UTC
  138. }
  139. //点击转发朋友圈
  140. U.D.Blog.A.SPAZFF = function (UDE, UDOD) {
  141. if (UDE.ArticleContent && !UDE["JZ"]) {
  142. U.D.Blog.A.PAZFF(UDE, UDOD);
  143. }
  144. else {
  145. U.A.Request(US.CD, ([US.DB, "UseStudio_Blog", "UB_P_S_SelectArticleInformation", UDE.ArticleID]), U.D.Blog.A.AsynSPAZFF, (["", UDE, UDOD]));
  146. // U.A.Request("pb.ArticleContent", ([UDE.ArticleID, "Blog"]), U.D.Blog.A.AsynSPAZFF, (["", UDE, UDOD]));
  147. }
  148. //获取内容和回复内容
  149. }
  150. //异步获取消息内容
  151. U.D.Blog.A.AsynSPAZFF = function (request) {
  152. var context = request.context;
  153. var _UDE = context[1];
  154. var _UDOD = context[2];
  155. //_$(_UDE).Add(request.value[0]);
  156. U.Ut.AddObj(_UDE, request.value[0]);
  157. delete _UDE["JZ"];
  158. U.D.Blog.A.SPAZFF(_UDE, _UDOD);
  159. }
  160. //发送转发
  161. U.D.Blog.A.PAZFF = function (UDE, UDOD) {
  162. var _UTF, _UKE = [], _UTH = UDOD.innerHTML;
  163. (_UTH == "可添加内容...") && (_UTH = "");
  164. U.Alert("转发中...");
  165. U.A.Request(US.CD, ([US.DB, "UseStudio_Blog", "UB_P_A_AddZFLR", US.userInfo.userid, Guid.NewGuid(), UDE.ArticleID, US.PID,
  166. _UTH, UDOD.innerText.substr(200) + (UDOD.innerText.length > 200 ? "..." : "") + U.selectEl("img", UDOD)[0].outerHTML]), U.D.Blog.A.AsynSPAZFF, (["", UDE, UDOD]));
  167. // U.A.Request("pb.ZFArticle", ([US.userInfo.userid, US.PID, UDE.ArticleID, _UTH]), U.D.Blog.A.AsynPAZFF, (["", _UTH, UDE]));
  168. //服务器同步中
  169. }
  170. //发送转发异步
  171. U.D.Blog.A.AsynPAZFF = function (request) {
  172. var _UKE, _UDTD = U.selectEl("#UD_SYSXZLLRTA").Child()[2];
  173. _UID = US.userInfo.userid,
  174. _UGE = U.D.SY.ET["UL"]["HY"],
  175. context = request.context,
  176. _UTH = context[1],
  177. _UDE = context[2],
  178. _UDOD = $$("div", {
  179. "innerHTML": _UTH
  180. });
  181. request = request.value;
  182. _UKE = U.D.Blog.A.BLEI([request, 0, 0, U.MT.SetDT(new Date()), _UTH, _UDOD.innerText.substr(0, 100), US.userInfo.userid, US.userInfo.UserNickName, US.userInfo.UserThumbnailImageHead, 0]);
  183. //添加实体
  184. U.Ut.AddObj(_UKE, {
  185. "Forward": _UDE["ArticleID"],
  186. "ZF": _UDE
  187. });
  188. (_UGE = _UGE[_UID]) && (_UGE[1] = _UGE[1] || [],
  189. _UGE[1].unshift(_UKE));
  190. //添加转发的数据
  191. if (_UDTD.className == "UD_SYSXZLLRTO") {
  192. U.D.Blog.PGBL($("#UD_SYSXZLRSRD")[0], [_UKE], null, 0, true);
  193. } else {
  194. U.D.SY.HDSY(["none", "block"]);
  195. _UDTD.onclick();
  196. }
  197. //显示转发
  198. }
  199. //#endregion