Houjie
3 天以前 51c7896fd8e45085dd5cdfff11e79a00ee0a7379
pages/home/home.vue
@@ -11,25 +11,14 @@
            </swiper-item>
         </swiper>
         <!-- 设备维修 -->
         <!-- 工作台 -->
         <view class="cu-bar bg-white solid-bottom" :style="[{animation: 'show 0.5s 1'}]">
            <view class="action">
               <text class='cuIcon-title text-blue'></text>工作台
            </view>
         </view>
         <!--          <view class="cu-list grid col-4 text-sm">
            <view class="cu-item animation-slide-bottom" :style="[{animationDelay: (index + 1)*0.05 + 's'}]" v-for="(item,index) in usList" :key="index" @tap="goPage(item.page)">
               <view class="padding text-center">
                  <image :src="item.icon" style="width:28px;height:28px;">
                     <view class="cu-tag badge margin-top-sm" style="margin-left:1.2em" v-if="getTtemDotInfo(item)">
                        <block v-if="getTtemDotInfo(item)">{{getTtemDotInfo(item)}}</block>
                     </view>
                  </image>
                  <view class="margin-top-xs">{{item.title}}</view>
               </view>
            </view>
         </view> -->
         <view class="cu-list grid col-4 text-sm">
            <view class="cu-item animation-slide-bottom" :style="[{animationDelay: (index + 1)*0.05 + 's'}]"
               v-for="(item, index) in usList" :key="index" @tap="goPage(item.page)">
@@ -43,10 +32,10 @@
            </view>
         </view>
         <!-- 设备保养 -->
         <!-- 设备管理 -->
         <view class="cu-bar bg-white solid-bottom margin-top" :style="[{animation: 'show 0.6s 1'}]">
            <view class="action">
               <text class='cuIcon-title text-yellow'></text>保养
               <text class='cuIcon-title text-yellow'></text>设备管理
            </view>
         </view>
         <view class="cu-list grid col-4 text-sm">
@@ -62,11 +51,32 @@
            </view>
         </view>
         <!-- 生产管理 -->
         <view class="cu-bar bg-white solid-bottom" :style="[{animation: 'show 0.5s 1'}]">
            <view class="action">
               <text class='cuIcon-title text-blue'></text>生产管理
            </view>
         </view>
         <view class="cu-list grid col-4 text-sm">
            <view class="cu-item animation-slide-bottom" :style="[{animationDelay: (index + 1)*0.05 + 's'}]"
               v-for="(item, index) in psList" :key="index" @tap="goPage(item.page)">
               <view class="padding text-center">
                  <image :src="item.icon" style="width:28px;height:28px;">
                     <view class="cu-tag badge margin-top-sm" style="margin-left:1.2em"
                        v-if="getTtemDotInfo(item)"></view>
                  </image>
                  <view class="margin-top-xs">{{ item.title }}</view>
               </view>
            </view>
         </view>
         <!-- 设备维修 -->
         <!-- 质量管理 -->
         <view class="cu-bar bg-white solid-bottom margin-top" :style="[{animation: 'show 0.6s 1'}]">
            <view class="action">
               <text class='cuIcon-title text-blue'></text>维修
               <text class='cuIcon-title text-orange'></text>质量管理
            </view>
         </view>
         <view class="cu-list grid col-4 text-sm">
@@ -82,6 +92,30 @@
            </view>
         </view>
         <!-- 安灯管理 -->
         <view class="cu-bar bg-white solid-bottom margin-top" :style="[{animation: 'show 0.6s 1'}]">
            <view class="action">
               <text class='cuIcon-title text-green'></text>安灯管理
            </view>
         </view>
         <view class="cu-list grid col-4 text-sm">
            <view class="cu-item animation-slide-bottom" :style="[{animationDelay: (index + 1)*0.1 + 's'}]"
               v-for="(item,index) in asList" :key="index" @tap="goPage(item.page)">
               <view class="padding text-center">
                  <image :src="item.icon" style="width:28px;height:28px;">
                     <view class="cu-tag badge margin-top-sm" style="margin-left:1.2em"
                        v-if="getTtemDotInfo(item)"></view>
                  </image>
                  <view class="margin-top-xs">{{item.title}}</view>
               </view>
            </view>
         </view>
      </scroll-view>
      <view class="cu-tabbar-height margin-top"></view>
   </view>
@@ -94,7 +128,9 @@
   import {
      us,
      os,
      ws
      ws,
      ps,
      as
   } from '@/common/util/work.js'
   import socket from '@/common/js-sdk/socket/socket.js'
   export default {
@@ -102,24 +138,15 @@
      props: {
         cur: String,
      },
      // watch: {
      //    cur: {
      //       immediate: true,
      //       handler: function(val, oldVal) {
      //          console.log('cur', val, oldVal)
      //          this.initMenu()
      //       },
      //    },
      // },
      watch: {
        cur: {
          immediate: true,
          handler: function(val, oldVal) {
            console.log('cur', val, oldVal)
            // 即使值没有变化,也主动调用 initMenu
            this.initMenu()
          },
        },
         cur: {
            immediate: true,
            handler: function(val, oldVal) {
               console.log('cur', val, oldVal)
               // 即使值没有变化,也主动调用 initMenu
               this.initMenu()
            },
         },
      },
      data() {
         return {
@@ -147,20 +174,11 @@
                  link: ''
               }
            ],
            middleApps: [{
                  icon: 'line2_icon1.png',
                  title: '审批',
                  'text': '个人审批'
               },
               {
                  icon: 'line2_icon2.png',
                  title: '审批稿',
                  'text': '审批草稿箱'
               },
            ],
            usList: us.data,
            osList: os.data,
            wsList: ws.data,
            psList: ps.data,
            asList: as.data,
            msgCount: 0,
            toDomsgCount: 0,
            unExecRepairOrderCount: 0,