...
|
...
|
@@ -109,3 +109,36 @@ exports.coupon = function(req, res, next) { |
|
|
res.jsonp(result);
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
exports.shop = function(req, res, next) {
|
|
|
// let activity_template_id = req.query.activity_id;
|
|
|
let uid = req.user.uid || req.query.uid;
|
|
|
let app = req.query.app;
|
|
|
|
|
|
if (app && app.app_version && app.client_type && app.session_key && app.uid) {
|
|
|
uid = {
|
|
|
toString: () => {
|
|
|
return _.parseInt(app.uid);
|
|
|
},
|
|
|
sessionKey: app.session_key,
|
|
|
appVersion: app.app_version,
|
|
|
appSessionType: app.client_type
|
|
|
};
|
|
|
}
|
|
|
|
|
|
const params = Object.assign({
|
|
|
limit: 12,
|
|
|
yh_channel: (req.yoho.channel && channels[req.yoho.channel]) || '1',
|
|
|
imageType: req.query.displayStyle === '1' ? '1' : '2',
|
|
|
season: req.query.season || '1',
|
|
|
port: '1'
|
|
|
}, req.query.searchCondition);
|
|
|
|
|
|
if (uid && uid.toString()) {
|
|
|
params.uid = uid;
|
|
|
}
|
|
|
|
|
|
req.ctx(model).getShop(params).then((result) => {
|
|
|
res.jsonp(result);
|
|
|
}).catch(next);
|
|
|
}; |
...
|
...
|
|