Browse Source

合并冲突

zhaowenkang/feature-20251028181547-行情页面
no99 4 weeks ago
parent
commit
c5d106536b
  1. 60
      pages/marketSituation/globalIndex.vue
  2. 81
      pages/marketSituation/marketDetail.vue
  3. 1036
      pages/marketSituation/marketOverview.vue

60
pages/marketSituation/globalIndex.vue

@ -43,7 +43,7 @@
</view>
<view class="cards-grid-three">
<view v-for="(item, index) in asiachinaIndexes" :key="index" class="card-item">
<IndexCard :flagIcon="item.flagIcon" :indexName="item.indexName"
<IndexCard :flagIcon="item.flagIcon" :stockName="item.stockName"
:currentPrice="item.currentPrice" :changeAmount="item.changeAmount"
:changePercent="item.changePercent" :isRising="item.isRising"
@click="viewIndexDetail(item)" />
@ -62,7 +62,7 @@
</view>
<view class="cards-grid-three">
<view v-for="(item, index) in asiaIndexes" :key="index" class="card-item">
<IndexCard :flagIcon="item.flagIcon" :indexName="item.indexName"
<IndexCard :flagIcon="item.flagIcon" :stockName="item.stockName"
:currentPrice="item.currentPrice" :changeAmount="item.changeAmount"
:changePercent="item.changePercent" :isRising="item.isRising"
@click="viewIndexDetail(item)" />
@ -81,7 +81,7 @@
</view>
<view class="cards-grid-three">
<view v-for="(item, index) in americaIndexes" :key="index" class="card-item">
<IndexCard :flagIcon="item.flagIcon" :indexName="item.indexName"
<IndexCard :flagIcon="item.flagIcon" :stockName="item.stockName"
:currentPrice="item.currentPrice" :changeAmount="item.changeAmount"
:changePercent="item.changePercent" :isRising="item.isRising"
@click="viewIndexDetail(item)" />
@ -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))}`
})
}
//

81
pages/marketSituation/marketDetail.vue

@ -37,10 +37,10 @@
<!-- 股票列表 -->
<view class="stock-list">
<view class="stock-row" v-for="(stock, index) in sortedStockList" :key="index"
@click="viewStockDetail(stock)">
@click="viewIndexDetail(stock)">
<view class="stock-cell name-column">
<view class="stock-name">{{ stock.name }}</view>
<view class="stock-code">{{ stock.code }}</view>
<view class="stock-name">{{ stock.stockName }}</view>
<view class="stock-code">{{ stock.stockCode }}</view>
</view>
<view class="stock-cell price-column">
<text class="stock-price"
@ -83,99 +83,99 @@ const sortOrder = ref('desc') // 排序顺序:'asc' 或 'desc'
//
const stockList = ref([
{
name: 'Telecommunication',
code: '888607',
stockName: 'Telecommunication',
stockCode: '888607',
price: 1349.47,
change: '+7.67%',
isRising: true
},
{
name: 'Other',
code: '888607',
stockName: 'Other',
stockCode: '888607',
price: 1349.47,
change: '+6.67%',
isRising: true
},
{
name: 'Consumer Discretio...',
code: '888610',
stockName: 'Consumer Discretio...',
stockCode: '888610',
price: 1349.47,
change: '+5.67%',
isRising: true
},
{
name: 'Telecommunication',
code: '888607',
stockName: 'Telecommunication',
stockCode: '888607',
price: 1349.47,
change: '+4.67%',
isRising: true
},
{
name: 'Other',
code: '888611',
stockName: 'Other',
stockCode: '888611',
price: 1359.47,
change: '+3.67%',
isRising: true
},
{
name: 'Consumer Discretio...',
code: '888610',
stockName: 'Consumer Discretio...',
stockCode: '888610',
price: 1349.47,
change: '+2.67%',
isRising: true
},
{
name: 'Telecommunication',
code: '888607',
stockName: 'Telecommunication',
stockCode: '888607',
price: 1349.47,
change: '+1.67%',
isRising: true
},
{
name: 'Other',
code: '888611',
stockName: 'Other',
stockCode: '888611',
price: 1009.98,
change: '-1.67%',
isRising: false
},
{
name: 'Consumer Discretio...',
code: '888610',
stockName: 'Consumer Discretio...',
stockCode: '888610',
price: 1009.98,
change: '-0.67%',
isRising: false
},
{
name: 'Telecommunication',
code: '888607',
stockName: 'Telecommunication',
stockCode: '888607',
price: 1009.98,
change: '-0.67%',
isRising: false
},
{
name: 'Other',
code: '888611',
stockName: 'Other',
stockCode: '888611',
price: 1009.98,
change: '-1.67%',
isRising: false
},
{
name: 'Consumer Discretio...',
code: '888610',
stockName: 'Consumer Discretio...',
stockCode: '888610',
price: 1009.98,
change: '-4.67%',
isRising: false
},
{
name: 'Consumer Discretio...',
code: '888610',
stockName: 'Consumer Discretio...',
stockCode: '888610',
price: 1009.98,
change: '-3.67%',
isRising: false
},
{
name: 'Consumer Discretio...',
code: '888610',
stockName: 'Consumer Discretio...',
stockCode: '888610',
price: 1009.98,
change: '-3.67%',
isRising: false
@ -232,6 +232,20 @@ const goBack = () => {
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;

1036
pages/marketSituation/marketOverview.vue
File diff suppressed because it is too large
View File

Loading…
Cancel
Save