Authored by 郭成尧

'shop-ok'

@@ -12,7 +12,7 @@ const _ = require('lodash'); @@ -12,7 +12,7 @@ const _ = require('lodash');
12 const helpers = global.yoho.helpers; 12 const helpers = global.yoho.helpers;
13 13
14 /** 14 /**
15 - * 店铺基础模板 15 + * 店铺 - 基础模板
16 */ 16 */
17 const _baseShop = (req, res, shopInfo) => { 17 const _baseShop = (req, res, shopInfo) => {
18 18
@@ -34,7 +34,7 @@ const _baseShop = (req, res, shopInfo) => { @@ -34,7 +34,7 @@ const _baseShop = (req, res, shopInfo) => {
34 }; 34 };
35 35
36 /** 36 /**
37 - * 店铺首页 || 若店铺使用基础模板就使用基础模板 37 + * 店铺首页
38 * @return int 38 * @return int
39 */ 39 */
40 const _shop = (req, res, shopId) => { 40 const _shop = (req, res, shopId) => {
@@ -68,7 +68,7 @@ const _shop = (req, res, shopId) => { @@ -68,7 +68,7 @@ const _shop = (req, res, shopId) => {
68 listModel.getShopData(req, shopId, uid, isApp).then(result => { 68 listModel.getShopData(req, shopId, uid, isApp).then(result => {
69 if (result.goBrand) { 69 if (result.goBrand) {
70 70
71 - // 跳转基础模板 71 + /* 若店铺使用基础模板跳转基础模板 */
72 _baseShop(req, res, result.goBrand); 72 _baseShop(req, res, result.goBrand);
73 } else { 73 } else {
74 result = _.assign(result, pageHeader); 74 result = _.assign(result, pageHeader);
@@ -101,7 +101,12 @@ const category = (req, res) => { @@ -101,7 +101,12 @@ const category = (req, res) => {
101 }); 101 });
102 }; 102 };
103 103
104 -// 品牌|店铺落地页 104 +/**
  105 + * 品牌店铺的入口
  106 + * @param req
  107 + * @param res
  108 + * @param next
  109 + */
105 const brand = (req, res, next) => { 110 const brand = (req, res, next) => {
106 let params = Object.assign({}, req.query); 111 let params = Object.assign({}, req.query);
107 let domain = req.query.domain; 112 let domain = req.query.domain;
@@ -179,7 +184,12 @@ const brand = (req, res, next) => { @@ -179,7 +184,12 @@ const brand = (req, res, next) => {
179 }).catch(next); 184 }).catch(next);
180 }; 185 };
181 186
182 -// 店铺简介 187 +/**
  188 + * 店铺简介
  189 + * @param req
  190 + * @param res
  191 + * @param next
  192 + */
183 const shopIntro = (req, res, next) => { 193 const shopIntro = (req, res, next) => {
184 let shopId = req.query.shop_id; 194 let shopId = req.query.shop_id;
185 let appVersion = req.body.appVersion || false; 195 let appVersion = req.body.appVersion || false;
@@ -455,15 +455,13 @@ const getShopData = (req, shopId, uid, isApp) => { @@ -455,15 +455,13 @@ const getShopData = (req, shopId, uid, isApp) => {
455 _getShopDecorator(shopId), 455 _getShopDecorator(shopId),
456 searchModel.getFilterData({ 456 searchModel.getFilterData({
457 shop_id: shopId, 457 shop_id: shopId,
458 - gender: '1,3', // TODO TAR 获取性别  
459 - channel: channel,  
460 - brand: '' // TODO TAR 获取品牌 458 + gender: req.query.gender || '1,3',
  459 + channel: channel
461 }), 460 }),
462 searchModel.getSearchData({ 461 searchModel.getSearchData({
463 shop_id: shopId, 462 shop_id: shopId,
464 - gender: '1,3', // TODO TAR 获取性别  
465 - channel: channel,  
466 - brand: '' // TODO TAR 获取品牌 463 + gender: req.query.gender || '1,3',
  464 + channel: channel
467 }) 465 })
468 ]).then((result) => { 466 ]).then((result) => {
469 shopData = { 467 shopData = {
@@ -479,7 +477,7 @@ const getShopData = (req, shopId, uid, isApp) => { @@ -479,7 +477,7 @@ const getShopData = (req, shopId, uid, isApp) => {
479 477
480 // noinspection JSCheckFunctionSignatures 478 // noinspection JSCheckFunctionSignatures
481 return Object.assign(_formShopData(shopData, shopId, isApp), 479 return Object.assign(_formShopData(shopData, shopId, isApp),
482 - {filter: result[1]}, {goods: result[2]}); // TODO TAR 获取筛选数据和商品数据数据校验 480 + {filter: result[1]}, {goods: result[2]});
483 }); 481 });
484 }); 482 });
485 483