diff --git a/src/views/contract/handicap.vue b/src/views/contract/handicap.vue
index 9922f8a..66d1eb7 100644
--- a/src/views/contract/handicap.vue
+++ b/src/views/contract/handicap.vue
@@ -196,7 +196,9 @@ export default {
this.linkSocket();
}
bus.$on('collapse', msg => {
- this.newPriceObj.price =this.symbol=='BTC'? (msg.close).toFixed(1):(msg.close).toFixed(3);
+ // this.newPriceObj.price =this.symbol=='BTC'? (msg.close).toFixed(1):(msg.close).toFixed(3);
+ const closeStr = msg.close.toString();
+ this.newPriceObj.price = this.symbol === 'BTC' ? closeStr.slice(0, closeStr.indexOf('.') + 2) : closeStr.slice(0, closeStr.indexOf('.') + 4);
this.$emit("input", this.newPriceObj);
});
},
diff --git a/src/views/contract/index.vue b/src/views/contract/index.vue
index 6d14d8c..6cf1aaf 100644
--- a/src/views/contract/index.vue
+++ b/src/views/contract/index.vue
@@ -82,6 +82,7 @@
}"
>
{{ price1(activeContract.price) }}$
+
{{ activeContract.increaseStr }}
@@ -271,7 +272,10 @@ export default {
});
// console.info(this.$refs)
bus.$on('collapse', msg => {
- this.activeContract.price =this.activeContract.symbol=='BTC'? (msg.close).toFixed(1):(msg.close).toFixed(3);
+ // 将数字转换为字符串
+ const closeStr = msg.close.toString();
+ // this.activeContract.price =this.activeContract.symbol=='BTC'? (msg.close).toFixed(1):(msg.close).toFixed(3);
+ this.activeContract.price = this.activeContract.symbol === 'BTC' ? closeStr.slice(0, closeStr.indexOf('.') + 2) : closeStr.slice(0, closeStr.indexOf('.') + 4);
this.holdPositionList.map(item=>{
if(item.symbol==this.activeContract.symbol) item.realtimePrice=this.activeContract.price
})
diff --git a/src/views/option/kline.vue b/src/views/option/kline.vue
index e966ea7..6ce53af 100644
--- a/src/views/option/kline.vue
+++ b/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,12 @@ methods: {
onErrorCallback
) {
// handleClick
+ this.periodCurrent = this.resolution(resolution);
this.page[this.symbol] = this.page[this.symbol] || 1;
let page = this.page[this.symbol] > 3 ? 3 : 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,