Authored by 郭成尧

detail-phrase

... ... @@ -5,6 +5,7 @@
*/
'use strict';
const utils = '../../../utils';
const _ = require('lodash');
const comment = require('./consult-comment');
const bundle = require('./bundle');
... ... @@ -231,6 +232,8 @@ let getProductData = (data) => {
let bundleData = _.get(info[4], 'data', null);
console.log(bundleData);
/* 套装 */
if (bundleData && _.get(bundleData, 'bundleInfo.discountType', null) === 1) {
finalResult.bundleData = {
... ... @@ -247,7 +250,8 @@ let getProductData = (data) => {
/* 量贩 */
if (bundleData && _.get(bundleData, 'bundleInfo.discountType', null) === 2) {
finalResult.discountBuy = {
num: _.get(bundleData, 'bundleInfo.bundleCount', 1)
num: _.get(bundleData, 'bundleInfo.bundleCount', 1),
promotionPhrase: _.get(bundleData, 'bundleInfo.promotionPhrase', '')
};
}
... ...
... ... @@ -123,6 +123,7 @@
{{/ bundleData}}
{{# discountBuy}}
<input type="hidden" id="discount-buy" value="{{num}}">
<input type="hidden" id="promption-phrase" value="{{promotionPhrase}}">
{{/ discountBuy}}
<div id="productDesc" {{#if limit}}class="limit"{{/if}}> </div>
{{> detail/recommend-for-you}}
... ...
... ... @@ -59,7 +59,8 @@ var limitProductCode,
skn;
// 量贩商品
var discountNum = $('#discount-buy').val() - 0;
var discountNum = $('#discount-buy').val() - 0,
promptionPhrase = $('#promption-phrase').val();
// 禁用数字编辑
function disableNumEdit() {
... ... @@ -246,6 +247,12 @@ function updateConformButtonClassAndText() {
// 显示剩余件数
function displayGoodNum(curGoodNum) {
// 量贩促销
if (promptionPhrase) {
$allChoseItems.find('.num .left-num').html('<span style="color: #e10">' + promptionPhrase + '</span>');
return;
}
// 门票限购
if (ticketsLimit) {
$allChoseItems.find('.num .left-num').html('限购' + ticketsLimit + '件');
... ...
... ... @@ -157,6 +157,7 @@ function render(data) {
/* tar modified 161205 量贩商品数量限制 */
$('#good-num').val($('#discount-buy').val());
$('.left-num').html('<span style="color: #e10">' + $('#promption-phrase').val() + '</span>');
$('#limitNum').val(data.limit);
$('#promotionId').val(data.cartInfo.promotionId);
$('#single').val(data.single);
... ...
... ... @@ -46,8 +46,8 @@
.seckill-time {
position: absolute;
bottom: 0px;
right: 0px;
bottom: 0;
right: 0;
float: none;
}
... ... @@ -105,6 +105,8 @@
position: absolute;
top: 20px;
left: 380px;
overflow: hidden;
white-space: nowrap;
}
span.disabled {
... ...