123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- <template >
- <view >
- <u-tabbar
- :class="{
- springclass:spring
- }"
- v-model="myCurrent" :list="tabbarList"
- :inactiveColor="inColor" :bgColor="bgColor"
- :before-switch="beforeSwitch" :activeColor="acColor" :height="spring?('120rpx' ):(elderStatus ? '120rpx' : '110rpx')" :icon-size="elderStatus ? '56rpx' : '40rpx'"></u-tabbar>
-
- </view>
- </template>
- <script>
-
-
- export default {
- name:"tabbarJob",
- props:{
- spring:false,
- current: 0,
- elderStatus: false,
- bgColor: {
- type: String,
- default: '#ffffff'
- },
- inColor: {
- type: String,
- default: '#A8B0AD'
- },
- acColor: {
- type: String,
- default: '#009143'
- },
- },
- data() {
- return {
- activeColor:"#5098FF",
- oldindex:this.current,
- myCurrent:this.current,
- tabbarList: [{
- iconPath: "home-3-line",
- selectedIconPath: "home-3-fill",
- text: '主页 ',
-
- count: 0,
- isDot: true,
- customIcon: true,
- pagePath2:"/pages/index/index",
- },
- {
- // iconPath: img4,
- // selectedIconPath: img3,
- iconPath: "gift",
- selectedIconPath: "gift-fill",
-
- text: '活动',
- midButton: true,
- //customIcon: true,
- pagePath2:"/pages/index/activity",
- },
- {
- iconPath: "road-map-line",
- selectedIconPath: "road-map-fill",
- text: '找桩',
- midButton: true,
- customIcon: true,
- pagePath2:"/pages/searchPile/searchPile",
- },
- {
- iconPath: "user-5-line",
- selectedIconPath: "user-5-fill",
- text: '我的',
- count: 0,
- isDot: false,
- customIcon: true,
- pagePath2:"/pages/user/index",
- }
- ],
- };
-
- },methods:{
- setcount(c){
- this.myCurrent=c
- },
- beforeSwitch(index){
-
-
- if(index==this.current){
- return false
- }
- var url =this.tabbarList[index].pagePath2;
-
- uni.navigateTo({
- url: url
- })
- if(index==1){
- this.myCurrent=this.oldindex;
- return false;
- }else{
- return true;
- }
-
- },
-
- },mounted(){
- console.log("mountedmountedmountedmountedmounted")
- if(this.spring){
- var img1=require('@/assets/img/spring/2025/index2.png')
- var img2=require('@/assets/img/spring/2025/index3.png')
-
- var img3=require('@/assets/img/spring/2025/index4.png')
- var img4=require('@/assets/img/spring/2025/index5.png')
-
- this.tabbarList[0].iconPath=img1
- this.tabbarList[0].selectedIconPath=img1
- this.tabbarList[1].iconPath=img2
- this.tabbarList[1].selectedIconPath=img2
- this.tabbarList[2].iconPath=img3
- this.tabbarList[2].selectedIconPath=img3
- this.tabbarList[3].iconPath=img4
- this.tabbarList[3].selectedIconPath=img4
- this.acColor="red"
-
-
-
- }
- },destroyed(){
-
- }
-
-
- }
- </script>
- <style>
-
- </style>
|