Commit 46881609bd6d8892f72b4b59d2a2f76e121bb09e

Authored by wangfan
1 parent 538dc0ab

seller-Invitation

// components/book/tabBar/tabBar.js
import util from '../../../utils/util'
import App from '../../../utils/api';
const {regeneratorRuntime} = global
Component({
/**
* 组件的属性列表
... ... @@ -13,6 +15,7 @@ Component({
*/
data: {
pi:0,
dot:0,
},
attached(){
let pages=getCurrentPages();
... ... @@ -28,6 +31,9 @@ Component({
}
}
},
ready(){
this.hasDot()
},
/**
* 组件的方法列表
*/
... ... @@ -41,6 +47,15 @@ Component({
url:url,
})
}
}
},
hasDot(){
App.Reserve.GetNewCustomerTotal().then(res => {
let dot=res.data.total||0
this.setData({
dot:dot
})
this.triggerEvent('NewCustomer',{total:dot})
});
}
}
})
... ...
... ... @@ -16,7 +16,9 @@
-->
<formids class="item flex-vc" bindtap="redirectTo" data-url="/pages/manager-invitation/setting/index">
<view class="flex-vc {{pi==2?'checked':''}}">
<view class="icon setting"></view>
<view class="icon setting">
<view class="dot" wx:if="{{dot>0}}"></view>
</view>
<view class="text">我的</view>
</view>
</formids>
... ...
... ... @@ -20,11 +20,21 @@
.tabBar .item{
width: 50%;
}
.dot{
position: absolute;
width: 16rpx;
height: 16rpx;
background-color: #F05522;
border-radius: 50%;
right:-14rpx;
top:-8rpx;
}
.tabBar .icon{
width: 34rpx;
height: 32rpx;
margin-bottom: 12rpx;
background-size: 100% 100%;
position: relative;
}
.tabBar .icon image{
width: 100%;
... ...
... ... @@ -23,11 +23,13 @@ Page({
enter_params: {},
onLoad: function (options) {
this.enter_params = util.cache('enter_params');
App.Reserve.SellerInfo(this.enter_params).then(res=>{
this.setData({
hasSalesman:res.data.hasSalesman==1
if(this.enter_params){
App.Reserve.SellerInfo(this.enter_params).then(res=>{
this.setData({
hasSalesman:res.data.hasSalesman==1
})
})
})
}
this.seller_id=options.seller_id||this.enter_params.seller_id;
this.getMembers();
App.Reserve.GetNewCustomerTotal({},'clean');
... ... @@ -69,9 +71,9 @@ Page({
},
getMembers(hasReachBottom=false){
App.Reserve.Members({
sid: this.seller_id,
sid: this.seller_id||'xxxx',
//manager_id:this.enter_params.manager_id,
manager_openid:this.enter_params.seller_openid,
//manager_openid:this.enter_params.seller_openid,
offset: this.offset,
limit: this.limit,
}).then(res => {
... ...
... ... @@ -2,6 +2,7 @@
import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
import PubSub from '../../../utils/PubSub'
Page({
/**
... ... @@ -9,6 +10,7 @@ Page({
*/
data: {
hasSellerBook:false,
NewCustomerTotal:0,
},
/**
... ... @@ -23,6 +25,13 @@ Page({
})
}
})
PubSub.on(
'flushNewCustomer',
data=>{
console.log('flushNewCustomer',data)
this.selectComponent('#tabBar').hasDot();
}
)
},
/**
... ... @@ -65,6 +74,10 @@ Page({
}
})
},
NewCustomer(e){
this.setData({
NewCustomerTotal:e.detail.total
})
}
})
\ No newline at end of file
... ...
... ... @@ -25,10 +25,11 @@
</view>
</view>
</formids>
<formids url="/pages/manager-invitation/crm/index">
<formids url="/pages/book/crm/index">
<view class="row flex-lr" style="padding-top: 34rpx;">
<view>我的客户</view>
<view class="flex-rr">
<text class="right" wx:if="{{NewCustomerTotal>0}}" style="color: #F05522;">新增{{NewCustomerTotal}}位</text>
<view class="more"></view>
</view>
</view>
... ... @@ -50,4 +51,4 @@
</view>
</formids>
</view>
<tabBar></tabBar>
<tabBar bindNewCustomer="NewCustomer" id="tabBar"></tabBar>
... ...