|
@@ -11,13 +11,6 @@ let $ = require('yoho-jquery'), |
|
@@ -11,13 +11,6 @@ let $ = require('yoho-jquery'), |
11
|
tip = require('../../plugin/tip'),
|
11
|
tip = require('../../plugin/tip'),
|
12
|
dialog = require('../../plugin/dialog');
|
12
|
dialog = require('../../plugin/dialog');
|
13
|
|
13
|
|
14
|
-// cookie 参数
|
|
|
15
|
-let actCkOpthn = {
|
|
|
16
|
- expires: 'Session',
|
|
|
17
|
- path: '/cart/index',
|
|
|
18
|
- domain: 'm.yohobuy.com'
|
|
|
19
|
-};
|
|
|
20
|
-
|
|
|
21
|
let cartObj = {
|
14
|
let cartObj = {
|
22
|
init(handle) {
|
15
|
init(handle) {
|
23
|
let self = this;
|
16
|
let self = this;
|
|
@@ -64,38 +57,37 @@ let cartObj = { |
|
@@ -64,38 +57,37 @@ let cartObj = { |
64
|
},
|
57
|
},
|
65
|
promoItemClick(e) {
|
58
|
promoItemClick(e) {
|
66
|
let self = this;
|
59
|
let self = this;
|
67
|
- let promotionId = $(e.currentTarget).data('id');
|
|
|
68
|
- let promotionType = $(e.currentTarget).data('type');
|
|
|
69
|
- let promotionTitle = encodeURIComponent(`以下商品参加【${$(e.currentTarget).data('title')}】促销活动`);
|
60
|
+ let promotionId = $(e.currentTarget).data('id'),
|
|
|
61
|
+ promotionType = $(e.currentTarget).data('type'),
|
|
|
62
|
+ status = $(e.currentTarget).data('status'),
|
|
|
63
|
+ promotionTitle = encodeURIComponent(`以下商品参加【${$(e.currentTarget).data('title')}】促销活动`);
|
70
|
|
64
|
|
71
|
self.toPromotionPage({
|
65
|
self.toPromotionPage({
|
72
|
promotionType,
|
66
|
promotionType,
|
73
|
promotionId,
|
67
|
promotionId,
|
74
|
promotionTitle,
|
68
|
promotionTitle,
|
75
|
- status: $(e.currentTarget).data('status')
|
69
|
+ status
|
76
|
});
|
70
|
});
|
77
|
},
|
71
|
},
|
78
|
toPromotionPage(opts) {
|
72
|
toPromotionPage(opts) {
|
79
|
let cartType = cookie.get('_cartType') || 'ordinary';
|
73
|
let cartType = cookie.get('_cartType') || 'ordinary';
|
80
|
let title = encodeURIComponent('优惠活动商品');
|
74
|
let title = encodeURIComponent('优惠活动商品');
|
|
|
75
|
+ let href;
|
81
|
|
76
|
|
82
|
- if (opts.promotionType === 'Gift') {
|
77
|
+ if (opts.status === 20 || (opts.promotionType !== 'Gift' && opts.promotionType !== 'Needpaygift')) {
|
|
|
78
|
+ href = `/product/index/index?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}`;
|
|
|
79
|
+ } else if (opts.promotionType === 'Gift') {
|
|
|
80
|
+ href = `/cart/index/new/gift?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}`;
|
83
|
if (opts.status === 30) {
|
81
|
if (opts.status === 30) {
|
84
|
- window.location.href = `/cart/index/new/gift?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}&edit=1`;
|
|
|
85
|
- } else {
|
|
|
86
|
- window.location.href = `/cart/index/new/gift?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}`;
|
82
|
+ href += '&edit=1';
|
87
|
}
|
83
|
}
|
88
|
-
|
|
|
89
|
} else if (opts.promotionType === 'Needpaygift') {
|
84
|
} else if (opts.promotionType === 'Needpaygift') {
|
|
|
85
|
+ href = `/cart/index/new/advanceBuy?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}`;
|
90
|
if (opts.status === 30) {
|
86
|
if (opts.status === 30) {
|
91
|
- window.location.href = `/cart/index/new/advanceBuy?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}&edit=1`;
|
|
|
92
|
- } else {
|
|
|
93
|
- window.location.href = `/cart/index/new/advanceBuy?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}`;
|
87
|
+ href += '&edit=1';
|
94
|
}
|
88
|
}
|
95
|
-
|
|
|
96
|
- } else {
|
|
|
97
|
- window.location.href = `/product/index/index?promotion_id=${opts.promotionId}&title=${title}&intro_text=${opts.promotionTitle}&cartType=${cartType}`;
|
|
|
98
|
}
|
89
|
}
|
|
|
90
|
+ window.location.href = href;
|
99
|
},
|
91
|
},
|
100
|
allGiftBoxClick(e) {
|
92
|
allGiftBoxClick(e) {
|
101
|
let cartType = cookie.get('_cartType') || 'ordinary';
|
93
|
let cartType = cookie.get('_cartType') || 'ordinary';
|