|
...
|
...
|
@@ -12,6 +12,7 @@ Page({ |
|
|
|
padding:[],
|
|
|
|
total:0,
|
|
|
|
},
|
|
|
|
ids:[],
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面加载
|
|
...
|
...
|
@@ -47,11 +48,17 @@ Page({ |
|
|
|
onUnload: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
getListData(){
|
|
|
|
/**
|
|
|
|
* 用户点击右上角分享
|
|
|
|
*/
|
|
|
|
onShareAppMessage: function () {
|
|
|
|
return this.shareSetting();
|
|
|
|
},
|
|
|
|
getListData(fouce=false){
|
|
|
|
App.Reserve.GetListFromScheAndRes({
|
|
|
|
flag:this.data.tabFlag,
|
|
|
|
openid:getApp().openid,
|
|
|
|
}).then(res => {
|
|
|
|
},fouce).then(res => {
|
|
|
|
let data=this.formatList(res.data);
|
|
|
|
this.setData({
|
|
|
|
success:data.success,
|
|
...
|
...
|
@@ -68,14 +75,17 @@ Page({ |
|
|
|
list.forEach(row=>{
|
|
|
|
row.rdateStr=util.unixtoTime(row.rdate,'MM月DD日 WW HH:II');
|
|
|
|
row.navigator=row.openid==openid?'detail_owner':'detail_customer';
|
|
|
|
row.hasOwner=getApp().openid==row.openid
|
|
|
|
let d=util.unixtoTime(row.rdate,'MM月DD日 DAY 星期WW');
|
|
|
|
typeof dlist[d]=='undefined'?dlist[d]=[]:'';
|
|
|
|
dlist[d].push(row);
|
|
|
|
this.ids.push(row.id);
|
|
|
|
})
|
|
|
|
}
|
|
|
|
return dlist;
|
|
|
|
},
|
|
|
|
formatList(res){
|
|
|
|
this.ids=[];
|
|
|
|
res.success=this._formatList(res.success);
|
|
|
|
res.padding=this._formatList(res.padding);
|
|
|
|
return res;
|
|
...
|
...
|
@@ -87,20 +97,39 @@ Page({ |
|
|
|
this.getListData();
|
|
|
|
},
|
|
|
|
userinfo(e){
|
|
|
|
let id=e.target.dataset.id;
|
|
|
|
let type=e.target.dataset.type;
|
|
|
|
if(type=='padding'){
|
|
|
|
App.Reserve.SetRelaSuccess({
|
|
|
|
rid:id,
|
|
|
|
openid:getApp().openid
|
|
|
|
}).then(res=>{
|
|
|
|
this.getListData();
|
|
|
|
})
|
|
|
|
}else{
|
|
|
|
wx.navigateTo({
|
|
|
|
url:'invite?id='+id,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log('userinfo-share',e)
|
|
|
|
this.ids.forEach(id=>{
|
|
|
|
let us=this.selectComponent("#userinfo-share-"+id);
|
|
|
|
//console.log('userinfo-share',us)
|
|
|
|
us.init();
|
|
|
|
})
|
|
|
|
},
|
|
|
|
shareSetting(){
|
|
|
|
console.log('this.topicVal',this.topicVal)
|
|
|
|
if(this.topicVal && this.data.detail.openid==getApp().openid){
|
|
|
|
App.Reserve.SetTopicFromShare({
|
|
|
|
rid:this.id,
|
|
|
|
topic:this.topicVal
|
|
|
|
})
|
|
|
|
}
|
|
|
|
let nickname="";
|
|
|
|
try{
|
|
|
|
nickname=util.cache('userInfo').nickName;
|
|
|
|
}catch(e){}
|
|
|
|
return {
|
|
|
|
title: nickname+'给你发了一个邀请,点击查看',
|
|
|
|
path: '/pages/customer/index?id='+this.id+'&fromid='+getApp().openid+'&invite_name='+nickname,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
accept(e){//同意
|
|
|
|
console.log('accept',e)
|
|
|
|
let id=e.target.dataset.id;
|
|
|
|
App.Reserve.SetRelaSuccess({
|
|
|
|
rid:id,
|
|
|
|
openid:getApp().openid,
|
|
|
|
is_agree:1,
|
|
|
|
}).then(res=>{
|
|
|
|
this.getListData(true);
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}) |
|
|
\ No newline at end of file |
...
|
...
|
|