...
|
...
|
@@ -154,47 +154,49 @@ const recordContent = (uid, udid, page, limit) => { |
|
|
|
|
|
return api.get('', {
|
|
|
method: 'app.browse.product',
|
|
|
uid: uid || 6228593, // TODO
|
|
|
uid: uid,
|
|
|
limit: limit,
|
|
|
page: page
|
|
|
}, {code: 200}).then((result) => {
|
|
|
|
|
|
let resu = {
|
|
|
browseRecord: []
|
|
|
};
|
|
|
let resu = {};
|
|
|
|
|
|
if (result && result.code === 200) {
|
|
|
|
|
|
let list = result;
|
|
|
|
|
|
// 不能再查到结果了
|
|
|
if (page > 1 && list === []) {
|
|
|
if (!result || page === '1' && result.data.total === 0) {
|
|
|
resu.walkwayUrl = helpers.urlFormat('/product/new');
|
|
|
resu.noRecord = true;
|
|
|
}
|
|
|
|
|
|
if (result.data.total === 0) {
|
|
|
resu.total = 0;
|
|
|
return resu;
|
|
|
}
|
|
|
|
|
|
|
|
|
_.forEach(list.data.product_list, function(val) {
|
|
|
let obj = {
|
|
|
productList: []
|
|
|
if (list.data && list.data.product_list) {
|
|
|
resu = {
|
|
|
browseRecord: []
|
|
|
};
|
|
|
|
|
|
|
|
|
obj = _.assign(obj, {
|
|
|
product_name: val.product_name,
|
|
|
product_skn: val.product_skn,
|
|
|
storage: val.storage,
|
|
|
image: val.image,
|
|
|
link: '/product/show_' + val.product_skn + '.html',
|
|
|
sales_price: val.sales_price,
|
|
|
market_price: (val.market_price - val.sales_price) > 0 ? val.market_price : false,
|
|
|
invalidGoods: val.status === 0
|
|
|
_.forEach(list.data.product_list, function(val) {
|
|
|
let obj = {
|
|
|
productList: []
|
|
|
};
|
|
|
|
|
|
obj = _.assign(obj, {
|
|
|
product_name: val.product_name,
|
|
|
product_skn: val.product_skn,
|
|
|
storage: val.storage,
|
|
|
image: val.image,
|
|
|
link: '/product/show_' + val.product_skn + '.html',
|
|
|
sales_price: val.sales_price,
|
|
|
market_price: (val.market_price - val.sales_price) > 0 ? val.market_price : false,
|
|
|
invalidGoods: val.status === 0
|
|
|
});
|
|
|
|
|
|
resu.browseRecord.push(obj);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
resu.browseRecord.push(obj);
|
|
|
});
|
|
|
return resu;
|
|
|
}
|
|
|
});
|
...
|
...
|
|