Merge branch 'gray' into 'master'
Gray See merge request !98
Showing
8 changed files
with
47 additions
and
33 deletions
@@ -78,7 +78,11 @@ const handleBrandList = origin => { | @@ -78,7 +78,11 @@ const handleBrandList = origin => { | ||
78 | brands.push({ | 78 | brands.push({ |
79 | name: subValue.brand_name_en || subValue.brand_name_cn || subValue.brand_name, | 79 | name: subValue.brand_name_en || subValue.brand_name_cn || subValue.brand_name, |
80 | logo: subValue.brand_ico, | 80 | logo: subValue.brand_ico, |
81 | - domain: subValue.brand_domain | 81 | + domain: subValue.brand_domain, |
82 | + shopId: subValue.shop_id, | ||
83 | + shopName: subValue.brand_name_en || subValue.brand_name_cn || subValue.brand_name, | ||
84 | + isRedShop: subValue.is_red_shop, | ||
85 | + shopTemplateType: subValue.shop_template_type | ||
82 | }); | 86 | }); |
83 | }); | 87 | }); |
84 | dest.brandList.push({ | 88 | dest.brandList.push({ |
@@ -20,10 +20,7 @@ exports.index = (req, res) => { | @@ -20,10 +20,7 @@ exports.index = (req, res) => { | ||
20 | 20 | ||
21 | /* 查询 产品列表 */ | 21 | /* 查询 产品列表 */ |
22 | exports.fetchProducts = (req, res, next) => { | 22 | exports.fetchProducts = (req, res, next) => { |
23 | - const params = req.query; | ||
24 | - | ||
25 | - params.gender = ''; | ||
26 | - model.products(params) | 23 | + model.products(req.query) |
27 | .then(result => res.json(result)) | 24 | .then(result => res.json(result)) |
28 | .catch(next); | 25 | .catch(next); |
29 | }; | 26 | }; |
@@ -4,15 +4,11 @@ | @@ -4,15 +4,11 @@ | ||
4 | * @author: Aiden Xu<aiden.xu@yoho.cn> | 4 | * @author: Aiden Xu<aiden.xu@yoho.cn> |
5 | * @date: 2016/4/27 | 5 | * @date: 2016/4/27 |
6 | */ | 6 | */ |
7 | -const channelGender = require('./doraemon/middleware/channel-gender').channelGender; | ||
8 | 7 | ||
9 | module.exports = app => { | 8 | module.exports = app => { |
10 | app.use('/', require('./apps/channel')); // 一级频道模块 | 9 | app.use('/', require('./apps/channel')); // 一级频道模块 |
11 | // 商品模块 | 10 | // 商品模块 |
12 | - app.use('/' | ||
13 | - , channelGender | ||
14 | - , require('./apps/product') | ||
15 | - ); | 11 | + app.use('/', require('./apps/product')); |
16 | app.use('/', require('./apps/me')); // 个人中心 | 12 | app.use('/', require('./apps/me')); // 个人中心 |
17 | app.use('/api', require('./apps/api')); // 各模块公有 API | 13 | app.use('/api', require('./apps/api')); // 各模块公有 API |
18 | app.use('/editorial', require('./apps/editorial')); // 资讯 | 14 | app.use('/editorial', require('./apps/editorial')); // 资讯 |
@@ -114,11 +114,29 @@ const getChannel = function() { | @@ -114,11 +114,29 @@ const getChannel = function() { | ||
114 | }); | 114 | }); |
115 | }; | 115 | }; |
116 | 116 | ||
117 | +const miniVersion = function (miniVersion) { | ||
118 | + let appVersion = cookie.get('app_version'); | ||
119 | + let miniVersions = miniVersion.split('.'); | ||
120 | + | ||
121 | + if (appVersion && typeof appVersion === 'string') { | ||
122 | + let versions = appVersion.split('.'); | ||
123 | + | ||
124 | + if (versions.length === 3 && | ||
125 | + (+versions[0] > +miniVersions[0] || | ||
126 | + (+versions[0] === +miniVersions[0] && +versions[1] > +miniVersions[1]) || | ||
127 | + (+versions[0] === +miniVersions[0] && +versions[1] === +miniVersions[1] && +versions[2] >= +miniVersions[2]))) { | ||
128 | + return true; | ||
129 | + } | ||
130 | + } | ||
131 | + return false; | ||
132 | +}; | ||
133 | + | ||
117 | export default { | 134 | export default { |
118 | getImgHost, | 135 | getImgHost, |
119 | getImgUrl, | 136 | getImgUrl, |
120 | applySuccuss, | 137 | applySuccuss, |
121 | visibilitychange, | 138 | visibilitychange, |
122 | getChannel, | 139 | getChannel, |
123 | - replaceHttp | 140 | + replaceHttp, |
141 | + miniVersion | ||
124 | }; | 142 | }; |
@@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
5 | * @Last Modified time: 2016-08-02 17:42:26 | 5 | * @Last Modified time: 2016-08-02 17:42:26 |
6 | */ | 6 | */ |
7 | import yoho from 'yoho'; | 7 | import yoho from 'yoho'; |
8 | +import cookie from 'yoho-cookie'; | ||
8 | import util from 'common/util'; | 9 | import util from 'common/util'; |
9 | 10 | ||
10 | function ImgSrcBinding(el, binding) { | 11 | function ImgSrcBinding(el, binding) { |
@@ -42,32 +43,31 @@ function BrandHrefBinding(el, binding) { | @@ -42,32 +43,31 @@ function BrandHrefBinding(el, binding) { | ||
42 | 43 | ||
43 | href += `?openby:yohobuy=${JSON.stringify(goParams)}`; | 44 | href += `?openby:yohobuy=${JSON.stringify(goParams)}`; |
44 | el.href = href; | 45 | el.href = href; |
45 | - return; | ||
46 | } | 46 | } |
47 | 47 | ||
48 | if (yoho.isYohoBuy && !shopId) { | 48 | if (yoho.isYohoBuy && !shopId) { |
49 | yoho.ready(function () { | 49 | yoho.ready(function () { |
50 | - yoho.getAppVersion({}, (version) => { | ||
51 | - if (version >= '6.5.5') { | ||
52 | - let { name } = binding.value; | ||
53 | - let goParams = { | ||
54 | - action: 'go.searchlist', | ||
55 | - params: { | ||
56 | - keyword: name | ||
57 | - } | ||
58 | - }; | ||
59 | - | ||
60 | - href += `?openby:yohobuy=${JSON.stringify(goParams)}`; | ||
61 | - el.href = href; | ||
62 | - } else { | ||
63 | - el.href = href; | ||
64 | - } | ||
65 | - }); | 50 | + if (util.miniVersion('6.5.5')) { |
51 | + let { name } = binding.value; | ||
52 | + | ||
53 | + let goParams = { | ||
54 | + action: 'go.searchlist', | ||
55 | + params: { | ||
56 | + keyword: name | ||
57 | + } | ||
58 | + }; | ||
59 | + | ||
60 | + href += `?openby:yohobuy=${JSON.stringify(goParams)}`; | ||
61 | + el.href = href; | ||
62 | + } else { | ||
63 | + el.href = href; | ||
64 | + } | ||
66 | }); | 65 | }); |
67 | - return; | ||
68 | } | 66 | } |
69 | 67 | ||
70 | - el.href = href; | 68 | + if (!yoho.isYohoBuy) { |
69 | + el.href = href; | ||
70 | + } | ||
71 | } else { | 71 | } else { |
72 | el.href = `/product/shop/${binding.value}`; | 72 | el.href = `/product/shop/${binding.value}`; |
73 | } | 73 | } |
@@ -347,7 +347,7 @@ export default { | @@ -347,7 +347,7 @@ export default { | ||
347 | _.each(this.filter.group_sort, item => { | 347 | _.each(this.filter.group_sort, item => { |
348 | temp = temp.concat(item.sub); | 348 | temp = temp.concat(item.sub); |
349 | }); | 349 | }); |
350 | - this.filterItems[0].choices = [{id: 1, name: '男'}, {id: 2, name: '女'}]; | 350 | + this.filterItems[0].choices = [{id: '1,3', name: '男'}, {id: '2,3', name: '女'}]; |
351 | this.filterItems[1].choices = this.filter.brand || []; | 351 | this.filterItems[1].choices = this.filter.brand || []; |
352 | this.filterItems[2].choices = temp; | 352 | this.filterItems[2].choices = temp; |
353 | this.filterItems[3].choices = this.filter.color || []; | 353 | this.filterItems[3].choices = this.filter.color || []; |
-
Please register or login to post a comment