From e7508ca6436d1707d115e931fd96cab20fdf5d7b Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期二, 02 七月 2024 09:42:32 +0800 Subject: [PATCH] # --- pages/home/home.vue | 41 +++++++++++++++++++++-------------------- 1 files changed, 21 insertions(+), 20 deletions(-) diff --git a/pages/home/home.vue b/pages/home/home.vue index de1596e..91dea64 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -2,7 +2,7 @@ <view> <scroll-view scroll-y class="page"> <view class="nav-list"> - <navigator hover-class='none' :url="'/pages' + item.url" class="nav-li" navigateTo + <navigator hover-class='none' :url="'/pages' + item.url + '?id=' + item.id" class="nav-li" navigateTo :class="'bg-'+item.color" :style="[{animation: 'show ' + ((index+1)*0.2+1) + 's 1'}]" v-for="(item,index) in elements" :key="index"> <view class="nav-title">{{item.title}}</view> @@ -244,7 +244,7 @@ onShow() { this.baseUrl = uni.getStorageSync('baseUrl'); this.token = uni.getStorageSync('token'); - this.project = uni.getStorageSync('project') + // this.project = uni.getStorageSync('project') this.getAuth() this.backGroundRepeat() }, @@ -264,7 +264,7 @@ let that = this uni.request({ url: that.baseUrl + '/menu/pda/auth', - data: {}, + data: {level:1,id: '0'}, header: { 'token': uni.getStorageSync('token') }, method: 'POST', success(res) { @@ -276,23 +276,15 @@ res = res.data that.elements = [] if (res.code === 200) { - if (res.data == undefined || res.data == null || res.data == "") { - 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: that.icon, - url: `/${that.project}${res.data[i].action}` - }) - } + that.getIcon(res.data[i].title) + that.elements.unshift({ + title: res.data[i].name, + name: res.data[i].title, + color: that.colorList[i], + cuIcon: that.icon, + id: res.data[i].id, + url: `${res.data[i].code}` + }) that.elements.push({ title: '閫�鍑虹櫥褰�', name: 'logOut', @@ -342,6 +334,15 @@ </script> <style> + .nav-list { + padding: 0px 40upx 0px; + } + .nav-li { + padding: 30upx; + border-radius: 12upx; + width: 90%; + margin: 0 2.5% 40upx; + } .page { height: 100vh; } -- Gitblit v1.9.1