1
jhzh
2026-05-22 ef52095f5e9f0a9fe2da779bb1573947d77d75b6
src/components/Transform/list-quotation/index.vue
@@ -22,10 +22,11 @@
      <transition-group :name="type" tag="div">
        <div v-if="active == 0">
          <van-cell v-for="item in listData" :key="item.id">
            <ul class="flex justify-between w-full items-center" @click="onItemClick(item)">
            <ul class="flex justify-between w-full items-center"  @click="onItemClick(item)">
              <li class="flex items-center left">
                <img
                  :src="item.symbol ? `${HOST_URL}/symbol/${item.symbol_data}.png` : handleImage('../../../assets/loading-default.png')"
                  :src="getSymbolImg(item)"
                  @error="onSymbolImgError"
                  alt="logo" class="w-72 h-72 rounded-full mr-16" />
                <p class="flex flex-col">
                  <span class="flex items-end font-32 flex items-center">
@@ -36,7 +37,7 @@
                    <!-- <span class="font-24 text-grey" style="position: relative; top: 1px">
                      {{ item.name && item.name.replace(item.symbol.toUpperCase(), '') || '--' }}</span> -->
                  </span>
                  <span class="font-24 text-grey text-left">{{ $t('成交量') + ' ' + (item.amount * 1).toFixed(2) }}</span>
                  <!-- <span class="font-24 text-grey text-left">{{ $t('成交量') + ' ' + (item.amount * 1).toFixed(2) }}</span> -->
                </p>
              </li>
              <li class="flex flex-col items-end mid">
@@ -59,8 +60,9 @@
          <van-cell v-for="item in showList" :key="item.id">
            <ul class="flex justify-between w-full items-center" @click="onItemClick(item)">
              <li class="flex items-center left">
                <img :src="`${HOST_URL}/symbol/${item.symbol_data}.png`" alt="logo"
                  class="w-72 h-72 rounded-full mr-16" />
                <img :src="getSymbolImg(item)"
                  @error="onSymbolImgError"
                  alt="logo" class="w-72 h-72 rounded-full mr-16" />
                <p class="flex flex-col">
                  <span class="flex items-end font-32 flex items-center">
                    <span class="textColor font-600 font-30">{{ arrGk(item.name.toUpperCase())[0] }}</span>
@@ -110,12 +112,14 @@
import ExTabs from "@/components/Transform/ex-tabs/index.vue";
import { HOST_URL } from '@/config'
import { SET_CURRENCY } from "@/store/const.store";
const defaultLogo = new URL('@/assets/imgs/logo.png', import.meta.url).href;
export default {
  name: 'ListQuotation',
  data() {
    return {
      fixDate,
      HOST_URL,
      defaultLogo,
      active: 0,
      showList: [],
      type: 'left' //left 从左往右 right 从有王座
@@ -171,8 +175,14 @@
        });
      }
    },
    handleImage(url) {
      return new URL(url, import.meta.url).href
    getSymbolImg(item) {
      if (item?.symbol && item?.symbol_data && this.HOST_URL) {
        return `${this.HOST_URL}/symbol/${(item.symbol_data + '').toLowerCase()}.png`;
      }
      return this.defaultLogo;
    },
    onSymbolImgError(e) {
      if (e?.target) e.target.src = this.defaultLogo;
    },
    onTabs(val) {
      if (this.active < val) {
@@ -235,7 +245,7 @@
@import "@/assets/init.scss";
#cryptos {
  .left-enter-active,
  .left-leave-active,
  .right-enter-active,
@@ -243,7 +253,11 @@
    will-change: transform;
    transition: all 250ms;
  }
.van-cell {
  padding: 25px 15px !important;
  background-color: #fff !important;
  border-radius: 10px !important;
}
  .textColor {
    color: $text_color4;
  }