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])
return (
<View className='patrol'>
<View>
<View className='report-type'>
<View className='text'>上报类型</View>
<RadioGroup onChange={onTypeChange}>

10
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;
}
}

14
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)

8
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 = () => {
<View className='page'>
<View className='fill'>
<View className='title'> </View>
{/* <View className='btn' onClick={toPatrol}>填报</View> */}
<View className='btn' onClick={toPatrolView}>查看</View>
<View className='btn' onClick={isSuperAdmin ? toPatrolView : toPatrol}>
{isSuperAdmin ? '查看' : '填报'}
</View>
</View>
</View>
);

Loading…
Cancel
Save