fix
This commit is contained in:
@@ -599,8 +599,13 @@
|
||||
async handleClick(tab) {
|
||||
if(tab.label === '自选') {
|
||||
let item = await this.getFavoriteData();
|
||||
this.marketList[tab.index].markets = item[0].markets;
|
||||
this.subscribeAllMarkets()
|
||||
if(item && item.length > 0) {
|
||||
this.marketList[tab.index].markets = item[0].markets;
|
||||
this.subscribeAllMarkets()
|
||||
} else {
|
||||
// 没有自选市场,显示空列表
|
||||
this.marketList[tab.index].markets = [];
|
||||
}
|
||||
}else{
|
||||
this.activeIndex = parseInt(tab.index);
|
||||
this.subscribeMarkets(this.activeName);
|
||||
@@ -610,10 +615,13 @@
|
||||
async getFavoriteData () {
|
||||
this.userFavorites = [];
|
||||
let item = await tradeApi.serverFavorite(this.token);
|
||||
item.data[0].markets.map(v=>{
|
||||
this.userFavorites.push(v.symbol.toLowerCase());
|
||||
});
|
||||
return item.data;
|
||||
if(item.data && item.data.length > 0 && item.data[0].markets) {
|
||||
item.data[0].markets.map(v=>{
|
||||
this.userFavorites.push(v.symbol.toLowerCase());
|
||||
});
|
||||
return item.data;
|
||||
}
|
||||
return [];
|
||||
},
|
||||
isNumber(val) {
|
||||
var regPos = /^\d+(\.\d+)?$/; //非负浮点数
|
||||
|
||||
Reference in New Issue
Block a user