Authored by 邱骏

分享

... ... @@ -172,7 +172,7 @@ Page(Object.assign({
this.setData({
'actionSheet.show': false
});
console.log('ok');
let uid = this.data.originUid || this.data.uid;
if (index === 0) {
... ... @@ -220,7 +220,8 @@ Page(Object.assign({
product_name: res.data.productName,
default_image,
product_qrCode,
product_skn: res.data.productSkn
product_skn: res.data.productSkn,
limitProductCode: this.data.limitProductCode
};
let productSourceType = PRODUCT_SOURCE_TYPE.ORIGIN;
... ... @@ -403,7 +404,7 @@ Page(Object.assign({
});
},
goQueueList() {
router.go('myList', Object.assign({
router.go('queueIndex', Object.assign({
actId: this.data.activityId,
}, this.data.snapData));
},
... ...
... ... @@ -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({
/**
* 页面的初始数据
... ... @@ -43,7 +43,8 @@ Page({
default_image: '',
product_name: '',
product_qrCode: '',
product_skn: ''
product_skn: '',
limitProductCode: ''
},
test_uid: [349709, // 测试用
500030924,
... ... @@ -101,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,
}]
},
},
/**
... ... @@ -122,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)
});
}
},
... ... @@ -137,9 +162,6 @@ Page({
*/
onShow: function(options) {
setTimeout(this.hidePopup, 4000);
this.setData({
shareInfo: Object.assign(this.data.shareInfo, options)
});
},
/**
... ... @@ -192,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滚动事件
... ... @@ -220,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));
},
/**
... ... @@ -495,4 +561,4 @@ Page({
}
return new_time;
}
});
}, Actionsheet));
... ...
<!--pages/limit/queue.wxml 限定商品用户排队页面-->
<import src="../../vendors/zanui/actionsheet/index.wxml" />
<view class='container'>
<!--头部-->
<!-- <scroll-view scroll-y scroll-top='{{scrollTop}}' bindscroll='scroll' bindscrolltolower='onReachBottom' scroll-with-animation> -->
... ... @@ -139,6 +140,9 @@
<view class='button-close' bindtap='closeMsg'>关闭</view>
</view>
</block>
</view>
</view>
\ No newline at end of file
<view class='invite-button' hidden='{{hideInviteButton}}' bindtap='inviteFriends'>
邀请好友助力排队
</view>
</view>
<template is="zan-actionsheet" data="{{...actionSheet}}" />
\ No newline at end of file
... ...
... ... @@ -450,3 +450,17 @@ image {
border-color: rgba(255, 255, 255, 0);
color: #d0021b;
}
.invite-button {
position: fixed;
width: 280rpx;
height: 50rpx;
line-height: 50rpx;
color: white;
text-align: center;
font-size: 26rpx;
left: 66rpx;
bottom: 30rpx;
border-radius: 30rpx;
background-color: #d0021b;
}
... ...
... ... @@ -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';
import {Actionsheet} from '../../vendors/zanui/index';
let app = getApp();
... ... @@ -27,7 +27,8 @@ Page(Object.assign({
default_image: '',
product_name: '',
product_qrCode: '',
product_skn: ''
product_skn: '',
limitProductCode: ''
},
bgStyle: [ // 排队图片
'../../static/images/limit/queue_bg_1.png',
... ... @@ -81,6 +82,9 @@ Page(Object.assign({
actId: actId
});
this.getQueueList(actId);
for (let i in options) {
options[i] = decodeURIComponent(options[i]);
}
this.setData({
shareInfo: Object.assign(this.data.shareInfo, options)
});
... ... @@ -142,9 +146,11 @@ Page(Object.assign({
let params = {
FROM: res.from,
SHARE_RESUIL: 0,
TITLE: this.data.shareInfo.product_name,
TITLE: decodeURIComponent(this.data.shareInfo.product_name),
DESC: '我在有货限定频道发现一个不错的商品赶快来看看吧!',
PATH: `/pages/product/detail/detail?limitProductCode=${this.data.limitProductCode}&originUid=${app.getUid()}`,
PATH: `/pages/product/detail/detail?limitProductCode=
${this.data.limitProductCode}&originUid=${app.getUid()}`,
IMG: decodeURIComponent(this.data.shareInfo.default_image)
};
// 用户点击右上角分享
... ... @@ -152,6 +158,7 @@ Page(Object.assign({
title: params.TITLE, // 分享标题
desc: params.DESC, // 分享描述
path: params.PATH, // 分享路径
imageUrl: params.IMG,
success: function() {
params.SHARE_RESUIL = 1;
},
... ... @@ -180,13 +187,8 @@ Page(Object.assign({
let uid = this.data.originUid || this.data.uid;
if (index === 0) {
// detailModel.addShareAction(uid, this.data.limitProductCode);
} else if (index === 1) {
// 生成页面给
// detailModel.addShareAction(uid, this.data.limitProductCode).then(() => {
// router.go('snapShare', this.data.snapData);
// });
if (index === 1) {
router.go('snapShare', this.data.shareInfo);
}
},
... ... @@ -228,9 +230,9 @@ Page(Object.assign({
this.setData({
queueList: result
});
return Promise.resolve({ code: 200, data: this.data.queueList });
return Promise.resolve({code: 200, data: this.data.queueList});
} else {
return Promise.reject({ code: 203, message: '获取失败' });
return Promise.reject({code: 203, message: '获取失败'});
}
});
},
... ...
... ... @@ -6,5 +6,6 @@ export default {
userCenter: {path: '/pages/home/index'},
snapShare: {path: '/pages/snapshootShare/snapshootShare'},
prizeUserList: {path: '/pages/queue/prizeUserList'},
myList: {path: '/pages/queue/myList'}
myList: {path: '/pages/queue/myList'},
queueIndex: {path: '/pages/queue/index'}
};
... ...