#
whycq
2023-07-06 f84e9c5a28285e213aacb7991971e92621a609b4
pages/home/home.vue
@@ -21,20 +21,29 @@
         return {
            baseUrl: '',
            token: '',
            icon: '',
            elements: [],
            elements2: [{
                  title: '组托入库',
                  name: 'pakin',
                  color: 'cyan',
                  cuIcon: 'pullup',
                  url: '/pakin/pakin'
               },
            elements2: [
               // {
               //    title: '组托入库',
               //    name: 'pakin',
               //    color: 'cyan',
               //    cuIcon: 'pullup',
               //    url: '/pakin/pakin'
               // },
               {
                  title: '订单入库',
                  title: '订单组托',
                  name: 'orderPakin',
                  color: 'blue',
                  cuIcon: 'pullup',
                  url: '/order/orderPakin'
               },
               {
                  title: '组托上架',
                  name: 'putOn',
                  color: 'cyan',
                  cuIcon: 'pullup',
                  url: '/pakin/putOn'
               },
               // {
               //    title: '打印',
@@ -136,11 +145,12 @@
                        if (res.data.length < 0) {
                           break;
                        }
                        that.getIcon(res.data[i].title)
                        that.elements.unshift({
                           title: res.data[i].name,
                           name: res.data[i].title,
                           color: that.colorList[i],
                           cuIcon: 'safe',
                           cuIcon: that.icon,
                           url: res.data[i].action
                        })
                     }
@@ -148,7 +158,8 @@
                        title: '退出登录',
                        name: 'logOut',
                        color: 'grey',
                        cuIcon: 'exit'
                        cuIcon: 'exit',
                        url: '/login/logOut'
                     })
                  } else if (res.code === 403) {
                     uni.showToast({
@@ -162,11 +173,12 @@
                        });
                     }, 1000);
                  } else if(res.status === 404) {
                     uni.showToast({
                        title: '404',
                        icon: "none",
                        position: 'top'
                     })
                     that.elements = that.elements2
                     // uni.showToast({
                     //    title: '默认主页',
                     //    icon: "none",
                     //    position: 'top'
                     // })
                  } else {
                     uni.showToast({
                        title: res.msg,
@@ -180,6 +192,12 @@
               }
            })
         },
         getIcon(e) {
            const ways = ['pakin','orderPakin','orderPutOn']
            if (ways.includes(e)) {
               this.icon = 'pullup'
            }
         }
      }
   }
</script>