Commit 39406479 authored by David黄金龙's avatar David黄金龙

一处 优化

parent 5d14b055
...@@ -180,6 +180,7 @@ extension YHActivityDetailViewController { ...@@ -180,6 +180,7 @@ extension YHActivityDetailViewController {
let vc = YHApplyActivityResultViewController() let vc = YHApplyActivityResultViewController()
vc.isSuccessFlag = true vc.isSuccessFlag = true
vc.activityTravelId = self.viewModel.travelModel?.id ?? "" vc.activityTravelId = self.viewModel.travelModel?.id ?? ""
vc.activityName = self.viewModel.activityDetailModel?.name ?? ""
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
} else { } else {
......
...@@ -163,44 +163,45 @@ extension YHActivityTravelViewController { ...@@ -163,44 +163,45 @@ extension YHActivityTravelViewController {
} }
func showApplyUI() { // func showApplyUI() {
YHApplyActivityAlert.showApplyActivityAlertView { (tag,name,number,phone) in // YHApplyActivityAlert.showApplyActivityAlertView { (tag,name,number,phone) in
if tag { // if tag {
printLog(tag) // printLog(tag)
printLog(name) // printLog(name)
printLog(number) // printLog(number)
printLog(phone) // printLog(phone)
if tag { // if tag {
if let model = self.viewModel.activityTravelModel,model.id > 0 { // if let model = self.viewModel.activityTravelModel,model.id > 0 {
let param = ["id" : model.id, // let param = ["id" : model.id,
"name":name, // "name":name,
"mobile":phone, // "mobile":phone,
"number":number] // "number":number]
self.applyActivity(param: param) // self.applyActivity(param: param)
} // }
} // }
} // }
} // }
} // }
func applyActivity(param : [String : Any]) { // func applyActivity(param : [String : Any]) {
//
viewModel.applyActivity(param: param) { success, error in // viewModel.applyActivity(param: param) { success, error in
if success { // if success {
YHHUD.flash(message: "报名成功") // YHHUD.flash(message: "报名成功")
self.loadData() // self.loadData()
DispatchQueue.main.async { // DispatchQueue.main.async {
let vc = YHApplyActivityResultViewController() // let vc = YHApplyActivityResultViewController()
vc.activityTravelId = String(self.viewModel.activityTravelModel?.id ?? 0) // vc.activityTravelId = String(self.viewModel.activityTravelModel?.id ?? 0)
self.navigationController?.pushViewController(vc) //
} // self.navigationController?.pushViewController(vc)
} else { // }
let msg = error?.errorMsg ?? "报名失败,请重试" // } else {
YHHUD.flash(message: msg) // let msg = error?.errorMsg ?? "报名失败,请重试"
} // YHHUD.flash(message: msg)
} // }
} // }
// }
} }
extension YHActivityTravelViewController: UITableViewDelegate, UITableViewDataSource { extension YHActivityTravelViewController: UITableViewDelegate, UITableViewDataSource {
......
...@@ -16,6 +16,7 @@ class YHApplyActivityResultViewController: YHBaseViewController { ...@@ -16,6 +16,7 @@ class YHApplyActivityResultViewController: YHBaseViewController {
var isSuccessFlag : Bool = false var isSuccessFlag : Bool = false
var messageTips : String = "" var messageTips : String = ""
var activityTravelId : String = "" var activityTravelId : String = ""
var activityName : String = ""
lazy var statusImageV:UIImageView = { lazy var statusImageV:UIImageView = {
let view = UIImageView() let view = UIImageView()
...@@ -107,6 +108,12 @@ extension YHApplyActivityResultViewController { ...@@ -107,6 +108,12 @@ extension YHApplyActivityResultViewController {
make.width.equalTo(142) make.width.equalTo(142)
make.height.equalTo(42) make.height.equalTo(42)
} }
if isSuccessFlag {
nameLabel.text = "已报名成功活动【" + activityName + "】,记得准时参加哦"
} else {
}
} }
@objc func clickSubmitBtn() { @objc func clickSubmitBtn() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment