1.
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$2
|
||||
} : {}, {
|
||||
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
|
||||
Reference in New Issue
Block a user