diff --git a/apps/product/models/bundle.js b/apps/product/models/bundle.js index b46e210..e2f76a2 100644 --- a/apps/product/models/bundle.js +++ b/apps/product/models/bundle.js @@ -31,10 +31,6 @@ const detail = (params) => { } return getBundleBySkn(params.skn).then(result => { - // let discountPrice = (_.get(result, 'data.bundleInfo.salesPrice', 0) - - // _.get(result, 'data.bundleInfo.discountPrice', 0)); - // let priceShow = _.split(discountPrice + '', '.')[0]; - return { bundleInfo: _.get(result, 'data.bundleInfo', {}), productList: productProcess.processProductList(_.get(result, 'data.productList', [])) diff --git a/apps/product/models/new-detail.js b/apps/product/models/new-detail.js index 7e72c6c..763323f 100644 --- a/apps/product/models/new-detail.js +++ b/apps/product/models/new-detail.js @@ -218,14 +218,12 @@ const tool = { * @returns {{}} */ processBundle(bundleData, skn, gid) { - // let discountPrice = (_.get(bundleData, 'bundleInfo.salesPrice', 0) - - // _.get(bundleData, 'bundleInfo.discountPrice', 0)); - // let priceShow = _.split(discountPrice + '', '.')[0]; + let subPrice = _.get(bundleData, 'bundleInfo.subPrice', 0); return { title: '优惠套装', href: helpers.urlFormat('/product/bundle/detail', {skn: skn, gid: gid}), - description: '立省¥' + _.get(bundleData, 'bundleInfo.subPrice', 0), + description: subPrice ? '立省¥' + subPrice : 0, productList: productProcess.processProductList(bundleData && bundleData.productList) }; }, diff --git a/apps/product/views/action/bundle/detail.hbs b/apps/product/views/action/bundle/detail.hbs index 41c83af..bc72c72 100644 --- a/apps/product/views/action/bundle/detail.hbs +++ b/apps/product/views/action/bundle/detail.hbs @@ -18,7 +18,9 @@ <div class="bundle-bar clearfix"> <div class="bundle-bar-md"> <div class="bundle-price"> + {{#if subPrice}} <span class="bundle-discount">立省¥{{subPrice}}</span> + {{/if}} <span>套餐价: {{discountPriceStr}}</span> </div> <div class="sale-price">销售价: {{salesPriceStr}}</div> diff --git a/public/hbs/product/detail/bundle.hbs b/public/hbs/product/detail/bundle.hbs index c248fc9..e4f9b17 100644 --- a/public/hbs/product/detail/bundle.hbs +++ b/public/hbs/product/detail/bundle.hbs @@ -4,7 +4,9 @@ <div class="bundle-title">{{title}}</div> <div class="bundle-right"> <a href="{{href}}"> - <span class="bundle-desc">{{description}}</span> + {{#if description}} + <span class="bundle-desc">{{description}}</span> + {{/if}} <span class="iconfont"></span> </a> </div>