| | |
| | | |
| | | @IBAction func completeAction(_ sender: UIButton) { |
| | | |
| | | guard let m = courseModel else {return} |
| | | |
| | | var money:Double = 0 |
| | | var id:Int = 0 |
| | | |
| | | if let m = courseModel{ |
| | | money = m.generalPrice |
| | | id = m.id |
| | | } |
| | | |
| | | if let m = museModel{ |
| | | money = m.generalPrice |
| | | id = m.id |
| | | } |
| | | |
| | | |
| | | guard btn_isRead.isSelected else { |
| | | alertError(msg: "请先阅读并同意《课程/疗愈音频购买协议》");return |
| | | } |
| | | |
| | | if giftToOther { |
| | | |
| | | guard !tf_phone.text!.isEmpty else { |
| | | alertError(msg: "请输入您要赠送人的手机号");return |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | guard balance > m.generalPrice else{ |
| | | guard balance > money else{ |
| | | CommonAlertView.show(title: "提示", content: "当前余额不足,请先充值", cancelStr: "暂不充值", completeStr: "去充值", isSingle: false) { state in |
| | | if state{ |
| | | |
| | |
| | | return |
| | | } |
| | | |
| | | let vc = PaymentOrderResultVC(courseId: id, price: m.generalPrice) |
| | | push(vc: vc) |
| | | Services.gvieCourse(orderForm: type, targetId: id,receiverId: giftUserId).subscribe(onNext: {[weak self]data in |
| | | guard let weakSelf = self else { return } |
| | | let vc = PaymentOrderResultVC(type: weakSelf.type, id: id, price: money) |
| | | self?.push(vc: vc) |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | } |