|
@@ -5,7 +5,7 @@ import {
|
|
|
reqFirstPayConfig,
|
|
reqFirstPayConfig,
|
|
|
reqGetAccountsPayInfo,
|
|
reqGetAccountsPayInfo,
|
|
|
reqPaymentOrder, reqPayOrderList,
|
|
reqPaymentOrder, reqPayOrderList,
|
|
|
- reqRechargeConfig, reqWithdrawBaseInfo, reqWithdrawInfo, reqWithdrawTax
|
|
|
|
|
|
|
+ reqRechargeConfig, reqWithdrawBaseInfo, reqWithdrawInfo, reqWithdrawRecord, reqWithdrawSetInfo, reqWithdrawTax
|
|
|
} from "@features/api";
|
|
} from "@features/api";
|
|
|
import {getHttpMsg} from "@utils/helpers";
|
|
import {getHttpMsg} from "@utils/helpers";
|
|
|
import {toast} from "react-toastify";
|
|
import {toast} from "react-toastify";
|
|
@@ -115,16 +115,26 @@ const reducerWithdrawBaseInfo=(state,action,arg)=>{
|
|
|
state.withdrawBaseInfo=data;
|
|
state.withdrawBaseInfo=data;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ let callback=arg;
|
|
|
|
|
+ if (callback!=null){
|
|
|
|
|
+ callback(payload);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+const withdrawBaseInfoStatus=(state,status,arg)=>{
|
|
|
|
|
+ state.status.WithdrawBaseInfo=status;
|
|
|
}
|
|
}
|
|
|
const reducerWithdrawInfo=(state,action,arg)=>{
|
|
const reducerWithdrawInfo=(state,action,arg)=>{
|
|
|
let payload=action.payload;
|
|
let payload=action.payload;
|
|
|
if (payload&&payload.code===200){
|
|
if (payload&&payload.code===200){
|
|
|
let data=payload.data;
|
|
let data=payload.data;
|
|
|
if (data){
|
|
if (data){
|
|
|
- state.withdrawInfo=data;
|
|
|
|
|
|
|
+ if (data.info)state.withdrawInfo=data.info;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+const withdrawInfoStatus=(state,status,arg)=>{
|
|
|
|
|
+ state.status.WithdrawInfo=status;
|
|
|
|
|
+}
|
|
|
const reducerChangePayPass=(state,action,arg)=>{
|
|
const reducerChangePayPass=(state,action,arg)=>{
|
|
|
let payload=action.payload;
|
|
let payload=action.payload;
|
|
|
let msg=getHttpMsg(payload);
|
|
let msg=getHttpMsg(payload);
|
|
@@ -133,15 +143,53 @@ const reducerChangePayPass=(state,action,arg)=>{
|
|
|
if (data){
|
|
if (data){
|
|
|
// state.withdrawInfo=data;
|
|
// state.withdrawInfo=data;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (arg){
|
|
|
|
|
+ if (arg.newpassword!=null){
|
|
|
|
|
+ global.setWDPass(arg.newpassword);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
toast.success(msg);
|
|
toast.success(msg);
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
|
toast.error(msg);
|
|
toast.error(msg);
|
|
|
}
|
|
}
|
|
|
|
|
+ if (arg&&arg.callback!=null){
|
|
|
|
|
+ arg.callback(payload);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
const changePayPassStatus=(state,status,arg)=>{
|
|
const changePayPassStatus=(state,status,arg)=>{
|
|
|
state.status.ChangePayPass=status;
|
|
state.status.ChangePayPass=status;
|
|
|
}
|
|
}
|
|
|
|
|
+const reducerWithdrawRecord=(state,action,arg)=>{
|
|
|
|
|
+ let payload=action.payload;
|
|
|
|
|
+ if (payload&&payload.code===200){
|
|
|
|
|
+ let data=payload.data;
|
|
|
|
|
+ if (data&&data.data){
|
|
|
|
|
+ state.withdrawRecord=data.data;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+const withdrawRecordStatus=(state,status,arg)=>{
|
|
|
|
|
+ state.status.WithdrawRecoard=status;
|
|
|
|
|
+}
|
|
|
|
|
+const reducerWithdrawSetInfo=(state,action,arg)=>{
|
|
|
|
|
+ let payload=action.payload;
|
|
|
|
|
+ let msg=payload.msg;
|
|
|
|
|
+ if (msg==null)msg="";
|
|
|
|
|
+ if (payload&&payload.code===200){
|
|
|
|
|
+ let data=payload.data;
|
|
|
|
|
+ toast.success(msg);
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ toast.error(msg);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (arg&&arg.callback!=null){
|
|
|
|
|
+ arg.callback(payload);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+const withdrawSetInfoStatus=(state,status,arg)=>{
|
|
|
|
|
+ state.status.WithdrawSetInfo=status;
|
|
|
|
|
+}
|
|
|
export const Pay=createSlice({
|
|
export const Pay=createSlice({
|
|
|
name: 'pay',
|
|
name: 'pay',
|
|
|
initialState: {
|
|
initialState: {
|
|
@@ -152,7 +200,10 @@ export const Pay=createSlice({
|
|
|
PaymentOrder:REQ_STATUS.NONE,
|
|
PaymentOrder:REQ_STATUS.NONE,
|
|
|
ChangePayPass:REQ_STATUS.NONE,
|
|
ChangePayPass:REQ_STATUS.NONE,
|
|
|
PayOrderList:REQ_STATUS.NONE,
|
|
PayOrderList:REQ_STATUS.NONE,
|
|
|
- WithdrawRecoard:REQ_STATUS.NONE
|
|
|
|
|
|
|
+ WithdrawRecoard:REQ_STATUS.NONE,
|
|
|
|
|
+ WithdrawBaseInfo:REQ_STATUS.NONE,
|
|
|
|
|
+ WithdrawInfo:REQ_STATUS.NONE,
|
|
|
|
|
+ WithdrawSetInfo:REQ_STATUS.NONE,
|
|
|
},
|
|
},
|
|
|
config:[],
|
|
config:[],
|
|
|
payconfig:null,
|
|
payconfig:null,
|
|
@@ -163,29 +214,8 @@ export const Pay=createSlice({
|
|
|
withdrawBaseInfo:null,
|
|
withdrawBaseInfo:null,
|
|
|
withdrawInfo:null,
|
|
withdrawInfo:null,
|
|
|
payOrderList:null,
|
|
payOrderList:null,
|
|
|
- withdrawRecord:[
|
|
|
|
|
- {
|
|
|
|
|
- CreateDate:1716706224,
|
|
|
|
|
- OrderID:"BR12345678901",
|
|
|
|
|
- State:2,
|
|
|
|
|
- ExchangeScore:10000,
|
|
|
|
|
- Fee:1000
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- CreateDate:1716706224,
|
|
|
|
|
- OrderID:"BR12345678901",
|
|
|
|
|
- State:2,
|
|
|
|
|
- ExchangeScore:10000,
|
|
|
|
|
- Fee:1000
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- CreateDate:1716706224,
|
|
|
|
|
- OrderID:"BR12345678901",
|
|
|
|
|
- State:3,
|
|
|
|
|
- ExchangeScore:10000,
|
|
|
|
|
- Fee:1000
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ withdrawRecord:null,
|
|
|
|
|
+ changePayPassType:0
|
|
|
},
|
|
},
|
|
|
reducers: {
|
|
reducers: {
|
|
|
updatePayFinish:((state, action) => {
|
|
updatePayFinish:((state, action) => {
|
|
@@ -194,7 +224,10 @@ export const Pay=createSlice({
|
|
|
}
|
|
}
|
|
|
//充值完成 message={Golds:12.xx,PayNum:10}
|
|
//充值完成 message={Golds:12.xx,PayNum:10}
|
|
|
toast.success(i18n.t("deposit.order_info.success"));
|
|
toast.success(i18n.t("deposit.order_info.success"));
|
|
|
- })
|
|
|
|
|
|
|
+ }),
|
|
|
|
|
+ setChangePayPassType:((state, action) => {
|
|
|
|
|
+ state.changePayPassType=action.payload;
|
|
|
|
|
+ }),
|
|
|
},
|
|
},
|
|
|
extraReducers: (builder) => {
|
|
extraReducers: (builder) => {
|
|
|
buildReqReducer(builder,reqRechargeConfig,reducerRechargeConfig,rechargeConfigStatus);
|
|
buildReqReducer(builder,reqRechargeConfig,reducerRechargeConfig,rechargeConfigStatus);
|
|
@@ -202,13 +235,15 @@ export const Pay=createSlice({
|
|
|
buildReqReducer(builder,reqGetAccountsPayInfo,reducerGetAccountsPayInfo,getAccountsPayInfoStatus);
|
|
buildReqReducer(builder,reqGetAccountsPayInfo,reducerGetAccountsPayInfo,getAccountsPayInfoStatus);
|
|
|
buildReqReducer(builder,reqPaymentOrder,reducerPaymentOrder,paymentOrderStatus);
|
|
buildReqReducer(builder,reqPaymentOrder,reducerPaymentOrder,paymentOrderStatus);
|
|
|
buildReqReducer(builder,reqWithdrawTax,reducerWithdrawTax,null);
|
|
buildReqReducer(builder,reqWithdrawTax,reducerWithdrawTax,null);
|
|
|
- buildReqReducer(builder,reqWithdrawBaseInfo,reducerWithdrawBaseInfo,null);
|
|
|
|
|
- buildReqReducer(builder,reqWithdrawInfo,reducerWithdrawInfo,null);
|
|
|
|
|
|
|
+ buildReqReducer(builder,reqWithdrawBaseInfo,reducerWithdrawBaseInfo,withdrawBaseInfoStatus);
|
|
|
|
|
+ buildReqReducer(builder,reqWithdrawInfo,reducerWithdrawInfo,withdrawInfoStatus);
|
|
|
buildReqReducer(builder,reqChangePayPass,reducerChangePayPass,changePayPassStatus);
|
|
buildReqReducer(builder,reqChangePayPass,reducerChangePayPass,changePayPassStatus);
|
|
|
buildReqReducer(builder,reqPayOrderList,reducerPayOrderList,payOrderListStatus);
|
|
buildReqReducer(builder,reqPayOrderList,reducerPayOrderList,payOrderListStatus);
|
|
|
|
|
+ buildReqReducer(builder,reqWithdrawRecord,reducerWithdrawRecord,withdrawRecordStatus);
|
|
|
|
|
+ buildReqReducer(builder,reqWithdrawSetInfo,reducerWithdrawSetInfo,withdrawSetInfoStatus);
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|
|
|
-export const {updatePayFinish} = Pay.actions;
|
|
|
|
|
|
|
+export const {updatePayFinish,setChangePayPassType} = Pay.actions;
|
|
|
export const getConfig=(state)=>{
|
|
export const getConfig=(state)=>{
|
|
|
return state.pay.config;
|
|
return state.pay.config;
|
|
|
}
|
|
}
|
|
@@ -283,6 +318,18 @@ export const getWithdrawRecord=(state)=>{
|
|
|
export const getWithdrawTax=(state)=>{
|
|
export const getWithdrawTax=(state)=>{
|
|
|
return state.pay.WithDrawTax;
|
|
return state.pay.WithDrawTax;
|
|
|
}
|
|
}
|
|
|
|
|
+export const getWDBaseInfoStatus=(state)=>{
|
|
|
|
|
+ return state.pay.status.WithdrawBaseInfo;
|
|
|
|
|
+}
|
|
|
|
|
+export const getWDSetInfoStatus=(state)=>{
|
|
|
|
|
+ return state.pay.status.WithdrawSetInfo;
|
|
|
|
|
+}
|
|
|
|
|
+export const getWDInfoStatus=(state)=>{
|
|
|
|
|
+ return state.pay.status.WithdrawInfo;
|
|
|
|
|
+}
|
|
|
|
|
+export const getChangePayPassType=(state)=>{
|
|
|
|
|
+ return state.pay.changePayPassType;
|
|
|
|
|
+}
|
|
|
export default Pay.reducer;
|
|
export default Pay.reducer;
|
|
|
|
|
|
|
|
export const reqPayConfig=(dispatch,userInfo)=>{
|
|
export const reqPayConfig=(dispatch,userInfo)=>{
|