From 421087f05bbcee88211f2b95afd4843da521998b Mon Sep 17 00:00:00 2001
From: jhzh <1628036192@qq.com>
Date: Tue, 22 Jul 2025 16:02:58 +0800
Subject: [PATCH] 1
---
src/page/list/tradingList/data.list.vue | 115 +++++++++++++++++++++++++++++++++++++--------------------
1 files changed, 75 insertions(+), 40 deletions(-)
diff --git a/src/page/list/tradingList/data.list.vue b/src/page/list/tradingList/data.list.vue
index 7543b55..dfcb49d 100644
--- a/src/page/list/tradingList/data.list.vue
+++ b/src/page/list/tradingList/data.list.vue
@@ -1,6 +1,6 @@
<template>
<div class="list-data">
- <div class="header-box">
+ <!-- <div class="header-box">
<van-row type="flex" align="center" gutter="20">
<van-col span="8">
<div>
@@ -23,7 +23,7 @@
</div>
</van-col>
</van-row>
- </div>
+ </div> -->
<van-pull-refresh
v-model="refreshing"
@refresh="onRefresh"
@@ -46,45 +46,60 @@
:key="item.indexCode"
>
<van-row type="flex" align="center" gutter="20">
- <van-col span="8">
- <div>
- <div class="tp">
- <div class="collection" @click="optionszx(item)">
- <div
- class="shu"
- :class="item.isOption == '1' ? 'shublue' : ''"
- ></div>
- </div>
- <div
- class="title_color"
- style="
- width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- "
- >
- {{ item.name || item.stockName }}
- </div>
- </div>
- <div class="bt">
- <span>{{ item.spell || item.stockSpell }}</span>
- </div>
- </div>
- </van-col>
+ <!-- <van-col span="3"> -->
+ <!-- </van-col> -->
<van-col span="3">
- <div style="text-align: right">
- {{ (item.gid || item.stockGid) == "nse" ? "NSE" : "BSE" }}
+ <img style="width: 42px;height: 42px;border-radius: 50px;" src="@/assets/img/nologo.svg"/>
+ </van-col>
+ <van-col span="8">
+ <div >
+ <!-- <div> -->
+ <div class="tp">
+ <div class="collection" @click="optionszx(item)">
+ <div
+ class="shu"
+ :class="item.isOption == '1' ? 'shublue' : ''"
+ ></div>
+ </div>
+ <div
+ class="title_color"
+ style="
+ width: 100%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ "
+ >
+ {{ item.name || item.stockName }}
+ </div>
+ <!-- </div> -->
+
+ </div>
+ <div class="bt" style="font-size: 12px;margin-top: 10px;">
+ <span>{{ item.spell || item.stockSpell }}</span>
+ <span style="padding: 3px 4px;background-color: #E8F4F0;color: #185546;font-size: 10px;">{{$t('日股')}}</span>
+ </div>
</div>
</van-col>
- <van-col :span="active == 'DZ' ? '12' : '7'">
+ <!-- <van-col span="3">
<div style="text-align: right">
- <div class="tp">
- <span class="price_color">
- {{ item.nowPrice | _toLocaleString(false) }}
- </span>
+ {{ (item.gid || item.stockGid).toUpperCase() }}
+ </div>
+ </van-col> -->
+
+ <van-col :span="active == 'DZ' ? '12' : '7'">
+ <div >
+ <div class="tp" style="display: flex;flex-direction: column;">
+ <span style="margin-bottom: 10px;font-size: .32rem;color: #858093;">{{$t('最新价')}}</span>
+ <div style="display: flex;">
+ <span class="price_color" style="font-size: 16px;font-weight: bold;">
+ {{ item.nowPrice }}
+ </span>
+ <img v-if="item.hcrateP.charAt(0) == '-'" style="width: 18px;" src="@/assets/home/greeensvg.png"/>
+ <img v-else style="width: 18px;" src="@/assets/home/R10OVD4.png"/>
+ </div>
</div>
<div class="bt" v-if="active != 'DZ'">
<span>{{ item.addTime }}</span>
@@ -93,11 +108,15 @@
</van-col>
<van-col span="6" v-if="active != 'DZ'">
<div style="text-align: right">
- <div
+ <!-- <div
class="tp right_bs"
:class="`${item.hcrateP.charAt(0) == '+' ? 'green' : 'red'}`"
+ > -->
+ <div
+ class="tp " style="display: flex;flex-direction: column;"
>
- <span class="price_color">{{ item.hcrateP }}</span>
+ <span :class="item.hcrateP.charAt(0) == '-'?'price_colorgree':'price_colorred'" style="margin-bottom: 10px;font-weight: bold;font-size: 12px;">{{ item.hcrate }}</span>
+ <span :class="item.hcrateP.charAt(0) == '-'?'price_colorgree':'price_colorred'" style="font-weight: bold;font-size: 12px;">{{ item.hcrateP }}</span>
</div>
</div>
</van-col>
@@ -186,7 +205,12 @@
refreshing: false,
};
},
-
+ beforeDestroy() {
+ if (this.Trade) {
+ this.Trade.close();
+ console.log('WebSocket disconnected');
+ }
+ },
mounted() {
this.listArr = [];
this.pageNumVal = 1;
@@ -264,8 +288,9 @@
// api.positionzx;
let data;
if (a !== "") {
- if (a == "IN") {
+ if (a == "JP") {
//印股
+ opt.stockType = "JP";
data = await api.getStockByType(opt);
} else {
//大宗
@@ -330,7 +355,7 @@
initWebSocket() {
console.log("initWebSocket");
this.Trade = new WhrWebSocket({
- path: `wss://ws.ispentagon-institution.com/websocket-server`,
+ path: `wss://wss.yanshiz.com/websocket-server `,
onmessage: this.getTradeMessage,
});
@@ -364,6 +389,16 @@
</script>
<style lang="less" scoped>
+ .price_colorred {
+ color: #C8302F;
+ font-size: 0.4rem;
+ font-weight: 600;
+ }
+ .price_colorgree {
+ color: #0FAD60;
+ font-size: 0.4rem;
+ font-weight: 600;
+ }
.box-a {
display: flex;
justify-content: space-between;
--
Gitblit v1.9.3