|
|
'use strict';
|
|
|
|
|
|
const api = global.yoho.API;
|
|
|
|
|
|
let _getProduct = function(o) {
|
|
|
return {
|
|
|
small_sort_id: o.small_sort_id,
|
...
|
...
|
@@ -30,12 +28,16 @@ const gender = { |
|
|
2: '2,3'
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
|
|
productLst: function(params) {
|
|
|
return api.get('', Object.assign({
|
|
|
method: 'app.search.newPromotion'
|
|
|
}, params), {
|
|
|
cache: true
|
|
|
class individuationModel extends global.yoho.BaseModel {
|
|
|
constructor(ctx) {
|
|
|
super(ctx);
|
|
|
}
|
|
|
productLst(params) {
|
|
|
return this.get({
|
|
|
data: Object.assign({
|
|
|
method: 'app.search.newPromotion'
|
|
|
}, params),
|
|
|
param: {cache: true}
|
|
|
}).then(res => {
|
|
|
var data = [],
|
|
|
lst = (res && res.data && res.data.product_list) || [];
|
...
|
...
|
@@ -45,19 +47,20 @@ module.exports = { |
|
|
});
|
|
|
return data;
|
|
|
});
|
|
|
},
|
|
|
maybeLikeList: function(params) {
|
|
|
return api.get('', {
|
|
|
method: 'app.home.newPreference',
|
|
|
uid: params.uid || 0,
|
|
|
udid: params.udid || 0,
|
|
|
yh_channel: params.yh_channel,
|
|
|
limit: params.limit || 60,
|
|
|
need_filter: 'null',
|
|
|
rec_pos: '100053',
|
|
|
gender: params.gender || gender[params.yh_channel]
|
|
|
}, {
|
|
|
cache: true
|
|
|
}
|
|
|
maybeLikeList(params) {
|
|
|
return this.get({
|
|
|
data: {
|
|
|
method: 'app.home.newPreference',
|
|
|
uid: params.uid || 0,
|
|
|
udid: params.udid || 0,
|
|
|
yh_channel: params.yh_channel,
|
|
|
limit: params.limit || 60,
|
|
|
need_filter: 'null',
|
|
|
rec_pos: '100053',
|
|
|
gender: params.gender || gender[params.yh_channel]
|
|
|
},
|
|
|
param: {cache: true}
|
|
|
}).then(res => {
|
|
|
var data = [],
|
|
|
lst = (res && res.data && res.data.product_list) || [];
|
...
|
...
|
@@ -67,12 +70,16 @@ module.exports = { |
|
|
});
|
|
|
return data;
|
|
|
});
|
|
|
},
|
|
|
getCoupon: function(params) {
|
|
|
return api.get('', Object.assign({
|
|
|
method: 'app.coupons.personalCoupons'
|
|
|
}, params), {
|
|
|
cache: true
|
|
|
}
|
|
|
getCoupon(params) {
|
|
|
return this.get({
|
|
|
data: Object.assign({
|
|
|
method: 'app.coupons.personalCoupons'
|
|
|
}, params),
|
|
|
param: {cache: true}
|
|
|
});
|
|
|
}
|
|
|
}; |
|
|
|
|
|
}
|
|
|
|
|
|
module.exports = individuationModel; |
...
|
...
|
|