Browse Source

修改合约价格

master
liaoxinyu 2 years ago
parent
commit
c1ff8cf985
  1. 27
      src/views/contract/index.vue

27
src/views/contract/index.vue

@ -74,7 +74,7 @@
<input type="text" :placeholder="$t('exchange.search')" v-model="filterCoin" @input="enterFilter"> <input type="text" :placeholder="$t('exchange.search')" v-model="filterCoin" @input="enterFilter">
</div> </div>
<div class="bottom-box-left"> <div class="bottom-box-left">
<template v-for="parent in contractListFilter"> <template v-for="parent in contractList">
<table class="table" :key="parent.coin_name + 1"> <table class="table" :key="parent.coin_name + 1">
<thead> <thead>
<tr> <tr>
@ -107,7 +107,7 @@
</div> </div>
</div> </div>
<div class="text-right width-32"> <div class="text-right width-32">
{{ item.close }} {{ item.price }}
</div> </div>
<div class="text-right width-32" :class="item.increase < 0 ? 'decreace' : 'increase'"> <div class="text-right width-32" :class="item.increase < 0 ? 'decreace' : 'increase'">
{{ item.increaseStr }} {{ item.increaseStr }}
@ -321,6 +321,7 @@ export default {
}); });
// console.info(this.$refs) // console.info(this.$refs)
bus.$on('collapse', msg => { bus.$on('collapse', msg => {
console.log(msg.close);
this.activeContract.price =this.activeContract.symbol=='BTC'? (msg.close).toFixed(1):(msg.close).toFixed(3); this.activeContract.price =this.activeContract.symbol=='BTC'? (msg.close).toFixed(1):(msg.close).toFixed(3);
this.holdPositionList.map(item=>{ this.holdPositionList.map(item=>{
if(item.symbol==this.activeContract.symbol) item.realtimePrice=this.activeContract.price if(item.symbol==this.activeContract.symbol) item.realtimePrice=this.activeContract.price
@ -353,10 +354,10 @@ export default {
if (sub == msg) { if (sub == msg) {
if( data.symbol=='BTC' )(data.price).toFixed(1) if( data.symbol=='BTC' )(data.price).toFixed(1)
this.contractList = data; this.contractList = data;
if(this.filterCoin==''){ // if(this.filterCoin==''){
this.contractListFilter = data; // this.contractListFilter = data;
// this.Listes(); // // this.Listes();
} // }
}else if (cmd == "ping") { }else if (cmd == "ping") {
this.ws.send({ this.ws.send({
cmd: "pong" cmd: "pong"
@ -371,7 +372,7 @@ export default {
}, },
Listes(){ Listes(){
this.Liste = [] this.Liste = []
this.contractListFilter[0].marketInfoList.map(item=>{ this.contractList[0].marketInfoList.map(item=>{
this.Liste.push({ this.Liste.push({
pair_name: item.pair_name, pair_name: item.pair_name,
symbol: item.symbol, symbol: item.symbol,
@ -392,10 +393,11 @@ export default {
if(this.activeSymbol==''){ if(this.activeSymbol==''){
// //
this.contractList = res; this.contractList = res;
if(this.filterCoin==''){ this.Listes();
this.contractListFilter = res; // if(this.filterCoin==''){
this.Listes(); // this.contractListFilter = res;
} // this.Listes();
// }
// //
let firstParent = res[0]; let firstParent = res[0];
@ -471,7 +473,8 @@ export default {
// let name = symbol.coinName || symbol.pair; // let name = symbol.coinName || symbol.pair;
// return name.search(reg) >= 0; // return name.search(reg) >= 0;
let name = symbol.pair_name || symbol.symbol; let name = symbol.pair_name || symbol.symbol;
return name.search(reg) >= 0; return reg.test(name);
// return name.search(reg) >= 0;
} }
// return !this.keyword || symbol.coinName.concat(symbol.pair).search(reg) >= 0; // return !this.keyword || symbol.coinName.concat(symbol.pair).search(reg) >= 0;

Loading…
Cancel
Save