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

修改支付策略选择指定会员, 支付参数设置

parent 852b4096
......@@ -6,7 +6,7 @@
*/
import React, { useState, useEffect } from 'react';
import { history } from 'umi';
import { Button, Card, Tabs, Space, Input, InputNumber,message } from 'antd';
import { Button, Card, Tabs, Space, Input, InputNumber, message } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { PublicApi } from '@/services/api';
import PayWayRadio from './components/payWayRadio';
......@@ -101,30 +101,40 @@ const PayWaySetTemplate: React.FC<{}> = () => {
let wayName = '';
try {
payItem.forEach(item => {
if (item.way === '微信' && item.isPitchOn === 1) {
if (item.payWayId === 2 && item.isPitchOn === 1) {
console.log(1)
if(item.payParametersAddListRequests.length > 0) {
if (item.payParametersAddListRequests.length > 0) {
conditions = true
} else {
conditions = false
wayName = item.way
wayName = `${item.way}缺少支付参数配置`
throw new Error
}
} else if (item.way === '支付宝' && item.isPitchOn === 1) {
console.log(2)
if(item.payParametersAddListRequests.length > 0 && item.payParametersList.length > 0) {
} else if (item.payWayId === 1 && item.isPitchOn === 1) {
if (item.payParametersAddListRequests.length > 0 && item.payParametersList.length > 0) {
conditions = true
} else {
conditions = false
wayName = item.way
wayName = `${item.way}缺少支付参数配置`
throw new Error
}
} else if (item.payWayId === 6 && item.isPitchOn === 1) {
if (item.payParametersAddListRequests.length > 0) {
const data = item.payParametersAddListRequests[0]
if (data.code && data.value && data.describe) {
conditions = true
} else {
conditions = false
wayName = `请配置${item.way}的参数`
throw new Error
}
}
} else {
conditions = true
}
})
} catch {
message.error(`${wayName}缺少支付参数配置`)
message.error(wayName)
}
if (conditions) {
PublicApi.postPayCollectionParametersAdd({
......@@ -199,7 +209,7 @@ const PayWaySetTemplate: React.FC<{}> = () => {
/>
}
{
(payItem[idx].id === 6 && !!payItem[idx].isPitchOn) &&
(payItem[idx].payWayId === 6 && !!payItem[idx].isPitchOn) &&
<div style={{ marginTop: 42 }}>
<Space direction="horizontal" size={16}>
初始申请额度不超过
......
......@@ -45,8 +45,14 @@ const payActions = createFormActions()
* @return {type}
*/
const fetchMemberList = async (params) => {
const res = await PublicApi.getMemberManageAllProviderPage(params)
return res.data
return new Promise(resolve => {
PublicApi.getPayGetMembers(params).then(res => {
res.data.data.forEach((item:any) => {
item.name = item.memberName
})
resolve(res.data)
})
})
}
const PaySetting: React.FC<{}> = () => {
......@@ -74,7 +80,7 @@ const PaySetting: React.FC<{}> = () => {
},
{
title: '会员名称',
dataIndex: 'name',
dataIndex: 'memberName',
align: 'center',
key: 'name',
},
......
......@@ -17,24 +17,35 @@ const tailLayout = {
const { TextArea } = Input;
const Template:React.FC<{}> = () => {
const [form] = Form.useForm();
const [lodaing, setLodaing] = useState<boolean>(false);
const { pathname, query } = history.location;
const type = pathname.split('/')[pathname.split('/').length - 1];
const onFinish = (values: any) => {
if(type === 'add') {
PublicApi.postManageSensitiveWordAdd(values).then(res => {
if(res.code === 1000) {
history.goBack();
PublicApi.postManageSensitiveWordAdd({...values}, {ctlType: 'none'}).then(res => {
if (res.code === 1000) {
setTimeout(() => {
history.goBack();
}, 2000)
message.success('新增敏感词成功')
setLodaing(true)
}
}).catch(() => {
setLodaing(false)
})
}
else {
values.id = query.id;
PublicApi.postManageSensitiveWordUpdate(values).then(res => {
if(res.code === 1000) {
history.goBack();
PublicApi.postManageSensitiveWordUpdate({...values}, {ctlType: 'none'}).then(res => {
if (res.code === 1000) {
setTimeout(() => {
history.goBack();
}, 2000)
message.success('修改敏感词成功')
setLodaing(true)
}
}).catch(() => {
setLodaing(false)
})
}
}
......@@ -76,7 +87,7 @@ const Template:React.FC<{}> = () => {
</Form.Item>
<Form.Item {...tailLayout}>
<Space size={24}>
<Button type='primary' htmlType="submit">保存</Button>
<Button type='primary' loading={lodaing} htmlType="submit">保存</Button>
<Popconfirm
onConfirm={confirmCancel}
title="确定要执行这个操作?"
......
import React, { useEffect } from 'react';
import React, { useEffect, useState } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history } from 'umi';
import ReutrnEle from '@/components/ReturnEle';
......@@ -16,28 +16,35 @@ const tailLayout = {
const Template: React.FC<{}> = () => {
const [form] = Form.useForm();
const [lodaing, setLodaing] = useState<boolean>(false);
const { pathname, query } = history.location;
const type = pathname.split('/')[pathname.split('/').length - 1];
const onFinish = (values: any) => {
if (type === 'add') {
PublicApi.postManageUnitSaveOrUpdateUnit(values).then(res => {
PublicApi.postManageUnitSaveOrUpdateUnit({...values}, {ctlType: 'none'}).then(res => {
if (res.code === 1000) {
setTimeout(() => {
history.goBack();
}, 1000)
}, 2000)
message.success('新增单位成功')
setLodaing(true)
}
}).catch(() => {
setLodaing(false)
})
}
else {
values.id = query.id;
PublicApi.postManageUnitSaveOrUpdateUnit(values).then(res => {
PublicApi.postManageUnitSaveOrUpdateUnit({...values}, {ctlType: 'none'}).then(res => {
if (res.code === 1000) {
setTimeout(() => {
history.goBack();
}, 1000)
}, 2000)
message.success('修改单位成功')
setLodaing(true)
}
}).catch(() => {
setLodaing(false)
})
}
}
......@@ -80,7 +87,7 @@ const Template: React.FC<{}> = () => {
</Form.Item>
<Form.Item {...tailLayout}>
<Space size={24}>
<Button type='primary' htmlType="submit">保存</Button>
<Button type='primary' loading={lodaing} htmlType="submit">保存</Button>
<Popconfirm
onConfirm={confirmCancel}
title="确定要执行这个操作?"
......
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