Authored by ccbikai

url 处理修改

... ... @@ -14,15 +14,15 @@ const renderData = {
module: 'channel',
page: 'home',
homeHeader: {
searchUrl: helpers.url('/search', null, 'search')
searchUrl: helpers.urlFormat('/search', null, 'search')
},
maybeLike: true,
showFooterTab: {
indexUrl: helpers.url('/?go=1'), // 首页
categoryUrl: helpers.url('/cate'), // 分类
guangUrl: helpers.url('', null, 'guang'), // 逛首页
shoppingCartUrl: helpers.url('/cart/index/index'), // 购物车
mineUrl: helpers.url('/home') // 个人中心
indexUrl: helpers.urlFormat('/?go=1'), // 首页
categoryUrl: helpers.urlFormat('/cate'), // 分类
guangUrl: helpers.urlFormat('', null, 'guang'), // 逛首页
shoppingCartUrl: helpers.urlFormat('/cart/index/index'), // 购物车
mineUrl: helpers.urlFormat('/home') // 个人中心
},
pageFooter: true
};
... ...
... ... @@ -34,10 +34,10 @@ const getShopsInfo = (data) => {
params.shop_id = value.shop_id;
enterStore[key].url =
helpers.url('/product/index/brand', params);
helpers.urlFormat('/product/index/brand', params);
} else {
enterStore[key].url =
helpers.url('', null, value.brand_domain);
helpers.urlFormat('', null, value.brand_domain);
}
});
return enterStore;
... ... @@ -110,7 +110,7 @@ const getLimitCodeUrl = (productCode, skn, ua) => {
let params = {};
params.lp = productCode;
url = 'yohobuy://' + helpers.url('/limitpurchase', params);
url = 'yohobuy://' + helpers.urlFormat('/limitpurchase', params);
}
return url;
};
... ... @@ -138,8 +138,8 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => {
if (uid === null || typeof uid === 'undefined') {
let params = {};
params.refer = helpers.url('/product/show_' + origin.erpProductId + '.html');
dest.loginUrl = helpers.url('/signin.html', params);
params.refer = helpers.urlFormat('/product/show_' + origin.erpProductId + '.html');
dest.loginUrl = helpers.urlFormat('/signin.html', params);
}
// 商品促销短语
... ... @@ -241,7 +241,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => {
params.product_id = origin.id;
params.total = dest.feedbacks.consultsNum;
dest.feedbacks.consultsUrl = helpers.url('/product/detail/consults', params);
dest.feedbacks.consultsUrl = helpers.urlFormat('/product/detail/consults', params);
} else { // 暂无咨询
... ... @@ -249,7 +249,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => {
params.product_id = origin.id;
dest.feedbacks.consultsUrl = helpers.url('/product/detail/consultform', params);
dest.feedbacks.consultsUrl = helpers.urlFormat('/product/detail/consultform', params);
}
// 商品评价
... ... @@ -273,7 +273,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => {
params.product_id = origin.id;
params.total = dest.feedbacks.commentsNum;
dest.feedbacks.commentsUrl = helpers.url('/product/detail/comments', params);
dest.feedbacks.commentsUrl = helpers.urlFormat('/product/detail/comments', params);
}
// 品牌信息
... ... @@ -284,7 +284,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => {
params.productSkn = origin.erpProductId;
params.brandId = origin.brand.id;
dest.preferenceUrl = helpers.url('/product/detail/preference', params, '');
dest.preferenceUrl = helpers.urlFormat('/product/detail/preference', params, '');
}
dest.productSkn = origin.erpProductId;
... ... @@ -431,7 +431,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => {
// 悬浮的购物车信息
dest.cartInfo = {};
dest.cartInfo.cartUrl = helpers.url('/cart/index/index', null);
dest.cartInfo.cartUrl = helpers.urlFormat('/cart/index/index', null);
dest.cartInfo.numInCart = 0;
dest.cartInfo.goodsInstore = origin.storage;
... ... @@ -471,9 +471,9 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => {
dest = procShowStatus(dest, showStatus, isBeginSale);
dest.cartInfo.limitProductCode = origin.limitProductCode;
dest.cartInfo.limitCodeUrl = getLimitCodeUrl(origin.limitProductCode, origin.erpProductId, ua);
dest.cartInfo.limitProductPay = helpers.url('/cart/index/orderEnsure'); // 待处理 相关处理逻辑还不存在
dest.cartInfo.limitProductPay = helpers.urlFormat('/cart/index/orderEnsure'); // 待处理 相关处理逻辑还不存在
} else {
dest.cartInfo.addToCartUrl = helpers.url('/product/buy_' + origin.id + '_' +
dest.cartInfo.addToCartUrl = helpers.urlFormat('/product/buy_' + origin.id + '_' +
origin.goodsList.id + '.html'); // 待处理 相关处理逻辑还不存在
}
} else if (notForSale) {
... ... @@ -490,7 +490,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => {
}
// 底部简介的URL链接 待处理
// dest.introUrl = helpers.url('/product/intro_' + origin.erpProductId +
// dest.introUrl = helpers.urlFormat('/product/intro_' + origin.erpProductId +
// '/' + origin.cnAlphabet + '.html', null, '');
dest.introUrl = 'http://localhost:6001/product/detail/intro/' + origin.erpProductId;
... ...
... ... @@ -23,4 +23,4 @@
<div class="pagination-inner">
</div>
</div>
</div>
\ No newline at end of file
</div>
... ...
... ... @@ -30,7 +30,7 @@ exports.image = (url, width, height, mode) => {
* @param {[string]} module 模块
* @return {[string]}
*/
exports.url = (uri, qs, module) => {
exports.urlFormat = (uri, qs, module) => {
const subDomain = '.m.yohobuy.com';
const subName = {
default: config.siteUrl,
... ...