fix
无故事王国
2024-03-04 54c6ef0be42d9f2e49a344fd69f231cb6df43797
fix
43个文件已修改
63个文件已添加
6670 ■■■■■ 已修改文件
WanPai.xcodeproj/project.pbxproj 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Bg/bg_ad.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Bg/bg_ad.imageset/bg_ad@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Bg/bg_ad.imageset/bg_ad@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Bg/bg_footall.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Bg/bg_footall.imageset/bg_footall@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Bg/bg_footall.imageset/bg_footall@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Btns/btn_delete_1.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Btns/btn_delete_1.imageset/btn_delete_1@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Btns/btn_delete_1.imageset/btn_delete_1@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Btns/btn_edit_1.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Btns/btn_edit_1.imageset/btn_edit_1@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Btns/btn_edit_1.imageset/btn_edit_1@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/icon_math_num.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/icon_math_num.imageset/icon_math_num@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/icon_math_num.imageset/icon_math_num@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_activity.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_activity.imageset/me_activity@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_activity.imageset/me_activity@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_camp.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_camp.imageset/me_camp@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_camp.imageset/me_camp@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_code.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_code.imageset/me_code@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_code.imageset/me_code@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_coin.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_coin.imageset/me_coin@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_coin.imageset/me_coin@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_consume.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_consume.imageset/me_consume@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_consume.imageset/me_consume@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_coupons.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_coupons.imageset/me_coupons@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_coupons.imageset/me_coupons@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_judge.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_judge.imageset/me_judge@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_judge.imageset/me_judge@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_payCoin.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_payCoin.imageset/me_payCoin@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_payCoin.imageset/me_payCoin@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_peoples.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_peoples.imageset/me_peoples@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_peoples.imageset/me_peoples@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_withdrawRec.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_withdrawRec.imageset/me_withdrawRec@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_withdrawRec.imageset/me_withdrawRec@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_wordCup.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_wordCup.imageset/me_wordCup@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_wordCup.imageset/me_wordCup@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_yard.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_yard.imageset/me_yard@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/me_yard.imageset/me_yard@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Common/VC/CommonWebVC.swift 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Common/View/AgreentView.swift 114 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Common/View/PaymentView.swift 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Config/Enums.swift 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Network/NetworkRequest.swift 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Network/Services.swift 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Activity/VC/ActivityStudentListVC.swift 116 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Activity/View/StoresInfoView.swift 187 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/VC/CourseDetailApplyVC.swift 1025 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/VC/StudentExchangeVC.swift 140 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Games/TCell/GamesTCell.swift 140 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Home/Model/WorldCupModel.swift 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Home/VC/WorldCupListVC.swift 95 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Other/TCell/StudentInfo_5_TCell.swift 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Other/TCell/StudentInfo_5_TCell.xib 193 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Other/VC/LogOffVC.swift 92 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Other/VC/PaymentResultVC.swift 703 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Other/View/StudentChoose2View.swift 126 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Other/View/StudentChoose2View.xib 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Other/View/StudentChooseView.swift 410 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/TCell/JudgeTCell.swift 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/TCell/JudgeTCell.xib 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/TCell/MyQRCodeTCell.swift 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/TCell/MyQRCodeTCell.xib 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/TCell/StudentInfo_4_TCell.swift 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/TCell/StudentInfo_4_TCell.xib 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/TCell/WorldCupRecordTCell.swift 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/TCell/WorldCupRecordTCell.xib 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/TCell/WorldCupTCell.swift 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/TCell/WorldCupTCell.xib 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/JudgeListVC.swift 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/JudgeListVC.xib 157 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/MatchDetailVC.swift 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/MatchDetailVC.xib 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/MeQRCodeVC.swift 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/MeQRCodeVC.xib 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/SearchVC.swift 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/StudentsManagerListVC.swift 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/StudentsManagerListVC.xib 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/WorldCupContentApplyInputVC.swift 235 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/WorldCupContentApplyInputVC.xib 63 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/WorldCupContentApplyVC.swift 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/WorldCupContentApplyVC.xib 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/WorldCupContentDetailVC.swift 89 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/WorldCupContentDetailVC.xib 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/WorldCupContentVC.swift 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/WorldCupHeaderVC.swift 72 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/WorldCupHeaderVC.xib 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/WorldCupRecordVC.swift 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/WorldCupVC.swift 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/CCell/FindItemCCell.swift 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/CCell/FindItemCCell.xib 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Yard/VC/YardBookingDetailVC.swift 568 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/ViewModel/RefreshModel.swift 402 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai.xcodeproj/project.pbxproj
@@ -74,6 +74,8 @@
        134BD52C2A6008BA00786819 /* YYPaymentManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 134BD5202A6008BA00786819 /* YYPaymentManager.swift */; };
        134BD52D2A6008BA00786819 /* YYPaymentResultModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 134BD5212A6008BA00786819 /* YYPaymentResultModel.swift */; };
        134BD52E2A6008BA00786819 /* YYPayRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 134BD5222A6008BA00786819 /* YYPayRequest.swift */; };
        134F87702B90AAD100962CE3 /* JudgeListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 134F876E2B90AAD100962CE3 /* JudgeListVC.swift */; };
        134F87712B90AAD100962CE3 /* JudgeListVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 134F876F2B90AAD100962CE3 /* JudgeListVC.xib */; };
        1350BF172ADFD1D9007FC49F /* RatingBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1350BF162ADFD1D9007FC49F /* RatingBar.swift */; };
        1353D5752A56CA0A00539FCA /* Services.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1353D5732A56CA0A00539FCA /* Services.swift */; };
        1353D5762A56CA0A00539FCA /* NetworkRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1353D5742A56CA0A00539FCA /* NetworkRequest.swift */; };
@@ -82,6 +84,8 @@
        1355ABFE2A4C15C7002B25E4 /* RechargeRecordVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1355ABFC2A4C15C7002B25E4 /* RechargeRecordVC.xib */; };
        135772AC2AB1B11400EA3544 /* YardBookingDetailVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 135772AA2AB1B11400EA3544 /* YardBookingDetailVC.swift */; };
        135772AD2AB1B11500EA3544 /* YardBookingDetailVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 135772AB2AB1B11400EA3544 /* YardBookingDetailVC.xib */; };
        13638ACB2B95AE7E00ABDD0D /* StudentChoose2View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13638ACA2B95AE7E00ABDD0D /* StudentChoose2View.swift */; };
        13638ACD2B95AE8900ABDD0D /* StudentChoose2View.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13638ACC2B95AE8900ABDD0D /* StudentChoose2View.xib */; };
        13675FF72B8CBDD400085A66 /* WorldCupMenuVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13675FF62B8CBDD400085A66 /* WorldCupMenuVC.swift */; };
        13675FF92B8CC05D00085A66 /* WorldCupContentVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13675FF82B8CC05D00085A66 /* WorldCupContentVC.swift */; };
        136B63982A4ECDD900E594F9 /* SearchStoreDetail_1_TCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 136B63962A4ECDD900E594F9 /* SearchStoreDetail_1_TCell.swift */; };
@@ -146,6 +150,10 @@
        1387B6722A4AC9C000BF2F2E /* CourseBookingTCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1387B6702A4AC9C000BF2F2E /* CourseBookingTCell.xib */; };
        1387B6752A4ACA1000BF2F2E /* CourseBooking_1_TCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1387B6732A4ACA1000BF2F2E /* CourseBooking_1_TCell.swift */; };
        1387B6762A4ACA1000BF2F2E /* CourseBooking_1_TCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1387B6742A4ACA1000BF2F2E /* CourseBooking_1_TCell.xib */; };
        138A25A82B91CC2300B2EE49 /* StudentsManagerListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 138A25A62B91CC2300B2EE49 /* StudentsManagerListVC.swift */; };
        138A25A92B91CC2300B2EE49 /* StudentsManagerListVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 138A25A72B91CC2300B2EE49 /* StudentsManagerListVC.xib */; };
        138A25B02B91CE8E00B2EE49 /* StudentInfo_5_TCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 138A25AE2B91CE8E00B2EE49 /* StudentInfo_5_TCell.swift */; };
        138A25B12B91CE8E00B2EE49 /* StudentInfo_5_TCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 138A25AF2B91CE8E00B2EE49 /* StudentInfo_5_TCell.xib */; };
        138BE81C2AF0E41400FECE44 /* SocketManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 138BE81B2AF0E41400FECE44 /* SocketManager.swift */; };
        138D4CFB2A47ECAC005233E7 /* CourseInfoScheduleVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 138D4CF92A47ECAC005233E7 /* CourseInfoScheduleVC.swift */; };
        138D4CFC2A47ECAC005233E7 /* CourseInfoScheduleVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 138D4CFA2A47ECAC005233E7 /* CourseInfoScheduleVC.xib */; };
@@ -221,6 +229,8 @@
        13D7BA9C2A4BDF0A0007E4B7 /* WelfareCouponsTCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13D7BA9A2A4BDF0A0007E4B7 /* WelfareCouponsTCell.xib */; };
        13D7D6232A4EBBCF000136BD /* SearchStoreTCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13D7D6212A4EBBCF000136BD /* SearchStoreTCell.swift */; };
        13D7D6242A4EBBCF000136BD /* SearchStoreTCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13D7D6222A4EBBCF000136BD /* SearchStoreTCell.xib */; };
        13D871122B90B7C2006B81AF /* MatchDetailVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13D871102B90B7C2006B81AF /* MatchDetailVC.swift */; };
        13D871132B90B7C2006B81AF /* MatchDetailVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13D871112B90B7C2006B81AF /* MatchDetailVC.xib */; };
        13DA7D4C2AAEFD630085ABF9 /* CommonWebVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13DA7D4A2AAEFD630085ABF9 /* CommonWebVC.swift */; };
        13DA7D4D2AAEFD630085ABF9 /* CommonWebVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13DA7D4B2AAEFD630085ABF9 /* CommonWebVC.xib */; };
        13DA7D4F2AAF03F90085ABF9 /* CommonScanQRCodeVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13DA7D4E2AAF03F90085ABF9 /* CommonScanQRCodeVC.swift */; };
@@ -250,6 +260,8 @@
        13FBD7812A4AD62100037156 /* StudentMentalListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13FBD7802A4AD62100037156 /* StudentMentalListVC.swift */; };
        13FBD7842A4ADD0600037156 /* StudentMentalTCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13FBD7822A4ADD0600037156 /* StudentMentalTCell.swift */; };
        13FBD7852A4ADD0600037156 /* StudentMentalTCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13FBD7832A4ADD0600037156 /* StudentMentalTCell.xib */; };
        13FF80F52B90AE8400B70178 /* JudgeTCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13FF80F32B90AE8400B70178 /* JudgeTCell.swift */; };
        13FF80F62B90AE8400B70178 /* JudgeTCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13FF80F42B90AE8400B70178 /* JudgeTCell.xib */; };
        32D5FD87AB45829154125950 /* Pods_WanPai.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F12BCB644B5E0392E2BFF8C7 /* Pods_WanPai.framework */; };
        8D2BCD3E2A3847F600A360C6 /* ActivityDetailApplyVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D2BCD3C2A3847F600A360C6 /* ActivityDetailApplyVC.swift */; };
        8D2BCD3F2A3847F600A360C6 /* ActivityDetailApplyVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8D2BCD3D2A3847F600A360C6 /* ActivityDetailApplyVC.xib */; };
@@ -411,6 +423,8 @@
        134BD5212A6008BA00786819 /* YYPaymentResultModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YYPaymentResultModel.swift; sourceTree = "<group>"; };
        134BD5222A6008BA00786819 /* YYPayRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YYPayRequest.swift; sourceTree = "<group>"; };
        134BD5332A60099B00786819 /* WanPai-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "WanPai-Bridging-Header.h"; sourceTree = SOURCE_ROOT; };
        134F876E2B90AAD100962CE3 /* JudgeListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JudgeListVC.swift; sourceTree = "<group>"; };
        134F876F2B90AAD100962CE3 /* JudgeListVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = JudgeListVC.xib; sourceTree = "<group>"; };
        1350BF162ADFD1D9007FC49F /* RatingBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RatingBar.swift; sourceTree = "<group>"; };
        1353D5732A56CA0A00539FCA /* Services.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Services.swift; sourceTree = "<group>"; };
        1353D5742A56CA0A00539FCA /* NetworkRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkRequest.swift; sourceTree = "<group>"; };
@@ -419,6 +433,8 @@
        1355ABFC2A4C15C7002B25E4 /* RechargeRecordVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = RechargeRecordVC.xib; sourceTree = "<group>"; };
        135772AA2AB1B11400EA3544 /* YardBookingDetailVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YardBookingDetailVC.swift; sourceTree = "<group>"; };
        135772AB2AB1B11400EA3544 /* YardBookingDetailVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = YardBookingDetailVC.xib; sourceTree = "<group>"; };
        13638ACA2B95AE7E00ABDD0D /* StudentChoose2View.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StudentChoose2View.swift; sourceTree = "<group>"; };
        13638ACC2B95AE8900ABDD0D /* StudentChoose2View.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = StudentChoose2View.xib; sourceTree = "<group>"; };
        13675FF62B8CBDD400085A66 /* WorldCupMenuVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorldCupMenuVC.swift; sourceTree = "<group>"; };
        13675FF82B8CC05D00085A66 /* WorldCupContentVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorldCupContentVC.swift; sourceTree = "<group>"; };
        136B63962A4ECDD900E594F9 /* SearchStoreDetail_1_TCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchStoreDetail_1_TCell.swift; sourceTree = "<group>"; };
@@ -483,6 +499,10 @@
        1387B6702A4AC9C000BF2F2E /* CourseBookingTCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CourseBookingTCell.xib; sourceTree = "<group>"; };
        1387B6732A4ACA1000BF2F2E /* CourseBooking_1_TCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseBooking_1_TCell.swift; sourceTree = "<group>"; };
        1387B6742A4ACA1000BF2F2E /* CourseBooking_1_TCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CourseBooking_1_TCell.xib; sourceTree = "<group>"; };
        138A25A62B91CC2300B2EE49 /* StudentsManagerListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StudentsManagerListVC.swift; sourceTree = "<group>"; };
        138A25A72B91CC2300B2EE49 /* StudentsManagerListVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = StudentsManagerListVC.xib; sourceTree = "<group>"; };
        138A25AE2B91CE8E00B2EE49 /* StudentInfo_5_TCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StudentInfo_5_TCell.swift; sourceTree = "<group>"; };
        138A25AF2B91CE8E00B2EE49 /* StudentInfo_5_TCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = StudentInfo_5_TCell.xib; sourceTree = "<group>"; };
        138BE81B2AF0E41400FECE44 /* SocketManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SocketManager.swift; sourceTree = "<group>"; };
        138D4CF92A47ECAC005233E7 /* CourseInfoScheduleVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseInfoScheduleVC.swift; sourceTree = "<group>"; };
        138D4CFA2A47ECAC005233E7 /* CourseInfoScheduleVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CourseInfoScheduleVC.xib; sourceTree = "<group>"; };
@@ -558,6 +578,8 @@
        13D7BA9A2A4BDF0A0007E4B7 /* WelfareCouponsTCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WelfareCouponsTCell.xib; sourceTree = "<group>"; };
        13D7D6212A4EBBCF000136BD /* SearchStoreTCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchStoreTCell.swift; sourceTree = "<group>"; };
        13D7D6222A4EBBCF000136BD /* SearchStoreTCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SearchStoreTCell.xib; sourceTree = "<group>"; };
        13D871102B90B7C2006B81AF /* MatchDetailVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MatchDetailVC.swift; sourceTree = "<group>"; };
        13D871112B90B7C2006B81AF /* MatchDetailVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MatchDetailVC.xib; sourceTree = "<group>"; };
        13DA7D4A2AAEFD630085ABF9 /* CommonWebVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonWebVC.swift; sourceTree = "<group>"; };
        13DA7D4B2AAEFD630085ABF9 /* CommonWebVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CommonWebVC.xib; sourceTree = "<group>"; };
        13DA7D4E2AAF03F90085ABF9 /* CommonScanQRCodeVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonScanQRCodeVC.swift; sourceTree = "<group>"; };
@@ -587,6 +609,8 @@
        13FBD7802A4AD62100037156 /* StudentMentalListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StudentMentalListVC.swift; sourceTree = "<group>"; };
        13FBD7822A4ADD0600037156 /* StudentMentalTCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StudentMentalTCell.swift; sourceTree = "<group>"; };
        13FBD7832A4ADD0600037156 /* StudentMentalTCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = StudentMentalTCell.xib; sourceTree = "<group>"; };
        13FF80F32B90AE8400B70178 /* JudgeTCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JudgeTCell.swift; sourceTree = "<group>"; };
        13FF80F42B90AE8400B70178 /* JudgeTCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = JudgeTCell.xib; sourceTree = "<group>"; };
        732365E0737559969E7CB12D /* Pods-WanPai.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WanPai.debug.xcconfig"; path = "Target Support Files/Pods-WanPai/Pods-WanPai.debug.xcconfig"; sourceTree = "<group>"; };
        8D2BCD3C2A3847F600A360C6 /* ActivityDetailApplyVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityDetailApplyVC.swift; sourceTree = "<group>"; };
        8D2BCD3D2A3847F600A360C6 /* ActivityDetailApplyVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ActivityDetailApplyVC.xib; sourceTree = "<group>"; };
@@ -760,6 +784,8 @@
                13426D612B8F0CFE0032338B /* WorldCupRankTCell.swift */,
                13F88AFB2B8F29F10055317B /* StudentInfo_4_TCell.swift */,
                13F88AFC2B8F29F10055317B /* StudentInfo_4_TCell.xib */,
                13FF80F32B90AE8400B70178 /* JudgeTCell.swift */,
                13FF80F42B90AE8400B70178 /* JudgeTCell.xib */,
            );
            path = TCell;
            sourceTree = "<group>";
@@ -1073,6 +1099,8 @@
                8D79A58E2A3957420029874B /* StudentInfo_2_TCell.xib */,
                1376A6932A4A765700D4C851 /* StudentInfo_3_TCell.swift */,
                1376A6942A4A765700D4C851 /* StudentInfo_3_TCell.xib */,
                138A25AE2B91CE8E00B2EE49 /* StudentInfo_5_TCell.swift */,
                138A25AF2B91CE8E00B2EE49 /* StudentInfo_5_TCell.xib */,
            );
            path = TCell;
            sourceTree = "<group>";
@@ -1231,6 +1259,8 @@
                8D6810EB2A3710D8004486DE /* StudentChooseView.xib */,
                1387B6612A4A969700BF2F2E /* CommonDatePickerView.swift */,
                1387B6632A4A96A600BF2F2E /* CommonDatePickerView.xib */,
                13638ACA2B95AE7E00ABDD0D /* StudentChoose2View.swift */,
                13638ACC2B95AE8900ABDD0D /* StudentChoose2View.xib */,
            );
            path = View;
            sourceTree = "<group>";
@@ -1502,6 +1532,12 @@
                137D2C352B8F5B8E001E34BF /* WorldCupContentApplyVC.xib */,
                137D2C3A2B8F630F001E34BF /* WorldCupContentApplyInputVC.swift */,
                137D2C3B2B8F630F001E34BF /* WorldCupContentApplyInputVC.xib */,
                134F876E2B90AAD100962CE3 /* JudgeListVC.swift */,
                134F876F2B90AAD100962CE3 /* JudgeListVC.xib */,
                13D871102B90B7C2006B81AF /* MatchDetailVC.swift */,
                13D871112B90B7C2006B81AF /* MatchDetailVC.xib */,
                138A25A62B91CC2300B2EE49 /* StudentsManagerListVC.swift */,
                138A25A72B91CC2300B2EE49 /* StudentsManagerListVC.xib */,
            );
            path = VC;
            sourceTree = "<group>";
@@ -1581,6 +1617,7 @@
                8D8400DE2A2F1432003AF6A2 /* LaunchScreen.storyboard in Resources */,
                13801CC92A4D29740041454D /* ChooseNumberView.xib in Resources */,
                133435042A40407200F23951 /* CalendarItemCCell.xib in Resources */,
                13638ACD2B95AE8900ABDD0D /* StudentChoose2View.xib in Resources */,
                8DFA9B772A316E9A00E99281 /* LoginRegOrForgotVC.xib in Resources */,
                136B63992A4ECDD900E594F9 /* SearchStoreDetail_1_TCell.xib in Resources */,
                1378019C2A3BF5C000414959 /* CourseOnlineSubListVC.xib in Resources */,
@@ -1611,6 +1648,7 @@
                137801872A3B01FA00414959 /* ActivitySignupDetailVC.xib in Resources */,
                13FBD7852A4ADD0600037156 /* StudentMentalTCell.xib in Resources */,
                13801CC02A4D20DB0041454D /* ChooseStoreView.xib in Resources */,
                134F87712B90AAD100962CE3 /* JudgeListVC.xib in Resources */,
                8D70178A2A3308DC00473C40 /* Common_1_TCell.xib in Resources */,
                139A39FB2A413C6500737AFB /* WelfareWeeklyTCell.xib in Resources */,
                13019C7E2A42ADA2004880CD /* CourseInfoVC.xib in Resources */,
@@ -1622,6 +1660,7 @@
                1387B6642A4A96A600BF2F2E /* CommonDatePickerView.xib in Resources */,
                137801982A3B188F00414959 /* CourseOnlineSearchView.xib in Resources */,
                8DCF25BC2A3813A400DC6899 /* CityChooseSubTypeView.xib in Resources */,
                13FF80F62B90AE8400B70178 /* JudgeTCell.xib in Resources */,
                1376A6962A4A765700D4C851 /* StudentInfo_3_TCell.xib in Resources */,
                13AFABC52A4AE492001FEA16 /* StudentRemarkTCell.xib in Resources */,
                13DA7D4D2AAEFD630085ABF9 /* CommonWebVC.xib in Resources */,
@@ -1632,6 +1671,7 @@
                130E402C2A4EC342003A3D75 /* SearchStoreDetailHeadView.xib in Resources */,
                13B6BB9E2ABAE000006D0C0E /* SignUpCourseVC.xib in Resources */,
                138D4CFC2A47ECAC005233E7 /* CourseInfoScheduleVC.xib in Resources */,
                13D871132B90B7C2006B81AF /* MatchDetailVC.xib in Resources */,
                1393B3972A4AD03A00B73072 /* CourseExerciseTCell.xib in Resources */,
                13F88AFE2B8F29F10055317B /* StudentInfo_4_TCell.xib in Resources */,
                13D084572A406672005B05D5 /* CalendarPickerView.xib in Resources */,
@@ -1672,6 +1712,7 @@
                8D8400EA2A2F14A3003AF6A2 /* LoginVC.xib in Resources */,
                1355ABFE2A4C15C7002B25E4 /* RechargeRecordVC.xib in Resources */,
                8D7D87182A380970003209D6 /* ActivityInfoTCell.xib in Resources */,
                138A25A92B91CC2300B2EE49 /* StudentsManagerListVC.xib in Resources */,
                13D7BA902A4BC3E90007E4B7 /* CommonSingleImgCCell.xib in Resources */,
                130CE4582A4925AB00394384 /* StudentVideoCCell.xib in Resources */,
                8D6E54D22A381CB000D750CE /* ActivityDetailVC.xib in Resources */,
@@ -1688,6 +1729,7 @@
                13921C012B8C838700BED781 /* FindItemCCell.xib in Resources */,
                8D630BF92A31801300F0B7A8 /* SearchVC.xib in Resources */,
                8D6810E82A370EFB004486DE /* CouponTCell.xib in Resources */,
                138A25B12B91CE8E00B2EE49 /* StudentInfo_5_TCell.xib in Resources */,
                8D6D6AF32A32D6F800DCA2C6 /* CourseListVC.xib in Resources */,
                8D4905AA2A31A6EC00E38513 /* HomeCCell.xib in Resources */,
                8D8400D92A2F1430003AF6A2 /* Main.storyboard in Resources */,
@@ -1779,6 +1821,7 @@
                13D7BA8F2A4BC3E90007E4B7 /* CommonSingleImgCCell.swift in Sources */,
                13426D632B8F0CFE0032338B /* WorldCupRankTCell.swift in Sources */,
                131732B72A405DED00F722AF /* YardDetailDateTimeVC.swift in Sources */,
                13638ACB2B95AE7E00ABDD0D /* StudentChoose2View.swift in Sources */,
                13D084552A40666A005B05D5 /* CalendarPickerView.swift in Sources */,
                8DF184442A332CCD0095687B /* StudentInfoTCell.swift in Sources */,
                13EAF3842AB43A3B000A6F07 /* GamesDataSourceVC.swift in Sources */,
@@ -1791,6 +1834,7 @@
                13A501912A4D6EA600FF6763 /* CoinStoreCCell.swift in Sources */,
                137B866A2AB3F03F00C4D01B /* GamesVC.swift in Sources */,
                1376A6952A4A765700D4C851 /* StudentInfo_3_TCell.swift in Sources */,
                13D871122B90B7C2006B81AF /* MatchDetailVC.swift in Sources */,
                1355ABFA2A4BE9FF002B25E4 /* WelfareCouponsSubListVC.swift in Sources */,
                8DFA9B762A316E9A00E99281 /* LoginRegOrForgotVC.swift in Sources */,
                132876622A49A18700FC9122 /* StudentExchangeVC.swift in Sources */,
@@ -1810,6 +1854,7 @@
                133A61882A4E7A200066C4E6 /* CustomerSubListVC.swift in Sources */,
                137B866F2AB3F87000C4D01B /* GamesPayView.swift in Sources */,
                1350BF172ADFD1D9007FC49F /* RatingBar.swift in Sources */,
                134F87702B90AAD100962CE3 /* JudgeListVC.swift in Sources */,
                1304B8602A4EB59F000D4F2E /* SearchStoreListVC.swift in Sources */,
                8D630BF82A31801300F0B7A8 /* SearchVC.swift in Sources */,
                13B6BBA12ABAE44E006D0C0E /* CourseSignUpTCell.swift in Sources */,
@@ -1925,6 +1970,7 @@
                1393B3922A4ACDB200B73072 /* CourseExerciseSubListVC.swift in Sources */,
                1304B8512A4EA5ED000D4F2E /* CustomerContentQATCell.swift in Sources */,
                13801CC72A4D294D0041454D /* ChooseNumberView.swift in Sources */,
                138A25A82B91CC2300B2EE49 /* StudentsManagerListVC.swift in Sources */,
                8D79A58F2A3957420029874B /* StudentInfo_2_TCell.swift in Sources */,
                131732BA2A405EF800F722AF /* CalendarDateTimeTCell.swift in Sources */,
                8D6C50232A372B21007EC2D9 /* IDCardView.swift in Sources */,
@@ -1933,6 +1979,7 @@
                13801CBE2A4D20D20041454D /* ChooseStoreView.swift in Sources */,
                137801932A3B0D3C00414959 /* CourseOnlineCCell.swift in Sources */,
                13675FF72B8CBDD400085A66 /* WorldCupMenuVC.swift in Sources */,
                138A25B02B91CE8E00B2EE49 /* StudentInfo_5_TCell.swift in Sources */,
                1324D35B2B8DE5EA00F168A8 /* WorldCupRecordTCell.swift in Sources */,
                136FD9AD2A4C2F0500933B7C /* RechargeItemCCell.swift in Sources */,
                8D630BFB2A3180B000F0B7A8 /* BaseTabBarVC.swift in Sources */,
@@ -1950,6 +1997,7 @@
                13D606B42A4C29C2004F2A7A /* RechargeCenterVC.swift in Sources */,
                8DAEB5502A305AEF00814766 /* Def.swift in Sources */,
                13F88B092B8F4A0B0055317B /* WorldCupHeadView.swift in Sources */,
                13FF80F52B90AE8400B70178 /* JudgeTCell.swift in Sources */,
                8D8400D42A2F1430003AF6A2 /* SceneDelegate.swift in Sources */,
                13F88B052B8F46EA0055317B /* WorldCupListVC.swift in Sources */,
                138D4CFF2A47EF4C005233E7 /* CourseDatetimeCCell.swift in Sources */,
WanPai/Assets.xcassets/Bg/bg_ad.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "bg_ad@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "bg_ad@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Bg/bg_ad.imageset/bg_ad@2x.png
WanPai/Assets.xcassets/Bg/bg_ad.imageset/bg_ad@3x.png
WanPai/Assets.xcassets/Bg/bg_footall.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "bg_footall@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "bg_footall@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Bg/bg_footall.imageset/bg_footall@2x.png
WanPai/Assets.xcassets/Bg/bg_footall.imageset/bg_footall@3x.png
WanPai/Assets.xcassets/Btns/btn_delete_1.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "btn_delete_1@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "btn_delete_1@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Btns/btn_delete_1.imageset/btn_delete_1@2x.png
WanPai/Assets.xcassets/Btns/btn_delete_1.imageset/btn_delete_1@3x.png
WanPai/Assets.xcassets/Btns/btn_edit_1.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "btn_edit_1@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "btn_edit_1@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Btns/btn_edit_1.imageset/btn_edit_1@2x.png
WanPai/Assets.xcassets/Btns/btn_edit_1.imageset/btn_edit_1@3x.png
WanPai/Assets.xcassets/Icons/icon_math_num.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "icon_math_num@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "icon_math_num@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Icons/icon_math_num.imageset/icon_math_num@2x.png
WanPai/Assets.xcassets/Icons/icon_math_num.imageset/icon_math_num@3x.png
WanPai/Assets.xcassets/Icons/me_activity.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "me_activity@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "me_activity@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Icons/me_activity.imageset/me_activity@2x.png
WanPai/Assets.xcassets/Icons/me_activity.imageset/me_activity@3x.png
WanPai/Assets.xcassets/Icons/me_camp.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "me_camp@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "me_camp@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Icons/me_camp.imageset/me_camp@2x.png
WanPai/Assets.xcassets/Icons/me_camp.imageset/me_camp@3x.png
WanPai/Assets.xcassets/Icons/me_code.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "me_code@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "me_code@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Icons/me_code.imageset/me_code@2x.png
WanPai/Assets.xcassets/Icons/me_code.imageset/me_code@3x.png
WanPai/Assets.xcassets/Icons/me_coin.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "me_coin@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "me_coin@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Icons/me_coin.imageset/me_coin@2x.png
WanPai/Assets.xcassets/Icons/me_coin.imageset/me_coin@3x.png
WanPai/Assets.xcassets/Icons/me_consume.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "me_consume@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "me_consume@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Icons/me_consume.imageset/me_consume@2x.png
WanPai/Assets.xcassets/Icons/me_consume.imageset/me_consume@3x.png
WanPai/Assets.xcassets/Icons/me_coupons.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "me_coupons@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "me_coupons@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Icons/me_coupons.imageset/me_coupons@2x.png
WanPai/Assets.xcassets/Icons/me_coupons.imageset/me_coupons@3x.png
WanPai/Assets.xcassets/Icons/me_judge.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "me_judge@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "me_judge@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Icons/me_judge.imageset/me_judge@2x.png
WanPai/Assets.xcassets/Icons/me_judge.imageset/me_judge@3x.png
WanPai/Assets.xcassets/Icons/me_payCoin.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "me_payCoin@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "me_payCoin@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Icons/me_payCoin.imageset/me_payCoin@2x.png
WanPai/Assets.xcassets/Icons/me_payCoin.imageset/me_payCoin@3x.png
WanPai/Assets.xcassets/Icons/me_peoples.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "me_peoples@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "me_peoples@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Icons/me_peoples.imageset/me_peoples@2x.png
WanPai/Assets.xcassets/Icons/me_peoples.imageset/me_peoples@3x.png
WanPai/Assets.xcassets/Icons/me_withdrawRec.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "me_withdrawRec@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "me_withdrawRec@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Icons/me_withdrawRec.imageset/me_withdrawRec@2x.png
WanPai/Assets.xcassets/Icons/me_withdrawRec.imageset/me_withdrawRec@3x.png
WanPai/Assets.xcassets/Icons/me_wordCup.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "me_wordCup@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "me_wordCup@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Icons/me_wordCup.imageset/me_wordCup@2x.png
WanPai/Assets.xcassets/Icons/me_wordCup.imageset/me_wordCup@3x.png
WanPai/Assets.xcassets/Icons/me_yard.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "me_yard@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "me_yard@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Icons/me_yard.imageset/me_yard@2x.png
WanPai/Assets.xcassets/Icons/me_yard.imageset/me_yard@3x.png
WanPai/Common/VC/CommonWebVC.swift
@@ -12,11 +12,12 @@
                private var type:AgreentType!
                private var content:String!
                private var customTitle:String?
                @IBOutlet weak var webView: WKWebView!
                @IBOutlet weak var cons_webHeight: NSLayoutConstraint!
                @IBOutlet weak var view_btns: UIView!
                init(type:AgreentType,content:String? = nil) {
                init(type:AgreentType,customTitle:String? = nil,content:String? = nil) {
                                super.init(nibName: nil, bundle: nil)
                                self.type = type
                                self.content = content
@@ -33,6 +34,13 @@
                                if type != .other{
                                                title = type.titleStr
                                                if customTitle != nil{
                                                                title = customTitle
                                                }else{
                                                                title = type.titleStr
                                                }
                                                Services.queryProtocol(type,progress: false).subscribe(onNext: {[weak self] result in
                                                                if let text = result.data?.jq_wrapHtml(){
                                                                                self?.webView.loadHTMLString(text, baseURL: nil)
WanPai/Common/View/AgreentView.swift
@@ -12,63 +12,63 @@
class AgreentView: UIView,JQNibView{
    @IBOutlet weak var label_title: UILabel!
    @IBOutlet weak var view_container: UIView!
//    @IBOutlet weak var webView: WKWebView!
    @IBOutlet weak var bottom_cons: NSLayoutConstraint!
    @IBOutlet weak var label_content: UILabel!
    private var type:AgreentType!
    private var content:String?
    private let disposeBag = DisposeBag()
    override func awakeFromNib() {
        super.awakeFromNib()
        bottom_cons.constant = -(JQ_ScreenH - JQ_ScreenW * 0.69)
        layoutIfNeeded()
    }
    static func show(type:AgreentType,content:String? = nil){
        let alertView = AgreentView.jq_loadNibView()
        alertView.frame = sceneDelegate?.window?.frame ?? .zero
        alertView.type = type
        alertView.label_title.text = type.titleStr
        alertView.content = content
        sceneDelegate?.window?.addSubview(alertView)
        alertView.bottom_cons.constant = 0
        UIView.animate(withDuration: 0.4) {
            alertView.layoutIfNeeded()
        }
                @IBOutlet weak var label_title: UILabel!
                @IBOutlet weak var view_container: UIView!
                //    @IBOutlet weak var webView: WKWebView!
                @IBOutlet weak var bottom_cons: NSLayoutConstraint!
                @IBOutlet weak var label_content: UILabel!
                private var type:AgreentType!
                private var content:String?
                private let disposeBag = DisposeBag()
        let attributed = AttributedStringbuilder.build()
                override func awakeFromNib() {
                                super.awakeFromNib()
                                bottom_cons.constant = -(JQ_ScreenH - JQ_ScreenW * 0.69)
                                layoutIfNeeded()
                }
        if type != .other && type != .matchStore && type != .useStore{
            Services.queryProtocol(type,progress: false).subscribe(onNext: { result in
                if let text = result.data?.jq_wrapHtml(){
                    attributed.add(string: text, withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "727272"), lineSpace: 4)
                }
            }).disposed(by: alertView.disposeBag)
        }else{
            attributed.add(string: content!, withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "727272"), lineSpace: 4)
        }
        alertView.label_content.attributedText = attributed.mutableAttributedString
        alertView.label_content.textAlignment = .center
    }
    override func layoutSubviews() {
        super.layoutSubviews()
        view_container.jq_addCorners(corner: [.topLeft,.topRight], radius: 20)
    }
    @IBAction func completeAction(_ sender: UIButton) {
        bottom_cons.constant = -(JQ_ScreenH - JQ_ScreenW * 0.69)
        UIView.animate(withDuration: 0.4) {
            self.layoutIfNeeded()
            self.alpha = 0
        }completion: { _ in
            self.removeFromSuperview()
        }
    }
                static func show(type:AgreentType,content:String? = nil){
                                let alertView = AgreentView.jq_loadNibView()
                                alertView.frame = sceneDelegate?.window?.frame ?? .zero
                                alertView.type = type
                                alertView.label_title.text = type.titleStr
                                alertView.content = content
                                sceneDelegate?.window?.addSubview(alertView)
                                alertView.bottom_cons.constant = 0
                                UIView.animate(withDuration: 0.4) {
                                                alertView.layoutIfNeeded()
                                }
                                let attributed = AttributedStringbuilder.build()
                                if type != .other && type != .matchStore && type != .useStore{
                                                Services.queryProtocol(type,progress: false).subscribe(onNext: { result in
                                                                if let text = result.data?.jq_wrapHtml(){
                                                                                attributed.add(string: text, withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "727272"), lineSpace: 4)
                                                                }
                                                }).disposed(by: alertView.disposeBag)
                                }else{
                                                attributed.add(string: content!, withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "727272"), lineSpace: 4)
                                }
                                alertView.label_content.attributedText = attributed.mutableAttributedString
                                alertView.label_content.textAlignment = .center
                }
                override func layoutSubviews() {
                                super.layoutSubviews()
                                view_container.jq_addCorners(corner: [.topLeft,.topRight], radius: 20)
                }
                @IBAction func completeAction(_ sender: UIButton) {
                                bottom_cons.constant = -(JQ_ScreenH - JQ_ScreenW * 0.69)
                                UIView.animate(withDuration: 0.4) {
                                                self.layoutIfNeeded()
                                                self.alpha = 0
                                }completion: { _ in
                                                self.removeFromSuperview()
                                }
                }
}
WanPai/Common/View/PaymentView.swift
@@ -10,15 +10,16 @@
class PaymentView: UIView,JQNibView{
    enum PaymentEnumType {
    case course //课程
    case yard //场地
    case joinMember //会员加入
    case game //游戏
    case recharge //充值
    case goods(ExchangeType)
    case activity
    }
                enum PaymentEnumType {
                                case course //课程
                                case yard //场地
                                case joinMember //会员加入
                                case game //游戏
                                case recharge //充值
                                case goods(ExchangeType)
                                case activity
                                case worldCup
                }
    @IBOutlet weak var view_container: UIView!
    @IBOutlet weak var cons_bottom: NSLayoutConstraint!
WanPai/Config/Enums.swift
@@ -17,6 +17,10 @@
                case video = 3
                ///常见问题
                case qusition = 4
                case worldCup_top = 6
                case worldCup_bottom = 7
}
/// 登录类型
@@ -66,6 +70,7 @@
}
//【mark】注意与:/other/base/protocol/queryProtocol 混用了,注意区分或分开
enum AgreentType:Int {
                case user = 1
@@ -74,6 +79,7 @@
                case other = 4
                case matchStore = 5
                case useStore = 6
                case matchPoint = 7
                var titleStr:String{
                                switch self{
@@ -83,6 +89,7 @@
                                                case .matchStore:return "参与门店"
                                                case .other:return ""
                                                case .useStore:return "可用门店"
                                                case .matchPoint:return "参与赛点"
                                }
                }
}
WanPai/Network/NetworkRequest.swift
@@ -21,6 +21,11 @@
    var msg: String = ""
}
struct BaseResponseList<T :HandyJSON>: HandyJSON {
                var list: [T] = []
                var totalSession:Int = 0
}
struct BaseData<T: HandyJSON>: HandyJSON {
    var records = [T]()
}
WanPai/Network/Services.swift
@@ -1101,7 +1101,7 @@
                /// 获取参赛人员列表
                class func queryParticipantList(isAuth:Int? = nil)->Observable<BaseResponse<[ActivityDetailPartModel]>>{
                                var params = ParamsAppender.build(url: All_Url)
                                let params = ParamsAppender.build(url: All_Url)
                                                .interface(url: "competition/api/participant/queryParticipantList")
                                if isAuth == 1{
                                                params.append(key: "isPre", value: isAuth)
@@ -1258,8 +1258,122 @@
                                                .append(key: "sort", value: sort)
                                                .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string)
                                                .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string)
                                return NetworkRequest.request(params: params, method: .post, progress: false)
                }
                /// 裁判获取社区世界杯赛点列表【2.0】
                class func getWorldCupStore()->Observable<BaseResponse<[NormalSimpleModel]>>{
                                let params = ParamsAppender.build(url: All_Url)
                                                .interface(url: "/communityWorldCup/api/worldCup/getWorldCupStore")
                                return NetworkRequest.request(params: params, method: .post, progress: false)
                }
                /// 获取世界杯详情
                class func getWorldCupDetail(id:Int)->Observable<BaseResponse<WorldCupDetailModel>>{
                                let params = ParamsAppender.build(url: All_Url)
                                                .interface(url: "/communityWorldCup/api/worldCup/getWorldCupInfo")
                                                .append(key: "id", value: id)
                                                .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string)
                                                .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string)
                                return NetworkRequest.request(params: params, method: .post, progress: true)
                }
                class func worldCupPayment(id:Int,ids:String,payType:PayType,uid:Int?)->Observable<BaseResponse<PaymentModel>>{
                                let params = ParamsAppender.build(url: All_Url)
                                                .interface(url: "/communityWorldCup/api/worldCup/paymentWorldCup")
                                                .append(key: "id", value: id)
                                                .append(key: "ids", value: ids)
                                                .append(key: "payType", value: payType.rawValue)
                                                .append(key: "uid", value: uid)
                                return NetworkRequest.request(params: params, method: .post, progress: true)
                }
                /// 世界杯报名前校验支付方式
                class func worldCupPaymentCheck(id:Int,ids:String,uid:Int?)->Observable<BaseResponse<WorldCupPayStateModel>>{
                                let params = ParamsAppender.build(url: All_Url)
                                                .interface(url: "/communityWorldCup/api/worldCup/checkPaymentMethod")
                                                .append(key: "id", value: id)
                                                .append(key: "ids", value: ids)
                                                .append(key: "uid", value: uid)
                                return NetworkRequest.request(params: params, method: .post, progress: true)
                }
                class func worldCupJudgeList(content:String? = nil,storeId:Int? = nil)->Observable<BaseResponse<[WorldCupJudgeModel]>>{
                                let params = ParamsAppender.build(url: All_Url)
                                                .interface(url: "/communityWorldCup/api/worldCup/getWorldCupListCoach")
                                                .append(key: "content", value: content)
                                                .append(key: "storeId", value: storeId)
                                                .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string)
                                                .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string)
                                return NetworkRequest.request(params: params, method: .post, progress: true)
                }
                //获取已报名的参赛人员【2.0】
                class func getParticipant()->Observable<BaseResponse<[ActivityDetailPartModel]>>{
                                let params = ParamsAppender.build(url: All_Url)
                                                .interface(url: "/communityWorldCup/api/worldCup/getParticipant")
                                return NetworkRequest.request(params: params, method: .post, progress: true)
                }
                //获取报名的世界杯列表【2.0】
                class func getMyWorldCupList(id:Int,isStudent:Int,pageNo:Int,pageSize:Int = 20,appUserId:Int? = nil,state:SignupType? = nil)->Observable<BaseResponse<[WorldCupSourceModel]>>{
                                let params = ParamsAppender.build(url: All_Url)
                                                .interface(url: "/communityWorldCup/api/worldCup/getMyWorldCupList")
                                                .append(key: "id", value: id)
                                                .append(key: "isStudent", value: isStudent)
                                                .append(key: "pageNo", value: pageNo)
                                                .append(key: "pageSize", value: pageSize)
                                                .append(key: "appUserId", value: appUserId)
                                                .append(key: "state", value: state?.rawValue)
                                return NetworkRequest.request(params: params, method: .post, progress: false)
                }
                class func getEntrantRank(id:Int,isStudent:Int)->Observable<BaseResponse<WorldCupRankModel>>{
                                let params = ParamsAppender.build(url: All_Url)
                                                .interface(url: "/communityWorldCup/api/worldCup/getEntrantRank")
                                                .append(key: "id", value: id)
                                                .append(key: "isStudent", value: isStudent)
                                return NetworkRequest.request(params: params, method: .post, progress: false)
                }
                /// 获取报名的世界杯列表【2.0】
                /// - Parameters:
                ///   - state: 状态(1=未开始,2=进行中)
                class func getMyWorldCupList(id:Int,isStudent:Int,pageNo:Int,pageSize:Int = 20,state:Int)->Observable<BaseResponse<[WorldCupListModel]>>{
                                let params = ParamsAppender.build(url: All_Url)
                                                .interface(url: "/communityWorldCup/api/worldCup/getMyWorldCupList")
                                                .append(key: "id", value: id)
                                                .append(key: "isStudent", value: isStudent)
                                                .append(key: "pageNo", value: pageNo)
                                                .append(key: "pageSize", value: pageSize)
                                                .append(key: "state", value: state)
                                return NetworkRequest.request(params: params, method: .post, progress: false)
                }
                /// 获取已报名世界杯详情【2.0】
                class func getMyWorldCupInfo(id:Int)->Observable<BaseResponse<WorldCupDetailModel>>{
                                let params = ParamsAppender.build(url: All_Url)
                                                .interface(url: "/communityWorldCup/api/worldCup/getMyWorldCupInfo")
                                                .append(key: "id", value: id)
                                                .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string)
                                                .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string)
                                return NetworkRequest.request(params: params, method: .post, progress: true)
                }
                /// 获取比赛记录【2.0】
                class func getWorldCupMatchRecord(id:Int,isStudent:Int,pageNo:Int,pageSize:Int = 20)->Observable<BaseResponse<BaseResponseList<WorldCupMatchRecordDataModel>>>{
                                let params = ParamsAppender.build(url: All_Url)
                                                .interface(url: "/communityWorldCup/api/worldCup/getWorldCupMatchRecord")
                                                .append(key: "id", value: id)
                                                .append(key: "isStudent", value: isStudent)
                                                .append(key: "pageNo", value: pageNo)
                                                .append(key: "pageSize", value: pageSize)
                                return NetworkRequest.request(params: params, method: .post, progress: false)
                }
}
extension Services{
WanPai/Root/Activity/VC/ActivityStudentListVC.swift
@@ -13,74 +13,74 @@
import HandyJSON
class ActivityStudentViewModel:RefreshModel<ActivityDetailPartModel>{
    override func api() -> (Observable<BaseResponse<[ActivityDetailPartModel]>>)? {
        return Services.queryParticipantList()
    }
                override func api() -> (Observable<BaseResponse<[ActivityDetailPartModel]>>)? {
                                return Services.queryParticipantList()
                }
}
class ActivityStudentListVC: BaseVC {
    @IBOutlet weak var btn_addStudent: QMUIButton!
    @IBOutlet weak var tableView: BaseTableView!
    private var viewModel = ActivityStudentViewModel()
                @IBOutlet weak var btn_addStudent: QMUIButton!
                @IBOutlet weak var tableView: BaseTableView!
                private var viewModel = ActivityStudentViewModel()
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "选择人员"
        viewModel.configure(tableView,needMore: false)
        viewModel.beginRefresh()
    }
    override func setUI() {
        btn_addStudent.imagePosition = .right
        btn_addStudent.spacingBetweenImageAndTitle = 4
        tableView.delegate = self
        tableView.dataSource = self
        tableView.separatorStyle = .none
        tableView.register(UINib(nibName: "StudentInfo_2_TCell", bundle: nil), forCellReuseIdentifier: "_StudentInfo_2_TCell")
//        tableView.jq_setEmptyView("暂无活动人员")
    }
                override func viewDidLoad() {
                                super.viewDidLoad()
                                title = "选择人员"
                                viewModel.configure(tableView,needMore: false)
                                viewModel.beginRefresh()
                }
    override func setRx() {
        NotificationCenter.default.rx.notification(StudentUpdate_Nofi).take(until: self.rx.deallocated).subscribe(onNext: {[weak self] noti in
            self?.viewModel.beginRefresh()
        }).disposed(by: disposeBag)
    }
    @IBAction func addStudentAction(_ sender: Any) {
        let vc = AddStudentVC(type: .activity)
        push(vc: vc)
    }
                override func setUI() {
                                btn_addStudent.imagePosition = .right
                                btn_addStudent.spacingBetweenImageAndTitle = 4
                                tableView.delegate = self
                                tableView.dataSource = self
                                tableView.separatorStyle = .none
                                tableView.register(UINib(nibName: "StudentInfo_2_TCell", bundle: nil), forCellReuseIdentifier: "_StudentInfo_2_TCell")
                                //        tableView.jq_setEmptyView("暂无活动人员")
                }
                override func setRx() {
                                NotificationCenter.default.rx.notification(StudentUpdate_Nofi).take(until: self.rx.deallocated).subscribe(onNext: {[weak self] noti in
                                                self?.viewModel.beginRefresh()
                                }).disposed(by: disposeBag)
                }
                @IBAction func addStudentAction(_ sender: Any) {
                                let vc = AddStudentVC(type: .activity)
                                push(vc: vc)
                }
}
extension ActivityStudentListVC:UITableViewDelegate{
}
extension ActivityStudentListVC:UITableViewDataSource{
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "_StudentInfo_2_TCell") as! StudentInfo_2_TCell
        cell.indexPath = indexPath
        cell.img_radio.isHidden = true
        cell.activityDetailPartModel = viewModel.dataSource.value[indexPath.row]
        cell.btn_verifiy.isHidden = !viewModel.dataSource.value[indexPath.row].idcard.isEmpty
        cell.btn_delete.isHidden = viewModel.dataSource.value[indexPath.row].isStudent == 1
        cell.delClouse = {index in
            CommonAlertView.show(title: "提示", content: "确认删除当前人员吗?") { [weak self] status in
                guard let weakSelf = self else { return }
                if status{
                    let m = weakSelf.viewModel.dataSource.value[index.row]
                    Services.deleParticipant(id: m.id).subscribe(onNext: { data in
                        weakSelf.viewModel.beginRefresh()
                    }).disposed(by: weakSelf.disposeBag)
                }
            }
        }
        return cell
    }
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return viewModel.dataSource.value.count
    }
                func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
                                let cell = tableView.dequeueReusableCell(withIdentifier: "_StudentInfo_2_TCell") as! StudentInfo_2_TCell
                                cell.indexPath = indexPath
                                cell.img_radio.isHidden = true
                                cell.activityDetailPartModel = viewModel.dataSource.value[indexPath.row]
                                cell.btn_verifiy.isHidden = !viewModel.dataSource.value[indexPath.row].idcard.isEmpty
                                cell.btn_delete.isHidden = viewModel.dataSource.value[indexPath.row].isStudent == 1
                                cell.delClouse = {index in
                                                CommonAlertView.show(title: "提示", content: "确认删除当前人员吗?") { [weak self] status in
                                                                guard let weakSelf = self else { return }
                                                                if status{
                                                                                let m = weakSelf.viewModel.dataSource.value[index.row]
                                                                                Services.deleParticipant(id: m.id).subscribe(onNext: { data in
                                                                                                weakSelf.viewModel.beginRefresh()
                                                                                }).disposed(by: weakSelf.disposeBag)
                                                                }
                                                }
                                }
                                return cell
                }
                func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
                                return viewModel.dataSource.value.count
                }
}
WanPai/Root/Activity/View/StoresInfoView.swift
@@ -10,98 +10,115 @@
import QMUIKit
class StoresInfoView: UIView,JQNibView{
    @IBOutlet weak var label_topTitle: UILabel!
    @IBOutlet weak var view_container: UIView!
    @IBOutlet weak var img_logo: UIImageView!
    @IBOutlet weak var label_title: UILabel!
    @IBOutlet weak var label_address: UILabel!
    @IBOutlet weak var label_distance: UILabel!
    @IBOutlet weak var btn_exchange: QMUIButton!
    private var clouse:((Bool)->Void)!
    override func awakeFromNib() {
        super.awakeFromNib()
        view_container.transform = .init(scaleX: 0.1, y: 0.1)
        alpha = 0
        layoutIfNeeded()
        btn_exchange.imagePosition = .top
        btn_exchange.spacingBetweenImageAndTitle = 8
    }
    static func show(_ detailModel:CourseDetailModel,clouse:@escaping (Bool)->Void){
        let storesView = StoresInfoView.jq_loadNibView()
        storesView.frame = sceneDelegate?.window?.frame ?? .zero
        storesView.label_topTitle.text = "请报名预约门店"
        storesView.img_logo.sd_setImage(with: URL(string: detailModel.storeCoverDrawing))
        storesView.label_title.text = detailModel.storeName
        storesView.label_address.text = detailModel.storeAddress
        storesView.label_distance.text = String(format: "距你%.2lfkm", detailModel.distance)
        storesView.clouse = clouse
        sceneDelegate?.window?.addSubview(storesView)
                @IBOutlet weak var label_topTitle: UILabel!
                @IBOutlet weak var view_container: UIView!
                @IBOutlet weak var img_logo: UIImageView!
                @IBOutlet weak var label_title: UILabel!
                @IBOutlet weak var label_address: UILabel!
                @IBOutlet weak var label_distance: UILabel!
                @IBOutlet weak var btn_exchange: QMUIButton!
        UIView.animate(withDuration: 0.4) {
            storesView.view_container.transform = CGAffineTransform(scaleX: 1.0, y: 1.0)
            storesView.alpha = 1
        }
    }
                private var clouse:((Bool)->Void)!
    static func show(_ activityModel:ActivityDetailStoreModel,clouse:@escaping (Bool)->Void){
        let storesView = StoresInfoView.jq_loadNibView()
        storesView.frame = sceneDelegate?.window?.frame ?? .zero
        storesView.label_topTitle.text = "请确认预约门店"
        storesView.img_logo.sd_setImage(with: URL(string: activityModel.storeCoverDrawing))
        storesView.label_title.text = activityModel.name
        storesView.label_address.text = activityModel.address
        storesView.label_distance.text = String(format: "距你%.2lfkm", activityModel.distance)
        storesView.clouse = clouse
        sceneDelegate?.window?.addSubview(storesView)
                override func awakeFromNib() {
                                super.awakeFromNib()
                                view_container.transform = .init(scaleX: 0.1, y: 0.1)
                                alpha = 0
                                layoutIfNeeded()
                                btn_exchange.imagePosition = .top
                                btn_exchange.spacingBetweenImageAndTitle = 8
                }
        UIView.animate(withDuration: 0.4) {
            storesView.view_container.transform = CGAffineTransform(scaleX: 1.0, y: 1.0)
            storesView.alpha = 1
        }
    }
                static func show(_ detailModel:CourseDetailModel,clouse:@escaping (Bool)->Void){
                                let storesView = StoresInfoView.jq_loadNibView()
                                storesView.frame = sceneDelegate?.window?.frame ?? .zero
                                storesView.label_topTitle.text = "请报名预约门店"
                                storesView.img_logo.sd_setImage(with: URL(string: detailModel.storeCoverDrawing))
                                storesView.label_title.text = detailModel.storeName
                                storesView.label_address.text = detailModel.storeAddress
                                storesView.label_distance.text = String(format: "距你%.2lfkm", detailModel.distance)
                                storesView.clouse = clouse
                                sceneDelegate?.window?.addSubview(storesView)
    static func show(_ siteDetailModel:SiteDetailModel,clouse:@escaping (Bool)->Void){
        let storesView = StoresInfoView.jq_loadNibView()
        storesView.frame = sceneDelegate?.window?.frame ?? .zero
                                UIView.animate(withDuration: 0.4) {
                                                storesView.view_container.transform = CGAffineTransform(scaleX: 1.0, y: 1.0)
                                                storesView.alpha = 1
                                }
                }
        storesView.img_logo.sd_setImage(with: URL(string: siteDetailModel.storeCoverDrawing))
        storesView.label_title.text = siteDetailModel.storeName
        storesView.label_address.text = siteDetailModel.storeAddress
        storesView.label_distance.text = String(format: "距你%.2lfkm", siteDetailModel.distance)
        storesView.clouse = clouse
        sceneDelegate?.window?.addSubview(storesView)
                static func show(_ activityModel:ActivityDetailStoreModel,clouse:@escaping (Bool)->Void){
                                let storesView = StoresInfoView.jq_loadNibView()
                                storesView.frame = sceneDelegate?.window?.frame ?? .zero
                                storesView.label_topTitle.text = "请确认预约门店"
                                storesView.img_logo.sd_setImage(with: URL(string: activityModel.storeCoverDrawing))
                                storesView.label_title.text = activityModel.name
                                storesView.label_address.text = activityModel.address
                                storesView.label_distance.text = String(format: "距你%.2lfkm", activityModel.distance)
                                storesView.clouse = clouse
                                sceneDelegate?.window?.addSubview(storesView)
        UIView.animate(withDuration: 0.4) {
            storesView.view_container.transform = CGAffineTransform(scaleX: 1.0, y: 1.0)
            storesView.alpha = 1
        }
    }
                                UIView.animate(withDuration: 0.4) {
                                                storesView.view_container.transform = CGAffineTransform(scaleX: 1.0, y: 1.0)
                                                storesView.alpha = 1
                                }
                }
    @IBAction func cancelAction(_ sender: UIButton) {
        close()
    }
                static func show(_ siteDetailModel:SiteDetailModel,clouse:@escaping (Bool)->Void){
                                let storesView = StoresInfoView.jq_loadNibView()
                                storesView.frame = sceneDelegate?.window?.frame ?? .zero
                                storesView.img_logo.sd_setImage(with: URL(string: siteDetailModel.storeCoverDrawing))
                                storesView.label_title.text = siteDetailModel.storeName
                                storesView.label_address.text = siteDetailModel.storeAddress
                                storesView.label_distance.text = String(format: "距你%.2lfkm", siteDetailModel.distance)
                                storesView.clouse = clouse
                                sceneDelegate?.window?.addSubview(storesView)
                                UIView.animate(withDuration: 0.4) {
                                                storesView.view_container.transform = CGAffineTransform(scaleX: 1.0, y: 1.0)
                                                storesView.alpha = 1
                                }
                }
                static func show(model:ActivityDetailStoreModel,clouse:@escaping (Bool)->Void){
                                let storesView = StoresInfoView.jq_loadNibView()
                                storesView.frame = sceneDelegate?.window?.frame ?? .zero
                                storesView.label_topTitle.text = "请确认参与赛点"
                                storesView.img_logo.sd_setImage(with: URL(string: model.storeCoverDrawing))
                                storesView.label_title.text = model.name
                                storesView.label_address.text = model.address
                                storesView.label_distance.text = String(format: "距你%.2lfkm", model.distance)
                                storesView.clouse = clouse
                                sceneDelegate?.window?.addSubview(storesView)
                                UIView.animate(withDuration: 0.4) {
                                                storesView.view_container.transform = CGAffineTransform(scaleX: 1.0, y: 1.0)
                                                storesView.alpha = 1
                                }
                }
    @IBAction func exchangeAction(_ sender: UIButton) {
        close()
        clouse(false)
    }
    @IBAction func completeAction(_ sender: UIButton) {
        close()
        clouse(true)
    }
    private func close(){
        UIView.animate(withDuration: 0.4) {
            self.view_container.transform = .init(scaleX: 0.1, y: 0.1)
            self.alpha = 0
        } completion: { _ in
            self.removeFromSuperview()
        }
    }
                @IBAction func cancelAction(_ sender: UIButton) {
                                close()
                }
                @IBAction func exchangeAction(_ sender: UIButton) {
                                close()
                                clouse(false)
                }
                @IBAction func completeAction(_ sender: UIButton) {
                                close()
                                clouse(true)
                }
                private func close(){
                                UIView.animate(withDuration: 0.4) {
                                                self.view_container.transform = .init(scaleX: 0.1, y: 0.1)
                                                self.alpha = 0
                                } completion: { _ in
                                                self.removeFromSuperview()
                                }
                }
}
WanPai/Root/Course/VC/CourseDetailApplyVC.swift
@@ -1,9 +1,9 @@
    //
    //  CourseDetailApplyVC.swift
    //  WanPai
    //
    //  Created by 杨锴 on 2023/6/9.
    //
//
//  CourseDetailApplyVC.swift
//  WanPai
//
//  Created by 杨锴 on 2023/6/9.
//
import UIKit
import JQTools
@@ -11,557 +11,550 @@
class CourseDetailApplyVC: BaseVC {
    @IBOutlet weak var collectionView: UICollectionView!
    @IBOutlet weak var cons_collectHei: NSLayoutConstraint!
    @IBOutlet weak var btn_addStudent: QMUIButton!
    @IBOutlet weak var tableView: UITableView!
    @IBOutlet weak var cons_collHei: NSLayoutConstraint!
    @IBOutlet weak var cons_tableHei: NSLayoutConstraint!
    @IBOutlet weak var btn_coupon: TapBtn!
                @IBOutlet weak var collectionView: UICollectionView!
                @IBOutlet weak var cons_collectHei: NSLayoutConstraint!
                @IBOutlet weak var btn_addStudent: QMUIButton!
                @IBOutlet weak var tableView: UITableView!
                @IBOutlet weak var cons_collHei: NSLayoutConstraint!
                @IBOutlet weak var cons_tableHei: NSLayoutConstraint!
                @IBOutlet weak var btn_coupon: TapBtn!
    @IBOutlet weak var view_banner: CommonBannerView!
    @IBOutlet weak var label_title: UILabel!
    @IBOutlet weak var label_listenWeek: UILabel!
    @IBOutlet weak var label_listenTime: UILabel!
    @IBOutlet weak var label_store: UILabel!
    @IBOutlet weak var label_address: UILabel!
                @IBOutlet weak var view_banner: CommonBannerView!
                @IBOutlet weak var label_title: UILabel!
                @IBOutlet weak var label_listenWeek: UILabel!
                @IBOutlet weak var label_listenTime: UILabel!
                @IBOutlet weak var label_store: UILabel!
                @IBOutlet weak var label_address: UILabel!
    @IBOutlet weak var label_price: UILabel!
    @IBOutlet weak var label_originPrice: UILabel!
    @IBOutlet weak var label_vipPrice: UILabel!
    @IBOutlet weak var label_coin: UILabel!
//    @IBOutlet weak var btn_hasCoupon: TapBtn!
    @IBOutlet weak var btn_couponInfo: UIButton!
    @IBOutlet weak var label_courseType: UILabel!
                @IBOutlet weak var label_price: UILabel!
                @IBOutlet weak var label_originPrice: UILabel!
                @IBOutlet weak var label_vipPrice: UILabel!
                @IBOutlet weak var label_coin: UILabel!
                //    @IBOutlet weak var btn_hasCoupon: TapBtn!
                @IBOutlet weak var btn_couponInfo: UIButton!
                @IBOutlet weak var label_courseType: UILabel!
    @IBOutlet weak var view_vaildTime: UIView!
    @IBOutlet weak var label_vaild: UILabel!
    @IBOutlet weak var studentTableView: UITableView!
    @IBOutlet weak var view_packageList: UIView!
    @IBOutlet weak var btn_handleBtn: UIButton!
    @IBOutlet weak var view_teach: UIView!
    @IBOutlet weak var label_couponInfo: UILabel!
    private var detailModel:CourseDetailModel?
    private var selectClassIndex:Int = 0
    private var CellW:Double!
    private var CellH:Double!
    private var studentModels = [CourseDetailStudentModel]()
    private var couponModels = [CouponInfoModel]()
    private var selectCouponModel:CouponInfoModel?
    private var classHours:Int?
//    private var signUpCourseModel:SignUpCourseItemModel?
    private var signUpModel:SignUpCourseItemDetailModel?
                @IBOutlet weak var view_vaildTime: UIView!
                @IBOutlet weak var label_vaild: UILabel!
                @IBOutlet weak var studentTableView: UITableView!
                @IBOutlet weak var view_packageList: UIView!
                @IBOutlet weak var btn_handleBtn: UIButton!
                @IBOutlet weak var view_teach: UIView!
                @IBOutlet weak var label_couponInfo: UILabel!
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "运动营详情"
                private var detailModel:CourseDetailModel?
                private var selectClassIndex:Int = 0
                private var CellW:Double!
                private var CellH:Double!
                private var studentModels = [CourseDetailStudentModel]()
                private var couponModels = [CouponInfoModel]()
                private var selectCouponModel:CouponInfoModel?
                private var classHours:Int?
                //    private var signUpCourseModel:SignUpCourseItemModel?
                private var signUpModel:SignUpCourseItemDetailModel?
        if let m = detailModel{
            label_title.text = m.name
            label_listenWeek.text = "每" + m.weeks.joined(separator: "、")
            label_listenTime.text = m.times.joined(separator: "|")
            label_store.text = m.storeName
            label_address.text = m.storeAddress
            label_vaild.text = m.time
            label_courseType.text = m.type.strTitle
                override func viewDidLoad() {
                                super.viewDidLoad()
                                title = "运动营详情"
            if classHours != nil{
                let temp = detailModel?.list.filter({$0.classHours == classHours!}) ?? []
                detailModel?.list = temp
            }
                                if let m = detailModel{
                                                label_title.text = m.name
                                                label_listenWeek.text = "每" + m.weeks.joined(separator: "、")
                                                label_listenTime.text = m.times.joined(separator: "|")
                                                label_store.text = m.storeName
                                                label_address.text = m.storeAddress
                                                label_vaild.text = m.time
                                                label_courseType.text = m.type.strTitle
//            //默认选择传递过来的课时数
//            for (index,clas) in m.list.enumerated(){
//                if clas.classHours == classHours{
//                    selectClassIndex = index;break
//                }
//            }
                                                if classHours != nil{
                                                                let temp = detailModel?.list.filter({$0.classHours == classHours!}) ?? []
                                                                detailModel?.list = temp
                                                }
            switch m.type {
                case .vocation:
                    label_vaild.text = m.time
                    view_vaildTime.isHidden = false
                    view_packageList.isHidden = true
                case .experience:
                    label_vaild.text = "购买当天有效"
                    view_vaildTime.isHidden = false
                    view_packageList.isHidden = true
                default:
                    view_vaildTime.isHidden = true
            }
                                                switch m.type {
                                                                case .vocation:
                                                                                label_vaild.text = m.time
                                                                                view_vaildTime.isHidden = false
                                                                                view_packageList.isHidden = true
                                                                case .experience:
                                                                                label_vaild.text = "购买当天有效"
                                                                                view_vaildTime.isHidden = false
                                                                                view_packageList.isHidden = true
                                                                default:
                                                                                view_vaildTime.isHidden = true
                                                }
            if m.student?.id != 0{
                studentModels.append(m.student!)
            }
                                                if m.student?.id != 0{
                                                                studentModels.append(m.student!)
                                                }
            cons_collHei.constant = ceil(Double(m.list.count) / 3.0) * CellH + floor(Double(m.list.count) / 3.0) * 21.0
            collectionView.reloadData()
                                                cons_collHei.constant = ceil(Double(m.list.count) / 3.0) * CellH + floor(Double(m.list.count) / 3.0) * 21.0
                                                collectionView.reloadData()
            cons_tableHei.constant = CGFloat(studentModels.count * 87)
            tableView.reloadData()
                                                cons_tableHei.constant = CGFloat(studentModels.count * 87)
                                                tableView.reloadData()
            let imgs = m.detailDrawing.components(separatedBy: ",")
            var items = [CommonBannerModel]()
            for (index,img) in imgs.enumerated(){
                items.append(CommonBannerModel(index: index,resource: img,mediaType: .imageUrl))
            }
            view_banner.setItems(items: items)
        }
        if let m = signUpModel{
            classHours = m.chooseHours
            detailModel?.list = m.list.filter({$0.classHours == classHours})
            if m.payStatus == .unPayment{
                btn_handleBtn.setTitle("待支付", for: .normal)
                btn_addStudent.isHidden = true
                btn_coupon.isHidden = true
                studentModels.removeAll()
                Services.queryStudentList().subscribe(onNext: {[weak self] data in
                    guard let weakSelf = self else { return }
                    if let students = data.data{
                        for stu in students{
                            if m.stuIds.contains(where: {$0 == stu.id}){
                                weakSelf.studentModels.append(stu)
                                weakSelf.cons_tableHei.constant = CGFloat(weakSelf.studentModels.count * 87)
                                weakSelf.tableView.reloadData()
                            }
                        }
                    }
                }).disposed(by: disposeBag)
            }
            if m.payStatus == .paymented{
                btn_handleBtn.setTitle("续课", for: .normal)
                btn_addStudent.isHidden = true
            }
        }
        queryCouponInfo {[weak self] () in
            guard let weakSelf = self else { return }
            self?.changePrice(weakSelf.selectClassIndex)
        }
    }
    override func setUI() {
        btn_coupon.isHidden = true
        CellW = (JQ_ScreenW - 155) / 3.0
        CellH = CellW * 0.439
        cons_tableHei.constant = 76
        collectionView.delegate = self
        collectionView.dataSource = self
        collectionView.register(UINib(nibName: "Common_1_CCell", bundle: nil), forCellWithReuseIdentifier: "_Common_1_CCell")
        studentTableView.dataSource = self
        studentTableView.separatorStyle = .none
        studentTableView.register(UINib(nibName: "StudentInfoTCell", bundle: nil), forCellReuseIdentifier: "_StudentInfoTCell")
        btn_addStudent.imagePosition = .right
        btn_addStudent.spacingBetweenImageAndTitle = 3
    }
    init(detailModel:CourseDetailModel,signUpModel:SignUpCourseItemDetailModel? = nil,classHours:Int? = nil) {
        super.init(nibName: nil, bundle: nil)
        self.detailModel = detailModel
        self.signUpModel = signUpModel
        self.classHours = classHours
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func setRx() {
        NotificationCenter.default.rx.notification(StudentUpdate_Nofi).take(until: self.rx.deallocated).subscribe {[weak self] noti in
            guard let weakSelf = self else { return }
                //重新唤起添加学生
            weakSelf.studentAction(weakSelf.btn_addStudent)
        }.disposed(by: disposeBag)
        NotificationCenter.default.rx.notification(UIApplication.didBecomeActiveNotification).take(until: self.rx.deallocated).subscribe(onNext: {[weak self] noti in
            self?.selectCouponModel = nil
            self?.btn_couponInfo.setTitle("去选择", for: .normal)
            self?.queryCouponInfo {[weak self] () in
                guard let weakSelf = self else { return }
                weakSelf.changePrice(weakSelf.selectClassIndex)
            }
        }).disposed(by: disposeBag)
    }
    @IBAction func couponAction(_ sender: TapBtn) {
        CouponChooseView.show(couponModels,defaultModel: selectCouponModel) {[weak self] m in
            guard let weakSelf = self else { return }
            weakSelf.selectCouponModel = m
            guard m != nil else {
                weakSelf.btn_couponInfo.setTitle("去选择", for: .normal);return
            }
            weakSelf.btn_couponInfo.setTitle("-\(m!.favorable.currency())", for: .normal)
            weakSelf.changePrice(weakSelf.selectClassIndex)
        }
    }
    @IBAction func studentAction(_ sender: QMUIButton) {
        StudentChooseView.show(itemType: .course, defaultStu: studentModels) { [weak self] studs in
            guard let weakSelf = self else { return }
            weakSelf.studentModels = studs as! [CourseDetailStudentModel]
            weakSelf.tableView.reloadData()
            weakSelf.cons_tableHei.constant = CGFloat((weakSelf.studentModels.count) * 87)
            weakSelf.changePrice(weakSelf.selectClassIndex)
        } needAddClouse: { [weak self] () in
            let vc = AddStudentVC(type: .course)
            self?.push(vc: vc)
        }
    }
    @IBAction func paymentAction(_ sender: UIButton) {
        guard detailModel != nil else {return}
        guard studentModels.count != 0 else {alertError(msg: "请选择运动营成员");return}
        StoresInfoView.show(detailModel!) { [weak self] status in
            guard let weakSelf = self else { return }
            if status{
                if var model = weakSelf.detailModel?.list[weakSelf.selectClassIndex]{
                    //续课时价格
                    if let list = weakSelf.signUpModel?.list{
                        model = list[weakSelf.selectClassIndex]
                    }
                    var price:Double = 0
                        //是否是会员
                    if weakSelf.detailModel?.isVip == 1 && model.vipPrice != 0{
                        price = model.vipPrice
                    }else{
                        price = model.paymentPrice
                    }
                    //计算人数总价
                    price = price * Double(weakSelf.studentModels.count)
                    //减去优惠
                    var discountPrice = price - (weakSelf.selectCouponModel?.favorable ?? 0)
                    var coin = model.playPaiCoin * weakSelf.studentModels.count
                    //待支付订单 ,取最终订单金额
                    if weakSelf.signUpModel?.payStatus == .unPayment{
                        discountPrice = weakSelf.signUpModel?.payPrice ?? 0
                        coin = weakSelf.signUpModel?.coinPrice ?? 0
                    }
                    PaymentView.show(enumType: .course, money: (ali:discountPrice,wx:discountPrice,coin:coin,course:nil,integral:nil)) { [weak self] payType in
                        guard let weakSelf = self else { return }
                        var resultPayPrice:Double = 0
                        switch payType {
                            case .aliPay,.wechat:
                                resultPayPrice = price
                                //待支付订单单独处理
                                if weakSelf.signUpModel?.payStatus == .unPayment{
                                    resultPayPrice = weakSelf.signUpModel?.payPrice ?? 0
                                                let imgs = m.detailDrawing.components(separatedBy: ",")
                                                var items = [CommonBannerModel]()
                                                for (index,img) in imgs.enumerated(){
                                                                items.append(CommonBannerModel(index: index,resource: img,mediaType: .imageUrl))
                                                }
                                                view_banner.setItems(items: items)
                                }
                            case .coin:
                                resultPayPrice = Double(coin)
                            default:break
                        }
                                if let m = signUpModel{
                                                classHours = m.chooseHours
                                                detailModel?.list = m.list.filter({$0.classHours == classHours})
                        Services.courcePayment(conponId: weakSelf.selectCouponModel?.id, courseConfigId: model.id, id: weakSelf.detailModel!.id, price: resultPayPrice, payType: payType, stuId: weakSelf.studentModels.map({$0.id}),orderId: weakSelf.signUpModel?.coursePayId).subscribe(onNext: { data in
                            if data.code == 200{
                                switch payType {
                                    case .aliPay:
                                        YYPaymentManager.shared.sendPaymentRequest(YYAlipayRequest(orderString: data.data!.orderString)) { [weak self] result in
                                            switch result {
                                                case .success:
                                                    let vc = PaymentResultVC(result: .success, objType: .courseApply,handleVC: self,courseConfigId: model.id)
                                                    vc.isExtend = self?.signUpModel?.payStatus == .paymented
                                                    self?.push(vc: vc)
                                                case .cancel:
                                                    alert(msg: "已取消")
                                                case .failure(_):
                                                    let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .courseApply)
                                                    self?.push(vc: vc)
                                            }
                                        }
                                    case .wechat:
                                        self?.navigationController?.popViewController(animated: false)
                                        break
                                    case .coin:
                                        let vc = PaymentResultVC(result: .success, objType: .courseApply,handleVC: self,courseConfigId: model.id)
                                        vc.isExtend = self?.signUpModel?.payStatus == .paymented
                                        self?.push(vc: vc)
                                    default:break
                                                if m.payStatus == .unPayment{
                                                                btn_handleBtn.setTitle("待支付", for: .normal)
                                                                btn_addStudent.isHidden = true
                                                                btn_coupon.isHidden = true
                                                                studentModels.removeAll()
                                                                Services.queryStudentList().subscribe(onNext: {[weak self] data in
                                                                                guard let weakSelf = self else { return }
                                                                                if let students = data.data{
                                                                                                for stu in students{
                                                                                                                if m.stuIds.contains(where: {$0 == stu.id}){
                                                                                                                                weakSelf.studentModels.append(stu)
                                                                                                                                weakSelf.cons_tableHei.constant = CGFloat(weakSelf.studentModels.count * 87)
                                                                                                                                weakSelf.tableView.reloadData()
                                                                                                                }
                                                                                                }
                                                                                }
                                                                }).disposed(by: disposeBag)
                                                }
                                                if m.payStatus == .paymented{
                                                                btn_handleBtn.setTitle("续课", for: .normal)
                                                                btn_addStudent.isHidden = true
                                                }
                                }
                            }else{
                                alertError(msg: data.msg)
                            }
                        },onError: { error in
                            if let er = error as? NetworkRequest.NetRequestError{
                                switch er {
                                    case .Other(let code,let string):
                                        let vc = PaymentResultVC(result: .fail(string,code), objType: .courseApply,handleVC: nil)
                                        self?.push(vc: vc)
                                    default:
                                        let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .courseApply,handleVC: nil)
                                        self?.push(vc: vc)
                                queryCouponInfo {[weak self] () in
                                                guard let weakSelf = self else { return }
                                                self?.changePrice(weakSelf.selectClassIndex)
                                }
                            }
                        }).disposed(by: weakSelf.disposeBag)
                    }
                }
            }else{
                self?.navigationController?.popToRootViewController(animated: true)
                NotificationCenter.default.post(name: ChooseHomeStore_Noti, object: nil)
            }
        }
    }
        //计算价格
    private func changePrice(_ index:Int){
        //待支付订单,终止后续
        if signUpModel?.payStatus == .unPayment{
            label_price.isHidden = true
            label_originPrice.isHidden = signUpModel!.payPrice == signUpModel!.orinPrice
            label_vipPrice.isHidden = true
            label_coin.isHidden = true
            let originPrice = signUpModel!.orinPrice - signUpModel!.payPrice
            label_originPrice.attributedText = AttributedStringbuilder.build().add(string: originPrice.currency(), withFont: UIFont.systemFont(ofSize: 16, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58)).delLine(color: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58)).mutableAttributedString
            if signUpModel?.coinPrice != 0{
                label_coin.isHidden = false
                label_coin.attributedText = AttributedStringbuilder.build()
                    .add(string: "玩湃币:", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F"))
                    .add(string: "\(signUpModel!.coinPrice)币", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313")).mutableAttributedString
            }
            if signUpModel?.payPrice != 0{
                label_price.isHidden = false
                label_price.text = (signUpModel!.payPrice).currency()
            }
            return
        }
        if let subM = detailModel?.list[index]{
            var studentCount:Int = 0
            if studentModels.count == 0{
                studentCount = 1
            }else{
                studentCount = studentModels.count
            }
            switch subM.payType {
                case .coin:
                    label_price.text = ""
                    label_price.isHidden = true
                    label_originPrice.isHidden = true
                    label_vipPrice.isHidden = true
                    label_coin.isHidden = false
                        //纯玩湃币没有优惠券项
                    btn_coupon.isHidden = true
                    label_coin.isHidden = false
                        //玩湃币
                    label_coin.attributedText = AttributedStringbuilder.build()
                        .add(string: "玩湃币:", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F"))
                        .add(string: "\(subM.playPaiCoin * studentCount)币", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313")).mutableAttributedString
                case .cash:
                    fallthrough
                case .cashCoin:
                    if subM.originalPrice == 0 || subM.originalPrice == subM.paymentPrice{
                        label_originPrice.isHidden = true
                    }else{
                        label_originPrice.isHidden = false
                    }
                        //                    label_originPrice.isHidden = (subM.paymentPrice == subM.originalPrice && subM.paymentPrice != 0 && subM.originalPrice != 0)
                    label_coin.isHidden = subM.payType == .cash
                        //玩湃币
                    label_coin.attributedText = AttributedStringbuilder.build()
                        .add(string: "玩湃币:", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F"))
                        .add(string: "\(subM.playPaiCoin * studentCount)币", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313")).mutableAttributedString
                        //原价
                    let attribute = AttributedStringbuilder.build().add(string: (subM.originalPrice * Double(studentCount)).currency(), withFont: UIFont.systemFont(ofSize: 16, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58)).delLine(color: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58))
                    label_originPrice.attributedText = attribute.mutableAttributedString
                    if UserInfoModel.get()?.isVip == 1{
                        if subM.payType != .coin{
                                //会员
                            label_vipPrice.isHidden = true
                            if subM.paymentPrice < subM.vipPrice && subM.paymentPrice != 0{
                                label_price.text = (subM.paymentPrice *  Double(studentCount) - (selectCouponModel?.favorable ?? 0)).currency()
                            }else if subM.vipPrice < subM.paymentPrice && subM.vipPrice != 0{
                                label_price.text = (subM.vipPrice *  Double(studentCount) - (selectCouponModel?.favorable ?? 0)).currency()
                            }else if subM.vipPrice != 0 &&  subM.paymentPrice != 0{
                                let price = min(subM.vipPrice, subM.paymentPrice)
                                label_price.text = (price *  Double(studentCount) - (selectCouponModel?.favorable ?? 0)).currency()
                            }else{
                                label_price.text = (subM.paymentPrice *  Double(studentCount) - (selectCouponModel?.favorable ?? 0)).currency()
                            }
                        }
                    }else{
                        if subM.payType != .coin{
                                //非会员
                            label_vipPrice.isHidden = subM.vipPrice == 0 || subM.vipPrice == subM.paymentPrice
                            let vipAttribute = AttributedStringbuilder.build()
                                .add(string: "会员价:", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F"))
                                .add(string: (subM.vipPrice *  Double(studentCount)).currency(), withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313"))
                            label_vipPrice.attributedText = vipAttribute.mutableAttributedString
                            if subM.originalPrice != 0 && subM.paymentPrice == 0{
                                label_price.text = (subM.originalPrice *  Double(studentCount) - (selectCouponModel?.favorable ?? 0)).currency()
                            }else if subM.originalPrice == 0 && subM.paymentPrice != 0{
                                label_price.text = (subM.paymentPrice *  Double(studentCount) - (selectCouponModel?.favorable ?? 0)).currency()
                            }else if subM.originalPrice != 0 && subM.paymentPrice != 0{
                                var money = min(subM.originalPrice,subM.paymentPrice)
                                money = money - (selectCouponModel?.favorable ?? 0)
                                label_price.text = (money *  Double(studentCount)).currency()
                            }else{
                                label_price.text = (subM.originalPrice *  Double(studentCount) - (selectCouponModel?.favorable ?? 0)).currency()
                            }
                        }
                    }
            }
            if detailModel?.type == .experience{
                if subM.paymentPrice != 0{
                    label_price.text = subM.paymentPrice.currency()
                    label_price.isHidden = false
                }
                view_teach.isHidden = true
                label_originPrice.isHidden = true
                label_vipPrice.isHidden = true
            }
                override func setUI() {
                //            if label_originPrice.isHidden && label_vipPrice.isHidden && label_coin.isHidden{
                //                label_coin.alpha = 0
                //            }
        }
    }
                                btn_coupon.isHidden = true
                                CellW = (JQ_ScreenW - 155) / 3.0
                                CellH = CellW * 0.439
        //查询优惠券
    private func queryCouponInfo(complete:(()->Void)? = nil){
        if let subM = detailModel?.list[selectClassIndex]{
                                cons_tableHei.constant = 76
            var price:Double?
            switch subM.payType{
                case .cash,.cashCoin:
                    price = subM.originalPrice == 0 ? subM.vipPrice : subM.originalPrice
                case .coin:
                    price = Double(subM.playPaiCoin)
            }
                                collectionView.delegate = self
                                collectionView.dataSource = self
                                collectionView.register(UINib(nibName: "Common_1_CCell", bundle: nil), forCellWithReuseIdentifier: "_Common_1_CCell")
            guard price != nil else {
                LogError("会员优惠价格出现问题:nil");return
            }
                                studentTableView.dataSource = self
                                studentTableView.separatorStyle = .none
                                studentTableView.register(UINib(nibName: "StudentInfoTCell", bundle: nil), forCellReuseIdentifier: "_StudentInfoTCell")
            Services.queryAvaiableCopons(id: detailModel!.id, price: price!).subscribe(onNext: { [weak self] data in
                guard let weakSelf = self else { return }
                self?.btn_coupon.isHidden = (data.data?.count ?? 0) == 0 || weakSelf.signUpModel?.payStatus == .unPayment
                self?.couponModels = data.data ?? []
                self?.label_couponInfo.isHidden = (data.data?.count ?? 0) == 0
                self?.label_couponInfo.text = String(format: "(%ld张可用)",data.data?.count ?? 0)
                    //重新获取优惠券,在切换套餐时触发
                if let selectCoupon = self?.selectCouponModel{
                    if !weakSelf.couponModels.contains(where: {$0.id == selectCoupon.id}){
                        weakSelf.selectCouponModel = nil
                        weakSelf.btn_couponInfo.setTitle("去选择", for: .normal)
                    }
                                btn_addStudent.imagePosition = .right
                                btn_addStudent.spacingBetweenImageAndTitle = 3
                }
                complete?()
            }).disposed(by: disposeBag)
        }
    }
    override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
        let w = String.jq_getWidth(text: detailModel?.type.strTitle ?? "", height: 25, font: 14) + 16
        label_courseType.jq_addCorners(corner: [.topLeft,.bottomLeft], radius: 4, width: w, height: 25)
    }
                init(detailModel:CourseDetailModel,signUpModel:SignUpCourseItemDetailModel? = nil,classHours:Int? = nil) {
                                super.init(nibName: nil, bundle: nil)
                                self.detailModel = detailModel
                                self.signUpModel = signUpModel
                                self.classHours = classHours
                }
                required init?(coder: NSCoder) {
                                fatalError("init(coder:) has not been implemented")
                }
                override func setRx() {
                                NotificationCenter.default.rx.notification(StudentUpdate_Nofi).take(until: self.rx.deallocated).subscribe {[weak self] noti in
                                                guard let weakSelf = self else { return }
                                                //重新唤起添加学生
                                                weakSelf.studentAction(weakSelf.btn_addStudent)
                                }.disposed(by: disposeBag)
                                NotificationCenter.default.rx.notification(UIApplication.didBecomeActiveNotification).take(until: self.rx.deallocated).subscribe(onNext: {[weak self] noti in
                                                self?.selectCouponModel = nil
                                                self?.btn_couponInfo.setTitle("去选择", for: .normal)
                                                self?.queryCouponInfo {[weak self] () in
                                                                guard let weakSelf = self else { return }
                                                                weakSelf.changePrice(weakSelf.selectClassIndex)
                                                }
                                }).disposed(by: disposeBag)
                }
                @IBAction func couponAction(_ sender: TapBtn) {
                                CouponChooseView.show(couponModels,defaultModel: selectCouponModel) {[weak self] m in
                                                guard let weakSelf = self else { return }
                                                weakSelf.selectCouponModel = m
                                                guard m != nil else {
                                                                weakSelf.btn_couponInfo.setTitle("去选择", for: .normal);return
                                                }
                                                weakSelf.btn_couponInfo.setTitle("-\(m!.favorable.currency())", for: .normal)
                                                weakSelf.changePrice(weakSelf.selectClassIndex)
                                }
                }
                @IBAction func studentAction(_ sender: QMUIButton) {
                                StudentChooseView.show(itemType: .course, defaultStu: studentModels) { [weak self] studs in
                                                guard let weakSelf = self else { return }
                                                weakSelf.studentModels = studs as! [CourseDetailStudentModel]
                                                weakSelf.tableView.reloadData()
                                                weakSelf.cons_tableHei.constant = CGFloat((weakSelf.studentModels.count) * 87)
                                                weakSelf.changePrice(weakSelf.selectClassIndex)
                                } needAddClouse: { [weak self] () in
                                                let vc = AddStudentVC(type: .course)
                                                self?.push(vc: vc)
                                }
                }
                @IBAction func paymentAction(_ sender: UIButton) {
                                guard detailModel != nil else {return}
                                guard studentModels.count != 0 else {alertError(msg: "请选择运动营成员");return}
                                StoresInfoView.show(detailModel!) { [weak self] status in
                                                guard let weakSelf = self else { return }
                                                if status{
                                                                if var model = weakSelf.detailModel?.list[weakSelf.selectClassIndex]{
                                                                                //续课时价格
                                                                                if let list = weakSelf.signUpModel?.list{
                                                                                                model = list[weakSelf.selectClassIndex]
                                                                                }
                                                                                var price:Double = 0
                                                                                //是否是会员
                                                                                if weakSelf.detailModel?.isVip == 1 && model.vipPrice != 0{
                                                                                                price = model.vipPrice
                                                                                }else{
                                                                                                price = model.paymentPrice
                                                                                }
                                                                                //计算人数总价
                                                                                price = price * Double(weakSelf.studentModels.count)
                                                                                //减去优惠
                                                                                var discountPrice = price - (weakSelf.selectCouponModel?.favorable ?? 0)
                                                                                var coin = model.playPaiCoin * weakSelf.studentModels.count
                                                                                //待支付订单 ,取最终订单金额
                                                                                if weakSelf.signUpModel?.payStatus == .unPayment{
                                                                                                discountPrice = weakSelf.signUpModel?.payPrice ?? 0
                                                                                                coin = weakSelf.signUpModel?.coinPrice ?? 0
                                                                                }
                                                                                PaymentView.show(enumType: .course, money: (ali:discountPrice,wx:discountPrice,coin:coin,course:nil,integral:nil)) { [weak self] payType in
                                                                                                guard let weakSelf = self else { return }
                                                                                                var resultPayPrice:Double = 0
                                                                                                switch payType {
                                                                                                                case .aliPay,.wechat:
                                                                                                                                resultPayPrice = price
                                                                                                                                //待支付订单单独处理
                                                                                                                                if weakSelf.signUpModel?.payStatus == .unPayment{
                                                                                                                                                resultPayPrice = weakSelf.signUpModel?.payPrice ?? 0
                                                                                                                                }
                                                                                                                case .coin:
                                                                                                                                resultPayPrice = Double(coin)
                                                                                                                default:break
                                                                                                }
                                                                                                Services.courcePayment(conponId: weakSelf.selectCouponModel?.id, courseConfigId: model.id, id: weakSelf.detailModel!.id, price: resultPayPrice, payType: payType, stuId: weakSelf.studentModels.map({$0.id}),orderId: weakSelf.signUpModel?.coursePayId).subscribe(onNext: { data in
                                                                                                                if data.code == 200{
                                                                                                                                switch payType {
                                                                                                                                                case .aliPay:
                                                                                                                                                                YYPaymentManager.shared.sendPaymentRequest(YYAlipayRequest(orderString: data.data!.orderString)) { [weak self] result in
                                                                                                                                                                                switch result {
                                                                                                                                                                                                case .success:
                                                                                                                                                                                                                let vc = PaymentResultVC(result: .success, objType: .courseApply,handleVC: self,courseConfigId: model.id)
                                                                                                                                                                                                                vc.isExtend = self?.signUpModel?.payStatus == .paymented
                                                                                                                                                                                                                self?.push(vc: vc)
                                                                                                                                                                                                case .cancel:
                                                                                                                                                                                                                alert(msg: "已取消")
                                                                                                                                                                                                case .failure(_):
                                                                                                                                                                                                                let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .courseApply)
                                                                                                                                                                                                                self?.push(vc: vc)
                                                                                                                                                                                }
                                                                                                                                                                }
                                                                                                                                                case .wechat:
                                                                                                                                                                self?.navigationController?.popViewController(animated: false)
                                                                                                                                                                break
                                                                                                                                                case .coin:
                                                                                                                                                                let vc = PaymentResultVC(result: .success, objType: .courseApply,handleVC: self,courseConfigId: model.id)
                                                                                                                                                                vc.isExtend = self?.signUpModel?.payStatus == .paymented
                                                                                                                                                                self?.push(vc: vc)
                                                                                                                                                default:break
                                                                                                                                }
                                                                                                                }else{
                                                                                                                                alertError(msg: data.msg)
                                                                                                                }
                                                                                                },onError: { error in
                                                                                                                if let er = error as? NetworkRequest.NetRequestError{
                                                                                                                                switch er {
                                                                                                                                                case .Other(let code,let string):
                                                                                                                                                                let vc = PaymentResultVC(result: .fail(string,code), objType: .courseApply,handleVC: nil)
                                                                                                                                                                self?.push(vc: vc)
                                                                                                                                                default:
                                                                                                                                                                let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .courseApply,handleVC: nil)
                                                                                                                                                                self?.push(vc: vc)
                                                                                                                                }
                                                                                                                }
                                                                                                }).disposed(by: weakSelf.disposeBag)
                                                                                }
                                                                }
                                                }else{
                                                                self?.navigationController?.popToRootViewController(animated: true)
                                                                NotificationCenter.default.post(name: ChooseHomeStore_Noti, object: nil)
                                                }
                                }
                }
                //计算价格
                private func changePrice(_ index:Int){
                                //待支付订单,终止后续
                                if signUpModel?.payStatus == .unPayment{
                                                label_price.isHidden = true
                                                label_originPrice.isHidden = signUpModel!.payPrice == signUpModel!.orinPrice
                                                label_vipPrice.isHidden = true
                                                label_coin.isHidden = true
                                                let originPrice = signUpModel!.orinPrice - signUpModel!.payPrice
                                                label_originPrice.attributedText = AttributedStringbuilder.build().add(string: originPrice.currency(), withFont: UIFont.systemFont(ofSize: 16, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58)).delLine(color: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58)).mutableAttributedString
                                                if signUpModel?.coinPrice != 0{
                                                                label_coin.isHidden = false
                                                                label_coin.attributedText = AttributedStringbuilder.build()
                                                                                .add(string: "玩湃币:", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F"))
                                                                                .add(string: "\(signUpModel!.coinPrice)币", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313")).mutableAttributedString
                                                }
                                                if signUpModel?.payPrice != 0{
                                                                label_price.isHidden = false
                                                                label_price.text = (signUpModel!.payPrice).currency()
                                                }
                                                return
                                }
                                if let subM = detailModel?.list[index]{
                                                var studentCount:Int = 0
                                                if studentModels.count == 0{
                                                                studentCount = 1
                                                }else{
                                                                studentCount = studentModels.count
                                                }
                                                switch subM.payType {
                                                                case .coin:
                                                                                label_price.text = ""
                                                                                label_price.isHidden = true
                                                                                label_originPrice.isHidden = true
                                                                                label_vipPrice.isHidden = true
                                                                                label_coin.isHidden = false
                                                                                //纯玩湃币没有优惠券项
                                                                                btn_coupon.isHidden = true
                                                                                label_coin.isHidden = false
                                                                                //玩湃币
                                                                                label_coin.attributedText = AttributedStringbuilder.build()
                                                                                                .add(string: "玩湃币:", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F"))
                                                                                                .add(string: "\(subM.playPaiCoin * studentCount)币", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313")).mutableAttributedString
                                                                case .cash:
                                                                                fallthrough
                                                                case .cashCoin:
                                                                                if subM.originalPrice == 0 || subM.originalPrice == subM.paymentPrice{
                                                                                                label_originPrice.isHidden = true
                                                                                }else{
                                                                                                label_originPrice.isHidden = false
                                                                                }
                                                                                //                    label_originPrice.isHidden = (subM.paymentPrice == subM.originalPrice && subM.paymentPrice != 0 && subM.originalPrice != 0)
                                                                                label_coin.isHidden = subM.payType == .cash
                                                                                //玩湃币
                                                                                label_coin.attributedText = AttributedStringbuilder.build()
                                                                                                .add(string: "玩湃币:", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F"))
                                                                                                .add(string: "\(subM.playPaiCoin * studentCount)币", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313")).mutableAttributedString
                                                                                //原价
                                                                                let attribute = AttributedStringbuilder.build().add(string: (subM.originalPrice * Double(studentCount)).currency(), withFont: UIFont.systemFont(ofSize: 16, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58)).delLine(color: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58))
                                                                                label_originPrice.attributedText = attribute.mutableAttributedString
                                                                                if UserInfoModel.get()?.isVip == 1{
                                                                                                if subM.payType != .coin{
                                                                                                                //会员
                                                                                                                label_vipPrice.isHidden = true
                                                                                                                if subM.paymentPrice < subM.vipPrice && subM.paymentPrice != 0{
                                                                                                                                label_price.text = (subM.paymentPrice *  Double(studentCount) - (selectCouponModel?.favorable ?? 0)).currency()
                                                                                                                }else if subM.vipPrice < subM.paymentPrice && subM.vipPrice != 0{
                                                                                                                                label_price.text = (subM.vipPrice *  Double(studentCount) - (selectCouponModel?.favorable ?? 0)).currency()
                                                                                                                }else if subM.vipPrice != 0 &&  subM.paymentPrice != 0{
                                                                                                                                let price = min(subM.vipPrice, subM.paymentPrice)
                                                                                                                                label_price.text = (price *  Double(studentCount) - (selectCouponModel?.favorable ?? 0)).currency()
                                                                                                                }else{
                                                                                                                                label_price.text = (subM.paymentPrice *  Double(studentCount) - (selectCouponModel?.favorable ?? 0)).currency()
                                                                                                                }
                                                                                                }
                                                                                }else{
                                                                                                if subM.payType != .coin{
                                                                                                                //非会员
                                                                                                                label_vipPrice.isHidden = subM.vipPrice == 0 || subM.vipPrice == subM.paymentPrice
                                                                                                                let vipAttribute = AttributedStringbuilder.build()
                                                                                                                                .add(string: "会员价:", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F"))
                                                                                                                                .add(string: (subM.vipPrice *  Double(studentCount)).currency(), withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313"))
                                                                                                                label_vipPrice.attributedText = vipAttribute.mutableAttributedString
                                                                                                                if subM.originalPrice != 0 && subM.paymentPrice == 0{
                                                                                                                                label_price.text = (subM.originalPrice *  Double(studentCount) - (selectCouponModel?.favorable ?? 0)).currency()
                                                                                                                }else if subM.originalPrice == 0 && subM.paymentPrice != 0{
                                                                                                                                label_price.text = (subM.paymentPrice *  Double(studentCount) - (selectCouponModel?.favorable ?? 0)).currency()
                                                                                                                }else if subM.originalPrice != 0 && subM.paymentPrice != 0{
                                                                                                                                var money = min(subM.originalPrice,subM.paymentPrice)
                                                                                                                                money = money - (selectCouponModel?.favorable ?? 0)
                                                                                                                                label_price.text = (money *  Double(studentCount)).currency()
                                                                                                                }else{
                                                                                                                                label_price.text = (subM.originalPrice *  Double(studentCount) - (selectCouponModel?.favorable ?? 0)).currency()
                                                                                                                }
                                                                                                }
                                                                                }
                                                }
                                                if detailModel?.type == .experience{
                                                                if subM.paymentPrice != 0{
                                                                                label_price.text = subM.paymentPrice.currency()
                                                                                label_price.isHidden = false
                                                                }
                                                                view_teach.isHidden = true
                                                                label_originPrice.isHidden = true
                                                                label_vipPrice.isHidden = true
                                                }
                                                //            if label_originPrice.isHidden && label_vipPrice.isHidden && label_coin.isHidden{
                                                //                label_coin.alpha = 0
                                                //            }
                                }
                }
                //查询优惠券
                private func queryCouponInfo(complete:(()->Void)? = nil){
                                if let subM = detailModel?.list[selectClassIndex]{
                                                var price:Double?
                                                switch subM.payType{
                                                                case .cash,.cashCoin:
                                                                                price = subM.originalPrice == 0 ? subM.vipPrice : subM.originalPrice
                                                                case .coin:
                                                                                price = Double(subM.playPaiCoin)
                                                }
                                                guard price != nil else {
                                                                LogError("会员优惠价格出现问题:nil");return
                                                }
                                                Services.queryAvaiableCopons(id: detailModel!.id, price: price!).subscribe(onNext: { [weak self] data in
                                                                guard let weakSelf = self else { return }
                                                                self?.btn_coupon.isHidden = (data.data?.count ?? 0) == 0 || weakSelf.signUpModel?.payStatus == .unPayment
                                                                self?.couponModels = data.data ?? []
                                                                self?.label_couponInfo.isHidden = (data.data?.count ?? 0) == 0
                                                                self?.label_couponInfo.text = String(format: "(%ld张可用)",data.data?.count ?? 0)
                                                                //重新获取优惠券,在切换套餐时触发
                                                                if let selectCoupon = self?.selectCouponModel{
                                                                                if !weakSelf.couponModels.contains(where: {$0.id == selectCoupon.id}){
                                                                                                weakSelf.selectCouponModel = nil
                                                                                                weakSelf.btn_couponInfo.setTitle("去选择", for: .normal)
                                                                                }
                                                                }
                                                                complete?()
                                                }).disposed(by: disposeBag)
                                }
                }
                override func viewDidLayoutSubviews() {
                                super.viewDidLayoutSubviews()
                                let w = String.jq_getWidth(text: detailModel?.type.strTitle ?? "", height: 25, font: 14) + 16
                                label_courseType.jq_addCorners(corner: [.topLeft,.bottomLeft], radius: 4, width: w, height: 25)
                }
}
extension CourseDetailApplyVC:UICollectionViewDelegate{
    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        selectClassIndex = indexPath.row
        collectionView.reloadData()
        queryCouponInfo {[weak self] () in
            self?.changePrice(indexPath.row)
        }
    }
                func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
                                selectClassIndex = indexPath.row
                                collectionView.reloadData()
                                queryCouponInfo {[weak self] () in
                                                self?.changePrice(indexPath.row)
                                }
                }
}
extension CourseDetailApplyVC:UICollectionViewDataSource{
    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let m = detailModel!.list[indexPath.row]
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_Common_1_CCell", for: indexPath) as! Common_1_CCell
        cell.isSelected = indexPath.row == selectClassIndex
        cell.courseDetailListModel = m
        return cell
    }
                func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
                                let m = detailModel!.list[indexPath.row]
                                let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_Common_1_CCell", for: indexPath) as! Common_1_CCell
                                cell.isSelected = indexPath.row == selectClassIndex
                                cell.courseDetailListModel = m
                                return cell
                }
    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return detailModel?.list.count ?? 0
    }
                func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
                                return detailModel?.list.count ?? 0
                }
}
extension CourseDetailApplyVC:UICollectionViewDelegateFlowLayout{
    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
        return 21
    }
                func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
                                return 21
                }
    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
        return 21
    }
                func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
                                return 21
                }
    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
        return CGSize(width: CellW, height: CellH)
    }
                func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
                                return CGSize(width: CellW, height: CellH)
                }
}
extension CourseDetailApplyVC:UITableViewDataSource{
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return studentModels.count
    }
                func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
                                return studentModels.count
                }
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "_StudentInfoTCell") as! StudentInfoTCell
        cell.indexPath = indexPath
        cell.studentModel = studentModels[indexPath.row]
        cell.deleClouse = { [weak self] index in
            guard let weakSelf = self else { return }
            if weakSelf.studentModels.count > 1{
                tableView.beginUpdates()
                weakSelf.studentModels.remove(at: index)
                tableView.deleteRows(at: [IndexPath(row: index, section: 0)], with: .right)
                tableView.endUpdates()
                weakSelf.cons_tableHei.constant = CGFloat((weakSelf.studentModels.count) * 87)
                tableView.reloadData()
                weakSelf.changePrice(weakSelf.selectClassIndex)
            }else{
                alert(msg: "至少选择一位运动营成员")
            }
        }
        cell.btn_handle.isHidden = signUpModel != nil
        return cell
    }
                func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
                                let cell = tableView.dequeueReusableCell(withIdentifier: "_StudentInfoTCell") as! StudentInfoTCell
                                cell.indexPath = indexPath
                                cell.studentModel = studentModels[indexPath.row]
                                cell.deleClouse = { [weak self] index in
                                                guard let weakSelf = self else { return }
                                                if weakSelf.studentModels.count > 1{
                                                                tableView.beginUpdates()
                                                                weakSelf.studentModels.remove(at: index)
                                                                tableView.deleteRows(at: [IndexPath(row: index, section: 0)], with: .right)
                                                                tableView.endUpdates()
                                                                weakSelf.cons_tableHei.constant = CGFloat((weakSelf.studentModels.count) * 87)
                                                                tableView.reloadData()
                                                                weakSelf.changePrice(weakSelf.selectClassIndex)
                                                }else{
                                                                alert(msg: "至少选择一位运动营成员")
                                                }
                                }
                                cell.btn_handle.isHidden = signUpModel != nil
                                return cell
                }
}
WanPai/Root/Course/VC/StudentExchangeVC.swift
@@ -10,91 +10,91 @@
import QMUIKit
class StudentExchangeViewModel:RefreshModel<StudentProfile1Model>{
    override func api() -> (Observable<BaseResponse<[StudentProfile1Model]>>)? {
        return Services.startCourceStudentList()
    }
                override func api() -> (Observable<BaseResponse<[StudentProfile1Model]>>)? {
                                return Services.startCourceStudentList()
                }
}
class StudentExchangeVC: BaseVC {
    @IBOutlet weak var tableView: BaseTableView!
    @IBOutlet weak var btn_add: QMUIButton!
    private var selectIndex:Int?
    private let viewModel = StudentExchangeViewModel()
                @IBOutlet weak var tableView: BaseTableView!
                @IBOutlet weak var btn_add: QMUIButton!
                private var selectIndex:Int?
                private let viewModel = StudentExchangeViewModel()
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "切换运动营成员"
        selectIndex = 0
        viewModel.configure(tableView,needMore: false)
        viewModel.beginRefresh()
        btn_add.imagePosition = .right
        btn_add.spacingBetweenImageAndTitle = 5
    }
                override func viewDidLoad() {
                                super.viewDidLoad()
                                title = "切换运动营成员"
                                selectIndex = 0
                                viewModel.configure(tableView,needMore: false)
                                viewModel.beginRefresh()
                                btn_add.imagePosition = .right
                                btn_add.spacingBetweenImageAndTitle = 5
                }
    override func setUI() {
        tableView.delegate = self
        tableView.dataSource = self
        tableView.separatorStyle = .none
        tableView.register(UINib(nibName: "StudentInfo_3_TCell", bundle: nil), forCellReuseIdentifier: "_StudentInfo_3_TCell")
//        tableView.jq_setEmptyView()
    }
                override func setUI() {
                                tableView.delegate = self
                                tableView.dataSource = self
                                tableView.separatorStyle = .none
                                tableView.register(UINib(nibName: "StudentInfo_3_TCell", bundle: nil), forCellReuseIdentifier: "_StudentInfo_3_TCell")
                                //        tableView.jq_setEmptyView()
                }
    override func setRx() {
        NotificationCenter.default.rx.notification(StudentUpdate_Nofi).take(until: self.rx.deallocated).subscribe(onNext: {noti in
            self.viewModel.beginRefresh()
        }).disposed(by: disposeBag)
    }
                override func setRx() {
                                NotificationCenter.default.rx.notification(StudentUpdate_Nofi).take(until: self.rx.deallocated).subscribe(onNext: {noti in
                                                self.viewModel.beginRefresh()
                                }).disposed(by: disposeBag)
                }
    @IBAction func addStudentAction(_ sender: UIButton) {
        let studentVC = AddStudentVC(type: .course)
        push(vc: studentVC)
    }
                @IBAction func addStudentAction(_ sender: UIButton) {
                                let studentVC = AddStudentVC(type: .course)
                                push(vc: studentVC)
                }
    @IBAction func changeAction(_ sender: UIButton) {
        if let s = selectIndex{
            let id = viewModel.dataSource.value[s].stuId
            UserDefaults.standard.setValue(id, forKey: "currentStuId")
            UserDefaults.standard.synchronize()
            Services.startCourseSwitch(id: id).subscribe(onNext: { data in
                NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil)
                self.navigationController?.popViewController()
            }).disposed(by: disposeBag)
        }
    }
                @IBAction func changeAction(_ sender: UIButton) {
                                if let s = selectIndex{
                                                let id = viewModel.dataSource.value[s].stuId
                                                UserDefaults.standard.setValue(id, forKey: "currentStuId")
                                                UserDefaults.standard.synchronize()
                                                Services.startCourseSwitch(id: id).subscribe(onNext: { data in
                                                                NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil)
                                                                self.navigationController?.popViewController()
                                                }).disposed(by: disposeBag)
                                }
                }
}
extension StudentExchangeVC:UITableViewDelegate{
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        selectIndex = indexPath.row
        tableView.reloadData()
    }
                func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
                                selectIndex = indexPath.row
                                tableView.reloadData()
                }
}
extension StudentExchangeVC:UITableViewDataSource{
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let model = viewModel.dataSource.value[indexPath.row]
        let cell = tableView.dequeueReusableCell(withIdentifier: "_StudentInfo_3_TCell") as! StudentInfo_3_TCell
        cell.studentProfile1Model = model
        cell.viewModel = viewModel
                func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
                                let model = viewModel.dataSource.value[indexPath.row]
                                let cell = tableView.dequeueReusableCell(withIdentifier: "_StudentInfo_3_TCell") as! StudentInfo_3_TCell
                                cell.studentProfile1Model = model
                                cell.viewModel = viewModel
        if selectIndex != nil{
            if indexPath.row == selectIndex{
                cell.view_container.jq_borderColor = UIColor(hexStr: "#FD7902").withAlphaComponent(0.28)
            }else{
                cell.view_container.jq_borderColor = UIColor(hexStr: "#818080").withAlphaComponent(0.28)
            }
        }else{
            if model.isNot == 1{
                cell.view_container.jq_borderColor = UIColor(hexStr: "#FD7902").withAlphaComponent(0.28)
            }else{
                cell.view_container.jq_borderColor = UIColor(hexStr: "#818080").withAlphaComponent(0.28)
            }
        }
        return cell
    }
                                if selectIndex != nil{
                                                if indexPath.row == selectIndex{
                                                                cell.view_container.jq_borderColor = UIColor(hexStr: "#FD7902").withAlphaComponent(0.28)
                                                }else{
                                                                cell.view_container.jq_borderColor = UIColor(hexStr: "#818080").withAlphaComponent(0.28)
                                                }
                                }else{
                                                if model.isNot == 1{
                                                                cell.view_container.jq_borderColor = UIColor(hexStr: "#FD7902").withAlphaComponent(0.28)
                                                }else{
                                                                cell.view_container.jq_borderColor = UIColor(hexStr: "#818080").withAlphaComponent(0.28)
                                                }
                                }
                                return cell
                }
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return viewModel.dataSource.value.count
    }
                func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
                                return viewModel.dataSource.value.count
                }
}
WanPai/Root/Games/TCell/GamesTCell.swift
@@ -12,79 +12,79 @@
class GamesTCell: UITableViewCell {
    var disposeBag = DisposeBag()
                var disposeBag = DisposeBag()
    @IBOutlet weak var img_icon: UIImageView!
    var QRCodeModel:QRCodeModel!
    var spaceId = 0
    var sutuId = 0
    var storeId = 0
                @IBOutlet weak var img_icon: UIImageView!
                var QRCodeModel:QRCodeModel!
                var spaceId = 0
                var sutuId = 0
                var storeId = 0
    var gameListModel:GameListModel!{
        didSet{
            img_icon.sd_setImage(with: URL(string: gameListModel.img))
        }
    }
    override func awakeFromNib() {
        super.awakeFromNib()
        selectionStyle = .none
        contentView.layer.masksToBounds = false
    }
    @IBAction func intruduceAction(_ sender: UIButton) {
        GamesIntruduceView.show(url: gameListModel.video, content: gameListModel.intro)
    }
    @IBAction func launchGameAction(_ sender: UIButton) {
        GamesPayView.show(price: gameListModel.cash, coin: gameListModel.playCoin,integral: gameListModel.integral) {[weak self] () in
            guard let weakSelf = self else { return }
            PaymentView.show(enumType:.game,money: (ali: weakSelf.gameListModel.cash, wx: weakSelf.gameListModel.cash, coin: weakSelf.gameListModel.playCoin, course: nil,integral:weakSelf.gameListModel.integral)) { [weak self] payType in
                guard let weakSelf = self else { return }
                Services.payGame(configId: weakSelf.gameListModel.id, gameId: weakSelf.gameListModel.gameId, spaceId: weakSelf.storeId, sutuId: weakSelf.sutuId, type: payType).subscribe(onNext: {data in
                    switch payType {
                        case .wechat:break
                        case .aliPay:
                            YYPaymentManager.shared.sendPaymentRequest(YYAlipayRequest(orderString: data.data?.orderString ?? "")) { result in
                                switch result {
                                    case .success:
                                        let vc = PaymentResultVC(result: .success, objType: .games)
                                        JQ_currentViewController().jq_push(vc: vc)
                                    case .cancel:alert(msg: "支付已取消")
                                    case .failure(_):
                                        let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .games)
                                        JQ_currentViewController().jq_push(vc: vc)
                var gameListModel:GameListModel!{
                                didSet{
                                                img_icon.sd_setImage(with: URL(string: gameListModel.img))
                                }
                            }
                        default:
                            let vc = PaymentResultVC(result: .success, objType: .games)
                            JQ_currentViewController().jq_push(vc: vc)
                    }
                }) { error in
                    if let er = error as? NetworkRequest.NetRequestError{
                        switch er {
                            case .Other(let code,let string):
                                let vc = PaymentResultVC(result: .fail(string,code), objType: .games)
                                JQ_currentViewController().jq_push(vc: vc)
                            default:
                                let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .games)
                                JQ_currentViewController().jq_push(vc: vc)
                        }
                    }
                }.disposed(by: weakSelf.disposeBag)
            }
        }
                }
//        Services.userDetails().subscribe(onNext: {[weak self] data in
//            guard let weakSelf = self else { return }
//            if let model = data.data{
//                Services.game_gameStart(gameId: weakSelf.gameListModel.id, spaceId: weakSelf.QRCodeModel.space_id!, sutuId: weakSelf.QRCodeModel.sutu_id!, userID: model.userId).subscribe(onNext: { _ in
//                    alertSuccess(msg: "启动成功")
//                }) { error in
//
//                }.disposed(by: weakSelf.disposeBag)
//            }
//        }).disposed(by: disposeBag)
                override func awakeFromNib() {
                                super.awakeFromNib()
                                selectionStyle = .none
                                contentView.layer.masksToBounds = false
                }
    }
                @IBAction func intruduceAction(_ sender: UIButton) {
                                GamesIntruduceView.show(url: gameListModel.video, content: gameListModel.intro)
                }
                @IBAction func launchGameAction(_ sender: UIButton) {
                                GamesPayView.show(price: gameListModel.cash, coin: gameListModel.playCoin,integral: gameListModel.integral) {[weak self] () in
                                                guard let weakSelf = self else { return }
                                                PaymentView.show(enumType:.game,money: (ali: weakSelf.gameListModel.cash, wx: weakSelf.gameListModel.cash, coin: weakSelf.gameListModel.playCoin, course: nil,integral:weakSelf.gameListModel.integral)) { [weak self] payType in
                                                                guard let weakSelf = self else { return }
                                                                Services.payGame(configId: weakSelf.gameListModel.id, gameId: weakSelf.gameListModel.gameId, spaceId: weakSelf.storeId, sutuId: weakSelf.sutuId, type: payType).subscribe(onNext: {data in
                                                                                switch payType {
                                                                                                case .wechat:break
                                                                                                case .aliPay:
                                                                                                                YYPaymentManager.shared.sendPaymentRequest(YYAlipayRequest(orderString: data.data?.orderString ?? "")) { result in
                                                                                                                                switch result {
                                                                                                                                                case .success:
                                                                                                                                                                let vc = PaymentResultVC(result: .success, objType: .games)
                                                                                                                                                                JQ_currentViewController().jq_push(vc: vc)
                                                                                                                                                case .cancel:alert(msg: "支付已取消")
                                                                                                                                                case .failure(_):
                                                                                                                                                                let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .games)
                                                                                                                                                                JQ_currentViewController().jq_push(vc: vc)
                                                                                                                                }
                                                                                                                }
                                                                                                default:
                                                                                                                let vc = PaymentResultVC(result: .success, objType: .games)
                                                                                                                JQ_currentViewController().jq_push(vc: vc)
                                                                                }
                                                                }) { error in
                                                                                if let er = error as? NetworkRequest.NetRequestError{
                                                                                                switch er {
                                                                                                                case .Other(let code,let string):
                                                                                                                                let vc = PaymentResultVC(result: .fail(string,code), objType: .games)
                                                                                                                                JQ_currentViewController().jq_push(vc: vc)
                                                                                                                default:
                                                                                                                                let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .games)
                                                                                                                                JQ_currentViewController().jq_push(vc: vc)
                                                                                                }
                                                                                }
                                                                }.disposed(by: weakSelf.disposeBag)
                                                }
                                }
                                //        Services.userDetails().subscribe(onNext: {[weak self] data in
                                //            guard let weakSelf = self else { return }
                                //            if let model = data.data{
                                //                Services.game_gameStart(gameId: weakSelf.gameListModel.id, spaceId: weakSelf.QRCodeModel.space_id!, sutuId: weakSelf.QRCodeModel.sutu_id!, userID: model.userId).subscribe(onNext: { _ in
                                //                    alertSuccess(msg: "启动成功")
                                //                }) { error in
                                //
                                //                }.disposed(by: weakSelf.disposeBag)
                                //            }
                                //        }).disposed(by: disposeBag)
                }
}
WanPai/Root/Home/Model/WorldCupModel.swift
@@ -13,10 +13,94 @@
                var content: String = ""
                var coverImg: String = ""
                var heat: Int = 0
                var id: String = ""
                var id: Int = 0
                var lat: String = ""
                var lon: String = ""
                var matchNumber: Int = 0
                var name: String = ""
                var registrationClosingTime: String = ""
                var worldCupId:Int = 0
}
struct WorldCupDetailModel:HandyJSON{
                var address: String = ""
                var age: String = ""
                var cash: Int = 0
                var classHour: Int = 0
                var content: String = ""
                var endTime: String = ""
                var gender: Int = 0
                var heat: Int = 0
                var id: Int = 0
                var infoImg: String = ""
                var intro: String = ""
                var name: String = ""
                var paiCoin: Int = 0
                var registrationClosingTime: String = ""
                var startTime: String = ""
                var storeInfos = [ActivityDetailStoreModel]()
                var participants = [ActivityDetailPartModel]()
                var expense:Double = 0 //支付费用
                var revocable:Int = 0 //是否可取消 是否可取消(0=否,1=是)
                var status:SignupType = .cancel//比赛状态 比赛状态(1=未开始,2=已开始,3=已结束,4=已取消)
                var unitPrice:Double = 0
}
struct WorldCupJudgeModel:HandyJSON{
                var activeTime: String = ""
                var id: Int = 0
                var lat: Double = 0
                var lon: Double = 0
                var matchNumber: Int = 0
                var name: String = ""
                var status: SignupType = .cancel
}
struct WorldCupPayStateModel:HandyJSON{
                var classHour = 0 //能否使用课时支付(0=否,1=是)
                var paiCoin = 0 //能否使用课时支付(0=否,1=是)
}
struct WorldCupSourceModel:HandyJSON{
                var age: String = ""
                var content: String = ""
                var coverImg: String = ""
                var distance: Int = 0
                var heat: Int = 0
                var id: Int = 0
                var lat: Double = 0
                var lon: Double = 0
                var matchNumber: Int = 0
                var name: String = ""
                var registrationClosingTime: String = ""
}
struct WorldCupRankModel:HandyJSON {
                var cityName: String = ""
                var cityRank: Int = 0
                var lose: Int = 0
                var name: String = ""
                var nationalRank: Int = 0
                var win: Int = 0
                var winRate: Int = 0
}
struct WorldCupMatchRecordModel:HandyJSON{
                var list = [WorldCupMatchRecordDataModel]()
                var totalSession: Int = 0
}
struct WorldCupMatchRecordDataModel: HandyJSON {
                var award: Int = 0
                var matchResult: Int = 0
                var name: String?
                var opponentScore: Int = 0
                var ourScore: Int = 0
                var startTime: String?
}
WanPai/Root/Home/VC/WorldCupListVC.swift
@@ -14,14 +14,13 @@
class WorldCupListViewModel:RefreshModel<WorldCupListModel>{
                var search = BehaviorRelay<String?>(value:nil)
                var gender = BehaviorRelay<Int?>(value:nil)
                var gender = BehaviorRelay<NormalSimpleModel>(value:NormalSimpleModel(id: 0, name: "全部"))
                var sort = BehaviorRelay<Int?>(value:nil)
                var storeId = BehaviorRelay<Int?>(value: nil)
                var storeId = BehaviorRelay<NormalSimpleModel?>(value: nil)
                override func api() -> (Observable<BaseResponse<[WorldCupListModel]>>)? {
                                let deserModel = HomeStoreModel.deserialize(from: UserDefaults.standard.object(forKey: "CurrentStore") as? String)
                                return Services.worldCupList(id: deserModel!.storeId, content: search.value, gender: gender.value, sort: sort.value, storeId: storeId.value)
                                return Services.worldCupList(id: deserModel!.storeId, content: search.value, gender: gender.value.id, sort: sort.value, storeId: storeId.value?.id)
                }
}
@@ -31,6 +30,8 @@
                private var pointView:CourseSubTypeView?
                private var conditionView:CourseSubTypeView?
                private var hotView:CourseSubTypeView?
                private var pointData = [NormalSimpleModel]()
                private var viewModel = WorldCupListViewModel()
@@ -42,10 +43,23 @@
                }()
                private var footerView:CommonBannerView = {
                                var banner = CommonBannerView()
                                banner.backgroundColor = .white
                                banner.frame = CGRect(x: 0, y: 0, width: JQ_ScreenW, height: JQ_ScreenW * 0.564)
                                return banner
                }()
    override func viewDidLoad() {
        super.viewDidLoad()
                                title = "社区世界杯"
                                viewModel.beginRefresh()
                                Services.getWorldCupStore().subscribe(onNext: { [weak self]data in
                                                self?.pointData.append(NormalSimpleModel(id: 0, name: "全部"))
                                                self?.pointData.append(contentsOf: data.data ?? [])
                                }).disposed(by: disposeBag)
    }
                override func setUI() {
@@ -59,6 +73,7 @@
                                tableview = BaseTableView(frame: .zero, style: .plain)
                                tableview.tableHeaderView = headerView
                                tableview.tableFooterView = footerView
                                view.addSubview(tableview)
                                tableview.delegate = self
                                tableview.dataSource = self
@@ -72,7 +87,40 @@
                                                make.edges.equalToSuperview()
                                }
                                viewModel.configure(tableview)
                                viewModel.configure(tableview,needMore: false)
                                getBanner()
                }
                private func getBanner(){
                                Services.bannerList(position: .worldCup_top).subscribe(onNext: {[weak self]data in
                                                if let models = data.data,models.count > 0{
                                                                let imgs = models.map({$0.img})
                                                                var items = [CommonBannerModel]()
                                                                for (index,img) in imgs.enumerated(){
                                                                                items.append(CommonBannerModel(index: index,resource: img,mediaType: .imageUrl))
                                                                }
                                                                self?.headerView.setItems(items: items) { m in
                                                                                let model = models[m.index]
                                                                                jumpPage(model: model.model, page: model.page, type: model.type, id: model.turnId)
                                                                }
                                                                self?.tableview.reloadData()
                                                }
                                }).disposed(by: disposeBag)
                                Services.bannerList(position: .worldCup_bottom).subscribe(onNext: {[weak self]data in
                                                if let models = data.data,models.count > 0{
                                                                let imgs = models.map({$0.img})
                                                                var items = [CommonBannerModel]()
                                                                for (index,img) in imgs.enumerated(){
                                                                                items.append(CommonBannerModel(index: index,resource: img,mediaType: .imageUrl))
                                                                }
                                                                self?.footerView.setItems(items: items) { m in
                                                                                let model = models[m.index]
                                                                                jumpPage(model: model.model, page: model.page, type: model.type, id: model.turnId)
                                                                }
                                                                self?.tableview.reloadData()
                                                }
                                }).disposed(by: disposeBag)
                }
}
@@ -80,19 +128,21 @@
extension WorldCupListVC:UITableViewDelegate & UITableViewDataSource{
                func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
                                let vc = WorldCupContentApplyVC()
                                let model = viewModel.dataSource.value[indexPath.row]
                                let vc = WorldCupContentApplyVC(id: model.id)
                                push(vc: vc)
                }
                func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
//                                return viewModel.dataSource.value.count
                                return 1
                                return viewModel.dataSource.value.count
                }
                
                func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
                                let model = viewModel.dataSource.value[indexPath.row]
                                let cell = tableView.dequeueReusableCell(withIdentifier: "_WorldCupTCell") as! WorldCupTCell
                                cell.backgroundColor = .clear
                                cell.setWorldCupListModel(model)
                                cell.label_state.text = ""
                                return cell
                }
@@ -109,32 +159,41 @@
extension WorldCupListVC:WorldCupHeadDelegate{
                func search(text: String) {
                                viewModel.search.accept(text)
                                viewModel.beginRefresh()
                }
                
                func atPoint(_ btn: QMUIButton) {
                                conditionView?.removeFromSuperview()
                                hotView?.removeFromSuperview()
                                btn.isSelected = true
                                pointView = CourseSubTypeView.show(inView: self.view, afterView: btn, items: [NormalSimpleModel(id: 0, name: "测试")]) { model in
                                pointView = CourseSubTypeView.show(inView: self.view, afterView: btn, items: pointData,selectModel: viewModel.storeId.value) {[weak self] model in
                                                if model.name == "全部"{
                                                                btn.setTitle("所在赛点", for: .normal)
                                                                self?.viewModel.storeId.accept(nil)
                                                }else{
                                                                btn.setTitle(model.name, for: .normal)
                                                                self?.viewModel.storeId.accept(model)
                                                }
                                                self?.viewModel.beginRefresh()
                                } closeClouse: {
                                                btn.isSelected = false
                                                self.pointView?.removeFromSuperview()
                                }
                }
                
                func atCondition(_ btn: QMUIButton) {
                                pointView?.removeFromSuperview()
                                hotView?.removeFromSuperview()
                                btn.isSelected = true
                                var items = [NormalSimpleModel]()
                                items.append(NormalSimpleModel(id: 0, name: "全部"))
                                items.append(NormalSimpleModel(id: 1, name: "男"))
                                items.append(NormalSimpleModel(id: 2, name: "女"))
                                conditionView = CourseSubTypeView.show(inView: self.view, afterView: btn, items: items) { model in
                                conditionView = CourseSubTypeView.show(inView: self.view, afterView: btn, items: items,selectModel: viewModel.gender.value) {[weak self] model in
                                                btn.setTitle(model.name, for: .normal)
                                                self?.viewModel.gender.accept(model)
                                                self?.viewModel.beginRefresh()
                                } closeClouse: {
                                                btn.isSelected = false
                                                self.conditionView?.removeFromSuperview()
                                }
                }
                
@@ -144,7 +203,7 @@
                                btn.isSelected = !btn.isSelected
                                let sortType = btn.isSelected ? SortType.desc:SortType.asc
                                btn.setImage(sortType.img, for: .normal)
                                viewModel.sort.accept(btn.isSelected ? 1:2)
                                viewModel.beginRefresh()
                }
}
WanPai/Root/Other/TCell/StudentInfo_5_TCell.swift
New file
@@ -0,0 +1,61 @@
//
//  StudentInfo_5_TCell.swift
//  WanPai
//
//  Created by 无故事王国 on 2024/3/1.
//
import UIKit
import QMUIKit
import JQTools
class StudentInfo_5_TCell: UITableViewCell {
                @IBOutlet weak var btn_delete: UIButton!
                @IBOutlet weak var btn_edit: UIButton!
                @IBOutlet weak var label_name: UILabel!
                @IBOutlet weak var label_idCard: UILabel!
                @IBOutlet weak var label_age: UILabel!
                @IBOutlet weak var label_phone: UILabel!
                @IBOutlet weak var view_container: UIView!
                @IBOutlet weak var btn_verifiy: UIButton!
                @IBOutlet weak var img_QRCode: UIImageView!
                var indexPath:IndexPath?
                var delClouse:((IndexPath)->Void)?
                //    var editClouse:((IndexPath)->Void)?
                var activityDetailPartModel:ActivityDetailPartModel!{
                                didSet{
                                                label_name.text = activityDetailPartModel.name
                                                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)
                                }
                }
                override func awakeFromNib() {
                                super.awakeFromNib()
                                selectionStyle = .none
                }
                @IBAction func editAction(_ sender: UIButton) {
                                StudentUpdateInfoView.show(activityDetailPartModel)
                }
                @IBAction func delAction(_ sender: UIButton) {
                                if let index = indexPath{
                                                delClouse?(index)
                                }
                }
                @IBAction func verifyAction(_ sender: UIButton) {
                                let vc = AddStudentVC(activityDetailPartModel: activityDetailPartModel)
                                JQ_currentViewController().jq_push(vc: vc)
                }
}
WanPai/Root/Other/TCell/StudentInfo_5_TCell.xib
New file
@@ -0,0 +1,193 @@
<?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"/>
        <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="_StudentInfo_5_TCell" rowHeight="159" id="KGk-i7-Jjw" customClass="StudentInfo_5_TCell" customModule="WanPai" customModuleProvider="target">
            <rect key="frame" x="0.0" y="0.0" width="430" height="159"/>
            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
                <rect key="frame" x="0.0" y="0.0" width="430" height="159"/>
                <autoresizingMask key="autoresizingMask"/>
                <subviews>
                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pTc-NR-Isq">
                        <rect key="frame" x="14" y="7" width="402" height="119"/>
                        <subviews>
                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="姓名:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nlO-mt-Joe">
                                <rect key="frame" x="10" y="13" width="36" height="20"/>
                                <constraints>
                                    <constraint firstAttribute="height" constant="20" id="lA3-uR-V1M"/>
                                </constraints>
                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
                                <nil key="highlightedColor"/>
                            </label>
                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JEN-r1-fTe">
                                <rect key="frame" x="46" y="14.666666666666668" width="13.333333333333336" height="17"/>
                                <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
                                <nil key="textColor"/>
                                <nil key="highlightedColor"/>
                            </label>
                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="身份证号:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oq3-zR-LzM">
                                <rect key="frame" x="114" y="13" width="72" height="20"/>
                                <constraints>
                                    <constraint firstAttribute="height" constant="20" id="2kD-Ln-8tX"/>
                                    <constraint firstAttribute="width" constant="72" id="Y4i-M5-HRT"/>
                                </constraints>
                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
                                <nil key="highlightedColor"/>
                            </label>
                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="1mU-G5-e7O">
                                <rect key="frame" x="186" y="14.666666666666668" width="13.333333333333343" height="17"/>
                                <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
                                <nil key="textColor"/>
                                <nil key="highlightedColor"/>
                            </label>
                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="年龄:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xwe-93-UxD">
                                <rect key="frame" x="10" y="44" width="36" height="20"/>
                                <constraints>
                                    <constraint firstAttribute="height" constant="20" id="a6E-nO-Skr"/>
                                </constraints>
                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
                                <nil key="highlightedColor"/>
                            </label>
                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gW2-8c-QGW">
                                <rect key="frame" x="46" y="45.666666666666664" width="13.333333333333336" height="17"/>
                                <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
                                <nil key="textColor"/>
                                <nil key="highlightedColor"/>
                            </label>
                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="v2s-kR-hqi">
                                <rect key="frame" x="316" y="80" width="16" height="22"/>
                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                <state key="normal" image="btn_delete_1"/>
                                <connections>
                                    <action selector="delAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="nQu-Bd-jYg"/>
                                </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="X2F-5e-2nv">
                                <rect key="frame" x="114" y="44" width="64.666666666666686" height="20"/>
                                <constraints>
                                    <constraint firstAttribute="height" constant="20" id="Ihb-VD-jzb"/>
                                </constraints>
                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
                                <nil key="highlightedColor"/>
                            </label>
                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NkA-Ac-dRf">
                                <rect key="frame" x="178.66666666666666" y="45.666666666666664" width="13.333333333333343" height="17"/>
                                <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
                                <nil key="textColor"/>
                                <nil key="highlightedColor"/>
                            </label>
                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="FU5-Nd-Orn">
                                <rect key="frame" x="286" y="80" width="15" height="22"/>
                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                <state key="normal" image="btn_edit_1"/>
                                <connections>
                                    <action selector="editAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="iXY-8a-ecZ"/>
                                </connections>
                            </button>
                            <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="yir-KB-bNp">
                                <rect key="frame" x="186" y="8.6666666666666643" width="61" height="29"/>
                                <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                <state key="normal" title="去实名&gt;&gt;">
                                    <color key="titleColor" name="FE6E0D"/>
                                </state>
                                <connections>
                                    <action selector="verifyAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="zt1-Ew-nJb"/>
                                </connections>
                            </button>
                            <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="zqS-zb-jhC">
                                <rect key="frame" x="354" y="63" width="42" height="42"/>
                                <color key="backgroundColor" name="F6F6F6"/>
                                <constraints>
                                    <constraint firstAttribute="height" constant="42" id="Eko-1m-7vY"/>
                                    <constraint firstAttribute="width" constant="42" id="UKW-yK-3nO"/>
                                </constraints>
                            </imageView>
                        </subviews>
                        <color key="backgroundColor" red="1" green="0.90588235289999997" blue="0.80000000000000004" alpha="0.080000000000000002" colorSpace="custom" customColorSpace="sRGB"/>
                        <constraints>
                            <constraint firstItem="X2F-5e-2nv" firstAttribute="leading" secondItem="oq3-zR-LzM" secondAttribute="leading" id="3LK-wR-0FC"/>
                            <constraint firstAttribute="height" constant="119" id="5EX-Nr-Ky6"/>
                            <constraint firstItem="oq3-zR-LzM" firstAttribute="leading" secondItem="pTc-NR-Isq" secondAttribute="leading" constant="114" id="5ee-l0-vay"/>
                            <constraint firstAttribute="trailing" secondItem="FU5-Nd-Orn" secondAttribute="trailing" constant="101" id="7VR-SC-FAa"/>
                            <constraint firstItem="NkA-Ac-dRf" firstAttribute="leading" secondItem="X2F-5e-2nv" secondAttribute="trailing" id="BTO-ER-5hG"/>
                            <constraint firstItem="gW2-8c-QGW" firstAttribute="centerY" secondItem="xwe-93-UxD" secondAttribute="centerY" id="Ecm-dz-tsT"/>
                            <constraint firstAttribute="bottom" secondItem="FU5-Nd-Orn" secondAttribute="bottom" constant="17" id="Enj-XV-2rJ"/>
                            <constraint firstItem="yir-KB-bNp" firstAttribute="centerY" secondItem="oq3-zR-LzM" secondAttribute="centerY" id="HbC-bs-d0u"/>
                            <constraint firstItem="JEN-r1-fTe" firstAttribute="leading" secondItem="nlO-mt-Joe" secondAttribute="trailing" id="IHd-sA-uMn"/>
                            <constraint firstItem="JEN-r1-fTe" firstAttribute="centerY" secondItem="nlO-mt-Joe" secondAttribute="centerY" id="M5m-fZ-f4d"/>
                            <constraint firstItem="oq3-zR-LzM" firstAttribute="centerY" secondItem="nlO-mt-Joe" secondAttribute="centerY" id="Ofg-ad-kpt"/>
                            <constraint firstItem="1mU-G5-e7O" firstAttribute="leading" secondItem="oq3-zR-LzM" secondAttribute="trailing" id="PZZ-mk-HSf"/>
                            <constraint firstItem="NkA-Ac-dRf" firstAttribute="centerY" secondItem="X2F-5e-2nv" secondAttribute="centerY" id="Rm0-F9-1Dh"/>
                            <constraint firstItem="X2F-5e-2nv" firstAttribute="centerY" secondItem="xwe-93-UxD" secondAttribute="centerY" id="Vaj-qV-UQy"/>
                            <constraint firstItem="xwe-93-UxD" firstAttribute="leading" secondItem="pTc-NR-Isq" secondAttribute="leading" constant="10" id="bPS-If-cfD"/>
                            <constraint firstAttribute="trailing" secondItem="v2s-kR-hqi" secondAttribute="trailing" constant="70" id="fod-vH-MDu"/>
                            <constraint firstAttribute="trailing" secondItem="zqS-zb-jhC" secondAttribute="trailing" constant="6" id="gaV-EU-OhS"/>
                            <constraint firstItem="xwe-93-UxD" firstAttribute="top" secondItem="nlO-mt-Joe" secondAttribute="bottom" constant="11" id="kqb-NL-qz1"/>
                            <constraint firstItem="nlO-mt-Joe" firstAttribute="top" secondItem="pTc-NR-Isq" secondAttribute="top" constant="13" id="qQt-JQ-uSo"/>
                            <constraint firstItem="v2s-kR-hqi" firstAttribute="centerY" secondItem="FU5-Nd-Orn" secondAttribute="centerY" id="rK5-Be-7qX"/>
                            <constraint firstItem="yir-KB-bNp" firstAttribute="leading" secondItem="oq3-zR-LzM" secondAttribute="trailing" id="tQt-R9-2IM"/>
                            <constraint firstItem="1mU-G5-e7O" firstAttribute="centerY" secondItem="oq3-zR-LzM" secondAttribute="centerY" id="tSA-FU-Bq3"/>
                            <constraint firstItem="nlO-mt-Joe" firstAttribute="leading" secondItem="pTc-NR-Isq" secondAttribute="leading" constant="10" id="x38-QJ-SmO"/>
                            <constraint firstItem="gW2-8c-QGW" firstAttribute="leading" secondItem="xwe-93-UxD" secondAttribute="trailing" id="xDx-qf-9Z0"/>
                            <constraint firstAttribute="bottom" secondItem="zqS-zb-jhC" secondAttribute="bottom" constant="14" id="zP2-Vw-Cdf"/>
                        </constraints>
                        <userDefinedRuntimeAttributes>
                            <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
                                <color key="value" red="0.99215686270000003" green="0.47450980390000003" blue="0.0078431372550000003" alpha="0.28000000000000003" colorSpace="custom" customColorSpace="sRGB"/>
                            </userDefinedRuntimeAttribute>
                            <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
                                <real key="value" value="1"/>
                            </userDefinedRuntimeAttribute>
                            <userDefinedRuntimeAttribute type="boolean" keyPath="ld_maskToBoundsXIB" value="YES"/>
                            <userDefinedRuntimeAttribute type="number" keyPath="ld_cornerRadiusXIB">
                                <real key="value" value="4"/>
                            </userDefinedRuntimeAttribute>
                        </userDefinedRuntimeAttributes>
                    </view>
                </subviews>
                <constraints>
                    <constraint firstItem="pTc-NR-Isq" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="14" id="9B7-HD-B05"/>
                    <constraint firstAttribute="bottom" secondItem="pTc-NR-Isq" secondAttribute="bottom" priority="750" constant="7" id="BEY-m0-17n"/>
                    <constraint firstItem="pTc-NR-Isq" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="7" id="M1r-H9-u6Q"/>
                    <constraint firstAttribute="trailing" secondItem="pTc-NR-Isq" secondAttribute="trailing" constant="14" id="oQK-5B-AHu"/>
                </constraints>
            </tableViewCellContentView>
            <connections>
                <outlet property="btn_delete" destination="v2s-kR-hqi" id="hzJ-Km-65D"/>
                <outlet property="btn_edit" destination="FU5-Nd-Orn" id="AjY-qH-Ksd"/>
                <outlet property="btn_verifiy" destination="yir-KB-bNp" id="u6F-Qu-uPr"/>
                <outlet property="img_QRCode" destination="zqS-zb-jhC" id="XNe-Sa-SvE"/>
                <outlet property="label_age" destination="gW2-8c-QGW" id="gbm-S8-rfn"/>
                <outlet property="label_idCard" destination="1mU-G5-e7O" id="qal-j2-GhY"/>
                <outlet property="label_name" destination="JEN-r1-fTe" id="cl7-6E-TtF"/>
                <outlet property="label_phone" destination="NkA-Ac-dRf" id="Ivw-wT-aGh"/>
                <outlet property="view_container" destination="pTc-NR-Isq" id="XXM-Ca-YkB"/>
            </connections>
            <point key="canvasLocation" x="164.8854961832061" y="59.507042253521128"/>
        </tableViewCell>
    </objects>
    <resources>
        <image name="btn_delete_1" width="16" height="16"/>
        <image name="btn_edit_1" width="15" height="15"/>
        <namedColor name="F6F6F6">
            <color red="0.9649999737739563" green="0.9649999737739563" blue="0.9649999737739563" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
        </namedColor>
        <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/VC/LogOffVC.swift
@@ -9,50 +9,50 @@
import WebKit
class LogOffVC: BaseVC {
    @IBOutlet weak var webView: WKWebView!
    private var timer:Timer?
    private var time:Int = 6
    @IBOutlet weak var btn_complete: UIButton!
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "注销账号"
        btn_complete.isEnabled = false
        btn_complete.backgroundColor = .gray.withAlphaComponent(0.5)
        Services.queryProtocol(.other,progress: false).subscribe(onNext: {[weak self] result in
            if let text = result.data?.jq_wrapHtml(){
                self?.webView.loadHTMLString(text, baseURL: nil)
            }
        }).disposed(by: disposeBag)
        timer = Timer(timeInterval: 1.0, repeats: true, block: {[weak self] t in
            guard let weakSelf = self else { return }
            self?.time -= 1
            self?.btn_complete.setTitle("确认(\(weakSelf.time))", for: .normal)
            if self?.time == 0{
                t.invalidate()
                self?.btn_complete.isEnabled = true
                self?.btn_complete.backgroundColor = Def_ThemeColor
                self?.btn_complete.setTitle("确认", for: .normal)
            }
        })
        timer?.fire()
        RunLoop.current.add(timer!, forMode: .common)
    }
    @IBAction func cancelAction(_ sender: UIButton) {
        navigationController?.popViewController()
    }
    @IBAction func completeAction(_ sender: Any) {
        CommonAlertView.show(title: "提示", content: "确认注销账号?") { status in
            if status{
                Services.logOff().subscribe(onNext: {data in
                    app.needLogin()
                }).disposed(by: self.disposeBag)
            }
        }
    }
                @IBOutlet weak var webView: WKWebView!
                private var timer:Timer?
                private var time:Int = 6
                @IBOutlet weak var btn_complete: UIButton!
                override func viewDidLoad() {
                                super.viewDidLoad()
                                title = "注销账号"
                                btn_complete.isEnabled = false
                                btn_complete.backgroundColor = .gray.withAlphaComponent(0.5)
                                Services.queryProtocol(.other,progress: false).subscribe(onNext: {[weak self] result in
                                                if let text = result.data?.jq_wrapHtml(){
                                                                self?.webView.loadHTMLString(text, baseURL: nil)
                                                }
                                }).disposed(by: disposeBag)
                                timer = Timer(timeInterval: 1.0, repeats: true, block: {[weak self] t in
                                                guard let weakSelf = self else { return }
                                                self?.time -= 1
                                                self?.btn_complete.setTitle("确认(\(weakSelf.time))", for: .normal)
                                                if self?.time == 0{
                                                                t.invalidate()
                                                                self?.btn_complete.isEnabled = true
                                                                self?.btn_complete.backgroundColor = Def_ThemeColor
                                                                self?.btn_complete.setTitle("确认", for: .normal)
                                                }
                                })
                                timer?.fire()
                                RunLoop.current.add(timer!, forMode: .common)
                }
                @IBAction func cancelAction(_ sender: UIButton) {
                                navigationController?.popViewController()
                }
                @IBAction func completeAction(_ sender: Any) {
                                CommonAlertView.show(title: "提示", content: "确认注销账号?") { status in
                                                if status{
                                                                Services.logOff().subscribe(onNext: {data in
                                                                                app.needLogin()
                                                                }).disposed(by: self.disposeBag)
                                                }
                                }
                }
}
WanPai/Root/Other/VC/PaymentResultVC.swift
@@ -9,380 +9,397 @@
import JQTools
class PaymentResultVC: BaseVC {
    enum PaymentResult:Equatable{
        case success
        case fail(String,Int)
    }
    enum PaymentObjType{
        case member //会员
        case courseApply //运动营报名
        case courseSUPApply //运动营报名[体验]
        case activityApply //活动报名
        case yard //场地预约
        case games //游戏
        case exchange //替换
        case recharge //充值
    }
    @IBOutlet weak var img_paymentState: UIImageView!
    @IBOutlet weak var label_content: UILabel!
    @IBOutlet weak var collectionView: UICollectionView!
    @IBOutlet weak var btn_backHome: UIButton!
    @IBOutlet weak var btn_again: UIButton!
    @IBOutlet weak var btn_back: UIButton!
    private var result:PaymentResult!
    private var objType:PaymentObjType!
    private var courseConfigId:Int?
    private var handleVC:UIViewController?
    private var models = [Any]() //CouponInfoModel ,CourseCouponModel
    private var againClouse:(()->Void)?
    var isExtend:Bool = false
    var otherInfo:Dictionary<String,Any>?
    required init(result:PaymentResult,objType:PaymentObjType,handleVC:UIViewController? = nil,courseConfigId:Int? = nil,againClouse:(()->Void)? = nil) {
        super.init(nibName: nil, bundle: nil)
        self.result = result
        self.objType = objType
        self.handleVC = handleVC
        self.againClouse = againClouse
        self.courseConfigId = courseConfigId
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        if result == .success{
            title = "支付成功"
            img_paymentState.image = UIImage(named: "icon_success")
            NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil, userInfo: nil)
        }else{
            title = "支付失败"
            img_paymentState.image = UIImage(named: "icon_fail")
        }
        switch objType{
            case .recharge:
                btn_backHome.isHidden = true
                switch result {
                    case .success:
                        label_content.text = "充值成功!"
                        self.btn_back.setTitle("返回首页", for: .normal)
                        self.btn_again.setTitle("查看详情", for: .normal)
                        NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil)
                        NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil)
                    case .fail(let string, let code):
                        self.btn_back.setTitle("返回", for: .normal)
                        self.btn_again.setTitle("再次支付", for: .normal)
                        label_content.text = string
                        if code == 2{btn_again.setTitle("去充值", for: .normal)}
                    case .none:break
                enum PaymentResult:Equatable{
                                case success
                                case fail(String,Int)
                }
        case .member:
                btn_again.isHidden = result == .success
                btn_back.isHidden = result == .success
                btn_backHome.isHidden = result != .success
                collectionView.isHidden =  result != .success
                switch result {
                    case .fail(let str, _):
                        label_content.text = str
                    case .success:
                        label_content.text = "支付成功,恭喜您成为玩湃会员!"
                        NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil)
                        NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil)
                    case .none:break
                }
                Services.queryMemberCoupon(menthod: 2).subscribe(onNext: {[weak self] data in
                    if let models = data.data{
                        self?.models = models
                        if models.count > 0{
                            self?.label_content.text = "支付成功,恭喜您成为玩湃会员!并获得优惠券!"
                        }
                        self?.collectionView.reloadData()
                    }
                }) { error in
                }.disposed(by: disposeBag)
        case .courseApply:
                //课时购买
            btn_backHome.isHidden = true
                if let id = courseConfigId{
                    Services.paymentCourseCouponList(id: id).subscribe(onNext: {[weak self] data in
                        if let models = data.data{
                            self?.models = models
                            self?.collectionView.reloadData()
                        }
                    }) { error in
                    }.disposed(by: disposeBag)
                }
            switch result {
            case .fail(let str,let code):
                btn_again.setTitle("再次支付", for: .normal)
                btn_back.setTitle("返回", for: .normal)
                label_content.text = str
                    if code == 2{btn_again.setTitle("去充值", for: .normal)}
            case .success:
                    NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil)
                    NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil)
                btn_again.setTitle("立即预约", for: .normal)
                btn_back.setTitle("返回首页", for: .normal)
                label_content.text = "报名成功,请及时预约运动营上课!"
                    if isExtend{
                        btn_back.isHidden = true
                        btn_again.setTitle("返回", for: .normal)
                        label_content.text = "续课成功!"
                    }
            case .none:break
            }
            case .courseSUPApply:
                    //课时购买
                btn_backHome.isHidden = true
                switch result {
                    case .fail(let str,let code):
                        btn_again.setTitle("再次支付", for: .normal)
                        btn_back.setTitle("返回", for: .normal)
                        label_content.text = str
                        if code == 2{btn_again.setTitle("去充值", for: .normal)}
                    case .success:
                        NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil)
                        NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil)
                        btn_again.setTitle("立即预约", for: .normal)
                        btn_back.setTitle("返回首页", for: .normal)
                        label_content.text = "报名成功,请及时预约运动营上课!"
                    case .none:break
                enum PaymentObjType{
                                case member //会员
                                case courseApply //运动营报名
                                case courseSUPApply //运动营报名[体验]
                                case activityApply //活动报名
                                case worldCup
                                case yard //场地预约
                                case games //游戏
                                case exchange //替换
                                case recharge //充值
                }
        case .activityApply:
            btn_backHome.isHidden = true
            collectionView.isHidden =  true
            switch result {
                case .fail(let str, let code):
                btn_back.setTitle("返回", for: .normal)
                label_content.text = str
                    if code == 2{btn_again.setTitle("去充值", for: .normal)}
            case .success:
                    NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil)
                    NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil)
                btn_again.setTitle("查看报名", for: .normal)
                btn_back.setTitle("返回首页", for: .normal)
                label_content.text = "报名成功,请注意活动开始时间!"
            case .none:break
            }
            case .yard:
                btn_backHome.isHidden = true
                collectionView.isHidden =  true
                switch result {
                case .fail(let str,let code):
                        label_content.text = str
                    btn_again.setTitle("再次支付", for: .normal)
                    btn_back.setTitle("返回", for: .normal)
                    if code == 2{btn_again.setTitle("去充值", for: .normal)}
                case .success:
                        NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil)
                        NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil)
                    btn_again.setTitle("查看预约", for: .normal)
                    btn_back.setTitle("返回首页", for: .normal)
                    label_content.text = "预约成功,请注意预约开始时间!"
                case .none:break
                @IBOutlet weak var img_paymentState: UIImageView!
                @IBOutlet weak var label_content: UILabel!
                @IBOutlet weak var collectionView: UICollectionView!
                @IBOutlet weak var btn_backHome: UIButton!
                @IBOutlet weak var btn_again: UIButton!
                @IBOutlet weak var btn_back: UIButton!
                private var result:PaymentResult!
                private var objType:PaymentObjType!
                private var courseConfigId:Int?
                private var handleVC:UIViewController?
                private var models = [Any]() //CouponInfoModel ,CourseCouponModel
                private var againClouse:(()->Void)?
                var isExtend:Bool = false
                var otherInfo:Dictionary<String,Any>?
                required init(result:PaymentResult,objType:PaymentObjType,handleVC:UIViewController? = nil,courseConfigId:Int? = nil,againClouse:(()->Void)? = nil) {
                                super.init(nibName: nil, bundle: nil)
                                self.result = result
                                self.objType = objType
                                self.handleVC = handleVC
                                self.againClouse = againClouse
                                self.courseConfigId = courseConfigId
                }
            case .games:
                btn_backHome.isHidden = true
                collectionView.isHidden =  true
                switch result {
                    case .fail(let str,let code):
                        btn_again.setTitle("再次支付", for: .normal)
                        btn_back.setTitle("返回", for: .normal)
                        label_content.text = str
                        if code == 2{btn_again.setTitle("去充值", for: .normal)}
                    case .success:
                        NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil)
                        btn_again.isHidden = true
                        btn_back.setTitleColor(.white, for: .normal)
                        btn_back.backgroundColor = Def_ThemeColor
                        btn_back.setTitle("我的数据", for: .normal)
                        label_content.text = "支付成功"
                    case .none:break
                required init?(coder: NSCoder) {
                                fatalError("init(coder:) has not been implemented")
                }
            case .exchange:
                switch result {
                    case .success:
                        NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil)
                        NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil)
                        label_content.text = "兑换成功"
                        btn_again.setTitle("查看详情", for: .normal)
                        btn_back.setTitle("返回首页", for: .normal)
                        btn_backHome.isHidden = true
                    case .fail(let msg, let code):
                        btn_again.setTitle("再次支付", for: .normal)
                        btn_back.setTitle("返回", for: .normal)
                        label_content.text = msg
                        if code == 2{btn_again.setTitle("去充值", for: .normal)}
                override func viewDidLoad() {
                                super.viewDidLoad()
                    case .none:break
                }
        case .none:break
        }
        collectionView.delegate = self
        collectionView.dataSource = self
        collectionView.contentInset = UIEdgeInsets(top: 0, left: 14, bottom: 0, right: 14)
        collectionView.register(UINib(nibName: "CouponCCell", bundle: nil), forCellWithReuseIdentifier: "_CouponCCell")
    }
    @IBAction func paymentAgainAction(_ sender: UIButton) {
        let str = sender.titleLabel?.text ?? ""
                                if result == .success{
                                                title = "支付成功"
                                                img_paymentState.image = UIImage(named: "icon_success")
                                                NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil, userInfo: nil)
                                }else{
                                                title = "支付失败"
                                                img_paymentState.image = UIImage(named: "icon_fail")
                                }
        switch str{
            case "查看预约":
                let vc = YardBookingListVC()
                jumpAndRemoveSelfVC(vc)
            case "立即预约":
                navigationController?.qmui_popToRootViewController(animated: true, completion: { () in
                    JQ_currentViewController().tabBarController?.selectedIndex = 1
                })
                NotificationCenter.default.post(name: UpdateCurrentStore_Noti, object: nil)
                NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil)
            case "查看报名":
                let vc = ActivitySignupListVC()
                jumpAndRemoveSelfVC(vc)
            case "再次支付":
                if objType == .courseApply{
                    navigationController?.popViewController(animated: true, {[weak self] in
                        self?.againClouse?()
                    })
                                switch objType{
                                                case.worldCup:
                                                                btn_backHome.isHidden = true
                                                                switch result {
                                                                                case .success:
                                                                                                label_content.text = "报名成功,请等待平台通知具体开赛时间"
                                                                                                self.btn_back.setTitle("返回首页", for: .normal)
                                                                                                self.btn_again.setTitle("查看排名", for: .normal)
                                                                                case .fail(let string, let code):
                                                                                                self.btn_back.setTitle("返回", for: .normal)
                                                                                                self.btn_again.setTitle("再次支付", for: .normal)
                                                                                                label_content.text = string
                                                                                                if code == 2{btn_again.setTitle("去充值", for: .normal)}
                                                                                case .none:break
                                                                }
                                                case .recharge:
                                                                btn_backHome.isHidden = true
                                                                switch result {
                                                                                case .success:
                                                                                                label_content.text = "充值成功!"
                                                                                                self.btn_back.setTitle("返回首页", for: .normal)
                                                                                                self.btn_again.setTitle("查看详情", for: .normal)
                                                                                                NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil)
                                                                                                NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil)
                                                                                case .fail(let string, let code):
                                                                                                self.btn_back.setTitle("返回", for: .normal)
                                                                                                self.btn_again.setTitle("再次支付", for: .normal)
                                                                                                label_content.text = string
                                                                                                if code == 2{btn_again.setTitle("去充值", for: .normal)}
                                                                                case .none:break
                                                                }
                                                case .member:
                                                                btn_again.isHidden = result == .success
                                                                btn_back.isHidden = result == .success
                                                                btn_backHome.isHidden = result != .success
                                                                collectionView.isHidden =  result != .success
                                                                switch result {
                                                                                case .fail(let str, _):
                                                                                                label_content.text = str
                                                                                case .success:
                                                                                                label_content.text = "支付成功,恭喜您成为玩湃会员!"
                                                                                                NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil)
                                                                                                NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil)
                                                                                case .none:break
                                                                }
                                                                Services.queryMemberCoupon(menthod: 2).subscribe(onNext: {[weak self] data in
                                                                                if let models = data.data{
                                                                                                self?.models = models
                                                                                                if models.count > 0{
                                                                                                                self?.label_content.text = "支付成功,恭喜您成为玩湃会员!并获得优惠券!"
                                                                                                }
                                                                                                self?.collectionView.reloadData()
                                                                                }
                                                                }) { error in
                                                                }.disposed(by: disposeBag)
                                                case .courseApply:
                                                                //课时购买
                                                                btn_backHome.isHidden = true
                                                                if let id = courseConfigId{
                                                                                Services.paymentCourseCouponList(id: id).subscribe(onNext: {[weak self] data in
                                                                                                if let models = data.data{
                                                                                                                self?.models = models
                                                                                                                self?.collectionView.reloadData()
                                                                                                }
                                                                                }) { error in
                                                                                }.disposed(by: disposeBag)
                                                                }
                                                                switch result {
                                                                                case .fail(let str,let code):
                                                                                                btn_again.setTitle("再次支付", for: .normal)
                                                                                                btn_back.setTitle("返回", for: .normal)
                                                                                                label_content.text = str
                                                                                                if code == 2{btn_again.setTitle("去充值", for: .normal)}
                                                                                case .success:
                                                                                                NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil)
                                                                                                NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil)
                                                                                                btn_again.setTitle("立即预约", for: .normal)
                                                                                                btn_back.setTitle("返回首页", for: .normal)
                                                                                                label_content.text = "报名成功,请及时预约运动营上课!"
                                                                                                if isExtend{
                                                                                                                btn_back.isHidden = true
                                                                                                                btn_again.setTitle("返回", for: .normal)
                                                                                                                label_content.text = "续课成功!"
                                                                                                }
                                                                                case .none:break
                                                                }
                                                case .courseSUPApply:
                                                                //课时购买
                                                                btn_backHome.isHidden = true
                                                                switch result {
                                                                                case .fail(let str,let code):
                                                                                                btn_again.setTitle("再次支付", for: .normal)
                                                                                                btn_back.setTitle("返回", for: .normal)
                                                                                                label_content.text = str
                                                                                                if code == 2{btn_again.setTitle("去充值", for: .normal)}
                                                                                case .success:
                                                                                                NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil)
                                                                                                NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil)
                                                                                                btn_again.setTitle("立即预约", for: .normal)
                                                                                                btn_back.setTitle("返回首页", for: .normal)
                                                                                                label_content.text = "报名成功,请及时预约运动营上课!"
                                                                                case .none:break
                                                                }
                                                case .activityApply:
                                                                btn_backHome.isHidden = true
                                                                collectionView.isHidden =  true
                                                                switch result {
                                                                                case .fail(let str, let code):
                                                                                                btn_back.setTitle("返回", for: .normal)
                                                                                                label_content.text = str
                                                                                                if code == 2{btn_again.setTitle("去充值", for: .normal)}
                                                                                case .success:
                                                                                                NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil)
                                                                                                NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil)
                                                                                                btn_again.setTitle("查看报名", for: .normal)
                                                                                                btn_back.setTitle("返回首页", for: .normal)
                                                                                                label_content.text = "报名成功,请注意活动开始时间!"
                                                                                case .none:break
                                                                }
                                                case .yard:
                                                                btn_backHome.isHidden = true
                                                                collectionView.isHidden =  true
                                                                switch result {
                                                                                case .fail(let str,let code):
                                                                                                label_content.text = str
                                                                                                btn_again.setTitle("再次支付", for: .normal)
                                                                                                btn_back.setTitle("返回", for: .normal)
                                                                                                if code == 2{btn_again.setTitle("去充值", for: .normal)}
                                                                                case .success:
                                                                                                NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil)
                                                                                                NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil)
                                                                                                btn_again.setTitle("查看预约", for: .normal)
                                                                                                btn_back.setTitle("返回首页", for: .normal)
                                                                                                label_content.text = "预约成功,请注意预约开始时间!"
                                                                                case .none:break
                                                                }
                                                case .games:
                                                                btn_backHome.isHidden = true
                                                                collectionView.isHidden =  true
                                                                switch result {
                                                                                case .fail(let str,let code):
                                                                                                btn_again.setTitle("再次支付", for: .normal)
                                                                                                btn_back.setTitle("返回", for: .normal)
                                                                                                label_content.text = str
                                                                                                if code == 2{btn_again.setTitle("去充值", for: .normal)}
                                                                                case .success:
                                                                                                NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil)
                                                                                                btn_again.isHidden = true
                                                                                                btn_back.setTitleColor(.white, for: .normal)
                                                                                                btn_back.backgroundColor = Def_ThemeColor
                                                                                                btn_back.setTitle("我的数据", for: .normal)
                                                                                                label_content.text = "支付成功"
                                                                                case .none:break
                                                                }
                                                case .exchange:
                                                                switch result {
                                                                                case .success:
                                                                                                NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil)
                                                                                                NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil)
                                                                                                label_content.text = "兑换成功"
                                                                                                btn_again.setTitle("查看详情", for: .normal)
                                                                                                btn_back.setTitle("返回首页", for: .normal)
                                                                                                btn_backHome.isHidden = true
                                                                                case .fail(let msg, let code):
                                                                                                btn_again.setTitle("再次支付", for: .normal)
                                                                                                btn_back.setTitle("返回", for: .normal)
                                                                                                label_content.text = msg
                                                                                                if code == 2{btn_again.setTitle("去充值", for: .normal)}
                                                                                case .none:break
                                                                }
                                                case .none:break
                                }
                                collectionView.delegate = self
                                collectionView.dataSource = self
                                collectionView.contentInset = UIEdgeInsets(top: 0, left: 14, bottom: 0, right: 14)
                                collectionView.register(UINib(nibName: "CouponCCell", bundle: nil), forCellWithReuseIdentifier: "_CouponCCell")
                }
                if objType == .recharge || objType == .yard{
                    navigationController?.popViewController()
                @IBAction func paymentAgainAction(_ sender: UIButton) {
                                let str = sender.titleLabel?.text ?? ""
                                switch str{
                                                case "查看预约":
                                                                let vc = YardBookingListVC()
                                                                jumpAndRemoveSelfVC(vc)
                                                case "立即预约":
                                                                navigationController?.qmui_popToRootViewController(animated: true, completion: { () in
                                                                                JQ_currentViewController().tabBarController?.selectedIndex = 1
                                                                })
                                                                NotificationCenter.default.post(name: UpdateCurrentStore_Noti, object: nil)
                                                                NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil)
                                                case "查看报名":
                                                                let vc = ActivitySignupListVC()
                                                                jumpAndRemoveSelfVC(vc)
                                                case "再次支付":
                                                                if objType == .courseApply{
                                                                                navigationController?.popViewController(animated: true, {[weak self] in
                                                                                                self?.againClouse?()
                                                                                })
                                                                }
                                                                if objType == .recharge || objType == .yard{
                                                                                navigationController?.popViewController()
                                                                }
                                                case "去充值":
                                                                let vc = RechargeCenterVC()
                                                                jumpAndRemoveSelfVC(vc)
                                                case "返回":
                                                                navigationController?.popViewController(animated: true, {() in
                                                                })
                                                case "查看详情":
                                                                if objType == .exchange{
                                                                                let vc = WelfareExchangeRecordListVC(pageIndex: 1)
                                                                                jumpAndRemoveSelfVC(vc)
                                                                }
                                                                if objType == .recharge{
                                                                                for (_,vc) in navigationController!.viewControllers.enumerated(){
                                                                                                if vc is RechargeRecordVC{
                                                                                                                navigationController?.popToViewController(vc, animated: true)
                                                                                                                break
                                                                                                }
                                                                                }
                                                                }
                                                default:break
                                }
                }
            case "去充值":
                let vc = RechargeCenterVC()
                jumpAndRemoveSelfVC(vc)
            case "返回":
                navigationController?.popViewController(animated: true, {() in
                })
            case "查看详情":
                if objType == .exchange{
                    let vc = WelfareExchangeRecordListVC(pageIndex: 1)
                    jumpAndRemoveSelfVC(vc)
                private func jumpAndRemoveSelfVC(_ vc:UIViewController){
                                JQ_currentViewController().navigationController?.pushViewController(vc, completion: {
                                                for (index,subVC) in (JQ_currentViewController().navigationController?.viewControllers ?? []).enumerated(){
                                                                if subVC is PaymentResultVC{
                                                                                JQ_currentViewController().navigationController?.viewControllers.remove(at: index)
                                                                }
                                                }
                                })
                }
                if objType == .recharge{
                    for (_,vc) in navigationController!.viewControllers.enumerated(){
                        if vc is RechargeRecordVC{
                            navigationController?.popToViewController(vc, animated: true)
                            break
                        }
                    }
                @IBAction func backAction(_ sender: UIButton) {
                                if sender.titleLabel?.text == "返回首页"{
                                                navigationController?.qmui_popToRootViewController(animated: true, completion: {
                                                                JQ_currentViewController().tabBarController?.selectedIndex = 0
                                                })
                                }
                                if sender.titleLabel?.text == "返回"{
                                                navigationController?.popViewController(animated: true, {() in
                                                })
                                }
                                if sender.titleLabel?.text == "我的数据"{
                                                let vc = GamesDataSourceVC()
                                                jumpAndRemoveSelfVC(vc)
                                }
                }
            default:break
        }
    }
    private func jumpAndRemoveSelfVC(_ vc:UIViewController){
        JQ_currentViewController().navigationController?.pushViewController(vc, completion: {
            for (index,subVC) in (JQ_currentViewController().navigationController?.viewControllers ?? []).enumerated(){
                if subVC is PaymentResultVC{
                    JQ_currentViewController().navigationController?.viewControllers.remove(at: index)
                override var preferredStatusBarStyle: UIStatusBarStyle{
                                return .lightContent
                }
            }
        })
    }
    @IBAction func backAction(_ sender: UIButton) {
        if sender.titleLabel?.text == "返回首页"{
            navigationController?.qmui_popToRootViewController(animated: true, completion: {
                JQ_currentViewController().tabBarController?.selectedIndex = 0
            })
        }
        if sender.titleLabel?.text == "返回"{
            navigationController?.popViewController(animated: true, {() in
            })
        }
        if sender.titleLabel?.text == "我的数据"{
            let vc = GamesDataSourceVC()
            jumpAndRemoveSelfVC(vc)
        }
    }
    override var preferredStatusBarStyle: UIStatusBarStyle{
        return .lightContent
    }
}
extension PaymentResultVC:UICollectionViewDelegate{
    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        dismiss(animated: true)
        handleVC?.navigationController?.popToRootViewController(animated: false)
        let vc = WelfareCouponsListVC()
        vc.hidesBottomBarWhenPushed = true
        JQ_currentViewController().jq_push(vc: vc)
    }
                func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
                                dismiss(animated: true)
                                handleVC?.navigationController?.popToRootViewController(animated: false)
                                let vc = WelfareCouponsListVC()
                                vc.hidesBottomBarWhenPushed = true
                                JQ_currentViewController().jq_push(vc: vc)
                }
}
extension PaymentResultVC:UICollectionViewDataSource{
    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return models.count
    }
                func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
                                return models.count
                }
    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_CouponCCell", for: indexPath) as! CouponCCell
        let model = models[indexPath.row]
                func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
                                let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_CouponCCell", for: indexPath) as! CouponCCell
                                let model = models[indexPath.row]
        if let m = model as? CourseCouponModel{
            cell.courseCouponModel = m
        }
                                if let m = model as? CourseCouponModel{
                                                cell.courseCouponModel = m
                                }
        if let m = model as? CouponInfo_1_Model{
            cell.couponInfoModel = m
        }
                                if let m = model as? CouponInfo_1_Model{
                                                cell.couponInfoModel = m
                                }
        cell.showDetailClouse = {[weak self] () in
            self?.dismiss(animated:true){ [weak self] in
                let vc = WelfareCouponsListVC()
                self?.handleVC?.navigationController?.pushViewController(vc)
            }
        }
        return cell
    }
                                cell.showDetailClouse = {[weak self] () in
                                                self?.dismiss(animated:true){ [weak self] in
                                                                let vc = WelfareCouponsListVC()
                                                                self?.handleVC?.navigationController?.pushViewController(vc)
                                                }
                                }
                                return cell
                }
}
extension PaymentResultVC:UICollectionViewDelegateFlowLayout{
    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
        return 0
    }
    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
        return 0
    }
    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
        return CGSize(width: JQ_ScreenW, height: 120)
    }
                func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
                                return 0
                }
                func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
                                return 0
                }
                func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
                                return CGSize(width: JQ_ScreenW, height: 120)
                }
}
WanPai/Root/Other/View/StudentChoose2View.swift
New file
@@ -0,0 +1,126 @@
//
//  StudentChoose2View.swift
//  WanPai
//
//  Created by 无故事王国 on 2024/3/4.
//
import UIKit
import JQTools
import QMUIKit
import RxSwift
import RxCocoa
import HandyJSON
class StudentWorldCupViewModel:RefreshModel<ActivityDetailPartModel>{
                override func api() -> (Observable<BaseResponse<[ActivityDetailPartModel]>>)? {
                                return     Services.getParticipant()
                }
}
class StudentChoose2View: UIView,JQNibView {
                @IBOutlet weak var tableView: UITableView!
                @IBOutlet weak var view_container: UIView!
                @IBOutlet weak var cons_bottom: NSLayoutConstraint!
                @IBOutlet weak var cons_tableHei: NSLayoutConstraint!
                @IBOutlet weak var cons_tableLeading: NSLayoutConstraint!
                @IBOutlet weak var cons_tableTrailing: NSLayoutConstraint!
                private var clickClouse:((ActivityDetailPartModel)->Void)!
                private var needAddClouse:(()->Void)!
                private var selectStudents:ActivityDetailPartModel?
                private var disposeBag = DisposeBag()
                private var viewModel = StudentWorldCupViewModel()
                override func awakeFromNib() {
                                super.awakeFromNib()
                                cons_bottom.constant = -(JQ_ScreenW * 1.1)
                                tableView.delegate = self
                                tableView.dataSource = self
                                tableView.separatorStyle = .none
                                alpha = 0
                                layoutIfNeeded()
                                setRx()
                }
                static func show(defaultStu:ActivityDetailPartModel? = nil,clickClouse:@escaping (ActivityDetailPartModel)->Void){
                                let studentChooseView = StudentChoose2View.jq_loadNibView()
                                if defaultStu != nil{
                                                studentChooseView.selectStudents = defaultStu!
                                }
                                studentChooseView.tableView.register(UINib(nibName: "StudentInfo_2_TCell", bundle: nil), forCellReuseIdentifier: "_StudentInfo_2_TCell")
                                studentChooseView.frame = sceneDelegate?.window?.frame ?? .zero
                                studentChooseView.clickClouse = clickClouse
                                sceneDelegate?.window?.addSubview(studentChooseView)
                                studentChooseView.cons_bottom.constant = 0
                                studentChooseView.viewModel.configure(studentChooseView.tableView,needMore: false)
                                studentChooseView.viewModel.beginRefresh()
                                UIView.animate(withDuration: 0.4) {
                                                studentChooseView.alpha = 1
                                                studentChooseView.layoutIfNeeded()
                                                studentChooseView.tableView.reloadData()
                                }
                }
                private func setRx(){
                                viewModel.dataSource.subscribe(onNext: {[weak self] data in
                                                let hei = min(360,Double(data.count) * 90.0)
                                                self?.cons_tableHei.constant = hei
                                                UIView.animate(withDuration: 0.4) {
                                                                self?.layoutIfNeeded()
                                                }
                                }).disposed(by: disposeBag)
                }
                @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) {
                                //                                clickClouse!(selectStudents)
                                closeAction()
                }
}
extension StudentChoose2View:UITableViewDelegate{
                func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
                                let item = viewModel.dataSource.value[indexPath.row]
                                self.selectStudents = item
                                tableView.reloadData()
                }
}
extension StudentChoose2View:UITableViewDataSource{
                func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
                                return viewModel.dataSource.value.count
                }
                func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
                                let cell = tableView.dequeueReusableCell(withIdentifier: "_StudentInfo_2_TCell") as! StudentInfo_2_TCell
                                cell.btn_delete.isHidden = true
                                cell.btn_edit.isHidden = true
                                return cell
                                return UITableViewCell()
                }
}
WanPai/Root/Other/View/StudentChoose2View.xib
New file
@@ -0,0 +1,112 @@
<?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="StudentChoose2View" 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="7FQ-69-hgm">
                    <rect key="frame" x="0.0" y="516.33333333333337" width="393" height="335.66666666666663"/>
                    <subviews>
                        <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="bvu-f9-O9y">
                            <rect key="frame" x="14" y="53.666666666666629" width="365" height="166"/>
                            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                            <constraints>
                                <constraint firstAttribute="height" constant="166" id="8Qd-RV-3by"/>
                            </constraints>
                        </tableView>
                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="w9N-bm-gn4">
                            <rect key="frame" x="100" y="235.66666666666663" width="193" height="40"/>
                            <color key="backgroundColor" name="FE6E0D"/>
                            <constraints>
                                <constraint firstAttribute="height" constant="40" id="K2Z-wB-gN3"/>
                            </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="Tma-p2-mYe"/>
                            </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="JIO-Dm-ZQh">
                            <rect key="frame" x="164" y="18" width="65.333333333333314" 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="Do0-Pq-I22">
                            <rect key="frame" x="358" y="15" width="25" height="25"/>
                            <constraints>
                                <constraint firstAttribute="height" constant="25" id="vzx-Ib-DX6"/>
                                <constraint firstAttribute="width" constant="25" id="zyO-VL-XFF"/>
                            </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="edg-G1-1fF"/>
                            </connections>
                        </button>
                    </subviews>
                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                    <constraints>
                        <constraint firstItem="w9N-bm-gn4" firstAttribute="leading" secondItem="7FQ-69-hgm" secondAttribute="leading" constant="100" id="1ga-6Y-9g4"/>
                        <constraint firstItem="JIO-Dm-ZQh" firstAttribute="top" secondItem="7FQ-69-hgm" secondAttribute="top" constant="18" id="4an-8m-oKz"/>
                        <constraint firstAttribute="trailing" secondItem="Do0-Pq-I22" secondAttribute="trailing" constant="10" id="5q2-Mp-tVZ"/>
                        <constraint firstItem="bvu-f9-O9y" firstAttribute="top" secondItem="JIO-Dm-ZQh" secondAttribute="bottom" constant="16.5" id="6yL-KN-enl"/>
                        <constraint firstAttribute="bottomMargin" secondItem="w9N-bm-gn4" secondAttribute="bottom" constant="18" id="FDy-ib-Mgc"/>
                        <constraint firstItem="bvu-f9-O9y" firstAttribute="leading" secondItem="7FQ-69-hgm" secondAttribute="leading" constant="14" id="GQX-mj-ulO"/>
                        <constraint firstItem="JIO-Dm-ZQh" firstAttribute="centerX" secondItem="7FQ-69-hgm" secondAttribute="centerX" id="Qch-Yu-4Ph"/>
                        <constraint firstAttribute="trailing" secondItem="w9N-bm-gn4" secondAttribute="trailing" constant="100" id="T7K-dl-5nK"/>
                        <constraint firstAttribute="trailing" secondItem="bvu-f9-O9y" secondAttribute="trailing" constant="14" id="XGp-wX-djd"/>
                        <constraint firstItem="w9N-bm-gn4" firstAttribute="top" secondItem="bvu-f9-O9y" secondAttribute="bottom" constant="16" id="cEv-f8-tbi"/>
                        <constraint firstItem="Do0-Pq-I22" firstAttribute="centerY" secondItem="JIO-Dm-ZQh" secondAttribute="centerY" id="iEG-ZN-XKS"/>
                    </constraints>
                </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="7FQ-69-hgm" secondAttribute="trailing" id="Cvx-RO-wNo"/>
                <constraint firstAttribute="bottom" secondItem="7FQ-69-hgm" secondAttribute="bottom" id="joU-Fe-X1x"/>
                <constraint firstItem="7FQ-69-hgm" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="vwp-6h-Iw9"/>
            </constraints>
            <connections>
                <outlet property="cons_bottom" destination="joU-Fe-X1x" id="cUV-ug-xnc"/>
                <outlet property="cons_tableHei" destination="8Qd-RV-3by" id="phS-a7-amb"/>
                <outlet property="cons_tableLeading" destination="GQX-mj-ulO" id="1vv-Kc-oyL"/>
                <outlet property="cons_tableTrailing" destination="XGp-wX-djd" id="6nF-tx-xg6"/>
                <outlet property="tableView" destination="bvu-f9-O9y" id="hsh-5R-sfE"/>
                <outlet property="view_container" destination="7FQ-69-hgm" id="p5y-Rv-PzA"/>
            </connections>
            <point key="canvasLocation" x="81.679389312977094" 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/StudentChooseView.swift
@@ -13,221 +13,221 @@
import HandyJSON
class StudentViewModel:RefreshModel<CourseDetailStudentModel>{
    override func api() -> (Observable<BaseResponse<[CourseDetailStudentModel]>>)? {
        return Services.queryStudentList()
    }
                override func api() -> (Observable<BaseResponse<[CourseDetailStudentModel]>>)? {
                                return Services.queryStudentList()
                }
}
class ActivityViewModel:RefreshModel<ActivityDetailPartModel>{
    var isAuth = BehaviorRelay<Int?>.init(value: nil)
    override func api() -> (Observable<BaseResponse<[ActivityDetailPartModel]>>)? {
        return Services.queryParticipantList(isAuth: isAuth.value)
    }
                var isAuth = BehaviorRelay<Int?>.init(value: nil)
                override func api() -> (Observable<BaseResponse<[ActivityDetailPartModel]>>)? {
                                return Services.queryParticipantList(isAuth: isAuth.value)
                }
}
class StudentChooseView: UIView,JQNibView{
    @IBOutlet weak var tableView: UITableView!
    @IBOutlet weak var view_container: UIView!
    @IBOutlet weak var cons_bottom: NSLayoutConstraint!
    @IBOutlet weak var btn_add: QMUIButton!
    @IBOutlet weak var cons_tableHei: NSLayoutConstraint!
    @IBOutlet weak var cons_tableLeading: NSLayoutConstraint!
    @IBOutlet weak var cons_tableTrailing: NSLayoutConstraint!
    private var clickClouse:(([Any])->Void)!
    private var needAddClouse:(()->Void)!
    private var itemType:ItemType!
    private var selectStudents = [Any]()
    private var disposeBag = DisposeBag()
    private lazy var stuViewModel:StudentViewModel = {
        return StudentViewModel()
    }()
    private lazy var actViewModel:ActivityViewModel = {
        return ActivityViewModel()
    }()
    override func awakeFromNib() {
        super.awakeFromNib()
        btn_add.imagePosition = .right
        btn_add.spacingBetweenImageAndTitle = 5
        cons_bottom.constant = -(JQ_ScreenW * 1.1)
        tableView.delegate = self
        tableView.dataSource = self
        tableView.separatorStyle = .none
        alpha = 0
        layoutIfNeeded()
        setRx()
    }
    static func show(itemType:ItemType,defaultStu:[Any]? = nil,isAuth:Int? = nil,clickClouse:@escaping ([Any])->Void,needAddClouse:@escaping ()->Void){
        let studentChooseView = StudentChooseView.jq_loadNibView()
        if defaultStu != nil{
            studentChooseView.selectStudents = defaultStu!
        }
        if itemType == .course{
            studentChooseView.tableView.register(UINib(nibName: "StudentInfoTCell", bundle: nil), forCellReuseIdentifier: "_StudentInfoTCell")
            studentChooseView.btn_add.setTitle("添加运动营成员", for: .normal)
        }else if itemType == .activity{
            studentChooseView.tableView.register(UINib(nibName: "StudentInfo_2_TCell", bundle: nil), forCellReuseIdentifier: "_StudentInfo_2_TCell")
            studentChooseView.btn_add.setTitle("添加人员", for: .normal)
        }
        studentChooseView.frame = sceneDelegate?.window?.frame ?? .zero
        studentChooseView.itemType = itemType
        studentChooseView.clickClouse = clickClouse
        studentChooseView.needAddClouse = needAddClouse
        sceneDelegate?.window?.addSubview(studentChooseView)
        studentChooseView.cons_bottom.constant = 0
        if itemType == .course{
            studentChooseView.stuViewModel.configure(studentChooseView.tableView,needMore: false)
            studentChooseView.stuViewModel.beginRefresh()
        }else{
            studentChooseView.actViewModel.configure(studentChooseView.tableView,needMore: false)
            studentChooseView.actViewModel.isAuth.accept(isAuth)
            studentChooseView.actViewModel.beginRefresh()
            studentChooseView.cons_tableLeading.constant = 0
            studentChooseView.cons_tableTrailing.constant = 0
        }
        UIView.animate(withDuration: 0.4) {
            studentChooseView.alpha = 1
            studentChooseView.layoutIfNeeded()
            studentChooseView.tableView.reloadData()
        }
    }
    private func setRx(){
        stuViewModel.dataSource.subscribe(onNext: {[weak self] data in
            let hei = min(360,Double(data.count) * 90.0)
            self?.cons_tableHei.constant = hei
            UIView.animate(withDuration: 0.4) {
                self?.layoutIfNeeded()
            }
        }).disposed(by: disposeBag)
        actViewModel.dataSource.subscribe(onNext: {[weak self] data in
            let hei = min(360,Double(data.count) * 90.0)
            self?.cons_tableHei.constant = hei
            UIView.animate(withDuration: 0.4) {
                self?.layoutIfNeeded()
            }
        }).disposed(by: disposeBag)
    }
    @IBAction func closeAction(_ sender: UIButton) {
        closeAction()
    }
    @IBAction func addNewStudentAction(_ sender: QMUIButton) {
        needAddClouse!()
        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) {
        clickClouse!(selectStudents)
        closeAction()
    }
                @IBOutlet weak var tableView: UITableView!
                @IBOutlet weak var view_container: UIView!
                @IBOutlet weak var cons_bottom: NSLayoutConstraint!
                @IBOutlet weak var btn_add: QMUIButton!
                @IBOutlet weak var cons_tableHei: NSLayoutConstraint!
                @IBOutlet weak var cons_tableLeading: NSLayoutConstraint!
                @IBOutlet weak var cons_tableTrailing: NSLayoutConstraint!
                private var clickClouse:(([Any])->Void)!
                private var needAddClouse:(()->Void)!
                private var itemType:ItemType!
                private var selectStudents = [Any]()
                private var disposeBag = DisposeBag()
                private lazy var stuViewModel:StudentViewModel = {
                                return StudentViewModel()
                }()
                private lazy var actViewModel:ActivityViewModel = {
                                return ActivityViewModel()
                }()
                override func awakeFromNib() {
                                super.awakeFromNib()
                                btn_add.imagePosition = .right
                                btn_add.spacingBetweenImageAndTitle = 5
                                cons_bottom.constant = -(JQ_ScreenW * 1.1)
                                tableView.delegate = self
                                tableView.dataSource = self
                                tableView.separatorStyle = .none
                                alpha = 0
                                layoutIfNeeded()
                                setRx()
                }
                static func show(itemType:ItemType,defaultStu:[Any]? = nil,isAuth:Int? = nil,clickClouse:@escaping ([Any])->Void,needAddClouse:@escaping ()->Void){
                                let studentChooseView = StudentChooseView.jq_loadNibView()
                                if defaultStu != nil{
                                                studentChooseView.selectStudents = defaultStu!
                                }
                                if itemType == .course{
                                                studentChooseView.tableView.register(UINib(nibName: "StudentInfoTCell", bundle: nil), forCellReuseIdentifier: "_StudentInfoTCell")
                                                studentChooseView.btn_add.setTitle("添加运动营成员", for: .normal)
                                }else if itemType == .activity{
                                                studentChooseView.tableView.register(UINib(nibName: "StudentInfo_2_TCell", bundle: nil), forCellReuseIdentifier: "_StudentInfo_2_TCell")
                                                studentChooseView.btn_add.setTitle("添加人员", for: .normal)
                                }
                                studentChooseView.frame = sceneDelegate?.window?.frame ?? .zero
                                studentChooseView.itemType = itemType
                                studentChooseView.clickClouse = clickClouse
                                studentChooseView.needAddClouse = needAddClouse
                                sceneDelegate?.window?.addSubview(studentChooseView)
                                studentChooseView.cons_bottom.constant = 0
                                if itemType == .course{
                                                studentChooseView.stuViewModel.configure(studentChooseView.tableView,needMore: false)
                                                studentChooseView.stuViewModel.beginRefresh()
                                }else{
                                                studentChooseView.actViewModel.configure(studentChooseView.tableView,needMore: false)
                                                studentChooseView.actViewModel.isAuth.accept(isAuth)
                                                studentChooseView.actViewModel.beginRefresh()
                                                studentChooseView.cons_tableLeading.constant = 0
                                                studentChooseView.cons_tableTrailing.constant = 0
                                }
                                UIView.animate(withDuration: 0.4) {
                                                studentChooseView.alpha = 1
                                                studentChooseView.layoutIfNeeded()
                                                studentChooseView.tableView.reloadData()
                                }
                }
                private func setRx(){
                                stuViewModel.dataSource.subscribe(onNext: {[weak self] data in
                                                let hei = min(360,Double(data.count) * 90.0)
                                                self?.cons_tableHei.constant = hei
                                                UIView.animate(withDuration: 0.4) {
                                                                self?.layoutIfNeeded()
                                                }
                                }).disposed(by: disposeBag)
                                actViewModel.dataSource.subscribe(onNext: {[weak self] data in
                                                let hei = min(360,Double(data.count) * 90.0)
                                                self?.cons_tableHei.constant = hei
                                                UIView.animate(withDuration: 0.4) {
                                                                self?.layoutIfNeeded()
                                                }
                                }).disposed(by: disposeBag)
                }
                @IBAction func closeAction(_ sender: UIButton) {
                                closeAction()
                }
                @IBAction func addNewStudentAction(_ sender: QMUIButton) {
                                needAddClouse!()
                                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) {
                                clickClouse!(selectStudents)
                                closeAction()
                }
}
extension StudentChooseView:UITableViewDelegate{
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        if itemType == .course{
            let item = stuViewModel.dataSource.value[indexPath.row]
           if self.selectStudents.contains(where: {($0 as! CourseDetailStudentModel).id == item.id}){
               if self.selectStudents.count == 1{
                   alert(msg: "至少选择一位运动营成员");return
               }
               if let index = self.selectStudents.firstIndex(where: {($0 as! CourseDetailStudentModel).id == item.id}){
                   self.selectStudents.remove(at: index)
               }
           }else{
               self.selectStudents.append(item)
           }
        }else{
            let item = actViewModel.dataSource.value[indexPath.row]
           if self.selectStudents.contains(where: {($0 as! ActivityDetailPartModel).id == item.id}){
               if self.selectStudents.count == 1{
                   alert(msg: "至少选择一位运动营成员");return
               }
               if let index = self.selectStudents.firstIndex(where: {($0 as! ActivityDetailPartModel).id == item.id}){
                   self.selectStudents.remove(at: index)
               }
           }else{
               self.selectStudents.append(item)
           }
        }
        tableView.reloadData()
    }
                func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
                                if itemType == .course{
                                                let item = stuViewModel.dataSource.value[indexPath.row]
                                                if self.selectStudents.contains(where: {($0 as! CourseDetailStudentModel).id == item.id}){
                                                                if self.selectStudents.count == 1{
                                                                                alert(msg: "至少选择一位运动营成员");return
                                                                }
                                                                if let index = self.selectStudents.firstIndex(where: {($0 as! CourseDetailStudentModel).id == item.id}){
                                                                                self.selectStudents.remove(at: index)
                                                                }
                                                }else{
                                                                self.selectStudents.append(item)
                                                }
                                }else{
                                                let item = actViewModel.dataSource.value[indexPath.row]
                                                if self.selectStudents.contains(where: {($0 as! ActivityDetailPartModel).id == item.id}){
                                                                if self.selectStudents.count == 1{
                                                                                alert(msg: "至少选择一位运动营成员");return
                                                                }
                                                                if let index = self.selectStudents.firstIndex(where: {($0 as! ActivityDetailPartModel).id == item.id}){
                                                                                self.selectStudents.remove(at: index)
                                                                }
                                                }else{
                                                                self.selectStudents.append(item)
                                                }
                                }
                                tableView.reloadData()
                }
}
extension StudentChooseView:UITableViewDataSource{
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        if itemType == .course{
            return stuViewModel.dataSource.value.count
        }else{
            return actViewModel.dataSource.value.count
        }
    }
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        if itemType == .course{
            let item = stuViewModel.dataSource.value[indexPath.row]
            let cell = tableView.dequeueReusableCell(withIdentifier: "_StudentInfoTCell") as! StudentInfoTCell
            cell.cons_handleCenterY.constant = -7
            if self.selectStudents.contains(where: {($0 as! CourseDetailStudentModel).id == item.id}){
                cell.btn_handle.setImage(UIImage(named: "btn_choose_s"), for: .normal)
                cell.view_container.borderColor = UIColor(hexStr: "#FD7902").withAlphaComponent(0.28)
            }else{
                cell.btn_handle.setImage(nil, for: .normal)
                cell.view_container.borderColor = UIColor(hexStr: "#ADADAD").withAlphaComponent(0.28)
            }
            cell.studentModel = item
            return cell
        }else if itemType == .activity{
            let item = actViewModel.dataSource.value[indexPath.row]
            let cell = tableView.dequeueReusableCell(withIdentifier: "_StudentInfo_2_TCell") as! StudentInfo_2_TCell
            cell.btn_delete.isHidden = true
            cell.btn_edit.isHidden = true
            cell.activityDetailPartModel = item
            if self.selectStudents.contains(where: {($0 as! ActivityDetailPartModel).id == item.id}){
                cell.img_radio.image = UIImage(named: "btn_choose_s")
                cell.view_container.borderColor = UIColor(hexStr: "#FD7902").withAlphaComponent(0.28)
            }else{
                cell.img_radio.image = UIImage(named: "")
                cell.view_container.borderColor = UIColor(hexStr: "#ADADAD").withAlphaComponent(0.28)
            }
            return cell
        }
        return UITableViewCell()
    }
                func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
                                if itemType == .course{
                                                return stuViewModel.dataSource.value.count
                                }else{
                                                return actViewModel.dataSource.value.count
                                }
                }
                func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
                                if itemType == .course{
                                                let item = stuViewModel.dataSource.value[indexPath.row]
                                                let cell = tableView.dequeueReusableCell(withIdentifier: "_StudentInfoTCell") as! StudentInfoTCell
                                                cell.cons_handleCenterY.constant = -7
                                                if self.selectStudents.contains(where: {($0 as! CourseDetailStudentModel).id == item.id}){
                                                                cell.btn_handle.setImage(UIImage(named: "btn_choose_s"), for: .normal)
                                                                cell.view_container.borderColor = UIColor(hexStr: "#FD7902").withAlphaComponent(0.28)
                                                }else{
                                                                cell.btn_handle.setImage(nil, for: .normal)
                                                                cell.view_container.borderColor = UIColor(hexStr: "#ADADAD").withAlphaComponent(0.28)
                                                }
                                                cell.studentModel = item
                                                return cell
                                }else if itemType == .activity{
                                                let item = actViewModel.dataSource.value[indexPath.row]
                                                let cell = tableView.dequeueReusableCell(withIdentifier: "_StudentInfo_2_TCell") as! StudentInfo_2_TCell
                                                cell.btn_delete.isHidden = true
                                                cell.btn_edit.isHidden = true
                                                cell.activityDetailPartModel = item
                                                if self.selectStudents.contains(where: {($0 as! ActivityDetailPartModel).id == item.id}){
                                                                cell.img_radio.image = UIImage(named: "btn_choose_s")
                                                                cell.view_container.borderColor = UIColor(hexStr: "#FD7902").withAlphaComponent(0.28)
                                                }else{
                                                                cell.img_radio.image = UIImage(named: "")
                                                                cell.view_container.borderColor = UIColor(hexStr: "#ADADAD").withAlphaComponent(0.28)
                                                }
                                                return cell
                                }
                                return UITableViewCell()
                }
}
WanPai/Root/Search/TCell/JudgeTCell.swift
New file
@@ -0,0 +1,29 @@
//
//  JudgeTCell.swift
//  WanPai
//
//  Created by 无故事王国 on 2024/2/29.
//
import UIKit
class JudgeTCell: UITableViewCell {
                @IBOutlet weak var label_title: UILabel!
                @IBOutlet weak var label_state: UILabel!
                @IBOutlet weak var label_time: UILabel!
                @IBOutlet weak var label_times: UILabel!
    override func awakeFromNib() {
        super.awakeFromNib()
                                selectionStyle = .none
    }
                func setModel(_ model:WorldCupJudgeModel){
                                label_title.text = model.name
                                label_state.text = model.status.rawTitle
                                label_time.text = "活动时间:\(model.activeTime)"
                                label_times.text = "已比赛场次数:\(model.matchNumber)"
                }
}
WanPai/Root/Search/TCell/JudgeTCell.xib
New file
@@ -0,0 +1,112 @@
<?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="Safe area layout guides" minToolsVersion="9.0"/>
        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
    </dependencies>
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
        <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="_JudgeTCell" rowHeight="155" id="KGk-i7-Jjw" customClass="JudgeTCell" customModule="WanPai" customModuleProvider="target">
            <rect key="frame" x="0.0" y="0.0" width="320" height="155"/>
            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
                <rect key="frame" x="0.0" y="0.0" width="320" height="155"/>
                <autoresizingMask key="autoresizingMask"/>
                <subviews>
                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZLH-5W-zTr">
                        <rect key="frame" x="14" y="20" width="14.666666666666664" height="22"/>
                        <constraints>
                            <constraint firstAttribute="height" constant="22" id="5iH-1f-Qem"/>
                        </constraints>
                        <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
                        <color key="textColor" red="0.23921568627450979" green="0.24313725490196078" blue="0.27058823529411763" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                        <nil key="highlightedColor"/>
                    </label>
                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_time_mini_gray" translatesAutoresizingMaskIntoConstraints="NO" id="veC-Jz-GPK">
                        <rect key="frame" x="14" y="56" width="14" height="14"/>
                    </imageView>
                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_math_num" translatesAutoresizingMaskIntoConstraints="NO" id="qPl-Yn-01J">
                        <rect key="frame" x="14" y="81" width="15" height="15"/>
                    </imageView>
                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="duw-1y-5vU">
                        <rect key="frame" x="32" y="56" width="11.666666666666664" height="14.333333333333329"/>
                        <fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/>
                        <color key="textColor" red="0.45098039215686275" green="0.45098039215686275" blue="0.45098039215686275" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                        <nil key="highlightedColor"/>
                    </label>
                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="djT-fc-noO">
                        <rect key="frame" x="32" y="81.333333333333329" width="11.666666666666664" height="14.333333333333329"/>
                        <fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/>
                        <color key="textColor" red="0.45098039220000002" green="0.45098039220000002" blue="0.45098039220000002" 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="F8q-ir-Qf1">
                        <rect key="frame" x="294.33333333333331" y="24" width="11.666666666666686" height="14.333333333333336"/>
                        <fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/>
                        <color key="textColor" red="0.45098039220000002" green="0.45098039220000002" blue="0.45098039220000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                        <nil key="highlightedColor"/>
                    </label>
                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Vdj-Ri-TLK">
                        <rect key="frame" x="14" y="154" width="306" height="1"/>
                        <color key="backgroundColor" red="0.59215686274509804" green="0.59215686274509804" blue="0.59215686274509804" alpha="0.22" colorSpace="custom" customColorSpace="sRGB"/>
                        <constraints>
                            <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">
                        <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>
                            <constraint firstAttribute="width" constant="75" id="UdI-Fa-f0s"/>
                            <constraint firstAttribute="height" constant="31" id="y47-HG-dLH"/>
                        </constraints>
                        <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/>
                        <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="3"/>
                            </userDefinedRuntimeAttribute>
                        </userDefinedRuntimeAttributes>
                    </button>
                </subviews>
                <constraints>
                    <constraint firstItem="duw-1y-5vU" firstAttribute="leading" secondItem="veC-Jz-GPK" secondAttribute="trailing" constant="4" id="3v9-Dr-Jme"/>
                    <constraint firstAttribute="trailing" secondItem="F8q-ir-Qf1" secondAttribute="trailing" constant="14" id="4Oo-hh-x1F"/>
                    <constraint firstItem="duw-1y-5vU" firstAttribute="centerY" secondItem="veC-Jz-GPK" secondAttribute="centerY" id="79z-JJ-b3e"/>
                    <constraint firstItem="veC-Jz-GPK" firstAttribute="top" secondItem="ZLH-5W-zTr" secondAttribute="bottom" constant="14" id="9FN-sZ-mgv"/>
                    <constraint firstItem="Vdj-Ri-TLK" firstAttribute="top" secondItem="vza-pw-uzb" secondAttribute="bottom" constant="14" id="A4r-Tl-38g"/>
                    <constraint firstItem="qPl-Yn-01J" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="14" id="EyL-Yw-m30"/>
                    <constraint firstItem="ZLH-5W-zTr" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="14" id="GBh-8s-6zX"/>
                    <constraint firstAttribute="trailing" secondItem="vza-pw-uzb" secondAttribute="trailing" constant="12" id="HJE-HB-ltl"/>
                    <constraint firstItem="Vdj-Ri-TLK" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="14" id="QmT-fI-wIg"/>
                    <constraint firstAttribute="bottom" secondItem="Vdj-Ri-TLK" secondAttribute="bottom" id="Vto-ht-iCH"/>
                    <constraint firstItem="veC-Jz-GPK" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="14" id="aIN-aO-mW2"/>
                    <constraint firstItem="djT-fc-noO" firstAttribute="leading" secondItem="duw-1y-5vU" secondAttribute="leading" id="nvQ-W2-Grg"/>
                    <constraint firstItem="F8q-ir-Qf1" firstAttribute="centerY" secondItem="ZLH-5W-zTr" secondAttribute="centerY" id="pAf-CQ-yz8"/>
                    <constraint firstAttribute="trailing" secondItem="Vdj-Ri-TLK" secondAttribute="trailing" id="s2b-fG-KxE"/>
                    <constraint firstItem="djT-fc-noO" firstAttribute="centerY" secondItem="qPl-Yn-01J" secondAttribute="centerY" id="vMj-YP-EZp"/>
                    <constraint firstItem="ZLH-5W-zTr" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="20" id="w8w-ml-KBE"/>
                    <constraint firstItem="qPl-Yn-01J" firstAttribute="top" secondItem="veC-Jz-GPK" secondAttribute="bottom" constant="11" id="yku-RA-jBk"/>
                </constraints>
            </tableViewCellContentView>
            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
            <connections>
                <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"/>
                <outlet property="label_title" destination="ZLH-5W-zTr" id="lPQ-fK-vH6"/>
            </connections>
            <point key="canvasLocation" x="33.587786259541986" y="59.507042253521128"/>
        </tableViewCell>
    </objects>
    <resources>
        <image name="icon_math_num" width="15" height="15"/>
        <image name="icon_time_mini_gray" width="14" height="14"/>
    </resources>
</document>
WanPai/Root/Search/TCell/MyQRCodeTCell.swift
@@ -9,6 +9,17 @@
class MyQRCodeTCell: UITableViewCell {
                @IBOutlet weak var view_container: UIView!
                @IBOutlet weak var label_name: UILabel!
                @IBOutlet weak var label_age: UILabel!
                @IBOutlet weak var img_QRCode: UIImageView!
                var studentProfile1Model:StudentProfile1Model!{
                                didSet{
                                                label_name.text = studentProfile1Model.stuName
                                                label_age.text = "\(studentProfile1Model.stuAge)岁"
                                                img_QRCode.image = UIImage.jq_GenerateQRCode(with: "\(studentProfile1Model.stuId)", width: 100)
                                }
                }
    override func awakeFromNib() {
        super.awakeFromNib()
WanPai/Root/Search/TCell/MyQRCodeTCell.xib
@@ -83,6 +83,9 @@
                </constraints>
            </tableViewCellContentView>
            <connections>
                <outlet property="img_QRCode" destination="hOG-rl-POS" id="Lu4-3x-fU7"/>
                <outlet property="label_age" destination="KwF-AF-WE6" id="ZiB-Ba-RJ3"/>
                <outlet property="label_name" destination="Hlr-vD-idp" id="VDh-wm-WCH"/>
                <outlet property="view_container" destination="OzX-LD-ebb" id="7ap-FZ-Wsy"/>
            </connections>
            <point key="canvasLocation" x="247.32824427480915" y="77.816901408450704"/>
WanPai/Root/Search/TCell/StudentInfo_4_TCell.swift
@@ -9,8 +9,27 @@
class StudentInfo_4_TCell: UITableViewCell {
                var activityDetailPartModel:ActivityDetailPartModel?{
                                didSet{
                                                if let model = activityDetailPartModel{
                                                                label_name.text = model.name
                                                                label_age.text = "\(model.age)岁"
                                                                label_idCard.text = model.idcard
                                                                label_phone.text = model.phone
                                                                img_QRCode.image = UIImage.jq_generateQRCode(with: "\(model.id)", width: 30)
                                                }
                                }
                }
                @IBOutlet weak var label_name: UILabel!
                @IBOutlet weak var label_age: UILabel!
                @IBOutlet weak var label_idCard: UILabel!
                @IBOutlet weak var label_phone: UILabel!
                @IBOutlet weak var img_QRCode: UIImageView!
    override func awakeFromNib() {
        super.awakeFromNib()
                                selectionStyle = .none
    }
}
WanPai/Root/Search/TCell/StudentInfo_4_TCell.xib
@@ -136,6 +136,13 @@
                </constraints>
            </tableViewCellContentView>
            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
            <connections>
                <outlet property="img_QRCode" destination="DCI-Sz-1AX" id="bNa-Pz-tbg"/>
                <outlet property="label_age" destination="Rtg-7l-b7G" id="8h7-8g-mXd"/>
                <outlet property="label_idCard" destination="tqb-xC-9qk" id="gIT-CI-0DI"/>
                <outlet property="label_name" destination="h4n-nl-K9g" id="asV-Rp-OO9"/>
                <outlet property="label_phone" destination="z6w-gZ-omO" id="PzC-gW-8D9"/>
            </connections>
            <point key="canvasLocation" x="144.27480916030532" y="41.197183098591552"/>
        </tableViewCell>
    </objects>
WanPai/Root/Search/TCell/WorldCupRecordTCell.swift
@@ -9,6 +9,32 @@
class WorldCupRecordTCell: UITableViewCell {
                var model:WorldCupMatchRecordDataModel?{
                                didSet{
                                                if let m = model{
                                                                label_title.text = m.name
                                                                label_mathScore.text = "\(m.ourScore):\(m.opponentScore)"
                                                                label_datetime.text = m.startTime
                                                                label_getCoin.text = "获得积分:\(m.award)"
                                                                label_getCoin.isHidden = m.award == 0
                                                                if m.matchResult == 1{
                                                                                img_state.image = UIImage(named: "icon_winner")
                                                                }else{
                                                                                img_state.image = UIImage(named: "icon_lose")
                                                                }
                                                }
                                }
                }
                @IBOutlet weak var label_title: UILabel!
                @IBOutlet weak var label_mathScore: UILabel!
                @IBOutlet weak var label_datetime: UILabel!
                @IBOutlet weak var img_state: UIImageView!
                @IBOutlet weak var label_getCoin: UILabel!
    override func awakeFromNib() {
        super.awakeFromNib()
                                backgroundColor = .clear
WanPai/Root/Search/TCell/WorldCupRecordTCell.xib
@@ -95,6 +95,13 @@
                </constraints>
            </tableViewCellContentView>
            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
            <connections>
                <outlet property="img_state" destination="2Te-if-XIR" id="oU6-zr-h4A"/>
                <outlet property="label_datetime" destination="49D-wu-uWd" id="qPM-8P-43X"/>
                <outlet property="label_getCoin" destination="LHg-l0-pUp" id="8mB-bM-V1Q"/>
                <outlet property="label_mathScore" destination="LL4-oU-Vn8" id="gFw-Av-SD6"/>
                <outlet property="label_title" destination="WLz-mA-V2e" id="ZKw-Us-byY"/>
            </connections>
            <point key="canvasLocation" x="271.75572519083971" y="48.239436619718312"/>
        </tableViewCell>
    </objects>
WanPai/Root/Search/TCell/WorldCupTCell.swift
@@ -6,18 +6,29 @@
//
import UIKit
import SDWebImage
class WorldCupTCell: UITableViewCell {
    override func awakeFromNib() {
                @IBOutlet weak var label_name: UILabel!
                @IBOutlet weak var label_hotNum: UILabel!
                @IBOutlet weak var label_desc: UILabel!
                @IBOutlet weak var img_cover: UIImageView!
                @IBOutlet weak var label_dealTime: UILabel!
                @IBOutlet weak var label_age: UILabel!
                @IBOutlet weak var label_state: UILabel!
                override func awakeFromNib() {
        super.awakeFromNib()
                                selectionStyle = .none
    }
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
        // Configure the view for the selected state
    }
                func setWorldCupListModel(_ model:WorldCupListModel){
                                label_name.text = model.name
                                label_hotNum.text = "\(model.heat)"
                                label_desc.text = model.content
                                img_cover.sd_setImage(with: URL(string: model.coverImg))
                                label_dealTime.text = "截止报名:\(model.registrationClosingTime)"
                                label_age.text = model.age + "岁"
                }
}
WanPai/Root/Search/TCell/WorldCupTCell.xib
@@ -124,6 +124,15 @@
                </constraints>
            </tableViewCellContentView>
            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
            <connections>
                <outlet property="img_cover" destination="NAy-P9-bIs" id="IA2-Bx-tsP"/>
                <outlet property="label_age" destination="OGN-Ix-gGZ" id="mff-sY-I8J"/>
                <outlet property="label_dealTime" destination="SpG-d6-Mry" id="p57-dS-3fB"/>
                <outlet property="label_desc" destination="Aw5-DE-ZTd" id="vOV-CG-RaS"/>
                <outlet property="label_hotNum" destination="INC-Mr-eUQ" id="DR6-ee-kJf"/>
                <outlet property="label_name" destination="oFc-5H-7bu" id="Kp0-NG-Q3w"/>
                <outlet property="label_state" destination="y0L-La-CTe" id="RBq-ul-Iad"/>
            </connections>
            <point key="canvasLocation" x="288.54961832061065" y="106.33802816901409"/>
        </tableViewCell>
    </objects>
WanPai/Root/Search/VC/JudgeListVC.swift
New file
@@ -0,0 +1,116 @@
//
//  JudgeListVC.swift
//  WanPai
//
//  Created by 无故事王国 on 2024/2/29.
//
import UIKit
import QMUIKit
import RxRelay
import RxDataSources
import RxSwift
class JudgeViewModel:RefreshModel<WorldCupJudgeModel>{
                let content = BehaviorRelay<String?>(value:nil)
                let storeId = BehaviorRelay<NormalSimpleModel?>(value:nil)
                override func api() -> (Observable<BaseResponse<[WorldCupJudgeModel]>>)? {
                                return Services.worldCupJudgeList(content: content.value, storeId: storeId.value?.id)
                }
}
class JudgeListVC: BaseVC {
                @IBOutlet weak var tf_search: QMUITextField!
                @IBOutlet weak var btn_point: QMUIButton!
                @IBOutlet weak var tableView: UITableView!
                private var pointData = [NormalSimpleModel]()
                private var viewModel = JudgeViewModel()
                override func viewDidLoad() {
        super.viewDidLoad()
                                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 ?? [])
                                                }
                                }).disposed(by: disposeBag)
                                viewModel.configure(tableView, needMore: false)
                                viewModel.beginRefresh()
    }
                override func setUI() {
                                btn_point.imagePosition = .right
                                btn_point.spacingBetweenImageAndTitle = 5
                                tableView.delegate = self
                                tableView.dataSource = self
                                tf_search.delegate = self
                                tableView.register(UINib(nibName: "JudgeTCell", bundle: nil), forCellReuseIdentifier: "_JudgeTCell")
                                tableView.separatorStyle = .none
                }
                @IBAction func searchAction(_ sender: QMUIButton) {
                                tf_search.resignFirstResponder()
                                viewModel.content.accept(tf_search.text)
                                viewModel.beginRefresh()
                }
                @IBAction func pointAction(_ sender: QMUIButton) {
                                CourseSubTypeView.show(inView: self.view, afterView: btn_point, items: pointData,selectModel: viewModel.storeId.value) {[weak self] model in
                                                if model.name == "全部"{
                                                                sender.setTitle("所在赛点", for: .normal)
                                                                self?.viewModel.storeId.accept(nil)
                                                }else{
                                                                sender.setTitle(model.name, for: .normal)
                                                                self?.viewModel.storeId.accept(model)
                                                }
                                                self?.viewModel.beginRefresh()
                                } closeClouse: {
                                                sender.isSelected = false
                                }
                }
}
extension JudgeListVC:UITableViewDelegate{
                func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
                                let vc = MatchDetailVC()
                                push(vc: vc)
                }
}
extension JudgeListVC:UITableViewDataSource{
                func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
                                let cell = tableView.dequeueReusableCell(withIdentifier: "_JudgeTCell") as! JudgeTCell
//                                let model = viewModel.dataSource.value[indexPath.row]
//                                cell.setModel(model)
                                return cell
                }
                func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
//                                return viewModel.dataSource.value.count
                                return 2
                }
                func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
                                return 120
                }
}
extension JudgeListVC:QMUITextFieldDelegate{
                func textFieldShouldReturn(_ textField: UITextField) -> Bool {
                                textField.resignFirstResponder()
                                viewModel.content.accept(textField.text)
                                viewModel.beginRefresh()
                                return true
                }
}
WanPai/Root/Search/VC/JudgeListVC.xib
New file
@@ -0,0 +1,157 @@
<?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="Stack View standard spacing" 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" customClass="JudgeListVC" customModule="WanPai" customModuleProvider="target">
            <connections>
                <outlet property="btn_point" destination="J48-Tc-WRM" id="Rl7-V6-Xo5"/>
                <outlet property="tableView" destination="er5-FF-jye" id="Puy-zR-JeF"/>
                <outlet property="tf_search" destination="yUi-oL-7KJ" id="qe8-hC-5Kd"/>
                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
            </connections>
        </placeholder>
        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
        <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
            <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="Nde-LW-5vj">
                    <rect key="frame" x="0.0" y="59" width="393" height="105"/>
                    <subviews>
                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="cVF-Jt-0vt">
                            <rect key="frame" x="14" y="15" width="326" height="38"/>
                            <subviews>
                                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_search" translatesAutoresizingMaskIntoConstraints="NO" id="wIT-2t-W2x">
                                    <rect key="frame" x="4" y="10.666666666666671" width="17" height="17"/>
                                </imageView>
                                <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="搜索" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="yUi-oL-7KJ" customClass="QMUITextField">
                                    <rect key="frame" x="25" y="0.0" width="291" height="38"/>
                                    <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
                                    <textInputTraits key="textInputTraits" returnKeyType="search"/>
                                    <userDefinedRuntimeAttributes>
                                        <userDefinedRuntimeAttribute type="color" keyPath="placeholderColor">
                                            <color key="value" red="0.7843137255" green="0.79215686269999996" blue="0.83921568629999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                        </userDefinedRuntimeAttribute>
                                    </userDefinedRuntimeAttributes>
                                </textField>
                            </subviews>
                            <color key="backgroundColor" red="0.96470588239999999" green="0.96470588239999999" blue="0.96862745100000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                            <constraints>
                                <constraint firstItem="yUi-oL-7KJ" firstAttribute="top" secondItem="cVF-Jt-0vt" secondAttribute="top" id="CoF-1l-MJE"/>
                                <constraint firstAttribute="height" constant="38" id="HsG-zL-SmC"/>
                                <constraint firstItem="wIT-2t-W2x" firstAttribute="leading" secondItem="cVF-Jt-0vt" secondAttribute="leading" constant="4" id="hYc-eU-tGR"/>
                                <constraint firstItem="yUi-oL-7KJ" firstAttribute="leading" secondItem="wIT-2t-W2x" secondAttribute="trailing" constant="4" id="oTb-TK-IBk"/>
                                <constraint firstAttribute="trailing" secondItem="yUi-oL-7KJ" secondAttribute="trailing" constant="10" id="pri-GI-fL9"/>
                                <constraint firstAttribute="bottom" secondItem="yUi-oL-7KJ" secondAttribute="bottom" id="qJ9-mL-JLC"/>
                                <constraint firstItem="wIT-2t-W2x" firstAttribute="centerY" secondItem="cVF-Jt-0vt" secondAttribute="centerY" id="w8H-Yk-jhU"/>
                            </constraints>
                            <userDefinedRuntimeAttributes>
                                <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
                                    <real key="value" value="4.1600000000000001"/>
                                </userDefinedRuntimeAttribute>
                            </userDefinedRuntimeAttributes>
                        </view>
                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="lQC-qk-XDZ">
                            <rect key="frame" x="340" y="15" width="53" height="38"/>
                            <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                            <state key="normal" title="搜索">
                                <color key="titleColor" name="FE6E0D"/>
                            </state>
                            <connections>
                                <action selector="searchAction:" destination="-1" eventType="touchUpInside" id="vC4-Bv-vZo"/>
                            </connections>
                        </button>
                        <stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" spacingType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="owE-gi-Mtr">
                            <rect key="frame" x="14" y="53" width="79" height="52"/>
                            <subviews>
                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="J48-Tc-WRM" customClass="QMUIButton">
                                    <rect key="frame" x="0.0" y="0.0" width="79" height="52"/>
                                    <constraints>
                                        <constraint firstAttribute="width" relation="lessThanOrEqual" constant="250" id="O9Y-8H-ZpN"/>
                                    </constraints>
                                    <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                    <state key="normal" title="所在赛点" image="icon_down_arrow">
                                        <color key="titleColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                    </state>
                                    <state key="selected" image="icon_down_arrow_s">
                                        <color key="titleColor" name="FE6E0D"/>
                                    </state>
                                    <connections>
                                        <action selector="pointAction:" destination="-1" eventType="touchUpInside" id="oGI-2Y-3ZF"/>
                                    </connections>
                                </button>
                            </subviews>
                        </stackView>
                    </subviews>
                    <viewLayoutGuide key="safeArea" id="BVv-Mb-P7a"/>
                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                    <constraints>
                        <constraint firstItem="owE-gi-Mtr" firstAttribute="top" secondItem="cVF-Jt-0vt" secondAttribute="bottom" id="2Zk-9s-zdf"/>
                        <constraint firstAttribute="height" constant="105" id="460-f8-jps"/>
                        <constraint firstItem="cVF-Jt-0vt" firstAttribute="top" secondItem="Nde-LW-5vj" secondAttribute="top" constant="15" id="C3X-jB-dt4"/>
                        <constraint firstItem="lQC-qk-XDZ" firstAttribute="bottom" secondItem="cVF-Jt-0vt" secondAttribute="bottom" id="Cul-oM-e6c"/>
                        <constraint firstAttribute="bottom" secondItem="owE-gi-Mtr" secondAttribute="bottom" id="CzZ-0J-QOQ"/>
                        <constraint firstItem="cVF-Jt-0vt" firstAttribute="leading" secondItem="Nde-LW-5vj" secondAttribute="leading" constant="14" id="TUW-f9-mzf"/>
                        <constraint firstItem="lQC-qk-XDZ" firstAttribute="top" secondItem="cVF-Jt-0vt" secondAttribute="top" id="aZN-5Q-zgH"/>
                        <constraint firstAttribute="trailing" secondItem="cVF-Jt-0vt" secondAttribute="trailing" constant="53" id="f9C-lg-L3X"/>
                        <constraint firstItem="lQC-qk-XDZ" firstAttribute="leading" secondItem="cVF-Jt-0vt" secondAttribute="trailing" id="guS-SJ-b9s"/>
                        <constraint firstItem="owE-gi-Mtr" firstAttribute="leading" secondItem="Nde-LW-5vj" secondAttribute="leading" constant="14" id="lQS-ik-yci"/>
                        <constraint firstAttribute="trailing" secondItem="lQC-qk-XDZ" secondAttribute="trailing" id="rKM-Rd-DvG"/>
                    </constraints>
                    <userDefinedRuntimeAttributes>
                        <userDefinedRuntimeAttribute type="size" keyPath="shadowOffset">
                            <size key="value" width="0.0" height="2"/>
                        </userDefinedRuntimeAttribute>
                        <userDefinedRuntimeAttribute type="color" keyPath="shadowColor">
                            <color key="value" red="0.87450980389999999" green="0.87450980389999999" blue="0.87450980389999999" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
                        </userDefinedRuntimeAttribute>
                        <userDefinedRuntimeAttribute type="number" keyPath="shadowOpacity">
                            <real key="value" value="1"/>
                        </userDefinedRuntimeAttribute>
                        <userDefinedRuntimeAttribute type="number" keyPath="shadowRadius">
                            <real key="value" value="4"/>
                        </userDefinedRuntimeAttribute>
                    </userDefinedRuntimeAttributes>
                </view>
                <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="er5-FF-jye">
                    <rect key="frame" x="0.0" y="169" width="393" height="649"/>
                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                </tableView>
            </subviews>
            <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
            <constraints>
                <constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="er5-FF-jye" secondAttribute="bottom" id="4l2-3u-tRq"/>
                <constraint firstItem="er5-FF-jye" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="8j0-6m-wNI"/>
                <constraint firstItem="er5-FF-jye" firstAttribute="top" secondItem="Nde-LW-5vj" secondAttribute="bottom" constant="5" id="E0R-0D-CsL"/>
                <constraint firstItem="Nde-LW-5vj" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="topMargin" id="huN-w0-rtA"/>
                <constraint firstItem="Nde-LW-5vj" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="j7p-Sr-HXL"/>
                <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="er5-FF-jye" secondAttribute="trailing" id="kfY-cl-lu9"/>
                <constraint firstItem="Nde-LW-5vj" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="wx9-UP-RkW"/>
            </constraints>
            <point key="canvasLocation" x="33" y="21"/>
        </view>
    </objects>
    <resources>
        <image name="icon_down_arrow" width="13" height="8"/>
        <image name="icon_down_arrow_s" width="13" height="8"/>
        <image name="icon_search" width="17" height="17"/>
        <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/Search/VC/MatchDetailVC.swift
New file
@@ -0,0 +1,28 @@
//
//  MatchDetailVC.swift
//  WanPai
//
//  Created by 无故事王国 on 2024/2/29.
//
import UIKit
class MatchDetailVC: BaseVC {
    override func viewDidLoad() {
        super.viewDidLoad()
                                title = "当前比赛名称"
    }
    /*
    // MARK: - Navigation
    // 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.
    }
    */
}
WanPai/Root/Search/VC/MatchDetailVC.xib
New file
@@ -0,0 +1,57 @@
<?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="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="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
            </connections>
        </placeholder>
        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
        <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
            <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="7Lx-0R-Sfa">
                    <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
                    <color key="backgroundColor" red="0.098039215686274508" green="0.18431372549019609" blue="0.44705882352941173" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
                </view>
                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="bg_ad" translatesAutoresizingMaskIntoConstraints="NO" id="Mp4-s0-svz">
                    <rect key="frame" x="0.0" y="-100" width="453" height="918"/>
                </imageView>
                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="bg_footall" translatesAutoresizingMaskIntoConstraints="NO" id="UgK-2f-Czf">
                    <rect key="frame" x="0.0" y="59" width="393" height="548.66666666666663"/>
                    <constraints>
                        <constraint firstAttribute="width" secondItem="UgK-2f-Czf" secondAttribute="height" multiplier="1:1.3958" id="Zc2-i4-vXc"/>
                    </constraints>
                </imageView>
            </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 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="7Lx-0R-Sfa" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="ANk-R7-pWs"/>
                <constraint firstItem="UgK-2f-Czf" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="Fgv-aI-ohK"/>
                <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="7Lx-0R-Sfa" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="Tfq-ay-IBP"/>
                <constraint firstItem="UgK-2f-Czf" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="Z9i-9o-3P2"/>
                <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="Mp4-s0-svz" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" constant="60" id="pcf-l6-NAl"/>
            </constraints>
            <point key="canvasLocation" x="81.679389312977094" y="20.422535211267608"/>
        </view>
    </objects>
    <resources>
        <image name="bg_ad" width="927" height="927.66668701171875"/>
        <image name="bg_footall" width="802" height="1082"/>
    </resources>
</document>
WanPai/Root/Search/VC/MeQRCodeVC.swift
@@ -6,14 +6,21 @@
//
import UIKit
import JQTools
class MeQRCodeVC: BaseVC {
                @IBOutlet weak var tableView: UITableView!
                @IBOutlet weak var label_content: UILabel!
                private let viewModel = StudentExchangeViewModel()
                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()
                                }).disposed(by: disposeBag)
                }
                override func setUI() {
@@ -21,21 +28,26 @@
                                tableView.dataSource = self
                                tableView.separatorStyle = .none
                                tableView.register(UINib(nibName: "MyQRCodeTCell", bundle: nil), forCellReuseIdentifier: "_MyQRCodeTCell")
                                viewModel.configure(tableView,needMore: false)
                                viewModel.beginRefresh()
                }
}
extension    MeQRCodeVC:UITableViewDelegate,UITableViewDataSource{
                func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
                                QRPreview.show("123")
                                let model = viewModel.dataSource.value[indexPath.row]
                                QRPreview.show("\(model.stuId)")
                }
                func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
                                return 2
                                return viewModel.dataSource.value.count
                }
                func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
                                let model = viewModel.dataSource.value[indexPath.row]
                                let cell = tableView.dequeueReusableCell(withIdentifier: "_MyQRCodeTCell") as! MyQRCodeTCell
                                cell.studentProfile1Model = model
                                return cell
                }
WanPai/Root/Search/VC/MeQRCodeVC.xib
@@ -11,6 +11,7 @@
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MeQRCodeVC" customModule="WanPai" customModuleProvider="target">
            <connections>
                <outlet property="label_content" destination="kn2-C1-gHg" id="b7v-FP-Ryn"/>
                <outlet property="tableView" destination="xCU-ZT-TBO" id="aff-vD-UvB"/>
                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
            </connections>
WanPai/Root/Search/VC/SearchVC.swift
@@ -22,6 +22,7 @@
                private var models = [StartClouseExploreModel]()
                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) {
                                super.viewDidDisappear(animated)
@@ -145,7 +146,8 @@
                                                                case "我的运动营":
                                                                self.tabBarController?.selectedIndex = 1
                                                                case "人员管理":
                                                                break
                                                                let vc = StudentsManagerListVC()
                                                                push(vc: vc)
                                                                case "我的券包":
                                                                let vc = WelfareCouponsListVC()
                                                                push(vc: vc)
@@ -162,7 +164,8 @@
                                                                let vc = RechargeRecordVC(coin: benefitHomeModel?.wpCoin ?? 0,subtype: .coin)
                                                                push(vc: vc)
                                                                case "裁判入口":
                                                                break
                                                                let vc = JudgeListVC()
                                                                push(vc: vc)
                                                                default:
                                                                                break
                                                }
@@ -191,6 +194,7 @@
                                if collectionView == func_collectionView{
                                                let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_FindItemCCell", for: indexPath) as! FindItemCCell
                                                cell.label_title.text = items[indexPath.row]
                                                cell.img_avar.image = UIImage(named: itemsImg[indexPath.row])
                                                return cell
                                }
WanPai/Root/Search/VC/StudentsManagerListVC.swift
New file
@@ -0,0 +1,75 @@
//
//  StudentsManagerListVC.swift
//  WanPai
//
//  Created by 无故事王国 on 2024/3/1.
//
import UIKit
import QMUIKit
class StudentsManagerListVC: BaseVC {
                @IBOutlet weak var btn_addStudent: QMUIButton!
                @IBOutlet weak var tableView: BaseTableView!
                private var viewModel = ActivityStudentViewModel()
                override func viewDidLoad() {
                                super.viewDidLoad()
                                title = "选择人员"
                                viewModel.configure(tableView,needMore: false)
                                viewModel.beginRefresh()
                }
                override func setUI() {
                                btn_addStudent.imagePosition = .right
                                btn_addStudent.spacingBetweenImageAndTitle = 4
                                tableView.delegate = self
                                tableView.dataSource = self
                                tableView.separatorStyle = .none
                                tableView.register(UINib(nibName: "StudentInfo_5_TCell", bundle: nil), forCellReuseIdentifier: "_StudentInfo_5_TCell")
                                //        tableView.jq_setEmptyView("暂无活动人员")
                }
                override func setRx() {
                                NotificationCenter.default.rx.notification(StudentUpdate_Nofi).take(until: self.rx.deallocated).subscribe(onNext: {[weak self] noti in
                                                self?.viewModel.beginRefresh()
                                }).disposed(by: disposeBag)
                }
                @IBAction func addStudentAction(_ sender: Any) {
                                let vc = AddStudentVC(type: .activity)
                                push(vc: vc)
                }
}
extension StudentsManagerListVC:UITableViewDelegate{
}
extension StudentsManagerListVC:UITableViewDataSource{
                func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
                                let cell = tableView.dequeueReusableCell(withIdentifier: "_StudentInfo_5_TCell") as! StudentInfo_5_TCell
                                cell.indexPath = indexPath
                                cell.activityDetailPartModel = viewModel.dataSource.value[indexPath.row]
                                cell.btn_verifiy.isHidden = !viewModel.dataSource.value[indexPath.row].idcard.isEmpty
                                cell.delClouse = {index in
                                                CommonAlertView.show(title: "提示", content: "确认删除当前人员吗?") { [weak self] status in
                                                                guard let weakSelf = self else { return }
                                                                if status{
                                                                                let m = weakSelf.viewModel.dataSource.value[index.row]
                                                                                Services.deleParticipant(id: m.id).subscribe(onNext: { data in
                                                                                                weakSelf.viewModel.beginRefresh()
                                                                                }).disposed(by: weakSelf.disposeBag)
                                                                }
                                                }
                                }
                                return cell
                }
                func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
                                return viewModel.dataSource.value.count
                }
}
WanPai/Root/Search/VC/StudentsManagerListVC.xib
New file
@@ -0,0 +1,59 @@
<?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="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" customClass="StudentsManagerListVC" customModule="WanPai" customModuleProvider="target">
            <connections>
                <outlet property="btn_addStudent" destination="Bec-z9-thT" id="K29-7m-hmf"/>
                <outlet property="tableView" destination="hiY-oR-f1V" id="Ggk-IN-xCL"/>
                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
            </connections>
        </placeholder>
        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
        <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
            <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
            <subviews>
                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Bec-z9-thT" customClass="QMUIButton">
                    <rect key="frame" x="305" y="84.333333333333329" width="74" height="17"/>
                    <fontDescription key="fontDescription" type="system" pointSize="14"/>
                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                    <state key="normal" title="添加人员" image="btn_add_1">
                        <color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="0.56999999999999995" colorSpace="custom" customColorSpace="sRGB"/>
                    </state>
                    <connections>
                        <action selector="addStudentAction:" destination="-1" eventType="touchUpInside" id="Zw1-Rh-xf9"/>
                    </connections>
                </button>
                <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="hiY-oR-f1V" customClass="BaseTableView" customModule="WanPai" customModuleProvider="target">
                    <rect key="frame" x="0.0" y="107.66666666666669" width="393" height="710.33333333333326"/>
                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                </tableView>
            </subviews>
            <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
            <constraints>
                <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="Bec-z9-thT" secondAttribute="trailing" constant="14" id="Oso-3c-Dkf"/>
                <constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="hiY-oR-f1V" secondAttribute="bottom" id="YnI-CP-oqU"/>
                <constraint firstItem="hiY-oR-f1V" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="abn-BI-YrT"/>
                <constraint firstItem="hiY-oR-f1V" firstAttribute="top" secondItem="Bec-z9-thT" secondAttribute="bottom" constant="6.5" id="euN-ih-RKB"/>
                <constraint firstItem="Bec-z9-thT" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="25.329999999999998" id="nCS-LS-f4C"/>
                <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="hiY-oR-f1V" secondAttribute="trailing" id="su2-Jp-CbM"/>
            </constraints>
            <point key="canvasLocation" x="140" y="21"/>
        </view>
    </objects>
    <resources>
        <image name="btn_add_1" width="16" height="16"/>
        <systemColor name="systemBackgroundColor">
            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
        </systemColor>
    </resources>
</document>
WanPai/Root/Search/VC/WorldCupContentApplyInputVC.swift
@@ -6,24 +6,241 @@
//
import UIKit
import JQTools
import QMUIKit
import HandyJSON
struct WorldCupStudentSimpleInfoModel:HandyJSON{
                var id = 0
                var isStudent = 0
}
class WorldCupContentApplyInputVC: BaseVC {
                @IBOutlet weak var view_banner: UIView!
                @IBOutlet weak var label_title: UILabel!
                @IBOutlet weak var label_hot: UILabel!
                @IBOutlet weak var label_duetime: UILabel!
                @IBOutlet weak var label_starttime: UILabel!
                @IBOutlet weak var label_endtime: UILabel!
                @IBOutlet weak var label_ageScope: UILabel!
                @IBOutlet weak var label_genderCond: UILabel!
                @IBOutlet weak var label_city: UILabel!
                @IBOutlet weak var label_address: UILabel!
                @IBOutlet weak var label_matchPoint: UILabel!
                @IBOutlet weak var label_pay_money: UILabel!
                @IBOutlet weak var label_pay_coin: UILabel!
                @IBOutlet weak var label_pay_course: UILabel!
                @IBOutlet weak var btn_moreStore: UIButton!
                @IBOutlet weak var tableView: UITableView!
                @IBOutlet weak var btn_agreement: UIButton!
                @IBOutlet weak var cons_tableHei: NSLayoutConstraint!
                @IBOutlet weak var btn_addStudent: QMUIButton!
                private var students = [ActivityDetailPartModel]()
                private var detailModel:WorldCupDetailModel!
                private lazy var bannerView:CommonBannerView = {
                                let v = CommonBannerView()
                                return v
                }()
                init(_ model:WorldCupDetailModel) {
                                super.init(nibName: nil, bundle: nil)
                                self.detailModel = model
                }
                override func setUI() {
                                btn_addStudent.imagePosition = .right
                                btn_addStudent.spacingBetweenImageAndTitle = 4
                                view_banner.addSubview(bannerView)
                                bannerView.frame = CGRect(x: 0, y: 0, width: JQ_ScreenW, height: JQ_ScreenW * 0.56)
                                tableView.delegate = self
                                tableView.dataSource = self
                                tableView.separatorStyle = .none
                                tableView.register(UINib(nibName: "StudentInfo_2_TCell", bundle: nil), forCellReuseIdentifier: "_StudentInfo_2_TCell")
                }
    override func viewDidLoad() {
        super.viewDidLoad()
                                title = "社区世界杯"
                                let imgs = detailModel.infoImg.components(separatedBy: ",")
                                                var items = [CommonBannerModel]()
                                                for (index,img) in imgs.enumerated(){
                                                                items.append(CommonBannerModel(index: index,resource: img,mediaType: .imageUrl))
                                                }
                                                bannerView.setItems(items: items)
        // Do any additional setup after loading the view.
                                btn_moreStore.isHidden = detailModel.storeInfos.count > 1
                                                label_title.text = detailModel.name
                                                label_hot.text = "\(detailModel.heat)"
                                                label_duetime.text = detailModel.registrationClosingTime
                                                label_starttime.text = detailModel.startTime
                                                label_endtime.text = detailModel.endTime
                                                label_ageScope.text = detailModel.age + "岁"
                                                switch detailModel.gender{
                                                                case 1:label_genderCond.text = "男"
                                                                case 2:label_genderCond.text = "女"
                                                                default:label_genderCond.text = "全部"
                                                }
                                                label_city.text = ""
                                                label_address.text = detailModel.address
                                                label_matchPoint.text = detailModel.storeInfos.map({$0.name}).joined(separator: "、")
                                                label_pay_money.text = "¥\(detailModel.cash)/人"
                                                label_pay_coin.text = "\(detailModel.paiCoin)币/人"
                                                label_pay_course.text = "\(detailModel.classHour)课时/人"
    }
                override func setRx() {
                                tableView.rx.observe(CGSize.self, "contentSize").subscribe(onNext: {[weak self] size in
                                                self?.cons_tableHei.constant = size?.height ?? 0
                                }).disposed(by: disposeBag)
                }
    /*
    // MARK: - Navigation
                @IBAction func addStudentAction(_ sender: QMUIButton) {
                                StudentChooseView.show(itemType: .activity, defaultStu: students,isAuth: 1) { [weak self] studs in
                                                self?.students = studs as! [ActivityDetailPartModel]
                                                self?.cons_tableHei.constant = Double(self?.students.count ?? 0) * 100
                                                self?.tableView.reloadData()
                                } needAddClouse: {[weak self] () in
                                                let vc = ActivityStudentListVC()
                                                self?.push(vc: vc)
                                }
                }
    // 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.
    }
    */
                @IBAction func matchStoreAction(_ sender: UIButton) {
                                guard let detailModel = detailModel else{return}
                                AgreentView.show(type: .matchPoint, content: detailModel.storeInfos.map({$0.name}).joined(separator: "、"))
                }
                @IBAction func agreementAction(_ sender: UIButton) {
                                sender.isSelected = !sender.isSelected
                }
                @IBAction func webAction(_ sender: Any) {
                                let webVC = CommonWebVC(type: .matchStore,customTitle: "社区世界杯报名协议")
                                push(vc: webVC)
                }
                @IBAction func applyAction(_ sender: Any) {
                                guard btn_agreement.isSelected else {
                                                alert(msg: "请先阅读并同意协议");return
                                }
                                guard students.count > 0 else {
                                                alert(msg: "请选择参赛人员");return
                                }
                                StoresInfoView.show(detailModel.storeInfos.first ?? ActivityDetailStoreModel()) {[weak self] status in
                                                guard let weakSelf = self else { return }
                                                if status{
                                                                var result = [Dictionary<String,Int>]()
                                                                for v in weakSelf.students{
                                                                                result.append(["id":v.id,"isStudent":v.isStudent])
                                                                }
                                                                Services.worldCupPaymentCheck(id: weakSelf.detailModel.id, ids: result.jq_toJson1(), uid: nil).subscribe(onNext: {data in
                                                                                if let model = data.data{
                                                                                                var money:Double?
                                                                                                var paiCoin:Int?
                                                                                                var classHour:Int?
                                                                                                money = weakSelf.detailModel.cash.double
                                                                                                if model.paiCoin == 1{
                                                                                                                paiCoin = weakSelf.detailModel.paiCoin
                                                                                                }
                                                                                                if model.classHour == 1{
                                                                                                                classHour = weakSelf.detailModel.classHour
                                                                                                }
                                                                                                PaymentView.show(enumType: .worldCup, money: (ali: money, wx: money, coin: paiCoin, course:classHour, integral: nil)) {[weak self] payType in
                                                                                                                guard let weakSelf = self else { return }
                                                                                                                Services.worldCupPayment(id: weakSelf.detailModel.id, ids: result.jq_toJson1(), payType: payType, uid: nil).subscribe(onNext: {data in
                                                                                                                                if let m = data.data{
                                                                                                                                                switch payType {
                                                                                                                                                                case .aliPay:
                                                                                                                                                                                YYPaymentManager.shared.sendPaymentRequest(YYAlipayRequest(orderString: m.orderString)) { result in
                                                                                                                                                                                                switch result {
                                                                                                                                                                                                                case .success:
                                                                                                                                                                                                                                let vc = PaymentResultVC(result: .success, objType: .worldCup)
                                                                                                                                                                                                                                self?.push(vc: vc)
                                                                                                                                                                                                                case .cancel:
                                                                                                                                                                                                                                alert(msg: "交易取消")
                                                                                                                                                                                                                case .failure(_):
                                                                                                                                                                                                                                let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .worldCup)
                                                                                                                                                                                                                                self?.push(vc: vc)
                                                                                                                                                                                                }
                                                                                                                                                                                }
                                                                                                                                                                case .coin,.free:
                                                                                                                                                                                let vc = PaymentResultVC(result: .success, objType: .worldCup)
                                                                                                                                                                                self?.push(vc: vc)
                                                                                                                                                                case .courseNum:
                                                                                                                                                                                let vc = PaymentResultVC(result: .success, objType: .worldCup)
                                                                                                                                                                                self?.push(vc: vc)
                                                                                                                                                                default:break
                                                                                                                                                }
                                                                                                                                }
                                                                                                                },onError: { error in
                                                                                                                                if let er = error as? NetworkRequest.NetRequestError{
                                                                                                                                                switch er {
                                                                                                                                                                case .Other(let code,let string):
                                                                                                                                                                                let vc = PaymentResultVC(result: .fail(string,code), objType: .worldCup)
                                                                                                                                                                                JQ_currentViewController().jq_push(vc: vc)
                                                                                                                                                                default:
                                                                                                                                                                                let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .worldCup)
                                                                                                                                                                                JQ_currentViewController().jq_push(vc: vc)
                                                                                                                                                }
                                                                                                                                }
                                                                                                                }).disposed(by: weakSelf.disposeBag)
                                                                                                }
                                                                                }
                                                                }).disposed(by: weakSelf.disposeBag)
                                                }
                                }
                }
                required init?(coder: NSCoder) {
                                fatalError("init(coder:) has not been implemented")
                }
}
extension WorldCupContentApplyInputVC:UITableViewDelegate{
}
extension WorldCupContentApplyInputVC:UITableViewDataSource{
                func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
                                let student = students[indexPath.row]
                                let cell = tableView.dequeueReusableCell(withIdentifier: "_StudentInfo_2_TCell") as! StudentInfo_2_TCell
                                cell.indexPath = indexPath
                                cell.activityDetailPartModel = student
                                cell.btn_edit.isHidden = true
                                cell.img_radio.isHidden = true
                                cell.delClouse = {[weak self] index in
                                                tableView.beginUpdates()
                                                self?.students.remove(at: index.row)
                                                tableView.deleteItemsAtIndexPaths([index], animationStyle: .automatic)
                                                tableView.endUpdates()
                                                tableView.reloadData()
                                }
                                return cell
                }
                func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
                                return students.count
                }
}
WanPai/Root/Search/VC/WorldCupContentApplyInputVC.xib
@@ -12,7 +12,26 @@
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="WorldCupContentApplyInputVC" customModule="WanPai" customModuleProvider="target">
            <connections>
                <outlet property="btn_addStudent" destination="J6G-ci-uFv" id="NWF-LA-tm8"/>
                <outlet property="btn_agreement" destination="q5y-in-bNV" id="dA7-bY-ILw"/>
                <outlet property="btn_moreStore" destination="AgA-ET-N0O" id="u3j-bV-RNv"/>
                <outlet property="cons_tableHei" destination="7Nj-Ch-Bss" id="g2d-CY-NCq"/>
                <outlet property="label_address" destination="Mmh-IM-z9o" id="hJU-oa-HZD"/>
                <outlet property="label_ageScope" destination="Q5v-M5-mW9" id="pMT-hc-npm"/>
                <outlet property="label_city" destination="7pR-VP-V2H" id="BCv-oc-pQG"/>
                <outlet property="label_duetime" destination="u82-O5-aYe" id="77B-jS-nTe"/>
                <outlet property="label_endtime" destination="KWP-oW-KNC" id="Rgf-wK-kSG"/>
                <outlet property="label_genderCond" destination="TnZ-pd-b7f" id="2Fz-KF-WN9"/>
                <outlet property="label_hot" destination="IQk-5x-j1y" id="LWk-kk-Mzy"/>
                <outlet property="label_matchPoint" destination="h8z-hN-Sq9" id="m2W-eR-Ewl"/>
                <outlet property="label_pay_coin" destination="cVX-U3-mzN" id="qid-9E-LwL"/>
                <outlet property="label_pay_course" destination="0HL-O0-GC6" id="Snq-JA-AIb"/>
                <outlet property="label_pay_money" destination="W3G-c7-g9n" id="8Df-nN-zfx"/>
                <outlet property="label_starttime" destination="da2-LT-7vP" id="HyM-Lb-ghw"/>
                <outlet property="label_title" destination="0Xa-dp-XwP" id="VbM-O6-e6C"/>
                <outlet property="tableView" destination="vdV-Kg-Dhx" id="Rw4-fo-CUk"/>
                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
                <outlet property="view_banner" destination="iHH-PB-5zL" id="0G8-9s-0ju"/>
            </connections>
        </placeholder>
        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
@@ -386,6 +405,9 @@
                                                            <state key="normal" title="查看更多">
                                                                <color key="titleColor" name="FE6E0D"/>
                                                            </state>
                                                            <connections>
                                                                <action selector="matchStoreAction:" destination="-1" eventType="touchUpInside" id="juU-4Q-RwN"/>
                                                            </connections>
                                                        </button>
                                                    </subviews>
                                                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
@@ -563,6 +585,17 @@
                                                    <nil key="textColor"/>
                                                    <nil key="highlightedColor"/>
                                                </label>
                                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="J6G-ci-uFv" customClass="QMUIButton">
                                                    <rect key="frame" x="305" y="21" width="74" height="17"/>
                                                    <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                                    <state key="normal" title="选择人员" image="btn_add_1">
                                                        <color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="0.56999999999999995" colorSpace="custom" customColorSpace="sRGB"/>
                                                    </state>
                                                    <connections>
                                                        <action selector="addStudentAction:" destination="-1" eventType="touchUpInside" id="Xeq-wG-h3f"/>
                                                    </connections>
                                                </button>
                                                <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="vdV-Kg-Dhx">
                                                    <rect key="frame" x="0.0" y="49.333333333333258" width="393" height="100"/>
                                                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
@@ -577,6 +610,8 @@
                                                <constraint firstItem="vdV-Kg-Dhx" firstAttribute="leading" secondItem="Xyq-vd-5Sz" secondAttribute="leading" id="Acb-8j-W2N"/>
                                                <constraint firstAttribute="trailing" secondItem="ub3-DL-aH6" secondAttribute="trailing" id="DWP-md-W2S"/>
                                                <constraint firstItem="ub3-DL-aH6" firstAttribute="leading" secondItem="Xyq-vd-5Sz" secondAttribute="leading" constant="13" id="Vzl-fJ-G2Y"/>
                                                <constraint firstItem="J6G-ci-uFv" firstAttribute="centerY" secondItem="ldY-d5-HF6" secondAttribute="centerY" id="bPt-oJ-Og8"/>
                                                <constraint firstAttribute="trailing" secondItem="J6G-ci-uFv" secondAttribute="trailing" constant="14" id="fBx-VK-gUI"/>
                                                <constraint firstItem="vdV-Kg-Dhx" firstAttribute="top" secondItem="ldY-d5-HF6" secondAttribute="bottom" constant="5.5" id="go9-ce-gRs"/>
                                                <constraint firstItem="ub3-DL-aH6" firstAttribute="top" secondItem="Xyq-vd-5Sz" secondAttribute="top" id="icE-L6-uAK"/>
                                                <constraint firstItem="ldY-d5-HF6" firstAttribute="top" secondItem="ub3-DL-aH6" secondAttribute="bottom" constant="14" id="nzY-lw-16n"/>
@@ -592,6 +627,9 @@
                                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                                    <state key="normal" image="btn_choose"/>
                                                    <state key="selected" image="btn_choose_s"/>
                                                    <connections>
                                                        <action selector="agreementAction:" destination="-1" eventType="touchUpInside" id="9lJ-ur-pxI"/>
                                                    </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="VLx-ri-X99">
                                                    <rect key="frame" x="48" y="15" width="86" height="14.333333333333336"/>
@@ -599,21 +637,26 @@
                                                    <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
                                                    <nil key="highlightedColor"/>
                                                </label>
                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="《社区世界杯报名协议》" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="X7e-Ua-008">
                                                    <rect key="frame" x="136" y="15" width="123" height="14.333333333333336"/>
                                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hRB-z0-FaB">
                                                    <rect key="frame" x="139" y="8.6666666666667425" width="123" height="27"/>
                                                    <fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/>
                                                    <color key="textColor" red="0.0" green="0.47058823529411764" blue="0.80392156862745101" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="sRGB"/>
                                                    <nil key="highlightedColor"/>
                                                </label>
                                                    <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.0" green="0.47058823529999999" blue="0.80392156859999997" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="sRGB"/>
                                                    </state>
                                                    <connections>
                                                        <action selector="webAction:" destination="-1" eventType="touchUpInside" id="bs8-na-V0u"/>
                                                    </connections>
                                                </button>
                                            </subviews>
                                            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                                            <constraints>
                                                <constraint firstItem="hRB-z0-FaB" firstAttribute="leading" secondItem="VLx-ri-X99" secondAttribute="trailing" constant="5" id="6Lr-zJ-ZEH"/>
                                                <constraint firstItem="q5y-in-bNV" firstAttribute="centerY" secondItem="fch-vq-WNu" secondAttribute="centerY" id="9Co-Iy-tMh"/>
                                                <constraint firstItem="VLx-ri-X99" firstAttribute="leading" secondItem="q5y-in-bNV" secondAttribute="trailing" constant="9" id="Fc8-qF-wG0"/>
                                                <constraint firstAttribute="height" constant="44" id="eqp-mh-FIe"/>
                                                <constraint firstItem="X7e-Ua-008" firstAttribute="centerY" secondItem="q5y-in-bNV" secondAttribute="centerY" id="hFC-ME-4lm"/>
                                                <constraint firstItem="VLx-ri-X99" firstAttribute="centerY" secondItem="fch-vq-WNu" secondAttribute="centerY" id="lwA-kp-bcm"/>
                                                <constraint firstItem="X7e-Ua-008" firstAttribute="leading" secondItem="VLx-ri-X99" secondAttribute="trailing" constant="2" id="vAK-1n-fDh"/>
                                                <constraint firstItem="hRB-z0-FaB" firstAttribute="centerY" secondItem="q5y-in-bNV" secondAttribute="centerY" id="obS-yw-2fj"/>
                                                <constraint firstItem="q5y-in-bNV" firstAttribute="leading" secondItem="fch-vq-WNu" secondAttribute="leading" constant="14" id="xd7-B4-xVU"/>
                                            </constraints>
                                        </view>
@@ -649,6 +692,9 @@
                    <fontDescription key="fontDescription" type="system" weight="medium" pointSize="18"/>
                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                    <state key="normal" title="立即报名"/>
                    <connections>
                        <action selector="applyAction:" destination="-1" eventType="touchUpInside" id="gOF-qX-DlX"/>
                    </connections>
                </button>
            </subviews>
            <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
@@ -662,10 +708,11 @@
                <constraint firstAttribute="trailing" secondItem="d0O-dD-t7J" secondAttribute="trailing" id="Vaf-dW-a13"/>
                <constraint firstItem="d0O-dD-t7J" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="l4X-LJ-oNR"/>
            </constraints>
            <point key="canvasLocation" x="140" y="21"/>
            <point key="canvasLocation" x="139.69465648854961" y="20.422535211267608"/>
        </view>
    </objects>
    <resources>
        <image name="btn_add_1" width="16" height="16"/>
        <image name="btn_choose" width="25" height="25"/>
        <image name="btn_choose_s" width="25" height="25"/>
        <image name="icon_hot_1" width="24" height="28"/>
WanPai/Root/Search/VC/WorldCupContentApplyVC.swift
@@ -6,17 +6,111 @@
//
import UIKit
import JQTools
import WebKit
class WorldCupContentApplyVC: BaseVC {
                @IBOutlet weak var view_banner: UIView!
                @IBOutlet weak var label_title: UILabel!
                @IBOutlet weak var label_hot: UILabel!
                @IBOutlet weak var label_duetime: UILabel!
                @IBOutlet weak var label_starttime: UILabel!
                @IBOutlet weak var label_endtime: UILabel!
                @IBOutlet weak var label_ageScope: UILabel!
                @IBOutlet weak var label_genderCond: UILabel!
                @IBOutlet weak var label_city: UILabel!
                @IBOutlet weak var label_address: UILabel!
                @IBOutlet weak var label_matchPoint: UILabel!
                @IBOutlet weak var label_pay_money: UILabel!
                @IBOutlet weak var label_pay_coin: UILabel!
                @IBOutlet weak var label_pay_course: UILabel!
                @IBOutlet weak var label_desc: UILabel!
                @IBOutlet weak var webView: WKWebView!
                @IBOutlet weak var cons_webHei: NSLayoutConstraint!
                @IBOutlet weak var btn_moreStore: UIButton!
                private var detailModel:WorldCupDetailModel?
                private lazy var bannerView:CommonBannerView = {
                                let v = CommonBannerView()
                                return v
                }()
                private var id:Int!
                init(id:Int) {
                                super.init(nibName: nil, bundle: nil)
                                self.id = id
                }
                override func setUI() {
                                view_banner.addSubview(bannerView)
                                bannerView.frame = CGRect(x: 0, y: 0, width: JQ_ScreenW, height: JQ_ScreenW * 0.56)
                }
                required init?(coder: NSCoder) {
                                fatalError("init(coder:) has not been implemented")
                }
    override func viewDidLoad() {
        super.viewDidLoad()
                                title = "社区世界杯"
                                Services.getWorldCupDetail(id: id).subscribe(onNext: {[weak self] data in
                                                if let model = data.data{
                                                                let imgs = model.infoImg.components(separatedBy: ",")
                                                                var items = [CommonBannerModel]()
                                                                for (index,img) in imgs.enumerated(){
                                                                                items.append(CommonBannerModel(index: index,resource: img,mediaType: .imageUrl))
                                                                }
                                                                self?.bannerView.setItems(items: items)
                                                                self?.btn_moreStore.isHidden = model.storeInfos.count > 1
                                                                self?.label_title.text = model.name
                                                                self?.label_hot.text = "\(model.heat)"
                                                                self?.label_duetime.text = model.registrationClosingTime
                                                                self?.label_starttime.text = model.startTime
                                                                self?.label_endtime.text = model.endTime
                                                                self?.label_ageScope.text = model.age + "岁"
                                                                switch model.gender{
                                                                                case 1:self?.label_genderCond.text = "男"
                                                                                case 2:self?.label_genderCond.text = "女"
                                                                                default:self?.label_genderCond.text = "全部"
                                                                }
                                                                self?.label_city.text = ""
                                                                self?.label_address.text = model.address
                                                                self?.label_matchPoint.text = model.storeInfos.map({$0.name}).joined(separator: "、")
                                                                self?.label_pay_money.text = "¥\(model.cash)/人"
                                                                self?.label_pay_coin.text = "\(model.paiCoin)币/人"
                                                                self?.label_pay_course.text = "\(model.classHour)课时/人"
                                                                self?.label_desc.text = model.intro
                                                                self?.webView.loadHTMLString(model.content.jq_wrapHtml(), baseURL: nil)
                                                                self?.detailModel = model
                                                }
                                }).disposed(by: disposeBag)
    }
                override func setRx() {
                                webView.scrollView.rx.observe(CGSize.self, "contentSize").subscribe(onNext: {[weak self] size in
                                                self?.cons_webHei.constant = size?.height ?? 0
                                }).disposed(by: disposeBag)
                }
                @IBAction func matchStoreAction(_ sender: UIButton) {
                                guard let detailModel = detailModel else{return}
                                let text = detailModel.storeInfos.map({$0.name}).joined(separator: "、")
                                AgreentView.show(type: .matchPoint, content: text)
                }
                @IBAction func applyAction(_ sender: UIButton) {
                                let vc = WorldCupContentApplyInputVC()
                                guard let model = detailModel else { return }
                                let vc = WorldCupContentApplyInputVC(model)
                                push(vc: vc)
                }
}
WanPai/Root/Search/VC/WorldCupContentApplyVC.xib
@@ -12,7 +12,25 @@
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="WorldCupContentApplyVC" customModule="WanPai" customModuleProvider="target">
            <connections>
                <outlet property="btn_moreStore" destination="8A3-ba-Lfp" id="gNd-9Y-tYk"/>
                <outlet property="cons_webHei" destination="mZW-Bo-YeJ" id="jsg-oq-zAd"/>
                <outlet property="label_address" destination="5zE-II-xtR" id="bgD-gj-Q7I"/>
                <outlet property="label_ageScope" destination="e1B-PO-EcV" id="pj7-Ub-u4g"/>
                <outlet property="label_city" destination="ljf-wN-gW1" id="Za5-AR-A5Q"/>
                <outlet property="label_desc" destination="3U1-AP-dtr" id="sIX-3v-5AJ"/>
                <outlet property="label_duetime" destination="Uw0-ht-Y4A" id="kRh-vP-Gd8"/>
                <outlet property="label_endtime" destination="5Bo-1K-36O" id="qXb-Op-8cF"/>
                <outlet property="label_genderCond" destination="Kbi-qd-Cnt" id="zmT-I9-Wdk"/>
                <outlet property="label_hot" destination="KUT-ZO-3d1" id="FAI-LY-0mO"/>
                <outlet property="label_matchPoint" destination="qol-d4-iqE" id="Tov-zQ-kDs"/>
                <outlet property="label_pay_coin" destination="nZE-Uv-Vd2" id="eXp-Qm-ob3"/>
                <outlet property="label_pay_course" destination="H6O-v1-6wa" id="iHa-J1-vo0"/>
                <outlet property="label_pay_money" destination="QgZ-yG-G8F" id="cyc-yS-iot"/>
                <outlet property="label_starttime" destination="bNs-tK-h0l" id="Gb2-UV-tps"/>
                <outlet property="label_title" destination="tkR-Qw-6Qd" id="W9O-KH-zcd"/>
                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
                <outlet property="view_banner" destination="rEE-UF-kCK" id="yik-z7-fwy"/>
                <outlet property="webView" destination="sHP-li-Ukm" id="2vx-dd-7hx"/>
            </connections>
        </placeholder>
        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
@@ -386,6 +404,9 @@
                                                            <state key="normal" title="查看更多">
                                                                <color key="titleColor" name="FE6E0D"/>
                                                            </state>
                                                            <connections>
                                                                <action selector="matchStoreAction:" destination="-1" eventType="touchUpInside" id="bCS-gw-MtJ"/>
                                                            </connections>
                                                        </button>
                                                    </subviews>
                                                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
WanPai/Root/Search/VC/WorldCupContentDetailVC.swift
@@ -7,12 +7,15 @@
import UIKit
import QMUIKit
import JQTools
import WebKit
class WorldCupContentDetailVC: BaseVC {
                @IBOutlet weak var view_banner: UIView!
                @IBOutlet weak var label_storeNames: UILabel!
//                @IBOutlet weak var label_storeNames: UILabel!
                @IBOutlet weak var label_title: UILabel!
                @IBOutlet weak var label_hot: UILabel!
                @IBOutlet weak var label_joinCondition: UILabel!
                @IBOutlet weak var label_address: UILabel!
                @IBOutlet weak var label_duetime: UILabel!
@@ -21,23 +24,73 @@
                @IBOutlet weak var label_ageScope: UILabel!
                @IBOutlet weak var label_city: UILabel!
                @IBOutlet weak var label_money: UILabel!
                @IBOutlet weak var label_coin: UILabel!
                @IBOutlet weak var label_courseNum: UILabel!
                @IBOutlet weak var label_money_total: UILabel!
                @IBOutlet weak var label_introducion: UILabel!
                @IBOutlet weak var btn_enroll: UIButton!
                @IBOutlet weak var btn_cancel: UIButton!
                @IBOutlet weak var tableView: UITableView!
                @IBOutlet weak var btn_addStudent: QMUIButton!
                @IBOutlet weak var cons_tableHei: NSLayoutConstraint!
                @IBOutlet weak var label_matchStore: UILabel!
                @IBOutlet weak var btn_moreMatchStore: UIButton!
                @IBOutlet weak var webView: WKWebView!
                @IBOutlet weak var cons_webHei: NSLayoutConstraint!
                @IBOutlet weak var cons__cancelBtnHei: NSLayoutConstraint!
                private var id:Int!
                private lazy var bannerView:CommonBannerView = {
                                let v = CommonBannerView()
                                return v
                }()
                @IBOutlet weak var view_money: UIView!
                @IBOutlet weak var view_coin: UIView!
                @IBOutlet weak var view_courseNum: UIView!
                private var detailModel:WorldCupDetailModel?
                init(id:Int) {
                                super.init(nibName: nil, bundle: nil)
                                self.id = id
                }
                required init?(coder: NSCoder) {
                                fatalError("init(coder:) has not been implemented")
                }
                override func viewDidLoad() {
                                super.viewDidLoad()
                                title = "社区世界杯"
                                Services.getMyWorldCupInfo(id: id).subscribe(onNext: {[weak self]data in
                                                if let model = data.data{
                                                                self?.detailModel = model
                                                                let imgs = model.infoImg.components(separatedBy: ",")
                                                                var items = [CommonBannerModel]()
                                                                for (index,img) in imgs.enumerated(){
                                                                                items.append(CommonBannerModel(index: index,resource: img,mediaType: .imageUrl))
                                                                }
                                                                self?.bannerView.setItems(items: items)
                                                                self?.label_title.text = model.name
                                                                self?.label_hot.text = "\(model.heat)"
                                                                self?.label_duetime.text = model.registrationClosingTime
                                                                self?.label_starttime.text = model.startTime
                                                                self?.label_endtime.text = model.endTime
                                                                self?.label_ageScope.text = model.age + "岁"
                                                                if model.gender == 0{
                                                                                self?.label_joinCondition.text = "全部"
                                                                }else if model.gender == 1{
                                                                                self?.label_joinCondition.text = "仅限男生"
                                                                }else{
                                                                                self?.label_joinCondition.text = "仅限女生"
                                                                }
                                                                self?.label_introducion.text = model.intro
                                                                self?.label_money.text = "¥\(model.unitPrice.jq_formatFloat)/人"
                                                                self?.label_money_total.text = String(format: "合计:¥%.2f", model.expense)
                                                                self?.label_address.text = model.address
                                                                self?.label_city.text = ""
                                                                self?.label_matchStore.text = model.storeInfos.map({$0.name}).joined(separator: "、")
                                                                self?.btn_moreMatchStore.isHidden = model.storeInfos.count > 1
                                                                self?.tableView.reloadData()
                                                                self?.webView.loadHTMLString(model.content.jq_wrapHtml(), baseURL: nil)
                                                                self?.btn_cancel.isHidden = model.revocable == 0
                                                                self?.cons__cancelBtnHei.constant = model.revocable == 0 ? 0:40
                                                }
                                }).disposed(by: disposeBag)
                }
                override func setUI() {
@@ -46,6 +99,9 @@
                                tableView.separatorStyle = .none
                                tableView.isScrollEnabled = false
                                tableView.register(UINib(nibName: "StudentInfo_4_TCell", bundle: nil), forCellReuseIdentifier: "_StudentInfo_4_TCell")
                                view_banner.addSubview(bannerView)
                                bannerView.frame = CGRect(x: 0, y: 0, width: JQ_ScreenW, height: JQ_ScreenW * 0.56)
                }
                override func setRx() {
@@ -53,6 +109,17 @@
                                                .subscribe(onNext: { [weak self] size in
                                                                self?.cons_tableHei.constant = size?.height ?? 0
                                                }).disposed(by: disposeBag)
                                webView.scrollView.rx.observe(CGSize.self, "contentSize").subscribe(onNext: {[weak self] size in
                                                self?.cons_webHei.constant = size?.height ?? 0
                                }).disposed(by: disposeBag)
                }
                @IBAction func matchStoreAction(_ sender: UIButton) {
                                guard let detailModel = detailModel else{return}
                                let text = detailModel.storeInfos.map({$0.name}).joined(separator: "、")
                                AgreentView.show(type: .matchPoint, content: text)
                }
}
@@ -62,17 +129,17 @@
extension WorldCupContentDetailVC:UITableViewDataSource{
                func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
                                return 3
                                return detailModel?.participants.count ?? 0
                }
                func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
                                let model = detailModel!.participants[indexPath.row]
                                let cell = tableView.dequeueReusableCell(withIdentifier: "_StudentInfo_4_TCell", for: indexPath) as! StudentInfo_4_TCell
                                cell.activityDetailPartModel = model
                                return cell
                }
                func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
                                90
                }
}
WanPai/Root/Search/VC/WorldCupContentDetailVC.xib
@@ -12,9 +12,28 @@
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="WorldCupContentDetailVC" customModule="WanPai" customModuleProvider="target">
            <connections>
                <outlet property="btn_cancel" destination="Gkg-tn-WFH" id="u4S-QZ-qFa"/>
                <outlet property="btn_moreMatchStore" destination="tjO-5y-Kg9" id="twv-r8-wNh"/>
                <outlet property="cons__cancelBtnHei" destination="y3u-8o-eMw" id="eWN-fY-L44"/>
                <outlet property="cons_tableHei" destination="HCn-5Z-SAr" id="JPW-ED-7vP"/>
                <outlet property="cons_webHei" destination="6az-y3-MSd" id="rfK-bA-BiR"/>
                <outlet property="label_address" destination="kYd-z9-PGb" id="nVn-FG-baH"/>
                <outlet property="label_ageScope" destination="ail-JE-JUS" id="Odv-vx-cRi"/>
                <outlet property="label_city" destination="HZN-5V-0mC" id="EBJ-np-66R"/>
                <outlet property="label_duetime" destination="CaN-wO-hwU" id="TEp-tm-18V"/>
                <outlet property="label_endtime" destination="kKl-kq-lzY" id="pyb-ba-RrS"/>
                <outlet property="label_hot" destination="6bS-Ki-Z92" id="iqX-fk-Oef"/>
                <outlet property="label_introducion" destination="eyp-c1-yxU" id="46f-96-pOC"/>
                <outlet property="label_joinCondition" destination="w0h-nq-IIZ" id="Qkz-vz-nT2"/>
                <outlet property="label_matchStore" destination="VXV-P0-QQ6" id="3Og-R9-ilk"/>
                <outlet property="label_money" destination="YLf-xG-ZrU" id="4Sb-uG-cRy"/>
                <outlet property="label_money_total" destination="328-hS-eFC" id="crW-3h-arr"/>
                <outlet property="label_starttime" destination="e4r-bY-CuA" id="iem-EG-GGM"/>
                <outlet property="label_title" destination="MRZ-gv-FLH" id="UBE-wV-xC1"/>
                <outlet property="tableView" destination="pGy-ry-sPB" id="9SG-OL-UF5"/>
                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
                <outlet property="view_banner" destination="MmS-Eb-s2q" id="sd0-js-z8g"/>
                <outlet property="webView" destination="Wel-DM-IRM" id="b4b-MR-wGC"/>
            </connections>
        </placeholder>
        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
@@ -22,7 +41,7 @@
            <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
            <subviews>
                <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dMb-17-MtC">
                <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dMb-17-MtC">
                    <rect key="frame" x="0.0" y="0.0" width="393" height="770"/>
                    <subviews>
                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5Sd-Ru-eG3">
@@ -388,6 +407,9 @@
                                                            <state key="normal" title="查看更多">
                                                                <color key="titleColor" name="FE6E0D"/>
                                                            </state>
                                                            <connections>
                                                                <action selector="matchStoreAction:" destination="-1" eventType="touchUpInside" id="Dhm-wb-plo"/>
                                                            </connections>
                                                        </button>
                                                    </subviews>
                                                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
@@ -446,13 +468,6 @@
                                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Cs0-3x-jKV">
                                            <rect key="frame" x="0.0" y="581.66666666666663" width="393" height="81"/>
                                            <subviews>
                                                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gq1-2k-6ZR">
                                                    <rect key="frame" x="13" y="0.0" width="380" height="1"/>
                                                    <color key="backgroundColor" red="0.59215686270000001" green="0.59215686270000001" blue="0.59215686270000001" alpha="0.22" colorSpace="custom" customColorSpace="sRGB"/>
                                                    <constraints>
                                                        <constraint firstAttribute="height" constant="1" id="PWF-6O-8C0"/>
                                                    </constraints>
                                                </view>
                                                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="3Ew-TQ-Qh5">
                                                    <rect key="frame" x="13" y="80" width="380" height="1"/>
                                                    <color key="backgroundColor" red="0.59215686270000001" green="0.59215686270000001" blue="0.59215686270000001" alpha="0.22" colorSpace="custom" customColorSpace="sRGB"/>
@@ -492,16 +507,13 @@
                                            <constraints>
                                                <constraint firstItem="YLf-xG-ZrU" firstAttribute="leading" secondItem="Cs0-3x-jKV" secondAttribute="leading" constant="14" id="0io-kx-50g"/>
                                                <constraint firstAttribute="trailing" secondItem="3Ew-TQ-Qh5" secondAttribute="trailing" id="2sp-To-te6"/>
                                                <constraint firstAttribute="trailing" secondItem="gq1-2k-6ZR" secondAttribute="trailing" id="4jm-jd-AB0"/>
                                                <constraint firstItem="gq1-2k-6ZR" firstAttribute="top" secondItem="Cs0-3x-jKV" secondAttribute="top" id="C79-K7-RL9"/>
                                                <constraint firstItem="uyq-Ch-P6f" firstAttribute="leading" secondItem="Cs0-3x-jKV" secondAttribute="leading" constant="14" id="FhG-eo-4mV"/>
                                                <constraint firstItem="3Ew-TQ-Qh5" firstAttribute="leading" secondItem="Cs0-3x-jKV" secondAttribute="leading" constant="13" id="HrZ-My-kfa"/>
                                                <constraint firstItem="uyq-Ch-P6f" firstAttribute="top" secondItem="Cs0-3x-jKV" secondAttribute="top" constant="15" id="LPS-wd-hTi"/>
                                                <constraint firstItem="328-hS-eFC" firstAttribute="centerY" secondItem="YLf-xG-ZrU" secondAttribute="centerY" id="Nx3-Gu-PlC"/>
                                                <constraint firstItem="YLf-xG-ZrU" firstAttribute="top" secondItem="uyq-Ch-P6f" secondAttribute="bottom" constant="12" id="TzO-ef-cQP"/>
                                                <constraint firstItem="3Ew-TQ-Qh5" firstAttribute="top" secondItem="YLf-xG-ZrU" secondAttribute="bottom" constant="11" id="Z4C-Eo-mnQ"/>
                                                <constraint firstAttribute="bottom" secondItem="3Ew-TQ-Qh5" secondAttribute="bottom" id="alq-Ep-aFd"/>
                                                <constraint firstItem="gq1-2k-6ZR" firstAttribute="leading" secondItem="Cs0-3x-jKV" secondAttribute="leading" constant="13" id="bmh-OH-V1w"/>
                                                <constraint firstItem="uyq-Ch-P6f" firstAttribute="top" secondItem="gq1-2k-6ZR" secondAttribute="bottom" constant="14" id="hgN-hC-SaV"/>
                                                <constraint firstAttribute="trailing" secondItem="uyq-Ch-P6f" secondAttribute="trailing" constant="14" id="q9Q-Ta-MTP"/>
                                                <constraint firstAttribute="trailing" secondItem="328-hS-eFC" secondAttribute="trailing" constant="14" id="vFE-4F-1Ts"/>
                                            </constraints>
@@ -510,27 +522,27 @@
                                            <rect key="frame" x="0.0" y="662.66666666666663" width="393" height="115"/>
                                            <subviews>
                                                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="r3X-Bd-AMv">
                                                    <rect key="frame" x="13" y="0.0" width="380" height="1"/>
                                                    <rect key="frame" x="13" y="0.0" width="380" height="0.33333333333333331"/>
                                                    <color key="backgroundColor" red="0.59215686270000001" green="0.59215686270000001" blue="0.59215686270000001" alpha="0.22" colorSpace="custom" customColorSpace="sRGB"/>
                                                    <constraints>
                                                        <constraint firstAttribute="height" constant="1" id="JhG-hm-Te3"/>
                                                        <constraint firstAttribute="height" constant="0.40000000000000002" id="JhG-hm-Te3"/>
                                                    </constraints>
                                                </view>
                                                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="QkL-SA-SZn">
                                                    <rect key="frame" x="13" y="114" width="380" height="1"/>
                                                    <rect key="frame" x="13" y="114.66666666666674" width="380" height="0.3333333333333286"/>
                                                    <color key="backgroundColor" red="0.59215686270000001" green="0.59215686270000001" blue="0.59215686270000001" alpha="0.22" colorSpace="custom" customColorSpace="sRGB"/>
                                                    <constraints>
                                                        <constraint firstAttribute="height" constant="1" id="gUd-nL-ZvK"/>
                                                        <constraint firstAttribute="height" constant="0.40000000000000002" id="gUd-nL-ZvK"/>
                                                    </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="NMK-fZ-WJU">
                                                    <rect key="frame" x="14" y="15" width="365" height="61"/>
                                                    <rect key="frame" x="14" y="14.333333333333375" width="365" height="62.333333333333343"/>
                                                    <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="16"/>
                                                    <nil key="textColor"/>
                                                    <nil key="highlightedColor"/>
                                                </label>
                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eyp-c1-yxU">
                                                    <rect key="frame" x="14" y="83" width="365" height="17"/>
                                                    <rect key="frame" x="14" y="83.666666666666742" width="365" height="17"/>
                                                    <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                                    <color key="textColor" red="0.23921568630000001" green="0.24313725489999999" blue="0.27058823529999998" alpha="0.69999999999999996" colorSpace="custom" customColorSpace="sRGB"/>
                                                    <nil key="highlightedColor"/>
WanPai/Root/Search/VC/WorldCupContentVC.swift
@@ -6,14 +6,40 @@
//
import UIKit
import RxSwift
import RxRelay
class WorldCupContentViewModel:RefreshModel<WorldCupListModel>{
                var studentID = BehaviorRelay<Int>(value:0)
                var isStudent = BehaviorRelay<Int>(value:0)
                var state = BehaviorRelay<Int>(value:0)
                override func api() -> (Observable<BaseResponse<[WorldCupListModel]>>)? {
                                return Services.getMyWorldCupList(id: studentID.value, isStudent: isStudent.value, pageNo: page, state: state.value)
                }
}
class WorldCupContentVC: BaseVC {
                var currentPartModel:ActivityDetailPartModel?
                private var viewModel = WorldCupContentViewModel()
                private var tableView:UITableView!
    override func viewDidLoad() {
        super.viewDidLoad()
                                view.backgroundColor = .clear
    }
                init(state:Int) {
                                super.init(nibName: nil, bundle: nil)
                                viewModel.state.accept(state)
                }
                required init?(coder: NSCoder) {
                                fatalError("init(coder:) has not been implemented")
                }
                override func setUI() {
                                tableView = UITableView(frame: .zero, style: .plain)
                                tableView.delegate = self
@@ -21,10 +47,17 @@
                                tableView.separatorStyle = .none
                                tableView.backgroundColor = .clear
                                tableView.register(UINib(nibName: "WorldCupTCell", bundle: nil), forCellReuseIdentifier: "_WorldCupTCell")
                                view.addSubview(tableView)
                                tableView.snp.makeConstraints { make in
                                                make.edges.equalToSuperview()
                                }
                                viewModel.configure(tableView)
                                if let m = currentPartModel{
                                                viewModel.studentID.accept(m.id)
                                                viewModel.isStudent.accept(m.isStudent)
                                                viewModel.beginRefresh()
                                }
                }
}
@@ -33,17 +66,21 @@
extension WorldCupContentVC:UITableViewDelegate,UITableViewDataSource{
                func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
                                let vc = WorldCupContentDetailVC()
                                let model = viewModel.dataSource.value[indexPath.row]
                                let vc = WorldCupContentDetailVC(id: model.id)
                                push(vc: vc)
                }
                func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
                                return 20
                                return viewModel.dataSource.value.count
                }
                func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
                                let model = viewModel.dataSource.value[indexPath.row]
                                let cell = tableView.dequeueReusableCell(withIdentifier: "_WorldCupTCell") as! WorldCupTCell
                                cell.backgroundColor = .clear
                                cell.setWorldCupListModel(model)
                                cell.label_state.text = viewModel.state.value == 2 ? "未开始":"进行中"
                                return cell
                }
WanPai/Root/Search/VC/WorldCupHeaderVC.swift
@@ -6,24 +6,76 @@
//
import UIKit
import QMUIKit
import JQTools
class WorldCupHeaderVC: BaseVC {
    override func viewDidLoad() {
        super.viewDidLoad()
                @IBOutlet weak var btn_exchange: QMUIButton!
                @IBOutlet weak var label_name: UILabel!
                @IBOutlet weak var img_QR: UIImageView!
                @IBOutlet weak var label_provinceRank: UILabel!
                @IBOutlet weak var label_yearRank: UILabel!
                @IBOutlet weak var label_cityRank: UILabel!
                @IBOutlet weak var label_winNum: UILabel!
                @IBOutlet weak var label_loseNum: UILabel!
                @IBOutlet weak var label_winRate: UILabel!
                var currentPartModel:ActivityDetailPartModel?{
                                didSet{
                                                if let m = currentPartModel{
                                                                label_name.text = m.name
                                                                img_QR.image = UIImage.jq_GenerateQRCode(with: "\(m.id)", width: 76)
                                                                getData(id: m.id, isStudent: m.isStudent)
                                                }
                                }
                }
                var partModels = [ActivityDetailPartModel](){
                                didSet{
                                                btn_exchange.isHidden = partModels.count <= 1
                                }
                }
                override func viewDidLoad() {
        super.viewDidLoad()
                                view.backgroundColor = .clear
    }
                override func setUI() {
                                btn_exchange.isHidden = true
                                label_name.text = "暂无参赛人员"
                                label_yearRank.text = "您的\(Date().jq_nowYear())年场次排名"
    /*
    // MARK: - Navigation
                                setProvince(rank: 0)
                                setCity(cityName: "", rank: 0)
                }
    // 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.
    }
    */
                private func getData(id:Int,isStudent:Int){
                                Services.getEntrantRank(id: id, isStudent: isStudent).subscribe(onNext: {[weak self] data in
                                                if let model = data.data{
                                                                self?.setProvince(rank: model.nationalRank)
                                                                self?.setCity(cityName: model.cityName, rank: model.cityRank)
                                                                self?.label_winNum.text = "\(model.win)"
                                                                self?.label_loseNum.text = "\(model.lose)"
                                                                self?.label_winRate.text = "\(model.winRate)%"
                                                }
                                }).disposed(by: disposeBag)
                }
                private func setProvince(rank:Int){
                                label_provinceRank.attributedText     = AttributedStringbuilder.build().add(string: "全国排名 ", withFont: .systemFont(ofSize: 14), withColor: .white).add(string: "\(rank)", withFont: .systemFont(ofSize: 28, weight: .semibold), withColor: .white).mutableAttributedString
                }
                private func setCity(cityName:String,rank:Int){
                                label_cityRank.attributedText    = AttributedStringbuilder.build().add(string: "\(cityName)排名 ", withFont: .systemFont(ofSize: 14), withColor: .white).add(string: "\(rank)", withFont: .systemFont(ofSize: 28, weight: .semibold), withColor: .white).mutableAttributedString
                }
                @IBAction func exchangeAction(_ sender: Any) {
                                StudentChoose2View.show { items in
                                }
                }
}
WanPai/Root/Search/VC/WorldCupHeaderVC.xib
@@ -12,6 +12,15 @@
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="WorldCupHeaderVC" customModule="WanPai" customModuleProvider="target">
            <connections>
                <outlet property="btn_exchange" destination="3bk-Zw-hOl" id="guG-Au-EeP"/>
                <outlet property="img_QR" destination="kqK-MA-Vfm" id="4cP-wE-jEN"/>
                <outlet property="label_cityRank" destination="qXP-LB-xCU" id="XyU-KX-35J"/>
                <outlet property="label_loseNum" destination="lO3-VT-LVU" id="Abh-Hg-KXQ"/>
                <outlet property="label_name" destination="CLm-un-lHA" id="nLy-dh-gcl"/>
                <outlet property="label_provinceRank" destination="06M-Qw-l20" id="6T9-YO-bJ7"/>
                <outlet property="label_winNum" destination="rEf-8b-RAY" id="fMY-wz-Tnt"/>
                <outlet property="label_winRate" destination="m9A-Xb-JPg" id="Uw3-Hg-wF1"/>
                <outlet property="label_yearRank" destination="dho-Mk-UEo" id="Hd4-YJ-LaE"/>
                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
            </connections>
        </placeholder>
@@ -20,8 +29,9 @@
            <rect key="frame" x="0.0" y="0.0" width="393" height="418"/>
            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
            <subviews>
                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="rC1-GG-uHG">
                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_user_large" translatesAutoresizingMaskIntoConstraints="NO" id="rC1-GG-uHG">
                    <rect key="frame" x="24.000000000000007" y="24.000000000000007" width="87.666666666666686" height="87.666666666666686"/>
                    <color key="backgroundColor" name="F6F6F6"/>
                    <constraints>
                        <constraint firstAttribute="height" constant="87.5" id="acp-fA-EI4"/>
                        <constraint firstAttribute="width" constant="87.5" id="viK-40-g8b"/>
@@ -54,6 +64,9 @@
                            <real key="value" value="6"/>
                        </userDefinedRuntimeAttribute>
                    </userDefinedRuntimeAttributes>
                    <connections>
                        <action selector="exchangeAction:" destination="-1" eventType="touchUpInside" id="6NP-5X-wda"/>
                    </connections>
                </button>
                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="kqK-MA-Vfm">
                    <rect key="frame" x="282" y="29.666666666666671" width="76" height="76"/>
@@ -80,13 +93,13 @@
                            </constraints>
                        </view>
                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="成都排名 0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qXP-LB-xCU">
                            <rect key="frame" x="186.66666666666666" y="21" width="69.666666666666657" height="17"/>
                            <rect key="frame" x="186.66666666666666" y="25" width="69.666666666666657" height="17"/>
                            <fontDescription key="fontDescription" type="system" 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="全国排名 0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="06M-Qw-l20">
                            <rect key="frame" x="15" y="21" width="69.666666666666671" height="17"/>
                            <rect key="frame" x="15" y="25" width="69.666666666666671" height="17"/>
                            <fontDescription key="fontDescription" type="system" pointSize="14"/>
                            <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                            <nil key="highlightedColor"/>
@@ -94,11 +107,11 @@
                    </subviews>
                    <color key="backgroundColor" name="FE6E0D"/>
                    <constraints>
                        <constraint firstAttribute="bottom" secondItem="06M-Qw-l20" secondAttribute="bottom" constant="14" id="2ja-cx-dYR"/>
                        <constraint firstAttribute="bottom" secondItem="06M-Qw-l20" secondAttribute="bottom" constant="10" id="2ja-cx-dYR"/>
                        <constraint firstItem="qXP-LB-xCU" firstAttribute="leading" secondItem="5bi-q0-cyM" secondAttribute="trailing" constant="20.5" id="74s-Mt-1uu"/>
                        <constraint firstItem="06M-Qw-l20" firstAttribute="leading" secondItem="9RA-9C-jhI" secondAttribute="leading" constant="15" id="HeM-ZB-EQV"/>
                        <constraint firstItem="5bi-q0-cyM" firstAttribute="centerX" secondItem="9RA-9C-jhI" secondAttribute="centerX" id="Jb3-h8-BVT"/>
                        <constraint firstAttribute="bottom" secondItem="qXP-LB-xCU" secondAttribute="bottom" constant="14" id="nsi-Vw-kg3"/>
                        <constraint firstAttribute="bottom" secondItem="qXP-LB-xCU" secondAttribute="bottom" constant="10" id="nsi-Vw-kg3"/>
                        <constraint firstItem="5bi-q0-cyM" firstAttribute="top" secondItem="9RA-9C-jhI" secondAttribute="top" constant="9" id="tIz-Dv-NHL"/>
                        <constraint firstAttribute="height" constant="52" id="tq2-g3-PeI"/>
                        <constraint firstAttribute="bottom" secondItem="5bi-q0-cyM" secondAttribute="bottom" constant="7" id="vjM-zM-z8S"/>
@@ -246,6 +259,10 @@
    </objects>
    <resources>
        <image name="btn_exchange" width="40" height="35"/>
        <image name="icon_user_large" width="92" height="94"/>
        <namedColor name="F6F6F6">
            <color red="0.9649999737739563" green="0.9649999737739563" blue="0.9649999737739563" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
        </namedColor>
        <namedColor name="FE6E0D">
            <color red="0.99199998378753662" green="0.53299999237060547" blue="0.0080000003799796104" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
        </namedColor>
WanPai/Root/Search/VC/WorldCupRecordVC.swift
@@ -6,10 +6,24 @@
//
import UIKit
import RxSwift
import RxCocoa
class WorldCupRecordViewModel:RefreshInnerModel<WorldCupMatchRecordDataModel>{
                let studentId = BehaviorRelay<Int>(value:0)
                let isStudent = BehaviorRelay<Int>(value:0)
                override func api() -> (Observable<BaseResponse<BaseResponseList<WorldCupMatchRecordDataModel>>>)? {
                                return Services.getWorldCupMatchRecord(id: studentId.value, isStudent: isStudent.value, pageNo: page)
                }
}
class WorldCupRecordVC: BaseVC {
                private var tableView:UITableView!
                private var viewModel = WorldCupRecordViewModel()
                override func viewDidLoad() {
                                super.viewDidLoad()
                                view.backgroundColor = .clear
@@ -30,12 +44,15 @@
                                tableView.snp.makeConstraints { make in
                                                make.edges.equalToSuperview()
                                }
                                viewModel.configure(tableView)
                                viewModel.beginRefresh()
                }
}
extension WorldCupRecordVC:UITableViewDelegate,UITableViewDataSource{
                func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
                                return 20
                                return viewModel.dataSource.value?.list.count ?? 0
                }
                func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
@@ -55,7 +72,7 @@
                                                headerView?.backgroundColor = .clear
                                                headerView?.contentView.backgroundColor = .clear
                                            let label    = UILabel()
                                                label.text = "总场次:0场"
                                                label.tag = 100
                                                label.font = UIFont.systemFont(ofSize: 16, weight: .semibold)
                                                label.textColor = .black.withAlphaComponent(0.8)
                                                headerView?.contentView.addSubview(label)
@@ -65,6 +82,11 @@
                                                                make.bottom.equalToSuperview().offset(-6.5)
                                                }
                                }
                                if let label = headerView?.contentView.viewWithTag(100) as? UILabel{
                                                label.text = "总场次:\(viewModel.dataSource.value?.totalSession ?? 0)场"
                                }
                                return headerView
                }
WanPai/Root/Search/VC/WorldCupVC.swift
@@ -13,6 +13,19 @@
class WorldCupVC: BaseVC {
                private var partModels = [ActivityDetailPartModel](){
                                didSet{
                                                currentPartModel = partModels.first
                                }
                }
                private var currentPartModel:ActivityDetailPartModel?{
                                didSet{
                                                headerVC.currentPartModel = currentPartModel
                                                pageVC.reloadData()
                                }
                }
                lazy var headerVC:WorldCupHeaderVC = {
                                let vc = WorldCupHeaderVC()
                                return vc
@@ -33,7 +46,6 @@
                                vc.style = .subRefresh
                                return vc
                }()
                lazy var pageVC:FFPageViewController = {
                                let pageViewController = FFPageViewController()
@@ -65,6 +77,13 @@
                                }
                                menuVC.pageMenu.delegate = self
                                Services.getParticipant().subscribe(onNext: {[weak self ]data in
                                                if let items = data.data{
                                                                guard let weakSelf = self else { return }
                                                                weakSelf.partModels = items
                                                }
                                }).disposed(by: disposeBag)
    }
                override func setUI() {
@@ -79,7 +98,9 @@
                
                func pageViewController(_ pageViewConteoller: FFPageViewController, controllerForPage page: Int) -> UIViewController {
                                if page <= 1{
                                                return WorldCupContentVC()
                                                let contentVC = WorldCupContentVC(state:page + 1)
                                                contentVC.currentPartModel = currentPartModel
                                                return contentVC
                                }else if page == 2{
                                                return WorldCupRecordVC()
                                }else{
WanPai/Root/Welfare/CCell/FindItemCCell.swift
@@ -10,6 +10,7 @@
class FindItemCCell: UICollectionViewCell {
                @IBOutlet weak var label_title: UILabel!
                @IBOutlet weak var img_avar: UIImageView!
                override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
WanPai/Root/Welfare/CCell/FindItemCCell.xib
@@ -18,16 +18,15 @@
                <subviews>
                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="A0h-c2-sMH">
                        <rect key="frame" x="47.666666666666657" y="0.0" width="50" height="50"/>
                        <color key="backgroundColor" red="0.98039215690000003" green="0.57254901960000004" blue="0.23529411759999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                        <constraints>
                            <constraint firstAttribute="width" constant="50" id="MnY-6I-gT0"/>
                            <constraint firstAttribute="height" constant="50" id="vg3-hc-JPZ"/>
                        </constraints>
                    </imageView>
                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5ma-Jk-HRg">
                        <rect key="frame" x="51.666666666666657" y="60" width="42" height="21"/>
                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
                        <nil key="textColor"/>
                        <rect key="frame" x="56.333333333333329" y="60.000000000000007" width="32.333333333333329" height="14.333333333333336"/>
                        <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="12"/>
                        <color key="textColor" red="0.64313725490196072" green="0.64313725490196072" blue="0.64313725490196072" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                        <nil key="highlightedColor"/>
                    </label>
                </subviews>
@@ -40,6 +39,7 @@
            </constraints>
            <size key="customSize" width="145" height="187"/>
            <connections>
                <outlet property="img_avar" destination="A0h-c2-sMH" id="fJT-5H-7dq"/>
                <outlet property="label_title" destination="5ma-Jk-HRg" id="zUy-fV-rdb"/>
            </connections>
            <point key="canvasLocation" x="112.21374045801527" y="68.661971830985919"/>
WanPai/Root/Yard/VC/YardBookingDetailVC.swift
@@ -1,301 +1,301 @@
    //
    //  YardBookingDetailVC.swift
    //  WanPai
    //
    //  Created by 无故事王国 on 2023/9/13.
    //
//
//  YardBookingDetailVC.swift
//  WanPai
//
//  Created by 无故事王国 on 2023/9/13.
//
import UIKit
import JQTools
class YardBookingDetailVC: BaseVC {
    @IBOutlet weak var label_title: UILabel!
    @IBOutlet weak var label_type: UILabel!
    @IBOutlet weak var label_address: UILabel!
    @IBOutlet weak var label_yardName: UILabel!
    @IBOutlet weak var label_bookingType: UILabel!
    @IBOutlet weak var label_halfYardName: UILabel!
    @IBOutlet weak var label_bookingPerson: UILabel!
    @IBOutlet weak var label_contact: UILabel!
    @IBOutlet weak var label_paymentPrice: UILabel!
    @IBOutlet weak var label_bookingTime: UILabel!
    @IBOutlet weak var label_paymentTime: UILabel!
    @IBOutlet weak var view_paymentTime: UIView!
    @IBOutlet weak var label_usedState: UILabel!
    @IBOutlet weak var img_QRCode: UIImageView!
    @IBOutlet weak var view_qrCode: UIView!
    @IBOutlet weak var btn_cancel: UIButton!
    @IBOutlet weak var btn_payment: UIButton!
    @IBOutlet weak var view_halfYard: UIView!
    @IBOutlet weak var btn_call: UIButton!
    @IBOutlet weak var cons_cancelWidth: NSLayoutConstraint!
    @IBOutlet weak var label_descInfo: UILabel!
    @IBOutlet weak var view_yard: UIView!
    @IBOutlet weak var label_dealtime: UILabel!
                @IBOutlet weak var label_title: UILabel!
                @IBOutlet weak var label_type: UILabel!
                @IBOutlet weak var label_address: UILabel!
                @IBOutlet weak var label_yardName: UILabel!
                @IBOutlet weak var label_bookingType: UILabel!
                @IBOutlet weak var label_halfYardName: UILabel!
                @IBOutlet weak var label_bookingPerson: UILabel!
                @IBOutlet weak var label_contact: UILabel!
                @IBOutlet weak var label_paymentPrice: UILabel!
                @IBOutlet weak var label_bookingTime: UILabel!
                @IBOutlet weak var label_paymentTime: UILabel!
                @IBOutlet weak var view_paymentTime: UIView!
                @IBOutlet weak var label_usedState: UILabel!
                @IBOutlet weak var img_QRCode: UIImageView!
                @IBOutlet weak var view_qrCode: UIView!
                @IBOutlet weak var btn_cancel: UIButton!
                @IBOutlet weak var btn_payment: UIButton!
                @IBOutlet weak var view_halfYard: UIView!
                @IBOutlet weak var btn_call: UIButton!
                @IBOutlet weak var cons_cancelWidth: NSLayoutConstraint!
                @IBOutlet weak var label_descInfo: UILabel!
                @IBOutlet weak var view_yard: UIView!
                @IBOutlet weak var label_dealtime: UILabel!
    private var timer:Timer?
    private var siteBookingId:Int?
    private var yardBookingModel:YardBookingModel?
    private var yardBookingDetailDataModel:YardBookingDetailDataModel?
                private var timer:Timer?
                private var siteBookingId:Int?
                private var yardBookingModel:YardBookingModel?
                private var yardBookingDetailDataModel:YardBookingDetailDataModel?
    init(model:YardBookingModel) {
        super.init(nibName: nil, bundle: nil)
        self.yardBookingModel = model
    }
    init(siteBookingId:Int) {
        super.init(nibName: nil, bundle: nil)
        self.siteBookingId = siteBookingId
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func viewDidDisappear(_ animated: Bool) {
        super.viewDidDisappear(animated)
        timer?.invalidate()
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "我的预约"
        getData()
        yy_popBlock = {[weak self] () in
            guard let weakSelf = self else { return }
            var popToVc:UIViewController?
            if weakSelf.navigationController!.viewControllers.contains(where: {$0 is YardBookingListVC}){
                weakSelf.navigationController?.popViewController();return
            }
            for vc in weakSelf.navigationController!.viewControllers{
                if vc is YardListVC{popToVc = vc;break}
            }
            if popToVc != nil{
                weakSelf.navigationController?.popToViewController(popToVc!, animated: true)
            }else{
                weakSelf.navigationController?.popViewController()
            }
        }
    }
    private func getData(){
        var id = 0
        if yardBookingModel != nil{
            id = yardBookingModel!.id
        }else{
            id = siteBookingId!
        }
        Services.siteDetail(id: id).subscribe(onNext: {[weak self] data in
            if let model = data.data?.data{
                self?.yardBookingDetailDataModel = model
                self?.label_title.text = data.data!.siteName
                self?.label_address.text = String(format: "%@(%@)", data.data!.shopName,data.data!.shopAddress)
                self?.label_type.text = data.data!.siteType
                self?.view_yard.isHidden = data.data!.siteType.isEmpty
                self?.label_yardName.text = model.nextName
                self?.label_yardName.isHidden = model.nextName.isEmpty
                self?.label_bookingType.text = model.isHalf == 1 ? "半场":"全场"
                self?.view_halfYard.isHidden = model.isHalf != 1
                self?.label_halfYardName.text = model.halfName
                self?.label_bookingPerson.text = model.booker
                self?.label_contact.text = model.phone
                switch model.payType {
                    case .aliPay,.wechat:
                        self?.label_paymentPrice.text = model.payMoney.currency()
                    case .courseNum:
                        self?.label_paymentPrice.text = model.payMoney.string + "课时"
                    case .coin:
                        self?.label_paymentPrice.text = model.payMoney.int.string + "币"
                    default:break
                init(model:YardBookingModel) {
                                super.init(nibName: nil, bundle: nil)
                                self.yardBookingModel = model
                }
                self?.label_bookingTime.text = model.times
                self?.label_usedState.text = model.status.titleRaw
                self?.label_paymentTime.text = Date.jq_format(TimeInterval(model.payTime / 1000), formatter: "yyyy-MM-dd HH:mm")
                self?.view_paymentTime.isHidden = model.payTime == 0
                switch model.status {
                    case .waitPayment:
                        self?.label_paymentTime.text = "待支付"
                        self?.label_usedState.text = "待支付"
                        self?.label_paymentTime.textColor = UIColor(hexStr: "#F44444")
                        self?.label_usedState.textColor = UIColor(hexStr: "#F44444")
                        self?.view_qrCode.isHidden = true
                        self?.btn_payment.isHidden = false
                    case .cancel,.complete,.overdue:
                        self?.btn_payment.isHidden = true
                        self?.btn_cancel.isHidden = true
                        self?.view_qrCode.isHidden = true
                    case .inStore:
                        self?.btn_payment.isHidden = true
                        self?.btn_cancel.isHidden = true
                        self?.showQRCode(model)
                    case .pending:
                        self?.btn_payment.isHidden = true
                        self?.btn_cancel.isHidden = false
                        self?.showQRCode(model)
                        self?.startTimer(timeZone: model.times)
                    default:
                        break
                init(siteBookingId:Int) {
                                super.init(nibName: nil, bundle: nil)
                                self.siteBookingId = siteBookingId
                }
            }
        }) { error in
        }.disposed(by: disposeBag)
    }
    override func setUI() {
        let text = "您已经预约成功,请在预约时段扫码此二维码入场。您可以在“预约场地-已预约场地-详情”页面找到此二维码。"
        let attribute = AttributedStringbuilder.build().add(string: text, withFont: UIFont.systemFont(ofSize: 12, weight: .medium), withColor: .black.withAlphaComponent(0.43),lineSpace: 5).mutableAttributedString
        label_descInfo.attributedText = attribute
        label_dealtime.isHidden = true
    }
    private func startTimer(timeZone:String){
        guard let startTime    = yardBookingDetailDataModel?.startTime else {return}
        let d = Date(timeIntervalSince1970: TimeInterval(startTime / 1000))
        if Date().timeIntervalSince1970 > d.timeIntervalSince1970{return}
        label_dealtime.isHidden = false
        timer = Timer(timeInterval: 1.0, repeats: true, block: {[weak self] t in
            let datatime = Date.jq_CalBySet(startDate: Date(), endDate:d, set: [.day,.second,.hour,.minute])
            if datatime.day > 0 || datatime.hour > 0 || datatime.minute > 0 || datatime.second > 0{
                if datatime.day > 0{
                    self?.label_dealtime.text = String(format: "距可入场时间:%02ld天%02ld小时%02ld分%02ld秒", datatime.day,datatime.hour,datatime.minute,datatime.second)
                }else if datatime.hour == 0 && datatime.day == 0{
                    self?.label_dealtime.text = String(format: "距可入场时间:%02ld分%02ld秒",datatime.minute,datatime.second)
                }else if datatime.day == 0{
                    self?.label_dealtime.text = String(format: "距可入场时间:%02ld小时%02ld分%02ld秒", datatime.hour,datatime.minute,datatime.second)
                required init?(coder: NSCoder) {
                                fatalError("init(coder:) has not been implemented")
                }
            }else{
                t.invalidate()
                self?.label_dealtime.isHidden = true
            }
        })
        RunLoop.current.add(timer!, forMode: .common)
        timer?.fire()
    }
    private func showQRCode(_ model:YardBookingDetailDataModel){
        guard model.goType == 0 else {
                //入园方式是手环,隐藏Code
            view_qrCode.isHidden = true;return
        }
        if let m = yardBookingDetailDataModel{
            let date = m.times.components(separatedBy: " ").first!
            let time = m.times.components(separatedBy: " ").last!
            let firstTime = time.components(separatedBy: "-").first!
            let lastTime = time.components(separatedBy: "-").last!
            let formatFirstTime = Date.jq_StringToTimeInterval(String(format: "%@ %@", date,firstTime), "yyyy-MM-dd HH:mm")
            let formatLastTime = Date.jq_StringToTimeInterval(String(format: "%@ %@", date,lastTime), "yyyy-MM-dd HH:mm")
            let t = OpenDoorTimeModel(start_time: formatFirstTime, end_time: formatLastTime)
            let openDoorModel = OpenDoorModel(sid: m.sid, rid: m.rid, uid: m.appUserId, time: [t], type: 2)
            if let modelStr = openDoorModel.toJSONString(){
                img_QRCode.image = QRCodeImage(string: modelStr, size: 132 * sceneDelegate!.window!.screen.scale)
            }
        }
    }
    @IBAction func callAction(_ sender: UIButton) {
        guard let phone = yardBookingDetailDataModel?.storePhone else {return}
        UIApplication.shared.open(URL(string: "tel://\(phone)")!, options: [:], completionHandler: nil)
    }
    @IBAction func cancelAction(_ sender: UIButton) {
        var id = 0
        if yardBookingModel != nil{
            id = yardBookingModel!.id
        }else{
            id = siteBookingId!
        }
        CommonAlertView.show(title: "提示", content: "确认取消本次的预约吗?") {[weak self] status in
            if status{
                guard let weakSelf = self else { return }
                Services.cancelMySite(id: id).subscribe(onNext: {[weak self] data in
//                    weakSelf.getData()
                    NotificationCenter.default.post(name: RefreshBooking_Noti, object: nil)
                    self?.navigationController?.popViewController()
                }) { error in
                }.disposed(by: weakSelf.disposeBag)
            }
        }
    }
    @IBAction func paymentAction(_ sender: UIButton) {
        var id = 0
        if yardBookingModel != nil{
            id = yardBookingModel!.id
        }else{
            id = siteBookingId!
        }
        Services.continuePaymentPrice(id: id).subscribe(onNext: {data in
            if let model = data.data{
                PaymentView.show(enumType: .yard, money: (ali: model.cash, wx: model.cash, coin: model.playPaiCoin, course: nil,integral:nil)) { [weak self] paytype in
                    guard let weakSelf = self else { return }
                    Services.continuePayment(id: id, payType: paytype).subscribe(onNext: {data in
                        if let m = data.data{
                            NotificationCenter.default.post(name: RefreshBooking_Noti, object: nil)
                            switch paytype {
                                case .aliPay:
                                    YYPaymentManager.shared.sendPaymentRequest(YYAlipayRequest(orderString: m.orderString)) { result in
                                        switch result {
                                            case .success:
                                                let vc = PaymentResultVC(result: .success, objType: .activityApply)
                                                self?.push(vc: vc)
                                            case .cancel:
                                                alert(msg: "交易取消")
                                            case .failure(_):
                                                let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .activityApply)
                                                self?.push(vc: vc)
                                        }
                                    }
                                case .wechat:break
                                case .coin,.free:
                                    let vc = PaymentResultVC(result: .success, objType: .activityApply)
                                    self?.push(vc: vc)
                                case .courseNum:break
                                default:break
                            }
                        }
                    }) {[weak self] error in
                        if let er = error as? NetworkRequest.NetRequestError{
                            switch er {
                                case .Other(let code,let string):
                                    let vc = PaymentResultVC(result: .fail(string,code), objType: .activityApply)
                                    self?.push(vc: vc)
                                default:
                                    let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .activityApply)
                                    self?.push(vc: vc)
                            }
                        }
                    }.disposed(by: weakSelf.disposeBag)
                override func viewDidDisappear(_ animated: Bool) {
                                super.viewDidDisappear(animated)
                                timer?.invalidate()
                }
            }
        }) { error in
        }.disposed(by: disposeBag)
    }
                override func viewDidLoad() {
                                super.viewDidLoad()
                                title = "我的预约"
                                getData()
                                yy_popBlock = {[weak self] () in
                                                guard let weakSelf = self else { return }
                                                var popToVc:UIViewController?
                                                if weakSelf.navigationController!.viewControllers.contains(where: {$0 is YardBookingListVC}){
                                                                weakSelf.navigationController?.popViewController();return
                                                }
                                                for vc in weakSelf.navigationController!.viewControllers{
                                                                if vc is YardListVC{popToVc = vc;break}
                                                }
                                                if popToVc != nil{
                                                                weakSelf.navigationController?.popToViewController(popToVc!, animated: true)
                                                }else{
                                                                weakSelf.navigationController?.popViewController()
                                                }
                                }
                }
                private func getData(){
                                var id = 0
                                if yardBookingModel != nil{
                                                id = yardBookingModel!.id
                                }else{
                                                id = siteBookingId!
                                }
                                Services.siteDetail(id: id).subscribe(onNext: {[weak self] data in
                                                if let model = data.data?.data{
                                                                self?.yardBookingDetailDataModel = model
                                                                self?.label_title.text = data.data!.siteName
                                                                self?.label_address.text = String(format: "%@(%@)", data.data!.shopName,data.data!.shopAddress)
                                                                self?.label_type.text = data.data!.siteType
                                                                self?.view_yard.isHidden = data.data!.siteType.isEmpty
                                                                self?.label_yardName.text = model.nextName
                                                                self?.label_yardName.isHidden = model.nextName.isEmpty
                                                                self?.label_bookingType.text = model.isHalf == 1 ? "半场":"全场"
                                                                self?.view_halfYard.isHidden = model.isHalf != 1
                                                                self?.label_halfYardName.text = model.halfName
                                                                self?.label_bookingPerson.text = model.booker
                                                                self?.label_contact.text = model.phone
                                                                switch model.payType {
                                                                                case .aliPay,.wechat:
                                                                                                self?.label_paymentPrice.text = model.payMoney.currency()
                                                                                case .courseNum:
                                                                                                self?.label_paymentPrice.text = model.payMoney.string + "课时"
                                                                                case .coin:
                                                                                                self?.label_paymentPrice.text = model.payMoney.int.string + "币"
                                                                                default:break
                                                                }
                                                                self?.label_bookingTime.text = model.times
                                                                self?.label_usedState.text = model.status.titleRaw
                                                                self?.label_paymentTime.text = Date.jq_format(TimeInterval(model.payTime / 1000), formatter: "yyyy-MM-dd HH:mm")
                                                                self?.view_paymentTime.isHidden = model.payTime == 0
                                                                switch model.status {
                                                                                case .waitPayment:
                                                                                                self?.label_paymentTime.text = "待支付"
                                                                                                self?.label_usedState.text = "待支付"
                                                                                                self?.label_paymentTime.textColor = UIColor(hexStr: "#F44444")
                                                                                                self?.label_usedState.textColor = UIColor(hexStr: "#F44444")
                                                                                                self?.view_qrCode.isHidden = true
                                                                                                self?.btn_payment.isHidden = false
                                                                                case .cancel,.complete,.overdue:
                                                                                                self?.btn_payment.isHidden = true
                                                                                                self?.btn_cancel.isHidden = true
                                                                                                self?.view_qrCode.isHidden = true
                                                                                case .inStore:
                                                                                                self?.btn_payment.isHidden = true
                                                                                                self?.btn_cancel.isHidden = true
                                                                                                self?.showQRCode(model)
                                                                                case .pending:
                                                                                                self?.btn_payment.isHidden = true
                                                                                                self?.btn_cancel.isHidden = false
                                                                                                self?.showQRCode(model)
                                                                                                self?.startTimer(timeZone: model.times)
                                                                                default:
                                                                                                break
                                                                }
                                                }
                                }) { error in
                                }.disposed(by: disposeBag)
                }
                override func setUI() {
                                let text = "您已经预约成功,请在预约时段扫码此二维码入场。您可以在“预约场地-已预约场地-详情”页面找到此二维码。"
                                let attribute = AttributedStringbuilder.build().add(string: text, withFont: UIFont.systemFont(ofSize: 12, weight: .medium), withColor: .black.withAlphaComponent(0.43),lineSpace: 5).mutableAttributedString
                                label_descInfo.attributedText = attribute
                                label_dealtime.isHidden = true
                }
                private func startTimer(timeZone:String){
                                guard let startTime    = yardBookingDetailDataModel?.startTime else {return}
                                let d = Date(timeIntervalSince1970: TimeInterval(startTime / 1000))
                                if Date().timeIntervalSince1970 > d.timeIntervalSince1970{return}
                                label_dealtime.isHidden = false
                                timer = Timer(timeInterval: 1.0, repeats: true, block: {[weak self] t in
                                                let datatime = Date.jq_CalBySet(startDate: Date(), endDate:d, set: [.day,.second,.hour,.minute])
                                                if datatime.day > 0 || datatime.hour > 0 || datatime.minute > 0 || datatime.second > 0{
                                                                if datatime.day > 0{
                                                                                self?.label_dealtime.text = String(format: "距可入场时间:%02ld天%02ld小时%02ld分%02ld秒", datatime.day,datatime.hour,datatime.minute,datatime.second)
                                                                }else if datatime.hour == 0 && datatime.day == 0{
                                                                                self?.label_dealtime.text = String(format: "距可入场时间:%02ld分%02ld秒",datatime.minute,datatime.second)
                                                                }else if datatime.day == 0{
                                                                                self?.label_dealtime.text = String(format: "距可入场时间:%02ld小时%02ld分%02ld秒", datatime.hour,datatime.minute,datatime.second)
                                                                }
                                                }else{
                                                                t.invalidate()
                                                                self?.label_dealtime.isHidden = true
                                                }
                                })
                                RunLoop.current.add(timer!, forMode: .common)
                                timer?.fire()
                }
                private func showQRCode(_ model:YardBookingDetailDataModel){
                                guard model.goType == 0 else {
                                                //入园方式是手环,隐藏Code
                                                view_qrCode.isHidden = true;return
                                }
                                if let m = yardBookingDetailDataModel{
                                                let date = m.times.components(separatedBy: " ").first!
                                                let time = m.times.components(separatedBy: " ").last!
                                                let firstTime = time.components(separatedBy: "-").first!
                                                let lastTime = time.components(separatedBy: "-").last!
                                                let formatFirstTime = Date.jq_StringToTimeInterval(String(format: "%@ %@", date,firstTime), "yyyy-MM-dd HH:mm")
                                                let formatLastTime = Date.jq_StringToTimeInterval(String(format: "%@ %@", date,lastTime), "yyyy-MM-dd HH:mm")
                                                let t = OpenDoorTimeModel(start_time: formatFirstTime, end_time: formatLastTime)
                                                let openDoorModel = OpenDoorModel(sid: m.sid, rid: m.rid, uid: m.appUserId, time: [t], type: 2)
                                                if let modelStr = openDoorModel.toJSONString(){
                                                                img_QRCode.image = QRCodeImage(string: modelStr, size: 132 * sceneDelegate!.window!.screen.scale)
                                                }
                                }
                }
                @IBAction func callAction(_ sender: UIButton) {
                                guard let phone = yardBookingDetailDataModel?.storePhone else {return}
                                UIApplication.shared.open(URL(string: "tel://\(phone)")!, options: [:], completionHandler: nil)
                }
                @IBAction func cancelAction(_ sender: UIButton) {
                                var id = 0
                                if yardBookingModel != nil{
                                                id = yardBookingModel!.id
                                }else{
                                                id = siteBookingId!
                                }
                                CommonAlertView.show(title: "提示", content: "确认取消本次的预约吗?") {[weak self] status in
                                                if status{
                                                                guard let weakSelf = self else { return }
                                                                Services.cancelMySite(id: id).subscribe(onNext: {[weak self] data in
                                                                                //                    weakSelf.getData()
                                                                                NotificationCenter.default.post(name: RefreshBooking_Noti, object: nil)
                                                                                self?.navigationController?.popViewController()
                                                                }) { error in
                                                                }.disposed(by: weakSelf.disposeBag)
                                                }
                                }
                }
                @IBAction func paymentAction(_ sender: UIButton) {
                                var id = 0
                                if yardBookingModel != nil{
                                                id = yardBookingModel!.id
                                }else{
                                                id = siteBookingId!
                                }
                                Services.continuePaymentPrice(id: id).subscribe(onNext: {data in
                                                if let model = data.data{
                                                                PaymentView.show(enumType: .yard, money: (ali: model.cash, wx: model.cash, coin: model.playPaiCoin, course: nil,integral:nil)) { [weak self] paytype in
                                                                                guard let weakSelf = self else { return }
                                                                                Services.continuePayment(id: id, payType: paytype).subscribe(onNext: {data in
                                                                                                if let m = data.data{
                                                                                                                NotificationCenter.default.post(name: RefreshBooking_Noti, object: nil)
                                                                                                                switch paytype {
                                                                                                                                case .aliPay:
                                                                                                                                                YYPaymentManager.shared.sendPaymentRequest(YYAlipayRequest(orderString: m.orderString)) { result in
                                                                                                                                                                switch result {
                                                                                                                                                                                case .success:
                                                                                                                                                                                                let vc = PaymentResultVC(result: .success, objType: .activityApply)
                                                                                                                                                                                                self?.push(vc: vc)
                                                                                                                                                                                case .cancel:
                                                                                                                                                                                                alert(msg: "交易取消")
                                                                                                                                                                                case .failure(_):
                                                                                                                                                                                                let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .activityApply)
                                                                                                                                                                                                self?.push(vc: vc)
                                                                                                                                                                }
                                                                                                                                                }
                                                                                                                                case .wechat:break
                                                                                                                                case .coin,.free:
                                                                                                                                                let vc = PaymentResultVC(result: .success, objType: .activityApply)
                                                                                                                                                self?.push(vc: vc)
                                                                                                                                case .courseNum:break
                                                                                                                                default:break
                                                                                                                }
                                                                                                }
                                                                                }) {[weak self] error in
                                                                                                if let er = error as? NetworkRequest.NetRequestError{
                                                                                                                switch er {
                                                                                                                                case .Other(let code,let string):
                                                                                                                                                let vc = PaymentResultVC(result: .fail(string,code), objType: .activityApply)
                                                                                                                                                self?.push(vc: vc)
                                                                                                                                default:
                                                                                                                                                let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .activityApply)
                                                                                                                                                self?.push(vc: vc)
                                                                                                                }
                                                                                                }
                                                                                }.disposed(by: weakSelf.disposeBag)
                                                                }
                                                }
                                }) { error in
                                }.disposed(by: disposeBag)
                }
}
WanPai/ViewModel/RefreshModel.swift
@@ -1,9 +1,9 @@
    //
    //  RefreshModel.swift
    //  WanPai
    //
    //  Created by 无故事王国 on 2023/7/11.
    //
//
//  RefreshModel.swift
//  WanPai
//
//  Created by 无故事王国 on 2023/7/11.
//
import UIKit
import MJRefresh
@@ -13,187 +13,267 @@
enum RefreshState {
    case refreshing
    case completedRefresh
    case moreLoading
    case completedLoad
    case completedLoadWithNoMoreData
                case refreshing
                case completedRefresh
                case moreLoading
                case completedLoad
                case completedLoadWithNoMoreData
}
protocol RefreshModelProctol {
    associatedtype T:HandyJSON
    func api()->(Observable<BaseResponse<[T]>>)?
                associatedtype T:HandyJSON
                func api()->(Observable<BaseResponse<[T]>>)?
}
protocol RefreshModelInnerProctol {
                associatedtype T:HandyJSON
                func api()->(Observable<BaseResponse<BaseResponseList<T>>>)?
}
class RefreshModel<T:HandyJSON>:RefreshModelProctol{
    func api() -> (RxSwift.Observable<BaseResponse<[T]>>)? {
        return nil
    }
                func api() -> (RxSwift.Observable<BaseResponse<[T]>>)? {return nil}
                let disposeBag = DisposeBag()
                enum RefreshType {case refresh,load}
    let disposeBag = DisposeBag()
                private var handle:UIScrollView!
                lazy var refreshSubject = PublishSubject<RefreshState>()
                var page:Int = 0
                var pageSize:Int = 20
                private var needRefreshData:Bool = true
                lazy var dataSource = BehaviorRelay<[T]>(value: [])
                func configure(_ scrollView:UITableView,needMore:Bool = true){
                                scrollView.mj_header = CustomRefreshHeaer.refreshing(with: refreshData())
                                if needMore{
                                                scrollView.mj_footer = CustomRefreshFooter.refreshing(with: loadMoreData())
                                }
                                refreshSubject.bind(to: scrollView.rx.handlestatus()).disposed(by: disposeBag)
                                handle = scrollView
                }
                func configure(_ scrollView:UICollectionView,needMore:Bool = true,needRefreshData:Bool = true){
                                self.needRefreshData = needRefreshData
                                scrollView.mj_header = CustomRefreshHeaer.refreshing(with: refreshData())
                                if needMore{
                                                scrollView.mj_footer = CustomRefreshFooter.refreshing(with: loadMoreData())
                                }
                                refreshSubject.bind(to: scrollView.rx.handlestatus()).disposed(by: disposeBag)
                                handle = scrollView
                }
                func beginRefresh(){
                                handle.mj_header?.beginRefreshing()
                }
                func refreshData() ->(()->Void) {
                                return {self.request(status: .refresh)}
                }
                func loadMoreData() ->(()->Void) {
                                return {self.request(status: .load)}
                }
                func request(status:RefreshType){
                                switch status {
                                                case .refresh:
                                                                self.page = 1
                                                                self.refreshSubject.onNext(.refreshing)
                                                case .load:
                                                                self.page += 1
                                                                self.refreshSubject.onNext(.moreLoading)
                                }
                                api()?.subscribe(onNext: { data in
                                                if let datas = data.data{
                                                                switch status{
                                                                                case .refresh:
                                                                                                self.dataSource.accept(datas)
                                                                                                self.refreshSubject.onNext(.completedRefresh)
                                                                                case .load:
                                                                                                self.dataSource.accept(self.dataSource.value + datas)
                                                                                                if datas.count == 0{
                                                                                                                self.refreshSubject.onNext(.completedLoadWithNoMoreData)
                                                                                                }else{
                                                                                                                self.refreshSubject.onNext(.completedLoad)
                                                                                                }
                                                                }
                                                }else{
                                                                self.refreshSubject.onNext(.completedLoadWithNoMoreData)
                                                }
                                }, onError: { error in
                                                self.refreshSubject.onNext(.completedLoad)
                                }).disposed(by: disposeBag)
                }
}
    enum RefreshType {
        case refresh,load
    }
class RefreshInnerModel<T:HandyJSON>:RefreshModelInnerProctol{
                func api() -> (RxSwift.Observable<BaseResponse<BaseResponseList<T>>>)? {
                                return nil
                }
                let disposeBag = DisposeBag()
                enum RefreshType {case refresh,load}
                private var handle:UIScrollView!
                lazy var refreshSubject = PublishSubject<RefreshState>()
                var page:Int = 0
                var pageSize:Int = 20
                private var needRefreshData:Bool = true
                lazy var dataSource = BehaviorRelay<BaseResponseList<T>?>(value: nil)
                func configure(_ scrollView:UITableView,needMore:Bool = true){
                                scrollView.mj_header = CustomRefreshHeaer.refreshing(with: refreshData())
                                if needMore{
                                                scrollView.mj_footer = CustomRefreshFooter.refreshing(with: loadMoreData())
                                }
                                refreshSubject.bind(to: scrollView.rx.handlestatus()).disposed(by: disposeBag)
                                handle = scrollView
                }
                func configure(_ scrollView:UICollectionView,needMore:Bool = true,needRefreshData:Bool = true){
                                self.needRefreshData = needRefreshData
                                scrollView.mj_header = CustomRefreshHeaer.refreshing(with: refreshData())
                                if needMore{
                                                scrollView.mj_footer = CustomRefreshFooter.refreshing(with: loadMoreData())
                                }
                                refreshSubject.bind(to: scrollView.rx.handlestatus()).disposed(by: disposeBag)
                                handle = scrollView
                }
                func beginRefresh(){
                                handle.mj_header?.beginRefreshing()
                }
                func refreshData() ->(()->Void) {
                                return {self.request(status: .refresh)}
                }
                func loadMoreData() ->(()->Void) {
                                return {self.request(status: .load)}
                }
                func request(status:RefreshType){
                                switch status {
                                                case .refresh:
                                                                self.page = 1
                                                                self.refreshSubject.onNext(.refreshing)
                                                case .load:
                                                                self.page += 1
                                                                self.refreshSubject.onNext(.moreLoading)
                                }
                                api()?.subscribe(onNext: { data in
                                                switch status{
                                                                case .refresh:
                                                                                self.dataSource.accept(data.data)
                                                                                self.refreshSubject.onNext(.completedRefresh)
                                                                case .load:
                                                                                var new = self.dataSource.value?.list ?? []
                                                                                new.append(contentsOf: data.data?.list ?? [])
                                                                                var model = self.dataSource.value
                                                                                model!.list = new
                                                                                self.dataSource.accept(model)
                                                                                if data.data?.list.count == 0{
                                                                                                self.refreshSubject.onNext(.completedLoadWithNoMoreData)
                                                                                }else{
                                                                                                self.refreshSubject.onNext(.completedLoad)
                                                                                }
                                                }
                                }, onError: { error in
                                                self.refreshSubject.onNext(.completedLoad)
                                }).disposed(by: disposeBag)
                }
    private var handle:UIScrollView!
    lazy var refreshSubject = PublishSubject<RefreshState>()
    var page:Int = 0
    var pageSize:Int = 20
    private var needRefreshData:Bool = true
    lazy var dataSource = BehaviorRelay<[T]>(value: [])
    func configure(_ scrollView:UITableView,needMore:Bool = true){
        scrollView.mj_header = CustomRefreshHeaer.refreshing(with: refreshData())
        if needMore{
            scrollView.mj_footer = CustomRefreshFooter.refreshing(with: loadMoreData())
        }
        refreshSubject.bind(to: scrollView.rx.handlestatus()).disposed(by: disposeBag)
        handle = scrollView
    }
    func configure(_ scrollView:UICollectionView,needMore:Bool = true,needRefreshData:Bool = true){
        self.needRefreshData = needRefreshData
        scrollView.mj_header = CustomRefreshHeaer.refreshing(with: refreshData())
        if needMore{
            scrollView.mj_footer = CustomRefreshFooter.refreshing(with: loadMoreData())
        }
        refreshSubject.bind(to: scrollView.rx.handlestatus()).disposed(by: disposeBag)
        handle = scrollView
    }
    func beginRefresh(){
        handle.mj_header?.beginRefreshing()
    }
    func refreshData() ->(()->Void) {
        return {self.request(status: .refresh)}
    }
    func loadMoreData() ->(()->Void) {
        return {self.request(status: .load)}
    }
    func request(status:RefreshType){
        switch status {
            case .refresh:
                self.page = 1
                self.refreshSubject.onNext(.refreshing)
            case .load:
                self.page += 1
                self.refreshSubject.onNext(.moreLoading)
        }
        api()?.subscribe(onNext: { data in
            if let datas = data.data{
                switch status{
                    case .refresh:
                        self.dataSource.accept(datas)
                        self.refreshSubject.onNext(.completedRefresh)
                    case .load:
                        self.dataSource.accept(self.dataSource.value + datas)
                        if datas.count == 0{
                            self.refreshSubject.onNext(.completedLoadWithNoMoreData)
                        }else{
                            self.refreshSubject.onNext(.completedLoad)
                        }
                }
            }else{
                self.refreshSubject.onNext(.completedLoadWithNoMoreData)
            }
        }, onError: { error in
            self.refreshSubject.onNext(.completedLoad)
        }).disposed(by: disposeBag)
    }
}
class CustomRefreshHeaer:MJRefreshNormalHeader{
    static func refreshing(with refreshingBlock: @escaping MJRefreshComponentAction) -> MJRefreshNormalHeader? {
        let refreshHeader = MJRefreshNormalHeader(refreshingBlock: refreshingBlock)
        return refreshHeader
    }
                static func refreshing(with refreshingBlock: @escaping MJRefreshComponentAction) -> MJRefreshNormalHeader? {
                                let refreshHeader = MJRefreshNormalHeader(refreshingBlock: refreshingBlock)
                                return refreshHeader
                }
}
class CustomRefreshFooter:MJRefreshAutoNormalFooter{
    static func refreshing(with refreshingBlock: @escaping MJRefreshComponentAction) -> MJRefreshAutoNormalFooter? {
        let refrehFooter = MJRefreshAutoNormalFooter(refreshingBlock: refreshingBlock)
        refrehFooter.isRefreshingTitleHidden = true
        refrehFooter.stateLabel?.isHidden = true
        return refrehFooter
    }
                static func refreshing(with refreshingBlock: @escaping MJRefreshComponentAction) -> MJRefreshAutoNormalFooter? {
                                let refrehFooter = MJRefreshAutoNormalFooter(refreshingBlock: refreshingBlock)
                                refrehFooter.isRefreshingTitleHidden = true
                                refrehFooter.stateLabel?.isHidden = true
                                return refrehFooter
                }
}
extension Reactive where Base : UITableView {
    func handlestatus() -> Binder<RefreshState> {
        return Binder(self.base) { (tableView, status) in
            switch status {
                case .moreLoading:
                    self.base.mj_footer?.beginRefreshing()
                case .refreshing:
                    self.base.reloadData()
                    self.base.mj_footer?.resetNoMoreData()
                    self.base.mj_header?.beginRefreshing()
                func handlestatus() -> Binder<RefreshState> {
                                return Binder(self.base) { (tableView, status) in
                                                switch status {
                                                                case .moreLoading:
                                                                                self.base.mj_footer?.beginRefreshing()
                                                                case .refreshing:
                                                                                self.base.reloadData()
                                                                                self.base.mj_footer?.resetNoMoreData()
                                                                                self.base.mj_header?.beginRefreshing()
                case .completedLoadWithNoMoreData:
                    DispatchQueue.main.async {
                        self.base.reloadData()
                    }
                    (self.base.mj_footer as? MJRefreshAutoNormalFooter)?.stateLabel?.isHidden = false
                    self.base.mj_footer?.endRefreshingWithNoMoreData()
                    self.base.mj_header?.endRefreshing()
                case .completedLoad:
                    DispatchQueue.main.async {
                        self.base.reloadData()
                    }
                    self.base.mj_footer?.endRefreshing()
                    self.base.mj_header?.endRefreshing()
                default:
                    DispatchQueue.main.async {
                        self.base.reloadData()
                    }
                    self.base.mj_header?.endRefreshing()
                    self.base.mj_footer?.endRefreshing()
            }
        }
    }
                                                                case .completedLoadWithNoMoreData:
                                                                                DispatchQueue.main.async {
                                                                                                self.base.reloadData()
                                                                                }
                                                                                (self.base.mj_footer as? MJRefreshAutoNormalFooter)?.stateLabel?.isHidden = false
                                                                                self.base.mj_footer?.endRefreshingWithNoMoreData()
                                                                                self.base.mj_header?.endRefreshing()
                                                                case .completedLoad:
                                                                                DispatchQueue.main.async {
                                                                                                self.base.reloadData()
                                                                                }
                                                                                self.base.mj_footer?.endRefreshing()
                                                                                self.base.mj_header?.endRefreshing()
                                                                default:
                                                                                DispatchQueue.main.async {
                                                                                                self.base.reloadData()
                                                                                }
                                                                                self.base.mj_header?.endRefreshing()
                                                                                self.base.mj_footer?.endRefreshing()
                                                }
                                }
                }
}
extension Reactive where Base : UICollectionView {
    func handlestatus() -> Binder<RefreshState> {
        return Binder(self.base) { (tableView, status) in
            switch status {
                case .moreLoading:
                    self.base.mj_footer?.beginRefreshing()
                case .refreshing:
                    self.base.reloadData()
                    self.base.mj_footer?.resetNoMoreData()
                    self.base.mj_header?.endRefreshing()
                func handlestatus() -> Binder<RefreshState> {
                                return Binder(self.base) { (tableView, status) in
                                                switch status {
                                                                case .moreLoading:
                                                                                self.base.mj_footer?.beginRefreshing()
                                                                case .refreshing:
                                                                                self.base.reloadData()
                                                                                self.base.mj_footer?.resetNoMoreData()
                                                                                self.base.mj_header?.endRefreshing()
                case .completedLoadWithNoMoreData:
                    DispatchQueue.main.async {
                        self.base.reloadData()
                    }
                    self.base.mj_footer?.endRefreshingWithNoMoreData()
                case .completedLoad:
                    DispatchQueue.main.async {
                        self.base.reloadData()
                    }
                    self.base.mj_footer?.endRefreshing()
                default:
                    DispatchQueue.main.async {
                        self.base.reloadData()
                    }
                    self.base.mj_header?.endRefreshing()
                    self.base.mj_footer?.endRefreshing()
            }
        }
    }
                                                                case .completedLoadWithNoMoreData:
                                                                                DispatchQueue.main.async {
                                                                                                self.base.reloadData()
                                                                                }
                                                                                self.base.mj_footer?.endRefreshingWithNoMoreData()
                                                                case .completedLoad:
                                                                                DispatchQueue.main.async {
                                                                                                self.base.reloadData()
                                                                                }
                                                                                self.base.mj_footer?.endRefreshing()
                                                                default:
                                                                                DispatchQueue.main.async {
                                                                                                self.base.reloadData()
                                                                                }
                                                                                self.base.mj_header?.endRefreshing()
                                                                                self.base.mj_footer?.endRefreshing()
                                                }
                                }
                }
}