user-changepaypwd-3.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>修改支付密码3-创业帮</title>
  6. <meta name="keywords" content="修改支付密码3-创业帮">
  7. <meta name="description" content="修改支付密码3-创业帮">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="修改支付密码3-创业帮">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. </head>
  17. <body class="bgc-back nopb">
  18. <div id="app" v-cloak>
  19. <div class="tc">
  20. <van-row class="pt8 pb8">
  21. <van-col offset="6" span="12">
  22. <div class="f12 c999 pt32 pb16">{{tipText}}</div>
  23. </van-col>
  24. </van-row>
  25. </div>
  26. <van-password-input :value="value2" :gutter="1" :focused="showKeyboard" @focus="showKeyboard = true"></van-password-input>
  27. <!-- 数字键盘-->
  28. <van-number-keyboard v-model="value2" random-key-order :show="showKeyboard" @blur="showKeyboard = false"></van-number-keyboard>
  29. </div>
  30. <script src="./static/js/klm-vv.min.js"></script>
  31. <script src="./static/js/appfunc.min.js"></script>
  32. <script src="./static/js/klm-axios-config.js"></script>
  33. <script src="./static/js/publicfn.js"></script>
  34. <script>
  35. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  36. // 可以通过下面的方式手动注册
  37. Vue.use(vant.Lazyload);
  38. // 在 #app 标签下渲染一个按钮组件
  39. let app = new Vue({
  40. el: '#app',
  41. data() {
  42. return {
  43. active: 0,
  44. tipText: '请再次输入6位数字支付密码',
  45. value1: '',
  46. value2: '',
  47. changepaypwd:{
  48. Id:'',
  49. NewPayPwd:'',
  50. PayPwd:'',
  51. },
  52. showKeyboard: true,
  53. };
  54. },
  55. mounted() {
  56. this.value1 = PublicLib.getCookieInfo('newpaypwd');
  57. this.PayPwd = PublicLib.getCookieInfo('paypwd');
  58. this.changepaypwd.Id = PublicLib.getCookieInfo('userId');
  59. },
  60. watch: {
  61. value2(value) {
  62. if (value.length === 6) {
  63. if(this.value1 == this.value2){
  64. this.successToast();
  65. }else{
  66. this.giveToast();
  67. }
  68. } else {
  69. console.log('');
  70. }
  71. },
  72. },
  73. methods: {
  74. giveToast(){
  75. vant.Toast({
  76. message:'两次输入密码不一致',
  77. onClose: () => {
  78. this.value2 = '';
  79. }
  80. }
  81. );
  82. },
  83. goback(){
  84. PublicLib.GoBack({Level:'0'});
  85. },
  86. async successToast(){
  87. //- 修改密码
  88. if(this.PayPwd){
  89. this.changepaypwd.NewPayPwd = this.value2;
  90. const res = await postRequest('api/v1/users/modifypaypwd',JSON.stringify(this.changepaypwd));
  91. PublicLib.putCookieInfo('paypwd', '');
  92. PublicLib.putCookieInfo('newpaypwd', '');
  93. if(res.status === '1') tips('修改支付密码成功!');
  94. setTimeout(()=>{
  95. PublicLib.GoBack({Level:'0'});
  96. },1000);
  97. } else {
  98. //- 重置密码
  99. const res = await postRequest('api/v1/users/forgetpaypwd?t='+Math.random(6),JSON.stringify({Id:this.changepaypwd.Id,PayPwd:this.value2}));
  100. PublicLib.putCookieInfo('newpaypwd', '');
  101. if(res.status === '1') tips('重置支付密码成功!');
  102. setTimeout(()=>{
  103. //- 回到根节点
  104. PublicLib.GoBack({Level:'0'});
  105. },1000);
  106. }
  107. }
  108. },
  109. });
  110. </script>
  111. </body>
  112. </html>