Authored by 李奇

拼团详情页分享修改

... ... @@ -106,6 +106,7 @@ function progress(req, res, next) {
localCss: true,
nodownload: true,
width750: true,
wechatShare: true,
data: renderData
});
}).catch(next);
... ...
{{#data}}
<div class="group-progress" data-page-go="{{pageGo}}" data-left-time="{{leftTime}}">
<div class="group-progress" data-page-go="{{pageGo}}"
data-activity-id="{{activityId}}"
data-left-time="{{leftTime}}"
data-lack-num="{{lackNum}}"
data-group-no="{{groupNo}}"
data-product-name="{{yourJoinItem.productName}}"
data-group-price="{{yourJoinItem.productGroupPrice}}"
data-share-img="{{image2 yourJoinItem.productIcon w=200 h=282}}">
<div class="card">
<div class="inner-card go-join" data-product-skn="{{yourJoinItem.productSkn}}"
data-activity-id="{{activityId}}" data-group-no="{{groupNo}}" data-page-go="{{pageGo}}">
... ...
... ... @@ -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}`;
}
});
... ...