完善小程序
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
<template>
|
||||
<view class="Box">
|
||||
<view class="box_box">
|
||||
<view class="box_item flex-between">
|
||||
<!-- <view class="box_item flex-between">
|
||||
<text class="top_box_one_text">当前账号</text>
|
||||
<input type="number" v-model="form.mobile" placeholder="请输入手机号" maxlength="11" disabled="disabled" />
|
||||
<button v-if="!form.mobile" class="getPhone" open-type="getPhoneNumber" @getphonenumber="getPhone">
|
||||
<view class="text">获取手机号</view>
|
||||
</button>
|
||||
</view> -->
|
||||
<view class="box_item flex-between">
|
||||
<text class="top_box_one_text">当前账号</text>
|
||||
<input type="number" v-model="form.mobile" placeholder="请输入手机号" maxlength="11" :disabled="true" />
|
||||
|
||||
</view>
|
||||
<view class="box_item flex-between" style="position:relative;">
|
||||
@@ -45,13 +49,25 @@
|
||||
onMounted
|
||||
} from 'vue';
|
||||
|
||||
import {
|
||||
APIuserpwd,
|
||||
APIusercode
|
||||
} from '@/common/api/api.js'
|
||||
import {
|
||||
APIshopUserInfo
|
||||
} from '@/common/api/member.js'
|
||||
|
||||
import {
|
||||
productStore
|
||||
} from '@/stores/user.js';
|
||||
const storeuser = productStore();
|
||||
const shopUserInfo = reactive({
|
||||
shopInfo: "",
|
||||
shopInfo: uni.cache.get('orderVIP'),
|
||||
shopId: ''
|
||||
})
|
||||
|
||||
const form = reactive({
|
||||
mobile: '',
|
||||
mobile: uni.cache.get('orderVIP').phone,
|
||||
password: '',
|
||||
payPassword: '',
|
||||
checkCode: ''
|
||||
@@ -65,11 +81,10 @@
|
||||
second: 60,
|
||||
showText: true,
|
||||
Recapture: '获取验证码',
|
||||
shopUserInfo: null,
|
||||
})
|
||||
|
||||
const CodeRegister = async () => {
|
||||
const res = await this.api.phoneValidateCode({
|
||||
const res = await APIusercode({
|
||||
// post 手机验证码
|
||||
phone: form.mobile
|
||||
});
|
||||
@@ -167,30 +182,15 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
let res = await this.api.loginresetPwd({
|
||||
vipId: this.shopUserInfo.id,
|
||||
pwd: this.form.password,
|
||||
code: this.form.checkCode
|
||||
let res = await APIuserpwd({
|
||||
checkPayPwd: form.payPassword,
|
||||
payPwd: form.password,
|
||||
code: form.checkCode
|
||||
})
|
||||
|
||||
if (res.code == 0) {
|
||||
if (datalist.isPwd != 0) {
|
||||
uni.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '设置成功',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
// 获取用户信息
|
||||
this.loginwxuserInfo()
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
// * 获取会员信息
|
||||
await storeuser.actionsproductqueryProduct()
|
||||
if (res) {
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,8 +201,16 @@
|
||||
const currentPage = pages[pages.length - 1];
|
||||
// 获取页面参数
|
||||
const options = currentPage.options;
|
||||
shopUserInfo.shopInfo = JSON.parse(decodeURIComponent(options.shopInfo))
|
||||
console.log(shopUserInfo)
|
||||
// if (options.shopId) {
|
||||
// let res = await APIshopUserInfo({F
|
||||
// shopId: options.shopId
|
||||
// })
|
||||
// uni.cache.set('shopId', options.shopId, 30)
|
||||
// uni.cache.set('orderVIP', res)
|
||||
// uni.cache.set('ordershopUserInfo', res.shopInfo)
|
||||
// } else {
|
||||
// shopUserInfo.shopInfo = JSON.parse(decodeURIComponent(options.shopInfo))
|
||||
// }
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user