Commit e1b08c24b2c5a9b8efa0eacdd652b3b01d54fb83

Authored by wangfan
1 parent 96fca973

customer

... ... @@ -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
... ...
... ... @@ -24,7 +24,7 @@
</view>
</view>
<userinfo binduserinfo="userinfo" class="share-but-view">
<view class="share-but Regular">我愿意</view>
<view class="share-but Regular">{{!detail.hasCanSuccess?'我愿意':'去邀请'}}</view>
</userinfo>
<block wx:if="{{detail.customers.length>0}}">
<view class="line-text">
... ...
... ... @@ -68,9 +68,10 @@ Page({
_formatList(list){
if(!list) return [];
if(list.length>0){
let openid=getApp().openid;
list.forEach(row=>{
row.rdateStr=util.unixtoTime(row.rdate,'MM月DD日 WW HH:II');
row.navigator=row.inviting==getApp().openid?'detail_owner':'detail_customer'
row.navigator=row.openid==openid?'detail_owner':'detail_customer'
})
}
return list;
... ...