...
|
...
|
@@ -22,16 +22,40 @@ class GroupProgress extends Page { |
|
|
$countdown: $('.count-down')
|
|
|
};
|
|
|
this.timer = '';
|
|
|
this.data = {
|
|
|
groupNo: '',
|
|
|
lackNum: '',
|
|
|
productName: '',
|
|
|
groupPrice: '',
|
|
|
shareImgUrl: ''
|
|
|
};
|
|
|
this.init();
|
|
|
}
|
|
|
|
|
|
init() {
|
|
|
lazyLoad(this.selector.$page.find('img.lazy'));
|
|
|
this.initData();
|
|
|
this.bindEvents();
|
|
|
this.shareInfo();
|
|
|
this.countdown();
|
|
|
}
|
|
|
|
|
|
initData() {
|
|
|
let activityId = this.selector.$page.data('activity-id');
|
|
|
let groupNo = this.selector.$page.data('group-no');
|
|
|
let lackNum = this.selector.$page.data('lack-num');
|
|
|
let productName = this.selector.$page.data('product-name');
|
|
|
let groupPrice = this.selector.$page.data('group-price');
|
|
|
let shareImgUrl = this.selector.$page.data('share-img');
|
|
|
|
|
|
this.data.groupNo = groupNo;
|
|
|
this.data.lackNum = lackNum;
|
|
|
this.data.productName = productName;
|
|
|
this.data.groupPrice = groupPrice;
|
|
|
this.data.activityId = activityId;
|
|
|
this.data.shareImgUrl = shareImgUrl;
|
|
|
}
|
|
|
|
|
|
bindEvents() {
|
|
|
this.selector.$productItem.on('click', this.goDetail.bind(this));
|
|
|
this.selector.$goJoin.on('click', this.goJoin.bind(this));
|
...
|
...
|
@@ -40,17 +64,23 @@ class GroupProgress extends Page { |
|
|
}
|
|
|
|
|
|
shareInfo() {
|
|
|
let _this = this;
|
|
|
let link = '';
|
|
|
let [domain] = location.href.split('?');
|
|
|
|
|
|
link = `${domain}?activityId=${this.data.activityId}&groupNo=${this.data.groupNo}`;
|
|
|
|
|
|
_this.data.shareImgUrl = _this.data.shareImgUrl.replace(/(http:)?\/\//, 'https://');
|
|
|
|
|
|
sharePlugin({
|
|
|
title: '有货福利团xx元包邮xxx商品',
|
|
|
imgUrl: '',
|
|
|
link: '',
|
|
|
desc: 'x人团更优惠,正品保证,全场包邮',
|
|
|
copyDeac: '【有货福利团 】x人团,xx元包邮xxx商品>>'
|
|
|
title: `【还差${_this.data.lackNum}人】${_this.data.groupPrice}金额 拼${_this.data.productName}`,
|
|
|
imgUrl: _this.data.shareImgUrl,
|
|
|
link: link
|
|
|
});
|
|
|
|
|
|
let clipboardShare = new Clipboard('.h5-share-clipboard', {
|
|
|
text: function() {
|
|
|
return '【有货福利团 】x人团,xx元包邮xxx商品>>';
|
|
|
return `【还差${_this.data.lackNum}人】${_this.data.groupPrice}金额 拼${_this.data.productName}>>${link}`;
|
|
|
}
|
|
|
});
|
|
|
|
...
|
...
|
|