...
|
...
|
@@ -11,13 +11,6 @@ let $ = require('yoho-jquery'), |
|
|
tip = require('../../plugin/tip'),
|
|
|
dialog = require('../../plugin/dialog');
|
|
|
|
|
|
// cookie 参数
|
|
|
let actCkOpthn = {
|
|
|
expires: 'Session',
|
|
|
path: '/cart/index',
|
|
|
domain: 'm.yohobuy.com'
|
|
|
};
|
|
|
|
|
|
let cartObj = {
|
|
|
init(handle) {
|
|
|
let self = this;
|
...
|
...
|
@@ -64,38 +57,37 @@ let cartObj = { |
|
|
},
|
|
|
promoItemClick(e) {
|
|
|
let self = this;
|
|
|
let promotionId = $(e.currentTarget).data('id');
|
|
|
let promotionType = $(e.currentTarget).data('type');
|
|
|
let promotionTitle = encodeURIComponent(`以下商品参加【${$(e.currentTarget).data('title')}】促销活动`);
|
|
|
let promotionId = $(e.currentTarget).data('id'),
|
|
|
promotionType = $(e.currentTarget).data('type'),
|
|
|
status = $(e.currentTarget).data('status'),
|
|
|
promotionTitle = encodeURIComponent(`以下商品参加【${$(e.currentTarget).data('title')}】促销活动`);
|
|
|
|
|
|
self.toPromotionPage({
|
|
|
promotionType,
|
|
|
promotionId,
|
|
|
promotionTitle,
|
|
|
status: $(e.currentTarget).data('status')
|
|
|
status
|
|
|
});
|
|
|
},
|
|
|
toPromotionPage(opts) {
|
|
|
let cartType = cookie.get('_cartType') || 'ordinary';
|
|
|
let title = encodeURIComponent('优惠活动商品');
|
|
|
let href;
|
|
|
|
|
|
if (opts.promotionType === 'Gift') {
|
|
|
if (opts.status === 20 || (opts.promotionType !== 'Gift' && opts.promotionType !== 'Needpaygift')) {
|
|
|
href = `/product/index/index?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}`;
|
|
|
} else if (opts.promotionType === 'Gift') {
|
|
|
href = `/cart/index/new/gift?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}`;
|
|
|
if (opts.status === 30) {
|
|
|
window.location.href = `/cart/index/new/gift?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}&edit=1`;
|
|
|
} else {
|
|
|
window.location.href = `/cart/index/new/gift?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}`;
|
|
|
href += '&edit=1';
|
|
|
}
|
|
|
|
|
|
} else if (opts.promotionType === 'Needpaygift') {
|
|
|
href = `/cart/index/new/advanceBuy?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}`;
|
|
|
if (opts.status === 30) {
|
|
|
window.location.href = `/cart/index/new/advanceBuy?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}&edit=1`;
|
|
|
} else {
|
|
|
window.location.href = `/cart/index/new/advanceBuy?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}`;
|
|
|
href += '&edit=1';
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
window.location.href = `/product/index/index?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}`;
|
|
|
}
|
|
|
window.location.href = href;
|
|
|
},
|
|
|
allGiftBoxClick(e) {
|
|
|
let cartType = cookie.get('_cartType') || 'ordinary';
|
...
|
...
|
|