无故事王国
2023-10-19 eb795a6523edbc0fe3a3b1a3d3bea1063041efd5
WanPai/Root/Activity/VC/ActivityDetailApplyVC.swift
@@ -61,7 +61,7 @@
      btn_moreMatchStore.isHidden = (label_storeNames.text?.count ?? 0) < 50
        label_title.text = activityDetailModel.name
        label_joinCondition.text = activityDetailModel.registerCondition.strTitle
        label_joinCondition.text = activityDetailModel.registerCondition.strTitle + "参与"
        label_address.text = activityDetailModel.address
        label_duetime.text = activityDetailModel.registerEndTime
        label_starttime.text = activityDetailModel.startTime
@@ -137,7 +137,9 @@
                  weakSelf.payment(type: type)
               }
                }
            }
         }else{
            NotificationCenter.default.post(name: ChooseHomeStore_Noti, object: nil)
         }
        }
    }
@@ -155,8 +157,8 @@
                           let vc = PaymentResultVC(result: .success, objType: .activityApply)
                           vc.modalPresentationStyle = .fullScreen
                           weakSelf.present(vc, animated: true)
                           weakSelf.btn_enroll.setTitle("已报名", for: .normal)
                           weakSelf.btn_enroll.backgroundColor = UIColor.gray.withAlphaComponent(0.5)
//                           weakSelf.btn_enroll.setTitle("已报名", for: .normal)
//                           weakSelf.btn_enroll.backgroundColor = UIColor.gray.withAlphaComponent(0.5)
                        case .cancel:
                           alert(msg: "已取消")
                        case .failure(let error):
@@ -170,11 +172,25 @@
                  let vc = PaymentResultVC(result: .success, objType: .activityApply)
                  vc.modalPresentationStyle = .fullScreen
                  weakSelf.present(vc, animated: true)
                  weakSelf.btn_enroll.setTitle("已报名", for: .normal)
                  weakSelf.btn_enroll.backgroundColor = UIColor.gray.withAlphaComponent(0.5)
//                  weakSelf.btn_enroll.setTitle("已报名", for: .normal)
//                  weakSelf.btn_enroll.backgroundColor = UIColor.gray.withAlphaComponent(0.5)
               default:break
            }
         }
      },onError: {[weak self] error in
         guard let weakSelf = self else { return }
         if let er = error as? NetworkRequest.NetRequestError{
            switch er {
               case .Other(_,let string):
                  let vc = PaymentResultVC(result: .fail(string), objType: .yard,handleVC: nil)
                  vc.modalPresentationStyle = .fullScreen
                  weakSelf.present(vc, animated: true)
               default:
                  let vc = PaymentResultVC(result: .fail("支付失败"), objType: .yard,handleVC: nil)
                  vc.modalPresentationStyle = .fullScreen
                  weakSelf.present(vc, animated: true)
            }
         }
      }).disposed(by: disposeBag)
   }
}