设置密码 会员

This commit is contained in:
魏啾
2024-05-23 11:21:11 +08:00
parent d0cf4a5cc6
commit 8386120c87
9 changed files with 259 additions and 75 deletions

View File

@@ -1,8 +1,8 @@
<template>
<view class="Box">
<view class="box_one">安全密码用于商户推广提现/订单退款确保资金安全</view>
<view class="box_one" v-if="isPwd == 0">安全密码用于商户推广提现/订单退款确保资金安全</view>
<view class="box_box">
<view class="box_item flex-between">
<view class="box_item flex-between" v-if="isPwd == 0">
<text class="top_box_one_text">手机号码</text>
<input type="number" v-model="form.mobile" placeholder="请输入手机号" maxlength="11" disabled="disabled" />
</view>
@@ -36,6 +36,7 @@
export default {
data() {
return {
isPwd: uni.cache.get('userInfo').isPwd,
form: {
mobile: uni.cache.get('userInfo').telephone,
password: '',
@@ -50,8 +51,14 @@
Recapture: '发送验证码'
};
},
onLoad() {},
onLoad() {
if (uni.cache.get('userInfo').isPwd != 0) {
uni.setNavigationBarTitle({
title: '忘记支付密码', // 标题文本,必须是字符串
});
}
},
methods: {
async CodeRegister() {
const res = await this.api.phoneValidateCode({
@@ -78,8 +85,8 @@
}
},
async userInfosavePayPassword() {
console.log(this.form.payPassword, this.form.password)
if (this.form.mobile.length != 11) {
if (this.form.mobile.length != 11 && this.isPwd == 0) {
uni.showToast({
title: '手机号必须是11位',
icon: 'none'
@@ -123,14 +130,21 @@
}
let res = await this.api.loginresetPwd({
pwd: this.form.password,
shopId: uni.cache.get('shopUser'),
code: this.form.checkCode
})
if (res == 1) {
uni.showToast({
title: '修改成功',
icon: 'none'
});
if (res.code == 0) {
if (uni.cache.get('userInfo').isPwd != 0) {
uni.showToast({
title: '修改成功',
icon: 'none'
});
} else {
uni.showToast({
title: '设置成功',
icon: 'none'
});
}
setTimeout(() => {
uni.navigateBack();
}, 1000);