Commit 44e0c90b by 姜雷

修改授信保证金展示

parent ad44709f
......@@ -72,3 +72,15 @@ export const fetchCreditDeposites = (params: {
url: '/dcxy/api/creditDeposits',
data: params,
});
export const fetchOperationMode = (params: {
areaId: number;
}): Promise<
ResponseDataEntity<{
mode: string;
}>
> =>
baseFetch({
url: '/dcxy/api/operationModeConf',
data: params,
});
import { fetchCreditDeposites } from '@/api/account';
import { fetchCreditDeposites, fetchOperationMode } from '@/api/account';
import { useEffect, useReducer } from '@tarojs/taro';
import Actions from '@/types/Store/Actions';
......@@ -31,11 +31,17 @@ const useCreditDeposits = (areaId: number): CreditDepositsState => {
const [state, dispatch] = useReducer(reducer, initState);
useEffect(() => {
fetchCreditDeposites({
fetchOperationMode({
areaId: areaId,
}).then(res => {
if (res.data) {
dispatch({ type: 'updateCreditInfo', payload: res.data });
if (res.data.mode === '1' || res.data.mode === '2') {
fetchCreditDeposites({
areaId: areaId,
}).then(res => {
if (res.data) {
dispatch({ type: 'updateCreditInfo', payload: res.data });
}
});
}
});
}, [areaId]);
......
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