|
@@ -22,16 +22,40 @@ class GroupProgress extends Page { |
|
@@ -22,16 +22,40 @@ class GroupProgress extends Page { |
22
|
$countdown: $('.count-down')
|
22
|
$countdown: $('.count-down')
|
23
|
};
|
23
|
};
|
24
|
this.timer = '';
|
24
|
this.timer = '';
|
|
|
25
|
+ this.data = {
|
|
|
26
|
+ groupNo: '',
|
|
|
27
|
+ lackNum: '',
|
|
|
28
|
+ productName: '',
|
|
|
29
|
+ groupPrice: '',
|
|
|
30
|
+ shareImgUrl: ''
|
|
|
31
|
+ };
|
25
|
this.init();
|
32
|
this.init();
|
26
|
}
|
33
|
}
|
27
|
|
34
|
|
28
|
init() {
|
35
|
init() {
|
29
|
lazyLoad(this.selector.$page.find('img.lazy'));
|
36
|
lazyLoad(this.selector.$page.find('img.lazy'));
|
|
|
37
|
+ this.initData();
|
30
|
this.bindEvents();
|
38
|
this.bindEvents();
|
31
|
this.shareInfo();
|
39
|
this.shareInfo();
|
32
|
this.countdown();
|
40
|
this.countdown();
|
33
|
}
|
41
|
}
|
34
|
|
42
|
|
|
|
43
|
+ initData() {
|
|
|
44
|
+ let activityId = this.selector.$page.data('activity-id');
|
|
|
45
|
+ let groupNo = this.selector.$page.data('group-no');
|
|
|
46
|
+ let lackNum = this.selector.$page.data('lack-num');
|
|
|
47
|
+ let productName = this.selector.$page.data('product-name');
|
|
|
48
|
+ let groupPrice = this.selector.$page.data('group-price');
|
|
|
49
|
+ let shareImgUrl = this.selector.$page.data('share-img');
|
|
|
50
|
+
|
|
|
51
|
+ this.data.groupNo = groupNo;
|
|
|
52
|
+ this.data.lackNum = lackNum;
|
|
|
53
|
+ this.data.productName = productName;
|
|
|
54
|
+ this.data.groupPrice = groupPrice;
|
|
|
55
|
+ this.data.activityId = activityId;
|
|
|
56
|
+ this.data.shareImgUrl = shareImgUrl;
|
|
|
57
|
+ }
|
|
|
58
|
+
|
35
|
bindEvents() {
|
59
|
bindEvents() {
|
36
|
this.selector.$productItem.on('click', this.goDetail.bind(this));
|
60
|
this.selector.$productItem.on('click', this.goDetail.bind(this));
|
37
|
this.selector.$goJoin.on('click', this.goJoin.bind(this));
|
61
|
this.selector.$goJoin.on('click', this.goJoin.bind(this));
|
|
@@ -40,17 +64,23 @@ class GroupProgress extends Page { |
|
@@ -40,17 +64,23 @@ class GroupProgress extends Page { |
40
|
}
|
64
|
}
|
41
|
|
65
|
|
42
|
shareInfo() {
|
66
|
shareInfo() {
|
|
|
67
|
+ let _this = this;
|
|
|
68
|
+ let link = '';
|
|
|
69
|
+ let [domain] = location.href.split('?');
|
|
|
70
|
+
|
|
|
71
|
+ link = `${domain}?activityId=${this.data.activityId}&groupNo=${this.data.groupNo}`;
|
|
|
72
|
+
|
|
|
73
|
+ _this.data.shareImgUrl = _this.data.shareImgUrl.replace(/(http:)?\/\//, 'https://');
|
|
|
74
|
+
|
43
|
sharePlugin({
|
75
|
sharePlugin({
|
44
|
- title: '有货福利团xx元包邮xxx商品',
|
|
|
45
|
- imgUrl: '',
|
|
|
46
|
- link: '',
|
|
|
47
|
- desc: 'x人团更优惠,正品保证,全场包邮',
|
|
|
48
|
- copyDeac: '【有货福利团 】x人团,xx元包邮xxx商品>>'
|
76
|
+ title: `【还差${_this.data.lackNum}人】${_this.data.groupPrice}金额 拼${_this.data.productName}`,
|
|
|
77
|
+ imgUrl: _this.data.shareImgUrl,
|
|
|
78
|
+ link: link
|
49
|
});
|
79
|
});
|
50
|
|
80
|
|
51
|
let clipboardShare = new Clipboard('.h5-share-clipboard', {
|
81
|
let clipboardShare = new Clipboard('.h5-share-clipboard', {
|
52
|
text: function() {
|
82
|
text: function() {
|
53
|
- return '【有货福利团 】x人团,xx元包邮xxx商品>>';
|
83
|
+ return `【还差${_this.data.lackNum}人】${_this.data.groupPrice}金额 拼${_this.data.productName}>>${link}`;
|
54
|
}
|
84
|
}
|
55
|
});
|
85
|
});
|
56
|
|
86
|
|