...
|
...
|
@@ -135,7 +135,7 @@ Page(Object.assign({ |
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad: function (options) {
|
|
|
onLoad: function(options) {
|
|
|
console.log(options);
|
|
|
let actId = options.actId;
|
|
|
let uid = app.getUid();
|
...
|
...
|
@@ -164,14 +164,14 @@ Page(Object.assign({ |
|
|
/**
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
*/
|
|
|
onReady: function () {
|
|
|
onReady: function() {
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
onShow: function (options) {
|
|
|
onShow: function(options) {
|
|
|
setTimeout(this.hidePopup, 4000);
|
|
|
if (app.getUid()) {
|
|
|
this.setData({
|
...
|
...
|
@@ -183,19 +183,19 @@ Page(Object.assign({ |
|
|
/**
|
|
|
* 生命周期函数--监听页面隐藏
|
|
|
*/
|
|
|
onHide: function () {
|
|
|
onHide: function() {
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面卸载
|
|
|
*/
|
|
|
onUnload: function () {
|
|
|
onUnload: function() {
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
|
*/
|
|
|
onPullDownRefresh: function () {
|
|
|
onPullDownRefresh: function() {
|
|
|
let actId = this.data.activityInfo.activityId;
|
|
|
|
|
|
if (actId) {
|
...
|
...
|
@@ -212,7 +212,7 @@ Page(Object.assign({ |
|
|
/**
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
*/
|
|
|
onReachBottom: function () {
|
|
|
onReachBottom: function() {
|
|
|
console.log('到底部啦');
|
|
|
let actId = this.data.activityInfo.activityId;
|
|
|
let sort = this.data.queueList[this.data.queueList.length - 1].sort;
|
...
|
...
|
@@ -229,7 +229,7 @@ Page(Object.assign({ |
|
|
/**
|
|
|
* 用户点击右上角分享
|
|
|
*/
|
|
|
onShareAppMessage: function (res) {
|
|
|
onShareAppMessage: function(res) {
|
|
|
let params = {
|
|
|
FROM: res.from,
|
|
|
SHARE_RESUIL: 0,
|
...
|
...
|
@@ -246,15 +246,15 @@ Page(Object.assign({ |
|
|
desc: params.DESC, // 分享描述
|
|
|
path: params.PATH, // 分享路径
|
|
|
imageUrl: params.IMG,
|
|
|
success: function () {
|
|
|
success: function() {
|
|
|
params.SHARE_RESUIL = 1;
|
|
|
},
|
|
|
fail: function () {
|
|
|
fail: function() {
|
|
|
params.SHARE_RESUIL = 2;
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
share: function () {
|
|
|
share: function() {
|
|
|
this.setData({
|
|
|
'actionSheet.show': true
|
|
|
});
|
...
|
...
|
@@ -282,14 +282,14 @@ Page(Object.assign({ |
|
|
/**
|
|
|
* 邀请好友助力排队按钮
|
|
|
*/
|
|
|
inviteFriends: function (e) {
|
|
|
inviteFriends: function(e) {
|
|
|
this.share();
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* scroll-view滚动事件
|
|
|
*/
|
|
|
scroll: function (e) {
|
|
|
scroll: function(e) {
|
|
|
console.log(e);
|
|
|
let scrollTop = e.detail.scrollTop;
|
|
|
|
...
|
...
|
@@ -301,14 +301,14 @@ Page(Object.assign({ |
|
|
/**
|
|
|
* 跳转到我的排队列表
|
|
|
*/
|
|
|
navigateToMyList: function (e) {
|
|
|
navigateToMyList: function(e) {
|
|
|
router.go('myList', Object.assign({actId: this.data.activityInfo.activityId}, this.data.shareInfo));
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 点击用户头像,跳转到用户对应位置<已取消该功能>
|
|
|
*/
|
|
|
userTap: function (e) {
|
|
|
userTap: function(e) {
|
|
|
console.log(this.data.userInfo);
|
|
|
let uid = this.data.userInfo.uid;
|
|
|
let sort = this.data.userInfo.sort || 0;
|
...
|
...
|
@@ -340,7 +340,7 @@ Page(Object.assign({ |
|
|
/**
|
|
|
* 关闭提示框
|
|
|
*/
|
|
|
closeMsg: function (e) {
|
|
|
closeMsg: function(e) {
|
|
|
this.setData({
|
|
|
showMsg: 0
|
|
|
});
|
...
|
...
|
@@ -349,7 +349,7 @@ Page(Object.assign({ |
|
|
/**
|
|
|
* 隐藏气泡
|
|
|
*/
|
|
|
hidePopup: function (e) {
|
|
|
hidePopup: function(e) {
|
|
|
this.setData({
|
|
|
hidePopup: 1
|
|
|
});
|
...
|
...
|
@@ -358,7 +358,7 @@ Page(Object.assign({ |
|
|
/**
|
|
|
* 点击参加活动按钮
|
|
|
*/
|
|
|
joinInQueue: function (e) {
|
|
|
joinInQueue: function(e) {
|
|
|
let uid = app.getUid();
|
|
|
let activityId = this.data.activityInfo.activityId;
|
|
|
let isEnd = this.data.activityInfo.isEnd === 0 ? 0 : 1;
|
...
|
...
|
@@ -380,7 +380,7 @@ Page(Object.assign({ |
|
|
/**
|
|
|
* 获取活动信息
|
|
|
*/
|
|
|
getActivityInfo: function (actId) {
|
|
|
getActivityInfo: function(actId) {
|
|
|
return LimitModel.getActivityInfo(actId).then(res => { // 获取活动信息
|
|
|
console.log(res);
|
|
|
if (res.code === 200) {
|
...
|
...
|
@@ -415,7 +415,7 @@ Page(Object.assign({ |
|
|
/**
|
|
|
* 加入排队
|
|
|
*/
|
|
|
addQueue: function (actId, uid) {
|
|
|
addQueue: function(actId, uid) {
|
|
|
if (!this.data.api_status) {
|
|
|
this.setData({
|
|
|
api_status: 1
|
...
|
...
|
@@ -446,7 +446,7 @@ Page(Object.assign({ |
|
|
/**
|
|
|
* 获取用户参与排队的信息
|
|
|
*/
|
|
|
getUserActivityInfo: function (actId) {
|
|
|
getUserActivityInfo: function(actId) {
|
|
|
LimitModel.getUserActivityInfo(actId).then(res => {
|
|
|
console.log('getUserActivityInfo:', res);
|
|
|
this.setData({
|
...
|
...
|
@@ -470,7 +470,7 @@ Page(Object.assign({ |
|
|
/**
|
|
|
* 获取排队列表
|
|
|
*/
|
|
|
getQueueList: function (actId, start = 0, limit = 50, isAdd = false) {
|
|
|
getQueueList: function(actId, start = 0, limit = 50, isAdd = false) {
|
|
|
let that = this;
|
|
|
|
|
|
actId = actId || this.data.activityInfo.activityId;
|
...
|
...
|
@@ -512,7 +512,7 @@ Page(Object.assign({ |
|
|
}
|
|
|
});
|
|
|
},
|
|
|
scrollPage: function (id) { // 滚动页面到对应位置
|
|
|
scrollPage: function(id) { // 滚动页面到对应位置
|
|
|
if (id) {
|
|
|
let item_query = wx.createSelectorQuery();
|
|
|
|
...
|
...
|
@@ -538,14 +538,14 @@ Page(Object.assign({ |
|
|
/**
|
|
|
* 跳转到活动说明的H5页面
|
|
|
*/
|
|
|
navigateToDescPage: function () {
|
|
|
navigateToDescPage: function() {
|
|
|
router.goUrl(this.data.h5PageUrl[0].url + '&title=' + this.data.h5PageUrl[0].title);
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
*跳转到中奖名单页面
|
|
|
*/
|
|
|
navigateToPrizeUserList: function () {
|
|
|
navigateToPrizeUserList: function() {
|
|
|
if (this.data.activityInfo.isDrawEnd) {
|
|
|
router.go('prizeUserList', {actId: this.data.activityInfo.activityId});
|
|
|
}
|
...
|
...
|
@@ -554,15 +554,16 @@ Page(Object.assign({ |
|
|
/**
|
|
|
* 跳转到个人中心限购码页面
|
|
|
*/
|
|
|
navigateToUserCodePage: function () {
|
|
|
navigateToUserCodePage: function() {
|
|
|
if (this.data.userInfo.isLucky) {
|
|
|
router.go('userCenter');
|
|
|
}
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 提交formId消息模板
|
|
|
*/
|
|
|
submitFormId: function (e) {
|
|
|
submitFormId: function(e) {
|
|
|
console.log(e);
|
|
|
commonModel.addWechatFormId({
|
|
|
formId: e.detail.formId,
|
...
|
...
|
@@ -575,11 +576,11 @@ Page(Object.assign({ |
|
|
/**
|
|
|
* 处理接口返回的图片url
|
|
|
*/
|
|
|
formatImgUrl: function (url, mode, width, height) {
|
|
|
formatImgUrl: function(url, mode, width, height) {
|
|
|
return url.replace(/{mode}/g, mode).replace(/{width}/g, width).replace(/{height}/g, height);
|
|
|
},
|
|
|
|
|
|
formatTimeText: function (time) {
|
|
|
formatTimeText: function(time) {
|
|
|
let new_time;
|
|
|
|
|
|
if (time < 60) {
|
...
|
...
|
|