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
linweijiong
jinfa-platform
Commits
5549b8ad
Commit
5549b8ad
authored
Aug 19, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加 展示地址相关 逻辑
parent
1b6fb77c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
7 deletions
+49
-7
index.tsx
src/components/AddressSelect/index.tsx
+17
-3
CustomAddressSelect.tsx
src/components/NiceForm/components/CustomAddressSelect.tsx
+25
-2
index.tsx
src/pages/afterService/components/ReturnAnalysis/index.tsx
+2
-2
interface.d.ts
...ges/afterService/components/ReturnAnalysis/interface.d.ts
+5
-0
No files found.
src/components/AddressSelect/index.tsx
View file @
5549b8ad
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-08-05 10:28:06
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-1
1 20:05:5
0
* @LastEditTime: 2021-08-1
9 17:23:3
0
* @Description: 地址选择 FormItem
*/
import
React
,
{
useState
,
useEffect
,
useMemo
,
useRef
}
from
'react'
;
...
...
@@ -49,7 +49,11 @@ interface IProps {
/**
* 是否禁用
*/
disabled
:
boolean
,
disabled
?:
boolean
,
/**
* 是否可编辑的
*/
editable
?:
boolean
,
}
export
type
SubmitValuesType
=
{
...
...
@@ -106,6 +110,7 @@ const AddressSelect: React.FC<IProps> = (props) => {
onChange
,
isDefaultAddress
=
false
,
disabled
=
false
,
editable
=
true
,
}
=
props
;
const
[
list
,
setList
]
=
useState
<
AddressValueType
[]
>
([]);
const
[
internalValue
,
setInternalValue
]
=
useState
<
AddressValueType
>
();
...
...
@@ -151,7 +156,7 @@ const AddressSelect: React.FC<IProps> = (props) => {
triggerChange
(
undefined
);
}
if
(
isDefaultAddress
&&
defaultItem
&&
!
disabled
&&
!
actionFlagRef
.
current
)
{
if
(
isDefaultAddress
&&
defaultItem
&&
!
disabled
&&
!
editable
&&
!
actionFlagRef
.
current
)
{
const
{
shipperName
,
receiverName
,
...
rest
}
=
defaultItem
;
const
next
=
{
name
:
shipperName
||
receiverName
,
...
...
@@ -449,6 +454,15 @@ const AddressSelect: React.FC<IProps> = (props) => {
}));
},
[
list
]);
if
(
!
editable
)
{
const
current
=
list
.
find
((
item
)
=>
item
.
id
===
value
);
const
full
=
current
?
`
${
current
.
name
}
${
current
.
fullAddress
}
${
current
.
phone
}
`
:
null
;
return
(
<
div
>
{
full
||
value
}
</
div
>
);
}
return
(
<
AddressSelectContextProvider
value=
{
{
...
...
src/components/NiceForm/components/CustomAddressSelect.tsx
View file @
5549b8ad
...
...
@@ -2,14 +2,37 @@
* @Author: XieZhiXiong
* @Date: 2021-08-05 11:26:43
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-1
0 16:49:14
* @LastEditTime: 2021-08-1
9 17:34:18
* @Description:
*/
import
React
from
'react'
;
import
{
connect
}
from
'@formily/antd'
;
import
AddressSelect
from
'@/components/AddressSelect'
;
const
CustomAddressSelect
=
connect
()((
props
)
=>
{
const
mapTextComponent
=
(
Target
:
React
.
JSXElementConstructor
<
any
>
,
props
:
any
=
{},
fieldProps
:
any
=
{}
):
React
.
JSXElementConstructor
<
any
>
=>
{
const
{
editable
,
value
}
=
fieldProps
;
const
xComponentProps
=
fieldProps
.
props
[
'x-component-props'
]
||
{};
if
(
editable
!==
undefined
)
{
if
(
editable
===
false
)
{
return
()
=>
(
<
AddressSelect
value=
{
value
}
editable=
{
false
}
{
...
xComponentProps
}
/>
);
}
}
return
Target
;
}
const
CustomAddressSelect
=
connect
({
getComponent
:
mapTextComponent
,
})((
props
)
=>
{
const
{
dataSource
,
value
,
...
...
src/pages/afterService/components/ReturnAnalysis/index.tsx
View file @
5549b8ad
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 15:18:15
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-19 1
3:57:25
* @LastEditTime: 2021-08-19 1
7:24:00
* @Description: 退货收货统计、退货发货明细
*/
import
React
,
{
useState
}
from
'react'
;
...
...
@@ -473,7 +473,7 @@ const ReturnInfo: React.FC<ReturnInfoProps> = ({
subCount
:
item
.
differenceCount
,
count
:
item
.
deliveryCount
,
})),
returnDeliverAddress
:
0
,
// 缺少
returnDeliverAddress
:
currentDetailed
?.
logisticsReceiveAddress
,
deliveryTime
:
currentDetailed
?.
deliveryTime
,
logisticsOrderNo
:
currentDetailed
?.
logisticsOrderNo
,
logisticsName
:
currentDetailed
?.
logisticsName
,
...
...
src/pages/afterService/components/ReturnAnalysis/interface.d.ts
View file @
5549b8ad
...
...
@@ -152,4 +152,8 @@ export interface Detailed {
* 发货明细 ,DeliveryGoodsDetailVO
*/
detailList
:
DetailedListItem
[]
/**
* 物流收货地址
*/
logisticsReceiveAddress
:
string
,
}
\ No newline at end of file
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