123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327 |
- Namespace.register("U.MD.D.Blog.R"); //朋友圈评论
- //#region 评论
- //打印内容
- U.MD.D.Blog.R.PBPGBL = function (UDE, UDOD) {
- var i, _UDE = ["block", "none"], _UDCD = $(UDOD).childs(0).Child();
- if (!UDE && UDE["KZ"]) { _UDE.reverse(); } //取消
- else {//打印
- var i, _UTL, _UDTD, _UDFD = $$("frag"),
- _UDAD = $("div", _UDCD[0]),
- _UDID = $$("div",{"innerHTML": UDE.ArticleContent}),
- _img = $("img", _UDID);
- var UTH = _UDID.innerText; _UDCD[0].scrollTop = 0;
- _UDAD[16].innerText = _UDAD[2].innerText = _UDAD[8].innerText = "";
- _UDAD[5].innerText = UDE.UserNickName || UDE.UserName;
- _UDAD[6].innerText = U.UF.D.getDateInterval(UDE.ArticleAddTime);
- _UDAD[7].innerText = UTH || "图片分享";
- _UDAD.addAttrArray({ "innerText": (UDE.ArticleZFN === undefined ? UDE.AricitleReadNumber : UDE.ArticleZFN),
- "onclick": function () {
- U.UF.EV.stopBubble();
- U.MD.D.Blog.A.PAZF(UDE);
- }
- },
- 11);
- $$("img",
- {
- "onerror": U.MD.C.imgError,
- "onclick": function () {
- U.MD.U.V.ViewOtherUserInfo(UDE.UserID);
- },
- "src": U.MD.C.getHeadImage(UDE.UserThumbnailImageHead),
- "title": "点击查看"
- },
- _UDAD[2]); //用户头像
- //用户发表的图片展示 _UDID[0][i].onclick ||
- if ((_UTL = _img.length)) {
- for (i = 0; i < _UTL; i++) {
- $$("img",
- {
- "src": _img[i].src,
- "onclick": function () {
- U.UF.EV.stopBubble();
- U.MD.I.Img(UDE({ "Thm": _img[i].src, "Img": _img[i].alt.indexOf(US.FILESYSTEMURL) > -1 ? _img[i].alt : _img[i].src }));
- }
- },
- _UDFD);
- } _UDAD[8].appendChild(_UDFD);
- }
- (_UDTD = _UDAD["UD_SYBNO"]).onclick = function () {
- U.MD.D.Blog.R.FBHFRGBL(UDE, _UDTD, null);
- }
- }
- for (i = 0; i < _UDE.length; i++) {
- _UDCD[i].style.display = _UDE[i];
- }
- return _UDAD;
- }
- //滚动回复数据
- U.MD.D.Blog.R.GDHFRGBL = function (UDE, UDOD) {
- U.MD.D.Blog.R.HFRGBL(UDE, UDOD, this.P + 2);
- }
- //用户回复数据
- U.MD.D.Blog.R.HFRGBL = function (UDE, UDOD, P) {
- var _UDAD, _UGD = [undefined],
- _UET = U.MD.D.D.FYGBL(UDE.Reply, P),
- _UDTD = $(".UD_SYBAOO", UDOD)[0]; //获取回复数据
- if (_UET[0]) {
- _UDAD = $("div", _UDTD);
- if (P == 1) { _UDAD["UD_SYBF"].innerText = "", _UDAD[14].innerText = UDE["ArticleReplayNumber"] || 0 };
- if (_UET[0].length > 0) {
- if (P == 1) {
- U.MD.D.Blog.R.PHFRGBLPL(_UET[0], _UDAD[16]);
- //_UGD[0] = U.UF.EV.scrollLoad({ 'AF': function () { U.MD.D.Blog.R.GDHFRGBL(UDE, UDOD); } }).SCH();
- U.UF.EV.scrollLoad(_UGD[0], function () { U.MD.D.Blog.R.GDHFRGBL(UDE, UDOD) }, _UGD[0]);
- }
- U.MD.D.Blog.R.PHFRGBL(_UET[0], _UDAD["UD_SYBF"], null, UDE);
- } else { _UGD[0] = null; } if (_UGD[0] !== undefined) { _UDTD.onscroll = _UGD[0] };
- } //打印评论数据
- else {
- U.A.Request(US.CD, [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]];
- // U.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]];
- } //获取评论数据
- }
- //异步获取回复数据
- U.MD.D.Blog.R.AsynHFRGBL = function (r) {
- 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] = [];
- for (i = 0; i < r.length; i++) {
- if (!r[i].ReplyParentID) {
- _UDE.Reply[_UTP].push(r[i]);
- r[i]["RR"] = U.Json.select(r, { "ReplyParentID": r[i].ReplyID });
- }
- }
- U.MD.D.Blog.R.HFRGBL(_UDE, _UDOD, _UP);
- }
- //打印评论好友
- U.MD.D.Blog.R.PHFRGBLPL = function (UDE, UDOD) {
- var i,
- _UET = {},
- UDFD = $$("frag");
- for (i = 0; i < UDE.length; i++) {
- if (!_UET[UDE[i].ReplyAddUserID]) {
- $$("img",
- {
- "onerror": U.MD.C.imgError,
- "src": U.MD.C.getHeadImage(UDE[i].UserThumbnailImageHead),
- "title": UDE[i].UserNickName,
- "onclick": function () {
- U.UF.EV.stopBubble();
- U.MD.U.V.ViewOtherUserInfo(UDE[i].ReplyAddUserID);
- }
- },
- UDFD);
- _UET[UDE[i].ReplyAddUserID] = "Yes";
- }
- }
- UDOD.appendChild(UDFD)
- }
- //打印回复数据
- U.MD.D.Blog.R.PHFRGBL = function (UDE, UDPD, TF, UAE, UPE) {
- var i, j, _UME, _UKE, _UDTD, _UDSD,
- _UDFD = $$("frag");
- _UKE = UDE.length == 1 ? UAE["Reply"][1] : UDE
- for (i = 0; i < UDE.length; i++) {
- _UDTD = U.MD.D.Blog.R.YSPHFRGBL(UDE[i], _UDFD, UAE, UPE || UDE[i], UPE ? UDPD : null, _UKE);
- _UME = UDE[i]["RR"]; //打印回复
- for (j = 0; (_UME && j < _UME.length); j++) {
- U.MD.D.Blog.R.YSPHFRGBL(_UME[j], _UDTD, UAE, UDE[i], _UDTD, _UME);
- } //打印回复的回复
- }
- if (TF && UDPD.firstChild) {
- UDPD.insertBefore(_UDFD, UDPD.firstChild);
- }
- else {
- UDPD.appendChild(_UDFD);
- }
- }
- //样式使用
- U.MD.D.Blog.R.YSPHFRGBL = function (UDE, UDOD, UAE, UPE, UDMD, UME) {
- var _UDTD, _UDMD, _UDSD, _UDED, _UDGD, _UDJD,
- _UTF = UDE.ReplyAddUserID == US.userInfo.userid;
- _UDTD = $$("div",{"className": "UD_SYBFO"},UDOD);
- _UDSD = $$("div",{"className": "UD_SYBFOI"},_UDTD);
- $$("img",
- {
- "onerror": U.MD.C.imgError,
- "title": UDE.UserNickName,
- "src": U.MD.C.getHeadImage(UDE.UserThumbnailImageHead),
- "onclick": function () {
- U.UF.EV.stopBubble();
- U.MD.U.V.ViewOtherUserInfo(UDE.ReplyAddUserID);
- }
- },
- _UDSD);
- _UDED = $$("div",{"className": "UD_SYBFOZ"},_UDTD);
- _UDGD = $$("div",{"className": "UD_SYBFOZK"},_UDED);
- $$("div",
- {
- "className": "UD_SYBFOZTN",
- "innerHTML": UDE.UserNickName,
- "onclick": function () {
- U.UF.EV.stopBubble();
- U.MD.U.V.ViewOtherUserInfo(UDE.ReplyAddUserID);
- }
- },
- _UDGD);
- _UDJD = $$("div",{"className": "UD_SYBFOZTO"},_UDGD);
- $$("div",{"className": "UD_SYBFOZT","innerHTML": U.UF.D.getDateInterval(UDE.ReplyAddTime)},_UDJD);
- _UDSD = $$("div",{"className": "UD_SYBFT"},_UDTD);
- $$("div",{"className": "UD_SYBFOZTK" + (_UTF ? " UD_SYBFOZTKO" : ""),"title": _UTF ? "删除" : "回复","innerHTML": _UTF ? "删除" : "回复"
- //#error
- // "onclick": _UTF ? function(){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);
- if (UDE.ParentUserNickName) {
- $$("div",{"className": "UD_SYBFOZKT","innerHTML": "回复"},_UDGD),
- $$("div",
- {
- "className": "UD_SYBFOZKO",
- "innerHTML": "@" + UDE.ParentUserNickName,
- "onclick": function () {
- U.UF.EV.stopBubble();
- U.MD.U.V.ViewOtherUserInfo(UDE.ParentUserId);
- }
- }, _UDGD)
- };
- $$("div",
- {
- "className": "UD_SYBFOZC UC_TF",
- "innerHTML": UDE.ReplyContent,
- "onselectstart": function () {
- U.UF.EV.stopBubble();
- return true;
- }
- }, _UDED);
- return _UDSD;
- }
- //评论查看
- U.MD.D.Blog.R.PLCKBL = function (UDOD) {
- if (!U.MD.U.L.isLogin()) {
- U.UF.MR.InputTip(UDOD, ["发表回复...", ""]);
- } //发表回复
- else {
- UDOD = $($(UDOD).Parent(6));
- U.MD.U.L.loginCallBack = function () {
- UDOD.addAttrArray({ "style": { "display": "block"} });
- };
- } //评论查看
- }
- //删除评论
- U.MD.D.Blog.R.SCPHFRGBL = function (UPE, UDE, UAE, UDOD) {
- if (!U.MD.U.L.isLogin()) {
- var _URID, _UAID, _UCB;
- if (U.UF.C.isString(UPE)) {
- _URID = UPE; _UAID = UDE || US.EMPTYGUID; _UCB = UAE;
- }
- else {
- UPE.splice(UPE.indexOf(UDE), 1);
- $("#UD_SYBK div")[4].innerText -= 1 + (UDE["RR"] ? UDE["RR"].length : 0);
- $(UDOD).remove();
- _URID = UDE.ReplyID;
- _UAID = UAE.ArticleID;
- } //移除评论 //移除元素 //评论数-1
- U.A.Request(US.CD, [US.DB, "UseStudio_Blog", "UB_P_D_DeleteOneReplyAndAllChildReply", US.userInfo.userid, _URID, _UAID || US.EMPTYGUID]), _UCB || function () { }, [""]; //服务器同步
- // U.A.Request(US.AUTH,"pb.DeleteOneReplyAndChildReply", [US.userInfo.userid, _URID, UAID || US.EMPTYGUID]), _UCB || U.UF.C.apply, [""]; //服务器同步
- }
- }
- //弹出回复的回复框
- U.MD.D.Blog.R.TCPHFRGBL = function (UAE, UDOD, UPE, UDMD) {
- if (!U.MD.U.L.isLogin()) {
- var _UDAD, _UDTD = $("#UD_SYBNK")[0];
- if (!_UDTD) {
- _UDTD = $("#UD_SYBN")[0].parentNode.cloneNode(true);
- _UDTD.id = "UD_SYBNK"; $(_UDTD).Child()[0].onblur = U.MD.D.Blog.R.YCTCPHFRGBL;
- };
- $($(_UDTD).Child()[0]).addAttrArray({ "id": "", "innerHTML": "" });
- _UDTD.style.display = "block";
- _UDAD = $(_UDTD).Child();
- _UDAD[1].onclick = function () {
- U.MD.D.Blog.R.FBHFRGBL(UAE, _UDAD[1], UPE, _UDTD, UDMD);
- };
- UDOD.insertBefore(_UDTD, UDOD.firstChild);
- _UDAD[0].focus();
- }
- }
- //移除评论框
- U.MD.D.Blog.R.YCTCPHFRGBL = function () {
- var _UDTD = $(this.parentNode);
- setTimeout(function () {
- _UDTD.addAttrArray({ "style": { "display": "none"} });
- },
- 500); //延迟执行
- }
- //发表评论
- U.MD.D.Blog.R.FBHFRGBL = function (UAE, UDOD, UPE, UDTD, UDMD) {
- var _UDED = U.UF.EL.getChildrenNoText(UDOD.parentNode.childNodes)[0],
- _UHT = _UDED.innerHTML;
- if (_UHT != "发表回复..." && _UHT != "") {
- U.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];
- if (UDTD) { UDTD.style.display = "none" }; _UDED.innerText = "发表回复..."; U.Alert("正在发送中...");
- }
- }
- //添加回复
- U.MD.D.Blog.R.TJFBHFRG = function (UAID, UTH) {
- if (!U.MD.U.L.isLogin()) {
- var _UCB, _UPID = "",
- _UUID = "", _UDE = arguments;
- if (_UDE.length < 4) { _UCB = _UDE[2]; }
- else {
- _UPID = _UDE[3]; _UUID = _UDE[4]; _UCB = _UDE[5];
- }
- U.A.Request(US.AUTH, ["ReportReply", US.userInfo.userid, UAID, UTH, _UPID, _UUID], U.MD.D.Blog.R.AsynTJFBHFRG, ["", _UCB]); //添加回复到后台
- }
- }
- //添加回复异步
- U.MD.D.Blog.R.AsynTJFBHFRG = function (r) {
- var _context = r.context,
- _UCB = _context[1];
- r = r.value; if (_UCB) { _UCB(r) };
- }
- //发表评论成功异步
- U.MD.D.Blog.R.AsynFBHFRGBL = function (reuqest) {
- var _UKE, _UME, UPE, _UTH, _UAE, _UDOD, _UDMD, _UDP;
- _context = reuqest.context;
- reuqest = reuqest.value;
- _UAE = _context[1];
- _UTH = _context[2];
- UPE = _context[3];
- _UDOD = _context[4];
- _UDMD = _context[5];
- _UDPD = $("#UD_SYB" + _UAE.ArticleID).find("div")["UD_SYBF"];
- (_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])); //添加新的类
- if (!UPE) { _UME["RR"] = [] };
- U.MD.D.Blog.R.PHFRGBL([_UME], (UPE ? (_UDMD || _UDOD.parentNode) : _UDPD), true, _UAE, UPE);
- $("div", _UDPD.parentNode)[14].innerText = _UME.AllCount; //添加回复
- }
- //回复的实体
- U.MD.D.Blog.R.FRGBLET = function (UDE) {
- var i = UDE.length, _UET = ["AllCount", "ParentUserNickName", "ReplyAddTime", "ReplyAddUserID", "ReplyContent", "ReplyID", "ReplyParentID", "ReplyVerifyUserID", "UserNickName", "UserThumbnailImageHead"]
- while (i--) { this[_UET[i]] = UDE[i] }
- }
- //展开缩小消息发送
- U.MD.D.Blog.R.SGBL = function (UDOD, TF) {
- var _UDPD = UDOD.parentNode, _UDE = ["block", { "width": "310px", "height": "25px" }, "none", "UD_SYSXZLRSSV U_Boom_Img_ys2017"], _UDAD = $(_UDPD).Child(), _UDCD = $("div", _UDAD[1]); UDOD = $(UDOD);
- if (TF) { _UDE[0] = "none", _UDE[1] = { "width": "100%", "height": "100px" }, _UDE[2] = "block", _UDE[3] = "UD_SYSXZLRSSVA" };
- UDOD.addAttrArray({ "style": _UDE[1] }); _UDAD[1].className = _UDE[3]; _UDCD[0].style.display = _UDE[2]; //U.MD.D.H.DTGBL(_UDCD[1], true);
- }
- //#endregion
|