|
...
|
...
|
@@ -19,6 +19,7 @@ Page({ |
|
|
|
addr:'粤江西路啤酒文化创意艺术区B09'
|
|
|
|
},
|
|
|
|
options:{tplid:1},
|
|
|
|
hasOwner:true,//是否为发起人
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -30,6 +31,7 @@ Page({ |
|
|
|
wx.redirectTo({
|
|
|
|
url:util.http_build_query({rid:options.rid,tplid:options.tplid},'./review')
|
|
|
|
})
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
App.Invitation.SetInvitationRel({
|
|
|
|
id:options.rid,
|
|
...
|
...
|
@@ -38,24 +40,40 @@ Page({ |
|
|
|
})
|
|
|
|
let param={
|
|
|
|
options:options,
|
|
|
|
hasOwner:options.hasSellerShare==1,//是否为发起人
|
|
|
|
}
|
|
|
|
if(options.rid){
|
|
|
|
param.tpls=[TP.tpls(options.tplid)]
|
|
|
|
}
|
|
|
|
this.setData(param)
|
|
|
|
this.initData(options);
|
|
|
|
this.initData(options,openid);
|
|
|
|
},
|
|
|
|
initData(options){
|
|
|
|
initData(options,openid){
|
|
|
|
App.Invitation.Detail({id:options.rid}).then(res=>{
|
|
|
|
this.setData({
|
|
|
|
let hasOwner=false;
|
|
|
|
let hasCanSuccess=false;
|
|
|
|
if(res.data.customers && res.data.customers.length>0){
|
|
|
|
res.data.customers.forEach((u,i)=>{
|
|
|
|
if(u.openid==openid){
|
|
|
|
if(i==0){hasOwner=true;}
|
|
|
|
hasCanSuccess=true;
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
let obj={
|
|
|
|
seller:{
|
|
|
|
name:res.data.seller_name,
|
|
|
|
room:res.data.room_name,
|
|
|
|
date:util.unixtoTime(res.data.arrival_time,this.data.tpls[this.data.current].timeStr),
|
|
|
|
addr:res.data.seller_address,
|
|
|
|
image:res.data.image_url,
|
|
|
|
hasCanSuccess:hasCanSuccess,
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
if(hasOwner){
|
|
|
|
obj.hasOwner=true
|
|
|
|
}
|
|
|
|
this.setData(obj)
|
|
|
|
})
|
|
|
|
},
|
|
|
|
/**
|
|
...
|
...
|
@@ -122,13 +140,44 @@ Page({ |
|
|
|
onShareAppMessage: function () {
|
|
|
|
let path=util.http_build_query({
|
|
|
|
...this.data.options,
|
|
|
|
fromid:openid,
|
|
|
|
fromid:getApp().openid,
|
|
|
|
hasSellerShare:'',
|
|
|
|
},'/pages/manager-invitation/display')
|
|
|
|
return {
|
|
|
|
title: '点击查看详情,发邀请函',
|
|
|
|
title: '你收到一个邀请函,点击查看',
|
|
|
|
path: path,
|
|
|
|
imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-anpai2.jpg',
|
|
|
|
//imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-anpai2.jpg',
|
|
|
|
imageUrl:util.cgi('App.Reserve.MakePic&rid='+this.data.options.rid),
|
|
|
|
}
|
|
|
|
},
|
|
|
|
setUserInfoSuccess(){
|
|
|
|
util.toast('授权成功,可以继续转发','none');
|
|
|
|
},
|
|
|
|
confirmed(){
|
|
|
|
if(!this.data.seller.hasCanSuccess){
|
|
|
|
let userInfo=util.cache('userInfo');
|
|
|
|
let openid=getApp().openid
|
|
|
|
if(userInfo){
|
|
|
|
userInfo=JSON.stringify({
|
|
|
|
openid: openid,
|
|
|
|
avatar: userInfo.avatarUrl,
|
|
|
|
nickname: userInfo.nickName,
|
|
|
|
gender: userInfo.gender
|
|
|
|
})
|
|
|
|
}
|
|
|
|
App.Invitation.SetInvitationConfirm({
|
|
|
|
lid:this.data.options.rid,
|
|
|
|
openid:openid,
|
|
|
|
is_agree:1,
|
|
|
|
userinfo:userInfo
|
|
|
|
}).then(res=>{
|
|
|
|
this.setData({
|
|
|
|
[`seller.hasCanSuccess`]:true
|
|
|
|
})
|
|
|
|
util.toast('赴约成功','none')
|
|
|
|
})
|
|
|
|
}else{
|
|
|
|
util.toast('赴约成功','none')
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}) |
|
|
\ No newline at end of file |
...
|
...
|
|