Authored by yyq

Merge remote-tracking branch 'origin/master' into feature/seo1113

... ... @@ -90,7 +90,7 @@ module.exports = class extends global.yoho.BaseModel {
}
setDefaultAddress(uid, id) {
id = crypto.decrypt('', `${id}`);
id = parseInt(crypto.decrypt('', `${id}`), 10);
return new AddressApi(this.ctx).setDefaultAddressAsync(uid, id);
}
... ...
... ... @@ -120,7 +120,7 @@ module.exports = class extends global.yoho.BaseModel {
// isReco: articleData.is_recommended && Number(articleData.is_recommended) === 1 ? true : false,
url: +articleData.category_id === 9999 ?
helpers.urlFormat(`/${_.get(articleData, 'product_list[0].product_skn', 0)}.html`, null, 'item') :
helpers.getUrlBySkc(_.get(articleData, 'product_list[0].product_skn', 0)) :
ghelper.getArticleUrl(articleData.url, articleData.id),
img: helpers.image(articleData.src, width, height, 1),
isSquareImg: isSquareImage,
... ...
... ... @@ -136,14 +136,14 @@ const shopTopBannerBase = (data) => {
* @param data 装修数据
* @returns {{}}
*/
const navigationBar = (data, shopId, params) => {
const navigationBar = (data, shopId, params, domain) => {
params = params || {};
const gender = params.gender ? `&gender=${params.gender}` : '';
let shopNav = [
{
name: '店铺首页',
url: `/?navBar=0&shopId=${shopId}${gender}`
url: `/shop/${domain || ''}-${shopId}.html`
},
{
name: '全部商品',
... ... @@ -399,7 +399,7 @@ exports.getShopDecorator = (data, params, shopId, base) => {
Object.assign(dest, shopTopBanner(info));
},
navigationBar(info) {
Object.assign(dest, navigationBar(info, shopId, params));
Object.assign(dest, navigationBar(info, shopId, params, data.domain));
},
largeSlideImg(info) {
Object.assign(dest, largeSlideImg(info, shopId));
... ...
... ... @@ -79,6 +79,7 @@ function _getShopData(channel, params, shopInfo) {
// 店铺装修
if (result.decorator.code === 200) {
_.set(result, 'decorator.data.domain', shopInfo.shop_domain);
Object.assign(resData, shopHandler.getShopDecorator(result.decorator.data, params, shopId));
_.set(resData, 'shopTopBanner.brandIntro', {
... ... @@ -412,6 +413,7 @@ function getShopListInfoAsync(channel, params) {
// 店铺装修
if (result.decorator.code === 200) {
_.set(result, 'decorator.data.domain', _.get(result, 'shopInfo.data.shop_domain'));
Object.assign(resData, shopHandler.getShopDecorator(result.decorator.data, params, shopId));
// 设置shop nav选中状态
... ...
... ... @@ -39,11 +39,11 @@ module.exports = [
// 商品详情页新链接
{
type: TYPE.rewrite,
type: TYPE.redirect,
origin: /^\/([\d]+).html(.*)/,
target: (req, match, p1, p2) => {
req.mobileUrl = `${MOBILE_DOMAIN}/product/${p1}.html${p2 ? p2 : ''}`;
return `/product${req.url}`;
return helpers.urlFormat(`/product${req.url}`, null, 'www');
}
}
];
... ...