|
@@ -8,6 +8,7 @@ const headerModel = require('../../../doraemon/models/header'); // 头部model |
|
@@ -8,6 +8,7 @@ const headerModel = require('../../../doraemon/models/header'); // 头部model |
8
|
const _ = require('lodash');
|
8
|
const _ = require('lodash');
|
9
|
const productProcess = require(`${global.utils}/product-process`);
|
9
|
const productProcess = require(`${global.utils}/product-process`);
|
10
|
const stdntMrktModel = require('../models/student-market');
|
10
|
const stdntMrktModel = require('../models/student-market');
|
|
|
11
|
+const yasProcess = require(`${global.utils}/yas-process`);
|
11
|
|
12
|
|
12
|
const userAcquireStatus = (uid, couponIds) => {
|
13
|
const userAcquireStatus = (uid, couponIds) => {
|
13
|
if (couponIds !== '') {
|
14
|
if (couponIds !== '') {
|
|
@@ -197,10 +198,21 @@ exports.index = (req, res, next) => { |
|
@@ -197,10 +198,21 @@ exports.index = (req, res, next) => { |
197
|
exports.newIndex = (req, res, next) => {
|
198
|
exports.newIndex = (req, res, next) => {
|
198
|
stdntMrktModel.getStudentGoods({
|
199
|
stdntMrktModel.getStudentGoods({
|
199
|
limit: req.query.limit || '60',
|
200
|
limit: req.query.limit || '60',
|
200
|
- stocknumber: req.query.stocknumber || '1'
|
201
|
+ stocknumber: req.query.stocknumber || '1',
|
|
|
202
|
+ isApp: req.yoho.isApp
|
201
|
}).then(result => {
|
203
|
}).then(result => {
|
202
|
let title = '有货学生专享优惠';
|
204
|
let title = '有货学生专享优惠';
|
203
|
|
205
|
|
|
|
206
|
+ if (req.yoho.isApp) {
|
|
|
207
|
+ _.forEach(result, goods => {
|
|
|
208
|
+ goods.url = yasProcess.addParamsToGoodsHref({
|
|
|
209
|
+ href: goods.url,
|
|
|
210
|
+ fromPageName: yasProcess.getPname(req),
|
|
|
211
|
+ fromPageParam: req.originalUrl
|
|
|
212
|
+ });
|
|
|
213
|
+ });
|
|
|
214
|
+ }
|
|
|
215
|
+
|
204
|
res.render('student-market-new', {
|
216
|
res.render('student-market-new', {
|
205
|
title: title,
|
217
|
title: title,
|
206
|
pageHeader: headerModel.setNav({
|
218
|
pageHeader: headerModel.setNav({
|