Showing
8 changed files
with
68 additions
and
23 deletions
| @@ -48,5 +48,13 @@ | @@ -48,5 +48,13 @@ | ||
| 48 | </view> | 48 | </view> |
| 49 | </view> | 49 | </view> |
| 50 | </formids> | 50 | </formids> |
| 51 | + <formids url="/pages/manager-invitation/index"> | ||
| 52 | + <view class="row flex-lr" style="padding-top: 34rpx;"> | ||
| 53 | + <view>切换到客户经理模式</view> | ||
| 54 | + <view class="flex-rr"> | ||
| 55 | + <view class="more"></view> | ||
| 56 | + </view> | ||
| 57 | + </view> | ||
| 58 | + </formids> | ||
| 51 | </view> | 59 | </view> |
| 52 | <tabBar></tabBar> | 60 | <tabBar></tabBar> |
| @@ -27,6 +27,7 @@ http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png | @@ -27,6 +27,7 @@ http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png | ||
| 27 | margin: 0 auto; | 27 | margin: 0 auto; |
| 28 | color: #353535; | 28 | color: #353535; |
| 29 | padding-top: 34rpx; | 29 | padding-top: 34rpx; |
| 30 | + padding-bottom: 120rpx; | ||
| 30 | } | 31 | } |
| 31 | .row{ | 32 | .row{ |
| 32 | font-size: 34rpx; | 33 | font-size: 34rpx; |
| @@ -29,14 +29,14 @@ Page({ | @@ -29,14 +29,14 @@ Page({ | ||
| 29 | }) | 29 | }) |
| 30 | this.selectComponent("#network").debug(opt, 'scene'); | 30 | this.selectComponent("#network").debug(opt, 'scene'); |
| 31 | } | 31 | } |
| 32 | - mta.Page.init({ | ||
| 33 | - "appID":"500667280", | ||
| 34 | - "eventID":"500667287", | ||
| 35 | - "statPullDownFresh":true, | ||
| 36 | - "statShareApp":true, | ||
| 37 | - "statReachBottom":true, | ||
| 38 | - "lauchOpts":opt, //渠道分析 | ||
| 39 | - }); | 32 | + mta.Page.init({ |
| 33 | + "appID":"500667280", | ||
| 34 | + "eventID":"500667287", | ||
| 35 | + "statPullDownFresh":true, | ||
| 36 | + "statShareApp":true, | ||
| 37 | + "statReachBottom":true, | ||
| 38 | + "lauchOpts":opt, //渠道分析 | ||
| 39 | + }); | ||
| 40 | opt.openid = await this.getOpenid(); | 40 | opt.openid = await this.getOpenid(); |
| 41 | if (!opt.openid) { | 41 | if (!opt.openid) { |
| 42 | console.log('App.Orders.CheckOrder no openid'); | 42 | console.log('App.Orders.CheckOrder no openid'); |
| @@ -54,8 +54,9 @@ Page({ | @@ -54,8 +54,9 @@ Page({ | ||
| 54 | //获得商户数据 | 54 | //获得商户数据 |
| 55 | //this.enter_params=await this.SellerForOpenid(opt.openid); | 55 | //this.enter_params=await this.SellerForOpenid(opt.openid); |
| 56 | this.enter_params=usi.data.data; | 56 | this.enter_params=usi.data.data; |
| 57 | - }else if(usi.data.identity==2){//客户经理 | ||
| 58 | - if(this.islove!='customer'){ | 57 | + } |
| 58 | + if(usi.data.invitation.flag){//已是客户经理 | ||
| 59 | + if(this.islove=='invitation'){ | ||
| 59 | wx.redirectTo({ | 60 | wx.redirectTo({ |
| 60 | url:'/pages/manager-invitation/review' | 61 | url:'/pages/manager-invitation/review' |
| 61 | }) | 62 | }) |
| @@ -91,6 +91,7 @@ Page({ | @@ -91,6 +91,7 @@ Page({ | ||
| 91 | nickname:us.nickName, | 91 | nickname:us.nickName, |
| 92 | gender:us.gender, | 92 | gender:us.gender, |
| 93 | }).then(res=>{ | 93 | }).then(res=>{ |
| 94 | + util.cache('islove','invitation'); | ||
| 94 | wx.redirectTo({ | 95 | wx.redirectTo({ |
| 95 | url:'./review' | 96 | url:'./review' |
| 96 | }); | 97 | }); |
| @@ -110,13 +111,8 @@ Page({ | @@ -110,13 +111,8 @@ Page({ | ||
| 110 | hasGo:true, | 111 | hasGo:true, |
| 111 | }) | 112 | }) |
| 112 | if(res.ret==200){ | 113 | if(res.ret==200){ |
| 113 | - if(res.data.identity==1){ | ||
| 114 | - // wx.reLaunch({ | ||
| 115 | - // url:'/pages/customer/index' | ||
| 116 | - // }) | ||
| 117 | - // return; | ||
| 118 | - } | ||
| 119 | - if(res.data.identity==2){ | 114 | + if(res.data.invitation.flag){//已是客户经理 |
| 115 | + util.cache('islove','invitation'); | ||
| 120 | wx.redirectTo({ | 116 | wx.redirectTo({ |
| 121 | url:'/pages/manager-invitation/review' | 117 | url:'/pages/manager-invitation/review' |
| 122 | }) | 118 | }) |
| @@ -7,14 +7,22 @@ Page({ | @@ -7,14 +7,22 @@ Page({ | ||
| 7 | /** | 7 | /** |
| 8 | * 页面的初始数据 | 8 | * 页面的初始数据 |
| 9 | */ | 9 | */ |
| 10 | - data: {}, | 10 | + data: { |
| 11 | + hasSellerBook:false, | ||
| 12 | + }, | ||
| 11 | 13 | ||
| 12 | /** | 14 | /** |
| 13 | * 生命周期函数--监听页面加载 | 15 | * 生命周期函数--监听页面加载 |
| 14 | */ | 16 | */ |
| 15 | 17 | ||
| 16 | onLoad: function (options) { | 18 | onLoad: function (options) { |
| 17 | - | 19 | + App.Invitation.UserIdentity({openid:getApp().openid}).then(res=>{ |
| 20 | + if(res.data.seller.flag){//商户 | ||
| 21 | + this.setData({ | ||
| 22 | + hasSellerBook: res.data.seller.info, | ||
| 23 | + }) | ||
| 24 | + } | ||
| 25 | + }) | ||
| 18 | }, | 26 | }, |
| 19 | 27 | ||
| 20 | /** | 28 | /** |
| @@ -37,4 +45,26 @@ Page({ | @@ -37,4 +45,26 @@ Page({ | ||
| 37 | onHide: function () { | 45 | onHide: function () { |
| 38 | 46 | ||
| 39 | }, | 47 | }, |
| 48 | + gotoSellerBook(){ | ||
| 49 | + util.loading() | ||
| 50 | + App.Reserve.SellerForOpenid({openid:getApp().openid}).then(res=>{ | ||
| 51 | + util.loading('clear'); | ||
| 52 | + if(res.data && res.data.seller_id){ | ||
| 53 | + this.setData({ | ||
| 54 | + hasSellerBook:res.data, | ||
| 55 | + }) | ||
| 56 | + util.cache('islove','book'); | ||
| 57 | + wx.reLaunch({ | ||
| 58 | + url:util.http_build_query(res.data,'/pages/book/b_index') | ||
| 59 | + }) | ||
| 60 | + }else{ | ||
| 61 | + this.setData({ | ||
| 62 | + hasSellerBook:false, | ||
| 63 | + }) | ||
| 64 | + util.toast('已不是商家','none') | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + }) | ||
| 68 | + | ||
| 69 | + } | ||
| 40 | }) | 70 | }) |
| @@ -41,5 +41,13 @@ | @@ -41,5 +41,13 @@ | ||
| 41 | </view> | 41 | </view> |
| 42 | </view> | 42 | </view> |
| 43 | </formids> | 43 | </formids> |
| 44 | + <formids bindclick="gotoSellerBook" wx:if="{{hasSellerBook}}"> | ||
| 45 | + <view class="row flex-lr" style="padding-top: 34rpx;"> | ||
| 46 | + <view>切换到商家模式</view> | ||
| 47 | + <view class="flex-rr"> | ||
| 48 | + <view class="more"></view> | ||
| 49 | + </view> | ||
| 50 | + </view> | ||
| 51 | + </formids> | ||
| 44 | </view> | 52 | </view> |
| 45 | <tabBar></tabBar> | 53 | <tabBar></tabBar> |
| @@ -16,11 +16,12 @@ Page({ | @@ -16,11 +16,12 @@ Page({ | ||
| 16 | */ | 16 | */ |
| 17 | onLoad: function (options) { | 17 | onLoad: function (options) { |
| 18 | App.Invitation.UserIdentity({openid:getApp().openid}).then(res=>{ | 18 | App.Invitation.UserIdentity({openid:getApp().openid}).then(res=>{ |
| 19 | - if(res.data.identity==1) {//商户 | 19 | + if(res.data.seller.flag){//商户 |
| 20 | this.setData({ | 20 | this.setData({ |
| 21 | - hasSellerBook: res.data, | 21 | + hasSellerBook: res.data.seller.info, |
| 22 | }) | 22 | }) |
| 23 | - }else if(res.data.identity==2){//客户经理 | 23 | + } |
| 24 | + if(res.data.invitation.flag){//客户经理 | ||
| 24 | this.setData({ | 25 | this.setData({ |
| 25 | hasManagerInvitation: true, | 26 | hasManagerInvitation: true, |
| 26 | }) | 27 | }) |
| @@ -39,7 +39,7 @@ | @@ -39,7 +39,7 @@ | ||
| 39 | </view> | 39 | </view> |
| 40 | </view> | 40 | </view> |
| 41 | </formids> | 41 | </formids> |
| 42 | - <formids url="/pages/manager-invitation/review" wx:if="{{hasManagerInvitation}}"> | 42 | + <formids url="/pages/manager-invitation/index" wx:if="{{hasManagerInvitation}}"> |
| 43 | <view class="item flex-lr"> | 43 | <view class="item flex-lr"> |
| 44 | <view class="left">客户经理模式</view> | 44 | <view class="left">客户经理模式</view> |
| 45 | <view class="right"> | 45 | <view class="right"> |
-
Please register or login to post a comment