| | |
| | | 136FD9AE2A4C2F0500933B7C /* RechargeItemCCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 136FD9AC2A4C2F0500933B7C /* RechargeItemCCell.xib */; }; |
| | | 136FD9B12A4C354000933B7C /* WelfareRedeemGoodsDetailVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 136FD9AF2A4C354000933B7C /* WelfareRedeemGoodsDetailVC.swift */; }; |
| | | 136FD9B22A4C354000933B7C /* WelfareRedeemGoodsDetailVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 136FD9B02A4C354000933B7C /* WelfareRedeemGoodsDetailVC.xib */; }; |
| | | 1371CD062BA3E7F2007E0849 /* StudentInfo_2_1_TCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1371CD042BA3E7F2007E0849 /* StudentInfo_2_1_TCell.swift */; }; |
| | | 1371CD072BA3E7F2007E0849 /* StudentInfo_2_1_TCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1371CD052BA3E7F2007E0849 /* StudentInfo_2_1_TCell.xib */; }; |
| | | 137546402A57F545001FA77A /* UserModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1375463F2A57F545001FA77A /* UserModel.swift */; }; |
| | | 137546432A57F56F001FA77A /* CommonModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 137546422A57F56F001FA77A /* CommonModels.swift */; }; |
| | | 137546452A58038B001FA77A /* BaseTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 137546442A58038B001FA77A /* BaseTableView.swift */; }; |
| | |
| | | 136FD9AC2A4C2F0500933B7C /* RechargeItemCCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = RechargeItemCCell.xib; sourceTree = "<group>"; }; |
| | | 136FD9AF2A4C354000933B7C /* WelfareRedeemGoodsDetailVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelfareRedeemGoodsDetailVC.swift; sourceTree = "<group>"; }; |
| | | 136FD9B02A4C354000933B7C /* WelfareRedeemGoodsDetailVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WelfareRedeemGoodsDetailVC.xib; sourceTree = "<group>"; }; |
| | | 1371CD042BA3E7F2007E0849 /* StudentInfo_2_1_TCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StudentInfo_2_1_TCell.swift; sourceTree = "<group>"; }; |
| | | 1371CD052BA3E7F2007E0849 /* StudentInfo_2_1_TCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = StudentInfo_2_1_TCell.xib; sourceTree = "<group>"; }; |
| | | 1375463F2A57F545001FA77A /* UserModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserModel.swift; sourceTree = "<group>"; }; |
| | | 137546422A57F56F001FA77A /* CommonModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonModels.swift; sourceTree = "<group>"; }; |
| | | 137546442A58038B001FA77A /* BaseTableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseTableView.swift; sourceTree = "<group>"; }; |
| | |
| | | 1376A6942A4A765700D4C851 /* StudentInfo_3_TCell.xib */, |
| | | 138A25AE2B91CE8E00B2EE49 /* StudentInfo_5_TCell.swift */, |
| | | 138A25AF2B91CE8E00B2EE49 /* StudentInfo_5_TCell.xib */, |
| | | 1371CD042BA3E7F2007E0849 /* StudentInfo_2_1_TCell.swift */, |
| | | 1371CD052BA3E7F2007E0849 /* StudentInfo_2_1_TCell.xib */, |
| | | ); |
| | | path = TCell; |
| | | sourceTree = "<group>"; |
| | |
| | | 13EAF3822AB43657000A6F07 /* GamesIntruduceView.xib in Resources */, |
| | | 8DFA9B922A317DE900E99281 /* WelfareVC.xib in Resources */, |
| | | 13F88B062B8F46EA0055317B /* WorldCupListVC.xib in Resources */, |
| | | 1371CD072BA3E7F2007E0849 /* StudentInfo_2_1_TCell.xib in Resources */, |
| | | 13B640C12A54108B00EA33ED /* UploadImgCCell.xib in Resources */, |
| | | 8D8DEDF32A31DDC500F2C7FA /* CouponCCell.xib in Resources */, |
| | | 138D8B8F2A3FFE36009DCA9E /* YardListVC.xib in Resources */, |
| | |
| | | 13801CBE2A4D20D20041454D /* ChooseStoreView.swift in Sources */, |
| | | 137801932A3B0D3C00414959 /* CourseOnlineCCell.swift in Sources */, |
| | | 13675FF72B8CBDD400085A66 /* WorldCupMenuVC.swift in Sources */, |
| | | 1371CD062BA3E7F2007E0849 /* StudentInfo_2_1_TCell.swift in Sources */, |
| | | 138A25B02B91CE8E00B2EE49 /* StudentInfo_5_TCell.swift in Sources */, |
| | | 1324D35B2B8DE5EA00F168A8 /* WorldCupRecordTCell.swift in Sources */, |
| | | 136FD9AD2A4C2F0500933B7C /* RechargeItemCCell.swift in Sources */, |
| | |
| | | import RxCocoa |
| | | |
| | | class ActivitySignupViewModel:RefreshModel<ActivityListModel>{ |
| | | var type = BehaviorRelay<SignupType>(value: .all) |
| | | override func api() -> (Observable<BaseResponse<[ActivityListModel]>>)? { |
| | | return Services.queryMyCompetitionList(page: page,pageSize: 20, type: type.value) |
| | | } |
| | | var type = BehaviorRelay<SignupType>(value: .all) |
| | | override func api() -> (Observable<BaseResponse<[ActivityListModel]>>)? { |
| | | return Services.queryMyCompetitionList(page: page,pageSize: 20, type: type.value) |
| | | } |
| | | } |
| | | |
| | | class ActivitySignupListSubVC: BaseVC { |
| | | |
| | | var viewModel = ActivitySignupViewModel() |
| | | |
| | | lazy private var tableView:BaseTableView = { |
| | | let tableView = BaseTableView(frame: .zero, style: .plain) |
| | | tableView.delegate = self |
| | | tableView.dataSource = self |
| | | tableView.separatorStyle = .none |
| | | tableView.register(UINib(nibName: "ActivityInfoTCell", bundle: nil), forCellReuseIdentifier: "_ActivityInfoTCell") |
| | | return tableView |
| | | }() |
| | | |
| | | init(type:SignupType) { |
| | | super.init(nibName: nil, bundle: nil) |
| | | viewModel.type.accept(type) |
| | | } |
| | | |
| | | required init?(coder: NSCoder) { |
| | | fatalError("init(coder:) has not been implemented") |
| | | } |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | view.backgroundColor = .white |
| | | var viewModel = ActivitySignupViewModel() |
| | | |
| | | // tableView.jq_setEmptyView() |
| | | viewModel.configure(tableView) |
| | | viewModel.beginRefresh() |
| | | } |
| | | |
| | | override func setUI() { |
| | | view.addSubview(tableView) |
| | | tableView.snp.makeConstraints { make in |
| | | make.edges.equalToSuperview() |
| | | } |
| | | } |
| | | lazy private var tableView:BaseTableView = { |
| | | let tableView = BaseTableView(frame: .zero, style: .plain) |
| | | tableView.delegate = self |
| | | tableView.dataSource = self |
| | | tableView.separatorStyle = .none |
| | | tableView.register(UINib(nibName: "ActivityInfoTCell", bundle: nil), forCellReuseIdentifier: "_ActivityInfoTCell") |
| | | return tableView |
| | | }() |
| | | |
| | | override func setRx() { |
| | | NotificationCenter.default.rx.notification(CancelActivitySingup_Noti).take(until: self.rx.deallocated).subscribe(onNext: {[weak self]noti in |
| | | self?.viewModel.beginRefresh() |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | init(type:SignupType) { |
| | | super.init(nibName: nil, bundle: nil) |
| | | viewModel.type.accept(type) |
| | | } |
| | | |
| | | required init?(coder: NSCoder) { |
| | | fatalError("init(coder:) has not been implemented") |
| | | } |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | view.backgroundColor = .white |
| | | |
| | | // tableView.jq_setEmptyView() |
| | | viewModel.configure(tableView) |
| | | viewModel.beginRefresh() |
| | | } |
| | | |
| | | override func setUI() { |
| | | view.addSubview(tableView) |
| | | tableView.snp.makeConstraints { make in |
| | | make.edges.equalToSuperview() |
| | | } |
| | | } |
| | | |
| | | override func setRx() { |
| | | NotificationCenter.default.rx.notification(CancelActivitySingup_Noti).take(until: self.rx.deallocated).subscribe(onNext: {[weak self]noti in |
| | | self?.viewModel.beginRefresh() |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | } |
| | | |
| | | extension ActivitySignupListSubVC:UITableViewDelegate{ |
| | | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| | | let model = viewModel.dataSource.value[indexPath.row] |
| | | let vc = ActivitySignupDetailVC(id: model.id) |
| | | push(vc: vc) |
| | | } |
| | | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| | | let model = viewModel.dataSource.value[indexPath.row] |
| | | let vc = ActivitySignupDetailVC(id: model.id) |
| | | push(vc: vc) |
| | | } |
| | | } |
| | | |
| | | extension ActivitySignupListSubVC:UITableViewDataSource{ |
| | | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
| | | let model = viewModel.dataSource.value[indexPath.row] |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_ActivityInfoTCell") as! ActivityInfoTCell |
| | | cell.activityListModel = model |
| | | cell.label_ageScope.isHidden = true |
| | | return cell |
| | | } |
| | | |
| | | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
| | | return viewModel.dataSource.value.count |
| | | } |
| | | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
| | | let model = viewModel.dataSource.value[indexPath.row] |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_ActivityInfoTCell") as! ActivityInfoTCell |
| | | cell.activityListModel = model |
| | | cell.label_ageScope.isHidden = true |
| | | return cell |
| | | } |
| | | |
| | | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
| | | return viewModel.dataSource.value.count |
| | | } |
| | | } |
| | |
| | | import JQTools |
| | | |
| | | class ActivitySignupListVC: BaseVC { |
| | | |
| | | private var pageMenu:SPPageMenu = { |
| | | let pageMenu = SPPageMenu(frame: .zero, trackerStyle: .line) |
| | | // 追踪线 |
| | | pageMenu.trackerWidth = 56 |
| | | pageMenu.setTrackerHeight(3, cornerRadius: 1.5) |
| | | pageMenu.tracker.backgroundColor = UIColor(hexStr: "#FF9D2E") |
| | | pageMenu.trackerFollowingMode = .always |
| | | pageMenu.contentInset = UIEdgeInsets(top: 0, left: 14, bottom: 0, right: 14) |
| | | |
| | | // 分割线 |
| | | pageMenu.dividingLine.backgroundColor = .clear |
| | | pageMenu.dividingLineHeight = 1 |
| | | private var pageMenu:SPPageMenu = { |
| | | let pageMenu = SPPageMenu(frame: .zero, trackerStyle: .line) |
| | | // 追踪线 |
| | | pageMenu.trackerWidth = 56 |
| | | pageMenu.setTrackerHeight(3, cornerRadius: 1.5) |
| | | pageMenu.tracker.backgroundColor = UIColor(hexStr: "#FF9D2E") |
| | | pageMenu.trackerFollowingMode = .always |
| | | pageMenu.contentInset = UIEdgeInsets(top: 0, left: 14, bottom: 0, right: 14) |
| | | |
| | | // item |
| | | pageMenu.spacing = 20.0 |
| | | pageMenu.permutationWay = .notScrollEqualWidths |
| | | pageMenu.setItems(["全部","进行中","已结束","未开始","已取消"], selectedItemIndex: 0) |
| | | // 分割线 |
| | | pageMenu.dividingLine.backgroundColor = .clear |
| | | pageMenu.dividingLineHeight = 1 |
| | | |
| | | // 字体 |
| | | pageMenu.selectedItemTitleFont = UIFont.systemFont(ofSize: 14, weight: .semibold) |
| | | pageMenu.unSelectedItemTitleFont = UIFont.systemFont(ofSize: 14,weight: .medium) |
| | | // 颜色 |
| | | pageMenu.selectedItemTitleColor = .black.withAlphaComponent(0.8) |
| | | pageMenu.unSelectedItemTitleColor = .black.withAlphaComponent(0.6) |
| | | |
| | | return pageMenu |
| | | }() |
| | | |
| | | lazy var pageViewController:FFPageViewController = { |
| | | let pageVC = FFPageViewController() |
| | | pageVC.view.backgroundColor = .clear |
| | | pageVC.scrollview.backgroundColor = .clear |
| | | // item |
| | | pageMenu.spacing = 20.0 |
| | | pageMenu.permutationWay = .notScrollEqualWidths |
| | | pageMenu.setItems(["全部","进行中","已结束","未开始","已取消"], selectedItemIndex: 0) |
| | | |
| | | pageVC.scrollview.bounces = false |
| | | return pageVC |
| | | }() |
| | | // 字体 |
| | | pageMenu.selectedItemTitleFont = UIFont.systemFont(ofSize: 14, weight: .semibold) |
| | | pageMenu.unSelectedItemTitleFont = UIFont.systemFont(ofSize: 14,weight: .medium) |
| | | // 颜色 |
| | | pageMenu.selectedItemTitleColor = .black.withAlphaComponent(0.8) |
| | | pageMenu.unSelectedItemTitleColor = .black.withAlphaComponent(0.6) |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | title = "我的报名" |
| | | |
| | | pageMenu.delegate = self |
| | | pageViewController.delegate = self |
| | | |
| | | } |
| | | |
| | | override func setUI() { |
| | | pageMenu.frame = CGRect(x: 0, y: view.safeAreaInsets.top + JQ_NavBarHeight, width: JQ_ScreenW, height: 50) |
| | | pageMenu.layer.shadowColor = UIColor(hexStr: "#EFEEEE").withAlphaComponent(0.5).cgColor |
| | | pageMenu.layer.shadowOffset = CGSize(width: 0, height: 2) |
| | | pageMenu.layer.shadowOpacity = 1 |
| | | view.addSubview(pageMenu) |
| | | view.backgroundColor = .white |
| | | |
| | | addChild(pageViewController) |
| | | view.insertSubview(pageViewController.view, at: 0) |
| | | pageViewController.didMove(toParent: self) |
| | | |
| | | pageViewController.view.frame = CGRect(x: 0, y: view.safeAreaInsets.top + JQ_NavBarHeight + 50, width: JQ_ScreenW, height: JQ_ScreenH - view.safeAreaInsets.top - JQ_NavBarHeight - 9 - 45) |
| | | } |
| | | return pageMenu |
| | | }() |
| | | |
| | | lazy var pageViewController:FFPageViewController = { |
| | | let pageVC = FFPageViewController() |
| | | pageVC.view.backgroundColor = .clear |
| | | pageVC.scrollview.backgroundColor = .clear |
| | | |
| | | pageVC.scrollview.bounces = false |
| | | return pageVC |
| | | }() |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | title = "我的报名" |
| | | |
| | | pageMenu.delegate = self |
| | | pageViewController.delegate = self |
| | | |
| | | } |
| | | |
| | | override func setUI() { |
| | | pageMenu.frame = CGRect(x: 0, y: view.safeAreaInsets.top + JQ_NavBarHeight, width: JQ_ScreenW, height: 50) |
| | | pageMenu.layer.shadowColor = UIColor(hexStr: "#EFEEEE").withAlphaComponent(0.5).cgColor |
| | | pageMenu.layer.shadowOffset = CGSize(width: 0, height: 2) |
| | | pageMenu.layer.shadowOpacity = 1 |
| | | view.addSubview(pageMenu) |
| | | view.backgroundColor = .white |
| | | |
| | | addChild(pageViewController) |
| | | view.insertSubview(pageViewController.view, at: 0) |
| | | pageViewController.didMove(toParent: self) |
| | | |
| | | pageViewController.view.frame = CGRect(x: 0, y: view.safeAreaInsets.top + JQ_NavBarHeight + 50, width: JQ_ScreenW, height: JQ_ScreenH - view.safeAreaInsets.top - JQ_NavBarHeight - 9 - 45) |
| | | } |
| | | } |
| | | |
| | | extension ActivitySignupListVC:SPPageMenuDelegate{ |
| | | func pageMenu(_ pageMenu: SPPageMenu, itemSelectedAt index: Int) { |
| | | pageViewController.scroll(toPage: index, animation: true) |
| | | } |
| | | func pageMenu(_ pageMenu: SPPageMenu, itemSelectedAt index: Int) { |
| | | pageViewController.scroll(toPage: index, animation: true) |
| | | } |
| | | } |
| | | |
| | | |
| | | extension ActivitySignupListVC:FFPageViewControllerDelegate{ |
| | | |
| | | func pageViewController(_ pageViewController: FFPageViewController, currentPageChanged currentPage: Int) { |
| | | pageMenu.selectedItemIndex = currentPage |
| | | } |
| | | |
| | | func totalPagesOfpageViewController(_ pageViewConteoller: FFPageViewController) -> UInt { |
| | | return pageMenu.numberOfItems |
| | | } |
| | | |
| | | func pageViewController(_ pageViewConteoller: FFPageViewController, controllerForPage page: Int) -> UIViewController { |
| | | |
| | | var type:SignupType = .all |
| | | switch page{ |
| | | case 1:type = .ongoing |
| | | case 2:type = .over |
| | | case 3:type = .prepare |
| | | case 4:type = .cancel |
| | | default:type = .all |
| | | } |
| | | let vc = ActivitySignupListSubVC(type:type) |
| | | return vc |
| | | } |
| | | func pageViewController(_ pageViewController: FFPageViewController, currentPageChanged currentPage: Int) { |
| | | pageMenu.selectedItemIndex = currentPage |
| | | } |
| | | |
| | | func totalPagesOfpageViewController(_ pageViewConteoller: FFPageViewController) -> UInt { |
| | | return pageMenu.numberOfItems |
| | | } |
| | | |
| | | func pageViewController(_ pageViewConteoller: FFPageViewController, controllerForPage page: Int) -> UIViewController { |
| | | |
| | | var type:SignupType = .all |
| | | switch page{ |
| | | case 1:type = .ongoing |
| | | case 2:type = .over |
| | | case 3:type = .prepare |
| | | case 4:type = .cancel |
| | | default:type = .all |
| | | } |
| | | let vc = ActivitySignupListSubVC(type:type) |
| | | return vc |
| | | } |
| | | |
| | | } |
| | |
| | | storesView.view_profile.isHidden = !updateUserProfile |
| | | storesView.frame = sceneDelegate?.window?.frame ?? .zero |
| | | sceneDelegate?.window?.addSubview(storesView) |
| | | storesView.cons_bottom.constant = 0 |
| | | storesView.cons_bottom.constant = -UIDevice.jq_safeEdges.bottom |
| | | storesView.tf_phone.text = model.phone |
| | | storesView.tf_height.text = "\(model.height.int)" |
| | | storesView.tf_weight.text = "\(model.weight.int)" |
| | |
| | | <constraint firstItem="ZAh-4X-KgY" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="3hB-2M-dCz"/> |
| | | <constraint firstAttribute="trailing" secondItem="ZAh-4X-KgY" secondAttribute="trailing" id="H19-1B-OUy"/> |
| | | <constraint firstItem="ZAh-4X-KgY" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="SgX-gc-8zU"/> |
| | | <constraint firstAttribute="bottom" secondItem="FQP-Da-djy" secondAttribute="bottom" id="Xfr-Bp-8jB"/> |
| | | <constraint firstItem="FQP-Da-djy" firstAttribute="top" secondItem="ZAh-4X-KgY" secondAttribute="bottom" id="Zk1-2K-JHo"/> |
| | | <constraint firstItem="FQP-Da-djy" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="c0g-Sn-Fvg"/> |
| | | <constraint firstAttribute="bottom" secondItem="FQP-Da-djy" secondAttribute="bottom" id="dTD-bt-pns"/> |
| | | <constraint firstAttribute="trailing" secondItem="FQP-Da-djy" secondAttribute="trailing" id="pRf-XY-SYk"/> |
| | | </constraints> |
| | | <connections> |
| | | <outlet property="cons_bottom" destination="Xfr-Bp-8jB" id="IZH-JX-BFj"/> |
| | | <outlet property="cons_bottom" destination="dTD-bt-pns" id="h0d-JB-Guo"/> |
| | | <outlet property="img_profile" destination="bj7-gH-bLI" id="GsX-Bs-0B2"/> |
| | | <outlet property="tf_height" destination="Zec-I5-pJT" id="48c-gi-8K9"/> |
| | | <outlet property="tf_phone" destination="Cui-v0-oxz" id="Twv-bl-sNA"/> |
| | |
| | | @IBOutlet weak var tf_phone: QMUITextField! |
| | | @IBOutlet weak var tf_birthday: UITextField! |
| | | @IBOutlet weak var img_idCardSingle: UIImageView! |
| | | |
| | | @IBOutlet weak var img_phoneSingle: UIImageView! |
| | | |
| | | var profileImg:UIImage? |
| | | |
| | | var studentModel = StudentProfileModel() |
| | |
| | | |
| | | var verifyIdCard:Bool = false |
| | | var identity:Bool = false //是否需要实名 |
| | | var identityPhone:Bool = false //是否需要实名手机 |
| | | |
| | | init(type:ItemType,studentInfo:StudentProfile1Model? = nil,identity:Bool = false) { |
| | | |
| | | init(type:ItemType,studentInfo:StudentProfile1Model? = nil,identity:Bool = false,identityPhone:Bool = false) { |
| | | super.init(nibName: nil, bundle: nil) |
| | | self.type = type |
| | | self.studentInfo = studentInfo |
| | | self.identity = identity |
| | | self.identityPhone = identityPhone |
| | | } |
| | | |
| | | init(type:ItemType,activityDetailPartModel:ActivityDetailPartModel? = nil,identity:Bool = false) { |
| | | init(type:ItemType,activityDetailPartModel:ActivityDetailPartModel? = nil,identity:Bool = false,identityPhone:Bool = false) { |
| | | super.init(nibName: nil, bundle: nil) |
| | | self.type = type |
| | | self.activityDetailPartModel = activityDetailPartModel |
| | | self.identity = identity |
| | | self.identityPhone = identityPhone |
| | | } |
| | | |
| | | required init?(coder: NSCoder) { |
| | |
| | | super.viewDidLoad() |
| | | |
| | | img_idCardSingle.isHidden = !identity |
| | | img_phoneSingle.isHidden = !identityPhone |
| | | |
| | | if type == .course{ |
| | | title = "添加运动营成员" |
| | |
| | | @IBAction func completeAction(_ sender: UIButton) { |
| | | |
| | | if !view_profile.isHidden{ |
| | | guard profileImg != nil else { |
| | | guard profileImg != nil || !(studentInfo?.stuHeadImg.isEmpty ?? true) else { |
| | | |
| | | if type == .course{ |
| | | alertError(msg: "请上传运动营成员头像"); |
| | |
| | | guard tf_height.text != "0" else {alertError(msg: "请输入正确的身高");return} |
| | | guard tf_weight.text != "0" else {alertError(msg: "请输入正确的体重");return} |
| | | |
| | | if !tf_phone.isEmpty{ |
| | | if !tf_phone.isEmpty || identityPhone{ |
| | | guard tf_phone.text!.jq_isPhone else {alertError(msg: "请输入正确的手机号");return} |
| | | } |
| | | |
| | |
| | | guard tf_idCard.text!.jq_idCard() else {alertError(msg: "请输入正确的身份证号码");return} |
| | | } |
| | | |
| | | studentModel.birthday = tf_birthday.text! |
| | | if let birthday = tf_idCard.text?.jq_idCardBirthday(){ |
| | | studentModel.birthday = birthday |
| | | } |
| | | |
| | | studentModel.name = tf_name.text! |
| | | studentModel.height = tf_height.text!.toDouble |
| | | studentModel.weight = tf_weight.text!.toDouble |
| | |
| | | <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="AddStudentVC" customModule="WanPai" customModuleProvider="target"> |
| | | <connections> |
| | | <outlet property="img_idCardSingle" destination="fvg-3w-ZtH" id="Jbe-zT-f6D"/> |
| | | <outlet property="img_phoneSingle" destination="Uo9-I6-elv" id="t3j-Xy-UEX"/> |
| | | <outlet property="img_profile" destination="5oh-CW-AiU" id="lde-3f-DOi"/> |
| | | <outlet property="tf_birthday" destination="Gwh-N7-mRQ" id="Xsk-gB-nJj"/> |
| | | <outlet property="tf_gender" destination="5l9-vJ-vil" id="Ch0-JK-GqD"/> |
| | |
| | | <constraint firstAttribute="height" constant="0.40000000000000002" id="2yI-f5-96H"/> |
| | | </constraints> |
| | | </view> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="联系方式" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="DPg-zi-req"> |
| | | <rect key="frame" x="14.000000000000004" y="16.666666666666686" width="57.333333333333343" height="17"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/> |
| | | <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入运动营成员联系方式" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="eT7-mO-3I8" customClass="QMUITextField"> |
| | | <rect key="frame" x="120" y="0.0" width="233" height="49.666666666666664"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/> |
| | |
| | | </userDefinedRuntimeAttribute> |
| | | </userDefinedRuntimeAttributes> |
| | | </textField> |
| | | <stackView opaque="NO" contentMode="scaleToFill" spacing="3" translatesAutoresizingMaskIntoConstraints="NO" id="30u-sF-SWv"> |
| | | <rect key="frame" x="14.000000000000004" y="16.666666666666686" width="57.333333333333343" height="17"/> |
| | | <subviews> |
| | | <imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_item_p" translatesAutoresizingMaskIntoConstraints="NO" id="Uo9-I6-elv"> |
| | | <rect key="frame" x="0.0" y="0.0" width="0.0" height="17"/> |
| | | </imageView> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="联系方式" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7ew-H9-V5J"> |
| | | <rect key="frame" x="0.0" y="0.0" width="57.333333333333336" height="17"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/> |
| | | <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | </subviews> |
| | | </stackView> |
| | | </subviews> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <constraints> |
| | | <constraint firstItem="30u-sF-SWv" firstAttribute="leading" secondItem="2nU-pk-phu" secondAttribute="leading" constant="14" id="1q9-6a-2A4"/> |
| | | <constraint firstItem="eT7-mO-3I8" firstAttribute="leading" secondItem="2nU-pk-phu" secondAttribute="leading" constant="120" id="5rc-Vo-lne"/> |
| | | <constraint firstAttribute="trailing" secondItem="eT7-mO-3I8" secondAttribute="trailing" constant="40" id="Amx-f1-Qi4"/> |
| | | <constraint firstItem="DPg-zi-req" firstAttribute="leading" secondItem="2nU-pk-phu" secondAttribute="leading" constant="14" id="EXc-da-VkD"/> |
| | | <constraint firstItem="c6a-Ai-3Np" firstAttribute="top" secondItem="eT7-mO-3I8" secondAttribute="bottom" id="GCe-gk-F1O"/> |
| | | <constraint firstItem="eT7-mO-3I8" firstAttribute="top" secondItem="2nU-pk-phu" secondAttribute="top" id="GhU-m9-uTp"/> |
| | | <constraint firstItem="30u-sF-SWv" firstAttribute="centerY" secondItem="2nU-pk-phu" secondAttribute="centerY" id="Hul-E2-gkF"/> |
| | | <constraint firstAttribute="trailing" secondItem="c6a-Ai-3Np" secondAttribute="trailing" constant="14" id="Jew-PT-4Tk"/> |
| | | <constraint firstItem="DPg-zi-req" firstAttribute="centerY" secondItem="2nU-pk-phu" secondAttribute="centerY" id="amO-dK-CUg"/> |
| | | <constraint firstAttribute="bottom" secondItem="c6a-Ai-3Np" secondAttribute="bottom" id="btp-Pj-qXe"/> |
| | | <constraint firstAttribute="height" constant="50" id="dxG-vK-Tf9"/> |
| | | <constraint firstItem="c6a-Ai-3Np" firstAttribute="leading" secondItem="2nU-pk-phu" secondAttribute="leading" constant="14" id="j7Q-C8-u2p"/> |
| | |
| | | <rect key="frame" x="0.0" y="0.0" width="0.0" height="17"/> |
| | | </imageView> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="身份证号" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JjF-jS-GPH"> |
| | | <rect key="frame" x="0.0" y="0.0" width="57.333333333333329" height="17"/> |
| | | <rect key="frame" x="0.0" y="0.0" width="57.333333333333336" height="17"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/> |
| | | <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | weakSelf.cons_tableHei.constant = CGFloat((weakSelf.studentModels.count) * 87) |
| | | weakSelf.changePrice(weakSelf.selectClassIndex) |
| | | } needAddClouse: { [weak self] () in |
| | | let vc = AddStudentVC(type: .course,studentInfo: nil) |
| | | let vc = AddStudentVC(type: .course,studentInfo: nil,identity:true) |
| | | self?.push(vc: vc) |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @IBAction func addStudentAction(_ sender: QMUIButton) { |
| | | let vc = AddStudentVC(type: .course,studentInfo: nil) |
| | | let vc = AddStudentVC(type: .course,studentInfo: nil,identity:true) |
| | | push(vc: vc) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @IBAction func addStudentAction(_ sender: QMUIButton) { |
| | | let addstudentVC = AddStudentVC(type: .course,studentInfo: nil) |
| | | let addstudentVC = AddStudentVC(type: .course,studentInfo: nil,identity:true) |
| | | push(vc: addstudentVC) |
| | | } |
| | | } |
| | |
| | | tableView.delegate = self |
| | | tableView.dataSource = self |
| | | tableView.separatorStyle = .none |
| | | tableView.showsVerticalScrollIndicator = false |
| | | tableView.showsHorizontalScrollIndicator = false |
| | | tableView.register(UINib(nibName: "StudentInfo_3_TCell", bundle: nil), forCellReuseIdentifier: "_StudentInfo_3_TCell") |
| | | // tableView.jq_setEmptyView() |
| | | } |
| | |
| | | } |
| | | |
| | | @IBAction func addStudentAction(_ sender: UIButton) { |
| | | let studentVC = AddStudentVC(type: .course,studentInfo: nil) |
| | | let studentVC = AddStudentVC(type: .course,studentInfo: nil,identity:true) |
| | | push(vc: studentVC) |
| | | } |
| | | |
| | |
| | | var oneself: Int = 0 |
| | | var totalSession: Int = 0 |
| | | var winRate: Int = 0 |
| | | var rank:Int = 0 |
| | | } |
| | | |
| | | struct WorldCupPeopleModel:HandyJSON{ |
| | |
| | | Services.getCompletedCupTips().subscribe(onNext: {data in |
| | | if (data.data ?? 0) > 0{ |
| | | FinishWorldCupMatchView.show { |
| | | let vc = WorldCupVC() |
| | | let vc = WorldCupVC(toPage: 2) |
| | | weakSelf.push(vc: vc) |
| | | } |
| | | } |
New file |
| | |
| | | // |
| | | // StudentInfo_2_1_TCell.swift |
| | | // WanPai |
| | | // |
| | | // Created by 无故事王国 on 2024/3/15. |
| | | // |
| | | |
| | | import UIKit |
| | | |
| | | class StudentInfo_2_1_TCell: UITableViewCell { |
| | | |
| | | @IBOutlet weak var img_radio: UIImageView! |
| | | @IBOutlet weak var label_name: UILabel! |
| | | @IBOutlet weak var label_idCard: UILabel! |
| | | @IBOutlet weak var label_age: UILabel! |
| | | @IBOutlet weak var label_phone: UILabel! |
| | | @IBOutlet weak var view_container: UIView! |
| | | |
| | | var indexPath:IndexPath? |
| | | var activityDetailPartModel:ActivityDetailPartModel!{ |
| | | didSet{ |
| | | label_name.text = activityDetailPartModel.name |
| | | label_idCard.text = activityDetailPartModel.idcard |
| | | label_age.text = "\(activityDetailPartModel.age)岁" |
| | | label_phone.text = activityDetailPartModel.phone |
| | | } |
| | | } |
| | | |
| | | var isChoose:Bool!{ |
| | | didSet{ |
| | | img_radio.isHidden = !isChoose |
| | | } |
| | | } |
| | | |
| | | override func awakeFromNib() { |
| | | super.awakeFromNib() |
| | | selectionStyle = .none |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" 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="22684"/> |
| | | <capability name="Safe area layout guides" minToolsVersion="9.0"/> |
| | | <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> |
| | | </dependencies> |
| | | <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="_StudentInfo_2_1_TCell" rowHeight="100" id="KGk-i7-Jjw" customClass="StudentInfo_2_1_TCell" customModule="WanPai" customModuleProvider="target"> |
| | | <rect key="frame" x="0.0" y="0.0" width="660" height="100"/> |
| | | <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> |
| | | <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" ambiguous="YES" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> |
| | | <rect key="frame" x="0.0" y="0.0" width="660" height="100"/> |
| | | <autoresizingMask key="autoresizingMask"/> |
| | | <subviews> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5dz-Z7-EDq"> |
| | | <rect key="frame" x="14" y="7" width="632" height="76"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="姓名:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CYE-Is-6tp"> |
| | | <rect key="frame" x="10" y="13" width="36" height="20"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="20" id="OGu-TT-oFV"/> |
| | | </constraints> |
| | | <fontDescription key="fontDescription" type="system" pointSize="14"/> |
| | | <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uN4-1T-03N"> |
| | | <rect key="frame" x="46" y="14.666666666666668" width="13.333333333333336" height="17"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/> |
| | | <nil key="textColor"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="联系电话:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PsG-Rv-98M"> |
| | | <rect key="frame" x="114" y="13" width="72" height="20"/> |
| | | <constraints> |
| | | <constraint firstAttribute="width" constant="72" id="73P-Au-jeA"/> |
| | | <constraint firstAttribute="height" constant="20" id="tfe-Zz-daf"/> |
| | | </constraints> |
| | | <fontDescription key="fontDescription" type="system" pointSize="14"/> |
| | | <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="bFa-Tv-yrN"> |
| | | <rect key="frame" x="186" y="14.666666666666668" width="409" height="17"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/> |
| | | <nil key="textColor"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="年龄:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ffB-3r-mMe"> |
| | | <rect key="frame" x="10" y="44" width="36" height="20"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="20" id="fSF-J8-coy"/> |
| | | </constraints> |
| | | <fontDescription key="fontDescription" type="system" pointSize="14"/> |
| | | <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IzQ-fd-US8"> |
| | | <rect key="frame" x="46" y="45.666666666666664" width="13.333333333333336" height="17"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/> |
| | | <nil key="textColor"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="身份证号:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vRK-rj-18Y"> |
| | | <rect key="frame" x="114" y="44" width="64.666666666666686" height="20"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="20" id="6bN-Qc-IZy"/> |
| | | </constraints> |
| | | <fontDescription key="fontDescription" type="system" pointSize="14"/> |
| | | <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5wJ-8b-S1o"> |
| | | <rect key="frame" x="178.66666666666666" y="45.666666666666664" width="13.333333333333343" height="17"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/> |
| | | <nil key="textColor"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="btn_select_u" translatesAutoresizingMaskIntoConstraints="NO" id="L3K-Cg-6gd"> |
| | | <rect key="frame" x="605" y="13" width="20" height="20"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="20" id="Xcx-mk-vz3"/> |
| | | <constraint firstAttribute="width" constant="20" id="onm-Nl-bLz"/> |
| | | </constraints> |
| | | </imageView> |
| | | </subviews> |
| | | <color key="backgroundColor" red="1" green="0.90588235289999997" blue="0.80000000000000004" alpha="0.080000000000000002" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <constraints> |
| | | <constraint firstItem="vRK-rj-18Y" firstAttribute="centerY" secondItem="ffB-3r-mMe" secondAttribute="centerY" id="5KX-Us-IHl"/> |
| | | <constraint firstItem="5wJ-8b-S1o" firstAttribute="leading" secondItem="vRK-rj-18Y" secondAttribute="trailing" id="8Oc-wt-evw"/> |
| | | <constraint firstItem="ffB-3r-mMe" firstAttribute="leading" secondItem="5dz-Z7-EDq" secondAttribute="leading" constant="10" id="9WQ-HW-IrN"/> |
| | | <constraint firstItem="PsG-Rv-98M" firstAttribute="centerY" secondItem="CYE-Is-6tp" secondAttribute="centerY" id="Ero-Dy-fMF"/> |
| | | <constraint firstItem="PsG-Rv-98M" firstAttribute="leading" secondItem="5dz-Z7-EDq" secondAttribute="leading" constant="114" id="H7I-bz-7Ty"/> |
| | | <constraint firstItem="uN4-1T-03N" firstAttribute="leading" secondItem="CYE-Is-6tp" secondAttribute="trailing" id="H8u-T0-Dc3"/> |
| | | <constraint firstItem="IzQ-fd-US8" firstAttribute="leading" secondItem="ffB-3r-mMe" secondAttribute="trailing" id="Iuz-Up-eRe"/> |
| | | <constraint firstItem="5wJ-8b-S1o" firstAttribute="centerY" secondItem="vRK-rj-18Y" secondAttribute="centerY" id="KkU-yU-pFr"/> |
| | | <constraint firstItem="vRK-rj-18Y" firstAttribute="leading" secondItem="PsG-Rv-98M" secondAttribute="leading" id="QKS-Rs-CpP"/> |
| | | <constraint firstItem="bFa-Tv-yrN" firstAttribute="centerY" secondItem="PsG-Rv-98M" secondAttribute="centerY" id="cYr-Sj-cyH"/> |
| | | <constraint firstAttribute="trailing" secondItem="L3K-Cg-6gd" secondAttribute="trailing" constant="7" id="fV9-IB-aML"/> |
| | | <constraint firstItem="ffB-3r-mMe" firstAttribute="top" secondItem="CYE-Is-6tp" secondAttribute="bottom" constant="11" id="g2j-ce-mdO"/> |
| | | <constraint firstItem="CYE-Is-6tp" firstAttribute="top" secondItem="5dz-Z7-EDq" secondAttribute="top" constant="13" id="hxR-vS-H6Z"/> |
| | | <constraint firstItem="uN4-1T-03N" firstAttribute="centerY" secondItem="CYE-Is-6tp" secondAttribute="centerY" id="mRX-cf-CVK"/> |
| | | <constraint firstItem="L3K-Cg-6gd" firstAttribute="leading" secondItem="bFa-Tv-yrN" secondAttribute="trailing" constant="10" id="qa1-a7-B09"/> |
| | | <constraint firstItem="IzQ-fd-US8" firstAttribute="centerY" secondItem="ffB-3r-mMe" secondAttribute="centerY" id="qx9-DQ-s18"/> |
| | | <constraint firstItem="bFa-Tv-yrN" firstAttribute="leading" secondItem="PsG-Rv-98M" secondAttribute="trailing" id="rvP-QW-IYA"/> |
| | | <constraint firstAttribute="height" constant="76" id="sre-yW-FKU"/> |
| | | <constraint firstItem="L3K-Cg-6gd" firstAttribute="centerY" secondItem="CYE-Is-6tp" secondAttribute="centerY" id="ug6-H4-0iJ"/> |
| | | <constraint firstItem="CYE-Is-6tp" firstAttribute="leading" secondItem="5dz-Z7-EDq" secondAttribute="leading" constant="10" id="y9c-w4-yg7"/> |
| | | </constraints> |
| | | <userDefinedRuntimeAttributes> |
| | | <userDefinedRuntimeAttribute type="color" keyPath="borderColor"> |
| | | <color key="value" red="0.99215686270000003" green="0.47450980390000003" blue="0.0078431372550000003" alpha="0.28000000000000003" colorSpace="custom" customColorSpace="sRGB"/> |
| | | </userDefinedRuntimeAttribute> |
| | | <userDefinedRuntimeAttribute type="number" keyPath="borderWidth"> |
| | | <real key="value" value="1"/> |
| | | </userDefinedRuntimeAttribute> |
| | | <userDefinedRuntimeAttribute type="boolean" keyPath="ld_maskToBoundsXIB" value="YES"/> |
| | | <userDefinedRuntimeAttribute type="number" keyPath="ld_cornerRadiusXIB"> |
| | | <real key="value" value="4"/> |
| | | </userDefinedRuntimeAttribute> |
| | | </userDefinedRuntimeAttributes> |
| | | </view> |
| | | </subviews> |
| | | <constraints> |
| | | <constraint firstAttribute="trailing" secondItem="5dz-Z7-EDq" secondAttribute="trailing" constant="14" id="LRs-tp-L2D"/> |
| | | <constraint firstItem="5dz-Z7-EDq" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="14" id="M6P-Td-V0L"/> |
| | | <constraint firstAttribute="bottom" secondItem="5dz-Z7-EDq" secondAttribute="bottom" constant="7" id="XIq-gC-M0B"/> |
| | | <constraint firstItem="5dz-Z7-EDq" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="7" id="q35-z3-ifD"/> |
| | | </constraints> |
| | | </tableViewCellContentView> |
| | | <viewLayoutGuide key="safeArea" id="njF-e1-oar"/> |
| | | <connections> |
| | | <outlet property="img_radio" destination="L3K-Cg-6gd" id="qZg-w8-UFA"/> |
| | | <outlet property="label_age" destination="IzQ-fd-US8" id="ZdU-z2-gib"/> |
| | | <outlet property="label_idCard" destination="5wJ-8b-S1o" id="eMa-Wk-gO1"/> |
| | | <outlet property="label_name" destination="uN4-1T-03N" id="RnP-Lg-r3z"/> |
| | | <outlet property="label_phone" destination="bFa-Tv-yrN" id="pmb-oK-j6X"/> |
| | | <outlet property="view_container" destination="5dz-Z7-EDq" id="L86-7K-XDQ"/> |
| | | </connections> |
| | | <point key="canvasLocation" x="311.4503816793893" y="40.140845070422536"/> |
| | | </tableViewCell> |
| | | </objects> |
| | | <resources> |
| | | <image name="btn_select_u" width="20" height="20"/> |
| | | </resources> |
| | | </document> |
| | |
| | | |
| | | class StudentInfo_3_TCell: UITableViewCell { |
| | | |
| | | @IBOutlet weak var view_container: UIView! |
| | | @IBOutlet weak var label_name: UILabel! |
| | | @IBOutlet weak var label_age: UILabel! |
| | | @IBOutlet weak var label_birthday: UILabel! |
| | | @IBOutlet weak var label_height: UILabel! |
| | | @IBOutlet weak var label_weight: UILabel! |
| | | @IBOutlet weak var btn_isDefault: UIButton! |
| | | @IBOutlet weak var view_container: UIView! |
| | | @IBOutlet weak var label_name: UILabel! |
| | | @IBOutlet weak var label_age: UILabel! |
| | | @IBOutlet weak var label_birthday: UILabel! |
| | | @IBOutlet weak var label_height: UILabel! |
| | | @IBOutlet weak var label_weight: UILabel! |
| | | @IBOutlet weak var btn_isDefault: UIButton! |
| | | |
| | | private let disposeBag = DisposeBag() |
| | | var viewModel:StudentExchangeViewModel? |
| | | private let disposeBag = DisposeBag() |
| | | var viewModel:StudentExchangeViewModel? |
| | | |
| | | var studentProfile1Model:StudentProfile1Model!{ |
| | | didSet{ |
| | | label_name.text = studentProfile1Model.stuName |
| | | label_age.text = "\(studentProfile1Model.stuAge)岁" |
| | | label_birthday.text = studentProfile1Model.birthday |
| | | label_height.text = "\(studentProfile1Model.stuHeight)cm" |
| | | label_weight.text = "\(studentProfile1Model.stuWeight)kg" |
| | | var studentProfile1Model:StudentProfile1Model!{ |
| | | didSet{ |
| | | label_name.text = studentProfile1Model.stuName |
| | | label_age.text = "\(studentProfile1Model.stuAge)岁" |
| | | label_birthday.text = studentProfile1Model.birthday |
| | | label_height.text = "\(studentProfile1Model.stuHeight)cm" |
| | | label_weight.text = "\(studentProfile1Model.stuWeight)kg" |
| | | |
| | | if studentProfile1Model.isNot == 1{ |
| | | let attribute = AttributedStringbuilder.build().add(string: "默认", withFont: UIFont.systemFont(ofSize: 14), withColor: UIColor.black.withAlphaComponent(0.47)).mutableAttributedString |
| | | btn_isDefault.setAttributedTitle(attribute, for: .normal) |
| | | }else{ |
| | | let attribute = AttributedStringbuilder.build().add(string: "设为默认", withFont: UIFont.systemFont(ofSize: 14), withColor: Def_ThemeColor).underLine(color: Def_ThemeColor).mutableAttributedString |
| | | btn_isDefault.setAttributedTitle(attribute, for: .normal) |
| | | } |
| | | } |
| | | } |
| | | if studentProfile1Model.isNot == 1{ |
| | | let attribute = AttributedStringbuilder.build().add(string: "默认", withFont: UIFont.systemFont(ofSize: 14), withColor: UIColor.black.withAlphaComponent(0.47)).mutableAttributedString |
| | | btn_isDefault.setAttributedTitle(attribute, for: .normal) |
| | | }else{ |
| | | let attribute = AttributedStringbuilder.build().add(string: "设为默认", withFont: UIFont.systemFont(ofSize: 14), withColor: Def_ThemeColor).underLine(color: Def_ThemeColor).mutableAttributedString |
| | | btn_isDefault.setAttributedTitle(attribute, for: .normal) |
| | | } |
| | | } |
| | | } |
| | | |
| | | override func awakeFromNib() { |
| | | super.awakeFromNib() |
| | | selectionStyle = .none |
| | | view_container.jq_borderWidth = 1 |
| | | } |
| | | override func awakeFromNib() { |
| | | super.awakeFromNib() |
| | | selectionStyle = .none |
| | | view_container.jq_borderWidth = 1 |
| | | } |
| | | |
| | | @IBAction func tobeDefaultAction(_ sender: UIButton) { |
| | | guard studentProfile1Model.isNot == 2 else {return} |
| | | Services.courseDefaultSet(id: studentProfile1Model.stuId).subscribe(onNext: {[weak self] data in |
| | | alertSuccess(msg: "设置成功") |
| | | self?.viewModel?.beginRefresh() |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | @IBAction func tobeDefaultAction(_ sender: UIButton) { |
| | | guard studentProfile1Model.isNot == 2 else {return} |
| | | Services.courseDefaultSet(id: studentProfile1Model.stuId).subscribe(onNext: {[weak self] data in |
| | | alertSuccess(msg: "设置成功") |
| | | self?.viewModel?.beginRefresh() |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | @IBAction func editAction(_ sender: UIButton) { |
| | | let vc = AddStudentVC(type: .course, studentInfo: studentProfile1Model) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | @IBAction func editAction(_ sender: UIButton) { |
| | | let vc = AddStudentVC(type: .course, studentInfo: studentProfile1Model,identity:true) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @IBAction func verifyAction(_ sender: UIButton) { |
| | | let vc = AddStudentVC(type:.worldCup,activityDetailPartModel: activityDetailPartModel,identity: true) |
| | | let vc = AddStudentVC(type:.worldCup,activityDetailPartModel: activityDetailPartModel,identity: true,identityPhone: true) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | |
| | |
| | | self.btn_back.setTitle("返回", for: .normal) |
| | | self.btn_again.setTitle("再次支付", for: .normal) |
| | | label_content.text = string |
| | | if code == 2{btn_again.setTitle("去充值", for: .normal)} |
| | | if string.contains("玩湃币"){btn_again.setTitle("去充值", for: .normal)} |
| | | if string.contains("课时"){btn_again.setTitle("去续课", for: .normal)} |
| | | case .none:break |
| | | } |
| | | case .recharge: |
| | |
| | | self.btn_back.setTitle("返回", for: .normal) |
| | | self.btn_again.setTitle("再次支付", for: .normal) |
| | | label_content.text = string |
| | | if code == 2{btn_again.setTitle("去充值", for: .normal)} |
| | | if string.contains("玩湃币"){btn_again.setTitle("去充值", for: .normal)} |
| | | if string.contains("课时"){btn_again.setTitle("去续课", for: .normal)} |
| | | |
| | | case .none:break |
| | | } |
| | |
| | | btn_again.setTitle("再次支付", for: .normal) |
| | | btn_back.setTitle("返回", for: .normal) |
| | | label_content.text = str |
| | | if code == 2{btn_again.setTitle("去充值", for: .normal)} |
| | | if str.contains("玩湃币"){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 = str |
| | | if code == 2{btn_again.setTitle("去充值", for: .normal)} |
| | | if str.contains("玩湃币"){btn_again.setTitle("去充值", for: .normal)} |
| | | if str.contains("课时"){btn_again.setTitle("去续课", for: .normal)} |
| | | case .success: |
| | | NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil) |
| | | NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil) |
| | |
| | | case .fail(let str, let code): |
| | | btn_back.setTitle("返回", for: .normal) |
| | | label_content.text = str |
| | | if code == 2{btn_again.setTitle("去充值", for: .normal)} |
| | | if str.contains("玩湃币"){btn_again.setTitle("去充值", for: .normal)} |
| | | if str.contains("课时"){btn_again.setTitle("去续课", for: .normal)} |
| | | case .success: |
| | | NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil) |
| | | NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil) |
| | |
| | | label_content.text = str |
| | | btn_again.setTitle("再次支付", for: .normal) |
| | | btn_back.setTitle("返回", for: .normal) |
| | | if code == 2{btn_again.setTitle("去充值", for: .normal)} |
| | | if str.contains("玩湃币"){btn_again.setTitle("去充值", for: .normal)} |
| | | if str.contains("课时"){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 = str |
| | | if code == 2{btn_again.setTitle("去充值", for: .normal)} |
| | | if str.contains("玩湃币"){btn_again.setTitle("去充值", for: .normal)} |
| | | if str.contains("课时"){btn_again.setTitle("去续课", for: .normal)} |
| | | case .success: |
| | | NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil) |
| | | btn_again.isHidden = true |
| | |
| | | btn_again.setTitle("再次支付", for: .normal) |
| | | btn_back.setTitle("返回", for: .normal) |
| | | label_content.text = msg |
| | | if code == 2{btn_again.setTitle("去充值", for: .normal)} |
| | | if msg.contains("玩湃币"){btn_again.setTitle("去充值", for: .normal)} |
| | | if msg.contains("课时"){btn_again.setTitle("去续课", for: .normal)} |
| | | |
| | | case .none:break |
| | | } |
| | |
| | | case "去充值": |
| | | let vc = RechargeCenterVC() |
| | | jumpAndRemoveSelfVC(vc) |
| | | case "去续课": |
| | | let vc = SignUpCourseVC() |
| | | jumpAndRemoveSelfVC(vc) |
| | | case "返回": |
| | | navigationController?.popViewController(animated: true, {() in |
| | | |
| | |
| | | tableView.delegate = self |
| | | tableView.dataSource = self |
| | | tableView.separatorStyle = .none |
| | | tableView.showsVerticalScrollIndicator = false |
| | | tableView.showsHorizontalScrollIndicator = false |
| | | alpha = 0 |
| | | layoutIfNeeded() |
| | | setRx() |
| | |
| | | if defaultStu != nil{ |
| | | studentChooseView.selectStudents = defaultStu! |
| | | } |
| | | studentChooseView.tableView.register(UINib(nibName: "StudentInfo_2_TCell", bundle: nil), forCellReuseIdentifier: "_StudentInfo_2_TCell") |
| | | studentChooseView.tableView.register(UINib(nibName: "StudentInfo_2_1_TCell", bundle: nil), forCellReuseIdentifier: "_StudentInfo_2_1_TCell") |
| | | studentChooseView.frame = sceneDelegate?.window?.frame ?? .zero |
| | | studentChooseView.clickClouse = clickClouse |
| | | sceneDelegate?.window?.addSubview(studentChooseView) |
| | |
| | | } |
| | | |
| | | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_StudentInfo_2_TCell") as! StudentInfo_2_TCell |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_StudentInfo_2_1_TCell") as! StudentInfo_2_1_TCell |
| | | cell.indexPath = indexPath |
| | | cell.activityDetailPartModel = viewModel.dataSource.value[indexPath.row] |
| | | cell.img_radio.isHidden = false |
| | | cell.btn_delete.isHidden = true |
| | | cell.btn_edit.isHidden = true |
| | | // cell.btn_delete.isHidden = true |
| | | // cell.btn_edit.isHidden = true |
| | | |
| | | cell.img_radio.image = UIImage(named: selectStudents?.id == viewModel.dataSource.value[indexPath.row].id ? "btn_select" : "btn_select_u") |
| | | if selectStudents?.id == viewModel.dataSource.value[indexPath.row].id{ |
| | |
| | | private var itemType:ItemType! |
| | | private var selectStudents = [Any]() |
| | | private var disposeBag = DisposeBag() |
| | | |
| | | private var authGender:Int? |
| | | private var authAgeRange:(min:Int,max:Int)? |
| | | |
| | | |
| | | private lazy var stuViewModel:StudentViewModel = { |
| | | return StudentViewModel() |
| | |
| | | setRx() |
| | | } |
| | | |
| | | static func show(itemType:ItemType,defaultStu:[Any]? = nil,isAuth:Int? = nil,clickClouse:@escaping ([Any])->Void,needAddClouse:@escaping ()->Void){ |
| | | static func show(itemType:ItemType,defaultStu:[Any]? = nil,isAuth:Int? = nil,authGender:Int? = nil,authAgeRange:(min:Int,max:Int)? = nil,clickClouse:@escaping ([Any])->Void,needAddClouse:@escaping ()->Void){ |
| | | let studentChooseView = StudentChooseView.jq_loadNibView() |
| | | if defaultStu != nil{ |
| | | studentChooseView.selectStudents = defaultStu! |
| | |
| | | if itemType == .course{ |
| | | studentChooseView.tableView.register(UINib(nibName: "StudentInfoTCell", bundle: nil), forCellReuseIdentifier: "_StudentInfoTCell") |
| | | studentChooseView.btn_add.setTitle("添加运动营成员", for: .normal) |
| | | }else if itemType == .activity{ |
| | | }else{ |
| | | studentChooseView.tableView.register(UINib(nibName: "StudentInfo_2_TCell", bundle: nil), forCellReuseIdentifier: "_StudentInfo_2_TCell") |
| | | studentChooseView.btn_add.setTitle("添加人员", for: .normal) |
| | | } |
| | |
| | | studentChooseView.itemType = itemType |
| | | studentChooseView.clickClouse = clickClouse |
| | | studentChooseView.needAddClouse = needAddClouse |
| | | studentChooseView.authGender = authGender |
| | | studentChooseView.authAgeRange = authAgeRange |
| | | sceneDelegate?.window?.addSubview(studentChooseView) |
| | | studentChooseView.cons_bottom.constant = 0 |
| | | |
| | |
| | | } |
| | | }else{ |
| | | let item = actViewModel.dataSource.value[indexPath.row] |
| | | |
| | | |
| | | if authGender != nil{ |
| | | if item.gender.rawValue != authGender! && authGender != 0{ |
| | | alert(msg: "该成员性别不符合要求");return |
| | | } |
| | | } |
| | | |
| | | if authAgeRange != nil{ |
| | | if item.age < authAgeRange!.0 || item.age > authAgeRange!.1{ |
| | | alert(msg: "该成员年龄不符合要求");return |
| | | } |
| | | } |
| | | |
| | | if self.selectStudents.contains(where: {($0 as! ActivityDetailPartModel).id == item.id}){ |
| | | if self.selectStudents.count == 1{ |
| | | alert(msg: "至少选择一位运动营成员");return |
| | | if itemType == .worldCup{ |
| | | alert(msg: "至少选择一位成员") |
| | | }else{ |
| | | alert(msg: "至少选择一位运动营成员") |
| | | } |
| | | return |
| | | } |
| | | if let index = self.selectStudents.firstIndex(where: {($0 as! ActivityDetailPartModel).id == item.id}){ |
| | | self.selectStudents.remove(at: index) |
| | |
| | | } |
| | | cell.studentModel = item |
| | | return cell |
| | | }else if itemType == .activity{ |
| | | }else if itemType == .activity || itemType == .worldCup{ |
| | | let item = actViewModel.dataSource.value[indexPath.row] |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_StudentInfo_2_TCell") as! StudentInfo_2_TCell |
| | | cell.btn_delete.isHidden = true |
| | |
| | | private var userNameLabel:UILabel! |
| | | private var numerLabel:UILabel! |
| | | private var radioLabel:UILabel! |
| | | var indexPath:IndexPath! |
| | | var indexPath:IndexPath? |
| | | |
| | | var model:WorldCupMatchRankModel?{ |
| | | didSet{ |
| | |
| | | numerLabel.text = "\(m.totalSession)" |
| | | radioLabel.text = "\(m.winRate)%" |
| | | |
| | | rankImg.image = UIImage(named: "rank_\(indexPath.row + 1)") |
| | | switch indexPath.row{ |
| | | case 0...2: |
| | | rankImg.isHidden = false |
| | | rankLabel.text = "" |
| | | default: |
| | | rankImg.isHidden = true |
| | | rankLabel.text = "\(indexPath.row + 1)" |
| | | if let index = indexPath{ |
| | | rankImg.image = UIImage(named: "rank_\(index.row + 1)") |
| | | switch index.row{ |
| | | case 0...2: |
| | | rankImg.isHidden = false |
| | | rankLabel.text = "" |
| | | default: |
| | | rankImg.isHidden = true |
| | | rankLabel.text = "\(index.row + 1)" |
| | | } |
| | | }else{ |
| | | rankImg.isHidden = true |
| | | rankLabel.text = "\(m.rank)" |
| | | } |
| | | } |
| | | } |
| | |
| | | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| | | let model = viewModel.dataSource.value[indexPath.row] |
| | | if let qrCode = WorldCupUserInfoQRCodel(id: model.id, isStudent: model.isStudent).toJSONString(){ |
| | | QRPreview.show(qrCode) |
| | | QRPreview.show(qrCode,title: model.name) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @IBAction func addStudentAction(_ sender: Any) { |
| | | let vc = AddStudentVC(type: .activity,activityDetailPartModel: nil,identity:true) |
| | | let vc = AddStudentVC(type: .activity,activityDetailPartModel: nil,identity:true,identityPhone: true) |
| | | push(vc: vc) |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @IBAction func addStudentAction(_ sender: QMUIButton) { |
| | | StudentChooseView.show(itemType: .activity, defaultStu: students,isAuth: 1) { [weak self] studs in |
| | | let minAge = detailModel.age.components(separatedBy: "-").first?.int ?? 0 |
| | | let maxAge = detailModel.age.components(separatedBy: "-").last?.int ?? 1000 |
| | | StudentChooseView.show(itemType: .worldCup, defaultStu: students,isAuth: 1,authGender: detailModel.gender,authAgeRange: (minAge,maxAge)) { [weak self] studs in |
| | | self?.students = studs as! [ActivityDetailPartModel] |
| | | self?.cons_tableHei.constant = Double(self?.students.count ?? 0) * 100 |
| | | self?.tableView.reloadData() |
| | | } needAddClouse: {[weak self] () in |
| | | let vc = AddStudentVC(type: .worldCup,activityDetailPartModel: nil,identity: true) |
| | | let vc = AddStudentVC(type: .worldCup,activityDetailPartModel: nil,identity: true,identityPhone: true) |
| | | self?.push(vc: vc) |
| | | } |
| | | } |
| | |
| | | class WorldCupContentDetailVC: BaseVC { |
| | | |
| | | @IBOutlet weak var view_banner: UIView! |
| | | // @IBOutlet weak var label_storeNames: UILabel! |
| | | // @IBOutlet weak var label_storeNames: UILabel! |
| | | @IBOutlet weak var label_title: UILabel! |
| | | @IBOutlet weak var label_hot: UILabel! |
| | | @IBOutlet weak var label_joinCondition: UILabel! |
| | |
| | | @IBOutlet weak var webView: WKWebView! |
| | | @IBOutlet weak var cons_webHei: NSLayoutConstraint! |
| | | @IBOutlet weak var cons__cancelBtnHei: NSLayoutConstraint! |
| | | @IBOutlet weak var btn_enroll: UIButton! |
| | | |
| | | |
| | | private var id:Int! |
| | | private lazy var bannerView:CommonBannerView = { |
| | | let v = CommonBannerView() |
| | |
| | | super.init(nibName: nil, bundle: nil) |
| | | self.id = id |
| | | } |
| | | |
| | | |
| | | required init?(coder: NSCoder) { |
| | | fatalError("init(coder:) has not been implemented") |
| | | } |
| | | |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | title = "社区世界杯" |
| | |
| | | self?.btn_moreMatchStore.isHidden = model.storeInfos.count == 1 |
| | | self?.tableView.reloadData() |
| | | self?.webView.loadHTMLString(model.content.jq_wrapHtml(), baseURL: nil) |
| | | self?.btn_cancel.isHidden = model.revocable == 0 |
| | | self?.cons__cancelBtnHei.constant = model.revocable == 0 ? 0:40 |
| | | // self?.btn_cancel.isHidden = model.revocable == 0 |
| | | // self?.cons__cancelBtnHei.constant = model.revocable == 0 ? 0:40 |
| | | |
| | | |
| | | switch model.status { |
| | | case .cancel: |
| | | self?.btn_enroll.setTitle("已取消", for: .normal) |
| | | self?.btn_enroll.backgroundColor = .gray.withAlphaComponent(0.5) |
| | | self?.btn_enroll.isEnabled = false |
| | | self?.btn_cancel.setTitle("已取消", for: .normal) |
| | | self?.btn_cancel.backgroundColor = .gray.withAlphaComponent(0.5) |
| | | self?.btn_cancel.isEnabled = false |
| | | case .over: |
| | | self?.btn_enroll.setTitle("已结束", for: .normal) |
| | | self?.btn_enroll.backgroundColor = .gray.withAlphaComponent(0.5) |
| | | self?.btn_enroll.isEnabled = false |
| | | default:break |
| | | self?.btn_cancel.setTitle("已结束", for: .normal) |
| | | self?.btn_cancel.backgroundColor = .gray.withAlphaComponent(0.5) |
| | | self?.btn_cancel.isEnabled = false |
| | | case .ongoing: |
| | | self?.btn_cancel.setTitle("进行中", for: .normal) |
| | | self?.btn_cancel.backgroundColor = .gray.withAlphaComponent(0.5) |
| | | self?.btn_cancel.isEnabled = false |
| | | default: |
| | | if let endDate = model.registrationClosingTime{ |
| | | let endDateTimeInterval = Date.jq_StringToTimeInterval(model.startTime, "yyyy-MM-dd HH:mm") |
| | | if Date.jq_CalByDays(startDate: Date(), endDate: Date(timeIntervalSince1970: endDateTimeInterval)) <= 1{ |
| | | self?.btn_cancel.setTitle("取消", for: .normal) |
| | | self?.btn_cancel.backgroundColor = .gray.withAlphaComponent(0.5) |
| | | self?.btn_cancel.isEnabled = false |
| | | } |
| | | |
| | | if endDateTimeInterval < Date().timeIntervalSince1970{ |
| | | self?.btn_cancel.setTitle("报名已截止", for: .normal) |
| | | self?.btn_cancel.backgroundColor = .gray.withAlphaComponent(0.5) |
| | | self?.btn_cancel.isEnabled = false |
| | | } |
| | | } |
| | | } |
| | | |
| | | if let endDate = model.registrationClosingTime{ |
| | | let endDateTimeInterval = Date.jq_StringToTimeInterval(model.startTime, "yyyy-MM-dd HH:mm") |
| | | |
| | | if Date.jq_CalByDays(startDate: Date(), endDate: Date(timeIntervalSince1970: endDateTimeInterval)) <= 1{ |
| | | self?.btn_enroll.setTitle("取消", for: .normal) |
| | | self?.btn_enroll.backgroundColor = .gray.withAlphaComponent(0.5) |
| | | self?.btn_enroll.isEnabled = false |
| | | } |
| | | |
| | | |
| | | if endDateTimeInterval < Date().timeIntervalSince1970{ |
| | | self?.btn_enroll.setTitle("报名已截止", for: .normal) |
| | | self?.btn_enroll.backgroundColor = .gray.withAlphaComponent(0.5) |
| | | self?.btn_enroll.isEnabled = false |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | |
| | | <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="WorldCupContentDetailVC" customModule="WanPai" customModuleProvider="target"> |
| | | <connections> |
| | | <outlet property="btn_cancel" destination="Gkg-tn-WFH" id="u4S-QZ-qFa"/> |
| | | <outlet property="btn_enroll" destination="Gkg-tn-WFH" id="dHR-xr-fFS"/> |
| | | <outlet property="btn_moreMatchStore" destination="tjO-5y-Kg9" id="twv-r8-wNh"/> |
| | | <outlet property="cons__cancelBtnHei" destination="y3u-8o-eMw" id="eWN-fY-L44"/> |
| | | <outlet property="cons_tableHei" destination="HCn-5Z-SAr" id="JPW-ED-7vP"/> |
| | |
| | | self?.setCity(cityName: model.cityName, rank: model.cityRank) |
| | | self?.label_winNum.text = "\(model.win)" |
| | | self?.label_loseNum.text = "\(model.lose)" |
| | | self?.label_winRate.text = String(format: "%.1lf%%", model.winRate) |
| | | self?.label_winRate.text = String(format: " %.2lf%% ", model.winRate) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | |
| | | <color key="textColor" red="0.34901960780000002" green="0.3411764706" blue="0.3411764706" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <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="m9A-Xb-JPg"> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0.00%" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="14" translatesAutoresizingMaskIntoConstraints="NO" id="m9A-Xb-JPg"> |
| | | <rect key="frame" x="268" y="274.33333333333331" width="93" height="46"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="46" id="8tN-ps-bbt"/> |
| | |
| | | make.bottom.equalToSuperview().offset(-69) |
| | | } |
| | | |
| | | let stackView = UIStackView() |
| | | stackView.axis = .horizontal |
| | | stackView.distribution = .equalCentering |
| | | stackView.spacing = 20 |
| | | view.addSubview(stackView) |
| | | stackView.snp.makeConstraints { make in |
| | | make.centerX.equalToSuperview() |
| | | make.bottom.equalTo(-16) |
| | | make.height.equalTo(40) |
| | | } |
| | | |
| | | |
| | | provinceBtn.setTitle("全国", for: .normal) |
| | | provinceBtn.tag = 10 |
| | | provinceBtn.titleLabel?.font = UIFont.systemFont(ofSize: 15, weight: .medium) |
| | | provinceBtn.setTitleColor(UIColor(hexString: "#FE7E03"), for: .normal) |
| | | provinceBtn.borderColor = UIColor(hexString: "#FE7E03") |
| | | provinceBtn.borderWidth = 1 |
| | | provinceBtn.cornerRadius = 20 |
| | | provinceBtn.addTarget(self, action: #selector(radiusAction), for: .touchUpInside) |
| | | provinceBtn.snp.makeConstraints { make in |
| | | make.width.equalTo(144) |
| | | } |
| | | |
| | | cityBtn.titleLabel?.font = UIFont.systemFont(ofSize: 15, weight: .medium) |
| | | cityBtn.tag = 11 |
| | | cityBtn.setTitleColor(.white, for: .normal) |
| | | cityBtn.backgroundColor = UIColor(hexString: "#FE7E03") |
| | | cityBtn.cornerRadius = 20 |
| | | cityBtn.addTarget(self, action: #selector(radiusAction), for: .touchUpInside) |
| | | cityBtn.snp.makeConstraints { make in |
| | | make.width.equalTo(144) |
| | | } |
| | | |
| | | stackView.addArrangedSubview(provinceBtn) |
| | | stackView.addArrangedSubview(cityBtn) |
| | | |
| | | viewModel.configure(tableView,needMore: false) |
| | | viewModel.beginRefresh() |
| | |
| | | |
| | | }).disposed(by: disposeBag) |
| | | |
| | | Observable.combineLatest(superScrollView!.rx.contentOffset, tableView.rx.contentOffset).subscribe { v1,v2 in |
| | | //获取rankTCell是否出现在屏幕内 |
| | | if let cell = self.flowCell{ |
| | | let rect = cell.convert(cell.bounds, to: app.window) |
| | | if rect.origin.y < 0 || rect.origin.y > self.view.height{ |
| | | NotificationCenter.default.post(name: ShowOrHiddenFlowImage_Noti, object: false) |
| | | }else{ |
| | | NotificationCenter.default.post(name: ShowOrHiddenFlowImage_Noti, object: true) |
| | | } |
| | | } |
| | | }.disposed(by: disposeBag) |
| | | // Observable.combineLatest(superScrollView!.rx.contentOffset, tableView.rx.contentOffset).subscribe { v1,v2 in |
| | | // //获取rankTCell是否出现在屏幕内 |
| | | // if let cell = self.flowCell{ |
| | | // let rect = cell.convert(cell.bounds, to: app.window) |
| | | // if rect.origin.y < 0 || rect.origin.y > self.view.height{ |
| | | // NotificationCenter.default.post(name: ShowOrHiddenFlowImage_Noti, object: false) |
| | | // }else{ |
| | | // NotificationCenter.default.post(name: ShowOrHiddenFlowImage_Noti, object: true) |
| | | // } |
| | | // } |
| | | // }.disposed(by: disposeBag) |
| | | } |
| | | |
| | | @objc func radiusAction(btn:UIButton){ |
| | |
| | | cell.indexPath = indexPath |
| | | cell.model = viewModel.dataSource.value[indexPath.row] |
| | | |
| | | if viewModel.dataSource.value[indexPath.row].oneself == 1{ |
| | | cell.borderColor = UIColor(hexString: "#FC743A") |
| | | cell.borderWidth = 1 |
| | | }else{ |
| | | cell.borderWidth = 0 |
| | | } |
| | | |
| | | cell.addLine(UIColor(hexStr: "#E1E1E1"), false, true, false, true, 0.4) |
| | | return cell |
| | | } |
| | | |
| | | func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { |
| | | if let rankTCell = cell as? WorldCupRankTCell{ |
| | | if viewModel.dataSource.value[indexPath.row].oneself == 1{ |
| | | flowCell = rankTCell |
| | | NotificationCenter.default.post(name: FlowImage_Noti, object: rankTCell.jq_captureToImage()) |
| | | } |
| | | } |
| | | } |
| | | // func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { |
| | | // if let rankTCell = cell as? WorldCupRankTCell{ |
| | | // if viewModel.dataSource.value[indexPath.row].oneself == 1{ |
| | | // flowCell = rankTCell |
| | | // NotificationCenter.default.post(name: FlowImage_Noti, object: rankTCell.jq_captureToImage()) |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | |
| | | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { |
| | |
| | | ratioRankBtn.setImage(UIImage(named: "icon_reset"), for: .normal) |
| | | ratioRankBtn.addTarget(self, action: #selector(rateAction), for: .touchUpInside) |
| | | ratioRankBtn.spacingBetweenImageAndTitle = 5 |
| | | ratioRankBtn.isSelected = true |
| | | ratioRankBtn.imagePosition = .right |
| | | headerView?.contentView.addSubview(ratioRankBtn) |
| | | ratioRankBtn.snp.makeConstraints { make in |
| | |
| | | } |
| | | return headerView |
| | | } |
| | | |
| | | func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { |
| | | |
| | | if section == 0{return nil} |
| | | var footView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "footer") |
| | | if footView == nil{ |
| | | footView = UITableViewHeaderFooterView(reuseIdentifier: "footer") |
| | | let stackView = UIStackView() |
| | | stackView.axis = .horizontal |
| | | stackView.distribution = .fillEqually |
| | | stackView.spacing = 10 |
| | | |
| | | provinceBtn.setTitle("全国", for: .normal) |
| | | provinceBtn.tag = 10 |
| | | provinceBtn.titleLabel?.font = UIFont.systemFont(ofSize: 15, weight: .medium) |
| | | provinceBtn.setTitleColor(UIColor(hexString: "#FE7E03"), for: .normal) |
| | | provinceBtn.borderColor = UIColor(hexString: "#FE7E03") |
| | | provinceBtn.borderWidth = 1 |
| | | provinceBtn.cornerRadius = 20 |
| | | provinceBtn.addTarget(self, action: #selector(radiusAction), for: .touchUpInside) |
| | | |
| | | cityBtn.titleLabel?.font = UIFont.systemFont(ofSize: 15, weight: .medium) |
| | | cityBtn.tag = 11 |
| | | cityBtn.setTitleColor(.white, for: .normal) |
| | | cityBtn.backgroundColor = UIColor(hexString: "#FE7E03") |
| | | cityBtn.cornerRadius = 20 |
| | | cityBtn.addTarget(self, action: #selector(radiusAction), for: .touchUpInside) |
| | | |
| | | stackView.addArrangedSubview(provinceBtn) |
| | | stackView.addArrangedSubview(cityBtn) |
| | | |
| | | footView?.contentView.addSubview(stackView) |
| | | footView?.contentView.backgroundColor = .white |
| | | stackView.snp.makeConstraints { make in |
| | | make.left.right.equalToSuperview().inset(UIEdgeInsets(top: 0, left: 27, bottom: 0, right: 27)) |
| | | make.bottom.equalToSuperview() |
| | | make.height.equalTo(40) |
| | | } |
| | | |
| | | let cell = WorldCupRankTCell(style: .default, reuseIdentifier: nil) |
| | | cell.tag = 1100 |
| | | cell.borderColor = UIColor(hexString: "#FC743A") |
| | | cell.jq_borderWidth = 1 |
| | | footView?.addSubview(cell) |
| | | cell.snp.makeConstraints { make in |
| | | make.left.top.right.equalToSuperview() |
| | | make.height.equalTo(45) |
| | | } |
| | | } |
| | | if let cell = footView?.viewWithTag(1100) as? WorldCupRankTCell{ |
| | | if let model = viewModel.dataSource.value.filter({$0.oneself == 1}).first{ |
| | | cell.model = model |
| | | } |
| | | } |
| | | return footView |
| | | } |
| | | |
| | | func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { |
| | | if section == 0{ |
| | | return 0.001 |
| | | } |
| | | return 100 |
| | | } |
| | | |
| | | |
| | | func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { |
| | | if section != 0{ |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | override func setRx() { |
| | | NotificationCenter.default.rx.notification(FlowImage_Noti, object: nil).take(until: self.rx.deallocated).subscribe(onNext: { noti in |
| | | if let img = noti.object as? UIImage{ |
| | | if let imag = self.view.viewWithTag(1001) as? UIImageView{ |
| | | imag.image = img |
| | | }else{ |
| | | self.flowImageView.image = img |
| | | self.flowImageView.frame = CGRect(x: 15, y: JQ_ScreenH - UIDevice.jq_safeEdges.bottom - 45, width: JQ_ScreenW-30, height: 45) |
| | | self.view.addSubview(self.flowImageView) |
| | | } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | | NotificationCenter.default.rx.notification(ShowOrHiddenFlowImage_Noti, object: nil).take(until: self.rx.deallocated).subscribe(onNext: { noti in |
| | | |
| | | if let hidden = noti.object as? Bool, self.pageVC.currentPage == 3{ |
| | | self.flowImageView.isHidden = hidden |
| | | } |
| | | |
| | | }).disposed(by: disposeBag) |
| | | // NotificationCenter.default.rx.notification(FlowImage_Noti, object: nil).take(until: self.rx.deallocated).subscribe(onNext: { noti in |
| | | // if let img = noti.object as? UIImage{ |
| | | // if let imag = self.view.viewWithTag(1001) as? UIImageView{ |
| | | // imag.image = img |
| | | // }else{ |
| | | // self.flowImageView.image = img |
| | | // self.flowImageView.frame = CGRect(x: 15, y: JQ_ScreenH - UIDevice.jq_safeEdges.bottom - 45, width: JQ_ScreenW-30, height: 45) |
| | | // self.view.addSubview(self.flowImageView) |
| | | // } |
| | | // } |
| | | // }).disposed(by: disposeBag) |
| | | // |
| | | // NotificationCenter.default.rx.notification(ShowOrHiddenFlowImage_Noti, object: nil).take(until: self.rx.deallocated).subscribe(onNext: { noti in |
| | | // |
| | | // if let hidden = noti.object as? Bool, self.pageVC.currentPage == 3{ |
| | | // self.flowImageView.isHidden = hidden |
| | | // } |
| | | // |
| | | // }).disposed(by: disposeBag) |
| | | |
| | | } |
| | | } |
| | |
| | | self?.studentModels = studs as! [CourseDetailStudentModel] |
| | | self?.updateStudenTable() |
| | | } needAddClouse: { [weak self] in |
| | | let vc = AddStudentVC(type: .course,studentInfo: nil) |
| | | let vc = AddStudentVC(type: .course,studentInfo: nil,identity:true) |
| | | self?.push(vc: vc) |
| | | } |
| | | } |