Browse Source

k线切换

master
shike 6 years ago
parent
commit
054d277efd
  1. 2
      src/views/coincoin/coincoin_trade.vue
  2. 13
      src/views/release/release_trade.vue

2
src/views/coincoin/coincoin_trade.vue

@ -227,6 +227,8 @@
this.initCoin(); this.initCoin();
this.KlinFunc() this.KlinFunc()
this.timers = setInterval(() => { this.timers = setInterval(() => {
this.$store.dispatch('trend/getTransactions');
this.$emit('updateOrder');
this.getData(); this.getData();
}, 1000); }, 1000);
} }

13
src/views/release/release_trade.vue

@ -80,7 +80,7 @@
/*---------- 自定义 -----------*/ /*---------- 自定义 -----------*/
symbolId:'',//uniapp() symbolId:'',//uniapp()
symbolIdLine:'BTC-USDT',//()(xxx-xxx)
symbolIdLine:'UBSC-USDT',//()(xxx-xxx)
token: '', //uniapptoken token: '', //uniapptoken
sub: null, // sub: null, //
depth: { sellList: [], buyList: [] }, // depth: { sellList: [], buyList: [] }, //
@ -98,6 +98,11 @@
computed: { computed: {
...mapState('trend', ['allPairList', 'currentPair']), ...mapState('trend', ['allPairList', 'currentPair']),
}, },
watch:{
currentPair(val,old){
if(val.symbolId!==old.symbolId) this.restart()
}
},
methods: { methods: {
/* ---------------- 以下是K线图配置 --------------------*/ /* ---------------- 以下是K线图配置 --------------------*/
@ -111,7 +116,7 @@
//K线 //K线
restart() { restart() {
this.$store.state.tv_setting.symbol = 'BTC-USDT'; //K线()
this.$store.state.tv_setting.symbol = this.currentPair.symbolId; //K线()
this.$refs.tradingViewChart.symbolTab(); this.$refs.tradingViewChart.symbolTab();
}, },
@ -119,7 +124,7 @@
KlinFunc() { KlinFunc() {
if (!this.getsetting().wsurl) { if (!this.getsetting().wsurl) {
this.$store.state.tv_setting.skin = 'white'; //K线 white \ black 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(); this.load();
console.log(11111111) console.log(11111111)
this.$store.state.tv_setting.wsurl = 'ws://119.23.49.169:10803/ws/coin/exchange'; this.$store.state.tv_setting.wsurl = 'ws://119.23.49.169:10803/ws/coin/exchange';
@ -223,6 +228,8 @@
this.KlinFunc() this.KlinFunc()
this.timers = setInterval(() => { this.timers = setInterval(() => {
this.$store.dispatch('trend/getAllPair'); this.$store.dispatch('trend/getAllPair');
this.$store.dispatch('trend/getTransactions');
this.$emit('updateOrder');
this.getDepth(); this.getDepth();
}, 1000); }, 1000);
} }

Loading…
Cancel
Save