8.28 修改事件详情相关概念模块样式,增加股票详情信息来源展示

This commit is contained in:
尚政杰
2025-08-28 17:42:22 +08:00
parent 58b3414bdd
commit bf2388c3ec
403 changed files with 19843 additions and 1602 deletions

View File

@@ -1,6 +1,7 @@
"use strict";
const common_vendor = require("../../../common/vendor.js");
const request_api = require("../../../request/api.js");
const utils_util = require("../../../utils/util.js");
const common_assets = require("../../../common/assets.js");
const _sfc_main = {
data() {
@@ -9,41 +10,51 @@ const _sfc_main = {
eventId: "",
//事件id
contentTop: "",
categoryList: ["背景", "推演", "实际", "相关股票", "相关概念"],
investDetails: null,
former: "",
//背景
categoryList: ["背景", "推演", "相关股票"],
selectCategory: 0,
stockCategoryList: [
{
title: "全部股票",
num: 0,
bgColor: "#C00000",
color: "white"
},
{
title: "大周期",
num: 0,
bgColor: "#305496",
color: "white"
},
{
title: "TMT板块",
num: 0,
bgColor: "#FFBF00",
color: "white"
},
{
title: "大金融地产",
num: 0,
bgColor: "#FFF4D3"
},
{
title: "大消费",
num: 0,
bgColor: "#CDEEEE"
},
{
title: "公共产业板块",
num: 0,
bgColor: "#DEEBF7"
}
]
],
accMul: utils_util.accMul
};
},
onLoad(e) {
this.contentTop = this.navH + (30 + 74) / 750 * common_vendor.inject("windowWidth");
this.contentTop = this.navH + (30 + 72) / 750 * common_vendor.inject("windowWidth");
if (e.id) {
this.eventId = e.id;
this.getEventDetailsData();
@@ -58,11 +69,32 @@ const _sfc_main = {
this.selectCategory = index;
}
},
/**
* 点击相关股票
* @param {Object} item 股票数据
*/
clickLookRelatedStockItem(item) {
common_vendor.index.navigateTo({
url: "/pages/index/stockDetails/stockDetails?type=2&code=" + item.code + "&des=" + item.description + "&name=" + item.name
});
},
/**
* 获取事件详情数据
*/
getEventDetailsData() {
request_api.investEventDetails(this.eventId).then((res) => {
if (res.code == 200) {
let detail = res.data.detail;
for (let item of this.stockCategoryList) {
item.num = detail.sector_stats[item.title];
}
this.investDetails = detail;
this.former = detail.former.replace("<answer>", "").replace("</answer>", "");
} else
common_vendor.index.showToast({
title: res.message,
icon: "none"
});
}).catch((error) => {
});
}
@@ -70,11 +102,13 @@ const _sfc_main = {
};
if (!Array) {
const _easycom_navBar2 = common_vendor.resolveComponent("navBar");
_easycom_navBar2();
const _easycom_ua_markdown2 = common_vendor.resolveComponent("ua-markdown");
(_easycom_navBar2 + _easycom_ua_markdown2)();
}
const _easycom_navBar = () => "../../../components/navBar/navBar.js";
const _easycom_ua_markdown = () => "../../../components/ua-markdown/ua-markdown.js";
if (!Math) {
_easycom_navBar();
(_easycom_navBar + _easycom_ua_markdown)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
@@ -93,18 +127,58 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
});
}),
d: common_vendor.s("top:" + $data.navH + "px;"),
e: $data.selectCategory == 3
}, $data.selectCategory == 3 ? {
f: common_vendor.f($data.stockCategoryList, (item, index, i0) => {
e: $data.investDetails
}, $data.investDetails ? common_vendor.e({
f: $data.selectCategory == 0
}, $data.selectCategory == 0 ? {
g: common_vendor.p({
source: $data.former
})
} : {}, {
h: $data.selectCategory == 1
}, $data.selectCategory == 1 ? {
i: common_vendor.p({
source: $data.investDetails.forecast
})
} : {}, {
j: $data.selectCategory == 2
}, $data.selectCategory == 2 ? {
k: common_vendor.f($data.stockCategoryList, (item, index, i0) => {
return {
a: common_vendor.t(item.title),
b: common_vendor.s("background-color:" + item.bgColor + ";color:" + item.color + ";"),
c: index
a: common_vendor.t(item.num),
b: common_vendor.t(item.title),
c: common_vendor.s("background-color:" + item.bgColor + ";color:" + item.color + ";"),
d: index
};
}),
l: common_vendor.f($data.investDetails.related_stocks, (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item.code + " " + item.name),
b: common_vendor.t($data.accMul(item.score, 100)),
c: item.sw_primary_sector
}, item.sw_primary_sector ? {
d: common_vendor.t(item.sw_primary_sector)
} : {}, {
e: common_vendor.t(item.description),
f: index,
g: common_vendor.o(($event) => $options.clickLookRelatedStockItem(item), index)
});
})
} : {}, {
m: $data.selectCategory == 4
}, $data.selectCategory == 4 ? {
n: common_vendor.f($data.investDetails.extracted_concepts, (item, index, i0) => {
return {
a: item.first_image,
b: common_vendor.t(item.name),
c: common_vendor.t(item.reason),
d: index,
e: common_vendor.o(($event) => _ctx.clickConceptItem(), index)
};
})
} : {}, {
g: common_vendor.s("top:" + $data.contentTop + "px;")
});
o: common_vendor.s("top:" + $data.contentTop + "px;")
}) : {});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);

View File

@@ -1,6 +1,7 @@
{
"navigationBarTitleText": "",
"usingComponents": {
"nav-bar": "../../../components/navBar/navBar"
"nav-bar": "../../../components/navBar/navBar",
"ua-markdown": "../../../components/ua-markdown/ua-markdown"
}
}

View File

@@ -1 +1 @@
<view><nav-bar wx:if="{{a}}" u-i="b7e6c0fc-0" bind:__l="__l" u-p="{{a}}"></nav-bar><image class="topBg absolute" src="{{b}}" mode="widthFix"></image><view class="categoryC fixed" style="{{d}}"><view wx:for="{{c}}" wx:for-item="item" wx:key="d" class="{{item.c}}" bindtap="{{item.e}}">{{item.a}} <view wx:if="{{item.b}}" class="line absolute"></view></view></view><view class="contentC fixed" style="{{g}}"><view wx:if="{{e}}" class="stockC"><view class="stockCategoryList flexWrap"><view wx:for="{{f}}" wx:for-item="item" wx:key="c" class="item flexColumnCenter" style="{{item.b}}"><view class="num">23</view><view class="title">{{item.a}}</view></view></view><view class="stockList"><view class="item"><view class="titleCorrelationC flex"><view class="title flex1">000065.SZ 北方国际</view><view class="correlation">相关度: 98%</view></view><view class="category">石油石化</view><view class="content"> 海外订单占比70%-80%,在俄语区矿产资源开发(蒙古矿山)、电力运营经验丰富,是乌克兰重建核心受益标的。公司在俄语区的深厚积累使其直接获益于区域经济复苏和能源合作深化。 </view></view></view></view></view></view>
<view><nav-bar wx:if="{{a}}" u-i="b7e6c0fc-0" bind:__l="__l" u-p="{{a}}"></nav-bar><image class="topBg absolute" src="{{b}}" mode="widthFix"></image><view class="categoryC fixed" style="{{d}}"><view wx:for="{{c}}" wx:for-item="item" wx:key="d" class="{{item.c}}" bindtap="{{item.e}}">{{item.a}} <view wx:if="{{item.b}}" class="line absolute"></view></view></view><view wx:if="{{e}}" class="contentC fixed" style="{{o}}"><view wx:if="{{f}}" class="former"><ua-markdown wx:if="{{g}}" u-i="b7e6c0fc-1" bind:__l="__l" u-p="{{g}}"/></view><view wx:if="{{h}}" class="former"><ua-markdown wx:if="{{i}}" u-i="b7e6c0fc-2" bind:__l="__l" u-p="{{i}}"/></view><view wx:if="{{j}}" class="stockC"><view class="stockCategoryList flexWrap"><view wx:for="{{k}}" wx:for-item="item" wx:key="d" class="item flexColumnCenter" style="{{item.c}}"><view class="num">{{item.a}}</view><view class="title">{{item.b}}</view></view></view><view class="stockList"><view wx:for="{{l}}" wx:for-item="item" wx:key="f" class="item" bindtap="{{item.g}}"><view class="titleCorrelationC flex"><view class="title flex1">{{item.a}}</view><view class="correlation">相关度: {{item.b}}%</view></view><view wx:if="{{item.c}}" class="category">{{item.d}}</view><view class="content">{{item.e}}</view></view></view></view><view wx:if="{{m}}" class=""><view class="conceptList"><view wx:for="{{n}}" wx:for-item="item" wx:key="d" class="item relative" bindtap="{{item.e}}"><image class="cover" src="{{item.a}}" mode="aspectFill"></image><view class="infoC absolute"><view class="title">{{item.b}}</view><view class="content relative">{{item.c}} <text class="lookDetails absolute">查看详情</text></view></view></view></view></view></view></view>

View File

@@ -38,6 +38,9 @@
bottom: 0;
overflow-y: scroll;
}
.contentC .former {
padding: 40rpx 25rpx;
}
.contentC .stockCategoryList {
margin-top: 18rpx;
padding: 0 24rpx;
@@ -61,6 +64,9 @@
}
.contentC .stockList {
padding: 22rpx 25rpx 30rpx;
}
.contentC .stockList .item {
padding: 22rpx 0 30rpx;
border-bottom: solid 1rpx #E4E4E4;
}
.contentC .stockList .item .title {
@@ -94,3 +100,42 @@
color: #666;
line-height: 1.2rem;
}
.contentC .conceptList {
padding: 30rpx 25rpx;
}
.contentC .conceptList .item {
margin-bottom: 20rpx;
}
.contentC .conceptList .item .cover {
display: block;
width: 100%;
height: 350rpx;
border-radius: 10rpx;
}
.contentC .conceptList .item .infoC {
background: linear-gradient(to bottom, #00000080, #000);
padding: 20rpx 23rpx;
left: 0;
width: 100%;
bottom: 0;
border-radius: ;
color: white;
}
.contentC .conceptList .item .infoC .title {
font-size: 26rpx;
font-weight: bold;
}
.contentC .conceptList .item .infoC .content {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
margin-top: 10rpx;
font-size: 20rpx;
font-weight: 500;
line-height: 1.2rem;
}
.contentC .conceptList .item .infoC .content .lookDetails {
right: 0;
color: #F97316;
}