Commit 44e0c90b by 姜雷

修改授信保证金展示

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