8.28 修改事件详情相关概念模块样式,增加股票详情信息来源展示

This commit is contained in:
尚政杰
2025-08-28 17:42:22 +08:00
parent 58b3414bdd
commit bf2388c3ec
403 changed files with 19843 additions and 1602 deletions

View File

@@ -11,8 +11,16 @@ const _sfc_main = {
navH: common_vendor.inject("navHeight"),
windowWidth: common_vendor.inject("windowWidth"),
contentTop: "",
keywords: "",
//搜索关键字
todayDate: "",
//今日日期
calendarDateList: [],
//日历日期
selectMonth: "",
//选中月份
selectMonthIndex: 0,
//选中月份下标
weekList: ["一", "二", "三", "四", "五", "六", "日"],
weekDateList: [],
//当前周日期
@@ -34,66 +42,95 @@ const _sfc_main = {
//事件列表
dataList: [],
//数据列表
getLocaleHourMinute: utils_util.getLocaleHourMinute
page: 1,
loadAll: false,
getLocaleHourMinute: utils_util.getLocaleHourMinute,
replaceAnswerLabel: utils_util.replaceAnswerLabel
};
},
onLoad() {
let date = /* @__PURE__ */ new Date();
this.contentTop = this.navH + (75 + 20) / 750 * common_vendor.inject("windowWidth");
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
this.todayDate = this.selectDate = date.getFullYear() + "-" + (month > 9 ? month : "0" + month) + "-" + (day > 9 ? day : "0" + day);
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(day - diff + i);
newDate.setDate(currentDay - diff + i);
let newDay = newDate.getDate();
let date2 = year + "-" + (month > 9 ? month : "0" + month) + "-" + (newDay > 9 ? newDay : "0" + newDay);
daysOfWeek.push({ date: date2, day: newDay, isToday: newDay == day ? true : false });
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 firstDayOfMonth = /* @__PURE__ */ new Date();
firstDayOfMonth.setDate(1);
let currentMonthDay = new Date(year, month, 0).getDate();
let firstDayWeek = firstDayOfMonth.getDay() || 7;
let daysOfMonth = [];
for (var i = 1; i <= currentMonthDay; i++) {
let newDate = /* @__PURE__ */ new Date();
newDate.setDate(i);
let newDay = newDate.getDate();
let date2 = year + "-" + (month > 9 ? month : "0" + month) + "-" + (newDay > 9 ? newDay : "0" + newDay);
daysOfMonth.push({ date: date2, day: newDay, isToday: newDay == day ? true : false, isCurrentMonth: true });
}
for (var i = 0; i < firstDayWeek - 1; i++) {
let lastMonthDay = new Date(year, month - 1, 0).getDate();
let newDate = new Date(year, month - 2, lastMonthDay - i);
let newMonth = newDate.getMonth() + 1;
let newDay = newDate.getDate();
let date2 = year + "-" + (newMonth > 9 ? newMonth : "0" + newMonth) + "-" + (newDay > 9 ? newDay : "0" + newDay);
daysOfMonth.unshift({ date: date2, day: newDay, isToday: false, isCurrentMonth: false });
}
let nextMonthFirstDay = new Date(year, month, 1);
let lastDayOfMonth = new Date(nextMonthFirstDay - 24 * 60 * 60 * 1e3);
let lastDayWeek = lastDayOfMonth.getDay() || 7;
for (var i = 1; i < 8 - lastDayWeek; i++) {
if (month > 11) {
month = -1;
year++;
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);
}
let newDate = new Date(year, month + 1, i);
let newMonth = newDate.getMonth() + 1;
let newDay = newDate.getDate();
let date2 = year + "-" + (newMonth > 9 ? newMonth : "0" + newMonth) + "-" + (newDay > 9 ? newDay : "0" + newDay);
daysOfMonth.push({ date: date2, day: newDay, isToday: false, isCurrentMonth: false });
}
this.monthDateList = daysOfMonth;
this.calendarDateList = calendarDateList;
this.monthDateList = calendarDateList[this.selectMonthIndex];
this.listTop = this.contentTop + (68 + 40 + 96 + 74 + 70 + 74 + 22) / 750 * common_vendor.inject("windowWidth");
this.getStockCategoryListData();
this.getEventListData();
this.getCurrentMonthEventCountData();
Promise.all([this.getStockCategoryListData(), this.getCurrentMonthEventCountData()]).then((res) => {
this.getEventListData();
}).catch((error) => {
});
},
onPullDownRefresh() {
this.reloadData();
},
computed: {
circumference() {
@@ -101,16 +138,45 @@ const _sfc_main = {
}
},
methods: {
reloadData() {
this.page = 1;
this.loadAll = false;
if (this.selectTab == 0) {
this.getEventListData();
} else
this.getDataListData();
},
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;
if (this.selectTab == 0) {
this.getEventListData();
} else
this.getDataListData();
let date = /* @__PURE__ */ new Date();
let currentMonth = date.getMonth() + 1;
this.selectMonthIndex = 20 * 12 + currentMonth - 1;
this.reloadData();
}
},
/**
@@ -123,6 +189,40 @@ const _sfc_main = {
} 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
@@ -130,10 +230,7 @@ const _sfc_main = {
clickSelectDate(item) {
if (this.selectDate != item.date) {
this.selectDate = item.date;
if (this.selectTab == 0) {
this.getEventListData();
} else
this.getDataListData();
this.reloadData();
}
},
/**
@@ -142,10 +239,7 @@ const _sfc_main = {
clickTabItem(index) {
if (this.selectTab != index) {
this.selectTab = index;
if (this.selectTab == 0) {
this.getEventListData();
} else
this.getDataListData();
this.reloadData();
}
},
/**
@@ -154,10 +248,7 @@ const _sfc_main = {
clickTopCategoryItem(index) {
if (this.selectTopCategory != index) {
this.selectTopCategory = index;
if (this.selectTab == 0) {
this.getEventListData();
} else
this.getDataListData();
this.reloadData();
}
},
/**
@@ -172,42 +263,59 @@ const _sfc_main = {
* 获取股票分类
*/
getStockCategoryListData() {
request_api.stockCategoryList().then((res) => {
if (res.code == 200) {
res.data.unshift({ primary_sector: "全部", sub_sectors: [] });
this.stockCategoryList = res.data;
} else
common_vendor.index.showToast({
title: res.message,
icon: "none"
});
}).catch((error) => {
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 };
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) => {
common_vendor.index.stopPullDownRefresh();
if (res.code == 200) {
this.eventList = res.data.events;
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) => {
common_vendor.index.stopPullDownRefresh();
});
},
/**
* 获取事件列表数据
*/
getDataListData() {
let param = { start: this.selectDate };
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) => {
if (res.code == 200) {
this.dataList = res.data.data_list;
@@ -217,60 +325,72 @@ const _sfc_main = {
icon: "none"
});
}).catch((error) => {
common_vendor.index.stopPullDownRefresh();
});
},
/**
* 获取当前月份每一天的事件数量
*/
getCurrentMonthEventCountData() {
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;
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;
}
}
}
for (let s of this.monthDateList) {
if (s.date == date) {
s.eventCount = item.title;
s.className = item.className;
}
}
}
}).catch((error) => {
resolve(1);
}).catch((error) => {
reject(1);
});
});
}
}
};
if (!Array) {
const _easycom_ua_markdown2 = common_vendor.resolveComponent("ua-markdown");
const _easycom_zui_progress_circle2 = common_vendor.resolveComponent("zui-progress-circle");
_easycom_zui_progress_circle2();
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
(_easycom_ua_markdown2 + _easycom_zui_progress_circle2 + _easycom_uni_popup2)();
}
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_zui_progress_circle();
(_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.s("top:" + $data.menuTop + "px;line-height:" + $data.menuH + "px;"),
c: common_assets._imports_1,
d: common_vendor.s("top:" + $data.navH + "px;"),
e: common_vendor.t($data.selectDate),
f: common_assets._imports_2$3,
g: common_vendor.o(($event) => $options.clickExpandOrRetract()),
h: common_vendor.o(($event) => $options.clickTodayDate()),
i: common_vendor.f($data.weekList, (item, index, i0) => {
d: $data.keywords,
e: common_vendor.o(($event) => $data.keywords = $event.detail.value),
f: common_vendor.o(($event) => $options.clickSearch()),
g: common_vendor.s("top:" + $data.navH + "px;"),
h: common_vendor.t($data.selectDate),
i: common_assets._imports_2$3,
j: common_vendor.o(($event) => $options.clickSelectMonth()),
k: common_vendor.o(($event) => $options.clickTodayDate()),
l: common_vendor.f($data.weekList, (item, index, i0) => {
return {
a: common_vendor.t(item),
b: index
};
}),
j: $data.isExpand
m: $data.isExpand
}, $data.isExpand ? {
k: common_vendor.f($data.monthDateList, (item, index, i0) => {
n: common_vendor.f($data.monthDateList, (item, index, i0) => {
return common_vendor.e($data.selectDate != $data.todayDate ? common_vendor.e({
a: $data.selectDate == item.date
}, $data.selectDate == item.date ? {
@@ -304,9 +424,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
q: common_vendor.o(($event) => $options.clickSelectDate(item), index)
});
}),
l: $data.selectDate != $data.todayDate
o: $data.selectDate != $data.todayDate
} : {
m: common_vendor.f($data.weekDateList, (item, index, i0) => {
p: common_vendor.f($data.weekDateList, (item, index, i0) => {
return common_vendor.e($data.selectDate != $data.todayDate ? common_vendor.e({
a: $data.selectDate == item.date
}, $data.selectDate == item.date ? {
@@ -340,12 +460,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
q: index
});
}),
n: $data.selectDate != $data.todayDate
q: $data.selectDate != $data.todayDate
}, {
o: common_vendor.t($data.isExpand ? "收起" : "展开"),
p: common_assets._imports_3$2,
q: common_vendor.o(($event) => $options.clickExpandOrRetract()),
r: common_vendor.f($data.tabList, (item, index, i0) => {
r: common_vendor.t($data.isExpand ? "收起" : "展开"),
s: $data.isExpand
}, $data.isExpand ? {
t: common_assets._imports_3$2
} : {
v: common_assets._imports_4$1
}, {
w: common_vendor.o(($event) => $options.clickExpandOrRetract()),
x: common_vendor.f($data.tabList, (item, index, i0) => {
return {
a: common_vendor.t(item),
b: common_vendor.n("item " + ($data.selectTab == index ? "select" : "")),
@@ -353,7 +478,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
d: common_vendor.o(($event) => $options.clickTabItem(index), index)
};
}),
s: common_vendor.f($data.stockCategoryList, (item, index, i0) => {
y: common_vendor.f($data.stockCategoryList, (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item.primary_sector),
b: $data.selectTopCategory == index
@@ -363,29 +488,38 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
e: common_vendor.o(($event) => $options.clickTopCategoryItem(index), index)
});
}),
t: $data.selectTab == 0
z: $data.selectTab == 0
}, $data.selectTab == 0 ? {
v: common_vendor.f($data.eventList, (item, index, i0) => {
A: 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.star ? "/static/icon/invest/star_s.png" : "/static/icon/invest/star.png"
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: common_vendor.t(item.description),
g: item.concepts
}, item.concepts ? {
h: common_vendor.f(JSON.parse(item.concepts), (citem, cindex, i1) => {
f: common_vendor.f(item.tags, (titem, tindex, i1) => {
return {
a: common_vendor.t(citem[0]),
b: common_vendor.t(citem[2] * 100),
c: "2cf1ca64-0-" + i0 + "-" + i1,
a: common_vendor.t(titem),
b: tindex
};
}),
g: "2cf1ca64-0-" + i0,
h: common_vendor.p({
source: $data.replaceAnswerLabel(item.description)
}),
i: item.related_concepts
}, item.related_concepts ? {
j: common_vendor.f(item.related_concepts, (citem, cindex, i1) => {
return {
a: common_vendor.t(citem.name),
b: common_vendor.t(citem.score * 100),
c: "2cf1ca64-1-" + i0 + "-" + i1,
d: common_vendor.p({
position: citem[2],
position: citem.score,
range: [270, 630],
size: 26,
["ring-width"]: 2,
@@ -395,34 +529,64 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
};
})
} : {}, {
i: index,
j: common_vendor.o(($event) => $options.clickEventItem(item.id), index)
k: index,
l: common_vendor.o(($event) => $options.clickEventItem(item.id), index)
});
})
} : {}, {
w: $data.selectTab == 1
B: $data.selectTab == 1
}, $data.selectTab == 1 ? {
x: common_vendor.f($data.dataList, (item, index, i0) => {
C: common_vendor.f($data.dataList, (item, index, i0) => {
return {
a: common_vendor.t($data.getLocaleHourMinute(item.created_at)),
b: common_vendor.f(5, (item2, index2, i1) => {
b: common_vendor.f(5, (sitem, sindex, i1) => {
return {
a: index2
};
}),
c: common_vendor.f(5, (item2, index2, i1) => {
return {
a: index2
a: sindex < item.star ? "/static/icon/invest/star_s.png" : "/static/icon/invest/star.png"
};
}),
c: index,
d: common_vendor.t(item.title),
e: index
e: common_vendor.t(item.former),
f: common_vendor.t(item.forecast ? item.forecast : "--"),
g: common_vendor.t(item.fact ? item.fact : "--"),
h: index
};
})
} : {}, {
D: common_vendor.s("top:" + $data.contentTop + "px;"),
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
};
}),
y: common_assets._imports_4$1,
z: common_assets._imports_5
} : {}, {
A: common_vendor.s("top:" + $data.contentTop + "px;")
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-2"),
O: common_vendor.p({
type: "top"
})
});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);

View File

@@ -1,6 +1,9 @@
{
"navigationBarTitleText": "",
"enablePullDownRefresh": true,
"usingComponents": {
"zui-progress-circle": "../../uni_modules/zui-progress-circle/components/zui-progress-circle/zui-progress-circle"
"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

@@ -248,12 +248,20 @@
color: #222;
}
.eventList .item .labelC {
display: inline-block;
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;
@@ -329,3 +337,74 @@
font-weight: 500;
color: #666;
}
.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

@@ -1,6 +1,7 @@
"use strict";
const common_vendor = require("../../../common/vendor.js");
const request_api = require("../../../request/api.js");
const utils_util = require("../../../utils/util.js");
const common_assets = require("../../../common/assets.js");
const _sfc_main = {
data() {
@@ -9,41 +10,51 @@ const _sfc_main = {
eventId: "",
//事件id
contentTop: "",
categoryList: ["背景", "推演", "实际", "相关股票", "相关概念"],
investDetails: null,
former: "",
//背景
categoryList: ["背景", "推演", "相关股票"],
selectCategory: 0,
stockCategoryList: [
{
title: "全部股票",
num: 0,
bgColor: "#C00000",
color: "white"
},
{
title: "大周期",
num: 0,
bgColor: "#305496",
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 + 74) / 750 * common_vendor.inject("windowWidth");
this.contentTop = this.navH + (30 + 72) / 750 * common_vendor.inject("windowWidth");
if (e.id) {
this.eventId = e.id;
this.getEventDetailsData();
@@ -58,11 +69,32 @@ const _sfc_main = {
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) => {
});
}
@@ -70,11 +102,13 @@ const _sfc_main = {
};
if (!Array) {
const _easycom_navBar2 = common_vendor.resolveComponent("navBar");
_easycom_navBar2();
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_navBar + _easycom_ua_markdown)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
@@ -93,18 +127,58 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
});
}),
d: common_vendor.s("top:" + $data.navH + "px;"),
e: $data.selectCategory == 3
}, $data.selectCategory == 3 ? {
f: common_vendor.f($data.stockCategoryList, (item, index, i0) => {
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.title),
b: common_vendor.s("background-color:" + item.bgColor + ";color:" + item.color + ";"),
c: index
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($data.accMul(item.score, 100)),
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 == 4
}, $data.selectCategory == 4 ? {
n: common_vendor.f($data.investDetails.extracted_concepts, (item, index, i0) => {
return {
a: item.first_image,
b: common_vendor.t(item.name),
c: common_vendor.t(item.reason),
d: index,
e: common_vendor.o(($event) => _ctx.clickConceptItem(), index)
};
})
} : {}, {
g: common_vendor.s("top:" + $data.contentTop + "px;")
});
o: common_vendor.s("top:" + $data.contentTop + "px;")
}) : {});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);

View File

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

View File

@@ -1 +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="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="{{g}}"><view wx:if="{{e}}" class="stockC"><view class="stockCategoryList flexWrap"><view wx:for="{{f}}" wx:for-item="item" wx:key="c" class="item flexColumnCenter" style="{{item.b}}"><view class="num">23</view><view class="title">{{item.a}}</view></view></view><view class="stockList"><view class="item"><view class="titleCorrelationC flex"><view class="title flex1">000065.SZ 北方国际</view><view class="correlation">相关度: 98%</view></view><view class="category">石油石化</view><view class="content"> 海外订单占比70%-80%,在俄语区矿产资源开发(蒙古矿山)、电力运营经验丰富,是乌克兰重建核心受益标的。公司在俄语区的深厚积累使其直接获益于区域经济复苏和能源合作深化。 </view></view></view></view></view></view>
<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="d" class="{{item.c}}" bindtap="{{item.e}}">{{item.a}} <view wx:if="{{item.b}}" class="line absolute"></view></view></view><view wx:if="{{e}}" class="contentC fixed" style="{{o}}"><view wx:if="{{f}}" class="former"><ua-markdown wx:if="{{g}}" u-i="b7e6c0fc-1" bind:__l="__l" u-p="{{g}}"/></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}}" class=""><view class="conceptList"><view wx:for="{{n}}" wx:for-item="item" wx:key="d" class="item relative" bindtap="{{item.e}}"><image class="cover" src="{{item.a}}" mode="aspectFill"></image><view class="infoC absolute"><view class="title">{{item.b}}</view><view class="content relative">{{item.c}} <text class="lookDetails absolute">查看详情</text></view></view></view></view></view></view></view>

View File

@@ -38,6 +38,9 @@
bottom: 0;
overflow-y: scroll;
}
.contentC .former {
padding: 40rpx 25rpx;
}
.contentC .stockCategoryList {
margin-top: 18rpx;
padding: 0 24rpx;
@@ -61,6 +64,9 @@
}
.contentC .stockList {
padding: 22rpx 25rpx 30rpx;
}
.contentC .stockList .item {
padding: 22rpx 0 30rpx;
border-bottom: solid 1rpx #E4E4E4;
}
.contentC .stockList .item .title {
@@ -94,3 +100,42 @@
color: #666;
line-height: 1.2rem;
}
.contentC .conceptList {
padding: 30rpx 25rpx;
}
.contentC .conceptList .item {
margin-bottom: 20rpx;
}
.contentC .conceptList .item .cover {
display: block;
width: 100%;
height: 350rpx;
border-radius: 10rpx;
}
.contentC .conceptList .item .infoC {
background: linear-gradient(to bottom, #00000080, #000);
padding: 20rpx 23rpx;
left: 0;
width: 100%;
bottom: 0;
border-radius: ;
color: white;
}
.contentC .conceptList .item .infoC .title {
font-size: 26rpx;
font-weight: bold;
}
.contentC .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;
}
.contentC .conceptList .item .infoC .content .lookDetails {
right: 0;
color: #F97316;
}