Showing
1 changed file
with
28 additions
and
11 deletions
@@ -166,7 +166,9 @@ const getFilterValueForSeo = (queryParams, apiData) => { | @@ -166,7 +166,9 @@ const getFilterValueForSeo = (queryParams, apiData) => { | ||
166 | seniors.push(seoParams.style); | 166 | seniors.push(seoParams.style); |
167 | } | 167 | } |
168 | 168 | ||
169 | - seoParams.senior = _.join(seniors, ','); | 169 | + if (seniors.length) { |
170 | + seoParams.senior = _.join(seniors, ','); | ||
171 | + } | ||
170 | 172 | ||
171 | return seoParams; | 173 | return seoParams; |
172 | }; | 174 | }; |
@@ -178,11 +180,8 @@ const getFilterValueForSeo = (queryParams, apiData) => { | @@ -178,11 +180,8 @@ const getFilterValueForSeo = (queryParams, apiData) => { | ||
178 | * @param isNewArrival 是否是新品到着 | 180 | * @param isNewArrival 是否是新品到着 |
179 | */ | 181 | */ |
180 | const getListSeoData = (params, isNewArrival) => { | 182 | const getListSeoData = (params, isNewArrival) => { |
181 | - let seoData = { | ||
182 | - title: '【潮流商品】_潮流男装_潮流女装_潮流童装-YOHO!BUY 有货', | ||
183 | - keywords: '潮流服装配饰,创意生活用品,男生服装配饰,女生服装配饰,潮童服装配饰', | ||
184 | - description: '潮流网购就上YOHO!BUY有货,有货网潮流商品专卖店提供潮流商品品牌、潮流商品价格、潮流商品图片等信息。销售正品新款潮流男装、潮流女装、潮流童装,全场低至4折,★全场品牌正品保证,支持货到付款!★' // eslint-disable-line | ||
185 | - }; | 183 | + let genderName = params.channel; |
184 | + let seoData = {}; | ||
186 | let seoParams = { | 185 | let seoParams = { |
187 | color: '', | 186 | color: '', |
188 | size: '', | 187 | size: '', |
@@ -195,14 +194,32 @@ const getListSeoData = (params, isNewArrival) => { | @@ -195,14 +194,32 @@ const getListSeoData = (params, isNewArrival) => { | ||
195 | channel: '' | 194 | channel: '' |
196 | }; | 195 | }; |
197 | 196 | ||
198 | - if (params) { | ||
199 | - _.assign(seoParams, params); | 197 | + delete params.channel; |
200 | 198 | ||
199 | + if (_.isEmpty(params)) { | ||
201 | seoData = { | 200 | seoData = { |
202 | - title: `【${seoParams.channel}${seoParams.color}${seoParams.senior}${seoParams.brand}${seoParams.sort}${isNewArrival ? '新品': ''}】_价格,图片,款式-YOHO!BUY 有货`, // eslint-disable-line | ||
203 | - keywords: `${seoParams.channel}${seoParams.color}${seoParams.senior}${seoParams.brand}${seoParams.sort}`, // eslint-disable-line | ||
204 | - description: `潮流网购就上YOHO!BUY有货,有货网${seoParams.sort}专卖店提供${seoParams.sort}品牌、${seoParams.sort}价格、${seoParams.sort}图片等信息。销售正品新款${seoParams.sort},全场低至4折,★全场品牌正品保证,支持货到付款!★` // eslint-disable-line | 201 | + title: '【潮流商品】_潮流男装_潮流女装_潮流童装-YOHO!BUY 有货', |
202 | + keywords: '潮流服装配饰,创意生活用品,男生服装配饰,女生服装配饰,潮童服装配饰', | ||
203 | + description: '潮流网购就上YOHO!BUY有货,有货网潮流商品专卖店提供潮流商品品牌、潮流商品价格、潮流商品图片等信息。销售正品新款潮流男装、潮流女装、潮流童装,全场低至4折,★全场品牌正品保证,支持货到付款!★' // eslint-disable-line | ||
205 | }; | 204 | }; |
205 | + } else { | ||
206 | + _.assign(seoParams, params); | ||
207 | + | ||
208 | + delete params.sort; | ||
209 | + | ||
210 | + if (_.isEmpty(params)) { | ||
211 | + seoData = { | ||
212 | + title: `【${seoParams.sort}${isNewArrival ? '新品': ''}】_${seoParams.sort}价格,${seoParams.sort}图片,${seoParams.sort}款式-YOHO!BUY 有货`, // eslint-disable-line | ||
213 | + keywords: `${seoParams.sort},${seoParams.sort}品牌,${seoParams.sort}价格,${seoParams.sort}图片`, // eslint-disable-line | ||
214 | + description: `潮流网购就上YOHO!BUY有货,有货网${seoParams.sort}专卖店提供${seoParams.sort}品牌、${seoParams.sort}价格、${seoParams.sort}图片等信息。销售正品新款${seoParams.sort},全场低至4折,★全场品牌正品保证,支持货到付款!★` // eslint-disable-line | ||
215 | + }; | ||
216 | + } else { | ||
217 | + seoData = { | ||
218 | + title: `【${genderName}${seoParams.color}${seoParams.senior}${seoParams.brand}${seoParams.sort}${isNewArrival ? '新品': ''}】_价格,图片,款式-YOHO!BUY 有货`, // eslint-disable-line | ||
219 | + keywords: `${genderName}${seoParams.color}${seoParams.senior}${seoParams.brand}${seoParams.sort}`, // eslint-disable-line | ||
220 | + description: `潮流网购就上YOHO!BUY有货,有货网${seoParams.sort}专卖店提供${seoParams.sort}品牌、${seoParams.sort}价格、${seoParams.sort}图片等信息。销售正品新款${seoParams.sort},全场低至4折,★全场品牌正品保证,支持货到付款!★` // eslint-disable-line | ||
221 | + }; | ||
222 | + } | ||
206 | } | 223 | } |
207 | return seoData; | 224 | return seoData; |
208 | }; | 225 | }; |
-
Please register or login to post a comment