U.U.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  1. Namespace.register("U.U"); //个人资料设置
  2. //#region 用户登录个人资料
  3. //-------------------------------------------------------------------个人资料设置
  4. //#region 初始化用户设置
  5. //打开个人资料
  6. U.U.DKGEZL = function () {
  7. if (!U.U.L.isLogin(3)) {
  8. var _UDTD, _UDOD = $("#UD_SYZ")[0]; //个人资料元素
  9. if (_UDOD) {
  10. U.U.DKSRDQ(_UDOD); //初始化资料
  11. _UDOD.style.display = "block"; //用户资料初始化
  12. _UDTD = U.UI.Form({ min: false, max: false, id: "UD_SYZDC", style: { width: "746px", height: "650px" }, content: _UDOD, title: "<div class='UD_SYF_STI'>个人设置</div>", //弹出个人资料
  13. hst: { style: { "padding": "0"} }
  14. }).be;
  15. U.U.SDKGEZL(_UDOD, ["block", "none"]); //用户信息、 密码密保 切换
  16. for (var i = 0; i < $(".UD_xx_jbxx").length; i++) {
  17. $(".UD_xx_jbxx")[i].onclick = function () {
  18. U.U.YHDHTCSH(this);
  19. }
  20. }
  21. U.U.YHDHTCSH($(".UD_xx_jbxx")[0]);
  22. return _UDTD;
  23. }
  24. }
  25. }
  26. /**
  27. * 用户资料左侧导航条初始化
  28. *
  29. * @param {element} 个人资料内容元素
  30. * @returns {array} 是否登录
  31. */
  32. U.U.YHDHTCSH = function (UOD) {
  33. switch (UOD.children[1].innerText) {
  34. case '基本信息':
  35. $(".UD_SYZCR")[0].style.display = 'block';
  36. $(".UD_SYZCLT")[0].style.display = 'block';
  37. $(".UD_SYZCL")[0].style.display = 'none';
  38. $(".UD_SYZOV")[0].style.display = 'none';
  39. break;
  40. case '个人隐私设置':
  41. $(".UD_SYZCL")[0].style.display = 'block';
  42. $(".UD_SYZCR")[0].style.display = 'none';
  43. $(".UD_SYZCLT")[0].style.display = 'none';
  44. $(".UD_SYZCLRT")[0].style.display = 'none';
  45. $(".UD_SYZOV")[0].style.display = 'none';
  46. break;
  47. case '账号安全设置':
  48. if ($(".UD_SYZCLRX")[0].style.display == 'block') {
  49. $(".UD_SYZCLRX")[0].style.display = 'none';
  50. UOD.children[2].src = '../../img/left.png';
  51. UOD.children[2].style.cssText = 'width: 8px;margin-left: 32px;margin-top: 18px;height: 13px;';
  52. }
  53. else {
  54. $(".UD_SYZCLRX")[0].style.display = 'block';
  55. UOD.children[2].src = '../../img/down.png';
  56. UOD.children[2].style.cssText = 'width:12px;margin-left: 32px;margin-top: 20px;height:8px';
  57. }
  58. break;
  59. }
  60. }
  61. /**
  62. * 用户资料初始化
  63. *
  64. * @param {element} 个人资料内容元素
  65. * @returns {array} 是否登录
  66. */
  67. U.U.DKSRDQ = function (UDOD) {
  68. var i, _UTF, _UIF = US.userInfo,
  69. _UDTD = $(UDOD).childg(0)[0];
  70. _UDTD = $(_UDTD).childg(0)[0];
  71. _UDTD = $(_UDTD).Child(); //这个是
  72. var _UDAD = $("input", _UDTD[0]), //所有可编辑的款
  73. _UAE = ["UserEmail", "UserTelephoneNumber"], //用户头像电话
  74. _UDE = ["TrueName", "", "UserNickName", "UserIndividualitysignature", { "checked": !_UIF.UserSex }, { "checked": _UIF.UserSex }, "UserEmail", "UserTelephoneNumber"]; //输入框需要设置的内容
  75. //设置用户邮箱、电话
  76. for (i = 0; i < _UAE.length; i++) { //这里设置了
  77. _UTF = (_UIF[_UAE[i]] && _UIF[_UAE[i]].length > 0);
  78. // _UDAD.addAttrArray({ disabled: _UTF === true }, i + 7);
  79. _UDAD.parentg(2, i + 7).css("border", "1px solid " + (_UTF ? "#ABABAB" : "red"));
  80. _UDAD.parentg(1, i + 7).find("i").css("display", _UTF ? "" : "block")
  81. }
  82. //设置用户真实姓名、 昵称、 签名、 性别、 邮箱 、电话号码
  83. for (i = 0; i < _UDE.length; i++) { //设置值
  84. typeof _UDE[i] == "string" ? _UDAD[i + 1].value = (_UIF[_UDE[i]] || "") : _UDAD.addAttrArray(_UDE[i], i + 1);
  85. }
  86. //用户基本信息设置
  87. _UDAD[1].disabled = (_UIF.TrueName && _UIF.IsAllowAccess != 0);
  88. _UDAD = $("div", _UDTD[0]);
  89. _UDAD[6].style.display = _UIF.UserThumbnailImageHead ? "none" : "block";
  90. $($("img", _UDTD[0])[0] || $$("img")).addAttrArray({ "title": $("div#UD_SYZOVTCNR", _UDTD[1])[0].innerText = _UIF.UserName, //用户头像显示
  91. "onerror": U.M.ImgError, "src": U.M.GetImgU(_UIF.UserThumbnailImageHead)
  92. }).appendTo(_UDAD[3]);
  93. $("div#UD_SYZCRZ", _UDTD[0])[0].innerText = "账号登陆:" + _UIF.UserName;
  94. //用户详细信息设置 用户出生年月日 城市
  95. U.U.LMBD($("#UD_SYZCLRU", _UDTD[0])[0], _UIF.Birthday);
  96. U.MD.DynamicLoad("/js/UU/U.U.C.js", "js", [[U.U.LCJ, [$("#UD_SYZCLRUO", _UDTD[0])[0], _UIF]]]);
  97. return _UDTD; //加载生日和地区
  98. }
  99. /**
  100. * 个人资料切换 普通信息和密码密保切换
  101. *
  102. * @param {element} 个人资料内容
  103. * @param {array} 切换变化参数
  104. * @param {element} 弹出元素
  105. * @returns {array} 是否登录
  106. */
  107. U.U.SDKGEZL = function (UDOD, UDE) {
  108. var i, j;
  109. var _UDAD = $(UDOD).Child(); //获取个人信息 找回密码 两个函数
  110. var _UDCD = $(_UDAD[1]).Child();
  111. //var _UKE = [1, 4]; //下面介绍的内容
  112. // $(_UDCD[1]).addAttrArray({ "onclick": [_UTF ? [U.D.CloseWindow, [UDFD]] : [U.U.SDKGEZL, [UDOD, ["block", "none"], UDFD]]], //退出或者返回
  113. // "innerText": (_UTF ? "退出" : "返回") + "设置"
  114. // });
  115. if (UDE[0] == "block") {
  116. _UDCD[0].onclick = U.M.apply(_UDCD[0], [[U.U.UpdateUserBasicInfo, [UDOD]]]); //确定事件
  117. }
  118. else {
  119. _UDCD[0].onclick = U.M.apply(_UDCD[0], [[U.U.MDKMMSZ, [UDOD]]]); //确定事件
  120. }
  121. //切换效果
  122. $(".UD_SYZCL")[0].style.display = 'none';
  123. $(".UD_SYZCR")[0].style.display = 'none';
  124. $(".UD_SYZCLT")[0].style.display = 'none';
  125. $(".UD_SYZCLRT")[0].style.display = 'none';
  126. $(".UD_SYZOV")[0].style.display = 'block';
  127. // for (i = 0; i < 2; i++) {
  128. // _UDCD = $(_UDAD[i * 2]).Child();
  129. // for (j = 0; j < UDE.length; j++) { _UDCD[j].style.display = UDE[j]; }
  130. // }
  131. }
  132. /**
  133. * 用户资料提示显示和取消
  134. *
  135. * @param {element} 个人资料内容
  136. * @param {boolean} 切换变化参数
  137. * @param {格式} 格式参数
  138. */
  139. U.U.ZLXSQX = function (UDOD, UTF, UTP) {
  140. var _UFT = UTF || U.MS[UTP].test(UDOD.value.trim());
  141. U.U.R[(_UFT ? "D" : "B") + "TT"](UDOD, !UTF);
  142. $(UDOD).parentg(2).css("border", "1px solid " + (_UFT ? "#ABABAB" : "red"));
  143. U.D.SY.ET["ZL"][UTP || "PN"] = _UFT;
  144. }
  145. //#endregion
  146. //#region 背景设置
  147. //查看背景设置
  148. U.U.CKBJSZ = function () {
  149. }
  150. //#endregion
  151. //#region select选择使用区域
  152. //加载用户城市
  153. U.U.LCJ = function (UDOD, UIF) {
  154. var i, _UIE,
  155. _UDSD = $("select", UDOD),
  156. _UGE = U.U.C.J["citylist"],
  157. _UDE = [[null, "co", "Country"], ["cp", "p", "Province"], ["c", "n", "City"]];
  158. for (i = 0; i < _UDE.length; i++) {
  159. _UIE = U.U.SZST(_UDSD[i], _UGE, _UDE[i][1], UIF[_UDE[i][2]] || "其它");
  160. if (i == 2) { return; }
  161. _UGE = _UGE[_UIE][_UDE[i + 1][0]];
  162. } //设置用户城市
  163. }
  164. //修改用户城市时执行
  165. U.U.XGSZST = function (UDAD, UAE, UTF) {
  166. var i, _UIE = UDAD[0].selectedIndex,
  167. _UDE = UTF ? [U.U.C.J["citylist"], ["cp", "p"], ["c", "n"]] : ["", [12, 0], [U.MT.getDayOfMonth[UDAD[0].options[UDAD[0].selectedIndex].value, UDAD[1].options[UDAD[1].selectedIndex].value], 0]],
  168. _UGE = _UDE[0];
  169. for (i = 0; i < UDAD.length; i++) {
  170. if (i >= UAE[0] || i <= UAE[UAE.length]) {
  171. U.U.SZST(UDAD[i], _UGE, _UDE[i][1], _UIE);
  172. }
  173. if (i != UDAD.length - 1) {
  174. if (UTF) {
  175. _UGE = _UGE[UDAD[i].selectedIndex][_UDE[i + 1][0]];
  176. }
  177. else { _UGE = _UDE[i + 1][0]; }
  178. _UIE = Math.floor((_UGE.length || _UGE) / 2);
  179. }
  180. }
  181. }
  182. //加载用户生日
  183. U.U.LMBD = function (UDOD, UBE) {
  184. var i, _UDSD = $("select", UDOD),
  185. _UAE = U.MT.getYearMonthDay(UBE),
  186. _UDE = [[(new Date()).getFullYear() - 1939, 1939], [12, 0], [U.MT.getDayOfMonth[_UAE[0], _UAE[1]], 0]];
  187. for (i = 0; i < _UDSD.length; i++) {
  188. U.U.SZST(_UDSD[i], _UDE[i][0], _UDE[i][1], _UAE[i]);
  189. } //设置用户生日
  190. }
  191. //设置Select
  192. U.U.SZST = function (UDOD, UL, UC, UZ) {
  193. var i, _UV, _UDTD, _UFT,
  194. _UTF = UL.length == null,
  195. _UCL = UDOD.options.length = _UTF ? UL : UL.length;
  196. for (i = 0; i < _UCL; i++) {
  197. _UDTD = UDOD.options[i];
  198. _UV = _UDTD.text = _UDTD.value = _UTF ? UC + i + 1 : UL[i][UC];
  199. (_UV == UZ) && (UDOD.selectedIndex = i, _UFT = true);
  200. }
  201. (!_UFT && typeof UZ == "string") && (UDOD.selectedIndex = UZ);
  202. return UDOD.selectedIndex;
  203. }
  204. //#endregion
  205. //#region 切换区域
  206. //密码密保设置切换区域
  207. U.U.MDKGEZL = function (UIE) {
  208. var i, _UDOD = $("#UD_SYZOV"),
  209. _UDAD = $("div", _UDOD[0]), _UDID = $("input", _UDOD[0]),
  210. _UAE = ["当前", "新", "确认"],
  211. _UDE = [["密码", "定期更换密码可以让你的账号更加安全。建议密码采用字母和数字混合, 避免与账号名、生日、手机号等部分或者完全相同避免使用有规律的数字或者字母, 并且不短于6位。"], ["密保", "设置账号密保识别身份, 方便找回账号、设置和使用安全服务等。"]][UIE];
  212. U.D.SY.ET["SZ"] = UIE;
  213. _UDID.addAttrArray({ "value": "" });
  214. for (i = 0; i < _UDID.length; i++) {//去除提示
  215. _UDID[i].onchange();
  216. }
  217. // _UDAD[1].innerText = "修改账号" + _UDE[0];
  218. _UDE[0] == '密码' ? _UDAD[1].innerText = '修改密码' : _UDAD[1].innerText = '密保设置';
  219. // _UDAD[4].innerText = _UDAD[4].title = _UDE[0] + "设置"; _UDAD[7].innerText = _UDE[1];
  220. _UDAD[7].innerText = _UDE[1];
  221. _UDAD = $($(_UDOD[0]).Child()[2]).Child();
  222. for (i = 1; i < _UDAD.length; i++) {
  223. (i != 3) && ($(_UDAD[i]).Child()[1].innerText = _UAE[i > 3 ? i - 2 : i - 1] + "账号" + _UDE[0]);
  224. if (i == 2 && UIE && !US.userInfo.SecurityAnswer) {
  225. _UDAD[1].style.display = "none";
  226. }
  227. }
  228. }
  229. //#endregion
  230. //#region 普通信息
  231. //普通信息设置保存
  232. U.U.UpdateUserBasicInfo = function (UDOD) {
  233. var i, j = 0,
  234. _userinfo = US.userInfo,
  235. //此处需要修改。不用下面的全局变量。
  236. _UDE = U.D.SY.ET["ZL"],
  237. _selectElements = $("select", UDOD),
  238. _inputs = $("input", UDOD);
  239. var _modifyuserinfo = {
  240. "TrueName": _inputs[1].value,
  241. "UserNickName": _inputs[3].value,
  242. "UserTelephoneNumber": _inputs[8].value,
  243. "UserIDCard": _userinfo["UserIDCard"],
  244. "UserRemarks": _inputs[4].value,
  245. "UserIndividualitysignature": _inputs[4].value,
  246. "UserSex": _inputs[6].checked,
  247. "UserEmail": _inputs[7].value,
  248. "Country": _selectElements[3].value,
  249. "Province": _selectElements[4].value,
  250. "City": _selectElements[5].value,
  251. "Birthday": U.MT.toTimeStamp(U.MT.toTimeStamp(_selectElements[0].value + "-" + _selectElements[1].value + "-" + _selectElements[2].value, "-"))
  252. };
  253. for (i in _UDE) {
  254. if (!_UDE[i]) {
  255. U.Alert("请修改红线的错误");
  256. return false;
  257. }
  258. j++;
  259. }
  260. if (_inputs[0].value) {
  261. U.U.ULIMG(_inputs[0], U.U.MDKXTX);
  262. } //用户头像上传 $(_inputs[0]).Parent().innerHTML += "";
  263. //如果j>0表示有错误,如果有用没有修改信息,也不插入数据
  264. if (j && !_$(US.userInfo).IsTF(_modifyuserinfo)) {
  265. U.A.Request(US.Auth, (["UpdateUserBasicInfo", _modifyuserinfo.TrueName, _modifyuserinfo.UserNickName, _modifyuserinfo.UserTelephoneNumber, _modifyuserinfo.UserIDCard, _modifyuserinfo.UserRemarks, _modifyuserinfo.UserIndividualitysignature,
  266. _modifyuserinfo.UserSex, _modifyuserinfo.UserEmail, _modifyuserinfo.Country, _modifyuserinfo.Province, _modifyuserinfo.City, _selectElements[0].value + "-" + _selectElements[1].value + "-" + _selectElements[2].value]), U.U.UpdateUserBasicInfoAsyn, ["", _modifyuserinfo, _inputs]);
  267. }
  268. U.Alert("设置同步中");
  269. }
  270. //普通信息设置异步
  271. U.U.UpdateUserBasicInfoAsyn = function (r) {
  272. var i, _UCE = {},
  273. _UIF = US.userInfo,
  274. _UAE = [["UserNickName", "Name"], ["UserIndividualitysignature", "IT"]],
  275. context = r.context,
  276. _UDE = context[1],
  277. _UDID = context[2];
  278. r = r.value;
  279. (r) && (_UDID[7].value = _UDE["UserEmail"] = US.userInfo["UserEmail"]);
  280. U.D.SY.ET["ZL"] = {}; //邮箱不允许重复修改
  281. for (i = 0; i < _UAE.length; i++) {
  282. (_UDE[_UAE[i][0]] != _UIF[_UAE[i][0]]) && (_UCE[_UAE[i][1]] = _UDE[_UAE[i][0]], U.D.SY.TYSZTX(_UCE));
  283. }
  284. _$(_UIF).Change(_UDE); //修改后的样式
  285. }
  286. //选择男女
  287. U.U.MDKXZNN = function (UDOD) {
  288. var i, _UDID = $("input", $(UDOD).Parent(2)); U.D.SY.ET["ZL"]["Sex"] = true;
  289. for (i = 0; i < _UDID.length; i++) { _UDID[i].checked = (_UDID[i] == UDOD); }
  290. }
  291. //#region 上传用户头像
  292. //上传头像到服务器处理
  293. U.U.GLUI = function (UDOD, UDE) {
  294. U.UP.uploading[UDOD], UDE[0], UDE[1], "http://main.1473.cn/USupfile.ashx?iframename=" + UDE[2];
  295. }
  296. //信息上传查看
  297. /*
  298. 上传头像处理函数
  299. 参数:r[0]为name属性等于UD_SYZCLTSI的div元素。
  300. r[1]为数组:格式为:"headimg",回调函数U.U.MDKSCTX,class名为UD_SYZCLTSI的div元素。
  301. r[2]为图片文件流。
  302. */
  303. U.U.DI = function (r) {
  304. var _UDID = r.UpObj[0]; //name属性为UD_SYZCLTSI的上传框
  305. var context = r.context; //简化后面的代码,不再带r。
  306. var _UTF = context[0]; //值为headimg,
  307. var _UCB = context[1]; //上传完毕后的回调函数,指向U.U.MDKSCTX。
  308. var r = r.value; //上传内容,
  309. //r[0]为文件内容,成功上传
  310. if (r && isNaN(r[0])) {
  311. if (_UTF != "headimg") {
  312. U.D.Img.Img(US.userInfo, { "Thm": r[0], "Img": r[0] });
  313. }
  314. //执行回调函数,传递参数
  315. (_UCB) && (_UCB(context, r));
  316. }
  317. else {
  318. if (document.selection) {
  319. _UDID.select();
  320. document.selection.clear();
  321. }
  322. else {
  323. _UDID.outerHTML += ""; _UDID.value = "";
  324. }
  325. U.Alert("文件格式或者文件大小不符合要求。");
  326. }
  327. }
  328. /*
  329. 上传头像回调函数。
  330. 参数一:URC,格式为:"headimg",回调函数U.U.MDKSCTX,class名为UD_SYZCLTSI的div元素。
  331. 参数二:URE,上传文件数据流。
  332. */
  333. U.U.MDKSCTX = function (URC, URE) {
  334. $("img", $(URC[2]).Parent())[0].src = URE[0]; //找到上传头像区域,赋予上传图片信息。
  335. }
  336. //上传头像到硬盘
  337. U.U.ULIMG = function (UDOD, UCB) {
  338. if (UDOD.value) { U.U.GLUI(UDOD, [U.U.AsynULIMG, [UCB], "UploadHeadImage"]); }
  339. }
  340. //上传头像到硬盘异步
  341. U.U.AsynULIMG = function (r) {
  342. var _UDE, _UIF = US.userInfo, context = r.context, _UCB = context[0], _URE = r = r.value;
  343. if (r) {
  344. _$(_UIF).Change({ "UserImageHead": _URE.UserFilesServerName, "UserThumbnailImageHead": _URE.UseFilesServerThumbnailName }); //用户头像的修改
  345. US.Disk.UserDisk[0].push(_UDE = new U.Dk.M.Entity(_URE.UserFilesID, _URE.UserFilesSize, _URE.UserDirectoryID, _URE.UserFilesName.addEllipsis(10), _URE.UserFilesName, _URE.UserFilesExtendName, _URE.UserFilesServerName, new Date(), US.fs + _URE.UseFilesServerThumbnailName, 99999, null, null, 1, "", "", null, _UIF.UserId, _UIF.UserNickName, _UIF.UserName, _UIF.UserThumbnailImageHead)); //添加到网盘
  346. _UIF.DiskHeadImg.push(_UDE); (_UCB) && (_UCB(context, r)); U.Alert("保存头像成功"); //重新显示
  347. }
  348. }
  349. //上传用户头像到网盘异步
  350. U.U.MDKXTX = function (UCE, URE) {
  351. U.D.SY.TYSZTX({ "Img": URE.UseFilesServerThumbnailName }); //设置所有的头像
  352. }
  353. //用户资料错误提示
  354. U.U.MDKCWTS = function (UDOD, UTF, UTP) {
  355. var _UDC = "red", _UFT = false;
  356. (UDOD.value == "" || UTF.test(UDOD.value)) && (_UDC = "#ababab", _UFT = true);
  357. U.D.SY.ET["ZL"][UTP] = _UFT; $(UDOD).Parent(2).style.borderColor = _UDC;
  358. }
  359. //#endregion
  360. //#endregion
  361. //#region 密码密保设置
  362. //判断和指定的密保是否相同
  363. U.U.MDKMMYS = function (UDOD) {
  364. if (!UDOD.value) {
  365. U.U.AsynMDKMMYS([null, UDOD], true, null);
  366. }
  367. else {
  368. U.U.CNP(UDOD, U.D.SY.ET["SZ"], U.U.AsynMDKMMYS);
  369. } //判断
  370. }
  371. //检测当前用户输入的密码是否正确
  372. U.U.CNP = function (UDOD, UTF, UCB) {
  373. U.A.Request(US.Auth, ["Check" + (UTF ? "SecurityCode" : "Password"), US.userInfo.userid, UDOD.value]), U.U.AsynCNP, ["", UDOD, UTF, UCB];
  374. }
  375. //异步判断密码是否正确
  376. U.U.AsynCNP = function (r) {
  377. var context = r.context,
  378. _UDOD = context[1],
  379. _UTF = context[2],
  380. _UCB = context[3];
  381. r = r.value;
  382. (_UCB) && (_UCB(context, r));
  383. }
  384. //判断两次输入的是否相同
  385. U.U.MDKPDYW = function (UDOD) {
  386. var _UTF,
  387. _UDID = $("input", $(UDOD).Parent(4));
  388. (_UTF = (_UDID[1].value != _UDID[2].value)) && (U.Alert("两次密码不统一"));
  389. U.U.AsynMDKMMYS([null, _UDID[2]], !_UTF, "UNPW");
  390. }
  391. //设置密码或者密保
  392. U.U.MDKMMSZ = function (UCB) {
  393. var i, _UAE = ["PN", "UPN", "UNPW"],
  394. _UDE = U.D.SY.ET["ZL"],
  395. _UTF = U.D.SY.ET["SZ"],
  396. _UDOD = $("#UD_SYZOVTC")[0],
  397. _UDID = $("input", _UDOD);
  398. for (i = 0; i < _UAE.length; i++) {
  399. if (!_UDE[_UAE[i]]) {
  400. U.Alert("填写资料或者修改红线区"); return;
  401. }
  402. else { delete _UDE[_UAE[i]]; }
  403. };
  404. (UCB) && (UCB());
  405. if (_UDID[0].value == _UDID[1].value) {
  406. U.U.AsynMDKMMSZMM({ "context": ["", _UDID[2], _UDOD, (_UTF = _UTF ? "SecurityAnswer" : "UserPassword")], "r": US.userInfo[_UTF] });
  407. } //相同直接通过
  408. else {
  409. if (_UTF) {
  410. //U.U.MDKMMSZMB(_UDID[2], _UDOD);
  411. U.A.Request(US.Auth, ["EditSecurityCode", US.userInfo.userid, _UDID[2].value], U.U.AsynMDKMMSZMM, ["", _UDID[2], _UDOD, "SecurityAnswer"]); //保存到数据库
  412. }
  413. else {
  414. //U.U.MDKMMSZMM(_UDID[2], _UDOD);
  415. U.A.Request(US.Auth, ["UpdateUserPassword", US.userInfo.userid, US.userInfo["LoginId"], _UDID[2].value], U.U.AsynMDKMMSZMM, ["", _UDID[2], _UDOD, "UserPassword"]); //保存到数据库
  416. }
  417. U.Alert("与服务器同步中...");
  418. } //服务器
  419. }
  420. //密保设置异步
  421. U.U.AsynMDKMMSZMM = function (r) {
  422. var context = r.context,
  423. _UDOD = context[1],
  424. _UDPD = context[2],
  425. _UTF = context[3];
  426. r = r.value;
  427. if (r) {
  428. U.Alert("成功设置");
  429. US.userInfo[_UTF] = r; //修改指定的
  430. U.U.SDKGEZL($(_UDPD).Parent("UD_SYZ"), ["block", "none"]); //切回个人设置
  431. }
  432. }
  433. //设置变化
  434. U.U.AsynMDKMMYS = function (UCE, UQE, UTF) {
  435. var _UDC = "red", _UDOD = UCE[1];
  436. (UQE) && (_UDC = "#ababab");
  437. $(_UDOD).Parent(2).style.borderColor = _UDC;
  438. return (U.D.SY.ET["ZL"][UTF || "PN"] = (UQE ? true : false));
  439. }
  440. //#endregion
  441. //#region 检查资料完整度
  442. U.U.CUD = function () {
  443. if (US.userInfo.userid) {
  444. var i, j = 0,
  445. _UDE = ["UserNickName", "UserEmail",
  446. "UserTelephoneNumber", "TrueName", "UserIDCard", "Country",
  447. "Province", "City", "Birthday", "SecurityAnswer"];
  448. for (i = 0; i < _UDE.length; i++) {
  449. if (US.userInfo[_UDE[i]]) { j++; }
  450. };
  451. return Math.round(j / _UDE.length * 100);
  452. }
  453. }
  454. //#endregion