1.26 个股详情业务结构,发展历程模块完善
This commit is contained in:
203
unpackage/dist/dev/mp-weixin/pages/invest/investDetails/investDetails.js
vendored
Normal file
203
unpackage/dist/dev/mp-weixin/pages/invest/investDetails/investDetails.js
vendored
Normal file
@@ -0,0 +1,203 @@
|
||||
"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() {
|
||||
return {
|
||||
navH: common_vendor.inject("navHeight"),
|
||||
eventId: "",
|
||||
//事件id
|
||||
contentTop: "",
|
||||
investDetails: null,
|
||||
former: "",
|
||||
//背景
|
||||
categoryList: ["背景", "推演", "相关股票"],
|
||||
selectCategory: 0,
|
||||
stockCategoryList: [
|
||||
{
|
||||
title: "全部股票",
|
||||
num: 0,
|
||||
bgColor: "#D82A2A",
|
||||
color: "white"
|
||||
},
|
||||
{
|
||||
title: "大周期",
|
||||
num: 0,
|
||||
bgColor: "#3A5D9C",
|
||||
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 + 72) / 750 * common_vendor.inject("windowWidth");
|
||||
if (e.id) {
|
||||
this.eventId = e.id;
|
||||
this.getEventDetailsData();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 点击切换栏目
|
||||
*/
|
||||
clickCategoryItem(index) {
|
||||
if (this.selectCategory != index) {
|
||||
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) => {
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_navBar2 = common_vendor.resolveComponent("navBar");
|
||||
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_ua_markdown)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.p({
|
||||
leftText: "事件详情",
|
||||
hideNavBg: true
|
||||
}),
|
||||
b: common_assets._imports_0,
|
||||
c: common_vendor.f($data.categoryList, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item),
|
||||
b: common_vendor.n("item relative " + ($data.selectCategory == index ? "select" : "")),
|
||||
c: index,
|
||||
d: common_vendor.o(($event) => $options.clickCategoryItem(index), index)
|
||||
};
|
||||
}),
|
||||
d: common_vendor.s("top:" + $data.navH + "px;"),
|
||||
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.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(item.score),
|
||||
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 == 3
|
||||
}, $data.selectCategory == 3 ? {
|
||||
n: common_vendor.f(_ctx.conceptList, (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item.concept),
|
||||
b: item.price_info
|
||||
}, item.price_info ? {
|
||||
c: common_vendor.t(_ctx.getChgRateStr(item.price_info.avg_change_pct)),
|
||||
d: common_vendor.n("chg " + (_ctx.getRateUpOrDown(item.price_info.avg_change_pct) ? "down" : "up"))
|
||||
} : {}, {
|
||||
e: item.price_info
|
||||
}, item.price_info ? {
|
||||
f: common_vendor.t(item.stock_count),
|
||||
g: common_vendor.n("stockNum " + (_ctx.getRateUpOrDown(item.price_info.avg_change_pct) ? "down" : "up"))
|
||||
} : {}, {
|
||||
h: common_vendor.t(item.description),
|
||||
i: common_vendor.f(item.stocks.slice(0, 3), (sitem, sindex, i1) => {
|
||||
return {
|
||||
a: common_vendor.t(sitem.stock_name),
|
||||
b: sindex
|
||||
};
|
||||
}),
|
||||
j: common_vendor.t(item.stock_count - 3),
|
||||
k: common_vendor.o(($event) => _ctx.clickStockMore(item), index),
|
||||
l: common_vendor.t(item.price_info ? item.price_info.trade_date : ""),
|
||||
m: common_vendor.o(($event) => _ctx.clickHistoricalTimeline(item), index),
|
||||
n: index
|
||||
});
|
||||
}),
|
||||
o: common_assets._imports_1$3
|
||||
} : {}, {
|
||||
p: common_vendor.s("top:" + $data.contentTop + "px;")
|
||||
}) : {});
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/invest/investDetails/investDetails.js.map
|
||||
7
unpackage/dist/dev/mp-weixin/pages/invest/investDetails/investDetails.json
vendored
Normal file
7
unpackage/dist/dev/mp-weixin/pages/invest/investDetails/investDetails.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"usingComponents": {
|
||||
"nav-bar": "../../../components/navBar/navBar",
|
||||
"ua-markdown": "../../../components/ua-markdown/ua-markdown"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/invest/investDetails/investDetails.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/invest/investDetails/investDetails.wxml
vendored
Normal file
@@ -0,0 +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="c" class="{{item.b}}" bindtap="{{item.d}}">{{item.a}}</view></view><view wx:if="{{e}}" class="contentC fixed" style="{{p}}"><view wx:if="{{f}}" class="former"><ua-markdown wx:if="{{g}}" u-i="b7e6c0fc-1" bind:__l="__l" u-p="{{g}}"/><text class="ai">(AI合成)</text></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}}"><view class="conceptList"><view wx:for="{{n}}" wx:for-item="item" wx:key="n" class="item"><view class="titleChgStockNumC flex"><view class="title">{{item.a}}</view><view wx:if="{{item.b}}" class="{{item.d}}">{{item.c}}%</view><view wx:if="{{item.e}}" class="{{item.g}}">{{item.f}} 只股票</view></view><view class="content">{{item.h}}</view><view class="hotStockC flex"><view class="title">热门个股</view><view class="stockList flex"><view wx:for="{{item.i}}" wx:for-item="sitem" wx:key="b" class="stockItem">{{sitem.a}}</view><view class="more" bindtap="{{item.k}}">+{{item.j}}更多</view></view></view><view class="transactionDateHistoryTimeC flex"><view class="transactionDate flex1">交易时间:{{item.l}}</view><view class="historyTimeC flex" bindtap="{{item.m}}"><image class="icon" src="{{o}}" mode="widthFix"></image><view>历史时间轴</view></view></view></view></view></view></view></view>
|
||||
222
unpackage/dist/dev/mp-weixin/pages/invest/investDetails/investDetails.wxss
vendored
Normal file
222
unpackage/dist/dev/mp-weixin/pages/invest/investDetails/investDetails.wxss
vendored
Normal file
@@ -0,0 +1,222 @@
|
||||
page {
|
||||
background-color: #070707;
|
||||
}
|
||||
.topBg {
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.categoryC {
|
||||
margin-top: 10rpx;
|
||||
padding: 20rpx 10rpx 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
}
|
||||
.categoryC .item {
|
||||
display: inline-block;
|
||||
padding: 0 30rpx;
|
||||
line-height: 76rpx;
|
||||
font-size: 27rpx;
|
||||
font-weight: 500;
|
||||
color: #939393;
|
||||
}
|
||||
.categoryC .item.select {
|
||||
font-weight: bold;
|
||||
color: #F3C368;
|
||||
}
|
||||
.contentC {
|
||||
background: linear-gradient(-30deg, #FFF6F0 0%, #FEFEFE 100%);
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: env(safe-area-inset-bottom);
|
||||
margin: 0 25rpx;
|
||||
border-radius: 10rpx;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.contentC .former {
|
||||
padding: 40rpx 25rpx;
|
||||
}
|
||||
.contentC .former .ai {
|
||||
font-size: 28rpx;
|
||||
color: #C00000;
|
||||
}
|
||||
.contentC .stockCategoryList {
|
||||
margin-top: 30rpx;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
.contentC .stockCategoryList .item {
|
||||
margin: 0 30rpx 20rpx 0;
|
||||
width: calc((100% - 60rpx)/3);
|
||||
height: 100rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.contentC .stockCategoryList .item .num {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.contentC .stockCategoryList .item .title {
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
.contentC .stockCategoryList .item:nth-child(3n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
.contentC .stockList {
|
||||
padding: 22rpx 25rpx 30rpx;
|
||||
}
|
||||
.contentC .stockList .item {
|
||||
padding: 22rpx 0 30rpx;
|
||||
border-bottom: solid 1rpx #E4E4E4;
|
||||
}
|
||||
.contentC .stockList .item .title {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #222;
|
||||
}
|
||||
.contentC .stockList .item .correlation {
|
||||
background-color: #F973161A;
|
||||
padding: 0 13rpx;
|
||||
line-height: 40rpx;
|
||||
border-radius: 5rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #F97316;
|
||||
}
|
||||
.contentC .stockList .item .category {
|
||||
display: inline-block;
|
||||
padding: 0 10rpx;
|
||||
line-height: 28rpx;
|
||||
border: solid 1rpx #F6604A;
|
||||
font-size: 20rpx;
|
||||
font-weight: 500;
|
||||
color: #F6604A;
|
||||
border-radius: 5rpx;
|
||||
}
|
||||
.contentC .stockList .item .content {
|
||||
margin-top: 18rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #666;
|
||||
line-height: 1.2rem;
|
||||
}
|
||||
.contentC .conceptList {
|
||||
padding: 30rpx 25rpx;
|
||||
}
|
||||
.contentC .conceptList .item {
|
||||
background: linear-gradient(-30deg, #FFF6F0 0%, #FEFEFE 100%);
|
||||
margin-bottom: 24rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.contentC .conceptList .item .titleChgStockNumC {
|
||||
padding: 24rpx 18rpx 0;
|
||||
}
|
||||
.contentC .conceptList .item .titleChgStockNumC .title {
|
||||
margin-right: 20rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #3D3D3D;
|
||||
}
|
||||
.contentC .conceptList .item .titleChgStockNumC .chg {
|
||||
margin-right: 20rpx;
|
||||
padding: 0 13rpx;
|
||||
line-height: 40rpx;
|
||||
border-radius: 20rpx;
|
||||
font-size: 22rpx;
|
||||
font-weight: bold;
|
||||
color: white;
|
||||
}
|
||||
.contentC .conceptList .item .titleChgStockNumC .chg.up {
|
||||
background-color: #EC3440;
|
||||
}
|
||||
.contentC .conceptList .item .titleChgStockNumC .chg.down {
|
||||
background-color: #355422;
|
||||
}
|
||||
.contentC .conceptList .item .titleChgStockNumC .stockNum {
|
||||
padding: 0 16rpx;
|
||||
line-height: 36rpx;
|
||||
border-radius: 20rpx;
|
||||
font-size: 22rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.contentC .conceptList .item .titleChgStockNumC .stockNum.up {
|
||||
color: #EC3440;
|
||||
border: solid 2rpx #EC3440;
|
||||
}
|
||||
.contentC .conceptList .item .titleChgStockNumC .stockNum.down {
|
||||
color: #355422;
|
||||
border: solid 2rpx #355422;
|
||||
}
|
||||
.contentC .conceptList .item .content {
|
||||
margin-top: 26rpx;
|
||||
padding: 0 22rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #71675D;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.contentC .conceptList .item .hotStockC {
|
||||
margin-top: 30rpx;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
.contentC .conceptList .item .hotStockC .title {
|
||||
margin-right: 10rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: bold;
|
||||
color: #936E5C;
|
||||
}
|
||||
.contentC .conceptList .item .hotStockC .stockList {
|
||||
font-size: 22rpx;
|
||||
}
|
||||
.contentC .conceptList .item .hotStockC .stockList .stockItem {
|
||||
background-color: #3D3D3D;
|
||||
margin-right: 10rpx;
|
||||
padding: 0 8rpx;
|
||||
line-height: 36rpx;
|
||||
border-radius: 5rpx 20rpx 5rpx 20rpx;
|
||||
color: #EFDDD1;
|
||||
}
|
||||
.contentC .conceptList .item .hotStockC .stockList .more {
|
||||
color: #936E5C;
|
||||
line-height: 36rpx;
|
||||
}
|
||||
.contentC .conceptList .item .hotStockC .notVipC {
|
||||
background-color: #3D3D3D;
|
||||
padding: 0 21rpx 0 16rpx;
|
||||
line-height: 36rpx;
|
||||
border-radius: 5rpx;
|
||||
font-size: 22rpx;
|
||||
color: #F3C368;
|
||||
}
|
||||
.contentC .conceptList .item .hotStockC .notVipC .icon {
|
||||
margin-right: 9rpx;
|
||||
width: 15rpx;
|
||||
height: auto;
|
||||
}
|
||||
.contentC .conceptList .item .transactionDateHistoryTimeC {
|
||||
padding: 20rpx 22rpx 30rpx;
|
||||
}
|
||||
.contentC .conceptList .item .transactionDateHistoryTimeC .transactionDate {
|
||||
font-size: 20rpx;
|
||||
font-weight: 500;
|
||||
color: #666;
|
||||
}
|
||||
.contentC .conceptList .item .transactionDateHistoryTimeC .historyTimeC {
|
||||
background-color: #F3C368;
|
||||
padding: 0 10rpx 0 15rpx;
|
||||
line-height: 36rpx;
|
||||
border-radius: 10rpx;
|
||||
font-size: 22rpx;
|
||||
font-weight: 500;
|
||||
color: #101213;
|
||||
}
|
||||
.contentC .conceptList .item .transactionDateHistoryTimeC .historyTimeC .icon {
|
||||
margin-right: 7rpx;
|
||||
width: 20rpx;
|
||||
height: auto;
|
||||
}
|
||||
Reference in New Issue
Block a user