7.10 增加登录页面,事件详情接口对接,我的点赞,关注收藏页面搭建,接口对接
This commit is contained in:
@@ -1,22 +1,43 @@
|
||||
"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"),
|
||||
windowWidth: common_vendor.inject("windowWidth"),
|
||||
eventId: "",
|
||||
//事件id
|
||||
eventDetails: null,
|
||||
//事件详情
|
||||
categoryList: ["相关标的", "相关概念", "历史事件", "时间传导链分析", "关联数据"],
|
||||
targetList: [],
|
||||
//相关标的
|
||||
conceptList: [],
|
||||
//相关概念
|
||||
historyEventList: [],
|
||||
//历史事件
|
||||
historyEventRelatedStockList: [],
|
||||
//历史事件相关股票
|
||||
selectCategory: 0,
|
||||
headingList: ["名称代码", "分时图", "开盘价", "最新价", "涨跌幅"]
|
||||
headingList: ["名称代码", "分时图", "开盘价", "最新价", "涨跌幅"],
|
||||
getLocaleTime: utils_util.getLocaleTime,
|
||||
getRateUpOrDown: utils_util.getRateUpOrDown,
|
||||
getRateStr: utils_util.getRateStr,
|
||||
scoreTop: "",
|
||||
eventComment: "",
|
||||
//事件评论
|
||||
expectScore: 0
|
||||
//预期得分
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
if (e.id) {
|
||||
this.eventId = e.id;
|
||||
this.getEventDetailsData();
|
||||
this.getEventRelatedStockData();
|
||||
this.getEventCommentListData();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -26,14 +47,21 @@ const _sfc_main = {
|
||||
clickCategoryItem(index) {
|
||||
if (this.selectCategory != index) {
|
||||
this.selectCategory = index;
|
||||
if (index == 0) {
|
||||
this.getEventRelatedStockData();
|
||||
} else if (index == 1) {
|
||||
this.getEventRelatedConceptData();
|
||||
} else if (index == 2) {
|
||||
this.getEventHistoryEventData();
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 点击查看股票详情
|
||||
*/
|
||||
clickStockItem() {
|
||||
clickStockItem(code) {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/index/stockDetails/stockDetails"
|
||||
url: "/pages/index/stockDetails/stockDetails?code=" + code
|
||||
});
|
||||
},
|
||||
/**
|
||||
@@ -44,21 +72,125 @@ const _sfc_main = {
|
||||
url: "/pages/index/conceptDetails/conceptDetails"
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 点击查看历史事件的相关股票
|
||||
*/
|
||||
clickLookHistoricalEventRelatedStock(item) {
|
||||
this.historyEventRelatedStockList = item.related_stocks;
|
||||
this.$refs["stockPopup"].open();
|
||||
},
|
||||
/**
|
||||
* 点击关闭相关股票弹窗
|
||||
*/
|
||||
closeRelatedStockPopup() {
|
||||
this.$refs["stockPopup"].close();
|
||||
},
|
||||
/**
|
||||
* 点击查看超预期得分
|
||||
*/
|
||||
clickExpectScore(e) {
|
||||
this.scoreTop = e.currentTarget.offsetTop + this.navH + (70 + 10 + 20) / 750 * this.windowWidth;
|
||||
this.$refs["expectScorePopup"].open();
|
||||
},
|
||||
/**
|
||||
* 点击发送事件评论
|
||||
*/
|
||||
sendEventComment() {
|
||||
if (!this.eventComment) {
|
||||
common_vendor.index.showToast({
|
||||
title: "请输入评论内容",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
let eventId = this.eventId;
|
||||
let param = { content: this.eventComment };
|
||||
request_api.commentEvent(eventId, param).then((res) => {
|
||||
}).catch((error) => {
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 点击评论
|
||||
*/
|
||||
clickComment() {
|
||||
this.$refs["popup"].open();
|
||||
},
|
||||
/**
|
||||
* 点击关闭评论弹窗
|
||||
*/
|
||||
closeCommentPopup() {
|
||||
this.$refs["popup"].close();
|
||||
},
|
||||
/**
|
||||
* 获取事件详情数据
|
||||
* 点击关注
|
||||
*/
|
||||
getEventDetailsData() {
|
||||
clickFollow() {
|
||||
let eventId = this.eventId;
|
||||
request_api.eventDetails(eventId).then((res) => {
|
||||
followEvent(eventId).then((res) => {
|
||||
common_vendor.index.showToast({
|
||||
title: res.message,
|
||||
icon: "none"
|
||||
});
|
||||
}).catch((error) => {
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取事件相关标的数据
|
||||
*/
|
||||
getEventRelatedStockData() {
|
||||
let eventId = this.eventId;
|
||||
request_api.eventRelatedStock(eventId).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.eventDetails = res.data;
|
||||
this.targetList = res.data.related_stocks;
|
||||
} else
|
||||
common_vendor.index.showToast({
|
||||
title: res.message,
|
||||
icon: "none"
|
||||
});
|
||||
}).catch((error) => {
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取事件相关概念数据
|
||||
*/
|
||||
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"
|
||||
});
|
||||
}).catch((error) => {
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取事件历史事件数据
|
||||
*/
|
||||
getEventHistoryEventData() {
|
||||
let eventId = this.eventId;
|
||||
request_api.eventHistoryEvent(eventId).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.expectScore = res.data.invest_score;
|
||||
this.historyEventList = res.data.historical_events;
|
||||
} else
|
||||
common_vendor.index.showToast({
|
||||
title: res.message,
|
||||
icon: "none"
|
||||
});
|
||||
}).catch((error) => {
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取事件评论列表
|
||||
*/
|
||||
getEventCommentListData() {
|
||||
let eventId = this.eventId;
|
||||
request_api.eventCommentList(eventId).then((res) => {
|
||||
this.commentList = res.data.comments;
|
||||
}).catch((error) => {
|
||||
});
|
||||
}
|
||||
@@ -80,7 +212,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
leftText: "事件详情"
|
||||
}),
|
||||
b: common_assets._imports_0,
|
||||
c: common_vendor.f($data.categoryList, (item, index, i0) => {
|
||||
c: $data.eventDetails
|
||||
}, $data.eventDetails ? common_vendor.e({
|
||||
d: common_vendor.t($data.eventDetails.event_type),
|
||||
e: common_vendor.t($data.eventDetails.event_title),
|
||||
f: common_vendor.t($data.eventDetails.event_created_at.substr(0, 16)),
|
||||
g: common_vendor.t($data.eventDetails.event_desc),
|
||||
h: common_vendor.f($data.categoryList, (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item),
|
||||
b: $data.selectCategory == index
|
||||
@@ -90,33 +228,129 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
e: common_vendor.o(($event) => $options.clickCategoryItem(index), index)
|
||||
});
|
||||
}),
|
||||
d: $data.selectCategory == 0
|
||||
i: $data.selectCategory == 0
|
||||
}, $data.selectCategory == 0 ? {
|
||||
e: common_vendor.f($data.headingList, (item, index, i0) => {
|
||||
j: common_vendor.f($data.headingList, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item),
|
||||
b: index
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
f: $data.selectCategory == 0
|
||||
}, $data.selectCategory == 0 ? {} : {}, {
|
||||
g: $data.selectCategory == 1
|
||||
}, $data.selectCategory == 1 ? {
|
||||
h: common_vendor.o(($event) => $options.clickConceptItem())
|
||||
k: $data.selectCategory == 0
|
||||
}, $data.selectCategory == 0 ? {
|
||||
l: common_vendor.f($data.targetList, (item, index, i0) => {
|
||||
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)
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
i: common_vendor.s("top:" + $data.navH + "px;"),
|
||||
j: common_assets._imports_1$1,
|
||||
k: common_assets._imports_2$1,
|
||||
l: common_vendor.o(($event) => $options.clickComment()),
|
||||
m: common_assets._imports_3$1,
|
||||
n: common_assets._imports_4$2,
|
||||
o: common_vendor.o(($event) => $options.closeCommentPopup()),
|
||||
p: common_assets._imports_5$2,
|
||||
q: common_assets._imports_6,
|
||||
r: common_assets._imports_5$2,
|
||||
s: common_vendor.sr("popup", "6e1a61f1-1"),
|
||||
t: common_vendor.p({
|
||||
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
|
||||
} : {
|
||||
e: common_assets._imports_2$2
|
||||
}, {
|
||||
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
|
||||
});
|
||||
}),
|
||||
v: common_assets._imports_1$4
|
||||
} : {}, {
|
||||
w: common_vendor.s("top:" + $data.navH + "px;")
|
||||
}) : {}, {
|
||||
x: $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())
|
||||
} : {}, {
|
||||
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({
|
||||
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({
|
||||
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) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item.stock_name + "(" + item.stock_code + ")"),
|
||||
b: common_vendor.t(item.correlation * 100),
|
||||
c: common_vendor.t(item.sector),
|
||||
d: $data.getRateUpOrDown(item.daily_change)
|
||||
}, $data.getRateUpOrDown(item.daily_change) ? {
|
||||
e: common_assets._imports_1$1
|
||||
} : {
|
||||
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)
|
||||
});
|
||||
}),
|
||||
X: common_vendor.sr("stockPopup", "6e1a61f1-3"),
|
||||
Y: common_vendor.p({
|
||||
type: "bottom"
|
||||
})
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -12,7 +12,7 @@
|
||||
right: 0;
|
||||
bottom: calc(20rpx + 70rpx + 20rpx + env(safe-area-inset-bottom));
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
overflow-y: hidden;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.eventDetailsC .categoryTitleC {
|
||||
padding: 0 25rpx;
|
||||
@@ -33,7 +33,7 @@
|
||||
font-weight: bold;
|
||||
color: #222;
|
||||
}
|
||||
.eventDetailsC .time {
|
||||
.eventDetailsC .eventTime {
|
||||
margin: 20rpx 25rpx 0;
|
||||
font-size: 22rpx;
|
||||
font-weight: 500;
|
||||
@@ -99,14 +99,17 @@
|
||||
color: #888;
|
||||
}
|
||||
.eventDetailsC .targetList .item .nameCodePriceC .price {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #222;
|
||||
text-align: center;
|
||||
}
|
||||
.eventDetailsC .targetList .item .nameCodePriceC .chg {
|
||||
text-align: center;
|
||||
}
|
||||
.eventDetailsC .targetList .item .nameCodePriceC .chg.up {
|
||||
color: #FF2929;
|
||||
}
|
||||
.eventDetailsC .targetList .item .nameCodePriceC .chg.down {
|
||||
color: #22C55E;
|
||||
}
|
||||
.eventDetailsC .targetList .item .content {
|
||||
font-size: 20rpx;
|
||||
font-weight: 500;
|
||||
@@ -115,8 +118,10 @@
|
||||
.eventDetailsC .conceptList {
|
||||
padding: 30rpx 25rpx;
|
||||
}
|
||||
.eventDetailsC .conceptList .item {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.eventDetailsC .conceptList .item .cover {
|
||||
background-color: red;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 350rpx;
|
||||
@@ -128,6 +133,7 @@
|
||||
left: 0;
|
||||
width: 100%;
|
||||
bottom: 0;
|
||||
border-radius: ;
|
||||
color: white;
|
||||
}
|
||||
.eventDetailsC .conceptList .item .infoC .title {
|
||||
@@ -135,14 +141,146 @@
|
||||
font-weight: bold;
|
||||
}
|
||||
.eventDetailsC .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;
|
||||
}
|
||||
.eventDetailsC .conceptList .item .infoC .content .lookDetails {
|
||||
right: 0;
|
||||
color: #F97316;
|
||||
}
|
||||
.eventDetailsC .historyEventList {
|
||||
padding: 34rpx 25rpx;
|
||||
}
|
||||
.eventDetailsC .historyEventList .expectScoreC {
|
||||
background-color: #FBEFE7;
|
||||
padding: 0 25rpx;
|
||||
height: 70rpx;
|
||||
}
|
||||
.eventDetailsC .historyEventList .expectScoreC .icon {
|
||||
margin-right: 14rpx;
|
||||
width: 24rpx;
|
||||
height: auto;
|
||||
}
|
||||
.eventDetailsC .historyEventList .expectScoreC .score {
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #F97316;
|
||||
}
|
||||
.eventDetailsC .historyEventList .expectScoreC .tips {
|
||||
margin-left: 14rpx;
|
||||
width: 24rpx;
|
||||
height: auto;
|
||||
}
|
||||
.eventDetailsC .historyEventList .list {
|
||||
padding: 23rpx 0;
|
||||
}
|
||||
.eventDetailsC .historyEventList .list .item .eventLineC {
|
||||
padding: 0 43rpx 0 15rpx;
|
||||
}
|
||||
.eventDetailsC .historyEventList .list .item .eventLineC .line {
|
||||
background-color: #F0F0F0;
|
||||
width: 1px;
|
||||
height: 100%;
|
||||
}
|
||||
.eventDetailsC .historyEventList .list .item .eventLineC .pointC {
|
||||
background-color: #F9731680;
|
||||
top: 0;
|
||||
left: 5rpx;
|
||||
width: 20rpx;
|
||||
height: 20rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.eventDetailsC .historyEventList .list .item .eventLineC .pointC .point {
|
||||
background-color: #F97316;
|
||||
width: 10rpx;
|
||||
height: 10rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.eventDetailsC .historyEventList .list .item .eventInfoC {
|
||||
box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.07);
|
||||
margin-bottom: 20rpx;
|
||||
padding-top: 27rpx;
|
||||
min-width: 0;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.eventDetailsC .historyEventList .list .item .eventInfoC .titleCorrelationC {
|
||||
padding: 0 24rpx 0 30rpx;
|
||||
}
|
||||
.eventDetailsC .historyEventList .list .item .eventInfoC .titleCorrelationC .title {
|
||||
min-width: 0;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #222;
|
||||
}
|
||||
.eventDetailsC .historyEventList .list .item .eventInfoC .titleCorrelationC .correlation {
|
||||
background-color: #F973161A;
|
||||
padding: 0 12rpx;
|
||||
line-height: 40rpx;
|
||||
border-radius: 5rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #F97316;
|
||||
}
|
||||
.eventDetailsC .historyEventList .list .item .eventInfoC .content {
|
||||
margin: 16rpx 30rpx 0;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #666;
|
||||
}
|
||||
.eventDetailsC .historyEventList .list .item .eventInfoC .increaseRateList {
|
||||
white-space: nowrap;
|
||||
padding: 0 30rpx;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
.eventDetailsC .historyEventList .list .item .eventInfoC .increaseRateList .rateItem {
|
||||
display: inline-block;
|
||||
margin-right: 15rpx;
|
||||
line-height: 44rpx;
|
||||
padding: 0 14rpx;
|
||||
border-radius: 10rpx;
|
||||
font-size: 22rpx;
|
||||
font-weight: bold;
|
||||
color: white;
|
||||
}
|
||||
.eventDetailsC .historyEventList .list .item .eventInfoC .increaseRateList .rateItem .arrow {
|
||||
width: 15rpx;
|
||||
height: auto;
|
||||
}
|
||||
.eventDetailsC .historyEventList .list .item .eventInfoC .increaseRateList .rateItem.up {
|
||||
background-color: #C00000;
|
||||
}
|
||||
.eventDetailsC .historyEventList .list .item .eventInfoC .increaseRateList .rateItem.down {
|
||||
background-color: #355422;
|
||||
}
|
||||
.eventDetailsC .historyEventList .list .item .eventInfoC .relatedStockTimeC {
|
||||
padding-right: 28rpx;
|
||||
}
|
||||
.eventDetailsC .historyEventList .list .item .eventInfoC .relatedStockTimeC .relatedStockC {
|
||||
padding: 16rpx 30rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: bold;
|
||||
color: #F97316;
|
||||
}
|
||||
.eventDetailsC .historyEventList .list .item .eventInfoC .relatedStockTimeC .relatedStockC .icon {
|
||||
margin-right: 13rpx;
|
||||
width: 24rpx;
|
||||
height: auto;
|
||||
}
|
||||
.eventDetailsC .historyEventList .list .item .eventInfoC .relatedStockTimeC .time {
|
||||
font-size: 22rpx;
|
||||
font-weight: 500;
|
||||
color: #aaa;
|
||||
text-align: right;
|
||||
}
|
||||
.bottomC {
|
||||
padding: 20rpx 25rpx calc(20rpx + env(safe-area-inset-bottom));
|
||||
left: 0;
|
||||
@@ -163,12 +301,13 @@
|
||||
font-weight: 500;
|
||||
}
|
||||
.bottomC .commentLikeNumC .item {
|
||||
padding: 0 20rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
}
|
||||
.bottomC .commentLikeNumC .item .icon {
|
||||
margin: 0 20rpx;
|
||||
width: 35rpx;
|
||||
height: auto;
|
||||
}
|
||||
@@ -201,7 +340,6 @@
|
||||
display: flex;
|
||||
}
|
||||
.popup .list .item .originComment .avatar {
|
||||
background-color: red;
|
||||
margin-right: 23rpx;
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
@@ -271,7 +409,6 @@
|
||||
border-bottom: solid 1rpx #E4E4E4;
|
||||
}
|
||||
.popup .list .item .replyList .replyItem .avatar {
|
||||
background-color: red;
|
||||
margin-right: 23rpx;
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
@@ -332,3 +469,98 @@
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
.expectScorePopup {
|
||||
background-color: white;
|
||||
margin-left: calc(100% - 320rpx - 24rpx);
|
||||
width: 320rpx;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.expectScorePopup .arrow {
|
||||
top: -13rpx;
|
||||
right: 38rpx;
|
||||
width: 26rpx;
|
||||
height: auto;
|
||||
}
|
||||
.expectScorePopup .tips {
|
||||
padding: 30rpx 22rpx 20rpx;
|
||||
font-size: 22rpx;
|
||||
font-weight: 500;
|
||||
color: #444;
|
||||
}
|
||||
.stockPopup {
|
||||
background-color: white;
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
}
|
||||
.stockPopup .titleCloseC {
|
||||
padding-left: 25rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #222;
|
||||
}
|
||||
.stockPopup .titleCloseC .closeC {
|
||||
padding: 28rpx;
|
||||
}
|
||||
.stockPopup .titleCloseC .closeC .icon {
|
||||
width: 28rpx;
|
||||
height: auto;
|
||||
}
|
||||
.stockPopup .list {
|
||||
border-top: solid 1rpx #E4E4E4;
|
||||
margin: 0 25rpx;
|
||||
max-height: 800rpx;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.stockPopup .list .item {
|
||||
padding: 36rpx 0 28rpx;
|
||||
border-bottom: solid 1rpx #E4E4E4;
|
||||
}
|
||||
.stockPopup .list .item .titleCorrelationC .title {
|
||||
min-width: 0;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #222;
|
||||
}
|
||||
.stockPopup .list .item .titleCorrelationC .correlation {
|
||||
background-color: #F973161A;
|
||||
padding: 0 12rpx;
|
||||
line-height: 40rpx;
|
||||
border-radius: 5rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #F97316;
|
||||
}
|
||||
.stockPopup .list .item .sectorRateC .sector {
|
||||
display: inline-block;
|
||||
margin-right: 20rpx;
|
||||
padding: 0 11rpx;
|
||||
line-height: 30rpx;
|
||||
border-radius: 5rpx;
|
||||
border: solid 0.5px #F6604A;
|
||||
font-size: 20rpx;
|
||||
font-weight: 500;
|
||||
color: #F6604A;
|
||||
}
|
||||
.stockPopup .list .item .sectorRateC .rateC {
|
||||
background-color: #C00000;
|
||||
display: inline-block;
|
||||
padding: 0 10rpx;
|
||||
height: 30rpx;
|
||||
border-radius: 5rpx;
|
||||
font-size: 20rpx;
|
||||
font-weight: 500;
|
||||
color: white;
|
||||
}
|
||||
.stockPopup .list .item .sectorRateC .rateC .arrow {
|
||||
width: 15rpx;
|
||||
height: auto;
|
||||
}
|
||||
.stockPopup .list .item .content {
|
||||
margin-top: 16rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
354
unpackage/dist/dev/mp-weixin/pages/index/index.js
vendored
354
unpackage/dist/dev/mp-weixin/pages/index/index.js
vendored
@@ -10,18 +10,24 @@ const _sfc_main = {
|
||||
menuTop: common_vendor.inject("menuTop"),
|
||||
menuH: common_vendor.inject("menuHeight"),
|
||||
navH: common_vendor.inject("navHeight"),
|
||||
windowWidth: common_vendor.inject("windowWidth"),
|
||||
contentTop: "",
|
||||
listTop: "",
|
||||
sortListTop: "",
|
||||
keywords: "",
|
||||
//关键词
|
||||
sortList: [],
|
||||
selectSortKey: "",
|
||||
//选中排序key
|
||||
timeCategoryList: [],
|
||||
selectTimeCategory: 0,
|
||||
topCategoryList: ["全部", "大周期", "大消费", "大金融地产", "TMT板块", "公共产业板块"],
|
||||
stockCategoryList: [],
|
||||
topScrollWidth: 0,
|
||||
secondScrollWidth: 0,
|
||||
selectTopCategory: 0,
|
||||
secondCategoryList: ["全部", "石油石化", "煤炭", "有色金属", "钢铁", "基础化工", "建筑材料"],
|
||||
topScrollLeft: 0,
|
||||
selectSecondCategory: 0,
|
||||
secondScrollLeft: 0,
|
||||
screenCategoryList: ["日期范围", "行业分类", "重要性"],
|
||||
selectYearMonth: "",
|
||||
//选择的年月日
|
||||
@@ -39,7 +45,10 @@ const _sfc_main = {
|
||||
//选中月份下标
|
||||
selectMonth: "",
|
||||
//选中年月
|
||||
industryTopCategoryList: ["巨潮行业分类", "新财富行业分类", "申银万国行业分类", "证监会行业分类"],
|
||||
industryTopCategoryList: [],
|
||||
//行业一级分类
|
||||
selectIndustryTopCategory: 0,
|
||||
//
|
||||
selectScreenCategory: 0,
|
||||
importanceList: [],
|
||||
//重要性数组
|
||||
@@ -173,11 +182,13 @@ const _sfc_main = {
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.contentTop = this.navH + (75 + 20) / 750 * common_vendor.inject("windowWidth");
|
||||
this.listTop = this.contentTop + (22 + 80 + 72 + 44 + 44) / 750 * common_vendor.inject("windowWidth");
|
||||
this.sortListTop = this.navH + (22 + 80 + 80) / 750 * common_vendor.inject("windowWidth");
|
||||
this.contentTop = this.navH + (75 + 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();
|
||||
let currentDate = /* @__PURE__ */ new Date();
|
||||
let currentYear = currentDate.getFullYear();
|
||||
let currentMonth = currentDate.getMonth() + 1;
|
||||
@@ -239,6 +250,16 @@ const _sfc_main = {
|
||||
}
|
||||
this.monthDateList = monthDateList;
|
||||
},
|
||||
onReady() {
|
||||
common_vendor.index.createSelectorQuery().select("#topCategory").boundingClientRect((rect) => {
|
||||
this.topScrollWidth = Math.round(rect.width);
|
||||
}).exec();
|
||||
common_vendor.index.createSelectorQuery().select("#secondCategory").boundingClientRect((rect) => {
|
||||
if (rect) {
|
||||
this.secondScrollWidth = Math.round(rect.width);
|
||||
}
|
||||
}).exec();
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.page = 1;
|
||||
this.getEventListData();
|
||||
@@ -268,14 +289,29 @@ const _sfc_main = {
|
||||
clickTimeCategoryItem(index) {
|
||||
if (this.selectTimeCategory != index) {
|
||||
this.selectTimeCategory = index;
|
||||
if (index == 0) {
|
||||
this.getEventListData();
|
||||
} else
|
||||
this.getHotEventListData();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 点击排序
|
||||
*/
|
||||
clickSortItem() {
|
||||
clickSort() {
|
||||
this.$refs["sortPopup"].open();
|
||||
},
|
||||
/**
|
||||
* 点击排序选项
|
||||
*/
|
||||
clickSortListItem(item) {
|
||||
this.selectSortKey = item.key;
|
||||
this.$refs["sortPopup"].close();
|
||||
if (this.selectTimeCategory == 0) {
|
||||
this.getEventListData();
|
||||
} else
|
||||
this.getHotEventListData();
|
||||
},
|
||||
/**
|
||||
* 点击筛选
|
||||
*/
|
||||
@@ -308,18 +344,26 @@ const _sfc_main = {
|
||||
* 点击选择一级分类
|
||||
* @param {Object} index
|
||||
*/
|
||||
clickTopCategoryItem(index) {
|
||||
clickTopCategoryItem(event, index) {
|
||||
if (this.selectTopCategory != index) {
|
||||
this.selectTopCategory = index;
|
||||
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;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 点击选择二级分类
|
||||
* @param {Object} index
|
||||
*/
|
||||
clickSecondCategoryItem(index) {
|
||||
clickSecondCategoryItem(event, index) {
|
||||
if (this.selectSecondCategory != index) {
|
||||
this.selectSecondCategory = index;
|
||||
let offsetLeft = event.currentTarget.offsetLeft;
|
||||
this.secondScrollLeft = offsetLeft - this.secondScrollWidth / 2;
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -378,6 +422,14 @@ const _sfc_main = {
|
||||
this.startTimeStamp = item.timestamp;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 选择行业分类一级分类
|
||||
*/
|
||||
clickSelectIndustryTopCategoryItem(index) {
|
||||
if (this.selectIndustryTopCategory != index) {
|
||||
this.selectIndustryTopCategory = index;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 点击选择重要性
|
||||
*/
|
||||
@@ -386,6 +438,35 @@ const _sfc_main = {
|
||||
this.selectImportanceIndex = index;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 点击展开收起内容
|
||||
* @param {Object} index
|
||||
*/
|
||||
clickExpandOrRetract(index) {
|
||||
this.eventList[index].isExpand = !this.eventList[index].isExpand;
|
||||
},
|
||||
/**
|
||||
* 点击相关股票
|
||||
* @param {Object} code
|
||||
*/
|
||||
clickLookRelatedStockItem(code) {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/index/stockDetails/stockDetails?code=" + code
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 点击关注事件
|
||||
* @param {Object} id
|
||||
*/
|
||||
clickFollowEvent(id) {
|
||||
request_api.followEvent(id).then((res) => {
|
||||
common_vendor.index.showToast({
|
||||
title: res.message,
|
||||
icon: "none"
|
||||
});
|
||||
}).catch((error) => {
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 查看事件详情
|
||||
*/
|
||||
@@ -398,24 +479,58 @@ const _sfc_main = {
|
||||
* 获取事件筛选项
|
||||
*/
|
||||
getEventFilterListData() {
|
||||
request_api.eventFilterList().then((res) => {
|
||||
let timeList = [...res.data.available_sorts];
|
||||
this.timeCategoryList = timeList.splice(0, 2);
|
||||
let sortList = [...res.data.available_sorts];
|
||||
for (let item of sortList) {
|
||||
if (item.name == "最新") {
|
||||
item.icon = "/static/icon/home/new.png";
|
||||
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";
|
||||
}
|
||||
}
|
||||
if (item.name == "热门") {
|
||||
item.icon = "/static/icon/home/hot.png";
|
||||
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) => {
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取行业分类
|
||||
*/
|
||||
getIndustryCategoryListData() {
|
||||
request_api.industryCategoryList().then((res) => {
|
||||
this.industryTopCategoryList = res.data;
|
||||
}).catch((error) => {
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取股票分类
|
||||
*/
|
||||
getStockCategoryListData() {
|
||||
request_api.stockCategoryList().then((res) => {
|
||||
if (res.code == 200) {
|
||||
for (let item of res.data) {
|
||||
item.sub_sectors.unshift("全部");
|
||||
}
|
||||
if (item.name == "收益率") {
|
||||
item.icon = "/static/icon/home/yield.png";
|
||||
}
|
||||
}
|
||||
this.sortList = res.data.available_sorts.splice(0, 3);
|
||||
this.importanceList = res.data.available_importance_levels;
|
||||
this.importanceList.unshift({ desc: "全部", key: "all", name: "全部" });
|
||||
res.data.unshift({ primary_sector: "全部", sub_sectors: [] });
|
||||
this.stockCategoryList = res.data;
|
||||
} else
|
||||
common_vendor.index.showToast({
|
||||
title: res.message,
|
||||
icon: "none"
|
||||
});
|
||||
}).catch((error) => {
|
||||
});
|
||||
},
|
||||
@@ -433,6 +548,9 @@ const _sfc_main = {
|
||||
if (this.selectImportanceIndex > 0) {
|
||||
param.importance = this.importanceList[this.selectImportanceIndex].key;
|
||||
}
|
||||
if (this.selectSortKey) {
|
||||
param.sort = this.selectSortKey;
|
||||
}
|
||||
request_api.eventList(param).then((res) => {
|
||||
if (res.success) {
|
||||
if (this.page == 1) {
|
||||
@@ -442,6 +560,38 @@ const _sfc_main = {
|
||||
}
|
||||
}).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) => {
|
||||
if (res.code == 200) {
|
||||
if (this.page == 1) {
|
||||
this.eventList = res.data.events;
|
||||
} else
|
||||
this.eventList = this.eventList.concat(res.data.events);
|
||||
} else
|
||||
common_vendor.index.showToast({
|
||||
title: res.message,
|
||||
icon: "none"
|
||||
});
|
||||
}).catch((error) => {
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -470,87 +620,104 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
d: common_vendor.o(($event) => $options.clickTimeCategoryItem(index), index)
|
||||
};
|
||||
}),
|
||||
i: common_assets._imports_2,
|
||||
j: common_vendor.o(($event) => $options.clickSortItem()),
|
||||
k: common_assets._imports_3,
|
||||
i: common_assets._imports_2$1,
|
||||
j: common_vendor.o(($event) => $options.clickSort()),
|
||||
k: common_assets._imports_3$1,
|
||||
l: common_vendor.o(($event) => $options.clickScreenItem()),
|
||||
m: common_vendor.f($data.topCategoryList, (item, index, i0) => {
|
||||
m: common_vendor.f($data.stockCategoryList, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item),
|
||||
a: common_vendor.t(item.primary_sector),
|
||||
b: common_vendor.n("item relative " + ($data.selectTopCategory == index ? "select" : "")),
|
||||
c: index,
|
||||
d: common_vendor.o(($event) => $options.clickTopCategoryItem(index), index)
|
||||
d: common_vendor.o(($event) => $options.clickTopCategoryItem($event, index), index)
|
||||
};
|
||||
}),
|
||||
n: common_vendor.f($data.secondCategoryList, (item, index, i0) => {
|
||||
n: $data.topScrollLeft,
|
||||
o: $data.stockCategoryList.length > 0 && $data.stockCategoryList[$data.selectTopCategory].sub_sectors.length > 0
|
||||
}, $data.stockCategoryList.length > 0 && $data.stockCategoryList[$data.selectTopCategory].sub_sectors.length > 0 ? {
|
||||
p: common_vendor.f($data.stockCategoryList[$data.selectTopCategory].sub_sectors, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item),
|
||||
b: common_vendor.n("item " + ($data.selectSecondCategory == index ? "select" : "")),
|
||||
c: index,
|
||||
d: common_vendor.o(($event) => $options.clickSecondCategoryItem(index), index)
|
||||
d: common_vendor.o(($event) => $options.clickSecondCategoryItem($event, index), index)
|
||||
};
|
||||
}),
|
||||
o: common_vendor.s("top:" + $data.contentTop + "px"),
|
||||
p: common_vendor.f($data.eventList, (item, index, i0) => {
|
||||
q: $data.secondScrollLeft
|
||||
} : {}, {
|
||||
r: common_vendor.s("top:" + $data.contentTop + "px"),
|
||||
s: 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),
|
||||
c: common_vendor.t(item.title),
|
||||
d: common_vendor.t(item.description),
|
||||
e: $data.getRateUpOrDown(item.related_avg_chg)
|
||||
e: common_vendor.n("content " + (item.isExpand ? "" : "retract")),
|
||||
f: common_vendor.o(($event) => $options.clickExpandOrRetract(index), index),
|
||||
g: $data.getRateUpOrDown(item.related_avg_chg)
|
||||
}, $data.getRateUpOrDown(item.related_avg_chg) ? {
|
||||
f: common_assets._imports_4
|
||||
h: common_assets._imports_1$1
|
||||
} : {
|
||||
g: common_assets._imports_5
|
||||
i: common_assets._imports_2$2
|
||||
}, {
|
||||
h: common_vendor.t($data.getRateStr(item.related_avg_chg)),
|
||||
i: common_vendor.n("rateItem " + ($data.getRateUpOrDown(item.related_avg_chg) ? "down" : "up")),
|
||||
j: $data.getRateUpOrDown(item.related_max_chg)
|
||||
j: common_vendor.t($data.getRateStr(item.related_avg_chg)),
|
||||
k: common_vendor.n("rateItem " + ($data.getRateUpOrDown(item.related_avg_chg) ? "down" : "up")),
|
||||
l: $data.getRateUpOrDown(item.related_max_chg)
|
||||
}, $data.getRateUpOrDown(item.related_max_chg) ? {
|
||||
k: common_assets._imports_4
|
||||
m: common_assets._imports_1$1
|
||||
} : {
|
||||
l: common_assets._imports_5
|
||||
n: common_assets._imports_2$2
|
||||
}, {
|
||||
m: common_vendor.t($data.getRateStr(item.related_max_chg)),
|
||||
n: common_vendor.n("rateItem " + ($data.getRateUpOrDown(item.related_max_chg) ? "down" : "up")),
|
||||
o: $data.getRateUpOrDown(item.related_week_chg)
|
||||
o: common_vendor.t($data.getRateStr(item.related_max_chg)),
|
||||
p: common_vendor.n("rateItem " + ($data.getRateUpOrDown(item.related_max_chg) ? "down" : "up")),
|
||||
q: $data.getRateUpOrDown(item.related_week_chg)
|
||||
}, $data.getRateUpOrDown(item.related_week_chg) ? {
|
||||
p: common_assets._imports_4
|
||||
r: common_assets._imports_1$1
|
||||
} : {
|
||||
q: common_assets._imports_5
|
||||
s: common_assets._imports_2$2
|
||||
}, {
|
||||
r: common_vendor.t($data.getRateStr(item.related_week_chg)),
|
||||
s: common_vendor.n("rateItem " + ($data.getRateUpOrDown(item.related_week_chg) ? "down" : "up")),
|
||||
t: common_vendor.t($data.getLocaleTime(item.created_at)),
|
||||
v: common_vendor.t(item.view_count),
|
||||
w: common_vendor.t(item.post_count),
|
||||
x: common_vendor.t(item.follower_count),
|
||||
y: common_vendor.o(($event) => $options.clickEventItem(item.id), index),
|
||||
z: index
|
||||
t: common_vendor.t($data.getRateStr(item.related_week_chg)),
|
||||
v: common_vendor.n("rateItem " + ($data.getRateUpOrDown(item.related_week_chg) ? "down" : "up")),
|
||||
w: common_vendor.f(item.related_stocks, (sitem, sindex, i1) => {
|
||||
return {
|
||||
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)
|
||||
};
|
||||
}),
|
||||
x: common_vendor.t($data.getLocaleTime(item.created_at)),
|
||||
y: common_vendor.t(item.view_count),
|
||||
z: common_vendor.t(item.post_count),
|
||||
A: common_vendor.t(item.follower_count),
|
||||
B: common_vendor.o(($event) => $options.clickFollowEvent(item.id), index),
|
||||
C: common_vendor.o(($event) => $options.clickEventItem(item.id), index),
|
||||
D: index
|
||||
});
|
||||
}),
|
||||
q: common_assets._imports_1$1,
|
||||
r: common_assets._imports_2$1,
|
||||
s: common_assets._imports_3$1,
|
||||
t: common_vendor.s("top:" + $data.listTop + "px"),
|
||||
v: common_vendor.o(($event) => $options.loadMoreData()),
|
||||
w: common_assets._imports_9,
|
||||
x: common_vendor.f($data.sortList, (item, index, i0) => {
|
||||
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) => {
|
||||
return {
|
||||
a: item.icon,
|
||||
b: common_vendor.t(item.name),
|
||||
c: index
|
||||
c: index,
|
||||
d: common_vendor.o(($event) => $options.clickSortListItem(item), index)
|
||||
};
|
||||
}),
|
||||
y: common_vendor.s("margin-top:" + $data.sortListTop + "px;"),
|
||||
z: common_vendor.sr("sortPopup", "9dfd58d8-0"),
|
||||
A: common_vendor.p({
|
||||
B: common_vendor.s("margin-top:" + $data.sortListTop + "px;"),
|
||||
C: common_vendor.sr("sortPopup", "9dfd58d8-0"),
|
||||
D: common_vendor.p({
|
||||
type: "top",
|
||||
["mask-background-color"]: "transparent"
|
||||
}),
|
||||
B: common_assets._imports_2$2,
|
||||
C: common_vendor.s("height:" + $data.menuH + "px;"),
|
||||
D: common_vendor.f($data.screenCategoryList, (item, index, i0) => {
|
||||
E: common_assets._imports_2,
|
||||
F: common_vendor.s("height:" + $data.menuH + "px;"),
|
||||
G: common_vendor.f($data.screenCategoryList, (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item),
|
||||
b: $data.selectScreenCategory == index
|
||||
@@ -560,22 +727,22 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
e: common_vendor.o(($event) => $options.clickScreenCategoryItem(index), index)
|
||||
});
|
||||
}),
|
||||
E: $data.selectScreenCategory == 0
|
||||
H: $data.selectScreenCategory == 0
|
||||
}, $data.selectScreenCategory == 0 ? {
|
||||
F: common_vendor.t($data.startDate),
|
||||
G: common_vendor.t($data.endDate),
|
||||
H: common_assets._imports_11,
|
||||
I: common_vendor.o(($event) => $options.clickPreMonth()),
|
||||
J: common_vendor.t($data.selectMonth),
|
||||
K: common_assets._imports_12,
|
||||
L: common_vendor.o(($event) => $options.clickNextMonth()),
|
||||
M: common_vendor.f($data.weekList, (item, index, i0) => {
|
||||
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) => {
|
||||
return {
|
||||
a: common_vendor.t(item),
|
||||
b: index
|
||||
};
|
||||
}),
|
||||
N: common_vendor.f($data.monthDateList[$data.selectMonthIndex], (item, index, i0) => {
|
||||
Q: 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 ? {
|
||||
@@ -596,19 +763,22 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
});
|
||||
})
|
||||
} : {}, {
|
||||
O: $data.selectScreenCategory == 1
|
||||
R: $data.selectScreenCategory == 1
|
||||
}, $data.selectScreenCategory == 1 ? {
|
||||
P: common_vendor.f($data.industryTopCategoryList, (item, index, i0) => {
|
||||
S: common_vendor.f($data.industryTopCategoryList, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item),
|
||||
b: index
|
||||
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)
|
||||
};
|
||||
}),
|
||||
Q: common_assets._imports_1
|
||||
T: common_assets._imports_1,
|
||||
U: common_vendor.t($data.industryTopCategoryList[$data.selectIndustryTopCategory].classification_name)
|
||||
} : {}, {
|
||||
R: $data.selectScreenCategory == 2
|
||||
V: $data.selectScreenCategory == 2
|
||||
}, $data.selectScreenCategory == 2 ? {
|
||||
S: common_vendor.f($data.importanceList, (item, index, i0) => {
|
||||
W: common_vendor.f($data.importanceList, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.name),
|
||||
b: common_vendor.n("item " + ($data.selectImportanceIndex == index ? "select" : "")),
|
||||
@@ -617,11 +787,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
T: common_vendor.o(($event) => $options.clickCancel()),
|
||||
U: common_vendor.o(($event) => $options.clickCertain()),
|
||||
V: common_vendor.s("padding-top:" + $data.menuTop + "px;"),
|
||||
W: common_vendor.sr("screenPopup", "9dfd58d8-1"),
|
||||
X: common_vendor.p({
|
||||
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({
|
||||
type: "top"
|
||||
})
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -168,14 +168,17 @@
|
||||
}
|
||||
.eventListC .list .item .content {
|
||||
margin-top: 20rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #666;
|
||||
word-break: break-all;
|
||||
}
|
||||
.eventListC .list .item .content.retract {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 3;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #666;
|
||||
}
|
||||
.eventListC .list .item .increaseRateList {
|
||||
white-space: nowrap;
|
||||
@@ -207,6 +210,7 @@
|
||||
}
|
||||
.eventListC .list .item .stockList .stockItem {
|
||||
background-color: #F8F8F8;
|
||||
margin-right: 21rpx;
|
||||
display: inline-block;
|
||||
padding: 0 20rpx;
|
||||
line-height: 60rpx;
|
||||
@@ -215,6 +219,9 @@
|
||||
font-weight: bold;
|
||||
color: #222;
|
||||
}
|
||||
.eventListC .list .item .stockList .stockItem .change {
|
||||
color: #F97316;
|
||||
}
|
||||
.eventListC .list .item .timeToolBarC {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
@@ -430,6 +437,15 @@
|
||||
width: 30rpx;
|
||||
height: auto;
|
||||
}
|
||||
.screenPopup .screenContentC .industryList {
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
.screenPopup .screenContentC .industryList .list .topCategory {
|
||||
padding: 0 30rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #F97316;
|
||||
}
|
||||
.screenPopup .screenContentC .importanceList {
|
||||
margin-top: 16rpx;
|
||||
padding: 0 20rpx;
|
||||
|
||||
@@ -1,26 +1,256 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../common/vendor.js");
|
||||
const request_api = require("../../../request/api.js");
|
||||
const common_assets = require("../../../common/assets.js");
|
||||
const echarts = require("../../../uni_modules/lime-echart/static/echarts.min.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {};
|
||||
return {
|
||||
navH: common_vendor.inject("navHeight"),
|
||||
contentTop: "",
|
||||
navTitle: "",
|
||||
stockCode: "",
|
||||
//股票code
|
||||
categoryList: ["分钟线", "分时图", "日K线"],
|
||||
selectCategory: 0,
|
||||
option: {
|
||||
title: {
|
||||
show: false
|
||||
},
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
type: "cross"
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
grid: {
|
||||
left: "10%",
|
||||
right: "10%",
|
||||
bottom: "15%"
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
data: [],
|
||||
boundaryGap: false,
|
||||
axisLine: { onZero: false },
|
||||
splitLine: { show: false },
|
||||
min: "dataMin",
|
||||
max: "dataMax"
|
||||
},
|
||||
yAxis: {
|
||||
scale: true,
|
||||
splitArea: {
|
||||
show: true
|
||||
}
|
||||
},
|
||||
dataZoom: [
|
||||
{
|
||||
type: "inside",
|
||||
start: 50,
|
||||
end: 100
|
||||
},
|
||||
{
|
||||
show: true,
|
||||
type: "slider",
|
||||
top: "90%",
|
||||
start: 50,
|
||||
end: 100
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: "日K",
|
||||
type: "candlestick",
|
||||
data: [],
|
||||
itemStyle: {
|
||||
color: "#ec0000",
|
||||
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"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {}
|
||||
onLoad(e) {
|
||||
this.contentTop = this.navH + (60 + 10) / 750 * common_vendor.inject("windowWidth");
|
||||
if (e.code) {
|
||||
this.stockCode = e.code;
|
||||
this.getStockDetailsData();
|
||||
this.getStockCandlestickChartData();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async init() {
|
||||
const chart = await this.$refs.chartRef.init(echarts);
|
||||
chart.setOption(this.option);
|
||||
},
|
||||
/**
|
||||
* 点击切换分类
|
||||
* @param {Object} index
|
||||
*/
|
||||
clickCategoryItem(index) {
|
||||
if (this.selectCategory != index) {
|
||||
this.selectCategory = index;
|
||||
if (index == 0 || index == 2) {
|
||||
this.getStockCandlestickChartData();
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取股票详情数据
|
||||
*/
|
||||
getStockDetailsData() {
|
||||
let stockCode = this.stockCode;
|
||||
request_api.stockDetails(stockCode).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.navTitle = res.data.basic_info.stock_name + "(" + res.data.basic_info.stock_code + ")";
|
||||
} else
|
||||
common_vendor.index.showToast({
|
||||
title: res.message,
|
||||
icon: "none"
|
||||
});
|
||||
}).catch((error) => {
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取股票K线数据
|
||||
*/
|
||||
getStockCandlestickChartData() {
|
||||
let stockCode = this.stockCode;
|
||||
let param = { chart_type: "minute" };
|
||||
if (this.selectCategory == 2) {
|
||||
param.chart_type = "daily";
|
||||
}
|
||||
request_api.stockCandlestickChartData(stockCode, param).then((res) => {
|
||||
let data = res.data;
|
||||
let categoryData = [];
|
||||
for (let item of data) {
|
||||
categoryData.push(item.time);
|
||||
}
|
||||
this.option.xAxis.data = categoryData;
|
||||
this.init();
|
||||
}).catch((error) => {
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_navBar2 = common_vendor.resolveComponent("navBar");
|
||||
_easycom_navBar2();
|
||||
const _easycom_l_echart2 = common_vendor.resolveComponent("l-echart");
|
||||
(_easycom_navBar2 + _easycom_l_echart2)();
|
||||
}
|
||||
const _easycom_navBar = () => "../../../components/navBar/navBar.js";
|
||||
const _easycom_l_echart = () => "../../../uni_modules/lime-echart/components/l-echart/l-echart.js";
|
||||
if (!Math) {
|
||||
_easycom_navBar();
|
||||
(_easycom_navBar + _easycom_l_echart)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.p({
|
||||
leftText: "科锐国际(300662.SZ)"
|
||||
leftText: $data.navTitle
|
||||
}),
|
||||
b: common_assets._imports_0
|
||||
b: common_assets._imports_0,
|
||||
c: common_vendor.f($data.categoryList, (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item),
|
||||
b: $data.selectCategory == index
|
||||
}, $data.selectCategory == index ? {} : {}, {
|
||||
c: common_vendor.n("item relative " + ($data.selectCategory == index ? "select" : "")),
|
||||
d: index,
|
||||
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;")
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"usingComponents": {
|
||||
"nav-bar": "../../../components/navBar/navBar"
|
||||
"nav-bar": "../../../components/navBar/navBar",
|
||||
"l-echart": "../../../uni_modules/lime-echart/components/l-echart/l-echart"
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
<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>
|
||||
@@ -4,3 +4,48 @@
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.tabC {
|
||||
background-color: white;
|
||||
margin-top: 10rpx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
}
|
||||
.tabC .item {
|
||||
display: inline-block;
|
||||
padding: 0 30rpx;
|
||||
line-height: 60rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: #42485B;
|
||||
}
|
||||
.tabC .item.select {
|
||||
font-weight: bold;
|
||||
color: #F97316;
|
||||
}
|
||||
.tabC .item.select .line {
|
||||
background-color: #F97316;
|
||||
left: calc((100% - 50rpx)/2);
|
||||
bottom: 0;
|
||||
width: 50rpx;
|
||||
height: 2rpx;
|
||||
}
|
||||
.contentC {
|
||||
background-color: white;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
.contentC .section {
|
||||
padding: 0 28rpx;
|
||||
line-height: 80rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #222;
|
||||
}
|
||||
.contentC .des {
|
||||
padding: 0 30rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user