From 93f9b248dd0eecbaa77006e5146c58c831d89d8e Mon Sep 17 00:00:00 2001
From: lxf <1371462558@qq.com>
Date: Mon, 07 Jul 2025 17:12:16 +0800
Subject: [PATCH] style
---
src/components/Transform/list-quotation/index.vue | 72 ++++++++++++++++++++++++-----------
1 files changed, 49 insertions(+), 23 deletions(-)
diff --git a/src/components/Transform/list-quotation/index.vue b/src/components/Transform/list-quotation/index.vue
index c6aa564..3f0a2e4 100644
--- a/src/components/Transform/list-quotation/index.vue
+++ b/src/components/Transform/list-quotation/index.vue
@@ -19,17 +19,17 @@
<!-- 热门 -->
<div class="flex items-end justify-between" style="margin: 14px 0;">
<div class="block text-22 font-medium" >{{$t('Market')}}</div>
- <div class="relative text-13">
- <!-- <div class="flex px-10 justify-between rounded-full bg-black text-white min-w-100 box-border">
- <div class="block">貨幣</div>
- <div class="i-material-symbols:arrow-drop-down-rounded"></div>
- </div> -->
- <!-- <div class="px-9 py-10 bg-black text-white flex flex-col absolute min-w-100 box-border top-25 rounded-11 leading-28" style="display: none;">
- <div>貨幣</div>
- <div>數字貨幣</div>
- <div>期貨</div>
- <div>收藏</div>
- </div> -->
+ <div class="relative text-13" @click="toggleDropdown">
+ <div class="flex px-20 justify-between rounded-full bg-black text-white min-w-100 box-border">
+ <div class="block">{{ $t(topTitle) }}</div>
+ <van-icon name="play" style="align-content:center;transform: rotate(90deg);"/>
+ </div>
+ <div class="px-16 py-20 bg-black text-white flex flex-col absolute min-w-100 box-border top-25 rounded-11 leading-28" style="z-index:999;margin-top: 0.8rem;" v-show="isTopShow">
+ <div @click="changeType('币币交易', 1)">{{ $t('币币交易') }}</div>
+ <div @click="changeType('外汇交割', 2)">{{ $t('外汇交割') }}</div>
+ <!-- <div>期貨</div>
+ <div>收藏</div> -->
+ </div>
</div>
</div>
@@ -62,10 +62,10 @@
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_str > 0">
- +{{ item.change_ratio_str || (item.change_ratio_str === 0 ? 0 : '--') }}%</p>
+ <p class="w-153 font-31 h-71 bg-green text-white border-0 text-center btn" v-if="item.change_ratio_str > 0 || item.change_ratio > 0">
+ +{{ item.change_ratio || (item.change_ratio_str === 0 ? 0 : '--') }}%</p>
<p class="w-153 font-31 h-71 bg-red text-white border-0 text-center btn" v-else>
- {{ item.change_ratio_str || (item.change_ratio_str === 0 ? 0 : '--') }}%</p>
+ {{ item.change_ratio || (item.change_ratio_str === 0 ? 0 : '--') }}%</p>
</li>
</ul>
</van-cell>
@@ -82,9 +82,9 @@
}}</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="font-24 text-grey" style="position: relative; top: 1px">
/USDT
- </span>
+ </span> -->
</span>
<span class="font-24 text-grey text-left">{{ $t('成交量') + ' ' + (item.amount * 1).toFixed(2) }}</span>
</p>
@@ -99,10 +99,10 @@
{{ (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" v-if="item.change_ratio_str > 0">
- +{{ item.change_ratio_str }}%</p>
+ <p class="w-153 font-31 h-71 bg-green text-white border-0 text-center btn" v-if="item.change_ratio_str > 0 || item.change_ratio > 0">
+ +{{ item.change_ratio || item.change_ratio_str }}%</p>
<p class="w-153 font-31 h-71 bg-red text-white border-0 text-center btn" v-else>
- {{ item.change_ratio_str || (item.change_ratio_str === 0 ? 0 : '--') }}%</p>
+ {{ item.change_ratio || (item.change_ratio_str === 0 ? 0 : '--') }}%</p>
</template>
</li>
</ul>
@@ -132,6 +132,9 @@
fixDate,
HOST_URL,
active: 0,
+ isTopShow: false,
+ topTitle: '币币交易',
+ topValue: 1,
type: 'left' //left 从左往右 right 从有王座
}
},
@@ -164,17 +167,32 @@
},
methods: {
...mapActions('home', [SET_CURRENCY]),
+ changeType(tit, val){
+ this.topTitle = tit
+ this.topValue = val
+ this.$emit('onfetchQList', val)
+ },
+ toggleDropdown(){
+ if(this.isTopShow){
+ this.isTopShow = false
+ }else{
+ this.isTopShow = true
+ }
+ },
onItemClick(item) {
- if (this.tabActive == 2) { //现货
+ if (this.topValue == 2) { //现货
+ setStorage('symbol', item.symbol)
this.$router.push({
- path: `/cryptos/trade/${item.symbol}`
+ path: `/cryptos/perpetualContract/${item.symbol}`,
+ query: { selectIndex: 2 }
});
} else {
setStorage('symbol', item.symbol)
// /cryptos/perpetualContract/btcusdt?selectIndex=2
this.$router.push({
- path: `/cryptos/perpetualContract/${item.symbol}`,
- query: { selectIndex: 2 }
+ path:`/cryptos/trade/${item.symbol}`,
+ // path: `/cryptos/perpetualContract/${item.symbol}`,
+ // query: { selectIndex: 2 }
});
// this.$router.push({
// path: `/foreign/deliveryContract/${item.symbol}`,
@@ -305,4 +323,12 @@
.text-grey{
// color: #8c8c8c;
}
+
+#cryptos .list-quatation .van-cell{
+ padding: 24px !important;
+ border-radius: 1rem;
+}
+.list-quatation{
+ margin: 0 20px;
+}
</style>
--
Gitblit v1.9.3