1.26 个股详情业务结构,发展历程模块完善

This commit is contained in:
尚政杰
2026-01-26 17:53:08 +08:00
parent f296e005b3
commit 67a673cd4d
508 changed files with 44334 additions and 305 deletions

View File

@@ -0,0 +1,604 @@
"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 {
menuTop: common_vendor.inject("menuTop"),
menuH: common_vendor.inject("menuHeight"),
navH: common_vendor.inject("navHeight"),
windowWidth: common_vendor.inject("windowWidth"),
contentTop: "",
keywords: "",
//搜索关键字
isRefreshing: false,
todayDate: "",
//今日日期
calendarDateList: [],
//日历日期
selectMonth: "",
//选中月份
selectMonthIndex: 0,
//选中月份下标
weekList: ["一", "二", "三", "四", "五", "六", "日"],
weekDateList: [],
//当前周日期
monthDateList: [],
//当前月日期
isExpand: false,
//是否展开日期
tabList: ["事件", "数据"],
selectTab: 0,
stockCategoryList: [],
selectTopCategory: 0,
listTop: "",
todayDate: "",
//今日日期
selectDate: "",
//选择查看的日期
progress: 75,
eventList: [],
//事件列表
dataList: [],
//数据列表
page: 1,
loadAll: false,
getLocaleHourMinute: utils_util.getLocaleHourMinute,
replaceAnswerLabel: utils_util.replaceAnswerLabel,
accMul: utils_util.accMul,
isData: false
//是否请求过数据了
};
},
onLoad() {
let date = /* @__PURE__ */ new Date();
this.contentTop = this.navH + (75 + 20) / 750 * common_vendor.inject("windowWidth");
let currentYear = date.getFullYear();
let currentMonth = date.getMonth() + 1;
let currentDay = date.getDate();
this.todayDate = this.selectDate = currentYear + "-" + (currentMonth > 9 ? currentMonth : "0" + currentMonth) + "-" + (currentDay > 9 ? currentDay : "0" + currentDay);
let week = date.getDay() || 7;
let diff = week - 1;
let daysOfWeek = [];
for (var i = 0; i < 7; i++) {
let newDate = /* @__PURE__ */ new Date();
newDate.setDate(currentDay - diff + i);
let newDay = newDate.getDate();
let date2 = currentYear + "-" + (currentMonth > 9 ? currentMonth : "0" + currentMonth) + "-" + (newDay > 9 ? newDay : "0" + newDay);
daysOfWeek.push({ date: date2, day: newDay, isToday: newDay == currentDay ? true : false });
}
this.weekDateList = daysOfWeek;
let calendarDateList = [];
this.selectMonthIndex = 20 * 12 + currentMonth - 1;
this.selectMonth = currentYear + "-" + (currentMonth > 9 ? currentMonth : "0" + currentMonth);
for (var i = currentYear - 20; i < currentYear + 20; i++) {
for (var j = 0; j < 12; j++) {
let date2 = new Date(i, j + 1, 0);
let firstDayOfMonth = new Date(i, j + 1, 0);
firstDayOfMonth.setDate(1);
let currentMonthDay = date2.getDate();
let firstDayWeek = firstDayOfMonth.getDay() || 7;
let daysOfMonth = [];
for (var k = 1; k <= currentMonthDay; k++) {
let newDate = new Date(i, j + 1, 0);
newDate.setDate(k);
let newMonth = newDate.getMonth() + 1;
let newDay = newDate.getDate();
let time = newDate.getTime();
let date3 = i + "-" + (newMonth > 9 ? newMonth : "0" + newMonth) + "-" + (newDay > 9 ? newDay : "0" + newDay);
daysOfMonth.push({ date: date3, year: i, month: newMonth, day: newDay, isToday: i == currentYear && newMonth == currentMonth && newDay == currentDay ? true : false, isCurrentMonth: true, timestamp: time });
}
for (var k = 0; k < firstDayWeek - 1; k++) {
let year = i;
let month = j;
if (j < 1) {
year = i - 1;
month = 12;
}
let lastMonthDay = new Date(year, month, 0).getDate();
let newDate = new Date(year, month - 1, lastMonthDay - k);
let newMonth = newDate.getMonth() + 1;
let newDay = newDate.getDate();
let time = newDate.getTime();
let date3 = year + "-" + (newMonth > 9 ? newMonth : "0" + newMonth) + "-" + (newDay > 9 ? newDay : "0" + newDay);
daysOfMonth.unshift({ date: date3, year, month: newMonth, day: newDay, isToday: false, isCurrentMonth: false, timestamp: time });
}
let nextMonthFirstDay = new Date(i, j + 1, 1);
let lastDayOfMonth = new Date(nextMonthFirstDay - 24 * 60 * 60 * 1e3);
let lastDayWeek = lastDayOfMonth.getDay() || 7;
for (var k = 1; k < 8 - lastDayWeek; k++) {
let year = i;
let month = j;
if (month > 11) {
month = 0;
year++;
}
let newDate = new Date(year, month + 1, k);
let newMonth = newDate.getMonth() + 1;
let newDay = newDate.getDate();
let time = newDate.getTime();
let date3 = year + "-" + (newMonth > 9 ? newMonth : "0" + newMonth) + "-" + (newDay > 9 ? newDay : "0" + newDay);
daysOfMonth.push({ date: date3, year, month: newMonth, day: newDay, isToday: false, isCurrentMonth: false, timestamp: time });
}
calendarDateList.push(daysOfMonth);
}
}
this.calendarDateList = calendarDateList;
this.monthDateList = calendarDateList[this.selectMonthIndex];
this.listTop = this.contentTop + (68 + 40 + 96 + 74 + 70 + 22) / 750 * common_vendor.inject("windowWidth");
Promise.all([this.getStockCategoryListData(), this.getCurrentMonthEventCountData()]).then((res) => {
this.getEventListData();
}).catch((error) => {
});
},
computed: {
circumference() {
return Math.PI * 100;
}
},
methods: {
reloadData() {
this.page = 1;
this.loadAll = false;
if (this.selectTab == 0) {
this.getEventListData();
} else
this.getDataListData();
},
pullDownRefresh() {
this.isRefreshing = true;
this.reloadData();
},
loadMoreData() {
if (!this.loadAll) {
this.page++;
if (this.selectTab == 0) {
this.getEventListData();
} else
this.getDataListData();
}
},
/**
* 点击搜索
*/
clickSearch() {
this.reloadData();
},
/**
* 点击选择月份
*/
clickSelectMonth() {
this.$refs["popup"].open();
},
/**
* 点击今日日期
*/
clickTodayDate() {
if (this.selectDate != this.todayDate) {
this.selectDate = this.todayDate;
let date = /* @__PURE__ */ new Date();
let currentMonth = date.getMonth() + 1;
this.selectMonthIndex = 20 * 12 + currentMonth - 1;
this.reloadData();
}
},
/**
* 点击展开或收起
*/
clickExpandOrRetract() {
this.isExpand = !this.isExpand;
if (this.isExpand) {
this.listTop = this.contentTop + (68 + 40 + 96 * 6 + 74 + 70 + 74 + 22) / 750 * this.windowWidth;
} else
this.listTop = this.contentTop + (68 + 40 + 96 + 74 + 70 + 74 + 22) / 750 * this.windowWidth;
},
/**
* 点击上个月
*/
clickPreMonth() {
if (this.selectMonthIndex > 0) {
this.selectMonthIndex--;
let monthList = this.calendarDateList[this.selectMonthIndex];
let month = "";
for (let item of monthList) {
if (item.isCurrentMonth) {
month = item.month;
break;
}
}
this.selectMonth = this.calendarDateList[this.selectMonthIndex][0].year + "-" + (month > 9 ? month : "0" + month);
}
},
/**
* 点击下个月
*/
clickNextMonth() {
if (this.selectMonthIndex < this.calendarDateList.length - 1) {
this.selectMonthIndex++;
let monthList = this.calendarDateList[this.selectMonthIndex];
let month = "";
for (let item of monthList) {
if (item.isCurrentMonth) {
month = item.month;
break;
}
}
this.selectMonth = this.calendarDateList[this.selectMonthIndex][0].year + "-" + (month > 9 ? month : "0" + month);
}
},
/**
* 选中日期
* @param {Object} item
*/
clickSelectDate(item) {
if (this.selectDate != item.date) {
this.selectDate = item.date;
this.reloadData();
}
},
/**
* 点击切换事件或者数据
*/
clickTabItem(index) {
if (this.selectTab != index) {
this.selectTab = index;
this.reloadData();
}
},
/**
* 选择一级分类
*/
clickTopCategoryItem(index) {
if (this.selectTopCategory != index) {
this.selectTopCategory = index;
this.reloadData();
}
},
/**
* 点击查看事件详情
*/
clickEventItem(id) {
common_vendor.index.navigateTo({
url: "/pages/invest/investDetails/investDetails?id=" + id
});
},
/**
* 获取股票分类
*/
getStockCategoryListData() {
return new Promise((resolve, reject) => {
request_api.stockCategoryList().then((res) => {
if (res.code == 200) {
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);
}
}).catch((error) => {
reject(1);
});
});
},
/**
* 获取事件列表数据
*/
getEventListData() {
let param = { start: this.selectDate, q: this.keywords, page: this.page };
if (this.selectTopCategory > 0) {
param.category = this.stockCategoryList[this.selectTopCategory].primary_sector;
}
request_api.calendarEventList(param).then((res) => {
this.isData = true;
this.isRefreshing = false;
if (res.code == 200) {
if (res.data.page == 1) {
this.eventList = res.data.events;
} else
this.eventList = this.eventList.concat(res.data.events);
if (res.data.page == res.data.total_pages) {
this.loadAll = true;
}
} else
common_vendor.index.showToast({
title: res.message,
icon: "none"
});
}).catch((error) => {
this.isRefreshing = false;
this.isData = true;
});
},
/**
* 获取事件列表数据
*/
getDataListData() {
let param = { start: this.selectDate, q: this.keywords, page: this.page };
if (this.selectTopCategory > 0) {
param.category = this.stockCategoryList[this.selectTopCategory].primary_sector;
}
request_api.calendarDataList(param).then((res) => {
this.isRefreshing = false;
if (res.code == 200) {
this.dataList = res.data.data_list;
} else
common_vendor.index.showToast({
title: res.message,
icon: "none"
});
}).catch((error) => {
this.isRefreshing = false;
});
},
/**
* 获取当前月份每一天的事件数量
*/
getCurrentMonthEventCountData() {
return new Promise((resolve, reject) => {
request_api.calendarEventCount().then((res) => {
for (let item of res) {
let date = item.start;
for (let s of this.weekDateList) {
if (s.date == date) {
s.eventCount = item.title;
s.className = item.className;
}
}
for (let s of this.monthDateList) {
if (s.date == date) {
s.eventCount = item.title;
s.className = item.className;
}
}
}
resolve(1);
}).catch((error) => {
reject(1);
});
});
}
}
};
if (!Array) {
const _easycom_navBar2 = common_vendor.resolveComponent("navBar");
const _easycom_ua_markdown2 = common_vendor.resolveComponent("ua-markdown");
const _easycom_zui_progress_circle2 = common_vendor.resolveComponent("zui-progress-circle");
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
(_easycom_navBar2 + _easycom_ua_markdown2 + _easycom_zui_progress_circle2 + _easycom_uni_popup2)();
}
const _easycom_navBar = () => "../../components/navBar/navBar.js";
const _easycom_ua_markdown = () => "../../components/ua-markdown/ua-markdown.js";
const _easycom_zui_progress_circle = () => "../../uni_modules/zui-progress-circle/components/zui-progress-circle/zui-progress-circle.js";
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
if (!Math) {
(_easycom_navBar + _easycom_ua_markdown + _easycom_zui_progress_circle + _easycom_uni_popup)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: common_assets._imports_0,
b: common_vendor.p({
leftText: "投资日历",
hideNavBg: true,
hideBack: true
}),
c: common_assets._imports_1,
d: common_vendor.o(($event) => $options.clickSearch()),
e: $data.keywords,
f: common_vendor.o(($event) => $data.keywords = $event.detail.value),
g: common_vendor.s("top:" + $data.navH + "px;"),
h: common_vendor.t($data.selectDate),
i: common_vendor.o(($event) => $options.clickSelectMonth()),
j: common_vendor.o(($event) => $options.clickTodayDate()),
k: common_vendor.f($data.weekList, (item, index, i0) => {
return {
a: common_vendor.t(item),
b: index
};
}),
l: $data.isExpand
}, $data.isExpand ? {
m: common_vendor.f($data.monthDateList, (item, index, i0) => {
return common_vendor.e({
a: item.className
}, item.className ? common_vendor.e({
b: item.className == "bg-gradient-danger"
}, item.className == "bg-gradient-danger" ? {
c: common_vendor.t(item.day),
d: common_vendor.t(item.eventCount),
e: common_vendor.n("item flexColumnCenter danger " + ($data.selectDate == item.date ? "select" : "")),
f: common_vendor.o(($event) => $options.clickSelectDate(item), index)
} : {}, {
g: item.className == "bg-gradient-warning"
}, item.className == "bg-gradient-warning" ? {
h: common_vendor.t(item.day),
i: common_vendor.t(item.eventCount),
j: common_vendor.n("item flexColumnCenter warning " + ($data.selectDate == item.date ? "select" : "")),
k: common_vendor.o(($event) => $options.clickSelectDate(item), index)
} : {}, {
l: item.className == "bg-gradient-info"
}, item.className == "bg-gradient-info" ? {
m: common_vendor.t(item.day),
n: common_vendor.t(item.eventCount),
o: common_vendor.n("item flexColumnCenter info " + ($data.selectDate == item.date ? "select" : "")),
p: common_vendor.o(($event) => $options.clickSelectDate(item), index)
} : {}, {
q: item.className == "bg-gradient-success"
}, item.className == "bg-gradient-success" ? {
r: common_vendor.t(item.day),
s: common_vendor.t(item.eventCount),
t: common_vendor.n("item flexColumnCenter success " + ($data.selectDate == item.date ? "select" : "")),
v: common_vendor.o(($event) => $options.clickSelectDate(item), index)
} : {}) : {
w: common_vendor.t(item.day),
x: common_vendor.n("date " + (item.isCurrentMonth ? "" : " notCurrentMonth"))
}, {
y: index
});
})
} : {
n: common_vendor.f($data.weekDateList, (item, index, i0) => {
return common_vendor.e({
a: item.className
}, item.className ? common_vendor.e({
b: item.className == "bg-gradient-danger"
}, item.className == "bg-gradient-danger" ? {
c: common_vendor.t(item.day),
d: common_vendor.t(item.eventCount),
e: common_vendor.n("item flex1 flexColumnCenter danger " + ($data.selectDate == item.date ? "select" : "")),
f: common_vendor.o(($event) => $options.clickSelectDate(item), index)
} : {}, {
g: item.className == "bg-gradient-warning"
}, item.className == "bg-gradient-warning" ? {
h: common_vendor.t(item.day),
i: common_vendor.t(item.eventCount),
j: common_vendor.n("item flex1 flexColumnCenter warning " + ($data.selectDate == item.date ? "select" : "")),
k: common_vendor.o(($event) => $options.clickSelectDate(item), index)
} : {}, {
l: item.className == "bg-gradient-info"
}, item.className == "bg-gradient-info" ? {
m: common_vendor.t(item.day),
n: common_vendor.t(item.eventCount),
o: common_vendor.n("item flex1 flexColumnCenter info " + ($data.selectDate == item.date ? "select" : "")),
p: common_vendor.o(($event) => $options.clickSelectDate(item), index)
} : {}, {
q: item.className == "bg-gradient-success"
}, item.className == "bg-gradient-success" ? {
r: common_vendor.t(item.day),
s: common_vendor.t(item.eventCount),
t: common_vendor.n("item flex1 flexColumnCenter success " + ($data.selectDate == item.date ? "select" : "")),
v: common_vendor.o(($event) => $options.clickSelectDate(item), index)
} : {}) : {
w: common_vendor.t(item.day),
x: common_vendor.t(item.className ? item.eventCount : ""),
y: common_vendor.o(($event) => $options.clickSelectDate(item), index)
}, {
z: index
});
})
}, {
o: common_vendor.t($data.isExpand ? "收起" : "展开"),
p: $data.isExpand
}, $data.isExpand ? {
q: common_assets._imports_2$2
} : {
r: common_assets._imports_4$1
}, {
s: common_vendor.o(($event) => $options.clickExpandOrRetract()),
t: common_vendor.f($data.tabList, (item, index, i0) => {
return {
a: common_vendor.t(item),
b: common_vendor.n("item " + ($data.selectTab == index ? "select" : "")),
c: index,
d: common_vendor.o(($event) => $options.clickTabItem(index), index)
};
}),
v: $data.selectTab == 0
}, $data.selectTab == 0 ? {
w: common_vendor.f($data.eventList, (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t($data.getLocaleHourMinute(item.start_time)),
b: common_vendor.f(5, (sitem, sindex, i1) => {
return {
a: sindex < item.category.star_rating ? "/static/icon/invest/star_s.png" : "/static/icon/invest/star.png"
};
}),
c: index,
d: common_vendor.t(item.category.event_type),
e: common_vendor.t(item.title),
f: "2cf1ca64-1-" + i0,
g: common_vendor.p({
source: $data.replaceAnswerLabel(item.description)
}),
h: item.related_concepts
}, item.related_concepts ? {
i: common_vendor.f(item.related_concepts, (citem, cindex, i1) => {
return {
a: common_vendor.t(citem.name),
b: common_vendor.t($data.accMul(citem.score, 100)),
c: "2cf1ca64-2-" + i0 + "-" + i1,
d: common_vendor.p({
position: citem.score,
range: [270, 630],
size: 26,
["ring-width"]: 2,
texture: ["#F3C368", "#E3E3E3"]
}),
e: cindex
};
})
} : {}, {
j: index,
k: common_vendor.o(($event) => $options.clickEventItem(item.id), index)
});
})
} : {}, {
x: $data.selectTab == 1
}, $data.selectTab == 1 ? {
y: common_vendor.f($data.dataList, (item, index, i0) => {
return {
a: common_vendor.t($data.getLocaleHourMinute(item.created_at)),
b: common_vendor.f(5, (sitem, sindex, i1) => {
return {
a: sindex < item.star ? "/static/icon/invest/star_s.png" : "/static/icon/invest/star.png"
};
}),
c: index,
d: common_vendor.t(item.title),
e: common_vendor.t(item.former),
f: common_vendor.t(item.forecast ? item.forecast : "--"),
g: common_vendor.t(item.fact ? item.fact : "--"),
h: index
};
})
} : {}, {
z: $data.isData && ($data.selectTab == 0 && $data.eventList.length == 0 || $data.selectTab == 1 && $data.dataList.length == 0)
}, $data.isData && ($data.selectTab == 0 && $data.eventList.length == 0 || $data.selectTab == 1 && $data.dataList.length == 0) ? {
A: common_assets._imports_4
} : {}, {
B: common_vendor.s("top:" + $data.contentTop + "px;"),
C: $data.isRefreshing,
D: common_vendor.o(($event) => $options.pullDownRefresh()),
E: common_vendor.o(($event) => $options.loadMoreData()),
F: common_assets._imports_5,
G: common_vendor.o(($event) => $options.clickPreMonth()),
H: common_vendor.t($data.selectMonth),
I: common_assets._imports_6,
J: common_vendor.o(($event) => $options.clickNextMonth()),
K: common_vendor.f($data.weekList, (item, index, i0) => {
return {
a: common_vendor.t(item),
b: index
};
}),
L: common_vendor.f($data.calendarDateList[$data.selectMonthIndex], (item, index, i0) => {
return common_vendor.e({
a: item.isToday || item.date == $data.selectDate
}, item.isToday || item.date == $data.selectDate ? {
b: common_vendor.t(item.day)
} : common_vendor.e({
c: !item.isCurrentMonth
}, !item.isCurrentMonth ? {
d: common_vendor.t(item.day)
} : {
e: common_vendor.t(item.day)
}), {
f: index,
g: common_vendor.o(($event) => $options.clickSelectDate(item), index)
});
}),
M: common_vendor.s("margin-top:" + $data.navH + "px;"),
N: common_vendor.sr("popup", "2cf1ca64-3"),
O: common_vendor.p({
type: "top"
})
});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/invest/invest.js.map

View File

@@ -0,0 +1,10 @@
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"usingComponents": {
"nav-bar": "../../components/navBar/navBar",
"ua-markdown": "../../components/ua-markdown/ua-markdown",
"zui-progress-circle": "../../uni_modules/zui-progress-circle/components/zui-progress-circle/zui-progress-circle",
"uni-popup": "../../uni_modules/uni-popup/components/uni-popup/uni-popup"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,491 @@
page {
background-color: #070707;
}
.topBg {
top: 0;
left: 0;
width: 100%;
height: auto;
}
.searchC {
background-color: #292929B3;
left: 0;
right: 0;
margin: 20rpx 25rpx 0;
padding: 0 25rpx;
height: 70rpx;
border: solid 1rpx #363636;
border-radius: 35rpx;
font-size: 22rpx;
font-weight: 500;
}
.searchC .icon {
margin-right: 16rpx;
width: 30rpx;
height: auto;
}
.searchC input {
height: 100%;
color: white;
}
.searchC .line {
background-color: #E1E1E1;
width: 1rpx;
height: 40rpx;
}
.searchC .search {
padding: 0 25rpx;
color: #F97316;
}
.contentC {
left: 0;
right: 0;
bottom: calc(55px + env(safe-area-inset-bottom));
margin-top: 20rpx;
overflow-y: scroll;
}
.contentC .calendarC {
background: linear-gradient(-30deg, #FFF6F0 0%, #FEFEFE 100%);
margin: 0 25rpx;
border-radius: 20rpx;
}
.contentC .calendarC .todayC {
padding: 12rpx 26rpx;
}
.contentC .calendarC .todayC .todayDateC {
font-size: 32rpx;
font-weight: bold;
color: #3D3D3D;
}
.contentC .calendarC .todayC .todayDateC .icon {
margin-left: 16rpx;
width: 30rpx;
height: auto;
}
.contentC .calendarC .todayC .today {
background-color: #F3C368;
width: 40rpx;
line-height: 40rpx;
border-radius: 50%;
font-size: 26rpx;
font-weight: 500;
color: #070707;
text-align: center;
}
.contentC .calendarC .weekList .item {
line-height: 40rpx;
font-size: 24rpx;
font-weight: 500;
color: #292621;
text-align: center;
}
.contentC .calendarC .weekDateList {
margin-top: 6rpx;
padding: 0 20rpx;
}
.contentC .calendarC .weekDateList .item {
margin-right: 16rpx;
padding: 10rpx 0 6rpx;
border-radius: 5rpx;
}
.contentC .calendarC .weekDateList .item .date {
font-size: 24rpx;
font-weight: bold;
color: #2A2A2A;
}
.contentC .calendarC .weekDateList .item .eventNum {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-top: 2rpx;
font-size: 18rpx;
font-weight: bold;
}
.contentC .calendarC .weekDateList .item:nth-child(7n) {
margin-right: 0;
}
.contentC .calendarC .weekDateList .item.select .date {
color: white;
}
.contentC .calendarC .weekDateList .item.danger {
background-color: #EB4A461A;
color: #EB4A46;
}
.contentC .calendarC .weekDateList .item.select.danger {
background-color: #EB4A46;
color: white;
}
.contentC .calendarC .weekDateList .item.warning {
background-color: #FD9A141A;
color: #FD9A14;
}
.contentC .calendarC .weekDateList .item.select.warning {
background-color: #FD9A14;
color: white;
}
.contentC .calendarC .weekDateList .item.info {
background-color: #16BBCF1A;
color: #16BBCF;
}
.contentC .calendarC .weekDateList .item.select.info {
background-color: #16BBCF;
color: white;
}
.contentC .calendarC .weekDateList .item.success {
background-color: #55AE591A;
color: #55AE59;
}
.contentC .calendarC .weekDateList .item.select.success {
background-color: #55AE59;
color: white;
}
.contentC .calendarC .monthDateList {
margin-top: 6rpx;
padding: 0 20rpx;
}
.contentC .calendarC .monthDateList .item {
margin: 0 16rpx 20rpx 0;
padding: 10rpx 0 6rpx;
width: calc((100% - 96rpx)/7);
border-radius: 5rpx;
}
.contentC .calendarC .monthDateList .item .date {
font-size: 26rpx;
font-weight: bold;
color: #2A2A2A;
}
.contentC .calendarC .monthDateList .item .date.notCurrentMonth {
color: #999;
}
.contentC .calendarC .monthDateList .item .eventNum {
margin-top: 2rpx;
font-size: 18rpx;
font-weight: bold;
}
.contentC .calendarC .monthDateList .item:nth-child(7n) {
margin-right: 0;
}
.contentC .calendarC .monthDateList .item.select .date {
color: white;
}
.contentC .calendarC .monthDateList .item.danger {
background-color: #EB4A461A;
color: #EB4A46;
}
.contentC .calendarC .monthDateList .item.select.danger {
background-color: #EB4A46;
color: white;
}
.contentC .calendarC .monthDateList .item.warning {
background-color: #FD9A141A;
color: #FD9A14;
}
.contentC .calendarC .monthDateList .item.select.warning {
background-color: #FD9A14;
color: white;
}
.contentC .calendarC .monthDateList .item.info {
background-color: #16BBCF1A;
color: #16BBCF;
}
.contentC .calendarC .monthDateList .item.select.info {
background-color: #16BBCF;
color: white;
}
.contentC .calendarC .monthDateList .item.success {
background-color: #55AE591A;
color: #55AE59;
}
.contentC .calendarC .monthDateList .item.select.success {
background-color: #55AE59;
color: white;
}
.contentC .calendarC .expandBgC {
margin: 0 25rpx;
border-bottom: solid 1rpx #E4E4E4;
}
.contentC .calendarC .expandBgC .expandC {
padding: 20rpx 0;
font-size: 22rpx;
font-weight: 500;
color: #8A857C;
}
.contentC .calendarC .expandBgC .expandC .arrow {
margin-left: 7rpx;
width: 15rpx;
height: auto;
}
.contentC .tabC {
margin-top: 10rpx;
}
.contentC .tabC .item {
display: inline-block;
padding: 0 27rpx;
line-height: 70rpx;
font-size: 32rpx;
color: #CCCDD1;
}
.contentC .tabC .item.select {
color: #F3C368;
}
.contentC .topCategoryC {
white-space: nowrap;
}
.contentC .topCategoryC .item {
display: inline-block;
line-height: 72rpx;
padding: 0 28rpx;
font-size: 27rpx;
font-weight: 500;
color: #939393;
}
.contentC .topCategoryC .item.select {
font-weight: bold;
color: #F3C368;
}
.contentC .topCategoryC .item.select .line {
background-color: #F3C368;
left: calc((100% - 50rpx)/2);
width: 50rpx;
height: 2rpx;
bottom: 0;
}
.eventList {
padding: 18rpx 25rpx;
}
.eventList .item {
background: linear-gradient(-30deg, #FFF6F0 0%, #FEFEFE 100%);
margin-bottom: 20rpx;
padding: 30rpx 20rpx;
border-radius: 10rpx;
}
.eventList .item .timeStarFollowC .time {
margin-right: 22rpx;
font-size: 24rpx;
font-weight: bold;
color: #767676;
}
.eventList .item .timeStarFollowC .starC .starList {
top: 0;
left: 0;
}
.eventList .item .timeStarFollowC .starC .icon {
margin-right: 9rpx;
width: 27rpx;
height: auto;
}
.eventList .item .timeStarFollowC .follow {
background-color: #3D3D3D;
width: 90rpx;
line-height: 40rpx;
border-radius: 20rpx;
font-size: 22rpx;
font-weight: 500;
color: #F2C367;
text-align: center;
}
.eventList .item .timeStarFollowC .follow.select {
background-color: #F3C368;
color: #3D3D3D;
}
.eventList .item .categoryTitleC {
margin-top: 18rpx;
}
.eventList .item .categoryTitleC .category {
background-color: #F3C368;
margin-right: 12rpx;
padding: 0 12rpx;
line-height: 40rpx;
border-radius: 8rpx;
font-size: 24rpx;
font-weight: bold;
color: #070707;
}
.eventList .item .categoryTitleC .title {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 28rpx;
font-weight: bold;
color: #3D3D3D;
}
.eventList .item .labelC {
margin-top: 12rpx;
}
.eventList .item .labelC .label {
display: inline-block;
margin-right: 10rpx;
padding: 0 10rpx;
line-height: 30rpx;
font-size: 20rpx;
font-weight: 500;
border-radius: 5rpx;
border: solid 1rpx #333;
}
.eventList .item .content {
margin-top: 20rpx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
text-overflow: ellipsis;
overflow: hidden;
font-size: 24rpx;
font-weight: 500;
color: #71675D;
}
.eventList .item .percentList {
white-space: nowrap;
margin-top: 26rpx;
}
.eventList .item .percentList .percentItem {
display: inline-flex;
align-items: center;
background-color: white;
box-shadow: 0 7rpx 18rpx 0 rgba(217, 217, 217, 0.28);
margin-right: 20rpx;
padding: 0 20rpx;
height: 70rpx;
border-radius: 10rpx;
font-size: 26rpx;
font-weight: bold;
color: #222;
}
.eventList .item .percentList .percentItem zui-progress-circle {
margin-left: 20rpx;
}
.eventList .item .percentList .percentItem .num {
width: 23px;
line-height: 23px;
font-size: 17rpx;
font-weight: bold;
color: #999;
text-align: center;
}
.eventList .item .percentList .percentItem:last-child {
margin-right: 0;
}
.dataList {
padding: 0 25rpx;
}
.dataList .item {
padding: 30rpx 0;
border-bottom: solid 1rpx #E4E4E4;
}
.dataList .item .time {
font-size: 24rpx;
font-weight: bold;
color: #767676;
}
.dataList .item .starC .starList {
top: 0;
left: 0;
}
.dataList .item .starC .icon {
margin-right: 9rpx;
width: 27rpx;
height: auto;
}
.dataList .item .title {
margin-top: 16rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 30rpx;
font-weight: bold;
color: #222;
}
.dataList .item .valueList {
margin-top: 20rpx;
font-size: 26rpx;
font-weight: 500;
color: #666;
}
.noDataC {
margin-top: 200rpx;
font-weight: 500;
}
.noDataC .icon {
width: 412rpx;
height: auto;
}
.noDataC .title {
margin-top: 8rpx;
font-size: 32rpx;
color: #939393;
}
.noDataC .subtitle {
margin-top: 16rpx;
font-size: 26rpx;
color: #646464;
}
.popup {
background-color: white;
padding: 30rpx 0;
}
.popup .yearMonthC {
padding: 0 30rpx;
}
.popup .yearMonthC .yearMonth {
text-align: center;
font-size: 24rpx;
}
.popup .yearMonthC .btn {
background-color: #f8f8f8;
width: 40rpx;
height: 40rpx;
border-radius: 50%;
}
.popup .yearMonthC .btn .icon {
display: block;
width: 24rpx;
height: auto;
}
.popup .weekList {
margin-top: 20rpx;
padding: 0 30rpx;
}
.popup .weekList .item {
line-height: 40rpx;
font-size: 24rpx;
color: #a1a1a1;
text-align: center;
}
.popup .monthDateList {
padding: 0 30rpx;
}
.popup .monthDateList .item {
margin-bottom: 10rpx;
width: calc(100%/7);
}
.popup .monthDateList .item .date {
background-color: #f8f8f8;
width: calc(100% - 10rpx);
line-height: 64rpx;
border-radius: 15rpx;
font-size: 24rpx;
font-weight: bold;
color: #333;
text-align: center;
}
.popup .monthDateList .item .date.today {
background-color: #FF7E1A;
color: white;
}
.popup .monthDateList .item .date.inRange {
background-color: #FFF2EB;
}
.popup .monthDateList .item .date.notCurrentMonth {
background-color: #fdfdfd;
color: #c3c3c3;
}
.popup .monthDateList .item .eventNum {
margin-top: 12rpx;
width: 80rpx;
height: 30rpx;
line-height: 30rpx;
border-radius: 5rpx;
font-size: 16rpx;
font-weight: 500;
color: white;
text-align: center;
}

View File

@@ -0,0 +1,203 @@
"use strict";
const common_vendor = require("../../../common/vendor.js");
const request_api = require("../../../request/api.js");
const utils_util = require("../../../utils/util.js");
const common_assets = require("../../../common/assets.js");
const _sfc_main = {
data() {
return {
navH: common_vendor.inject("navHeight"),
eventId: "",
//事件id
contentTop: "",
investDetails: null,
former: "",
//背景
categoryList: ["背景", "推演", "相关股票"],
selectCategory: 0,
stockCategoryList: [
{
title: "全部股票",
num: 0,
bgColor: "#D82A2A",
color: "white"
},
{
title: "大周期",
num: 0,
bgColor: "#3A5D9C",
color: "white"
},
{
title: "TMT板块",
num: 0,
bgColor: "#FFBF00",
color: "white"
},
{
title: "大金融地产",
num: 0,
bgColor: "#FFF4D3"
},
{
title: "大消费",
num: 0,
bgColor: "#CDEEEE"
},
{
title: "公共产业板块",
num: 0,
bgColor: "#DEEBF7"
}
],
accMul: utils_util.accMul
};
},
onLoad(e) {
this.contentTop = this.navH + (30 + 72) / 750 * common_vendor.inject("windowWidth");
if (e.id) {
this.eventId = e.id;
this.getEventDetailsData();
}
},
methods: {
/**
* 点击切换栏目
*/
clickCategoryItem(index) {
if (this.selectCategory != index) {
this.selectCategory = index;
}
},
/**
* 点击相关股票
* @param {Object} item 股票数据
*/
clickLookRelatedStockItem(item) {
common_vendor.index.navigateTo({
url: "/pages/index/stockDetails/stockDetails?type=2&code=" + item.code + "&des=" + item.description + "&name=" + item.name
});
},
/**
* 获取事件详情数据
*/
getEventDetailsData() {
request_api.investEventDetails(this.eventId).then((res) => {
if (res.code == 200) {
let detail = res.data.detail;
for (let item of this.stockCategoryList) {
item.num = detail.sector_stats[item.title];
}
this.investDetails = detail;
this.former = detail.former.replace("<answer>", "").replace("</answer>", "");
} else
common_vendor.index.showToast({
title: res.message,
icon: "none"
});
}).catch((error) => {
});
}
}
};
if (!Array) {
const _easycom_navBar2 = common_vendor.resolveComponent("navBar");
const _easycom_ua_markdown2 = common_vendor.resolveComponent("ua-markdown");
(_easycom_navBar2 + _easycom_ua_markdown2)();
}
const _easycom_navBar = () => "../../../components/navBar/navBar.js";
const _easycom_ua_markdown = () => "../../../components/ua-markdown/ua-markdown.js";
if (!Math) {
(_easycom_navBar + _easycom_ua_markdown)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: common_vendor.p({
leftText: "事件详情",
hideNavBg: true
}),
b: common_assets._imports_0,
c: common_vendor.f($data.categoryList, (item, index, i0) => {
return {
a: common_vendor.t(item),
b: common_vendor.n("item relative " + ($data.selectCategory == index ? "select" : "")),
c: index,
d: common_vendor.o(($event) => $options.clickCategoryItem(index), index)
};
}),
d: common_vendor.s("top:" + $data.navH + "px;"),
e: $data.investDetails
}, $data.investDetails ? common_vendor.e({
f: $data.selectCategory == 0
}, $data.selectCategory == 0 ? {
g: common_vendor.p({
source: $data.former
})
} : {}, {
h: $data.selectCategory == 1
}, $data.selectCategory == 1 ? {
i: common_vendor.p({
source: $data.investDetails.forecast
})
} : {}, {
j: $data.selectCategory == 2
}, $data.selectCategory == 2 ? {
k: common_vendor.f($data.stockCategoryList, (item, index, i0) => {
return {
a: common_vendor.t(item.num),
b: common_vendor.t(item.title),
c: common_vendor.s("background-color:" + item.bgColor + ";color:" + item.color + ";"),
d: index
};
}),
l: common_vendor.f($data.investDetails.related_stocks, (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item.code + " " + item.name),
b: common_vendor.t(item.score),
c: item.sw_primary_sector
}, item.sw_primary_sector ? {
d: common_vendor.t(item.sw_primary_sector)
} : {}, {
e: common_vendor.t(item.description),
f: index,
g: common_vendor.o(($event) => $options.clickLookRelatedStockItem(item), index)
});
})
} : {}, {
m: $data.selectCategory == 3
}, $data.selectCategory == 3 ? {
n: common_vendor.f(_ctx.conceptList, (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item.concept),
b: item.price_info
}, item.price_info ? {
c: common_vendor.t(_ctx.getChgRateStr(item.price_info.avg_change_pct)),
d: common_vendor.n("chg " + (_ctx.getRateUpOrDown(item.price_info.avg_change_pct) ? "down" : "up"))
} : {}, {
e: item.price_info
}, item.price_info ? {
f: common_vendor.t(item.stock_count),
g: common_vendor.n("stockNum " + (_ctx.getRateUpOrDown(item.price_info.avg_change_pct) ? "down" : "up"))
} : {}, {
h: common_vendor.t(item.description),
i: common_vendor.f(item.stocks.slice(0, 3), (sitem, sindex, i1) => {
return {
a: common_vendor.t(sitem.stock_name),
b: sindex
};
}),
j: common_vendor.t(item.stock_count - 3),
k: common_vendor.o(($event) => _ctx.clickStockMore(item), index),
l: common_vendor.t(item.price_info ? item.price_info.trade_date : ""),
m: common_vendor.o(($event) => _ctx.clickHistoricalTimeline(item), index),
n: index
});
}),
o: common_assets._imports_1$3
} : {}, {
p: common_vendor.s("top:" + $data.contentTop + "px;")
}) : {});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/invest/investDetails/investDetails.js.map

View File

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

View File

@@ -0,0 +1 @@
<view><nav-bar wx:if="{{a}}" u-i="b7e6c0fc-0" bind:__l="__l" u-p="{{a}}"></nav-bar><image class="topBg absolute" src="{{b}}" mode="widthFix"></image><view class="categoryC fixed" style="{{d}}"><view wx:for="{{c}}" wx:for-item="item" wx:key="c" class="{{item.b}}" bindtap="{{item.d}}">{{item.a}}</view></view><view wx:if="{{e}}" class="contentC fixed" style="{{p}}"><view wx:if="{{f}}" class="former"><ua-markdown wx:if="{{g}}" u-i="b7e6c0fc-1" bind:__l="__l" u-p="{{g}}"/><text class="ai">AI合成</text></view><view wx:if="{{h}}" class="former"><ua-markdown wx:if="{{i}}" u-i="b7e6c0fc-2" bind:__l="__l" u-p="{{i}}"/></view><view wx:if="{{j}}" class="stockC"><view class="stockCategoryList flexWrap"><view wx:for="{{k}}" wx:for-item="item" wx:key="d" class="item flexColumnCenter" style="{{item.c}}"><view class="num">{{item.a}}</view><view class="title">{{item.b}}</view></view></view><view class="stockList"><view wx:for="{{l}}" wx:for-item="item" wx:key="f" class="item" bindtap="{{item.g}}"><view class="titleCorrelationC flex"><view class="title flex1">{{item.a}}</view><view class="correlation">相关度: {{item.b}}%</view></view><view wx:if="{{item.c}}" class="category">{{item.d}}</view><view class="content">{{item.e}}</view></view></view></view><view wx:if="{{m}}"><view class="conceptList"><view wx:for="{{n}}" wx:for-item="item" wx:key="n" class="item"><view class="titleChgStockNumC flex"><view class="title">{{item.a}}</view><view wx:if="{{item.b}}" class="{{item.d}}">{{item.c}}%</view><view wx:if="{{item.e}}" class="{{item.g}}">{{item.f}} 只股票</view></view><view class="content">{{item.h}}</view><view class="hotStockC flex"><view class="title">热门个股</view><view class="stockList flex"><view wx:for="{{item.i}}" wx:for-item="sitem" wx:key="b" class="stockItem">{{sitem.a}}</view><view class="more" bindtap="{{item.k}}">+{{item.j}}更多</view></view></view><view class="transactionDateHistoryTimeC flex"><view class="transactionDate flex1">交易时间:{{item.l}}</view><view class="historyTimeC flex" bindtap="{{item.m}}"><image class="icon" src="{{o}}" mode="widthFix"></image><view>历史时间轴</view></view></view></view></view></view></view></view>

View File

@@ -0,0 +1,222 @@
page {
background-color: #070707;
}
.topBg {
top: 0;
left: 0;
width: 100%;
height: auto;
}
.categoryC {
margin-top: 10rpx;
padding: 20rpx 10rpx 0;
left: 0;
right: 0;
border-radius: 20rpx 20rpx 0 0;
}
.categoryC .item {
display: inline-block;
padding: 0 30rpx;
line-height: 76rpx;
font-size: 27rpx;
font-weight: 500;
color: #939393;
}
.categoryC .item.select {
font-weight: bold;
color: #F3C368;
}
.contentC {
background: linear-gradient(-30deg, #FFF6F0 0%, #FEFEFE 100%);
left: 0;
right: 0;
bottom: env(safe-area-inset-bottom);
margin: 0 25rpx;
border-radius: 10rpx;
overflow-y: scroll;
}
.contentC .former {
padding: 40rpx 25rpx;
}
.contentC .former .ai {
font-size: 28rpx;
color: #C00000;
}
.contentC .stockCategoryList {
margin-top: 30rpx;
padding: 0 20rpx;
}
.contentC .stockCategoryList .item {
margin: 0 30rpx 20rpx 0;
width: calc((100% - 60rpx)/3);
height: 100rpx;
border-radius: 10rpx;
}
.contentC .stockCategoryList .item .num {
font-size: 36rpx;
font-weight: bold;
}
.contentC .stockCategoryList .item .title {
font-size: 24rpx;
font-weight: 500;
}
.contentC .stockCategoryList .item:nth-child(3n) {
margin-right: 0;
}
.contentC .stockList {
padding: 22rpx 25rpx 30rpx;
}
.contentC .stockList .item {
padding: 22rpx 0 30rpx;
border-bottom: solid 1rpx #E4E4E4;
}
.contentC .stockList .item .title {
font-size: 30rpx;
font-weight: bold;
color: #222;
}
.contentC .stockList .item .correlation {
background-color: #F973161A;
padding: 0 13rpx;
line-height: 40rpx;
border-radius: 5rpx;
font-size: 24rpx;
font-weight: 500;
color: #F97316;
}
.contentC .stockList .item .category {
display: inline-block;
padding: 0 10rpx;
line-height: 28rpx;
border: solid 1rpx #F6604A;
font-size: 20rpx;
font-weight: 500;
color: #F6604A;
border-radius: 5rpx;
}
.contentC .stockList .item .content {
margin-top: 18rpx;
font-size: 24rpx;
font-weight: 500;
color: #666;
line-height: 1.2rem;
}
.contentC .conceptList {
padding: 30rpx 25rpx;
}
.contentC .conceptList .item {
background: linear-gradient(-30deg, #FFF6F0 0%, #FEFEFE 100%);
margin-bottom: 24rpx;
border-radius: 10rpx;
}
.contentC .conceptList .item .titleChgStockNumC {
padding: 24rpx 18rpx 0;
}
.contentC .conceptList .item .titleChgStockNumC .title {
margin-right: 20rpx;
font-size: 30rpx;
font-weight: bold;
color: #3D3D3D;
}
.contentC .conceptList .item .titleChgStockNumC .chg {
margin-right: 20rpx;
padding: 0 13rpx;
line-height: 40rpx;
border-radius: 20rpx;
font-size: 22rpx;
font-weight: bold;
color: white;
}
.contentC .conceptList .item .titleChgStockNumC .chg.up {
background-color: #EC3440;
}
.contentC .conceptList .item .titleChgStockNumC .chg.down {
background-color: #355422;
}
.contentC .conceptList .item .titleChgStockNumC .stockNum {
padding: 0 16rpx;
line-height: 36rpx;
border-radius: 20rpx;
font-size: 22rpx;
font-weight: bold;
}
.contentC .conceptList .item .titleChgStockNumC .stockNum.up {
color: #EC3440;
border: solid 2rpx #EC3440;
}
.contentC .conceptList .item .titleChgStockNumC .stockNum.down {
color: #355422;
border: solid 2rpx #355422;
}
.contentC .conceptList .item .content {
margin-top: 26rpx;
padding: 0 22rpx;
font-size: 24rpx;
font-weight: 500;
color: #71675D;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
}
.contentC .conceptList .item .hotStockC {
margin-top: 30rpx;
padding: 0 20rpx;
}
.contentC .conceptList .item .hotStockC .title {
margin-right: 10rpx;
font-size: 24rpx;
font-weight: bold;
color: #936E5C;
}
.contentC .conceptList .item .hotStockC .stockList {
font-size: 22rpx;
}
.contentC .conceptList .item .hotStockC .stockList .stockItem {
background-color: #3D3D3D;
margin-right: 10rpx;
padding: 0 8rpx;
line-height: 36rpx;
border-radius: 5rpx 20rpx 5rpx 20rpx;
color: #EFDDD1;
}
.contentC .conceptList .item .hotStockC .stockList .more {
color: #936E5C;
line-height: 36rpx;
}
.contentC .conceptList .item .hotStockC .notVipC {
background-color: #3D3D3D;
padding: 0 21rpx 0 16rpx;
line-height: 36rpx;
border-radius: 5rpx;
font-size: 22rpx;
color: #F3C368;
}
.contentC .conceptList .item .hotStockC .notVipC .icon {
margin-right: 9rpx;
width: 15rpx;
height: auto;
}
.contentC .conceptList .item .transactionDateHistoryTimeC {
padding: 20rpx 22rpx 30rpx;
}
.contentC .conceptList .item .transactionDateHistoryTimeC .transactionDate {
font-size: 20rpx;
font-weight: 500;
color: #666;
}
.contentC .conceptList .item .transactionDateHistoryTimeC .historyTimeC {
background-color: #F3C368;
padding: 0 10rpx 0 15rpx;
line-height: 36rpx;
border-radius: 10rpx;
font-size: 22rpx;
font-weight: 500;
color: #101213;
}
.contentC .conceptList .item .transactionDateHistoryTimeC .historyTimeC .icon {
margin-right: 7rpx;
width: 20rpx;
height: auto;
}