user-setpaypwd-2.html 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>设置支付密码2-创业帮</title>
  6. <meta name="keywords" content="设置支付密码2-创业帮">
  7. <meta name="description" content="设置支付密码2-创业帮">
  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="设置支付密码2-创业帮">
  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">
  19. <div class="tc">
  20. <van-row class="pt8 pb8">
  21. <van-col offset="7" span="10">
  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. tipText: '请再次输入6位数字支付密码',
  44. value1: '',
  45. value2: '',
  46. showKeyboard: true,
  47. };
  48. },
  49. created() {
  50. this.value1 = PublicLib.getCookieInfo("setpaypwd");
  51. },
  52. watch: {
  53. value2(value) {
  54. if (value.length === 6) {
  55. if(this.value1 == this.value2){
  56. this.successToast();
  57. }else{
  58. this.giveToast();
  59. }
  60. }
  61. }
  62. },
  63. methods: {
  64. giveToast(){
  65. vant.Toast({
  66. message:'密码错误,请再次输入',
  67. onClose: () => {
  68. this.value2 = '';
  69. }}
  70. );
  71. },
  72. async successToast(){
  73. const Id = PublicLib.getCookieInfo("userId");
  74. const res = await postRequest('api/v1/users/setpaypwd?t='+Math.random(6),JSON.stringify({Id,PayPwd:this.value2}));
  75. vant.Toast({
  76. message:'设置密码成功',
  77. onClose: () => {
  78. //- 退回当前根节点
  79. PublicLib.GoBack({Level:2});
  80. }}
  81. );
  82. }
  83. },
  84. });
  85. </script>
  86. </body>
  87. </html>