10.13 修改时间筛选逻辑,去掉分时图线上圆圈展示,修改K线图颜色

This commit is contained in:
尚政杰
2025-10-13 16:48:21 +08:00
parent bf2388c3ec
commit b53bb9715e
93 changed files with 736 additions and 352 deletions

View File

@@ -52,29 +52,26 @@ const _sfc_main = {
confine: true
},
grid: {
left: "0%",
right: "0%",
left: "10%",
right: "6%",
top: "0%",
bottom: "20%"
},
xAxis: [
{
type: "category",
data: [],
axisTick: {
show: false
},
axisLine: {
show: false
}
}
],
xAxis: {
type: "category",
scale: true,
data: [],
// axisTick:{ show:false },
axisLine: { show: false },
axisLabel: { show: false }
},
yAxis: [
{
type: "value",
show: false,
axisTick: { show: false },
scale: true
scale: true,
axisLabel: { show: false },
splitLine: { show: false }
}
],
series: {
@@ -116,13 +113,29 @@ const _sfc_main = {
const chartDom = that.$refs["chartRef" + index][0];
chartDom.init(echarts).then((res) => {
let option = { ...that.option };
let categoryData = [];
let valueData = [];
for (let item1 of item.minute_chart_data) {
categoryData.push(item1.time);
valueData.push(item1.close);
}
option.series.data = valueData;
option.xAxis.data = categoryData;
let time = that.eventDetails.event_start_time.split("T")[1];
let firstOpen = item.minute_chart_data[0].open;
option.series.markLine.data = [{ yAxis: firstOpen }];
option.series.markLine.data = [
{
xAxis: time,
lineStyle: {
type: "solid",
width: 1,
color: "#ffd700"
}
},
{
yAxis: firstOpen
}
];
let lastClose = item.minute_chart_data.slice(-1)[0].close;
if (lastClose >= firstOpen) {
option.series.itemStyle.color = "#EF5350";
@@ -231,6 +244,8 @@ const _sfc_main = {
title: res.message,
icon: "none"
});
common_vendor.index.$emit("editSuccess");
this.getEventRelatedStockData();
}).catch((error) => {
});
},
@@ -382,11 +397,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.t(item.stock_name),
b: common_vendor.t(item.stock_code),
c: common_vendor.sr("chartRef" + index, "6e1a61f1-1-" + i0, {
c: common_vendor.sr("chartRef" + index, "52d9c4e6-1-" + i0, {
"f": 1
}),
d: "chartRef" + index,
e: "6e1a61f1-1-" + i0,
e: "52d9c4e6-1-" + i0,
f: common_vendor.t(item.trade_data ? item.trade_data.open_price : ""),
g: common_vendor.t(item.trade_data ? item.trade_data.latest_price : ""),
h: common_vendor.t(item.trade_data ? item.trade_data.change_pct : ""),
@@ -495,13 +510,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
P: common_vendor.o(($event) => $options.sendReplyComment()),
Q: $data.replyComment,
R: common_vendor.o(($event) => $data.replyComment = $event.detail.value),
S: common_vendor.sr("popup", "6e1a61f1-2"),
S: common_vendor.sr("popup", "52d9c4e6-2"),
T: common_vendor.p({
type: "bottom"
}),
U: common_assets._imports_13$1,
V: common_vendor.s("margin-top:" + $data.scoreTop + "px;"),
W: common_vendor.sr("expectScorePopup", "6e1a61f1-3"),
W: common_vendor.sr("expectScorePopup", "52d9c4e6-3"),
X: common_vendor.p({
type: "top",
["mask-background-color"]: "transparent"
@@ -526,7 +541,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
k: common_vendor.o(($event) => $options.clickStockItem(item.stock_code), index)
});
}),
ab: common_vendor.sr("stockPopup", "6e1a61f1-4"),
ab: common_vendor.sr("stockPopup", "52d9c4e6-4"),
ac: common_vendor.p({
type: "bottom"
})

File diff suppressed because one or more lines are too long

View File

@@ -46,6 +46,9 @@
color: #666;
line-height: 1.2rem;
}
.eventDetailsC .eventContent .ai {
color: #C00000;
}
.eventDetailsC .categoryList {
white-space: nowrap;
margin-top: 10rpx;
@@ -115,6 +118,9 @@
font-weight: 500;
color: #666;
}
.eventDetailsC .targetList .item .content .ai {
color: #C00000;
}
.eventDetailsC .conceptList {
padding: 30rpx 25rpx;
}
@@ -313,6 +319,9 @@
font-weight: 500;
color: #666;
}
.eventDetailsC .historyEventList .list .item .eventInfoC .content .ai {
color: #C00000;
}
.eventDetailsC .historyEventList .list .item .eventInfoC .increaseRateList {
white-space: nowrap;
padding: 0 30rpx;
@@ -646,3 +655,6 @@
font-weight: 500;
color: #666;
}
.stockPopup .list .item .content .ai {
color: #C00000;
}

View File

@@ -210,14 +210,16 @@ const _sfc_main = {
}).exec();
},
onPullDownRefresh() {
this.page = 1;
this.getEventListData();
this.clickSearch();
},
methods: {
loadMoreData() {
if (!this.loadAll) {
this.page++;
this.getEventListData();
if (this.selectScreenCategory == 0) {
this.getEventListData();
} else
this.getHotEventListData();
}
},
async init() {
@@ -229,7 +231,10 @@ const _sfc_main = {
*/
clickSearch() {
this.page = 1;
this.getEventListData();
if (this.selectTimeCategory == 0) {
this.getEventListData();
} else
this.getHotEventListData();
},
/**
* 点击事件筛选
@@ -364,16 +369,23 @@ const _sfc_main = {
*/
clickSelectDate(item) {
if (this.startDate) {
let date1 = new Date(this.startDate);
let date2 = new Date(item.date);
if (date1 > date2) {
this.endDate = this.startDate;
this.endTimeStamp = this.startTimeStamp;
if (this.endDate) {
this.startDate = item.date;
this.startTimeStamp = item.timestamp;
this.endDate = null;
this.endTimeStamp = null;
} else {
this.endDate = item.date;
this.endTimeStamp = item.timestamp;
let date1 = new Date(this.startDate);
let date2 = new Date(item.date);
if (date1 > date2) {
this.endDate = this.startDate;
this.endTimeStamp = this.startTimeStamp;
this.startDate = item.date;
this.startTimeStamp = item.timestamp;
} else {
this.endDate = item.date;
this.endTimeStamp = item.timestamp;
}
}
} else {
this.startDate = item.date;
@@ -533,6 +545,7 @@ const _sfc_main = {
title: res.message,
icon: "none"
});
this.clickSearch();
}).catch((error) => {
});
},
@@ -540,6 +553,11 @@ const _sfc_main = {
* 查看事件详情
*/
clickEventItem(id) {
let that = this;
common_vendor.index.$on("editSuccess", (res) => {
that.clickSearch();
common_vendor.index.$off("editSuccess");
});
common_vendor.index.navigateTo({
url: "/pages/index/eventDetails/eventDetails?id=" + id
});
@@ -829,7 +847,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", "9dfd58d8-0"),
s: common_vendor.sr("chartRef", "eb4215a0-0"),
t: common_vendor.f($data.eventList, (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item.importance),
@@ -866,8 +884,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
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(item.id, sitem.stock_code), sindex)
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)),
@@ -894,7 +913,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
};
}),
C: common_vendor.s("margin-top:" + $data.sortListTop + "px;"),
D: common_vendor.sr("sortPopup", "9dfd58d8-1"),
D: common_vendor.sr("sortPopup", "eb4215a0-1"),
E: common_vendor.p({
type: "top",
["mask-background-color"]: "transparent"
@@ -1063,7 +1082,7 @@ 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", "9dfd58d8-2"),
at: common_vendor.sr("screenPopup", "eb4215a0-2"),
av: common_vendor.p({
type: "top"
})

File diff suppressed because one or more lines are too long

View File

@@ -219,7 +219,10 @@
font-weight: bold;
color: #222;
}
.eventListC .list .item .stockList .stockItem .change {
.eventListC .list .item .stockList .stockItem .change.down {
color: #355422;
}
.eventListC .list .item .stockList .stockItem .change.up {
color: #F97316;
}
.eventListC .list .item .timeToolBarC {

View File

@@ -35,7 +35,6 @@ const _sfc_main = {
formatter: function(params) {
common_vendor.index.__f__("log", "at pages/index/stockDetails/stockDetails.vue:66", params);
let res = "日期:" + params[0].name + "\n开盘价" + params[0].data[1] + "\n收盘价" + params[0].data[2] + "\n最低价" + params[0].data[3] + "\n最高价" + params[0].data[4];
common_vendor.index.__f__("log", "at pages/index/stockDetails/stockDetails.vue:68", res);
return res;
}
},
@@ -43,6 +42,7 @@ const _sfc_main = {
show: false
},
grid: {
top: "10%",
left: "10%",
right: "10%",
bottom: "15%"
@@ -83,9 +83,9 @@ const _sfc_main = {
data: [],
itemStyle: {
color: "#ec0000",
color0: "#8A0000",
borderColor: "#00da3c",
borderColor0: "#008F28"
color0: "#00da3c"
// borderColor: '#8A0000',
// borderColor0: '#008F28'
}
}
]
@@ -95,17 +95,30 @@ const _sfc_main = {
show: false
},
tooltip: {
trigger: "axis"
position: function(pos, params, dom, rect, size) {
var obj = { top: "10%" };
obj[["left", "right"][+(pos[0] < size.viewSize[0] / 2)]] = 5;
return obj;
},
trigger: "axis",
formatter: function(params) {
common_vendor.index.__f__("log", "at pages/index/stockDetails/stockDetails.vue:137", params);
let res = "时间:" + params[0].name + "\n高" + params[0].data[2] + "\n开" + params[0].data[3] + "\n低" + params[0].data[4] + "\n收" + params[0].data[1] + "\n涨幅" + params[0].data[5] + "%";
return res;
}
},
grid: {
left: "10%",
right: "12%",
top: "10%",
left: "12%",
right: "14%",
bottom: "10%"
},
xAxis: {
type: "category"
type: "category",
scale: true
},
yAxis: {
show: false,
scale: true
},
dataZoom: [
@@ -116,16 +129,20 @@ const _sfc_main = {
series: {
name: "分时图",
type: "line",
symbol: "none",
markLine: {
silent: true,
symbol: ["none", "none"],
lineStyle: {
width: 2,
color: "#AAA"
type: "solid",
width: 1,
color: "#dedede"
},
data: []
}
}
z: 1
},
data: []
},
animation: false
},
relatedDesc: "",
//关联描述
@@ -182,32 +199,82 @@ const _sfc_main = {
let data = res.data.minute_chart_data;
let categoryData = [];
let valueData = [];
let open = data[0].open;
for (let item of data) {
categoryData.push(item.time);
valueData.push(item.close);
let rate = utils_util.accMul(utils_util.accDiv(utils_util.accSub(item.close, open), open).toFixed(4), 100);
valueData.push([item.time, item.close, item.high, item.open, item.low, rate]);
}
let min = open;
let max = 0;
for (let item of valueData) {
let value = item[1];
if (parseFloat(value) < min) {
min = parseFloat(value);
}
if (parseFloat(value) > max) {
max = parseFloat(value);
}
}
let minInterval = (open - min) / 3;
let maxInterval = (max - open) / 3;
let intervalList = [];
if (minInterval > maxInterval) {
for (var i = 3; i > 0; i--) {
intervalList.push(open - i * minInterval);
}
for (var i = 0; i < 4; i++) {
intervalList.push(open + i * minInterval);
}
} else {
for (var i = 3; i > 0; i--) {
intervalList.push(open - i * maxInterval);
}
for (var i = 0; i < 4; i++) {
intervalList.push(open + i * maxInterval);
}
}
this.option1.xAxis.data = categoryData;
this.option1.yAxis.min = intervalList[0].toFixed(2);
this.option1.yAxis.max = intervalList[intervalList.length - 1].toFixed(2);
this.option1.series.data = valueData;
this.option1.series.markLine.data = [
{
yAxis: data[0].open,
label: {
show: true,
position: "start",
// formatter:'111',
color: "#333"
let markData = [];
let time = res.data.event_info;
for (let item of intervalList) {
markData.push(
{
xAxis: time,
lineStyle: {
type: "solid",
width: 1,
color: "#ffd700"
},
label: {
position: "middle",
formatter: "事件发生",
color: "#ffd700"
}
},
{
yAxis: item,
label: {
show: true,
position: "start",
color: "#333"
}
},
{
yAxis: item,
label: {
show: true,
position: "end",
formatter: utils_util.accMul(utils_util.accDiv(utils_util.accSub(item, open), open).toFixed(4), 100) + "%",
color: "#333"
}
}
},
{
yAxis: data[0].open,
label: {
show: true,
position: "end",
formatter: "0.00%",
color: "#333"
}
}
];
);
}
this.option1.series.markLine.data = markData;
let relatedDesc = res.data.related_desc;
if (relatedDesc) {
this.relatedDesc = relatedDesc.relation_desc;
@@ -281,7 +348,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
} : {}, {
f: $data.type == 1
}, $data.type == 1 ? {
g: common_vendor.sr("chartRef", "42054871-1")
g: common_vendor.sr("chartRef", "ab03f7e6-1")
} : {}, {
h: common_vendor.t($data.relatedDesc),
i: $data.type == 1 && $data.sourceList.length > 0

View File

@@ -1 +1 @@
<view><nav-bar wx:if="{{a}}" u-i="42054871-0" bind:__l="__l" u-p="{{a}}"></nav-bar><image class="topBg absolute" src="{{b}}" mode="widthFix"></image><view wx:if="{{c}}" class="tabC fixed" style="{{e}}"><view wx:for="{{d}}" wx:for-item="item" wx:key="d" class="{{item.c}}" bindtap="{{item.e}}">{{item.a}} <view wx:if="{{item.b}}" class="line absolute"></view></view></view><view class="{{k}}" style="{{l}}"><view wx:if="{{f}}" style="width:750rpx;height:400rpx"><l-echart class="r" u-r="chartRef" u-i="42054871-1" bind:__l="__l"></l-echart></view><view class="section">关联描述</view><view class="des">{{h}}</view><view wx:if="{{i}}" class="section">信息来源</view><view class="list"><view wx:for="{{j}}" wx:for-item="item" wx:key="e" class="item"><view class="content">{{item.a}}</view><view class="article">——《{{item.b}}》</view><view class="authorDateC flex"><view class="author flex1">{{item.c}}</view><view class="date">{{item.d}}</view></view></view></view></view></view>
<view><nav-bar wx:if="{{a}}" u-i="ab03f7e6-0" bind:__l="__l" u-p="{{a}}"></nav-bar><image class="topBg absolute" src="{{b}}" mode="widthFix"></image><view wx:if="{{c}}" class="tabC fixed" style="{{e}}"><view wx:for="{{d}}" wx:for-item="item" wx:key="d" class="{{item.c}}" bindtap="{{item.e}}">{{item.a}} <view wx:if="{{item.b}}" class="line absolute"></view></view></view><view class="{{k}}" style="{{l}}"><view wx:if="{{f}}" style="width:750rpx;height:400rpx"><l-echart class="r" u-r="chartRef" u-i="ab03f7e6-1" bind:__l="__l"></l-echart></view><view class="section">关联描述</view><view class="des">{{h}}<text class="ai">AI合成</text></view><view wx:if="{{i}}" class="section">信息来源</view><view class="list"><view wx:for="{{j}}" wx:for-item="item" wx:key="e" class="item"><view class="content">{{item.a}}</view><view class="article">——《{{item.b}}》</view><view class="authorDateC flex"><view class="author flex1">{{item.c}}</view><view class="date">{{item.d}}</view></view></view></view></view></view>

View File

@@ -53,6 +53,9 @@
font-weight: 500;
color: #666;
}
.contentC .des .ai {
color: #C00000;
}
.contentC .list {
padding: 0 25rpx;
}