| | |
| | | v-for="(item,index) in typelist" :key="index">{{item}}</div> |
| | | </div> |
| | | <div v-if="typeindex==0"> |
| | | <trade-head :backFunc="() => $router.push('/')" :symbol="symbol" :newname="newname" :price="price" :range="range" |
| | | <trade-head :backFunc="() => $router.push('/')" :symbol="symbol" :price="price" :range="range" |
| | | :isTrade="true" @update-coin="onUpdate" @data="quote = $event" /> |
| | | |
| | | <div class="trade-buy-sell flex justify-between px-30 py-30"> |
| | |
| | | <trade-deep-data :selectValue="selectValue" @getList="getList" :showType="showType" :symbol="symbol" |
| | | v-if="symbol" :price="price" class="w-290 mr-30" /> |
| | | </keep-alive> |
| | | <trade-order-area :symbol="symbol" :init-open="initOpena" :newname="newname" :init-close="initClose" :price="price" |
| | | <trade-order-area :symbol="symbol" :init-open="initOpena" :newname="newname | symbol" :init-close="initClose" :price="price" |
| | | @ordered="onOrdereda" /> |
| | | </div> |
| | | |
| | |
| | | } from "@/utils/utis"; |
| | | |
| | | export default { |
| | | filters: { |
| | | symbol(value) { |
| | | // 过滤器逻辑 |
| | | return value; // 示例 |
| | | }, |
| | | newname(value) { |
| | | // 过滤器逻辑 |
| | | return value; // 示例 |
| | | }, |
| | | }, |
| | | name: "TradePage", |
| | | components: { |
| | | ContractHeader, |
| | |
| | | ...mapActions("user", ["GET_UERS_KYC"]), |
| | | typeclick(e) { |
| | | this.typeindex = e |
| | | if(e==0){ |
| | | this.initParama(this.symbol) |
| | | }else{ |
| | | // this.symbol = 'wld' |
| | | this.initParam(this.symbol) |
| | | } |
| | | console.log(e); |
| | | // var storedSymbol = localStorage.getItem("symbol"); |
| | | // console.log("storedSymbol",storedSymbol); |
| | | // this.symbol = storedSymbol |
| | | // this.symbol = this.$route.params.symbol.toLowerCase() |
| | | // this.newname = this.symbol |
| | | this.symbol = this.$route.params.symbol.toLowerCase() |
| | | // if(e==0){ |
| | | // this.symbol=this.symbol.toLowerCase() |
| | | // console.log(this.symbol); |
| | | // if(this.symbol=='orbital'){ |
| | | // this.symbol = 'mother' |
| | | // }else if(this.symbol=='zyd'){ |
| | | // this.symbol = 'zkp' |
| | | // }else if(this.symbol=='dea'){ |
| | | // this.symbol = 'dia' |
| | | // }else if(this.symbol=='axfd'){ |
| | | // this.symbol = 'xeta' |
| | | // }else if(this.symbol=='smk'){ |
| | | // this.symbol = 'og' |
| | | // }else if(this.symbol=='fpp'){ |
| | | // this.symbol = 'fil' |
| | | // }else if(this.symbol=='ask'){ |
| | | // this.symbol = 'gas' |
| | | // console.log(this.symbol); |
| | | // }else if(this.symbol=='jkrt'){ |
| | | // this.symbol = 'axs' |
| | | // }else if(this.symbol=='egt'){ |
| | | // this.symbol = 'ethw' |
| | | // }else{ |
| | | // } |
| | | // // this.initParam(this.symbol) |
| | | // }else{ |
| | | // // this.symbol = this.$route.params.symbol.toLowerCase() |
| | | // } |
| | | // this.symbol = this.$route.params.symbol.toLowerCase() |
| | | // this.symbol = this.$route.params.symbol.toLowerCase() |
| | | // this.newname = this.symbol |
| | | // }else{ |
| | | // // this.symbol = 'wld' |
| | | // // this.initParam(this.symbol) |
| | | this.$forceUpdate() |
| | | }, |
| | | onUpdate(symbol,name) { |
| | |
| | | } |
| | | }, |
| | | startDeepSocket() { |
| | | if(this.symbol=='orbital'){ |
| | | this.symbol = 'mother' |
| | | } |
| | | if(this.symbol=='zyd'){ |
| | | this.symbol = 'zkp' |
| | | } |
| | | if(this.symbol=='dea'){ |
| | | this.symbol = 'dia' |
| | | } |
| | | if(this.symbol=='axfd'){ |
| | | this.symbol = 'xeta' |
| | | } |
| | | if(this.symbol=='smk'){ |
| | | this.symbol = 'og' |
| | | } |
| | | if(this.symbol=='fpp'){ |
| | | this.symbol = 'fil' |
| | | } |
| | | if(this.symbol=='ask'){ |
| | | this.symbol = 'gas' |
| | | } |
| | | if(this.symbol=='jkrt'){ |
| | | this.symbol = 'axs' |
| | | } |
| | | if(this.symbol=='egt'){ |
| | | this.symbol = 'ethw' |
| | | } |
| | | console.log('这里',this.symbol); |
| | | // 开启socket链接 |
| | | if(this.typeindex==0){ |
| | | this.closeSocketa(); |
| | | }else{ |
| | | this.closeSocket(); |
| | | } |
| | | |
| | | // if(this.typeindex==0){ |
| | | // this.closeSocketa(); |
| | | // }else{ |
| | | // this.closeSocket(); |
| | | // } |
| | | this.socket = new WebSocket(`${WS_URL}/3/${this.symbol}`); |
| | | |
| | | this.socket.onopen = () => { |
| | |
| | | console.log("symbol", this.symbol); |
| | | if (!this.symbol) { |
| | | return; |
| | | } |
| | | if(this.symbol=='orbital'){ |
| | | this.symbol = 'mother' |
| | | } |
| | | if(this.symbol=='zyd'){ |
| | | this.symbol = 'zkp' |
| | | } |
| | | if(this.symbol=='dea'){ |
| | | this.symbol = 'dia' |
| | | } |
| | | if(this.symbol=='axfd'){ |
| | | this.symbol = 'xeta' |
| | | } |
| | | if(this.symbol=='smk'){ |
| | | this.symbol = 'og' |
| | | } |
| | | if(this.symbol=='fpp'){ |
| | | this.symbol = 'fil' |
| | | } |
| | | if(this.symbol=='ask'||this.symbol=='ASK'){ |
| | | this.symbol = 'gas' |
| | | } |
| | | if(this.symbol=='jkrt'){ |
| | | this.symbol = 'axs' |
| | | } |
| | | if(this.symbol=='egt'){ |
| | | this.symbol = 'ethw' |
| | | } |
| | | this.socket = new WebSocket(`${WS_URL}/1/${this.symbol}`); |
| | | this.socket.onmessage = (evt) => { |
| | |
| | | }, |
| | | init(symbol) { |
| | | // 初始化页面 |
| | | debugger |
| | | this.symbol = symbol.toLowerCase(); |
| | | this.fetchQoutes(symbol); |
| | | this.fetchDeepData(symbol); |
| | |
| | | }, |
| | | startQuoteSocket() { |
| | | // 行情socket |
| | | if(this.symbol=='orbital'){ |
| | | this.symbol = 'mother' |
| | | } |
| | | if(this.symbol=='zyd'){ |
| | | this.symbol = 'zkp' |
| | | } |
| | | if(this.symbol=='dea'){ |
| | | this.symbol = 'dia' |
| | | } |
| | | if(this.symbol=='axfd'){ |
| | | this.symbol = 'xeta' |
| | | } |
| | | if(this.symbol=='smk'){ |
| | | this.symbol = 'og' |
| | | } |
| | | if(this.symbol=='fpp'){ |
| | | this.symbol = 'fil' |
| | | } |
| | | if(this.symbol=='ask'||this.symbol=='ASK'){ |
| | | this.symbol = 'gas' |
| | | } |
| | | if(this.symbol=='jkrt'){ |
| | | this.symbol = 'axs' |
| | | } |
| | | if(this.symbol=='egt'){ |
| | | this.symbol = 'ethw' |
| | | } |
| | | this.sockets.quotes = new WebSocket(`${WS_URL}/1/${this.symbol}`); |
| | | // socket.onopen = () => { |
| | | // console.log('open') |
| | |
| | | symbol |
| | | }, |
| | | } = to; |
| | | let catchTradeSymbol = getStorage("tradeSymbol"); |
| | | if (catchTradeSymbol) { |
| | | symbol = catchTradeSymbol; |
| | | } |
| | | // let catchTradeSymbol = getStorage("tradeSymbol"); |
| | | // if (catchTradeSymbol) { |
| | | // symbol = catchTradeSymbol; |
| | | // } |
| | | if (symbol) { |
| | | // debugger |
| | | // if(that.typeindex==0){ |