From 19d3b7e685ae91921aff312b50cabf137cde28bf Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期四, 30 五月 2024 09:24:55 +0800 Subject: [PATCH] # --- pages/home/home.vue | 151 +++++++++++++++++++++++++++----------------------- 1 files changed, 81 insertions(+), 70 deletions(-) diff --git a/pages/home/home.vue b/pages/home/home.vue index 8640219..8ef4dd5 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -21,84 +21,86 @@ return { baseUrl: '', token: '', + icon: '', elements: [], - elements2: [{ + elements2: [ + { title: '缁勬墭鍏ュ簱', name: 'pakin', color: 'cyan', cuIcon: 'pullup', url: '/pakin/pakin' - }, + }, { - title: '璁㈠崟鍏ュ簱', - name: 'orderPakin', - color: 'blue', + title: '骞冲簱缁勬墭', + name: 'putOn', + color: 'orange', cuIcon: 'pullup', - url: '/order/orderPakin' + url: '/pakin/putOn' }, - // { - // title: '鎵撳嵃', - // name: 'print', - // color: 'purple', - // cuIcon: 'text', - // url: '/print/print' - // }, { - title: '璁㈠崟涓婃灦', + title: '骞冲簱涓婃灦', + name: 'print', + color: 'purple', + cuIcon: 'text', + url: '/print/print' + }, + { + title: '骞冲簱涓嬫灦', name: 'orderPutOn', - color: 'mauve', + color: 'yellow', cuIcon: 'pullup', url: '/order/orderPutOn' }, { - title: '璁㈠崟涓嬫灦', - name: 'orderPutDown', - color: 'pink', - cuIcon: 'pulldown', - url: '/order/orderPutDown' - }, - { - title: '搴撳瓨鏌ヨ', - name: 'stockQuery', - color: 'brown', - cuIcon: 'check', - url: '/stock/stockQuery' - }, - { - title: '鐩樼偣', - name: 'stockCheck', - color: 'red', - cuIcon: 'post', - url: '/stock/stockCheck' - }, - { - title: '鍟嗗搧鎵撳嵃', - name: 'matList', - color: 'orange', - cuIcon: 'post', - url: '/mat/matList' - }, - { - title: '琛ヨ揣', - name: 'restock', - color: 'yellow', - cuIcon: 'punch', - url: '/stock/restock' - }, - { - title: '杞叏鏉�', - name: 'piking', + title: '璁㈠崟缁勬墭', + name: 'orderComb', color: 'olive', - cuIcon: 'order', - url: '/pakin/piking' + cuIcon: 'pulldown', + url: '/order/orderComb' }, - { - title: '鎹㈡澘缁戝畾', - name: 'changePallet', - color: 'green', - cuIcon: 'order', - url: '/stock/changePallet' - }, + // { + // title: '搴撳瓨鏌ヨ', + // name: 'stockQuery', + // color: 'green', + // cuIcon: 'check', + // url: '/stock/stockQuery' + // }, + // { + // title: '鐩樼偣', + // name: 'stockCheck', + // color: 'red', + // cuIcon: 'post', + // url: '/stock/stockCheck' + // }, + // { + // title: '鍟嗗搧鎵撳嵃', + // name: 'matList', + // color: 'orange', + // cuIcon: 'post', + // url: '/mat/matList' + // }, + // { + // title: '琛ヨ揣', + // name: 'restock', + // color: 'yellow', + // cuIcon: 'punch', + // url: '/stock/restock' + // }, + // { + // title: '杞叏鏉�', + // name: 'piking', + // color: 'olive', + // cuIcon: 'order', + // url: '/pakin/piking' + // }, + // { + // title: '鎹㈡澘缁戝畾', + // name: 'changePallet', + // color: 'green', + // cuIcon: 'order', + // url: '/stock/changePallet' + // }, { title: '閫�鍑虹櫥褰�', name: 'logOut', @@ -120,7 +122,7 @@ getAuth() { let that = this uni.request({ - url: that.baseUrl + '/menu/pda/auth', + url: that.baseUrl + '/mobile/menu/pda/auth', data: {}, header: { 'token': uni.getStorageSync('token') }, method: 'POST', @@ -129,18 +131,19 @@ that.elements = [] if (res.code === 200) { if (res.data == undefined || res.data == null || res.data == "") { - that.elements = that.elements2 + that.elements = that.elements2 return } for (var i = 0; i < res.data.length; i++) { 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 +151,8 @@ title: '閫�鍑虹櫥褰�', name: 'logOut', color: 'grey', - cuIcon: 'exit' + cuIcon: 'exit', + url: '/login/logOut' }) } else if (res.code === 403) { uni.showToast({ @@ -162,11 +166,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 +185,12 @@ } }) }, + getIcon(e) { + const ways = ['pakin','orderPakin','orderPutOn'] + if (ways.includes(e)) { + this.icon = 'pullup' + } + } } } </script> -- Gitblit v1.9.1