| <template> |
| <view class="changePayPwd"> |
| <view class="changePayPwd-list"> |
| <u-field v-model="pwd" label="支付密码" :field-style="fieldStyle" placeholder="请设置6-12位密码" |
| label-width="160" :password="true" maxlength="12" clear-size="40"></u-field> |
| <u-field v-model="repwd" label="确认密码" :field-style="fieldStyle" placeholder="请确认新密码" |
| label-width="160" :password="true" maxlength="12" clear-size="40"></u-field> |
| </view> |
| <view class="changePayPwd-forget"> |
| <text @click="toForgetPwd">忘记密码?</text> |
| </view> |
| <u-button @click="changePayPwd" :custom-style="changePayPwdBtn">确认修改</u-button> |
| </view> |
| </template> |
| |
| <script> |
| export default { |
| data() { |
| return { |
| pwd: "", |
| repwd: "", |
| fieldStyle:{'font-size':'30rpx','color':'#999999'}, |
| changePayPwdBtn:{ |
| width: '600rpx', |
| backgroundColor: '#2FA8E1', |
| color: '#FFFFFF', |
| fontFamily: "PingFang-SC-Medium", |
| fontSize: '30rpx', |
| marginTop: '100rpx', |
| padding: '50rpx 0' |
| } |
| } |
| }, |
| methods: { |
| toForgetPwd() { |
| uni.navigateTo({ |
| url: "/pages/sub_mine/findPayPwd" |
| }) |
| }, |
| changePayPwd() { |
| let that = this |
| let { |
| pwd, |
| repwd |
| } = that |
| if (pwd == "") { |
| uni.showToast({ |
| title: "请输入支付密码", |
| duration: 800, |
| icon: "none" |
| }) |
| return false |
| } |
| if (repwd != pwd) { |
| uni.showToast({ |
| title: "两次支付密码不一致,请确认后重新输入", |
| duration: 800, |
| icon: "none" |
| }) |
| return false |
| } |
| let paypwdtype = uni.getStorageSync("paypwdtype"); |
| if (paypwdtype == "") { |
| paypwdtype = "new" |
| } |
| var randomcode = uni.getStorageSync("randomcode"); |
| if (randomcode == "") { |
| randomcode = "" |
| } |
| let param = { |
| "pwd": pwd, |
| "repwd": repwd, |
| "type": paypwdtype, |
| "randcode": randomcode |
| } |
| that.$u.post("/v1/paypwd", param).then((res) => { |
| uni.showToast({ |
| title: "设置支付密码成功", |
| icon: "none", |
| duration: 800, |
| complete(res) { |
| setTimeout(() => { |
| uni.switchTab({ |
| url: "/pages/sub_tabbar/index" |
| }) |
| }, 1500) |
| } |
| }) |
| }) |
| } |
| }, |
| } |
| </script> |
| |
| <style lang="scss" scoped> |
| .changePayPwd { |
| width: 100vw; |
| // height: 100vh; |
| background-color: #F3F3F3; |
| overflow: hidden; |
| padding-bottom: 30rpx; |
| |
| &-list { |
| background-color: #FFFFFF; |
| margin-top: 30rpx; |
| } |
| |
| &-forget { |
| font-size: 24rpx; |
| font-family: "PingFang-SC-Regular"; |
| display: flex; |
| padding: 30rpx 30rpx 0; |
| color: #666666; |
| justify-content: flex-end; |
| } |
| |
| &-btn { |
| width: 600rpx; |
| background-color: #2FA8E1; |
| color: #FFFFFF; |
| font-family: "PingFang-SC-Medium"; |
| font-size: 30rpx; |
| margin-top: 50rpx; |
| padding: 50rpx 0; |
| } |
| } |
| </style> |