|
@@ -11,43 +11,43 @@ Page({ |
|
|
data: { |
|
|
data: { |
|
|
teljpgUrl: imgurl.teljpg.url, |
|
|
teljpgUrl: imgurl.teljpg.url, |
|
|
wmhome: imgurl.wmhome.url, |
|
|
wmhome: imgurl.wmhome.url, |
|
|
couponChannelId:'', |
|
|
|
|
|
couponId:'', |
|
|
|
|
|
data:null, |
|
|
|
|
|
spellData:null, |
|
|
|
|
|
canSpell:true, |
|
|
|
|
|
canBuyIf:true, |
|
|
|
|
|
|
|
|
couponChannelId: '', |
|
|
|
|
|
couponId: '', |
|
|
|
|
|
data: null, |
|
|
|
|
|
spellData: null, |
|
|
|
|
|
canSpell: true, |
|
|
|
|
|
canBuyIf: true, |
|
|
clock: "00", |
|
|
clock: "00", |
|
|
day: "00", |
|
|
day: "00", |
|
|
hour: "00", |
|
|
hour: "00", |
|
|
min: "00", |
|
|
min: "00", |
|
|
sec: "00", |
|
|
sec: "00", |
|
|
showTime:true |
|
|
|
|
|
|
|
|
showTime: true |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 生命周期函数--监听页面加载 |
|
|
* 生命周期函数--监听页面加载 |
|
|
*/ |
|
|
*/ |
|
|
onLoad: function (options) { |
|
|
|
|
|
|
|
|
onLoad: function(options) { |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
couponChannelId: options.couponChannelId, |
|
|
couponChannelId: options.couponChannelId, |
|
|
couponId: options.couponId |
|
|
couponId: options.couponId |
|
|
}) |
|
|
}) |
|
|
if (options&&options.couponChannelId){ |
|
|
|
|
|
|
|
|
if (options && options.couponChannelId) { |
|
|
this.getDetail(options.couponChannelId); |
|
|
this.getDetail(options.couponChannelId); |
|
|
} |
|
|
} |
|
|
if (options&&options.couponId){ |
|
|
|
|
|
|
|
|
if (options && options.couponId) { |
|
|
this.getOneSpell(options.couponId) |
|
|
this.getOneSpell(options.couponId) |
|
|
} |
|
|
} |
|
|
this.getUserInfo(); |
|
|
this.getUserInfo(); |
|
|
}, |
|
|
}, |
|
|
getUserInfo: function () { |
|
|
|
|
|
|
|
|
getUserInfo: function() { |
|
|
let that = this; |
|
|
let that = this; |
|
|
// 获取用户信息 |
|
|
// 获取用户信息 |
|
|
Http.get({ |
|
|
Http.get({ |
|
|
url: config.api.getScore, |
|
|
|
|
|
data: {} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
url: config.api.getScore, |
|
|
|
|
|
data: {} |
|
|
|
|
|
}) |
|
|
.then(res => { |
|
|
.then(res => { |
|
|
console.log(res) |
|
|
console.log(res) |
|
|
that.setData({ |
|
|
that.setData({ |
|
@@ -56,7 +56,7 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
gotoIndex: function () { |
|
|
|
|
|
|
|
|
gotoIndex: function() { |
|
|
wx.switchTab({ |
|
|
wx.switchTab({ |
|
|
url: '/pages/main/index', |
|
|
url: '/pages/main/index', |
|
|
}) |
|
|
}) |
|
@@ -64,7 +64,7 @@ Page({ |
|
|
/** |
|
|
/** |
|
|
* 拨打电话 |
|
|
* 拨打电话 |
|
|
*/ |
|
|
*/ |
|
|
phone: function (e) { |
|
|
|
|
|
|
|
|
phone: function(e) { |
|
|
let that = this; |
|
|
let that = this; |
|
|
wx.makePhoneCall({ |
|
|
wx.makePhoneCall({ |
|
|
phoneNumber: e.target.dataset.merchantlinkphone |
|
|
phoneNumber: e.target.dataset.merchantlinkphone |
|
@@ -73,11 +73,10 @@ Page({ |
|
|
/** |
|
|
/** |
|
|
* 直接购买 |
|
|
* 直接购买 |
|
|
*/ |
|
|
*/ |
|
|
gotoBuy(e){ |
|
|
|
|
|
console.log(22222) |
|
|
|
|
|
|
|
|
gotoBuy(e) { |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
canBuyIf: false, |
|
|
canBuyIf: false, |
|
|
formId:e.detail.formId |
|
|
|
|
|
|
|
|
formId: e.detail.formId |
|
|
}) |
|
|
}) |
|
|
this.orderFunc() |
|
|
this.orderFunc() |
|
|
}, |
|
|
}, |
|
@@ -105,14 +104,13 @@ Page({ |
|
|
countdown(time) { |
|
|
countdown(time) { |
|
|
let that = this; |
|
|
let that = this; |
|
|
var EndTime = time; |
|
|
var EndTime = time; |
|
|
if (that.data.spellData!=null){ |
|
|
|
|
|
|
|
|
if (that.data.spellData != null) { |
|
|
EndTime = that.data.spellData.expiredDate; |
|
|
EndTime = that.data.spellData.expiredDate; |
|
|
} |
|
|
} |
|
|
var NowTime = new Date().getTime(); |
|
|
var NowTime = new Date().getTime(); |
|
|
var total_micro_second = EndTime - NowTime || []; |
|
|
var total_micro_second = EndTime - NowTime || []; |
|
|
// 渲染倒计时时钟 |
|
|
// 渲染倒计时时钟 |
|
|
let obj = that.dateformat(total_micro_second); |
|
|
let obj = that.dateformat(total_micro_second); |
|
|
console.log(obj) |
|
|
|
|
|
if (total_micro_second > 0) { |
|
|
if (total_micro_second > 0) { |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
clock: obj, |
|
|
clock: obj, |
|
@@ -123,17 +121,15 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
// spellData:null, |
|
|
|
|
|
clock: "00", |
|
|
clock: "00", |
|
|
day: "00", |
|
|
day: "00", |
|
|
hour: "00", |
|
|
hour: "00", |
|
|
min: "00", |
|
|
min: "00", |
|
|
sec: "00", |
|
|
sec: "00", |
|
|
}) |
|
|
}) |
|
|
// that.getOneSpell(that.data.couponId) |
|
|
|
|
|
} |
|
|
} |
|
|
if(that.data.showTime){ |
|
|
|
|
|
setTimeout(function () { |
|
|
|
|
|
|
|
|
if (that.data.showTime) { |
|
|
|
|
|
setTimeout(function() { |
|
|
total_micro_second -= 1000; |
|
|
total_micro_second -= 1000; |
|
|
that.countdown(); |
|
|
that.countdown(); |
|
|
}, 1000) |
|
|
}, 1000) |
|
@@ -142,15 +138,14 @@ Page({ |
|
|
/** |
|
|
/** |
|
|
* 发起拼团 |
|
|
* 发起拼团 |
|
|
*/ |
|
|
*/ |
|
|
gotoSpell(){ |
|
|
|
|
|
console.log(111111111) |
|
|
|
|
|
|
|
|
gotoSpell() { |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
canSpell:false |
|
|
|
|
|
|
|
|
canSpell: false |
|
|
}) |
|
|
}) |
|
|
this.orderFunc(0) |
|
|
this.orderFunc(0) |
|
|
}, |
|
|
}, |
|
|
//参与别人的拼团 |
|
|
//参与别人的拼团 |
|
|
gotoPartner(){ |
|
|
|
|
|
|
|
|
gotoPartner() { |
|
|
wx.navigateTo({ |
|
|
wx.navigateTo({ |
|
|
url: `/pages/joinFrDpell/index?orderId=${this.data.spellData.orderId}&couponId=${this.data.spellData.couponId}&orderGroupId=${this.data.spellData.orderGroupId}&couponChannelId=${this.data.couponChannelId}&avatarUrl=${this.data.spellData.avatarUrl}&nickName=${this.data.spellData.nickName}` |
|
|
url: `/pages/joinFrDpell/index?orderId=${this.data.spellData.orderId}&couponId=${this.data.spellData.couponId}&orderGroupId=${this.data.spellData.orderGroupId}&couponChannelId=${this.data.couponChannelId}&avatarUrl=${this.data.spellData.avatarUrl}&nickName=${this.data.spellData.nickName}` |
|
|
}); |
|
|
}); |
|
@@ -158,7 +153,7 @@ Page({ |
|
|
/** |
|
|
/** |
|
|
* 获取一个拼团信息 |
|
|
* 获取一个拼团信息 |
|
|
*/ |
|
|
*/ |
|
|
getOneSpell(couponId){ |
|
|
|
|
|
|
|
|
getOneSpell(couponId) { |
|
|
let that = this; |
|
|
let that = this; |
|
|
Http.get({ |
|
|
Http.get({ |
|
|
url: config.api.queryRemainOne, |
|
|
url: config.api.queryRemainOne, |
|
@@ -167,7 +162,7 @@ Page({ |
|
|
} |
|
|
} |
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
wx.stopPullDownRefresh(); |
|
|
wx.stopPullDownRefresh(); |
|
|
if(res.data){ |
|
|
|
|
|
|
|
|
if (res.data) { |
|
|
that.countdown(res.data.expiredDate); |
|
|
that.countdown(res.data.expiredDate); |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
spellData: res.data |
|
|
spellData: res.data |
|
@@ -178,7 +173,7 @@ Page({ |
|
|
/** |
|
|
/** |
|
|
* 获取券详情信息 |
|
|
* 获取券详情信息 |
|
|
*/ |
|
|
*/ |
|
|
getDetail(couponChannelId){ |
|
|
|
|
|
|
|
|
getDetail(couponChannelId) { |
|
|
let that = this; |
|
|
let that = this; |
|
|
Http.get({ |
|
|
Http.get({ |
|
|
url: config.api.couponDetail, |
|
|
url: config.api.couponDetail, |
|
@@ -188,9 +183,12 @@ Page({ |
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
wx.stopPullDownRefresh(); |
|
|
wx.stopPullDownRefresh(); |
|
|
let data = res.data; |
|
|
let data = res.data; |
|
|
|
|
|
wx.setNavigationBarTitle({ |
|
|
|
|
|
title: res.data.title |
|
|
|
|
|
}) |
|
|
data.price = (data.price / 100).toFixed(2) |
|
|
data.price = (data.price / 100).toFixed(2) |
|
|
data.salePrice = (data.salePrice / 100).toFixed(2); |
|
|
data.salePrice = (data.salePrice / 100).toFixed(2); |
|
|
data.validStartDate = utils.formatTime(data.validStartDate,'yyyy-MM-dd') |
|
|
|
|
|
|
|
|
data.validStartDate = utils.formatTime(data.validStartDate, 'yyyy-MM-dd') |
|
|
data.validEndDate = utils.formatTime(data.validEndDate, 'yyyy-MM-dd') |
|
|
data.validEndDate = utils.formatTime(data.validEndDate, 'yyyy-MM-dd') |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
data |
|
|
data |
|
@@ -200,8 +198,7 @@ Page({ |
|
|
/** |
|
|
/** |
|
|
* 去拼团 |
|
|
* 去拼团 |
|
|
*/ |
|
|
*/ |
|
|
goToOrderGroup(orderId, orderGroupId, _this){ |
|
|
|
|
|
console.log(22222222) |
|
|
|
|
|
|
|
|
goToOrderGroup(orderId, orderGroupId, _this) { |
|
|
let that = this; |
|
|
let that = this; |
|
|
// 支付成功 |
|
|
// 支付成功 |
|
|
Http.post({ |
|
|
Http.post({ |
|
@@ -212,21 +209,20 @@ Page({ |
|
|
couponId: _this.data.data.couponId |
|
|
couponId: _this.data.data.couponId |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.then(res => { |
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: `/pages/spellDetail/index?orderId=${orderId}&couponId=${_this.data.data.couponId}&orderGroupId=${res.data.orderGroupId}&couponChannelId=${_this.data.couponChannelId}` |
|
|
|
|
|
}); |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(err => { |
|
|
|
|
|
console.log(err); |
|
|
|
|
|
}) |
|
|
|
|
|
// return; |
|
|
|
|
|
|
|
|
.then(res => { |
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: `/pages/spellDetail/index?orderId=${orderId}&couponId=${_this.data.data.couponId}&orderGroupId=${res.data.orderGroupId}&couponChannelId=${_this.data.couponChannelId}` |
|
|
|
|
|
}); |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(err => { |
|
|
|
|
|
console.log(err); |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
/** |
|
|
/** |
|
|
* 支付订单更新 |
|
|
* 支付订单更新 |
|
|
*/ |
|
|
*/ |
|
|
payOrderUpdate: (orderId, payOrderId, status, reason, _this, orderGroupId) => { |
|
|
payOrderUpdate: (orderId, payOrderId, status, reason, _this, orderGroupId) => { |
|
|
console.log(orderGroupId,7777) |
|
|
|
|
|
|
|
|
console.log(orderGroupId, 7777) |
|
|
let that = this; |
|
|
let that = this; |
|
|
// 支付成功 |
|
|
// 支付成功 |
|
|
Http.post({ |
|
|
Http.post({ |
|
@@ -238,24 +234,23 @@ Page({ |
|
|
reason: reason |
|
|
reason: reason |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.then(res => { |
|
|
|
|
|
wx.hideLoading() |
|
|
|
|
|
if (orderGroupId==undefined){ |
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: '/pages/order/detail/index?orderId='+res.data.id, |
|
|
|
|
|
}) |
|
|
|
|
|
}else{ |
|
|
|
|
|
_this.goToOrderGroup(orderId, res.data.orderGroupId, _this) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(err => { |
|
|
|
|
|
console.log(err); |
|
|
|
|
|
if (err.code!=12002){ |
|
|
|
|
|
setTimeout(function () { |
|
|
|
|
|
_this.payOrderUpdate(orderId, payOrderId, status, reason, _this, orderGroupId); |
|
|
|
|
|
}, 2000) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
.then(res => { |
|
|
|
|
|
wx.hideLoading() |
|
|
|
|
|
if (orderGroupId == undefined) { |
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: '/pages/order/detail/index?orderId=' + res.data.id, |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
_this.goToOrderGroup(orderId, res.data.orderGroupId, _this) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(err => { |
|
|
|
|
|
if (err.code != 12002) { |
|
|
|
|
|
setTimeout(function() { |
|
|
|
|
|
_this.payOrderUpdate(orderId, payOrderId, status, reason, _this, orderGroupId); |
|
|
|
|
|
}, 2000) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
/** |
|
|
/** |
|
|
* 发起支付 |
|
|
* 发起支付 |
|
@@ -264,19 +259,19 @@ Page({ |
|
|
let data = { |
|
|
let data = { |
|
|
couponChannelId: this.data.data.id, |
|
|
couponChannelId: this.data.data.id, |
|
|
couponId: this.data.data.couponId, |
|
|
couponId: this.data.data.couponId, |
|
|
formId:this.data.formId |
|
|
|
|
|
|
|
|
formId: this.data.formId |
|
|
} |
|
|
} |
|
|
/** |
|
|
/** |
|
|
* 拼团订单 |
|
|
* 拼团订单 |
|
|
*/ |
|
|
*/ |
|
|
if (orderGroupId==0){ |
|
|
|
|
|
|
|
|
let that = this; |
|
|
|
|
|
if (orderGroupId == 0) { |
|
|
data.orderGroupId = orderGroupId |
|
|
data.orderGroupId = orderGroupId |
|
|
} |
|
|
} |
|
|
var that = this; |
|
|
|
|
|
Http.get({ |
|
|
Http.get({ |
|
|
url: config.api.checkPhoneStatus, |
|
|
|
|
|
data: {} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
url: config.api.checkPhoneStatus, |
|
|
|
|
|
data: {} |
|
|
|
|
|
}) |
|
|
.then(res => { |
|
|
.then(res => { |
|
|
/** |
|
|
/** |
|
|
* orderSave 下单 |
|
|
* orderSave 下单 |
|
@@ -376,7 +371,7 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
.then(res => { |
|
|
.then(res => { |
|
|
console.log(res) |
|
|
console.log(res) |
|
|
if (typeof (res) != "undefined") { |
|
|
|
|
|
|
|
|
if (typeof(res) != "undefined") { |
|
|
let orderId = "" + res.data.id; |
|
|
let orderId = "" + res.data.id; |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
orderId: orderId, |
|
|
orderId: orderId, |
|
@@ -388,79 +383,79 @@ Page({ |
|
|
* 支付订单创建 |
|
|
* 支付订单创建 |
|
|
*/ |
|
|
*/ |
|
|
Http.post({ |
|
|
Http.post({ |
|
|
url: config.api.payOrderCreate, |
|
|
|
|
|
data: { |
|
|
|
|
|
orderId: orderId |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
.then(res => { |
|
|
|
|
|
var payOrderId = "" + res.data.payOrderId; |
|
|
|
|
|
wx.hideLoading(); |
|
|
|
|
|
wx.requestPayment({ |
|
|
|
|
|
timeStamp: res.data.timeStamp, |
|
|
|
|
|
nonceStr: res.data.nonceStr, |
|
|
|
|
|
package: res.data.package, |
|
|
|
|
|
signType: (res.data.signType) ? res.data.signType : "MD5", |
|
|
|
|
|
paySign: res.data.paySign, |
|
|
|
|
|
success: res => { |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
canSpell: false |
|
|
|
|
|
}) |
|
|
|
|
|
wx.showLoading({ |
|
|
|
|
|
title: '订单正在处理中...', |
|
|
|
|
|
}) |
|
|
|
|
|
setTimeout(function () { |
|
|
|
|
|
wx.hideLoading() |
|
|
|
|
|
}, 5000) |
|
|
|
|
|
that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', that, orderGroupId); |
|
|
|
|
|
if (res.errMsg == "requestPayment:ok") { |
|
|
|
|
|
setTimeout(function () { |
|
|
|
|
|
wx.hideLoading(); |
|
|
|
|
|
}, 2000); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
fail: res => { |
|
|
|
|
|
/** |
|
|
|
|
|
* 支付失败,需要更新订单的状态 |
|
|
|
|
|
*/ |
|
|
|
|
|
that.payOrderUpdate(that.data.orderId, payOrderId, 2, '', that, orderGroupId); |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
showbutton: false, |
|
|
|
|
|
canSpell: true, |
|
|
|
|
|
canBuyIf: true |
|
|
|
|
|
}) |
|
|
|
|
|
return; |
|
|
|
|
|
}, |
|
|
|
|
|
complete: res => { } |
|
|
|
|
|
}); |
|
|
|
|
|
/// End payment -------- |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(err => { |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
canSpell: true, |
|
|
|
|
|
canBuyIf: true |
|
|
|
|
|
|
|
|
url: config.api.payOrderCreate, |
|
|
|
|
|
data: { |
|
|
|
|
|
orderId: orderId |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
.then(res => { |
|
|
|
|
|
var payOrderId = "" + res.data.payOrderId; |
|
|
|
|
|
wx.hideLoading(); |
|
|
|
|
|
wx.requestPayment({ |
|
|
|
|
|
timeStamp: res.data.timeStamp, |
|
|
|
|
|
nonceStr: res.data.nonceStr, |
|
|
|
|
|
package: res.data.package, |
|
|
|
|
|
signType: (res.data.signType) ? res.data.signType : "MD5", |
|
|
|
|
|
paySign: res.data.paySign, |
|
|
|
|
|
success: res => { |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
canSpell: false |
|
|
|
|
|
}) |
|
|
|
|
|
wx.showLoading({ |
|
|
|
|
|
title: '订单正在处理中...', |
|
|
|
|
|
}) |
|
|
|
|
|
setTimeout(function() { |
|
|
|
|
|
wx.hideLoading() |
|
|
|
|
|
}, 5000) |
|
|
|
|
|
that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', that, orderGroupId); |
|
|
|
|
|
if (res.errMsg == "requestPayment:ok") { |
|
|
|
|
|
setTimeout(function() { |
|
|
|
|
|
wx.hideLoading(); |
|
|
|
|
|
}, 2000); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
fail: res => { |
|
|
|
|
|
/** |
|
|
|
|
|
* 支付失败,需要更新订单的状态 |
|
|
|
|
|
*/ |
|
|
|
|
|
that.payOrderUpdate(that.data.orderId, payOrderId, 2, '', that, orderGroupId); |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
showbutton: false, |
|
|
|
|
|
canSpell: true, |
|
|
|
|
|
canBuyIf: true |
|
|
|
|
|
}) |
|
|
|
|
|
return; |
|
|
|
|
|
}, |
|
|
|
|
|
complete: res => {} |
|
|
|
|
|
}); |
|
|
|
|
|
/// End payment -------- |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(err => { |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
canSpell: true, |
|
|
|
|
|
canBuyIf: true |
|
|
|
|
|
}) |
|
|
|
|
|
wx.showToast({ |
|
|
|
|
|
title: err.message, |
|
|
|
|
|
icon: 'none', |
|
|
|
|
|
duration: 2000, |
|
|
|
|
|
mask: false |
|
|
|
|
|
}); |
|
|
}) |
|
|
}) |
|
|
wx.showToast({ |
|
|
|
|
|
title: err.message, |
|
|
|
|
|
icon: 'none', |
|
|
|
|
|
duration: 2000, |
|
|
|
|
|
mask: false |
|
|
|
|
|
}); |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
/** |
|
|
/** |
|
|
* 生命周期函数--监听页面显示 |
|
|
* 生命周期函数--监听页面显示 |
|
|
*/ |
|
|
*/ |
|
|
onShow: function () { |
|
|
|
|
|
|
|
|
onShow: function() { |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
canSpell:true, |
|
|
|
|
|
canBuyIf:true, |
|
|
|
|
|
|
|
|
canSpell: true, |
|
|
|
|
|
canBuyIf: true, |
|
|
showTime: true |
|
|
showTime: true |
|
|
}) |
|
|
}) |
|
|
if(this.data.spellData!=null){ |
|
|
|
|
|
|
|
|
if (this.data.spellData != null) { |
|
|
this.countdown() |
|
|
this.countdown() |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
@@ -468,7 +463,7 @@ Page({ |
|
|
/** |
|
|
/** |
|
|
* 生命周期函数--监听页面隐藏 |
|
|
* 生命周期函数--监听页面隐藏 |
|
|
*/ |
|
|
*/ |
|
|
onHide: function () { |
|
|
|
|
|
|
|
|
onHide: function() { |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
showTime: false |
|
|
showTime: false |
|
|
}) |
|
|
}) |
|
@@ -477,7 +472,7 @@ Page({ |
|
|
/** |
|
|
/** |
|
|
* 生命周期函数--监听页面卸载 |
|
|
* 生命周期函数--监听页面卸载 |
|
|
*/ |
|
|
*/ |
|
|
onUnload: function () { |
|
|
|
|
|
|
|
|
onUnload: function() { |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
showTime: false |
|
|
showTime: false |
|
|
}) |
|
|
}) |
|
@@ -486,8 +481,8 @@ Page({ |
|
|
/** |
|
|
/** |
|
|
* 页面相关事件处理函数--监听用户下拉动作 |
|
|
* 页面相关事件处理函数--监听用户下拉动作 |
|
|
*/ |
|
|
*/ |
|
|
onPullDownRefresh: function (e) { |
|
|
|
|
|
let that=this; |
|
|
|
|
|
|
|
|
onPullDownRefresh: function(e) { |
|
|
|
|
|
let that = this; |
|
|
that.getDetail(that.data.couponChannelId); |
|
|
that.getDetail(that.data.couponChannelId); |
|
|
that.getOneSpell(that.data.couponId) |
|
|
that.getOneSpell(that.data.couponId) |
|
|
}, |
|
|
}, |