Browse Source

no message

feature/v1.1.0
xpz2018 7 years ago
parent
commit
96921c5b39
1 changed files with 22 additions and 21 deletions
  1. 43
      pages/activity_detail/activity_detail.js

43
pages/activity_detail/activity_detail.js

@ -67,6 +67,7 @@ Page({
getActivityDetail: function () { getActivityDetail: function () {
let that = this; let that = this;
that.stopInterval();
wx.showNavigationBarLoading(); //在标题栏中显示加载 wx.showNavigationBarLoading(); //在标题栏中显示加载
var url = ""; var url = "";
var data = {}; var data = {};
@ -75,7 +76,7 @@ Page({
} else { } else {
url = "/mall/wxa/activity/detail"; url = "/mall/wxa/activity/detail";
} }
console.log('msg>>>' + that.data.activityNo + ',' + that.data.groupNo);
console.log("getActivityDetail>>groupNo>>>" + that.data.groupNo);
wx.request({ wx.request({
url: app.gw.hostUrl + url, url: app.gw.hostUrl + url,
method: 'get', method: 'get',
@ -91,7 +92,6 @@ Page({
console.log(res); console.log(res);
var data = res.data; var data = res.data;
var status = data.code; var status = data.code;
console.log(res);
if (status == 0) { if (status == 0) {
that.setData({ that.setData({
activityDetail: data.response, activityDetail: data.response,
@ -182,7 +182,8 @@ Page({
buttomText: '重新开团', buttomText: '重新开团',
grounpInfo: "block", grounpInfo: "block",
grounpInfo2: "none", grounpInfo2: "none",
remarkText: "已退款",
remark: "none",
remarkText: "",
}); });
} }
} }
@ -218,12 +219,25 @@ Page({
}) })
}, },
stopInterval: function () {
if (interval != undefined) {
clearInterval(interval);
interval = undefined
}
this.setData({
countDownDay: '00',
countDownHour: '00',
countDownMinute: '00',
countDownSecond: '00',
});
},
/** /**
*活动倒计时方法 *活动倒计时方法
*/ */
countActivityTime: function (timeStamp) { countActivityTime: function (timeStamp) {
var totalSecond = timeStamp - 1; var totalSecond = timeStamp - 1;
console.log("countActivityTime>>>" + timeStamp)
// totalSecond = 20;
if (totalSecond < 0 || interval != undefined) { if (totalSecond < 0 || interval != undefined) {
return return
} }
@ -234,17 +248,14 @@ Page({
var day = Math.floor(second / 3600 / 24); var day = Math.floor(second / 3600 / 24);
var dayStr = day.toString(); var dayStr = day.toString();
if (dayStr.length == 1) dayStr = '0' + dayStr; if (dayStr.length == 1) dayStr = '0' + dayStr;
// 小时位 // 小时位
var hr = Math.floor((second - day * 3600 * 24) / 3600); var hr = Math.floor((second - day * 3600 * 24) / 3600);
var hrStr = hr.toString(); var hrStr = hr.toString();
if (hrStr.length == 1) hrStr = '0' + hrStr; if (hrStr.length == 1) hrStr = '0' + hrStr;
// 分钟位 // 分钟位
var min = Math.floor((second - day * 3600 * 24 - hr * 3600) / 60); var min = Math.floor((second - day * 3600 * 24 - hr * 3600) / 60);
var minStr = min.toString(); var minStr = min.toString();
if (minStr.length == 1) minStr = '0' + minStr; if (minStr.length == 1) minStr = '0' + minStr;
// 秒位 // 秒位
var sec = second - day * 3600 * 24 - hr * 3600 - min * 60; var sec = second - day * 3600 * 24 - hr * 3600 - min * 60;
var secStr = sec.toString(); var secStr = sec.toString();
@ -258,14 +269,8 @@ Page({
}); });
totalSecond--; totalSecond--;
if (totalSecond < 0) { if (totalSecond < 0) {
clearInterval(interval);
this.stopInterval();
this.getActivityDetail(); this.getActivityDetail();
this.setData({
countDownDay: '00',
countDownHour: '00',
countDownMinute: '00',
countDownSecond: '00',
});
} }
}.bind(this), 1000); }.bind(this), 1000);
}, },
@ -339,7 +344,6 @@ Page({
//开团与参团 //开团与参团
groupOpenOrJoin: function (url) { groupOpenOrJoin: function (url) {
let that = this; let that = this;
wx.showToast({ wx.showToast({
title: '正在调起支付', title: '正在调起支付',
icon: 'loading' icon: 'loading'
@ -357,7 +361,7 @@ Page({
'sessionId': wx.getStorageSync('sessionId') 'sessionId': wx.getStorageSync('sessionId')
}, },
success: function (res) { success: function (res) {
//--init data
//--init data
let data = res.data; let data = res.data;
let status = data.code; let status = data.code;
if (status != 0) { if (status != 0) {
@ -371,7 +375,6 @@ Page({
that.setData({ that.setData({
groupNo: data.response.orderNo == undefined ? that.data.groupNo : data.response.orderNo, groupNo: data.response.orderNo == undefined ? that.data.groupNo : data.response.orderNo,
}); });
console.log(data.response);
let dr = data.response.weixinTransParameters; let dr = data.response.weixinTransParameters;
console.log(dr); console.log(dr);
wx.requestPayment({//微信支付 wx.requestPayment({//微信支付
@ -433,10 +436,8 @@ Page({
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function () {
if (interval != undefined){
clearInterval(interval);
interval = undefined
}
this.topInterval();
}, },
/** /**

Loading…
Cancel
Save