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
2cc771f1
Commit
2cc771f1
authored
Oct 21, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:修复收货发货信息置换
parent
7a872995
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
396 additions
and
332 deletions
+396
-332
router.ts
config/router.ts
+0
-4
Phone.tsx
src/components/NiceForm/components/Phone.tsx
+6
-2
regExp.ts
src/constants/regExp.ts
+1
-0
index.tsx
...pages/transaction/components/orderDetailSection/index.tsx
+2
-1
index.tsx
src/pages/transaction/components/orderSaleRecord/index.tsx
+268
-0
useSelfTable.tsx
...tion/saleOrder/addSaleDelevedOrder/model/useSelfTable.tsx
+1
-1
index.tsx
...ction/saleOrder/readyConfirmDelevedOrder/detail/index.tsx
+1
-1
useSelfTable.tsx
...saleOrder/readyConfirmDelevedOrder/model/useSelfTable.tsx
+1
-4
forgetPwd.tsx
src/pages/user/forgetPwd.tsx
+95
-194
getBack.tsx
src/pages/user/getBack.tsx
+0
-116
index.less
src/pages/user/index.less
+1
-2
index.tsx
src/pages/user/index.tsx
+1
-1
index.ts
src/pages/user/schema/index.ts
+19
-6
No files found.
config/router.ts
View file @
2cc771f1
...
...
@@ -27,10 +27,6 @@ const router = [
component
:
'@/pages/user/register'
},
{
path
:
'/user/getBack'
,
component
:
'@/pages/user/getBack'
},
{
path
:
'/user/policy'
,
component
:
'@/pages/user/policy'
},
...
...
src/components/NiceForm/components/Phone.tsx
View file @
2cc771f1
...
...
@@ -13,7 +13,10 @@ const Phone = (props) => {
delay
:
1
*
1000
})
const
{
value
,
form
}
=
props
const
{
value
,
form
,
schema
}
=
props
const
{
smsFn
,
...
componentProps
}
=
schema
.
getExtendsComponentProps
()
||
{}
console
.
log
(
smsFn
,
componentProps
)
const
[
loading
,
setLoading
]
=
useState
(
false
)
const
handleClickSms
=
()
=>
{
...
...
@@ -29,13 +32,14 @@ const Phone = (props) => {
})
})
}
return
(
<
Row
style=
{
{
width
:
'100%'
}
}
>
<
Col
flex=
{
1
}
>
<
Input
value=
{
value
||
''
}
onChange=
{
e
=>
props
.
mutators
.
change
(
e
.
target
.
value
)
}
{
...
props
.
props
['
x
-
component
-
props
']
}
{
...
componentProps
}
/>
</
Col
>
<
Col
style=
{
{
marginLeft
:
8
}
}
>
...
...
src/constants/regExp.ts
View file @
2cc771f1
...
...
@@ -13,6 +13,7 @@ export const PATTERN_MAPS = {
password
:
/^
(?=
.*
[
a-z
])(?=
.*
[
A-Z
])[
a-zA-Z
\d]{8,20}
$/
,
email
:
/^
[\w
-
]
+
(\.[\w
-
]
+
)
*@
[\w
-
]
+
(\.[\w
-
]
+
)
+$/
,
phone
:
/^1
[
3|4|5|6|7|8|9
][
0-9
]{9}
$/
,
phoneAndEmail
:
/^
(
1
[
3|4|5|6|7|8|9
][
0-9
]{9})
|
([\w
-
]
+
(\.[\w
-
]
+
)
*@
[\w
-
]
+
(\.[\w
-
]
+
)
+
)
$/
,
tel
:
/^
(
0
\d{2,3}
-
\d{7,8})(
-
\d{1,4})?
$/
,
//座机
smsCode
:
/^
\d{6}
$/
,
money
:
/^
\d
*
(?:\.\d{0,2})?
$/
,
...
...
src/pages/transaction/components/orderDetailSection/index.tsx
View file @
2cc771f1
...
...
@@ -7,6 +7,7 @@ import OrderPayTabs from '../../components/orderPayTabs'
import
OrderMergeInfo
from
'../../components/orderMergeInfo'
import
OrderDeleveRecord
from
'../../components/orderDeleveRecord'
import
OrderTransformRecord
from
'../../components/orderTransformRecord'
import
OrderSaleRecord
from
'../orderSaleRecord'
export
interface
OrderDetailSectionProps
{
formContext
:
any
,
...
...
@@ -31,7 +32,7 @@ const OrderDetailSection:React.FC<OrderDetailSectionProps> = ({formContext, type
<
OrderMergeInfo
/>
<
OrderDeleveRecord
/>
{
type
===
'saleOrder'
?
<
OrderSaleRecord
/>
:
<
OrderDeleveRecord
/>
}
<
OrderTransformRecord
/>
</
div
>
...
...
src/pages/transaction/components/orderSaleRecord/index.tsx
0 → 100644
View file @
2cc771f1
import
React
,
{
useContext
}
from
'react'
import
{
Tabs
,
Table
,
Button
}
from
'antd'
import
StatusColors
from
'@/pages/transaction/components/StatusColors'
import
{
formatTimeString
}
from
'@/utils'
import
{
OrderDetailContext
}
from
'../../_public/order/context'
import
MellowCard
from
'@/components/MellowCard'
import
NestTable
from
'@/components/NestTable'
import
{
DeliverySideState
}
from
'@/constants'
import
{
PublicApi
}
from
'@/services/api'
export
interface
OrderSaleRecordProps
{}
const
outOrderCols
:
any
[]
=
[
{
title
:
'商品ID'
,
dataIndex
:
'productId'
,
align
:
'center'
,
key
:
'productId'
},
{
title
:
'商品名称'
,
dataIndex
:
'productName'
,
align
:
'center'
,
key
:
'productName'
,
},
{
title
:
'品类'
,
dataIndex
:
'category'
,
align
:
'center'
,
key
:
'category'
},
{
title
:
'品牌'
,
dataIndex
:
'brand'
,
align
:
'center'
,
key
:
'brand'
,
},
{
title
:
'单位'
,
dataIndex
:
'unit'
,
align
:
'center'
,
key
:
'unit'
},
{
title
:
'单价'
,
dataIndex
:
'unitPrice'
,
align
:
'center'
,
key
:
'unitPrice'
,
},
{
title
:
'采购数量'
,
dataIndex
:
'purchaseCount'
,
align
:
'center'
,
key
:
'purchaseCount'
,
},
{
title
:
'含税'
,
dataIndex
:
'no'
,
align
:
'center'
,
key
:
'no'
,
render
:
()
=>
'是'
},
{
title
:
'金额'
,
dataIndex
:
'price'
,
align
:
'center'
,
key
:
'price'
,
},
{
title
:
'已发货'
,
dataIndex
:
'delivered'
,
align
:
'center'
,
key
:
'delivered'
,
},
{
title
:
'未发货'
,
dataIndex
:
'notDelivered'
,
align
:
'center'
,
key
:
'notDelivered'
,
},
{
title
:
'已收货'
,
dataIndex
:
'goodsReceived'
,
align
:
'center'
,
key
:
'goodsReceived'
,
},
{
title
:
'差异数量'
,
dataIndex
:
'differenceCount'
,
align
:
'center'
,
key
:
'differenceCount'
,
},
]
const
sideChildrenCols
:
any
[]
=
[
{
title
:
'商品ID'
,
dataIndex
:
'productId'
,
align
:
'center'
,
key
:
'productId'
,
},
{
title
:
'商品名称'
,
dataIndex
:
'productName'
,
align
:
'center'
,
key
:
'productName'
,
},
{
title
:
'品类'
,
dataIndex
:
'category'
,
align
:
'center'
,
key
:
'category'
,
},
{
title
:
'品牌'
,
dataIndex
:
'brand'
,
align
:
'center'
,
key
:
'brand'
,
},
{
title
:
'单位'
,
dataIndex
:
'unit'
,
align
:
'center'
,
key
:
'unit'
,
},
{
title
:
'采购数量'
,
dataIndex
:
'purchaseCount'
,
align
:
'center'
,
key
:
'purchaseCount'
,
},
{
title
:
'发货数量'
,
dataIndex
:
'deliverGoodsCount'
,
align
:
'center'
,
key
:
'deliverGoodsCount'
,
},
{
title
:
'入库数量'
,
dataIndex
:
'storageCount'
,
align
:
'center'
,
key
:
'storageCount'
,
},
{
title
:
'差异数量'
,
dataIndex
:
'differenceCount'
,
align
:
'center'
,
key
:
'differenceCount'
,
},
]
// 订单发货记录
const
OrderSaleRecord
:
React
.
FC
<
OrderSaleRecordProps
>
=
(
props
)
=>
{
const
{
data
,
reloadFormData
}
=
useContext
(
OrderDetailContext
)
const
{
orderReceivingStatisticsResponses
,
orderDeliveryDetailsResponses
}
=
data
const
sideOrderCols
:
any
[]
=
[
{
title
:
'发货批次'
,
dataIndex
:
'deliveryBatch'
,
align
:
'center'
,
key
:
'deliveryBatch'
},
{
title
:
'发货单号'
,
dataIndex
:
'deliveryNo'
,
align
:
'center'
,
key
:
'deliveryNo'
,
},
{
title
:
'发货时间'
,
dataIndex
:
'deliveryTime'
,
align
:
'center'
,
key
:
'deliveryTime'
,
render
:
text
=>
formatTimeString
(
text
)
},
{
title
:
'物流单号'
,
dataIndex
:
'logisticsNo'
,
align
:
'center'
,
key
:
'logisticsNo'
,
},
{
title
:
'物流公司'
,
dataIndex
:
'logisticsCompanyName'
,
align
:
'center'
,
key
:
'logisticsCompanyName'
},
{
title
:
'入库单号'
,
dataIndex
:
'storageNo'
,
align
:
'center'
,
key
:
'storageNo'
,
},
{
title
:
'入库时间'
,
dataIndex
:
'storageTime'
,
align
:
'center'
,
key
:
'storageTime'
,
render
:
text
=>
formatTimeString
(
text
)
},
{
title
:
'内部状态'
,
dataIndex
:
'interiorState'
,
align
:
'center'
,
key
:
'interiorState'
,
render
:
text
=>
<
StatusColors
type=
'deliveInside'
status=
{
text
}
/>
},
{
title
:
'操作'
,
dataIndex
:
'ctl'
,
align
:
'center'
,
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
<>
{
record
.
interiorState
===
DeliverySideState
.
CONFIRM_RECEIPT_ORDER
&&
<
Button
type=
'link'
onClick=
{
()
=>
handleReturn
(
record
)
}
>
确认回单
</
Button
>
}
{
record
.
interiorState
===
DeliverySideState
.
ADD_LOGISTICS_ORDER
&&
<
Button
type=
'link'
onClick=
{
()
=>
handleConfirm
(
record
)
}
>
确认发货
</
Button
>
}
</>
},
]
// 确认发货
const
handleConfirm
=
async
(
record
)
=>
{
const
params
=
{
orderId
:
record
.
orderId
,
id
:
record
.
id
}
await
PublicApi
.
postOrderConfirmShipmentOrder
(
params
)
reloadFormData
&&
reloadFormData
()
}
// 确认回单
const
handleReturn
=
async
(
record
)
=>
{
const
params
=
{
orderId
:
record
.
orderId
,
id
:
record
.
id
}
await
PublicApi
.
postOrderReceiptOrderConfirmed
(
params
)
reloadFormData
&&
reloadFormData
()
}
return
(
<
MellowCard
style=
{
{
marginTop
:
24
}
}
bordered=
{
false
}
id=
'deleveBox'
>
<
Tabs
defaultActiveKey=
"2"
animated=
{
false
}
>
<
Tabs
.
TabPane
tab=
'订单发货统计'
key=
"1"
>
<
Table
columns=
{
outOrderCols
}
dataSource=
{
orderReceivingStatisticsResponses
}
pagination=
{
false
}
rowKey=
"id"
/>
</
Tabs
.
TabPane
>
<
Tabs
.
TabPane
tab=
'订单发货明细'
key=
"2"
>
<
NestTable
NestColumns=
{
[
sideOrderCols
,
sideChildrenCols
]
}
rowKey=
'id'
childrenDataKey=
'orderDeliveryProducts'
dataSource=
{
orderDeliveryDetailsResponses
}
/>
</
Tabs
.
TabPane
>
</
Tabs
>
</
MellowCard
>
)
}
OrderSaleRecord
.
defaultProps
=
{}
export
default
OrderSaleRecord
\ No newline at end of file
src/pages/transaction/saleOrder/addSaleDelevedOrder/model/useSelfTable.tsx
View file @
2cc771f1
...
...
@@ -35,7 +35,7 @@ export const useSelfTable = () => {
// <EyePreview url={`/memberCenter/tranactionAbility/purchaseOrder/orderPreview?page_type=-1&id=${record.id}&preview=1`}>
// {text}
// </EyePreview>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/
purchaseOrder/orderP
review?id=${record.id}`
}
>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/
saleOrder/addSaleDelevedOrder/p
review?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
)
...
...
src/pages/transaction/saleOrder/readyConfirmDelevedOrder/detail/index.tsx
View file @
2cc771f1
...
...
@@ -16,7 +16,7 @@ const ReadyConfirmDelevedOrderDetail: React.FC = () => {
const
{
formContext
,
id
,
detailList
}
=
useOrderDetail
({
type
:
'saleOrder'
})
// 是否是手工发货
const
isHandDeleved
=
formContext
&&
formContext
.
data
.
purchaseOrderInteriorState
===
SaleOrderInsideWorkState
.
HAND_DELEVED_ORDER
const
isHandDeleved
=
formContext
&&
formContext
.
data
&&
formContext
.
data
.
purchaseOrderInteriorState
===
SaleOrderInsideWorkState
.
HAND_DELEVED_ORDER
const
approvedRef
=
useRef
<
any
>
({})
...
...
src/pages/transaction/saleOrder/readyConfirmDelevedOrder/model/useSelfTable.tsx
View file @
2cc771f1
...
...
@@ -32,10 +32,7 @@ export const useSelfTable = () => {
render
:
(
text
,
record
)
=>
{
// 查看订单, 需根据状态显示不同schema
return
(
// <EyePreview url={`/memberCenter/tranactionAbility/purchaseOrder/orderPreview?page_type=-1&id=${record.id}&preview=1`}>
// {text}
// </EyePreview>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/purchaseOrder/orderPreview?id=${record.id}`
}
>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/saleOrder/readyConfirmDelevedOrder/preview?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
)
...
...
src/pages/user/forgetPwd.tsx
View file @
2cc771f1
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
Form
,
Steps
,
Button
,
Row
,
Col
,
Radio
,
Divider
,
Tooltip
,
Upload
,
message
,
Input
as
AntdInput
}
from
'antd'
import
{
UploadOutlined
,
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
import
styles
from
'./index.less'
import
React
,
{
useState
,
Fragment
}
from
'react'
;
import
cx
from
'classnames'
;
import
{
Row
}
from
'antd'
;
import
{
Link
,
Helmet
}
from
'umi'
import
{
FormPage
,
RiskCheck
}
from
'god'
import
{
IFormControllers
,
IFormButtonTypes
}
from
'god/dist/src/form-page'
import
'./index.less'
import
globalStyles
from
'@/global/styles/global.less'
import
cx
from
'classnames'
import
{
Link
,
history
}
from
'umi'
import
im_success
from
'../../../mockStatic/im_success.png'
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
useCountDown
from
'@/utils/hooks'
;
import
{
GlobalConfig
}
from
'@/global/config'
;
import
{
omit
,
transFormSchema
}
from
'@/utils'
;
import
{
PATTERN_MAPS
}
from
'@/constants/regExp'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
schemas
from
'./schema'
;
import
{
forgetPwdSchema
}
from
'./schema'
;
const
{
onFieldValueChange$
}
=
FormEffectHooks
const
GetBack
:
React
.
FC
=
()
=>
{
const
[
validButton
,
setValidButton
]
=
useState
(
true
)
let
formCache
:
any
=
{}
const
CustomInput
=
props
=>
{
const
{
help
,
...
restProps
}
=
props
return
(
<
AntdInput
{
...
restProps
}
addonAfter=
{
help
?
<
Tooltip
title=
{
help
}
><
QuestionCircleOutlined
style=
{
{
color
:
'#909399'
,
marginLeft
:
5
}
}
/></
Tooltip
>
:
undefined
}
/>
)
}
// 检验联动
const
useLinkageValidateEffects
=
()
=>
{
const
{
setFieldState
,
getFieldState
}
=
createFormActions
()
onFieldValueChange$
(
'*(password,confirmPassword)'
).
subscribe
(
fieldState
=>
{
const
selfName
=
fieldState
.
name
const
selfValue
=
fieldState
.
value
const
otherName
=
selfName
==
'password'
?
'confirmPassword'
:
'password'
const
otherValue
=
getFieldState
(
otherName
,
state
=>
state
.
value
)
setFieldState
(
otherName
,
state
=>
{
if
(
selfValue
&&
otherValue
&&
selfValue
!==
otherValue
)
{
state
.
errors
=
[
'两次密码输入不一致'
]
}
else
{
state
.
errors
=
[
''
]
}
})
setFieldState
(
selfName
,
state
=>
{
if
(
selfValue
&&
otherValue
&&
selfValue
!==
otherValue
)
{
state
.
errors
=
[
'两次密码输入不一致'
]
}
else
{
state
.
errors
=
[
''
]
}
})
})
}
let
timeChange
:
any
;
// 定时器
const
actions
=
createFormActions
()
const
UserForgetPwd
=
()
=>
{
const
[
current
,
setCurrent
]
=
useState
(
0
)
const
[
subStep
,
setSubStep
]
=
useState
(
false
)
const
stepList
=
[
{
title
:
'填写信息'
,
key
:
'message'
,
name
:
'message'
},
{
title
:
'完善资料'
,
key
:
'over'
,
name
:
'over'
},
{
title
:
'等待审核'
,
key
:
'wait'
,
name
:
'wait'
},
{
title
:
'注册成功'
,
key
:
'success'
,
name
:
'success'
},
]
const
[
time
,
setTime
]
=
useState
(
5
);
// timer
// useEffect(() => {
// clearInterval(timeChange)
// handleRegisterTypeList()
// }, [])
const
[
asyncSchema
,
setAsyncSchema
]
=
useState
(()
=>
{
return
schemas
[
`schema
${
current
}
`
]
})
useEffect
(()
=>
{
setAsyncSchema
(
schemas
[
`schema
${
current
}
`
])
if
(
current
===
2
)
runTimerJump
()
},
[
current
,
actions
])
useEffect
(()
=>
{
if
(
time
===
0
)
{
clearInterval
(
timeChange
)
setTime
(
60
)
history
.
push
(
'/user/login'
)
console
.
log
(
'执行登录跳转!'
)
}
},
[
time
])
const
runTimerJump
=
()
=>
{
timeChange
=
setInterval
(()
=>
setTime
(
t
=>
--
t
),
1000
)
const
finish
=
(
value
:
any
)
=>
{
console
.
log
(
value
,
'finish'
)
}
const
normFile
=
(
e
:
any
)
=>
{
if
(
Array
.
isArray
(
e
))
{
return
e
;
}
return
e
&&
e
.
fileList
;
const
handleSubmit
=
(
value
:
any
)
=>
{
console
.
log
(
value
,
'handleSubmit'
)
}
const
checkoutFile
=
(
rule
:
any
,
value
:
any
)
=>
{
if
(
value
&&
value
.
length
)
{
let
length
=
value
.
length
let
obj
=
value
[
length
-
1
]
const
isLt5M
=
obj
.
size
/
1024
/
1024
<
5
;
if
(
isLt5M
)
{
return
Promise
.
resolve
();
}
else
{
return
Promise
.
reject
(
'附件大小不能超过5M!'
);
}
}
else
{
return
Promise
.
reject
();
}
}
const
getBcakForm
:
IFormControllers
[]
=
[
{
type
:
'Input'
,
name
:
'phonemail'
,
span
:
24
,
inputProps
:
{
type
:
'phonemail'
,
placeholder
:
'请输入您的邮箱/手机'
,
},
rules
:
[
{
required
:
true
,
message
:
'邮箱/手机为必填项!'
}
]
},
// {
// span: 24,
// // @ts-ignore
// custom: () => <RiskCheck />
// },
{
type
:
'Verification'
,
name
:
'smsCode'
,
span
:
24
,
inputProps
:
{
const
beforeUpload
=
(
file
:
any
)
=>
{
const
isLt5M
=
file
.
size
/
1024
/
1024
<
5
;
if
(
!
isLt5M
)
{
message
.
error
(
'附件大小不能超过5M!'
);
}
},
{
type
:
'Input'
,
name
:
'password'
,
span
:
24
,
inputProps
:
{
type
:
'password'
,
placeholder
:
'设置你的密码'
,
},
rules
:
[
{
required
:
true
,
message
:
'密码为必填项!'
},
{
pattern
:
/^
(?=
.*
[
a-z
])(?=
.*
[
A-Z
])(?=
.*
\d)[^]{8,20}
$/
,
message
:
'密码长度8-20个字符,必须包含大小写字母和数字!'
}
],
},
{
type
:
'Input'
,
name
:
'confirm'
,
span
:
24
,
dependencies
:
[
'password'
],
inputProps
:
{
type
:
'password'
,
placeholder
:
'请再次输入密码'
,
},
rules
:
[
{
required
:
true
,
message
:
'请再次确认密码!'
},
({
getFieldValue
})
=>
({
validator
(
rule
,
value
)
{
if
(
!
value
||
getFieldValue
(
'password'
)
===
value
)
{
return
Promise
.
resolve
();
}
return
Promise
.
reject
(
'两次的密码输入不一致!'
);
},
}),
]
},
]
const
getBackButtons
:
IFormButtonTypes
[]
=
[
{
text
:
'提交'
,
type
:
'primary'
,
htmlType
:
'submit'
,
block
:
true
,
disabled
:
false
,
}
console
.
log
(
isLt5M
)
return
isLt5M
;
}
const
{
text
,
isActive
,
start
}
=
useCountDown
({
maxTime
:
60
,
minTime
:
0
,
initText
:
'获取验证码'
,
onEnd
:
()
=>
{
},
decayRate
:
1
,
delay
:
1
*
1000
})
const
handleActionBtn
=
()
=>
{
// 校验后触发跳转
actions
.
submit
(
data
=>
{
actions
.
dispatch
(
'onFormStepNext'
,
{})
formCache
=
Object
.
assign
({},
formCache
,
data
)
}).
then
(()
=>
{
setCurrent
(
current
+
1
)
})
}
const
nextStepAction
=
()
=>
{
actions
.
submit
().
then
(
data
=>
{
const
{
values
}
=
data
formCache
=
Object
.
assign
({},
values
,
formCache
)
const
{
businessTypeId
,
typeId
}
=
values
PublicApi
.
getMemberMenuRegisterDetail
({
businessTypeId
,
memberTypeId
:
typeId
}).
then
(
res
=>
{
const
{
data
}
=
res
// 动态渲染第三步
setAsyncSchema
(
transFormSchema
(
data
))
setSubStep
(
true
)
})
})
}
// @todo 注册成功后 交互功能未完成
const
submitForm
=
()
=>
{
actions
.
submit
().
then
(
data
=>
{
const
{
values
}
=
data
formCache
=
Object
.
assign
({},
values
,
formCache
)
// 写死传入的区号
formCache
.
countryCode
=
'+86'
const
params
=
omit
(
formCache
,
[
'isRead'
,
'confirmPassword'
])
PublicApi
.
postMemberRegister
(
params
).
then
(()
=>
{
actions
.
dispatch
(
'onFormStepNext'
,
{})
setCurrent
(
current
+
1
)
})
})
}
]
return
(
<
div
className=
{
cx
(
styles
.
register
,
globalStyles
.
lingxiBusinessContent1024
)
}
>
<
div
className=
{
cx
(
styles
.
registerBox
,
globalStyles
.
lingxiBusinessMarginContent
)
}
>
<
NiceForm
id=
'registerForm'
schema=
{
asyncSchema
}
actions=
{
actions
}
components=
{
{
CustomInput
}
}
effects=
{
()
=>
{
useLinkageValidateEffects
()
}
}
expressionScope=
{
{
current
:
false
,
phoneBefore
:
<
div
className=
{
styles
.
formBefore
}
>
+86
</
div
>,
smsCodeAfter
:
<
Button
disabled=
{
isActive
}
style=
{
{
minWidth
:
110
,
marginLeft
:
8
}
}
size=
'large'
onClick=
{
start
}
>
{
text
}
</
Button
>,
checkBoxChildren
:
<
span
style=
{
{
fontSize
:
12
}
}
>
阅读并同意
<
span
className=
'commonPickColor'
>
《会员服务协议》《法律条款》《隐私政策》
</
span
></
span
>,
memberTypeTitle
:
<
span
className=
{
styles
.
commonPanelTitle
}
>
请选择您的身份
</
span
>,
businessTypeTitle
:
<
span
className=
{
styles
.
commonPanelTitle
}
>
请选择您要开展的业务
</
span
>,
}
}
/>
</
div
>
</
div
>
<
Fragment
>
<
Helmet
>
<
title
>
找回密码
</
title
>
</
Helmet
>
<
Row
className=
{
'getBackBox'
}
>
<
div
className=
{
cx
(
'getBackForm'
)
}
>
<
NiceForm
schema=
{
forgetPwdSchema
}
/>
</
div
>
</
Row
>
</
Fragment
>
)
}
export
default
UserForgetPwd
\ No newline at end of file
export
default
GetBack
src/pages/user/getBack.tsx
deleted
100644 → 0
View file @
7a872995
import
React
,
{
useState
,
Fragment
}
from
'react'
;
import
cx
from
'classnames'
;
import
{
Row
}
from
'antd'
;
import
{
Link
,
Helmet
}
from
'umi'
import
{
FormPage
,
RiskCheck
}
from
'god'
import
{
IFormControllers
,
IFormButtonTypes
}
from
'god/dist/src/form-page'
import
'./index.less'
const
GetBack
:
React
.
FC
=
()
=>
{
const
[
validButton
,
setValidButton
]
=
useState
(
true
)
const
finish
=
(
value
:
any
)
=>
{
console
.
log
(
value
,
'finish'
)
}
const
handleSubmit
=
(
value
:
any
)
=>
{
console
.
log
(
value
,
'handleSubmit'
)
}
const
getBcakForm
:
IFormControllers
[]
=
[
{
type
:
'Input'
,
name
:
'phonemail'
,
span
:
24
,
inputProps
:
{
type
:
'phonemail'
,
placeholder
:
'请输入您的邮箱/手机'
,
},
rules
:
[
{
required
:
true
,
message
:
'邮箱/手机为必填项!'
}
]
},
// {
// span: 24,
// // @ts-ignore
// custom: () => <RiskCheck />
// },
{
type
:
'Verification'
,
name
:
'smsCode'
,
span
:
24
,
inputProps
:
{
}
},
{
type
:
'Input'
,
name
:
'password'
,
span
:
24
,
inputProps
:
{
type
:
'password'
,
placeholder
:
'设置你的密码'
,
},
rules
:
[
{
required
:
true
,
message
:
'密码为必填项!'
},
{
pattern
:
/^
(?=
.*
[
a-z
])(?=
.*
[
A-Z
])(?=
.*
\d)[^]{8,20}
$/
,
message
:
'密码长度8-20个字符,必须包含大小写字母和数字!'
}
],
},
{
type
:
'Input'
,
name
:
'confirm'
,
span
:
24
,
dependencies
:
[
'password'
],
inputProps
:
{
type
:
'password'
,
placeholder
:
'请再次输入密码'
,
},
rules
:
[
{
required
:
true
,
message
:
'请再次确认密码!'
},
({
getFieldValue
})
=>
({
validator
(
rule
,
value
)
{
if
(
!
value
||
getFieldValue
(
'password'
)
===
value
)
{
return
Promise
.
resolve
();
}
return
Promise
.
reject
(
'两次的密码输入不一致!'
);
},
}),
]
},
]
const
getBackButtons
:
IFormButtonTypes
[]
=
[
{
text
:
'提交'
,
type
:
'primary'
,
htmlType
:
'submit'
,
block
:
true
,
disabled
:
false
,
}
]
return
(
<
Fragment
>
<
Helmet
>
<
title
>
找回密码
</
title
>
</
Helmet
>
<
Row
className=
{
'getBackBox'
}
>
<
div
className=
{
cx
(
'getBackForm'
)
}
>
<
div
className=
{
'formBox'
}
>
<
FormPage
renderFormLists=
{
getBcakForm
}
renderButtonLists=
{
getBackButtons
}
onSubmit=
{
handleSubmit
}
>
<
Row
justify=
'center'
align=
'middle'
>
<
Link
to=
'/user/login'
className=
{
'back'
}
>
返回登录页
</
Link
>
</
Row
>
</
FormPage
>
</
div
>
</
div
>
</
Row
>
</
Fragment
>
)
}
export
default
GetBack
src/pages/user/index.less
View file @
2cc771f1
...
...
@@ -303,7 +303,6 @@
.getBackBox {
position: relative;
padding-top: 60px;
&>h2 {
width: 100%;
.make-center(text);
...
...
@@ -315,7 +314,7 @@
margin-left: auto;
margin-right: auto;
width: 1190px;
padding-bottom: 60px;
.formBox {
width: 320px;
.make-center-space(margin, 40, 40);
...
...
src/pages/user/index.tsx
View file @
2cc771f1
...
...
@@ -27,7 +27,7 @@ const User: React.FC = () => {
}
const
forgetPassword
=
()
=>
{
history
.
push
(
'/user/
getBack
'
)
history
.
push
(
'/user/
forget
'
)
console
.
log
(
'找回密码'
)
}
...
...
src/pages/user/schema/index.ts
View file @
2cc771f1
...
...
@@ -182,16 +182,29 @@ export const forgetPwdSchema: ISchema = {
type
:
'string'
,
"x-rules"
:
[
{
pattern
:
PATTERN_MAPS
.
e
mail
,
message
:
'请输入正确的邮箱'
}
pattern
:
PATTERN_MAPS
.
phoneAndE
mail
,
message
:
'请输入正确的邮箱
/手机号
'
}
,
],
"x-component-props"
:
{
placeholder
:
'请输入你的邮箱(选填)'
,
size
:
'large'
,
type
:
'email'
placeholder
:
'请您输入邮箱/手机'
,
size
:
'large'
}
},
smsCode
:
{
type
:
'string'
,
"x-component"
:
'Phone'
,
required
:
true
,
"x-rules"
:
[
{
pattern
:
PATTERN_MAPS
.
smsCode
,
message
:
'请输入正确的6位验证码'
}
],
"x-component-props"
:
{
size
:
'large'
}
}
}
}
}
...
...
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