diff --git a/pages/marketSituation/globalIndex.vue b/pages/marketSituation/globalIndex.vue index 2a2ed7d..beb2fc4 100644 --- a/pages/marketSituation/globalIndex.vue +++ b/pages/marketSituation/globalIndex.vue @@ -43,7 +43,7 @@ - @@ -62,7 +62,7 @@ - @@ -81,7 +81,7 @@ - @@ -145,7 +145,8 @@ const checkWarnTextOverflow = () => { const asiachinaIndexes = ref([ { flagIcon: '/static/c1.png', - indexName: '上证指数', + stockName: '上证指数', + stockCode:'noCode', currentPrice: '3933.96', changeAmount: '+24.32', changePercent: '+0.62%', @@ -153,7 +154,8 @@ const asiachinaIndexes = ref([ }, { flagIcon: '/static/c2.png', - indexName: '深证成指', + stockName: '深证成指', + stockCode:'noCode', currentPrice: '45757.90', changeAmount: '-123.45', changePercent: '-0.27%', @@ -161,7 +163,8 @@ const asiachinaIndexes = ref([ }, { flagIcon: '/static/c3.png', - indexName: '创业板指', + stockName: '创业板指', + stockCode:'noCode', currentPrice: '6606.08', changeAmount: '+89.76', changePercent: '+1.38%', @@ -169,7 +172,8 @@ const asiachinaIndexes = ref([ }, { flagIcon: '/static/c4.png', - indexName: 'HSI50', + stockName: 'HSI50', + stockCode:'noCode', currentPrice: '22333.96', changeAmount: '+156.78', changePercent: '+0.71%', @@ -177,7 +181,8 @@ const asiachinaIndexes = ref([ }, { flagIcon: '/static/c5.png', - indexName: '沪深300', + stockName: '沪深300', + stockCode:'noCode', currentPrice: '45757.90', changeAmount: '-89.12', changePercent: '-0.19%', @@ -185,7 +190,8 @@ const asiachinaIndexes = ref([ }, { flagIcon: '/static/c6.png', - indexName: '上证50', + stockName: '上证50', + stockCode:'noCode', currentPrice: '45757.90', changeAmount: '+234.56', changePercent: '+0.52%', @@ -197,7 +203,8 @@ const asiachinaIndexes = ref([ const asiaIndexes = ref([ { flagIcon: '/static/c7.png', - indexName: '日经225', + stockName: '日经225', + stockCode:'noCode', currentPrice: '28456.78', changeAmount: '+234.56', changePercent: '+0.83%', @@ -205,7 +212,8 @@ const asiaIndexes = ref([ }, { flagIcon: '/static/c8.png', - indexName: '韩国KOSPI', + stockName: '韩国KOSPI', + stockCode:'noCode', currentPrice: '2567.89', changeAmount: '-12.34', changePercent: '-0.48%', @@ -213,7 +221,8 @@ const asiaIndexes = ref([ }, { flagIcon: '/static/c9.png', - indexName: '印度孟买', + stockName: '印度孟买', + stockCode:'noCode', currentPrice: '65432.10', changeAmount: '+456.78', changePercent: '+0.70%', @@ -225,7 +234,8 @@ const asiaIndexes = ref([ const americaIndexes = ref([ { flagIcon: '/static/c7.png', - indexName: '道琼斯指数', + stockName: '道琼斯指数', + stockCode:'noCode', currentPrice: '34567.89', changeAmount: '+123.45', changePercent: '+0.36%', @@ -233,7 +243,8 @@ const americaIndexes = ref([ }, { flagIcon: '/static/c8.png', - indexName: '纳斯达克', + stockName: '纳斯达克', + stockCode:'noCode', currentPrice: '13456.78', changeAmount: '-67.89', changePercent: '-0.50%', @@ -241,7 +252,8 @@ const americaIndexes = ref([ }, { flagIcon: '/static/c9.png', - indexName: '标普500', + stockName: '标普500', + stockCode:'noCode', currentPrice: '4234.56', changeAmount: '+23.45', changePercent: '+0.56%', @@ -281,16 +293,16 @@ const viewMore = (market) => { // 方法:查看指数详情 const viewIndexDetail = (item) => { - console.log('查看指数详情:', item.indexName) - uni.showToast({ - title: `查看 ${item.indexName} 详情`, - icon: 'none', - duration: 2000 - }) - // 这里可以跳转到具体的指数详情页面 - // uni.navigateTo({ - // url: `/pages/detail/indexDetail?id=${item.id}` + console.log('查看指数详情:', item.stockName) + // uni.showToast({ + // title: `查看 ${item.stockName} 详情`, + // icon: 'none', + // duration: 2000 // }) + // 这里可以跳转到具体的指数详情页面 + uni.navigateTo({ + url: `/pages/marketSituation/marketCondition?stockInformation=${encodeURIComponent(JSON.stringify(item))}` + }) } // 生命周期:页面挂载 diff --git a/pages/marketSituation/marketDetail.vue b/pages/marketSituation/marketDetail.vue index f349d6f..0252547 100644 --- a/pages/marketSituation/marketDetail.vue +++ b/pages/marketSituation/marketDetail.vue @@ -37,10 +37,10 @@ + @click="viewIndexDetail(stock)"> - {{ stock.name }} - {{ stock.code }} + {{ stock.stockName }} + {{ stock.stockCode }} { uni.navigateBack() } +// 方法:查看指数详情 +const viewIndexDetail = (item) => { + console.log('查看指数详情:', item.stockName) + // uni.showToast({ + // title: `查看 ${item.stockName} 详情`, + // icon: 'none', + // duration: 2000 + // }) + // 这里可以跳转到具体的指数详情页面 + uni.navigateTo({ + url: `/pages/marketSituation/marketCondition?stockInformation=${encodeURIComponent(JSON.stringify(item))}` + }) +} + const sortByPrice = () => { if (sortType.value === 'price') { sortOrder.value = sortOrder.value === 'asc' ? 'desc' : 'asc' @@ -250,11 +264,6 @@ const sortByChange = () => { } } -const viewStockDetail = (stock) => { - console.log('查看股票详情:', stock) - // 这里可以跳转到股票详情页面 -} - onMounted(() => { // 获取状态栏高度 iSMT.value = uni.getSystemInfoSync().statusBarHeight; diff --git a/pages/marketSituation/marketOverview.vue b/pages/marketSituation/marketOverview.vue index db1ad11..ad25c7b 100644 --- a/pages/marketSituation/marketOverview.vue +++ b/pages/marketSituation/marketOverview.vue @@ -1,733 +1,757 @@ + + \ No newline at end of file +