Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenshaokai
jinfa-platform
Commits
cff81bd9
Commit
cff81bd9
authored
Mar 25, 2022
by
rainbowmorel@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
address Drawer
parent
fd1279d6
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
300 additions
and
75 deletions
+300
-75
AddressDrawer.less
src/components/AddressDrawer/AddressDrawer.less
+4
-0
AddressDrawer.tsx
src/components/AddressDrawer/AddressDrawer.tsx
+80
-0
AddressForm.tsx
src/components/AddressDrawer/AddressForm.tsx
+70
-0
AddressRaio.tsx
src/components/AddressDrawer/AddressRaio.tsx
+54
-0
index.tsx
src/components/AddressDrawer/index.tsx
+2
-0
BaseInfo.tsx
src/components/BaseInfo/BaseInfo.tsx
+2
-2
FormItem.tsx
src/components/FormItem/FormItem.tsx
+7
-3
add.tsx
src/pages/order/deliveryNotice/manageSRM/add.tsx
+81
-70
No files found.
src/components/AddressDrawer/AddressDrawer.less
0 → 100644
View file @
cff81bd9
.antRadioWrapperItems{
display: flex !important;
align-items: center !important;
}
src/components/AddressDrawer/AddressDrawer.tsx
0 → 100644
View file @
cff81bd9
import
{
Button
,
Col
,
Drawer
,
Form
,
Radio
,
Row
,
Select
,
Space
}
from
'antd'
;
import
React
,
{
useState
}
from
'react'
;
import
AddressForm
from
'./AddressForm'
;
import
AddressRaio
from
'./AddressRaio'
;
interface
AddressDrawerProps
{
onChange
?:
void
}
function
AddressDrawer
(
props
:
AddressDrawerProps
)
{
const
{
onChange
}
=
props
;
const
[
visible
,
setVisible
]
=
useState
<
boolean
>
(
false
);
const
[
showForm
,
setShowForm
]
=
useState
<
boolean
>
(
false
);
const
[
value
,
setValue
]
=
useState
();
const
[
addrForm
]
=
Form
.
useForm
()
//地址提交
function
sumbitAddressForm
()
{
addrForm
.
validateFields
().
then
(
values
=>
{
console
.
log
(
values
);
})
}
return
(
<>
<
Row
gutter=
{
10
}
>
<
Col
span=
{
20
}
>
<
Select
value=
{
value
}
>
<
Select
.
Option
value=
{
1
}
>
我的地址1
</
Select
.
Option
>
<
Select
.
Option
value=
{
2
}
>
我的地址2
</
Select
.
Option
>
<
Select
.
Option
value=
{
3
}
>
我的地址3
</
Select
.
Option
>
<
Select
.
Option
value=
{
4
}
>
我的地址4
</
Select
.
Option
>
</
Select
>
</
Col
>
<
Col
span=
{
4
}
>
<
Button
className=
'w-full'
onClick=
{
()
=>
setVisible
(
true
)
}
>
管理
</
Button
>
</
Col
>
</
Row
>
<
Drawer
width=
{
600
}
visible=
{
visible
}
onClose=
{
()
=>
setVisible
(
false
)
}
title=
"地址管理"
footer=
{
<
Button
.
Group
>
<
Button
type=
'primary'
onClick=
{
sumbitAddressForm
}
>
提交
</
Button
>
</
Button
.
Group
>
}
>
<
Radio
.
Group
className=
'w-full'
onChange=
{
(
e
)
=>
{
setValue
(
e
.
target
.
value
);
}
}
>
<
Space
className=
'w-full'
direction=
"vertical"
>
<
AddressRaio
onEdit=
{
(
addr
)
=>
{
setShowForm
(
true
)
console
.
log
(
addr
)
addrForm
.
setFieldsValue
(
addr
);
}
}
/>
</
Space
>
</
Radio
.
Group
>
<
Button
className=
'mt-10'
onClick=
{
()
=>
setShowForm
(
true
)
}
>
新增地址
</
Button
>
{
showForm
&&
<
AddressForm
form=
{
addrForm
}
/>
}
</
Drawer
>
</>
);
}
export
default
AddressDrawer
\ No newline at end of file
src/components/AddressDrawer/AddressForm.tsx
0 → 100644
View file @
cff81bd9
import
{
PATTERN_MAPS
}
from
'@/constants/regExp'
;
import
{
Cascader
,
Form
,
FormInstance
,
Input
,
Select
,
Switch
}
from
'antd'
;
import
React
,
{
useEffect
}
from
'react'
;
const
FormItem
=
Form
.
Item
;
interface
addrFormProps
{
form
?:
FormInstance
}
function
AddressForm
(
props
:
addrFormProps
)
{
const
[
selfForm
]
=
Form
.
useForm
(
props
.
form
)
return
(
<
Form
style=
{
{
marginTop
:
32
}
}
layout=
"vertical"
form=
{
selfForm
}
>
<
FormItem
label=
"收货人"
name=
"name"
rules=
{
[
{
required
:
true
}
]
}
>
<
Input
/>
</
FormItem
>
<
FormItem
label=
"收货人"
name=
"cons"
rules=
{
[
{
required
:
true
}
]
}
>
<
Cascader
/>
</
FormItem
>
<
FormItem
label=
"收货地址详情"
name=
"address"
rules=
{
[
{
required
:
true
}
]
}
>
<
Input
/>
</
FormItem
>
<
div
className=
'mt-16'
>
<
div
className=
'text-gray-400'
>
法人手机号
<
span
className=
'text-red-500'
style=
{
{
fontFamily
:
"SimSun, sans-serif"
}
}
>
*
</
span
></
div
>
<
div
className=
'flex gap-5 mt-5'
>
<
FormItem
className=
'flex-1 w-17'
name=
"areaCode"
rules=
{
[
{
required
:
true
}
]
}
>
<
Select
>
<
Select
.
Option
value=
"+86"
>
+86
</
Select
.
Option
>
</
Select
>
</
FormItem
>
<
FormItem
className=
'flex-auto'
name=
"phone"
rules=
{
[
{
required
:
true
}
]
}
>
<
Input
/>
</
FormItem
>
</
div
>
</
div
>
<
FormItem
label=
"电话号码"
name=
"tel"
rules=
{
[
{
pattern
:
PATTERN_MAPS
.
tel
}
]
}
>
<
Input
/>
</
FormItem
>
<
FormItem
label=
"是否默认"
name=
"isDefault"
>
<
Switch
/>
</
FormItem
>
</
Form
>
)
}
export
default
AddressForm
;
\ No newline at end of file
src/components/AddressDrawer/AddressRaio.tsx
0 → 100644
View file @
cff81bd9
import
{
Radio
,
Button
}
from
'antd'
import
React
from
'react'
import
styles
from
'./AddressDrawer.less'
/**
* FormItem 修个值
*/
interface
AddressRaioProps
{
onChange
?:
(
value
)
=>
void
onEdit
?:
(
address
)
=>
void
}
function
AddressRaio
(
props
:
AddressRaioProps
)
{
const
{
onChange
,
onEdit
}
=
props
;
return
(
<>
{
[
1
,
2
,
3
,
4
].
map
(
addr
=>
(
<
div
className=
'flex mb-14'
>
<
div
className=
'_left felx-auto'
>
<
Radio
className=
{
styles
[
'antRadioWrapperItems'
]
}
value=
{
addr
}
>
<
div
className=
'address_base ml-10'
>
<
span
>
蒯美政
</
span
>
<
span
>
185 2929 6758
</
span
>
<
span
>
默认地址
</
span
>
</
div
>
<
div
className=
'address_decs ml-10'
>
广东省广州市海珠区新港东路1068号中洲中心北塔6楼
</
div
>
</
Radio
>
</
div
>
<
div
className=
{
`_right flex flex-1 justify-end ${styles["antRadioWrapperItems"]}`
}
>
<
Button
.
Group
size=
'small'
>
<
Button
onClick=
{
()
=>
{
if
(
onEdit
)
{
onEdit
({
name
:
'molei'
})
}
}
}
>
编辑
</
Button
>
<
Button
>
删除
</
Button
>
</
Button
.
Group
>
</
div
>
</
div
>
))
}
</>
)
}
export
default
AddressRaio
\ No newline at end of file
src/components/AddressDrawer/index.tsx
0 → 100644
View file @
cff81bd9
export
{
default
as
AddressDrawer
}
from
'./AddressDrawer'
\ No newline at end of file
src/components/BaseInfo/BaseInfo.tsx
View file @
cff81bd9
...
@@ -35,8 +35,8 @@ function BaseInfoItem({ label, children }: {
...
@@ -35,8 +35,8 @@ function BaseInfoItem({ label, children }: {
return
(
return
(
<
div
className=
'base_info_item'
>
<
div
className=
'base_info_item'
>
<
Row
>
<
Row
>
<
Col
span=
{
4
}
>
{
label
}
</
Col
>
<
Col
span=
{
8
}
>
{
label
}
</
Col
>
<
Col
span=
{
20
}
>
<
Col
span=
{
16
}
>
{
typeof
children
===
'string'
?
<
div
>
{
children
}
</
div
>
:
children
}
{
typeof
children
===
'string'
?
<
div
>
{
children
}
</
div
>
:
children
}
</
Col
>
</
Col
>
</
Row
>
</
Row
>
...
...
src/components/FormItem/FormItem.tsx
View file @
cff81bd9
...
@@ -4,9 +4,13 @@ function FormItem<values = any>(prosp: FormItemProps<values>) {
...
@@ -4,9 +4,13 @@ function FormItem<values = any>(prosp: FormItemProps<values>) {
return
(
return
(
<
Form
.
Item
<
Form
.
Item
labelAlign=
"left"
labelAlign=
"left"
labelCol=
{
{
span
:
4
}
}
labelCol=
{
{
span
:
6
}
}
wrapperCol=
{
{
span
:
20
}
}
wrapperCol=
{
{
span
:
18
}
}
{
...
prosp
}
className=
"w-full"
/>
{
...
prosp
}
className=
"w-full"
>
{
prosp
.
children
}
</
Form
.
Item
>
);
);
}
}
...
...
src/pages/order/deliveryNotice/manageSRM/add.tsx
View file @
cff81bd9
...
@@ -7,11 +7,12 @@ import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
...
@@ -7,11 +7,12 @@ import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import
React
,
{
useState
}
from
'react'
import
React
,
{
useState
}
from
'react'
import
{
BillsInfo
,
BuyerLabel
,
ConsigneeLabel
,
ConsigneePhoneLabel
,
ConsigneeTimeLabel
,
DeliveryAbstractLabel
,
DeliveryAddrLabel
,
DeliveryDateLabel
,
DeliveryGood
,
DeliveryInfo
,
DeliveryNameLabel
,
DeliveryNoLabel
,
DeliveryPhoneLabel
,
DeliverySlefAddrLabel
,
DeliveryTimeLabel
,
DeliveryTypeLabel
,
Distribution
,
LogisticsCarNoLabel
,
LogisticsCompanyLabel
,
LogisticsInfo
,
LogisticsNoLabel
,
NoteLabel
,
OutStatusLabel
}
from
'../../constants'
import
{
BillsInfo
,
BuyerLabel
,
ConsigneeLabel
,
ConsigneePhoneLabel
,
ConsigneeTimeLabel
,
DeliveryAbstractLabel
,
DeliveryAddrLabel
,
DeliveryDateLabel
,
DeliveryGood
,
DeliveryInfo
,
DeliveryNameLabel
,
DeliveryNoLabel
,
DeliveryPhoneLabel
,
DeliverySlefAddrLabel
,
DeliveryTimeLabel
,
DeliveryTypeLabel
,
Distribution
,
LogisticsCarNoLabel
,
LogisticsCompanyLabel
,
LogisticsInfo
,
LogisticsNoLabel
,
NoteLabel
,
OutStatusLabel
}
from
'../../constants'
import
{
BaseInfo
as
ContentBox
}
from
'@/components/BaseInfo'
import
{
BaseInfo
as
ContentBox
}
from
'@/components/BaseInfo'
import
{
Input
,
Table
,
Row
,
Col
}
from
'antd'
;
import
{
Input
,
Table
,
Row
,
Col
,
Select
,
Radio
,
Form
}
from
'antd'
;
import
{
DeliveryNoticeTableColumn
}
from
'../../constants/page-table-column'
;
import
{
DeliveryNoticeTableColumn
}
from
'../../constants/page-table-column'
;
import
{
FormItem
}
from
'@/components/FormItem'
;
import
{
FormItem
}
from
'@/components/FormItem'
;
import
{
DatePickerSelect
}
from
'@/components/DatePickerSelect'
import
{
DatePickerSelect
}
from
'@/components/DatePickerSelect'
import
DatePicker
from
'@/components/DatePicker'
;
import
DatePicker
from
'@/components/DatePicker'
;
import
{
AddressDrawer
}
from
'@/components/AddressDrawer'
;
const
ContentBoxItem
=
ContentBox
.
BaseInfoItem
;
const
ContentBoxItem
=
ContentBox
.
BaseInfoItem
;
...
@@ -29,75 +30,85 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
...
@@ -29,75 +30,85 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
anchors=
{
anchors
}
anchors=
{
anchors
}
>
>
<
ContentBox
title=
{
BillsInfo
.
name
}
id=
{
BillsInfo
.
key
}
>
<
Form
>
<
FormItem
label=
{
DeliveryAbstractLabel
}
>
<
ContentBox
title=
{
BillsInfo
.
name
}
id=
{
BillsInfo
.
key
}
>
<
Input
/>
<
FormItem
label=
{
DeliveryAbstractLabel
}
>
</
FormItem
>
<
Input
/>
</
FormItem
>
<
FormItem
label=
{
NoteLabel
}
>
<
Input
/>
<
FormItem
label=
{
NoteLabel
}
>
</
FormItem
>
<
Input
/>
</
FormItem
>
<
FormItem
label=
{
BuyerLabel
}
>
<
Input
/>
<
FormItem
label=
{
BuyerLabel
}
>
</
FormItem
>
<
Input
/>
</
ContentBox
>
</
FormItem
>
</
ContentBox
>
<
ContentBox
title=
{
Distribution
.
name
}
id=
{
Distribution
.
key
}
>
<
FormItem
label=
{
DeliveryDateLabel
}
>
<
ContentBox
title=
{
Distribution
.
name
}
id=
{
Distribution
.
key
}
>
<
DatePickerSelect
className=
'w-full'
/>
<
FormItem
label=
{
DeliveryDateLabel
}
>
</
FormItem
>
<
DatePickerSelect
className=
'w-full'
/>
</
FormItem
>
<
FormItem
label=
{
DeliveryNameLabel
}
>
<
Input
/>
<
FormItem
label=
{
DeliveryNameLabel
}
>
</
FormItem
>
<
Input
/>
</
FormItem
>
<
FormItem
label=
{
DeliveryTimeLabel
}
>
<
DatePickerSelect
.
RangePicker
className=
"w-full"
picker=
'time'
/>
<
FormItem
label=
{
DeliveryTimeLabel
}
>
</
FormItem
>
<
DatePickerSelect
.
RangePicker
className=
"w-full"
picker=
'time'
/>
</
FormItem
>
<
FormItem
label=
{
DeliveryPhoneLabel
}
>
<
Input
/>
<
FormItem
label=
{
DeliveryPhoneLabel
}
>
</
FormItem
>
<
Input
/>
</
ContentBox
>
</
FormItem
>
</
ContentBox
>
<
ContentBox
title=
{
DeliveryInfo
.
name
}
id=
{
DeliveryInfo
.
key
}
>
<
FormItem
label=
{
ConsigneeTimeLabel
}
>
<
ContentBox
title=
{
DeliveryInfo
.
name
}
id=
{
DeliveryInfo
.
key
}
>
<
DatePickerSelect
/>
<
FormItem
label=
{
ConsigneeTimeLabel
}
>
</
FormItem
>
<
DatePickerSelect
className=
"w-full"
/>
</
FormItem
>
<
FormItem
label=
{
DeliveryAddrLabel
}
>
<
Input
/>
<
FormItem
label=
{
DeliveryAddrLabel
}
>
</
FormItem
>
<
Input
/>
</
FormItem
>
<
FormItem
label=
{
DeliverySlefAddrLabel
}
>
<
FormItem
name=
{
"DeliverySlefAddrLabel"
}
label=
{
DeliverySlefAddrLabel
}
>
</
FormItem
>
<
AddressDrawer
/>
</
FormItem
>
</
ContentBox
>
</
ContentBox
>
<
ContentBox
title=
{
LogisticsInfo
.
name
}
id=
{
LogisticsInfo
.
key
}
>
<
ContentBox
title=
{
LogisticsInfo
.
name
}
id=
{
LogisticsInfo
.
key
}
>
<
ContentBoxItem
label=
{
DeliveryTypeLabel
}
>
<
FormItem
label=
{
DeliveryTypeLabel
}
>
</
ContentBoxItem
>
<
ContentBoxItem
label=
{
LogisticsCarNoLabel
}
>
<
Radio
.
Group
>
<
Radio
.
Button
value=
{
1
}
>
物流
</
Radio
.
Button
>
</
ContentBoxItem
>
<
Radio
.
Button
value=
{
2
}
>
自提
</
Radio
.
Button
>
<
ContentBoxItem
label=
{
LogisticsCompanyLabel
}
>
<
Radio
.
Button
value=
{
3
}
>
无效配送
</
Radio
.
Button
>
</
Radio
.
Group
>
</
ContentBoxItem
>
<
ContentBoxItem
label=
{
LogisticsNoLabel
}
>
</
FormItem
>
<
FormItem
label=
{
LogisticsCarNoLabel
}
>
</
ContentBoxItem
>
<
Input
/>
</
ContentBox
>
</
FormItem
>
<
FormItem
label=
{
LogisticsCompanyLabel
}
>
<
Select
>
<
ContentBox
title=
{
DeliveryGood
.
name
}
id=
{
DeliveryGood
.
key
}
cols=
{
1
}
>
<
Select
.
Option
>
顺丰快递
</
Select
.
Option
>
</
Select
>
<
Table
columns=
{
DeliveryNoticeTableColumn
}
/>
</
FormItem
>
<
FormItem
label=
{
LogisticsNoLabel
}
>
</
ContentBox
>
<
Input
/>
</
FormItem
>
</
ContentBox
>
<
ContentBox
title=
{
DeliveryGood
.
name
}
id=
{
DeliveryGood
.
key
}
cols=
{
1
}
>
<
Table
columns=
{
DeliveryNoticeTableColumn
}
/>
</
ContentBox
>
</
Form
>
</
AnchorPage
>
</
AnchorPage
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment