From b22000f1e0034376f408d236f4425e1dc98e51d8 Mon Sep 17 00:00:00 2001 From: yhj <1836460075@qq.com> Date: 星期三, 05 六月 2024 13:58:28 +0800 Subject: [PATCH] 查看图号 --- pages/index/index.vue | 147 +++++++++++++++++++++++++------------------------ 1 files changed, 75 insertions(+), 72 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index 279764d..70d771e 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,93 +1,96 @@ <template> - <u-grid :col="3" @click="gotoPage" border> - <u-grid-item v-for="item in grid" :index="item[0]"> - <u-icon name="photo" :size="46"></u-icon> - <view class="grid-text">{{item[0]}}</view> - </u-grid-item> - </u-grid> + <view> + <u-grid :col="3" @click="gotoPage" border> + <u-grid-item v-for="item in grid" :index="item[0]" class="grid-box"> + <u-icon name="play-right-fill" :size="46" color="#FF8000"></u-icon> + <view class="grid-text">{{item.name}}</view> + </u-grid-item> + </u-grid> + <u-toast ref="uToast" /> + </view> + </template> <script> + import { + queryPurview + } from '../../api' + import grid from '../../uni_modules/uview-ui/libs/config/props/grid' export default { data() { return { - grid: [ - [ - "宸℃棣栨", "touliao" - ], - [ - "閲囪喘鍏ュ簱", "touliao" - ], - [ - "鐢熶骇閫�鏂�", "touliao" - ], - [ - "鍏跺畠鍏ュ簱", "touliao" - ], - [ - "鐢熶骇鍏ュ簱", "touliao" - ], - [ - "閲囪喘閫�璐�", "touliao" - ], - [ - "鍏跺畠鍑哄簱", "touliao" - ], - [ - "璋冩嫈鍑哄簱", "touliao" - ], - [ - "璋冩嫈鍏ュ簱", "touliao" - ], - [ - "鐢熶骇鎶ュ伐", "touliao" - ], - [ - "鎵撳嵃璁剧疆", "touliao" - ], - [ - "鐢熶骇澶囨枡", "touliao" - ] - - ], - title: 'Hello' + grid: [], + filter: [ + { + name: '宸℃妫�楠�', + src: '/pages/inspection/inspectionList', + icon:'' + }, + { + name: '棣栨妫�楠�', + src: '/pages/inspection/firstInspectionList', + icon:'' + }, + { + name :'鏈哄彴鎶ュ伐', + src:'/pages/work_reporting/work_reporting', + icon:'' + }, + { + name :'璁惧鐐规璁″垝', + src:'/pages/eqSpotCheck/eqSpotCheckList', + icon:'' + }, + ] } }, onLoad() { - + queryPurview().then(res => { + if (!res.result) { + this.$refs.uToast.show({ + message: res.msg, + type: 'error' + }) + return + } + // 鏄剧ず闇�瑕佽浠g悊鐨� + for (let item of this.filter) { + if (res.data.find(t => t[0] == item.name)) { + this.grid.push(item) + } + } + console.log(this.grid); + }) }, methods: { gotoPage(e) { - console.log(this.grid[e]) + // console.log(this.grid[e]) + // let name = this.grid[e][0] + // // 鍒ゆ柇璇ラ〉闈㈡槸鍚﹀簲璇ヨ浠g悊 + // let item = this.filter.find(t => { + // if (t.name == name) { + // return t; + // } + // }) + // if (typeof(item) == 'undefined') { + // uni.navigateTo({ + // url: '/pages/main/main?name=' + name + // }) + // return + // } + uni.navigateTo({ + url: this.grid[e].src + }) } } } </script> <style> - .content { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - } - - .logo { - height: 200rpx; - width: 200rpx; - margin-top: 200rpx; - margin-left: auto; - margin-right: auto; - margin-bottom: 50rpx; - } - - .text-area { - display: flex; - justify-content: center; - } - - .title { - font-size: 36rpx; - color: #8f8f94; + .grid-box{ + border-bottom: 1upx solid #dadbde; + border-right: 1upx solid #dadbde; + background-color: #f1f2f4; + height: 100upx; } </style> \ No newline at end of file -- Gitblit v1.9.3