|
|
|
@ -80,7 +80,7 @@ |
|
|
|
|
|
|
|
/*---------- 自定义 -----------*/ |
|
|
|
symbolId:'',//uniapp传来的交易对(小写) |
|
|
|
symbolIdLine:'BTC-USDT',//当前交易对(大写)(xxx-xxx格式) |
|
|
|
symbolIdLine:'UBSC-USDT',//当前交易对(大写)(xxx-xxx格式) |
|
|
|
token: '', //uniapp传来的token |
|
|
|
sub: null, //当前交易对信息 |
|
|
|
depth: { sellList: [], buyList: [] }, //当前交易对信息 |
|
|
|
@ -98,6 +98,11 @@ |
|
|
|
computed: { |
|
|
|
...mapState('trend', ['allPairList', 'currentPair']), |
|
|
|
}, |
|
|
|
watch:{ |
|
|
|
currentPair(val,old){ |
|
|
|
if(val.symbolId!==old.symbolId) this.restart() |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
/* ---------------- 以下是K线图配置 --------------------*/ |
|
|
|
|
|
|
|
@ -111,7 +116,7 @@ |
|
|
|
|
|
|
|
//重启K线图 |
|
|
|
restart() { |
|
|
|
this.$store.state.tv_setting.symbol = 'BTC-USDT'; //K线版块(交易对) |
|
|
|
this.$store.state.tv_setting.symbol = this.currentPair.symbolId; //K线版块(交易对) |
|
|
|
this.$refs.tradingViewChart.symbolTab(); |
|
|
|
}, |
|
|
|
|
|
|
|
@ -119,7 +124,7 @@ |
|
|
|
KlinFunc() { |
|
|
|
if (!this.getsetting().wsurl) { |
|
|
|
this.$store.state.tv_setting.skin = 'white'; //K线颜色 white \ black |
|
|
|
this.$store.state.tv_setting.symbol = 'BTC-USDT'; //K线版块(交易对) |
|
|
|
this.$store.state.tv_setting.symbol = this.currentPair.symbolId; //K线版块(交易对) |
|
|
|
this.load(); |
|
|
|
console.log(11111111) |
|
|
|
this.$store.state.tv_setting.wsurl = 'ws://119.23.49.169:10803/ws/coin/exchange'; |
|
|
|
@ -223,6 +228,8 @@ |
|
|
|
this.KlinFunc() |
|
|
|
this.timers = setInterval(() => { |
|
|
|
this.$store.dispatch('trend/getAllPair'); |
|
|
|
this.$store.dispatch('trend/getTransactions'); |
|
|
|
this.$emit('updateOrder'); |
|
|
|
this.getDepth(); |
|
|
|
}, 1000); |
|
|
|
} |
|
|
|
|