22个文件已删除
1个文件已添加
33个文件已修改
| | |
| | | 13A501972A4D772F00FF6763 /* CoinStoreHeadView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13A501952A4D772F00FF6763 /* CoinStoreHeadView.xib */; }; |
| | | 13A7F72C2AB7E0EC000B3436 /* CourseEXPVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13A7F72A2AB7E0EC000B3436 /* CourseEXPVC.swift */; }; |
| | | 13A7F72D2AB7E0EC000B3436 /* CourseEXPVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13A7F72B2AB7E0EC000B3436 /* CourseEXPVC.xib */; }; |
| | | 13A9F8B12B0F2DC400ADF402 /* TransitionUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13A9F8B02B0F2DC400ADF402 /* TransitionUtil.swift */; }; |
| | | 13AFABC12A4AE3DC001FEA16 /* StudentRemarkListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13AFABC02A4AE3DC001FEA16 /* StudentRemarkListVC.swift */; }; |
| | | 13AFABC42A4AE492001FEA16 /* StudentRemarkTCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13AFABC22A4AE492001FEA16 /* StudentRemarkTCell.swift */; }; |
| | | 13AFABC52A4AE492001FEA16 /* StudentRemarkTCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13AFABC32A4AE492001FEA16 /* StudentRemarkTCell.xib */; }; |
| | |
| | | 13A501952A4D772F00FF6763 /* CoinStoreHeadView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CoinStoreHeadView.xib; sourceTree = "<group>"; }; |
| | | 13A7F72A2AB7E0EC000B3436 /* CourseEXPVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseEXPVC.swift; sourceTree = "<group>"; }; |
| | | 13A7F72B2AB7E0EC000B3436 /* CourseEXPVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CourseEXPVC.xib; sourceTree = "<group>"; }; |
| | | 13A9F8B02B0F2DC400ADF402 /* TransitionUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransitionUtil.swift; sourceTree = "<group>"; }; |
| | | 13AFABC02A4AE3DC001FEA16 /* StudentRemarkListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StudentRemarkListVC.swift; sourceTree = "<group>"; }; |
| | | 13AFABC22A4AE492001FEA16 /* StudentRemarkTCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StudentRemarkTCell.swift; sourceTree = "<group>"; }; |
| | | 13AFABC32A4AE492001FEA16 /* StudentRemarkTCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = StudentRemarkTCell.xib; sourceTree = "<group>"; }; |
| | |
| | | 8DA51DF62A32BE270085F4BA /* Enums.swift */, |
| | | 1319386A2AC2EC8300FC63F1 /* WeChatTools.swift */, |
| | | 13B2DEFB2AE12A7E00FCD31E /* LaunchImageHelper.swift */, |
| | | 13A9F8B02B0F2DC400ADF402 /* TransitionUtil.swift */, |
| | | ); |
| | | path = Config; |
| | | sourceTree = "<group>"; |
| | |
| | | 137546402A57F545001FA77A /* UserModel.swift in Sources */, |
| | | 13019C7D2A42ADA2004880CD /* CourseInfoVC.swift in Sources */, |
| | | 138D8B8E2A3FFE36009DCA9E /* YardListVC.swift in Sources */, |
| | | 13A9F8B12B0F2DC400ADF402 /* TransitionUtil.swift in Sources */, |
| | | 139402422AB4588F003CF61E /* PaymentCourseTCell.swift in Sources */, |
| | | 13BEEAEA2A4D92A200685667 /* ExchangeRecordTCell.swift in Sources */, |
| | | 1387B6622A4A969700BF2F2E /* CommonDatePickerView.swift in Sources */, |
| | |
| | | import UIKit |
| | | import WebKit |
| | | |
| | | class CommonWebVC: BaseVC { |
| | | class CommonWebVC: BaseVC, WKNavigationDelegate { |
| | | |
| | | private var type:AgreentType! |
| | | private var content:String! |
| | | @IBOutlet weak var webView: WKWebView! |
| | | @IBOutlet weak var cons_webHeight: NSLayoutConstraint! |
| | | @IBOutlet weak var view_btns: UIView! |
| | | |
| | | init(type:AgreentType,content:String? = nil) { |
| | | super.init(nibName: nil, bundle: nil) |
| | |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | view_btns.isHidden = true |
| | | webView.navigationDelegate = self |
| | | |
| | | if type != .other{ |
| | | title = type.titleStr |
| | | Services.queryProtocol(type,progress: false).subscribe(onNext: {[weak self] result in |
| | |
| | | } |
| | | } |
| | | |
| | | override func setRx() { |
| | | 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) |
| | | |
| | | } |
| | | |
| | | @IBAction func readAction(_ sender: UIButton) { |
| | | UserDefaults.standard.set(object: true, forKey: type.titleStr) |
| | | switch type { |
| | | case .user: |
| | | UserDefaults.standard.set(object: true, forKey: "agreent_2") |
| | | UserDefaults.standard.synchronize() |
| | | case .safe: |
| | | UserDefaults.standard.set(object: true, forKey: "agreent_3") |
| | | UserDefaults.standard.synchronize() |
| | | case .privacy: |
| | | UserDefaults.standard.set(object: true, forKey: "agreent_1") |
| | | UserDefaults.standard.synchronize() |
| | | default:break |
| | | } |
| | | navigationController?.popViewController() |
| | | } |
| | | |
| | | @IBAction func cancelAction(_ sender: UIButton) { |
| | | navigationController?.popViewController() |
| | | } |
| | | |
| | | |
| | | override var preferredStatusBarStyle: UIStatusBarStyle{ |
| | | return .darkContent |
| | |
| | | override var shouldAutorotate: Bool{ |
| | | return false |
| | | } |
| | | |
| | | func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { |
| | | switch type { |
| | | case .user,.safe,.privacy: |
| | | view_btns.isHidden = false |
| | | navigationItem.leftBarButtonItem = UIBarButtonItem() |
| | | default: |
| | | view_btns.isHidden = true |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22154" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <device id="retina6_12" orientation="portrait" appearance="light"/> |
| | | <dependencies> |
| | | <deployment identifier="iOS"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22130"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/> |
| | | <capability name="Named colors" minToolsVersion="9.0"/> |
| | | <capability name="Safe area layout guides" minToolsVersion="9.0"/> |
| | | <capability name="System colors in document resources" minToolsVersion="11.0"/> |
| | |
| | | <objects> |
| | | <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CommonWebVC" customModule="WanPai" customModuleProvider="target"> |
| | | <connections> |
| | | <outlet property="cons_webHeight" destination="2Su-pm-nFK" id="SCN-K5-tdP"/> |
| | | <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> |
| | | <outlet property="view_btns" destination="Wyh-Ys-RU3" id="gxo-1l-ap6"/> |
| | | <outlet property="webView" destination="mq2-Pw-XgV" id="DhJ-E0-y0z"/> |
| | | </connections> |
| | | </placeholder> |
| | |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="852"/> |
| | | <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
| | | <subviews> |
| | | <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="dap-XU-Myc"> |
| | | <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="oeq-R8-0ks"> |
| | | <rect key="frame" x="0.0" y="59" width="393" height="759"/> |
| | | <subviews> |
| | | <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="dap-XU-Myc"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="580"/> |
| | | <subviews> |
| | | <wkWebView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mq2-Pw-XgV"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="759"/> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="500"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="500" id="2Su-pm-nFK"/> |
| | | </constraints> |
| | | <wkWebViewConfiguration key="configuration"> |
| | | <audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/> |
| | | <wkPreferences key="preferences"/> |
| | | </wkWebViewConfiguration> |
| | | </wkWebView> |
| | | <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="1aa-Yc-u90"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="48"/> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Wyh-Ys-RU3"> |
| | | <rect key="frame" x="0.0" y="500" width="393" height="80"/> |
| | | <subviews> |
| | | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="K2Q-nH-vAh"> |
| | | <rect key="frame" x="40" y="20" width="146.66666666666666" height="40"/> |
| | | <color key="backgroundColor" red="0.75294117647058822" green="0.75294117647058822" blue="0.75294117647058822" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="40" id="nXI-Nh-Fsv"/> |
| | | </constraints> |
| | | <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> |
| | | <state key="normal" title="取消"/> |
| | | <userDefinedRuntimeAttributes> |
| | | <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius"> |
| | | <real key="value" value="20"/> |
| | | </userDefinedRuntimeAttribute> |
| | | </userDefinedRuntimeAttributes> |
| | | <connections> |
| | | <action selector="cancelAction:" destination="-1" eventType="touchUpInside" id="sJU-K3-rJN"/> |
| | | </connections> |
| | | </button> |
| | | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gqo-Wc-Pfx"> |
| | | <rect key="frame" x="206.66666666666663" y="20" width="146.33333333333337" height="40"/> |
| | | <color key="backgroundColor" name="FE6E0D"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="48" id="q68-5p-h44"/> |
| | | <constraint firstAttribute="height" constant="40" id="hQS-q2-b8v"/> |
| | | </constraints> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="18"/> |
| | | <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> |
| | | <state key="normal" title="我已阅读"/> |
| | | <state key="normal" title="同意"/> |
| | | <userDefinedRuntimeAttributes> |
| | | <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius"> |
| | | <real key="value" value="20"/> |
| | | </userDefinedRuntimeAttribute> |
| | | </userDefinedRuntimeAttributes> |
| | | <connections> |
| | | <action selector="readAction:" destination="-1" eventType="touchUpInside" id="1bM-F5-6rK"/> |
| | | <action selector="readAction:" destination="-1" eventType="touchUpInside" id="Lsz-Uc-AIf"/> |
| | | </connections> |
| | | </button> |
| | | </subviews> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <constraints> |
| | | <constraint firstAttribute="trailing" secondItem="gqo-Wc-Pfx" secondAttribute="trailing" constant="40" id="8Xm-c5-QIa"/> |
| | | <constraint firstItem="K2Q-nH-vAh" firstAttribute="leading" secondItem="Wyh-Ys-RU3" secondAttribute="leading" constant="40" id="Djt-vx-4c6"/> |
| | | <constraint firstItem="K2Q-nH-vAh" firstAttribute="centerY" secondItem="Wyh-Ys-RU3" secondAttribute="centerY" id="JYb-f1-2wW"/> |
| | | <constraint firstItem="gqo-Wc-Pfx" firstAttribute="centerY" secondItem="Wyh-Ys-RU3" secondAttribute="centerY" id="JoR-MQ-uLf"/> |
| | | <constraint firstAttribute="height" constant="80" id="PjV-gC-vHm"/> |
| | | <constraint firstItem="gqo-Wc-Pfx" firstAttribute="width" secondItem="K2Q-nH-vAh" secondAttribute="width" id="iR0-4m-esj"/> |
| | | <constraint firstItem="gqo-Wc-Pfx" firstAttribute="leading" secondItem="K2Q-nH-vAh" secondAttribute="trailing" constant="20" id="zva-VC-Dpg"/> |
| | | </constraints> |
| | | </view> |
| | | </subviews> |
| | | </stackView> |
| | | </subviews> |
| | | <constraints> |
| | | <constraint firstAttribute="trailing" secondItem="dap-XU-Myc" secondAttribute="trailing" id="8Rk-Wj-hYq"/> |
| | | <constraint firstItem="dap-XU-Myc" firstAttribute="top" secondItem="oeq-R8-0ks" secondAttribute="top" id="VQz-ZP-GrB"/> |
| | | <constraint firstItem="dap-XU-Myc" firstAttribute="leading" secondItem="oeq-R8-0ks" secondAttribute="leading" id="d04-g9-gMk"/> |
| | | <constraint firstAttribute="bottom" secondItem="dap-XU-Myc" secondAttribute="bottom" id="qff-rp-ztQ"/> |
| | | <constraint firstItem="dap-XU-Myc" firstAttribute="centerX" secondItem="oeq-R8-0ks" secondAttribute="centerX" id="tIG-gF-tlN"/> |
| | | </constraints> |
| | | </scrollView> |
| | | </subviews> |
| | | <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <constraints> |
| | | <constraint firstItem="dap-XU-Myc" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="4CZ-IH-JQy"/> |
| | | <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="dap-XU-Myc" secondAttribute="trailing" id="Ak2-EE-O7l"/> |
| | | <constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="dap-XU-Myc" secondAttribute="bottom" id="d9b-OR-NSb"/> |
| | | <constraint firstItem="dap-XU-Myc" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="fXK-8Z-QkB"/> |
| | | <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="oeq-R8-0ks" secondAttribute="trailing" id="1Lz-Tp-4cX"/> |
| | | <constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="oeq-R8-0ks" secondAttribute="bottom" id="Szc-so-Nfa"/> |
| | | <constraint firstItem="oeq-R8-0ks" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="fCh-50-kQ2"/> |
| | | <constraint firstItem="oeq-R8-0ks" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="sBV-x4-QpA"/> |
| | | </constraints> |
| | | <point key="canvasLocation" x="140" y="21"/> |
| | | </view> |
| | |
| | | |
| | | let attributed = AttributedStringbuilder.build() |
| | | |
| | | if type != .other && type != .matchStore{ |
| | | if type != .other && type != .matchStore && type != .useStore{ |
| | | Services.queryProtocol(type,progress: false).subscribe(onNext: { result in |
| | | if let text = result.data?.jq_wrapHtml(){ |
| | | attributed.add(string: text, withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "727272"), lineSpace: 4) |
| | |
| | | var defaultImg:UIImage{ |
| | | switch self { |
| | | case .none: |
| | | return UIImage(named: "placeholder_1")! |
| | | return UIImage() |
| | | case .course: |
| | | return UIImage(named: "b_1")! |
| | | case .booking: |
New file |
| | |
| | | // |
| | | // TransitionUtil.swift |
| | | // WanPai |
| | | // |
| | | // Created by 无故事王国 on 2023/11/23. |
| | | // |
| | | |
| | | import Foundation |
| | | |
| | | ///通用转场工具类 |
| | | class TransitionUtil: NSObject { |
| | | ///转场类型 |
| | | var transitionType: TransitionType? |
| | | //交互转场 |
| | | var interactive = false |
| | | let interactionTransition = UIPercentDrivenInteractiveTransition() |
| | | |
| | | override init() { |
| | | super.init() |
| | | |
| | | } |
| | | |
| | | //MARK: ------------ 不同类型的转场 ------------ |
| | | |
| | | private func transitionAnimation(transitionContext: UIViewControllerContextTransitioning) { |
| | | //获得容器视图(转场动画发生的地方) |
| | | let containerView = transitionContext.containerView |
| | | //动画执行时间 |
| | | let duration = self.transitionDuration(using: transitionContext) |
| | | |
| | | //fromVC (即将消失的视图) |
| | | let fromVC = transitionContext.viewController(forKey: .from)! |
| | | let fromView = fromVC.view! |
| | | //toVC (即将出现的视图) |
| | | let toVC = transitionContext.viewController(forKey: .to)! |
| | | let toView = toVC.view! |
| | | |
| | | var offset = containerView.frame.width |
| | | var fromTransform = CGAffineTransform.identity |
| | | var toTransform = CGAffineTransform.identity |
| | | |
| | | switch transitionType { |
| | | case .modal(let operation): |
| | | offset = containerView.frame.height |
| | | let fromY = operation == .presentation ? 0 : offset |
| | | fromTransform = CGAffineTransform(translationX: 0, y: fromY) |
| | | let toY = operation == .presentation ? offset : 0 |
| | | toTransform = CGAffineTransform(translationX: 0, y: toY) |
| | | if operation == .presentation { |
| | | containerView.addSubview(toView) |
| | | } |
| | | |
| | | case .navigation(let operation): |
| | | offset = operation == .push ? offset : -offset |
| | | fromTransform = CGAffineTransform(translationX: -offset, y: 0) |
| | | toTransform = CGAffineTransform(translationX: offset, y: 0) |
| | | containerView.insertSubview(toView, at: 0) |
| | | //containerView.addSubview(toView) |
| | | |
| | | case .tabBar(let direction): |
| | | offset = direction == .left ? offset : -offset |
| | | fromTransform = CGAffineTransform(translationX: offset, y: 0) |
| | | toTransform = CGAffineTransform(translationX: -offset, y: 0) |
| | | containerView.addSubview(toView) |
| | | |
| | | case nil: |
| | | break |
| | | } |
| | | |
| | | toView.transform = toTransform |
| | | UIView.animate(withDuration: duration, animations: { |
| | | fromView.transform = fromTransform |
| | | toView.transform = .identity |
| | | }) { (finished) in |
| | | fromView.transform = .identity |
| | | toView.transform = .identity |
| | | //考虑到转场中途可能取消的情况,转场结束后,恢复视图状态。(通知是否完成转场) |
| | | let wasCancelled = transitionContext.transitionWasCancelled |
| | | transitionContext.completeTransition(!wasCancelled) |
| | | } |
| | | } |
| | | } |
| | | |
| | | ///转场类型 |
| | | enum TransitionType { |
| | | //导航栏 |
| | | case navigation(_ operation: UINavigationController.Operation) |
| | | //tabBar切换 |
| | | case tabBar(_ direction: TabBarOperationDirection) |
| | | //模态跳转 |
| | | case modal(_ operation: ModalOperation) |
| | | } |
| | | |
| | | enum TabBarOperationDirection { |
| | | case left |
| | | case right |
| | | } |
| | | |
| | | enum ModalOperation { |
| | | case presentation |
| | | case dismissal |
| | | } |
| | | |
| | | ///自定义模态转场动画时使用 |
| | | extension TransitionUtil: UIViewControllerTransitioningDelegate { |
| | | func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { |
| | | self.transitionType = .modal(.presentation) |
| | | return self |
| | | } |
| | | |
| | | func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { |
| | | self.transitionType = .modal(.dismissal) |
| | | return self |
| | | } |
| | | |
| | | //interactive false:非交互转场, true: 交互转场 |
| | | func interactionControllerForPresentation(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? { |
| | | return interactive ? self.interactionTransition : nil |
| | | } |
| | | |
| | | //interactive false:非交互转场, true: 交互转场 |
| | | func interactionControllerForDismissal(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? { |
| | | return interactive ? self.interactionTransition : nil |
| | | } |
| | | } |
| | | |
| | | /// 自定义navigation转场动画时使用 |
| | | extension TransitionUtil: UINavigationControllerDelegate { |
| | | func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationController.Operation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? { |
| | | self.transitionType = .navigation(operation) |
| | | return self |
| | | } |
| | | |
| | | func navigationController(_ navigationController: UINavigationController, interactionControllerFor animationController: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? { |
| | | return interactive ? self.interactionTransition : nil |
| | | } |
| | | } |
| | | |
| | | /// 自定义tab转场动画时使用 |
| | | extension TransitionUtil: UITabBarControllerDelegate { |
| | | func tabBarController(_ tabBarController: UITabBarController, animationControllerForTransitionFrom fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? { |
| | | let fromIndex = tabBarController.viewControllers?.firstIndex(of: fromVC) ?? 0 |
| | | let toIndex = tabBarController.viewControllers?.firstIndex(of: toVC) ?? 0 |
| | | let direction: TabBarOperationDirection = fromIndex < toIndex ? .right : .left |
| | | self.transitionType = .tabBar(direction) |
| | | return self |
| | | } |
| | | |
| | | func tabBarController(_ tabBarController: UITabBarController, interactionControllerFor animationController: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? { |
| | | return interactive ? self.interactionTransition : nil |
| | | } |
| | | } |
| | | |
| | | extension TransitionUtil: UIViewControllerAnimatedTransitioning { |
| | | //控制转场动画执行时间 |
| | | func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { |
| | | return 0.5 |
| | | } |
| | | |
| | | //执行动画的地方,最核心的方法。 |
| | | func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { |
| | | transitionAnimation(transitionContext: transitionContext) |
| | | } |
| | | } |
| | | |
| | |
| | | var payStatus:PayStateType = .unPayment |
| | | var coursePackTypeId = 0 |
| | | var type:CourseType = .normal |
| | | var orderId:Int = 0 |
| | | } |
| | | |
| | | struct SignUpCourseItemDetailModel:HandyJSON{ |
| | |
| | | var isAble = 0 |
| | | var id = 0 |
| | | var courseType = 0 //1:常规,2:假期 |
| | | var orderId:Int? |
| | | } |
| | | |
| | | struct StartClouseVideoListModel:HandyJSON { |
| | |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | static func registeredData(coursePayId:Int)->Observable<BaseResponse<SignUpCourseItemDetailModel>>{ |
| | | static func registeredData(coursePayId:Int,orderId:Int? = nil)->Observable<BaseResponse<SignUpCourseItemDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/startCource/RegisteredData") |
| | | .append(key: "coursePayId", value: coursePayId) |
| | | .append(key: "orderId", value: orderId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | |
| | | var activityListModel:ActivityListModel?{ |
| | | didSet{ |
| | | if let m = activityListModel{ |
| | | img_profile.sd_setImage(with: URL(string: m.coverDrawing),placeholderImage: UIImage(named: "placeholder_1")) |
| | | img_profile.sd_setImage(with: URL(string: m.coverDrawing),placeholderImage: nil) |
| | | label_title.text = m.name |
| | | |
| | | var temp = [String]() |
| | |
| | | |
| | | var signUpCourseItemModel:SignUpCourseItemModel!{ |
| | | didSet{ |
| | | img_cover.sd_setImage(with: URL(string: signUpCourseItemModel.packageImg),placeholderImage: UIImage(named: "placeholder_1")) |
| | | img_cover.sd_setImage(with: URL(string: signUpCourseItemModel.packageImg),placeholderImage: nil) |
| | | label_title.text = signUpCourseItemModel.courseNameStore |
| | | label_enrollTime.text = "报名时间:" + signUpCourseItemModel.courseTime |
| | | label_teachNum.attributedText = AttributedStringbuilder.build().add(string: "已上课课时数:", withFont: UIFont.systemFont(ofSize: 14), withColor: UIColor(hexStr: "#737373")).add(string: "\(signUpCourseItemModel.courseNums)课时", withFont: UIFont.systemFont(ofSize: 14), withColor: UIColor(hexStr: "#EA0C0C")).mutableAttributedString |
| | |
| | | |
| | | var courseItemModel:CourseItemModel!{ |
| | | didSet{ |
| | | img_cover.sd_setImage(with: URL(string: courseItemModel.coverDrawing),placeholderImage: UIImage(named: "placeholder_1")) |
| | | img_cover.sd_setImage(with: URL(string: courseItemModel.coverDrawing),placeholderImage: nil) |
| | | label_title.text = String(format: "%@(%@)", courseItemModel.name,courseItemModel.storeName) |
| | | label_teachTime.text = String(format: "上课时间:%@", courseItemModel.classStartTime.jq_max(size: 2).joined(separator: "|")) |
| | | label_enrollNumber.text = String(format: "已报名:%ld人", courseItemModel.applicantsNumber) |
| | |
| | | @IBOutlet weak var view_packageList: UIView! |
| | | @IBOutlet weak var btn_handleBtn: UIButton! |
| | | @IBOutlet weak var view_teach: UIView! |
| | | @IBOutlet weak var label_couponInfo: UILabel! |
| | | |
| | | private var detailModel:CourseDetailModel? |
| | | private var selectClassIndex:Int = 0 |
| | |
| | | //重新唤起添加学生 |
| | | weakSelf.studentAction(weakSelf.btn_addStudent) |
| | | }.disposed(by: disposeBag) |
| | | |
| | | NotificationCenter.default.rx.notification(UIApplication.didBecomeActiveNotification).take(until: self.rx.deallocated).subscribe(onNext: {[weak self] noti in |
| | | self?.selectCouponModel = nil |
| | | self?.btn_couponInfo.setTitle("去选择", for: .normal) |
| | | self?.queryCouponInfo {[weak self] () in |
| | | guard let weakSelf = self else { return } |
| | | weakSelf.changePrice(weakSelf.selectClassIndex) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | | } |
| | | |
| | | @IBAction func couponAction(_ sender: TapBtn) { |
| | |
| | | guard let weakSelf = self else { return } |
| | | self?.btn_hasCoupon.isHidden = (data.data?.count ?? 0) == 0 |
| | | self?.couponModels = data.data ?? [] |
| | | self?.label_couponInfo.isHidden = (data.data?.count ?? 0) == 0 |
| | | |
| | | self?.label_couponInfo.text = String(format: "(%ld张可用)",data.data?.count ?? 0) |
| | | //重新获取优惠券,在切换套餐时触发 |
| | | if let selectCoupon = self?.selectCouponModel{ |
| | | if !weakSelf.couponModels.contains(where: {$0.id == selectCoupon.id}){ |
| | |
| | | <outlet property="cons_tableHei" destination="YrT-fE-DXP" id="wAi-wu-Afa"/> |
| | | <outlet property="label_address" destination="dq4-Ry-HOa" id="TTi-yc-w1v"/> |
| | | <outlet property="label_coin" destination="AuS-Gc-geQ" id="rBY-uI-jPU"/> |
| | | <outlet property="label_couponInfo" destination="CSW-Mn-uUp" id="a1f-Ix-SHy"/> |
| | | <outlet property="label_courseType" destination="Ohr-7c-UGL" id="MYu-9q-mGS"/> |
| | | <outlet property="label_listenTime" destination="gAj-GU-kf7" id="F9v-Rl-tLX"/> |
| | | <outlet property="label_listenWeek" destination="z0j-zm-BuW" id="6Sj-GF-NyT"/> |
| | |
| | | <color key="titleColor" name="FE6E0D"/> |
| | | </state> |
| | | </button> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CSW-Mn-uUp"> |
| | | <rect key="frame" x="105" y="16.666666666666742" width="11.333333333333329" height="14.333333333333336"/> |
| | | <fontDescription key="fontDescription" type="system" pointSize="12"/> |
| | | <nil key="textColor"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | </subviews> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <constraints> |
| | | <constraint firstItem="uvW-sZ-v3z" firstAttribute="centerY" secondItem="XNI-Vj-heV" secondAttribute="centerY" id="HKW-ZS-ZUS"/> |
| | | <constraint firstItem="ENs-7n-mN0" firstAttribute="top" secondItem="XNI-Vj-heV" secondAttribute="top" constant="14" id="UbJ-yU-seT"/> |
| | | <constraint firstAttribute="trailing" secondItem="1GA-NZ-pkR" secondAttribute="trailing" id="VRE-95-xJR"/> |
| | | <constraint firstItem="CSW-Mn-uUp" firstAttribute="centerY" secondItem="ENs-7n-mN0" secondAttribute="centerY" id="cCx-eX-hpm"/> |
| | | <constraint firstAttribute="trailing" secondItem="uvW-sZ-v3z" secondAttribute="trailing" constant="14" id="jrc-RZ-XZA"/> |
| | | <constraint firstItem="CSW-Mn-uUp" firstAttribute="leading" secondItem="ENs-7n-mN0" secondAttribute="trailing" constant="5" id="l2q-9I-Yxt"/> |
| | | <constraint firstItem="1GA-NZ-pkR" firstAttribute="top" secondItem="ENs-7n-mN0" secondAttribute="bottom" constant="14" id="pD4-2s-YRp"/> |
| | | <constraint firstItem="ENs-7n-mN0" firstAttribute="leading" secondItem="XNI-Vj-heV" secondAttribute="leading" constant="14" id="pDQ-Wb-cbl"/> |
| | | <constraint firstAttribute="bottom" secondItem="1GA-NZ-pkR" secondAttribute="bottom" id="wR5-QT-Zl7"/> |
| | |
| | | if let date = updateProdDate{ |
| | | //防止反复切换,15秒 |
| | | if Date().timeIntervalSince1970 - date.timeIntervalSince1970 > 15{ |
| | | updateData() |
| | | NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil) |
| | | } |
| | | } |
| | | } |
| | |
| | | exerciseCollectionView.tag = 1001 |
| | | exerciseCollectionView.register(UINib(nibName: "StudentVideoCCell", bundle: nil), forCellWithReuseIdentifier: "_StudentVideoCCell") |
| | | |
| | | // navigationItem.leftBarButtonItem = UIBarButtonItem(customView: leftBtn) |
| | | |
| | | } |
| | | |
| | | override func setRx() { |
| | |
| | | UserDefaults.standard.setValue(model.stuId, forKey: "currentStuId") |
| | | UserDefaults.standard.synchronize() |
| | | self?.updateData() |
| | | } |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | }).disposed(by: disposeBag) |
| | | |
| | | |
| | | NotificationCenter.default.rx.notification(StudentUpdate_Nofi).take(until: self.rx.deallocated).subscribe(onNext: {[weak self] noti in |
| | | guard let weakSelf = self else { return } |
| | | Services.startCourseHome().subscribe(onNext: {[weak self] data in |
| | | if let model = data.data{ |
| | | UserDefaults.standard.setValue(model.stuId, forKey: "currentStuId") |
| | | UserDefaults.standard.synchronize() |
| | | if model.isThere == 1{ |
| | | let courseInfoVC = CourseInfoVC() |
| | | courseInfoVC.startClouseHomeModel = model |
| | | let clouseNav = BaseNav(rootViewController: courseInfoVC) |
| | | clouseNav.tabBarItem = UITabBarItem(title: "玩湃运动营", image: UIImage(named: "tabbar_course"), selectedImage: UIImage(named: "tabbar_course_s")!.withRenderingMode(.alwaysOriginal)) |
| | | self?.tabBarController?.viewControllers![1] = clouseNav |
| | | }else { |
| | | if let vc = (self?.tabBarController?.viewControllers?[1] as? BaseNav)?.topViewController as? CourseVC{ |
| | | vc.startClouseHomeModel = model |
| | | self?.viewDidLoad() |
| | | } |
| | | } |
| | | } |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | }).disposed(by: disposeBag) |
| | |
| | | }).disposed(by: disposeBag) |
| | | |
| | | Services.weeksOfGetHours().subscribe(onNext: {[weak self] data in |
| | | // self?.btn_dispatchCourse.isHidden = data.data == 0 |
| | | self?.unDispatchNum = data.data |
| | | }) { error in |
| | | |
| | |
| | | let index = pageMenu.selectedItemIndex |
| | | let models = startClouseHomeModel!.courseList |
| | | guard index < models.count else {return} |
| | | Services.registeredData(coursePayId: models[index].id).subscribe(onNext: {data in |
| | | Services.registeredData(coursePayId: models[index].id,orderId: models[index].orderId).subscribe(onNext: {data in |
| | | if let m1 = data.data{ |
| | | let vc = CourseDetailVC(id: models[index].courseId, signUpCourseModel: m1) |
| | | self.push(vc: vc) |
| | |
| | | extension CourseInfoVC:UITableViewDelegate{ |
| | | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| | | // let m = weeklyCourseModel?.data[indexPath.row] |
| | | let vc = SignUpCourseVC() |
| | | push(vc: vc) |
| | | // let vc = SignUpCourseVC() |
| | | // push(vc: vc) |
| | | } |
| | | } |
| | | |
| | |
| | | if m.type == 1 && m.isType == 0{ |
| | | CommonAlertView.show(title: "提示", content: "确认请假?") { status in |
| | | if status{ |
| | | let leveTime = String(format: "%@ %@", weakSelf.currentDate.jq_format("yyyy-MM-dd"),m.time.first!) |
| | | let ftime = m.time.first!.components(separatedBy: "-").first! |
| | | let leveTime = String(format: "%@ %@", weakSelf.currentDate.jq_format("yyyy-MM-dd"),ftime) |
| | | Services.startCourceRreverse(courseId: m.id, time: leveTime, stuId: stuId).subscribe(onNext: {[weak self] data in |
| | | alertSuccess(msg: "请假成功") |
| | | self?.getSelectDayData() |
| | |
| | | <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fJF-28-SsM" customClass="CourseInfoScrollView" customModule="WanPai" customModuleProvider="target"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="818"/> |
| | | <subviews> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="placeholder_1" translatesAutoresizingMaskIntoConstraints="NO" id="r6S-MR-7fc"> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="r6S-MR-7fc"> |
| | | <rect key="frame" x="145.66666666666666" y="-51" width="102" height="102"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="102" id="ECk-yY-iGU"/> |
| | |
| | | </label> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_BMI" translatesAutoresizingMaskIntoConstraints="NO" id="ACh-xi-jO2"> |
| | | <rect key="frame" x="0.0" y="31" width="20" height="20"/> |
| | | <constraints> |
| | | <constraint firstAttribute="width" constant="20" id="eip-NO-LdU"/> |
| | | <constraint firstAttribute="height" constant="20" id="szX-gl-aHt"/> |
| | | </constraints> |
| | | </imageView> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0正常" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="voj-Sv-4FE"> |
| | | <rect key="frame" x="31" y="25.333333333333343" width="69" height="31.333333333333329"/> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0正常" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="voj-Sv-4FE"> |
| | | <rect key="frame" x="31" y="25.333333333333343" width="86" height="31.333333333333329"/> |
| | | <fontDescription key="fontDescription" type="system" pointSize="26"/> |
| | | <nil key="textColor"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | <constraints> |
| | | <constraint firstItem="ACh-xi-jO2" firstAttribute="top" secondItem="RbV-cx-Ch7" secondAttribute="bottom" constant="11" id="2zy-rh-Noq"/> |
| | | <constraint firstItem="RbV-cx-Ch7" firstAttribute="top" secondItem="moe-D8-QLX" secondAttribute="top" id="6LG-AY-ZY1"/> |
| | | <constraint firstAttribute="trailing" secondItem="voj-Sv-4FE" secondAttribute="trailing" constant="5" id="8Az-2c-WjU"/> |
| | | <constraint firstItem="voj-Sv-4FE" firstAttribute="leading" secondItem="ACh-xi-jO2" secondAttribute="trailing" constant="11" id="rpm-eH-RGA"/> |
| | | <constraint firstItem="ACh-xi-jO2" firstAttribute="leading" secondItem="RbV-cx-Ch7" secondAttribute="leading" id="rpp-qZ-zNg"/> |
| | | <constraint firstItem="RbV-cx-Ch7" firstAttribute="leading" secondItem="moe-D8-QLX" secondAttribute="leading" id="uSH-wp-eg2"/> |
| | |
| | | <image name="icon_star" width="22" height="23"/> |
| | | <image name="icon_stu_weight" width="20" height="20"/> |
| | | <image name="icon_student_hei" width="18" height="24"/> |
| | | <image name="placeholder_1" width="106" height="141"/> |
| | | <namedColor name="FE6E0D"> |
| | | <color red="0.99199998378753662" green="0.53299999237060547" blue="0.0080000003799796104" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | </namedColor> |
| | |
| | | @IBOutlet weak var btn_addStudent: QMUIButton! |
| | | @IBOutlet weak var img_bg: UIImageView! |
| | | @IBOutlet weak var cons_imgHeight: NSLayoutConstraint! |
| | | private var imgSize = UIImage(named: "bg_home_2")?.size ?? .zero |
| | | private var imgSize:CGSize = .zero |
| | | |
| | | var startClouseHomeModel:StartClouseHomeModel? |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | img_bg.sd_setImage(with: URL(string: startClouseHomeModel?.imgs)) {[weak self] image, error, type, url in |
| | | |
| | | } |
| | | |
| | | override func viewDidAppear(_ animated: Bool) { |
| | | super.viewDidAppear(animated) |
| | | |
| | | guard !children.contains(where: {$0 is CourseInfoVC}) else {return} |
| | | Services.startCourseHome().subscribe(onNext: {[weak self] data in |
| | | if let model = data.data{ |
| | | if model.isThere == 1{ |
| | | UserDefaults.standard.setValue(model.stuId, forKey: "currentStuId") |
| | | UserDefaults.standard.synchronize() |
| | | let courseInfoVC = CourseInfoVC() |
| | | courseInfoVC.startClouseHomeModel = model |
| | | |
| | | self?.addChild(courseInfoVC) |
| | | courseInfoVC.view.frame = self?.view.frame ?? .zero |
| | | self?.view.addSubview(courseInfoVC.view) |
| | | self?.didMove(toParent: courseInfoVC) |
| | | } |
| | | |
| | | self?.img_bg.sd_setImage(with: URL(string: model.imgs)) {[weak self] image, error, type, url in |
| | | if let image{ |
| | | self?.img_bg.image = image |
| | | let radio = image.size.width / image.size.height |
| | | self?.cons_imgHeight.constant = JQ_ScreenW / radio |
| | | } |
| | | } |
| | | |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | override func setUI() { |
| | |
| | | } |
| | | |
| | | override func setRx() { |
| | | NotificationCenter.default.rx.notification(StudentUpdate_Nofi).take(until: self.rx.deallocated).subscribe(onNext: { [weak self] data in |
| | | guard let weakSelf = self else { return } |
| | | Services.startCourseHome().subscribe(onNext: {[weak self] data in |
| | | if let model = data.data{ |
| | | if model.isThere == 1{ |
| | | UserDefaults.standard.setValue(model.stuId, forKey: "currentStuId") |
| | | UserDefaults.standard.synchronize() |
| | | let courseInfoVC = CourseInfoVC() |
| | | courseInfoVC.startClouseHomeModel = model |
| | | let clouseNav = BaseNav(rootViewController: courseInfoVC) |
| | | clouseNav.tabBarItem = UITabBarItem(title: "玩湃运动营", image: UIImage(named: "tabbar_course"), selectedImage: UIImage(named: "tabbar_course_s")!.withRenderingMode(.alwaysOriginal)) |
| | | self?.tabBarController?.viewControllers![1] = clouseNav |
| | | }else{ |
| | | let courseVC = CourseVC() |
| | | courseVC.startClouseHomeModel = model |
| | | let clouseNav = BaseNav(rootViewController: courseVC) |
| | | clouseNav.tabBarItem = UITabBarItem(title: "玩湃运动营", image: UIImage(named: "tabbar_course"), selectedImage: UIImage(named: "tabbar_course_s")!.withRenderingMode(.alwaysOriginal)) |
| | | self?.tabBarController?.viewControllers![1] = clouseNav |
| | | } |
| | | } |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | }).disposed(by: disposeBag) |
| | | // NotificationCenter.default.rx.notification(StudentUpdate_Nofi).take(until: self.rx.deallocated).subscribe(onNext: { [weak self] data in |
| | | // guard let weakSelf = self else { return } |
| | | // Services.startCourseHome().subscribe(onNext: {[weak self] data in |
| | | // if let model = data.data{ |
| | | // if model.isThere == 1{ |
| | | // UserDefaults.standard.setValue(model.stuId, forKey: "currentStuId") |
| | | // UserDefaults.standard.synchronize() |
| | | // let courseInfoVC = CourseInfoVC() |
| | | // courseInfoVC.startClouseHomeModel = model |
| | | // let clouseNav = BaseNav(rootViewController: courseInfoVC) |
| | | // clouseNav.tabBarItem = UITabBarItem(title: "玩湃运动营", image: UIImage(named: "tabbar_course"), selectedImage: UIImage(named: "tabbar_course_s")!.withRenderingMode(.alwaysOriginal)) |
| | | // self?.tabBarController?.viewControllers![1] = clouseNav |
| | | // }else{ |
| | | // let courseVC = CourseVC() |
| | | // courseVC.startClouseHomeModel = model |
| | | // let clouseNav = BaseNav(rootViewController: courseVC) |
| | | // clouseNav.tabBarItem = UITabBarItem(title: "玩湃运动营", image: UIImage(named: "tabbar_course"), selectedImage: UIImage(named: "tabbar_course_s")!.withRenderingMode(.alwaysOriginal)) |
| | | // self?.tabBarController?.viewControllers![1] = clouseNav |
| | | // } |
| | | // } |
| | | // }).disposed(by: weakSelf.disposeBag) |
| | | // }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | @IBAction func addStudentAction(_ sender: QMUIButton) { |
| | |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Lq0-CE-oO6"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="900"/> |
| | | <subviews> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="bg_home_2" translatesAutoresizingMaskIntoConstraints="NO" id="aj0-Tl-S2F"> |
| | | <imageView opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="bg_home_2" translatesAutoresizingMaskIntoConstraints="NO" id="aj0-Tl-S2F"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="900"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="900" id="GgI-pj-8xd"/> |
| | |
| | | extension SignUpCourseVC:UITableViewDelegate{ |
| | | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| | | let item = viewModel.dataSource.value[indexPath.row] |
| | | Services.registeredData(coursePayId: item.coursePayId).subscribe(onNext: {data in |
| | | Services.registeredData(coursePayId: item.coursePayId,orderId: item.orderId).subscribe(onNext: {data in |
| | | if let m1 = data.data{ |
| | | if m1.payStatus == .unPayment{ |
| | | Services.queryCourseInfo(id: item.coursePackageId,payId: item.coursePayId).subscribe(onNext: { data in |
| | |
| | | guard let weakSelf = self else { return } |
| | | let model = weakSelf.models[weakSelf.headView.pageMenu.selectedItemIndex] |
| | | |
| | | Services.registeredData(coursePayId: model.id).subscribe(onNext: {[weak self]data in |
| | | Services.registeredData(coursePayId: model.id,orderId: model.orderId).subscribe(onNext: {[weak self]data in |
| | | if let m1 = data.data{ |
| | | let vc = CourseDetailVC(id: model.courseId, signUpCourseModel: m1) |
| | | self?.push(vc: vc) |
| | |
| | | headView.pageMenu.setItems(models.map({$0.courseName}), selectedItemIndex: defaultIndex) |
| | | headView.pageMenu.delegate = self |
| | | headView.label_stuName.text = studentModel.stuName |
| | | headView.img_stuProfile.sd_setImage(with: URL(string: studentModel.stuImage),placeholderImage: UIImage(named: "placeholder_1")) |
| | | headView.img_stuProfile.sd_setImage(with: URL(string: studentModel.stuImage),placeholderImage: nil) |
| | | |
| | | viewModel.beginRefresh() |
| | | } |
| | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | startLocation() |
| | | |
| | | Services.startCourseHome().subscribe(onNext: {[weak self] data in |
| | | if let model = data.data{ |
| | | UserDefaults.standard.setValue(model.stuId, forKey: "currentStuId") |
| | | UserDefaults.standard.synchronize() |
| | | if model.isThere == 1{ |
| | | let courseInfoVC = CourseInfoVC() |
| | | courseInfoVC.startClouseHomeModel = model |
| | | let clouseNav = BaseNav(rootViewController: courseInfoVC) |
| | | clouseNav.tabBarItem = UITabBarItem(title: "玩湃运动营", image: UIImage(named: "tabbar_course"), selectedImage: UIImage(named: "tabbar_course_s")?.withRenderingMode(.alwaysOriginal)) |
| | | self?.tabBarController?.viewControllers![1] = clouseNav |
| | | }else { |
| | | if let vc = (self?.tabBarController?.viewControllers?[1] as? BaseNav)?.topViewController as? CourseVC{ |
| | | vc.startClouseHomeModel = model |
| | | } |
| | | } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | | Services.bannerList(position: .homeTop).subscribe(onNext: {[weak self] data in |
| | | if let models = data.data{ |
| | | var bannerResources = [CommonBannerModel]() |
| | |
| | | } |
| | | return false |
| | | } |
| | | |
| | | // let temp = self.items.map { m in |
| | | // if let n = m as? HomeStoreConfigModel{ |
| | | // return "\(n.sort)" |
| | | // } |
| | | // if let n = m as? HomeStoreTopBannerModel{ |
| | | // return "\(n.sort)" |
| | | // } |
| | | // return "" |
| | | // } |
| | | // |
| | | // print("---->") |
| | | // print(temp.joined(separator: ",")) |
| | | // print("---->") |
| | | |
| | | self.layout.collectionView?.reloadData() |
| | | self.collectionView.reloadData() |
| | |
| | | let item = items[indexPath.row] |
| | | |
| | | if let m = item as? HomeStoreConfigModel{ |
| | | cell.img.sd_setImage(with: URL(string: m.backgroundImage), placeholderImage: m.type.defaultImg, options: .lowPriority) |
| | | cell.img.sd_setImage(with: URL(string: m.backgroundImage), placeholderImage: nil, options: .lowPriority) |
| | | } |
| | | |
| | | if let m = item as? HomeStoreTopBannerModel{ |
| | |
| | | |
| | | |
| | | @IBAction func readAgreentAction(_ sender: UIButton) { |
| | | |
| | | var temp = [String]() |
| | | |
| | | let v1 = UserDefaults.standard.value(forKey: "agreent_1") |
| | | let v2 = UserDefaults.standard.value(forKey: "agreent_2") |
| | | let v3 = UserDefaults.standard.value(forKey: "agreent_3") |
| | | |
| | | if v1 == nil{temp.append("《隐私协议》")} |
| | | if v2 == nil{temp.append("《用户协议》")} |
| | | if v3 == nil{temp.append("《运动营告知书》")} |
| | | |
| | | if temp.count > 0{ |
| | | alert(msg: String(format: "请阅读并同意 %@", temp.joined(separator: ",")));return |
| | | } |
| | | |
| | | sender.isSelected = !sender.isSelected |
| | | } |
| | | |
| | |
| | | self.btn_back.setTitle("返回首页", for: .normal) |
| | | self.btn_again.setTitle("查看详情", for: .normal) |
| | | NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil) |
| | | NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil) |
| | | |
| | | case .fail(let string, let code): |
| | | self.btn_back.setTitle("返回", for: .normal) |
| | |
| | | label_content.text = str |
| | | case .success: |
| | | label_content.text = "支付成功,恭喜您成为玩湃会员!" |
| | | NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil) |
| | | NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil) |
| | | case .none:break |
| | | } |
| | | Services.queryMemberCoupon(menthod: 2).subscribe(onNext: {[weak self] data in |
| | |
| | | }.disposed(by: disposeBag) |
| | | |
| | | case .courseApply: |
| | | NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil) |
| | | //课时购买 |
| | | btn_backHome.isHidden = true |
| | | if let id = courseConfigId{ |
| | |
| | | label_content.text = str |
| | | if code == 2{btn_again.setTitle("去充值", for: .normal)} |
| | | case .success: |
| | | NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil) |
| | | NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil) |
| | | btn_again.setTitle("立即预约", for: .normal) |
| | | btn_back.setTitle("返回首页", for: .normal) |
| | | label_content.text = "报名成功,请及时预约运动营上课!" |
| | |
| | | label_content.text = str |
| | | if code == 2{btn_again.setTitle("去充值", for: .normal)} |
| | | case .success: |
| | | NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil) |
| | | NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil) |
| | | btn_again.setTitle("立即预约", for: .normal) |
| | | btn_back.setTitle("返回首页", for: .normal) |
| | | label_content.text = "报名成功,请及时预约运动营上课!" |
| | |
| | | label_content.text = str |
| | | if code == 2{btn_again.setTitle("去充值", for: .normal)} |
| | | case .success: |
| | | NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil) |
| | | NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil) |
| | | btn_again.setTitle("查看报名", for: .normal) |
| | | btn_back.setTitle("返回首页", for: .normal) |
| | | label_content.text = "报名成功,请注意活动开始时间!" |
| | |
| | | btn_back.setTitle("返回", for: .normal) |
| | | if code == 2{btn_again.setTitle("去充值", for: .normal)} |
| | | case .success: |
| | | NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil) |
| | | NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil) |
| | | btn_again.setTitle("查看预约", for: .normal) |
| | | btn_back.setTitle("返回首页", for: .normal) |
| | | label_content.text = "预约成功,请注意预约开始时间!" |
| | |
| | | label_content.text = str |
| | | if code == 2{btn_again.setTitle("去充值", for: .normal)} |
| | | case .success: |
| | | NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil) |
| | | btn_again.isHidden = true |
| | | btn_back.setTitleColor(.white, for: .normal) |
| | | btn_back.backgroundColor = Def_ThemeColor |
| | |
| | | case .exchange: |
| | | switch result { |
| | | case .success: |
| | | NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil) |
| | | NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil) |
| | | label_content.text = "兑换成功" |
| | | btn_again.setTitle("查看详情", for: .normal) |
| | | btn_back.setTitle("返回首页", for: .normal) |
| | |
| | | case .voucher: |
| | | break |
| | | case .experience: |
| | | label_price.text = "体验券" |
| | | label_price.text = couponModel.name |
| | | break |
| | | } |
| | | } |
| | | } |
| | |
| | | <objects> |
| | | <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> |
| | | <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> |
| | | <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="_WelfareCouponsTCell" rowHeight="346" id="KGk-i7-Jjw" customClass="WelfareCouponsTCell" customModule="WanPai" customModuleProvider="target"> |
| | | <rect key="frame" x="0.0" y="0.0" width="409" height="346"/> |
| | | <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="_WelfareCouponsTCell" rowHeight="149" id="KGk-i7-Jjw" customClass="WelfareCouponsTCell" customModule="WanPai" customModuleProvider="target"> |
| | | <rect key="frame" x="0.0" y="0.0" width="409" height="149"/> |
| | | <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> |
| | | <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> |
| | | <rect key="frame" x="0.0" y="0.0" width="409" height="346"/> |
| | | <rect key="frame" x="0.0" y="0.0" width="409" height="149"/> |
| | | <autoresizingMask key="autoresizingMask"/> |
| | | <subviews> |
| | | <view contentMode="scaleAspectFill" translatesAutoresizingMaskIntoConstraints="NO" id="ZhQ-JM-XIl"> |
| | | <rect key="frame" x="14" y="7.6666666666666572" width="100" height="331.33333333333337"/> |
| | | <rect key="frame" x="14" y="7.6666666666666714" width="100" height="135.66666666666663"/> |
| | | <subviews> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_coupon_header" translatesAutoresizingMaskIntoConstraints="NO" id="wLK-TU-eK6"> |
| | | <rect key="frame" x="0.0" y="0.0" width="100" height="331.33333333333331"/> |
| | | <rect key="frame" x="0.0" y="0.0" width="100" height="135.66666666666666"/> |
| | | </imageView> |
| | | <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="m8J-DK-my1"> |
| | | <rect key="frame" x="5" y="135" width="90" height="61"/> |
| | | <rect key="frame" x="5" y="37.333333333333343" width="90" height="61"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="¥ 0" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="efu-ap-jzG"> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="¥ 0" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="efu-ap-jzG"> |
| | | <rect key="frame" x="0.0" y="0.0" width="90" height="28"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="28" id="V4k-aB-f7A"/> |
| | |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="满0可用" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Swu-3s-t08"> |
| | | <rect key="frame" x="0.0" y="44" width="90" height="17"/> |
| | | <rect key="frame" x="0.0" y="43.999999999999993" width="90" height="17"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="17" id="bJ6-wC-a6S"/> |
| | | </constraints> |
| | |
| | | </constraints> |
| | | </view> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="htP-hm-rxQ"> |
| | | <rect key="frame" x="114" y="7.6666666666666572" width="281" height="331"/> |
| | | <rect key="frame" x="114" y="7.6666666666666714" width="281" height="135.33333333333331"/> |
| | | <subviews> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_coupon_footer" translatesAutoresizingMaskIntoConstraints="NO" id="fT4-6g-L0m"> |
| | | <rect key="frame" x="0.0" y="0.0" width="281" height="331"/> |
| | | <rect key="frame" x="0.0" y="0.0" width="281" height="135.33333333333334"/> |
| | | </imageView> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="G7I-Sh-sFL"> |
| | | <rect key="frame" x="15" y="8" width="195" height="25"/> |
| | |
| | | </connections> |
| | | </button> |
| | | <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="9" translatesAutoresizingMaskIntoConstraints="NO" id="fpg-MK-829"> |
| | | <rect key="frame" x="15" y="104" width="256" height="220"/> |
| | | <rect key="frame" x="15" y="104" width="256" height="24.333333333333343"/> |
| | | <subviews> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Idc-Qp-xg4"> |
| | | <rect key="frame" x="0.0" y="0.0" width="256" height="1"/> |
| | |
| | | </constraints> |
| | | </view> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="otH-gu-7hx"> |
| | | <rect key="frame" x="0.0" y="10" width="256" height="210"/> |
| | | <rect key="frame" x="0.0" y="10" width="256" height="14.333333333333336"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="17" id="Bhz-uE-F2F"/> |
| | | </constraints> |
| | |
| | | <outlet property="label_useCon" destination="Swu-3s-t08" id="5lK-sO-Sbo"/> |
| | | <outlet property="view_line" destination="Idc-Qp-xg4" id="qgz-C4-7oJ"/> |
| | | </connections> |
| | | <point key="canvasLocation" x="104.58015267175573" y="102.8169014084507"/> |
| | | <point key="canvasLocation" x="104.58015267175573" y="32.74647887323944"/> |
| | | </tableViewCell> |
| | | </objects> |
| | | <resources> |
| | |
| | | YYPaymentManager.shared.sendPaymentRequest(YYAlipayRequest(orderString: m.orderString)) {[weak self] result in |
| | | switch result { |
| | | case .success: |
| | | NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil) |
| | | let vc = PaymentResultVC(result: .success, objType: .recharge) |
| | | self?.push(vc: vc) |
| | | case .cancel: |
| | |
| | | Services.benefitHome().subscribe(onNext: {[weak self] data in |
| | | if let model = data.data{ |
| | | self?.viewModel.coin.accept(model.wpCoin) |
| | | self?.viewModel.beginRefresh() |
| | | } |
| | | }) { error in |
| | | |
| | |
| | | table.separatorStyle = .none |
| | | table.delegate = self |
| | | table.dataSource = self |
| | | table.estimatedRowHeight = 200 |
| | | table.register(UINib(nibName: "WelfareCouponsTCell", bundle: nil), forCellReuseIdentifier: "_WelfareCouponsTCell") |
| | | return table |
| | | }() |
| | |
| | | |
| | | extension WelfareCouponsSubListVC:UITableViewDelegate{ |
| | | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { |
| | | return UITableView.automaticDimension |
| | | let model = viewModel.dataSource.value[indexPath.row] |
| | | if rows.contains(where: {$0 == indexPath.row}){ |
| | | let h = max(String.jq_getHeight(text: model.instructionsForUse, width: JQ_ScreenW - 200, font: 12), 30) |
| | | return h + 125 |
| | | }else{ |
| | | return 125 |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | extension WelfareCouponsSubListVC:UITableViewDataSource{ |
| | |
| | | } |
| | | |
| | | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_WelfareCouponsTCell") as! WelfareCouponsTCell |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_WelfareCouponsTCell", for: indexPath) as! WelfareCouponsTCell |
| | | // let cell = tableView.dequeueReusableCell(withIdentifier: "_WelfareCouponsTCell") as! WelfareCouponsTCell |
| | | cell.indexPath = indexPath |
| | | cell.btn_info.isSelected = rows.contains(indexPath.row) |
| | | cell.label_info.isHidden = !rows.contains(indexPath.row) |
| | |
| | | extension WelfareExchangeRecordSubListVC:UITableViewDelegate{ |
| | | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| | | let model = viewModel.dataSource.value[indexPath.row] |
| | | if model.goodType == .coupon{ |
| | | let vc = WelfareCouponsListVC() |
| | | push(vc: vc) |
| | | }else{ |
| | | let vc = WelfareExchangeRecordDetailVC(id: model.detailsId, goodsType: model.goodType) |
| | | push(vc: vc) |
| | | } |
| | | } |
| | | } |
| | | |
| | | extension WelfareExchangeRecordSubListVC:UITableViewDataSource{ |
| | | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
| | |
| | | @IBOutlet weak var btn_weekly: UIButton! |
| | | @IBOutlet weak var btn_todayFree: UIButton! |
| | | |
| | | private var timer:Timer? |
| | | private var timerOffsetX:Double = 0 |
| | | private let cellW = 144.0 |
| | | private var benefitHomeModel:BenefitHomeModel? |
| | | private var updateProdDate:Date? |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | getData() |
| | | } |
| | | |
| | | override func viewDidDisappear(_ animated: Bool) { |
| | | super.viewDidDisappear(animated) |
| | | timer?.invalidate() |
| | | } |
| | | |
| | | override func viewWillDisappear(_ animated: Bool) { |
| | | super.viewWillDisappear(animated) |
| | | // navigationController?.isNavigationBarHidden = false |
| | | } |
| | | |
| | | override func viewWillAppear(_ animated: Bool) { |
| | | super.viewWillAppear(animated) |
| | | // navigationController?.isNavigationBarHidden = true |
| | | } |
| | | |
| | | override func viewDidAppear(_ animated: Bool) { |
| | | super.viewDidAppear(animated) |
| | | if timer != nil{ |
| | | recoverTimer() |
| | | }else{ |
| | | // if (benefitHomeModel?.commodities.count ?? 0) > 5{ |
| | | // autoScroll() |
| | | // } |
| | | if let date = updateProdDate{ |
| | | //防止反复切换,15秒 |
| | | if Date().timeIntervalSince1970 - date.timeIntervalSince1970 > 15{ |
| | | getData() |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | push(vc: vc) |
| | | } |
| | | |
| | | |
| | | private func autoScroll(){ |
| | | guard benefitHomeModel != nil else {return} |
| | | timer = Timer.scheduledTimer(timeInterval: 0.1, target: self, selector: #selector(runTimer), userInfo: nil, repeats: true) |
| | | timer?.fire() |
| | | RunLoop.current.add(timer!, forMode: .common) |
| | | } |
| | | |
| | | @objc func runTimer(){ |
| | | if timerOffsetX >= (JQ_ScreenW - cellW * Double(benefitHomeModel!.commodities.count - 3)){ |
| | | timerOffsetX = 0 |
| | | coinCollectionView.setContentOffset(CGPoint.zero, animated: true) |
| | | timer?.invalidate() |
| | | DispatchQueue.main.asyncAfter(deadline: .now()+2.5) { |
| | | self.recoverTimer() |
| | | } |
| | | } |
| | | self.timerOffsetX += 1 |
| | | self.coinCollectionView.setContentOffset(CGPoint(x: timerOffsetX, y: 0), animated: true) |
| | | } |
| | | |
| | | private func recoverTimer(){ |
| | | guard benefitHomeModel != nil else {return} |
| | | timer = Timer.scheduledTimer(timeInterval: 0.1, target: self, selector: #selector(runTimer), userInfo: nil, repeats: true) |
| | | } |
| | | |
| | | func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { |
| | | timer?.invalidate() |
| | | } |
| | | |
| | | func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) { |
| | | self.timerOffsetX = max(0,scrollView.contentOffset.x) |
| | | self.timer?.invalidate() |
| | | // DispatchQueue.main.asyncAfter(deadline: .now()+2.5) { |
| | | // self.recoverTimer() |
| | | // } |
| | | } |
| | | |
| | | override var preferredStatusBarStyle: UIStatusBarStyle{ |
| | | return .lightContent |
| | | } |
| | |
| | | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_WelfareCoinCCell", for: indexPath) as! WelfareCoinCCell |
| | | cell.label_name.text = model.commodityName |
| | | cell.label_price.text = model.commodityPrice.currency() |
| | | cell.img_cover.sd_setImage(with: URL(string: model.commodityImg), placeholderImage: UIImage(named: "test_1")) |
| | | cell.img_cover.sd_setImage(with: URL(string: model.commodityImg), placeholderImage: nil) |
| | | return cell |
| | | } |
| | | } |
| | |
| | | <constraint firstAttribute="width" secondItem="Kte-Xd-tVd" secondAttribute="height" multiplier="1:0.72" id="9pS-AQ-07b"/> |
| | | </constraints> |
| | | <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> |
| | | <state key="normal" backgroundImage="bg_welfare_coupon"/> |
| | | <connections> |
| | | <action selector="couponsAction:" destination="-1" eventType="touchUpInside" id="DXv-od-Hy1"/> |
| | | </connections> |
| | |
| | | <constraint firstAttribute="width" secondItem="hBk-90-GU4" secondAttribute="height" multiplier="1:0.6525" id="iMt-GH-OCP"/> |
| | | </constraints> |
| | | <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> |
| | | <state key="normal" backgroundImage="bg_welfare"/> |
| | | <connections> |
| | | <action selector="welfareWeeklyAction:" destination="-1" eventType="touchUpInside" id="bXl-Yh-tq4"/> |
| | | </connections> |
| | |
| | | <constraint firstAttribute="width" secondItem="r4f-Ay-EGJ" secondAttribute="height" multiplier="1:0.6525" id="WOq-qS-ptG"/> |
| | | </constraints> |
| | | <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> |
| | | <state key="normal" backgroundImage="bg_welfare_today"/> |
| | | <connections> |
| | | <action selector="freeTodayAction:" destination="-1" eventType="touchUpInside" id="CF2-ok-0h8"/> |
| | | </connections> |
| | |
| | | </view> |
| | | </objects> |
| | | <resources> |
| | | <image name="bg_welfare" width="308" height="201"/> |
| | | <image name="bg_welfare_coupon" width="390" height="281"/> |
| | | <image name="bg_welfare_today" width="308" height="201"/> |
| | | <image name="icon_coin_tiny" width="14" height="14"/> |
| | | <image name="icon_score" width="16" height="16"/> |
| | | <image name="icon_vip_medal" width="16" height="16"/> |
| | |
| | | <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> |
| | | </systemColor> |
| | | <systemColor name="tertiarySystemGroupedBackgroundColor"> |
| | | <color red="0.94901960780000005" green="0.94901960780000005" blue="0.96862745100000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <color red="0.94901960784313721" green="0.94901960784313721" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | </systemColor> |
| | | </resources> |
| | | </document> |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22154" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <device id="retina6_12" orientation="portrait" appearance="light"/> |
| | | <dependencies> |
| | | <deployment identifier="iOS"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22130"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/> |
| | | <capability name="Named colors" minToolsVersion="9.0"/> |
| | | <capability name="System colors in document resources" minToolsVersion="11.0"/> |
| | | <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> |
| | |
| | | <rect key="frame" x="0.0" y="0.0" width="485" height="184"/> |
| | | <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="mAq-ab-OQZ"> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="1000" verticalHuggingPriority="251" horizontalCompressionResistancePriority="250" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mAq-ab-OQZ"> |
| | | <rect key="frame" x="13.999999999999996" y="15" width="40.666666666666657" height="35"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> |
| | | <color key="textColor" red="0.23921568630000001" green="0.24313725489999999" blue="0.27058823529999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="BmZ-U5-ZlG"> |
| | | <rect key="frame" x="62.666666666666657" y="23" width="40" height="19"/> |
| | | <view contentMode="scaleToFill" horizontalCompressionResistancePriority="999" translatesAutoresizingMaskIntoConstraints="NO" id="BmZ-U5-ZlG"> |
| | | <rect key="frame" x="62.666666666666686" y="23" width="40" 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="o05-ea-KEG"> |
| | | <rect key="frame" x="5.0000000000000071" y="2" width="30" height="15"/> |
| | |
| | | </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="bHI-Vp-rzv"> |
| | | <rect key="frame" x="459.33333333333331" y="25.333333333333332" width="11.666666666666686" height="14.333333333333332"/> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" horizontalCompressionResistancePriority="1000" text="--" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bHI-Vp-rzv"> |
| | | <rect key="frame" x="112.66666666666669" y="25.333333333333332" width="358.33333333333331" height="14.333333333333332"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/> |
| | | <color key="textColor" red="0.23921568627450979" green="0.24313725490196078" blue="0.27058823529411763" alpha="0.69999999999999996" colorSpace="calibratedRGB"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | <constraint firstItem="a0M-Pb-uKt" firstAttribute="top" secondItem="mAq-ab-OQZ" secondAttribute="bottom" constant="13" id="her-lr-8fq"/> |
| | | <constraint firstAttribute="trailing" secondItem="a0M-Pb-uKt" secondAttribute="trailing" constant="14" id="jA3-O7-Mj7"/> |
| | | <constraint firstAttribute="trailing" secondItem="OTH-ok-NLN" secondAttribute="trailing" id="kaZ-U2-Swg"/> |
| | | <constraint firstItem="bHI-Vp-rzv" firstAttribute="leading" secondItem="BmZ-U5-ZlG" secondAttribute="trailing" constant="10" id="w7J-Sm-VQm"/> |
| | | <constraint firstItem="a0M-Pb-uKt" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="14" id="wse-fy-fPN"/> |
| | | <constraint firstItem="mAq-ab-OQZ" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="15" id="yEt-XT-2um"/> |
| | | </constraints> |
| | |
| | | override func setRx() { |
| | | NotificationCenter.default.rx.notification(UpdateDetailDate_Noti, object: nil).take(until: self.rx.deallocated).subscribe(onNext: {[weak self] data in |
| | | guard let weakSelf = self else { return } |
| | | self?.selects.removeAll() |
| | | self?.drop1 = nil |
| | | self?.drop2 = nil |
| | | self?.clearALL() |
| | | self?.querySiteTimes(halfName: weakSelf.halfName, siteName: weakSelf.siteName) |
| | | }).disposed(by: disposeBag) |
| | | } |
| | |
| | | drop1 = nil |
| | | drop2 = nil |
| | | selects.removeAll() |
| | | var val = YardDetailDateManager.shared().dates.value |
| | | val.removeAll() |
| | | YardDetailDateManager.shared().dates.accept(val) |
| | | |
| | | collectionView.reloadData() |
| | | } |
| | | |
| | |
| | | @IBOutlet weak var web_introduce: WKWebView! |
| | | @IBOutlet weak var cons_webHei: NSLayoutConstraint! |
| | | @IBOutlet weak var btn_booking: UIButton! |
| | | @IBOutlet weak var label_conponInfo: UILabel! |
| | | |
| | | private var coupons = [CouponInfoModel]() |
| | | private var selectCouponModel:CouponInfoModel? |
| | |
| | | if let models = data.data{ |
| | | self?.view_coupon.isHidden = models.count == 0 |
| | | self?.coupons = models |
| | | self?.label_conponInfo.isHidden = models.count == 0 |
| | | self?.label_conponInfo.text = String(format: "(%ld张可用)",models.count) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | |
| | | @IBAction func bookingAction(_ sender: UIButton) { |
| | | |
| | | guard !YardDetailDateManager.shared().dates.value.isEmpty else {alertError(msg: "请选择预约时间");return} |
| | | guard YardDetailDateManager.shared().dates.value.values.first!.count != 0 else {alertError(msg: "请选择预约时间");return} |
| | | guard !tf_person.isEmpty else {alertError(msg: "请输入预约人");tf_person.becomeFirstResponder();return} |
| | | guard !tf_phone.isEmpty else {alertError(msg: "请输入联系方式");tf_phone.becomeFirstResponder();return} |
| | | guard tf_phone.text!.jq_isPhone else {alertError(msg: "请输入正确的联系方式");return} |
| | |
| | | isHalf = 1 |
| | | } |
| | | |
| | | if siteDetailModel.nextName.count > 0 && isHalf == 1{ |
| | | if siteDetailModel.nextName.count > 0{ |
| | | nextName = siteDetailModel.nextName[yardIndex] |
| | | } |
| | | |
| | |
| | | guard let weakSelf = self else { return } |
| | | Services.reservationSite(booker: weakSelf.tf_person.text!, couponId: weakSelf.selectCouponModel?.id, id: weakSelf.siteDetailModel.id, payType: type, phone: weakSelf.tf_phone.text!, times: datetimes.joined(separator: ";"),halfName:halfName,isHalf:isHalf,nextName:nextName).subscribe(onNext: { data in |
| | | if let m = data.data{ |
| | | weakSelf.selectCouponModel = nil |
| | | weakSelf.btn_coupon.setTitle("去选择", for: .normal) |
| | | weakSelf.queryCoupon(price: Double(a.count) * cashPrice) |
| | | switch type { |
| | | case .aliPay: |
| | | YYPaymentManager.shared.sendPaymentRequest(YYAlipayRequest(orderString: m.orderString)) { result in |
| | |
| | | alert(msg: "交易取消") |
| | | let vc = YardBookingListVC(page: 5) |
| | | weakSelf.push(vc: vc) |
| | | NotificationCenter.default.post(name: UpdateDetailDate_Noti, object: nil) |
| | | case .failure(_): |
| | | NotificationCenter.default.post(name: UpdateDetailDate_Noti, object: nil) |
| | | let vc = PaymentResultVC(result: .fail("交易失败",0), objType: .yard,handleVC: nil) |
| | |
| | | <outlet property="label_address" destination="ABf-uR-SlT" id="vyV-vd-fqU"/> |
| | | <outlet property="label_cashPrice" destination="2xn-tO-Yya" id="5fc-MF-K3M"/> |
| | | <outlet property="label_coinPrice" destination="qTF-Bj-PLk" id="6Lh-p8-qdY"/> |
| | | <outlet property="label_conponInfo" destination="3qk-21-v3g" id="O0b-69-QVy"/> |
| | | <outlet property="label_datetime" destination="N2q-3h-Yvf" id="CN5-H5-VAs"/> |
| | | <outlet property="label_name" destination="weU-mS-qsX" id="AzG-WP-rGE"/> |
| | | <outlet property="label_price" destination="ats-7F-9UX" id="fUw-1m-wUI"/> |
| | |
| | | <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
| | | <subviews> |
| | | <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aCz-js-83k"> |
| | | <rect key="frame" x="0.0" y="59" width="393" height="759"/> |
| | | <rect key="frame" x="0.0" y="59" width="393" height="758.99999999999977"/> |
| | | <subviews> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9j6-1C-tRQ"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="1432.6666666666667"/> |
| | |
| | | <constraint firstAttribute="height" constant="1" id="DT6-iC-VbU"/> |
| | | </constraints> |
| | | </view> |
| | | <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3qk-21-v3g"> |
| | | <rect key="frame" x="88.666666666666671" y="18.333333333333258" width="11.333333333333329" height="14.333333333333336"/> |
| | | <fontDescription key="fontDescription" type="system" pointSize="12"/> |
| | | <nil key="textColor"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | </subviews> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <constraints> |
| | | <constraint firstAttribute="trailing" secondItem="MMe-xz-jIA" secondAttribute="trailing" constant="14" id="7lC-cu-8l7"/> |
| | | <constraint firstAttribute="height" constant="51" id="9fF-xl-H6t"/> |
| | | <constraint firstItem="MMe-xz-jIA" firstAttribute="centerY" secondItem="v56-xm-qbo" secondAttribute="centerY" id="DPP-yr-Q7s"/> |
| | | <constraint firstItem="3qk-21-v3g" firstAttribute="centerY" secondItem="NvT-Br-9vi" secondAttribute="centerY" id="Ps4-gw-IX1"/> |
| | | <constraint firstAttribute="trailing" secondItem="crc-Oo-B1B" secondAttribute="trailing" id="SCJ-2p-7El"/> |
| | | <constraint firstItem="NvT-Br-9vi" firstAttribute="centerY" secondItem="v56-xm-qbo" secondAttribute="centerY" id="WGd-0q-cx2"/> |
| | | <constraint firstAttribute="bottom" secondItem="crc-Oo-B1B" secondAttribute="bottom" id="Wuh-aa-hzU"/> |
| | | <constraint firstItem="MMe-xz-jIA" firstAttribute="top" secondItem="v56-xm-qbo" secondAttribute="top" id="Zb6-of-8by"/> |
| | | <constraint firstItem="crc-Oo-B1B" firstAttribute="leading" secondItem="v56-xm-qbo" secondAttribute="leading" constant="13" id="exb-7W-w3e"/> |
| | | <constraint firstItem="3qk-21-v3g" firstAttribute="leading" secondItem="NvT-Br-9vi" secondAttribute="trailing" constant="3" id="oxP-mh-Pq8"/> |
| | | <constraint firstItem="NvT-Br-9vi" firstAttribute="leading" secondItem="v56-xm-qbo" secondAttribute="leading" constant="14" id="pC2-M4-wuR"/> |
| | | <constraint firstAttribute="bottom" secondItem="MMe-xz-jIA" secondAttribute="bottom" id="zLP-uY-cJ9"/> |
| | | </constraints> |