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
bf32a0e6
Commit
bf32a0e6
authored
Dec 03, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: e账户认证对接初步个人认证
parent
d327f78d
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
112 additions
and
45 deletions
+112
-45
regExp.ts
src/constants/regExp.ts
+5
-6
index.tsx
src/pages/classAndProperty/propertyValue/index.tsx
+1
-2
index.tsx
src/pages/payandSettle/capitalAccounts/eAccount/index.tsx
+6
-5
index.tsx
...Settle/eAccountApprove/components/companyFinish/index.tsx
+1
-1
index.tsx
...ayandSettle/eAccountApprove/components/personal/index.tsx
+56
-9
index.tsx
...ettle/eAccountApprove/components/personalFinish/index.tsx
+1
-1
constant.tsx
src/pages/payandSettle/eAccountApprove/constant.tsx
+9
-0
useEDetail.tsx
...pages/payandSettle/eAccountApprove/effects/useEDetail.tsx
+29
-18
index.tsx
src/pages/payandSettle/eAccountApprove/index.tsx
+3
-3
index.tsx
...es/transaction/components/saleOrderProductTable/index.tsx
+1
-0
No files found.
src/constants/regExp.ts
View file @
bf32a0e6
...
...
@@ -3,7 +3,7 @@
* @Date: 2020-07-22 09:54:50
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-28 18:33:56
*/
*/
/**
* 正则表达式集合
*/
...
...
@@ -14,10 +14,10 @@ export const PATTERN_MAPS = {
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{3,}))?
$/
,
//座机
tel
:
/^
((
0
\d{2,3})
-
)?(\d{7,8})(
-
(\d{3,}))?
$/
,
//座机
smsCode
:
/^
\d{6}
$/
,
money
:
/^
\d
*
(?:\.\d{0,2})?
$/
,
weight
:
/^
\d
*
(?:\.\d{0,3})?
$/
,
weight
:
/^
\d
*
(?:\.\d{0,3})?
$/
,
quantity
:
/^
[
1-9
]
+
[
0-9
]
*$/
,
// 数量,大于等于1的正整数
identity
:
/
(
^
\d{15}
$
)
|
(
^
\d{18}
$
)
|
(
^
\d{17}(\d
|X|x
)
$
)
/
,
// 数量,大于等于1的正整数
}
\ No newline at end of file
identity
:
/
(
^
\d{15}
$
)
|
(
^
\d{18}
$
)
|
(
^
\d{17}(\d
|X|x
)
$
)
/
,
// 身份证
}
src/pages/classAndProperty/propertyValue/index.tsx
View file @
bf32a0e6
...
...
@@ -21,7 +21,7 @@ import Submit from '@/components/NiceForm/components/Submit'
import
{
ISchema
}
from
'@formily/antd'
;
import
{
clearModalParams
}
from
'@/utils'
;
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
;
import
{
getProductCustomerGetCustomerAttributeTree
,
getProductCustomerGetCustomerAttributeValueList
,
getProductPlatformGetSyncAttributeValueList
,
postProductCustomerDeleteCustomerAttributeValue
,
postProductCustomerUpdateCustomerAttributeValueStatus
}
from
'@/services/ProductV2Api'
;
import
{
getProductCustomerGetCustomerAttributeTree
,
getProductCustomerGetCustomerAttributeValueList
,
getProductPlatformGetSyncAttributeValueList
,
postProductCustomerDeleteCustomerAttributeValue
,
postProductCustomer
SyncAttributeValue
,
postProductCustomer
UpdateCustomerAttributeValueStatus
}
from
'@/services/ProductV2Api'
;
const
treeActions
=
createTreeActions
()
...
...
@@ -296,7 +296,6 @@ const PropertyValue: React.FC<{}> = () => {
const
handleAsyncOk
=
()
=>
{
setSyncLoading
(
true
)
if
(
rowSelectionCtl
.
selectedRowKeys
.
length
)
{
// @ts-ignore
postProductCustomerSyncAttributeValue
({
idList
:
rowSelectionCtl
.
selectedRowKeys
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
ref
?.
current
?.
reload
)
{
...
...
src/pages/payandSettle/capitalAccounts/eAccount/index.tsx
View file @
bf32a0e6
...
...
@@ -15,7 +15,7 @@ import { memberStatusMap, moveStatusMap, operationMap, statusMap } from '../../c
import
{
StandardTable
}
from
'god'
import
QRCode
from
'qrcode'
;
import
{
ScanOutlined
}
from
'@ant-design/icons'
import
{
getPayAssetAccountGet
AccountStatusRecord
,
getPayAssetAccountGetAccountTradeRecord
,
getPayAssetAccountGetAssetAccount
,
getPayAssetAccountGetRechargeResult
,
postPayAssetAccountRecharge
}
from
'@/services/PayV2Api'
import
{
getPayAssetAccountGet
RechargeResult
,
getPayEAccountAllInPayGetAccountDetail
,
getPayEAccountAllInPayGetEAccountStatusRecord
,
getPayEAccountAllInPayGetEAccountTradeRecord
,
postPayAssetAccountRecharge
}
from
'@/services/PayV2Api'
interface
rechargeItem
{
codeUrl
:
string
;
...
...
@@ -63,10 +63,11 @@ const EAccountDetail: React.FC<{}> = () => {
const
getAccountInfo
=
async
()
=>
{
const
{
id
=
161
}
=
history
.
location
.
query
setPageId
(
id
)
let
res
=
await
getPayAssetAccountGetAssetAccount
({
id
:
id
+
''
})
const
{
code
,
data
}
=
res
let
res
=
await
getPayEAccountAllInPayGetAccountDetail
({
id
:
id
+
''
})
const
{
code
,
data
,
message
:
msg
}
=
res
if
(
code
!==
1000
)
{
return
message
.
error
(
msg
)
}
setDetails
(
data
)
getPay
AssetAccountGetAccountStatusRecord
({
memberAssetAccountI
d
:
id
+
''
}).
then
(
res
=>
{
getPay
EAccountAllInPayGetEAccountStatusRecord
({
i
d
:
id
+
''
}).
then
(
res
=>
{
const
{
data
}
=
res
setMoveData
(
data
)
})
...
...
@@ -76,7 +77,7 @@ const EAccountDetail: React.FC<{}> = () => {
// 获取交易记录
const
fetchTradeData
=
(
params
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
getPay
AssetAccountGetAccountTradeRecord
({
memberAssetAccountId
:
history
.
location
.
query
.
id
+
''
,
...
params
}).
then
(
res
=>
{
getPay
EAccountAllInPayGetEAccountTradeRecord
({
...
params
}).
then
(
res
=>
{
const
{
data
}
=
res
resolve
(
data
)
})
...
...
src/pages/payandSettle/eAccountApprove/components/companyFinish/index.tsx
View file @
bf32a0e6
...
...
@@ -8,7 +8,7 @@ import { EDetailContext } from '../../constant'
const
CompanyFinish
:
React
.
FC
<
{}
>
=
()
=>
{
const
[
form
]
=
Form
.
useForm
();
const
eDetailContext
=
useContext
(
EDetailContext
)
const
{
ctl
,
finish
,
perfection
,
approved
}
=
eDetailContext
const
{
ctl
,
finish
,
perfection
}
=
eDetailContext
return
(<
div
>
<
MellowCard
headStyle=
{
{
borderBottom
:
'none'
}
}
title=
"企业信息"
id=
"companyInfo"
>
...
...
src/pages/payandSettle/eAccountApprove/components/personal/index.tsx
View file @
bf32a0e6
import
React
,
{
useContext
}
from
'react'
import
{
Button
,
Col
,
Form
,
Input
,
Row
,
Select
}
from
'antd'
import
MellowCard
from
'@/components/MellowCard'
;
import
{
EDetailContext
,
formItemLayout
,
prefixSelector
,
tailFormItemLayout
}
from
'../../constant'
;
import
{
BIND_PHONE
,
EDetailContext
,
formItemLayout
,
prefixSelector
,
tailFormItemLayout
}
from
'../../constant'
;
import
useCountDown
from
'@/utils/hooks'
;
import
{
PATTERN_MAPS
}
from
'@/constants/regExp'
;
import
{
postPayAllInPayPersonalCrate
,
postPayAllInPaySendVerificationCode
}
from
'@/services/PayV2Api'
;
/** 个人 初始认证 */
const
Personal
:
React
.
FC
<
{}
>
=
()
=>
{
const
{
Option
}
=
Select
;
const
[
form
]
=
Form
.
useForm
();
const
eDetailContext
=
useContext
(
EDetailContext
)
const
{
ctl
}
=
eDetailContext
const
{
ctl
,
reloadFormData
}
=
eDetailContext
const
onFinish
=
(
values
:
any
)
=>
{
ctl
.
setApproved
(
true
)
const
onFinish
=
async
(
values
:
any
)
=>
{
const
{
code
}
=
await
postPayAllInPayPersonalCrate
({...
values
})
if
(
code
===
1000
)
{
reloadFormData
()
}
console
.
log
(
'Received values of form: '
,
values
);
};
const
{
text
,
isActive
,
start
}
=
useCountDown
({
maxTime
:
60
,
minTime
:
0
,
initText
:
'获取验证码'
,
onEnd
:
()
=>
{
console
.
log
(
"end"
)
},
decayRate
:
1
,
delay
:
1
*
1000
})
const
handleSendSMS
=
()
=>
{
form
.
validateFields
([
'phone'
]).
then
(
result
=>
{
console
.
log
(
result
)
// 发送验证码
postPayAllInPaySendVerificationCode
({...
result
,
verificationCodeType
:
BIND_PHONE
}).
then
(
res
=>
{
res
.
code
===
1000
&&
start
()
})
})
}
return
(
<
MellowCard
headStyle=
{
{
borderBottom
:
'none'
}
}
title=
"个人认证"
>
<
Form
...
...
@@ -43,7 +68,7 @@ const Personal: React.FC<{}> = () => {
</
Form
.
Item
>
<
Form
.
Item
name=
"
t
ype"
name=
"
cardT
ype"
label=
"证件类型"
rules=
{
[
{
...
...
@@ -58,13 +83,17 @@ const Personal: React.FC<{}> = () => {
</
Form
.
Item
>
<
Form
.
Item
name=
"
idcard
"
name=
"
cardNo
"
label=
"证件号码"
rules=
{
[
{
required
:
true
,
message
:
'请输入证件号码'
,
},
{
pattern
:
PATTERN_MAPS
.
identity
,
message
:
'请输入证件号码'
}
]
}
>
<
Input
placeholder=
"请输入证件号码"
/>
...
...
@@ -73,7 +102,16 @@ const Personal: React.FC<{}> = () => {
<
Form
.
Item
name=
"phone"
label=
"手机号码"
rules=
{
[{
required
:
true
,
message
:
'请输入手机号码'
}]
}
rules=
{
[
{
required
:
true
,
message
:
'请输入手机号码'
},
{
pattern
:
PATTERN_MAPS
.
phone
,
message
:
'请输入手机号码'
}
]
}
>
<
Input
addonBefore=
{
prefixSelector
}
style=
{
{
width
:
'100%'
}
}
placeholder=
"请输入手机号码"
/>
</
Form
.
Item
>
...
...
@@ -84,13 +122,22 @@ const Personal: React.FC<{}> = () => {
<
Form
.
Item
name=
"captcha"
noStyle
rules=
{
[{
required
:
true
,
message
:
'请输入验证码'
}]
}
rules=
{
[
{
required
:
true
,
message
:
'请输入验证码'
},
{
pattern
:
/^
\d
{5}$/
,
message
:
'请输入验证码'
}
]
}
>
<
Input
placeholder=
"请输入验证码"
/>
</
Form
.
Item
>
</
Col
>
<
Col
span=
{
4
}
>
<
Button
>
获取验证码
</
Button
>
<
Button
disabled=
{
isActive
}
onClick=
{
handleSendSMS
}
>
{
text
}
</
Button
>
</
Col
>
</
Row
>
</
Form
.
Item
>
...
...
src/pages/payandSettle/eAccountApprove/components/personalFinish/index.tsx
View file @
bf32a0e6
...
...
@@ -9,7 +9,7 @@ import { EDetailContext, formItemLayout, tailFormItemLayout } from '../../consta
const
PersonalFinish
:
React
.
FC
<
{}
>
=
()
=>
{
const
[
form
]
=
Form
.
useForm
();
const
eDetailContext
=
useContext
(
EDetailContext
)
const
{
ctl
,
finish
,
perfection
,
approved
}
=
eDetailContext
const
{
ctl
,
finish
,
perfection
}
=
eDetailContext
const
onFinish
=
(
values
:
any
)
=>
{
ctl
.
setFinish
(
true
)
// 已经完善
...
...
src/pages/payandSettle/eAccountApprove/constant.tsx
View file @
bf32a0e6
...
...
@@ -2,6 +2,15 @@ import { createContext } from 'react';
import
{
Form
,
Select
}
from
'antd'
;
const
{
Option
}
=
Select
;
/**
* 绑定手机
*/
export
const
BIND_PHONE
=
9
;
/**
* 解绑手机
*/
export
const
UNBIND_PHONE
=
6
;
// e账户认证 组件切换控制 Context
export
const
EDetailContext
=
createContext
<
any
>
({})
...
...
src/pages/payandSettle/eAccountApprove/effects/useEDetail.tsx
View file @
bf32a0e6
import
{
getPayAllInPayGetAuthMemberInfo
,
postPayAllInPayCreateMember
,
postPayAllInPayGetMemberInfo
}
from
'@/services/PayV2Api'
;
import
{
getAuth
}
from
'@/utils/auth'
;
import
{
message
}
from
'antd'
;
import
{
useCallback
,
useState
,
useEffect
}
from
'react'
import
{
message
}
from
'antd'
/**
* 企业会员
*/
export
const
MEMBER_TYPE_CORPORATE
=
1
;
/**
* 个人会员
*/
export
const
MEMBER_TYPE_INDIVIDUAL
=
2
;
export
const
MEMBER_TYPE
=
{
[
MEMBER_TYPE_CORPORATE
]:
'company'
,
[
MEMBER_TYPE_INDIVIDUAL
]:
'personal'
,
};
export
const
useEDetail
=
()
=>
{
/** 详情数据 */
const
{
memberRoleType
}
=
getAuth
()
||
{}
/** 详情数据 null从未认证*/
const
[
formData
,
setFormData
]
=
useState
<
any
>
(
null
)
/** 企业/个人 */
const
[
type
,
setType
]
=
useState
<
'company'
|
'personal'
>
(
'company'
)
/** 是否认证过 */
const
[
approved
,
setApproved
]
=
useState
<
boolean
>
(
false
)
const
[
type
,
setType
]
=
useState
<
'company'
|
'personal'
>
(
MEMBER_TYPE
[
memberRoleType
])
/** 是否需要完善 */
const
[
perfection
,
setPerfection
]
=
useState
<
boolean
>
(
false
)
/** 是否完善过 */
...
...
@@ -21,32 +36,28 @@ export const useEDetail = () => {
reloadFormData
()
},
[])
const
reloadFormData
=
useCallback
(
async
()
=>
{
// const fn = switchApi(type);
// let params: any = {};
// params[switchParamField(type)] = id
// const { code, data, message: msg } = await fn(params, { ctlType: "none" })
// if (code === 1000) {
setFormData
({})
// } else {
// message.error(msg)
// }
const
{
code
,
data
,
message
:
msg
}
=
await
postPayAllInPayGetMemberInfo
({},
{
ctlType
:
'none'
})
if
(
code
===
1000
)
{
!
data
&&
await
postPayAllInPayCreateMember
({},
{
ctlType
:
'none'
})
setFormData
(
data
)
}
else
{
message
.
error
(
msg
)
}
},
[])
// 需共享的状态
const
formContext
=
{
data
:
formData
,
type
,
approved
,
//
approved,
finish
,
perfection
,
backed
,
showAnchor
,
ctl
:
{
setFormData
,
setApproved
,
//
setApproved,
setPerfection
,
setBacked
,
setShowAnchor
,
...
...
src/pages/payandSettle/eAccountApprove/index.tsx
View file @
bf32a0e6
...
...
@@ -14,11 +14,11 @@ const EAccountApprove: React.FC<{}> = () => {
const
{
type
,
approved
,
perfection
,
finish
,
backed
,
showAnchor
}
=
formContext
showAnchor
,
data
}
=
formContext
const
personalLinkList
=
[
{
title
:
'个人信息'
,
id
:
'personalInfo'
},
...
...
@@ -40,7 +40,7 @@ const EAccountApprove: React.FC<{}> = () => {
/>
<
div
className=
{
styles
.
wrapper
}
>
{
type
===
'personal'
?
(
approved
?
<
PersonalFinish
/>
:
<
Personal
/>)
:
(
approved
?
<
CompanyFinish
/>
:
<
Company
/>)
type
===
'personal'
?
(
data
?.
name
?
<
PersonalFinish
/>
:
<
Personal
/>)
:
(
data
?
<
CompanyFinish
/>
:
<
Company
/>)
}
</
div
>
</
EDetailContext
.
Provider
>
...
...
src/pages/transaction/components/saleOrderProductTable/index.tsx
View file @
bf32a0e6
...
...
@@ -548,6 +548,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
const
handleSubmitModifyPrice
=
()
=>
{
modifyPriceActions
.
submit
().
then
(
async
({
values
}:
any
)
=>
{
values
.
orderId
=
data
.
orderId
values
.
prices
=
[{
orderProductId
:
values
.
orderProductId
,
price
:
values
.
price
,
reason
:
values
.
reason
}]
console
.
log
(
values
)
const
result
=
await
runPrice
(
values
)
if
(
result
.
code
===
1000
)
{
...
...
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