Authored by OF1706

m

... ... @@ -273,10 +273,28 @@ const formatGifts = (giftList) => {
return formatPriceGifts(giftList, true);
};
const checkGoodsIsSel = (goodsList, promotionId, giftsList, pricesGifts) => {
return _.map(goodsList, goods => {
_.forEach((giftsList || []).concat(pricesGifts), gift => {
if (goods.id === gift.id && promotionId === gift.promotionId) {
goods.isCheckedGift = true;
goods.checkedGiftPid = gift.pid;
goods.checkedGiftSkn = gift.skn;
return;
}
});
return goods;
});
};
/**
* 优惠池头部优惠信息列表
*/
const formatPoolPromotionInfos = (infoList) => {
const formatPoolPromotionInfos = (infoList, giftsList, priceGifts) => {
return _.map(infoList, it => {
... ... @@ -292,6 +310,8 @@ const formatPoolPromotionInfos = (infoList) => {
promotionId: it.promotion_id, // 促销id
promotionTitle: it.promotion_title, // "已满足[满30减10-dev30]",
promotionType: it.promotion_type, // 促销类型
// list.yohobuy.com?pp_id=10408
promotionPageUrl: helpers.urlFormat('', { pp_id: it.promotion_id }, 'list'),
tag: PROMOTION_TYPE_TAG_MAP[it.promotion_type],
isGift: it.promotion_type === 'Gift',
... ... @@ -302,6 +322,9 @@ const formatPoolPromotionInfos = (infoList) => {
isSelected: status === 30 // 已选择,可更换
};
// 判断赠品/加价购商品,是否被选中
info.giftGoodsList = checkGoodsIsSel(info.giftGoodsList, info.promotionId, giftsList, priceGifts);
if (status === 0) {
let tipTxt = `差${ -1 * info.conditionValue}`;
... ... @@ -315,6 +338,10 @@ const formatPoolPromotionInfos = (infoList) => {
} else if (status === 10) {
info.promotionTitle = '已满足' + info.promotionTitle;
}
if (info.giftGoodsList) {
info.giftGoodsListStr = JSON.stringify(info.giftGoodsList);
}
return info;
});
};
... ... @@ -322,12 +349,12 @@ const formatPoolPromotionInfos = (infoList) => {
/**
* 格式化子优惠池信息,返回商品列表,子优惠列表放在每个商品中
*/
const formatSubPromotionPools = (pools) => {
const formatSubPromotionPools = (pools, gifts, priceGifts) => {
let goodsListPool = _.map(pools, p => {
let pool = {
goodsList: formatCartGoods(p.goods_list),
promotionInfos: formatPoolPromotionInfos(p.promotion_list)
promotionInfos: formatPoolPromotionInfos(p.promotion_list, gifts, priceGifts)
};
let goodsList = pool.goodsList;
... ... @@ -347,20 +374,21 @@ const formatSubPromotionPools = (pools) => {
};
/**
* giftsList, priceGifts 已选择的赠品和加价购,判断可选的赠品和加价购是否被选中
* 优惠池
*/
const formatPromotionPools = (pools) => {
const formatPromotionPools = (pools, giftsList, priceGifts) => {
return _.map(pools, p => {
let pool = {
poolTitle: p.pool_title,
poolType: p.pool_type,
goodsList: formatCartGoods(p.goods_list),
promotionInfos: formatPoolPromotionInfos(p.promotion_list)
promotionInfos: formatPoolPromotionInfos(p.promotion_list, giftsList, priceGifts)
};
if (p.sub_pool) {
let goodsWithPromotion = formatSubPromotionPools(p.sub_pool);
let goodsWithPromotion = formatSubPromotionPools(p.sub_pool, giftsList, priceGifts);
if (_.isArray(goodsWithPromotion) && goodsWithPromotion.length) {
pool.goodsList = goodsWithPromotion.concat(pool.goodsList);
... ...
... ... @@ -423,16 +423,19 @@ const getCartData = (uid, shoppingKey, cartDelList) => {
stat: chelper.formatShoppingCartData(_.get(advCartData, 'shopping_cart_data'))
};
let giftsList = chelper.formatGifts(_.get(ordCartData, 'gift_list'));
let priceGifts = chelper.formatPriceGifts(_.get(ordCartData, 'price_gift'));
result.ordinaryCart = {
gifts: chelper.formatGifts(_.get(ordCartData, 'gift_list')),
gifts: giftsList, // chelper.formatGifts(_.get(ordCartData, 'gift_list')),
// 未参加活动的商品
goodsList: chelper.formatCartGoods(_.get(ordCartData, 'goods_list'), false, false, false, analysisData),
pools: chelper.formatPromotionPools(_.get(ordCartData, 'goods_pool_list')),
pools: chelper.formatPromotionPools(_.get(ordCartData, 'goods_pool_list'), giftsList, priceGifts),
offShelves: chelper.formatOffShelves(_.get(ordCartData, 'off_shelves_goods_list'), false, analysisData),
soldOuts: chelper.formatSoldOuts(_.get(ordCartData, 'sold_out_goods_list'), false, analysisData),
priceGifts: chelper.formatPriceGifts(_.get(ordCartData, 'price_gift')),
promotionInfos: chelper.formatPromotionInfos(_.get(ordCartData, 'promotion_info')),
priceGifts: priceGifts, // chelper.formatPriceGifts(_.get(ordCartData, 'price_gift')),
promotionInfos: chelper.formatPromotionInfos(_.get(ordCartData, 'promotion_info'), giftsList, priceGifts),
stat: chelper.formatShoppingCartData(_.get(ordCartData, 'shopping_cart_data'))
};
... ...
... ... @@ -7,7 +7,7 @@
<li class="end">付款,完成购买</li>
</ul>
</div>
{{#if cart.loginUrl}}
{{#unless cart.isLogin}}
<div class="cartnew-tips">
<div class="tipsbox" id="tipsbox">
<a href="javascript:void(0);" class="btn_close" title="关闭"></a>
... ... @@ -21,7 +21,7 @@
<strong>温馨提示:</strong>1. 选购单中的商品不保留库存,请及时结算。 2. 商品的价格、相关活动信息及库存以订单提交时为准。
</div>
</div>
{{/if}}
{{/unless}}
<div class="order-pay">
{{#if cart.isEmpty}}
<div class="pay-wapper">
... ... @@ -33,475 +33,186 @@
</div>
<div class="dev-revocation {{#unless cart.deleteShop}}none{{/unless}}">
<table>
{{# cart.deleteShop}}
<tr data-productnum="{{productNum}}" data-productsku="{{productSku}}">
<td style="width:40%; text-align: left;">成功删除<a class="title" href="{{link}}" target="_blank">{{productTitle}}</a></td>
<td style="width:10%;"><span class="productPrice">{{productPrice}}</span></td>
<td style="width:10%;"></td>
<td style="width:10%;">{{productNum}}</td>
<td style="width:10%;"></td>
<td style="width:20%; border-right: none; text-align: right;">
<a href="javascript:void(0);"><span class="goBack">撤销本次删除</span></a>
</td>
</tr>
{{/ cart.deleteShop}}
</table>
{{# cart.deleteShop}}
<tr data-productnum="{{productNum}}" data-productsku="{{productSku}}">
<td style="width:40%; text-align: left;">成功删除<a class="title" href="{{link}}" target="_blank">{{productTitle}}</a></td>
<td style="width:10%;"><span class="productPrice">{{productPrice}}</span></td>
<td style="width:10%;"></td>
<td style="width:10%;">{{productNum}}</td>
<td style="width:10%;"></td>
<td style="width:20%; border-right: none; text-align: right;">
<a href="javascript:void(0);"><span class="goBack">撤销本次删除</span></a>
</td>
</tr>
{{/ cart.deleteShop}}
</table>
</div>
{{^}}
<!-- 购物车商品列表 -->
{{#cart}}
<div class="pay-wapper">
<div class="cart-title">
<p class="left" style="width:6%;">
<i class="cart-item-check iconfont cart-item-checked"></i> 全选
</p>
<p style="width:40%">商品信息</p>
<p style="width:14%">单价</p>
<p style="width:13%;">数量</p>
<p style="width:16%;">小计(元)</p>
<p class="right" style="width:11%;">操作</p>
</div>
{{#advanceCart}}
<!-- 预售商品 -->
<div class="pre-sell">
<code>预售商品</code>预售商品不参加活动,不可使用优惠券,不同上市期的商品我们将为您先到先发。
<div class="pay-wapper">
<div class="cart-title">
<p class="left" style="width:6%;">
<i class="cart-item-check iconfont cart-item-checked"></i> 全选
</p>
<p style="width:40%">商品信息</p>
<p style="width:14%">单价</p>
<p style="width:13%;">数量</p>
<p style="width:16%;">小计(元)</p>
<p class="right" style="width:11%;">操作</p>
</div>
<div class="cart-table">
<ul class="table table-group">
<li class="pre-sell-box tr"
{{#if pid}}data-pid="{{pid}}"{{/if}}
{{#if id}}data-id="{{id}}"{{/if}}
{{#if skn}}data-skn="{{skn}}"{{/if}}
{{#if sku}}data-sku="{{sku}}"{{/if}}
{{#if productNum}}data-productnum="{{productNum}}"{{/if}}
{{#if goodsType}}data-goodstype="{{goodsType}}"{{/if}}>
<div class="td pay-pro" style="width: 45%;">
<i class="cart-item-check iconfont cart-item-checked" data-goodstype="{{goodsType}}" {{#if isChecked}}checked{{/if}}></i>
<a class="pay-pro-icon" href="{{link}}" target="_blank">
<img src="{{imgCover}}">
<span class="incentive">预售</span>
</a>
<p class="pay-pro-info">
<a href="{{link}}" target="_blank">哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈
{{productTitle}}</a>
<span><b title="{{productColor}}">颜色:红色{{productColor}}</b> 尺码:L{{productSize}}</span>
<span class="presell">上市期:2016-09-01{{preSellDate}}</span>
</p>
</div>
<div class="td productPrice" style="width:17%;">¥66666{{productPrice}}</div>
<div style="width:10%;" class="td adjust-cart-num">
{{#if isGift}}
<div>{{productNum}}</div>
{{^}}
{{#if isPriceGift}}
<div>{{productNum}}</div>
{{^}}
<div class="cart-num-cont">
<span class="minus"></span>
<input type="text" value="67{{productNum}}" readonly="readonly"/>
<span class="plus"></span>
</div>
<p class="tip-message {{#isTipNoStore}}tipNoStore{{/isTipNoStore}}">{{tipMessage}}</p>
{{/if}}
{{/if}}
</div>
<div style="width:17%;" class="td sub-total red">¥888{{productSubtotal}}</div>
<div style="width:11%;" class="td cart-operation">
<span class="cart-del-btn">删除</span>
<span class="cart-col-btn">移入收藏</span>
</div>
</li>
<li class="pre-sell-box tr" {{#if pid}}data-pid="{{pid}}"{{/if}} {{#if id}}data-id="{{id}}"{{/if}} {{#if skn}}data-skn="{{skn}}"{{/if}} {{#if sku}}data-sku="{{sku}}"{{/if}} {{#if productNum}}data-productnum="{{productNum}}"{{/if}} {{#if goodsType}}data-goodstype="{{goodsType}}"{{/if}}>
<div class="pay-pro td" style="width:45%;">
<i class="cart-item-check iconfont cart-item-checked" data-goodstype="{{goodsType}}" {{#if isChecked}}checked{{/if}}></i>
<a class="pay-pro-icon" href="{{link}}" target="_blank">
<img src="{{imgCover}}">
<span class="incentive">预售</span>
</a>
<p class="pay-pro-info">
<a href="{{link}}" target="_blank">哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈
{{productTitle}}</a>
<span><b title="{{productColor}}">颜色:红色{{productColor}}</b> 尺码:L{{productSize}}</span>
<span class="presell">上市期:2016-09-01{{preSellDate}}</span>
</p>
</div>
<div class="productPrice td" style="width:17%;">¥{{productPrice}}</div>
<div style="width:10%;" class="adjust-cart-num td">
{{#if isGift}}
<div>{{productNum}}</div>
{{^}}
{{#if isPriceGift}}
<div>{{productNum}}</div>
{{^}}
<div class="cart-num-cont">
<span class="minus"></span>
<input type="text" value="{{productNum}}" readonly="readonly"/>
<span class="plus"></span>
</div>
<p class="tip-message {{#isTipNoStore}}tipNoStore{{/isTipNoStore}}">{{tipMessage}}</p>
{{/if}}
{{/if}}
</div>
<div style="width:17%;" class="sub-total red td">¥{{productSubtotal}}</div>
<div style="width:11%;" class="cart-operation td">
<span class="cart-del-btn">删除</span>
<span class="cart-col-btn">移入收藏</span>
</div>
</li>
<li class="pre-sell-box tr" {{#if pid}}data-pid="{{pid}}"{{/if}} {{#if id}}data-id="{{id}}"{{/if}} {{#if skn}}data-skn="{{skn}}"{{/if}} {{#if sku}}data-sku="{{sku}}"{{/if}} {{#if productNum}}data-productnum="{{productNum}}"{{/if}} {{#if goodsType}}data-goodstype="{{goodsType}}"{{/if}}>
<div class="pay-pro td" style="width:45%;">
<i class="cart-item-check iconfont cart-item-checked" id="" data-goodstype="{{goodsType}}" {{#if isChecked}}checked{{/if}}></i>
<a class="pay-pro-icon" href="{{link}}" target="_blank">
<img src="{{imgCover}}">
<span class="incentive">预售</span>
</a>
<p class="pay-pro-info">
<a href="{{link}}" target="_blank">哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈
{{productTitle}}</a>
<span><b title="{{productColor}}">颜色:红色{{productColor}}</b> 尺码:L{{productSize}}</span>
<span class="presell">上市期:2016-09-01{{preSellDate}}</span>
</p>
</div>
<div class="productPrice td" style="width:17%;">¥{{productPrice}}</div>
<div style="width:10%;" class="adjust-cart-num td">
{{#if isGift}}
<div>{{productNum}}</div>
{{^}}
{{#if isPriceGift}}
<div>{{productNum}}</div>
{{^}}
<div class="cart-num-cont">
<span class="minus"></span>
<input type="text" value="1{{productNum}}" readonly="readonly"/>
<span class="plus"></span>
</div>
<p class="tip-message {{#isTipNoStore}}tipNoStore{{/isTipNoStore}}">库存不足{{tipMessage}}</p>
{{/if}}
{{/if}}
</div>
<div style="width:17%;" class="sub-total red td">¥{{productSubtotal}}</div>
<div style="width:11%;" class="cart-operation td">
<span class="cart-del-btn">删除</span>
<span class="cart-col-btn">移入收藏</span>
</div>
</li>
</ul>
</div>
{{/advanceCart}}
{{#advanceCart}}
<!-- 预售商品 -->
<div class="pre-sell">
<code>预售商品</code>预售商品不参加活动,不可使用优惠券,不同上市期的商品我们将为您先到先发。
</div>
{{#ordinaryCart}}
{{#pools}}
{{#if promotionInfos}}
<div class="gift-sell mt40">
{{#promotionInfos}}
<p>
<code class="{{#unless isReach}}order-pay-mark-white{{/unless}}">{{tag}}</code>{{promotionTitle}}
<a>去换购</a>
<button class="btn-clear blue" data-together-id="1" >去凑单&nbsp;></button>
</p>
{{/promotionInfos}}
{{#if goodsList}}
<div class="cart-table">
<ul class="table table-group">
{{#each goodsList}}
{{>cart-item}}
{{/each}}
</ul>
</div>
{{/if}}
{{#if goodsList}}
{{#if offShelves}}
<div class="cart-table">
<ul class="table">
{{#goodsList}}
{{> cart-item}}
{{/goodsList}}
<ul class="table table-group">
{{#each offShelves}}
{{>cart-item}}
{{/each}}
</ul>
</div>
{{/if}}
{{/pools}}
<!--可选的加价购商品 -->
<!--priceGifts-->
<!--可选择的赠品-->
<!--gifts-->
<!-- -->
{{#if offShelves}}
<div class="cart-table">
<ul class="table">
{{#offShelves}}
{{> cart-item}}
{{/offShelves}}
</ul>
</div>
{{/if}}
<!-- -->
{{#if soldOuts}}
<div class="cart-table">
<ul class="table">
{{#soldOuts}}
{{> cart-item}}
{{/soldOuts}}
{{/if}}
<!-- 全场已选择的 加价购+赠品 -->
{{#if goodsList}}
<div class="cart-table">
<ul class="table">
{{#each goodsList}}
{{> cart-item}}
{{/each}}
</ul>
</div>
{{/if}}
{{#if promotionInfos}}
<div class="gift-sell mt20">
{{#promotionInfos}}
<p><code>{{tag}}</code>{{promotionTitle}}<a class="btn-clear blue" data-together-id="6">去凑单&nbsp;&gt;</a></p>
{{/promotionInfos}}
</div>
{{/if}}
{{/ordinaryCart}}
{{#stat}}
<!-- 总价计算 -->
<div class="cartnew-sum">
{{#unless cart.isEmpty}}
<div class="left">
<a href="javascript:void(0);" class="btn_h" style="display:none;"><span>清空商品</span></a>
<i class="cart-item-check iconfont" id="cbSelAllGoods" {{#if cart.isCheckedAll}}checked="checked"{{/if}}></i>
<span>全选</span>
<a class="delAll" href="javascript:void(0);">删除选中商品</a>
<a class="removeAll" href="javascript:void(0);">移入收藏夹</a>
<a class="emptyDisabled" href="javascript:void(0);">清空失效商品</a>
{{#if soldOuts}}
<div class="cart-table">
<ul class="table table-group">
{{#each soldOuts}}
{{>cart-item}}
{{/each}}
</ul>
</div>
{{/unless}}
<div class="right">
<p>
{{#if gainYohoCoin}}<a href="/help/?category_id=87" class="yoho-coin" target="_blank"></a>
共返有货币:{{gainYohoCoin}}&#12288;&#12288;{{/if}}
已选商品<strong class="ins">{{selectedGoodsCount}}</strong>&#12288;&#12288;
商品金额:<b>¥&nbsp;{{orderAmount}}</b>
</p>
{{#if discountAmount}}<p>活动优惠:<b>&nbsp;{{discountAmount}}</b></p>{{/if}}
<!--<p>优惠码/优惠券:<b>¥&nbsp;8888.00</b></p>-->
<p class="sum">
应付金额(不含邮费):<strong><kbd>¥&nbsp;</kbd>{{lastOrderAmount}}</strong></p>
</div>
</div>
<div class="cartnew-submit" id="payDiv">
<span>添加礼品袋</span>
<a href="javascript:void(0);" class="btn-account">去结算</a>
</div>
{{/stat}}
{{/if}}
{{/advanceCart}}
{{#ordinaryCart}}
{{#pools}}
{{#if promotionInfos}}
<div class="gift-sell mt40">
{{#promotionInfos}}
<p data-role="promotion-wrap">
<code class="{{#unless isReach}}order-pay-mark-white{{/unless}}">{{tag}}</code>{{promotionTitle}}
<!--<a>去换购</a>-->
{{#if isGift}}
{{#if isNotReach}}<a href="javascript:void(0);" data-role="gift-view-btn">查看赠品</a>{{/if}}
{{#if isSelected}}
<a href="javascript:void(0);" data-role="gift-resel-btn">重选赠品</a>
{{else}}
{{#if isReach}}<a href="javascript:void(0);" data-role="gift-sel-btn">领赠品</a>{{/if}}
{{/if}}
{{/if}}
{{#if isNotReach}}
<a class="btn-clear blue" target="_blank" href="{{promotionPageUrl}}" data-together-id="1" >去凑单&nbsp;></a>
{{/if}}
<textarea data-role="gifts-cansel" class="hide" data-promotionid="{{promotionId}}">{{{giftGoodsListStr}}}</textarea>
</p>
{{/promotionInfos}}
</div>
{{/if}}
<!-- 普通商品 -->
<div class="pre-sell">
普通商品
</div>
<div class="cart-table">
<ul class="table table-group">
<li class="pre-sell-box tr"
{{#if pid}}data-pid="{{pid}}"{{/if}}
{{#if id}}data-id="{{id}}"{{/if}}
{{#if skn}}data-skn="{{skn}}"{{/if}}
{{#if sku}}data-sku="{{sku}}"{{/if}}
{{#if productNum}}data-productnum="{{productNum}}"{{/if}}
{{#if goodsType}}data-goodstype="{{goodsType}}"{{/if}}>
{{#if goodsList}}
<div class="cart-table">
<ul class="table">
{{#goodsList}}
{{> cart-item}}
{{/goodsList}}
</ul>
</div>
{{/if}}
{{/pools}}
<!--可选的加价购商品 -->
<!--priceGifts-->
<!--可选择的赠品-->
<!--gifts-->
<div class="td pay-pro" style="width: 45%;">
<i class="cart-item-check iconfont" data-goodstype="{{goodsType}}" {{#if isChecked}}checked{{/if}}></i>
<a class="pay-pro-icon" href="{{link}}" target="_blank">
<img src="{{imgCover}}">
</a>
<p class="pay-pro-info">
<a href="{{link}}" target="_blank">哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈
{{productTitle}}</a>
<span><b title="{{productColor}}">颜色:红色{{productColor}}</b> 尺码:L{{productSize}}<i class="iconfont">&#xe6c7;</i></span>
</p>
</div>
<div class="td productPrice" style="width:17%;">¥66666{{productPrice}}</div>
<div style="width:10%;" class="td adjust-cart-num">
{{#if isGift}}
<div>{{productNum}}</div>
{{^}}
{{#if isPriceGift}}
<div>{{productNum}}</div>
{{^}}
<div class="cart-num-cont">
<span class="minus"></span>
<input type="text" value="67{{productNum}}" readonly="readonly"/>
<span class="plus"></span>
<!-- -->
{{#if offShelves}}
<div class="cart-table">
<ul class="table">
{{#offShelves}}
{{> cart-item}}
{{/offShelves}}
</ul>
</div>
<p class="tip-message {{#isTipNoStore}}tipNoStore{{/isTipNoStore}}">{{tipMessage}}</p>
{{/if}}
{{/if}}
</div>
<div style="width:17%;" class="td sub-total red">¥888{{productSubtotal}}</div>
<div style="width:11%;" class="td cart-operation">
<span class="cart-del-btn">删除</span>
<span class="cart-col-btn">移入收藏</span>
</div>
<div class="goods-choose-box none" id="goodsChoose">
<div class="goods-info">
<div class="dl choose-color">
<div class="dd">颜色:</div>
<div class="dt active">
<img src="#"/>
</div>
<div class="dt">
<img src="#"/>
</div>
<div class="dt">
<img src="#"/>
</div>
</div>
<div class="dl choose-size">
<div class="dd">尺码:</div>
<div class="dt active">
40
</div>
<div class="dt">
42
</div>
<div class="dt">
44
</div>
<div class="dt">
46
</div>
<div class="dt disabled">
48
</div>
</div>
<div class="button-group">
<button class="button-sure">确定</button>
<button class="button-cancel">取消</button>
</div>
</div>
<div class="goods-info-bigImg">
<div class="bigImg">
<img src="#"/>
</div>
<div class="bigImg none">
<img src="#"/>
</div>
<div class="bigImg none">
<img src="#"/>
</div>
<div class="bigImg none">
<img src="#"/>
</div>
<div class="bigImg none">
<img src="#"/>
</div>
</div>
</div>
</li>
<li class="pre-sell-box tr"
{{#if pid}}data-pid="{{pid}}"{{/if}}
{{#if id}}data-id="{{id}}"{{/if}}
{{#if skn}}data-skn="{{skn}}"{{/if}}
{{#if sku}}data-sku="{{sku}}"{{/if}}
{{#if productNum}}data-productnum="{{productNum}}"{{/if}}
{{#if goodsType}}data-goodstype="{{goodsType}}"{{/if}}>
<div class="td pay-pro" style="width: 45%;">
<i class="cart-item-check iconfont" data-goodstype="{{goodsType}}" {{#if isChecked}}checked{{/if}}></i>
<a class="pay-pro-icon" href="{{link}}" target="_blank">
<img src="{{imgCover}}">
</a>
<p class="pay-pro-info">
<a href="{{link}}" target="_blank">哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈
{{productTitle}}</a>
<span><b title="{{productColor}}">颜色:红色{{productColor}}</b> 尺码:L{{productSize}}<i class="iconfont">&#xe6c7;</i></span>
</p>
</div>
<div class="td productPrice" style="width:17%;">¥66666{{productPrice}}</div>
<div style="width:10%;" class="td adjust-cart-num">
{{#if isGift}}
<div>{{productNum}}</div>
{{^}}
{{#if isPriceGift}}
<div>{{productNum}}</div>
{{^}}
<div class="cart-num-cont">
<span class="minus"></span>
<input type="text" value="67{{productNum}}" readonly="readonly"/>
<span class="plus"></span>
<!-- -->
{{#if soldOuts}}
<div class="cart-table">
<ul class="table">
{{#soldOuts}}
{{> cart-item}}
{{/soldOuts}}
</ul>
</div>
<p class="tip-message {{#isTipNoStore}}tipNoStore{{/isTipNoStore}}">{{tipMessage}}</p>
{{/if}}
{{/if}}
</div>
<div style="width:17%;" class="td sub-total red">¥888{{productSubtotal}}</div>
<div style="width:11%;" class="td cart-operation">
<span class="cart-del-btn">删除</span>
<span class="cart-col-btn">移入收藏</span>
</div>
<div class="goods-choose-box none" id="goodsChoose">
<div class="goods-info">
<div class="dl choose-color">
<div class="dd">颜色:</div>
<div class="dt active">
<img src="#"/>
</div>
<div class="dt">
<img src="#"/>
</div>
<div class="dt">
<img src="#"/>
</div>
</div>
<div class="dl choose-size">
<div class="dd">尺码:</div>
<div class="dt active">
40
</div>
<div class="dt">
42
</div>
<div class="dt">
44
<!-- 全场已选择的 加价购+赠品 -->
{{#if goodsList}}
<div class="cart-table">
<ul class="table">
{{#each goodsList}}
{{> cart-item}}
{{/each}}
</ul>
</div>
<div class="dt">
46
{{/if}}
{{#if promotionInfos}}
<div class="gift-sell mt20">
{{#promotionInfos}}
<p><code>{{tag}}</code>{{promotionTitle}}<a class="btn-clear blue" data-together-id="6">去凑单&nbsp;&gt;</a></p>
{{/promotionInfos}}
</div>
<div class="dt disabled">
48
{{/if}}
{{/ordinaryCart}}
{{#stat}}
<!-- 总价计算 -->
<div class="cartnew-sum">
{{#unless cart.isEmpty}}
<div class="left">
<a href="javascript:void(0);" class="btn_h" style="display:none;"><span>清空商品</span></a>
<i class="cart-item-check iconfont" id="cbSelAllGoods" {{#if cart.isCheckedAll}}checked="checked"{{/if}}></i>
<span>全选</span>
<a class="delAll" href="javascript:void(0);">删除选中商品</a>
<a class="removeAll" href="javascript:void(0);">移入收藏夹</a>
<a class="emptyDisabled" href="javascript:void(0);">清空失效商品</a>
</div>
{{/unless}}
<div class="right">
<p>
{{#if gainYohoCoin}}<a href="/help/?category_id=87" class="yoho-coin" target="_blank"></a>
共返有货币:{{gainYohoCoin}}&#12288;&#12288;{{/if}}
已选商品<strong class="ins">{{selectedGoodsCount}}</strong>&#12288;&#12288;
商品金额:<b>¥&nbsp;{{orderAmount}}</b>
</p>
{{#if discountAmount}}<p>活动优惠:<b>&nbsp;{{discountAmount}}</b></p>{{/if}}
<!--<p>优惠码/优惠券:<b>¥&nbsp;8888.00</b></p>-->
<p class="sum">
应付金额(不含邮费):<strong><kbd>¥&nbsp;</kbd>{{lastOrderAmount}}</strong></p>
</div>
</div>
<div class="button-group">
<button class="button-sure">确定</button>
<button class="button-cancel">取消</button>
</div>
</div>
<div class="goods-info-bigImg">
<div class="bigImg">
<img src="#"/>
</div>
<div class="bigImg none">
<img src="#"/>
</div>
<div class="bigImg none">
<img src="#"/>
</div>
<div class="bigImg none">
<img src="#"/>
</div>
<div class="bigImg none">
<img src="#"/>
</div>
<div class="cartnew-submit" id="payDiv">
<span>添加礼品袋</span>
<a href="javascript:void(0);" class="btn-account">去结算</a>
</div>
</div>
</li>
</ul>
{{/stat}}
</div>
{{/cart}}
... ... @@ -519,14 +230,15 @@
</div>
</div>
{{#unless @root.pc.product.removeRecentView}}
<div class="lazy-load-object">
<textarea class="datalazyload" style="visibility: hidden;">
<script>
fetchRecommend();
</script>
</textarea>
</div>
{{#unless @root.pc.product.removeRecentView}}
<div class="lazy-load-object">
<textarea class="datalazyload" style="visibility: hidden;">
<script>
fetchRecommend();
</script>
</textarea>
</div>
{{#if cart.isEmpty}}
... ... @@ -562,11 +274,17 @@
{{/if}}
{{/unless}}
<div class="loading"><span></span>请稍后...</div>
</div>
<div class="loading"><span></span>请稍后...</div>
</div>
<script type="text/javascript">
/*<textarea data-role="gifts-cansel" class="hide" data-promotionid="{{promotionId}}">{{{giftGoodsListStr}}}</textarea>*/
</script>
<!-- 商品详细信息窗口 -->
<script type="text/javascript">
... ...
... ... @@ -229,3 +229,18 @@ $goodsChoose.on('click', '.choose-color .dt', function() {
});
var giftBtn = '[data-role=gift-view-btn],[data-role=gift-resel-btn],[data-role=gift-sel-btn]';
$('.shop-cart').on('click', giftBtn, function() {
var mtext = $(this).closest('[data-role=promotion-wrap]').find('textarea[data-role=gifts-cansel]').text();
var mhtml = $(this).closest('[data-role=promotion-wrap]').find('textarea[data-role=gifts-cansel]').html();
console.log(mtext);
console.log(mhtml);
var textJson = $.parseJSON(mtext);
var htmlJson = $.parseJSON(mhtml);
console.log(textJson);
console.log(htmlJson);
});
... ...