Authored by 陈峰

逛和商品详情优化路由

@@ -233,7 +233,7 @@ exports.index = (req, res, next) => { @@ -233,7 +233,7 @@ exports.index = (req, res, next) => {
233 value.cn_alphabet = productNameProcess(value.cn_alphabet); 233 value.cn_alphabet = productNameProcess(value.cn_alphabet);
234 } 234 }
235 235
236 - value.url = helpers.urlFormat(`/product/p${value.product_id}.html`) + `?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":${value.product_skn}}}`; 236 + value.url = helpers.urlFormat(`/product/${value.product_skn}.html`) + `?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":${value.product_skn}}}`; // 商品url改版
237 return value; 237 return value;
238 }); 238 });
239 239
@@ -431,7 +431,7 @@ exports.verifystudent = (req, res, next) => { @@ -431,7 +431,7 @@ exports.verifystudent = (req, res, next) => {
431 value.cn_alphabet = productNameProcess(value.cn_alphabet); 431 value.cn_alphabet = productNameProcess(value.cn_alphabet);
432 } 432 }
433 433
434 - value.url = helpers.urlFormat(`/product/p${value.product_id}.html`) + `?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":${value.product_skn}}}`; 434 + value.url = helpers.urlFormat(`/product/${value.product_skn}.html`) + `?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":${value.product_skn}}}`; // 商品url改版
435 return value; 435 return value;
436 }); 436 });
437 return getUser(uid).then((user) => { 437 return getUser(uid).then((user) => {
@@ -146,7 +146,7 @@ const _formatOrderGoods = (orderGoods, count, haveLink, tickets) => { @@ -146,7 +146,7 @@ const _formatOrderGoods = (orderGoods, count, haveLink, tickets) => {
146 /* 商品链接 */ 146 /* 商品链接 */
147 if (haveLink && value.product_skn) { 147 if (haveLink && value.product_skn) {
148 Object.assign(goods, { 148 Object.assign(goods, {
149 - link: helpers.urlFormat('/product/show_' + value.product_skn + '.html') 149 + link: helpers.urlFormat('/product/' + value.product_skn + '.html') // 商品url改版
150 }); 150 });
151 } 151 }
152 152
@@ -42,7 +42,7 @@ const getProductData = (params) => { @@ -42,7 +42,7 @@ const getProductData = (params) => {
42 return ''; 42 return '';
43 } else { 43 } else {
44 _.forEach(result.data, (item) => { 44 _.forEach(result.data, (item) => {
45 - item.url = helpers.urlFormat(`/product/p${item.product_id}.html`); // eslint-disable-line 45 + item.url = helpers.urlFormat(`/product/${item.productSkn}.html`); // 商品url改版 // eslint-disable-line
46 item.url = helpers.appUrlFormat(item.url, 'go.productDetail', { 46 item.url = helpers.appUrlFormat(item.url, 'go.productDetail', {
47 product_skn: item.productSkn 47 product_skn: item.productSkn
48 }); 48 });
@@ -61,7 +61,7 @@ exports.ensure = (req, res, next) => { @@ -61,7 +61,7 @@ exports.ensure = (req, res, next) => {
61 page: 'seckill', 61 page: 'seckill',
62 pageHeader: headerModel.setNav({ 62 pageHeader: headerModel.setNav({
63 navTitle: '确认订单', 63 navTitle: '确认订单',
64 - backUrl: '/product/show_' + skn + '.html' 64 + backUrl: '/product/' + skn + '.html' // 商品url改版
65 }), 65 }),
66 }, view)); 66 }, view));
67 } 67 }
@@ -106,7 +106,7 @@ exports.ensure = (req, res, next) => { @@ -106,7 +106,7 @@ exports.ensure = (req, res, next) => {
106 page: 'seckill', 106 page: 'seckill',
107 pageHeader: headerModel.setNav({ 107 pageHeader: headerModel.setNav({
108 navTitle: '确认订单', 108 navTitle: '确认订单',
109 - backUrl: '/product/show_' + skn + '.html' 109 + backUrl: '/product/' + skn + '.html' // 商品url改版
110 }), 110 }),
111 cartToken: crypto.encryption(SLAT, [sku, activityId].join('')) 111 cartToken: crypto.encryption(SLAT, [sku, activityId].join(''))
112 }, view)); 112 }, view));
@@ -102,7 +102,7 @@ const editorRedirect = (req, res, next) => { @@ -102,7 +102,7 @@ const editorRedirect = (req, res, next) => {
102 if (param) { 102 if (param) {
103 param = '?' + param; 103 param = '?' + param;
104 } 104 }
105 - redirectUrl += `-${id}${param}/`; 105 + redirectUrl += `-${id}/${param}/`;
106 res.redirect(redirectUrl); 106 res.redirect(redirectUrl);
107 } else { 107 } else {
108 return next(); 108 return next();
@@ -185,7 +185,7 @@ const getNewProduct = (brandId, gender, url, isApp) => { @@ -185,7 +185,7 @@ const getNewProduct = (brandId, gender, url, isApp) => {
185 list.cn_alphabet = productNameProcess(list.cn_alphabet); 185 list.cn_alphabet = productNameProcess(list.cn_alphabet);
186 } 186 }
187 187
188 - let productUrl = '//m.yohobuy.com/product/p' + list.product_id + '.html'; 188 + let productUrl = '//m.yohobuy.com/product/' + list.product_skn + '.html'; // 商品url改版
189 189
190 if (isApp) { 190 if (isApp) {
191 productUrl += `?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${list.product_skn}"}}`; 191 productUrl += `?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${list.product_skn}"}}`;
@@ -53,7 +53,7 @@ const favProduct = (uid, page, limit) => { @@ -53,7 +53,7 @@ const favProduct = (uid, page, limit) => {
53 53
54 if (val.goodsId && val.cnAlphabet) { 54 if (val.goodsId && val.cnAlphabet) {
55 obj = _.assign(obj, { 55 obj = _.assign(obj, {
56 - link: config.siteUrl + '/product/p' + val.productId + '.html' 56 + link: config.siteUrl + '/product/' + val.productSkn + '.html' // 商品url改版
57 }); 57 });
58 } else { 58 } else {
59 obj = _.assign(obj, { 59 obj = _.assign(obj, {
@@ -175,7 +175,7 @@ const favfavBrand = (uid, page, limit) => { @@ -175,7 +175,7 @@ const favfavBrand = (uid, page, limit) => {
175 175
176 _.forEach(val.newProduct, function(data, key) { 176 _.forEach(val.newProduct, function(data, key) {
177 obj.productList.push({ 177 obj.productList.push({
178 - link: '/product/p' + data.productId + '.html', 178 + link: '/product/' + data.productSkn + '.html', // 商品url改版
179 imgUrl: data.defaultImages, 179 imgUrl: data.defaultImages,
180 price: '¥' + Number(data.marketPrice).toFixed(2), 180 price: '¥' + Number(data.marketPrice).toFixed(2),
181 discount: data.marketPrice > data.salesPrice ? '¥' + Number(data.salesPrice).toFixed(2) : false, 181 discount: data.marketPrice > data.salesPrice ? '¥' + Number(data.salesPrice).toFixed(2) : false,
@@ -258,7 +258,7 @@ const recordContent = (uid, udid, page, limit) => { @@ -258,7 +258,7 @@ const recordContent = (uid, udid, page, limit) => {
258 product_skn: val.product_skn, 258 product_skn: val.product_skn,
259 storage: val.storage, 259 storage: val.storage,
260 image: val.image, 260 image: val.image,
261 - link: '/product/show_' + val.product_skn + '.html', 261 + link: '/product/' + val.product_skn + '.html', // 商品url改版
262 sales_price: val.sales_price, 262 sales_price: val.sales_price,
263 market_price: (val.market_price - val.sales_price) > 0 ? val.market_price : false, 263 market_price: (val.market_price - val.sales_price) > 0 ? val.market_price : false,
264 invalidGoods: val.status === 0 264 invalidGoods: val.status === 0
@@ -51,7 +51,7 @@ const _formatOrderGoods = (orderGoods, count, haveLink, tickets) => { @@ -51,7 +51,7 @@ const _formatOrderGoods = (orderGoods, count, haveLink, tickets) => {
51 /* 商品链接 */ 51 /* 商品链接 */
52 if (haveLink && value.product_skn) { 52 if (haveLink && value.product_skn) {
53 Object.assign(goods, { 53 Object.assign(goods, {
54 - link: helpers.urlFormat('/product/show_' + value.product_skn + '.html') 54 + link: helpers.urlFormat('/product/' + value.product_skn + '.html') // 商品url改版
55 }); 55 });
56 } 56 }
57 57
@@ -239,7 +239,7 @@ const orderDetailData = (uid, orderCode) => { @@ -239,7 +239,7 @@ const orderDetailData = (uid, orderCode) => {
239 239
240 if (data.productSkn) { 240 if (data.productSkn) {
241 obj = _.assign(obj, { 241 obj = _.assign(obj, {
242 - link: '/product/show_' + data.productSkn + '.html' 242 + link: '/product/' + data.productSkn + '.html' // 商品url改版
243 }); 243 });
244 } 244 }
245 245
@@ -64,21 +64,33 @@ const newDetail = { @@ -64,21 +64,33 @@ const newDetail = {
64 64
65 // 301到新路由 65 // 301到新路由
66 indexRedirect(req, res, next) { 66 indexRedirect(req, res, next) {
67 - if (req.params[0] && req.params[1]) {  
68 - let redirectUrl = '/product/';  
69 -  
70 - if (req.yoho.channel !== req.cookies._Channel) {  
71 - redirectUrl += `${req.yoho.channel}-`;  
72 - }  
73 let param = qs.stringify(req.query); 67 let param = qs.stringify(req.query);
74 68
75 if (param) { 69 if (param) {
76 param = '?' + param; 70 param = '?' + param;
77 } 71 }
78 - redirectUrl += `p${req.params[0]}.html${param}`;  
79 - return res.redirect(redirectUrl); 72 + return new Promise((resolve, reject) => {
  73 + if (req.params[0] && req.params[1]) {
  74 + newDetailModel.getProductData({
  75 + id: req.params[0],
  76 + ua: req.get('user-agent') || ''
  77 + }).then(result => {
  78 + if (_.isEmpty(result)) {
  79 + return reject();
80 } 80 }
81 - next(); 81 + resolve(result.productSkn);
  82 + }).catch(next);
  83 + } else if (req.params[0]) {
  84 + resolve(req.params[0]);
  85 + } else {
  86 + reject();
  87 + }
  88 + }).then(skn => {
  89 + return res.redirect(`/product/${skn}.html${param}`);
  90 + }, () => {
  91 + return next();
  92 + });
  93 +
82 }, 94 },
83 95
84 96
@@ -596,7 +596,7 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => { @@ -596,7 +596,7 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => {
596 // 用户未登录时 596 // 用户未登录时
597 if (!uid) { 597 if (!uid) {
598 dest.loginUrl = helpers.urlFormat('/signin.html', { 598 dest.loginUrl = helpers.urlFormat('/signin.html', {
599 - refer: helpers.urlFormat('/product/show_' + origin.product_skn + '.html') 599 + refer: helpers.urlFormat('/product/' + origin.product_skn + '.html') // 商品url改版
600 }); 600 });
601 } 601 }
602 602
@@ -104,7 +104,7 @@ const selectHotrank = (yhChannel, gender, sort, tabId, limit, page, notab) => { @@ -104,7 +104,7 @@ const selectHotrank = (yhChannel, gender, sort, tabId, limit, page, notab) => {
104 } 104 }
105 105
106 one = _.assign(one, { 106 one = _.assign(one, {
107 - url: '/product/p' + data.product_id + '.html', 107 + url: '/product/' + data.product_skn + '.html', // 商品url改版
108 thumb: data.default_images, 108 thumb: data.default_images,
109 rank: limit * (page - 1) + index + 1, 109 rank: limit * (page - 1) + index + 1,
110 name: data.product_name, 110 name: data.product_name,
@@ -16,7 +16,6 @@ const yhchannelMap = { @@ -16,7 +16,6 @@ const yhchannelMap = {
16 kids: '3', 16 kids: '3',
17 lifestyle: '4' 17 lifestyle: '4'
18 }; 18 };
19 -const proUrlReg = /\/pro_(\d+)_\d+\//;  
20 19
21 module.exports = (data) => { 20 module.exports = (data) => {
22 return api.get('', { 21 return api.get('', {
@@ -31,10 +30,10 @@ module.exports = (data) => { @@ -31,10 +30,10 @@ module.exports = (data) => {
31 30
32 goodThumb.each(function(index, domEle) { 31 goodThumb.each(function(index, domEle) {
33 let href = $(domEle).attr('href').split('?')[0]; 32 let href = $(domEle).attr('href').split('?')[0];
34 - let matchs = href.match(proUrlReg); 33 + let skn = $(domEle).closest('.good-info').data('id');
35 34
36 - if (matchs) {  
37 - href = helpers.urlFormat(`/product/p${matchs[1]}.html`); 35 + if (skn) {
  36 + href = helpers.urlFormat(`/product/${skn}.html`); // 商品url改版
38 } 37 }
39 $(domEle).attr('href', href); 38 $(domEle).attr('href', href);
40 }); 39 });
@@ -34,7 +34,7 @@ const getPreferenceData = (data) => { @@ -34,7 +34,7 @@ const getPreferenceData = (data) => {
34 product_name: value.product_name, 34 product_name: value.product_name,
35 default_images: value.default_images, 35 default_images: value.default_images,
36 is_soon_sold_out: value.is_soon_sold_out === 'Y', 36 is_soon_sold_out: value.is_soon_sold_out === 'Y',
37 - url: helpers.urlFormat(`/product/p${value.product_id}.html`), 37 + url: helpers.urlFormat(`/product/${value.product_skn}.html`), // 商品url改版
38 market_price: value.market_price, 38 market_price: value.market_price,
39 sales_price: value.sales_price 39 sales_price: value.sales_price
40 }; 40 };
@@ -160,7 +160,7 @@ const _getLimitCodeUrl = (productCode, skn, ua) => { @@ -160,7 +160,7 @@ const _getLimitCodeUrl = (productCode, skn, ua) => {
160 // if (!uid) { 160 // if (!uid) {
161 // let params = {}; 161 // let params = {};
162 162
163 -// params.refer = helpers.urlFormat('/product/show_' + origin.erpProductId + '.html'); 163 +// params.refer = helpers.urlFormat('/product/' + origin.erpProductId + '.html');
164 // dest.loginUrl = helpers.urlFormat('/signin.html', params); 164 // dest.loginUrl = helpers.urlFormat('/signin.html', params);
165 // } 165 // }
166 166
@@ -579,7 +579,7 @@ const _getLimitCodeUrl = (productCode, skn, ua) => { @@ -579,7 +579,7 @@ const _getLimitCodeUrl = (productCode, skn, ua) => {
579 // // 用户未登录时 579 // // 用户未登录时
580 // if (!uid) { 580 // if (!uid) {
581 // dest.loginUrl = helpers.urlFormat('/signin.html', { 581 // dest.loginUrl = helpers.urlFormat('/signin.html', {
582 -// refer: helpers.urlFormat('/product/show_' + origin.productSkn + '.html') 582 +// refer: helpers.urlFormat('/product/' + origin.productSkn + '.html')
583 // }); 583 // });
584 // } 584 // }
585 585
@@ -1151,7 +1151,7 @@ const _detailDataPkg = (origin, ua) => { @@ -1151,7 +1151,7 @@ const _detailDataPkg = (origin, ua) => {
1151 // 用户未登录时 pagecache重构 1151 // 用户未登录时 pagecache重构
1152 // if (!uid) { 1152 // if (!uid) {
1153 // dest.loginUrl = helpers.urlFormat('/signin.html', { 1153 // dest.loginUrl = helpers.urlFormat('/signin.html', {
1154 - // refer: helpers.urlFormat('/product/show_' + origin.product_skn + '.html') 1154 + // refer: helpers.urlFormat('/product/' + origin.product_skn + '.html')
1155 // }); 1155 // });
1156 // } 1156 // }
1157 1157
@@ -1539,7 +1539,7 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => { @@ -1539,7 +1539,7 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => {
1539 // 用户未登录时 1539 // 用户未登录时
1540 if (!uid) { 1540 if (!uid) {
1541 dest.loginUrl = helpers.urlFormat('/signin.html', { 1541 dest.loginUrl = helpers.urlFormat('/signin.html', {
1542 - refer: helpers.urlFormat('/product/show_' + origin.product_skn + '.html') 1542 + refer: helpers.urlFormat('/product/' + origin.product_skn + '.html') // 商品url改版
1543 }); 1543 });
1544 } 1544 }
1545 1545
@@ -60,10 +60,10 @@ const bundle = require(`${cRoot}/bundle`); @@ -60,10 +60,10 @@ const bundle = require(`${cRoot}/bundle`);
60 // 因为正则匹配原因,秒杀详情页路由要放在普通详情页前面,待解决 60 // 因为正则匹配原因,秒杀详情页路由要放在普通详情页前面,待解决
61 router.get(/^\/seckill\/show_([\d]+)/, seckillDetail.indexSkn); // 秒杀商品详情页 SKN 进入 61 router.get(/^\/seckill\/show_([\d]+)/, seckillDetail.indexSkn); // 秒杀商品详情页 SKN 进入
62 router.get(/^\/seckill\/pro_([\d]+)_([\d]+)/, seckillDetail.index); // 秒杀商品详情页进入 62 router.get(/^\/seckill\/pro_([\d]+)_([\d]+)/, seckillDetail.index); // 秒杀商品详情页进入
63 -router.get(/^\/pro_([\d]+)_([\d]+)/, rewrite.channel, newDetail.indexRedirect); // 商品详情页 63 +router.get(/^\/pro_([\d]+)_([\d]+)/, newDetail.indexRedirect); // 商品详情页
64 // /show_51047967.html 64 // /show_51047967.html
65 -router.get(/^\/show_([\d]+)/, newDetail.index); // 商品详情页 SKN 进入  
66 -router.get(/^\/(.*?-)?p(\d+)\.html/, rewrite.resolve, newDetail.index); // 商品详情页 进入 SEO优化 65 +router.get(/^\/show_([\d]+)/, newDetail.indexRedirect); // 商品详情页 SKN 进入
  66 +router.get(/^\/(\d+)\.html/, newDetail.index); // 商品详情页 SKN 进入 SEO优化
67 67
68 router.get('/detail/sknData.json', newDetail.sknData); // 商品咨询,评价,店铺 68 router.get('/detail/sknData.json', newDetail.sknData); // 商品咨询,评价,店铺
69 router.get('/detail/intro/:productskn', detail.intro); // 商品内嵌页 69 router.get('/detail/intro/:productskn', detail.intro); // 商品内嵌页
@@ -6,7 +6,8 @@ @@ -6,7 +6,8 @@
6 <ul> 6 <ul>
7 {{#list}} 7 {{#list}}
8 <li class="hot-single-goods"> 8 <li class="hot-single-goods">
9 - <a href="//m.yohobuy.com/product/show_{{product_skn}}"> 9 + <a href="//m.yohobuy.com/product/{{product_skn}}.html">
  10 + {{!--商品url改版 --}}
10 <img src="{{image2 default_images w=153 h=206 q=60}}" alt="goods" class="goods-pic"> 11 <img src="{{image2 default_images w=153 h=206 q=60}}" alt="goods" class="goods-pic">
11 <div class="goods-info"> 12 <div class="goods-info">
12 <h3 class="price">&yen; {{sales_price}}</h3> 13 <h3 class="price">&yen; {{sales_price}}</h3>
@@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
7 <ul> 7 <ul>
8 {{#list}} 8 {{#list}}
9 <li class="new-user-good"> 9 <li class="new-user-good">
10 - <a href="//m.yohobuy.com/product/show_{{product_skn}}"> 10 + <a href="//m.yohobuy.com/product/{{product_skn}}.html">
  11 + {{!--商品url改版 --}}
11 <img src="{{image default_images 128 171}}" alt="goods-pic" class="goods-pic" /> 12 <img src="{{image default_images 128 171}}" alt="goods-pic" class="goods-pic" />
12 <div class="goods-info"> 13 <div class="goods-info">
13 <h3 class="title">{{product_name}}</h3> 14 <h3 class="title">{{product_name}}</h3>
@@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
7 <div class="vip-only-goods-list" {{#background}} style="background-image: url({{image src 640 330}})" {{/background}}> 7 <div class="vip-only-goods-list" {{#background}} style="background-image: url({{image src 640 330}})" {{/background}}>
8 <ul> 8 <ul>
9 {{#list}} 9 {{#list}}
10 - <a href="//m.yohobuy.com/product/show_{{product_skn}}"> 10 + <a href="//m.yohobuy.com/product/{{product_skn}}.html">
  11 + {{!--商品url改版 --}}
11 <li class="vip-only-goods"> 12 <li class="vip-only-goods">
12 <img src="{{image default_images 153 206}}" alt="goods" class="goods-pic"> 13 <img src="{{image default_images 153 206}}" alt="goods" class="goods-pic">
13 <div class="goods-info"> 14 <div class="goods-info">
@@ -6,7 +6,8 @@ @@ -6,7 +6,8 @@
6 <ul> 6 <ul>
7 {{#list}} 7 {{#list}}
8 <li class="hot-single-goods"> 8 <li class="hot-single-goods">
9 - <a href="//m.yohobuy.com/product/show_{{product_skn}}"> 9 + <a href="//m.yohobuy.com/product/{{product_skn}}.html">
  10 + {{!--商品url改版 --}}
10 <img src="{{image2 default_images w=153 h=206 q=60}}" alt="goods" class="goods-pic"> 11 <img src="{{image2 default_images w=153 h=206 q=60}}" alt="goods" class="goods-pic">
11 <div class="goods-info"> 12 <div class="goods-info">
12 <h3 class="price">&yen; {{sales_price}}</h3> 13 <h3 class="price">&yen; {{sales_price}}</h3>
@@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
7 <ul> 7 <ul>
8 {{#list}} 8 {{#list}}
9 <li class="new-user-good"> 9 <li class="new-user-good">
10 - <a href="//m.yohobuy.com/product/show_{{product_skn}}"> 10 + <a href="//m.yohobuy.com/product/{{product_skn}}.html">
  11 + {{!--商品url改版 --}}
11 <img src="{{image default_images 128 171}}" alt="goods-pic" class="goods-pic" /> 12 <img src="{{image default_images 128 171}}" alt="goods-pic" class="goods-pic" />
12 <div class="goods-info"> 13 <div class="goods-info">
13 <h3 class="title">{{product_name}}</h3> 14 <h3 class="title">{{product_name}}</h3>
@@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
7 <div class="vip-only-goods-list" {{#background}} style="background-image: url({{image src 640 400}})" {{/background}}> 7 <div class="vip-only-goods-list" {{#background}} style="background-image: url({{image src 640 400}})" {{/background}}>
8 <ul> 8 <ul>
9 {{#list}} 9 {{#list}}
10 - <a href="//m.yohobuy.com/product/show_{{product_skn}}"> 10 + <a href="//m.yohobuy.com/product/{{product_skn}}.html">
  11 + {{!--商品url改版 --}}
11 <li class="vip-only-goods"> 12 <li class="vip-only-goods">
12 <img src="{{image default_images 153 206}}" alt="goods" class="goods-pic"> 13 <img src="{{image default_images 153 206}}" alt="goods" class="goods-pic">
13 <div class="goods-info"> 14 <div class="goods-info">
@@ -86,7 +86,7 @@ $( @@ -86,7 +86,7 @@ $(
86 success: function(data) { 86 success: function(data) {
87 // 秒杀是否结束 87 // 秒杀是否结束
88 if (data == '' || data.status === 0 || data.status === 3) { 88 if (data == '' || data.status === 0 || data.status === 3) {
89 - window.location.replace('/product/show_' + $('#productSkn').val() + '.html'); 89 + window.location.replace('/product/' + $('#productSkn').val() + '.html'); // 商品url改版
90 90
91 // $('.sold-out').hide(); 91 // $('.sold-out').hide();
92 // $('.cart-bar a:first').append('<a href="javascript:;" class="sold-out">已售罄</a>'); 92 // $('.cart-bar a:first').append('<a href="javascript:;" class="sold-out">已售罄</a>');
@@ -153,7 +153,7 @@ const formatCartGoods = (goodData, isAdvanceCart, isValid, inValidLow) => { @@ -153,7 +153,7 @@ const formatCartGoods = (goodData, isAdvanceCart, isValid, inValidLow) => {
153 } 153 }
154 154
155 // 商品链接 155 // 商品链接
156 - result.link = helpers.urlFormat(`/product/show_${goodData.product_skn}.html`); 156 + result.link = helpers.urlFormat(`/product/${goodData.product_skn}.html`); // 商品url改版
157 return result; 157 return result;
158 }; 158 };
159 const procPriceGiftData = (data, promotionType) => { 159 const procPriceGiftData = (data, promotionType) => {
@@ -286,7 +286,7 @@ const formatProduct = (productData, showTags, showNew, showSale, width, height, @@ -286,7 +286,7 @@ const formatProduct = (productData, showTags, showNew, showSale, width, height,
286 productData.cn_alphabet = productNameProcess(productData.cn_alphabet); 286 productData.cn_alphabet = productNameProcess(productData.cn_alphabet);
287 } 287 }
288 288
289 - let url = encodeURI(helpers.urlFormat(`/product/p${productData.product_id}.html`)); 289 + let url = encodeURI(helpers.urlFormat(`/product/${productData.product_skn}.html`));// 商品url改版
290 290
291 result.url = url.replace('http://', '//'); 291 result.url = url.replace('http://', '//');
292 292
@@ -165,7 +165,7 @@ exports.processProductList = (list, options) => { @@ -165,7 +165,7 @@ exports.processProductList = (list, options) => {
165 product.cn_alphabet = productNameProcess(product.cn_alphabet); 165 product.cn_alphabet = productNameProcess(product.cn_alphabet);
166 } 166 }
167 167
168 - product.url = helpers.urlFormat(`/product/p${product.product_id}.html`); // eslint-disable-line 168 + product.url = helpers.urlFormat(`/product/${product.product_skn}.html`); // 商品url改版 // eslint-disable-line
169 169
170 // APP访问需要加附加的参数 170 // APP访问需要加附加的参数
171 // 备注:如果以后APP的接口太多,可以把这边参数提取出来,变成一个公共的方法来生成,便于以后管理维护 171 // 备注:如果以后APP的接口太多,可以把这边参数提取出来,变成一个公共的方法来生成,便于以后管理维护