...
|
...
|
@@ -144,49 +144,73 @@ const myDetails = (params) => { |
|
|
});
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 浏览记录
|
|
|
* @param params
|
|
|
*/
|
|
|
|
|
|
|
|
|
const record = (params) => {
|
|
|
const recordContent = (uid, udid, page, limit) => {
|
|
|
|
|
|
return api.get('', {
|
|
|
method: 'app.browse.product',
|
|
|
uid: params.uid || 6228593,
|
|
|
limit: 100,
|
|
|
page: 1
|
|
|
uid: uid || 6228593, // TODO
|
|
|
limit: limit,
|
|
|
page: page
|
|
|
}, {code: 200}).then((result) => {
|
|
|
|
|
|
let resu = {
|
|
|
recordResult: []
|
|
|
browseRecord: []
|
|
|
};
|
|
|
|
|
|
if (result && result.code === 200) {
|
|
|
let list = result;
|
|
|
|
|
|
// 不能再查到结果了
|
|
|
if (page > 1 && list === []) {
|
|
|
resu.noRecord = true;
|
|
|
}
|
|
|
|
|
|
if (result.data.total === 0) {
|
|
|
resu.total = 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
_.forEach(list.data.product_list, function(val) {
|
|
|
let obj = {
|
|
|
productList: []
|
|
|
};
|
|
|
|
|
|
|
|
|
_.forEach(result.data.product_list, function(val) {
|
|
|
let obj = {};
|
|
|
obj = _.assign(obj, {
|
|
|
product_name: val.product_name,
|
|
|
product_skn: val.product_skn,
|
|
|
invalidGoods: val.status === 0,
|
|
|
storage: val.storage
|
|
|
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.recordResult.push(obj);
|
|
|
|
|
|
resu.browseRecord.push(obj);
|
|
|
});
|
|
|
|
|
|
return resu;
|
|
|
}
|
|
|
|
|
|
// console.log(resu);
|
|
|
return resu;
|
|
|
});
|
|
|
};
|
|
|
|
|
|
const delRecord = (uid, skn) => {
|
|
|
return api.get('', {
|
|
|
method: 'app.browse.delete',
|
|
|
uid: uid,
|
|
|
skn: skn
|
|
|
});
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
|
|
index,
|
|
|
myDetails,
|
|
|
record
|
|
|
recordContent,
|
|
|
delRecord
|
|
|
}; |
...
|
...
|
|