From 154848e66fd2f82ce1a9be92f1abbe502d661fc3 Mon Sep 17 00:00:00 2001
From: lxf <1371462558@qq.com>
Date: Thu, 24 Apr 2025 22:42:31 +0800
Subject: [PATCH] feat: 基本完成
---
src/page/list/tradingList/data.list.vue | 54 ++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 46 insertions(+), 8 deletions(-)
diff --git a/src/page/list/tradingList/data.list.vue b/src/page/list/tradingList/data.list.vue
index be8151f..d221c31 100644
--- a/src/page/list/tradingList/data.list.vue
+++ b/src/page/list/tradingList/data.list.vue
@@ -22,6 +22,19 @@
{{ $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">الترتيب</van-button>
+ </template>
+ </van-popover>
+ </van-col>
</van-row>
</div>
<van-pull-refresh
@@ -46,7 +59,7 @@
:key="item.indexCode"
>
<van-row type="flex" align="center" gutter="20">
- <van-col span="8">
+ <van-col span="8" 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,7 +87,7 @@
</div>
</van-col>
- <van-col span="3">
+ <van-col span="3" v-if="active != 'HJ'">
<div style="text-align: right">
{{ (item.gid || item.stockGid).toUpperCase() }}
</div>
@@ -91,11 +105,11 @@
</div>
</div>
</van-col>
- <van-col span="6" v-if="active != 'DZ'">
+ <van-col span="6" v-if="!['DZ', 'HJ'].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: "ترتيب", zh: "升序", val: "asc" },
+ { text: "التخفيض", zh: "降序", val: "desc" },
+ { text: "طبيعي", 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;
@@ -221,7 +246,8 @@
// 点击进入详情
const obj = {
pid: item.code || "",
- type: item.stock_type || ""
+ type: item.stock_type || "",
+ name: item.name || ""
};
window.localStorage.setItem("kLine", JSON.stringify(obj));
// return;
@@ -264,7 +290,7 @@
stockPlate: "",
keyWords: this.sousuo,
stockType: stockType,
- orderBy: ""
+ orderBy: this.orderBy
};
// console.log();
@@ -275,6 +301,18 @@
if (a == "ST") {
//沙特
data = await api.getStockByType(opt);
+ } else if (a == "HJ") {
+ data = await api.getGoldCrudeOil();
+
+ data.data.list = Object.entries(data.data).map(([name, nowPrice]) => {
+ let nowPriceArr = Object.entries(nowPrice);
+ return {
+ name,
+ st_name: nowPriceArr[0][0],
+ nowPrice: nowPriceArr[0][1],
+ stock_type: "HJ"
+ };
+ });
} else {
//大宗
opt.stockType = "";
--
Gitblit v1.9.3