Browse Source

修改

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

9
build/webpack.prod.conf.js

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

45
src/views/contract/index.vue

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

Loading…
Cancel
Save