Browse Source

细节优化

release_0.0.1
liujiangyong 3 years ago
parent
commit
2ed26ba452
  1. 2
      weapp/src/packages/patrol/index.jsx
  2. 10
      weapp/src/packages/patrol/index.scss
  3. 14
      weapp/src/packages/patrolView/index.jsx
  4. 8
      weapp/src/pages/home/index.jsx

2
weapp/src/packages/patrol/index.jsx

@ -81,7 +81,7 @@ const Index = () => {
}, [images]) }, [images])
return ( return (
<View className='patrol'> <View>
<View className='report-type'> <View className='report-type'>
<View className='text'>上报类型</View> <View className='text'>上报类型</View>
<RadioGroup onChange={onTypeChange}> <RadioGroup onChange={onTypeChange}>

10
weapp/src/packages/patrol/index.scss

@ -1,13 +1,12 @@
.patrol { page {
height: 100vh; height: 100%;
width: 100vw; width: 100vw;
background-color: #f6f6f6; background-color: #f6f6f6;
padding-top: 20px;
.report-type { .report-type {
height: 96px; height: 96px;
background-color: #fff; background-color: #fff;
margin-bottom: 20px; margin: 20px auto;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
@ -53,6 +52,7 @@
.horizontal-line { .horizontal-line {
height: 30px; height: 30px;
width: 100%; width: 100%;
border-radius: 5px;
display: flex; display: flex;
justify-content: left; justify-content: left;
align-items: center; align-items: center;
@ -111,6 +111,6 @@
.sub-btn { .sub-btn {
width: 70%; width: 70%;
margin-top: 100px; margin: 80px auto;
} }
} }

14
weapp/src/packages/patrolView/index.jsx

@ -26,18 +26,6 @@ function Index() {
const userInfo = Taro.getStorageSync('userInfo') || {}; const userInfo = Taro.getStorageSync('userInfo') || {};
const data = [
{
place: {
name: '飞尚'
},
user: {
name: '用户1'
},
time: '2022-7-1'
}
]
function dealError(error) { function dealError(error) {
Taro.showToast({ Taro.showToast({
title: error, title: error,
@ -47,7 +35,7 @@ function Index() {
throw new Error(error); throw new Error(error);
} }
useEffect(() => { useEffect(() => {
request.get(getReportList(), {}, { hideErrorToast: true, hideLoading: true }).then(res => { request.get(getReportList(),{}, { hideErrorToast: true, hideLoading: true }).then(res => {
if (res.statusCode == 200) { if (res.statusCode == 200) {
console.log(res); console.log(res);
setListData(res.data) setListData(res.data)

8
weapp/src/pages/home/index.jsx

@ -4,8 +4,9 @@ import { View } from '@tarojs/components';
import { useIndustry } from '@/actions/business'; import { useIndustry } from '@/actions/business';
import './index.scss'; import './index.scss';
const Index = () => { const Index = () => {
const userInfo = Taro.getStorageSync('userInfo') || {};
const isSuperAdmin = userInfo && userInfo.username === 'SuperAdmin' ? true : false
function toPatrol() { function toPatrol() {
Taro.navigateTo({ Taro.navigateTo({
@ -22,8 +23,9 @@ const Index = () => {
<View className='page'> <View className='page'>
<View className='fill'> <View className='fill'>
<View className='title'> </View> <View className='title'> </View>
{/* <View className='btn' onClick={toPatrol}>填报</View> */} <View className='btn' onClick={isSuperAdmin ? toPatrolView : toPatrol}>
<View className='btn' onClick={toPatrolView}>查看</View> {isSuperAdmin ? '查看' : '填报'}
</View>
</View> </View>
</View> </View>
); );

Loading…
Cancel
Save