项目开发完成
This commit is contained in:
42
src/user/bx/BestSellers.tsx
Normal file
42
src/user/bx/BestSellers.tsx
Normal file
@@ -0,0 +1,42 @@
|
||||
import {useEffect} from "react";
|
||||
import {Image, Space} from '@nutui/nutui-react-taro'
|
||||
import Taro from '@tarojs/taro'
|
||||
|
||||
const BestSellers = (props: any) => {
|
||||
const reload = () => {
|
||||
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
reload()
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className={'px-2 mb-4'}>
|
||||
<div className={'flex flex-col justify-between items-center rounded-lg px-3'}>
|
||||
{props.data?.map((item, index) => {
|
||||
return (
|
||||
<div key={index} className={'flex bg-white rounded-lg w-full p-3 mb-3'}
|
||||
onClick={() => Taro.navigateTo({url: '/hjm/query?id=' + item.id})}>
|
||||
<Image src={item.image} mode={'scaleToFill'}
|
||||
radius="10%" width="80" height="80"/>
|
||||
<div className={'mx-3 flex flex-col'}>
|
||||
<Space direction={'vertical'}>
|
||||
<div className={'car-no text-lg font-bold'}>{item.code}</div>
|
||||
<div className={'flex text-xs text-gray-500'}>快递公司:<span
|
||||
className={'text-gray-700'}>{item.parentOrganization}</span></div>
|
||||
<div className={'flex text-xs text-gray-500'}>保险状态:<span className={'text-green-600'}>{item.insuranceStatus}</span>
|
||||
</div>
|
||||
<div className={'flex text-xs text-gray-500'}>绑定操作员:<span
|
||||
className={'text-gray-700'}>{item.driver}</span></div>
|
||||
</Space>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
<div style={{height: '170px'}}></div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default BestSellers
|
||||
4
src/user/bx/index.config.ts
Normal file
4
src/user/bx/index.config.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: '报险记录',
|
||||
navigationStyle: 'custom'
|
||||
})
|
||||
62
src/user/bx/index.tsx
Normal file
62
src/user/bx/index.tsx
Normal file
@@ -0,0 +1,62 @@
|
||||
import {useEffect, useState} from "react";
|
||||
import Taro from '@tarojs/taro'
|
||||
import {ArrowLeft} from '@nutui/icons-react-taro'
|
||||
import {NavBar, InfiniteLoading} from '@nutui/nutui-react-taro'
|
||||
import {pageHjmCar} from "@/api/hjm/hjmCar";
|
||||
import {HjmCar} from "@/api/hjm/hjmCar/model";
|
||||
import BestSellers from "./BestSellers";
|
||||
|
||||
/**
|
||||
* 文章终极列表
|
||||
* @constructor
|
||||
*/
|
||||
const Index = () => {
|
||||
const [statusBarHeight, setStatusBarHeight] = useState<number>()
|
||||
const [list, setList] = useState<HjmCar[]>([])
|
||||
|
||||
const reload = () => {
|
||||
// 获取车辆列表
|
||||
pageHjmCar({userId: Taro.getStorageSync('UserId')}).then(res => {
|
||||
setList(res?.list || [])
|
||||
})
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
Taro.getSystemInfo({
|
||||
success: (res) => {
|
||||
setStatusBarHeight(res.statusBarHeight)
|
||||
},
|
||||
})
|
||||
reload()
|
||||
}, [])
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<NavBar
|
||||
fixed={true}
|
||||
style={{marginTop: `${statusBarHeight}px`}}
|
||||
onBackClick={() => {
|
||||
}}
|
||||
left={
|
||||
<>
|
||||
<ArrowLeft size={18} onClick={() => {Taro.navigateBack()}} />
|
||||
{/*<SearchBar shape="round" maxLength={5} style={{paddingLeft: '1px'}}/>*/}
|
||||
{/*<div className={'flex flex-col text-center justify-center items-center'}>*/}
|
||||
{/* <Filter size={14}/>*/}
|
||||
{/* <div className={'text-xs text-gray-600 whitespace-nowrap'}>筛选</div>*/}
|
||||
{/*</div>*/}
|
||||
</>
|
||||
}
|
||||
>
|
||||
<span>车辆管理</span>
|
||||
</NavBar>
|
||||
<InfiniteLoading
|
||||
className={'w-full fixed left-0 top-24'}
|
||||
>
|
||||
<BestSellers data={list}/>
|
||||
</InfiniteLoading>
|
||||
</>
|
||||
)
|
||||
}
|
||||
export default Index
|
||||
42
src/user/car/BestSellers.tsx
Normal file
42
src/user/car/BestSellers.tsx
Normal file
@@ -0,0 +1,42 @@
|
||||
import {useEffect} from "react";
|
||||
import {Image, Space} from '@nutui/nutui-react-taro'
|
||||
import Taro from '@tarojs/taro'
|
||||
|
||||
const BestSellers = (props: any) => {
|
||||
const reload = () => {
|
||||
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
reload()
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className={'px-2 mb-4'}>
|
||||
<div className={'flex flex-col justify-between items-center rounded-lg px-3'}>
|
||||
{props.data?.map((item, index) => {
|
||||
return (
|
||||
<div key={index} className={'flex bg-white rounded-lg w-full p-3 mb-3'}
|
||||
onClick={() => Taro.navigateTo({url: '/hjm/query?id=' + item.id})}>
|
||||
<Image src={item.image} mode={'scaleToFill'}
|
||||
radius="10%" width="80" height="80"/>
|
||||
<div className={'mx-3 flex flex-col'}>
|
||||
<Space direction={'vertical'}>
|
||||
<div className={'car-no text-lg font-bold'}>{item.code}</div>
|
||||
<div className={'flex text-xs text-gray-500'}>快递公司:<span
|
||||
className={'text-gray-700'}>{item.parentOrganization}</span></div>
|
||||
<div className={'flex text-xs text-gray-500'}>保险状态:<span className={'text-green-600'}>{item.insuranceStatus}</span>
|
||||
</div>
|
||||
<div className={'flex text-xs text-gray-500'}>绑定操作员:<span
|
||||
className={'text-gray-700'}>{item.driver}</span></div>
|
||||
</Space>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
<div style={{height: '170px'}}></div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default BestSellers
|
||||
4
src/user/car/index.config.ts
Normal file
4
src/user/car/index.config.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: '车辆管理',
|
||||
navigationStyle: 'custom'
|
||||
})
|
||||
62
src/user/car/index.tsx
Normal file
62
src/user/car/index.tsx
Normal file
@@ -0,0 +1,62 @@
|
||||
import {useEffect, useState} from "react";
|
||||
import Taro from '@tarojs/taro'
|
||||
import {ArrowLeft} from '@nutui/icons-react-taro'
|
||||
import {NavBar, InfiniteLoading} from '@nutui/nutui-react-taro'
|
||||
import {pageHjmCar} from "@/api/hjm/hjmCar";
|
||||
import {HjmCar} from "@/api/hjm/hjmCar/model";
|
||||
import BestSellers from "./BestSellers";
|
||||
|
||||
/**
|
||||
* 文章终极列表
|
||||
* @constructor
|
||||
*/
|
||||
const Index = () => {
|
||||
const [statusBarHeight, setStatusBarHeight] = useState<number>()
|
||||
const [list, setList] = useState<HjmCar[]>([])
|
||||
|
||||
const reload = () => {
|
||||
// 获取车辆列表
|
||||
pageHjmCar({userId: Taro.getStorageSync('UserId')}).then(res => {
|
||||
setList(res?.list || [])
|
||||
})
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
Taro.getSystemInfo({
|
||||
success: (res) => {
|
||||
setStatusBarHeight(res.statusBarHeight)
|
||||
},
|
||||
})
|
||||
reload()
|
||||
}, [])
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<NavBar
|
||||
fixed={true}
|
||||
style={{marginTop: `${statusBarHeight}px`}}
|
||||
onBackClick={() => {
|
||||
}}
|
||||
left={
|
||||
<>
|
||||
<ArrowLeft size={18} onClick={() => {Taro.navigateBack()}} />
|
||||
{/*<SearchBar shape="round" maxLength={5} style={{paddingLeft: '1px'}}/>*/}
|
||||
{/*<div className={'flex flex-col text-center justify-center items-center'}>*/}
|
||||
{/* <Filter size={14}/>*/}
|
||||
{/* <div className={'text-xs text-gray-600 whitespace-nowrap'}>筛选</div>*/}
|
||||
{/*</div>*/}
|
||||
</>
|
||||
}
|
||||
>
|
||||
<span>车辆管理</span>
|
||||
</NavBar>
|
||||
<InfiniteLoading
|
||||
className={'w-full fixed left-0 top-24'}
|
||||
>
|
||||
<BestSellers data={list}/>
|
||||
</InfiniteLoading>
|
||||
</>
|
||||
)
|
||||
}
|
||||
export default Index
|
||||
@@ -12,11 +12,7 @@ import {
|
||||
Form,
|
||||
Button,
|
||||
Input,
|
||||
Radio,
|
||||
// SideNavBar,
|
||||
// SideNavBarItem,
|
||||
// SubSideNavBar,
|
||||
// Cascader
|
||||
Radio
|
||||
} from '@nutui/nutui-react-taro'
|
||||
import {DictData} from "@/api/system/dict-data/model";
|
||||
import {pageDictData} from "@/api/system/dict-data";
|
||||
@@ -25,12 +21,12 @@ function Profile() {
|
||||
const formId = Number(router?.params.id)
|
||||
|
||||
const [form] = Form.useForm()
|
||||
const [type, setType] = useState<number>(0)
|
||||
const [sex, setSex] = useState<DictData[]>()
|
||||
const [FormData, setFormData] = useState<User>(
|
||||
{
|
||||
userId: undefined,
|
||||
nickname: undefined,
|
||||
realName: undefined,
|
||||
avatar: undefined,
|
||||
sex: undefined,
|
||||
phone: undefined,
|
||||
@@ -48,41 +44,23 @@ function Profile() {
|
||||
// 获取数据字典
|
||||
pageDictData({limit: 200}).then(res => {
|
||||
setSex(res?.list.filter((item) => item.dictCode === 'sex'))
|
||||
// setPresent(res?.list.filter((item) => item.dictCode === 'present'))
|
||||
})
|
||||
// 获取用户信息
|
||||
getUserInfo().then((data) => {
|
||||
setUser(data)
|
||||
setFormData(data)
|
||||
})
|
||||
// pageDictData({limit: 200}).then(res => {
|
||||
// setSex(res?.list.filter((item) => item.dictCode === 'sex'))
|
||||
// setPresent(res?.list.filter((item) => item.dictCode === 'present'))
|
||||
// // setClassList([res?.list.filter((item) => item.dictCode === 'Class')])
|
||||
// setGradeList(res?.list.filter((item) => {
|
||||
// if (item.dictCode === 'Grade') {
|
||||
// item.value = item.dictDataCode;
|
||||
// item.text = item.dictDataName;
|
||||
// return item
|
||||
// }
|
||||
// }))
|
||||
// })
|
||||
}
|
||||
|
||||
// 提交表单
|
||||
const submitSucceed = (values: any) => {
|
||||
console.log(values, 'values')
|
||||
console.log(formId, 'formId>>')
|
||||
if(values.type === 1 && values.name == ''){
|
||||
Taro.showToast({
|
||||
title: '请填写单位名称',
|
||||
icon: 'error'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
updateUserInfo(values).then(() => {
|
||||
Taro.showToast({title: `保存成功`, icon: 'success'})
|
||||
return Taro.navigateBack()
|
||||
setTimeout(() => {
|
||||
return Taro.navigateBack()
|
||||
},1000)
|
||||
}).catch(() => {
|
||||
Taro.showToast({
|
||||
title: '保存失败',
|
||||
@@ -92,12 +70,6 @@ function Profile() {
|
||||
}
|
||||
const submitFailed = (error: any) => {
|
||||
console.log(error, 'err...')
|
||||
// Taro.showToast({ title: error[0].message, icon: 'error' })
|
||||
}
|
||||
|
||||
const changeType = (type: any) => {
|
||||
console.log(type, 'type>>>>')
|
||||
setType(type)
|
||||
}
|
||||
|
||||
const uploadAvatar = ({detail}) => {
|
||||
@@ -170,105 +142,58 @@ function Profile() {
|
||||
}
|
||||
>
|
||||
<Form.Item
|
||||
label="类型"
|
||||
name="type"
|
||||
style={{marginTop: '10px'}}
|
||||
required
|
||||
initialValue={type}
|
||||
label={'昵称'}
|
||||
name="nickname"
|
||||
initialValue={FormData.nickname}
|
||||
rules={[{message: '请输入昵称'}]}
|
||||
>
|
||||
<Radio.Group defaultValue={type} direction="horizontal" onChange={(e) => changeType(e)}>
|
||||
<Radio value={0}>校友</Radio>
|
||||
<Radio value={1}>友好单位</Radio>
|
||||
<Radio value={2}>爱心人士</Radio>
|
||||
<Input placeholder="请输入昵称" type="text"/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={'真实姓名'}
|
||||
name="realName"
|
||||
initialValue={FormData.realName}
|
||||
rules={[{message: '请输入真实姓名'}]}
|
||||
>
|
||||
<Input placeholder="请输入真实姓名或单位名称" type="text"/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="性别"
|
||||
name="sex"
|
||||
initialValue={FormData.sex}
|
||||
rules={[
|
||||
{message: '请选择性别'}
|
||||
]}
|
||||
>
|
||||
<Radio.Group defaultValue={FormData.sex} direction="horizontal">
|
||||
{
|
||||
sex?.map((item, index) => (
|
||||
<Radio key={index} value={item.dictDataCode}>
|
||||
{item.dictDataName}
|
||||
</Radio>
|
||||
))
|
||||
}
|
||||
</Radio.Group>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={type === 1 ? '单位名称' : '真实姓名'}
|
||||
name="name"
|
||||
required={type === 1}
|
||||
initialValue={FormData.realName}
|
||||
rules={[{message: '请输入姓名或单位名称'}]}
|
||||
>
|
||||
<Input placeholder="请输入姓名或单位名称" type="text"/>
|
||||
</Form.Item>
|
||||
{type !== 1 && (
|
||||
<Form.Item
|
||||
label="性别"
|
||||
name="sex"
|
||||
initialValue={FormData.sex}
|
||||
rules={[
|
||||
{message: '请选择性别'}
|
||||
]}
|
||||
>
|
||||
<Radio.Group defaultValue={FormData.sex} direction="horizontal">
|
||||
{
|
||||
sex?.map((item, index) => (
|
||||
<Radio key={index} value={item.dictDataCode}>
|
||||
{item.dictDataName}
|
||||
</Radio>
|
||||
))
|
||||
}
|
||||
</Radio.Group>
|
||||
</Form.Item>
|
||||
)}
|
||||
{/*<Form.Item*/}
|
||||
{/* label="手机号码"*/}
|
||||
{/* name="phone"*/}
|
||||
{/* required*/}
|
||||
{/* initialValue={phone}*/}
|
||||
{/* rules={[{max: 11, message: '请输入手机号码'}]}*/}
|
||||
{/*>*/}
|
||||
{/* <Input placeholder="手机号码" maxLength={11} type="number"/>*/}
|
||||
{/*</Form.Item>*/}
|
||||
<Form.Item
|
||||
label={type === 1 ? '单位地址' : '联系地址'}
|
||||
label={'联系地址'}
|
||||
name="address"
|
||||
initialValue={FormData.address}
|
||||
rules={[{message: '请输入现居住地'}]}
|
||||
rules={[{message: '请输入联系地址'}]}
|
||||
>
|
||||
<Input placeholder="请输入现居住地" type="text"/>
|
||||
<Input placeholder="请输入联系地址" type="text"/>
|
||||
</Form.Item>
|
||||
{/*<Form.Item*/}
|
||||
{/* label="参加校庆活动"*/}
|
||||
{/* name="present"*/}
|
||||
{/* initialValue={FormData.present}*/}
|
||||
{/* required*/}
|
||||
{/*>*/}
|
||||
{/* <Radio.Group defaultValue={FormData.present} direction="horizontal">*/}
|
||||
{/* {*/}
|
||||
{/* present?.map((item, index) => (*/}
|
||||
{/* <Radio key={index} value={item.dictDataCode}>*/}
|
||||
{/* {item.dictDataName}*/}
|
||||
{/* </Radio>*/}
|
||||
{/* ))*/}
|
||||
{/* }*/}
|
||||
{/* </Radio.Group>*/}
|
||||
{/*</Form.Item>*/}
|
||||
<Form.Item
|
||||
label="备注信息"
|
||||
name="comments"
|
||||
initialValue={FormData.comments}
|
||||
rules={[{message: '备注信息'}]}
|
||||
>
|
||||
<Input placeholder={type == 2 ? '可注明身份,如:家长、小学教师、公务员等' : '未找到班级年级请在标注(初/高xx班)'} />
|
||||
<Input placeholder={'个性签名'} />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</ConfigProvider>
|
||||
</div>
|
||||
{/*<Cascader*/}
|
||||
{/* popupProps={{*/}
|
||||
{/* className: 'cascader-popup',*/}
|
||||
{/* }}*/}
|
||||
{/* visible={navBarState.visible}*/}
|
||||
{/* optionKey={{valueKey: 'name', textKey: 'name', childrenKey: 'children'}}*/}
|
||||
{/* title="选择所在班级"*/}
|
||||
{/* options={classList}*/}
|
||||
{/* closeable*/}
|
||||
{/* onChange={change6}*/}
|
||||
{/* onClose={() => {*/}
|
||||
{/* changeNarBar(false)*/}
|
||||
{/* }}*/}
|
||||
{/*/>*/}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user