lisenzhou 2 years ago
parent
commit
1ac950394e
1 changed files with 20 additions and 28 deletions
  1. 20
    28
      src/subpackages/pages/marketing/changeVisit/index.jsx

+ 20
- 28
src/subpackages/pages/marketing/changeVisit/index.jsx View File

@@ -52,6 +52,8 @@ export default withLayout((props) => {
52 52
   const [SuccessDate, setSuccessDate] = useState(null);
53 53
   const [channelCustomerId, setChannelCustomerId] = useState(null);
54 54
   const [channelCustomerInfo, setChannelCustomerIdInfo] = useState({});
55
+  const [confirmLoading, setConfirmLoading] = useState(false);
56
+  
55 57
   // const [StatusList,setStatusList] = useState([
56 58
   //   { name: "认筹", id: 3 },
57 59
   //   { name: "签约", id: 4 },
@@ -277,6 +279,7 @@ export default withLayout((props) => {
277 279
   };
278 280
 
279 281
   const ToSubmit = () => {
282
+    if(confirmLoading) return
280 283
     let brokerParams = {};
281 284
 
282 285
     if (isBroker) {
@@ -285,28 +288,9 @@ export default withLayout((props) => {
285 288
           Number(FormData?.currentCommission || 0) * 100);
286 289
     }
287 290
 
288
-    // let params = {};
289
-    // for (let key in FormData) {
290
-    //   if (key !== "dividendsName" && key !== "dividendsPer") {
291
-    //     params[key] = { ...FormData }[key];
292
-    //     // console.log(
293
-    //     //   "🚀 ~ file: index.jsx ~ line 202 ~ ToSubmit ~ FormData",
294
-    //     //   FormData
295
-    //     // );
296
-    //   }
297
-    // }
298
-
299
-    // console.log(
300
-    //   params,
301
-    //   params.currentCommission,
302
-    //   Number(params.totalCommission || 0) -
303
-    //     Number(channelCustomerInfo?.channelCustomer?.settledCommission || 0) >=
304
-    //     Number(params.currentCommission || 0),
305
-    //   "params"
306
-    // );
307
-    // return;
291
+
308 292
     if (CurrentStatusId === 3) {
309
-      Taro.showLoading()
293
+     setConfirmLoading(true)
310 294
       fetch({
311 295
         url: API_SURE_CHIP,
312 296
         method: "put",
@@ -326,7 +310,9 @@ export default withLayout((props) => {
326 310
         setTimeout(() => {
327 311
           Taro.navigateBack({ delta: 1 });
328 312
         }, 2000);
329
-      });
313
+      }).catch(()=>[
314
+        setConfirmLoading(false)
315
+      ]);
330 316
     } else if (CurrentStatusId === 4) {
331 317
       let params = {};
332 318
       for (let key in FormData) {
@@ -353,7 +339,7 @@ export default withLayout((props) => {
353 339
         });
354 340
         return;
355 341
       }
356
-      Taro.showLoading()
342
+      setConfirmLoading(true)
357 343
       fetch({
358 344
         url: API_SURE_SIGN,
359 345
         method: "put",
@@ -372,7 +358,9 @@ export default withLayout((props) => {
372 358
         setTimeout(() => {
373 359
           Taro.navigateBack({ delta: 1 });
374 360
         }, 2000);
375
-      });
361
+      }).catch(()=>[
362
+        setConfirmLoading(false)
363
+      ]);
376 364
     } else if (CurrentStatusId === 5) {
377 365
       let params = {};
378 366
       for (let key in FormData) {
@@ -394,7 +382,7 @@ export default withLayout((props) => {
394 382
         });
395 383
         return;
396 384
       }
397
-      Taro.showLoading()
385
+      setConfirmLoading(true)
398 386
       fetch({
399 387
         url: API_SURE_BUY,
400 388
         method: "put",
@@ -414,7 +402,9 @@ export default withLayout((props) => {
414 402
         setTimeout(() => {
415 403
           Taro.navigateBack({ delta: 1 });
416 404
         }, 2000);
417
-      });
405
+      }).catch(()=>[
406
+        setConfirmLoading(false)
407
+      ]);
418 408
     } else if (CurrentStatusId === 6) {
419 409
       let params = {};
420 410
       for (let key in FormData) {
@@ -440,7 +430,7 @@ export default withLayout((props) => {
440 430
         });
441 431
         return;
442 432
       }
443
-
433
+      setConfirmLoading(true)
444 434
       fetch({
445 435
         url: API_SURE_ALLPAYMENT,
446 436
         method: "put",
@@ -459,7 +449,9 @@ export default withLayout((props) => {
459 449
         setTimeout(() => {
460 450
           Taro.navigateBack({ delta: 1 });
461 451
         }, 2000);
462
-      });
452
+      }).catch(()=>[
453
+        setConfirmLoading(false)
454
+      ]);
463 455
     }
464 456
   };
465 457