Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
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
project
jinfa-admin
Commits
75bd82e0
Commit
75bd82e0
authored
Nov 18, 2020
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改微信支付参水
parent
92391f11
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
87 deletions
+92
-87
global.d.ts
src/global/config/global.d.ts
+1
-1
settingModal.tsx
...tingManage/components/PayForm/components/settingModal.tsx
+19
-16
settingIndex.tsx
src/pages/ruleSettingManage/paySetting/settingIndex.tsx
+72
-70
No files found.
src/global/config/global.d.ts
View file @
75bd82e0
...
...
@@ -50,7 +50,7 @@ export interface ShopInfo {
type
:
number
;
environment
:
number
;
logoUrl
:
string
;
describe
?:
any
;
describe
:
string
;
state
:
number
;
url
:
string
;
}
...
...
src/pages/ruleSettingManage/components/PayForm/components/settingModal.tsx
View file @
75bd82e0
...
...
@@ -5,7 +5,7 @@ import {
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
import
{
Input
,
FormMegaLayout
}
from
'@formily/antd-components'
import
{
Input
,
FormMegaLayout
,
Select
}
from
'@formily/antd-components'
import
{
PublicApi
}
from
'@/services/api'
export
interface
Params
{
id
?:
any
,
...
...
@@ -20,24 +20,28 @@ export interface Params {
const
actions
=
createFormActions
()
const
{
onFieldChange$
}
=
FormEffectHooks
const
comfirmDialog
:
React
.
FC
<
Params
>
=
(
props
)
=>
{
const
handleCancel
=
()
=>
{
}
const
[
payWayCode
,
setPayWayCode
]
=
useState
<
any
>
([]);
const
handletOk
=
(
values
:
any
)
=>
{
let
value
=
{
...
values
}
if
(
props
.
type
){
value
.
type
=
props
.
type
}
console
.
log
(
'列表'
,
value
)
props
.
onOK
(
value
)
}
useEffect
(()
=>
{
return
()
=>
{
}
PublicApi
.
getPayGetPayWayCodeTypeEnum
().
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
const
{
data
}
=
res
;
const
arr
:
any
=
[];
data
.
forEach
(
item
=>
{
arr
.
push
({
label
:
item
.
type
,
value
:
item
.
name
})
})
setPayWayCode
(
arr
)
}
})
},
[])
const
useFormEffects
=
()
=>
{
const
{
setFieldState
}
=
createFormActions
()
...
...
@@ -56,10 +60,9 @@ const comfirmDialog: React.FC<Params> = (props) => {
cancelText=
'取消'
>
<
SchemaForm
labelCol=
{
3
}
components=
{
{
Input
,
Radio
:
Radio
.
Group
,
TextArea
:
Input
.
TextArea
Input
,
Radio
:
Radio
.
Group
,
TextArea
:
Input
.
TextArea
,
Select
}
}
actions=
{
actions
}
effects=
{
()
=>
useFormEffects
()
}
...
...
@@ -72,11 +75,11 @@ const comfirmDialog: React.FC<Params> = (props) => {
name=
'code'
title=
'参数代码'
required
enum=
{
payWayCode
}
x
-
component
-
props=
{
{
placeholder
:
''
,
placeholder
:
''
}
}
x
-
component=
"Input"
x
-
component=
"Select"
/>
<>
<
Field
...
...
src/pages/ruleSettingManage/paySetting/settingIndex.tsx
View file @
75bd82e0
...
...
@@ -4,8 +4,8 @@
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-21 15:05:26
*/
import
React
,
{
useEffect
,
useState
,
useRef
}
from
'react'
import
{
Card
,
Button
,
Tabs
,
Radio
,
Space
,
Row
,
Col
,
Table
,
Popconfirm
}
from
'antd'
import
React
,
{
useEffect
,
useState
,
useRef
,
Fragment
}
from
'react'
import
{
Card
,
Button
,
Tabs
,
Radio
,
Space
,
Row
,
Col
,
Table
,
Popconfirm
}
from
'antd'
import
{
PlusOutlined
,
SaveOutlined
}
from
'@ant-design/icons'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
EyePreview
from
'@/components/EyePreview'
...
...
@@ -22,8 +22,8 @@ import '../components/PayForm/components/index.less'
const
payActions
=
createFormActions
()
const
{
TabPane
}
=
Tabs
const
{
onFieldValueChange$
}
=
FormEffectHooks
const
TabList
:
any
=
GlobalConfig
.
payConfig
.
payPlatformPayConfig
||
[]
console
.
log
(
'初始化payConfig'
,
GlobalConfig
.
payConfig
.
payPlatformPayConfig
)
const
TabList
:
any
=
GlobalConfig
.
payConfig
.
payPlatformPayConfig
||
[]
console
.
log
(
'初始化payConfig'
,
GlobalConfig
.
payConfig
.
payPlatformPayConfig
)
const
PaySetting
:
React
.
FC
<
{}
>
=
()
=>
{
const
ref
=
useRef
<
any
>
({})
const
[
mode
,
setmode
]
=
useState
<
number
>
(
0
)
...
...
@@ -54,13 +54,13 @@ const PaySetting: React.FC<{}> = () => {
}
const
handleEdit
=
(
record
:
any
,
type
:
number
|
string
,
index
:
number
)
=>
{
setvisible
(
true
)
setmode
(
1
)
//编辑还是新增
settype
(
type
)
setlistID
(
record
.
id
)
setinitialValues
(
record
)
console
.
log
(
'类型'
,
type
,
'下标'
,
index
,
'record'
,
record
,
'listID:'
,
listID
)
console
.
log
(
'类型'
,
type
,
'下标'
,
index
,
'record'
,
record
,
'listID:'
,
listID
)
}
//删除
const
handleDeleteTable
=
(
type
:
number
,
id
:
number
,
index
)
=>
{
...
...
@@ -88,11 +88,11 @@ const PaySetting: React.FC<{}> = () => {
setvisible
(
false
)
// console.log('选项卡:', tabid, '数据', obj,'mode:',mode)
if
(
mode
===
0
)
{
if
(
type
==
1
||
type
==
3
)
{
if
(
mode
===
0
)
{
if
(
type
==
1
||
type
==
3
)
{
let
list
:
any
=
[]
obj
.
id
=
`obj-
${
payParametersListResponses
.
length
}
`
obj
.
payWayCodeTypeEnum
=
obj
.
code
list
.
push
(
obj
)
setpayParametersListResponses
([...
payParametersListResponses
,
...
list
])
sethasEdit
(
true
)
...
...
@@ -104,13 +104,13 @@ const PaySetting: React.FC<{}> = () => {
setpayParametersList
([...
payParametersList
,
...
list
])
sethasEdit
(
true
)
}
}
else
{
if
(
type
==
1
||
type
==
3
)
{
}
else
{
if
(
type
==
1
||
type
==
3
)
{
let
list
=
[...
payParametersListResponses
]
if
(
listID
)
{
list
.
forEach
((
v
,
i
)
=>
{
if
(
listID
==
v
.
id
)
{
if
(
listID
)
{
list
.
forEach
((
v
,
i
)
=>
{
if
(
listID
==
v
.
id
)
{
list
[
i
]
=
obj
}
})
...
...
@@ -118,11 +118,11 @@ const PaySetting: React.FC<{}> = () => {
setpayParametersListResponses
([...
list
])
sethasEdit
(
true
)
}
else
if
(
type
==
2
)
{
//支付宝银行卡
}
else
if
(
type
==
2
)
{
//支付宝银行卡
let
list
=
[...
payParametersList
]
if
(
listID
)
{
list
.
forEach
((
v
,
i
)
=>
{
if
(
listID
==
v
.
id
)
{
if
(
listID
)
{
list
.
forEach
((
v
,
i
)
=>
{
if
(
listID
==
v
.
id
)
{
list
[
i
]
=
obj
}
})
...
...
@@ -214,16 +214,16 @@ const PaySetting: React.FC<{}> = () => {
<
PageHeaderWrapper
extra=
{
hasEdit
?
<
Popconfirm
title=
"配置已修改,是否保存?"
okText=
"是"
cancelText=
"否"
onConfirm=
{
()
=>
handleSubmit
()
}
>
<
Button
type=
"primary"
icon=
{
<
SaveOutlined
/>
}
>
保存
<
Popconfirm
title=
"配置已修改,是否保存?"
okText=
"是"
cancelText=
"否"
onConfirm=
{
()
=>
handleSubmit
()
}
>
<
Button
type=
"primary"
icon=
{
<
SaveOutlined
/>
}
>
保存
</
Button
>
</
Popconfirm
>
:
<
Button
type=
"primary"
onClick=
{
()
=>
handleSubmit
()
}
icon=
{
<
SaveOutlined
/>
}
>
保存
</
Popconfirm
>
:
<
Button
type=
"primary"
onClick=
{
()
=>
handleSubmit
()
}
icon=
{
<
SaveOutlined
/>
}
>
保存
</
Button
>
}
>
...
...
@@ -232,52 +232,54 @@ const PaySetting: React.FC<{}> = () => {
<
Tabs
onTabClick=
{
(
e
)
=>
changeTab
(
e
)
}
type=
"card"
>
{
TabList
.
map
((
v
,
i
)
=>
{
return
<>
<
TabPane
tab=
{
`${v.way}`
}
key=
{
v
.
id
}
>
<
Space
size=
{
49
}
>
<
span
>
是否开启
{
v
.
way
}
</
span
>
<
Radio
.
Group
className=
'radio-group-box'
size=
"small"
value=
{
isPitchOn
}
// defaultValue=
{0}
buttonStyle=
"solid"
options=
{
options
}
optionType=
"button"
onChange=
{
value
=>
changeRadio
(
value
)
}
/>
</
Space
>
{
return
(
<
Fragment
key=
{
`tab-${i}`
}
>
<
TabPane
tab=
{
`${v.way}`
}
key=
{
v
.
id
}
>
<
Space
size=
{
49
}
>
<
span
>
是否开启
{
v
.
way
}
</
span
>
<
Radio
.
Group
className=
'radio-group-box'
size=
"small"
value=
{
isPitchOn
}
// defaultValue=
{0}
buttonStyle=
"solid"
options=
{
options
}
optionType=
"button"
onChange=
{
value
=>
changeRadio
(
value
)
}
/>
</
Space
>
{
(
v
.
id
===
1
||
v
.
id
===
2
)
&&
<
Row
>
(
v
.
id
===
1
||
v
.
id
===
2
)
&&
<
Row
>
<
Col
><
div
style=
{
{
borderLeft
:
'2px solid #00B37A'
,
margin
:
'41px 0 8px'
,
padding
:
'1px 5px'
}
}
>
{
v
.
way
}
参数配置
</
div
></
Col
>
<
Col
span=
{
24
}
>
<
Table
dataSource=
{
payParametersListResponses
}
columns=
{
tableColumns
}
pagination=
{
false
}
/>
{
v
.
id
==
1
?
<
Col
><
div
style=
{
{
borderLeft
:
'2px solid #00B37A'
,
margin
:
'41px 0 8px'
,
padding
:
'1px 5px'
}
}
>
{
v
.
way
}
参数配置
</
div
></
Col
>
<
Col
span=
{
24
}
>
<
Table
dataSource=
{
payParametersListResponses
}
columns=
{
tableColumns
}
pagination=
{
false
}
/>
{
v
.
id
==
1
?
<
Button
style=
{
{
marginBottom
:
16
,
marginTop
:
24
}
}
block
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
handleAddMemberBtn
(
`${v.id}`
,
1
)
}
type=
'dashed'
>
新增参数配置
</
Button
>
:
<
Button
style=
{
{
marginBottom
:
16
,
marginTop
:
24
}
}
block
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
handleAddMemberBtn
(
`${v.id}`
,
3
)
}
type=
'dashed'
>
新增参数配置
</
Button
>
}
</
Col
>
<
Button
style=
{
{
marginBottom
:
16
,
marginTop
:
24
}
}
block
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
handleAddMemberBtn
(
`${v.id}`
,
1
)
}
type=
'dashed'
>
新增参数配置
</
Button
>
:
<
Button
style=
{
{
marginBottom
:
16
,
marginTop
:
24
}
}
block
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
handleAddMemberBtn
(
`${v.id}`
,
3
)
}
type=
'dashed'
>
新增参数配置
</
Button
>
}
</
Col
>
</
Row
>
</
Row
>
}
{
v
.
id
===
1
&&
<
Row
>
<
Col
><
div
style=
{
{
borderLeft
:
'2px solid #00B37A'
,
margin
:
'41px 0 8px'
,
padding
:
'1px 5px'
}
}
>
{
v
.
way
}
转账到银行卡参数配置
</
div
></
Col
>
<
Col
span=
{
24
}
>
<
Table
dataSource=
{
payParametersList
}
columns=
{
tableColumns
}
pagination=
{
false
}
/>
<
Button
style=
{
{
marginBottom
:
16
,
marginTop
:
24
}
}
block
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
handleAddMemberBtn
(
`${v.id}`
,
2
)
}
type=
'dashed'
>
新增参数配置
</
Button
>
</
Col
>
</
Row
>
}
</
TabPane
>
</>
}
{
v
.
id
===
1
&&
<
Row
>
<
Col
><
div
style=
{
{
borderLeft
:
'2px solid #00B37A'
,
margin
:
'41px 0 8px'
,
padding
:
'1px 5px'
}
}
>
{
v
.
way
}
转账到银行卡参数配置
</
div
></
Col
>
<
Col
span=
{
24
}
>
<
Table
dataSource=
{
payParametersList
}
columns=
{
tableColumns
}
pagination=
{
false
}
/>
<
Button
style=
{
{
marginBottom
:
16
,
marginTop
:
24
}
}
block
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
handleAddMemberBtn
(
`${v.id}`
,
2
)
}
type=
'dashed'
>
新增参数配置
</
Button
>
</
Col
>
</
Row
>
}
</
TabPane
>
</
Fragment
>
)
})
}
</
Tabs
>
...
...
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