修复:已知问题
This commit is contained in:
2
.idea/AugmentWebviewStateStore.xml
generated
2
.idea/AugmentWebviewStateStore.xml
generated
File diff suppressed because one or more lines are too long
@@ -39,5 +39,6 @@ export interface HjmViolation {
|
|||||||
*/
|
*/
|
||||||
export interface HjmViolationParam extends PageParam {
|
export interface HjmViolationParam extends PageParam {
|
||||||
id?: number;
|
id?: number;
|
||||||
|
code?: string;
|
||||||
keywords?: string;
|
keywords?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ export default defineAppConfig({
|
|||||||
"bx/bx-add",
|
"bx/bx-add",
|
||||||
"violation/add",
|
"violation/add",
|
||||||
"violation/list",
|
"violation/list",
|
||||||
|
"violation/detail",
|
||||||
"trajectory/trajectory",
|
"trajectory/trajectory",
|
||||||
"gps-log/gps-log"
|
"gps-log/gps-log"
|
||||||
// "bx/bx-list",
|
// "bx/bx-list",
|
||||||
|
|||||||
3
src/hjm/violation/detail.config.ts
Normal file
3
src/hjm/violation/detail.config.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '违章记录'
|
||||||
|
})
|
||||||
78
src/hjm/violation/detail.tsx
Normal file
78
src/hjm/violation/detail.tsx
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
import {useEffect, useState} from "react";
|
||||||
|
import Taro from '@tarojs/taro'
|
||||||
|
import {useRouter} from '@tarojs/taro'
|
||||||
|
import {
|
||||||
|
Cell
|
||||||
|
} from '@nutui/nutui-react-taro'
|
||||||
|
import {listHjmViolation} from "@/api/hjm/hjmViolation";
|
||||||
|
import {HjmViolation} from "@/api/hjm/hjmViolation/model";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加违章记录页面
|
||||||
|
*/
|
||||||
|
function Detail() {
|
||||||
|
const {params} = useRouter();
|
||||||
|
const [violation, setViolation] = useState<HjmViolation>({})
|
||||||
|
|
||||||
|
// 初始化页面数据
|
||||||
|
const initPageData = async () => {
|
||||||
|
try {
|
||||||
|
listHjmViolation({
|
||||||
|
code: params.id
|
||||||
|
}).then(data => {
|
||||||
|
console.log(data[0],'00[]000')
|
||||||
|
data.length > 0 && setViolation(data[0])
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
console.error('初始化失败:', error)
|
||||||
|
Taro.showToast({
|
||||||
|
title: '初始化失败',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
initPageData().then(r => {
|
||||||
|
console.log(r, 'rr')
|
||||||
|
})
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div style={{
|
||||||
|
backgroundColor: '#f5f5f5',
|
||||||
|
minHeight: '100vh',
|
||||||
|
paddingBottom: '80px'
|
||||||
|
}}>
|
||||||
|
|
||||||
|
{/* 违章信息表单 */}
|
||||||
|
<div style={{
|
||||||
|
backgroundColor: '#fff',
|
||||||
|
margin: '16px 16px 16px',
|
||||||
|
borderRadius: '12px',
|
||||||
|
overflow: 'hidden'
|
||||||
|
}}>
|
||||||
|
<Cell.Group>
|
||||||
|
<Cell title="车辆编号" style={{padding: '12px 16px'}}>
|
||||||
|
车辆编号:{violation.code}
|
||||||
|
</Cell>
|
||||||
|
<Cell title="违章标题" style={{padding: '12px 16px'}}>
|
||||||
|
车辆编号:{violation.title}
|
||||||
|
</Cell>
|
||||||
|
<Cell title="违章描述" style={{padding: '12px 16px'}}>
|
||||||
|
违章描述:{violation.comments}
|
||||||
|
</Cell>
|
||||||
|
<Cell title="处罚金额" style={{padding: '12px 16px'}}>
|
||||||
|
违章金额:{violation.money}
|
||||||
|
</Cell>
|
||||||
|
<Cell title="扣分" style={{padding: '12px 16px'}}>
|
||||||
|
扣分情况:{violation.score}
|
||||||
|
</Cell>
|
||||||
|
</Cell.Group>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Detail
|
||||||
@@ -157,6 +157,11 @@ const List: React.FC = () => {
|
|||||||
boxShadow: '0 2px 8px rgba(0,0,0,0.06)',
|
boxShadow: '0 2px 8px rgba(0,0,0,0.06)',
|
||||||
border: '1px solid #f0f0f0'
|
border: '1px solid #f0f0f0'
|
||||||
}}
|
}}
|
||||||
|
onClick={() => {
|
||||||
|
Taro.navigateTo({
|
||||||
|
url: `/hjm/violation/detail?id=${item.code}`
|
||||||
|
})
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<div style={{
|
<div style={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
@@ -241,18 +246,23 @@ const List: React.FC = () => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={{
|
{
|
||||||
position: 'fixed',
|
Taro.getStorageSync('RoleCode') == 'jiaojing' && (
|
||||||
bottom: '20px',
|
<div
|
||||||
right: '20px',
|
style={{
|
||||||
zIndex: 30,
|
position: 'fixed',
|
||||||
padding: '8px',
|
bottom: '20px',
|
||||||
borderRadius: '20px',
|
right: '20px',
|
||||||
overflow: "hidden",
|
zIndex: 30,
|
||||||
backgroundColor: '#ff0000',
|
padding: '8px',
|
||||||
}}>
|
borderRadius: '20px',
|
||||||
<AddCircle size={28} color={'#ffffff'} onClick={onAddInsurance} />
|
overflow: "hidden",
|
||||||
</div>
|
backgroundColor: '#ff0000',
|
||||||
|
}}>
|
||||||
|
<AddCircle size={28} color={'#ffffff'} onClick={onAddInsurance} />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,10 +40,10 @@ const ExpirationTime = () => {
|
|||||||
if(data.certification){
|
if(data.certification){
|
||||||
setIsAdmin( true)
|
setIsAdmin( true)
|
||||||
}
|
}
|
||||||
if(Taro.getStorageSync('certification') == 'jj'){
|
if(Taro.getStorageSync('Certification') == 'jj'){
|
||||||
setIsAdmin(true)
|
setIsAdmin(true)
|
||||||
}
|
}
|
||||||
if(Taro.getStorageSync('certification') == 'yz'){
|
if(Taro.getStorageSync('Certification') == 'yz'){
|
||||||
setIsAdmin(true)
|
setIsAdmin(true)
|
||||||
}
|
}
|
||||||
if(Taro.getStorageSync('RoleCode') == 'Installer'){
|
if(Taro.getStorageSync('RoleCode') == 'Installer'){
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ const Header = (props: any) => {
|
|||||||
setRoleName('交警')
|
setRoleName('交警')
|
||||||
Taro.setStorageSync('RoleName', '交警')
|
Taro.setStorageSync('RoleName', '交警')
|
||||||
Taro.setStorageSync('RoleCode', 'jiaojing')
|
Taro.setStorageSync('RoleCode', 'jiaojing')
|
||||||
Taro.setStorageSync('certification', 'jj')
|
Taro.setStorageSync('Certification', 'jj')
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// 邮政协会/管局
|
// 邮政协会/管局
|
||||||
@@ -80,7 +80,7 @@ const Header = (props: any) => {
|
|||||||
setRoleName('邮政协会/管局')
|
setRoleName('邮政协会/管局')
|
||||||
Taro.setStorageSync('RoleName', '邮政协会/管局')
|
Taro.setStorageSync('RoleName', '邮政协会/管局')
|
||||||
Taro.setStorageSync('RoleCode', 'youzheng')
|
Taro.setStorageSync('RoleCode', 'youzheng')
|
||||||
Taro.setStorageSync('certification', 'yz')
|
Taro.setStorageSync('Certification', 'yz')
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// 快递公司
|
// 快递公司
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ function Home() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 已认证用户
|
// 已认证用户
|
||||||
if (Taro.getStorageSync('certification')) {
|
if (Taro.getStorageSync('Certification')) {
|
||||||
setIsAdmin(true)
|
setIsAdmin(true)
|
||||||
setScale(11)
|
setScale(11)
|
||||||
// pageHjmCarByMap(res.latitude, res.longitude)
|
// pageHjmCarByMap(res.latitude, res.longitude)
|
||||||
@@ -149,6 +149,10 @@ function Home() {
|
|||||||
// 搜索条件
|
// 搜索条件
|
||||||
const where = {}
|
const where = {}
|
||||||
|
|
||||||
|
// 交警和邮管不能在小程序主界面地图上看到任何一个车辆的定位
|
||||||
|
if(Taro.getStorageSync('RoleCode') == 'jiaojing' || Taro.getStorageSync('RoleCode') == 'youzheng'){
|
||||||
|
return false
|
||||||
|
}
|
||||||
if (latitude) {
|
if (latitude) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
where.latitude = latitude
|
where.latitude = latitude
|
||||||
@@ -207,6 +211,7 @@ function Home() {
|
|||||||
if (!Taro.getStorageSync('access_token')) {
|
if (!Taro.getStorageSync('access_token')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
pageHjmCarByMap(latitude, longitude)
|
pageHjmCarByMap(latitude, longitude)
|
||||||
if (!isAdmin) {
|
if (!isAdmin) {
|
||||||
return false;
|
return false;
|
||||||
@@ -293,7 +298,7 @@ function Home() {
|
|||||||
setIsAdmin(true)
|
setIsAdmin(true)
|
||||||
}
|
}
|
||||||
// 是否交警
|
// 是否交警
|
||||||
if (Taro.getStorageSync('certification') == 'jj') {
|
if (Taro.getStorageSync('Certification') == 'jj') {
|
||||||
console.log('交警', '12312')
|
console.log('交警', '12312')
|
||||||
setIsAdmin(true)
|
setIsAdmin(true)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,6 +135,27 @@ const UserCell = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
roleName === 'youzheng' && (
|
||||||
|
<Cell.Group divider={true}>
|
||||||
|
<Cell
|
||||||
|
className="nutui-cell-clickable"
|
||||||
|
title={
|
||||||
|
<div style={{display: 'inline-flex', alignItems: 'center'}}>
|
||||||
|
<Truck size={16}/>
|
||||||
|
<span className={'pl-3 text-sm'}>违章记录</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
align="center"
|
||||||
|
extra={<ArrowRight color="#cccccc" size={18}/>}
|
||||||
|
onClick={() => {
|
||||||
|
navTo('/hjm/violation/list', true)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Cell.Group>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
{/*<Cell.Group divider={true} description={*/}
|
{/*<Cell.Group divider={true} description={*/}
|
||||||
{/* <div style={{display: 'inline-flex', alignItems: 'center'}}>*/}
|
{/* <div style={{display: 'inline-flex', alignItems: 'center'}}>*/}
|
||||||
{/* <span style={{marginTop: '12px'}}>管理</span>*/}
|
{/* <span style={{marginTop: '12px'}}>管理</span>*/}
|
||||||
|
|||||||
Reference in New Issue
Block a user