Authored by 郭成尧

student-market

... ... @@ -8,6 +8,7 @@ const headerModel = require('../../../doraemon/models/header'); // 头部model
const _ = require('lodash');
const productProcess = require(`${global.utils}/product-process`);
const stdntMrktModel = require('../models/student-market');
const yasProcess = require(`${global.utils}/yas-process`);
const userAcquireStatus = (uid, couponIds) => {
if (couponIds !== '') {
... ... @@ -197,10 +198,21 @@ exports.index = (req, res, next) => {
exports.newIndex = (req, res, next) => {
stdntMrktModel.getStudentGoods({
limit: req.query.limit || '60',
stocknumber: req.query.stocknumber || '1'
stocknumber: req.query.stocknumber || '1',
isApp: req.yoho.isApp
}).then(result => {
let title = '有货学生专享优惠';
if (req.yoho.isApp) {
_.forEach(result, goods => {
goods.url = yasProcess.addParamsToGoodsHref({
href: goods.url,
fromPageName: yasProcess.getPname(req),
fromPageParam: req.originalUrl
});
});
}
res.render('student-market-new', {
title: title,
pageHeader: headerModel.setNav({
... ...
... ... @@ -19,7 +19,7 @@ const getStudentGoods = (params) => {
limit: params.limit,
stocknumber: params.stocknumber,
}).then(result => {
return productProcess.processProductList(_.get(result, 'data.product_list', []));
return productProcess.processProductList(_.get(result, 'data.product_list', []), {isApp: params.isApp});
});
};
... ...
... ... @@ -44,11 +44,9 @@ const _handleOpenbyParams = (params) => {
return params.openbyStr;
}
if (!_.isEmpty(openByParamObj)) {
_.assign(openByParamObj, {
from_page_name: params.fromPageName,
from_page_param: params.fromPageParam
});
if (!_.isEmpty(openByParamObj) && _.has(openByParamObj, 'params')) {
openByParamObj.params.from_page_name = params.fromPageName;
openByParamObj.params.from_page_param = params.fromPageParam;
openByStrNew = `${paramsKeyStr}${JSON.stringify(openByParamObj)}`;
}
... ...