| | |
| | | case cashAndCoin = 2 |
| | | } |
| | | |
| | | enum UseStateType:Int,HandyJSONEnum{ |
| | | case used = 1 |
| | | case unUsed = 2 |
| | | |
| | | var strTitle:String{ |
| | | switch self{ |
| | | case .used:return "已使用" |
| | | case .unUsed:return "未使用" |
| | | } |
| | | } |
| | | } |
| | | |
| | | enum DetailType:Int,HandyJSONEnum{ |
| | | case minus = 1 //负数 |
| | | case positive = 2 //正数 |
| | | } |
| | | |
| | | |
| | |
| | | var consumeAmount:Double = 0 |
| | | var consumeName = "" |
| | | var consumeTime = "" |
| | | var detailsType:DetailType = .positive //1扣减 2增加 |
| | | } |
| | | |
| | | struct CouponModel:HandyJSON{ |
| | |
| | | var nums: Int = 0 |
| | | } |
| | | |
| | | struct RecordsModel:HandyJSON{ |
| | | var detailsId: Int = 0 |
| | | var endTime: String = "" |
| | | var goodName: String = "" |
| | | var goodType: ExchangeType = .goods |
| | | var requiredType: ExchangePaymentType = .coin |
| | | var integral: Int = 0 |
| | | var cash: Double = 0 |
| | | var startTime: String = "" |
| | | var useStatus: UseStateType = .used |
| | | } |
| | | |
| | | struct RecordsDetailModel:HandyJSON{ |
| | | var belongs: String = "" |
| | | var classHours = 0 |
| | | var contents: String = "" |
| | | var detailsId: Int = 0 |
| | | var endTime: String = "" |
| | | var goodName: String = "" |
| | | var orderTime: String = "" |
| | | var pics = [String]() |
| | | var startTime: String = "" |
| | | var useType: UseStateType = .unUsed |
| | | var writeOffName: String = "" |
| | | var writeOffTime: String = "" |
| | | |
| | | var goodType: ExchangeType = .goods |
| | | var cash: Double = 0 |
| | | var exchangeType: ExchangePaymentType = .coin |
| | | var integral: Int = 0 |
| | | var exchangeAddrType: CouponConditionType = .nationwide |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | /// 充值明细 |
| | | /// - Parameters: |
| | | /// - yearMonth: 记录(1充值 2扣除) |
| | | class func voucherDetail(recordType:Int?,yearMonth:String,page:Int,pageSize:Int = 20)->Observable<BaseResponse<[BillingModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/voucherDetail") |
| | | .append(key: "recordId", value: recordType) |
| | | .append(key: "yearMonth", value: yearMonth) |
| | | .append(key: "pageNum", value: page) |
| | | .append(key: "pageSize", value: pageSize) |
| | | class func voucherDetail(recordType:Int?,yearMonth:String,page:Int,pageSize:Int = 20,subType:RechargeRecordVC.RechargeRecordType)->Observable<BaseResponse<[BillingModel]>>{ |
| | | |
| | | let params:ParamsAppender! |
| | | if subType == .coin{ |
| | | params = ParamsAppender.build(url: All_Url).interface(url: "/account/api/useBenefit/voucherDetail") |
| | | }else{ |
| | | params = ParamsAppender.build(url: All_Url).interface(url: "/account/api/useBenefit/integralDetails") |
| | | } |
| | | |
| | | params.append(key: "recordId", value: recordType) |
| | | params.append(key: "yearMonth", value: yearMonth) |
| | | params.append(key: "pageNum", value: page) |
| | | params.append(key: "pageSize", value: pageSize) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | |
| | | /// 积分商城-兑换记录 |
| | | class func exchangeRecords(goodType:ExchangeType? = nil,useType:UseStateType? = nil)->Observable<BaseResponse<[RecordsModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/exchangeRecords") |
| | | .append(key: "goodType", value: goodType?.rawValue) |
| | | .append(key: "useType", value: useType?.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | |
| | | /// 兑换记录-详情 |
| | | class func exchangeRecordDetail(id:Int,goodType:ExchangeType)->Observable<BaseResponse<RecordsDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/redemptionDetails") |
| | | .append(key: "id", value: id) |
| | | .append(key: "goodType", value: goodType.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | } |
| | | |
| | | // MARK: -- 预约场地 |
| | |
| | | let queue = DispatchQueue(label: "1") |
| | | queue.async(group: group) { |
| | | group.enter() |
| | | m.radio = m.type.defaultImg.size.width / m.type.defaultImg.size.height //默认比例 |
| | | SDWebImageDownloader.shared.downloadImage(with: URL(string: m.backgroundImage),options: .scaleDownLargeImages,progress: nil) { image, data, error, status in |
| | | if let i = image{ |
| | | m.radio = i.size.width / i.size.height |
| | |
| | | // |
| | | |
| | | import UIKit |
| | | import JQTools |
| | | |
| | | class ExchangeRecordTCell: UITableViewCell { |
| | | |
| | | var recordsModel:RecordsModel!{ |
| | | didSet{ |
| | | label_title.text = recordsModel.goodName |
| | | label_state.text = recordsModel.useStatus.strTitle |
| | | label_duetime.text = String(format: "有效期:%@-%@", recordsModel.startTime,recordsModel.endTime) |
| | | label_type.text = recordsModel.goodType.strTitle |
| | | |
| | | switch recordsModel.requiredType{ |
| | | 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: |
| | | 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).add(string: recordsModel.cash.currency(), withFont: UIFont.systemFont(ofSize: 18, weight: .medium), withColor: Def_ThemeColor).mutableAttributedString |
| | | } |
| | | } |
| | | } |
| | | @IBOutlet weak var label_title: UILabel! |
| | | @IBOutlet weak var label_state: UILabel! |
| | | @IBOutlet weak var label_duetime: UILabel! |
| | | @IBOutlet weak var label_price: UILabel! |
| | | @IBOutlet weak var label_type: UILabel! |
| | | |
| | | |
| | | override func awakeFromNib() { |
| | | super.awakeFromNib() |
| | | selectionStyle = .none |
| | |
| | | <rect key="frame" x="0.0" y="0.0" width="323" height="145"/> |
| | | <autoresizingMask key="autoresizingMask"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kAZ-BY-Ik3"> |
| | | <rect key="frame" x="13.999999999999996" y="10" width="40.666666666666657" height="22"/> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kAZ-BY-Ik3"> |
| | | <rect key="frame" x="13.999999999999996" y="10" width="40.666666666666657" height="48"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="22" id="CwC-q6-1iS"/> |
| | | <constraint firstAttribute="width" relation="lessThanOrEqual" constant="180" id="CmV-oh-uyI"/> |
| | | <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="22" id="CwC-q6-1iS"/> |
| | | </constraints> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> |
| | | <color key="textColor" red="0.23921568627450979" green="0.24313725490196078" blue="0.27058823529411763" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Zhz-Y4-StE"> |
| | | <rect key="frame" x="62.666666666666657" y="11.666666666666664" width="46.333333333333343" height="19"/> |
| | | <rect key="frame" x="62.666666666666657" y="24.666666666666671" width="46.333333333333343" height="19"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PyP-oy-jKg"> |
| | | <rect key="frame" x="10.000000000000005" y="2" width="26.333333333333329" height="15"/> |
| | |
| | | </userDefinedRuntimeAttributes> |
| | | </view> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="待使用" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="B9F-rx-tLl"> |
| | | <rect key="frame" x="272" y="14" width="37" height="14.333333333333336"/> |
| | | <rect key="frame" x="272" y="26.999999999999996" width="37" height="14.333333333333332"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/> |
| | | <color key="textColor" name="FE6E0D"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_time_mini_gray" translatesAutoresizingMaskIntoConstraints="NO" id="faj-5r-yyV"> |
| | | <rect key="frame" x="14" y="45" width="14" height="14"/> |
| | | <rect key="frame" x="14" y="71" width="14" height="14"/> |
| | | <constraints> |
| | | <constraint firstAttribute="width" constant="14" id="I2D-7K-lhE"/> |
| | | <constraint firstAttribute="height" constant="14" id="JQ8-Qf-1nV"/> |
| | | </constraints> |
| | | </imageView> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="有效期:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cwb-7C-fPf"> |
| | | <rect key="frame" x="32" y="16" width="281" height="72"/> |
| | | <rect key="frame" x="32" y="68" width="281" height="20"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="20" id="E7o-ZK-iOR"/> |
| | | </constraints> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/> |
| | | <color key="textColor" red="0.45098039215686275" green="0.45098039215686275" blue="0.45098039215686275" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0积分" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="q70-lq-Dux"> |
| | | <rect key="frame" x="14" y="70" width="48" height="22"/> |
| | | <rect key="frame" x="14" y="96" width="48" height="22"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="18"/> |
| | | <color key="textColor" name="FE6E0D"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | <constraint firstItem="cwb-7C-fPf" firstAttribute="leading" secondItem="faj-5r-yyV" secondAttribute="trailing" constant="4" id="zMF-5s-JzX"/> |
| | | </constraints> |
| | | </tableViewCellContentView> |
| | | <connections> |
| | | <outlet property="label_duetime" destination="cwb-7C-fPf" id="yvY-PR-dni"/> |
| | | <outlet property="label_price" destination="q70-lq-Dux" id="GuC-dt-G90"/> |
| | | <outlet property="label_state" destination="B9F-rx-tLl" id="b3p-on-S1O"/> |
| | | <outlet property="label_title" destination="kAZ-BY-Ik3" id="kmw-z6-M0a"/> |
| | | <outlet property="label_type" destination="PyP-oy-jKg" id="bzv-vg-QxP"/> |
| | | </connections> |
| | | <point key="canvasLocation" x="70.992366412213741" y="70.070422535211264"/> |
| | | </tableViewCell> |
| | | </objects> |
| | |
| | | headView.label_username.text = benefitHomeModel?.userName ?? "" |
| | | headView.img_cover.sd_setImage(with: URL(string: benefitHomeModel?.userHeadImg)) |
| | | headView.tf_search.rx.text.orEmpty.bind(to: viewModel.search).disposed(by: disposeBag) |
| | | headView.integral = benefitHomeModel?.userIntegral ?? 0 |
| | | |
| | | return headView |
| | | } |
| | |
| | | class RechargeRecordViewModel:RefreshModel<BillingModel>{ |
| | | var coin = BehaviorRelay<Int>(value: 0) |
| | | var type = BehaviorRelay<Int?>(value: nil) |
| | | var subType = BehaviorRelay<RechargeRecordVC.RechargeRecordType>(value: .coin) |
| | | var yearMonth = BehaviorRelay<String>(value: "") |
| | | override func api() -> (Observable<BaseResponse<[BillingModel]>>)? { |
| | | return Services.voucherDetail(recordType: type.value, yearMonth: yearMonth.value,page: page,pageSize: pageSize) |
| | | return Services.voucherDetail(recordType: type.value, yearMonth: yearMonth.value,page: page,pageSize: pageSize, subType: subType.value) |
| | | } |
| | | } |
| | | |
| | | class RechargeRecordVC: BaseVC { |
| | | |
| | | enum RechargeRecordType { |
| | | case coin //玩湃币 |
| | | case integral //积分 |
| | | } |
| | | |
| | | @IBOutlet weak var view_topBg: UIView! |
| | | @IBOutlet weak var view_cion: JQ_RollNumberLabel! |
| | |
| | | |
| | | private let viewModel = RechargeRecordViewModel() |
| | | |
| | | required init(coin:Int) { |
| | | required init(coin:Int,subtype:RechargeRecordType) { |
| | | super.init(nibName: nil, bundle: nil) |
| | | self.viewModel.coin.accept(coin) |
| | | self.viewModel.subType.accept(subtype) |
| | | } |
| | | |
| | | required init?(coder: NSCoder) { |
| | |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | title = "充值明细" |
| | | view_cion.font = UIFont.init(name: "Impact", size: 36)! |
| | | view_cion.textColor = .white |
| | | btn_rechange.isHidden = viewModel.subType.value == .integral |
| | | title = viewModel.subType.value == .coin ? "充值明细":"积分明细" |
| | | viewModel.beginRefresh() |
| | | } |
| | | |
| | | override func viewDidAppear(_ animated: Bool) { |
| | |
| | | viewModel.yearMonth.accept(Date().jq_format("yyyy-MM")) |
| | | btn_date.setTitle("\(Date().jq_format("yyyy年MM月"))>", for: .normal) |
| | | viewModel.configure(tableView) |
| | | viewModel.beginRefresh() |
| | | } |
| | | |
| | | @IBAction func datetimeAction(_ sender: UIButton) { |
| | |
| | | // |
| | | |
| | | import UIKit |
| | | import JQTools |
| | | import WebKit |
| | | |
| | | class WelfareExchangeRecordDetailVC: BaseVC { |
| | | |
| | | private var id:Int! |
| | | private var goodsType:ExchangeType! |
| | | |
| | | @IBOutlet weak var view_banner: UIView! |
| | | @IBOutlet weak var label_course: UILabel! |
| | | @IBOutlet weak var label_title: UILabel! |
| | | @IBOutlet weak var label_price: UILabel! |
| | | @IBOutlet weak var label_duetime: UILabel! |
| | | @IBOutlet weak var view_duetime: UIView! |
| | | @IBOutlet weak var view_course: UIView! |
| | | @IBOutlet weak var view_ordertime: UIView! |
| | | @IBOutlet weak var label_ordertime: UILabel! |
| | | @IBOutlet weak var label_verifitime: UILabel! |
| | | @IBOutlet weak var view_verifitime: UIView! |
| | | @IBOutlet weak var view_verifiStore: UIView! |
| | | @IBOutlet weak var label_verifiStore: UILabel! |
| | | @IBOutlet weak var view_assignStore: UIView! |
| | | @IBOutlet weak var img_state: UIImageView! |
| | | @IBOutlet weak var img_state1: UIImageView! |
| | | @IBOutlet weak var webView: WKWebView! |
| | | @IBOutlet weak var cons_webHeight: NSLayoutConstraint! |
| | | |
| | | private let bannerView = CommonBannerView() |
| | | |
| | | required init(id:Int,goodsType:ExchangeType) { |
| | | super.init(nibName: nil, bundle: nil) |
| | | self.id = id |
| | | self.goodsType = goodsType |
| | | } |
| | | |
| | | required init?(coder: NSCoder) { |
| | | fatalError("init(coder:) has not been implemented") |
| | | } |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | title = "商品详情" |
| | | title = "兑换详情" |
| | | |
| | | Services.exchangeRecordDetail(id: id, goodType: goodsType).subscribe(onNext: { [weak self] data in |
| | | if let model = data.data{ |
| | | self?.label_title.text = model.goodName |
| | | self?.label_duetime.text = String(format: "%@-%@", model.startTime,model.endTime) |
| | | self?.label_course.text = "\(model.classHours)课时" |
| | | self?.label_ordertime.text = model.orderTime |
| | | self?.label_verifitime.text = model.writeOffTime |
| | | self?.label_verifiStore.text = model.writeOffName |
| | | switch model.exchangeType{ |
| | | case .coin: |
| | | self?.label_price.text = "\(model.integral)积分" |
| | | case .cashAndCoin: |
| | | self?.label_price.text = String(format: "%ld积分+%@", model.integral,model.cash.currency()) |
| | | } |
| | | |
| | | self?.img_state.isHidden = model.useType == .unUsed |
| | | self?.img_state1.isHidden = model.useType == .unUsed |
| | | |
| | | |
| | | switch model.goodType{ |
| | | case .coupon:break |
| | | case .course: |
| | | self?.view_duetime.isHidden = true |
| | | case .goods: |
| | | self?.view_course.isHidden = true |
| | | case .ticket: |
| | | self?.view_course.isHidden = true |
| | | } |
| | | |
| | | self?.view_verifiStore.isHidden = model.writeOffName.isEmpty |
| | | self?.view_verifitime.isHidden = model.writeOffName.isEmpty |
| | | self?.view_ordertime.isHidden = model.orderTime.isEmpty |
| | | self?.view_assignStore.isHidden = model.exchangeAddrType != .store && model.useType != .used |
| | | if model.contents.isEmpty{ |
| | | self?.webView.loadHTMLString("暂无说明".jq_wrapHtml(), baseURL: nil) |
| | | }else{ |
| | | self?.webView.loadHTMLString(model.contents.jq_wrapHtml(), baseURL: nil) |
| | | } |
| | | |
| | | self?.bannerView.setImages(images: model.pics, type: .URL) { index in |
| | | |
| | | } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | override func setUI() { |
| | | view_banner.addSubview(bannerView) |
| | | bannerView.frame = CGRect(x: 0, y: 0, width: JQ_ScreenW, height: JQ_ScreenW * 0.56) |
| | | // view_course.isHidden = true |
| | | // view_verifiStore.isHidden = true |
| | | // view_verifitime.isHidden = true |
| | | // view_ordertime.isHidden = true |
| | | // view_duetime.isHidden = true |
| | | // view_assignStore.isHidden = true |
| | | } |
| | | |
| | | override func setRx() { |
| | | self.webView.scrollView.rx.observe(CGSize.self, "contentSize").map { (size) -> CGFloat? in |
| | | if let size = size{ |
| | | return size.height |
| | | } |
| | | return nil |
| | | }.subscribe(onNext: { [unowned self](height) in |
| | | if let height = height{ |
| | | self.cons_webHeight.constant = height |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | } |
| | |
| | | <objects> |
| | | <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="WelfareExchangeRecordDetailVC" customModule="WanPai" customModuleProvider="target"> |
| | | <connections> |
| | | <outlet property="cons_webHeight" destination="wrH-M0-oLp" id="lfX-Vg-RCO"/> |
| | | <outlet property="img_state" destination="7pC-js-UtM" id="b53-6P-AOb"/> |
| | | <outlet property="img_state1" destination="M4e-TS-dOq" id="O4P-ZU-Amf"/> |
| | | <outlet property="label_course" destination="OqZ-I4-JSH" id="rve-jQ-v6A"/> |
| | | <outlet property="label_duetime" destination="qwp-eY-ANG" id="sCR-Dn-zFm"/> |
| | | <outlet property="label_ordertime" destination="jqC-oi-87t" id="qm4-Ra-XvV"/> |
| | | <outlet property="label_price" destination="jDZ-qB-6EK" id="bfC-5W-vxj"/> |
| | | <outlet property="label_title" destination="6q7-Li-5jF" id="xkI-TV-Y3N"/> |
| | | <outlet property="label_verifiStore" destination="5j1-89-0Gp" id="7lp-4H-5OC"/> |
| | | <outlet property="label_verifitime" destination="NP0-w5-1le" id="uOd-BZ-Pnn"/> |
| | | <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> |
| | | <outlet property="view_assignStore" destination="KaG-H8-hJu" id="ixM-hD-V07"/> |
| | | <outlet property="view_banner" destination="C2R-PV-rhH" id="isM-AO-jFr"/> |
| | | <outlet property="view_course" destination="KvQ-WX-Vd0" id="dfU-fv-EZv"/> |
| | | <outlet property="view_duetime" destination="3eJ-y4-YbI" id="CJe-3K-lhb"/> |
| | | <outlet property="view_ordertime" destination="d94-pa-Vdg" id="OkZ-YO-9KM"/> |
| | | <outlet property="view_verifiStore" destination="9r1-c4-fXB" id="HIJ-Gp-07w"/> |
| | | <outlet property="view_verifitime" destination="33s-C4-vPx" id="dGv-tN-cs8"/> |
| | | <outlet property="webView" destination="NpA-0b-6wX" id="Tz4-db-T57"/> |
| | | </connections> |
| | | </placeholder> |
| | | <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> |
| | |
| | | <rect key="frame" x="0.0" y="59" width="393" height="759"/> |
| | | <subviews> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="uFF-eA-g9J"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="880.33333333333337"/> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="885.33333333333337"/> |
| | | <subviews> |
| | | <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="Qhr-Bd-SDJ"> |
| | | <rect key="frame" x="0.0" y="220.00000000000006" width="393" height="660.33333333333348"/> |
| | | <rect key="frame" x="0.0" y="220.00000000000006" width="393" height="665.33333333333348"/> |
| | | <subviews> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5BT-e6-nV2"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="235"/> |
| | |
| | | </userDefinedRuntimeAttribute> |
| | | </userDefinedRuntimeAttributes> |
| | | </view> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="制定门店可用" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mx1-xh-fuv"> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="指定门店可用" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mx1-xh-fuv"> |
| | | <rect key="frame" x="22" y="6.0000000000000009" width="73.666666666666671" height="14.333333333333336"/> |
| | | <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="12"/> |
| | | <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> |
| | |
| | | </subviews> |
| | | </stackView> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="lyj-Wu-v1x"> |
| | | <rect key="frame" x="0.0" y="510.99999999999994" width="393" height="149.33333333333331"/> |
| | | <rect key="frame" x="0.0" y="510.99999999999994" width="393" height="154.33333333333331"/> |
| | | <subviews> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4rf-M1-yRb"> |
| | | <rect key="frame" x="13" y="0.0" width="380" height="1"/> |
| | |
| | | <nil key="textColor"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="hfc-hw-2AU"> |
| | | <rect key="frame" x="0.0" y="49.333333333333371" width="393" height="100"/> |
| | | <wkWebView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NpA-0b-6wX"> |
| | | <rect key="frame" x="0.0" y="44.333333333333371" width="393" height="100"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="100" id="B9G-zj-5EP"/> |
| | | <constraint firstAttribute="height" constant="100" id="wrH-M0-oLp"/> |
| | | </constraints> |
| | | </imageView> |
| | | <wkWebViewConfiguration key="configuration"> |
| | | <audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/> |
| | | <wkPreferences key="preferences"/> |
| | | </wkWebViewConfiguration> |
| | | </wkWebView> |
| | | </subviews> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <constraints> |
| | | <constraint firstItem="EzX-ob-h3Q" firstAttribute="top" secondItem="4rf-M1-yRb" secondAttribute="bottom" constant="14" id="2qz-qe-QD8"/> |
| | | <constraint firstAttribute="trailing" secondItem="EzX-ob-h3Q" secondAttribute="trailing" constant="14" id="2xt-nC-0rL"/> |
| | | <constraint firstItem="4rf-M1-yRb" firstAttribute="leading" secondItem="lyj-Wu-v1x" secondAttribute="leading" constant="13" id="5r3-3d-kDJ"/> |
| | | <constraint firstItem="NpA-0b-6wX" firstAttribute="top" secondItem="EzX-ob-h3Q" secondAttribute="bottom" constant="10" id="Cti-BF-fEH"/> |
| | | <constraint firstAttribute="bottom" secondItem="NpA-0b-6wX" secondAttribute="bottom" constant="10" id="DMl-Dt-yfH"/> |
| | | <constraint firstItem="EzX-ob-h3Q" firstAttribute="leading" secondItem="lyj-Wu-v1x" secondAttribute="leading" constant="14" id="Fp5-e4-hog"/> |
| | | <constraint firstAttribute="trailing" secondItem="hfc-hw-2AU" secondAttribute="trailing" id="Owt-BK-EkB"/> |
| | | <constraint firstAttribute="trailing" secondItem="4rf-M1-yRb" secondAttribute="trailing" id="W0x-cE-pHo"/> |
| | | <constraint firstAttribute="bottom" secondItem="hfc-hw-2AU" secondAttribute="bottom" id="bR8-pC-xP9"/> |
| | | <constraint firstItem="hfc-hw-2AU" firstAttribute="top" secondItem="EzX-ob-h3Q" secondAttribute="bottom" constant="15" id="bef-YM-KCf"/> |
| | | <constraint firstItem="hfc-hw-2AU" firstAttribute="leading" secondItem="lyj-Wu-v1x" secondAttribute="leading" id="lps-LF-dur"/> |
| | | <constraint firstItem="NpA-0b-6wX" firstAttribute="leading" secondItem="lyj-Wu-v1x" secondAttribute="leading" id="kxm-Mt-EMd"/> |
| | | <constraint firstAttribute="trailing" secondItem="NpA-0b-6wX" secondAttribute="trailing" id="sjx-93-6yN"/> |
| | | <constraint firstItem="4rf-M1-yRb" firstAttribute="top" secondItem="lyj-Wu-v1x" secondAttribute="top" id="wTz-Xt-c3y"/> |
| | | </constraints> |
| | | </view> |
| | |
| | | return pageVC |
| | | }() |
| | | |
| | | private var selectTypeModel:NormalSimpleModel? |
| | | |
| | | private lazy var funcView:UIView = { |
| | | let v = UIView() |
| | | v.backgroundColor = .white |
| | |
| | | if let btn = funcView.viewWithTag(1000) as? QMUIButton{ |
| | | guard !btn.isSelected else {return} |
| | | btn.isSelected = true |
| | | let items = Array<NormalSimpleModel>() |
| | | CourseSubTypeView.show(inView: self.view, afterView: funcView, items: items) { m in |
| | | btn.isSelected = false |
| | | var items = Array<NormalSimpleModel>() |
| | | items.append(NormalSimpleModel(id: 0, name: "全部")) |
| | | items.append(NormalSimpleModel(id: 1, name: "实物")) |
| | | items.append(NormalSimpleModel(id: 2, name: "课包")) |
| | | items.append(NormalSimpleModel(id: 3, name: "门票")) |
| | | items.append(NormalSimpleModel(id: 4, name: "优惠券")) |
| | | |
| | | CourseSubTypeView.show(inView: self.view, afterView: funcView, items: items, selectModel: selectTypeModel) {[weak self] m in |
| | | let vc = self?.pageViewController.currentController as! WelfareExchangeRecordSubListVC |
| | | if m.id == 0{ |
| | | self?.selectTypeModel = nil |
| | | vc.viewModel.goodsType.accept(nil) |
| | | btn.setTitle("商品类型", for: .normal) |
| | | }else{ |
| | | self?.selectTypeModel = m |
| | | btn.setTitle(m.name, for: .normal) |
| | | vc.viewModel.goodsType.accept(ExchangeType(rawValue: m.id)) |
| | | } |
| | | btn.isSelected = false |
| | | vc.viewModel.beginRefresh() |
| | | } closeClouse: { |
| | | btn.isSelected = false |
| | | } |
| | |
| | | } |
| | | |
| | | func pageViewController(_ pageViewConteoller: FFPageViewController, controllerForPage page: Int) -> UIViewController { |
| | | let vc = WelfareExchangeRecordSubListVC() |
| | | return vc |
| | | switch page{ |
| | | case 1:return WelfareExchangeRecordSubListVC(stateType: .unUsed) |
| | | case 2:return WelfareExchangeRecordSubListVC(stateType: .used) |
| | | default:return WelfareExchangeRecordSubListVC(stateType: nil) |
| | | } |
| | | } |
| | | } |
| | |
| | | // |
| | | |
| | | import UIKit |
| | | import RxRelay |
| | | import RxSwift |
| | | |
| | | class RecordsViewModel:RefreshModel<RecordsModel>{ |
| | | let goodsType = BehaviorRelay<ExchangeType?>(value: nil) |
| | | let stateType = BehaviorRelay<UseStateType?>(value: nil) |
| | | override func api() -> (Observable<BaseResponse<[RecordsModel]>>)? { |
| | | return Services.exchangeRecords(goodType: goodsType.value, useType: stateType.value) |
| | | } |
| | | } |
| | | |
| | | class WelfareExchangeRecordSubListVC: BaseVC { |
| | | |
| | | lazy private var tableView:UITableView = { |
| | | let table = UITableView(frame: .zero, style: .plain) |
| | | lazy private var tableView:BaseTableView = { |
| | | let table = BaseTableView(frame: .zero, style: .plain) |
| | | table.separatorStyle = .none |
| | | table.delegate = self |
| | | table.dataSource = self |
| | |
| | | return table |
| | | }() |
| | | |
| | | let viewModel = RecordsViewModel() |
| | | |
| | | init(stateType:UseStateType?) { |
| | | super.init(nibName: nil, bundle: nil) |
| | | viewModel.stateType.accept(stateType) |
| | | } |
| | | |
| | | required init?(coder: NSCoder) { |
| | | fatalError("init(coder:) has not been implemented") |
| | | } |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | view.backgroundColor = .white |
| | | viewModel.configure(tableView) |
| | | tableView.jq_setEmptyView() |
| | | viewModel.beginRefresh() |
| | | } |
| | | |
| | | override func setUI() { |
| | |
| | | |
| | | extension WelfareExchangeRecordSubListVC:UITableViewDelegate{ |
| | | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| | | let vc = WelfareExchangeRecordDetailVC() |
| | | let model = viewModel.dataSource.value[indexPath.row] |
| | | let vc = WelfareExchangeRecordDetailVC(id: model.detailsId, goodsType: model.goodType) |
| | | push(vc: vc) |
| | | } |
| | | } |
| | | |
| | | extension WelfareExchangeRecordSubListVC:UITableViewDataSource{ |
| | | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
| | | return 10 |
| | | return viewModel.dataSource.value.count |
| | | } |
| | | |
| | | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_ExchangeRecordTCell") as! ExchangeRecordTCell |
| | | cell.recordsModel = viewModel.dataSource.value[indexPath.row] |
| | | return cell |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @IBAction func rechargeAction(_ sender: UIButton) { |
| | | let vc = RechargeRecordVC(coin: benefitHomeModel?.wpCoin ?? 0) |
| | | let vc = RechargeRecordVC(coin: benefitHomeModel?.wpCoin ?? 0,subtype: .coin) |
| | | push(vc: vc) |
| | | } |
| | | |
| | |
| | | private var disposeBag = DisposeBag() |
| | | |
| | | var viewModel:CoinStoreViewModel! |
| | | var integral:Int = 0 |
| | | var innerView:UIView! |
| | | |
| | | override func awakeFromNib() { |
| | |
| | | } |
| | | |
| | | @IBAction func recoredAction(_ sender: UIButton) { |
| | | // let vc = RechargeRecordVC() |
| | | // vc.title = "积分明细" |
| | | // JQ_currentViewController().jq_push(vc: vc) |
| | | let vc = RechargeRecordVC(coin: integral,subtype: .integral) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | |
| | | |