yangan
2025-02-27 ea7457be6870e35cd385e163ca9bba26d7621d66
pages/tabbar-page/myPage-tabbar/myPage-tabbar.vue
@@ -8,7 +8,10 @@
         ref="driverMyRef"></driver-my-page>
      <unload-mypage ref="UnloadMypageRef"
         v-if="roleType == 5"></unload-mypage>
      <tab-bar :current="roleType==5?1:2"></tab-bar>
         <sampling-myPage ref="samplingRef"
         v-if="roleType == 6"></sampling-myPage>
         <entranceGuardMypage ref='entranceGuardRef' v-if="roleType == 7"/>
      <tab-bar :current="(roleType==5 || roleType == 6 || roleType == 7)?1:2"></tab-bar>
   </view>
</template>
@@ -16,16 +19,35 @@
   import customerMyPage from '@/pages/customer-page/customer-my/customer-my.vue';
   import driverMyPage from '@/pages/driver-page/drvier-my/drvier-my.vue';
   import freightForwarderMyPage from '@/pages/freight-forwarder-page/freightForwarder-my/freightForwarder-my.vue';
   import UnloadMypage from '@/pages/loadUnload-page/my-page/my-page.vue'
   import UnloadMypage from '@/pages/loadUnload-page/my-page/my-page.vue';
   import samplingMyPage from '@/pages/sampling-page/sampling-my.vue';
   import entranceGuardMypage from '@/pages/entranceGuard/entranceGuard'
   export default {
      components: {
         customerMyPage,
         driverMyPage,
         freightForwarderMyPage,
         UnloadMypage
         UnloadMypage,
         samplingMyPage,
         entranceGuardMypage
      },
      onLoad() {
         this.init();
      },
      onShow() {
         uni.$on('needRefresh', () => {
            this.init();
         })
      },
      onHide() {
         uni.$off('needRefresh', () => {
         })
      },
      onUnload() {
         uni.$off('needRefresh', () => {
         })
      },
      data() {
         return {};
@@ -39,6 +61,12 @@
         if (this.roleType === 3) {
            this.$nextTick(() => {
               this.$refs.driverMyRef.init();
               uni.stopPullDownRefresh()
            })
         }
         if (this.roleType === 1) {
            this.$nextTick(() => {
               this.$refs.customerMyPageRef.init();
               uni.stopPullDownRefresh()
            })
         }
@@ -58,6 +86,15 @@
               case 5:
                  this.$refs.UnloadMypageRef.init();
                  break;
                  case 6:
                     this.$nextTick(()=>{
                        this.$refs.samplingRef.init();
                     })
                     case 7:
                     this.$nextTick(()=>{
                        this.$refs.entranceGuardRef.init();
                     })
                  break;
               default:
                  break;
            }