修复:已知问题

This commit is contained in:
2025-06-26 17:01:05 +08:00
parent bd676b3147
commit ed80e2db40
10 changed files with 138 additions and 19 deletions

File diff suppressed because one or more lines are too long

View File

@@ -39,5 +39,6 @@ export interface HjmViolation {
*/
export interface HjmViolationParam extends PageParam {
id?: number;
code?: string;
keywords?: string;
}

View File

@@ -52,6 +52,7 @@ export default defineAppConfig({
"bx/bx-add",
"violation/add",
"violation/list",
"violation/detail",
"trajectory/trajectory",
"gps-log/gps-log"
// "bx/bx-list",

View File

@@ -0,0 +1,3 @@
export default definePageConfig({
navigationBarTitleText: '违章记录'
})

View 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

View File

@@ -157,6 +157,11 @@ const List: React.FC = () => {
boxShadow: '0 2px 8px rgba(0,0,0,0.06)',
border: '1px solid #f0f0f0'
}}
onClick={() => {
Taro.navigateTo({
url: `/hjm/violation/detail?id=${item.code}`
})
}}
>
<div style={{
display: 'flex',
@@ -241,7 +246,10 @@ const List: React.FC = () => {
)}
</div>
<div style={{
{
Taro.getStorageSync('RoleCode') == 'jiaojing' && (
<div
style={{
position: 'fixed',
bottom: '20px',
right: '20px',
@@ -253,6 +261,8 @@ const List: React.FC = () => {
}}>
<AddCircle size={28} color={'#ffffff'} onClick={onAddInsurance} />
</div>
)
}
</>
)
}

View File

@@ -40,10 +40,10 @@ const ExpirationTime = () => {
if(data.certification){
setIsAdmin( true)
}
if(Taro.getStorageSync('certification') == 'jj'){
if(Taro.getStorageSync('Certification') == 'jj'){
setIsAdmin(true)
}
if(Taro.getStorageSync('certification') == 'yz'){
if(Taro.getStorageSync('Certification') == 'yz'){
setIsAdmin(true)
}
if(Taro.getStorageSync('RoleCode') == 'Installer'){

View File

@@ -71,7 +71,7 @@ const Header = (props: any) => {
setRoleName('交警')
Taro.setStorageSync('RoleName', '交警')
Taro.setStorageSync('RoleCode', 'jiaojing')
Taro.setStorageSync('certification', 'jj')
Taro.setStorageSync('Certification', 'jj')
return false;
}
// 邮政协会/管局
@@ -80,7 +80,7 @@ const Header = (props: any) => {
setRoleName('邮政协会/管局')
Taro.setStorageSync('RoleName', '邮政协会/管局')
Taro.setStorageSync('RoleCode', 'youzheng')
Taro.setStorageSync('certification', 'yz')
Taro.setStorageSync('Certification', 'yz')
return false;
}
// 快递公司

View File

@@ -118,7 +118,7 @@ function Home() {
}
// 已认证用户
if (Taro.getStorageSync('certification')) {
if (Taro.getStorageSync('Certification')) {
setIsAdmin(true)
setScale(11)
// pageHjmCarByMap(res.latitude, res.longitude)
@@ -149,6 +149,10 @@ function Home() {
// 搜索条件
const where = {}
// 交警和邮管不能在小程序主界面地图上看到任何一个车辆的定位
if(Taro.getStorageSync('RoleCode') == 'jiaojing' || Taro.getStorageSync('RoleCode') == 'youzheng'){
return false
}
if (latitude) {
// @ts-ignore
where.latitude = latitude
@@ -207,6 +211,7 @@ function Home() {
if (!Taro.getStorageSync('access_token')) {
return false;
}
pageHjmCarByMap(latitude, longitude)
if (!isAdmin) {
return false;
@@ -293,7 +298,7 @@ function Home() {
setIsAdmin(true)
}
// 是否交警
if (Taro.getStorageSync('certification') == 'jj') {
if (Taro.getStorageSync('Certification') == 'jj') {
console.log('交警', '12312')
setIsAdmin(true)
}

View File

@@ -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={*/}
{/* <div style={{display: 'inline-flex', alignItems: 'center'}}>*/}
{/* <span style={{marginTop: '12px'}}>管理</span>*/}