Commit 1d0be7790ca4f065da73023046c73e72aefd1236

Authored by wangfan
1 parent 3b55b871

三模互切

... ... @@ -48,5 +48,13 @@
</view>
</view>
</formids>
<formids url="/pages/manager-invitation/index">
<view class="row flex-lr" style="padding-top: 34rpx;">
<view>切换到客户经理模式</view>
<view class="flex-rr">
<view class="more"></view>
</view>
</view>
</formids>
</view>
<tabBar></tabBar>
... ...
... ... @@ -27,6 +27,7 @@ http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png
margin: 0 auto;
color: #353535;
padding-top: 34rpx;
padding-bottom: 120rpx;
}
.row{
font-size: 34rpx;
... ...
... ... @@ -29,14 +29,14 @@ Page({
})
this.selectComponent("#network").debug(opt, 'scene');
}
mta.Page.init({
"appID":"500667280",
"eventID":"500667287",
"statPullDownFresh":true,
"statShareApp":true,
"statReachBottom":true,
"lauchOpts":opt, //渠道分析
});
mta.Page.init({
"appID":"500667280",
"eventID":"500667287",
"statPullDownFresh":true,
"statShareApp":true,
"statReachBottom":true,
"lauchOpts":opt, //渠道分析
});
opt.openid = await this.getOpenid();
if (!opt.openid) {
console.log('App.Orders.CheckOrder no openid');
... ... @@ -54,8 +54,9 @@ Page({
//获得商户数据
//this.enter_params=await this.SellerForOpenid(opt.openid);
this.enter_params=usi.data.data;
}else if(usi.data.identity==2){//客户经理
if(this.islove!='customer'){
}
if(usi.data.invitation.flag){//已是客户经理
if(this.islove=='invitation'){
wx.redirectTo({
url:'/pages/manager-invitation/review'
})
... ...
... ... @@ -91,6 +91,7 @@ Page({
nickname:us.nickName,
gender:us.gender,
}).then(res=>{
util.cache('islove','invitation');
wx.redirectTo({
url:'./review'
});
... ... @@ -110,13 +111,8 @@ Page({
hasGo:true,
})
if(res.ret==200){
if(res.data.identity==1){
// wx.reLaunch({
// url:'/pages/customer/index'
// })
// return;
}
if(res.data.identity==2){
if(res.data.invitation.flag){//已是客户经理
util.cache('islove','invitation');
wx.redirectTo({
url:'/pages/manager-invitation/review'
})
... ...
... ... @@ -7,14 +7,22 @@ Page({
/**
* 页面的初始数据
*/
data: {},
data: {
hasSellerBook:false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
App.Invitation.UserIdentity({openid:getApp().openid}).then(res=>{
if(res.data.seller.flag){//商户
this.setData({
hasSellerBook: res.data.seller.info,
})
}
})
},
/**
... ... @@ -37,4 +45,26 @@ Page({
onHide: function () {
},
gotoSellerBook(){
util.loading()
App.Reserve.SellerForOpenid({openid:getApp().openid}).then(res=>{
util.loading('clear');
if(res.data && res.data.seller_id){
this.setData({
hasSellerBook:res.data,
})
util.cache('islove','book');
wx.reLaunch({
url:util.http_build_query(res.data,'/pages/book/b_index')
})
}else{
this.setData({
hasSellerBook:false,
})
util.toast('已不是商家','none')
}
})
}
})
\ No newline at end of file
... ...
... ... @@ -41,5 +41,13 @@
</view>
</view>
</formids>
<formids bindclick="gotoSellerBook" wx:if="{{hasSellerBook}}">
<view class="row flex-lr" style="padding-top: 34rpx;">
<view>切换到商家模式</view>
<view class="flex-rr">
<view class="more"></view>
</view>
</view>
</formids>
</view>
<tabBar></tabBar>
... ...
... ... @@ -16,11 +16,12 @@ Page({
*/
onLoad: function (options) {
App.Invitation.UserIdentity({openid:getApp().openid}).then(res=>{
if(res.data.identity==1) {//商户
if(res.data.seller.flag){//商户
this.setData({
hasSellerBook: res.data,
hasSellerBook: res.data.seller.info,
})
}else if(res.data.identity==2){//客户经理
}
if(res.data.invitation.flag){//客户经理
this.setData({
hasManagerInvitation: true,
})
... ...
... ... @@ -39,7 +39,7 @@
</view>
</view>
</formids>
<formids url="/pages/manager-invitation/review" wx:if="{{hasManagerInvitation}}">
<formids url="/pages/manager-invitation/index" wx:if="{{hasManagerInvitation}}">
<view class="item flex-lr">
<view class="left">客户经理模式</view>
<view class="right">
... ...