Browse Source

图片

maziyang/feature-20251025172218-智能客服中台
lihuilin 4 weeks ago
parent
commit
c1fffc901d
  1. 21
      pages/home/member.vue
  2. 45
      pages/setting/email.vue

21
pages/home/member.vue

@ -16,10 +16,10 @@
</view> </view>
<view class="userId">ID:{{ dccode }}</view> <view class="userId">ID:{{ dccode }}</view>
</view> </view>
<view class="msg-right">
<!-- <view class="msg-right">
<image class="image-attendance" src="/static/my/Check-in.png"/> <image class="image-attendance" src="/static/my/Check-in.png"/>
<span style="font-size:10px;">签到</span> <span style="font-size:10px;">签到</span>
</view>
</view> -->
</view> </view>
<view class="settings-buttons"> <view class="settings-buttons">
@ -81,6 +81,8 @@ import {
} from '@element-plus/icons-vue' } from '@element-plus/icons-vue'
import footerBar from '../../components/footerBar.vue' import footerBar from '../../components/footerBar.vue'
import {getUserInfo} from "@/api/member" import {getUserInfo} from "@/api/member"
import { useUserStore } from "../../stores/modules/userInfo"
const userStore = useUserStore()
const type = ref('member') const type = ref('member')
const iSMT = ref(0) const iSMT = ref(0)
@ -136,6 +138,7 @@ onMounted(() => {
// //
iSMT.value = uni.getSystemInfoSync().statusBarHeight iSMT.value = uni.getSystemInfoSync().statusBarHeight
console.log('??????????????', iSMT.value) console.log('??????????????', iSMT.value)
console.log('通信来的用户身份',userStore.userInfo)
}) })
</script> </script>
@ -146,7 +149,7 @@ onMounted(() => {
} }
.top { .top {
height: 47vh;
height: 50vh;
background-color: white; background-color: white;
} }
@ -159,8 +162,8 @@ onMounted(() => {
} }
.image-bell { .image-bell {
width: 13px;
height: 16px;
width: 26rpx;
height: 32rpx;
} }
.msg { .msg {
@ -171,7 +174,7 @@ onMounted(() => {
} }
.msg-left { .msg-left {
width: 33.6vw;
width: 252rpx;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -185,7 +188,7 @@ onMounted(() => {
} }
.msg-center { .msg-center {
width: 51.7vw;
width: 388rpx;
padding-left: 2.5vh; padding-left: 2.5vh;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -204,11 +207,10 @@ onMounted(() => {
.image-editName { .image-editName {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
margin-left: 2vw;
margin-left: 15rpx;
} }
.msg-right { .msg-right {
width: 14.7vw;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
@ -232,6 +234,7 @@ onMounted(() => {
justify-content: center; justify-content: center;
background-color: rgb(243, 243, 243); background-color: rgb(243, 243, 243);
border-radius: 8%; border-radius: 8%;
margin-bottom: 1vh;
} }
.setting-icon { .setting-icon {

45
pages/setting/email.vue

@ -28,7 +28,7 @@
<view class="top-list"> <view class="top-list">
<view class="left"> <view class="left">
<image class="image" src="/static/my/verification.png" /> <image class="image" src="/static/my/verification.png" />
<input type="text" placeholder="请输入验证码" class="input" />
<input type="text" v-model="verifyCode" placeholder="请输入验证码" class="input" />
</view> </view>
</view> </view>
</view> </view>
@ -51,11 +51,16 @@
sendEmail, sendEmail,
changeBind changeBind
} from "@/api/setting/password" } from "@/api/setting/password"
import {
verifyCodeApi
} from "@/api/start/login"
const iSMT = ref(0) const iSMT = ref(0)
const email = ref('') const email = ref('')
const gettingCode = ref(false) const gettingCode = ref(false)
const time = ref(60) const time = ref(60)
const userEmail = ref('') const userEmail = ref('')
const verifyCode = ref('')
const userInfoPromise = getUserInfo() const userInfoPromise = getUserInfo()
userInfoPromise.then(res => { userInfoPromise.then(res => {
@ -71,21 +76,55 @@
}) })
const changeAccount = () => { const changeAccount = () => {
const res = changeBind({
if (!userEmail) {
uni.showToast({
title: '请输入邮箱',
icon: 'none'
})
return
}
if (!verifyCode) {
uni.showToast({
title: '请输入验证码',
icon: 'none'
})
return
}
const res1 = verifyCodeApi({
loginType: 'EMAIL',
account: userEmail.value,
verifyCode: verifyCode.value
})
if (res1.code === 200) {
const res2 = changeBind({
verificateType: 0, verificateType: 0,
account: userEmail.value account: userEmail.value
}) })
if(res.code === 200){
if (res2.code === 200) {
uni.showToast({ uni.showToast({
title: '绑定成功', title: '绑定成功',
icon: 'none', icon: 'none',
}) })
uni.navigateTo({
url: '/pages/home/member'
})
} else { } else {
uni.showToast({ uni.showToast({
title: '用户绑定失败', title: '用户绑定失败',
icon: 'none', icon: 'none',
}) })
} }
} else {
uni.showToast({
title: '验证失败,请检查验证码',
icon: 'none',
})
return
}
} }
const getCode = () => { const getCode = () => {

Loading…
Cancel
Save