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,29 +1,22 @@
"use strict";
const common_vendor = require("../../../common/vendor.js");
const common_assets = require("../../../common/assets.js");
const _sfc_main = {
data() {
return {
navH: common_vendor.inject("navHeight")
navH: common_vendor.inject("navHeight"),
url: ""
};
},
onLoad(e) {
if (e.name) {
this.url = "https://valuefrontier.cn/htmls/" + e.name + ".html";
}
},
methods: {}
};
if (!Array) {
const _easycom_navBar2 = common_vendor.resolveComponent("navBar");
_easycom_navBar2();
}
const _easycom_navBar = () => "../../../components/navBar/navBar.js";
if (!Math) {
_easycom_navBar();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.p({
leftText: "相关概念详情"
}),
b: common_assets._imports_0,
c: common_vendor.s("top:" + $data.navH + "px;")
a: $data.url
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);

View File

@@ -1,6 +1,6 @@
{
"navigationBarTitleText": "",
"usingComponents": {
"nav-bar": "../../../components/navBar/navBar"
}
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"usingComponents": {}
}

View File

@@ -1 +1 @@
<view><nav-bar wx:if="{{a}}" u-i="5d0be61e-0" bind:__l="__l" u-p="{{a}}"></nav-bar><image class="topBg absolute" src="{{b}}" mode="widthFix"></image><view class="conceptDetailsC fixed" style="{{c}}"><view class="title">外骨骼机器人(250501)</view><view class="time">2025-05-08 08:43</view><view class="content">四部门联合启动的人力资源服务业与制造业融合发展试点,主要目的是推动人力资源服务向高端制造渗透,促进产业升级。而外骨骼机器人属于高端制造领域的重要创新产品之一,其发展需要人力资源服务业的支持,例如技术人才的输送、产业工人培训等。同时,外骨骼机器人在消费级市场的推广和应用也符合制造业与服务业融合发展的方向。因此,该政策试点对外骨骼机器人行业具有潜在利好影响。</view></view></view>
<view><web-view src="{{a}}"></web-view></view>

View File

@@ -3,6 +3,7 @@ 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 echarts = require("../../../uni_modules/lime-echart/static/echarts.min.js");
const _sfc_main = {
data() {
return {
@@ -12,7 +13,7 @@ const _sfc_main = {
//事件id
eventDetails: null,
//事件详情
categoryList: ["相关标的", "相关概念", "历史事件", "时间传导链分析", "关联数据"],
categoryList: ["相关标的", "相关概念", "历史事件"],
targetList: [],
//相关标的
conceptList: [],
@@ -23,14 +24,81 @@ const _sfc_main = {
//历史事件相关股票
selectCategory: 0,
headingList: ["名称代码", "分时图", "开盘价", "最新价", "涨跌幅"],
getLocaleHourMinute: utils_util.getLocaleHourMinute,
getLocaleTime: utils_util.getLocaleTime,
getRateUpOrDown: utils_util.getRateUpOrDown,
getRateStr: utils_util.getRateStr,
scoreTop: "",
eventComment: "",
//事件评论
expectScore: 0
expectScore: 0,
//预期得分
commentList: [],
//评价列表
eventComment: "",
//事件评论内容
replyId: "",
//回复评论id
replyPid: "",
//回复评论父级id
isFocus: false,
//是否获取焦点
replyComment: "",
//评论回复内容
option: {
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow"
},
confine: true
},
grid: {
left: "0%",
right: "0%",
top: "0%",
bottom: "20%"
},
xAxis: [
{
type: "category",
data: [],
axisTick: {
show: false
},
axisLine: {
show: false
}
}
],
yAxis: [
{
type: "value",
show: false,
axisTick: { show: false },
scale: true
}
],
series: {
name: "分时图",
type: "line",
label: {
show: true,
position: "top",
fontSize: 12
},
data: [],
itemStyle: {
color: ""
},
markLine: {
symbol: ["none", "none"],
lineStyle: {
color: "#AAAAAA",
type: "dashed"
},
data: []
}
}
}
};
},
onLoad(e) {
@@ -41,6 +109,30 @@ const _sfc_main = {
}
},
methods: {
async init() {
let that = this;
setTimeout(function() {
that.targetList.map(function(item, index) {
const chartDom = that.$refs["chartRef" + index][0];
chartDom.init(echarts).then((res) => {
let option = { ...that.option };
let valueData = [];
for (let item1 of item.minute_chart_data) {
valueData.push(item1.close);
}
option.series.data = valueData;
let firstOpen = item.minute_chart_data[0].open;
option.series.markLine.data = [{ yAxis: firstOpen }];
let lastClose = item.minute_chart_data.slice(-1)[0].close;
if (lastClose >= firstOpen) {
option.series.itemStyle.color = "#EF5350";
} else
option.series.itemStyle.color = "#26A69A";
res.setOption(option);
});
});
}, 300);
},
/**
* 点击切换分类
*/
@@ -61,15 +153,15 @@ const _sfc_main = {
*/
clickStockItem(code) {
common_vendor.index.navigateTo({
url: "/pages/index/stockDetails/stockDetails?code=" + code
url: "/pages/index/stockDetails/stockDetails?type=1&code=" + code + "&id=" + this.eventId
});
},
/**
* 点击查看相关概念
*/
clickConceptItem() {
clickConceptItem(name) {
common_vendor.index.navigateTo({
url: "/pages/index/conceptDetails/conceptDetails"
url: "/pages/index/conceptDetails/conceptDetails?name=" + name
});
},
/**
@@ -106,6 +198,14 @@ const _sfc_main = {
let eventId = this.eventId;
let param = { content: this.eventComment };
request_api.commentEvent(eventId, param).then((res) => {
common_vendor.index.showToast({
title: res.message,
icon: "none"
});
let that = this;
setTimeout(function() {
that.getEventCommentListData();
}, 1e3);
}).catch((error) => {
});
},
@@ -126,7 +226,7 @@ const _sfc_main = {
*/
clickFollow() {
let eventId = this.eventId;
followEvent(eventId).then((res) => {
request_api.followEvent(eventId).then((res) => {
common_vendor.index.showToast({
title: res.message,
icon: "none"
@@ -134,6 +234,47 @@ const _sfc_main = {
}).catch((error) => {
});
},
/**
* 点击回复评论
*/
clickReplyComment(id, pid) {
this.replyId = id;
if (pid) {
this.replyPid = pid;
}
this.isFocus = true;
},
sendReplyComment() {
if (!this.replyComment) {
common_vendor.index.showToast({
title: "请输入评论内容",
icon: "none"
});
return;
}
let param = { content: this.replyComment };
if (this.replyPid) {
param.parent_id = this.replyPid;
}
request_api.replyComment(this.replyId, param).then((res) => {
}).catch((error) => {
});
},
/**
* 点赞评论
*/
clickLikeComment(id, index, cindex) {
request_api.likeEventComment(id).then((res) => {
common_vendor.index.showToast({
title: res.message,
icon: "none"
});
if (cindex == -1) {
this.commentList[index].likes_count = res.likes_count;
}
}).catch((error) => {
});
},
/**
* 获取事件相关标的数据
*/
@@ -143,6 +284,7 @@ const _sfc_main = {
if (res.code == 200) {
this.eventDetails = res.data;
this.targetList = res.data.related_stocks;
this.init();
} else
common_vendor.index.showToast({
title: res.message,
@@ -155,15 +297,10 @@ const _sfc_main = {
* 获取事件相关概念数据
*/
getEventRelatedConceptData() {
let eventId = this.eventId;
request_api.eventRelatedConcept(eventId).then((res) => {
if (res.code == 200) {
this.conceptList = res.data.related_concepts;
} else
common_vendor.index.showToast({
title: res.message,
icon: "none"
});
let eventDetails = this.eventDetails;
let param = { query: eventDetails.event_title, size: 4, page: 1, sort_by: "_score", isJson: 1 };
request_api.eventRelatedConcept(param).then((res) => {
this.conceptList = res.results;
}).catch((error) => {
});
},
@@ -190,7 +327,7 @@ const _sfc_main = {
getEventCommentListData() {
let eventId = this.eventId;
request_api.eventCommentList(eventId).then((res) => {
this.commentList = res.data.comments;
this.commentList = res.data.posts;
}).catch((error) => {
});
}
@@ -198,13 +335,15 @@ const _sfc_main = {
};
if (!Array) {
const _easycom_navBar2 = common_vendor.resolveComponent("navBar");
const _easycom_l_echart2 = common_vendor.resolveComponent("l-echart");
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
(_easycom_navBar2 + _easycom_uni_popup2)();
(_easycom_navBar2 + _easycom_l_echart2 + _easycom_uni_popup2)();
}
const _easycom_navBar = () => "../../../components/navBar/navBar.js";
const _easycom_l_echart = () => "../../../uni_modules/lime-echart/components/l-echart/l-echart.js";
const _easycom_uni_popup = () => "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
if (!Math) {
(_easycom_navBar + _easycom_uni_popup)();
(_easycom_navBar + _easycom_l_echart + _easycom_uni_popup)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
@@ -243,96 +382,133 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.t(item.stock_name),
b: common_vendor.t(item.stock_code),
c: common_vendor.t(item.trade_data.open_price),
d: common_vendor.t(item.trade_data.latest_price),
e: common_vendor.t(item.trade_data.change_pct),
f: common_vendor.n("chg flex1 " + ($data.getRateUpOrDown(item.trade_data.change_pct) ? "down" : "up")),
g: common_vendor.t(item.relation_desc),
h: index,
i: common_vendor.o(($event) => $options.clickStockItem(item.stock_code), index)
c: common_vendor.sr("chartRef" + index, "6e1a61f1-1-" + i0, {
"f": 1
}),
d: "chartRef" + index,
e: "6e1a61f1-1-" + i0,
f: common_vendor.t(item.trade_data ? item.trade_data.open_price : ""),
g: common_vendor.t(item.trade_data ? item.trade_data.latest_price : ""),
h: common_vendor.t(item.trade_data ? item.trade_data.change_pct : ""),
i: common_vendor.n("chg flex1 " + ($data.getRateUpOrDown(item.trade_data ? item.trade_data.change_pct : "") ? "down" : "up")),
j: common_vendor.t(item.relation_desc),
k: index,
l: common_vendor.o(($event) => $options.clickStockItem(item.stock_code), index)
};
})
} : {}, {
m: $data.selectCategory == 1
}, $data.selectCategory == 1 ? {
n: common_vendor.f($data.conceptList, (item, index, i0) => {
return {
a: item.first_image,
b: common_vendor.t(item.concept),
c: common_vendor.t(item.reason),
d: index,
e: common_vendor.o(($event) => $options.clickConceptItem(), index)
};
})
} : {}, {
o: $data.selectCategory == 2
}, $data.selectCategory == 2 ? {
p: common_assets._imports_1$4,
q: common_vendor.t($data.expectScore),
r: common_assets._imports_2$6,
s: common_vendor.o(($event) => $options.clickExpectScore($event)),
t: common_vendor.f($data.historyEventList, (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item.title),
b: common_vendor.t(item.content),
c: $data.getRateUpOrDown(item.related_avg_chg)
}, $data.getRateUpOrDown(item.related_avg_chg) ? {
d: common_assets._imports_1$1
a: $data.getRateUpOrDown(item.price_info.avg_change_pct)
}, $data.getRateUpOrDown(item.price_info.avg_change_pct) ? {
b: common_assets._imports_1$4
} : {
e: common_assets._imports_2$2
c: common_assets._imports_2$6
}, {
f: common_vendor.t($data.getRateStr(item.related_avg_chg)),
g: common_vendor.n("rateItem " + ($data.getRateUpOrDown(item.related_avg_chg) ? "down" : "up")),
h: $data.getRateUpOrDown(item.related_max_chg)
}, $data.getRateUpOrDown(item.related_max_chg) ? {
i: common_assets._imports_1$1
} : {
j: common_assets._imports_2$2
}, {
k: common_vendor.t($data.getRateStr(item.related_max_chg)),
l: common_vendor.n("rateItem " + ($data.getRateUpOrDown(item.related_max_chg) ? "down" : "up")),
m: common_vendor.o(($event) => $options.clickLookHistoricalEventRelatedStock(item), index),
n: common_vendor.t($data.getLocaleTime(item.event_date)),
o: index
d: common_vendor.t($data.getRateStr(item.price_info.avg_change_pct)),
e: common_vendor.n("rateC absolute " + ($data.getRateUpOrDown(item.price_info.avg_change_pct) ? "down" : "up")),
f: common_vendor.t(item.stock_count),
g: common_vendor.t(item.concept),
h: common_vendor.t(item.description),
i: common_vendor.t(item.price_info.trade_date),
j: common_vendor.f(item.stocks, (item2, index2, i1) => {
return {
a: common_vendor.t(item2.stock_name),
b: index2
};
}),
k: common_vendor.t(item.happened_times[0] + (item.happened_times.length > 1 ? "(共" + item.happened_times.length + "次)" : "")),
l: index,
m: common_vendor.o(($event) => $options.clickConceptItem(item.concept), index)
});
}),
v: common_assets._imports_1$4
o: common_assets._imports_3$4
} : {}, {
w: common_vendor.s("top:" + $data.navH + "px;")
p: $data.selectCategory == 2
}, $data.selectCategory == 2 ? {
q: common_assets._imports_4$2,
r: common_vendor.t($data.expectScore),
s: common_assets._imports_5$1,
t: common_vendor.o(($event) => $options.clickExpectScore($event)),
v: common_vendor.f($data.historyEventList, (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item.title),
b: common_vendor.t(item.relevance * 10),
c: common_vendor.t(item.content),
d: $data.getRateUpOrDown(item.related_avg_chg)
}, $data.getRateUpOrDown(item.related_avg_chg) ? {
e: common_assets._imports_1$1
} : {
f: common_assets._imports_2$2
}, {
g: common_vendor.t($data.getRateStr(item.related_avg_chg)),
h: common_vendor.n("rateItem " + ($data.getRateUpOrDown(item.related_avg_chg) ? "down" : "up")),
i: $data.getRateUpOrDown(item.related_max_chg)
}, $data.getRateUpOrDown(item.related_max_chg) ? {
j: common_assets._imports_1$1
} : {
k: common_assets._imports_2$2
}, {
l: common_vendor.t($data.getRateStr(item.related_max_chg)),
m: common_vendor.n("rateItem " + ($data.getRateUpOrDown(item.related_max_chg) ? "down" : "up")),
n: common_vendor.o(($event) => $options.clickLookHistoricalEventRelatedStock(item), index),
o: common_vendor.t($data.getLocaleTime(item.event_date)),
p: index
});
}),
w: common_assets._imports_4$2
} : {}, {
x: common_vendor.s("top:" + $data.navH + "px;")
}) : {}, {
x: $data.eventDetails
y: $data.eventDetails
}, $data.eventDetails ? {
y: common_vendor.o(($event) => $options.sendEventComment()),
z: $data.eventComment,
A: common_vendor.o(($event) => $data.eventComment = $event.detail.value),
B: common_assets._imports_3,
C: common_vendor.t($data.eventDetails.view_count),
D: common_assets._imports_4,
E: common_vendor.t($data.eventDetails.post_count),
F: common_vendor.o(($event) => $options.clickComment()),
G: common_assets._imports_7,
H: common_vendor.t($data.eventDetails.follower_count),
I: common_vendor.o(($event) => $options.clickFollow())
z: common_vendor.o(($event) => $options.sendEventComment()),
A: $data.eventComment,
B: common_vendor.o(($event) => $data.eventComment = $event.detail.value),
C: common_assets._imports_3,
D: common_vendor.t($data.eventDetails.view_count),
E: common_assets._imports_4,
F: common_vendor.t($data.eventDetails.post_count),
G: common_vendor.o(($event) => $options.clickComment()),
H: common_assets._imports_10,
I: common_vendor.t($data.eventDetails.follower_count),
J: common_vendor.o(($event) => $options.clickFollow())
} : {}, {
J: common_assets._imports_8,
K: common_vendor.o(($event) => $options.closeCommentPopup()),
L: common_assets._imports_9,
M: common_assets._imports_10,
N: common_assets._imports_9,
O: common_vendor.sr("popup", "6e1a61f1-1"),
P: common_vendor.p({
K: common_assets._imports_11,
L: common_vendor.o(($event) => $options.closeCommentPopup()),
M: common_vendor.f($data.commentList, (item, index, i0) => {
return {
a: item.user.avatar_url,
b: common_vendor.t(item.user.username),
c: common_vendor.t(item.content),
d: common_vendor.t($data.getLocaleHourMinute(item.created_at)),
e: common_vendor.o(($event) => $options.clickReplyComment(item.post_id), index),
f: common_vendor.t(item.likes_count),
g: common_vendor.o(($event) => $options.clickLikeComment(item.post_id, index, -1), index),
h: index
};
}),
N: common_assets._imports_12,
O: $data.isFocus,
P: common_vendor.o(($event) => $options.sendReplyComment()),
Q: $data.replyComment,
R: common_vendor.o(($event) => $data.replyComment = $event.detail.value),
S: common_vendor.sr("popup", "6e1a61f1-2"),
T: common_vendor.p({
type: "bottom"
}),
Q: common_assets._imports_11$1,
R: common_vendor.s("margin-top:" + $data.scoreTop + "px;"),
S: common_vendor.sr("expectScorePopup", "6e1a61f1-2"),
T: common_vendor.p({
U: common_assets._imports_13$1,
V: common_vendor.s("margin-top:" + $data.scoreTop + "px;"),
W: common_vendor.sr("expectScorePopup", "6e1a61f1-3"),
X: common_vendor.p({
type: "top",
["mask-background-color"]: "transparent"
}),
U: common_assets._imports_8,
V: common_vendor.o(($event) => $options.closeRelatedStockPopup()),
W: common_vendor.f($data.historyEventRelatedStockList, (item, index, i0) => {
Y: common_assets._imports_11,
Z: common_vendor.o(($event) => $options.closeRelatedStockPopup()),
aa: common_vendor.f($data.historyEventRelatedStockList, (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item.stock_name + "(" + item.stock_code + ")"),
b: common_vendor.t(item.correlation * 100),
@@ -344,13 +520,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
f: common_assets._imports_2$2
}, {
g: common_vendor.t($data.getRateStr(item.daily_change)),
h: common_vendor.t(item.relation_desc),
i: index,
j: common_vendor.o(($event) => $options.clickStockItem(item.stock_code), index)
h: common_vendor.n("rateC " + ($data.getRateUpOrDown(item.daily_change) ? "down" : "up")),
i: common_vendor.t(item.relation_desc),
j: index,
k: common_vendor.o(($event) => $options.clickStockItem(item.stock_code), index)
});
}),
X: common_vendor.sr("stockPopup", "6e1a61f1-3"),
Y: common_vendor.p({
ab: common_vendor.sr("stockPopup", "6e1a61f1-4"),
ac: common_vendor.p({
type: "bottom"
})
});

View File

@@ -2,6 +2,7 @@
"navigationBarTitleText": "",
"usingComponents": {
"nav-bar": "../../../components/navBar/navBar",
"l-echart": "../../../uni_modules/lime-echart/components/l-echart/l-echart",
"uni-popup": "../../../uni_modules/uni-popup/components/uni-popup/uni-popup"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -118,42 +118,119 @@
.eventDetailsC .conceptList {
padding: 30rpx 25rpx;
}
.eventDetailsC .conceptList .item {
margin-bottom: 20rpx;
}
.eventDetailsC .conceptList .item .cover {
display: block;
width: 100%;
height: 350rpx;
.eventDetailsC .conceptList .conceptItem {
box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.05);
margin: 0 30rpx 30rpx 0;
width: calc((100% - 30rpx)/2);
border-radius: 10rpx;
}
.eventDetailsC .conceptList .item .infoC {
background: linear-gradient(to bottom, #00000080, #000);
padding: 20rpx 23rpx;
left: 0;
.eventDetailsC .conceptList .conceptItem .coverC .cover {
display: block;
width: 100%;
bottom: 0;
border-radius: ;
height: 220rpx;
}
.eventDetailsC .conceptList .conceptItem .coverC .rateC {
top: 12rpx;
left: 12rpx;
padding: 0 10rpx;
line-height: 40rpx;
border-radius: 20rpx;
font-size: 18rpx;
font-weight: 500;
color: white;
}
.eventDetailsC .conceptList .item .infoC .title {
.eventDetailsC .conceptList .conceptItem .coverC .rateC .icon {
width: 11rpx;
height: auto;
}
.eventDetailsC .conceptList .conceptItem .coverC .rateC.up {
background-color: #E53E3E;
}
.eventDetailsC .conceptList .conceptItem .coverC .rateC.down {
background-color: #38A169;
}
.eventDetailsC .conceptList .conceptItem .coverC .totalC {
background: linear-gradient(-90deg, #FAC915 0%, #F18D10 100%);
top: 12rpx;
right: 12rpx;
padding: 0 9rpx;
line-height: 40rpx;
border-radius: 20rpx;
font-size: 20rpx;
color: white;
}
.eventDetailsC .conceptList .conceptItem .infoC {
padding: 20rpx 23rpx;
}
.eventDetailsC .conceptList .conceptItem .infoC .title {
font-size: 26rpx;
font-weight: bold;
color: #222;
}
.eventDetailsC .conceptList .item .infoC .content {
.eventDetailsC .conceptList .conceptItem .infoC .content {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
margin-top: 10rpx;
line-height: 1.2rem;
font-size: 20rpx;
font-weight: 500;
line-height: 1.2rem;
color: #666;
}
.eventDetailsC .conceptList .item .infoC .content .lookDetails {
right: 0;
.eventDetailsC .conceptList .conceptItem .infoC .transactionDate {
margin-top: 12rpx;
font-size: 22rpx;
font-weight: 500;
color: #AAA;
}
.eventDetailsC .conceptList .conceptItem .infoC .hotStockC {
background-color: #F7FAFC;
margin-top: 16rpx;
padding: 10rpx 13rpx;
border-radius: 5rpx;
}
.eventDetailsC .conceptList .conceptItem .infoC .hotStockC .titleC {
font-size: 20rpx;
font-weight: 500;
color: #666;
}
.eventDetailsC .conceptList .conceptItem .infoC .hotStockC .titleC .arrow {
width: 6rpx;
height: auto;
}
.eventDetailsC .conceptList .conceptItem .infoC .hotStockC .stockList {
margin-top: 10rpx;
height: 35rpx;
overflow: hidden;
}
.eventDetailsC .conceptList .conceptItem .infoC .hotStockC .stockList .item {
background-color: #FFEADC;
margin: 0 5rpx 5rpx 0;
padding: 0 9rpx;
line-height: 30rpx;
border-radius: 5rpx;
font-size: 18rpx;
font-weight: 500;
color: #F97316;
}
.eventDetailsC .conceptList .conceptItem .infoC .dateHistoryTimeC {
margin-top: 10rpx;
font-size: 20rpx;
}
.eventDetailsC .conceptList .conceptItem .infoC .dateHistoryTimeC .date {
color: #666;
}
.eventDetailsC .conceptList .conceptItem .infoC .dateHistoryTimeC .historyTimeC {
background-color: #F97316;
padding: 0 6rpx;
line-height: 38rpx;
border-radius: 5rpx;
color: white;
}
.eventDetailsC .conceptList .conceptItem:nth-child(2n) {
margin-right: 0;
}
.eventDetailsC .historyEventList {
padding: 34rpx 25rpx;
}
@@ -545,7 +622,6 @@
color: #F6604A;
}
.stockPopup .list .item .sectorRateC .rateC {
background-color: #C00000;
display: inline-block;
padding: 0 10rpx;
height: 30rpx;
@@ -558,6 +634,12 @@
width: 15rpx;
height: auto;
}
.stockPopup .list .item .sectorRateC .rateC.up {
background-color: #C00000;
}
.stockPopup .list .item .sectorRateC .rateC.down {
background-color: #355422;
}
.stockPopup .list .item .content {
margin-top: 16rpx;
font-size: 24rpx;

View File

@@ -45,10 +45,20 @@ const _sfc_main = {
//选中月份下标
selectMonth: "",
//选中年月
industryTopCategoryList: [],
//行业一级分类
industryCategoryList: [],
//行业分类数组
industryKeywords: "",
//行业分类搜索关键词
searchResultList: [],
//行业分类搜索结果数组
selectIndustryTopCategory: 0,
//
//选中行业一级分类
selectIndustrySecondCategory: -1,
//选中行业二级分类
selectIndustryThirdCategory: -1,
//选中行业三级分类
selectIndustryForthCategory: -1,
//选中行业四级分类
selectScreenCategory: 0,
importanceList: [],
//重要性数组
@@ -65,7 +75,7 @@ const _sfc_main = {
grid: {
left: "0%",
right: "0%",
top: "0%",
top: "10%",
bottom: "20%"
},
xAxis: [
@@ -105,71 +115,10 @@ const _sfc_main = {
position: "top",
fontSize: 12
},
data: [
{
value: 0,
itemStyle: { color: "#355422" },
label: {
textStyle: { color: "#355422" }
}
},
{
value: 44,
itemStyle: { color: "#35542299" },
label: {
textStyle: { color: "#355422" }
}
},
{
value: 315,
itemStyle: { color: "#355422CC" },
label: {
textStyle: { color: "#355422" }
}
},
{
value: 1264,
itemStyle: { color: "#355422" },
label: {
textStyle: { color: "#355422" }
}
},
{
value: 1064,
itemStyle: { color: "#ACB0C0" },
label: {
textStyle: { color: "#666" }
}
},
{
value: 1809,
itemStyle: { color: "#C00000" },
label: {
textStyle: { color: "#C00000" }
}
},
{
value: 602,
itemStyle: { color: "#C00000CC" },
label: {
textStyle: { color: "#C00000" }
}
},
{
value: 44,
itemStyle: { color: "#C0000099" },
label: {
textStyle: { color: "#C00000" }
}
},
{
value: 0,
itemStyle: { color: "#C00000" },
label: {
textStyle: { color: "#C00000" }
}
}
]
itemStyle: {
borderRadius: [5, 5, 0, 0]
},
data: []
}
]
},
@@ -182,13 +131,13 @@ const _sfc_main = {
};
},
onLoad() {
this.contentTop = this.navH + (75 + 20) / 750 * this.windowWidth;
this.contentTop = this.navH + (74 + 20) / 750 * this.windowWidth;
this.listTop = this.contentTop + (22 + 80 + 72) / 750 * this.windowWidth;
this.sortListTop = this.navH + (22 + 80 + 80) / 750 * this.windowWidth;
this.getEventFilterListData();
this.getEventListData();
this.getIndustryCategoryListData();
this.getStockCategoryListData();
Promise.all([this.getEventFilterListData(), this.getIndustryCategoryListData(), this.getStockCategoryListData()]).then((res) => {
this.getEventListData();
}).catch((error) => {
});
let currentDate = /* @__PURE__ */ new Date();
let currentYear = currentDate.getFullYear();
let currentMonth = currentDate.getMonth() + 1;
@@ -347,12 +296,17 @@ const _sfc_main = {
clickTopCategoryItem(event, index) {
if (this.selectTopCategory != index) {
this.selectTopCategory = index;
this.selectSecondCategory = 0;
let offsetLeft = event.currentTarget.offsetLeft;
this.topScrollLeft = offsetLeft - this.topScrollWidth / 2;
if (index == 0) {
this.listTop = this.contentTop + (22 + 80 + 72) / 750 * this.windowWidth;
} else
this.listTop = this.contentTop + (22 + 80 + 72 + 44 + 44) / 750 * this.windowWidth;
this.listTop = this.contentTop + (22 + 80 + 72 + 42 + 42) / 750 * this.windowWidth;
if (this.selectTimeCategory == 0) {
this.getEventListData();
} else
this.getHotEventListData();
}
},
/**
@@ -364,6 +318,10 @@ const _sfc_main = {
this.selectSecondCategory = index;
let offsetLeft = event.currentTarget.offsetLeft;
this.secondScrollLeft = offsetLeft - this.secondScrollWidth / 2;
if (this.selectTimeCategory == 0) {
this.getEventListData();
} else
this.getHotEventListData();
}
},
/**
@@ -425,11 +383,121 @@ const _sfc_main = {
/**
* 选择行业分类一级分类
*/
clickSelectIndustryTopCategoryItem(index) {
clickIndustryTopCategoryItem(index) {
if (this.selectIndustryTopCategory != index) {
this.selectIndustryTopCategory = index;
}
},
/**
* 行业分类搜索
*/
industrySearch(e) {
let keywords = e.detail.value;
this.industryKeywords = keywords;
let arr = [];
for (let item of this.industryCategoryList) {
let index = this.industryCategoryList.indexOf(item);
for (let item1 of item.hierarchy) {
let index1 = item.hierarchy.indexOf(item1);
let arr1 = [];
if (item1.level1_sector.indexOf(keywords) > -1) {
arr1.push(item1);
arr.push({ classification_name: item.classification_name, hierarchy: arr1 });
}
for (let item2 of item1.level2_sectors) {
let index2 = item1.level2_sectors.indexOf(item2);
let arr2 = [];
if (item2.level2_sector.indexOf(keywords) > -1) {
arr2.push(item2);
arr1.push({ level1_sector: item1.level1_sector, level2_sectors: arr2 });
arr.push({ classification_name: item.classification_name, hierarchy: arr1 });
}
for (let item3 of item2.level3_sectors) {
let index3 = item2.level3_sectors.indexOf(item3);
let arr3 = [];
if (item3.level3_sector.indexOf(keywords) > -1) {
item3.index = index;
item3.index1 = index1;
item3.index2 = index2;
item3.index3 = index3;
arr3.push(item3);
arr2.push({ level2_sector: item2.level2_sector, level3_sectors: arr3 });
arr1.push({ level1_sector: item1.level1_sector, level2_sectors: arr2 });
arr.push({ classification_name: item.classification_name, hierarchy: arr1 });
}
}
}
}
}
this.searchResultList = arr;
},
/**
* 点击选择搜索结果
* @param {Object} item
*/
clickIndustrySearchItem(item) {
this.industryKeywords = "";
this.selectIndustryTopCategory = item.index;
this.selectIndustrySecondCategory = item.index1;
this.selectIndustryThirdCategory = item.index2;
this.selectIndustryForthCategory = item.index3;
},
/**
* 选择行业分类二级分类
*/
clickIndustrySecondCategoryItem(index) {
if (this.selectIndustrySecondCategory != index) {
this.selectIndustrySecondCategory = index;
}
this.industryCategoryList[this.selectIndustryTopCategory].hierarchy[index].isSpread = !this.industryCategoryList[this.selectIndustryTopCategory].hierarchy[index].isSpread;
},
/**
* 选择行业分类三级分类
*/
clickIndustryThirdCategoryItem(sindex, index) {
if (this.selectIndustrySecondCategory != sindex) {
this.selectIndustrySecondCategory = sindex;
}
if (this.selectIndustryThirdCategory != index) {
this.selectIndustryThirdCategory = index;
}
this.industryCategoryList[this.selectIndustryTopCategory].hierarchy[sindex].level2_sectors[index].isSpread = !this.industryCategoryList[this.selectIndustryTopCategory].hierarchy[sindex].level2_sectors[index].isSpread;
},
/**
* 选择行业分类四级分类
*/
clickIndustryForthCategoryItem(sindex, tindex, index) {
if (this.selectIndustrySecondCategory != sindex) {
this.selectIndustrySecondCategory = sindex;
}
if (this.selectIndustryThirdCategory != tindex) {
this.selectIndustryThirdCategory = tindex;
}
if (this.selectIndustryForthCategory != index) {
this.selectIndustryForthCategory = index;
}
},
/**
* 删除选中的行业二级分类
*/
deleteIndustrySecondCategoryItem() {
this.selectIndustrySecondCategory = -1;
this.selectIndustryThirdCategory = -1;
this.selectIndustryForthCategory = -1;
},
/**
* 删除选中的行业三级分类
*/
deleteIndustryThirdCategoryItem() {
this.selectIndustryThirdCategory = -1;
this.selectIndustryForthCategory = -1;
},
/**
* 删除选中的行业四级分类
*/
deleteIndustryForthCategoryItem() {
this.selectIndustryForthCategory = -1;
},
/**
* 点击选择重要性
*/
@@ -447,11 +515,12 @@ const _sfc_main = {
},
/**
* 点击相关股票
* @param {Object} code
* @param {Object} id 事件id
* @param {Object} code 股票代码
*/
clickLookRelatedStockItem(code) {
clickLookRelatedStockItem(id, code) {
common_vendor.index.navigateTo({
url: "/pages/index/stockDetails/stockDetails?code=" + code
url: "/pages/index/stockDetails/stockDetails?type=1&code=" + code + "&id=" + id
});
},
/**
@@ -479,66 +548,88 @@ const _sfc_main = {
* 获取事件筛选项
*/
getEventFilterListData() {
request_api.filterOptions().then((res) => {
if (res.code == 200) {
let timeList = [...res.data.sort_options];
this.timeCategoryList = timeList.splice(0, 2);
let sortList = [...res.data.sort_options];
for (let item of sortList) {
if (item.name == "最新") {
item.icon = "/static/icon/home/new.png";
}
if (item.name == "热门") {
item.icon = "/static/icon/home/hot.png";
}
if (item.name == "收益率") {
item.icon = "/static/icon/home/yield.png";
return new Promise((resolve, reject) => {
request_api.filterOptions().then((res) => {
if (res.code == 200) {
resolve(1);
let timeList = [...res.data.sort_options];
this.timeCategoryList = timeList.splice(0, 2);
let sortList = [...res.data.sort_options];
for (let item of sortList) {
if (item.name == "最新") {
item.icon = "/static/icon/home/new.png";
}
if (item.name == "热门") {
item.icon = "/static/icon/home/hot.png";
}
if (item.name == "收益率") {
item.icon = "/static/icon/home/yield.png";
}
}
this.sortList = res.data.sort_options.splice(0, 3);
this.importanceList = res.data.importance_options;
this.importanceList.unshift({ desc: "全部", key: "all", name: "全部" });
} else {
reject(1);
common_vendor.index.showToast({
title: res.message,
icon: "none"
});
}
this.sortList = res.data.sort_options.splice(0, 3);
this.importanceList = res.data.importance_options;
this.importanceList.unshift({ desc: "全部", key: "all", name: "全部" });
} else
common_vendor.index.showToast({
title: res.message,
icon: "none"
});
}).catch((error) => {
}).catch((error) => {
reject(1);
});
});
},
/**
* 获取行业分类
*/
getIndustryCategoryListData() {
request_api.industryCategoryList().then((res) => {
this.industryTopCategoryList = res.data;
}).catch((error) => {
return new Promise((resolve, reject) => {
request_api.industryCategoryList().then((res) => {
this.industryCategoryList = res.data;
resolve(1);
}).catch((error) => {
reject(1);
});
});
},
/**
* 获取股票分类
*/
getStockCategoryListData() {
request_api.stockCategoryList().then((res) => {
if (res.code == 200) {
for (let item of res.data) {
item.sub_sectors.unshift("全部");
return new Promise((resolve, reject) => {
request_api.stockCategoryList().then((res) => {
if (res.code == 200) {
for (let item of res.data) {
item.sub_sectors.unshift("全部");
}
res.data.unshift({ primary_sector: "全部", sub_sectors: [] });
this.stockCategoryList = res.data;
resolve(1);
} else {
common_vendor.index.showToast({
title: res.message,
icon: "none"
});
reject(1);
}
res.data.unshift({ primary_sector: "全部", sub_sectors: [] });
this.stockCategoryList = res.data;
} else
common_vendor.index.showToast({
title: res.message,
icon: "none"
});
}).catch((error) => {
}).catch((error) => {
reject(1);
});
});
},
/**
* 获取事件列表数据
*/
getEventListData() {
let param = { page: this.page, keywords: this.keywords };
let param = { page: this.page, q: this.keywords };
if (this.selectTopCategory > 0) {
param.stock_sector = this.stockCategoryList[this.selectTopCategory].primary_sector;
}
if (this.selectSecondCategory > 0) {
param.secondary_sector = this.stockCategoryList[this.selectTopCategory].sub_sectors[this.selectSecondCategory];
}
if (this.startDate) {
param.start_date = this.startDate;
}
@@ -551,35 +642,125 @@ const _sfc_main = {
if (this.selectSortKey) {
param.sort = this.selectSortKey;
}
if (this.selectIndustryForthCategory > -1) {
param.industry_level = 4;
param.industry_classification = this.industryCategoryList[this.selectIndustryTopCategory].hierarchy[this.selectIndustrySecondCategory].level2_sectors[this.selectIndustryThirdCategory].level3_sectors[this.selectIndustryForthCategory].level3_sector;
} else {
if (this.selectIndustryThirdCategory > -1) {
param.industry_level = 3;
param.industry_classification = this.industryCategoryList[this.selectIndustryTopCategory].hierarchy[this.selectIndustrySecondCategory].level2_sectors[this.selectIndustryThirdCategory].level2_sector;
} else {
if (this.selectIndustrySecondCategory > -1) {
param.industry_level = 2;
param.industry_classification = this.industryCategoryList[this.selectIndustryTopCategory].hierarchy[this.selectIndustrySecondCategory].level1_sector;
} else {
param.industry_level = 1;
param.industry_classification = this.industryCategoryList[this.selectIndustryTopCategory].classification_name;
}
}
}
request_api.eventList(param).then((res) => {
if (res.success) {
let valueData = [];
let data = res.data.overall_stats.change_distribution;
valueData.push({
value: data.limit_down,
itemStyle: { color: "#35542266" },
label: {
textStyle: { color: "#35542266" }
}
});
valueData.push({
value: data.down_over_5,
itemStyle: { color: "#35542299" },
label: {
textStyle: { color: "#355422" }
}
});
valueData.push({
value: data.down_5_to_1,
itemStyle: { color: "#355422CC" },
label: {
textStyle: { color: "#355422" }
}
});
valueData.push({
value: data.down_within_1,
itemStyle: { color: "#355422" },
label: {
textStyle: { color: "#355422" }
}
});
valueData.push({
value: data.flat,
itemStyle: { color: "#ACB0C0" },
label: {
textStyle: { color: "#666" }
}
});
valueData.push({
value: data.up_within_1,
itemStyle: { color: "#C00000" },
label: {
textStyle: { color: "#C00000" }
}
});
valueData.push({
value: data.up_1_to_5,
itemStyle: { color: "#C00000CC" },
label: {
textStyle: { color: "#C00000" }
}
});
valueData.push({
value: data.up_over_5,
itemStyle: { color: "#C0000099" },
label: {
textStyle: { color: "#C00000" }
}
});
valueData.push({
value: data.limit_up,
itemStyle: { color: "#C0000066" },
label: {
textStyle: { color: "#C0000066" }
}
});
this.option.series[0].data = valueData;
this.init();
if (this.page == 1) {
this.eventList = res.data.events;
} else
this.eventList = this.eventList.concat(res.data.events);
this.loadAll = !res.data.pagination.has_next;
}
}).catch((error) => {
});
let token = common_vendor.index.getStorageSync("token");
if (!token) {
let param1 = { email: "1198731706@qq.com", password: "Aa123456", isJson: 1 };
request_api.loginByEmail(param1).then((res) => {
if (res.code == 200) {
common_vendor.index.setStorageSync("token", res.data.token);
} else
common_vendor.index.showToast({
title: res.message,
icon: "none"
});
}).catch((error) => {
});
}
},
/**
* 获取热门事件数据
*/
getHotEventListData() {
request_api.homeData().then((res) => {
let param = { page: this.page, q: this.keywords };
if (this.selectTopCategory > 0) {
param.stock_sector = this.stockCategoryList[this.selectTopCategory].primary_sector;
}
if (this.selectSecondCategory > 0) {
param.secondary_sector = this.stockCategoryList[this.selectTopCategory].sub_sectors[this.selectSecondCategory];
}
if (this.startDate) {
param.start_date = this.startDate;
}
if (this.endDate) {
param.end_date = this.endDate;
}
if (this.selectImportanceIndex > 0) {
param.importance = this.importanceList[this.selectImportanceIndex].key;
}
if (this.selectSortKey) {
param.sort = this.selectSortKey;
}
request_api.homeData(param).then((res) => {
if (res.code == 200) {
if (this.page == 1) {
this.eventList = res.data.events;
@@ -596,12 +777,14 @@ const _sfc_main = {
}
};
if (!Array) {
const _easycom_l_echart2 = common_vendor.resolveComponent("l-echart");
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
_easycom_uni_popup2();
(_easycom_l_echart2 + _easycom_uni_popup2)();
}
const _easycom_l_echart = () => "../../uni_modules/lime-echart/components/l-echart/l-echart.js";
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
if (!Math) {
_easycom_uni_popup();
(_easycom_l_echart + _easycom_uni_popup)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
@@ -646,7 +829,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
q: $data.secondScrollLeft
} : {}, {
r: common_vendor.s("top:" + $data.contentTop + "px"),
s: common_vendor.f($data.eventList, (item, index, i0) => {
s: common_vendor.sr("chartRef", "9dfd58d8-0"),
t: common_vendor.f($data.eventList, (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item.importance),
b: common_vendor.n("level " + item.importance),
@@ -683,7 +867,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
a: common_vendor.t(sitem.stock_name),
b: common_vendor.t(($data.getRateUpOrDown(sitem.daily_change) ? "" : "+") + sitem.daily_change),
c: sindex,
d: common_vendor.o(($event) => $options.clickLookRelatedStockItem(sitem.stock_code), sindex)
d: common_vendor.o(($event) => $options.clickLookRelatedStockItem(item.id, sitem.stock_code), sindex)
};
}),
x: common_vendor.t($data.getLocaleTime(item.created_at)),
@@ -695,13 +879,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
D: index
});
}),
t: common_assets._imports_3,
v: common_assets._imports_4,
w: common_assets._imports_7,
x: common_vendor.s("top:" + $data.listTop + "px"),
y: common_vendor.o(($event) => $options.loadMoreData()),
z: common_assets._imports_11$1,
A: common_vendor.f($data.sortList, (item, index, i0) => {
v: common_assets._imports_3,
w: common_assets._imports_4,
x: common_assets._imports_10,
y: common_vendor.s("top:" + $data.listTop + "px"),
z: common_vendor.o(($event) => $options.loadMoreData()),
A: common_assets._imports_13$1,
B: common_vendor.f($data.sortList, (item, index, i0) => {
return {
a: item.icon,
b: common_vendor.t(item.name),
@@ -709,15 +893,15 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
d: common_vendor.o(($event) => $options.clickSortListItem(item), index)
};
}),
B: common_vendor.s("margin-top:" + $data.sortListTop + "px;"),
C: common_vendor.sr("sortPopup", "9dfd58d8-0"),
D: common_vendor.p({
C: common_vendor.s("margin-top:" + $data.sortListTop + "px;"),
D: common_vendor.sr("sortPopup", "9dfd58d8-1"),
E: common_vendor.p({
type: "top",
["mask-background-color"]: "transparent"
}),
E: common_assets._imports_2,
F: common_vendor.s("height:" + $data.menuH + "px;"),
G: common_vendor.f($data.screenCategoryList, (item, index, i0) => {
F: common_assets._imports_2,
G: common_vendor.s("height:" + $data.menuH + "px;"),
H: common_vendor.f($data.screenCategoryList, (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item),
b: $data.selectScreenCategory == index
@@ -727,22 +911,22 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
e: common_vendor.o(($event) => $options.clickScreenCategoryItem(index), index)
});
}),
H: $data.selectScreenCategory == 0
I: $data.selectScreenCategory == 0
}, $data.selectScreenCategory == 0 ? {
I: common_vendor.t($data.startDate),
J: common_vendor.t($data.endDate),
K: common_assets._imports_11,
L: common_vendor.o(($event) => $options.clickPreMonth()),
M: common_vendor.t($data.selectMonth),
N: common_assets._imports_12,
O: common_vendor.o(($event) => $options.clickNextMonth()),
P: common_vendor.f($data.weekList, (item, index, i0) => {
J: common_vendor.t($data.startDate),
K: common_vendor.t($data.endDate),
L: common_assets._imports_5,
M: common_vendor.o(($event) => $options.clickPreMonth()),
N: common_vendor.t($data.selectMonth),
O: common_assets._imports_6,
P: common_vendor.o(($event) => $options.clickNextMonth()),
Q: common_vendor.f($data.weekList, (item, index, i0) => {
return {
a: common_vendor.t(item),
b: index
};
}),
Q: common_vendor.f($data.monthDateList[$data.selectMonthIndex], (item, index, i0) => {
R: common_vendor.f($data.monthDateList[$data.selectMonthIndex], (item, index, i0) => {
return common_vendor.e({
a: item.isToday || item.date == $data.startDate || item.date == $data.endDate
}, item.isToday || item.date == $data.startDate || item.date == $data.endDate ? {
@@ -763,22 +947,111 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
});
})
} : {}, {
R: $data.selectScreenCategory == 1
}, $data.selectScreenCategory == 1 ? {
S: common_vendor.f($data.industryTopCategoryList, (item, index, i0) => {
S: $data.selectScreenCategory == 1
}, $data.selectScreenCategory == 1 ? common_vendor.e({
T: common_vendor.f($data.industryCategoryList, (item, index, i0) => {
return {
a: common_vendor.t(item.classification_name),
b: common_vendor.n("item " + ($data.selectIndustryTopCategory == index ? "select" : "")),
c: index,
d: common_vendor.o(($event) => $options.clickSelectIndustryTopCategoryItem(index), index)
d: common_vendor.o(($event) => $options.clickIndustryTopCategoryItem(index), index)
};
}),
T: common_assets._imports_1,
U: common_vendor.t($data.industryTopCategoryList[$data.selectIndustryTopCategory].classification_name)
U: common_assets._imports_1,
V: common_vendor.o([($event) => $data.industryKeywords = $event.detail.value, (...args) => $options.industrySearch && $options.industrySearch(...args)]),
W: $data.industryKeywords,
X: $data.industryKeywords.length > 0
}, $data.industryKeywords.length > 0 ? {
Y: common_vendor.f($data.searchResultList, (item, index, i0) => {
return {
a: common_vendor.f(item.hierarchy, (sitem, sindex, i1) => {
return {
a: common_vendor.f(sitem.level2_sectors, (titem, tindex, i2) => {
return {
a: common_vendor.f(titem.level3_sectors, (fitem, findex, i3) => {
return {
a: common_vendor.f(fitem.level3_sector + "/" + titem.level2_sector + "/" + sitem.level1_sector, (citem, cindex, i4) => {
return {
a: common_vendor.t(citem),
b: common_vendor.n($data.industryKeywords.indexOf(citem) > -1 ? "key" : ""),
c: cindex
};
}),
b: common_vendor.o(($event) => $options.clickIndustrySearchItem(fitem), findex),
c: findex
};
}),
b: tindex
};
}),
b: sindex
};
}),
b: index
};
})
} : common_vendor.e({
Z: $data.selectIndustrySecondCategory > -1
}, $data.selectIndustrySecondCategory > -1 ? common_vendor.e({
aa: $data.selectIndustrySecondCategory > -1
}, $data.selectIndustrySecondCategory > -1 ? {
ab: common_vendor.t($data.industryCategoryList[$data.selectIndustryTopCategory].hierarchy[$data.selectIndustrySecondCategory].level1_sector),
ac: common_assets._imports_13,
ad: common_vendor.o(($event) => $options.deleteIndustrySecondCategoryItem())
} : {}, {
V: $data.selectScreenCategory == 2
ae: $data.selectIndustryThirdCategory > -1
}, $data.selectIndustryThirdCategory > -1 ? {
af: common_vendor.t($data.industryCategoryList[$data.selectIndustryTopCategory].hierarchy[$data.selectIndustrySecondCategory].level2_sectors[$data.selectIndustryThirdCategory].level2_sector),
ag: common_assets._imports_13,
ah: common_vendor.o(($event) => $options.deleteIndustryThirdCategoryItem())
} : {}, {
ai: $data.selectIndustryForthCategory > -1
}, $data.selectIndustryForthCategory > -1 ? {
aj: common_vendor.t($data.industryCategoryList[$data.selectIndustryTopCategory].hierarchy[$data.selectIndustrySecondCategory].level2_sectors[$data.selectIndustryThirdCategory].level3_sectors[$data.selectIndustryForthCategory].level3_sector),
ak: common_assets._imports_13,
al: common_vendor.o(($event) => $options.deleteIndustryForthCategoryItem())
} : {}) : {}, {
am: common_vendor.t($data.industryCategoryList[$data.selectIndustryTopCategory].classification_name),
an: common_vendor.f($data.industryCategoryList[$data.selectIndustryTopCategory].hierarchy, (sitem, sindex, i0) => {
return common_vendor.e({
a: common_vendor.t($data.selectIndustrySecondCategory == sindex && sitem.isSpread ? "-" : "+"),
b: common_vendor.t(sitem.level1_sector),
c: common_vendor.n("categoryC flex " + ($data.selectIndustrySecondCategory == sindex ? "select" : "")),
d: common_vendor.o(($event) => $options.clickIndustrySecondCategoryItem(sindex), sindex),
e: sitem.isSpread
}, sitem.isSpread ? {
f: common_vendor.f($data.industryCategoryList[$data.selectIndustryTopCategory].hierarchy[sindex].level2_sectors, (titem, tindex, i1) => {
return common_vendor.e({
a: common_vendor.t($data.selectIndustrySecondCategory == sindex && $data.selectIndustryThirdCategory == tindex && titem.isSpread ? "-" : "+"),
b: common_vendor.t(titem.level2_sector),
c: common_vendor.n("categoryC flex " + ($data.selectIndustrySecondCategory == sindex && $data.selectIndustryThirdCategory == tindex ? "select" : "")),
d: common_vendor.o(($event) => $options.clickIndustryThirdCategoryItem(sindex, tindex), tindex),
e: titem.isSpread
}, titem.isSpread ? {
f: common_vendor.f($data.industryCategoryList[$data.selectIndustryTopCategory].hierarchy[sindex].level2_sectors[tindex].level3_sectors, (fitem, findex, i2) => {
return common_vendor.e({
a: common_vendor.t(fitem.level3_sector),
b: $data.selectIndustrySecondCategory == sindex && $data.selectIndustryThirdCategory == tindex && $data.selectIndustryForthCategory == findex
}, $data.selectIndustrySecondCategory == sindex && $data.selectIndustryThirdCategory == tindex && $data.selectIndustryForthCategory == findex ? {
c: common_assets._imports_14
} : {}, {
d: common_vendor.n("categoryC flex " + ($data.selectIndustrySecondCategory == sindex && $data.selectIndustryThirdCategory == tindex && $data.selectIndustryForthCategory == findex ? "select" : "")),
e: common_vendor.o(($event) => $options.clickIndustryForthCategoryItem(sindex, tindex, findex), findex),
f: findex
});
})
} : {}, {
g: tindex
});
})
} : {}, {
g: sindex
});
})
})) : {}, {
ao: $data.selectScreenCategory == 2
}, $data.selectScreenCategory == 2 ? {
W: common_vendor.f($data.importanceList, (item, index, i0) => {
ap: common_vendor.f($data.importanceList, (item, index, i0) => {
return {
a: common_vendor.t(item.name),
b: common_vendor.n("item " + ($data.selectImportanceIndex == index ? "select" : "")),
@@ -787,11 +1060,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
};
})
} : {}, {
X: common_vendor.o(($event) => $options.clickCancel()),
Y: common_vendor.o(($event) => $options.clickCertain()),
Z: common_vendor.s("padding-top:" + $data.menuTop + "px;"),
aa: common_vendor.sr("screenPopup", "9dfd58d8-1"),
ab: common_vendor.p({
aq: common_vendor.o(($event) => $options.clickCancel()),
ar: common_vendor.o(($event) => $options.clickCertain()),
as: common_vendor.s("padding-top:" + $data.menuTop + "px;"),
at: common_vendor.sr("screenPopup", "9dfd58d8-2"),
av: common_vendor.p({
type: "top"
})
});

View File

@@ -2,6 +2,7 @@
"navigationBarTitleText": "uni-app",
"enablePullDownRefresh": true,
"usingComponents": {
"l-echart": "../../uni_modules/lime-echart/components/l-echart/l-echart",
"uni-popup": "../../uni_modules/uni-popup/components/uni-popup/uni-popup"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -437,15 +437,94 @@
width: 30rpx;
height: auto;
}
.screenPopup .screenContentC .searchResultList .item {
padding: 10rpx 44rpx;
font-size: 26rpx;
font-weight: 500;
color: #444;
}
.screenPopup .screenContentC .searchResultList .item .key {
color: #F97316;
}
.screenPopup .screenContentC .industryList {
margin-top: 24rpx;
}
.screenPopup .screenContentC .industryList .selectCategoryList {
padding: 0 22rpx;
}
.screenPopup .screenContentC .industryList .selectCategoryList .item {
background-color: #FFF1E7;
margin-right: 15rpx;
padding-left: 16rpx;
line-height: 38rpx;
border-radius: 10rpx;
border: solid 0.5px #F97316;
font-size: 22rpx;
font-weight: 500;
color: #F97316;
}
.screenPopup .screenContentC .industryList .selectCategoryList .item .deleteC {
padding: 0 11rpx;
}
.screenPopup .screenContentC .industryList .selectCategoryList .item .deleteC .icon {
width: 15rpx;
height: 15rpx;
}
.screenPopup .screenContentC .industryList .list {
margin-top: 20rpx;
}
.screenPopup .screenContentC .industryList .list .topCategory {
padding: 0 30rpx;
padding: 0 22rpx;
font-size: 28rpx;
font-weight: bold;
color: #F97316;
}
.screenPopup .screenContentC .industryList .list .secondItem {
padding: 0 22rpx;
}
.screenPopup .screenContentC .industryList .list .thirdItem {
padding-left: 36rpx;
}
.screenPopup .screenContentC .industryList .list .forthItem {
padding-left: 36rpx;
}
.screenPopup .screenContentC .industryList .list .forthItem .categoryC.select {
border-bottom: solid 0.5px #F97316;
}
.screenPopup .screenContentC .industryList .list .categoryC {
height: 50rpx;
}
.screenPopup .screenContentC .industryList .list .categoryC .spread {
margin-right: 12rpx;
width: 24rpx;
line-height: 22rpx;
border: solid 0.5px #8C8C8C;
font-size: 22rpx;
color: #8C8C8C;
text-align: center;
}
.screenPopup .screenContentC .industryList .list .categoryC .category {
font-size: 24rpx;
font-weight: 500;
color: #444;
}
.screenPopup .screenContentC .industryList .list .categoryC.select .spread {
color: #F97316;
border: solid 0.5px #F97316;
}
.screenPopup .screenContentC .industryList .list .categoryC.select .category {
color: #F97316;
}
.screenPopup .screenContentC .industryList .list .categoryC.select .selectC {
width: 24rpx;
height: 24rpx;
border: solid 0.5px #F97316;
}
.screenPopup .screenContentC .industryList .list .categoryC.select .selectC .icon {
display: block;
width: 20rpx;
height: auto;
}
.screenPopup .screenContentC .importanceList {
margin-top: 16rpx;
padding: 0 20rpx;

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 echarts = require("../../../uni_modules/lime-echart/static/echarts.min.js");
const _sfc_main = {
@@ -9,18 +10,33 @@ const _sfc_main = {
navH: common_vendor.inject("navHeight"),
contentTop: "",
navTitle: "",
type: "",
//1事件详情2投资详情
eventId: "",
//事件id
stockCode: "",
//股票code
categoryList: ["分钟线", "分时图", "日K线"],
categoryList: ["分时图", "日K线"],
selectCategory: 0,
option: {
title: {
show: false
},
tooltip: {
position: function(pos, params, dom, rect, size) {
var obj = { top: "10%" };
obj[["left", "right"][+(pos[0] < size.viewSize[0] / 2)]] = 5;
return obj;
},
trigger: "axis",
axisPointer: {
type: "cross"
},
formatter: function(params) {
common_vendor.index.__f__("log", "at pages/index/stockDetails/stockDetails.vue:66", params);
let res = "日期:" + params[0].name + "\n开盘价" + params[0].data[1] + "\n收盘价" + params[0].data[2] + "\n最低价" + params[0].data[3] + "\n最高价" + params[0].data[4];
common_vendor.index.__f__("log", "at pages/index/stockDetails/stockDetails.vue:68", res);
return res;
}
},
legend: {
@@ -70,107 +86,76 @@ const _sfc_main = {
color0: "#8A0000",
borderColor: "#00da3c",
borderColor0: "#008F28"
},
markPoint: {
label: {
formatter: function(param) {
return param != null ? Math.round(param.value) + "" : "";
}
},
data: [
{
name: "Mark",
coord: ["2013/5/31", 2300],
value: 2300,
itemStyle: {
color: "rgb(41,60,85)"
}
},
{
name: "highest value",
type: "max",
valueDim: "highest"
},
{
name: "lowest value",
type: "min",
valueDim: "lowest"
},
{
name: "average value on close",
type: "average",
valueDim: "close"
}
],
tooltip: {
formatter: function(param) {
return param.name + "<br>" + (param.data.coord || "");
}
}
},
markLine: {
symbol: ["none", "none"],
data: [
[
{
name: "from lowest to highest",
type: "min",
valueDim: "lowest",
symbol: "circle",
symbolSize: 10,
label: {
show: false
},
emphasis: {
label: {
show: false
}
}
},
{
type: "max",
valueDim: "highest",
symbol: "circle",
symbolSize: 10,
label: {
show: false
},
emphasis: {
label: {
show: false
}
}
}
],
{
name: "min line on close",
type: "min",
valueDim: "close"
},
{
name: "max line on close",
type: "max",
valueDim: "close"
}
]
}
}
]
}
},
option1: {
title: {
show: false
},
tooltip: {
trigger: "axis"
},
grid: {
left: "10%",
right: "12%",
bottom: "10%"
},
xAxis: {
type: "category"
},
yAxis: {
scale: true
},
dataZoom: [
{
type: "inside"
}
],
series: {
name: "分时图",
type: "line",
markLine: {
silent: true,
symbol: ["none", "none"],
lineStyle: {
width: 2,
color: "#AAA"
},
data: []
}
}
},
relatedDesc: "",
//关联描述
sourceList: [],
//来源列表
getLocalDate: utils_util.getLocalDate
};
},
onLoad(e) {
this.contentTop = this.navH + (60 + 10) / 750 * common_vendor.inject("windowWidth");
if (e.code) {
this.stockCode = e.code;
this.getStockDetailsData();
this.getStockCandlestickChartData();
this.type = e.type;
if (e.type == 1) {
this.contentTop = this.navH + (60 + 8) / 750 * common_vendor.inject("windowWidth");
this.eventId = e.id;
this.stockCode = e.code;
this.getStockDetailsData();
} else {
this.contentTop = this.navH;
this.navTitle = e.name + "(" + e.code + ")";
this.relatedDesc = e.des;
}
}
},
methods: {
async init() {
const chart = await this.$refs.chartRef.init(echarts);
chart.setOption(this.option);
if (this.selectCategory == 0) {
chart.setOption(this.option1);
} else
chart.setOption(this.option);
},
/**
* 点击切换分类
@@ -179,9 +164,10 @@ const _sfc_main = {
clickCategoryItem(index) {
if (this.selectCategory != index) {
this.selectCategory = index;
if (index == 0 || index == 2) {
if (index == 1) {
this.getStockCandlestickChartData();
}
} else
this.init();
}
},
/**
@@ -189,9 +175,47 @@ const _sfc_main = {
*/
getStockDetailsData() {
let stockCode = this.stockCode;
request_api.stockDetails(stockCode).then((res) => {
let eventId = this.eventId;
request_api.stockDetails(eventId, stockCode).then((res) => {
if (res.code == 200) {
this.navTitle = res.data.basic_info.stock_name + "(" + res.data.basic_info.stock_code + ")";
let data = res.data.minute_chart_data;
let categoryData = [];
let valueData = [];
for (let item of data) {
categoryData.push(item.time);
valueData.push(item.close);
}
this.option1.xAxis.data = categoryData;
this.option1.series.data = valueData;
this.option1.series.markLine.data = [
{
yAxis: data[0].open,
label: {
show: true,
position: "start",
// formatter:'111',
color: "#333"
}
},
{
yAxis: data[0].open,
label: {
show: true,
position: "end",
formatter: "0.00%",
color: "#333"
}
}
];
let relatedDesc = res.data.related_desc;
if (relatedDesc) {
this.relatedDesc = relatedDesc.relation_desc;
if (relatedDesc.retrieved_sources) {
this.sourceList = relatedDesc.retrieved_sources;
}
}
this.init();
} else
common_vendor.index.showToast({
title: res.message,
@@ -206,16 +230,19 @@ const _sfc_main = {
getStockCandlestickChartData() {
let stockCode = this.stockCode;
let param = { chart_type: "minute" };
if (this.selectCategory == 2) {
if (this.selectCategory == 1) {
param.chart_type = "daily";
}
request_api.stockCandlestickChartData(stockCode, param).then((res) => {
let data = res.data;
let categoryData = [];
let valueData = [];
for (let item of data) {
categoryData.push(item.time);
valueData.push([item.open, item.close, item.low, item.high]);
}
this.option.xAxis.data = categoryData;
this.option.series[0].data = valueData;
this.init();
}).catch((error) => {
});
@@ -233,12 +260,14 @@ if (!Math) {
(_easycom_navBar + _easycom_l_echart)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
return common_vendor.e({
a: common_vendor.p({
leftText: $data.navTitle
}),
b: common_assets._imports_0,
c: common_vendor.f($data.categoryList, (item, index, i0) => {
c: $data.type == 1
}, $data.type == 1 ? {
d: common_vendor.f($data.categoryList, (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item),
b: $data.selectCategory == index
@@ -248,10 +277,27 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
e: common_vendor.o(($event) => $options.clickCategoryItem(index), index)
});
}),
d: common_vendor.s("top:" + $data.navH + "px;"),
e: common_vendor.sr("chartRef", "42054871-1"),
f: common_vendor.s("top:" + $data.contentTop + "px;")
};
e: common_vendor.s("top:" + $data.navH + "px;")
} : {}, {
f: $data.type == 1
}, $data.type == 1 ? {
g: common_vendor.sr("chartRef", "42054871-1")
} : {}, {
h: common_vendor.t($data.relatedDesc),
i: $data.type == 1 && $data.sourceList.length > 0
}, $data.type == 1 && $data.sourceList.length > 0 ? {} : {}, {
j: common_vendor.f($data.sourceList, (item, index, i0) => {
return {
a: common_vendor.t(item.sentences),
b: common_vendor.t(item.report_title),
c: common_vendor.t(item.author),
d: common_vendor.t($data.getLocalDate(item.declare_date)),
e: index
};
}),
k: common_vendor.n("contentC fixed " + ($data.type == 2 ? "radius" : "")),
l: 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 +1 @@
<view><nav-bar wx:if="{{a}}" u-i="42054871-0" bind:__l="__l" u-p="{{a}}"></nav-bar><image class="topBg absolute" src="{{b}}" mode="widthFix"></image><view class="tabC 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="{{f}}"><view style="width:750rpx;height:400rpx"><l-echart class="r" u-r="chartRef" u-i="42054871-1" bind:__l="__l"></l-echart></view><view class="section">关联描述</view><view class="des">全球原油运输巨头VLCC运力规模全球第一直接受益于霍尔木兹海峡地缘风险带来的运价上涨及风险溢价。</view></view></view>
<view><nav-bar wx:if="{{a}}" u-i="42054871-0" bind:__l="__l" u-p="{{a}}"></nav-bar><image class="topBg absolute" src="{{b}}" mode="widthFix"></image><view wx:if="{{c}}" class="tabC fixed" style="{{e}}"><view wx:for="{{d}}" 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="{{k}}" style="{{l}}"><view wx:if="{{f}}" style="width:750rpx;height:400rpx"><l-echart class="r" u-r="chartRef" u-i="42054871-1" bind:__l="__l"></l-echart></view><view class="section">关联描述</view><view class="des">{{h}}</view><view wx:if="{{i}}" class="section">信息来源</view><view class="list"><view wx:for="{{j}}" wx:for-item="item" wx:key="e" class="item"><view class="content">{{item.a}}</view><view class="article">——《{{item.b}}》</view><view class="authorDateC flex"><view class="author flex1">{{item.c}}</view><view class="date">{{item.d}}</view></view></view></view></view></view>

View File

@@ -35,6 +35,7 @@
left: 0;
right: 0;
bottom: 0;
overflow-y: scroll;
}
.contentC .section {
padding: 0 28rpx;
@@ -44,8 +45,45 @@
color: #222;
}
.contentC .des {
padding: 0 30rpx;
padding: 0 0 30rpx;
margin: 0 25rpx;
border-bottom: solid 1rpx #E4E4E4;
line-height: 1.4rem;
font-size: 24rpx;
font-weight: 500;
color: #666;
}
.contentC .list {
padding: 0 25rpx;
}
.contentC .list .item {
background-color: #F8F8F8;
margin-bottom: 20rpx;
padding: 30rpx 26rpx;
border-radius: 10rpx;
}
.contentC .list .item .content {
font-size: 24rpx;
font-weight: 500;
color: #222;
}
.contentC .list .item .article {
margin-top: 10rpx;
font-size: 22rpx;
font-weight: 500;
color: #666;
text-align: right;
}
.contentC .list .item .authorDateC {
margin-top: 30rpx;
font-size: 22rpx;
font-weight: 500;
color: #AAA;
}
.contentC .list .item .authorDateC .author {
margin-right: 10rpx;
}
.contentC.radius {
margin-top: 10rpx;
border-radius: 20rpx 20rpx 0 0;
}