You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
apply-assistant-v3/components/panel/tabbar.vue

97 lines
1.9 KiB
Vue

6 months ago
<template>
<view class="g-components-panel-tabbar">
<u-tabbar v-model="current" :list="list" active-color="#00b666" @change='handleTab'></u-tabbar>
</view>
</template>
<script>
export default {
props: {
tip:{
default:()=>{
return 0;
}
}
},
data() {
return {
cdnBaseImg:this.G.store().cdnBaseImg,
list: [],
current: 0,
isTip:0,
}
},
watch:{
'tip'(val){
this.isTip = val
}
},
created() {
let that = this;
that.isTip = that.tip;
console.log('creatd tabbar',this.tip)
that.init();
},
methods:{
init(){
let that = this;
if (uni.getStorageSync("apply-supplierAccount") == 1) {
// 有
that.list = [
{
iconPath: this.cdnBaseImg + 'home.png',
selectedIconPath: this.cdnBaseImg + 'homeActive.png',
text: '首页',
customIcon: false,
pagePath:"/pages/home/index",
},
{
iconPath: this.cdnBaseImg + 'person.png',
selectedIconPath: this.cdnBaseImg + 'personActive.png',
text: '我的',
customIcon: false,
pagePath:"/pages/person/index",
isDot: that.isTip ? true : false,
},
]
} else {
// 无
that.list = [
{
iconPath: this.cdnBaseImg + 'home.png',
selectedIconPath: this.cdnBaseImg + 'homeActive.png',
text: '首页',
customIcon: false,
pagePath:"/pages/home/index",
},
{
iconPath: this.cdnBaseImg + 'person.png',
selectedIconPath: this.cdnBaseImg + 'personActive.png',
text: '我的',
customIcon: false,
pagePath:"/pages/person/index",
isDot: that.isTip ? true : false,
},
]
}
},
handleTab(e){
let that = this;
that.G.Get(
that.api.bind_getWaitNum + "/" + 2,
{
type: 2,
},
(res) => {
that.isTip = res.unread;
that.init();
}
);
}
}
}
</script>
<style lang="scss">
.g-components-panel-tabbar {}
</style>