|
|
@@ -1,11 +1,19 @@
|
|
|
import {createSlice} from "@reduxjs/toolkit";
|
|
|
import {REQ_STATUS} from "@api/config";
|
|
|
import {
|
|
|
- buildReqReducer, reqChangePayPass,
|
|
|
+ buildReqReducer,
|
|
|
+ reqChangePayPass,
|
|
|
reqFirstPayConfig,
|
|
|
reqGetAccountsPayInfo,
|
|
|
- reqPaymentOrder, reqPayOrderList,
|
|
|
- reqRechargeConfig, reqWithdrawBaseInfo, reqWithdrawInfo, reqWithdrawRecord, reqWithdrawSetInfo, reqWithdrawTax
|
|
|
+ reqPaymentOrder,
|
|
|
+ reqPayOrderList,
|
|
|
+ reqRechargeConfig,
|
|
|
+ reqWithdrawBaseInfo,
|
|
|
+ reqWithdrawInfo,
|
|
|
+ reqWithdrawPayout,
|
|
|
+ reqWithdrawRecord,
|
|
|
+ reqWithdrawSetInfo,
|
|
|
+ reqWithdrawTax
|
|
|
} from "@features/api";
|
|
|
import {getHttpMsg} from "@utils/helpers";
|
|
|
import {toast} from "react-toastify";
|
|
|
@@ -190,6 +198,23 @@ const reducerWithdrawSetInfo=(state,action,arg)=>{
|
|
|
const withdrawSetInfoStatus=(state,status,arg)=>{
|
|
|
state.status.WithdrawSetInfo=status;
|
|
|
}
|
|
|
+const reducerWithdrawPayout=(state,action,arg)=>{
|
|
|
+ let payload=action.payload;
|
|
|
+ let msg=getHttpMsg(payload);
|
|
|
+ if (payload&&payload.code===200){
|
|
|
+ toast.success(msg);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ toast.error(msg);
|
|
|
+ }
|
|
|
+ if (arg&&arg.callback!=null){
|
|
|
+ arg.callback(payload);
|
|
|
+ }
|
|
|
+}
|
|
|
+const withdrawPayoutStatus=(state,status,arg)=>{
|
|
|
+ state.status.WithdrawPayout=status;
|
|
|
+}
|
|
|
export const Pay=createSlice({
|
|
|
name: 'pay',
|
|
|
initialState: {
|
|
|
@@ -204,6 +229,7 @@ export const Pay=createSlice({
|
|
|
WithdrawBaseInfo:REQ_STATUS.NONE,
|
|
|
WithdrawInfo:REQ_STATUS.NONE,
|
|
|
WithdrawSetInfo:REQ_STATUS.NONE,
|
|
|
+ WithdrawPayout:REQ_STATUS.NONE,
|
|
|
},
|
|
|
config:[],
|
|
|
payconfig:null,
|
|
|
@@ -241,6 +267,7 @@ export const Pay=createSlice({
|
|
|
buildReqReducer(builder,reqPayOrderList,reducerPayOrderList,payOrderListStatus);
|
|
|
buildReqReducer(builder,reqWithdrawRecord,reducerWithdrawRecord,withdrawRecordStatus);
|
|
|
buildReqReducer(builder,reqWithdrawSetInfo,reducerWithdrawSetInfo,withdrawSetInfoStatus);
|
|
|
+ buildReqReducer(builder,reqWithdrawPayout,reducerWithdrawPayout,withdrawPayoutStatus);
|
|
|
},
|
|
|
})
|
|
|
export const {updatePayFinish,setChangePayPassType} = Pay.actions;
|
|
|
@@ -330,6 +357,9 @@ export const getWDInfoStatus=(state)=>{
|
|
|
export const getChangePayPassType=(state)=>{
|
|
|
return state.pay.changePayPassType;
|
|
|
}
|
|
|
+export const getWDPayoutStatus=(state)=>{
|
|
|
+ return state.pay.status.WithdrawPayout;
|
|
|
+}
|
|
|
export default Pay.reducer;
|
|
|
|
|
|
export const reqPayConfig=(dispatch,userInfo)=>{
|