fix
无故事王国
2024-03-05 74c7b6c7ac226c39e5ce252af234dc50efa38e74
fix
22个文件已修改
13个文件已添加
2169 ■■■■ 已修改文件
WanPai.xcodeproj/project.pbxproj 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Bg/bg_finishWC.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Bg/bg_finishWC.imageset/bg_finishWC@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Bg/bg_finishWC.imageset/bg_finishWC@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Btns/btn_Match_del.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Btns/btn_Match_del.imageset/btn_Match_del@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Btns/btn_Match_del.imageset/btn_Match_del@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Btns/btn_add_3.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Btns/btn_add_3.imageset/btn_add_3@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Btns/btn_add_3.imageset/btn_add_3@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Common/VC/CommonScanQRCodeVC.swift 600 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Model/CommonModels.swift 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Network/Services.swift 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Activity/VC/ActivityStudentListVC.swift 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Games/GamesVC.swift 164 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Home/Model/WorldCupModel.swift 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Home/VC/HomeVC.swift 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Home/View/FinishWorldCupMatchView.swift 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Home/View/FinishWorldCupMatchView.xib 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Other/TCell/StudentInfo_5_TCell.swift 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Other/VC/PaymentResultVC.swift 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Other/View/CommonYearsPickerView.swift 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Other/View/CommonYearsPickerView.xib 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Other/View/StudentChoose2View.swift 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/TCell/JudgeTCell.swift 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/TCell/JudgeTCell.xib 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/TCell/MyQRCodeTCell.swift 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/JudgeListVC.swift 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/MatchDetailVC.swift 224 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/MatchDetailVC.xib 389 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/MeQRCodeVC.swift 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/SearchVC.swift 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/WorldCupHeaderVC.swift 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/WorldCupRankVC.swift 144 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/WorldCupVC.swift 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai.xcodeproj/project.pbxproj
@@ -57,6 +57,8 @@
        133E223C2AFB37020045B544 /* StoresInfo_2_View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 133E223B2AFB37020045B544 /* StoresInfo_2_View.swift */; };
        133E223E2AFB370D0045B544 /* StoresInfo_2_View.xib in Resources */ = {isa = PBXBuildFile; fileRef = 133E223D2AFB370D0045B544 /* StoresInfo_2_View.xib */; };
        133E22402AFB85330045B544 /* CustomPointAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 133E223F2AFB85330045B544 /* CustomPointAnnotation.swift */; };
        133FAE982B96F651005CF2F2 /* CommonYearsPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 133FAE972B96F651005CF2F2 /* CommonYearsPickerView.swift */; };
        133FAE9A2B96F658005CF2F2 /* CommonYearsPickerView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 133FAE992B96F658005CF2F2 /* CommonYearsPickerView.xib */; };
        13426D632B8F0CFE0032338B /* WorldCupRankTCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13426D612B8F0CFE0032338B /* WorldCupRankTCell.swift */; };
        13426D672B8F20AB0032338B /* WorldCupContentDetailVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13426D652B8F20AB0032338B /* WorldCupContentDetailVC.swift */; };
        13426D682B8F20AB0032338B /* WorldCupContentDetailVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13426D662B8F20AB0032338B /* WorldCupContentDetailVC.xib */; };
@@ -166,6 +168,8 @@
        138ED7982AF3A5BE0001F2EF /* CustomPointAnnotationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 138ED7972AF3A5BE0001F2EF /* CustomPointAnnotationView.swift */; };
        13921C002B8C838700BED781 /* FindItemCCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13921BFE2B8C838700BED781 /* FindItemCCell.swift */; };
        13921C012B8C838700BED781 /* FindItemCCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13921BFF2B8C838700BED781 /* FindItemCCell.xib */; };
        13927C772B97337D00223A21 /* FinishWorldCupMatchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13927C762B97337D00223A21 /* FinishWorldCupMatchView.swift */; };
        13927C792B97338C00223A21 /* FinishWorldCupMatchView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13927C782B97338C00223A21 /* FinishWorldCupMatchView.xib */; };
        1393B3922A4ACDB200B73072 /* CourseExerciseSubListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1393B3902A4ACDB200B73072 /* CourseExerciseSubListVC.swift */; };
        1393B3932A4ACDB200B73072 /* CourseExerciseSubListVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1393B3912A4ACDB200B73072 /* CourseExerciseSubListVC.xib */; };
        1393B3962A4AD03A00B73072 /* CourseExerciseTCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1393B3942A4AD03A00B73072 /* CourseExerciseTCell.swift */; };
@@ -405,6 +409,8 @@
        133E223B2AFB37020045B544 /* StoresInfo_2_View.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoresInfo_2_View.swift; sourceTree = "<group>"; };
        133E223D2AFB370D0045B544 /* StoresInfo_2_View.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = StoresInfo_2_View.xib; sourceTree = "<group>"; };
        133E223F2AFB85330045B544 /* CustomPointAnnotation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomPointAnnotation.swift; sourceTree = "<group>"; };
        133FAE972B96F651005CF2F2 /* CommonYearsPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonYearsPickerView.swift; sourceTree = "<group>"; };
        133FAE992B96F658005CF2F2 /* CommonYearsPickerView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CommonYearsPickerView.xib; sourceTree = "<group>"; };
        13426D612B8F0CFE0032338B /* WorldCupRankTCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorldCupRankTCell.swift; sourceTree = "<group>"; };
        13426D652B8F20AB0032338B /* WorldCupContentDetailVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorldCupContentDetailVC.swift; sourceTree = "<group>"; };
        13426D662B8F20AB0032338B /* WorldCupContentDetailVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WorldCupContentDetailVC.xib; sourceTree = "<group>"; };
@@ -515,6 +521,8 @@
        138ED7972AF3A5BE0001F2EF /* CustomPointAnnotationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomPointAnnotationView.swift; sourceTree = "<group>"; };
        13921BFE2B8C838700BED781 /* FindItemCCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FindItemCCell.swift; sourceTree = "<group>"; };
        13921BFF2B8C838700BED781 /* FindItemCCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FindItemCCell.xib; sourceTree = "<group>"; };
        13927C762B97337D00223A21 /* FinishWorldCupMatchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FinishWorldCupMatchView.swift; sourceTree = "<group>"; };
        13927C782B97338C00223A21 /* FinishWorldCupMatchView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FinishWorldCupMatchView.xib; sourceTree = "<group>"; };
        1393B3902A4ACDB200B73072 /* CourseExerciseSubListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseExerciseSubListVC.swift; sourceTree = "<group>"; };
        1393B3912A4ACDB200B73072 /* CourseExerciseSubListVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CourseExerciseSubListVC.xib; sourceTree = "<group>"; };
        1393B3942A4AD03A00B73072 /* CourseExerciseTCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseExerciseTCell.swift; sourceTree = "<group>"; };
@@ -1017,6 +1025,8 @@
            children = (
                13F88B082B8F4A0B0055317B /* WorldCupHeadView.swift */,
                13F88B0A2B8F4A1A0055317B /* WorldCupHeadView.xib */,
                13927C762B97337D00223A21 /* FinishWorldCupMatchView.swift */,
                13927C782B97338C00223A21 /* FinishWorldCupMatchView.xib */,
            );
            path = View;
            sourceTree = "<group>";
@@ -1261,6 +1271,8 @@
                1387B6632A4A96A600BF2F2E /* CommonDatePickerView.xib */,
                13638ACA2B95AE7E00ABDD0D /* StudentChoose2View.swift */,
                13638ACC2B95AE8900ABDD0D /* StudentChoose2View.xib */,
                133FAE972B96F651005CF2F2 /* CommonYearsPickerView.swift */,
                133FAE992B96F658005CF2F2 /* CommonYearsPickerView.xib */,
            );
            path = View;
            sourceTree = "<group>";
@@ -1618,6 +1630,7 @@
                13801CC92A4D29740041454D /* ChooseNumberView.xib in Resources */,
                133435042A40407200F23951 /* CalendarItemCCell.xib in Resources */,
                13638ACD2B95AE8900ABDD0D /* StudentChoose2View.xib in Resources */,
                133FAE9A2B96F658005CF2F2 /* CommonYearsPickerView.xib in Resources */,
                8DFA9B772A316E9A00E99281 /* LoginRegOrForgotVC.xib in Resources */,
                136B63992A4ECDD900E594F9 /* SearchStoreDetail_1_TCell.xib in Resources */,
                1378019C2A3BF5C000414959 /* CourseOnlineSubListVC.xib in Resources */,
@@ -1719,6 +1732,7 @@
                13272DD12A4034A300AC6481 /* YardDetailVC.xib in Resources */,
                137B866B2AB3F03F00C4D01B /* GamesVC.xib in Resources */,
                133E223E2AFB370D0045B544 /* StoresInfo_2_View.xib in Resources */,
                13927C792B97338C00223A21 /* FinishWorldCupMatchView.xib in Resources */,
                13CCC4BD2A4A820100DEDF19 /* StudentCourseDetailHeadView.xib in Resources */,
                8D5C150D2A31885B00A8BCC9 /* AgreentView.xib in Resources */,
                130EC1822AD3F6C0003CA9BA /* CommonAlertSheetView.xib in Resources */,
@@ -1907,6 +1921,7 @@
                13BBFBBE2B8CAE440027A17A /* WorldCupVC.swift in Sources */,
                137D2C392B8F5F67001E34BF /* WorldCupModel.swift in Sources */,
                13AFABC12A4AE3DC001FEA16 /* StudentRemarkListVC.swift in Sources */,
                13927C772B97337D00223A21 /* FinishWorldCupMatchView.swift in Sources */,
                8D6D58D12A39906F0003CFE6 /* ActivitySignupListSubVC.swift in Sources */,
                134BD50A2A5FF72900786819 /* OBSUploader.swift in Sources */,
                1375464B2A581716001FA77A /* HomeModel.swift in Sources */,
@@ -1962,6 +1977,7 @@
                8DFA9B912A317DE900E99281 /* WelfareVC.swift in Sources */,
                8D6D58D32A39970C0003CFE6 /* StoresInfoView.swift in Sources */,
                139A39FD2A413C7900737AFB /* WelfareWeeklySubListVC.swift in Sources */,
                133FAE982B96F651005CF2F2 /* CommonYearsPickerView.swift in Sources */,
                137D2C362B8F5B8E001E34BF /* WorldCupContentApplyVC.swift in Sources */,
                13D7BA952A4BD4760007E4B7 /* BillInfoTCell.swift in Sources */,
                130CE4532A4823AC00394384 /* StudentMedalCCell.swift in Sources */,
WanPai/Assets.xcassets/Bg/bg_finishWC.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "bg_finishWC@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "bg_finishWC@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Bg/bg_finishWC.imageset/bg_finishWC@2x.png
WanPai/Assets.xcassets/Bg/bg_finishWC.imageset/bg_finishWC@3x.png
WanPai/Assets.xcassets/Btns/btn_Match_del.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "btn_Match_del@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "btn_Match_del@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Btns/btn_Match_del.imageset/btn_Match_del@2x.png
WanPai/Assets.xcassets/Btns/btn_Match_del.imageset/btn_Match_del@3x.png
WanPai/Assets.xcassets/Btns/btn_add_3.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "btn_add_3@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "btn_add_3@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Btns/btn_add_3.imageset/btn_add_3@2x.png
WanPai/Assets.xcassets/Btns/btn_add_3.imageset/btn_add_3@3x.png
WanPai/Common/VC/CommonScanQRCodeVC.swift
@@ -12,341 +12,341 @@
class CommonScanQRCodeVC: BaseVC,AVCaptureMetadataOutputObjectsDelegate {
        //是否是第一次扫描到结果
    public var firstResult: Bool = true
        //AVCaptureSession对象来执行输入设备和输出设备之间的数据传递
    public var session: AVCaptureSession?
        //输入设备
    public var videoInput: AVCaptureDeviceInput?
        //输出对象
    public var metadataOutput: AVCaptureMetadataOutput = AVCaptureMetadataOutput()
        //预览图层
    public var previewLayer: AVCaptureVideoPreviewLayer?
    public var scanTimer: Timer?
        //边框
    public var borderView:UIImageView?
        //line
    public var scanLineView:UIImageView?
        //返回按钮
    public var closeBtn:UIButton?
                //是否是第一次扫描到结果
                public var firstResult: Bool = true
                //AVCaptureSession对象来执行输入设备和输出设备之间的数据传递
                public var session: AVCaptureSession?
                //输入设备
                public var videoInput: AVCaptureDeviceInput?
                //输出对象
                public var metadataOutput: AVCaptureMetadataOutput = AVCaptureMetadataOutput()
                //预览图层
                public var previewLayer: AVCaptureVideoPreviewLayer?
                public var scanTimer: Timer?
                //边框
                public var borderView:UIImageView?
                //line
                public var scanLineView:UIImageView?
                //返回按钮
                public var closeBtn:UIButton?
    private let borderWidth:CGFloat =  400
    private let topMargin: CGFloat =  230
    private var clouse:((String,Bool)->Void)?
                private let borderWidth:CGFloat =  400
                private let topMargin: CGFloat =  230
                private var clouse:((String,Bool)->Void)?
        /// 返回扫描结果,是否时第一次扫描到结果
    public convenience init(clouse:@escaping (String,Bool)->Void){
        self.init()
        self.clouse = clouse
    }
    public override func viewDidLoad() {
        super.viewDidLoad()
        title = "扫描二维码"
        if UIImagePickerController.isSourceTypeAvailable(.camera){
            if borderView == nil {
                borderView = UIImageView(image: UIImage(named: "ty_qrcode_bg"))
            }
            if scanLineView == nil {
                scanLineView = UIImageView(image: UIImage(named: "ty_qrcode_line"))
            }
            if closeBtn == nil &&  modalPresentationStyle == .fullScreen && self.presentationController != nil {
                closeBtn = UIButton(type: .custom)
                closeBtn!.addTarget(self, action: #selector(closeView), for: .touchUpInside)
                let image = Bundle.JQ_Bundle(icon: "close_btn")
                closeBtn!.setImage(image, for: .normal)
                view.addSubview(closeBtn!)
                closeBtn!.snp.makeConstraints { (make) in
                    make.top.equalTo(30)
                    make.left.equalTo(20)
                    make.width.height.equalTo(30)
                }
            }
            let authStatus = AVCaptureDevice.authorizationStatus(for: AVMediaType.video)
            if authStatus == AVAuthorizationStatus.notDetermined {
                AVCaptureDevice.requestAccess(for: AVMediaType.video) { (granted) in
                    if granted{
                        self.limitSuccess()
                    }else{
                        self.limitFaild()
                    }
                }
            } else if authStatus == AVAuthorizationStatus.restricted || authStatus == AVAuthorizationStatus.denied {
                limitFaild()
            } else {
                limitSuccess()
            }
        }else{
            alertError(msg: "当前环境相机不可用")
            DispatchQueue.main.asyncAfter(deadline: .now()+1) {
                self.navigationController?.popViewController()
            }
        }
//        if(!checkCameraAuth()){
//
//            let authStatus = AVCaptureDevice.authorizationStatus(for: AVMediaType.video)
//            if authStatus == AVAuthorizationStatus.notDetermined {
//                AVCaptureDevice.requestAccess(for: AVMediaType.video) {[weak self] (granted) in
//                    if granted{
//                        self?.setupCaptureSession()
//                        self?.addSubviews()
//                        self?.scanTimer = Timer.scheduledTimer(timeInterval: 3.0, target: self, selector: #selector(startAnimation), userInfo: nil, repeats: true)
//                    }
//                }
//            } else if authStatus == AVAuthorizationStatus.restricted || authStatus == AVAuthorizationStatus.denied {
//                let alertController = UIAlertController(title: nil,message: "请在iphone的“设置-隐私-相机”选项中,允许应用访问你的相机", preferredStyle: .alert)
//                let cancelAction = UIAlertAction(title: "取消", style: .cancel, handler: { action in
//                    self.navigationController?.popViewController(animated: true)
//                })
//
//                let okAction = UIAlertAction(title: "前往", style: .default, handler: {action in
//                    let settingUrl = NSURL(string: UIApplication.openSettingsURLString)!
//                    if UIApplication.shared.canOpenURL(settingUrl as URL){
//                        if #available(iOS 10.0, *) {
//                            UIApplication.shared.open(settingUrl as URL, options: [:], completionHandler: nil)
//                        } else {
//                            UIApplication.shared.openURL(settingUrl as URL)
//                        }
//                    }
//                })
//
//                alertController.addAction(cancelAction)
//                alertController.addAction(okAction)
//                self.present(alertController, animated: true, completion: nil)
//            } else {
//
//            }
//
//        }else{
//            setupCaptureSession()
//            addSubviews()
//            scanTimer = Timer.scheduledTimer(timeInterval: 3.0, target: self, selector: #selector(startAnimation), userInfo: nil, repeats: true)
//        }
    }
    private func limitSuccess(){
        setupCaptureSession()
        DispatchQueue.main.async {
            self.addSubviews()
            self.scanTimer = Timer.scheduledTimer(timeInterval: 3.0, target: self, selector: #selector(self.startAnimation), userInfo: nil, repeats: true)
            self.firstResult = true
            if let session = self.session {
                let queue = DispatchQueue(label: "startRun")
                queue.async {
                    session.startRunning()
                }
            }
            self.scanTimer?.fireDate = NSDate.distantPast
        }
    }
    private func limitFaild(){
        DispatchQueue.main.async {
            let alertController = UIAlertController(title: nil,message: "请在iphone的“设置-隐私-相机”选项中,允许应用访问你的相机", preferredStyle: .alert)
            let cancelAction = UIAlertAction(title: "取消", style: .cancel, handler: { action in
                if self.qmui_isPresented(){
                    self.dismiss(animated: true)
                }else{
                    self.navigationController?.popViewController(animated: true)
                }
            })
            let okAction = UIAlertAction(title: "前往", style: .default, handler: {action in
                if self.qmui_isPresented(){
                    self.dismiss(animated: true)
                }else{
                    self.navigationController?.popViewController(animated: true)
                /// 返回扫描结果,是否时第一次扫描到结果
                public convenience init(clouse:@escaping (String,Bool)->Void){
                                self.init()
                                self.clouse = clouse
                }
                public override func viewDidLoad() {
                                super.viewDidLoad()
                                title = "扫描二维码"
                                if UIImagePickerController.isSourceTypeAvailable(.camera){
                let settingUrl = NSURL(string: UIApplication.openSettingsURLString)!
                if UIApplication.shared.canOpenURL(settingUrl as URL){
                    if #available(iOS 10.0, *) {
                        UIApplication.shared.open(settingUrl as URL, options: [:], completionHandler: nil)
                    } else {
                        UIApplication.shared.openURL(settingUrl as URL)
                    }
                                                if borderView == nil {
                                                                borderView = UIImageView(image: UIImage(named: "ty_qrcode_bg"))
                                                }
                                                if scanLineView == nil {
                                                                scanLineView = UIImageView(image: UIImage(named: "ty_qrcode_line"))
                                                }
                                                if closeBtn == nil &&  modalPresentationStyle == .fullScreen && self.presentationController != nil {
                                                                closeBtn = UIButton(type: .custom)
                                                                closeBtn!.addTarget(self, action: #selector(closeView), for: .touchUpInside)
                                                                let image = Bundle.JQ_Bundle(icon: "close_btn")
                                                                closeBtn!.setImage(image, for: .normal)
                                                                view.addSubview(closeBtn!)
                                                                closeBtn!.snp.makeConstraints { (make) in
                                                                                make.top.equalTo(30)
                                                                                make.left.equalTo(20)
                                                                                make.width.height.equalTo(30)
                                                                }
                                                }
                                                let authStatus = AVCaptureDevice.authorizationStatus(for: AVMediaType.video)
                                                if authStatus == AVAuthorizationStatus.notDetermined {
                                                                AVCaptureDevice.requestAccess(for: AVMediaType.video) { (granted) in
                                                                                if granted{
                                                                                                self.limitSuccess()
                                                                                }else{
                                                                                                self.limitFaild()
                                                                                }
                                                                }
                                                } else if authStatus == AVAuthorizationStatus.restricted || authStatus == AVAuthorizationStatus.denied {
                                                                limitFaild()
                                                } else {
                                                                limitSuccess()
                                                }
                                }else{
                                                alertError(msg: "当前环境相机不可用")
                                                DispatchQueue.main.asyncAfter(deadline: .now()+1) {
                                                                self.navigationController?.popViewController()
                                                }
                                }
                                //        if(!checkCameraAuth()){
                                //
                                //            let authStatus = AVCaptureDevice.authorizationStatus(for: AVMediaType.video)
                                //            if authStatus == AVAuthorizationStatus.notDetermined {
                                //                AVCaptureDevice.requestAccess(for: AVMediaType.video) {[weak self] (granted) in
                                //                    if granted{
                                //                        self?.setupCaptureSession()
                                //                        self?.addSubviews()
                                //                        self?.scanTimer = Timer.scheduledTimer(timeInterval: 3.0, target: self, selector: #selector(startAnimation), userInfo: nil, repeats: true)
                                //                    }
                                //                }
                                //            } else if authStatus == AVAuthorizationStatus.restricted || authStatus == AVAuthorizationStatus.denied {
                                //                let alertController = UIAlertController(title: nil,message: "请在iphone的“设置-隐私-相机”选项中,允许应用访问你的相机", preferredStyle: .alert)
                                //                let cancelAction = UIAlertAction(title: "取消", style: .cancel, handler: { action in
                                //                    self.navigationController?.popViewController(animated: true)
                                //                })
                                //
                                //                let okAction = UIAlertAction(title: "前往", style: .default, handler: {action in
                                //                    let settingUrl = NSURL(string: UIApplication.openSettingsURLString)!
                                //                    if UIApplication.shared.canOpenURL(settingUrl as URL){
                                //                        if #available(iOS 10.0, *) {
                                //                            UIApplication.shared.open(settingUrl as URL, options: [:], completionHandler: nil)
                                //                        } else {
                                //                            UIApplication.shared.openURL(settingUrl as URL)
                                //                        }
                                //                    }
                                //                })
                                //
                                //                alertController.addAction(cancelAction)
                                //                alertController.addAction(okAction)
                                //                self.present(alertController, animated: true, completion: nil)
                                //            } else {
                                //
                                //            }
                                //
                                //        }else{
                                //            setupCaptureSession()
                                //            addSubviews()
                                //            scanTimer = Timer.scheduledTimer(timeInterval: 3.0, target: self, selector: #selector(startAnimation), userInfo: nil, repeats: true)
                                //        }
                }
            })
            alertController.addAction(cancelAction)
            alertController.addAction(okAction)
            self.present(alertController, animated: true, completion: nil)
        }
    }
                private func limitSuccess(){
                                setupCaptureSession()
                                DispatchQueue.main.async {
                                                self.addSubviews()
                                                self.scanTimer = Timer.scheduledTimer(timeInterval: 3.0, target: self, selector: #selector(self.startAnimation), userInfo: nil, repeats: true)
    func checkCameraAuth() -> Bool {
        let status = AVCaptureDevice.authorizationStatus(for: .video)
        return  status == .authorized;
    }
                                                self.firstResult = true
                                                if let session = self.session {
                                                                let queue = DispatchQueue(label: "startRun")
                                                                queue.async {
                                                                                session.startRunning()
                                                                }
                                                }
                                                self.scanTimer?.fireDate = NSDate.distantPast
                                }
                }
        //MARK:生成背景遮盖
    func getCoverView(left: CGFloat, top: CGFloat) -> UIImage? {
        UIGraphicsBeginImageContext(CGSize(width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height - 64))
        let contextRef = UIGraphicsGetCurrentContext()
        contextRef?.setFillColor(UIColor (red: 111/255.0, green: 111/255.0, blue: 22/255.0, alpha: 0.5).cgColor)
        contextRef?.fill(CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height))
        let inset:CGFloat =   4
        contextRef?.clear(CGRect(x: left + inset, y: top + inset, width: UIScreen.main.bounds.size.width - left * 2 - inset * 2, height: UIScreen.main.bounds.size.width - left * 2 - inset * 2))
        return UIGraphicsGetImageFromCurrentImageContext()
    }
                private func limitFaild(){
                                DispatchQueue.main.async {
                                                let alertController = UIAlertController(title: nil,message: "请在iphone的“设置-隐私-相机”选项中,允许应用访问你的相机", preferredStyle: .alert)
                                                let cancelAction = UIAlertAction(title: "取消", style: .cancel, handler: { action in
                                                                if self.qmui_isPresented(){
                                                                                self.dismiss(animated: true)
                                                                }else{
                                                                                self.navigationController?.popViewController(animated: true)
                                                                }
                                                })
    func addSubviews() {
        let _: CGFloat = (UIScreen.main.bounds.size.width - borderWidth) * 0.5
                                                let okAction = UIAlertAction(title: "前往", style: .default, handler: {action in
            //
                                                                if self.qmui_isPresented(){
                                                                                self.dismiss(animated: true)
                                                                }else{
                                                                                self.navigationController?.popViewController(animated: true)
                                                                }
            //        let coverImageView = UIImageView(frame: CGRect(x: 0, y: 64, width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height - 64))
            //        coverImageView.backgroundColor = UIColor.clear
            //        coverImageView.image = self.getCoverView(left: leftMargin, top: topMargin)
            //        view.addSubview(coverImageView)
                                                                let settingUrl = NSURL(string: UIApplication.openSettingsURLString)!
                                                                if UIApplication.shared.canOpenURL(settingUrl as URL){
                                                                                if #available(iOS 10.0, *) {
                                                                                                UIApplication.shared.open(settingUrl as URL, options: [:], completionHandler: nil)
                                                                                } else {
                                                                                                UIApplication.shared.openURL(settingUrl as URL)
                                                                                }
                                                                }
                                                })
                                                alertController.addAction(cancelAction)
                                                alertController.addAction(okAction)
                                                self.present(alertController, animated: true, completion: nil)
                                }
                }
                func checkCameraAuth() -> Bool {
                                let status = AVCaptureDevice.authorizationStatus(for: .video)
                                return  status == .authorized;
                }
                //MARK:生成背景遮盖
                func getCoverView(left: CGFloat, top: CGFloat) -> UIImage? {
                                UIGraphicsBeginImageContext(CGSize(width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height - 64))
                                let contextRef = UIGraphicsGetCurrentContext()
                                contextRef?.setFillColor(UIColor (red: 111/255.0, green: 111/255.0, blue: 22/255.0, alpha: 0.5).cgColor)
                                contextRef?.fill(CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height))
                                let inset:CGFloat =   4
                                contextRef?.clear(CGRect(x: left + inset, y: top + inset, width: UIScreen.main.bounds.size.width - left * 2 - inset * 2, height: UIScreen.main.bounds.size.width - left * 2 - inset * 2))
                                return UIGraphicsGetImageFromCurrentImageContext()
                }
                func addSubviews() {
                                let _: CGFloat = (UIScreen.main.bounds.size.width - borderWidth) * 0.5
                                //
                                //        let coverImageView = UIImageView(frame: CGRect(x: 0, y: 64, width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height - 64))
                                //        coverImageView.backgroundColor = UIColor.clear
                                //        coverImageView.image = self.getCoverView(left: leftMargin, top: topMargin)
                                //        view.addSubview(coverImageView)
            //扫描边框
        borderView!.frame = CGRect.init(x: (UIScreen.main.bounds.size.width-(self.view.center.x+30))/2, y: (UIScreen.main.bounds.size.height-(self.view.center.x + 30))/2, width: self.view.center.x + 30, height: self.view.center.x + 30)
        view.addSubview(borderView!)
                                //扫描边框
                                borderView!.frame = CGRect.init(x: (UIScreen.main.bounds.size.width-(self.view.center.x+30))/2, y: (UIScreen.main.bounds.size.height-(self.view.center.x + 30))/2, width: self.view.center.x + 30, height: self.view.center.x + 30)
                                view.addSubview(borderView!)
            //扫描的线
        scanLineView!.frame = CGRect(x:borderView!.frame.origin.x+2, y:   borderView!.frame.origin.y+2, width: borderView!.bounds.size.width, height: 2)
        view.addSubview(scanLineView!)
                                //扫描的线
                                scanLineView!.frame = CGRect(x:borderView!.frame.origin.x+2, y:   borderView!.frame.origin.y+2, width: borderView!.bounds.size.width, height: 2)
                                view.addSubview(scanLineView!)
        let tipLabel = UILabel();
        tipLabel.text = "对准二维码,即可自动扫描";
        tipLabel.textColor = UIColor.white;
        tipLabel.font = UIFont.systemFont(ofSize: 14)
        tipLabel.textAlignment = .center;
        tipLabel.frame = CGRect(x: 0, y:0, width:200, height: 40)
        tipLabel.center = CGPoint(x: borderView!.center.x , y: borderView!.center.y + (self.view.center.x + 30)/2 + 30);
        view.addSubview(tipLabel)
    }
                                let tipLabel = UILabel();
                                tipLabel.text = "对准二维码,即可自动扫描";
                                tipLabel.textColor = UIColor.white;
                                tipLabel.font = UIFont.systemFont(ofSize: 14)
                                tipLabel.textAlignment = .center;
                                tipLabel.frame = CGRect(x: 0, y:0, width:200, height: 40)
                                tipLabel.center = CGPoint(x: borderView!.center.x , y: borderView!.center.y + (self.view.center.x + 30)/2 + 30);
                                view.addSubview(tipLabel)
                }
        //MARK:- 开始扫描动画
    @objc func startAnimation() -> Void {
                //MARK:- 开始扫描动画
                @objc func startAnimation() -> Void {
            //让约束从顶部开始
        var frame = self.scanLineView!.frame
        frame.origin.y = borderView!.frame.origin.y
        self.scanLineView!.frame = frame
        self.scanLineView!.layoutIfNeeded()
                                //让约束从顶部开始
                                var frame = self.scanLineView!.frame
                                frame.origin.y = borderView!.frame.origin.y
                                self.scanLineView!.frame = frame
                                self.scanLineView!.layoutIfNeeded()
        UIView.animate(withDuration: 3.0, animations: {
                //改变frame
            frame.origin.y = self.borderView!.frame.origin.y+self.borderView!.bounds.size.height
            self.scanLineView!.frame = frame
                //强制更新界面
            self.scanLineView!.layoutIfNeeded()
        })
    }
                                UIView.animate(withDuration: 3.0, animations: {
                                                //改变frame
                                                frame.origin.y = self.borderView!.frame.origin.y+self.borderView!.bounds.size.height
                                                self.scanLineView!.frame = frame
                                                //强制更新界面
                                                self.scanLineView!.layoutIfNeeded()
                                })
                }
    func stopAnimation() -> Void {
            //让约束从顶部开始
        var frame = self.scanLineView!.frame
        frame.origin.y = 64 + topMargin
        self.scanLineView!.frame = frame
        self.scanLineView!.layoutIfNeeded()
        scanTimer?.invalidate()
        scanTimer = nil
    }
                func stopAnimation() -> Void {
                                //让约束从顶部开始
                                var frame = self.scanLineView!.frame
                                frame.origin.y = 64 + topMargin
                                self.scanLineView!.frame = frame
                                self.scanLineView!.layoutIfNeeded()
                                scanTimer?.invalidate()
                                scanTimer = nil
                }
    public override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(animated)
                public override func viewWillDisappear(_ animated: Bool) {
                                super.viewWillDisappear(animated)
            //关闭session
        if let session = self.session{
            session.stopRunning()
        }
    }
                                //关闭session
                                if let session = self.session{
                                                session.stopRunning()
                                }
                }
    @objc func closeView(){
        if (self.presentationController != nil) {
            self.dismiss(animated: true, completion: nil)
        }else{
            self.navigationController?.popViewController(animated: true)
        }
    }
                @objc func closeView(){
                                if (self.presentationController != nil) {
                                                self.dismiss(animated: true, completion: nil)
                                }else{
                                                self.navigationController?.popViewController(animated: true)
                                }
                }
    deinit {
        scanTimer?.invalidate()
        scanTimer = nil
        print("scan-----deinit")
                deinit {
                                scanTimer?.invalidate()
                                scanTimer = nil
                                print("scan-----deinit")
    }
                }
        //MARK:设置session
    func setupCaptureSession() {
        self.session = AVCaptureSession()
                //MARK:设置session
                func setupCaptureSession() {
                                self.session = AVCaptureSession()
            //高质量采集率
        self.session?.sessionPreset = AVCaptureSession.Preset.high
        guard let device = AVCaptureDevice.default(for: AVMediaType.video) else { return }
            //更改这个设置的时候必须先锁定设备,修改完后再解锁,否则崩溃
        do{
            try device.lockForConfiguration()
                //设置闪光灯为自动
            device.flashMode = AVCaptureDevice.FlashMode.auto
            device.unlockForConfiguration()
        }catch{
            print("崩溃")
        }
        do{
            try self.videoInput = AVCaptureDeviceInput(device: device)
        }catch{
            print("崩溃")
        }
                                //高质量采集率
                                self.session?.sessionPreset = AVCaptureSession.Preset.high
                                guard let device = AVCaptureDevice.default(for: AVMediaType.video) else { return }
                                //更改这个设置的时候必须先锁定设备,修改完后再解锁,否则崩溃
                                do{
                                                try device.lockForConfiguration()
                                                //设置闪光灯为自动
                                                device.flashMode = AVCaptureDevice.FlashMode.auto
                                                device.unlockForConfiguration()
                                }catch{
                                                print("崩溃")
                                }
                                do{
                                                try self.videoInput = AVCaptureDeviceInput(device: device)
                                }catch{
                                                print("崩溃")
                                }
            //输入设备
        if let videoInput = self.videoInput {
            if self.session?.canAddInput(videoInput) == true {
                self.session?.addInput(videoInput)
            }
        }
                                //输入设备
                                if let videoInput = self.videoInput {
                                                if self.session?.canAddInput(videoInput) == true {
                                                                self.session?.addInput(videoInput)
                                                }
                                }
            //添加输出
        if self.session?.canAddOutput(self.metadataOutput) == true{
            self.session?.addOutput(self.metadataOutput)
        }
                                //添加输出
                                if self.session?.canAddOutput(self.metadataOutput) == true{
                                                self.session?.addOutput(self.metadataOutput)
                                }
        self.metadataOutput.metadataObjectTypes = [AVMetadataObject.ObjectType.qr,
                                                   AVMetadataObject.ObjectType.ean13,
                                                   AVMetadataObject.ObjectType.ean8,
                                                   AVMetadataObject.ObjectType.code128,
                                                   AVMetadataObject.ObjectType.code39,
                                                   AVMetadataObject.ObjectType.code93]
                                self.metadataOutput.metadataObjectTypes = [AVMetadataObject.ObjectType.qr,
                                                                                                                                                                                                            AVMetadataObject.ObjectType.ean13,
                                                                                                                                                                                                            AVMetadataObject.ObjectType.ean8,
                                                                                                                                                                                                            AVMetadataObject.ObjectType.code128,
                                                                                                                                                                                                            AVMetadataObject.ObjectType.code39,
                                                                                                                                                                                                            AVMetadataObject.ObjectType.code93]
        self.metadataOutput.setMetadataObjectsDelegate(self, queue: DispatchQueue.main)
                                self.metadataOutput.setMetadataObjectsDelegate(self, queue: DispatchQueue.main)
            //预览图层
        if let session = self.session {
            self.previewLayer = AVCaptureVideoPreviewLayer(session: session)
            self.previewLayer?.videoGravity = AVLayerVideoGravity.resizeAspectFill
            self.previewLayer?.frame = CGRect(x: 0, y : 0, width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height)
        }
                                //预览图层
                                if let session = self.session {
                                                self.previewLayer = AVCaptureVideoPreviewLayer(session: session)
                                                self.previewLayer?.videoGravity = AVLayerVideoGravity.resizeAspectFill
                                                self.previewLayer?.frame = CGRect(x: 0, y : 0, width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height)
                                }
        if let layer = self.previewLayer {
            view.layer.insertSublayer(layer, at: 0)
        }
    }
                                if let layer = self.previewLayer {
                                                view.layer.insertSublayer(layer, at: 0)
                                }
                }
    public func metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection) {
        self.session?.stopRunning();
        if (metadataObjects.count >= 1) {
                //数组中包含的都是AVMetadataMachineReadableCodeObject 类型的对象,该对象中包含解码后的数据
            let qrObject:AVMetadataMachineReadableCodeObject = metadataObjects.last as! AVMetadataMachineReadableCodeObject;
                //拿到扫描内容在这里进行个性化处理
            let result = qrObject.stringValue
            clouse?(result ?? "",firstResult)
            closeView()
        }
    }
                public func metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection) {
                                self.session?.stopRunning();
                                if (metadataObjects.count >= 1) {
                                                //数组中包含的都是AVMetadataMachineReadableCodeObject 类型的对象,该对象中包含解码后的数据
                                                let qrObject:AVMetadataMachineReadableCodeObject = metadataObjects.last as! AVMetadataMachineReadableCodeObject;
                                                //拿到扫描内容在这里进行个性化处理
                                                let result = qrObject.stringValue
                                                clouse?(result ?? "",firstResult)
                                                closeView()
                                }
                }
}
WanPai/Model/CommonModels.swift
@@ -580,6 +580,7 @@
                var userIntegral: Int = 0
                var userName: String = "未命名"
                var wpCoin: Int = 0
                var referee:Int = 0 //是否是裁判(0=否,1=是)
}
struct BenefitImageModel:HandyJSON{
@@ -961,3 +962,5 @@
                var isBind = 0
}
WanPai/Network/Services.swift
@@ -1374,6 +1374,49 @@
                                                .append(key: "pageSize", value: pageSize)
                                return NetworkRequest.request(params: params, method: .post, progress: false)
                }
                class func getWorldCupRank(id:Int,isStudent:Int,radius:Int,sort:Int,year:Int? = nil)->Observable<BaseResponse<[WorldCupMatchRankModel]>>{
                                let params = ParamsAppender.build(url: All_Url)
                                                .interface(url: "/communityWorldCup/api/worldCup/getWorldCupRank")
                                                .append(key: "id", value: id)
                                                .append(key: "isStudent", value: isStudent)
                                                .append(key: "radius", value: radius)
                                                .append(key: "sort", value: sort)
                                                .append(key: "year", value: year)
                                return NetworkRequest.request(params: params, method: .post, progress: false)
                }
                class func getWorldCupPeople(code:String,worldCupId:Int)->Observable<BaseResponse<WorldCupPeopleModel>>{
                                let params = ParamsAppender.build(url: All_Url)
                                                .interface(url: "/communityWorldCup/api/worldCup/getWorldCupPeople")
                                                .append(key: "code", value: code)
                                                .append(key: "worldCupId", value: worldCupId)
                                return NetworkRequest.request(params: params, method: .post, progress: true)
                }
                class func getDeviceInformation(text:String)->Observable<BaseResponse<ActivityDetailStoreModel>>{
                                let params = ParamsAppender.build(url: All_Url)
                                                .interface(url: "/communityWorldCup/api/worldCup/getDeviceInformation")
                                                .append(key: "code", value: text)
                                return NetworkRequest.request(params: params, method: .post, progress: true)
                }
                class func startWorldCup(code:String,people:String,worldCupId:Int)->Observable<BaseResponse<SimpleModel>>{
                                let params = ParamsAppender.build(url: All_Url)
                                                .interface(url: "/communityWorldCup/api/worldCup/startWorldCup")
                                                .append(key: "code", value: code)
                                                .append(key: "people", value: people)
                                                .append(key: "worldCupId", value: worldCupId)
                                return NetworkRequest.request(params: params, method: .post, progress: true)
                }
                class func getCompletedCupTips()->Observable<BaseResponse<Int>>{
                                let params = ParamsAppender.build(url: All_Url)
                                                .interface(url: "/communityWorldCup/api/worldCup/getCompletedWorldCupTips")
                                return NetworkRequest.request(params: params, method: .post, progress: false)
                }
}
extension Services{
WanPai/Root/Activity/VC/ActivityStudentListVC.swift
@@ -13,8 +13,9 @@
import HandyJSON
class ActivityStudentViewModel:RefreshModel<ActivityDetailPartModel>{
                var isAuth = BehaviorRelay<Int?>(value:nil)
                override func api() -> (Observable<BaseResponse<[ActivityDetailPartModel]>>)? {
                                return Services.queryParticipantList()
                                return Services.queryParticipantList(isAuth: isAuth.value)
                }
}
WanPai/Root/Games/GamesVC.swift
@@ -12,96 +12,96 @@
let StartGame_Noti = Notification.Name.init("StartGame_Noti")
struct QRCodeModel:HandyJSON {
    var scan_type:ScanType? //扫码类型
    var space_id:Int? //场地ID
    var sutu_id:Int? //设备ID
    var id:Int? //运动营/场地/游戏
                var scan_type:ScanType? //扫码类型
                var space_id:Int? //场地ID
                var sutu_id:Int? //设备ID
                var id:Int? //运动营/场地/游戏
}
class GamesVC: BaseVC {
    private var codeModel:QRCodeModel!
                private var codeModel:QRCodeModel!
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "智慧球场"
    }
    override func setUI() {
        view.backgroundColor = .white
    }
    private func checkUnPayGame(_ model:QRCodeModel){
        let gamesListVC = GamesListVC(model: model)
        addChild(gamesListVC)
        view.addSubview(gamesListVC.view)
        gamesListVC.view.frame = CGRect(x: 0, y: UIDevice.jq_safeEdges.top + navigationController!.navigationBar.height, width: JQ_ScreenW, height: JQ_ScreenH - UIDevice.jq_safeEdges.top - navigationController!.navigationBar.height)
        gamesListVC.didMove(toParent: self)
    }
    override func setRx() {
    }
    @IBAction func scanAction(_ sender: UIButton) {
        guard UIImagePickerController.isSourceTypeAvailable(.camera) else {
            alertError(msg: "当前环境相机不可用");return
        }
        let scan = CommonScanQRCodeVC {[weak self] text, status in
            if status{
                if let model = QRCodeModel.deserialize(from: text){
                    if model.scan_type == .games{
                        self?.codeModel = model
                        self?.checkUnPayGame(model)
                    }else if model.scan_type == .yard{
                        alertError(msg: "识别类型错误")
//                        let vc = YardDetailVC(id: model.id!)
//                        self?.push(vc: vc)
                    }else if model.scan_type == .course{
                        alertError(msg: "识别类型错误")
//                        let vc = CourseDetailVC(id: model.id!)
//                        self?.push(vc: vc)
                    }
                }else{
                    alertError(msg: "识别失败")
                override func viewDidLoad() {
                                super.viewDidLoad()
                                title = "智慧球场"
                }
                //暂时关闭【勿删】
//                GamesPayView.show(price: 120, coin: 99) {
//                    PaymentView.show(money: (ali: 120, wx: 120, coin: 99,course:nil)) { type in
//                        let vc = PaymentResultVC(result: .success, objType: .games, handleVC: self)
//                        vc.modalPresentationStyle = .fullScreen
//                        self.present(vc, animated: true)
//
//                        DispatchQueue.main.asyncAfter(deadline: .now()+0.6) {
//                            self.checkUnPayGame()
//                        }
//                    }
//                }
            }
        }
        present(scan, animated: true)
    }
                override func setUI() {
                                view.backgroundColor = .white
                }
    @IBAction func myDatasourceAction(_ sender: UIButton) {
        let vc = GamesDataSourceVC()
        push(vc: vc)
    }
//    @IBAction func introAction(_ sender: UIButton) {
//        Services.game_intro().subscribe(onNext: {data in
//            let vc = CommonWebVC(type: .other, content: data.data)
//            vc.title = "步骤说明"
//            self.push(vc: vc)
//
//        }) { error in
//
//        }.disposed(by: disposeBag)
//
//    }
                private func checkUnPayGame(_ model:QRCodeModel){
                                let gamesListVC = GamesListVC(model: model)
                                addChild(gamesListVC)
                                view.addSubview(gamesListVC.view)
                                gamesListVC.view.frame = CGRect(x: 0, y: UIDevice.jq_safeEdges.top + navigationController!.navigationBar.height, width: JQ_ScreenW, height: JQ_ScreenH - UIDevice.jq_safeEdges.top - navigationController!.navigationBar.height)
                                gamesListVC.didMove(toParent: self)
                }
                override func setRx() {
                }
                @IBAction func scanAction(_ sender: UIButton) {
                                guard UIImagePickerController.isSourceTypeAvailable(.camera) else {
                                                alertError(msg: "当前环境相机不可用");return
                                }
                                let scan = CommonScanQRCodeVC {[weak self] text, status in
                                                if status{
                                                                if let model = QRCodeModel.deserialize(from: text){
                                                                                if model.scan_type == .games{
                                                                                                self?.codeModel = model
                                                                                                self?.checkUnPayGame(model)
                                                                                }else if model.scan_type == .yard{
                                                                                                alertError(msg: "识别类型错误")
                                                                                                //                        let vc = YardDetailVC(id: model.id!)
                                                                                                //                        self?.push(vc: vc)
                                                                                }else if model.scan_type == .course{
                                                                                                alertError(msg: "识别类型错误")
                                                                                                //                        let vc = CourseDetailVC(id: model.id!)
                                                                                                //                        self?.push(vc: vc)
                                                                                }
                                                                }else{
                                                                                alertError(msg: "识别失败")
                                                                }
                                                                //暂时关闭【勿删】
                                                                //                GamesPayView.show(price: 120, coin: 99) {
                                                                //                    PaymentView.show(money: (ali: 120, wx: 120, coin: 99,course:nil)) { type in
                                                                //                        let vc = PaymentResultVC(result: .success, objType: .games, handleVC: self)
                                                                //                        vc.modalPresentationStyle = .fullScreen
                                                                //                        self.present(vc, animated: true)
                                                                //
                                                                //                        DispatchQueue.main.asyncAfter(deadline: .now()+0.6) {
                                                                //                            self.checkUnPayGame()
                                                                //                        }
                                                                //                    }
                                                                //                }
                                                }
                                }
                                present(scan, animated: true)
                }
                @IBAction func myDatasourceAction(_ sender: UIButton) {
                                let vc = GamesDataSourceVC()
                                push(vc: vc)
                }
                //    @IBAction func introAction(_ sender: UIButton) {
                //        Services.game_intro().subscribe(onNext: {data in
                //            let vc = CommonWebVC(type: .other, content: data.data)
                //            vc.title = "步骤说明"
                //            self.push(vc: vc)
                //
                //        }) { error in
                //
                //        }.disposed(by: disposeBag)
                //
                //    }
}
WanPai/Root/Home/Model/WorldCupModel.swift
@@ -103,4 +103,25 @@
                var startTime: String?
}
struct WorldCupMatchRankModel:HandyJSON{
                var avatar: String = ""
                var name: String = ""
                var oneself: Int = 0
                var totalSession: Int = 0
                var winRate: Int = 0
}
struct WorldCupPeopleModel:HandyJSON{
                var age: Int = 0
                var avatar: String = ""
                var id: Int = 0
                var name: String = ""
                var participantType: Int = 0 //参赛人员类型(1=学员,2=参赛人)
}
struct WorldCupUserInfoQRCodel:HandyJSON{
                var id = 0
                var isStudent:Int = 0
}
WanPai/Root/Home/VC/HomeVC.swift
@@ -49,6 +49,18 @@
                                }) { error in
                                }.disposed(by: disposeBag)
                                DispatchQueue.main.asyncAfter(deadline: .now()+5) {[weak self] in
                                                guard let weakSelf = self else { return }
                                                Services.getCompletedCupTips().subscribe(onNext: {data in
                                                                if (data.data ?? 0) > 0{
                                                                                FinishWorldCupMatchView.show {
                                                                                                let vc  = WorldCupVC()
                                                                                                weakSelf.push(vc: vc)
                                                                                }
                                                                }
                                                }).disposed(by: weakSelf.disposeBag)
                                }
                }
                override func setUI() {
WanPai/Root/Home/View/FinishWorldCupMatchView.swift
New file
@@ -0,0 +1,51 @@
//
//  FinishWorldCupMatchView.swift
//  WanPai
//
//  Created by 无故事王国 on 2024/3/5.
//
import UIKit
import JQTools
class FinishWorldCupMatchView: UIView,JQNibView{
                @IBOutlet weak var view_container: UIView!
                private var clouse:(()->Void)!
                static func show(_ clouse:@escaping()->Void){
                                let matchView = FinishWorldCupMatchView.jq_loadNibView()
                                matchView.clouse = clouse
                                matchView.frame = sceneDelegate?.window?.frame  ?? .zero
                                matchView.alpha = 0
                                matchView.view_container.transform = .init(scaleX: 0.1, y: 0.1)
                                sceneDelegate?.window?.addSubview(matchView)
                                matchView.layoutIfNeeded()
                                UIView.animate(withDuration: 0.5) {
                                                matchView.alpha = 1
                                                matchView.view_container.transform = .identity
                                                matchView.layoutIfNeeded()
                                }
                }
                @IBAction func showAction(_ sender: Any) {
                                UIView.animate(withDuration: 0.5) {
                                                self.alpha = 0
                                                self.view_container.transform = .init(scaleX: 0.1, y: 0.1)
                                                self.layoutIfNeeded()
                                } completion: { _ in
                                                self.removeFromSuperview()
                                                self.clouse()
                                }
                }
                @IBAction func closeAction(_ sender: Any) {
                                UIView.animate(withDuration: 0.5) {
                                                self.alpha = 0
                                                self.view_container.transform = .init(scaleX: 0.1, y: 0.1)
                                                self.layoutIfNeeded()
                                } completion: { _ in
                                                self.removeFromSuperview()
                                }
                }
}
WanPai/Root/Home/View/FinishWorldCupMatchView.xib
New file
@@ -0,0 +1,119 @@
<?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">
    <device id="retina6_12" orientation="portrait" appearance="light"/>
    <dependencies>
        <deployment identifier="iOS"/>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
        <capability name="Named colors" 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"/>
        <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="FinishWorldCupMatchView" 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="7Jb-Bl-gbZ">
                    <rect key="frame" x="43.666666666666657" y="298" width="306" height="256"/>
                    <subviews>
                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="bg_finishWC" translatesAutoresizingMaskIntoConstraints="NO" id="mI5-DW-Xql">
                            <rect key="frame" x="0.0" y="0.0" width="306" height="256"/>
                        </imageView>
                        <stackView opaque="NO" contentMode="scaleToFill" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="4NU-Ra-suA">
                            <rect key="frame" x="48" y="209" width="210" height="35"/>
                            <subviews>
                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="SQ3-cE-lo1">
                                    <rect key="frame" x="0.0" y="0.0" width="100" height="35"/>
                                    <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                    <constraints>
                                        <constraint firstAttribute="width" constant="100" id="nxM-fL-GRQ"/>
                                    </constraints>
                                    <fontDescription key="fontDescription" type="system" weight="medium" pointSize="20"/>
                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                    <state key="normal" title="关闭">
                                        <color key="titleColor" red="0.43137254901960786" green="0.43137254901960786" blue="0.43137254901960786" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                    </state>
                                    <userDefinedRuntimeAttributes>
                                        <userDefinedRuntimeAttribute type="boolean" keyPath="ld_maskToBoundsXIB" value="YES"/>
                                        <userDefinedRuntimeAttribute type="number" keyPath="ld_cornerRadiusXIB">
                                            <real key="value" value="17.5"/>
                                        </userDefinedRuntimeAttribute>
                                        <userDefinedRuntimeAttribute type="color" keyPath="ld_borderColorXIB">
                                            <color key="value" red="0.86274509803921573" green="0.8666666666666667" blue="0.8666666666666667" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                        </userDefinedRuntimeAttribute>
                                        <userDefinedRuntimeAttribute type="number" keyPath="ld_borderWidthXIB">
                                            <real key="value" value="1"/>
                                        </userDefinedRuntimeAttribute>
                                    </userDefinedRuntimeAttributes>
                                    <connections>
                                        <action selector="closeAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="7aK-Z3-lvJ"/>
                                    </connections>
                                </button>
                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="q2p-RW-Qpm">
                                    <rect key="frame" x="110" y="0.0" width="100" height="35"/>
                                    <color key="backgroundColor" name="FE6E0D"/>
                                    <constraints>
                                        <constraint firstAttribute="width" constant="100" id="zDp-GN-qM4"/>
                                    </constraints>
                                    <fontDescription key="fontDescription" type="system" weight="medium" pointSize="20"/>
                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                    <state key="normal" title="查看"/>
                                    <userDefinedRuntimeAttributes>
                                        <userDefinedRuntimeAttribute type="boolean" keyPath="ld_maskToBoundsXIB" value="YES"/>
                                        <userDefinedRuntimeAttribute type="number" keyPath="ld_cornerRadiusXIB">
                                            <real key="value" value="17.5"/>
                                        </userDefinedRuntimeAttribute>
                                    </userDefinedRuntimeAttributes>
                                    <connections>
                                        <action selector="showAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="zst-fG-auw"/>
                                    </connections>
                                </button>
                            </subviews>
                            <constraints>
                                <constraint firstAttribute="height" constant="35" id="jpo-re-fIl"/>
                            </constraints>
                        </stackView>
                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Fwm-Fu-OQf">
                            <rect key="frame" x="10" y="160" width="286" height="33.666666666666657"/>
                            <string key="text">您完成了一场社区世界杯正式比赛,
快去看看吧</string>
                            <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
                            <color key="textColor" red="0.43137254899999999" green="0.43137254899999999" blue="0.43137254899999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                            <nil key="highlightedColor"/>
                        </label>
                    </subviews>
                    <constraints>
                        <constraint firstAttribute="trailing" secondItem="mI5-DW-Xql" secondAttribute="trailing" id="1eT-RN-oRd"/>
                        <constraint firstItem="4NU-Ra-suA" firstAttribute="centerX" secondItem="Fwm-Fu-OQf" secondAttribute="centerX" id="FDV-NA-hrb"/>
                        <constraint firstAttribute="trailing" secondItem="Fwm-Fu-OQf" secondAttribute="trailing" constant="10" id="GPJ-c1-Vka"/>
                        <constraint firstItem="mI5-DW-Xql" firstAttribute="top" secondItem="7Jb-Bl-gbZ" secondAttribute="top" id="Kvh-Wu-tHD"/>
                        <constraint firstItem="4NU-Ra-suA" firstAttribute="top" secondItem="Fwm-Fu-OQf" secondAttribute="bottom" constant="15.5" id="Q3p-hB-VYV"/>
                        <constraint firstItem="Fwm-Fu-OQf" firstAttribute="leading" secondItem="7Jb-Bl-gbZ" secondAttribute="leading" constant="10" id="YfY-aL-pRB"/>
                        <constraint firstAttribute="width" secondItem="7Jb-Bl-gbZ" secondAttribute="height" multiplier="1:0.837" id="ezh-gr-FTj"/>
                        <constraint firstAttribute="bottom" secondItem="4NU-Ra-suA" secondAttribute="bottom" constant="12" id="u3n-mn-7Iz"/>
                        <constraint firstItem="mI5-DW-Xql" firstAttribute="leading" secondItem="7Jb-Bl-gbZ" secondAttribute="leading" id="uKd-eL-DUe"/>
                        <constraint firstAttribute="bottom" secondItem="mI5-DW-Xql" secondAttribute="bottom" id="xoh-wh-hrl"/>
                    </constraints>
                </view>
            </subviews>
            <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
            <constraints>
                <constraint firstItem="7Jb-Bl-gbZ" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="1pf-NC-7dH"/>
                <constraint firstItem="7Jb-Bl-gbZ" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="9Y7-QJ-sM2"/>
                <constraint firstAttribute="trailing" secondItem="7Jb-Bl-gbZ" secondAttribute="trailing" constant="43.5" id="YUe-MJ-p5L"/>
                <constraint firstItem="7Jb-Bl-gbZ" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="43.5" id="pBE-Sh-iFM"/>
            </constraints>
            <connections>
                <outlet property="view_container" destination="7Jb-Bl-gbZ" id="RsE-d6-RkB"/>
            </connections>
            <point key="canvasLocation" x="83" y="21"/>
        </view>
    </objects>
    <resources>
        <image name="bg_finishWC" width="205" height="171.33332824707031"/>
        <namedColor name="FE6E0D">
            <color red="0.99199998378753662" green="0.53299999237060547" blue="0.0080000003799796104" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
        </namedColor>
    </resources>
</document>
WanPai/Root/Other/TCell/StudentInfo_5_TCell.swift
@@ -33,13 +33,26 @@
                                                label_idCard.text = activityDetailPartModel.idcard
                                                label_age.text = "\(activityDetailPartModel.age)岁"
                                                label_phone.text = activityDetailPartModel.phone
                                                img_QRCode.image = UIImage.jq_GenerateQRCode(with: "\(activityDetailPartModel.id)", width: 80)
                                                if let qrCode = WorldCupUserInfoQRCodel(id: activityDetailPartModel.id, isStudent: activityDetailPartModel.isStudent).toJSONString(){
                                                                img_QRCode.image = UIImage.jq_GenerateQRCode(with: qrCode, width: 80)
                                                }
                                }
                }
                override func awakeFromNib() {
                                super.awakeFromNib()
                                selectionStyle = .none
                                let tap = UITapGestureRecognizer(target: self, action: #selector(showQRAction))
                                img_QRCode.addGestureRecognizer(tap)
                                img_QRCode.isUserInteractionEnabled = true
                }
                @objc func showQRAction(){
                                if let qrCode = WorldCupUserInfoQRCodel(id: activityDetailPartModel.id, isStudent: activityDetailPartModel.isStudent).toJSONString(){
                                                QRPreview.show(qrCode)
                                }
                }
                @IBAction func editAction(_ sender: UIButton) {
WanPai/Root/Other/VC/PaymentResultVC.swift
@@ -267,9 +267,12 @@
                                let str = sender.titleLabel?.text ?? ""
                                switch str{
                                                case "查看排名":
                                                                let vc  = WorldCupVC()
                                                                jumpAndRemoveSelfVC(vc)
                                                case "查看预约":
                                                                let vc = YardBookingListVC()
                                                                jumpAndRemoveSelfVC(vc)
                                                case "立即预约":
                                                                navigationController?.qmui_popToRootViewController(animated: true, completion: { () in
                                                                                JQ_currentViewController().tabBarController?.selectedIndex = 1
WanPai/Root/Other/View/CommonYearsPickerView.swift
New file
@@ -0,0 +1,111 @@
//
//  CommonYearsPickerView.swift
//  WanPai
//
//  Created by 无故事王国 on 2024/3/5.
//
import UIKit
import JQTools
import QMUIKit
import RxSwift
import RxCocoa
class CommonYearsPickerView: UIView,JQNibView{
                @IBOutlet weak var view_container: UIView!
                @IBOutlet weak var cons_bottom: NSLayoutConstraint!
                @IBOutlet weak var pickerView: UIPickerView!
                private var clickClouse:((Int)->Void)!
                private var disposeBag = DisposeBag()
                private var years = [Int]()
                override func awakeFromNib() {
                                super.awakeFromNib()
                                years = (Date().jq_nowYear()-5...Date().jq_nowYear()).map{$0}
                                years.insert(0, at: 0)
                                cons_bottom.constant = -(JQ_ScreenW * 1.1)
                                pickerView.delegate = self
                                pickerView.dataSource = self
                                alpha = 0
                                layoutIfNeeded()
                                setRx()
                }
                static func show(clickClouse:@escaping (Int)->Void){
                                let studentChooseView = CommonYearsPickerView.jq_loadNibView()
                                studentChooseView.frame = sceneDelegate?.window?.frame ?? .zero
                                studentChooseView.clickClouse = clickClouse
                                sceneDelegate?.window?.addSubview(studentChooseView)
                                studentChooseView.cons_bottom.constant = 0
                                UIView.animate(withDuration: 0.4) {
                                                studentChooseView.alpha = 1
                                                studentChooseView.layoutIfNeeded()
                                }
                }
                private func setRx(){
                }
                @IBAction func closeAction(_ sender: UIButton) {
                                closeAction()
                }
                override func layoutSubviews() {
                                super.layoutSubviews()
                                DispatchQueue.main.asyncAfter(wallDeadline: .now()+0.1) {
                                                self.view_container.jq_addCorners(corner: [.topLeft,.topRight], radius: 20)
                                }
                }
                private func closeAction(){
                                self.cons_bottom.constant = -(JQ_ScreenW * 1.1)
                                UIView.animate(withDuration: 0.4) {
                                                self.alpha = 0
                                                self.layoutIfNeeded()
                                } completion: { _ in
                                                self.removeFromSuperview()
                                }
                }
                @IBAction func completeAction(_ sender: UIButton) {
                                let index = pickerView.selectedRow(inComponent: 0)
                                clickClouse!(years[index])
                                closeAction()
                }
}
extension CommonYearsPickerView:UIPickerViewDelegate{
                func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView {
                                let label = UILabel()
                                if years[row] == 0{
                                                label.text = "全部"
                                }else{
                                                label.text = "\(years[row])年"
                                }
                                label.textColor = UIColor(hexString: "3C3C3C")
                                label.textAlignment = .center
                                label.font = UIFont.systemFont(ofSize: 18, weight: .semibold)
                                label.bounds = CGRect(origin: .zero, size: CGSize(width: 100, height: 45))
                                return label
                }
                func pickerView(_ pickerView: UIPickerView, rowHeightForComponent component: Int) -> CGFloat {
                                return 50
                }
}
extension CommonYearsPickerView:UIPickerViewDataSource{
                func numberOfComponents(in pickerView: UIPickerView) -> Int {
                                return 1
                }
                func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
                                return years.count
                }
}
WanPai/Root/Other/View/CommonYearsPickerView.xib
New file
@@ -0,0 +1,105 @@
<?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">
    <device id="retina6_12" orientation="portrait" appearance="light"/>
    <dependencies>
        <deployment identifier="iOS"/>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
        <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"/>
        <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="CommonYearsPickerView" 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="Orj-lr-oYU">
                    <rect key="frame" x="0.0" y="476" width="393" height="376"/>
                    <subviews>
                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="yU4-jb-CHe">
                            <rect key="frame" x="100" y="276" width="193" height="40"/>
                            <color key="backgroundColor" name="FE6E0D"/>
                            <constraints>
                                <constraint firstAttribute="height" constant="40" id="T80-f4-ZNe"/>
                            </constraints>
                            <fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                            <state key="normal" title="确认">
                                <color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                            </state>
                            <userDefinedRuntimeAttributes>
                                <userDefinedRuntimeAttribute type="boolean" keyPath="ld_maskToBoundsXIB" value="YES"/>
                                <userDefinedRuntimeAttribute type="number" keyPath="ld_cornerRadiusXIB">
                                    <real key="value" value="20"/>
                                </userDefinedRuntimeAttribute>
                            </userDefinedRuntimeAttributes>
                            <connections>
                                <action selector="completeAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="i5t-0o-tYW"/>
                            </connections>
                        </button>
                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="请选择参与年份" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="F88-Cm-Utq">
                            <rect key="frame" x="139.33333333333334" y="18" width="114.33333333333334" height="19.333333333333329"/>
                            <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
                            <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
                            <nil key="highlightedColor"/>
                        </label>
                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9bC-Lz-I50">
                            <rect key="frame" x="358" y="15" width="25" height="25"/>
                            <constraints>
                                <constraint firstAttribute="height" constant="25" id="FcF-HQ-11R"/>
                                <constraint firstAttribute="width" constant="25" id="iQl-xT-ntH"/>
                            </constraints>
                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                            <state key="normal" image="btn_close_2"/>
                            <connections>
                                <action selector="closeAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="DP3-yh-o8f"/>
                            </connections>
                        </button>
                        <pickerView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="CrJ-Dm-Z2H">
                            <rect key="frame" x="50" y="50" width="293" height="216"/>
                        </pickerView>
                    </subviews>
                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                    <constraints>
                        <constraint firstAttribute="trailing" secondItem="9bC-Lz-I50" secondAttribute="trailing" constant="10" id="AVl-zm-8jl"/>
                        <constraint firstItem="CrJ-Dm-Z2H" firstAttribute="top" secondItem="9bC-Lz-I50" secondAttribute="bottom" constant="10" id="Aa6-OR-rEI"/>
                        <constraint firstItem="CrJ-Dm-Z2H" firstAttribute="leading" secondItem="Orj-lr-oYU" secondAttribute="leading" constant="50" id="EJy-TG-GTs"/>
                        <constraint firstAttribute="trailing" secondItem="yU4-jb-CHe" secondAttribute="trailing" constant="100" id="IcY-wI-p7g"/>
                        <constraint firstItem="F88-Cm-Utq" firstAttribute="centerX" secondItem="Orj-lr-oYU" secondAttribute="centerX" id="MKr-bg-I4g"/>
                        <constraint firstItem="9bC-Lz-I50" firstAttribute="centerY" secondItem="F88-Cm-Utq" secondAttribute="centerY" id="eCx-xO-zk0"/>
                        <constraint firstItem="yU4-jb-CHe" firstAttribute="top" secondItem="CrJ-Dm-Z2H" secondAttribute="bottom" constant="10" id="qbx-Cm-qOw"/>
                        <constraint firstItem="yU4-jb-CHe" firstAttribute="leading" secondItem="Orj-lr-oYU" secondAttribute="leading" constant="100" id="udA-eS-dr5"/>
                        <constraint firstAttribute="trailing" secondItem="CrJ-Dm-Z2H" secondAttribute="trailing" constant="50" id="udK-Qn-YS5"/>
                        <constraint firstItem="F88-Cm-Utq" firstAttribute="top" secondItem="Orj-lr-oYU" secondAttribute="top" constant="18" id="wqx-XF-xpq"/>
                        <constraint firstAttribute="bottomMargin" secondItem="yU4-jb-CHe" secondAttribute="bottom" constant="18" id="xL2-UJ-vql"/>
                    </constraints>
                </view>
            </subviews>
            <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
            <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
            <constraints>
                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="Orj-lr-oYU" secondAttribute="trailing" id="01x-iX-8lL"/>
                <constraint firstItem="Orj-lr-oYU" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="7DP-hE-wBv"/>
                <constraint firstAttribute="bottom" secondItem="Orj-lr-oYU" secondAttribute="bottom" id="dOw-Ug-LeN"/>
            </constraints>
            <connections>
                <outlet property="cons_bottom" destination="dOw-Ug-LeN" id="377-ga-r8x"/>
                <outlet property="pickerView" destination="CrJ-Dm-Z2H" id="aXW-aq-HzI"/>
                <outlet property="view_container" destination="Orj-lr-oYU" id="bWK-AB-O2r"/>
            </connections>
            <point key="canvasLocation" x="139.69465648854961" y="20.422535211267608"/>
        </view>
    </objects>
    <resources>
        <image name="btn_close_2" width="20" height="20"/>
        <namedColor name="FE6E0D">
            <color red="0.99199998378753662" green="0.53299999237060547" blue="0.0080000003799796104" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
        </namedColor>
        <systemColor name="systemBackgroundColor">
            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
        </systemColor>
    </resources>
</document>
WanPai/Root/Other/View/StudentChoose2View.swift
@@ -121,6 +121,5 @@
                                cell.btn_delete.isHidden = true
                                cell.btn_edit.isHidden = true
                                return cell
                                return UITableViewCell()
                }
}
WanPai/Root/Search/TCell/JudgeTCell.swift
@@ -13,6 +13,7 @@
                @IBOutlet weak var label_state: UILabel!
                @IBOutlet weak var label_time: UILabel!
                @IBOutlet weak var label_times: UILabel!
                @IBOutlet weak var btn_begin: UIButton!
                
    override func awakeFromNib() {
        super.awakeFromNib()
@@ -24,6 +25,7 @@
                                label_state.text = model.status.rawTitle
                                label_time.text = "活动时间:\(model.activeTime)"
                                label_times.text = "已比赛场次数:\(model.matchNumber)"
                                btn_begin.isHidden = model.status == .cancel || model.status == .ongoing
                }
}
WanPai/Root/Search/TCell/JudgeTCell.xib
@@ -57,7 +57,7 @@
                            <constraint firstAttribute="height" constant="1" id="YCd-90-OF4"/>
                        </constraints>
                    </view>
                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vza-pw-uzb">
                    <button opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vza-pw-uzb">
                        <rect key="frame" x="233" y="109" width="75" height="31"/>
                        <color key="backgroundColor" red="0.42352941176470588" green="0.76470588235294112" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                        <constraints>
@@ -97,6 +97,7 @@
            </tableViewCellContentView>
            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
            <connections>
                <outlet property="btn_begin" destination="vza-pw-uzb" id="Cob-lZ-2Of"/>
                <outlet property="label_state" destination="F8q-ir-Qf1" id="ISr-2D-GbB"/>
                <outlet property="label_time" destination="duw-1y-5vU" id="EYg-1M-nJB"/>
                <outlet property="label_times" destination="djT-fc-noO" id="bpI-iD-vWk"/>
WanPai/Root/Search/TCell/MyQRCodeTCell.swift
@@ -6,6 +6,7 @@
//
import UIKit
import JQTools
class MyQRCodeTCell: UITableViewCell {
                @IBOutlet weak var view_container: UIView!
@@ -13,11 +14,28 @@
                @IBOutlet weak var label_age: UILabel!
                @IBOutlet weak var img_QRCode: UIImageView!
                
                var studentProfile1Model:StudentProfile1Model!{
//                var studentProfile1Model:StudentProfile1Model?{
//                                didSet{
//                                                if let m =
//                                                label_name.text = studentProfile1Model.stuName
//                                                label_age.text = "\(studentProfile1Model.stuAge)岁"
//
//                                                if let qrCode = WorldCupUserInfoQRCodel(id: studentProfile1Model.stuId, isStudent: 1).toJSONString(){
//                                                                img_QRCode.image = UIImage.jq_GenerateQRCode(with: "\(qrCode)", width: 100)
//                                                }
//                                }
//                }
                var activityDetailPartModel:ActivityDetailPartModel?{
                                didSet{
                                                label_name.text = studentProfile1Model.stuName
                                                label_age.text = "\(studentProfile1Model.stuAge)岁"
                                                img_QRCode.image = UIImage.jq_GenerateQRCode(with: "\(studentProfile1Model.stuId)", width: 100)
                                                if let m = activityDetailPartModel{
                                                                label_name.text = m.name
                                                                label_age.text = "\(m.age)岁"
                                                                if let qrCode = WorldCupUserInfoQRCodel(id: m.id, isStudent: m.isStudent).toJSONString(){
                                                                                img_QRCode.image = UIImage.jq_GenerateQRCode(with: "\(qrCode)", width: 100)
                                                                }
                                                }
                                }
                }
WanPai/Root/Search/VC/JudgeListVC.swift
@@ -37,10 +37,8 @@
                                title = "社区世界杯"
                                Services.getWorldCupStore().subscribe(onNext: {[weak self] data in
                                                if let model = data.data{
                                                                self?.pointData.append(NormalSimpleModel(id: 0, name: "全部"))
                                                                self?.pointData.append(contentsOf: data.data ?? [])
                                                }
                                                self?.pointData.append(NormalSimpleModel(id: 0, name: "全部"))
                                                self?.pointData.append(contentsOf: data.data ?? [])
                                }).disposed(by: disposeBag)
                                viewModel.configure(tableView, needMore: false)
@@ -82,22 +80,23 @@
extension JudgeListVC:UITableViewDelegate{
                func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
                                let vc = MatchDetailVC()
                                let model = viewModel.dataSource.value[indexPath.row]
                                guard model.status != .cancel else {return}
                                let vc = MatchDetailVC(model: model)
                                push(vc: vc)
                }
}
extension JudgeListVC:UITableViewDataSource{
                func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
                                let model = viewModel.dataSource.value[indexPath.row]
                                let cell = tableView.dequeueReusableCell(withIdentifier: "_JudgeTCell") as! JudgeTCell
//                                let model = viewModel.dataSource.value[indexPath.row]
//                                cell.setModel(model)
                                cell.setModel(model)
                                return cell
                }
                func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
//                                return viewModel.dataSource.value.count
                                return 2
                                return viewModel.dataSource.value.count
                }
                func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
WanPai/Root/Search/VC/MatchDetailVC.swift
@@ -6,23 +6,227 @@
//
import UIKit
import JQTools
import HandyJSON
class MatchDetailVC: BaseVC {
    override func viewDidLoad() {
                @IBOutlet weak var view_red1: UIView!
                @IBOutlet weak var view_red2: UIView!
                @IBOutlet weak var view_red3: UIView!
                @IBOutlet weak var view_blue1: UIView!
                @IBOutlet weak var view_blue2: UIView!
                @IBOutlet weak var view_blue3: UIView!
                @IBOutlet weak var view_device: UIView!
                @IBOutlet weak var label_deviceTitle: UILabel!
                @IBOutlet weak var label_matchPoint: UILabel!
                @IBOutlet weak var label_mathYard: UILabel!
                @IBOutlet weak var redStackView: UIStackView!
                @IBOutlet weak var blueStackView: UIStackView!
                @IBOutlet weak var btn_handle: UIButton!
                private var redTeamItems = [WorldCupPeopleModel]()
                private var blueTeamItems = [WorldCupPeopleModel]()
                private var model:WorldCupJudgeModel!
                private var deviceQRCode:String?
                required init(model:WorldCupJudgeModel) {
                                super.init(nibName: nil, bundle: nil)
                                self.model = model
                }
                required init?(coder: NSCoder) {
                                fatalError("init(coder:) has not been implemented")
                }
                override func viewDidLoad() {
        super.viewDidLoad()
                                title = "当前比赛名称"
                                title = model.name
                                view.backgroundColor = .white
    }
                override func setUI() {
                                view_red1.isHidden = true
                                view_red2.isHidden = true
                                view_red3.isHidden = true
    /*
    // MARK: - Navigation
                                view_blue1.isHidden = true
                                view_blue2.isHidden = true
                                view_blue3.isHidden = true
    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */
                                label_deviceTitle.isHidden = true
                                label_matchPoint.isHidden = true
                                label_mathYard.isHidden = true
                }
                @IBAction func addRedTeam(_ sender: UIButton) {
                                guard redTeamItems.count < 3 else {
                                                alert(msg: "红队已满员");return
                                }
                                let scan = CommonScanQRCodeVC {[weak self] text, status in
                                                guard let weakSelf = self else { return }
                                                if status{
                                                                if let _ = WorldCupUserInfoQRCodel.deserialize(from: text){
                                                                                Services.getWorldCupPeople(code: text, worldCupId: weakSelf.model.id).subscribe(onNext: {data in
                                                                                                if let model = data.data{
                                                                                                                if  weakSelf.checkMutable(model: model){
                                                                                                                                weakSelf.redTeamItems.append(model)
                                                                                                                                weakSelf.updateUserView()
                                                                                                                }
                                                                                                }
                                                                                }).disposed(by: weakSelf.disposeBag)
                                                                }else{
                                                                                alert(msg: "无效二维码")
                                                                }
                                                }
                                }
                                present(scan, animated: true)
                }
                @IBAction func addBlueTeam(_ sender: UIButton) {
                                guard blueTeamItems.count < 3 else {
                                                alert(msg: "蓝队已满员");return
                                }
                                let scan = CommonScanQRCodeVC {[weak self] text, status in
                                                guard let weakSelf = self else { return }
                                                if status{
                                                                if let _ = WorldCupUserInfoQRCodel.deserialize(from: text){
                                                                                Services.getWorldCupPeople(code: text, worldCupId: weakSelf.model.id).subscribe(onNext: {data in
                                                                                                if let model = data.data{
                                                                                                                if  weakSelf.checkMutable(model: model){
                                                                                                                                weakSelf.blueTeamItems.append(model)
                                                                                                                                weakSelf.updateUserView()
                                                                                                                }
                                                                                                }
                                                                                }).disposed(by: weakSelf.disposeBag)
                                                                }else{
                                                                                alert(msg: "无效二维码")
                                                                }
                                                }
                                }
                                present(scan, animated: true)
                }
                @IBAction func deleRedUserAction(_ sender: UIButton) {
                                let index = sender.tag - 10
                                redTeamItems.remove(at: index)
                                redStackView.arrangedSubviews[index].isHidden = true
                }
                @IBAction func deleBlueUserAction(_ sender: UIButton) {
                                let index = sender.tag - 10
                                blueTeamItems.remove(at: index)
                                blueStackView.arrangedSubviews[index].isHidden = true
                }
                private func updateUserView(){
                                for item in redTeamItems {
                                                for subView in redStackView.arrangedSubviews{
                                                                if subView.isHidden{
                                                                                if let img = subView.subviews.first as? UIImageView{
                                                                                                img.sd_setImage(with: URL(string: item.avatar))
                                                                                                subView.isHidden = false
                                                                                                break
                                                                                }
                                                                }
                                                }
                                }
                                for item in blueTeamItems {
                                                for subView in blueStackView.arrangedSubviews{
                                                                if subView.isHidden{
                                                                                if let img = subView.subviews.first as? UIImageView{
                                                                                                img.sd_setImage(with: URL(string: item.avatar))
                                                                                                subView.isHidden = false
                                                                                                break
                                                                                }
                                                                }
                                                }
                                }
                }
                private func checkMutable(model:WorldCupPeopleModel)->Bool{
                                let red = redTeamItems.contains(where: {$0.id == model.id})
                                let blue = blueTeamItems.contains(where: {$0.id == model.id})
                                if red{
                                                alert(msg: "红队已存在")
                                                return false
                                }
                                if blue{
                                                alert(msg: "蓝队已存在")
                                                return false
                                }
                                return true
                }
                @IBAction func handleAction(_ sender: UIButton) {
                                if sender.isSelected{
                                                #if !DEBUG
                                                guard redTeamItems.count == 3 else{alert(msg: "红队人数不足");return}
                                                guard blueTeamItems.count == 3 else{alert(msg: "蓝队人数不足");return}
                                                #endif
                                                guard let devCode = deviceQRCode else{alert(msg: "请扫描设备二维码");return}
                                                struct TempModel:HandyJSON{
                                                                var id = 0
                                                                var participantType = 0
                                                                var type = ""
                                                }
                                                var tempArray = [Dictionary<String,Any>]()
                                                for red in redTeamItems {
                                                                tempArray.append(TempModel(id: red.id, participantType: red.participantType, type: "red").toJSON()!)
                                                }
                                                for blue in blueTeamItems {
                                                                tempArray.append(TempModel(id: blue.id, participantType: blue.participantType, type: "blue").toJSON()!)
                                                }
                                                CommonAlertView.show(title: "提示", content: "确认开启当前比赛吗?") {[weak self] status in
                                                                guard let weakSelf = self else { return }
                                                                if status{
                                                                                Services.startWorldCup(code: devCode, people: tempArray.jq_toJson1(), worldCupId: weakSelf.model.id).subscribe(onNext: {data in
                                                                                                if let _ = data.data{
                                                                                                                weakSelf.btn_handle.isEnabled = false
                                                                                                                alert(msg: "比赛已开始")
                                                                                                                DispatchQueue.main.asyncAfter(deadline: .now()+0.5) {
                                                                                                                                weakSelf.navigationController?.popViewController()
                                                                                                                }
                                                                                                }
                                                                                }).disposed(by: weakSelf.disposeBag)
                                                                }
                                                }
                                }else{
                                                let scan = CommonScanQRCodeVC {[weak self] text, status in
                                                                guard let weakSelf = self else { return }
                                                                if status{
                                                                                Services.getDeviceInformation(text: text).subscribe(onNext: {data in
                                                                                                if let model = data.data{
                                                                                                                sender.isSelected = true
                                                                                                                weakSelf.deviceQRCode = text
                                                                                                                weakSelf.label_deviceTitle.isHidden = false
                                                                                                                weakSelf.label_matchPoint.isHidden = false
                                                                                                                weakSelf.label_mathYard.isHidden = false
                                                                                                                weakSelf.label_matchPoint.text = "所属赛点:" + model.name
                                                                                                                weakSelf.label_mathYard.text = "所属场地:" + model.address
                                                                                                }
                                                                                }).disposed(by: weakSelf.disposeBag)
                                                                }
                                                }
                                                present(scan, animated: true)
                                }
                }
}
WanPai/Root/Search/VC/MatchDetailVC.xib
@@ -4,13 +4,27 @@
    <dependencies>
        <deployment identifier="iOS"/>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
        <capability name="Named colors" minToolsVersion="9.0"/>
        <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" customClass="MatchDetailVC" customModule="WanPai" customModuleProvider="target">
            <connections>
                <outlet property="blueStackView" destination="0Qm-bc-Lz6" id="QBR-Np-BZu"/>
                <outlet property="btn_handle" destination="Irm-Cr-MTn" id="iOo-2u-oB9"/>
                <outlet property="label_deviceTitle" destination="YhX-W2-lV6" id="N9W-o6-ZEk"/>
                <outlet property="label_matchPoint" destination="ohX-Ys-LLn" id="g0C-Lh-8yb"/>
                <outlet property="label_mathYard" destination="api-DT-2Ga" id="fhc-21-VAG"/>
                <outlet property="redStackView" destination="IM3-iJ-n3i" id="rMz-jS-Vq6"/>
                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
                <outlet property="view_blue1" destination="NC1-mI-zKx" id="tlf-qa-Zta"/>
                <outlet property="view_blue2" destination="MAY-fE-XVW" id="zXt-hK-2nw"/>
                <outlet property="view_blue3" destination="Pv2-U4-eh9" id="8Aa-BL-tOr"/>
                <outlet property="view_device" destination="t22-L5-pNm" id="pM5-Hn-UwJ"/>
                <outlet property="view_red1" destination="WaE-Ya-Qah" id="PZx-EF-S91"/>
                <outlet property="view_red2" destination="DL1-JD-042" id="u4s-RH-wK5"/>
                <outlet property="view_red3" destination="yx0-w9-Zk2" id="PNW-Kh-vZM"/>
            </connections>
        </placeholder>
        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
@@ -31,21 +45,391 @@
                        <constraint firstAttribute="width" secondItem="UgK-2f-Czf" secondAttribute="height" multiplier="1:1.3958" id="Zc2-i4-vXc"/>
                    </constraints>
                </imageView>
                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="t22-L5-pNm">
                    <rect key="frame" x="0.0" y="607.66666666666663" width="393" height="210.33333333333337"/>
                    <subviews>
                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Irm-Cr-MTn">
                            <rect key="frame" x="50" y="152.33333333333337" width="293" height="40"/>
                            <color key="backgroundColor" name="FE6E0D"/>
                            <constraints>
                                <constraint firstAttribute="height" constant="40" id="G9D-9W-FOI"/>
                            </constraints>
                            <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="16"/>
                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                            <state key="normal" title="选择设备"/>
                            <state key="selected" title="开启比赛"/>
                            <userDefinedRuntimeAttributes>
                                <userDefinedRuntimeAttribute type="boolean" keyPath="ld_maskToBoundsXIB" value="YES"/>
                                <userDefinedRuntimeAttribute type="number" keyPath="ld_cornerRadiusXIB">
                                    <real key="value" value="20"/>
                                </userDefinedRuntimeAttribute>
                            </userDefinedRuntimeAttributes>
                            <connections>
                                <action selector="handleAction:" destination="-1" eventType="touchUpInside" id="TjK-gz-AaJ"/>
                            </connections>
                        </button>
                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="所属赛点:--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ohX-Ys-LLn">
                            <rect key="frame" x="50.000000000000007" y="120.33333333333337" width="84.666666666666686" height="17"/>
                            <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/>
                            <color key="textColor" red="0.95686274510000002" green="0.97254901959999995" blue="0.98431372549999996" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                            <nil key="highlightedColor"/>
                        </label>
                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="所属场地:--" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="api-DT-2Ga">
                            <rect key="frame" x="258.33333333333331" y="120.33333333333337" width="84.666666666666686" height="17"/>
                            <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/>
                            <color key="textColor" red="0.95686274510000002" green="0.97254901959999995" blue="0.98431372549999996" alpha="1" 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="YhX-W2-lV6">
                            <rect key="frame" x="50" y="93.333333333333371" width="57.333333333333343" height="17"/>
                            <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/>
                            <color key="textColor" red="0.95686274510000002" green="0.97254901959999995" blue="0.98431372549999996" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                            <nil key="highlightedColor"/>
                        </label>
                    </subviews>
                    <constraints>
                        <constraint firstItem="Irm-Cr-MTn" firstAttribute="leading" secondItem="t22-L5-pNm" secondAttribute="leading" constant="50" id="3rp-0Z-Qwm"/>
                        <constraint firstItem="api-DT-2Ga" firstAttribute="trailing" secondItem="Irm-Cr-MTn" secondAttribute="trailing" id="5ZY-iW-zQk"/>
                        <constraint firstAttribute="bottom" secondItem="Irm-Cr-MTn" secondAttribute="bottom" constant="18" id="6Id-bE-iUp"/>
                        <constraint firstItem="ohX-Ys-LLn" firstAttribute="leading" secondItem="Irm-Cr-MTn" secondAttribute="leading" id="b1Z-1C-bF9"/>
                        <constraint firstItem="api-DT-2Ga" firstAttribute="centerY" secondItem="ohX-Ys-LLn" secondAttribute="centerY" id="hW6-K4-aMF"/>
                        <constraint firstItem="ohX-Ys-LLn" firstAttribute="leading" secondItem="YhX-W2-lV6" secondAttribute="leading" id="hdc-Bh-kzQ"/>
                        <constraint firstItem="ohX-Ys-LLn" firstAttribute="top" secondItem="YhX-W2-lV6" secondAttribute="bottom" constant="10" id="jmI-FW-Qgm"/>
                        <constraint firstItem="Irm-Cr-MTn" firstAttribute="top" secondItem="ohX-Ys-LLn" secondAttribute="bottom" constant="15" id="tnE-mo-ybC"/>
                        <constraint firstAttribute="trailing" secondItem="Irm-Cr-MTn" secondAttribute="trailing" constant="50" id="yMS-xi-PG3"/>
                    </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="PHe-Tf-02i">
                    <rect key="frame" x="182.33333333333334" y="560.66666666666663" width="28.666666666666657" height="17"/>
                    <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
                    <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                    <nil key="highlightedColor"/>
                </label>
                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="BLUE" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="30t-bC-Fho">
                    <rect key="frame" x="136.66666666666666" y="560.66666666666663" width="35.666666666666657" height="17"/>
                    <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
                    <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                    <nil key="highlightedColor"/>
                </label>
                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DWj-Io-Gyo">
                    <rect key="frame" x="221" y="554" width="30" height="30"/>
                    <constraints>
                        <constraint firstAttribute="height" constant="30" id="ERh-P5-3dc"/>
                        <constraint firstAttribute="width" constant="30" id="c8b-6H-Jve"/>
                    </constraints>
                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                    <state key="normal" image="btn_add_3"/>
                    <connections>
                        <action selector="addBlueTeam:" destination="-1" eventType="touchUpInside" id="zrS-94-aBU"/>
                    </connections>
                </button>
                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="红队" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="J3j-Sw-JFA">
                    <rect key="frame" x="192.33333333333334" y="89" width="28.666666666666657" height="17"/>
                    <constraints>
                        <constraint firstAttribute="width" constant="28.666666666666657" id="we1-a5-5EW"/>
                    </constraints>
                    <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
                    <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                    <nil key="highlightedColor"/>
                </label>
                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="RED" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ewM-XU-TUF">
                    <rect key="frame" x="146" y="89" width="36.333333333333343" height="17"/>
                    <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
                    <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                    <nil key="highlightedColor"/>
                </label>
                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fgq-No-gPy">
                    <rect key="frame" x="231" y="82.666666666666671" width="30" height="30"/>
                    <constraints>
                        <constraint firstAttribute="height" constant="30" id="Fd3-ah-9BK"/>
                        <constraint firstAttribute="width" constant="30" id="HTZ-8V-Hze"/>
                    </constraints>
                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                    <state key="normal" image="btn_add_3"/>
                    <connections>
                        <action selector="addRedTeam:" destination="-1" eventType="touchUpInside" id="tgh-Sd-4EJ"/>
                    </connections>
                </button>
                <stackView opaque="NO" contentMode="scaleToFill" spacing="25" translatesAutoresizingMaskIntoConstraints="NO" id="IM3-iJ-n3i">
                    <rect key="frame" x="33.666666666666657" y="136" width="326" height="115"/>
                    <subviews>
                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="WaE-Ya-Qah">
                            <rect key="frame" x="0.0" y="0.0" width="92" height="115"/>
                            <subviews>
                                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="WBK-jh-hgX">
                                    <rect key="frame" x="0.0" y="0.0" width="92" height="92"/>
                                    <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                    <constraints>
                                        <constraint firstAttribute="width" secondItem="WBK-jh-hgX" secondAttribute="height" multiplier="1:1" id="xFl-Hg-y76"/>
                                    </constraints>
                                    <userDefinedRuntimeAttributes>
                                        <userDefinedRuntimeAttribute type="boolean" keyPath="ld_maskToBoundsXIB" value="YES"/>
                                        <userDefinedRuntimeAttribute type="number" keyPath="ld_cornerRadiusXIB">
                                            <real key="value" value="46"/>
                                        </userDefinedRuntimeAttribute>
                                    </userDefinedRuntimeAttributes>
                                </imageView>
                                <button opaque="NO" tag="10" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="lrA-lC-dXQ">
                                    <rect key="frame" x="25.333333333333336" y="84" width="41.000000000000007" height="41"/>
                                    <constraints>
                                        <constraint firstAttribute="height" constant="41" id="9JX-dp-wMW"/>
                                        <constraint firstAttribute="width" constant="41" id="fvq-3C-Kaa"/>
                                    </constraints>
                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                    <state key="normal" image="btn_Match_del"/>
                                    <connections>
                                        <action selector="deleRedUserAction:" destination="-1" eventType="touchUpInside" id="ABT-QD-M0x"/>
                                    </connections>
                                </button>
                            </subviews>
                            <constraints>
                                <constraint firstItem="WBK-jh-hgX" firstAttribute="top" secondItem="WaE-Ya-Qah" secondAttribute="top" id="3qW-Mb-F3b"/>
                                <constraint firstAttribute="width" constant="92" id="5jq-gc-Qd9"/>
                                <constraint firstAttribute="trailing" secondItem="WBK-jh-hgX" secondAttribute="trailing" id="5ys-Hh-GrY"/>
                                <constraint firstAttribute="bottom" secondItem="lrA-lC-dXQ" secondAttribute="bottom" constant="-10" id="DT9-6V-bOq"/>
                                <constraint firstItem="lrA-lC-dXQ" firstAttribute="centerX" secondItem="WaE-Ya-Qah" secondAttribute="centerX" id="J60-6N-Guo"/>
                                <constraint firstItem="WBK-jh-hgX" firstAttribute="leading" secondItem="WaE-Ya-Qah" secondAttribute="leading" id="Un5-qd-jv5"/>
                            </constraints>
                        </view>
                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DL1-JD-042">
                            <rect key="frame" x="117" y="0.0" width="92" height="115"/>
                            <subviews>
                                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="pDI-vT-Fpd">
                                    <rect key="frame" x="0.0" y="0.0" width="92" height="92"/>
                                    <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                    <constraints>
                                        <constraint firstAttribute="width" secondItem="pDI-vT-Fpd" secondAttribute="height" multiplier="1:1" id="Y8Q-dA-RFY"/>
                                    </constraints>
                                    <userDefinedRuntimeAttributes>
                                        <userDefinedRuntimeAttribute type="boolean" keyPath="ld_maskToBoundsXIB" value="YES"/>
                                        <userDefinedRuntimeAttribute type="number" keyPath="ld_cornerRadiusXIB">
                                            <real key="value" value="46"/>
                                        </userDefinedRuntimeAttribute>
                                    </userDefinedRuntimeAttributes>
                                </imageView>
                                <button opaque="NO" tag="11" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tFr-Yv-o4R">
                                    <rect key="frame" x="25.333333333333343" y="84" width="41" height="41"/>
                                    <constraints>
                                        <constraint firstAttribute="height" constant="41" id="SQz-uu-8gf"/>
                                        <constraint firstAttribute="width" constant="41" id="TKL-5M-UtW"/>
                                    </constraints>
                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                    <state key="normal" image="btn_Match_del"/>
                                    <connections>
                                        <action selector="deleRedUserAction:" destination="-1" eventType="touchUpInside" id="9Mj-4Z-Vf3"/>
                                    </connections>
                                </button>
                            </subviews>
                            <constraints>
                                <constraint firstAttribute="width" constant="92" id="0V4-Y8-yB8"/>
                                <constraint firstAttribute="bottom" secondItem="tFr-Yv-o4R" secondAttribute="bottom" constant="-10" id="N6w-Cb-2tU"/>
                                <constraint firstItem="pDI-vT-Fpd" firstAttribute="top" secondItem="DL1-JD-042" secondAttribute="top" id="atq-UE-kY9"/>
                                <constraint firstItem="pDI-vT-Fpd" firstAttribute="leading" secondItem="DL1-JD-042" secondAttribute="leading" id="c19-7J-xI1"/>
                                <constraint firstAttribute="trailing" secondItem="pDI-vT-Fpd" secondAttribute="trailing" id="nrV-Hq-OxF"/>
                                <constraint firstItem="tFr-Yv-o4R" firstAttribute="centerX" secondItem="DL1-JD-042" secondAttribute="centerX" id="peh-rV-eGs"/>
                            </constraints>
                        </view>
                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="yx0-w9-Zk2">
                            <rect key="frame" x="234" y="0.0" width="92" height="115"/>
                            <subviews>
                                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Duc-CA-hkw">
                                    <rect key="frame" x="0.0" y="0.0" width="92" height="92"/>
                                    <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                    <constraints>
                                        <constraint firstAttribute="width" secondItem="Duc-CA-hkw" secondAttribute="height" multiplier="1:1" id="7Sq-j0-r09"/>
                                    </constraints>
                                    <userDefinedRuntimeAttributes>
                                        <userDefinedRuntimeAttribute type="boolean" keyPath="ld_maskToBoundsXIB" value="YES"/>
                                        <userDefinedRuntimeAttribute type="number" keyPath="ld_cornerRadiusXIB">
                                            <real key="value" value="46"/>
                                        </userDefinedRuntimeAttribute>
                                    </userDefinedRuntimeAttributes>
                                </imageView>
                                <button opaque="NO" tag="12" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="QZw-VN-PnF">
                                    <rect key="frame" x="25.333333333333314" y="84" width="41" height="41"/>
                                    <constraints>
                                        <constraint firstAttribute="width" constant="41" id="T3O-jc-ERQ"/>
                                        <constraint firstAttribute="height" constant="41" id="x3F-Qy-a7c"/>
                                    </constraints>
                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                    <state key="normal" image="btn_Match_del"/>
                                    <connections>
                                        <action selector="deleRedUserAction:" destination="-1" eventType="touchUpInside" id="MtC-sW-6Xj"/>
                                    </connections>
                                </button>
                            </subviews>
                            <constraints>
                                <constraint firstItem="Duc-CA-hkw" firstAttribute="top" secondItem="yx0-w9-Zk2" secondAttribute="top" id="3gu-9u-nz9"/>
                                <constraint firstAttribute="bottom" secondItem="QZw-VN-PnF" secondAttribute="bottom" constant="-10" id="538-QT-fos"/>
                                <constraint firstAttribute="width" constant="92" id="UbZ-b0-hoh"/>
                                <constraint firstAttribute="trailing" secondItem="Duc-CA-hkw" secondAttribute="trailing" id="cgv-mK-hVE"/>
                                <constraint firstItem="QZw-VN-PnF" firstAttribute="centerX" secondItem="yx0-w9-Zk2" secondAttribute="centerX" id="lHk-0b-VPa"/>
                                <constraint firstItem="Duc-CA-hkw" firstAttribute="leading" secondItem="yx0-w9-Zk2" secondAttribute="leading" id="r4H-qD-7pk"/>
                            </constraints>
                        </view>
                    </subviews>
                    <constraints>
                        <constraint firstAttribute="height" constant="115" id="EpF-Ed-99c"/>
                    </constraints>
                </stackView>
                <stackView opaque="NO" contentMode="scaleToFill" spacing="25" translatesAutoresizingMaskIntoConstraints="NO" id="0Qm-bc-Lz6">
                    <rect key="frame" x="33.666666666666657" y="425.66666666666669" width="326" height="115.00000000000006"/>
                    <subviews>
                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NC1-mI-zKx">
                            <rect key="frame" x="0.0" y="0.0" width="92" height="115"/>
                            <subviews>
                                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="kwN-sM-5Jp">
                                    <rect key="frame" x="0.0" y="0.0" width="92" height="92"/>
                                    <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                    <constraints>
                                        <constraint firstAttribute="width" secondItem="kwN-sM-5Jp" secondAttribute="height" multiplier="1:1" id="FVT-Mu-jWa"/>
                                    </constraints>
                                    <userDefinedRuntimeAttributes>
                                        <userDefinedRuntimeAttribute type="boolean" keyPath="ld_maskToBoundsXIB" value="YES"/>
                                        <userDefinedRuntimeAttribute type="number" keyPath="ld_cornerRadiusXIB">
                                            <real key="value" value="46"/>
                                        </userDefinedRuntimeAttribute>
                                    </userDefinedRuntimeAttributes>
                                </imageView>
                                <button opaque="NO" tag="20" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="yU2-as-RQp">
                                    <rect key="frame" x="25.333333333333336" y="84" width="41.000000000000007" height="41"/>
                                    <constraints>
                                        <constraint firstAttribute="width" constant="41" id="L8A-7f-wll"/>
                                        <constraint firstAttribute="height" constant="41" id="nHl-J4-GPL"/>
                                    </constraints>
                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                    <state key="normal" image="btn_Match_del"/>
                                    <connections>
                                        <action selector="deleBlueUserAction:" destination="-1" eventType="touchUpInside" id="fRm-MJ-mBX"/>
                                    </connections>
                                </button>
                            </subviews>
                            <constraints>
                                <constraint firstItem="kwN-sM-5Jp" firstAttribute="leading" secondItem="NC1-mI-zKx" secondAttribute="leading" id="9lp-RW-s2f"/>
                                <constraint firstAttribute="bottom" secondItem="yU2-as-RQp" secondAttribute="bottom" constant="-10" id="HzU-CD-INT"/>
                                <constraint firstItem="yU2-as-RQp" firstAttribute="centerX" secondItem="NC1-mI-zKx" secondAttribute="centerX" id="U1z-Pz-xOe"/>
                                <constraint firstAttribute="trailing" secondItem="kwN-sM-5Jp" secondAttribute="trailing" id="ZZC-Mh-uSp"/>
                                <constraint firstAttribute="width" constant="92" id="gVv-re-6Kv"/>
                                <constraint firstItem="kwN-sM-5Jp" firstAttribute="top" secondItem="NC1-mI-zKx" secondAttribute="top" id="yH0-1Q-rwI"/>
                            </constraints>
                        </view>
                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="MAY-fE-XVW">
                            <rect key="frame" x="117" y="0.0" width="92" height="115"/>
                            <subviews>
                                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="4Ro-YL-VwE">
                                    <rect key="frame" x="0.0" y="0.0" width="92" height="92"/>
                                    <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                    <constraints>
                                        <constraint firstAttribute="width" secondItem="4Ro-YL-VwE" secondAttribute="height" multiplier="1:1" id="zLY-tm-uwz"/>
                                    </constraints>
                                    <userDefinedRuntimeAttributes>
                                        <userDefinedRuntimeAttribute type="boolean" keyPath="ld_maskToBoundsXIB" value="YES"/>
                                        <userDefinedRuntimeAttribute type="number" keyPath="ld_cornerRadiusXIB">
                                            <real key="value" value="46"/>
                                        </userDefinedRuntimeAttribute>
                                    </userDefinedRuntimeAttributes>
                                </imageView>
                                <button opaque="NO" tag="21" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5su-M5-JoT">
                                    <rect key="frame" x="25.333333333333343" y="84" width="41" height="41"/>
                                    <constraints>
                                        <constraint firstAttribute="height" constant="41" id="c8G-QJ-ED7"/>
                                        <constraint firstAttribute="width" constant="41" id="mxs-9J-Jf9"/>
                                    </constraints>
                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                    <state key="normal" image="btn_Match_del"/>
                                    <connections>
                                        <action selector="deleBlueUserAction:" destination="-1" eventType="touchUpInside" id="EPY-gp-IZE"/>
                                    </connections>
                                </button>
                            </subviews>
                            <constraints>
                                <constraint firstAttribute="trailing" secondItem="4Ro-YL-VwE" secondAttribute="trailing" id="2Mk-8l-icj"/>
                                <constraint firstAttribute="width" constant="92" id="GS9-am-a2V"/>
                                <constraint firstItem="5su-M5-JoT" firstAttribute="centerX" secondItem="MAY-fE-XVW" secondAttribute="centerX" id="Vy8-Dx-huu"/>
                                <constraint firstItem="4Ro-YL-VwE" firstAttribute="top" secondItem="MAY-fE-XVW" secondAttribute="top" id="bo7-sC-LRh"/>
                                <constraint firstItem="4Ro-YL-VwE" firstAttribute="leading" secondItem="MAY-fE-XVW" secondAttribute="leading" id="eQf-1t-Nce"/>
                                <constraint firstAttribute="bottom" secondItem="5su-M5-JoT" secondAttribute="bottom" constant="-10" id="q7v-Lg-WNc"/>
                            </constraints>
                        </view>
                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Pv2-U4-eh9">
                            <rect key="frame" x="234" y="0.0" width="92" height="115"/>
                            <subviews>
                                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="bcy-TN-a7B">
                                    <rect key="frame" x="0.0" y="0.0" width="92" height="92"/>
                                    <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                    <constraints>
                                        <constraint firstAttribute="width" secondItem="bcy-TN-a7B" secondAttribute="height" multiplier="1:1" id="yaE-83-Zl9"/>
                                    </constraints>
                                    <userDefinedRuntimeAttributes>
                                        <userDefinedRuntimeAttribute type="boolean" keyPath="ld_maskToBoundsXIB" value="YES"/>
                                        <userDefinedRuntimeAttribute type="number" keyPath="ld_cornerRadiusXIB">
                                            <real key="value" value="46"/>
                                        </userDefinedRuntimeAttribute>
                                    </userDefinedRuntimeAttributes>
                                </imageView>
                                <button opaque="NO" tag="22" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4ou-Zt-QxE">
                                    <rect key="frame" x="25.333333333333314" y="84" width="41" height="41"/>
                                    <constraints>
                                        <constraint firstAttribute="height" constant="41" id="jDJ-nk-oK0"/>
                                        <constraint firstAttribute="width" constant="41" id="rNx-RW-rlS"/>
                                    </constraints>
                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                    <state key="normal" image="btn_Match_del"/>
                                    <connections>
                                        <action selector="deleBlueUserAction:" destination="-1" eventType="touchUpInside" id="TsJ-ak-vII"/>
                                    </connections>
                                </button>
                            </subviews>
                            <constraints>
                                <constraint firstAttribute="width" constant="92" id="Oxa-Be-zg7"/>
                                <constraint firstItem="4ou-Zt-QxE" firstAttribute="centerX" secondItem="Pv2-U4-eh9" secondAttribute="centerX" id="Qav-dr-UMu"/>
                                <constraint firstAttribute="trailing" secondItem="bcy-TN-a7B" secondAttribute="trailing" id="ZY4-JX-4dU"/>
                                <constraint firstAttribute="bottom" secondItem="4ou-Zt-QxE" secondAttribute="bottom" constant="-10" id="gDl-jm-KPU"/>
                                <constraint firstItem="bcy-TN-a7B" firstAttribute="leading" secondItem="Pv2-U4-eh9" secondAttribute="leading" id="nGY-fT-ALk"/>
                                <constraint firstItem="bcy-TN-a7B" firstAttribute="top" secondItem="Pv2-U4-eh9" secondAttribute="top" id="od3-Kp-3f1"/>
                            </constraints>
                        </view>
                    </subviews>
                    <constraints>
                        <constraint firstAttribute="height" constant="115" id="SgF-T8-Qy5"/>
                    </constraints>
                </stackView>
            </subviews>
            <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
            <color key="backgroundColor" red="0.070588235294117646" green="0.15686274509803921" blue="0.4392156862745098" alpha="0.20000000000000001" colorSpace="custom" customColorSpace="sRGB"/>
            <constraints>
                <constraint firstItem="IM3-iJ-n3i" firstAttribute="top" secondItem="J3j-Sw-JFA" secondAttribute="bottom" constant="30" id="3Ik-6R-1Ib"/>
                <constraint firstItem="PHe-Tf-02i" firstAttribute="centerX" secondItem="UgK-2f-Czf" secondAttribute="centerX" id="3Ys-OJ-Zeg"/>
                <constraint firstAttribute="bottomMargin" secondItem="Mp4-s0-svz" secondAttribute="bottom" id="4Wx-ez-kmY"/>
                <constraint firstItem="Mp4-s0-svz" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="4vc-K6-Zgw"/>
                <constraint firstItem="DWj-Io-Gyo" firstAttribute="centerY" secondItem="PHe-Tf-02i" secondAttribute="centerY" id="9ld-fM-YQ7"/>
                <constraint firstItem="7Lx-0R-Sfa" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="ANk-R7-pWs"/>
                <constraint firstItem="PHe-Tf-02i" firstAttribute="top" secondItem="0Qm-bc-Lz6" secondAttribute="bottom" constant="20" id="CmA-gL-adv"/>
                <constraint firstItem="UgK-2f-Czf" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="Fgv-aI-ohK"/>
                <constraint firstItem="J3j-Sw-JFA" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="30" id="JkW-6B-3VB"/>
                <constraint firstItem="7Lx-0R-Sfa" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="K4F-im-6xF"/>
                <constraint firstItem="UgK-2f-Czf" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="KQs-DN-DBz"/>
                <constraint firstItem="DWj-Io-Gyo" firstAttribute="leading" secondItem="PHe-Tf-02i" secondAttribute="trailing" constant="10" id="LRX-LL-eyK"/>
                <constraint firstItem="PHe-Tf-02i" firstAttribute="centerY" secondItem="30t-bC-Fho" secondAttribute="centerY" id="Qad-Ae-JxL"/>
                <constraint firstItem="PHe-Tf-02i" firstAttribute="bottom" secondItem="UgK-2f-Czf" secondAttribute="bottom" constant="-30" id="RIg-1z-hCD"/>
                <constraint firstItem="7Lx-0R-Sfa" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="Tfq-ay-IBP"/>
                <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="t22-L5-pNm" secondAttribute="trailing" id="VM9-rE-0Fd"/>
                <constraint firstItem="t22-L5-pNm" firstAttribute="top" secondItem="UgK-2f-Czf" secondAttribute="bottom" id="VXX-A9-2uc"/>
                <constraint firstItem="UgK-2f-Czf" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="Z9i-9o-3P2"/>
                <constraint firstItem="fgq-No-gPy" firstAttribute="centerY" secondItem="J3j-Sw-JFA" secondAttribute="centerY" id="ZkW-XW-AC0"/>
                <constraint firstItem="t22-L5-pNm" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="cjd-sG-baB"/>
                <constraint firstAttribute="bottom" secondItem="7Lx-0R-Sfa" secondAttribute="bottom" id="hdD-lk-r2e"/>
                <constraint firstItem="Mp4-s0-svz" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="-100" id="jDc-pE-715"/>
                <constraint firstItem="fgq-No-gPy" firstAttribute="leading" secondItem="J3j-Sw-JFA" secondAttribute="trailing" constant="10" id="lGe-Qq-MOP"/>
                <constraint firstItem="IM3-iJ-n3i" firstAttribute="centerX" secondItem="UgK-2f-Czf" secondAttribute="centerX" id="lGl-2M-6nl"/>
                <constraint firstItem="ewM-XU-TUF" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="146" id="m92-2t-84l"/>
                <constraint firstItem="J3j-Sw-JFA" firstAttribute="leading" secondItem="ewM-XU-TUF" secondAttribute="trailing" constant="10" id="n9u-su-mxT"/>
                <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="fgq-No-gPy" secondAttribute="trailing" constant="132" id="oK6-Sq-J93"/>
                <constraint firstItem="Mp4-s0-svz" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" constant="60" id="pcf-l6-NAl"/>
                <constraint firstItem="J3j-Sw-JFA" firstAttribute="centerY" secondItem="ewM-XU-TUF" secondAttribute="centerY" id="sN2-la-Oom"/>
                <constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="t22-L5-pNm" secondAttribute="bottom" id="t8q-DK-9CO"/>
                <constraint firstItem="PHe-Tf-02i" firstAttribute="leading" secondItem="30t-bC-Fho" secondAttribute="trailing" constant="10" id="ugq-Fc-Yo4"/>
                <constraint firstItem="0Qm-bc-Lz6" firstAttribute="centerX" secondItem="UgK-2f-Czf" secondAttribute="centerX" id="zcq-2T-oic"/>
            </constraints>
            <point key="canvasLocation" x="81.679389312977094" y="20.422535211267608"/>
        </view>
@@ -53,5 +437,10 @@
    <resources>
        <image name="bg_ad" width="927" height="927.66668701171875"/>
        <image name="bg_footall" width="802" height="1082"/>
        <image name="btn_Match_del" width="55.333332061767578" height="55.333332061767578"/>
        <image name="btn_add_3" width="61" height="61"/>
        <namedColor name="FE6E0D">
            <color red="0.99199998378753662" green="0.53299999237060547" blue="0.0080000003799796104" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
        </namedColor>
    </resources>
</document>
WanPai/Root/Search/VC/MeQRCodeVC.swift
@@ -12,11 +12,12 @@
                @IBOutlet weak var tableView: UITableView!
                @IBOutlet weak var label_content: UILabel!
                private let viewModel = StudentExchangeViewModel()
                private let viewModel = ActivityStudentViewModel()
                override func viewDidLoad() {
                                super.viewDidLoad()
                                title = "我的二维码"
                                Services.queryProtocol(.matchStore, progress: false).subscribe(onNext: {[weak self] text in
                                                self?.label_content.text = (text.data ?? "").jq_filterFromHTML_1()
@@ -24,6 +25,7 @@
                }
                override func setUI() {
                                viewModel.isAuth.accept(1)
                                tableView.delegate = self
                                tableView.dataSource = self
                                tableView.separatorStyle = .none
@@ -37,7 +39,9 @@
                func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
                                let model = viewModel.dataSource.value[indexPath.row]
                                QRPreview.show("\(model.stuId)")
                                if let qrCode = WorldCupUserInfoQRCodel(id: model.id, isStudent: model.isStudent).toJSONString(){
                                                QRPreview.show(qrCode)
                                }
                }
                func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
@@ -47,7 +51,7 @@
                func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
                                let model = viewModel.dataSource.value[indexPath.row]
                                let cell = tableView.dequeueReusableCell(withIdentifier: "_MyQRCodeTCell") as! MyQRCodeTCell
                                cell.studentProfile1Model = model
                                cell.activityDetailPartModel = model
                                return cell
                }
WanPai/Root/Search/VC/SearchVC.swift
@@ -21,7 +21,7 @@
                var benefitHomeModel:BenefitHomeModel?
                private var models = [StartClouseExploreModel]()
                private var items = ["我的二维码","我的预约","社区世界杯","已报名活动","我的运动营","人员管理","我的券包","兑换记录","消费记录","积分明细","我的玩湃币","裁判入口"]
                private var items = ["我的二维码","我的预约","社区世界杯","已报名活动","我的运动营","人员管理","我的券包","兑换记录","消费记录","积分明细","我的玩湃币"]
                private var itemsImg = ["me_code","me_yard","me_wordCup","me_activity","me_camp","me_judge","me_coupons","me_withdrawRec","me_consume","me_coin","me_payCoin","me_judge"]
                override func viewDidDisappear(_ animated: Bool) {
@@ -72,6 +72,15 @@
                                                                self?.label_wpCoin.text = model.wpCoin.currencyNotPrefix()
                                                                self?.label_coin.text = "\(model.userIntegral)"
                                                                if model.referee == 1{
                                                                                self?.items.append("裁判入口")
                                                                                self?.func_collectionView.reloadData()
                                                                }
                                                                #if DEBUG
                                                                self?.items.append("裁判入口")
                                                                self?.func_collectionView.reloadData()
                                                                #endif
                                                }
                                }) { error in
WanPai/Root/Search/VC/WorldCupHeaderVC.swift
@@ -25,7 +25,9 @@
                                didSet{
                                                if let m = currentPartModel{
                                                                label_name.text = m.name
                                                                img_QR.image = UIImage.jq_GenerateQRCode(with: "\(m.id)", width: 76)
                                                                if let qrCode = WorldCupUserInfoQRCodel(id: m.id, isStudent: m.isStudent).toJSONString(){
                                                                                img_QR.image = UIImage.jq_GenerateQRCode(with: "\(qrCode)", width: 76)
                                                                }
                                                                getData(id: m.id, isStudent: m.isStudent)
                                                }
WanPai/Root/Search/VC/WorldCupRankVC.swift
@@ -8,13 +8,48 @@
import UIKit
import JQTools
import QMUIKit
import RxSwift
import RxRelay
class WorldCupRankViewModel:RefreshModel<WorldCupMatchRankModel>{
                var id = BehaviorRelay<Int>(value: 0)
                var isStudent = BehaviorRelay<Int>(value: 0)
                var radius = BehaviorRelay<Int>(value: 2)
                var sort = BehaviorRelay<Int>(value: 1)
                var year = BehaviorRelay<Int?>(value: nil)
                override func api() -> (Observable<BaseResponse<[WorldCupMatchRankModel]>>)? {
                                return Services.getWorldCupRank(id: id.value, isStudent: isStudent.value, radius: radius.value, sort: sort.value,year: year.value)
                }
}
class WorldCupRankVC: BaseVC {
                private var viewModel = WorldCupRankViewModel()
                var currentPartModel:ActivityDetailPartModel?
                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 var tableView:UITableView!
                override func viewDidLoad() {
                                super.viewDidLoad()
                                view.backgroundColor = .clear
                                if let model = currentPartModel{
                                                viewModel.id.accept(model.id)
                                                viewModel.isStudent.accept(model.isStudent)
                                                Services.getEntrantRank(id: model.id, isStudent: model.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: disposeBag)
                                }
                }
                override func setUI() {
@@ -47,29 +82,80 @@
                                                make.height.equalTo(40)
                                }
                                let provinceBtn = UIButton(type: .custom)
                                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)
                                }
                                let cityBtn = UIButton(type: .custom)
                                cityBtn.setTitle("城市", for: .normal)
                                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)
                                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(1)
                                                viewModel.radius.accept(2)
                                }
                                viewModel.beginRefresh()
                }
                @objc func filterAction(){
                                CommonYearsPickerView.show {[weak self] index in
                                                if index == 0{
                                                                self?.viewModel.year.accept(nil)
                                                                self?.yearBtn.setTitle("  全部", for: .normal)
                                                }else{
                                                                self?.viewModel.year.accept(index)
                                                                self?.yearBtn.setTitle("  \(index)年", for: .normal)
                                                }
                                                self?.viewModel.beginRefresh()
                                }
                }
                @objc func rateAction(sender:UIButton){
                                sender.isSelected = !sender.isSelected
                                viewModel.sort.accept(sender.isSelected ? 2 : 1)
                                ratioRankBtn.setTitle(viewModel.sort.value == 1 ? "按胜率排名":"按场次排名", for: .normal)
                                viewModel.beginRefresh()
                }
}
@@ -78,7 +164,7 @@
                                if section == 0{
                                                return 1
                                }
                                return 2
                                return viewModel.dataSource.value.count
                }
                func numberOfSections(in tableView: UITableView) -> Int {
@@ -183,33 +269,39 @@
                                                                make.centerY.equalToSuperview()
                                                }
                                                let btn = QMUIButton(type: .custom)
                                                btn.setTitle("全部", for: .normal)
                                                btn.setTitleColor(.black.withAlphaComponent(0.74), for: .normal)
                                                btn.titleLabel?.font = UIFont.systemFont(ofSize: 16)
                                                btn.borderColor = UIColor(hexString: "#D9D9D9")
                                                btn.borderWidth = 1
                                                btn.setImage(UIImage(named: "icon_down_arrow"), for: .normal)
                                                btn.spacingBetweenImageAndTitle = 20
                                                btn.imagePosition = .right
                                                btn.jq_cornerRadius = 5
                                                headerView?.contentView.addSubview(btn)
                                                btn.snp.makeConstraints { make in
                                                if     viewModel.year.value == nil{
                                                                yearBtn.setTitle("  全部", for: .normal)
                                                }else{
                                                                yearBtn.setTitle("  \(viewModel.year.value!)年", for: .normal)
                                                }
                                                yearBtn.setTitleColor(.black.withAlphaComponent(0.74), for: .normal)
                                                yearBtn.titleLabel?.font = UIFont.systemFont(ofSize: 16)
                                                yearBtn.borderColor = UIColor(hexString: "#D9D9D9")
                                                yearBtn.borderWidth = 1
                                                yearBtn.setImage(UIImage(named: "icon_down_arrow"), for: .normal)
                                                yearBtn.addTarget(self, action: #selector(filterAction), for: .touchUpInside)
                                                yearBtn.spacingBetweenImageAndTitle = 5
                                                yearBtn.imagePosition = .right
                                                yearBtn.jq_cornerRadius = 5
                                                headerView?.contentView.addSubview(yearBtn)
                                                yearBtn.snp.makeConstraints { make in
                                                                make.left.equalTo(label.snp.right).offset(2)
                                                                make.centerY.equalToSuperview()
                                                                make.width.greaterThanOrEqualTo(88)
                                                                make.width.greaterThanOrEqualTo(68)
                                                                make.height.equalTo(35)
                                                }
                                                let btn1 = QMUIButton(type: .custom)
                                                btn1.setTitle("按胜率排名", for: .normal)
                                                btn1.setTitleColor(UIColor(hexString: "#3876F2"), for: .normal)
                                                btn1.titleLabel?.font = UIFont.systemFont(ofSize: 16,weight: .medium)
                                                btn1.setImage(UIImage(named: "icon_reset"), for: .normal)
                                                btn1.spacingBetweenImageAndTitle = 5
                                                btn1.imagePosition = .right
                                                headerView?.contentView.addSubview(btn1)
                                                btn1.snp.makeConstraints { make in
                                                ratioRankBtn.setTitle("按胜率排名", for: .normal)
                                                ratioRankBtn.setTitle(viewModel.sort.value == 1 ? "按胜率排名":"按场次排名", for: .normal)
                                                ratioRankBtn.setTitleColor(UIColor(hexString: "#3876F2"), for: .normal)
                                                ratioRankBtn.titleLabel?.font = UIFont.systemFont(ofSize: 16,weight: .medium)
                                                ratioRankBtn.setImage(UIImage(named: "icon_reset"), for: .normal)
                                                ratioRankBtn.addTarget(self, action: #selector(rateAction), for: .touchUpInside)
                                                ratioRankBtn.spacingBetweenImageAndTitle = 5
                                                ratioRankBtn.imagePosition = .right
                                                headerView?.contentView.addSubview(ratioRankBtn)
                                                ratioRankBtn.snp.makeConstraints { make in
                                                                make.right.equalToSuperview().offset(-14)
                                                                make.centerY.equalToSuperview()
                                                                make.height.equalTo(22)
WanPai/Root/Search/VC/WorldCupVC.swift
@@ -104,7 +104,9 @@
                                }else if page == 2{
                                                return WorldCupRecordVC()
                                }else{
                                                return WorldCupRankVC()
                                                let vc = WorldCupRankVC()
                                                vc.currentPartModel = currentPartModel
                                                return vc
                                }
                }