1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <template >
- <view>
- <u-tabbar v-model="myCurrent" :active-color="activeColor" :list="list" :before-switch="beforeSwitch" ></u-tabbar>
- </view>
- </template>
- <script>
-
- export default {
- name:"tabbarJob",
- props:{
- current: {
- setIntervalId:'',
- require: false,
- default: 0,
- },
- },
- data() {
- return {
- activeColor:"#5098FF",
- myCurrent:this.current,
- num:0,
- list: [{
- iconPath: "home",
- selectedIconPath: "home",
- text: '首页',
- customIcon: false,
- pagePath2:"/pages/job/index/index"
- },
-
- {
- iconPath: "/static/img/iconPark-city-one.svg",
- selectedIconPath: "/static/img/iconPark-city-one-selected.svg",
- text: '企业',
- customIcon: false,
- pagePath2:"/pages/job/company/index"
- },
- {
- iconPath: "chat",
- selectedIconPath: "chat",
- text: '消息',
- customIcon: false,
- count:0,
- pagePath2:"/pages/job/newsIndex/newsIndex",
- },
- {
- iconPath: "account",
- selectedIconPath: "account",
- text: '我的',
- pagePath2:"/pages/job/personal/my/my",
- customIcon: false,
- },
- ],
- };
-
- },methods:{
- beforeSwitch(index){
- clearInterval(this.setIntervalId)
-
- if(index==this.current){
- return false
- }
- var url =this.list[index].pagePath2;
- uni.navigateTo({
- url: url
- })
- return true;
- },
- getNum(){
- this.list[2].count=this.carhelp.get("tabbar_show_num")
-
- }
- },mounted(){
- this.getNum()
- this.setIntervalId= setInterval(()=>{
- this.getNum()
- },1000*2)
-
-
- },destroyed(){
- }
-
- }
- </script>
- <style>
-
- </style>
|