12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <template >
- <view>
- <u-tabbar v-model="myCurrent" :list="tabbarList"
- :before-switch="beforeSwitch" active-color="#1F4A99" ></u-tabbar>
-
- </view>
- </template>
- <script>
-
- export default {
- name:"tabbarJob",
- props:{
- current: 0,
- elderStatus: false
- },
- data() {
- return {
- activeColor:"#1F4A99",
- oldindex:this.current,
- myCurrent:this.current,
- tabbarList: [
- {
-
- iconPath: "home",
- selectedIconPath: "home-fill",
- text: '主页 ',
- pagePath2:"/pages/homePage/homePage",
- login:false,
- },
- {
-
- iconPath: "heart",
- selectedIconPath: "heart-fill",
- text: '职工之家 ',
- pagePath2:"/pages/staffHome/staffHome",
- login:true,
- },
- {
- iconPath: "account",
- selectedIconPath: "account-fill",
- text: '我的',
- login:true,
- pagePath2:"/pages/mine/mine",
- }
- ],
- };
-
- },methods:{
- setcount(c){
- this.myCurrent=c
- },
- beforeSwitch(index){
-
- var bl=false
- if(index==this.current){
- return false
- }
- var url =this.tabbarList[index].pagePath2;
-
- if(this.tabbarList[index].login){
- var userInfo=this.carhelp.getPersonInfo()
- if(userInfo){
-
- }else{
- url="/pages/login/index"
- bl=true
- }
-
- }
- uni.navigateTo({
- url: url
- })
-
- if(bl){
- this.myCurrent=0;
- return false;
- }else{
- return true;
- }
-
- },
-
- },
- mounted(){
-
- },destroyed(){
-
- }
-
-
- }
- </script>
- <style>
-
- </style>
|