findpaypwd.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. <include file="Public:header_new" />
  2. <link rel="stylesheet" href="__PUBLIC__/intel/css/intlTelInput.css">
  3. <script src="__PUBLIC__/intel/js/intlTelInput.js"></script>
  4. <link rel="stylesheet" href="__PUBLIC__/Home/ecshe_css/pass.css">
  5. <style>
  6. .nochoose{
  7. width:30%;
  8. margin-left:2.5%;
  9. margin-top:10px;
  10. height:36px;
  11. line-height:36px;
  12. float:left;
  13. text-align:center;
  14. border:1px solid #ccc;
  15. border-radius:10px;
  16. cursor:pointer;
  17. }
  18. .choose{
  19. width: 30%;
  20. margin-left: 2.5%;
  21. margin-top: 10px;
  22. height: 36px;
  23. line-height: 36px;
  24. float: left;
  25. text-align: center;
  26. border: 1px solid #f5f5f5;
  27. border-radius: 10px;
  28. cursor: pointer;
  29. color: #f5f5f5;
  30. }
  31. </style>
  32. <div class="logsbox" style="margin-top:100px;margin-bottom:50px;" id="onebox">
  33. <h2>{:L('找回交易密码')}</h2>
  34. <div class="form-group">
  35. <input type="text" autocomplete="off" id="username" placeholder="{:L('用户登陆账号')}" onblur="usename_check()" />
  36. </div>
  37. <!--<div class="form-group">
  38. <input type="text" autocomplete="off" id="verify" placeholder="{:L('图形验证码')}" onblur="regverify()" />
  39. <div class="imgcode">
  40. <img src="{:U('Verify/code')}" title="{:L('换一张')}" onclick="this.src=this.src+'?t='+Math.random()" id="verifycode">
  41. </div>
  42. </div>
  43. <div class="form-group">
  44. <input type="text" autocomplete="off" id="mobile_verify" placeholder="{:L('动态验证码')}" />
  45. <a class="code-num" id="regBtn" onclick="SendCode()">{:L('获取验证码')}</a>
  46. </div>-->
  47. <div class="form-group">
  48. <input type="password" autocomplete="off" id="password" onblur="password()" placeholder="{:L('新交易密码')}" />
  49. </div>
  50. <div class="form-group">
  51. <input type="password" autocomplete="off" id="repassword" onblur="repassword()" placeholder="{:L('确认交易密码')}" />
  52. </div>
  53. <div class="form-button">
  54. <input type="button" name="index_submit" id="loginSubmin" onclick="to_next();" class="btn btn-primary" value="{:L('提交')}">
  55. </div>
  56. </div>
  57. <div class="logsbox" style="margin-top: 30px;margin-bottom: 100px;display:none;" id="twobox">
  58. <div class="form-group" style="margin-top:0px;">
  59. <h4 style="margin-bottom:10px;">备份助记词</h4>
  60. <p style="margin-bottom:10px;text-align: left;">请按顺序抄写助记词,确保证备份正确。</p>
  61. <div style="width:100%;height:150px;border-radius:5px;border:1px solid #ccc;background:#fbfbfb;">
  62. <ul id="mywords">
  63. <!--<?php //foreach($t_words as $k=>$v){?>
  64. <li style="width:33.33%;height:36px;line-height:36px;float:left;text-align:center;"><?php //echo $v;?></li>
  65. <?php //}?>-->
  66. </ul>
  67. </div>
  68. <p style="margin-top:10px;text-align: left;">* 妥善保管助记词至隔离网络的安全地方</p>
  69. </div>
  70. <div class="form-button">
  71. <input type="button" name="index_submit" onclick="next_updata();" class="btn btn-primary" value="{:L('下一步')}">
  72. </div>
  73. </div>
  74. <div class="logsbox" style="margin-top: 30px;margin-bottom: 100px;display:none;" id="threebox">
  75. <div class="form-group" style="margin-top:0px;">
  76. <h4 style="margin-bottom:10px;">确认助记词</h4>
  77. <p style="margin-bottom:10px;text-align: left;">请按顺序点击助记词,以确认您正确的备份。</p>
  78. <div style="width:100%;height:150px;border-radius:5px;border:1px solid #ccc;background:#fbfbfb;">
  79. <ul id = "tlistid"></ul>
  80. </div>
  81. <div style="width:100%;height:150px;border-radius:5px;margin-bottom:10px;">
  82. <ul id="ld_words"></ul>
  83. </div>
  84. <p style="margin-top:15px;text-align: left;height:36px;"></p>
  85. </div>
  86. <input type="hidden" id="myusername" value=""/>
  87. <input type="hidden" id="newpwd" value=""/>
  88. <input type="hidden" id="renewpwd" value=""/>
  89. <div style="display:none;" id="buttondiv"></div>
  90. <div class="form-button">
  91. <input type="button" name="index_submit" id="loginSubmin" onclick="Update_new();" class="btn btn-primary" value="{:L('下一步')}">
  92. </div>
  93. </div>
  94. <script type="text/javascript">
  95. function to_next(){
  96. var username = $("#username").val();
  97. if(username == ''){
  98. layer.msg("请输入登陆账号"); return false;
  99. }
  100. var password = $("#password").val();
  101. if(password == ''){
  102. layer.msg("请输入新交易密码"); return false;
  103. }
  104. var repassword = $("#repassword").val();
  105. if(password != repassword){
  106. layer.msg("两次输入的密码不一致"); return false;
  107. }
  108. $("#myusername").val(username);
  109. $("#newpwd").val(password);
  110. $("#renewpwd").val(repassword);
  111. $.post("{:U('Login/getwords')}",
  112. {'username':username},
  113. function(data){
  114. if(data.code == 1){
  115. $.each(data.data,function(key,val){
  116. $("#mywords").append('<li style="width:33.33%;height:36px;line-height:36px;float:left;text-align:center;">' + val + '</li>');
  117. });
  118. $("#onebox").hide();
  119. $("#twobox").show();
  120. $("#threebox").hide();
  121. }else{
  122. layer.msg("该账号不存在!"); return false;
  123. }
  124. });
  125. }
  126. </script>
  127. <script type="text/javascript">
  128. function next_updata(){
  129. var username = $("#username").val();
  130. $.post("{:U('Login/getlwords')}",
  131. {'username':username},
  132. function(data){
  133. $.each(data.data,function(key,val){
  134. $("#ld_words").append('<li class="nochoose" onclick="choose_word('+"'"+val+"'"+","+key+')" id="lid_'+val+'">'+val+'</li>');
  135. });
  136. $("#onebox").hide();
  137. $("#twobox").hide();
  138. $("#threebox").show();
  139. });
  140. }
  141. </script>
  142. <script type="text/javascript">
  143. function choose_word(str,num){
  144. var strid = "tid_" + str;
  145. var word = str;
  146. var l_str = "lid_" + str;
  147. var ascid = num;
  148. $("#tlistid").append("<li style='width:33.33%;height:36px;line-height:36px;float:left;text-align:center;cursor: pointer' id = 'bword"+word+"'> " + word + "</li>");
  149. $("#buttondiv").append("<input type='hidden' id='"+ascid+"' value='"+word+"'>");
  150. $("#"+l_str).addClass('choose').removeAttr('onclick');
  151. }
  152. </script>
  153. <script type="text/javascript">
  154. function Update_new(){
  155. var val_a = $("#buttondiv input:eq(0)").val();
  156. var val_b = $("#buttondiv input:eq(1)").val();
  157. var val_c = $("#buttondiv input:eq(2)").val();
  158. var val_d = $("#buttondiv input:eq(3)").val();
  159. var val_e = $("#buttondiv input:eq(4)").val();
  160. var val_f = $("#buttondiv input:eq(5)").val();
  161. var val_g = $("#buttondiv input:eq(6)").val();
  162. var val_h = $("#buttondiv input:eq(7)").val();
  163. var val_i = $("#buttondiv input:eq(8)").val();
  164. var val_j = $("#buttondiv input:eq(9)").val();
  165. var val_k = $("#buttondiv input:eq(10)").val();
  166. var val_l = $("#buttondiv input:eq(11)").val();
  167. if(val_a== '' || val_b == '' || val_c == '' || val_d == '' || val_e == '' || val_f == '' || val_g == '' || val_h == '' || val_i == '' || val_j == '' || val_k == '' || val_l == '' ){
  168. layer.msg("助记词输入不完整"); return false;
  169. }
  170. var username = $("#myusername").val();
  171. var newpwd = $("#newpwd").val();
  172. var renewpwd = $("#renewpwd").val();
  173. if(username == '' || newpwd == ''){
  174. layer.msg("缺少重要参数,请重新填写资料"); return false;
  175. }
  176. $.post("{:U('Login/findpaypwd')}",
  177. {
  178. 'val_a':val_a,
  179. 'val_b':val_b,
  180. 'val_c':val_c,
  181. 'val_d':val_d,
  182. 'val_e':val_e,
  183. 'val_f':val_f,
  184. 'val_g':val_g,
  185. 'val_h':val_h,
  186. 'val_i':val_i,
  187. 'val_j':val_j,
  188. 'val_k':val_k,
  189. 'val_l':val_l,
  190. 'username':username,
  191. 'newpwd':newpwd,
  192. 'renewpwd':renewpwd
  193. },
  194. function(data){
  195. if(data.code==1){
  196. layer.msg(data.msg);
  197. setTimeout(function(args){
  198. window.location.href = "{:U('Login/index')}";
  199. },3000);
  200. }else{
  201. layer.msg(data.msg);
  202. setTimeout(function(args){
  203. window.location.reload();
  204. },3000);
  205. }
  206. });
  207. }
  208. </script>
  209. <script type="text/javascript">
  210. function regmobile() {
  211. var mobile = $('#mobile').val();
  212. var intlNumber = $("#mobile").intlTelInput("getSelectedCountryData");//获取国家代码
  213. var isValid = $("#mobile").intlTelInput("isValidNumber");//验证手机号码是否正确
  214. // console.log(isValid)
  215. // console.log(intlNumber['dialCode'])
  216. if (mobile == "" || mobile == null) {
  217. layer.tips('{$Think.lang.请输入手机号码}', '#mobile', { tips: 3 });
  218. return false;
  219. }
  220. if (isValid!=true) {
  221. layer.tips('{$Think.lang.手机号码不正确}', '#mobile', { tips: 3 });
  222. return false;
  223. }
  224. }
  225. function regverify() {
  226. var verify = $('#verify').val();
  227. if (verify == "" || verify == null) {
  228. layer.tips('{$Think.lang.请输入图形验证码 }', '#verify', { tips: 3 });
  229. return false;
  230. }
  231. }
  232. $("#mobile").intlTelInput({
  233. allowDropdown: true,
  234. // autoHideDialCode: true,
  235. // autoPlaceholder: "off",
  236. dropdownContainer: "body",
  237. // excludeCountries: ["us"],
  238. // formatOnDisplay: true,
  239. // geoIpLookup: function(callback) {
  240. // $.get("http://ipinfo.io", function() {}, "jsonp").always(function(resp) {
  241. // var countryCode = (resp && resp.country) ? resp.country : "";
  242. // callback(countryCode);
  243. // });
  244. // },
  245. initialCountry: "cn",
  246. nationalMode: true,
  247. // onlyCountries: ['us', 'fr', 'ca', 'jp','kr','de','cn','ru'],
  248. // placeholderNumberType: "MOBILE",
  249. // preferredCountries: ['cn', 'jp'],
  250. separateDialCode: true,
  251. utilsScript: "/Public/intel/js/utils.js"
  252. });
  253. </script>
  254. <script>
  255. var mbTest_username = /^(?![^a-zA-Z]+$)(?!\D+$).{5,15}$/;
  256. var mbTest_password = /^[a-zA-Z0-9_]{5,15}$/;
  257. function password() {
  258. var password = $('#password').val();
  259. if (password == "" || password == null) {
  260. layer.tips('{$Think.lang.请输入登录密码 }', '#password', { tips: 3 });
  261. return false;
  262. } else {
  263. if (!mbTest_password.test(password)) {
  264. layer.tips('{$Think.lang.密码格式为6~16 位, 不含特殊符号! }', '#password', { tips: 3 });
  265. return false;
  266. }
  267. }
  268. }
  269. function repassword() {
  270. var password = $('#password').val();
  271. var repassword = $('#repassword').val();
  272. if (repassword == "" || repassword == null) {
  273. layer.tips('{$Think.lang.请输入确认密码 }', '#repassword', { tips: 3 });
  274. return false;
  275. } else {
  276. if (!mbTest_password.test(repassword)) {
  277. layer.tips('{$Think.lang.密码格式为6~16 位, 不含特殊符号! }', '#repassword', { tips: 3 });
  278. return false;
  279. } else {
  280. if (password != repassword) {
  281. layer.tips('{$Think.lang.两次输入的密码不一致 }', '#repassword', { tips: 3 });
  282. return false;
  283. }
  284. }
  285. }
  286. }
  287. function SendCode(){
  288. var mobile = $("#mobile").val();
  289. var verify = $("#verify").val();
  290. var intlNumber = $("#mobile").intlTelInput("getSelectedCountryData");//获取国家代码
  291. var intnum = intlNumber['dialCode'];//获取国家代码
  292. var isValid = $("#mobile").intlTelInput("isValidNumber");//验证手机号码是否正确
  293. if (mobile == "" || mobile == null) {
  294. layer.tips('{$Think.lang.请输入手机号码}', '#mobile', { tips: 3 });
  295. return false;
  296. }
  297. if (isValid!=true) {
  298. layer.tips('{$Think.lang.手机号码不正确}', '#mobile', { tips: 3 });
  299. return false;
  300. }
  301. if (verify == "" || verify == null) {
  302. layer.tips('{$Think.lang.请先输入图形验证码}', '#verify', { tips: 3 });
  303. return false;
  304. }
  305. layer.load(0, {shade: [0.5,'#8F8F8F']});
  306. $.post("{:U('Verify/findpaypwd')}",{mobile:mobile,verify:verify,intnum:intnum},function(data){
  307. layer.closeAll();
  308. if(data.status==1){
  309. $('#regBtn').removeAttr('onclick');
  310. layer.msg(data.info,{icon:1});
  311. var obj = $('#regBtn');
  312. var wait = 60;
  313. var interval = setInterval(function() {
  314. obj.css('color', '#a7a7a7');
  315. obj.css('cursor', 'default');
  316. obj.removeAttr('onclick');
  317. obj.text(wait + '{$Think.lang.秒再次发送 }');
  318. wait--;
  319. if (wait < 1) {
  320. //obj.removeAttr("disabled");
  321. obj.css('color', '#00a7e1');
  322. obj.css('cursor', 'pointer');
  323. obj.attr("onclick","SendCode();");
  324. clearInterval(interval);
  325. obj.text('{$Think.lang.获取验证码 }');
  326. };
  327. }, 1000);
  328. }else{
  329. $("#verifycode").click();
  330. $('#regBtn').attr("onclick","SendCode();");
  331. layer.msg(data.info,{icon:2});
  332. }
  333. },"json");
  334. }
  335. function Update(){
  336. var username = $("#mobile").val();
  337. var mobile = $("#mobile").val();
  338. var verify = $("#verify").val();
  339. var mobile_verify = $("#mobile_verify").val();
  340. var password = $("#password").val();
  341. var repassword = $("#repassword").val();
  342. if (username == "" || username == null) {
  343. layer.tips('{$Think.lang.请输入手机号码 }', '#mobile', { tips: 3 });
  344. return false;
  345. }
  346. if (mobile == "" || mobile == null) {
  347. layer.tips('{$Think.lang.请输入手机号码 }', '#mobile', { tips: 3 });
  348. return false;
  349. }
  350. if (verify == "" || verify == null) {
  351. layer.tips('{$Think.lang.请输入图形验证码 }', '#verify', { tips: 3 });
  352. return false;
  353. }
  354. if (mobile_verify == "" || mobile_verify == null) {
  355. layer.tips('{$Think.lang.请输入手机验证码 }', '#mobile_verify', { tips: 3 });
  356. return false;
  357. }
  358. if (password == "" || password == null) {
  359. layer.tips('{$Think.lang.请输入新交易密码 }', '#password', { tips: 3 });
  360. return false;
  361. }
  362. if (repassword == "" || repassword == null) {
  363. layer.tips('{$Think.lang.请输入确认交易密码 }', '#repassword', { tips: 3 });
  364. return false;
  365. }
  366. if (password != repassword) {
  367. layer.tips('{$Think.lang.两次输入的密码不一致 }', '#repassword', { tips: 3 });
  368. return false;
  369. }
  370. $.post("{:U('Login/findpaypwd')}",{username:username,mobile:mobile,mobile_verify:mobile_verify,verify:verify,password:password,repassword:repassword},function(data){
  371. if(data.status==1){
  372. layer.msg(data.info,{icon:1});
  373. window.setTimeout("window.location='/'",1000);
  374. }else{
  375. layer.msg(data.info,{icon:2});
  376. }
  377. },"json");
  378. }
  379. </script>
  380. <script>
  381. $('#menu_top_index').addClass('current');
  382. $('title').html('{:L('找回交易密码')} - '+'{:L(C('web_title'))}');
  383. </script>
  384. <include file="Public:footer_pass"/>