From 2b38398687dc826015ae1389c2b7338af1ad02b2 Mon Sep 17 00:00:00 2001
From: lxf <1371462558@qq.com>
Date: Mon, 28 Apr 2025 18:31:25 +0800
Subject: [PATCH] style: 翻译
---
src/page/list/tradingList/data.list.vue | 76 ++++++++++++++++++++++++++++----------
1 files changed, 56 insertions(+), 20 deletions(-)
diff --git a/src/page/list/tradingList/data.list.vue b/src/page/list/tradingList/data.list.vue
index 96ae478..f3232f2 100644
--- a/src/page/list/tradingList/data.list.vue
+++ b/src/page/list/tradingList/data.list.vue
@@ -2,16 +2,16 @@
<div class="list-data">
<div class="header-box">
<van-row type="flex" align="center" gutter="20">
- <van-col span="8">
+ <van-col span="11">
<div>
{{ $t("hj313") }}
</div>
</van-col>
- <van-col span="3">
+ <!-- <van-col span="3">
<div style="text-align: right">
{{ $t("市场") }}
</div>
- </van-col>
+ </van-col> -->
<van-col :span="active == 'DZ' ? '12' : '7'">
<div style="text-align: right">
{{ $t("hj314") }}
@@ -21,6 +21,19 @@
<div style="text-align: right">
{{ $t("hj315") }}
</div>
+ </van-col>
+ <van-col span="6" v-if="active == 'ST'">
+ <van-popover
+ theme="dark"
+ v-model="showPopover"
+ trigger="click"
+ :actions="actions"
+ @select="onSelect"
+ >
+ <template #reference>
+ <van-button type="primary">{{ $t("排序") }}</van-button>
+ </template>
+ </van-popover>
</van-col>
</van-row>
</div>
@@ -46,7 +59,7 @@
:key="item.indexCode"
>
<van-row type="flex" align="center" gutter="20">
- <van-col span="8">
+ <van-col span="13" style="padding-right: 0 !important;">
<div>
<div class="tp">
<div class="collection" @click="optionszx(item)">
@@ -58,13 +71,14 @@
<div
class="title_color"
style="
+ font-size: 14px;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
"
>
- {{ item.name || item.stockName }}
+ {{ item.st_name || item.name || item.stockName }}
</div>
</div>
<div class="bt">
@@ -73,17 +87,17 @@
</div>
</van-col>
- <van-col span="3" v-if="active != 'HJ'">
+ <!-- <van-col span="3" v-if="active != 'HJ'">
<div style="text-align: right">
{{ (item.gid || item.stockGid).toUpperCase() }}
</div>
- </van-col>
+ </van-col> -->
- <van-col :span="active == 'DZ' ? '12' : '7'">
+ <van-col :span="active == 'DZ' ? '12' : '5'">
<div style="text-align: right">
<div class="tp">
<span class="price_color">
- {{ item.nowPrice | _toLocaleString(false) }}
+ {{ item.nowPrice }}
</span>
</div>
<div class="bt" v-if="active != 'DZ'">
@@ -91,11 +105,11 @@
</div>
</div>
</van-col>
- <van-col span="6" v-if="!['DZ', 'HJ'].includes(active)">
+ <van-col span="6" v-if="!['DZ'].includes(active)">
<div style="text-align: right">
<div
class="tp right_bs"
- :class="`${item.hcrateP.charAt(0) == '+' ? 'green' : 'red'}`"
+ :class="`${item.hcrate > 0 ? 'green' : 'red'}`"
>
<span class="price_color">{{ item.hcrateP }}</span>
</div>
@@ -177,13 +191,20 @@
},
data() {
return {
+ showPopover: false,
loadings: false,
finished: false,
listArr: [],
pageNumVal: 1,
getInterval: null,
num: 1,
- refreshing: false
+ orderBy: "",
+ refreshing: false,
+ actions: [
+ { text: this.$t("升序"), zh: "升序", val: "asc" },
+ { text: this.$t("降序"), zh: "降序", val: "desc" },
+ { text: this.$t("正常"), zh: "正常", val: "" }
+ ]
};
},
beforeDestroy() {
@@ -202,6 +223,10 @@
// }, 5000);
},
methods: {
+ onSelect(action) {
+ this.orderBy = action.val;
+ this.getStock(this.active, this.zxactive, 1);
+ },
filterSH(val) {
if (val === "sh") {
return 1;
@@ -265,7 +290,7 @@
stockPlate: "",
keyWords: this.sousuo,
stockType: stockType,
- orderBy: ""
+ orderBy: this.orderBy
};
// console.log();
@@ -279,13 +304,25 @@
} else if (a == "HJ") {
data = await api.getGoldCrudeOil();
- data.data.list = Object.entries(data.data).map(
- ([name, nowPrice]) => ({
+ data.data.list = Object.entries(data.data).map(([name, nowPrice]) => {
+ let nowPriceArr = Object.entries(nowPrice);
+ let nowPriceObj = {};
+ nowPriceArr.map(item => {
+ if (name === item[0]) {
+ nowPriceObj.st_name = item[0];
+ nowPriceObj.nowPrice = item[1];
+ }
+ nowPriceObj = {
+ ...nowPriceObj,
+ [item[0]]: item[1]
+ };
+ });
+ return {
name,
- nowPrice,
- stock_type: "HJ"
- })
- );
+ stock_type: "HJ",
+ ...nowPriceObj
+ };
+ });
} else {
//大宗
opt.stockType = "";
@@ -312,7 +349,6 @@
this.listArr = data.data.list;
this.loadings = false;
// this.finished = true;
- console.log("listArr", this.listArr);
if (this.listArr.length % 20) {
this.finished = true;
}
--
Gitblit v1.9.3