bind-account-password.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <view class="container">
  3. <view class="login-wrap">
  4. <view class="login-form">
  5. <u--form labelPosition="left" :model="userInfo" :rules="rules" ref="form1">
  6. <u-form-item label="密码" prop="password" labelWidth="auto" labelAlign="right">
  7. <u--input v-model="userInfo.password" placeholder="请输入6到18位的密码" border="bottom" maxlength="18"
  8. minlength="6" type="password"></u--input>
  9. </u-form-item>
  10. <u-form-item labelWidth="auto" labelAlign="right" label="确认密码" prop="password1" width="120">
  11. <u--input maxlength="20" v-model="userInfo.password1" placeholder="请再次输入密码" border="bottom"
  12. type="password"></u--input>
  13. </u-form-item>
  14. </u--form>
  15. </view>
  16. </view>
  17. <view @click="gotoSettingTransactionPassword()" class="op-btn-wrap">
  18. <view class="h-btn">
  19. <text>下一步</text>
  20. </view>
  21. </view>
  22. <view class="h-mark-desc">
  23. <view class="h-text">
  24. <text>*账号密码建议输入6到18位的数字、字母和特殊符号组成</text>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. data() {
  32. return {
  33. userInfo: {
  34. phone: '',
  35. smsCode: '',
  36. openId: '',
  37. password: '',
  38. password1: '',
  39. transactionPassword: '',
  40. reference: '',
  41. },
  42. tips2: '',
  43. rules: {
  44. password: {
  45. required: true,
  46. min: 6,
  47. max: 18,
  48. message: '请输入6到18位密码',
  49. trigger: ['blur', 'change'],
  50. },
  51. password1: [
  52. {
  53. required: true,
  54. min: 6,
  55. max: 18,
  56. message: '请输入6到18位密码',
  57. trigger: ['blur', 'change'],
  58. },
  59. {
  60. validator: (rule, value, callback) => {
  61. if (this.userInfo.password === value) {
  62. return true;
  63. }
  64. return false;
  65. },
  66. message: "两次输入密码不一致",
  67. trigger: ['blur', 'change'],
  68. }
  69. ],
  70. },
  71. }
  72. },
  73. onLoad(option) {
  74. // 判断Openid是否为空
  75. if (!this.$isDataEmpty(option)) {
  76. this.userInfo = JSON.parse(option.data);
  77. }
  78. },
  79. onReady() {
  80. this.$refs.form1.setRules(this.rules)
  81. },
  82. methods: {
  83. // 去设置交易密码
  84. gotoSettingTransactionPassword() {
  85. let that = this;
  86. this.$refs.form1.validate().then(res => {
  87. uni.$u.route({
  88. url: '/pages/login/bind-transaction-password',
  89. params: {
  90. data: JSON.stringify(that.userInfo)
  91. }
  92. })
  93. })
  94. },
  95. }
  96. }
  97. </script>
  98. <style lang="scss">
  99. page,
  100. body {
  101. background: #fff;
  102. }
  103. .container {
  104. background: #fff;
  105. height: 500px;
  106. .login-wrap {
  107. display: flex;
  108. justify-content: center;
  109. .login-form {
  110. width: 90%;
  111. }
  112. .account {
  113. display: flex;
  114. }
  115. .identifying-code {}
  116. }
  117. .op-btn-wrap {
  118. margin-top: 30px;
  119. display: flex;
  120. justify-content: center;
  121. align-items: center;
  122. .h-btn {
  123. text-align: center;
  124. width: 343px;
  125. height: 42px;
  126. background: #FFE05C;
  127. border-radius: 27px;
  128. line-height: 42px;
  129. }
  130. }
  131. }
  132. </style>