zhejiushizhuce 2 anni fa
parent
commit
62656d564c
3 ha cambiato i file con 17 aggiunte e 8 eliminazioni
  1. 10 8
      src/features/api.js
  2. 3 0
      src/features/mainSlice.js
  3. 4 0
      src/widgets/WCustomerService/index.jsx

+ 10 - 8
src/features/api.js

@@ -479,16 +479,18 @@ export const reqCustomService=createAsyncThunk(
 export const reqCustomLeaveMsg=createAsyncThunk(
     APP_CUSTOMER_LEAVEMSG,
     async (arg,thunkAPI)=>{
-        let preTime=localStorageGet(LOCAL_CUSTOM_LOCK,"0");
-        let now=Date.now();
-        preTime=Number(preTime);
-        if (now-preTime<180000){
-            toast.error(i18n.t("customer.TopTip_timerFail"));
-            return null;
-        }
+        // let preTime=localStorageGet(LOCAL_CUSTOM_LOCK,"0");
+        // let now=Date.now();
+        // preTime=Number(preTime);
+        // if (now-preTime<180000){
+        //     toast.error(i18n.t("customer.TopTip_timerFail"));
+        //     return null;
+        // }
+        let pp={...arg};
+        delete pp.callback;
         let params={
             url:APP_CUSTOMER_LEAVEMSG,
-            params:arg
+            params:pp
         }
         const response=await Http.get(params);
         return response;

+ 3 - 0
src/features/mainSlice.js

@@ -419,6 +419,9 @@ const reducerCustomLeaveMsg=(state,action,arg)=>{
             toast.error(i18n.t("customer.TopTip_fail"));
         }
     }
+    if (arg&&arg.callback!=null){
+        arg.callback(payload);
+    }
 }
 const customLeaveMsgStatus=(state,status,arg)=>{
     state.customLeaveMsgStatus=status;

+ 4 - 0
src/widgets/WCustomerService/index.jsx

@@ -52,6 +52,9 @@ const WCustomerService=({close})=>{
         let url="mailto:"+email+"?subject=Mexico "+APP_CHANNEL.Channel+" gameid:"+gameID+"&body=problem:";
         window.open(url,"_blank");
     }
+    const onSubmitCB=(data)=>{
+        setLeaveMsg("");
+    }
     const onSubmit=()=>{
         if (leaveMsg==="")return;
         if (status===REQ_STATUS.LOADING)return;
@@ -60,6 +63,7 @@ const WCustomerService=({close})=>{
             GameID:gameID,
             PackageName:APP_CHANNEL.PackageName
         }
+        data.callback=onSubmitCB;
         dispatch(reqCustomLeaveMsg(data));
     }
     const renderTips=()=>{