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

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

parent 20c98210
/*
* @Author: XieZhiXiong
* @Date: 2021-08-03 14:54:50
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-03 14:55:39
* @Description: 营销活动相关常量
*/
/* --------------------------------- 平台优惠券类型 -------------------------------- */
/**
* 0元购买抵扣券
*/
export const MERCHANT_COUPON_TYPE_VOUCHER = 1;
/**
* 通用优惠券
*/
export const MERCHANT_COUPON_TYPE_UNIVERSAL = 2;
/**
* 品类优惠券
*/
export const MERCHANT_COUPON_TYPE_CATEGORY = 3;
/**
* 品牌优惠券
*/
export const MERCHANT_COUPON_TYPE_BRAND = 4;
/**
* 商品优惠券
*/
export const MERCHANT_COUPON_TYPE_PRODUCT = 5;
/* --------------------------------- 平台优惠券领取方式 -------------------------------- */
/**
* 前台用户领券
*/
export const MERCHANT_COUPON_RECEIVE_FRONT = 1;
/**
* 指定会员发券
*/
export const MERCHANT_COUPON_RECEIVE_DESIGNATED = 2;
/**
* 营销活动用券
*/
export const MERCHANT_COUPON_RECEIVE_ACTIVITY = 3;
/**
* 会员运营用券
*/
export const MERCHANT_COUPON_RECEIVE_OPERATE = 4;
/* --------------------------------- 平台优惠券适用用户 -------------------------------- */
/**
* 新用户(不包含会员)
*/
export const SUITABLE_TYPE_NEW_USER = 1;
/**
* 老用户(不包含会员)
*/
export const SUITABLE_TYPE_OLD_USER = 2;
/**
* 新会员(仅会员用户)
*/
export const SUITABLE_TYPE_NEW_MEMBER = 3;
/**
* 老会员(仅会员用户)
*/
export const SUITABLE_TYPE_OLD_MEMBER = 4;
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2021-08-03 14:54:50
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-03 14:55:39
* @Description: 营销活动相关常量
*/
/* --------------------------------- 平台优惠券类型 -------------------------------- */
/**
* 0元购买抵扣券
*/
export const MERCHANT_COUPON_TYPE_VOUCHER = 1;
/**
* 通用优惠券
*/
export const MERCHANT_COUPON_TYPE_UNIVERSAL = 2;
/**
* 品类优惠券
*/
export const MERCHANT_COUPON_TYPE_CATEGORY = 3;
/**
* 品牌优惠券
*/
export const MERCHANT_COUPON_TYPE_BRAND = 4;
/**
* 商品优惠券
*/
export const MERCHANT_COUPON_TYPE_PRODUCT = 5;
/* --------------------------------- 平台优惠券领取方式 -------------------------------- */
/**
* 前台用户领券
*/
export const MERCHANT_COUPON_RECEIVE_FRONT = 1;
/**
* 指定会员发券
*/
export const MERCHANT_COUPON_RECEIVE_DESIGNATED = 2;
/**
* 营销活动用券
*/
export const MERCHANT_COUPON_RECEIVE_ACTIVITY = 3;
/**
* 会员运营用券
*/
export const MERCHANT_COUPON_RECEIVE_OPERATE = 4;
/* --------------------------------- 平台优惠券适用用户 -------------------------------- */
/**
* 新用户(不包含会员)
*/
export const SUITABLE_TYPE_NEW_USER = 1;
/**
* 老用户(不包含会员)
*/
export const SUITABLE_TYPE_OLD_USER = 2;
/**
* 新会员(仅会员用户)
*/
export const SUITABLE_TYPE_NEW_MEMBER = 3;
/**
* 老会员(仅会员用户)
*/
export const SUITABLE_TYPE_OLD_MEMBER = 4;
......@@ -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,13 +364,15 @@ const PaySettingLayout = () => {
/** 商户参数配置 - 查询会员通用支付参数配置列表 */
const handleCommonParameterList = () => {
getOrderPlatformPaymentMemberCommonParameterList({ payChannel }).then(res => {
if (res.code !== 1000) {
message.error(res.message);
return
}
setParameterList(res.data);
})
if (LINE_UP_ALIPAY === Number(payChannel)) {
getOrderPlatformPaymentMemberCommonParameterList({ payChannel }).then(res => {
if (res.code !== 1000) {
message.error(res.message);
return
}
setParameterList(res.data);
})
}
}
useEffect(() => {
......@@ -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