xuxy
2024-06-25 d1bb68d9f9054bbf87cd84956d3240c71d8e370c
components/footer/farmer-footer.vue
@@ -1,49 +1,52 @@
<template>
   <view class="footer flex">
      <view v-for="(item,index) in tabBar" :key="index" class="footer-item">
         <view class="item flex" :class="[flg==index?'cur':'']" @click="go(index,item)">
               <view v-if="index==0">
                  <image src="../../static/imgs/footer/footer-home-1.png"  class="footer-icon" :class="(''+index)"  v-if="flg==0"></image>
                  <image src="../../static/imgs/footer/footer-home-0.png"  class="footer-icon" :class="(''+index)"  v-if="flg!=0"></image>
               </view>
               <view v-if="index==1">
                  <image src="../../static/imgs/footer/footer-self-1.png"  class="footer-icon" :class="(''+index)"   v-if="flg==2"></image>
                  <image src="../../static/imgs/footer/footer-self-0.png"  class="footer-icon"  :class="(''+index)"  v-if="flg!=2"></image>
               </view>
               <view>
                  {{item.text}}
               </view>
   <view class="footer flex farmer-footer">
      <view v-for="(item,index) in tabBar" :key="index" class="footer-item"  :class="[flg==index?'cur':'']">
         <view class="item flex" @click="go(index,item)">
            <view v-if="index==0">
               <image src="../../static/imgs/footer/footer-home-1.png" class="footer-icon m-t-4 m-l-a m-r-0" :class="(''+index)"
                  v-if="flg==0"></image>
               <image src="../../static/imgs/footer/footer-home-0.png" class="footer-icon m-t-4 m-l-a m-r-0" :class="(''+index)"
                  v-if="flg!=0"></image>
            </view>
            <view v-if="index==1">
               <image src="../../static/imgs/footer/footer-self-1.png" class="footer-icon m-t-4 m-l-a m-r-0" :class="(''+index)"
                  v-if="flg==2"></image>
               <image src="../../static/imgs/footer/footer-self-0.png" class="footer-icon m-t-4 m-l-a m-r-0" :class="(''+index)"
                  v-if="flg!=2"></image>
            </view>
            <view class="m-l-0 m-r-a">
               {{item.text}}
            </view>
         </view>
      </view>
   </view>
</template>
<script>
   export default {
      data() {
         return {
            tabBar: [
               {
                  "pagePath": "/pages/home/shop-home",
                  "pagePath": "/pages/home/farmer-home",
                  "iconPath": "/static/tabbar/home.png",
                  "selectedIconPath": "/static/tabbar/home_s.png",
                  "text": "工作台"
               },
               {
                  "pagePath": "/pages/user/shop-user",
                  "pagePath": "/pages/user/farmer-user",
                  "iconPath": "/static/tabbar/my.png",
                  "selectedIconPath": "/static/tabbar/my_s.png",
                  "text": "我的"
               }
            ],
            value:''
            value: ''
         }
      },
      props: {
@@ -62,9 +65,6 @@
      },
      methods: {
         go(index, item) {
            if (index == 1) {
               return
            }
            if (this.flg == ('' + index)) {
               return
            }
@@ -73,10 +73,10 @@
            });
         },
      }
   }
</script>
<style lang="scss">
   @import "./main.scss";
</style>
</style>