...
|
...
|
@@ -17,7 +17,7 @@ import { |
|
|
import {formatImageUrl} from '../../utils/util'
|
|
|
|
|
|
import {
|
|
|
Toast
|
|
|
Toast, Actionsheet
|
|
|
} from '../../vendors/zanui/index';
|
|
|
import router from './router/router';
|
|
|
import { jumpByUrl } from '../../libs/urlRoute';
|
...
|
...
|
@@ -57,7 +57,28 @@ Page(Object.assign({ |
|
|
dialogUrl: null,
|
|
|
bannerSrc: null,
|
|
|
bannerUrl: null,
|
|
|
openType: 'getUserInfo'
|
|
|
openType: 'getUserInfo',
|
|
|
actionsheet: {
|
|
|
componentId: 'shareActionSheet',
|
|
|
show: false,
|
|
|
closeOnClickOverlay: true,
|
|
|
cancelText: '取消',
|
|
|
isNewShareStyle: true,
|
|
|
unionUserImageUrl: 'http://img12.static.yhbimg.com/sns/2018/08/02/15/029b6acc4f8bc0620ecd7ec2133fcf900c.png',
|
|
|
actions: [{
|
|
|
name: '分享给好友',
|
|
|
className: 'action-class',
|
|
|
loading: false,
|
|
|
openType: 'share',
|
|
|
image_src: '../../images/share_wechat@2x.png',
|
|
|
},
|
|
|
{
|
|
|
name: '生成海报分享',
|
|
|
className: 'action-class',
|
|
|
loading: false,
|
|
|
image_src: '../../images/share_wxpeng@2x.png'
|
|
|
}]
|
|
|
},
|
|
|
},
|
|
|
|
|
|
onLoad(options) {
|
...
|
...
|
@@ -87,7 +108,9 @@ Page(Object.assign({ |
|
|
this._init();
|
|
|
}
|
|
|
new app.WeToast();
|
|
|
if(!(options && +options.reload === 0)) {
|
|
|
console.log(options.reload);
|
|
|
if(options && (Number(options.reload) !== 0)) {
|
|
|
console.log('执行了');
|
|
|
this._getResouceCode()
|
|
|
}
|
|
|
this._getBottomBanner()
|
...
|
...
|
@@ -470,4 +493,71 @@ Page(Object.assign({ |
|
|
});
|
|
|
},
|
|
|
|
|
|
}, Toast)); |
|
|
\ No newline at end of file |
|
|
share({ detail }) {
|
|
|
this.setData({
|
|
|
'actionsheet.show': true,
|
|
|
'shareProduct': detail
|
|
|
})
|
|
|
},
|
|
|
|
|
|
handleZanActionsheetCancel({ componentId }) {
|
|
|
this.setData({
|
|
|
'actionsheet.show': false
|
|
|
})
|
|
|
},
|
|
|
|
|
|
handleZanActionsheetClick({ componentId, index }) {
|
|
|
this.setData({
|
|
|
'actionsheet.show': false
|
|
|
});
|
|
|
|
|
|
let qrcode = this.service.getQrCode({
|
|
|
shareUid: app.getUid(),
|
|
|
actPrizeId: this.data.shareProduct.act_prize_id
|
|
|
});
|
|
|
|
|
|
if (index === 1) {
|
|
|
if (this.data.shareProduct.name) {
|
|
|
router.go('snapShare', {
|
|
|
product_name: this.data.shareProduct.name,
|
|
|
default_image: this.data.shareProduct.cover_img,
|
|
|
product_price: this.data.shareProduct.price,
|
|
|
product_qrCode: qrcode
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
onShareAppMessage(res) {
|
|
|
let params = {
|
|
|
TITLE: `【0元抽奖】点一下,免费拿走${this.data.shareProduct.name}`,
|
|
|
DESC: '我在YO!LUCK发现一个不错的商品赶快来看看吧!'
|
|
|
};
|
|
|
|
|
|
if (res.from === 'menu') {
|
|
|
// 用户点击右上角分享
|
|
|
return {
|
|
|
title: params.TITLE, // 分享标题
|
|
|
desc: params.DESC, // 分享描述
|
|
|
path: `pages/zeroSell/detail?actPrizeId=${this.data.shareProduct.act_prize_id}`,
|
|
|
imageUrl: this.data.shareProduct.cover_img,
|
|
|
success: function () {
|
|
|
},
|
|
|
fail: function () {
|
|
|
}
|
|
|
};
|
|
|
} else if (res.from === 'button') {
|
|
|
// 用户点击分享按钮
|
|
|
|
|
|
return {
|
|
|
title: params.TITLE, // 分享标题
|
|
|
desc: params.DESC, // 分享描述
|
|
|
path: `/pages/zeroSell/detail?actPrizeId=${this.data.shareProduct.act_prize_id}&shareUid=${app.getUid()}`,
|
|
|
imageUrl: this.data.shareProduct.cover_img,
|
|
|
success: function () {
|
|
|
},
|
|
|
fail: function () {
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
}
|
|
|
}, Toast, Actionsheet)); |
|
|
\ No newline at end of file |
...
|
...
|
|