Browse Source

次数3改为20

master
luyisha 3 years ago
parent
commit
e6212d0615
  1. 9
      src/views/contract/index.vue
  2. 24
      src/views/option/kline.vue

9
src/views/contract/index.vue

@ -263,7 +263,7 @@ export default {
this.indexList(); this.indexList();
this._time = setInterval(() => { this._time = setInterval(() => {
if (this.contractOpen) { if (this.contractOpen) {
this.holdPosition(); this.holdPosition();//
} }
}, 3000); }, 3000);
this.ws.on("open", () => { this.ws.on("open", () => {
@ -279,9 +279,10 @@ export default {
}, },
// //
mounted: function () { mounted: function () {
setInterval(() => { // created holdPosition
this.holdPosition(); // setInterval(() => {
}, 2000) // this.holdPosition();
// }, 2000)
}, },
methods: { methods: {
ispopover1(item){ ispopover1(item){

24
src/views/option/kline.vue

@ -65,6 +65,12 @@ export default {
this.unsub(this.ajaxTv.getSymbol(o), this.timer); this.unsub(this.ajaxTv.getSymbol(o), this.timer);
} }
}, },
periodCurrent(n,o){
if(n != o && o){
console.log('切换周期,页数为第一页')
this.page[this.symbol] = 1;//
}
}
}, },
computed: { computed: {
lang() { lang() {
@ -122,7 +128,8 @@ data() {
sub: "", sub: "",
isCreateSocket: false, isCreateSocket: false,
page: {}, page: {},
tt:undefined tt:undefined,
periodCurrent: ''
}; };
}, },
methods: { methods: {
@ -239,11 +246,15 @@ methods: {
onErrorCallback onErrorCallback
) { ) {
// handleClick // handleClick
this.periodCurrent = this.resolution(resolution);
console.log(this.page[this.symbol], 'this.page[this.symbol]')
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] > 3 ? 3 : this.page[this.symbol];
let page = this.page[this.symbol] > 20 ? 20 : this.page[this.symbol];
// let page = 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.periodCurrent,
form: rangeStartDate, form: rangeStartDate,
to: rangeEndDate, to: rangeEndDate,
size: page * 200, size: page * 200,
@ -270,10 +281,11 @@ methods: {
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]++;//+1
onLoadedCallback(arr); onLoadedCallback(arr);
setTimeout(() => { setTimeout(() => {
if (this.page[this.symbol] > 3) { // if (this.page[this.symbol] > 3) {
if (this.page[this.symbol] > 20) {
onLoadedCallback([]); onLoadedCallback([]);
} }
}, 60); }, 60);
@ -486,7 +498,7 @@ methods: {
created(){ created(){
let tim=localStorage.getItem("tim"); let tim=localStorage.getItem("tim");
if(tim){ if(tim){
this.timer=tim this.timer=tim;
} }
}, },
mounted() { mounted() {

Loading…
Cancel
Save