Browse Source

修改k线不能一直加载数据问题

master
liaoxinyu 2 years ago
parent
commit
0e20fc793b
  1. 12
      src/views/option/kline.vue

12
src/views/option/kline.vue

@ -240,13 +240,13 @@ methods: {
) { ) {
// handleClick // handleClick
this.page[this.symbol] = this.page[this.symbol] || 1; this.page[this.symbol] = this.page[this.symbol] || 1;
let page = this.page[this.symbol] > 3 ? 3 : this.page[this.symbol]; let page = this.page[this.symbol] > 50 ? 50 : this.page[this.symbol];
let data = { let data = {
symbol: this.ajaxTv.getSymbol(symbolInfo.name), symbol: this.ajaxTv.getSymbol(symbolInfo.name),
period: this.resolution(resolution), period: this.resolution(resolution),
form: rangeStartDate, form: rangeStartDate,
to: rangeEndDate, to: rangeEndDate,
size: page * 200, size: page * 400,
zip: 1, zip: 1,
}; };
@ -268,14 +268,14 @@ methods: {
this.timer = resolution; this.timer = resolution;
this.ajaxTv.getKline(data).then((res) => { this.ajaxTv.getKline(data).then((res) => {
let arr = this.unzip(res.data).map((item) => { let arr = this.unzip(res.data).map((item) => {
return this.getMap(item); return this.getMap(item);
}); });
this.page[this.symbol]++; this.page[this.symbol]++;
onLoadedCallback(arr); onLoadedCallback(arr);
setTimeout(() => { setTimeout(() => {
if (this.page[this.symbol] > 3) { if (this.page[this.symbol] > 50) {
onLoadedCallback([]); onLoadedCallback([]);
} }
}, 60); }, 60);
}); });
// //

Loading…
Cancel
Save