设置和消息对接口 改回上报记录页面
This commit is contained in:
@@ -44,7 +44,7 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, computed, onUnmounted } from 'vue';
|
||||
import {getSendCode} from '../../api/api.js'
|
||||
import {getSendCode,changePhone} from '../../api/api.js'
|
||||
|
||||
// ====响应式数据======
|
||||
const phoneNumber = ref('')
|
||||
@@ -66,7 +66,7 @@ const getVerifyCode = () => {
|
||||
if (!canGetVerify.value) return;
|
||||
let params = {
|
||||
phone:phoneNumber.value,
|
||||
scene:'reset'
|
||||
scene:'butler_login'
|
||||
}
|
||||
getSendCode(params).then(res =>{
|
||||
if(res.code === 200){
|
||||
@@ -103,21 +103,34 @@ const canRegister = computed(() => {
|
||||
&& verifyReg.test(verifyCode.value)
|
||||
});
|
||||
// 确认
|
||||
const handleConfirm = () =>{
|
||||
// 把参数存到本地缓存
|
||||
uni.setStorageSync('tempChangePwdParams', {
|
||||
phoneNumber:phoneNumber.value,
|
||||
verifyCode: verifyCode.value
|
||||
});
|
||||
if(!canRegister.value){
|
||||
uni.showToast({ title: '请输入',icon: 'error'});
|
||||
return
|
||||
}
|
||||
setTimeout(()=>{
|
||||
uni.navigateTo({
|
||||
url:"/pageSubPack/setting/setting"
|
||||
})
|
||||
})
|
||||
const handleConfirm = () => {
|
||||
if (!canRegister.value) {
|
||||
uni.showToast({ title: '请输入正确的手机号和验证码', icon: 'none' })
|
||||
return
|
||||
}
|
||||
|
||||
uni.showLoading({ title: '提交中...' })
|
||||
changePhone({
|
||||
phone: phoneNumber.value,
|
||||
smsCode: verifyCode.value
|
||||
}).then(res => {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({ title: '修改成功', icon: 'success' })
|
||||
// 把参数存到本地缓存
|
||||
uni.setStorageSync('tempChangePwdParams', {
|
||||
phoneNumber:phoneNumber.value
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 800)
|
||||
} else {
|
||||
uni.showToast({ title: res.msg || '修改失败', icon: 'none' })
|
||||
}
|
||||
}).catch(() => {
|
||||
uni.showToast({ title: '请求失败,请重试', icon: 'none' })
|
||||
}).finally(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
// 返回上一页
|
||||
// const goBack = () => {
|
||||
|
||||
Reference in New Issue
Block a user