| | |
| | | label_state.textColor = Def_ThemeColor |
| | | switch recordsModel.goodType { |
| | | case .ticket: |
| | | // rightQR.constant = 9 |
| | | btn_qrCode.isHidden = false |
| | | default: |
| | | btn_qrCode.isHidden = true |
| | | } |
| | | case .expired,.used: |
| | | case .expired,.used: |
| | | label_state.textColor = UIColor(hexStr: "#7A7A7A") |
| | | btn_qrCode.isHidden = true |
| | | } |
| | | |
| | | lookDetails.isHidden = false |
| | | qrRight.constant = -9 |
| | | switch recordsModel.exchangeType{ |
| | | case.coin: |
| | | label_price.attributedText = AttributedStringbuilder.build().add(string: "\(recordsModel.integral)", withFont: UIFont.systemFont(ofSize: 18, weight: .medium), withColor: Def_ThemeColor) |
| | | .add(string: "积分", withFont: UIFont.systemFont(ofSize: 12, weight: .medium), withColor: Def_ThemeColor).mutableAttributedString |
| | | |
| | | |
| | | case .cashAndCoin: |
| | | var attribute = AttributedStringbuilder.build() |
| | | if recordsModel.integral != 0{ |
| | |
| | | label_price.attributedText = attribute.mutableAttributedString |
| | | case .cash: |
| | | label_price.attributedText = AttributedStringbuilder.build().add(string: recordsModel.cash.currency(), withFont: UIFont.systemFont(ofSize: 18, weight: .medium), withColor: Def_ThemeColor).mutableAttributedString |
| | | case .mpiao: |
| | | label_price.attributedText = AttributedStringbuilder.build().add(string: "会员赠送", withFont: UIFont.systemFont(ofSize: 18, weight: .medium), withColor: Def_ThemeColor).mutableAttributedString |
| | | lookDetails.isHidden = true |
| | | qrRight.constant = -90 |
| | | } |
| | | } |
| | | } |
| | |
| | | @IBOutlet weak var label_type: UILabel! |
| | | @IBOutlet weak var btn_qrCode: UIButton! |
| | | |
| | | |
| | | @IBOutlet weak var qrRight: NSLayoutConstraint! |
| | | @IBOutlet weak var lookDetails: UIButton! |
| | | |
| | | override func awakeFromNib() { |
| | | super.awakeFromNib() |
| | | selectionStyle = .none |
| | |
| | | |
| | | @IBAction func QRCodeAction(_ sender: UIButton) { |
| | | var time = OpenDoorTimeModel() |
| | | time.start_time = Date.jq_StringToTimeInterval((recordsModel.startTime + " 00:00:00"), "yyyy-MM-dd HH:mm:ss") |
| | | time.end_time = Date.jq_StringToTimeInterval((recordsModel.endTime + " 23:59:59"), "yyyy-MM-dd HH:mm:ss") |
| | | let model = OpenDoorModel(sid: recordsModel.sid, rid: recordsModel.rid, uid: recordsModel.userId, time: [time], type: 2) |
| | | if let string = model.toJSONString(){ |
| | | QRPreview.show(string) |
| | | } |
| | | |
| | | if recordsModel.exchangeType == .mpiao && recordsModel.goodType == .ticket{ |
| | | var timeCopy = OpenDoorTimeModelCopy() |
| | | timeCopy.start_time = recordsModel.startTime |
| | | timeCopy.end_time = recordsModel.endTime |
| | | let model = OpenDoorModelCopy(role: 1, time: [timeCopy], vipDetail: recordsModel.detailsId) |
| | | if let string = model.toJSONString(){ |
| | | QRPreview.show(string) |
| | | } |
| | | }else{ |
| | | time.start_time = Date.jq_StringToTimeInterval((recordsModel.startTime ), "yyyy-MM-dd HH:mm:ss") |
| | | time.end_time = Date.jq_StringToTimeInterval((recordsModel.endTime ), "yyyy-MM-dd HH:mm:ss") |
| | | let model = OpenDoorModel(sid: recordsModel.sid, rid: recordsModel.rid, uid: recordsModel.userId, time: [time], type: 2) |
| | | if let string = model.toJSONString(){ |
| | | QRPreview.show(string) |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |