Merge remote-tracking branch 'origin/master' into feature/seo1113
Showing
5 changed files
with
9 additions
and
7 deletions
@@ -90,7 +90,7 @@ module.exports = class extends global.yoho.BaseModel { | @@ -90,7 +90,7 @@ module.exports = class extends global.yoho.BaseModel { | ||
90 | } | 90 | } |
91 | 91 | ||
92 | setDefaultAddress(uid, id) { | 92 | setDefaultAddress(uid, id) { |
93 | - id = crypto.decrypt('', `${id}`); | 93 | + id = parseInt(crypto.decrypt('', `${id}`), 10); |
94 | 94 | ||
95 | return new AddressApi(this.ctx).setDefaultAddressAsync(uid, id); | 95 | return new AddressApi(this.ctx).setDefaultAddressAsync(uid, id); |
96 | } | 96 | } |
@@ -120,7 +120,7 @@ module.exports = class extends global.yoho.BaseModel { | @@ -120,7 +120,7 @@ module.exports = class extends global.yoho.BaseModel { | ||
120 | 120 | ||
121 | // isReco: articleData.is_recommended && Number(articleData.is_recommended) === 1 ? true : false, | 121 | // isReco: articleData.is_recommended && Number(articleData.is_recommended) === 1 ? true : false, |
122 | url: +articleData.category_id === 9999 ? | 122 | url: +articleData.category_id === 9999 ? |
123 | - helpers.urlFormat(`/${_.get(articleData, 'product_list[0].product_skn', 0)}.html`, null, 'item') : | 123 | + helpers.getUrlBySkc(_.get(articleData, 'product_list[0].product_skn', 0)) : |
124 | ghelper.getArticleUrl(articleData.url, articleData.id), | 124 | ghelper.getArticleUrl(articleData.url, articleData.id), |
125 | img: helpers.image(articleData.src, width, height, 1), | 125 | img: helpers.image(articleData.src, width, height, 1), |
126 | isSquareImg: isSquareImage, | 126 | isSquareImg: isSquareImage, |
@@ -136,14 +136,14 @@ const shopTopBannerBase = (data) => { | @@ -136,14 +136,14 @@ const shopTopBannerBase = (data) => { | ||
136 | * @param data 装修数据 | 136 | * @param data 装修数据 |
137 | * @returns {{}} | 137 | * @returns {{}} |
138 | */ | 138 | */ |
139 | -const navigationBar = (data, shopId, params) => { | 139 | +const navigationBar = (data, shopId, params, domain) => { |
140 | params = params || {}; | 140 | params = params || {}; |
141 | 141 | ||
142 | const gender = params.gender ? `&gender=${params.gender}` : ''; | 142 | const gender = params.gender ? `&gender=${params.gender}` : ''; |
143 | let shopNav = [ | 143 | let shopNav = [ |
144 | { | 144 | { |
145 | name: '店铺首页', | 145 | name: '店铺首页', |
146 | - url: `/?navBar=0&shopId=${shopId}${gender}` | 146 | + url: `/shop/${domain || ''}-${shopId}.html` |
147 | }, | 147 | }, |
148 | { | 148 | { |
149 | name: '全部商品', | 149 | name: '全部商品', |
@@ -399,7 +399,7 @@ exports.getShopDecorator = (data, params, shopId, base) => { | @@ -399,7 +399,7 @@ exports.getShopDecorator = (data, params, shopId, base) => { | ||
399 | Object.assign(dest, shopTopBanner(info)); | 399 | Object.assign(dest, shopTopBanner(info)); |
400 | }, | 400 | }, |
401 | navigationBar(info) { | 401 | navigationBar(info) { |
402 | - Object.assign(dest, navigationBar(info, shopId, params)); | 402 | + Object.assign(dest, navigationBar(info, shopId, params, data.domain)); |
403 | }, | 403 | }, |
404 | largeSlideImg(info) { | 404 | largeSlideImg(info) { |
405 | Object.assign(dest, largeSlideImg(info, shopId)); | 405 | Object.assign(dest, largeSlideImg(info, shopId)); |
@@ -79,6 +79,7 @@ function _getShopData(channel, params, shopInfo) { | @@ -79,6 +79,7 @@ function _getShopData(channel, params, shopInfo) { | ||
79 | 79 | ||
80 | // 店铺装修 | 80 | // 店铺装修 |
81 | if (result.decorator.code === 200) { | 81 | if (result.decorator.code === 200) { |
82 | + _.set(result, 'decorator.data.domain', shopInfo.shop_domain); | ||
82 | Object.assign(resData, shopHandler.getShopDecorator(result.decorator.data, params, shopId)); | 83 | Object.assign(resData, shopHandler.getShopDecorator(result.decorator.data, params, shopId)); |
83 | 84 | ||
84 | _.set(resData, 'shopTopBanner.brandIntro', { | 85 | _.set(resData, 'shopTopBanner.brandIntro', { |
@@ -412,6 +413,7 @@ function getShopListInfoAsync(channel, params) { | @@ -412,6 +413,7 @@ function getShopListInfoAsync(channel, params) { | ||
412 | 413 | ||
413 | // 店铺装修 | 414 | // 店铺装修 |
414 | if (result.decorator.code === 200) { | 415 | if (result.decorator.code === 200) { |
416 | + _.set(result, 'decorator.data.domain', _.get(result, 'shopInfo.data.shop_domain')); | ||
415 | Object.assign(resData, shopHandler.getShopDecorator(result.decorator.data, params, shopId)); | 417 | Object.assign(resData, shopHandler.getShopDecorator(result.decorator.data, params, shopId)); |
416 | 418 | ||
417 | // 设置shop nav选中状态 | 419 | // 设置shop nav选中状态 |
@@ -39,11 +39,11 @@ module.exports = [ | @@ -39,11 +39,11 @@ module.exports = [ | ||
39 | 39 | ||
40 | // 商品详情页新链接 | 40 | // 商品详情页新链接 |
41 | { | 41 | { |
42 | - type: TYPE.rewrite, | 42 | + type: TYPE.redirect, |
43 | origin: /^\/([\d]+).html(.*)/, | 43 | origin: /^\/([\d]+).html(.*)/, |
44 | target: (req, match, p1, p2) => { | 44 | target: (req, match, p1, p2) => { |
45 | req.mobileUrl = `${MOBILE_DOMAIN}/product/${p1}.html${p2 ? p2 : ''}`; | 45 | req.mobileUrl = `${MOBILE_DOMAIN}/product/${p1}.html${p2 ? p2 : ''}`; |
46 | - return `/product${req.url}`; | 46 | + return helpers.urlFormat(`/product${req.url}`, null, 'www'); |
47 | } | 47 | } |
48 | } | 48 | } |
49 | ]; | 49 | ]; |
-
Please register or login to post a comment