|
|
@ -72,8 +72,8 @@ Page({ |
|
|
var url = ""; |
|
|
var url = ""; |
|
|
var data = {}; |
|
|
var data = {}; |
|
|
if (that.data.groupNo != "") { |
|
|
if (that.data.groupNo != "") { |
|
|
url = "/mall/wxa/activity/group/detail"; |
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
url = "/mall/wxa/activity/group/detail";//接口
|
|
|
|
|
|
} else { |
|
|
url = "/mall/wxa/activity/detail"; |
|
|
url = "/mall/wxa/activity/detail"; |
|
|
} |
|
|
} |
|
|
wx.request({ |
|
|
wx.request({ |
|
|
@ -243,7 +243,7 @@ Page({ |
|
|
interval = setInterval(function () { |
|
|
interval = setInterval(function () { |
|
|
// 秒数
|
|
|
// 秒数
|
|
|
var second = totalSecond; |
|
|
var second = totalSecond; |
|
|
// 天数位
|
|
|
|
|
|
|
|
|
// 天数位
|
|
|
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; |
|
|
@ -267,20 +267,20 @@ Page({ |
|
|
countDownSecond: secStr, |
|
|
countDownSecond: secStr, |
|
|
}); |
|
|
}); |
|
|
totalSecond--; |
|
|
totalSecond--; |
|
|
if (totalSecond < 0) { |
|
|
|
|
|
|
|
|
if (totalSecond < 0) {//活动结束时
|
|
|
this.stopInterval(); |
|
|
this.stopInterval(); |
|
|
this.getActivityDetail(); |
|
|
this.getActivityDetail(); |
|
|
} |
|
|
} |
|
|
}.bind(this), 1000); |
|
|
}.bind(this), 1000); |
|
|
}, |
|
|
}, |
|
|
// 图片加载
|
|
|
// 图片加载
|
|
|
ruleImageLoad: function (image) { |
|
|
|
|
|
|
|
|
ruleImageLoad: function (image) {//拼团失败时的图片加载
|
|
|
var imageHeight = getApp().gw.systemInfo.windowWidth / image.detail.width * image.detail.height; |
|
|
var imageHeight = getApp().gw.systemInfo.windowWidth / image.detail.width * image.detail.height; |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
rule_image_height: imageHeight |
|
|
rule_image_height: imageHeight |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
detailImageLoad: function (image) { |
|
|
|
|
|
|
|
|
detailImageLoad: function (image) {//暂时不清楚是做什么的
|
|
|
var imageHeight = getApp().gw.systemInfo.windowWidth / image.detail.width * image.detail.height; |
|
|
var imageHeight = getApp().gw.systemInfo.windowWidth / image.detail.width * image.detail.height; |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
detail_image_height: imageHeight |
|
|
detail_image_height: imageHeight |
|
|
@ -377,12 +377,12 @@ Page({ |
|
|
let dr = data.response.weixinTransParameters; |
|
|
let dr = data.response.weixinTransParameters; |
|
|
console.log(dr); |
|
|
console.log(dr); |
|
|
wx.requestPayment({//微信支付
|
|
|
wx.requestPayment({//微信支付
|
|
|
"timeStamp": dr.timeStamp, |
|
|
|
|
|
"nonceStr": dr.nonceStr, |
|
|
|
|
|
"package": dr.package, |
|
|
|
|
|
"signType": dr.signType, |
|
|
|
|
|
"paySign": dr.paySign, |
|
|
|
|
|
"success": function (res) { |
|
|
|
|
|
|
|
|
"timeStamp": dr.timeStamp,//时间戳
|
|
|
|
|
|
"nonceStr": dr.nonceStr,//随机字符串
|
|
|
|
|
|
"package": dr.package,//单接口返回的prepay_id参数值
|
|
|
|
|
|
"signType": dr.signType,//签名算法
|
|
|
|
|
|
"paySign": dr.paySign,//签名
|
|
|
|
|
|
"success": function (res) {//成功时回调
|
|
|
console.log(res); |
|
|
console.log(res); |
|
|
wx.showToast({ |
|
|
wx.showToast({ |
|
|
title: '支付成功', |
|
|
title: '支付成功', |
|
|
@ -394,7 +394,7 @@ Page({ |
|
|
url: '../pay_result/pay_result?activityNo=' + that.data.activityNo + '&groupNo=' + that.data.groupNo + '&shareTitle=' + that.data.activityDetail.shareTitle + '&sharePhoto=' + that.data.activityDetail.sharePhoto |
|
|
url: '../pay_result/pay_result?activityNo=' + that.data.activityNo + '&groupNo=' + that.data.groupNo + '&shareTitle=' + that.data.activityDetail.shareTitle + '&sharePhoto=' + that.data.activityDetail.sharePhoto |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
"fail": function (res) { |
|
|
|
|
|
|
|
|
"fail": function (res) {//接口调用失败的回调
|
|
|
console.log(res); |
|
|
console.log(res); |
|
|
if (res.errMsg == 'requestPayment:fail cancel') { |
|
|
if (res.errMsg == 'requestPayment:fail cancel') { |
|
|
wx.showToast({ |
|
|
wx.showToast({ |
|
|
|