U.DK.DI.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. Namespace.register("U.Dk.DI"); //网盘首页数据展示
  2. //#region 首页暂时网盘
  3. //获取网盘首页内容
  4. U.Dk.DI.WPFF = function (UTF, UCB) {
  5. var _UDE = U.D.SY.ET["UL"]["WS"];
  6. if (!_UDE) {
  7. U.A.Request(US.CD, [US.DB, "UseStudio_Disk", "GetDiskHallData", US.NU, 0, 3000], U.Dk.DI.AsynWPFF, [[$("#UD_SYSXZBJO")[0], true], UCB]);
  8. // U.A.Request(US.Auth,"UseStudioDisk.GetUserFNew", [_UNID, _UNID], U.Dk.DI.AsynWPFF, [[$("#UD_SYSXZBJO")[0], true], UCB]);
  9. } //获取网盘首页的内容
  10. else {
  11. U.Dk.DI.SYWPQHFY(1);
  12. (U.Ut.isFunction(UCB)) && (UCB());
  13. }
  14. }
  15. //获取网盘信息异步
  16. U.Dk.DI.AsynWPFF = function (r) {
  17. var _UDE = {},
  18. context = r.context,
  19. _UCB = context[1];
  20. r = r.value;
  21. // _UDE[US.NU] = [null, r[1]];
  22. // r[1] = [, , _UDE];
  23. U.D.SY.ET["UL"]["WS"] = r;
  24. U.Dk.DI.WPFF(null, _UCB); // (U.D.lot == 1) && (U.Dk.DI.WPFF(null, _UCB));
  25. }
  26. //网盘滚动分页
  27. U.Dk.DI.SYWPQHFY = function (UP, UDOD) {
  28. U.Dk.DI.SYWPQHJ(U.Ut.isElement(UDOD) ? UDOD : "", (UP == null ? this.P + 2 : UP), 2); //首页网盘点击
  29. // UP == 2 ? setTimeout(function () { U.Dk.DI.SYWPQHJ(null, UP, 2, U.D.SY.ET["UL"]["WS"][5]); }, 500) : U.Dk.DI.SYWPQHJ(null, UP, 2, U.D.SY.ET["UL"]["WS"][5]);
  30. }
  31. //首页网盘点击
  32. U.Dk.DI.SYWPDJ = function (UDID, UDOD) {
  33. var _UTF = (UDOD && UDOD.className.indexOf("UD_SYSXZBMHT") > -1);
  34. U.Dk.DI.SYWPQHJ(null, 1, 2, UDID, _UTF); (!_UTF && UDOD) && (U.MR.DHQH(UDOD, "UD_SYSXZBMHT"));
  35. }
  36. //网盘内容分页
  37. U.Dk.DI.SYWPQHJ = function (UDOD, UP, UTF, UDID, UTP) {
  38. if (UTF == 2 || !U.U.L.isLogin(3)) {//指定区域查看
  39. UTP = UTP === true;
  40. UDOD = UDOD || $("#UD_SYSXZBJO")[0];
  41. var _UCE,
  42. _UDPD = $(UDOD).Parent({ usbody: "true" }),
  43. _userid = UTF ? US.NU : US.userInfo.userid,
  44. _UDAD = $(_UDPD).Child(),
  45. _UGE = U.D.SY.ET["UL"]["WS"];
  46. // _UGE[5] = UDID = UDID || US.NU;
  47. // _UGE = _UGE[1][UTF];
  48. _UCE = U.D.T.FYGBL(_UGE, UP, [60, 300]), _UE = _UCE[1] * 300; (UP == 1) && (UDOD.innerText = "");
  49. if (_UCE[0] && !UTP) {
  50. if (_UCE[0].length) {
  51. U.Dk.DI.DiskSYN(UDOD, _UCE[0]); (UDOD.offsetHeight > 0 && _UDPD.offsetHeight >= _UDPD.scrollHeight) && (U.Dk.DI.SYWPQHJ(UDOD, UP + 1, UTF, UDID));
  52. }
  53. else if (UP == 1) {
  54. U.Dk.VW.XWPDYXK(UDOD, { "className": "UD_SYWRZFO", "onclick": [[U.D.DT.YYDK, ["Disk", { "userid": US.userInfo.userid, "directoryid": US.FG}]]] });
  55. }
  56. } //打印网盘资料
  57. else {
  58. UTP = (UTP && _UCE[0] && _UCE[0].length != 0);
  59. U.A.Request(US.CD, [US.DB, "UseStudio_Disk", "GetDiskHallData", UDID, _userid, _UE - 300, _UE], U.Dk.DI.AsynSYWPQHJ, [UP == 1 ? [UDOD, true] : _UDAD[_UDAD.length - 1], _UGE, UDID, UP, UTF, _UCE[1], UDOD, UTP]);
  60. // U.A.Request(US.Auth,"UseStudioDisk.GetUserFNew", [_userid, UDID, _UE - 300, _UE, _userid, (UTP ? _UCE[0][0].UserFilesID : "")], U.Dk.DI.AsynSYWPQHJ, ([UP == 1 ? [UDOD, true] : _UDAD[_UDAD.length - 1], _UGE, UDID, UP, UTF, _UCE[1], UDOD, UTP]));
  61. } //异步获取 $(UDOD).next().css("display", "none");
  62. }
  63. }
  64. //网盘内容分页异步
  65. U.Dk.DI.AsynSYWPQHJ = function (r) {
  66. var i, _UAE, context = r.context,
  67. _UGE = context[1],
  68. _UDID = context[2],
  69. _UP = context[3],
  70. _UTF = context[4],
  71. _UTP = context[5],
  72. _UDOD = context[6],
  73. _UFT = context[7];
  74. (!_UGE[_UDID]) && (_UGE[_UDID] = []); r = r.value;
  75. if (_UFT) {
  76. if ((_UAE = r).length) {
  77. _UGE = _UGE[_UDID];
  78. for (i = 1; i < _UGE.length; i++) {
  79. _UGE[i] = _UAE.concat(_UGE[i]);
  80. _UAE = _UAE.splice(300, _UGE[i].length - 300);
  81. }
  82. }
  83. }
  84. else { _UGE[_UDID][_UTP] = r; }
  85. //(U.D.SY.ET["UL"]["WS"][5] == _UDID) && (U.Dk.DI.SYWPQHJ(_UDOD, _UP, _UTF, _UDID));
  86. }
  87. //网盘首页分享区域
  88. U.Dk.DI.DiskSYN = function (UDOD, UDE) {
  89. var i, j, _UTF, _UTP, _UDTD, _UDWD, _UDND, _UDSD, _UDMD, _UDKD, _UEN, _USN, _USIN,
  90. _USI = $(UDOD).Child().length ? 0 : U.P.RandomRange(10, 25),
  91. _UAE = ["打开", "云盘", "评论", "下载"],
  92. _userid = US.userInfo.userid,
  93. _UDAD = $(UDOD).Child(),
  94. _UW = $(UDOD).Parent(2).offsetWidth,
  95. _UIF = Math.floor((_UW - 90) / 198) || 1,
  96. _ITF = _UDAD.length % _UIF,
  97. _UDFD = $$("frag"),
  98. _UKE = { "U": "40", "UD_SYWRZOE": "40", "UD_SYWRZOY": "40", "UD_SYWRZON": "40" };
  99. if (UDE) {
  100. for (i = 0; i < UDE.length; i++) {
  101. _UDTD = $$("div", { "className": "UD_SYSXZBMUZ", "style": { "marginLeft": (i + _ITF) % _UIF ? "" : "0px"} }, _UDFD); //
  102. if (_USI && _USI == i) {
  103. _UDWD = $$("div", { "id": Guid.guidNoDash(), "className": "UD_SYSXZBMUZL" }, _UDTD);
  104. U.D.AD.baidu(_UDWD.id, "u2360852"); //异步添加广告
  105. }
  106. else {
  107. _UEN = UDE[i].UserFilesExtendName || UDE[i].UserDirectoryExtendType;
  108. _UTF = U.UP.IsImg(_UEN || "");
  109. _UTP = U.Dk.HP.GetIcon(_UEN ? _UEN.toLowerCase() : "");
  110. _UDWD = $$("div", { "className": "UD_SYSXZBMU", "onclick": [[U.Dk.DI.DiskSYNDJ, [UDE[i], 0]]] }, _UDTD); //
  111. _UDTD = $$("div", { "className": "UD_SYSXZBMUAO" }, _UDWD); //
  112. _UDND = $$("div", { "className": "UD_SYSXZBMUA" }, _UDTD); //
  113. _UDSD = $$("div", { "className": "UD_SYSXZBMUS" + (_UTP.classname[1] ? " UD_SYID " + _UTP.classname[1] : ""), "style": { "width": (_UKE[_UTP.classname[1]] ? _UKE[_UTP.classname[1]] + "px" : "")} }, _UDND); //
  114. if (_UTF) {//图片查看
  115. _UEN = UDE[i].UseFilesServerThumbnailName || UDE[i].UserDirectoryUrl;
  116. _UDSD.className = "UD_SYSXZBMUS UD_SYSXZBMUSO"; _UDMD = $$("div", { "className": "UD_SYSXZBMUST", "onclick": U.M.apply() }, _UDSD);
  117. U.D.SY.JZTPJS(_UEN, _UDMD, UDE[i]);
  118. }
  119. //普通文件查看
  120. else if (_UTP.name == "文件") {
  121. $$("div", { "className": "UD_SYSXZBMUSN", "innerHTML": _UEN }, _UDSD);
  122. }
  123. _UDSD = $$("div", { "className": "UD_SYSXZBMUNO" }, _UDND);
  124. $$("div", { "className": "UD_SYSXZBMUN UTDF", "innerHTML": (_USN = UDE[i].UserFilesName || UDE[i].UserallDirectoryName || ""), "title": _USN }, _UDSD);
  125. _UDSD = $$("div", { "className": "UD_SYSXZBMUT UTDF" }, _UDSD);
  126. $$("span", { "innerHTML": U.MT.getDateInterval(UDE[i].UserFilesAddTime || UDE[i].UserDirectoryAddTime) }, _UDSD);
  127. $$("div", { "className": "UD_SYSXZBMUR", "innerHTML": _UTP.name + " 容量大小(" + U.UP.FileSize(UDE[i].UserFilesSize || UDE[i].UserDirectorySize || 0) + ")" }, _UDTD);
  128. _UDSD = $$("div", { "className": "UD_SYSXZBMUD", "onclick": [[U.M.StopBubble], [U.U.I.ViewOtherUserInfo, [UDE[i].UserID || UDE[i].UserId]]] }, _UDTD);
  129. _UDMD = $$("div", { "className": "UD_SYSXZBMUDL" }, _UDSD);
  130. _UDKD = $$("div", { "className": "UD_SYSXZBMUDLL" }, _UDMD);
  131. $$("img", { "onerror": U.M.ImgError, "title": "点击查看", "src": U.M.GetImgU(UDE[i].UserThumbnailImageHead || ((_userid && UDE[i].UserID == _userid || UDE[i].UserId == _userid) ? US.userInfo.UserThumbnailImageHead : "")) }, _UDKD);
  132. $$("div", { "className": "UD_SYSXZBMUDLR UTDF", "innerHTML": UDE[i].UserName || US.userInfo.UserNickName || "" }, _UDSD);
  133. _UDKD = $$("div", { "className": "UD_SYSXZBMUL UTransition" }, _UDWD);
  134. for (j = 0; j < _UAE.length; j++) {
  135. $$("div", { "className": "UD_SYSXZBMULO", "innerHTML": _UAE[j], "onclick": [[U.M.StopBubble], [U.Dk.DI.DiskSYNDJ, [UDE[i], j]]] }, _UDKD);
  136. } //使用文件
  137. }
  138. }
  139. }
  140. else {
  141. for (i = 0; i < _UDAD.length; i++) {
  142. $(_UDAD[i]).addAttrArray({ "style": { "marginLeft": i % _UIF ? "" : "0px"} });
  143. }
  144. }
  145. if (_UIF > 0) {
  146. UDOD.style.width = (_UIF * 198 - 22) + "px";
  147. }
  148. UDOD.appendChild(_UDFD); //$(UDOD).next().css("display", "block");
  149. }
  150. //点击查看网盘
  151. U.Dk.DI.DiskSYNDJ = function (UDE, UTF) {
  152. (UDE.UserDirectoryEncrypt && UDE.UserDirectoryEncrypt.indexOf("-") > 0 && UDE.UserDirectoryEncrypt.length == 36) && (UDE.UserID = UDE.UserDirectoryEncrypt);
  153. //文件打开 下载
  154. if (UTF == 1) {
  155. US.Disk.DiskDaren["SE"] = UDE;
  156. U.D.DT.YYDK("Disk", { "userid": UDE.UserID, "directoryid": UDE.UserDirectoryParentID || UDE.UserDirectoryID });
  157. }
  158. else if (UTF == 2) {
  159. U.D.Img.Img(UDE, UDE);
  160. }
  161. // U.D.CM.CKPLXS(UDE.UserFilesID || UDE.UserDirectoryID, UDE.UserallDirectoryName || UDE.UserFilesName);
  162. else if (!UTF || UTF == 3) {
  163. (!UDE.UserDirectoryParentID) && (U.Ut.AddObj(UDE, { UserallDirectoryName: UDE.UserFilesName, filetype: 1, Descript: UDE.UserFilesDescript, UserDirectoryParentID: UDE.UserDirectoryID, UserDirectoryID: UDE.UserFilesID }));
  164. UTF ? U.Dk.RE.WPXZWJZJO(UDE.UserDirectoryID, "file") : U.Dk.LE.OpenFileDirectory(UDE);
  165. }
  166. U.D.CM.CKPLXS(UDE.UserFilesID || UDE.UserDirectoryID, UDE.UserallDirectoryName || UDE.UserFilesName);
  167. U.M.StopBubble();
  168. }
  169. //#endregion
  170. //#region 查看热门信息
  171. //热门资料
  172. U.Dk.DI.WPRMZL = function (UP, UDE, userid) {
  173. var _UGE = U.Dk.DiskOperatingSwitch(userid), _USE = UP * 90;
  174. //#error 下面去除
  175. U.A.Request(US.CD, [US.DB, "UseStudio_Disk", "UD_S_GetHMZL", _USE - 89, _USE], U.Dk.DI.AsynWPRMZL, [[$("#UD_SYWRZ", _UGE.pdiv)[0], true], UDE, UP, userid]);
  176. }
  177. //获取热门资料异步
  178. U.Dk.DI.AsynWPRMZL = function (r) {
  179. var context = r.context,
  180. _UDE = context[1],
  181. _UP = context[2],
  182. _userid = context[3],
  183. _UGE = U.Dk.DiskOperatingSwitch(_userid),
  184. _UDOD = $("#UD_SYWRZ", _UGE.pdiv)[0];
  185. r = r.value;
  186. if (r.length) {
  187. U.Dk.DI.PWPRMZL(_UDOD, r, _UDE, _UP);
  188. }
  189. else {
  190. _UDOD.onscroll = null;
  191. } //不滚动加载了
  192. }
  193. //设置热门信息打印和滚动
  194. U.Dk.DI.PWPRMZL = function (UDOD, UDE, UAE, UP) {
  195. var _UDPD = $(UDOD).Parent(),
  196. _UKE = (UAE) ? UAE.concat(UDE) : UDE;
  197. (!_UDPD.onscroll || UP == 1) && (UDOD.innerText = "");
  198. //#error 这里用这个做一个标识到时候要改的地方
  199. U.Dk.LE.OpenFileDirectory(UDOD.onscroll ? UDE : _UKE, [{ "UserallDirectoryName": "热门消息查看"}]); //查看网盘信息
  200. _UDPD.onscroll = (U.M.SSCH({ 'AF': U.M.apply(null, [[U.Dk.DI.WPRMZLGD, [UAE]]]) }).SCH()); //设置滚动加载
  201. }
  202. //滚动加载热门消息
  203. U.Dk.DI.WPRMZLGD = function (UDE) {
  204. U.Dk.DI.WPRMZL(this.P + 2, UDE);
  205. }
  206. //#endregion