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

24
src/views/option/kline.vue

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

Loading…
Cancel
Save