From 2ed26ba452af2ce55631c353d1fec701b03a59d5 Mon Sep 17 00:00:00 2001 From: liujiangyong Date: Mon, 25 Jul 2022 13:28:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weapp/src/packages/patrol/index.jsx | 2 +- weapp/src/packages/patrol/index.scss | 10 +++++----- weapp/src/packages/patrolView/index.jsx | 14 +------------- weapp/src/pages/home/index.jsx | 8 +++++--- 4 files changed, 12 insertions(+), 22 deletions(-) diff --git a/weapp/src/packages/patrol/index.jsx b/weapp/src/packages/patrol/index.jsx index fa27ad47..36390b54 100644 --- a/weapp/src/packages/patrol/index.jsx +++ b/weapp/src/packages/patrol/index.jsx @@ -81,7 +81,7 @@ const Index = () => { }, [images]) return ( - + 上报类型 diff --git a/weapp/src/packages/patrol/index.scss b/weapp/src/packages/patrol/index.scss index b7338b0f..83057e4b 100644 --- a/weapp/src/packages/patrol/index.scss +++ b/weapp/src/packages/patrol/index.scss @@ -1,13 +1,12 @@ -.patrol { - height: 100vh; +page { + height: 100%; width: 100vw; background-color: #f6f6f6; - padding-top: 20px; .report-type { height: 96px; background-color: #fff; - margin-bottom: 20px; + margin: 20px auto; display: flex; justify-content: space-between; align-items: center; @@ -53,6 +52,7 @@ .horizontal-line { height: 30px; width: 100%; + border-radius: 5px; display: flex; justify-content: left; align-items: center; @@ -111,6 +111,6 @@ .sub-btn { width: 70%; - margin-top: 100px; + margin: 80px auto; } } \ No newline at end of file diff --git a/weapp/src/packages/patrolView/index.jsx b/weapp/src/packages/patrolView/index.jsx index db072309..04792eea 100644 --- a/weapp/src/packages/patrolView/index.jsx +++ b/weapp/src/packages/patrolView/index.jsx @@ -26,18 +26,6 @@ function Index() { const userInfo = Taro.getStorageSync('userInfo') || {}; - const data = [ - { - place: { - name: '飞尚' - }, - user: { - name: '用户1' - }, - time: '2022-7-1' - } - ] - function dealError(error) { Taro.showToast({ title: error, @@ -47,7 +35,7 @@ function Index() { throw new Error(error); } useEffect(() => { - request.get(getReportList(), {}, { hideErrorToast: true, hideLoading: true }).then(res => { + request.get(getReportList(),{}, { hideErrorToast: true, hideLoading: true }).then(res => { if (res.statusCode == 200) { console.log(res); setListData(res.data) diff --git a/weapp/src/pages/home/index.jsx b/weapp/src/pages/home/index.jsx index 95fa024b..ca1d68ca 100644 --- a/weapp/src/pages/home/index.jsx +++ b/weapp/src/pages/home/index.jsx @@ -4,8 +4,9 @@ import { View } from '@tarojs/components'; import { useIndustry } from '@/actions/business'; import './index.scss'; - const Index = () => { + const userInfo = Taro.getStorageSync('userInfo') || {}; + const isSuperAdmin = userInfo && userInfo.username === 'SuperAdmin' ? true : false function toPatrol() { Taro.navigateTo({ @@ -22,8 +23,9 @@ const Index = () => { 巡 查 养 护 - {/* 填报 */} - 查看 + + {isSuperAdmin ? '查看' : '填报'} + );