WanPai.xcodeproj/project.pbxproj
@@ -100,6 +100,8 @@ 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 */; }; 1371CD092BA44570007E0849 /* QRWithTitlePreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1371CD082BA4456F007E0849 /* QRWithTitlePreview.swift */; }; 1371CD0B2BA44584007E0849 /* QRWithTitlePreview.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1371CD0A2BA44584007E0849 /* QRWithTitlePreview.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 */; }; @@ -455,6 +457,8 @@ 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>"; }; 1371CD082BA4456F007E0849 /* QRWithTitlePreview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QRWithTitlePreview.swift; sourceTree = "<group>"; }; 1371CD0A2BA44584007E0849 /* QRWithTitlePreview.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = QRWithTitlePreview.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>"; }; @@ -1082,6 +1086,8 @@ 137546442A58038B001FA77A /* BaseTableView.swift */, 136E0EE82AB30DD200EDBB8F /* QRPreview.swift */, 136E0EEA2AB30DDA00EDBB8F /* QRPreview.xib */, 1371CD082BA4456F007E0849 /* QRWithTitlePreview.swift */, 1371CD0A2BA44584007E0849 /* QRWithTitlePreview.xib */, 1394023C2AB456D3003CF61E /* PaymentCourseView.swift */, 1394023E2AB456DB003CF61E /* PaymentCourseView.xib */, 130EC17F2AD3F6AF003CA9BA /* CommonAlertSheetView.swift */, @@ -1647,6 +1653,7 @@ 8DA51DFC2A32C6D00085F4BA /* StoresChooseView.xib in Resources */, 138D8B942A4000D2009DCA9E /* YardTCell.xib in Resources */, 8D6810EC2A3710D8004486DE /* StudentChooseView.xib in Resources */, 1371CD0B2BA44584007E0849 /* QRWithTitlePreview.xib in Resources */, 8D79A5902A3957420029874B /* StudentInfo_2_TCell.xib in Resources */, 131732BB2A405EF800F722AF /* CalendarDateTimeTCell.xib in Resources */, 8D5732BE2A3724A900B2F8E3 /* AddStudentVC.xib in Resources */, @@ -1839,6 +1846,7 @@ 13D7D6232A4EBBCF000136BD /* SearchStoreTCell.swift in Sources */, 8DC3BE112A3803B500C91B7F /* ActivityListVC.swift in Sources */, 1378018A2A3B08A600414959 /* CourseOnlineListVC.swift in Sources */, 1371CD092BA44570007E0849 /* QRWithTitlePreview.swift in Sources */, 13D7BA8F2A4BC3E90007E4B7 /* CommonSingleImgCCell.swift in Sources */, 13426D632B8F0CFE0032338B /* WorldCupRankTCell.swift in Sources */, 131732B72A405DED00F722AF /* YardDetailDateTimeVC.swift in Sources */, WanPai/Common/View/QRPreview.swift
@@ -12,35 +12,25 @@ @IBOutlet weak var img_QRCode: UIImageView! @IBOutlet weak var btn_close: UIButton! @IBOutlet weak var label_title: UILabel! override func awakeFromNib() { super.awakeFromNib() alpha = 0 label_title.isHidden = true img_QRCode.transform = CGAffineTransform(scaleX: 0.1, y: 0.1) btn_close.alpha = 0 layoutIfNeeded() } static func show(_ text:String,title:String? = nil){ static func show(_ text:String){ let preView = QRPreview.jq_loadNibView() preView.frame = sceneDelegate?.window?.frame ?? .zero preView.img_QRCode.image = QRCodeImage(string: text, size: (JQ_ScreenW - 88) * sceneDelegate!.window!.screen.scale) preView.label_title.text = title sceneDelegate?.window?.addSubview(preView) UIView.animate(withDuration: 0.5) { preView.alpha = 1 if title == nil{ preView.label_title.isHidden = true preView.img_QRCode.transform = CGAffineTransform(scaleX: 1.0, y: 1.0) }else{ preView.label_title.isHidden = false preView.img_QRCode.transform = CGAffineTransform(scaleX: 0.9, y: 0.9) } preView.img_QRCode.transform = CGAffineTransform(scaleX: 1.0, y: 1.0) preView.layoutIfNeeded() } completion: { complete in if complete{ WanPai/Common/View/QRPreview.xib
@@ -17,32 +17,18 @@ <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="TVQ-se-KCE"> <rect key="frame" x="44" y="273.66666666666669" width="305" height="305.00000000000006"/> <subviews> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="omp-OX-ywi"> <rect key="frame" x="0.0" y="0.0" width="305" height="305"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ezD-1O-ihZ"> <rect key="frame" x="0.0" y="0.0" width="305" height="46"/> <constraints> <constraint firstAttribute="height" constant="46" id="4Ei-5X-kUi"/> </constraints> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="21"/> <nil key="textColor"/> <nil key="highlightedColor"/> </label> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="6HX-Cl-1DV"> <rect key="frame" x="0.0" y="46" width="305" height="259"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> </imageView> </subviews> </stackView> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="6HX-Cl-1DV"> <rect key="frame" x="20" y="20" width="265" height="265"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> </imageView> </subviews> <color key="backgroundColor" systemColor="systemBackgroundColor"/> <constraints> <constraint firstItem="omp-OX-ywi" firstAttribute="leading" secondItem="TVQ-se-KCE" secondAttribute="leading" id="MQf-so-2YR"/> <constraint firstAttribute="width" secondItem="TVQ-se-KCE" secondAttribute="height" multiplier="1:1" id="eEW-WY-qk5"/> <constraint firstAttribute="trailing" secondItem="omp-OX-ywi" secondAttribute="trailing" id="sum-wH-Hz6"/> <constraint firstItem="omp-OX-ywi" firstAttribute="top" secondItem="TVQ-se-KCE" secondAttribute="top" id="wi4-8G-1DX"/> <constraint firstAttribute="bottom" secondItem="omp-OX-ywi" secondAttribute="bottom" id="z5X-IE-asj"/> <constraint firstAttribute="width" secondItem="TVQ-se-KCE" secondAttribute="height" multiplier="1:1" id="CYF-iu-Mn0"/> <constraint firstItem="6HX-Cl-1DV" firstAttribute="leading" secondItem="TVQ-se-KCE" secondAttribute="leading" constant="20" id="QtD-k4-EOo"/> <constraint firstAttribute="trailing" secondItem="6HX-Cl-1DV" secondAttribute="trailing" constant="20" id="Xoq-AI-8AN"/> <constraint firstAttribute="bottom" secondItem="6HX-Cl-1DV" secondAttribute="bottom" constant="20" id="bvj-Pb-h3j"/> <constraint firstItem="6HX-Cl-1DV" firstAttribute="top" secondItem="TVQ-se-KCE" secondAttribute="top" constant="20" id="did-a2-bLe"/> </constraints> </view> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Uua-ww-qMC"> @@ -66,7 +52,6 @@ <connections> <outlet property="btn_close" destination="Uua-ww-qMC" id="0hz-tc-D5t"/> <outlet property="img_QRCode" destination="6HX-Cl-1DV" id="3vh-6u-afq"/> <outlet property="label_title" destination="ezD-1O-ihZ" id="GcM-gS-NdK"/> </connections> <point key="canvasLocation" x="54" y="21"/> </view> WanPai/Common/View/QRWithTitlePreview.swift
New file @@ -0,0 +1,62 @@ // // QRWithTitlePreview.swift // WanPai // // Created by 无故事王国 on 2024/3/15. // import UIKit import JQTools class QRWithTitlePreview: UIView,JQNibView{ @IBOutlet weak var img_QRCode: UIImageView! @IBOutlet weak var btn_close: UIButton! @IBOutlet weak var label_title: UILabel! override func awakeFromNib() { super.awakeFromNib() alpha = 0 label_title.isHidden = true img_QRCode.transform = CGAffineTransform(scaleX: 0.1, y: 0.1) btn_close.alpha = 0 layoutIfNeeded() } static func show(_ text:String,title:String? = nil){ let preView = QRWithTitlePreview.jq_loadNibView() preView.frame = sceneDelegate?.window?.frame ?? .zero preView.img_QRCode.image = QRCodeImage(string: text, size: (JQ_ScreenW - 88) * sceneDelegate!.window!.screen.scale) preView.label_title.text = title sceneDelegate?.window?.addSubview(preView) UIView.animate(withDuration: 0.5) { preView.alpha = 1 if title == nil{ preView.label_title.isHidden = true preView.img_QRCode.transform = CGAffineTransform(scaleX: 1.0, y: 1.0) }else{ preView.label_title.isHidden = false preView.img_QRCode.transform = CGAffineTransform(scaleX: 1.0, y: 1.0) } preView.layoutIfNeeded() } completion: { complete in if complete{ preView.btn_close.alpha = 1 preView.layoutIfNeeded() } } } @IBAction func closeAction(_ sender: UIButton) { UIView.animate(withDuration: 0.5) { self.alpha = 0 self.img_QRCode.transform = CGAffineTransform(scaleX: 0.1, y: 0.1) self.btn_close.alpha = 0 } completion: { _ in self.removeFromSuperview() } } } WanPai/Common/View/QRWithTitlePreview.xib
New file @@ -0,0 +1,79 @@ <?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="System colors in document resources" minToolsVersion="11.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"/> <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="QRWithTitlePreview" customModule="WanPai" customModuleProvider="target"> <rect key="frame" x="0.0" y="0.0" width="393" height="852"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6Xm-xv-C5a"> <rect key="frame" x="44" y="286" width="305" height="305"/> <subviews> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="qrK-YT-Vlw"> <rect key="frame" x="36" y="55" width="233" height="234"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> </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="FOT-ck-6Oq"> <rect key="frame" x="126.99999999999999" y="17" width="51.333333333333329" height="29"/> <constraints> <constraint firstAttribute="height" constant="29" id="coO-JY-M1Y"/> </constraints> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="21"/> <nil key="textColor"/> <nil key="highlightedColor"/> </label> </subviews> <color key="backgroundColor" systemColor="systemBackgroundColor"/> <constraints> <constraint firstAttribute="trailing" secondItem="qrK-YT-Vlw" secondAttribute="trailing" constant="36" id="2r1-gf-0Hr"/> <constraint firstItem="qrK-YT-Vlw" firstAttribute="top" secondItem="FOT-ck-6Oq" secondAttribute="bottom" constant="9" id="2rL-7z-gfs"/> <constraint firstItem="qrK-YT-Vlw" firstAttribute="leading" secondItem="6Xm-xv-C5a" secondAttribute="leading" constant="36" id="8j4-NN-TC6"/> <constraint firstAttribute="width" secondItem="6Xm-xv-C5a" secondAttribute="height" multiplier="1:1" id="FIQ-di-qre"/> <constraint firstItem="FOT-ck-6Oq" firstAttribute="centerX" secondItem="6Xm-xv-C5a" secondAttribute="centerX" id="Ots-du-pbV"/> <constraint firstItem="FOT-ck-6Oq" firstAttribute="top" secondItem="6Xm-xv-C5a" secondAttribute="top" constant="17" id="gkX-Js-6JH"/> <constraint firstAttribute="bottom" secondItem="qrK-YT-Vlw" secondAttribute="bottom" constant="16" id="p6R-oB-CK0"/> </constraints> </view> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6h6-EG-G3b"> <rect key="frame" x="175.66666666666666" y="632" width="42" height="43"/> <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> <state key="normal" image="btn_close_1"/> <connections> <action selector="closeAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="64a-G4-2GZ"/> </connections> </button> </subviews> <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/> <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.69999999999999996" colorSpace="custom" customColorSpace="sRGB"/> <constraints> <constraint firstItem="6Xm-xv-C5a" firstAttribute="centerY" secondItem="vUN-kp-3ea" secondAttribute="centerY" id="OUU-au-Ymy"/> <constraint firstItem="6Xm-xv-C5a" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="44" id="ZuO-Pn-vED"/> <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="6Xm-xv-C5a" secondAttribute="trailing" constant="44" id="eJ8-La-vaJ"/> <constraint firstItem="6h6-EG-G3b" firstAttribute="centerX" secondItem="vUN-kp-3ea" secondAttribute="centerX" id="fXK-zW-LKQ"/> <constraint firstItem="6h6-EG-G3b" firstAttribute="top" secondItem="6Xm-xv-C5a" secondAttribute="bottom" constant="41" id="sTK-om-MNs"/> <constraint firstItem="6Xm-xv-C5a" firstAttribute="centerX" secondItem="vUN-kp-3ea" secondAttribute="centerX" id="ttV-yM-U0x"/> </constraints> <connections> <outlet property="btn_close" destination="6h6-EG-G3b" id="5Mr-zE-PfA"/> <outlet property="img_QRCode" destination="qrK-YT-Vlw" id="vM8-Z3-XjK"/> <outlet property="label_title" destination="FOT-ck-6Oq" id="AAv-FL-YxS"/> </connections> <point key="canvasLocation" x="101.5267175572519" y="20.422535211267608"/> </view> </objects> <resources> <image name="btn_close_1" width="42" height="43"/> <systemColor name="systemBackgroundColor"> <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> </systemColor> </resources> </document> WanPai/Network/Services.swift
@@ -1319,7 +1319,7 @@ class func getParticipant()->Observable<BaseResponse<[ActivityDetailPartModel]>>{ let params = ParamsAppender.build(url: All_Url) .interface(url: "/communityWorldCup/api/worldCup/getParticipant") return NetworkRequest.request(params: params, method: .post, progress: true) return NetworkRequest.request(params: params, method: .post, progress: false) } //获取报名的世界杯列表【2.0】 WanPai/Root/Home/Model/WorldCupModel.swift
@@ -117,7 +117,7 @@ var name: String = "" var oneself: Int = 0 var totalSession: Int = 0 var winRate: Int = 0 var winRate: Double = 0 var rank:Int = 0 } WanPai/Root/Other/TCell/StudentInfo_5_TCell.swift
@@ -51,7 +51,7 @@ @objc func showQRAction(){ if let qrCode = WorldCupUserInfoQRCodel(id: activityDetailPartModel.id, isStudent: activityDetailPartModel.isStudent).toJSONString(){ QRPreview.show(qrCode,title: activityDetailPartModel.name) QRWithTitlePreview.show(qrCode,title: activityDetailPartModel.name) } } WanPai/Root/Other/View/StudentChoose2View.xib
@@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <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="22504"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/> <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"/> @@ -20,7 +20,7 @@ <rect key="frame" x="0.0" y="516.33333333333337" width="393" height="335.66666666666663"/> <subviews> <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="bvu-f9-O9y"> <rect key="frame" x="14" y="53.666666666666629" width="365" height="166"/> <rect key="frame" x="0.0" y="53.666666666666629" width="393" height="166"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/> <constraints> <constraint firstAttribute="height" constant="166" id="8Qd-RV-3by"/> @@ -73,10 +73,10 @@ <constraint firstAttribute="trailing" secondItem="Do0-Pq-I22" secondAttribute="trailing" constant="10" id="5q2-Mp-tVZ"/> <constraint firstItem="bvu-f9-O9y" firstAttribute="top" secondItem="JIO-Dm-ZQh" secondAttribute="bottom" constant="16.5" id="6yL-KN-enl"/> <constraint firstAttribute="bottomMargin" secondItem="w9N-bm-gn4" secondAttribute="bottom" constant="18" id="FDy-ib-Mgc"/> <constraint firstItem="bvu-f9-O9y" firstAttribute="leading" secondItem="7FQ-69-hgm" secondAttribute="leading" constant="14" id="GQX-mj-ulO"/> <constraint firstItem="bvu-f9-O9y" firstAttribute="leading" secondItem="7FQ-69-hgm" secondAttribute="leading" id="GQX-mj-ulO"/> <constraint firstItem="JIO-Dm-ZQh" firstAttribute="centerX" secondItem="7FQ-69-hgm" secondAttribute="centerX" id="Qch-Yu-4Ph"/> <constraint firstAttribute="trailing" secondItem="w9N-bm-gn4" secondAttribute="trailing" constant="100" id="T7K-dl-5nK"/> <constraint firstAttribute="trailing" secondItem="bvu-f9-O9y" secondAttribute="trailing" constant="14" id="XGp-wX-djd"/> <constraint firstAttribute="trailing" secondItem="bvu-f9-O9y" secondAttribute="trailing" id="XGp-wX-djd"/> <constraint firstItem="w9N-bm-gn4" firstAttribute="top" secondItem="bvu-f9-O9y" secondAttribute="bottom" constant="16" id="cEv-f8-tbi"/> <constraint firstItem="Do0-Pq-I22" firstAttribute="centerY" secondItem="JIO-Dm-ZQh" secondAttribute="centerY" id="iEG-ZN-XKS"/> </constraints> WanPai/Root/Search/TCell/WorldCupRankTCell.swift
@@ -24,7 +24,7 @@ userNameLabel.text = m.name userImg.sd_setImage(with: URL(string: m.avatar)) numerLabel.text = "\(m.totalSession)" radioLabel.text = "\(m.winRate)%" radioLabel.text = String(format: "%.2lf%%", m.winRate) if let index = indexPath{ rankImg.image = UIImage(named: "rank_\(index.row + 1)") @@ -40,6 +40,14 @@ rankImg.isHidden = true rankLabel.text = "\(m.rank)" } self.borderColor = UIColor(hexString: "#FC743A") if m.oneself == 1{ self.borderWidth = 1 }else{ self.borderWidth = 0 } } } } WanPai/Root/Search/VC/MeQRCodeVC.swift
@@ -40,7 +40,7 @@ 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,title: model.name) QRWithTitlePreview.show(qrCode,title: model.name) } } WanPai/Root/Search/VC/WorldCupContentDetailVC.swift
@@ -197,7 +197,7 @@ func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let model = detailModel!.participants[indexPath.row] if let qrCode = WorldCupUserInfoQRCodel(id: model.id, isStudent: model.isStudent).toJSONString(){ QRPreview.show(qrCode,title: model.name) QRWithTitlePreview.show(qrCode,title: model.name) } } } WanPai/Root/Search/VC/WorldCupHeaderVC.swift
@@ -83,7 +83,7 @@ if let model = partModel?.value{ if let qrCode = WorldCupUserInfoQRCodel(id: model.id, isStudent: model.isStudent).toJSONString(){ QRPreview.show(qrCode,title: model.name) QRWithTitlePreview.show(qrCode,title: model.name) } } } WanPai/Root/Search/VC/WorldCupRankVC.swift
@@ -26,13 +26,14 @@ class WorldCupRankVC: BaseVC { private var viewModel = WorldCupRankViewModel() private(set) var viewModel = WorldCupRankViewModel() var partModel:BehaviorRelay<ActivityDetailPartModel?>? private var worldCupRankModel:WorldCupRankModel? private let cityBtn = UIButton(type: .custom) var currentRankModel:BehaviorRelay<WorldCupMatchRankModel?>? // private var worldCupRankModel:WorldCupRankModel? // private let cityBtn = UIButton(type: .custom) private let yearBtn = QMUIButton(type: .custom) private let ratioRankBtn = QMUIButton(type: .custom) private let provinceBtn = UIButton(type: .custom) // private let provinceBtn = UIButton(type: .custom) private var tableView:UITableView! var superScrollView:UIScrollView? @@ -50,6 +51,7 @@ tableView.showsHorizontalScrollIndicator = false tableView.backgroundColor = .clear tableView.separatorStyle = .none tableView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 100 - UIDevice.jq_safeEdges.bottom, right: 0) if #available(iOS 15.0, *) { tableView.sectionHeaderTopPadding = 0 } @@ -75,16 +77,25 @@ self?.viewModel.isStudent.accept(m.isStudent) self?.viewModel.beginRefresh() Services.getEntrantRank(id: m.id, isStudent: m.isStudent).subscribe(onNext: {[weak self] data in if let model = data.data{ self?.worldCupRankModel = model self?.cityBtn.setTitle(model.cityName, for: .normal) self?.cityBtn.layoutIfNeeded() self?.cityBtn.layoutSubviews() } }).disposed(by: weakSelf.disposeBag) // Services.getEntrantRank(id: m.id, isStudent: m.isStudent).subscribe(onNext: {[weak self] data in // if let model = data.data{ // self?.worldCupRankModel = model // self?.cityBtn.setTitle(model.cityName, for: .normal) // self?.cityBtn.layoutIfNeeded() // self?.cityBtn.layoutSubviews() // } // }).disposed(by: weakSelf.disposeBag) } }).disposed(by: disposeBag) viewModel.dataSource.subscribe(onNext: {[weak self] data in guard let weakSelf = self else { return } data.forEach { model in if model.oneself == 1{ weakSelf.currentRankModel?.accept(model) } } }).disposed(by: disposeBag) // Observable.combineLatest(superScrollView!.rx.contentOffset, tableView.rx.contentOffset).subscribe { v1,v2 in @@ -100,30 +111,30 @@ // }.disposed(by: disposeBag) } @objc func radiusAction(btn:UIButton){ if btn.tag == 10{ provinceBtn.jq_borderWidth = 0 provinceBtn.setTitleColor(.white, for: .normal) provinceBtn.backgroundColor = UIColor(hexString: "#FE7E03") cityBtn.setTitleColor(UIColor(hexString: "#FE7E03"), for: .normal) cityBtn.backgroundColor = .white cityBtn.jq_borderWidth = 1 cityBtn.jq_borderColor = UIColor(hexString: "#FE7E03") viewModel.radius.accept(1) }else{ cityBtn.jq_borderWidth = 0 cityBtn.setTitleColor(.white, for: .normal) cityBtn.backgroundColor = UIColor(hexString: "#FE7E03") provinceBtn.setTitleColor(UIColor(hexString: "#FE7E03"), for: .normal) provinceBtn.backgroundColor = .white provinceBtn.jq_borderWidth = 1 viewModel.radius.accept(2) } viewModel.beginRefresh() } // @objc func radiusAction(btn:UIButton){ // if btn.tag == 10{ // provinceBtn.jq_borderWidth = 0 // provinceBtn.setTitleColor(.white, for: .normal) // provinceBtn.backgroundColor = UIColor(hexString: "#FE7E03") // // cityBtn.setTitleColor(UIColor(hexString: "#FE7E03"), for: .normal) // cityBtn.backgroundColor = .white // cityBtn.jq_borderWidth = 1 // cityBtn.jq_borderColor = UIColor(hexString: "#FE7E03") // viewModel.radius.accept(1) // }else{ // cityBtn.jq_borderWidth = 0 // cityBtn.setTitleColor(.white, for: .normal) // cityBtn.backgroundColor = UIColor(hexString: "#FE7E03") // // provinceBtn.setTitleColor(UIColor(hexString: "#FE7E03"), for: .normal) // provinceBtn.backgroundColor = .white // provinceBtn.jq_borderWidth = 1 // viewModel.radius.accept(2) // } // viewModel.beginRefresh() // // } @objc func filterAction(){ CommonYearsPickerView.show {[weak self] index in @@ -235,8 +246,8 @@ cell.indexPath = indexPath cell.model = viewModel.dataSource.value[indexPath.row] cell.addLine(UIColor(hexStr: "#E1E1E1"), false, true, false, true, 0.4) return cell cell.addLine(UIColor(hexStr: "#E1E1E1"), false, true, false, true, 0.4) return cell } // func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { @@ -319,68 +330,68 @@ return headerView } func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { // 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 // } 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, heightForFooterInSection section: Int) -> CGFloat { // if section == 0{ // return 0.001 // } // return 100 // } func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { WanPai/Root/Search/VC/WorldCupVC.swift
@@ -20,9 +20,22 @@ class WorldCupVC: BaseVC { private let cityBtn = UIButton(type: .custom) private let provinceBtn = UIButton(type: .custom) private var partModels = [ActivityDetailPartModel]() private var partModel = BehaviorRelay<ActivityDetailPartModel?>(value:nil) private var currentRankModel = BehaviorRelay<WorldCupMatchRankModel?>(value: nil) private var toPage:Int? lazy var footView:UIView = { let v = UIView() return v }() lazy var worldCupRankVC:WorldCupRankVC = { return WorldCupRankVC() }() lazy var headerVC:WorldCupHeaderVC = { let vc = WorldCupHeaderVC() @@ -47,11 +60,12 @@ return vc }() lazy var flowImageView:UIImageView = { let i = UIImageView() i.tag = 1001 return i }() // lazy var flowImageView:UIImageView = { // let i = UIImageView() // i.tag = 1001 // return i // }() lazy var pageVC:FFPageViewController = { let pageViewController = FFPageViewController() @@ -106,13 +120,87 @@ self.pageVC.scroll(toPage: self.toPage ?? 0, animation: false) } addFootView() } override func setUI() { } private func addFootView(){ footView.backgroundColor = .white footView.isHidden = true view.addSubview(footView) footView.snp.makeConstraints { make in make.left.right.equalToSuperview().inset(UIEdgeInsets(top: 0, left: 14, bottom: 0, right: 14)) make.bottom.equalToSuperview() make.height.equalTo(100 + UIDevice.jq_safeEdges.bottom) } 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.addSubview(stackView) stackView.snp.makeConstraints { make in make.left.right.equalToSuperview().inset(UIEdgeInsets(top: 0, left: 27, bottom: 0, right: 27)) make.bottom.equalToSuperview().offset(-UIDevice.jq_safeEdges.bottom) 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) } } override func setRx() { partModel.subscribe(onNext: {[weak self]data in guard let weakSelf = self else { return } if let student = data{ Services.getEntrantRank(id: student.id, isStudent: student.isStudent).subscribe(onNext: {[weak self] data in if let model = data.data{ self?.cityBtn.setTitle(model.cityName, for: .normal) } }).disposed(by: weakSelf.disposeBag) } }).disposed(by: disposeBag) currentRankModel.subscribe(onNext: {[weak self]data in guard let weakSelf = self else { return } if let model = data{ if let cell = weakSelf.footView.viewWithTag(1100) as? WorldCupRankTCell{ cell.model = model } weakSelf.footView.isHidden = false } }).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{ @@ -132,6 +220,31 @@ // } // // }).disposed(by: disposeBag) } @objc func radiusAction(btn:UIButton){ if btn.tag == 10{ provinceBtn.jq_borderWidth = 0 provinceBtn.setTitleColor(.white, for: .normal) provinceBtn.backgroundColor = UIColor(hexString: "#FE7E03") cityBtn.setTitleColor(UIColor(hexString: "#FE7E03"), for: .normal) cityBtn.backgroundColor = .white cityBtn.jq_borderWidth = 1 cityBtn.jq_borderColor = UIColor(hexString: "#FE7E03") worldCupRankVC.viewModel.radius.accept(1) }else{ cityBtn.jq_borderWidth = 0 cityBtn.setTitleColor(.white, for: .normal) cityBtn.backgroundColor = UIColor(hexString: "#FE7E03") provinceBtn.setTitleColor(UIColor(hexString: "#FE7E03"), for: .normal) provinceBtn.backgroundColor = .white provinceBtn.jq_borderWidth = 1 worldCupRankVC.viewModel.radius.accept(2) } worldCupRankVC.viewModel.beginRefresh() } } @@ -157,23 +270,25 @@ vc.partModel = partModel return vc }else{ let vc = WorldCupRankVC() vc.superScrollView = adapterVC.scrollview vc.partModel = partModel return vc worldCupRankVC.superScrollView = adapterVC.scrollview worldCupRankVC.partModel = partModel worldCupRankVC.currentRankModel = currentRankModel return worldCupRankVC } } func pageViewController(_ pageViewController: FFPageViewController, currentPageChanged currentPage: Int) { menuVC.pageMenu.selectedItemIndex = currentPage flowImageView.isHidden = currentPage != 3 // flowImageView.isHidden = currentPage != 3 footView.isHidden = currentPage != 3 } } extension WorldCupVC:SPPageMenuDelegate{ func pageMenu(_ pageMenu: SPPageMenu, didSelectedItem index: Int) { pageVC.scroll(toPage: index, animation: true) flowImageView.isHidden = index != 3 // flowImageView.isHidden = index != 3 footView.isHidden = index != 3 } func pageMenu(_ pageMenu: SPPageMenu, itemSelectedAt index: Int) {