11.26 修改K线图样式

This commit is contained in:
尚政杰
2025-11-26 17:19:38 +08:00
parent 48f49c6cf0
commit 4e64455b9b
4803 changed files with 146408 additions and 648 deletions

View File

@@ -2,6 +2,7 @@
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
const utils_util = require("../../utils/util.js");
const utils_posthog = require("../../utils/posthog.js");
const common_assets = require("../../common/assets.js");
const echarts = require("../../uni_modules/lime-echart/static/echarts.min.js");
const _sfc_main = {
@@ -14,6 +15,7 @@ const _sfc_main = {
contentTop: "",
listTop: "",
sortListTop: "",
isRefreshing: false,
keywords: "",
//关键词
sortList: [],
@@ -198,6 +200,7 @@ const _sfc_main = {
}
}
this.monthDateList = monthDateList;
utils_posthog.posthog.capture("首页");
},
onReady() {
common_vendor.index.createSelectorQuery().select("#topCategory").boundingClientRect((rect) => {
@@ -209,10 +212,17 @@ const _sfc_main = {
}
}).exec();
},
onPullDownRefresh() {
this.clickSearch();
},
methods: {
/**
* 下拉刷新
*/
pullDownRefresh() {
this.isRefreshing = true;
this.clickSearch();
},
/**
* 上拉加载
*/
loadMoreData() {
if (!this.loadAll) {
this.page++;
@@ -588,7 +598,7 @@ const _sfc_main = {
this.importanceList = res.data.importance_options;
this.importanceList.unshift({ desc: "全部", key: "all", name: "全部" });
} else {
reject(1);
resolve(1);
common_vendor.index.showToast({
title: res.message,
icon: "none"
@@ -678,74 +688,8 @@ const _sfc_main = {
}
}
request_api.eventList(param).then((res) => {
this.isRefreshing = false;
if (res.success) {
let valueData = [];
let data = res.data.overall_stats.change_distribution;
valueData.push({
value: data.limit_down,
itemStyle: { color: "#35542266" },
label: {
textStyle: { color: "#35542266" }
}
});
valueData.push({
value: data.down_over_5,
itemStyle: { color: "#35542299" },
label: {
textStyle: { color: "#355422" }
}
});
valueData.push({
value: data.down_5_to_1,
itemStyle: { color: "#355422CC" },
label: {
textStyle: { color: "#355422" }
}
});
valueData.push({
value: data.down_within_1,
itemStyle: { color: "#355422" },
label: {
textStyle: { color: "#355422" }
}
});
valueData.push({
value: data.flat,
itemStyle: { color: "#ACB0C0" },
label: {
textStyle: { color: "#666" }
}
});
valueData.push({
value: data.up_within_1,
itemStyle: { color: "#C00000" },
label: {
textStyle: { color: "#C00000" }
}
});
valueData.push({
value: data.up_1_to_5,
itemStyle: { color: "#C00000CC" },
label: {
textStyle: { color: "#C00000" }
}
});
valueData.push({
value: data.up_over_5,
itemStyle: { color: "#C0000099" },
label: {
textStyle: { color: "#C00000" }
}
});
valueData.push({
value: data.limit_up,
itemStyle: { color: "#C0000066" },
label: {
textStyle: { color: "#C0000066" }
}
});
this.option.series[0].data = valueData;
this.init();
if (this.page == 1) {
this.eventList = res.data.events;
} else
@@ -753,6 +697,7 @@ const _sfc_main = {
this.loadAll = !res.data.pagination.has_next;
}
}).catch((error) => {
this.isRefreshing = false;
});
},
/**
@@ -795,14 +740,12 @@ const _sfc_main = {
}
};
if (!Array) {
const _easycom_l_echart2 = common_vendor.resolveComponent("l-echart");
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
(_easycom_l_echart2 + _easycom_uni_popup2)();
_easycom_uni_popup2();
}
const _easycom_l_echart = () => "../../uni_modules/lime-echart/components/l-echart/l-echart.js";
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
if (!Math) {
(_easycom_l_echart + _easycom_uni_popup)();
_easycom_uni_popup();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
@@ -847,8 +790,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
q: $data.secondScrollLeft
} : {}, {
r: common_vendor.s("top:" + $data.contentTop + "px"),
s: common_vendor.sr("chartRef", "eb4215a0-0"),
t: common_vendor.f($data.eventList, (item, index, i0) => {
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),
@@ -880,31 +822,24 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
}, {
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: common_vendor.n("change " + ($data.getRateUpOrDown(sitem.daily_change) ? "down" : "up")),
d: sindex,
e: common_vendor.o(($event) => $options.clickLookRelatedStockItem(item.id, 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
w: common_vendor.t($data.getLocaleTime(item.created_at)),
x: common_vendor.t(item.view_count),
y: common_vendor.t(item.post_count),
z: common_vendor.t(item.follower_count),
A: common_vendor.o(($event) => $options.clickFollowEvent(item.id), index),
B: common_vendor.o(($event) => $options.clickEventItem(item.id), index),
C: index
});
}),
v: common_assets._imports_3,
w: common_assets._imports_4,
x: common_assets._imports_10,
y: common_vendor.s("top:" + $data.listTop + "px"),
z: common_vendor.o(($event) => $options.loadMoreData()),
A: common_assets._imports_13$1,
B: common_vendor.f($data.sortList, (item, index, i0) => {
t: common_assets._imports_3,
v: common_assets._imports_4,
w: common_assets._imports_10,
x: common_vendor.s("top:" + $data.listTop + "px"),
y: $data.isRefreshing,
z: common_vendor.o(($event) => $options.pullDownRefresh()),
A: common_vendor.o(($event) => $options.loadMoreData()),
B: common_assets._imports_13$1,
C: common_vendor.f($data.sortList, (item, index, i0) => {
return {
a: item.icon,
b: common_vendor.t(item.name),
@@ -912,15 +847,16 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
d: common_vendor.o(($event) => $options.clickSortListItem(item), index)
};
}),
C: common_vendor.s("margin-top:" + $data.sortListTop + "px;"),
D: common_vendor.sr("sortPopup", "eb4215a0-1"),
E: common_vendor.p({
D: common_vendor.s("margin-top:" + $data.sortListTop + "px;"),
E: common_vendor.sr("sortPopup", "eb4215a0-0"),
F: common_vendor.p({
type: "top",
["mask-background-color"]: "transparent"
["mask-background-color"]: "transparent",
animation: false
}),
F: common_assets._imports_2,
G: common_vendor.s("height:" + $data.menuH + "px;"),
H: common_vendor.f($data.screenCategoryList, (item, index, i0) => {
G: common_assets._imports_2,
H: common_vendor.s("height:" + $data.menuH + "px;"),
I: common_vendor.f($data.screenCategoryList, (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item),
b: $data.selectScreenCategory == index
@@ -930,22 +866,22 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
e: common_vendor.o(($event) => $options.clickScreenCategoryItem(index), index)
});
}),
I: $data.selectScreenCategory == 0
J: $data.selectScreenCategory == 0
}, $data.selectScreenCategory == 0 ? {
J: common_vendor.t($data.startDate),
K: common_vendor.t($data.endDate),
L: common_assets._imports_5,
M: common_vendor.o(($event) => $options.clickPreMonth()),
N: common_vendor.t($data.selectMonth),
O: common_assets._imports_6,
P: common_vendor.o(($event) => $options.clickNextMonth()),
Q: common_vendor.f($data.weekList, (item, index, i0) => {
K: common_vendor.t($data.startDate),
L: common_vendor.t($data.endDate),
M: common_assets._imports_5,
N: common_vendor.o(($event) => $options.clickPreMonth()),
O: common_vendor.t($data.selectMonth),
P: common_assets._imports_6,
Q: common_vendor.o(($event) => $options.clickNextMonth()),
R: common_vendor.f($data.weekList, (item, index, i0) => {
return {
a: common_vendor.t(item),
b: index
};
}),
R: common_vendor.f($data.monthDateList[$data.selectMonthIndex], (item, index, i0) => {
S: common_vendor.f($data.monthDateList[$data.selectMonthIndex], (item, index, i0) => {
return common_vendor.e({
a: item.isToday
}, item.isToday ? {
@@ -970,9 +906,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
});
})
} : {}, {
S: $data.selectScreenCategory == 1
T: $data.selectScreenCategory == 1
}, $data.selectScreenCategory == 1 ? common_vendor.e({
T: common_vendor.f($data.industryCategoryList, (item, index, i0) => {
U: common_vendor.f($data.industryCategoryList, (item, index, i0) => {
return {
a: common_vendor.t(item.classification_name),
b: common_vendor.n("item " + ($data.selectIndustryTopCategory == index ? "select" : "")),
@@ -980,12 +916,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
d: common_vendor.o(($event) => $options.clickIndustryTopCategoryItem(index), index)
};
}),
U: common_assets._imports_1,
V: common_vendor.o([($event) => $data.industryKeywords = $event.detail.value, (...args) => $options.industrySearch && $options.industrySearch(...args)]),
W: $data.industryKeywords,
X: $data.industryKeywords.length > 0
V: common_assets._imports_1,
W: common_vendor.o([($event) => $data.industryKeywords = $event.detail.value, (...args) => $options.industrySearch && $options.industrySearch(...args)]),
X: $data.industryKeywords,
Y: $data.industryKeywords.length > 0
}, $data.industryKeywords.length > 0 ? {
Y: common_vendor.f($data.searchResultList, (item, index, i0) => {
Z: common_vendor.f($data.searchResultList, (item, index, i0) => {
return {
a: common_vendor.f(item.hierarchy, (sitem, sindex, i1) => {
return {
@@ -1014,28 +950,28 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
};
})
} : common_vendor.e({
Z: $data.selectIndustrySecondCategory > -1
}, $data.selectIndustrySecondCategory > -1 ? common_vendor.e({
aa: $data.selectIndustrySecondCategory > -1
}, $data.selectIndustrySecondCategory > -1 ? common_vendor.e({
ab: $data.selectIndustrySecondCategory > -1
}, $data.selectIndustrySecondCategory > -1 ? {
ab: common_vendor.t($data.industryCategoryList[$data.selectIndustryTopCategory].hierarchy[$data.selectIndustrySecondCategory].level1_sector),
ac: common_assets._imports_13,
ad: common_vendor.o(($event) => $options.deleteIndustrySecondCategoryItem())
ac: common_vendor.t($data.industryCategoryList[$data.selectIndustryTopCategory].hierarchy[$data.selectIndustrySecondCategory].level1_sector),
ad: common_assets._imports_13,
ae: common_vendor.o(($event) => $options.deleteIndustrySecondCategoryItem())
} : {}, {
ae: $data.selectIndustryThirdCategory > -1
af: $data.selectIndustryThirdCategory > -1
}, $data.selectIndustryThirdCategory > -1 ? {
af: common_vendor.t($data.industryCategoryList[$data.selectIndustryTopCategory].hierarchy[$data.selectIndustrySecondCategory].level2_sectors[$data.selectIndustryThirdCategory].level2_sector),
ag: common_assets._imports_13,
ah: common_vendor.o(($event) => $options.deleteIndustryThirdCategoryItem())
ag: common_vendor.t($data.industryCategoryList[$data.selectIndustryTopCategory].hierarchy[$data.selectIndustrySecondCategory].level2_sectors[$data.selectIndustryThirdCategory].level2_sector),
ah: common_assets._imports_13,
ai: common_vendor.o(($event) => $options.deleteIndustryThirdCategoryItem())
} : {}, {
ai: $data.selectIndustryForthCategory > -1
aj: $data.selectIndustryForthCategory > -1
}, $data.selectIndustryForthCategory > -1 ? {
aj: common_vendor.t($data.industryCategoryList[$data.selectIndustryTopCategory].hierarchy[$data.selectIndustrySecondCategory].level2_sectors[$data.selectIndustryThirdCategory].level3_sectors[$data.selectIndustryForthCategory].level3_sector),
ak: common_assets._imports_13,
al: common_vendor.o(($event) => $options.deleteIndustryForthCategoryItem())
ak: common_vendor.t($data.industryCategoryList[$data.selectIndustryTopCategory].hierarchy[$data.selectIndustrySecondCategory].level2_sectors[$data.selectIndustryThirdCategory].level3_sectors[$data.selectIndustryForthCategory].level3_sector),
al: common_assets._imports_13,
am: common_vendor.o(($event) => $options.deleteIndustryForthCategoryItem())
} : {}) : {}, {
am: common_vendor.t($data.industryCategoryList[$data.selectIndustryTopCategory].classification_name),
an: common_vendor.f($data.industryCategoryList[$data.selectIndustryTopCategory].hierarchy, (sitem, sindex, i0) => {
an: common_vendor.t($data.industryCategoryList[$data.selectIndustryTopCategory].classification_name),
ao: common_vendor.f($data.industryCategoryList[$data.selectIndustryTopCategory].hierarchy, (sitem, sindex, i0) => {
return common_vendor.e({
a: common_vendor.t($data.selectIndustrySecondCategory == sindex && sitem.isSpread ? "-" : "+"),
b: common_vendor.t(sitem.level1_sector),
@@ -1072,9 +1008,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
});
})
})) : {}, {
ao: $data.selectScreenCategory == 2
ap: $data.selectScreenCategory == 2
}, $data.selectScreenCategory == 2 ? {
ap: common_vendor.f($data.importanceList, (item, index, i0) => {
aq: common_vendor.f($data.importanceList, (item, index, i0) => {
return {
a: common_vendor.t(item.name),
b: common_vendor.n("item " + ($data.selectImportanceIndex == index ? "select" : "")),
@@ -1083,11 +1019,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
};
})
} : {}, {
aq: common_vendor.o(($event) => $options.clickCancel()),
ar: common_vendor.o(($event) => $options.clickCertain()),
as: common_vendor.s("padding-top:" + $data.menuTop + "px;"),
at: common_vendor.sr("screenPopup", "eb4215a0-2"),
av: common_vendor.p({
ar: common_vendor.o(($event) => $options.clickCancel()),
as: common_vendor.o(($event) => $options.clickCertain()),
at: common_vendor.s("padding-top:" + $data.menuTop + "px;"),
av: common_vendor.sr("screenPopup", "eb4215a0-1"),
aw: common_vendor.p({
type: "top"
})
});