1
This commit is contained in:
@@ -11,7 +11,7 @@ import { smsCode } from '@/services/user/user'
|
||||
|
||||
|
||||
|
||||
export default ({ modalOpenState, onModalOpenState, onSubmit }) => {
|
||||
export default ({ modalOpenState, onModalOpenState, onSubmit, type }) => {
|
||||
const restFormRef = useRef<ProFormInstance>();
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ export default ({ modalOpenState, onModalOpenState, onSubmit }) => {
|
||||
return (
|
||||
<>
|
||||
<ModalForm
|
||||
title="用户-余额"
|
||||
title={type == 2 ? '用户-增值收益' : '用户-基础收益'}
|
||||
formRef={restFormRef}
|
||||
submitter={{
|
||||
searchConfig: {
|
||||
@@ -42,7 +42,7 @@ export default ({ modalOpenState, onModalOpenState, onSubmit }) => {
|
||||
>
|
||||
<ProFormText hidden={true} width="md" name="id" />
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
<ProFormText
|
||||
rules={[{ required: true, message: '请输入!' }]}
|
||||
width="md"
|
||||
name="userName"
|
||||
@@ -81,25 +81,25 @@ export default ({ modalOpenState, onModalOpenState, onSubmit }) => {
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
{/* <ProFormRadio.Group
|
||||
<ProFormRadio.Group
|
||||
rules={[{ required: true, message: '请输入!' }]}
|
||||
name="type"
|
||||
name="rechargeType"
|
||||
label="类型"
|
||||
radioType="button"
|
||||
options={[
|
||||
{
|
||||
label: '线下充值',
|
||||
value: '51',
|
||||
value: '1',
|
||||
},
|
||||
{
|
||||
label: '余额划扣',
|
||||
value: '52',
|
||||
value: '2',
|
||||
},
|
||||
]}
|
||||
/> */}
|
||||
/>
|
||||
<ProFormMoney
|
||||
rules={[{ required: true, message: '请输入!' }]}
|
||||
label="金额"
|
||||
label={type == 2 ? '增值收益' : '基础收益'}
|
||||
name="rechargeAmount"
|
||||
customSymbol="¥"
|
||||
/>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { usersPage, usersAdd, usersDelete, usersUpdate, updateUserLevel, userTransferHanging, exportUser, userRecharge, accountChange, updateUserRoleType, updateUserPemType } from '@/services/user/user';
|
||||
import { usersPage, usersAdd, usersDelete, usersUpdate, updateUserLevel, userTransferHanging, exportUser, userRecharge, accountChange, updateUserRoleType, updateUserPemType, backendBasics } from '@/services/user/user';
|
||||
|
||||
|
||||
import React, { useRef, useEffect, useState } from 'react';
|
||||
@@ -87,6 +87,7 @@ const LogTableList: React.FC = () => {
|
||||
const [tradeFormModal, setTradeFormModal] = useState(false);
|
||||
const [upRoleDatd, setUpRoleDatd] = useState(false);
|
||||
const [upPemData, setUpPemData] = useState(false);
|
||||
const [type, setType] = useState(1);
|
||||
|
||||
|
||||
|
||||
@@ -126,11 +127,20 @@ const LogTableList: React.FC = () => {
|
||||
};
|
||||
|
||||
const handleMoney = async (fields) => {
|
||||
const { success } = await userRecharge(fields);
|
||||
if (success) {
|
||||
message.success('余额变更成功');
|
||||
actionRef.current?.reload();
|
||||
setMoneyFormModal(false);
|
||||
if (type == 2) {
|
||||
const { success } = await userRecharge(fields);
|
||||
if (success) {
|
||||
message.success('增值收益变更成功');
|
||||
actionRef.current?.reload();
|
||||
setMoneyFormModal(false);
|
||||
}
|
||||
} else if (type == 1) {
|
||||
const { success } = await backendBasics(fields);
|
||||
if (success) {
|
||||
message.success('基础收益变更成功');
|
||||
actionRef.current?.reload();
|
||||
setMoneyFormModal(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -408,6 +418,7 @@ const LogTableList: React.FC = () => {
|
||||
modalOpenState={moneyFormModal}
|
||||
onModalOpenState={setMoneyFormModal}
|
||||
onSubmit={handleMoney}
|
||||
type={type}
|
||||
/>
|
||||
|
||||
<UpRole
|
||||
@@ -450,14 +461,34 @@ const LogTableList: React.FC = () => {
|
||||
>
|
||||
修改用户角色
|
||||
</Button>,
|
||||
// <Button
|
||||
// danger
|
||||
// hidden={!access.hasPerms('/api/users/userRecharge')}
|
||||
// onClick={() => {
|
||||
// setMoneyFormModal(true)
|
||||
// }}
|
||||
// >
|
||||
// 余额变更
|
||||
// </Button>,
|
||||
<Button
|
||||
danger
|
||||
hidden={!access.hasPerms('/api/users/userRecharge')}
|
||||
onClick={() => {
|
||||
setType(2)
|
||||
setMoneyFormModal(true)
|
||||
}}
|
||||
>
|
||||
余额变更
|
||||
增值收益
|
||||
</Button>,
|
||||
<Button
|
||||
danger
|
||||
hidden={!access.hasPerms('/api/users/userRecharge')}
|
||||
onClick={() => {
|
||||
setType(1)
|
||||
setMoneyFormModal(true)
|
||||
}}
|
||||
>
|
||||
基础收益
|
||||
</Button>,
|
||||
<Button
|
||||
danger
|
||||
|
||||
@@ -100,6 +100,16 @@ export async function userRecharge(body) {
|
||||
});
|
||||
}
|
||||
|
||||
export async function backendBasics(body) {
|
||||
return request('/api/users/backendBasics', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body || {},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 获取短信
|
||||
export async function smsCode() {
|
||||
|
||||
Reference in New Issue
Block a user