Showing
1 changed file
with
38 additions
and
38 deletions
@@ -4,16 +4,15 @@ const _ = require('lodash'); | @@ -4,16 +4,15 @@ const _ = require('lodash'); | ||
4 | const camelCase = global.yoho.camelCase; | 4 | const camelCase = global.yoho.camelCase; |
5 | const helpers = global.yoho.helpers; | 5 | const helpers = global.yoho.helpers; |
6 | 6 | ||
7 | -// const images = require(`${global.utils}/images`); | ||
8 | - | ||
9 | -const itemFromBase = { | ||
10 | - search: {domain: 'search', module: 's'}, // 搜索页search.yohobuy.com | ||
11 | - list: {domain: 'list', module: 'c'}, // list.yohobuy.com | ||
12 | - listSale: {domain: 'list', module: 's'}, // list.yohobuy.com/sale | ||
13 | - listNew: {domain: 'list', module: 'n'}, // list.yohobuy.com/new | ||
14 | - brand: {domain: 'brand', module: 'b'}, // xxx.yohobuy.com[品牌域名] | ||
15 | - saleSpecial: {domain: 'sale', module: 's'}// sale.yohobuy.com | ||
16 | -}; | 7 | +// TODO 删除from参数,暂时保留注释 |
8 | +// const itemFromBase = { | ||
9 | +// search: {domain: 'search', module: 's'}, // 搜索页search.yohobuy.com | ||
10 | +// list: {domain: 'list', module: 'c'}, // list.yohobuy.com | ||
11 | +// listSale: {domain: 'list', module: 's'}, // list.yohobuy.com/sale | ||
12 | +// listNew: {domain: 'list', module: 'n'}, // list.yohobuy.com/new | ||
13 | +// brand: {domain: 'brand', module: 'b'}, // xxx.yohobuy.com[品牌域名] | ||
14 | +// saleSpecial: {domain: 'sale', module: 's'}// sale.yohobuy.com | ||
15 | +// }; | ||
17 | 16 | ||
18 | /** | 17 | /** |
19 | * 根据性别来决定 默认图片获取字段 如果是 2、3 | 18 | * 根据性别来决定 默认图片获取字段 如果是 2、3 |
@@ -112,8 +111,10 @@ const procCnAlphabetName = (nameStr) => { | @@ -112,8 +111,10 @@ const procCnAlphabetName = (nameStr) => { | ||
112 | */ | 111 | */ |
113 | exports.processProductList = (list, options) => { | 112 | exports.processProductList = (list, options) => { |
114 | const pruductList = []; | 113 | const pruductList = []; |
115 | - let itemNum = 0, | ||
116 | - itemFrom; | 114 | + |
115 | + // TODO 删除from参数,暂时保留注释 | ||
116 | + //let itemNum = 0, | ||
117 | + // itemFrom; | ||
117 | 118 | ||
118 | options = Object.assign({ | 119 | options = Object.assign({ |
119 | showTags: true, | 120 | showTags: true, |
@@ -131,24 +132,25 @@ exports.processProductList = (list, options) => { | @@ -131,24 +132,25 @@ exports.processProductList = (list, options) => { | ||
131 | from: {} // 来源 | 132 | from: {} // 来源 |
132 | }, options); | 133 | }, options); |
133 | 134 | ||
135 | + // TODO 删除from参数,暂时保留注释 | ||
134 | // 处理item from | 136 | // 处理item from |
135 | - if (!_.isEmpty(options.from) && itemFromBase[options.from.type]) { | ||
136 | - let f = {domain: '', module: '', key: ''}; | ||
137 | - let params = options.from.params || {}; | ||
138 | - | ||
139 | - f.page = params.page || 1; | ||
140 | - | ||
141 | - Object.assign(f, itemFromBase[options.from.type], { | ||
142 | - page: params.page || 1, | ||
143 | - key: params.misort || params.msort || '' | ||
144 | - }); | ||
145 | - | ||
146 | - if (options.from.type === 'search') { | ||
147 | - f.key = params.query || ''; | ||
148 | - } | ||
149 | - | ||
150 | - itemFrom = `from=${f.domain}-${f.module}-${f.key}_${f.page}_`; | ||
151 | - } | 137 | + // if (!_.isEmpty(options.from) && itemFromBase[options.from.type]) { |
138 | + // let f = {domain: '', module: '', key: ''}; | ||
139 | + // let params = options.from.params || {}; | ||
140 | + // | ||
141 | + // f.page = params.page || 1; | ||
142 | + // | ||
143 | + // Object.assign(f, itemFromBase[options.from.type], { | ||
144 | + // page: params.page || 1, | ||
145 | + // key: params.misort || params.msort || '' | ||
146 | + // }); | ||
147 | + // | ||
148 | + // if (options.from.type === 'search') { | ||
149 | + // f.key = params.query || ''; | ||
150 | + // } | ||
151 | + // | ||
152 | + // itemFrom = `from=${f.domain}-${f.module}-${f.key}_${f.page}_`; | ||
153 | + // } | ||
152 | 154 | ||
153 | _.forEach(list, (product) => { | 155 | _.forEach(list, (product) => { |
154 | 156 | ||
@@ -204,15 +206,13 @@ exports.processProductList = (list, options) => { | @@ -204,15 +206,13 @@ exports.processProductList = (list, options) => { | ||
204 | // tar add 1606071146 品牌链接处理 | 206 | // tar add 1606071146 品牌链接处理 |
205 | product.brandUrl = helpers.urlFormat('', '', product.brand_domain); | 207 | product.brandUrl = helpers.urlFormat('', '', product.brand_domain); |
206 | 208 | ||
207 | - // APP访问需要加附加的参数 | ||
208 | - // 备注:如果以后APP的接口太多,可以把这边参数提取出来,变成一个公共的方法来生成,便于以后管理维护 | ||
209 | - if (options.isApp) { | ||
210 | - product.url += `?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":'${product.product_id}'}}`; // eslint-disable-line | ||
211 | - } else if (itemFrom) { | ||
212 | - // 累加商品数量 | ||
213 | - itemNum++; | ||
214 | - product.url += `?${itemFrom}${itemNum}`; | ||
215 | - } | 209 | + // TODO 删除from参数,暂时保留注释 |
210 | + // if (itemFrom) { | ||
211 | + // // 累加商品数量 | ||
212 | + // itemNum++; | ||
213 | + // product.url += `?${itemFrom}${itemNum}`; | ||
214 | + // } | ||
215 | + | ||
216 | if (options.showTags) { | 216 | if (options.showTags) { |
217 | let tags = [], | 217 | let tags = [], |
218 | isfew = false; | 218 | isfew = false; |
-
Please register or login to post a comment