forgetPwd.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>忘记密码</title>
  6. <meta name="format-detection" content="telephone=no"/>
  7. <meta name="viewport"
  8. content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
  9. <meta name="apple-mobile-web-app-capable" content="yes"/>
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
  11. <link rel="stylesheet" href="../../../css/cross.css" type="text/css"/>
  12. <link rel="stylesheet" href="../../../css/cross.ui.css" type="text/css"/>
  13. <link rel="stylesheet" type="text/css" href="../../../css/ss-style.css">
  14. <link rel="stylesheet" type="text/css" href="../../../iconfont/iconfont.css"/>
  15. <style>
  16. .n-list-info {
  17. position: relative;
  18. }
  19. .searchbar-clear {
  20. position: absolute;
  21. width: 28px;
  22. height: 28px;
  23. right: 0;
  24. top: 8px;
  25. opacity: 0;
  26. pointer-events: none;
  27. background-position: center;
  28. background-repeat: no-repeat;
  29. background-image: url(../../../images/delete01_pre.png);
  30. -webkit-background-size: 20px 20px;
  31. background-size: 20px 20px;
  32. -webkit-transition-duration: 300ms;
  33. transition-duration: 300ms;
  34. cursor: pointer;
  35. }
  36. #div-yzm {
  37. width: 80px;
  38. height: 29px;
  39. border: 1px solid #4DCD70;
  40. color: #4DCD70;
  41. font-size: 14px;
  42. line-height: 29px;
  43. text-align: center;
  44. border-radius: 10px;
  45. margin-top: 7px;
  46. }
  47. .c-btn-dcdcdc {
  48. background: #DCDCDC;
  49. }
  50. .c-btn.active {
  51. background: #4DCD70;
  52. }
  53. .mui-content-pad{
  54. margin-top: 0px;
  55. }
  56. .btn-lt {
  57. position: absolute;
  58. left: 10px;
  59. }
  60. .btn-rt{
  61. position: absolute;
  62. right: 10px;
  63. }
  64. a {
  65. text-decoration: none;
  66. color: #17b3ec;
  67. font-size: 14px;
  68. }
  69. .display{display: none}
  70. .iconImg{width:26px}
  71. </style>
  72. </head>
  73. <body>
  74. <!--<div class="h45">
  75. <div class="demo-comtop">
  76. <a class="mui-action-back"></a>
  77. <h1>登录</h1>
  78. </div>
  79. </div>-->
  80. <div class="main">
  81. <div id="idcardBox">
  82. <ul class="n-list edit-info registered c-border-tb mt15 c-f15 form-register">
  83. <li>
  84. <div class="n-list-key" style="width: 2.3em;">
  85. <img src="../images/zhanghao_icon.png"
  86. style="width: 20px; height: 26px;padding-left: 3px;padding-top: 10px;">
  87. <!--<i class="iconfont icon-shouji1"></i>-->
  88. </div>
  89. <div class="n-list-info">
  90. <input id="idcardTxt" maxlength="18" minlength="11" type="text" class="width-100 c-f16 c-5b5b5b"
  91. placeholder="身份证号" value="">
  92. <a href="#" class="searchbar-clear"></a>
  93. </div>
  94. <div id="checkIdCard" class="n-list-key pl15 c-17b3ec" >
  95. <span>身份验证</span>
  96. </div>
  97. <div id="checkIdCardmes" class="n-list-key pl15 display" style="color: #4dcd70">
  98. <span>验证通过</span>
  99. </div>
  100. </li>
  101. <li>
  102. <div class="n-list-key" style="width: 2.3em;">
  103. <i class="iconfont icon-shouji1"></i>
  104. </div>
  105. <div class="n-list-info">
  106. <input id="txtMobile" type="tel" class="width-100 c-f16 c-5b5b5b" maxlength="11" placeholder="手机号" disabled/>
  107. <a href="#" class="searchbar-clear"></a>
  108. </div>
  109. </li>
  110. </ul>
  111. </div>
  112. <div id="phoneBox" >
  113. <ul class="n-list edit-info registered c-border-tb mt15 c-f15 form-register">
  114. <li>
  115. <div class="n-list-key" style="width: 2.3em;">
  116. <i class="iconfont icon-yanzhengma01"></i>
  117. </div>
  118. <div class="n-list-info">
  119. <input id="txtCode" type="text" class="width-100 c-f16 c-5b5b5b" placeholder="请输入验证码"/>
  120. <a href="#" class="searchbar-clear"></a>
  121. </div>
  122. <div id="messageCode1" class="n-list-key pl15 c-17b3ec" onclick="sendCode()">
  123. <span>获取短信验证码</span>
  124. </div>
  125. <div id="messageCode2" class="n-list-key pl15 c-999999" style="display: none;">
  126. <span id="message" ></span>
  127. </div>
  128. </li>
  129. <li>
  130. <div class="n-list-key">
  131. <span class="f-fs16 c-323232">设置密码</span>
  132. </div>
  133. <div class="n-list-info">
  134. <input type="password" class="width-100 c-f16 c-5b5b5b reg-pwd" placeholder="请输入密码"/>
  135. <a href="#" class="searchbar-clear"></a>
  136. </div>
  137. </li>
  138. <li>
  139. <div class="n-list-key">
  140. <span class="f-fs16 c-323232">确认密码</span>
  141. </div>
  142. <div class="n-list-info">
  143. <input id="apwd" type="password" class="width-100 c-f16 c-5b5b5b" placeholder="请再次输入密码"/>
  144. <a href="#" class="searchbar-clear"></a>
  145. </div>
  146. </li>
  147. </ul>
  148. <div class="mb15 mlr15 mt20">
  149. <a id="phoneBtn" href="javascript:;" style="font-size: 18px;"
  150. class="c-btn c-btn-dcdcdc c-btn-full c-btn-radius c-f16">完成</a>
  151. </div>
  152. </div>
  153. <p style="font-size: 16px;text-align: center;color: #323232;" class="mr15 c-t-right">返回<span style="font-size: 17px;font-style: italic;color: #17b3ec;" onclick="accountShenshu()">账号申诉</span></p>
  154. </div>
  155. </body>
  156. <script type="text/javascript" src="../../../js/jquery/2.1.3/jquery.js"></script>
  157. <script type="text/javascript" src="../../../js/common_http.js"></script>
  158. <script type="text/javascript" src="../../../js/weixin_common.js"></script>
  159. <link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
  160. <script src="../../../widget/artDialog/6.0.5/js/dialog-plus.js"></script>
  161. <script type="text/javascript" src="../../../js/commit_validate.js"></script>
  162. <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
  163. <script src="../../../js/mui.min.js"></script>
  164. <script type="text/javascript">
  165. var dd = dialog({contentType: 'load', skin: 'bk-popup', content: '验证中...'});
  166. var Request = new Object();
  167. Request = GetRequest();
  168. var openid = Request["openid"];
  169. var type = Number(Request["type"]);
  170. var mobile1 = Request["mobile"];
  171. var clock = "";
  172. var nums = 60;
  173. var loginParams = Request["loginParams"];
  174. var $phoneBox = $('#phoneBox');
  175. var $idcardBox = $('#idcardBox');
  176. bindEvents();
  177. if (loginParams) {
  178. loginParams = JSON.parse(decodeURIComponent(Request["loginParams"]));
  179. }
  180. $(function () {
  181. var userAgent = window.localStorage.getItem(agentName);
  182. if (userAgent) {
  183. var paurl = "";
  184. if (type == 0) {
  185. paurl = "wx/html/home/html/login.html?type=0&openid=" + openid;
  186. }
  187. else {
  188. if (mobile1) {
  189. paurl = "wx/html/home/html/login.html?type=" + type + "&openid=" + openid + "&mobile=" + mobile1;
  190. }
  191. else {
  192. paurl = "wx/html/home/html/login.html?type=" + type + "&openid=" + openid;
  193. }
  194. }
  195. //从后台那边获取签名等信息
  196. var params = {};
  197. params.pageUrl = window.location.href;
  198. $.ajax(server + "weixin/getSign", {
  199. data: params,
  200. dataType: "json",
  201. type: "post",
  202. success: function (res) {
  203. if (res.status == 200) {
  204. var t = res.data.timestamp;
  205. var noncestr = res.data.noncestr;
  206. var signature = res.data.signature;
  207. wx.config({
  208. //debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  209. appId: appId, // 必填,公众号的唯一标识
  210. timestamp: t, // 必填,生成签名的时间戳
  211. nonceStr: noncestr, // 必填,生成签名的随机串
  212. signature: signature,// 必填,签名,见附录1
  213. jsApiList: [
  214. 'closeWindow'
  215. ] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
  216. });
  217. }
  218. }
  219. });
  220. wx.ready(function () {
  221. wx.closeWindow();
  222. });
  223. }
  224. else {
  225. if (!openid) {
  226. dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: 'openid获取失败'}).show();
  227. }
  228. if (mobile1) {
  229. $("#txtMobile").val(mobile1);
  230. }
  231. }
  232. })
  233. function bindEvents() {
  234. $("#checkIdCard").on("click", function () {
  235. var idcard = $('#idcardTxt').val();
  236. var data = {}
  237. if (idcard == "") {
  238. dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: '身份证不能为空'}).show();
  239. return;
  240. }
  241. if (!isIdcard(idcard)) {
  242. dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: '请输入正确的身份证号'}).show();
  243. return;
  244. }
  245. data.idCard = idcard;
  246. sendPost("weixin/getMobile", data, "json", "post", operateFailed, operateSuccesss);
  247. function operateSuccesss(res) {
  248. if (res.status == -1) {
  249. dd.close();
  250. if (res && res.msg) {
  251. dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: res.msg}).show();
  252. setTimeout(function () {
  253. mui.openWindow({
  254. url: "regist-info.html",
  255. waiting: {
  256. autoShow: false, //自动显示等待框,默认为true
  257. title: '正在加载...'
  258. }
  259. });
  260. },1500)
  261. return;
  262. }
  263. } else if (res.status == -2) {
  264. dd.close();
  265. if (res && res.msg) {
  266. dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: '您还未绑定手机,无法重置密码,请尝试使用默认密码登录。'}).show();
  267. setTimeout(function () {
  268. mui.openWindow({
  269. url: "zhmm-login.html",
  270. waiting: {
  271. autoShow: false, //自动显示等待框,默认为true
  272. title: '正在加载...'
  273. }
  274. });
  275. },1500)
  276. }
  277. } else if (res.status == 200) {
  278. dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: res.msg}).show();
  279. var mobile = res.data.mobile;
  280. var phoneNum = mobile.substring(0, 3) + "*****" + mobile.substring(8, 11);
  281. $('#txtMobile').val(mobile);
  282. $('#checkIdCard').hide().next().show();
  283. }
  284. };
  285. function operateFailed(res) {
  286. dd.close();
  287. if (res && res.msg) {
  288. dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: res.msg}).show();
  289. } else {
  290. dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: '校验失败'}).show();
  291. }
  292. };
  293. })
  294. $("#phoneBtn").on("click", function () {
  295. if ($(this).hasClass("active")) {
  296. commit();
  297. }
  298. else{
  299. dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content:'请将相关信息补充完毕'}).show();
  300. }
  301. })
  302. $("input").on("focus", function () {
  303. $(".searchbar-clear").css("pointer-events", "none").css("opacity", 0);
  304. if ($(this).val()) {
  305. $(this).next().css("pointer-events", "auto").css("opacity", 1);
  306. }
  307. }).on("input", function () {
  308. $(this).next().css("pointer-events", "auto").css("opacity", 1);
  309. });
  310. $("input").on('keyup',function(){
  311. var allHaveValue = true,
  312. a = $('input');
  313. $('input').each(function(){
  314. if(!$(this).val()) {
  315. allHaveValue = false;
  316. }
  317. });
  318. if(allHaveValue){
  319. $("#phoneBtn").addClass("active");
  320. }
  321. else{
  322. $("#phoneBtn").removeClass("active");
  323. }
  324. })
  325. $(".n-list-info").on("click", ".searchbar-clear", function () {
  326. $(this).prev().val("");
  327. $(this).css("pointer-events", "none").css("opacity", 0);
  328. $(this).prev().focus();
  329. return false;
  330. });
  331. }
  332. function sendCode() {
  333. var mobile = document.getElementById("txtMobile").value;
  334. if (!mobile) {
  335. dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: '请先校验身份证'}).show();
  336. return;
  337. }
  338. if (!isphone(mobile)) {
  339. dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: '手机号格式不正确'}).show();
  340. return;
  341. }
  342. $("#messageCode1").hide();
  343. document.getElementById("message").innerHTML = nums + '秒后可重新获取';
  344. $("#messageCode2").show();
  345. clock = setInterval(doLoop, 1000); //一秒执行一次
  346. var data = {};
  347. data.mobile = mobile;
  348. data.type = 2;
  349. sendPost("common/captcha", data, "json", "post", sendFailed, sendSuccesss);
  350. }
  351. //失败
  352. function sendFailed(res) {
  353. clearInterval(clock); //清除js定时器
  354. $("#messageCode1").show();
  355. $("#messageCode2").hide();
  356. nums = 60; //重置时间
  357. if (res && res.msg) {
  358. dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: res.msg}).show();
  359. } else {
  360. dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: '获取失败'}).show();
  361. }
  362. }
  363. function sendSuccesss(res) {
  364. if (res.status == 200) {
  365. }
  366. else {
  367. sendFailed(res);
  368. }
  369. }
  370. function doLoop() {
  371. nums--;
  372. if (nums > 0) {
  373. document.getElementById("message").innerHTML = nums + '秒后可重新获取';
  374. } else {
  375. clearInterval(clock); //清除js定时器
  376. $("#messageCode1").show();
  377. $("#messageCode2").hide();
  378. nums = 60; //重置时间
  379. }
  380. }
  381. var mobile;
  382. function commit() {
  383. mobile = document.getElementById("txtMobile").value;
  384. var captcha = document.getElementById("txtCode").value;
  385. if (!mobile || !captcha) {
  386. dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: '手机号和验证码不能为空'}).show();
  387. return;
  388. }
  389. if (!isphone(mobile)) {
  390. dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: '手机号格式不正确'}).show();
  391. return;
  392. }
  393. dd.showModal();
  394. //拼请求内容
  395. var data = {};
  396. data.mobile = mobile;
  397. data.captcha = captcha;
  398. data.type = 2;
  399. sendPost("common/check_captcha", data, "json", "post", operateFailed, operateSuccesss);
  400. }
  401. //失败
  402. function operateFailed(res) {
  403. dd.close();
  404. if (res && res.msg) {
  405. dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: res.msg}).show();
  406. } else {
  407. dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: '验证码验证失败'}).show();
  408. }
  409. }
  410. //成功调用登录接口
  411. function operateSuccesss(res) {
  412. var idcard = $('#idcardTxt').val();
  413. if (res.status == 200) {
  414. window.location.href = "login.html?type=" + type + "&openid=" + openid + "&mobile=" + mobile + '&idcard=' + idcard;
  415. dd.close();
  416. } else {
  417. //非200则为失败
  418. operateFailed(res);
  419. }
  420. }
  421. $('#accounts').on('tap',function(){
  422. mui.openWindow({
  423. id: "account_back",
  424. url: "../../yjfk/html/account_back.html",
  425. extras: {
  426. }
  427. });
  428. })
  429. function accountShenshu(){
  430. window.location.href = "../../yjfk/html/account_back.html?type=" + type + "&openid=" + openid;
  431. }
  432. </script>
  433. </html>