...
|
...
|
@@ -4,7 +4,7 @@ import event from '../../common/event'; |
|
|
import LimitModel from '../../models/limit/index';
|
|
|
import helper from '../../utils/helper';
|
|
|
import wx from '../../utils/wx';
|
|
|
|
|
|
import {Actionsheet} from '../../vendors/zanui/index';
|
|
|
|
|
|
let app = getApp();
|
|
|
let router = global.router;
|
...
|
...
|
@@ -31,7 +31,7 @@ let router = global.router; |
|
|
* https://api.yoho.cn/?activityId=294&app_version=6.4.0&client_secret=e7ecfcd3410f5c8b0054c07b8366a700&client_type=iphone&fromPage=iFP_LimitPurchaseDetail&method=app.limitProduct.addUserShare&os_version=11.2.6&physical_channel=1&screen_size=375x667&session_key=d4c06294461b138058ce3aa2978cd602&udid=1a61c0b4db7b6e27999b1237977b5347eb503956&uid=349709&v=7 HTTP/1.1
|
|
|
*/
|
|
|
|
|
|
Page({
|
|
|
Page(Object.assign({
|
|
|
|
|
|
/**
|
|
|
* 页面的初始数据
|
...
|
...
|
@@ -39,6 +39,13 @@ Page({ |
|
|
data: {
|
|
|
userInfo: {}, // 用户信息
|
|
|
activityInfo: {}, // 活动信息
|
|
|
shareInfo: {
|
|
|
default_image: '',
|
|
|
product_name: '',
|
|
|
product_qrCode: '',
|
|
|
product_skn: '',
|
|
|
limitProductCode: ''
|
|
|
},
|
|
|
test_uid: [349709, // 测试用
|
|
|
500030924,
|
|
|
500030922,
|
...
|
...
|
@@ -95,7 +102,23 @@ Page({ |
|
|
tempScrollTop: 0, // 手动滚动页面时保存当前滚动的位置
|
|
|
showMsg: 0, // 0不显示提示框, 1显示提示框
|
|
|
hidePopup: 0, // 用于显示头像旁边的气泡 0:显示 1:不显示
|
|
|
hideInviteButton: 0 // 用户显示邀请按钮
|
|
|
hideInviteButton: 0, // 用户显示邀请按钮
|
|
|
actionSheet: {
|
|
|
componentId: 'shareActionSheet',
|
|
|
show: false,
|
|
|
closeOnClickOverlay: true,
|
|
|
cancelText: '取消',
|
|
|
actions: [{
|
|
|
name: '邀请好友助力',
|
|
|
className: 'action-class',
|
|
|
loading: false,
|
|
|
openType: 'share'
|
|
|
}, {
|
|
|
name: '生成图片分享到朋友圈',
|
|
|
className: 'action-class',
|
|
|
loading: false,
|
|
|
}]
|
|
|
},
|
|
|
},
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -116,6 +139,14 @@ Page({ |
|
|
this.getUserActivityInfo(actId, uid);
|
|
|
}
|
|
|
}); // 获取活动信息
|
|
|
|
|
|
for (let i in options) {
|
|
|
options[i] = decodeURIComponent(options[i]);
|
|
|
}
|
|
|
|
|
|
this.setData({
|
|
|
shareInfo: Object.assign(this.data.shareInfo, options)
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
|
...
|
...
|
@@ -129,7 +160,7 @@ Page({ |
|
|
/**
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
onShow: function() {
|
|
|
onShow: function(options) {
|
|
|
setTimeout(this.hidePopup, 4000);
|
|
|
},
|
|
|
|
...
|
...
|
@@ -183,17 +214,61 @@ Page({ |
|
|
* 用户点击右上角分享
|
|
|
*/
|
|
|
onShareAppMessage: function(res) {
|
|
|
let params = {
|
|
|
FROM: res.from,
|
|
|
SHARE_RESUIL: 0,
|
|
|
TITLE: decodeURIComponent(this.data.shareInfo.product_name),
|
|
|
DESC: '我在有货限定频道发现一个不错的商品赶快来看看吧!',
|
|
|
PATH: `/pages/product/detail/detail?limitProductCode=
|
|
|
${this.data.shareInfo.limitProductCode}&originUid=${app.getUid()}`,
|
|
|
IMG: decodeURIComponent(this.data.shareInfo.default_image)
|
|
|
};
|
|
|
|
|
|
// 用户点击右上角分享
|
|
|
return {
|
|
|
title: this.data.activityInfo.activityName || '排队活动',
|
|
|
path: './?actId=' + this.data.activityInfo.activityId,
|
|
|
success: function(data) {
|
|
|
console.log(data);
|
|
|
title: params.TITLE, // 分享标题
|
|
|
desc: params.DESC, // 分享描述
|
|
|
path: params.PATH, // 分享路径
|
|
|
imageUrl: params.IMG,
|
|
|
success: function() {
|
|
|
params.SHARE_RESUIL = 1;
|
|
|
},
|
|
|
fail: function(data) {
|
|
|
console.log(data);
|
|
|
fail: function() {
|
|
|
params.SHARE_RESUIL = 2;
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
share: function() {
|
|
|
this.setData({
|
|
|
'actionSheet.show': true
|
|
|
});
|
|
|
},
|
|
|
handleZanActionsheetCancel() {
|
|
|
this.setData({
|
|
|
'actionSheet.show': false
|
|
|
});
|
|
|
},
|
|
|
|
|
|
// 当行动按钮中有一个被点击时触发
|
|
|
// index 代表被点击按钮在传入参数 actions 中的位置
|
|
|
handleZanActionsheetClick({index}) {
|
|
|
this.setData({
|
|
|
'actionSheet.show': false
|
|
|
});
|
|
|
|
|
|
let uid = this.data.originUid || this.data.uid;
|
|
|
|
|
|
if (index === 1) {
|
|
|
router.go('snapShare', this.data.shareInfo);
|
|
|
}
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 邀请好友助力排队按钮
|
|
|
*/
|
|
|
inviteFriends: function(e) {
|
|
|
this.share();
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* scroll-view滚动事件
|
...
|
...
|
@@ -211,7 +286,7 @@ Page({ |
|
|
* 跳转到我的排队列表
|
|
|
*/
|
|
|
navigateToMyList: function(e) {
|
|
|
router.go('myList', { actId: this.data.activityInfo.activityId});
|
|
|
router.go('myList', Object.assign({actId: this.data.activityInfo.activityId}, this.data.shareInfo));
|
|
|
},
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -486,4 +561,4 @@ Page({ |
|
|
}
|
|
|
return new_time;
|
|
|
}
|
|
|
}); |
|
|
}, Actionsheet)); |
...
|
...
|
|