1
李凌
2025-10-09 c17311ba1351cd5e64654c3fc7b2fe765b1e7382
src/components/Transform/list-quotation/index.vue
@@ -20,78 +20,79 @@
        </div>
      </van-cell>
      <transition-group :name="type" tag="div">
        <div v-if="active == 0" :key="active">
        <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)">
              <li class="flex items-center left">
                <img
                  :src="item.symbol ? `${HOST_URL}/symbol/${item.symbol_data}.png` : handleImage('../../../assets/loading-default.png')"
                  alt="logo" class="w-72 h-72 rounded-full mr-16" />
                  alt="logo" class="w-35 h-35 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">{{ item.symbol_data && item.symbol_data.toUpperCase() ||
                      '--'
                      }}</span>
                    <span class="font-24 text-grey" style="position: relative; top: 1px">
                  <span class="flex items-end flex items-center font-16">
                    <span class="textColor font-600">
                      {{ item.symbol_data && item.symbol_data.toUpperCase() || '--' }}
                    </span>
                    <span class="text-grey" style="position: relative; top: 1px">
                      /USDT
                    </span>
                    <!-- <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-12 text-grey text-left leading-none">{{ $t('成交量') + ' ' + (item.amount *
                    1).toFixed(2) }}</span>
                </p>
              </li>
              <li class="flex flex-col items-end mid">
                <p class="textColor font-32 font-600">{{ item.close || '--' }}</p>
                <p class="font-24 text-grey">{{ currency.currency_symbol }}
                <p class="textColor font-16 font-600">{{ item.close || '--' }}</p>
                <p class="font-12 text-grey leading-none">{{ currency.currency_symbol }}
                  {{ item.close && item.symbol_data.toUpperCase() == 'SHIB' ? (item.close * currency.rate).toFixed(8) :
                    (item.close *
                      currency.rate).toFixed(2) || '--' }}</p>
              </li>
              <li class="right flex items-center justify-end">
                <p class="w-153 font-31 h-71 bg-green text-white border-0 text-center btn" v-if="item.change_ratio > 0">
                <p class="w-153 font-12 h-50 bg-green text-white border-0 text-center btn" v-if="item.change_ratio > 0">
                  +{{ item.change_ratio || (item.change_ratio === 0 ? 0 : '--') }}%</p>
                <p class="w-153 font-31 h-71 bg-red text-white border-0 text-center btn" v-else>
                <p class="w-153 font-12 h-50 bg-red text-white border-0 text-center btn" v-else>
                  {{ item.change_ratio || (item.change_ratio === 0 ? 0 : '--') }}%</p>
              </li>
            </ul>
          </van-cell>
        </div>
        <div v-else :key="active">
        <div v-else>
          <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" />
                  class="w-35 h-35 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">{{ item.symbol_data && item.symbol_data.toUpperCase() ||
                      '--'
                      }}</span>
                  <span class="flex items-end flex items-center font-16">
                    <span class="textColor font-600">
                      {{ item.symbol_data && item.symbol_data.toUpperCase() || '--' }}
                    </span>
                    <!-- <span class="font-24 text-grey" style="position: relative; top: 1px">
                      {{ item.name && item.name.replace(item.symbol.toUpperCase(), '') || '--' }}</span> -->
                    <span class="font-24 text-grey" style="position: relative; top: 1px">
                    <span class="text-grey" style="position: relative; top: 1px">
                      /USDT
                    </span>
                  </span>
                  <span class="font-24 text-grey text-left">{{ $t('成交量') + ' ' + (item.amount * 1).toFixed(2) }}</span>
                  <span class="font-12 text-grey text-left">{{ $t('成交量') + ' ' + (item.amount * 1).toFixed(2) }}</span>
                </p>
              </li>
              <li class="flex flex-col items-end mid">
                <p class="textColor font-32 font-600">{{ item.close }}</p>
                <p class="font-24 text-grey">{{ currency.currency_symbol }} {{ item.close &&
                <p class="textColor font-16 font-600">{{ item.close }}</p>
                <p class="font-12 text-grey leading-none">{{ currency.currency_symbol }} {{ item.close &&
                  item.symbol_data.toUpperCase() == 'SHIB' ? (item.close * currency.rate).toFixed(8) : (item.close *
                    currency.rate).toFixed(2) || '--' }}</p>
              </li>
              <li class="right flex items-center justify-end text-right">
                <div v-if="active == 3" class="textColor w-182 font-700 font-24">
                <div v-if="active == 3" class="textColor w-182 font-700 font-12">
                  {{ (item.volume * 1).toFixed(2) }}
                </div>
                <template v-else>
                  <p class="w-153 font-31 h-71 bg-green text-white border-0 text-center btn"
                  <p class="w-153 font-12 h-50 bg-green text-white border-0 text-center btn"
                    v-if="item.change_ratio > 0">
                    +{{ item.change_ratio }}%</p>
                  <p class="w-153 font-31 h-71 bg-red text-white border-0 text-center btn" v-else>
                  <p class="w-153 font-12 h-50 bg-red text-white border-0 text-center btn" v-else>
                    {{ item.change_ratio || (item.change_ratio === 0 ? 0 : '--') }}%</p>
                </template>
              </li>
@@ -240,7 +241,7 @@
    transition: all 250ms;
  }
  .textColor{
  .textColor {
    color: $text_color4;
  }
@@ -271,7 +272,9 @@
  .btn {
    border-radius: 9px;
    line-height: 71px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .left {