Commit c4f535f0 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

fix: 修改商户支付参数配置BUG

parent 6c103fe5
......@@ -70,6 +70,13 @@ const router = {
component: '@/pages/systemManage/ruleSettingManage/merchantPayType/add',
hideInMenu: true
},
// 编辑参数配置
{
path: '/system/ruleSettingManager/merchantPayType/edit',
name: '编辑参数配置',
component: '@/pages/systemManage/ruleSettingManage/merchantPayType/add',
hideInMenu: true
},
{
path: '/system/ruleSettingManager/transactionRules',
name: '平台交易规则',
......
......@@ -26,10 +26,10 @@ export interface LevelBrandProps {
};
const PIC_MAP = {
1: IMG_LEVEL1,
2: IMG_LEVEL2,
3: IMG_LEVEL3,
4: IMG_LEVEL4,
1: IMG_LEVEL1,
2: IMG_LEVEL2,
3: IMG_LEVEL3,
4: IMG_LEVEL4,
};
const LevelBrand: React.FC<LevelBrandProps> = ({ level }) => {
......@@ -42,4 +42,4 @@ const LevelBrand: React.FC<LevelBrandProps> = ({ level }) => {
);
};
export default LevelBrand;
\ No newline at end of file
export default LevelBrand;
......@@ -34,6 +34,21 @@ const TAB_LINK = [
{ id: 'typeLayout', title: '参数配置' },
]
const Level = (type) => {
switch (type) {
case '青铜会员':
return 1
case '白银会员':
return 2
case '黄金会员':
return 3
case '钻石会员':
return 4
default:
return 10086
}
}
const MerchantPayTypeAdded = (props) => {
const { state, pathname } = history.location;
const [path] = useState(pathname.split('/')[pathname.split('/').length - 1]);
......@@ -124,7 +139,13 @@ const MerchantPayTypeAdded = (props) => {
const handleSubmit = (_: string[] | number[], selectRowRecord: any) => {
form.setFieldsValue({ 'name': selectRowRecord[0].name })
setMenberInfo(selectRowRecord[0])
const param = {
...selectRowRecord[0],
fundModeName: '会员直接到账',
payTypeName: '线上支付',
payChannelName: '支付宝',
}
setMenberInfo(param)
toggle(false)
}
......@@ -178,6 +199,7 @@ const MerchantPayTypeAdded = (props) => {
useEffect(() => {
if (!isEmpty(state?.record) && !isEmpty(channel)) {
form.setFieldsValue({ ...state?.record })
setMenberInfo(state?.record)
setDataSource([
{
......@@ -222,8 +244,8 @@ const MerchantPayTypeAdded = (props) => {
</Col>
<Col span={12}>
<Form.Item label='会员等级'>
{path !== 'detail' && <LevelBrand level={menberInfo.level} />}
{path === 'detail' && <Typography.Text>{menberInfo.levelTag}</Typography.Text>}
{path !== 'detail' && <LevelBrand level={menberInfo.levelTag ? Level(menberInfo.levelTag) : menberInfo.level} />}
{path === 'detail' && <LevelBrand level={Level(menberInfo.levelTag)} />}
</Form.Item>
<Form.Item label='资金归集模式'>
<Typography.Text>{menberInfo.fundModeName}</Typography.Text>
......@@ -249,7 +271,7 @@ const MerchantPayTypeAdded = (props) => {
pagination={false}
/>
{path !== 'detail' && <Button
disabled={dataSource.length > 1}
disabled={dataSource.length >= 1}
type='dashed'
block
icon={<PlusOutlined />}
......
......@@ -72,6 +72,11 @@ const MerchantPayTypeLayout = () => {
// render: (_text, record: any) => <LevelBrand level={record.level} />
},
{
title: '资金归集模式',
key: 'fundModeName',
dataIndex: 'fundModeName',
},
{
title: '支付方式',
key: 'payTypeName',
dataIndex: 'payTypeName',
......@@ -106,6 +111,14 @@ const MerchantPayTypeLayout = () => {
删除
</Button>
</Popconfirm>
<Link
to={{
pathname: '/system/ruleSettingManager/merchantPayType/edit',
state: { record },
}}
>
编辑
</Link>
</>
)
}
......@@ -134,7 +147,7 @@ const MerchantPayTypeLayout = () => {
type: "object",
"x-component": "controllerBtns",
},
search: {
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment