Showing
9 changed files
with
6 additions
and
21 deletions
@@ -39,7 +39,7 @@ const helpers = global.yoho.helpers; | @@ -39,7 +39,7 @@ const helpers = global.yoho.helpers; | ||
39 | helpers.image = _.flow(helpers.image, fp.replace(/\/quality\/\d*$/, '/quality/90')); | 39 | helpers.image = _.flow(helpers.image, fp.replace(/\/quality\/\d*$/, '/quality/90')); |
40 | 40 | ||
41 | // NOTE:这里修改了参数的个数 | 41 | // NOTE:这里修改了参数的个数 |
42 | -helpers.getUrlBySkc = pid => `//item.yohobuy.com/${pid}.html`; | 42 | +helpers.getUrlBySkc = skn => `//item.yohobuy.com/${skn}.html`; |
43 | 43 | ||
44 | global.middleware = path.resolve('./doraemon/middleware'); | 44 | global.middleware = path.resolve('./doraemon/middleware'); |
45 | global.utils = path.resolve('./utils'); | 45 | global.utils = path.resolve('./utils'); |
@@ -322,7 +322,6 @@ const formatPriceGiftOne = (it) => { | @@ -322,7 +322,6 @@ const formatPriceGiftOne = (it) => { | ||
322 | 322 | ||
323 | // 商品链接 | 323 | // 商品链接 |
324 | if (g.goods_id) { | 324 | if (g.goods_id) { |
325 | - // let cnAlphaBet = g.cn_alphabet ? g.cn_alphabet : md5(g.product_name); | ||
326 | goods.subjoinLink = helpers.getUrlBySkc(g.product_skn); | 325 | goods.subjoinLink = helpers.getUrlBySkc(g.product_skn); |
327 | } else { | 326 | } else { |
328 | let uri = `/product/show_${g.product_id}_${g.product_skn}/${makeToken(g.product_skn)}.html`; | 327 | let uri = `/product/show_${g.product_id}_${g.product_skn}/${makeToken(g.product_skn)}.html`; |
@@ -784,11 +784,6 @@ const getRecommendProduct = (channelNum, uid, udid, page) => { | @@ -784,11 +784,6 @@ const getRecommendProduct = (channelNum, uid, udid, page) => { | ||
784 | '¥' + chelper.transPrice(it.market_price) : '' | 784 | '¥' + chelper.transPrice(it.market_price) : '' |
785 | }; | 785 | }; |
786 | 786 | ||
787 | - // 商品链接 | ||
788 | - // let cnAlphaBet = it.cn_alphabet ? it.cn_alphabet : md5(it.product_name); | ||
789 | - // let firstGoods = it.goods_list && it.goods_list[0]; | ||
790 | - // let productSkc = firstGoods && firstGoods.product_skc; | ||
791 | - | ||
792 | item.href = helpers.getUrlBySkc(it.product_skn); | 787 | item.href = helpers.getUrlBySkc(it.product_skn); |
793 | 788 | ||
794 | if (it.sales_price !== it.market_price) { | 789 | if (it.sales_price !== it.market_price) { |
@@ -79,7 +79,6 @@ exports.getCommentList = (uid, isComment, page, limit) => { | @@ -79,7 +79,6 @@ exports.getCommentList = (uid, isComment, page, limit) => { | ||
79 | }; | 79 | }; |
80 | 80 | ||
81 | _.forEach(value.orderGoods, (v) => { | 81 | _.forEach(value.orderGoods, (v) => { |
82 | - // let cnAlphabet = v.cnAlphabet || ''; | ||
83 | let hasComments = false; | 82 | let hasComments = false; |
84 | let good = { | 83 | let good = { |
85 | href: helpers.getUrlBySkc(v.productSkn), | 84 | href: helpers.getUrlBySkc(v.productSkn), |
@@ -82,12 +82,8 @@ const currencyList = (uid, condition)=>{ | @@ -82,12 +82,8 @@ const currencyList = (uid, condition)=>{ | ||
82 | if (_.get(product, 'code') === 200 && | 82 | if (_.get(product, 'code') === 200 && |
83 | !_.isEmpty(product.data.product_list) && | 83 | !_.isEmpty(product.data.product_list) && |
84 | !_.isEmpty(product.data.product_list[0].goods_list)) { | 84 | !_.isEmpty(product.data.product_list[0].goods_list)) { |
85 | - // let productId = _.get(product, 'data.product_list[0].product_id'); | ||
86 | let productSkn = _.get(product, 'data.product_list[0].product_skn'); | 85 | let productSkn = _.get(product, 'data.product_list[0].product_skn'); |
87 | 86 | ||
88 | - // let goodsId = _.get(product, 'data.product_list[0].goods_list[0].goods_id'); | ||
89 | - // let alphabet = _.get(product, 'data.product_list[0].cn_alphabet'); | ||
90 | - | ||
91 | result.list[key].detailUrl = helpers.getUrlBySkc(productSkn); | 87 | result.list[key].detailUrl = helpers.getUrlBySkc(productSkn); |
92 | } | 88 | } |
93 | } | 89 | } |
@@ -73,8 +73,7 @@ const _handleProduct = (products) => { | @@ -73,8 +73,7 @@ const _handleProduct = (products) => { | ||
73 | thumb: img, | 73 | thumb: img, |
74 | name: product.product_name, | 74 | name: product.product_name, |
75 | price: product.sales_price, | 75 | price: product.sales_price, |
76 | - productId: product.product_id, | ||
77 | - productSkn: product.product_skn | 76 | + productId: product.product_id |
78 | }; | 77 | }; |
79 | }); | 78 | }); |
80 | }; | 79 | }; |
@@ -57,10 +57,9 @@ function getGoodsData(goods) { | @@ -57,10 +57,9 @@ function getGoodsData(goods) { | ||
57 | let arr = []; | 57 | let arr = []; |
58 | 58 | ||
59 | goods.forEach(good => { | 59 | goods.forEach(good => { |
60 | - let cnAlphabet = good.cn_alphabet || ''; | ||
61 | 60 | ||
62 | arr.push({ | 61 | arr.push({ |
63 | - href: getProductUrlBySkc(good.product_skn, good.goods_id, cnAlphabet), | 62 | + href: getProductUrlBySkc(good.product_skn), |
64 | thumb: helpers.image(good.goods_image, 60, 60), | 63 | thumb: helpers.image(good.goods_image, 60, 60), |
65 | name: good.product_name, | 64 | name: good.product_name, |
66 | color: good.color_name, | 65 | color: good.color_name, |
@@ -180,9 +179,8 @@ const getOrderRefund = (orderCode, uid) => { | @@ -180,9 +179,8 @@ const getOrderRefund = (orderCode, uid) => { | ||
180 | 179 | ||
181 | 180 | ||
182 | _.forEach(_.get(result, 'data.goods_list', []), value => { | 181 | _.forEach(_.get(result, 'data.goods_list', []), value => { |
183 | - let cnAlphabet = value.cn_alphabet || 'cnalphabet'; | ||
184 | let item = { | 182 | let item = { |
185 | - href: getProductUrlBySkc(value.product_skn, value.goods_id, cnAlphabet), | 183 | + href: getProductUrlBySkc(value.product_skn), |
186 | thumb: helpers.image(value.goods_image, 60, 60), | 184 | thumb: helpers.image(value.goods_image, 60, 60), |
187 | name: value.product_name, | 185 | name: value.product_name, |
188 | color: value.factory_color_name, | 186 | color: value.factory_color_name, |
@@ -83,6 +83,8 @@ const detailHeader = (req, res, next) => { | @@ -83,6 +83,8 @@ const detailHeader = (req, res, next) => { | ||
83 | .then((result) => { | 83 | .then((result) => { |
84 | if (result.code === 200) { | 84 | if (result.code === 200) { |
85 | return res.render('product/detail-header', Object.assign({layout: false}, result.data)); | 85 | return res.render('product/detail-header', Object.assign({layout: false}, result.data)); |
86 | + }else{ | ||
87 | + res.status(204).end(); | ||
86 | } | 88 | } |
87 | }).catch(next); | 89 | }).catch(next); |
88 | }; | 90 | }; |
@@ -299,9 +299,6 @@ exports.getSearchLessProduct = (channelNum, uid, udid, page) => { | @@ -299,9 +299,6 @@ exports.getSearchLessProduct = (channelNum, uid, udid, page) => { | ||
299 | false : ('¥' + transPrice(it.market_price)) | 299 | false : ('¥' + transPrice(it.market_price)) |
300 | }; | 300 | }; |
301 | 301 | ||
302 | - // let firstGoods = it.goods_list && it.goods_list[0]; | ||
303 | - // let productSkc = firstGoods && firstGoods.product_skc; | ||
304 | - | ||
305 | item.href = helpers.getUrlBySkc(it.product_skn); | 302 | item.href = helpers.getUrlBySkc(it.product_skn); |
306 | 303 | ||
307 | return item; | 304 | return item; |
-
Please register or login to post a comment