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
40fba622
Commit
40fba622
authored
Aug 12, 2020
by
LeeJiancong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支付参数配置tab点击
parent
e7495c67
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
102 additions
and
86 deletions
+102
-86
global.d.ts
src/global/config/global.d.ts
+2
-24
RadioGroud.tsx
...ettingManage/components/PayForm/components/RadioGroud.tsx
+1
-1
settingModal.tsx
...tingManage/components/PayForm/components/settingModal.tsx
+7
-10
index.tsx
src/pages/ruleSettingManage/paySetting/index.tsx
+6
-8
index.tsx
src/pages/ruleSettingManage/schema/index.tsx
+86
-43
No files found.
src/global/config/global.d.ts
View file @
40fba622
...
...
@@ -13,26 +13,9 @@ export interface UseType {
businessType
:
BusinessType
[];
}
export
interface
Element
{
id
:
number
;
fieldName
:
string
;
fieldCNName
:
string
;
fieldType
:
string
;
fieldLength
:
number
;
fieldEmpty
:
number
;
fieldOrder
:
number
;
fieldRemark
:
string
;
checkRules
:
any
[];
}
export
interface
UseDetail
{
groupName
:
string
;
elements
:
Element
[];
}
export
interface
UserRegister
{
useType
:
UseType
;
useDetail
:
UseDetail
[]
;
useDetail
?:
any
;
}
export
interface
RuleConfiguration
{
...
...
@@ -53,18 +36,13 @@ export interface PayInitializeConfig {
payWayResponses
:
PayWayResponse
[];
}
export
interface
Pay
WayResponse
{
export
interface
Pay
PlatformPayConfig
{
id
:
number
;
payType
:
number
;
way
:
string
;
isPitchOn
:
number
;
}
export
interface
PayPlatformPayConfig
{
payType
:
number
;
payWayResponses
:
PayWayResponse
[];
}
export
interface
PayConfig
{
payInitializeConfig
:
PayInitializeConfig
[];
payPlatformPayConfig
:
PayPlatformPayConfig
[];
...
...
src/pages/ruleSettingManage/components/PayForm/components/RadioGroud.tsx
View file @
40fba622
...
...
@@ -7,7 +7,7 @@ const RadioGroud = (props:any) => {
<
Radio
.
Group
className=
'radio-group-box'
size=
"small"
defaultValue=
{
1
}
defaultValue=
{
0
}
buttonStyle=
"solid"
options=
{
options
}
optionType=
"button"
...
...
src/pages/ruleSettingManage/components/PayForm/components/settingModal.tsx
View file @
40fba622
...
...
@@ -14,7 +14,6 @@ export interface Params {
onCancel
:
Function
;
onOK
?:
Function
;
dontReceive
?:
boolean
;
//默认展示
tabOption
:
any
}
const
actions
=
createFormActions
()
const
{
onFieldChange$
}
=
FormEffectHooks
...
...
@@ -26,9 +25,8 @@ const comfirmDialog: React.FC<Params> = (props) => {
let
value
=
{
...
values
}
if
(
props
.
id
){
value
.
id
=
props
.
id
value
.
type
=
props
.
id
}
value
.
type
=
props
.
tabOption
.
type
PublicApi
.
postPayCollectionParametersAdd
(
value
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
props
.
onOK
()
...
...
@@ -67,7 +65,6 @@ const comfirmDialog: React.FC<Params> = (props) => {
effects=
{
()
=>
useFormEffects
()
}
onSubmit=
{
(
values
)
=>
handletOk
(
values
)
}
initialValues=
{
{
status
:
3
}
}
>
<
Field
...
...
@@ -83,7 +80,7 @@ const comfirmDialog: React.FC<Params> = (props) => {
<>
<
Field
title=
'参数值'
name=
"
freightPric
e"
name=
"
valu
e"
x
-
component=
"Input"
required
x
-
component
-
props=
{
{
...
...
@@ -99,7 +96,7 @@ const comfirmDialog: React.FC<Params> = (props) => {
{
/* <FormMegaLayout name='remarkOption' label='不接受原因' full required labelCol={2} labelAlign="top"> */
}
<
Field
title=
'参数描述'
name=
"
remark
"
name=
"
describe
"
x
-
component=
"TextArea"
required
x
-
component
-
props=
{
{
...
...
@@ -108,7 +105,7 @@ const comfirmDialog: React.FC<Params> = (props) => {
x
-
rules=
{
{
max
:
128
,
// maximum:10,//最大数值
message
:
'参数描述最多128个汉字'
//
message: '参数描述最多128个汉字'
}
}
/>
</>
...
...
@@ -120,8 +117,7 @@ const comfirmDialog: React.FC<Params> = (props) => {
}
comfirmDialog
.
defaultProps
=
{
dontReceive
:
true
,
tabOption
:{
tabOption
:
1
//1.支付宝 2.支付宝转账到银行卡参数配置 3.微信
}
id
:
1
//1.支付宝 2.支付宝转账到银行卡参数配置 3.微信
}
export
default
comfirmDialog
\ No newline at end of file
src/pages/ruleSettingManage/paySetting/index.tsx
View file @
40fba622
...
...
@@ -23,7 +23,7 @@ const PaySetting: React.FC<{}> = () => {
})
const
handleAddMemberBtn
=
(
type
:
number
)
=>
{
setid
(
''
)
setid
(
type
)
setvisible
(
true
)
}
const
handleDeleteTable
=
(
id
:
number
)
=>
{
...
...
@@ -33,8 +33,9 @@ const PaySetting: React.FC<{}> = () => {
setvisible
(
false
)
ref
.
current
.
reload
()
}
const
tableAddButton1
=
<
Button
style=
{
{
marginBottom
:
16
}
}
block
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
handleAddMemberBtn
(
1
)
}
type=
'dashed'
>
新增参数配置
</
Button
>
const
tableAddButton2
=
<
Button
style=
{
{
marginBottom
:
16
}
}
block
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
handleAddMemberBtn
(
2
)
}
type=
'dashed'
>
新增参数配置
</
Button
>
const
tableAddButton
=
<
Button
style=
{
{
marginBottom
:
16
}
}
block
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
handleAddMemberBtn
(
1
)
}
type=
'dashed'
>
新增参数配置1
</
Button
>
const
tableAddButton2
=
<
Button
style=
{
{
marginBottom
:
16
}
}
block
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
handleAddMemberBtn
(
2
)
}
type=
'dashed'
>
新增参数配置2
</
Button
>
const
tableAddButton3
=
<
Button
style=
{
{
marginBottom
:
16
}
}
block
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
handleAddMemberBtn
(
3
)
}
type=
'dashed'
>
新增参数配置3
</
Button
>
const
tableColumns
=
[
{
dataIndex
:
'code'
,
title
:
'参数代码'
,
align
:
'center'
},
{
dataIndex
:
'value'
,
align
:
'center'
,
title
:
'参数值'
,
render
:
(
_
,
record
)
=>
<
EyePreview
url=
{
`/memberCenter/memberAbility/manage/addMember?id=${record.memberId}&preview=1`
}
>
{
_
}
</
EyePreview
>
},
...
...
@@ -60,7 +61,7 @@ const PaySetting: React.FC<{}> = () => {
useEffect
(()
=>
{
PublicApi
.
getPayQueryPlatformDetails
().
then
(
res
=>
{
let
list
=
res
.
data
setinfoData
(
list
)
//
setinfoData(list)
})
return
()
=>
{
...
...
@@ -84,11 +85,9 @@ const PaySetting: React.FC<{}> = () => {
>
<
Card
>
<
PayForm
expressionScope=
{
{
tableColumns
,
tableAddButton1
,
tableAddButton2
,
tableAddButton
,
cardTableColumns
,
}
}
schema=
{
TabSetting
(
infoData
)
}
...
...
@@ -97,7 +96,6 @@ const PaySetting: React.FC<{}> = () => {
<
SettingModal
id=
{
id
}
type=
{
optionType
}
tabOption=
{
tabOption
}
dialogVisible=
{
visible
}
onCancel=
{
()
=>
setvisible
(
false
)
}
onOK
=
{()
=
>
handleModalOK}
...
...
src/pages/ruleSettingManage/schema/index.tsx
View file @
40fba622
...
...
@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-08-06 11:12:18
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-11
17:53:58
* @LastEditTime: 2020-08-11
20:48:22
*/
import
React
,
{
Component
}
from
'react'
import
{
ISchema
}
from
'@formily/antd'
...
...
@@ -213,66 +213,107 @@ export const paySetting: ISchema = {
//会员支付参数配置
export
const
TabSetting
=
(
props
:
any
[])
=>
{
let
list
=
GlobalConfig
.
payConfig
.
payPlatformPayConfig
let
list
=
// GlobalConfig.payConfig.payPlatformPayConfig
[{
id
:
1
,
isPitchOn
:
1
,
payType
:
1
,
way
:
"支付宝支付"
,
},
{
id
:
2
,
isPitchOn
:
1
,
payType
:
1
,
way
:
"微信"
,
},
{
id
:
3
,
isPitchOn
:
1
,
payType
:
2
,
way
:
"线上线下"
,
}
]
console
.
log
(
'初始哈'
,
list
)
let
tabItem
=
{}
props
.
forEach
((
v
,
i
)
=>
{
tabItem
[
`
tab-
${
i
+
1
}
`
]
=
{
list
.
forEach
((
v
,
i
)
=>
{
tabItem
[
`
${
v
.
id
}
`
]
=
{
"type"
:
'object'
,
"x-component"
:
'tabpane'
,
"x-component-props"
:
{
tab
:
v
.
way
},
properties
:
{
"isPitchOn"
:
{
type
:
'RadioGroud'
,
title
:
`是否开启
${
v
.
way
}
`
,
required
:
true
},
"alipayTitle"
:
{
type
:
'Text'
,
title
:
<
div
style=
{
{
borderLeft
:
'2px solid #00B37A'
,
padding
:
'1px 5px'
}
}
>
{
v
.
way
}
参数配置
</
div
>,
},
"payParametersList"
:
{
type
:
'array:number'
,
"x-component"
:
'PayTable'
,
"x-component-props"
:
{
rowKey
:
'id'
,
columns
:
"{{tableColumns}}"
,
suffix
:
"{{tableAddButton1}}"
}
},
"cardTitle"
:
{
type
:
'Text'
,
title
:
<
div
style=
{
{
borderLeft
:
'2px solid #00B37A'
,
padding
:
'1px 5px'
}
}
>
{
v
.
way
}
转账到银行卡参数配置
</
div
>,
required
:
true
,
"x-linkages"
:
[
{
type
:
'value:visible'
,
target
:
'megaLayout'
,
"condition"
:
"{{!!$value}}"
}
]
},
"payParametersListResponses"
:
{
type
:
'array:number'
,
"x-component"
:
'PayTable'
,
megaLayout
:
{
type
:
'object'
,
"x-component"
:
'mega-layout'
,
"x-component-props"
:
{
rowKey
:
'id'
,
columns
:
"{{cardTableColumns}}"
,
suffix
:
"{{tableAddButton2}}"
},
properties
:
{
"alipayTitle"
:
{
visible
:
v
.
payType
!=
2
,
type
:
'Text'
,
title
:
<
div
style=
{
{
borderLeft
:
'2px solid #00B37A'
,
padding
:
'1px 5px'
}
}
>
{
v
.
way
}
参数配置
</
div
>,
},
"payParametersList"
:
{
visible
:
v
.
payType
!=
2
,
type
:
'array:number'
,
"x-component"
:
'PayTable'
,
"x-component-props"
:
{
rowKey
:
'id'
,
columns
:
"{{tableColumns}}"
,
suffix
:
"{{tableAddButton}}"
}
},
"cardTitle"
:
{
visible
:
v
.
payType
!=
2
&&
v
.
id
!=
2
,
type
:
'Text'
,
title
:
<
div
style=
{
{
borderLeft
:
'2px solid #00B37A'
,
padding
:
'1px 5px'
}
}
>
{
v
.
way
}
转账到银行卡参数配置
</
div
>,
},
"payParametersListResponses"
:
{
visible
:
v
.
payType
!=
2
&&
v
.
id
!=
2
,
type
:
'array:number'
,
"x-component"
:
'PayTable'
,
"x-component-props"
:
{
rowKey
:
'id'
,
columns
:
"{{cardTableColumns}}"
,
suffix
:
"{{tableAddButton}}"
}
}
}
}
}
}
})
tabItem
[
`tab-
${
props
.
length
+
1
}
`
]
=
{
"type"
:
'object'
,
"x-component"
:
'tabpane'
,
"x-component-props"
:
{
tab
:
'线下支付'
},
properties
:
{
"isPitchOn"
:
{
type
:
'RadioGroud'
,
title
:
`是否开线下支付`
,
// required: true
}
}
}
//
tabItem[`tab-${props.length + 1}`] = {
//
"type": 'object',
//
"x-component": 'tabpane',
//
"x-component-props": {
//
tab: '线下支付'
//
},
//
properties: {
//
"isPitchOn": {
//
type: 'RadioGroud',
//
title: `是否开线下支付`,
//
// required: true
//
}
//
}
//
}
let
payTabSetting
:
ISchema
=
{
type
:
'object'
,
properties
:
{
...
...
@@ -281,6 +322,8 @@ export const TabSetting = (props: any[]) => {
"x-component"
:
'tab'
,
"x-component-props"
:
{
type
:
'card'
,
onChange
:
file
=>
console
.
log
(
file
),
onTabClick
:
file
=>
console
.
log
(
file
)
},
properties
:
{
...
tabItem
}
}
...
...
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