|
...
|
...
|
@@ -13,67 +13,48 @@ Page({ |
|
|
|
current: 0,
|
|
|
|
tpls: TP.tpls(),
|
|
|
|
seller:{
|
|
|
|
name:'一键订示例餐厅',
|
|
|
|
room:'天香阁',
|
|
|
|
name:'',
|
|
|
|
room:'',
|
|
|
|
date:util.unixtoTime(new Date()/1000,'YYYY/MM/DD 星期WW HH:II'),
|
|
|
|
addr:'粤江西路啤酒文化创意艺术区B09',
|
|
|
|
addr:'',
|
|
|
|
hasOwner:true,
|
|
|
|
},
|
|
|
|
options:{},
|
|
|
|
},
|
|
|
|
detail:{},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
*/
|
|
|
|
onLoad: function (options) {
|
|
|
|
options.tplid=options.tplid||1;
|
|
|
|
let param={
|
|
|
|
options:options,
|
|
|
|
}
|
|
|
|
if(options.rid){
|
|
|
|
if(true){
|
|
|
|
param.tpls=[TP.tpls(options.tplid)]
|
|
|
|
}
|
|
|
|
this.setData(param)
|
|
|
|
this.initData(options);
|
|
|
|
},
|
|
|
|
initData(options){
|
|
|
|
if(options.rid){
|
|
|
|
App.Invitation.Detail({id:options.rid}).then(res=>{
|
|
|
|
this.setData({
|
|
|
|
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,
|
|
|
|
hasOwner:true,
|
|
|
|
}
|
|
|
|
})
|
|
|
|
App.Reserve.Detail({rid:options.id,openid:''}).then(res=>{
|
|
|
|
this.detail=res.data;
|
|
|
|
let tables=[];
|
|
|
|
res.data.tables.forEach(t=>{
|
|
|
|
tables.push(t.name);
|
|
|
|
})
|
|
|
|
}else{
|
|
|
|
App.Invitation.GetSellerList({
|
|
|
|
openid:getApp().openid
|
|
|
|
}).then(res=>{
|
|
|
|
if(res.data.length>0){
|
|
|
|
let defi=0;
|
|
|
|
for(let i=0;i<res.data.length;i++){
|
|
|
|
if(res.data[i].is_default==1){
|
|
|
|
defi=i;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let sel=res.data[defi];
|
|
|
|
this.setData({
|
|
|
|
seller:{
|
|
|
|
name:sel.name,
|
|
|
|
room:'',
|
|
|
|
date:util.unixtoTime(new Date()/1000,this.data.tpls[this.data.current].timeStr),
|
|
|
|
addr:sel.address,
|
|
|
|
hasOwner:true,
|
|
|
|
}
|
|
|
|
})
|
|
|
|
this.setData({
|
|
|
|
seller:{
|
|
|
|
name:res.data.seller.sellername,
|
|
|
|
room:tables.join('、'),
|
|
|
|
date:util.unixtoTime(res.data.ddate,this.data.tpls[this.data.current].timeStr),
|
|
|
|
addr:res.data.seller.real_address||res.data.seller.map_address,
|
|
|
|
image:res.data.image_url,
|
|
|
|
hasOwner:true,
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
...
|
...
|
@@ -141,14 +122,8 @@ Page({ |
|
|
|
...this.data.options,
|
|
|
|
fromid:getApp().openid,
|
|
|
|
hasSellerShare:1,
|
|
|
|
hasInvitation:1,
|
|
|
|
},'/pages/manager-invitation/display')
|
|
|
|
if(!this.data.options.rid){
|
|
|
|
return {
|
|
|
|
title: '一键订,客户经理专用的拓客工具',
|
|
|
|
path: '/pages/manager-invitation/index',
|
|
|
|
imageUrl:this.data.tpls[this.data.current].shareFirstImage,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
title: '点击查看详情,发邀请函',
|
|
|
|
path: path,
|
|
...
|
...
|
@@ -169,13 +144,21 @@ Page({ |
|
|
|
[`seller.date`]:util.unixtoTime(new Date()/1000,this.data.tpls[current].timeStr)
|
|
|
|
})
|
|
|
|
},
|
|
|
|
goEditor(){
|
|
|
|
let param={
|
|
|
|
...this.data.options,
|
|
|
|
tplid:this.data.tpls[this.data.current].id,
|
|
|
|
sendmsg(){
|
|
|
|
if (!this.detail.phone) {
|
|
|
|
util.toast('未填写手机号码', 'none')
|
|
|
|
return;
|
|
|
|
} else if (!/^1\d{10}$/.test(this.detail.phone)) {
|
|
|
|
util.toast('手机号码错误', 'none')
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
wx.navigateTo({
|
|
|
|
url:util.http_build_query(param,'./editor')
|
|
|
|
})
|
|
|
|
url: '/pages/book/b_sms?id=' + this.detail.id
|
|
|
|
});
|
|
|
|
},
|
|
|
|
gotoDetail(){
|
|
|
|
wx.redirectTo({
|
|
|
|
url: '/pages/book/b_detail?id=' + this.detail.id
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}) |
|
|
\ No newline at end of file |
...
|
...
|
|