From 69c44c2a37e0651f3878346b0f175f8caf179d16 Mon Sep 17 00:00:00 2001
From: hongxilin <17663930442@163.com>
Date: Thu, 30 Oct 2025 18:08:40 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B6=A8=E8=B7=8C=E5=8A=A0=E7=AC=A6=E5=8F=B7?=
=?UTF-8?q?=EF=BC=8C=E4=BB=BB=E5=8A=A1=E6=A0=8F=E6=8C=89=E9=92=AE=E5=8F=98?=
=?UTF-8?q?=E5=A4=A7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/IndexCard.vue | 8 ++-
pages/marketSituation/marketDetail.vue | 112 ++----------------------------
pages/marketSituation/marketSituation.vue | 4 +-
3 files changed, 15 insertions(+), 109 deletions(-)
diff --git a/components/IndexCard.vue b/components/IndexCard.vue
index 69a3de3..176fc6a 100644
--- a/components/IndexCard.vue
+++ b/components/IndexCard.vue
@@ -12,8 +12,8 @@
{{ currentPrice }}
- {{ changeAmount }}
- {{ changePercent }}
+ {{ judgeSymbol(changeAmount) }}
+ {{ judgeSymbol(changePercent) }}
@@ -63,6 +63,10 @@ const props = defineProps({
},
});
+const judgeSymbol = (num) => {
+ return num[0] === "-" ? num : "+" + num;
+};
+
const getMarketFlag = (market) => {
let imagePath;
diff --git a/pages/marketSituation/marketDetail.vue b/pages/marketSituation/marketDetail.vue
index 98e52a3..155c8a9 100644
--- a/pages/marketSituation/marketDetail.vue
+++ b/pages/marketSituation/marketDetail.vue
@@ -36,7 +36,7 @@
-
+
{{ item.stockName }}
{{ item.stockCode }}
@@ -48,7 +48,7 @@
- {{ item.changePercent }}
+ {{ judgeSymbol(item.changePercent) }}
@@ -79,107 +79,6 @@ const sortType = ref(""); // 排序类型:'price' 或 'change'
const sortOrder = ref("desc"); // 排序顺序:'asc' 或 'desc'
const regionalGroupArray = ref([]);
-// 股票数据
-const stockList = ref([
- {
- stockName: "Telecommunication",
- stockCode: "888607",
- price: 1349.47,
- change: "+7.67%",
- isRising: true,
- },
- {
- stockName: "Other",
- stockCode: "888607",
- price: 1349.47,
- change: "+6.67%",
- isRising: true,
- },
- {
- stockName: "Consumer Discretio...",
- stockCode: "888610",
- price: 1349.47,
- change: "+5.67%",
- isRising: true,
- },
- {
- stockName: "Telecommunication",
- stockCode: "888607",
- price: 1349.47,
- change: "+4.67%",
- isRising: true,
- },
- {
- stockName: "Other",
- stockCode: "888611",
- price: 1359.47,
- change: "+3.67%",
- isRising: true,
- },
- {
- stockName: "Consumer Discretio...",
- stockCode: "888610",
- price: 1349.47,
- change: "+2.67%",
- isRising: true,
- },
- {
- stockName: "Telecommunication",
- stockCode: "888607",
- price: 1349.47,
- change: "+1.67%",
- isRising: true,
- },
- {
- stockName: "Other",
- stockCode: "888611",
- price: 1009.98,
- change: "-1.67%",
- isRising: false,
- },
- {
- stockName: "Consumer Discretio...",
- stockCode: "888610",
- price: 1009.98,
- change: "-0.67%",
- isRising: false,
- },
- {
- stockName: "Telecommunication",
- stockCode: "888607",
- price: 1009.98,
- change: "-0.67%",
- isRising: false,
- },
- {
- stockName: "Other",
- stockCode: "888611",
- price: 1009.98,
- change: "-1.67%",
- isRising: false,
- },
- {
- stockName: "Consumer Discretio...",
- stockCode: "888610",
- price: 1009.98,
- change: "-4.67%",
- isRising: false,
- },
- {
- stockName: "Consumer Discretio...",
- stockCode: "888610",
- price: 1009.98,
- change: "-3.67%",
- isRising: false,
- },
- {
- stockName: "Consumer Discretio...",
- stockCode: "888610",
- price: 1009.98,
- change: "-3.67%",
- isRising: false,
- },
-]);
// 计算属性
const contentTopPosition = computed(() => {
@@ -206,6 +105,10 @@ const sortedStockList = computed(() => {
return list;
});
+const judgeSymbol = (num) => {
+ return num[0] === "-" ? num : "+" + num;
+};
+
const getRegionalGroupList = async () => {
try {
const result = await getRegionalGroupListAPI({
@@ -224,7 +127,7 @@ const goBack = () => {
};
// 方法:查看指数详情
-const viewIndexDetail = (item,index) => {
+const viewIndexDetail = (item, index) => {
console.log("查看指数详情:", item.stockName);
// 这里可以跳转到具体的指数详情页面
uni.navigateTo({
@@ -348,7 +251,6 @@ const sendTcpMessage = (command) => {
break;
}
if (!messageData) {
-
return;
} else {
try {
diff --git a/pages/marketSituation/marketSituation.vue b/pages/marketSituation/marketSituation.vue
index 1503954..bec52f2 100644
--- a/pages/marketSituation/marketSituation.vue
+++ b/pages/marketSituation/marketSituation.vue
@@ -496,8 +496,8 @@ watch(headerHeight, (newHeight) => {
}
.scroll_indicator image {
- width: 20rpx;
- height: 20rpx;
+ width: 30rpx;
+ height: 30rpx;
opacity: 0.5;
}