},this) | },this) | ||||
}, | }, | ||||
getBuyState: function () {//查询是否已下订 | getBuyState: function () {//查询是否已下订 | ||||
this.wxRequest(this.globalData.urlRoot + "wxPay/getBuyState", {source:2}, res => { | |||||
if (res.code == 200) { | |||||
if (res.data) { | |||||
res.data.cdate = res.data.cdate ? res.data.cdate : ""; | |||||
this.globalData.getBuyState = res.data; | |||||
if (this.globalData.buyStateSuccessFuc){ | |||||
this.globalData.buyStateSuccessFuc(); | |||||
} | |||||
} | |||||
} | |||||
}, this); | |||||
// this.wxRequest(this.globalData.urlRoot + "wxPay/getBuyState", {source:2}, res => { | |||||
// if (res.code == 200) { | |||||
// if (res.data) { | |||||
// res.data.cdate = res.data.cdate ? res.data.cdate : ""; | |||||
// this.globalData.getBuyState = res.data; | |||||
// if (this.globalData.buyStateSuccessFuc){ | |||||
// this.globalData.buyStateSuccessFuc(); | |||||
// } | |||||
// } | |||||
// } | |||||
// }, this); | |||||
}, | }, | ||||
addAppEnter: function () {//小程序整体pv统计 | addAppEnter: function () {//小程序整体pv统计 | ||||
this.wxRequest(this.globalData.urlRoot + "statistics/addAppEnter", { scene:this.globalData.sceneSource}, res => { | this.wxRequest(this.globalData.urlRoot + "statistics/addAppEnter", { scene:this.globalData.sceneSource}, res => { |
paySuccess: function (e) {//支付成功 | paySuccess: function (e) {//支付成功 | ||||
app.wxRequest(app.globalData.urlRoot + "wxPay/paySuccess", { source:2,trade_id:e},res=>{ | app.wxRequest(app.globalData.urlRoot + "wxPay/paySuccess", { source:2,trade_id:e},res=>{ | ||||
if(res.code==200){ | if(res.code==200){ | ||||
// wx.showToast({ | |||||
// title: '下订成功', | |||||
// mask:true | |||||
// }) | |||||
this.setData({ | |||||
getBuyState:true | |||||
wx.showToast({ | |||||
title: '下订成功', | |||||
mask:true | |||||
}) | }) | ||||
// this.setData({ | |||||
// getBuyState:true | |||||
// }) | |||||
app.globalData.getBuyState = {}; | app.globalData.getBuyState = {}; | ||||
app.globalData.getBuyState.success = true; | app.globalData.getBuyState.success = true; | ||||
app.globalData.getBuyState.cdate = res.data.cdate; | app.globalData.getBuyState.cdate = res.data.cdate; | ||||
app.globalData.getBuyState.coupon_code = res.data.coupon_code; | app.globalData.getBuyState.coupon_code = res.data.coupon_code; | ||||
// setTimeout(()=>{ | |||||
// this.closeXieyi(); | |||||
// },1500) | |||||
setTimeout(()=>{ | |||||
wx.navigateTo({ | |||||
url: '/pages/rotaryDraw/rotaryDraw', | |||||
complete:()=>{ | |||||
this.closeXieyi(); | |||||
} | |||||
}) | |||||
},1500) | |||||
} else { | } else { | ||||
this.data.appointment = true; | this.data.appointment = true; | ||||
wx.showToast({ | wx.showToast({ |