李凌
2025-10-09 631dc512b226b346fefaebbedf1ddd79c06cab71
src/views/my/index.vue
@@ -1,13 +1,6 @@
<template>
  <section class="my-index" >
    <!-- <fx-header :back="false" :title="$t('my')">
      <template v-slot:right>
        <van-icon name="service-o" size="24" @click="$router.push('/customerService')"></van-icon>
      </template>
    </fx-header> -->
   <assets-head title="">
      <!-- <img src="../../../assets/image/assets-center/exchange.png" alt="exchange-img" class="w-44 h-38"
         @click="goRouter('/customerService')" /> -->
         <template v-slot:right>
           <van-icon name="service-o" size="24" @click="$router.push('/customerService')"></van-icon>
         </template>
@@ -27,7 +20,8 @@
      <div class="mt-4 flex items-start" v-else>
        <img class="w-24 h-24" src="@/assets/image/avatar.png" alt="avatar" />
        <div class="ml-5 pt-1 flex flex-col justify-center">
          <div class="font-bold text-lg name" style="width: 200px;overflow-wrap: break-word;">{{ userStore.userInfo && userStore.userInfo.username }}</div>
          <div class="font-bold text-lg name" style="width: 200px;overflow-wrap: break-word;">{{ userStore.userInfo &&
            userStore.userInfo.username }}</div>
          <div class="text-sm text-gray-400 mt-5 flex items-center id-text">
            ID:{{ userStore.userInfo && userStore.userInfo.usercode }}<img class="w-8 h-8 ml-4"
              src="@/assets/image/idcopy.png" alt="id" @click="copy" /></div>
@@ -56,20 +50,11 @@
            <img src="@/assets/imgs/my/安全.png" alt="">
            <div>{{ t('安全') }}</div>
          </div>
<!--          <div class="label_item flex flex-col items-center justify-center mt-8" @click="onRoute('/changePassword')">
            <img src="@/assets/imgs/my/密码.png" alt="">
            <div>{{ t('修改密码') }}</div>
          </div> -->
          <div class="label_item flex flex-col items-center justify-center mt-8"
            @click="onRoute('/cryptos/accountChange')">
            <img src="@/assets/imgs/my/记录.png" alt="">
            <div>{{ t('账变记录') }}</div>
          </div>
          <!-- <div class="label_item flex flex-col items-center justify-center mt-8"
            @click="onRoute('/certificationCenter')">
            <img src="@/assets/imgs/my/身份认证.png" alt="">
            <div>{{ t('authVerify') }}</div>
          </div> -->
        </div>
      </div>
    </template>
@@ -120,37 +105,33 @@
import useClipboard from "vue-clipboard3";
import { showToast } from "vant";
import addBankIcon from '@/assets/image/userCenter/addBank.png'
import kycHighStatusIcon from '@/assets/image/userCenter/kycHighStatus.png'
import store from '@/store/store'
const { t } = useI18n()
const { toClipboard } = useClipboard();
const router = useRouter()
const userStore = useUserStore()
const customer_service_url = ref(null)
const customer_service_url = ref(store.state.user.customer_service_url)
const status = ref(null)
const kycHighStatus = ref(null)
const userdata = ref({})
const state = reactive({
  cellList: [
    {
      title: t('safe'), list: [
        { icon: 'shield-o', title: t('safe'), path: '/safety' },
        { icon: 'setting-o', title: t('changePassword'), path: '/changePassword' },
        { icon: addBankIcon, title: t('AddPaymentMethod'), path: '/payMentMethod/list' }
const tabs = [
  { icon: new URL('@/assets/imgs/my/my_1a.png', import.meta.url), icon2: new URL('@/assets/imgs/my/my_1b.png', import.meta.url), title: t('authVerify'), path: '/certificationCenter' },
  { icon: new URL('@/assets/imgs/my/my_1a.png', import.meta.url), icon2: new URL('@/assets/imgs/my/my_1b.png', import.meta.url), title: t('高级认证'), path: '/advancedCtf' },
  { icon: new URL('@/assets/imgs/my/my_2a.png', import.meta.url), icon2: new URL('@/assets/imgs/my/my_2b.png', import.meta.url), title: t('安全'), path: '/safety' },
  { icon: new URL('@/assets/imgs/my/my_3a.png', import.meta.url), icon2: new URL('@/assets/imgs/my/my_3b.png', import.meta.url), title: t('账变记录'), path: '/cryptos/accountChange' },
      ]
    },
    {
      title: t('universal'), list: [
        { icon: 'font-o', title: t('language'), path: '/language' },
        { icon: 'service-o', title: t('onLineService'), path: '/customerService' },
        { icon: 'idcard', title: t('authVerify'), path: '/certificationCenter', show: true },
        { icon: 'todo-list-o', title: t('账变记录'), path: '/cryptos/accountChange' },
        { icon: 'gold-coin-o', title: t('计价方式'), path: '/cryptos/exchangeRate' },
const tabs2 = [
  { title: t('language'), path: '/language' },
  { title: t('onLineService'), path: '/customerService' },
  { title: t('计价方式'), path: '/cryptos/exchangeRate' },
  { title: t('AddPaymentMethod'), path: '/payMentMethod/list' },
  { title: t('帮助中心'), path: '/helpCenter' },
  { title: t('关于我们'), path: '/aboutUs' },
      ]
    }
  ]
})
// 跳转
const onRoute = (path) => {
  if(path=='/customerService'){
     if(customer_service_url.value){
@@ -167,7 +148,8 @@
    getIdentify()
    getKycHighLevel()
   getinfo()
   getcustomer()
  } else {
    router.push('/login')
  }
})
const cellList = computed(() => {
@@ -211,8 +193,9 @@
      // }
    ]
  }
})
// 退出登录
const loginOut = () => {
  _logOut({
    token: userStore.userInfo.token
@@ -221,14 +204,7 @@
    store.state.user.userInfo = {}
  })
}
const getcustomer = () => {
  _customer().then((data) => {
   customer_service_url.value = data.customer_service_url
   console.log(customer_service_url);
  }).catch(error => {
    console.error('Error fetching data:', error);
  });
};
// 用户信用分
const getinfo = () => {
  _info().then((data) => {
    userdata.value = data;  // 确保 userdata 被正确声明
@@ -236,16 +212,19 @@
    console.error('Error fetching data:', error);
  });
};
// 用户认证状态
const getIdentify = () => {
  _getIdentify().then(data => {
    status.value = data.status
  })
}
// 当前用户等级
const getKycHighLevel = () => {
  _getKycHighLevel().then((data) => {
    kycHighStatus.value = data.status
  })
}
// 复制用户code
const copy = async () => {
  try {
    await toClipboard(userStore.userInfo && userStore.userInfo.usercode);
@@ -257,6 +236,7 @@
</script>
<style lang="scss" scoped>
:deep(.van-cell-group__title) {
  // background: $main2_background !important;
  background: $inp-b !important;
@@ -320,9 +300,11 @@
  .label_item {
    width: 33%;
    font-size: 12px;
   div{
      text-align: center;
   }
    img {
      width: 32%;
      margin-bottom: 3px;