123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- Namespace.register("U.U.P"); //积分
- //类型
- U.U.P.TF = { "Contribute": "找出漏洞", "Introduce": "推广本网站", "Upload": "上传文件", "PostArticle": "发表文章", "Online": "在线时间", "Reply": "回复文章", "SignIn": "登陆签到", "Download": "下载文件", "DiskAddition": "硬盘增加", "IllegalImage": "发布违规图片" }
- U.U.P.FTF = { "Upload": "UseStudioUserDiskDiv", "Download": "UseStudioUserDiskDiv", "PostArticle": "UseStudioStudyControlDiv", "Reply": "UseStudioStudyControlDiv" };
- //用户数据分页
- U.U.P.E = {};
- //点击积分图标
- U.U.P.LoginIC = function () {
- var _UICD = $("#UU_IC")[0], _UDGG = $("#UU_ICBG_GG")[0]; //积分的显示区域
- U.D.PopupWindow(_UICD); //居中弹框
- U.U.P.GetIC($("div#UU_IC_Pay", _UICD)[0]); //获取积分统计
- U.D.Tb.WindowRestore(_UICD, '', '积分中心'); //创建任务栏
- }
- //切换
- U.U.P.SIC = function (TF) {
- U.U.P.YXICD["none", "block"]; //切换到显示的div
- if (TF == 1) { U.U.P.GetIC($("#UU_IC_Pay")[0]); }
- else { U.U.P.ICSS(1); }
- }
- //切换的显示和隐藏
- U.U.P.YXICD = function (TF) {
- $('#UU_IC_HB')[0].style.display = TF[0];
- $('#UU_IC_Info')[0].style.display = TF[1];
- }
- //------------------------------------------------------------------------用户个人
- //用户积分资料
- U.U.P.SUIC = function (UICD) {
- var i, TF = 0, _UDAD = $("#UU_IC_Avatar", UICD)[0], _UET = U.U.P.E[US.userInfo.userid]["ICCSV"][0]; _UDAD.innerHTML = "";
- for (i = 0; i < _UET.length; i++) { TF += _UET[i].VCSumValue; } //获取用户显示的积分
- //显示用户积分资料
- $$("img", { "onerror": [[U.M.ImgError, ["this"]]], "id": "UU_IC_Avatar_img", "src": U.M.GetImgU(US.userInfo.UserThumbnailImageHead) }, _UDAD);
- $("#UU_IC_VCSum", UICD)[0].innerHTML = TF; //用户积分
- }
- //------------------------------------------------------------------------用户积分消耗查询(分)
- //用户积分查询分页
- U.U.P.ICSS = function (P) {
- var SP = Math.ceil(P * 7 / 70),
- _E = SP * 70,
- _S = _E - 69,
- UPDL = U.U.P.E[US.userInfo.userid];
- if (UPDL && (UPDL = UPDL["Page"]) && (UPDL = UPDL[SP])) {
- var _TP = P % 10;
- _TP = _TP == 0 ? 10 : _TP;
- _E = _TP * 7; _S = _E - 7; //分页算法
- var _UICL = UPDL.slice(_S, _E); //获取打印的数据
- U.U.P.SetICSS(_UICL, P);
- }
- else { U.A.Request("UseStudioPay.UserGetSomeVC", [_S, _E], U.U.P.AsynICSS, ["", P, SP, US.userInfo.userid]); } //获取积分明细记录
- }
- //异步用户资料查询
- U.U.P.AsynICSS = function (r) {
- var context = r.context;
- r = r.value;
- if (U.U.P.E[context[3]] == null) {
- U.U.P.E[context[3]] = { "Page": [] };
- }
- else if (U.U.P.E[context[3]]["Page"] == null) {
- U.U.P.E[context[3]]["Page"] = [];
- }
- U.U.P.E[context[3]]["Page"][context[2]] = r[0]; //添加用户数据
- U.U.P.ICTT(r[1], $("#UU_ICM_UU_IC_Heroes")[0]); //打印英雄榜
- U.U.P.ICSS(context[1]); //用户积分查询分页
- }
- //设置分页
- U.U.P.SetICSS = function (UICL, P) {
- if (UICL.length > 0) {
- U.U.P.ICPL(UICL, ["时间", "来源", "来源", "积分"], $("#UU_IC_Info")[0]); //打印数据
- U.PG.PPage($("#UU_IC_Pag")[0], UICL[0].AllCount, P, 7, { "fun": [[U.U.P.ICSS, [P]]], "page": [0] }); //分页
- }
- }
- //-------------------------------------------------------------------获取用户积分消耗情况(总)
- //获取积分
- U.U.P.GetIC = function (UICD) {
- if (U.U.P.E[US.userInfo.userid] && U.U.P.E[US.userInfo.userid]["ICCSV"]) {
- U.U.P.SetIC(U.U.P.E[US.userInfo.userid]["ICCSV"], UICD);
- }
- else {
- U.A.Request("UseStudioPay.UserCountVC", [], U.U.P.AsynGetIC, [UICD, 1, US.userInfo.userid]);
- } //获取积分统计
- }
- //获取积分异步
- U.U.P.AsynGetIC = function (r) {
- var context = r.context;
- r = r.value;
- if (U.U.P.E[context[2]] == null) {
- U.U.P.E[context[2]] = {};
- }
- U.U.P.E[context[2]]["ICCSV"] = r; //积分消耗统计
- U.U.P.GetIC(context[0], r); //显示积分
- }
- //打印积分详情(总)
- U.U.P.SetIC = function (UIC, UICD) {
- U.U.P.ICTT(UIC[1], $("div#UU_ICM_UU_IC_Heroes", UICD)[0]); //打印排名
- U.U.P.ICPL(UIC[0], ["时间", "来源", "积分", "次数"], $("div#UU_IC_Info", UICD)[0]); //积分使用获得的变化
- U.U.P.SUIC(UICD); //设置用户积分信息
- }
- //打印积分排名
- U.U.P.ICTT = function (UICL, UOD) {
- var i, _UCL, _UDOD, _UDTD,
- _UDFD = $$("frag");
- UOD.innerText = "";
- for (i = 0; i < UICL.length; i++) {
- _UCL = UICL[i]; //获取积分名次
- _UDOD = $$("div", { "style": { "marginTop": "8px" }, "onclick": [[U.M.StopBubble], [U.U.I.POUW, [_UCL.UserId]]] }, _UDFD);
- $$("img", { "onerror": U.M.ImgError, "src": U.M.GetImgU(_UCL.UserThumbnailImageHead), "className": "UU_IC_Heroes_img" }, _UDOD);
- $$("div", { "className": "UU_IC_HSOne", "innerHTML": _UCL.UserNickName }, _UDOD);
- _UDTD = $$("div", { "className": "UU_IC_HSTwo" }, _UDOD);
- $$("span", { "innerHTML": "积分:" }, _UDTD);
- $$("span", { "style": { "color": "#3081fe" }, "innerHTML": _UCL.VCSumValue }, _UDTD);
- }
- UOD.appendChild(_UDFD);
- }
- //打印用户积分来源
- U.U.P.ICPL = function (UICL, UDTF, UOD) {
- UOD.innerText = $("#UU_IC_Pag")[0].innerText = "";
- var i, j, _UCI, _UDSD,
- _UDOD = $$("div", { "className": "UU_IC_Values" }), _UDTD = $$("div", { "className": "UU_IC_VP" });
- for (i = 0; i < UDTF.length; i++) {
- $$("div", { "innerHTML": UDTF[i], "style": { "width": (i == 3 ? "50px " : (i == 1 ? "100px" : i == 2 ? "200px" : ""))} }, _UDOD);
- };
- for (j = 0; j < UICL.length; j++) {
- _UCI = UICL[j];
- _UDSD = $$("div", { "className": "UU_IC_SG" }, _UDTD);
- $$("div", { "innerHTML": U.MT.getDateInterval(_UCI.VCDateTime) }, _UDSD);
- $$("div", { "innerHTML": U.U.P.TF[_UCI.VCType], "style": { "width": "100px"} }, _UDSD);
- $$("div", { "onclick": _UCI.VCCountValue ? "" : U.U.P.FTF[_UCI.VCType] ? [[U.M.StopBubble], [U.M.divdoubleClick, [U.U.P.FTF[_UCI.VCType], _UCI.VCDetailsDataID, null, null, "ART" + _UCI.VCDetailsDataID]]] : "", "className": ("UTDF" + (_UCI.VCCountValue ? "" : " UU_IC_FS")), "style": { "color": _UCI.VCCountValue ? "" : "#3081fe", "width": "200px" }, "innerHTML": _UCI.VCCountValue ? _UCI.VCSumValue : _UCI.VCDetailsDataValue }, _UDSD);
- $$("div", { "innerHTML": _UCI.VCCountValue || _UCI.VCValue, "style": { "width": "50px"} }, _UDSD);
- }
- UOD.appendChild(_UDOD); UOD.appendChild(_UDTD);
- }
- //--------------------------------------------------------------------------------汇换空间----------------------------------------------------------------------------
- //弹出
- U.U.P.ICEXC = function (TF) {
- var _UIED = $("#UU_IC_EXC")[0];
- if (TF == "block") { U.D.SetDTop(_UIED); } //解决层次的问题
- _UIED.style.display = TF; //显示或者隐藏
- }
- //用户换去空间
- U.U.P.ICGK = function (UICD) {
- var i, _TF = 0,
- _UICE = U.U.P.E[US.userInfo.userid]["ICCSV"][0];
- UICV = UICD.value;
- for (i = 0; i < _UICE.length; i++) {
- _TF += _UICE[i].VCSumValue;
- } //获取用户所有的积分
- if (parseFloat(UICV) < 0) {
- U.Alert("请输入正整数");
- } //换取有效网盘空间
- else if (!U.MS.Number.test(UICV)) {
- U.Alert("您的输入有误,请输入数字!");
- } //输入的是无效数据
- else if (UICV > _TF) {
- U.Alert("您的积分不足");
- } //积分不足无法汇换
- else {
- U.UI.Confirm("确定确定要兑换" + UICV + "M的空间吗?", function () {
- // U.A.Request(US.Auth,"UseStudioManage.UserDiskAddition", [UICV], U.U.P.AsynICGK, ["", UICD, UICV]);
- UICD.parentNode.parentNode.parentNode.style.display = "none"; UICD.value = "";
- })
- } //于服务器同步增加用户的网盘
- }
- //汇换空间异步
- U.U.P.AsynICGK = function (r) {
- var context = r.context;
- r = r.value;
- if (r) {
- var i, _TF = true,
- ICDE = U.U.P.E[US.userInfo.userid]["ICCSV"][0];
- for (i = 0; i < ICDE.length; i++) {
- if (ICDE[i]["VCType"] == "DiskAddition") {
- _TF = false; ICDE[i].VCSumValue -= context[2];
- ICDE[i].VCCountValue += 1;
- }
- } //修改用户积分消耗信息
- if (_TF) {
- var _E = new U.U.P.PICE[1, new Date(), -context[2], "DiskAddition"],
- _UICE = U.U.P.E[US.userInfo.userid]["Page"];
- ICDE.push(_E);
- if (_UICE && _UICE.length > 0) {
- var _ICE = U.U.P.ICE(_UICE[1][0].AllCount, "0", US.userInfo.userid, new Date(), Guid.newGuid(), "硬盘增加", Guid.newGuid(), "DiskAddition", -context[2]); _UICE[1].unshift(_ICE);
- }
- } //添加用户积分消耗信息
- U.U.P.SUIC();
- U.U.P.ICPL(ICDE, ["时间", "来源", "积分", "次数"], $("#UU_IC_Info")[0]);
- US.userInfo.UserDiskSpace += 1; //积分使用获得的变化 //用户信息
- }
- }
- //-----------------------------------------------------------------------------数据结构-------------------------------------------------------------------------------
- //积分的结构
- U.U.P.PICE = function (E) {
- this.VCCountValue = E[0];
- this.VCDateTime = E[1];
- this.VCSumValue = E[2];
- this.VCType = E[3];
- }
- //积分的消耗
- U.U.P.ICE = function (E) {
- this.AllCount = E[0];
- this.PageNum = E[1];
- this.UserID = E[2];
- this.VCDateTime = E[3];
- this.VCDetailsDataID = E[4];
- this.VCDetailsDataValue = E[5];
- this.VCID = E[6];
- this.VCType = E[7];
- this.VCValue = E[8];
- }
|