Browse Source

历史记录添加国旗图片

lihuilin/feature-20251024095243-我的
wangyi 3 weeks ago
parent
commit
874ce19afb
  1. 50
      components/deepExploration_header.vue
  2. 36
      pages/deepMate/deepMate.vue

50
components/deepExploration_header.vue

@ -66,8 +66,11 @@
>
<view class="history-left">
<view class="flag-circle"
><text class="flag-emoji">🇺🇸</text></view
>
><image
class="icon-stock"
:src="stockImage(item.stockMarket)"
mode="scaleToFill"
/></view>
</view>
<view class="history-main" @click="itemClick(item)">
<text class="history-query">{{ item.stockName }}</text>
@ -159,6 +162,29 @@ const onDrawerBackClick = () => {
}, 180);
};
//
function stockImage(Market) {
switch (Market) {
case "usa":
return "../../static/marketSituation-image/country-flag/us.png";
case "can":
return "../../static/marketSituation-image/country-flag/can.png";
case "vi":
return "../../static/marketSituation-image/country-flag/vi.png";
case "th":
return "../../static/marketSituation-image/country-flag/th.png";
case "my":
return "../../static/marketSituation-image/country-flag/my.png";
case "sg":
return "../../static/marketSituation-image/country-flag/sg.png";
case "hk":
return "../../static/marketSituation-image/country-flag/hk.png";
case "cn":
return "../../static/marketSituation-image/country-flag/cn.png";
}
}
//
async function itemClick(item) {
const res = await RecordInfoApi({
@ -167,19 +193,17 @@ async function itemClick(item) {
model: 5,
});
if (res.code == 200) {
const message = res.data;
const deepExplorationStore = useDeepExplorationStore();
deepExplorationStore.setDeepExplorationInfo(message);
console.log('点击了历史数据',deepExplorationStore.deepExplorationInfo);
console.log("点击了历史数据", deepExplorationStore.deepExplorationInfo);
onDrawerBackClick();
setTimeout(() => {
uni.navigateTo({
url: '/pages/deepExploration/MainForceActions'
});
}, 200);
setTimeout(() => {
uni.navigateTo({
url: "/pages/deepExploration/MainForceActions",
});
}, 200);
}
}
const historyList = ref([]);
@ -464,6 +488,12 @@ onMounted(() => {});
height: 50rpx;
}
.icon-stock {
width: 36rpx;
height: 36rpx;
}
.flag-circle {
width: 50rpx;
height: 50rpx;

36
pages/deepMate/deepMate.vue

@ -276,8 +276,11 @@
>
<view class="history-left">
<view class="flag-circle"
><text class="flag-emoji">🇺🇸</text></view
>
><image
class="icon-stock"
:src="stockImage(item.stockMarket)"
mode="scaleToFill"
/></view>
</view>
<view class="history-main" @click="itemClick(item)">
<text class="history-query">{{ item.stockName }}</text>
@ -348,8 +351,6 @@ const drawerOffsetY = ref(0);
const searchHistory = ref([]);
const historyList = ref([]);
//
onLoad((options) => {
console.log("deepMate页面接收到参数:", options);
@ -948,6 +949,28 @@ const onBackTopClick = () => {
scrollToTop();
};
//
function stockImage(Market) {
switch (Market) {
case "usa":
return "../../static/marketSituation-image/country-flag/us.png";
case "can":
return "../../static/marketSituation-image/country-flag/can.png";
case "vi":
return "../../static/marketSituation-image/country-flag/vi.png";
case "th":
return "../../static/marketSituation-image/country-flag/th.png";
case "my":
return "../../static/marketSituation-image/country-flag/my.png";
case "sg":
return "../../static/marketSituation-image/country-flag/sg.png";
case "hk":
return "../../static/marketSituation-image/country-flag/hk.png";
case "cn":
return "../../static/marketSituation-image/country-flag/cn.png";
}
}
//
async function itemClick(item) {
const res = await postHistoryDetail({
@ -1642,6 +1665,11 @@ async function itemClick(item) {
margin-right: 12rpx;
}
.icon-stock {
width: 36rpx;
height: 36rpx;
}
.flag-circle {
width: 36rpx;
height: 36rpx;

Loading…
Cancel
Save