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({ 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,

39
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();
// if(this.filterCoin==''){
// this.contractListFilter = res;
// this.Listes(); // this.Listes();
// } if(this.filterCoin==''){
// console.log('1234');
this.contractListFilter = res;
this.Listes();
}
// //
let firstParent = res[0]; let firstParent = res[0];
@ -482,16 +484,19 @@ export default {
}, },
isShow(symbol) { isShow(symbol) {
const reg = new RegExp(this.filterCoin, "gi");
if (!this.filterCoin) return true; if (!this.filterCoin) return true;
else {
// let name = symbol.coinName || symbol.pair;
// return name.search(reg) >= 0;
let name = symbol.pair_name || symbol.symbol; let name = symbol.pair_name || symbol.symbol;
return reg.test(name); return name.toLowerCase().includes(this.filterCoin.toLowerCase());
// return name.search(reg) >= 0; // 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; // return !this.keyword || symbol.coinName.concat(symbol.pair).search(reg) >= 0;
}, },

Loading…
Cancel
Save