From 34bd7cbbc1be3bd535e7adf341cc5a83eea62eb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=97=E5=B3=A6?= <2268499868@qq.com> Date: Mon, 23 Dec 2024 15:08:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/views/fore/profile.vue | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/front/src/views/fore/profile.vue b/front/src/views/fore/profile.vue index c83f694..9394962 100644 --- a/front/src/views/fore/profile.vue +++ b/front/src/views/fore/profile.vue @@ -22,6 +22,10 @@ + + + 绑定手机号 + @@ -30,11 +34,6 @@
- - - - - @@ -43,13 +42,13 @@ - - + + @@ -110,8 +109,7 @@ const profileInfo = ref({ address: '北京市朝阳区某某街道', }); - -// 读取 localStorage 中保存的地址数据 +// 读取 localStorage 中保存 的地址数据 const loadAddresses = () => { const savedData = localStorage.getItem('addresses'); return savedData ? JSON.parse(savedData) : []; @@ -211,12 +209,21 @@ const copyAddress = (address) => { ElMessage.success('地址已复制到剪贴板'); }; - const logout = () => { router.push({ name: 'login' }); -} +}; + +const bindPhone = () => { + if (!profileInfo.value.phone) { + ElMessage.error('手机号不能为空'); + return; + } + // 这里可以添加手机号绑定的逻辑,比如发送请求到后端 + ElMessage.success('手机号绑定成功!'); +}; + + \ No newline at end of file