Authored by 沈志敏

fix bug

... ... @@ -65,14 +65,15 @@
tab: 'brand'
}
}).then(data => {
if (_this.page === data.pageTotal) {
if (data.pageTotal && _this.page === data.pageTotal) {
_this.busy = true;
} else {
_this.busy = false;
}
data.brandList.forEach(function(o){
if (!_this.keys[o.brandId]) {
if (data.brandList) {
data.brandList.forEach(function(o){
if (!_this.keys[o.brandId]) {
_this.keys[o.brandId] = true;
_this.brandData.push({
... ... @@ -83,7 +84,8 @@
down: o.status === 0
});
}
})
});
}
_this.nullbox = _this.brandData.length ? 'hide' : '';
}).fail(() => {
... ...
... ... @@ -69,38 +69,40 @@
page: ++_this.page
}
}).then(data => {
if (_this.page === data.pageTotal) {
if (data.pageTotal && _this.page === data.pageTotal) {
_this.busy = true;
} else {
_this.busy = false;
}
data.productList.forEach(function(o){
if (!o.productSkn) {
return;
}
if (!_this.keys[o.productId]) {
_this.keys[o.productId] = true;
let discountPrice = false;
if (Number(o.marketPrice) - Number(o.salesPrice) > 0) {
discountPrice = '¥' + Number(Math.max(o.salesPrice, 0)).toFixed(2);
if (data.productList) {
data.productList.forEach(function(o){
if (!o.productSkn) {
return;
}
_this.productData.push({
fav_id: o.productId,
link: o.goodsId && o.cnAlphabet ? o.productId : '',
imgUrl: o.image,
title: o.productName,
price: '¥' + Number(Math.max(o.marketPrice, 0)).toFixed(2),
discountPrice: discountPrice,
sellOut: o.storage <= 0,
invalidGoods: o.status === 0
});
}
})
if (!_this.keys[o.productId]) {
_this.keys[o.productId] = true;
let discountPrice = false;
if (Number(o.marketPrice) - Number(o.salesPrice) > 0) {
discountPrice = '¥' + Number(Math.max(o.salesPrice, 0)).toFixed(2);
}
_this.productData.push({
fav_id: o.productId,
link: o.goodsId && o.cnAlphabet ? o.productId : '',
imgUrl: o.image,
title: o.productName,
price: '¥' + Number(Math.max(o.marketPrice, 0)).toFixed(2),
discountPrice: discountPrice,
sellOut: o.storage <= 0,
invalidGoods: o.status === 0
});
}
});
}
_this.nullbox = _this.productData.length ? 'hide' : '';
}).fail(() => {
... ...