From c1fffc901dea8f32c615a19ff9e47d9b766402f2 Mon Sep 17 00:00:00 2001 From: lihuilin Date: Thu, 30 Oct 2025 11:27:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/home/member.vue | 21 +++++++++------- pages/setting/email.vue | 67 ++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 65 insertions(+), 23 deletions(-) diff --git a/pages/home/member.vue b/pages/home/member.vue index bd175de..f1ffd25 100644 --- a/pages/home/member.vue +++ b/pages/home/member.vue @@ -16,10 +16,10 @@ ID:{{ dccode }} - + @@ -81,6 +81,8 @@ import { } from '@element-plus/icons-vue' import footerBar from '../../components/footerBar.vue' import {getUserInfo} from "@/api/member" +import { useUserStore } from "../../stores/modules/userInfo" +const userStore = useUserStore() const type = ref('member') const iSMT = ref(0) @@ -136,6 +138,7 @@ onMounted(() => { // 状态栏高度 iSMT.value = uni.getSystemInfoSync().statusBarHeight console.log('??????????????', iSMT.value) + console.log('通信来的用户身份',userStore.userInfo) }) @@ -146,7 +149,7 @@ onMounted(() => { } .top { - height: 47vh; + height: 50vh; background-color: white; } @@ -159,8 +162,8 @@ onMounted(() => { } .image-bell { - width: 13px; - height: 16px; + width: 26rpx; + height: 32rpx; } .msg { @@ -171,7 +174,7 @@ onMounted(() => { } .msg-left { - width: 33.6vw; + width: 252rpx; display: flex; justify-content: center; align-items: center; @@ -185,7 +188,7 @@ onMounted(() => { } .msg-center { - width: 51.7vw; + width: 388rpx; padding-left: 2.5vh; display: flex; flex-direction: column; @@ -204,11 +207,10 @@ onMounted(() => { .image-editName { width: 40rpx; height: 40rpx; - margin-left: 2vw; + margin-left: 15rpx; } .msg-right { - width: 14.7vw; display: flex; flex-direction: column; justify-content: center; @@ -232,6 +234,7 @@ onMounted(() => { justify-content: center; background-color: rgb(243, 243, 243); border-radius: 8%; + margin-bottom: 1vh; } .setting-icon { diff --git a/pages/setting/email.vue b/pages/setting/email.vue index 5f4f1c8..6f0c8d9 100644 --- a/pages/setting/email.vue +++ b/pages/setting/email.vue @@ -28,7 +28,7 @@ - + @@ -51,11 +51,16 @@ sendEmail, changeBind } from "@/api/setting/password" + import { + verifyCodeApi + } from "@/api/start/login" + const iSMT = ref(0) const email = ref('') const gettingCode = ref(false) const time = ref(60) const userEmail = ref('') + const verifyCode = ref('') const userInfoPromise = getUserInfo() userInfoPromise.then(res => { @@ -71,20 +76,54 @@ }) const changeAccount = () => { - const res = changeBind({ - verificateType: 0, - account: userEmail.value - }) - if(res.code === 200){ + if (!userEmail) { uni.showToast({ - title: '绑定成功', - icon: 'none', + title: '请输入邮箱', + icon: 'none' }) - }else { + return + } + + if (!verifyCode) { uni.showToast({ - title: '用户绑定失败', + title: '请输入验证码', + icon: 'none' + }) + return + } + + const res1 = verifyCodeApi({ + loginType: 'EMAIL', + account: userEmail.value, + verifyCode: verifyCode.value + }) + + if (res1.code === 200) { + const res2 = changeBind({ + verificateType: 0, + account: userEmail.value + }) + if (res2.code === 200) { + uni.showToast({ + title: '绑定成功', + icon: 'none', + }) + uni.navigateTo({ + url: '/pages/home/member' + }) + } else { + uni.showToast({ + title: '用户绑定失败', + icon: 'none', + }) + } + } else { + uni.showToast({ + title: '验证失败,请检查验证码', icon: 'none', }) + + return } } @@ -182,9 +221,9 @@ align-items: center; justify-content: center; } - - .image{ - width:40rpx; - height:40rpx; + + .image { + width: 40rpx; + height: 40rpx; } \ No newline at end of file