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
XieZhiXiong
jinfa-platform
Commits
8a6f7658
Commit
8a6f7658
authored
Dec 22, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加 AsAddressCard 售后收发货地址展示及处理组件
parent
84f75ebf
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
158 additions
and
9 deletions
+158
-9
afterService.ts
src/constants/afterService.ts
+17
-7
index.less
...omponents/AsAddressCard/components/AddressInfo/index.less
+13
-0
index.tsx
...components/AsAddressCard/components/AddressInfo/index.tsx
+43
-0
index.less
src/pages/afterService/components/AsAddressCard/index.less
+10
-0
index.tsx
src/pages/afterService/components/AsAddressCard/index.tsx
+0
-0
reducer.ts
src/pages/afterService/components/AsAddressCard/reducer.ts
+61
-0
utils.ts
src/pages/afterService/utils.ts
+14
-2
No files found.
src/constants/afterService.ts
View file @
8a6f7658
...
...
@@ -578,12 +578,21 @@ export const RETURN_OUTER_STATUS = {
[
RETURN_OUTER_STATUS_FINISHED
]:
'售后完成'
,
}
/**
* 物流
*/
export
const
DELIVERY_TYPE_EXPRESS
=
1
;
/**
* 自提
*/
export
const
DELIVERY_TYPE_SELF_LIFTING
=
2
;
/**
* 无需配送
*/
export
const
DELIVERY_TYPE_NO_DISTRIBUTION
=
3
;
export
const
DELIVERY_TYPE_ENUM
=
[
{
label
:
intl
.
formatMessage
({
id
:
'afterService.constants.DELIVERY_TYPE_ENUM_1'
},
{
default
:
'物流'
}),
value
:
1
},
{
label
:
intl
.
formatMessage
({
id
:
'afterService.constants.DELIVERY_TYPE_ENUM_2'
},
{
default
:
'自提'
}),
value
:
2
},
{
label
:
intl
.
formatMessage
({
id
:
'afterService.constants.DELIVERY_TYPE_ENUM_3'
},
{
default
:
'无需配送'
}),
value
:
3
},
]
{
label
:
intl
.
formatMessage
({
id
:
'afterService.constants.DELIVERY_TYPE_ENUM_1'
},
{
default
:
'物流'
}),
value
:
DELIVERY_TYPE_EXPRESS
},
{
label
:
intl
.
formatMessage
({
id
:
'afterService.constants.DELIVERY_TYPE_ENUM_2'
},
{
default
:
'自提'
}),
value
:
DELIVERY_TYPE_SELF_LIFTING
},
{
label
:
intl
.
formatMessage
({
id
:
'afterService.constants.DELIVERY_TYPE_ENUM_3'
},
{
default
:
'无需配送'
}),
value
:
DELIVERY_TYPE_NO_DISTRIBUTION
},
];
\ No newline at end of file
src/pages/afterService/components/AsAddressCard/components/AddressInfo/index.less
0 → 100644
View file @
8a6f7658
@import '~antd/es/style/themes/default.less';
.addressInfo {
&-head {
margin-bottom: @margin-xss;
line-height: @height-base;
}
&-foot {
margin-bottom: 0;
}
}
\ No newline at end of file
src/pages/afterService/components/AsAddressCard/components/AddressInfo/index.tsx
0 → 100644
View file @
8a6f7658
/**
* @Description: 地址卡片组件
*/
import
React
from
'react'
;
import
styles
from
'./index.less'
;
export
type
AsAddressType
=
{
/**
* 地址id
*/
id
:
number
,
/**
* 姓名
*/
name
:
string
,
/**
* 联系电话
*/
phone
:
string
,
/**
* 详细地址
*/
detailed
:
string
,
};
interface
AddressInfoProps
{
/**
* 数据
*/
data
:
AsAddressType
,
}
const
AddressInfo
:
React
.
FC
<
AddressInfoProps
>
=
(
props
:
AddressInfoProps
)
=>
{
const
{
data
}
=
props
;
return
(
<
div
className=
{
styles
.
addressInfo
}
>
<
p
className=
{
styles
[
'addressInfo-head'
]
}
>
{
data
?.
name
||
''
}
/
{
data
?.
phone
||
''
}
</
p
>
<
p
className=
{
styles
[
'addressInfo-foot'
]
}
>
{
data
?.
detailed
||
''
}
</
p
>
</
div
>
);
};
export
default
AddressInfo
;
src/pages/afterService/components/AsAddressCard/index.less
0 → 100644
View file @
8a6f7658
@import '~antd/es/style/themes/default.less';
.as-address-card {
:global {
.ant-form-item {
margin-bottom: @card-head-padding;
}
}
}
\ No newline at end of file
src/pages/afterService/components/AsAddressCard/index.tsx
0 → 100644
View file @
8a6f7658
This diff is collapsed.
Click to expand it.
src/pages/afterService/components/AsAddressCard/reducer.ts
0 → 100644
View file @
8a6f7658
import
{
Reducer
}
from
'react'
;
export
type
AsAddressType
=
{
/**
* 地址id
*/
id
:
number
,
/**
* 姓名
*/
name
:
string
,
/**
* 联系电话
*/
phone
:
string
,
/**
* 详细地址
*/
detailed
:
string
,
}
export
type
AsAddressValue
=
{
/**
* 配送方式
*/
deliveryType
:
number
,
/**
* 发货地址
*/
deliveryAddress
:
AsAddressType
|
null
,
/**
* 收货地址
*/
shippingAddress
:
AsAddressType
|
null
,
}
export
const
initialState
:
AsAddressValue
=
{
deliveryType
:
undefined
,
deliveryAddress
:
null
,
shippingAddress
:
null
,
}
type
ReducerActionType
=
{
/**
* 类型
*/
type
:
string
,
/**
* 额外的参数
*/
payload
:
Partial
<
AsAddressValue
>
,
}
export
const
reducer
:
Reducer
<
AsAddressValue
,
ReducerActionType
>
=
(
state
:
AsAddressValue
,
action
:
ReducerActionType
)
=>
{
switch
(
action
.
type
)
{
case
'setAsAddress'
:
return
{
...
state
,
...
action
.
payload
};
default
:
throw
new
Error
();
}
}
src/pages/afterService/utils.ts
View file @
8a6f7658
...
...
@@ -20,4 +20,16 @@ export const isMaterialOrder = (orderType: number) => {
||
orderType
===
ORDER_TYPE_TENDER_CONTRACT
||
orderType
===
ORDER_TYPE_REQUISITION
)
};
\ No newline at end of file
};
/**
* 售后类型
* 售后换货:2 售后退货: 3 售后维修:4
*/
export
type
AsType
=
2
|
3
|
4
;
/**
* 售后地址角色
* 寄件人 'sender' 收件人 'receiver'
*/
export
type
AsAddressRole
=
'sender'
|
'receiver'
\ 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