Browse Source

修改

master
liaoxinyu 6 months ago
parent
commit
6055f922d2
  1. 7
      build/webpack.prod.conf.js
  2. 39
      src/views/contract/index.vue

7
build/webpack.prod.conf.js

@ -53,7 +53,12 @@ const webpackConfig = merge(baseWebpackConfig, {
new UglifyJsPlugin({
uglifyOptions: {
compress: {
warnings: false
warnings: false,
drop_console: true, // 移除console
pure_funcs: ['console.log','console.info'] // 移除console.log
},
output: {
comments: true // 移除所有注释
}
},
sourceMap: config.build.productionSourceMap,

39
src/views/contract/index.vue

@ -95,7 +95,7 @@
:key="item.symbol"
:class="{ active: item.symbol == activeSymbol }"
@click="ispopover1(item.symbol)"
v-show="isShow(item)"
v-if="isShow(item)"
style="display:block"
>
<td style="display:block;width:100%;border:none;">
@ -370,10 +370,11 @@ export default {
if (sub == msg) {
if( data.symbol=='BTC' )(data.price).toFixed(1)
this.contractList = data;
// if(this.filterCoin==''){
// this.contractListFilter = data;
// // this.Listes();
// }
if(this.filterCoin==''){
// console.log('123');
this.contractListFilter = data;
// this.Listes();
}
}else if (cmd == "ping") {
this.ws.send({
cmd: "pong"
@ -409,11 +410,12 @@ export default {
if(this.activeSymbol==''){
//
this.contractList = res;
this.Listes();
// if(this.filterCoin==''){
// this.contractListFilter = res;
// this.Listes();
// }
if(this.filterCoin==''){
// console.log('1234');
this.contractListFilter = res;
this.Listes();
}
//
let firstParent = res[0];
@ -482,16 +484,19 @@ export default {
},
isShow(symbol) {
const reg = new RegExp(this.filterCoin, "gi");
if (!this.filterCoin) return true;
else {
// let name = symbol.coinName || symbol.pair;
// return name.search(reg) >= 0;
let name = symbol.pair_name || symbol.symbol;
return reg.test(name);
// return name.search(reg) >= 0;
}
return name.toLowerCase().includes(this.filterCoin.toLowerCase());
// const reg = new RegExp(this.filterCoin, "gi");
// if (!this.filterCoin) return true;
// else {
// // let name = symbol.coinName || symbol.pair;
// // return name.search(reg) >= 0;
// let name = symbol.pair_name || symbol.symbol;
// console.log(reg.test(name),'12345');
// return reg.test(name);
// // return name.search(reg) >= 0;
// }
// return !this.keyword || symbol.coinName.concat(symbol.pair).search(reg) >= 0;
},

Loading…
Cancel
Save