Commit 8555fd88d203ba20f07926765638a547d3024133

Authored by wangfan
1 parent 1d0be779

三模互切

Showing 1 changed file with 12 additions and 9 deletions
@@ -17,6 +17,7 @@ Page({ @@ -17,6 +17,7 @@ Page({
17 */ 17 */
18 islove:'',//用户在哪端 18 islove:'',//用户在哪端
19 enter_params:'',//商户入口参数 19 enter_params:'',//商户入口参数
  20 + isInvitation:false,//客户经理
20 async onLoad(opt) { 21 async onLoad(opt) {
21 console.log('onLoad', opt,mta); 22 console.log('onLoad', opt,mta);
22 //转化场景值到opt 23 //转化场景值到opt
@@ -50,18 +51,13 @@ Page({ @@ -50,18 +51,13 @@ Page({
50 this.islove=await util.cache('islove') 51 this.islove=await util.cache('islove')
51 } 52 }
52 let usi=await App.Invitation.UserIdentity({openid:opt.openid}); 53 let usi=await App.Invitation.UserIdentity({openid:opt.openid});
53 - if(usi.data.identity==1){//商户 54 + if(usi.data.seller.flag){//商户
54 //获得商户数据 55 //获得商户数据
55 //this.enter_params=await this.SellerForOpenid(opt.openid); 56 //this.enter_params=await this.SellerForOpenid(opt.openid);
56 this.enter_params=usi.data.data; 57 this.enter_params=usi.data.data;
57 } 58 }
58 if(usi.data.invitation.flag){//已是客户经理 59 if(usi.data.invitation.flag){//已是客户经理
59 - if(this.islove=='invitation'){  
60 - wx.redirectTo({  
61 - url:'/pages/manager-invitation/review'  
62 - })  
63 - return;  
64 - } 60 + this.isInvitation=true;
65 } 61 }
66 //console.log('this.enter_params',this.enter_params) 62 //console.log('this.enter_params',this.enter_params)
67 let url = '/pages/reserve/index'; 63 let url = '/pages/reserve/index';
@@ -123,13 +119,20 @@ Page({ @@ -123,13 +119,20 @@ Page({
123 this.redirectTo({url: url}); 119 this.redirectTo({url: url});
124 }) 120 })
125 } else { 121 } else {
126 - if(this.enter_params && this.islove!='customer'){  
127 - //商户且未手动切换到顾客端 122 + if(this.enter_params && this.islove!='customer' && this.islove!='invitation'){
  123 + //商户且未手动切换到顾客端或客户经理
128 wx.reLaunch({ 124 wx.reLaunch({
129 url:util.http_build_query(this.enter_params,'/pages/book/b_index') 125 url:util.http_build_query(this.enter_params,'/pages/book/b_index')
130 }) 126 })
131 return; 127 return;
132 } 128 }
  129 + if(this.isInvitation && this.islove!='customer' && this.islove!='book'){
  130 + //客户经理且未手动切换到顾客端或商户
  131 + wx.reLaunch({
  132 + url:'/pages/manager-invitation/review'
  133 + })
  134 + return;
  135 + }
133 console.log('url',url); 136 console.log('url',url);
134 this.redirectTo({url: url}); 137 this.redirectTo({url: url});
135 } 138 }