From 8588fe30f17d0d28190a279aab8675de0dbf1a5b Mon Sep 17 00:00:00 2001
From: lxf <1371462558@qq.com>
Date: Wed, 16 Jul 2025 18:46:29 +0800
Subject: [PATCH] 个人添加图片

---
 src/views/my/newindex.vue |   90 ++++++++++++++++++++++++++-------------------
 1 files changed, 52 insertions(+), 38 deletions(-)

diff --git a/src/views/my/newindex.vue b/src/views/my/newindex.vue
index 78df43f..bdadfab 100644
--- a/src/views/my/newindex.vue
+++ b/src/views/my/newindex.vue
@@ -2,11 +2,14 @@
   <div class="pb-30">
     <!-- 顶部用户信息卡片 -->
     <div class="mt-20 mx-17 pt-24 px-14 flex h-120 box-border bgimg">
-      <div class="w-65 h-65 rounded-full"></div>
+      <div class="w-50 h-50 rounded-full">
+        <van-icon name="contact" size="50" color="#fff" />
+        <!-- <img :src="userStore.userInfo.avatar" alt=""> -->
+      </div>
       <div class="text-white flex-1 ml-9">
-        <div class="text-19 font-bold">{{userStore.userInfo.username}}</div>
+        <div class="text-24 font-bold">{{ userStore.userInfo.username }}</div>
         <div class="flex">
-          <div class="text-10">ID: {{userStore.userInfo.usercode}}</div>
+          <div class="text-14">ID: {{ userStore.userInfo.usercode }}</div>
         </div>
         <!-- <div class="text-10 block">信用分: 100</div> -->
       </div>
@@ -16,13 +19,8 @@
     <div class="mt-20 px-17">
       <div class="text-22 font-medium">{{ t('账号') }} {{ t('详情') }}</div>
       <div class="mt-15 p-15 rounded-15 bg-#f5f7f9">
-        <div 
-          v-for="(item, index) in accountItems" 
-          :key="index"
-          class="flex items-center justify-between text-16"
-          :class="{'mt-15': index > 0}"
-           @click="onRoute(item.path)"
-        >
+        <div v-for="(item, index) in accountItems" :key="index" class="flex items-center justify-between text-16"
+          :class="{ 'mt-15': index > 0 }" @click="onRoute(item.path)">
           <div class="flex items-center">
             <img :src="`${item.icon}`" class="w-20 h-20">
             <div class="ml-10">{{ item.title }}</div>
@@ -37,18 +35,13 @@
       </div>
     </div>
 
-     <!-- 帮助和支持部分 -->
-     <div class="mt-20 px-17">
-      <div class="text-22 font-medium">{{ t('帮助')}}</div>
+    <!-- 帮助和支持部分 -->
+    <div class="mt-20 px-17">
+      <div class="text-22 font-medium">{{ t('帮助') }}</div>
       <div class="mt-15 p-15 rounded-15 bg-#f5f7f9">
-        <div 
-          v-for="(item, index) in helpItems" 
-          :key="index"
-          class="flex items-center justify-between text-16"
-          :class="{'mt-15': index > 0}"
-          @click="onRoute(item.path)"
-        >
-          <div v-if="item.button" class="flex items-center" @click="loginOut">
+        <div v-for="(item, index) in helpItems" :key="index" class="flex items-center justify-between text-16"
+          :class="{ 'mt-15': index > 0 }" @click="onRoute(item.path)">
+          <div v-if="item.button" class="flex items-center" @click.stop="loginOut">
             <img :src="`${item.icon}`" class="w-20 h-20">
             <div class="ml-10">{{ item.title }}</div>
           </div>
@@ -59,7 +52,7 @@
           <div class="i-material-symbols:arrow-right-rounded text-20 text-gray-400">
             <!---->
           </div>
-          
+
 
         </div>
       </div>
@@ -74,7 +67,7 @@
 import { useUserStore } from '@/store/user';
 import { useI18n } from "vue-i18n";
 import useClipboard from "vue-clipboard3";
-import { showToast } from "vant";
+import { showConfirmDialog } from 'vant';
 import addBankIcon from '@/assets/image/userCenter/addBank.png'
 import kycHighStatusIcon from '@/assets/image/userCenter/kycHighStatus.png'
 import store from '@/store/store'
@@ -83,20 +76,21 @@
 
 const router = useRouter()
 const userStore = useUserStore()
-const status = ref([t('未认证'),t("审核中"),t("已认证"),t("审核未通过")])
+const status = ref([t('未认证'), t("审核中"), t("已认证"), t("审核未通过")])
 const kycHighStatus = ref(null)
 // kyc_status
 
 // 账户详情选项数据
 const accountItems = ref([
   // { icon: 'icon-option.png', title: '貨幣訂單' , path: '/position/index'},
-  { icon: new URL('../../assets/img/icon-option.png', import.meta.url), title: t('现货订单') , path: '/position/index'},
-  { icon: new URL('../../assets/img/icon-option.png', import.meta.url), title: t('账变记录') , path:'/cryptos/accountChange'},
-  { icon: new URL('../../assets/img/icon-wallet.png', import.meta.url), title: t('银行卡'), path: '/payMentMethod/list'},
-  { icon: new URL('../../assets/img/icon-real.png', import.meta.url), title: t('实名认证'), status: status.value[userStore.userInfo.kyc_status] , path: '/certificationCenter'},
+  { icon: new URL('../../assets/img/icon-option.png', import.meta.url), title: t('hbdhdd'), path: '/cryptos/deliveryContractHistory?symbol=USDSGD&type=forex' },
+  { icon: new URL('../../assets/img/icon-option.png', import.meta.url), title: t('whjydd'), path: '/cryptos/tradeRecord/USDSGD/?type=forex' },
+  { icon: new URL('../../assets/img/icon-option.png', import.meta.url), title: t('账变记录'), path: '/cryptos/accountChange' },
+  // { icon: new URL('../../assets/img/icon-wallet.png', import.meta.url), title: t('银行卡'), path: '/payMentMethod/list'},
+  { icon: new URL('../../assets/img/icon-real.png', import.meta.url), title: t('实名认证'), status: status.value[userStore.userInfo.kyc_status], path: '/certificationCenter' },
   { icon: new URL('../../assets/img/icon-small-language.png', import.meta.url), title: t('语言'), status: JSON.parse(localStorage.getItem('lang_tit')), path: '/language' },
-  { icon: new URL('../../assets/img/icon-small-password.png', import.meta.url), title: t('修改密码'), path: '/changePassword'},
-  { icon: new URL('../../assets/img/icon-small-password.png', import.meta.url), title: t('修改资金密码'), path: '/changeFundsPassword' } 
+  { icon: new URL('../../assets/img/icon-small-password.png', import.meta.url), title: t('修改密码'), path: '/changePassword' },
+  { icon: new URL('../../assets/img/icon-small-password.png', import.meta.url), title: t('修改资金密码'), path: '/changeFundsPassword' }
 ]);
 
 // 帮助和支持选项数据
@@ -107,7 +101,7 @@
   // { icon: 'icon-service.png', title: '專屬客服' },
   { icon: new URL('../../assets/img/icon-about.png', import.meta.url), title: t('关于我们'), path: '/aboutUs' },
   // { icon: 'icon-logout.png', title: '下載 APP' },
-  { icon: new URL('../../assets/img/icon-logout.png', import.meta.url), title: t('退出'), button: true  }
+  { icon: new URL('../../assets/img/icon-logout.png', import.meta.url), title: t('退出'), path: '/aaa', button: true }
 ]);
 
 const state = reactive({
@@ -131,8 +125,16 @@
   ]
 })
 const onRoute = (path) => {
-  console.log(path)
-  router.push(path)
+  console.log(path, userStore)
+  if (!userStore.userInfo || !userStore.userInfo.token) {
+    router.push('/login')
+    return
+  }
+  if (path == '/aaa') {
+    loginOut()
+  } else {
+    router.push(path)
+  }
 }
 onMounted(() => {
   if (userStore.userInfo && userStore.userInfo.token) {
@@ -194,11 +196,22 @@
 
 })
 const loginOut = () => {
-  _logOut({
-    token: userStore.userInfo.token
-  }).then(res => {
-    userStore.userInfo = {}
-    store.state.user.userInfo = {}
+  showConfirmDialog({
+    title: `${t('确认退出')}`,
+    message: `${t('确定要退出登录吗?')}`
+  }).then(() => {
+    _logOut({
+      token: userStore.userInfo.token
+    }).then(res => {
+      userStore.userInfo = {}
+      store.state.user.userInfo = {}
+      router.push('/login')
+    })
+      .catch(err => {
+        // showFailToast(`${t('退出失败,请重试')}`)
+      })
+  }).catch(() => {
+    // 用户取消操作
   })
 }
 const getIdentify = () => {
@@ -228,6 +241,7 @@
 .bgimg {
   background: url('@/assets/imgs/bg-account.png') 0% 0% / cover;
 }
+
 :deep(.van-cell-group__title) {
   background: $main2_background !important;
   padding: 12px 16px;

--
Gitblit v1.9.3