Commit 04baba843bc5f4f2cb4efcae3a4eceb90e6d9516

Authored by wangfan
1 parent 7082aed9

manager-invitation

... ... @@ -9,6 +9,7 @@ Page({
*/
data: {
dots: [],
hasGo:false,
},
/**
... ... @@ -28,25 +29,7 @@ Page({
this.setData({
dots:dots,
})
App.Invitation.UserIdentity({
openid:getApp().openid
}).then(res=>{
if(res.ret==200){
if(res.data.identity==1){
wx.reLaunch({
url:'/pages/customer/index'
})
return;
}
if(res.data.identity==2){
wx.redirectTo({
url:'/pages/manager-invitation/review'
})
}
}else{
util.toast(res.msg)
}
})
this.UserIdentity();
},
/**
... ... @@ -98,6 +81,9 @@ Page({
},
userinfo(){
if(!this.data.hasGo){
return util.toast('数据初始化,请等候','none');
}
let us=util.cache('userInfo');
App.Invitation.AddInvitationUser({
openid:getApp().openid,
... ... @@ -110,4 +96,34 @@ Page({
});
})
},
UserIdentity(){
let openid=getApp().openid;
if(!openid){
return setTimeout(()=>{
this.UserIdentity();
},300)
}
App.Invitation.UserIdentity({
openid:openid,
}).then(res=>{
this.setData({
hasGo:true,
})
if(res.ret==200){
if(res.data.identity==1){
wx.reLaunch({
url:'/pages/customer/index'
})
return;
}
if(res.data.identity==2){
wx.redirectTo({
url:'/pages/manager-invitation/review'
})
}
}else{
util.toast(res.msg)
}
})
},
})
\ No newline at end of file
... ...