Commit 0d5e568aac5968f0cfbda568d3eaceeb60d97c77

Authored by vking
1 parent 8155ddd0

taocan ui fix

Showing 1 changed file with 21 additions and 4 deletions
... ... @@ -34,7 +34,6 @@ Page({
*/
onLoad: function (options) {
this.options=options
this.getOrderInfo();
},
/**
... ... @@ -48,21 +47,27 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getOrderInfo();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
if(this.getOrderInfoFlushInterval){
clearInterval(this.getOrderInfoFlushInterval)
this.getOrderInfoFlushInterval=null;
}
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
if(this.getOrderInfoFlushInterval){
clearInterval(this.getOrderInfoFlushInterval)
this.getOrderInfoFlushInterval=null;
}
},
/**
... ... @@ -96,6 +101,7 @@ Page({
}).then(async res=>{
let qrcode=''
if(res.data.order_info.status==2){
this.getOrderInfoFlush();
qrcode=util.http_build_query({
path:'pages/writeoff/setmeal',
//path:'pages/me/s_index',
... ... @@ -106,6 +112,10 @@ Page({
},util.cgi('App.System.GetWxLiteCodeScene'))
}else{
qrcode=orderStatusStr[res.data.order_info.status].qrcode
if(this.getOrderInfoFlushInterval){
clearInterval(this.getOrderInfoFlushInterval)
this.getOrderInfoFlushInterval=null;
}
}
this.setData({
order_info:{...res.data.order_info,...res.data.seller_info},
... ... @@ -115,4 +125,11 @@ Page({
})
})
},
getOrderInfoFlushInterval:null,
getOrderInfoFlush(){
if(this.getOrderInfoFlushInterval) return;
this.getOrderInfoFlushInterval=setInterval(()=>{
this.getOrderInfo()
},3000)
}
})
\ No newline at end of file
... ...