|
...
|
...
|
@@ -29,14 +29,7 @@ Page({ |
|
|
|
* 生命周期函数--监听页面显示
|
|
|
|
*/
|
|
|
|
onShow: function () {
|
|
|
|
App.Reserve.Detail({
|
|
|
|
openid: getApp().openid,
|
|
|
|
rid: this.id
|
|
|
|
}).then(res => {
|
|
|
|
this.setData({
|
|
|
|
detail:this.formatDatail(res.data)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
this.getDetail();
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -59,7 +52,16 @@ Page({ |
|
|
|
onPullDownRefresh: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
getDetail(){
|
|
|
|
App.Reserve.Detail({
|
|
|
|
openid: getApp().openid,
|
|
|
|
rid: this.id
|
|
|
|
}).then(res => {
|
|
|
|
this.setData({
|
|
|
|
detail:this.formatDatail(res.data)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
formatDatail(detail){
|
|
|
|
detail.rdateStr=util.unixtoTime(detail.rdate,'MM月DD日 WW HH:II');
|
|
|
|
detail.tableFirst=detail.tables[0].name;
|
|
...
|
...
|
@@ -72,6 +74,16 @@ Page({ |
|
|
|
detail.cusman_phone='15877556369';
|
|
|
|
detail.cusman_account='wx:vking';
|
|
|
|
}
|
|
|
|
detail.hasCanSuccess=false;
|
|
|
|
if(detail.customers.length>0){
|
|
|
|
let openid=getApp().openid;
|
|
|
|
detail.customers.forEach(item=>{
|
|
|
|
if(openid==item.openid){
|
|
|
|
detail.hasCanSuccess=true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
return detail;
|
|
|
|
},
|
|
|
|
showManager(){
|
|
...
|
...
|
@@ -88,5 +100,19 @@ Page({ |
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
userinfo(){
|
|
|
|
if(!this.data.detail.hasCanSuccess){
|
|
|
|
App.Reserve.SetRelaSuccess({
|
|
|
|
rid:this.id,
|
|
|
|
openid:getApp().openid
|
|
|
|
}).then(res=>{
|
|
|
|
this.getDetail();
|
|
|
|
})
|
|
|
|
}else{
|
|
|
|
wx.navigateTo({
|
|
|
|
url:'invite?id='+this.id,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
}) |
|
|
\ No newline at end of file |
...
|
...
|
|