Authored by 郭成尧

discount-add-to-cart

... ... @@ -9,7 +9,7 @@ const utils = '../../../utils';
const _ = require('lodash');
const comment = require('./consult-comment');
const bundle = require('./bundle');
``
const api = global.yoho.API;
const singleAPI = global.yoho.SingleAPI;
const helpers = global.yoho.helpers;
... ... @@ -232,8 +232,6 @@ let getProductData = (data) => {
let bundleData = _.get(info[4], 'data', null);
console.log(bundleData);
/* 套装 */
if (bundleData && _.get(bundleData, 'bundleInfo.discountType', null) === 1) {
finalResult.bundleData = {
... ...
... ... @@ -123,7 +123,7 @@
{{/ bundleData}}
{{# discountBuy}}
<input type="hidden" id="discount-buy" value="{{num}}">
<input type="hidden" id="promption-phrase" value="{{promotionPhrase}}">
<input type="hidden" id="promotion-phrase" value="{{promotionPhrase}}">
{{/ discountBuy}}
<div id="productDesc" {{#if limit}}class="limit"{{/if}}> </div>
{{> detail/recommend-for-you}}
... ...
... ... @@ -60,7 +60,7 @@ var limitProductCode,
// 量贩商品
var discountNum = $('#discount-buy').val() - 0,
promptionPhrase = $('#promption-phrase').val();
$promotionPhrase = $('#promotion-phrase');
// 禁用数字编辑
function disableNumEdit() {
... ... @@ -248,8 +248,9 @@ function updateConformButtonClassAndText() {
function displayGoodNum(curGoodNum) {
// 量贩促销
if (promptionPhrase) {
$allChoseItems.find('.num .left-num').html('<span style="color: #e10">' + promptionPhrase + '</span>');
if ($promotionPhrase.length > 0) {
$allChoseItems.find('.num .left-num').html('<span style="color: #e10">' + $promotionPhrase.val() + '</span>');
$leftNum.val(curGoodNum);
return;
}
... ...
... ... @@ -156,8 +156,17 @@ function render(data) {
}
/* tar modified 161205 量贩商品数量限制 */
$('#good-num').val($('#discount-buy').val());
$('.left-num').html('<span style="color: #e10">' + $('#promption-phrase').val() + '</span>');
var $discountBuy = $('#discount-buy'),
$promotionPhrase = $('#promotion-phrase');
if ($discountBuy.length > 0) {
$('#good-num').val($discountBuy.val());
}
if ($promotionPhrase.length > 0) {
$('.left-num').html('<span style="color: #e10">' + $promotionPhrase.val() + '</span>');
}
$('#limitNum').val(data.limit);
$('#promotionId').val(data.cartInfo.promotionId);
$('#single').val(data.single);
... ...