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

fix: 修改平台支付参数配置

parent 20c98210
......@@ -60,3 +60,13 @@ export const CONSTRUCTION_PAY = 7
* 建行支付 - 数字人民币 17
*/
export const CONSTRUCTION_NUMBER_RMBPAY = 17
/**
* 线上支付 - 微信退款证书 14
*/
export const LINE_UP_KEY_PATH = 14
/**
* 通联支付 - 微信退款证书 41
*/
export const UNIVERSAL_KEY_PATH = 14
......@@ -65,10 +65,10 @@ const ModalLayout: React.FC<ModalProps> = ({
}, [payChannel])
useEffect(() => {
if (payChannel) {
if (payChannel && visible) {
handleChannelFind();
}
}, [payChannel])
}, [payChannel, visible])
const handleCancel = () => {
onCancel()
......
......@@ -79,6 +79,7 @@ const ParameterLayout: React.FC<ModalProps> = ({
form.validateFields().then(res => {
onConfirm({
...res,
payChannel,
key: channel.filter(item => item.code === res.code)[0].key,
})
form.resetFields();
......
......@@ -28,6 +28,8 @@ import {
CONSTRUCTION_PAY,
CONSTRUCTION_B2BPAY,
CONSTRUCTION_NUMBER_RMBPAY,
LINE_UP_KEY_PATH,
UNIVERSAL_KEY_PATH
} from '@/constants/const/payment'
const PIC_MAP = {
......@@ -39,6 +41,7 @@ const PIC_MAP = {
12: alipay,
13: tonglian,
14: unionpay,
/** 默认图标 */
15: balance,
};
......@@ -135,8 +138,8 @@ const PaySettingLayout = () => {
width: '50%',
ellipsis: true,
render: (text, record) => <>
{(record.code === 14 || record.code === 41) && <Typography.Link href={text} target="_blank">{text}</Typography.Link>}
{(record.code !== 14 && record.code !== 41) && <>{text}</>}
{(record.code === LINE_UP_KEY_PATH || record.code === UNIVERSAL_KEY_PATH) && <Typography.Link href={text} target="_blank">{text}</Typography.Link>}
{(record.code !== LINE_UP_KEY_PATH && record.code !== UNIVERSAL_KEY_PATH) && <>{text}</>}
</>
},
{
......@@ -337,7 +340,6 @@ const PaySettingLayout = () => {
}
/** 编辑支付参数 */
const handleEdit = (record, index, __payChannel) => {
console.log(__payChannel, '__payChannel')
setPayChannel(__payChannel)
setValue(record);
setEditIndex(index);
......@@ -362,6 +364,7 @@ const PaySettingLayout = () => {
/** 商户参数配置 - 查询会员通用支付参数配置列表 */
const handleCommonParameterList = () => {
if (LINE_UP_ALIPAY === Number(payChannel)) {
getOrderPlatformPaymentMemberCommonParameterList({ payChannel }).then(res => {
if (res.code !== 1000) {
message.error(res.message);
......@@ -370,6 +373,7 @@ const PaySettingLayout = () => {
setParameterList(res.data);
})
}
}
useEffect(() => {
if (isEmpty(parameterList)) {
......@@ -507,10 +511,10 @@ const PaySettingLayout = () => {
shouldUpdate={(prevValues, currentValues) => prevValues[`payChannel_${_item.payChannel}`] !== currentValues[`payChannel_${_item.payChannel}`]}
>
{({ getFieldValue }) => (
getFieldValue(`payChannel_${_item.payChannel}`) === 1
getFieldValue(`payChannel_${_item.payChannel}`) === LINE_UP_ALIPAY
) && (
<Fragment>
<div className={style.anchor}>{`${_item.payChannelName}支付参数配置`}{getFieldValue(`payChannel_${_item.payChannel}`) === 1 ? <span className={style.tag}>会员直接到账模式</span> : null}</div>
<div className={style.anchor}>{`${_item.payChannelName}支付参数配置`}{getFieldValue(`payChannel_${_item.payChannel}`) === LINE_UP_ALIPAY ? <span className={style.tag}>会员直接到账模式</span> : null}</div>
<Button style={{ marginBottom: '24px' }} onClick={() => window.open('/system/ruleSettingManager/merchantPayType')}>商户参数配置</Button>
<Form.Item
wrapperCol={{ span: 24 }}
......@@ -579,11 +583,10 @@ const PaySettingLayout = () => {
<ParameterLayout
value={value}
visible={parameterVisible}
payChannel={payChannel}
payChannel={LINE_UP_ALIPAY.toString()}
onConfirm={handleParameterConfirm}
onCancel={handleParameterCancel}
/>
</Fragment>
}
/>
......
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