|
|
@ -22,6 +22,7 @@ Page({ |
|
|
countDownHour: 0, |
|
|
countDownHour: 0, |
|
|
countDownMinute: 0, |
|
|
countDownMinute: 0, |
|
|
countDownSecond: 0, |
|
|
countDownSecond: 0, |
|
|
|
|
|
countdownSec: 0, |
|
|
//根据状态切换样式
|
|
|
//根据状态切换样式
|
|
|
grounpInfo: "block", |
|
|
grounpInfo: "block", |
|
|
grounpInfo2: "none", |
|
|
grounpInfo2: "none", |
|
|
@ -79,7 +80,6 @@ Page({ |
|
|
* 生命周期函数--监听页面初次渲染完成 |
|
|
* 生命周期函数--监听页面初次渲染完成 |
|
|
*/ |
|
|
*/ |
|
|
onReady: function () { |
|
|
onReady: function () { |
|
|
//this.countActivityTime(1527609600);
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
@ -109,7 +109,8 @@ Page({ |
|
|
groupNo: that.data.groupNo, |
|
|
groupNo: that.data.groupNo, |
|
|
}, |
|
|
}, |
|
|
header: { |
|
|
header: { |
|
|
'Content-Type': 'application/x-www-form-urlencoded' |
|
|
|
|
|
|
|
|
'Content-Type': 'application/x-www-form-urlencoded', |
|
|
|
|
|
'sessionId': wx.getStorageSync('sessionId') |
|
|
}, |
|
|
}, |
|
|
success: function (res) { |
|
|
success: function (res) { |
|
|
var data = res.data; |
|
|
var data = res.data; |
|
|
@ -120,27 +121,29 @@ Page({ |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
activityDetail: data.response, |
|
|
activityDetail: data.response, |
|
|
activityNo: data.response.activityNo, |
|
|
activityNo: data.response.activityNo, |
|
|
groupNo: data.response.groupNo == undefined ? "" : data.response.groupNo, |
|
|
|
|
|
|
|
|
groupNo: data.response.groupNo == undefined ? that.data.groupNo : data.response.groupNo, |
|
|
memberList: data.response.memberList, |
|
|
memberList: data.response.memberList, |
|
|
groupStatus: data.response.status, |
|
|
groupStatus: data.response.status, |
|
|
currentMemberType: data.response.currentMemberType == undefined ? -1 : data.response.currentMemberType, |
|
|
currentMemberType: data.response.currentMemberType == undefined ? -1 : data.response.currentMemberType, |
|
|
|
|
|
countdownSec: data.response.countdownSec, |
|
|
}); |
|
|
}); |
|
|
let activityContent = data.response.activityContent; |
|
|
let activityContent = data.response.activityContent; |
|
|
WxParse.wxParse('activityContent', 'html', activityContent, that); |
|
|
WxParse.wxParse('activityContent', 'html', activityContent, that); |
|
|
|
|
|
|
|
|
|
|
|
console.log("currentMemberType:" + that.data.groupNo + "status:" + that.data.groupStatus); |
|
|
//根据状态切换样式
|
|
|
//根据状态切换样式
|
|
|
if (that.data.groupNo !=""){ |
|
|
if (that.data.groupNo !=""){ |
|
|
//开团后页面变化
|
|
|
//开团后页面变化
|
|
|
if (that.data.status == 10){ |
|
|
|
|
|
|
|
|
if (that.data.groupStatus == 10){ |
|
|
//团倒计时时
|
|
|
//团倒计时时
|
|
|
countActivityTime() |
|
|
|
|
|
|
|
|
that.countActivityTime(data.response.countdownSec); |
|
|
//正在拼团
|
|
|
//正在拼团
|
|
|
that.setData({ |
|
|
that.setData({ |
|
|
grounpInfo: "block", |
|
|
grounpInfo: "block", |
|
|
grounpInfo2: "none", |
|
|
grounpInfo2: "none", |
|
|
|
|
|
remark: "block", |
|
|
tagColor: "#F8B551", |
|
|
tagColor: "#F8B551", |
|
|
}); |
|
|
}); |
|
|
if (that.data.currentMemberTyp == -1){ |
|
|
|
|
|
|
|
|
if (that.data.currentMemberType == -1){ |
|
|
//游客
|
|
|
//游客
|
|
|
that.setData({ |
|
|
that.setData({ |
|
|
one_content: "none", |
|
|
one_content: "none", |
|
|
@ -156,9 +159,9 @@ Page({ |
|
|
buttomText: '邀请好友拼团', |
|
|
buttomText: '邀请好友拼团', |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
} else if (that.data.status == 20){ |
|
|
|
|
|
|
|
|
} else if (that.data.groupStatus == 20){ |
|
|
//拼团成功
|
|
|
//拼团成功
|
|
|
if (that.data.currentMemberTyp == -1) { |
|
|
|
|
|
|
|
|
if (that.data.currentMemberType == -1) { |
|
|
//游客
|
|
|
//游客
|
|
|
that.setData({ |
|
|
that.setData({ |
|
|
one_content: "block", |
|
|
one_content: "block", |
|
|
@ -182,9 +185,9 @@ Page({ |
|
|
remarkText: "", |
|
|
remarkText: "", |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
} else if (that.data.status == 90){ |
|
|
|
|
|
|
|
|
} else if (that.data.groupStatus == 90){ |
|
|
//拼团失败
|
|
|
//拼团失败
|
|
|
if (that.data.currentMemberTyp == -1) { |
|
|
|
|
|
|
|
|
if (that.data.currentMemberType == -1) { |
|
|
//游客
|
|
|
//游客
|
|
|
that.setData({ |
|
|
that.setData({ |
|
|
one_content: "block", |
|
|
one_content: "block", |
|
|
@ -242,7 +245,7 @@ Page({ |
|
|
*活动倒计时方法 |
|
|
*活动倒计时方法 |
|
|
*/ |
|
|
*/ |
|
|
countActivityTime: function (timeStamp) { |
|
|
countActivityTime: function (timeStamp) { |
|
|
var totalSecond = timeStamp - Date.parse(new Date()) / 1000; |
|
|
|
|
|
|
|
|
var totalSecond = timeStamp - 1; |
|
|
var interval = setInterval(function () { |
|
|
var interval = setInterval(function () { |
|
|
// 秒数
|
|
|
// 秒数
|
|
|
var second = totalSecond; |
|
|
var second = totalSecond; |
|
|
@ -308,15 +311,17 @@ Page({ |
|
|
|
|
|
|
|
|
//点击团按钮操作
|
|
|
//点击团按钮操作
|
|
|
groupTap: function (e) { |
|
|
groupTap: function (e) { |
|
|
|
|
|
let that = this; |
|
|
var url = ""; |
|
|
var url = ""; |
|
|
|
|
|
console.log("groupNo:" + that.data.groupNo + "¤tMemberType:" + that.data.currentMemberType + "&groupStatus:" + that.data.groupStatus); |
|
|
if (that.data.groupNo == ""){ |
|
|
if (that.data.groupNo == ""){ |
|
|
url = '/mall/wxa/activity/group/group'; |
|
|
|
|
|
|
|
|
url = '/mall/wxa/activity/group/open'; |
|
|
//首次开团
|
|
|
//首次开团
|
|
|
this.groupOpenOrJoin(url); |
|
|
this.groupOpenOrJoin(url); |
|
|
}else{ |
|
|
}else{ |
|
|
if (that.data.status == 10) { |
|
|
|
|
|
|
|
|
if (that.data.groupStatus == 10) { |
|
|
//正在拼团
|
|
|
//正在拼团
|
|
|
if (that.data.currentMemberTyp == -1) { |
|
|
|
|
|
|
|
|
if (that.data.currentMemberType == -1) { |
|
|
//游客
|
|
|
//游客
|
|
|
url = '/mall/wxa/activity/group/join'; |
|
|
url = '/mall/wxa/activity/group/join'; |
|
|
this.groupOpenOrJoin(url); |
|
|
this.groupOpenOrJoin(url); |
|
|
@ -324,11 +329,11 @@ Page({ |
|
|
//团长与参与人点击分享
|
|
|
//团长与参与人点击分享
|
|
|
this.openActionsheet(); |
|
|
this.openActionsheet(); |
|
|
} |
|
|
} |
|
|
} else if (that.data.status == 20) { |
|
|
|
|
|
|
|
|
} else if (that.data.groupStatus == 20) { |
|
|
//拼团成功
|
|
|
//拼团成功
|
|
|
if (that.data.currentMemberTyp == -1) { |
|
|
if (that.data.currentMemberTyp == -1) { |
|
|
//游客
|
|
|
//游客
|
|
|
url = '/mall/wxa/activity/group/group'; |
|
|
|
|
|
|
|
|
url = '/mall/wxa/activity/group/open'; |
|
|
this.groupOpenOrJoin(url); |
|
|
this.groupOpenOrJoin(url); |
|
|
} else { |
|
|
} else { |
|
|
//团长与参与人立即预约
|
|
|
//团长与参与人立即预约
|
|
|
@ -336,9 +341,9 @@ Page({ |
|
|
url: '../order/order', |
|
|
url: '../order/order', |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} else if (that.data.status == 90){ |
|
|
|
|
|
|
|
|
} else if (that.data.groupStatus == 90){ |
|
|
//拼团失败
|
|
|
//拼团失败
|
|
|
url = '/mall/wxa/activity/group/group'; |
|
|
|
|
|
|
|
|
url = '/mall/wxa/activity/group/open'; |
|
|
this.groupOpenOrJoin(url); |
|
|
this.groupOpenOrJoin(url); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -376,6 +381,9 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
groupNo: data.response.orderNo == undefined ? that.data.groupNo : data.response.orderNo, |
|
|
|
|
|
}); |
|
|
console.log(data.response); |
|
|
console.log(data.response); |
|
|
let dr = data.response.weixinTransParameters; |
|
|
let dr = data.response.weixinTransParameters; |
|
|
console.log(dr); |
|
|
console.log(dr); |
|
|
@ -457,6 +465,7 @@ Page({ |
|
|
|
|
|
|
|
|
//打败Actionsheet,进行分享
|
|
|
//打败Actionsheet,进行分享
|
|
|
openActionsheet: function () { |
|
|
openActionsheet: function () { |
|
|
|
|
|
console.log("qrImageUrl:" + this.data.qrImageUrl) |
|
|
if (this.data.qrImageUrl.length == 0) { |
|
|
if (this.data.qrImageUrl.length == 0) { |
|
|
wx.showLoading({ |
|
|
wx.showLoading({ |
|
|
title: '正在获取', |
|
|
title: '正在获取', |
|
|
|