Authored by 刘传洋

m

... ... @@ -290,7 +290,7 @@ const getTogetherProduct = (req, res) => {
'hasPrev': true,
'hasNext': true,
'item': [{
'id': 675944,
'id': 71984,
'skn': 51486050,
'href': '\/\/item.yohobuy.com\/product\/pro_675944_831288\/MYFUN yinliaopingxiuhuanvmianwa 1611DPA0195.html',
'title': 'MY FUN \u996e\u6599\u74f6\u7ee3\u82b1\u5973\u68c9\u889c',
... ... @@ -299,7 +299,7 @@ const getTogetherProduct = (req, res) => {
'price': '19.00',
'marketPrice': '49.00'
}, {
'id': 675942,
'id': 71984,
'skn': 51486048,
'href': '\/\/item.yohobuy.com\/product\/pro_675942_831286\/MYFUN siyecaoxiuhuanvmianwa 1611DPA0194.html',
'title': 'MY FUN \u56db\u53f6\u8349\u7ee3\u82b1\u5973\u68c9\u889c',
... ... @@ -308,7 +308,7 @@ const getTogetherProduct = (req, res) => {
'price': '19.00',
'marketPrice': '49.00'
}, {
'id': 675876,
'id': 71984,
'skn': 51485982,
'href': '\/\/item.yohobuy.com\/product\/pro_675876_831220\/MYFUN caitiaowennanshizhangtongwa 1611DPA0045.html',
'title': 'MYFUN \u5f69\u6761\u7eb9\u7537\u58eb\u957f\u7b52\u889c',
... ... @@ -317,7 +317,7 @@ const getTogetherProduct = (req, res) => {
'price': '19.00',
'marketPrice': '39.00'
}, {
'id': 675874,
'id': 71984,
'skn': 51485980,
'href': '\/\/item.yohobuy.com\/product\/pro_675874_831218\/MYFUN caitiaowennanshizhangtongwa 1611DPA0043.html',
'title': 'MY FUN \u5f69\u6761\u7eb9\u7537\u58eb\u957f\u7b52\u889c',
... ... @@ -326,7 +326,7 @@ const getTogetherProduct = (req, res) => {
'price': '19.00',
'marketPrice': '39.00'
}, {
'id': 675872,
'id': 71984,
'skn': 51485978,
'href': '\/\/item.yohobuy.com\/product\/pro_675872_831216\/MYFUN ertiaogangnanshizhongtongwa 1611DPA0034.html',
'title': 'MY FUN \u7537\u58eb\u4e2d\u7b52\u889c',
... ... @@ -404,7 +404,7 @@ const getRecommendProductAction = (req, res) => {
'hasPrev': false,
'hasNext': false,
'item': [{
'id': 493102,
'id': 71984,
'skn': 51295054,
'href': '\/\/item.yohobuy.com\/product\/pro_493102_450622\/LIFEAFTERLIFEDaYiLALA603WO97.html',
'title': 'Life\u00b7After Life \u6e14\u592b\u6263\u5927\u8863\u3010\u591a\u8272\u53ef\u9009\u3011',
... ... @@ -413,7 +413,7 @@ const getRecommendProductAction = (req, res) => {
'price': '589.00',
'marketPrice': '1389.00'
}, {
'id': 599258,
'id': 71984,
'skn': 51404992,
'href': '\/\/item.yohobuy.com\/product\/pro_599258_575876\/VEIL KEIOS x GARFIELD Sports Cap: Monday landicixiudiandaojiafei heisewanyanmao GFK-007.html',
'title': 'keios under the veil \u84dd\u5e95\u523a\u7ee3\u985b\u5012\u52a0\u83f2 \u9ed1\u8272\u5f2f\u6a90\u5e3d',
... ...
... ... @@ -292,25 +292,6 @@
</div>
{{/stat}}
<<<<<<< HEAD
<div class="cart-del-goods">
<p class="cart-del-goods-title">已删除商品,您可以重新购买或移入收藏:</p>
<ul>
<li>
<span class="good-name" style="width: 392px;"><a>TEEBACOO虎头字母短袖T恤</a></span>
<span class="good-price" style="width: 148px;">¥760.00</span>
<span class="good-num" style="width: 128px;">2</span>
<span class="good-operate" style="width: 260px;"><a>重新购买</a><a>移入收藏</a></span>
</li>
<li>
<span class="good-name" style="width: 392px;"><a>TEEBACOO虎头字母短袖T恤</a></span>
<span class="good-price" style="width: 148px;">¥760.00</span>
<span class="good-num" style="width: 128px;">2</span>
<span class="good-operate" style="width: 260px;"><a>重新购买</a><a>移入收藏</a></span>
</li>
</ul>
</div>
=======
{{#if deleteShop}}
<div class="cart-del-goods">
<p class="cart-del-goods-title">已删除商品,您可以重新购买或移入收藏:</p>
... ... @@ -331,7 +312,6 @@
</ul>
</div>
{{/if}}
>>>>>>> 88dbe2bef993419080ce441df806a520fe63cc67
{{> cart-pre-sell-tpl }}
</div>
... ... @@ -380,10 +360,10 @@
{{/unless}}
<div class="loading"><span></span>请稍后...</div>
<div class="modal-overflow" style="display: none;">
<div class="modal-overflow" style="display: none;" data-role="mdialog" id="Y_goodsSelectWinDialog">
<div class="body-modal-black"></div>
<div id="Y_goodsSelectWin" class="goods-select-win yoho-dialog cart-togetherGoods" style="top:50px;">
<div class="close">
<div class="close" data-role="mdialog-close">
<i class="iconfont">&#xe60d;</i>
</div>
<div class="content goods-select-content">
... ...
... ... @@ -2,11 +2,12 @@
* Created by yoho on 2017-01-05.
*/
var $ = require('yoho-jquery');
var dialog = require('../common/dialog');
var Alert = dialog.Alert,
var $ = require('yoho-jquery'),
dialog = require('../common/dialog'),
Alert = dialog.Alert,
CART_ITEM_DEL_URL = '/newcart/index/remove',
CART_ITEM_FAV_URL = '/newcart/index/fav';
CART_ITEM_FAV_URL = '/newcart/index/fav',
cartItemNumChg;
// checkbox提交ajax
function choiceOut(items) {
... ... @@ -96,7 +97,7 @@ function cartItemDel(items, type, cookieList) {
}
// 购物车商品增减
var cartItemNumChg = (function() {
cartItemNumChg = (function() {
var countBusy = false; // 保证一次只请求完成前不能再次发起
... ... @@ -379,6 +380,21 @@ function getTogetherProduct(page) {
});
}
function showMDialog(id) {
$(id).show();
$('body').addClass('mmodal-body');
}
function hideMDialog(id) {
$(id).hide();
$('body').removeClass('mmodal-body');
}
// 关闭按钮
$('[data-role=mdialog]').on('click', '[data-role=mdialog-close]', function() {
hideMDialog($(this).closest('[data-role=mdialog]'));
});
module.exports = {
addcart: addcart,
getProductInfo: getProductInfo,
... ... @@ -390,5 +406,7 @@ module.exports = {
updateCartGiftItem: updateCartGiftItem,
getProductByPromotionId: getProductByPromotionId,
getFineProduct: getFineProduct,
getTogetherProduct: getTogetherProduct
getTogetherProduct: getTogetherProduct,
showMDialog: showMDialog,
hideMDialog: hideMDialog
};
... ...
... ... @@ -2,33 +2,39 @@
* Created by yoho on 2017-01-05.
*/
var $ = require('yoho-jquery');
var dialog = require('../common/dialog');
var Alert = dialog.Alert;
var $payWapper = $('.pay-wapper'),
var $ = require('yoho-jquery'),
dialog = require('../common/dialog'),
Alert = dialog.Alert,
$payWapper = $('.pay-wapper'),
giftsWinTpl = require('hbs/cart/cart-gifts-win-tpl.hbs'),
productInfoTpl = require('hbs/cart/cart-product-info-tpl.hbs'),
$goodsSelWin = $('#Y_goodsSelectWin');
$ModalOverflow = $('.modal-overflow');
var capi = require('./cart-api');
$(function () {
$(".body-modal-black").css({
$goodsSelWin = $('#Y_goodsSelectWin'),
capi = require('./cart-api'),
// 显示赠品
giftBtn = ['[data-role=gift-view-btn]',
'[data-role=gift-resel-btn]',
'[data-role=gift-sel-btn]',
'[data-role=pg-sel-btn]',
'[data-role=pg-resel-btn]'];
$(function() {
$('.body-modal-black').css({
height: $(document).height(),
width: $(document).width()
});
})
});
function renderAndShowGiftWin(plist) {
$goodsSelWin.find('.content').empty().html(giftsWinTpl(plist));
capi.showMDialog('#Y_goodsSelectWinDialog');/*
$ModalOverflow.show();
$ModalOverflow.closest('body').css({"overflow":'hidden',"position":"relative"});
$ModalOverflow.closest('body').css({'overflow': 'hidden', 'position': 'relative'});*/
}
/** 赠品加价购弹窗 **/
var GoodsWinAction = {
showGiftWin: function () {
showGiftWin: function() {
var $this = $(this);
var $wrap = $this.closest('[data-role="promotion-wrap"]');
... ... @@ -57,7 +63,7 @@ var GoodsWinAction = {
$promotionPool.find('[data-role=pitem][data-ispricegift], [data-role=pitem][data-isgift]');
if (!promotionInfo) {
capi.getProductByPromotionId(promotionid).done(function (pinfo) {
capi.getProductByPromotionId(promotionid).done(function(pinfo) {
if (!pinfo && pinfo.code !== 200) {
... ... @@ -72,7 +78,7 @@ var GoodsWinAction = {
$wrap.data('_promotionInfo', promotionInfo);
renderAndShowGiftWin(promotionInfo);
}).fail(function () {
}).fail(function() {
new Alert('获取商品失败,请稍后再试!').show();
});
return;
... ... @@ -80,23 +86,23 @@ var GoodsWinAction = {
renderAndShowGiftWin(promotionInfo);
},
closeWin: function () {
/*closeWin: function() {
$ModalOverflow.hide();
},
changeGoods: function () {
},*/
changeGoods: function() {
var $this = $(this);
var id = $this.data('id');
var skn = $this.data('skn');
$this.sibling('li').removeClass('active');
$this.siblings('li').removeClass('active');
$this.addClass('active');
capi.getProductInfo(id, skn).then(res => {
$goodsSelWin.find('.product-detail-info').empty().append(productInfoTpl(res));
});
},
selThumb: function () {
selThumb: function() {
var $this = $(this);
var idx = $(this).index();
... ... @@ -104,7 +110,7 @@ var GoodsWinAction = {
$this.addClass('active');
$goodsSelWin.find('.detail-bigpic:not(.none) .bigpic').hide().eq(idx).show();
},
selThumbPrevNext: function () {
selThumbPrevNext: function() {
var $this = $(this);
var $detailBigpic = $this.closest('.detail-bigpic');
var curIndex = Number($detailBigpic.data('_index') || 0);
... ... @@ -127,7 +133,7 @@ var GoodsWinAction = {
$lis.removeClass('active').eq(curIndex).addClass('active');
$detailBigpic.find('.bigpic').hide().eq(curIndex).show();
},
selColor: function () {
selColor: function() {
var $this = $(this);
var idx = $this.index();
... ... @@ -159,7 +165,7 @@ var GoodsWinAction = {
$curDetailBig.find('.con li').removeClass('active');
$curDetailBig.find('.con li').eq(bigPicIndex).addClass('active');
$sizes.eq(idx).find('span').each(function () {
$sizes.eq(idx).find('span').each(function() {
if ($(this).hasClass('null-atcivec')) {
$goodsSelWin.find('.addcart').addClass('none');
$goodsSelWin.find('.btn_sellout').removeClass('none');
... ... @@ -170,7 +176,7 @@ var GoodsWinAction = {
}
});
},
selSize: function () {
selSize: function() {
var $this = $(this);
... ... @@ -188,7 +194,7 @@ var GoodsWinAction = {
$goodsSelWin.find('.btn_sellout').removeClass('none');
}
},
changeNum: function () {
changeNum: function() {
var $this = $(this);
var $pinfo = $this.closest('.product-detail-info');
... ... @@ -220,13 +226,14 @@ var GoodsWinAction = {
}
},
add2Cart: function () {
add2Cart: function() {
var $this = $(this);
var $curSize = $goodsSelWin.find('[data-role=sizes] .size-row:not(.none) .active');
var $num = $goodsSelWin.find('#num');
var allNum = $curSize.data('num');
var sku = $curSize.data('sku');
var skn = $this.closest('.detail-goods').data('skn');
var promotionId = $this.closest('.product-detail-info').data('promotionid') || 0;
var isSwap = $this.closest('.product-detail-info').data('swap');
... ... @@ -246,7 +253,7 @@ var GoodsWinAction = {
// 替换促销商品
if (isSwap) {
capi.updateCartGiftItem(promotionId, newSkn, sku);
capi.updateCartGiftItem(promotionId, skn, sku);
} else {
capi.addcart({
productSku: sku,
... ... @@ -259,16 +266,10 @@ var GoodsWinAction = {
};
/** 弹窗事件绑定 **/
// 显示赠品
var giftBtn = ['[data-role=gift-view-btn]',
'[data-role=gift-resel-btn]',
'[data-role=gift-sel-btn]',
'[data-role=pg-sel-btn]',
'[data-role=pg-resel-btn]'];
$payWapper./* find('li[data-role="pitem"]').*/on('click', giftBtn.join(','), GoodsWinAction.showGiftWin);
$goodsSelWin.on('click', '.close', GoodsWinAction.closeWin);
// $goodsSelWin.on('click', '.close', GoodsWinAction.closeWin);
$goodsSelWin.on('click', '.slide-img .img-list .img-item', GoodsWinAction.changeGoods);
$goodsSelWin.on('click', '.piclist li', GoodsWinAction.selThumb);
$goodsSelWin.on('click', '.pre, .next', GoodsWinAction.selThumbPrevNext);
... ...