1
李凌
2026-01-21 e01cee0f0c5c5c2eb2d8595eadb3c7a9df2a37fc
src/views/my/index.vue
@@ -1,33 +1,34 @@
<template>
  <section class="my-index" >
  <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"
</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>
   </assets-head>
      <template v-slot:right>
        <van-icon name="service-o" size="24" @click="$router.push('/customerService')"></van-icon>
      </template>
    </assets-head>
    <div class="px-8 mt-4">
      <h1 class="text-2xl font-bold title" v-if="!(userStore.userInfo && userStore.userInfo.token)">{{
        $t('welcome')
        }}&nbsp;{{ $title }}!
      }}&nbsp;{{ $title }}!
      </h1>
      <p class="sub-text" v-if="!(userStore.userInfo && userStore.userInfo.token)">{{ $t('全球最大的区块链资产平台') }}</p>
      <p class="sub-text" v-if="!(userStore.userInfo && userStore.userInfo.token)">{{ $t('通往机构机代币化的大门') }}</p>
      <p class="w-full flex mt-4 gap-x-4" v-if="!(userStore.userInfo && userStore.userInfo.token)">
        <van-button class="flex-1" round @click="onRoute('/register')">{{ $t('register') }}</van-button>
        <van-button class="flex-1" type="primary" round color="#f7b600" @click="onRoute('/login')">{{ $t('login')
          }}</van-button>
        }}</van-button>
      </p>
      <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>
@@ -38,10 +39,10 @@
                status == 1 ? $t('reviewing') : status == 2 ? $t('verified') : status == 3 ?
                  $t('noPassView') : '' }}
            </div>
            <div class="label pl-2 pr-2 ml-3" :class="{ 'green': kycHighStatus == 2 }">
            <!-- <div class="label pl-2 pr-2 ml-3" :class="{ 'green': kycHighStatus == 2 }">
              {{ kycHighStatus == 2 ? $t('高级用户') : $t('普通用户') }}
            </div>
         <div class="pl-2 pr-2 ml-3" style="font-size: 12px;">{{$t('信用分')}} : {{userdata.creditScore}}</div>
            </div> -->
            <div class="pl-2 pr-2 ml-3" style="font-size: 12px;">{{ $t('信用分') }} : {{ userdata.creditScore }}</div>
          </div>
        </div>
      </div>
@@ -56,7 +57,7 @@
            <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')">
          <!--          <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> -->
@@ -91,9 +92,10 @@
    <template v-if="userStore.userInfo && userStore.userInfo.token">
      <van-divider :style="{ borderColor: '#ddd' }" hairline />
      <van-cell-group :border="false">
        <van-cell is-link="is-link" center="center" :title="t('关于我们')" @click="onRoute('/aboutUs')">
        <van-cell is-link="is-link" center="center" :title="item.title" @click="onRoute(item.path)"
          v-for="(item, index) in tyList" :key="index">
          <template #icon>
            <img class="cell-img" src="../../assets/image/assets-center/aboutUs.png" />
            <img class="cell-img" :src="item.icon" />
          </template>
        </van-cell>
      </van-cell-group>
@@ -104,7 +106,7 @@
      <div class="px-4 mt-4">
        <p class="w-full flex mt-4 gap-x-4">
          <van-button type="primary" class="flex-1" round color="#f7b600" @click="loginOut">{{ $t('loginOut')
            }}</van-button>
          }}</van-button>
        </p>
      </div>
    </template>
@@ -114,7 +116,7 @@
<script setup>
import { reactive, onMounted, ref, computed } from 'vue';
import { useRouter } from 'vue-router';
import { _getIdentify, _getKycHighLevel, _logOut,_info ,_customer } from "@/service/user.api.js";
import { _getIdentify, _getKycHighLevel, _logOut, _info, _customer } from "@/service/user.api.js";
import { useUserStore } from '@/store/user';
import { useI18n } from "vue-i18n";
import useClipboard from "vue-clipboard3";
@@ -122,52 +124,50 @@
import addBankIcon from '@/assets/image/userCenter/addBank.png'
import kycHighStatusIcon from '@/assets/image/userCenter/kycHighStatus.png'
import store from '@/store/store'
import { customerServiceUrl } from '@/config'
const { t } = useI18n()
const { toClipboard } = useClipboard();
const router = useRouter()
const userStore = useUserStore()
const customer_service_url = ref(null)
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' }
      ]
    },
    {
      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 tyList = [
  { title: t('关于我们'), icon: new URL('@/assets/image/assets-center/aboutUs.png', import.meta.url), path: '/aboutUs?serviceTerm=20' },
  // { title: t('用户协议'), icon: new URL('@/assets/image/assets-center/yhxy.png', import.meta.url), path: '/aboutUs?serviceTerm=23' },
  // { title: t('隐私政策'), icon: new URL('@/assets/image/assets-center/yszc.png', import.meta.url), path: '/aboutUs?serviceTerm=24' },
  // { title: t('安全规定'), icon: new URL('@/assets/image/assets-center/aqzc.png', import.meta.url), path: '/aboutUs?serviceTerm=21' },
  // { title: t('反洗钱协议'), icon: new URL('@/assets/image/assets-center/yhxy.png', import.meta.url), path: '/aboutUs?serviceTerm=25' },
  // { title: t('法律声明'), icon: new URL('@/assets/image/assets-center/aqzc.png', import.meta.url), path: '/aboutUs?serviceTerm=22' },
  // { title: t('金融服务牌照'), icon: new URL('@/assets/image/assets-center/yhxy.png', import.meta.url), path: '/aboutUs?serviceTerm=26' },
]
const onRoute = (path) => {
  if(path=='/customerService'){
     if(customer_service_url.value){
        window.location.href = customer_service_url.value;
     }else{
        router.push(path)
     }
  }else{
     router.push(path)
  if (!path) return
  // 如果路径包含 "http",则作为外链跳转
  if (path && (path.startsWith('http://') || path.startsWith('https://'))) {
    window.open(path, '_blank');
    return;
  }
  if (path == '/customerService') {
    if (customerServiceUrl()) {
      window.location.href = customerServiceUrl();
    } else {
      router.push(path)
    }
  }else {
    router.push(path)
  }
}
onMounted(() => {
  if (userStore.userInfo && userStore.userInfo.token) {
    getIdentify()
    getKycHighLevel()
   getinfo()
   getcustomer()
    getinfo()
    // getcustomer()
  }
})
const cellList = computed(() => {
@@ -185,11 +185,13 @@
          { icon: new URL('../../assets/image/assets-center/language.png', import.meta.url), title: t('language'), path: '/language' },
          { icon: new URL('../../assets/image/assets-center/onLineService.png', import.meta.url), title: t('onLineService'), path: '/customerService' },
          { icon: new URL('../../assets/image/assets-center/authVerify.png', import.meta.url), title: t('authVerify'), path: '/certificationCenter', show: true },
          { icon: new URL('../../assets/image/assets-center/AdvancedCertification.png', import.meta.url), title: t('高级认证'), path: '/advancedCtf', show: true },
          // { icon: new URL('../../assets/image/assets-center/AdvancedCertification.png', import.meta.url), title: t('高级认证'), path: '/advancedCtf', show: true },
          // { icon: 'todo-list-o', title: t('账变记录'), path: '/cryptos/accountChange' },
          { icon: new URL('../../assets/image/assets-center/valuation.png', import.meta.url), title: t('计价方式'), path: '/cryptos/exchangeRate' },
          { icon: new URL('../../assets/image/assets-center/AddPaymentMethod.png', import.meta.url), title: t('AddPaymentMethod'), path: '/payMentMethod/list' },
          { icon: new URL('../../assets/image/assets-center/help.png', import.meta.url), title: t('帮助中心'), path: '/helpCenter' },
          // { icon: new URL('../../assets/image/assets-center/AddPaymentMethod.png', import.meta.url), title: t('AddPaymentMethod'), path: '/payMentMethod/list' },
          // { icon: new URL('../../assets/image/assets-center/help.png', import.meta.url), title: t('帮助中心'), path: '/helpCenter' }, // 原帮助中心页面
          { icon: new URL('../../assets/image/assets-center/help.png', import.meta.url), title: t('帮助中心'), path: '/aboutUs?serviceTerm=27' }, // 现跳转关于我们通过后台编辑获取的页面
          { icon: new URL('../../assets/image/assets-center/置业资格.png', import.meta.url), title: t('资格'), path: 'https://ali.coinbox-ws.com/upload/20250713/1752394308.pdf' },
        ]
      }
    ]
@@ -197,7 +199,7 @@
    return [
      {
        title: t('universal'), list: [
          { icon: new URL('../../assets/image/assets-center/help.png', import.meta.url), title: t('language'), path: '/language' },
          { icon: new URL('../../assets/image/assets-center/language.png', import.meta.url), title: t('language'), path: '/language' },
          // { icon: 'gold-coin-o', title: t('计价方式'), path: '/cryptos/exchangeRate' },
          { icon: new URL('../../assets/image/assets-center/aboutUs.png', import.meta.url), title: t('onLineService'), path: '/customerService' },
@@ -221,14 +223,6 @@
    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 被正确声明
@@ -257,6 +251,8 @@
</script>
<style lang="scss" scoped>
@import '@/assets/theme/index.scss';
:deep(.van-cell-group__title) {
  // background: $main2_background !important;
  background: $inp-b !important;
@@ -288,11 +284,15 @@
}
:deep(.van-icon) {
  color: $text_color;
  @include themify() {
    color: themed("text_color") !important;
  }
}
:deep(.van-cell__title) {
  color: $text_color;
  @include themify() {
    color: themed("text_color") !important;
  }
}
:deep(.van-cell:after) {
@@ -320,9 +320,11 @@
  .label_item {
    width: 33%;
    font-size: 12px;
   div{
      text-align: center;
   }
    div {
      text-align: center;
    }
    img {
      width: 32%;
      margin-bottom: 3px;