无故事王国
2023-12-22 3bb9ef528199cab12e5f9b3bbf1064cfa296caaa
修复BUG:
1. 相机授权“取消”崩溃问题
2. 活动列表未带城市问题
5个文件已修改
91 ■■■■■ 已修改文件
WanPai/Common/VC/CommonScanQRCodeVC.swift 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Activity/VC/ActivityListVC.swift 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/VC/StudentMentalListVC.swift 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Games/GamesVC.swift 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Home/VC/HomeVC.swift 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Common/VC/CommonScanQRCodeVC.swift
@@ -148,25 +148,39 @@
    }
    private func limitFaild(){
        let alertController = UIAlertController(title: nil,message: "请在iphone的“设置-隐私-相机”选项中,允许应用访问你的相机", preferredStyle: .alert)
        let cancelAction = UIAlertAction(title: "取消", style: .cancel, handler: { action in
            self.navigationController?.popViewController(animated: true)
        })
        let okAction = UIAlertAction(title: "前往", style: .default, handler: {action in
            let settingUrl = NSURL(string: UIApplication.openSettingsURLString)!
            if UIApplication.shared.canOpenURL(settingUrl as URL){
                if #available(iOS 10.0, *) {
                    UIApplication.shared.open(settingUrl as URL, options: [:], completionHandler: nil)
                } else {
                    UIApplication.shared.openURL(settingUrl as URL)
        DispatchQueue.main.async {
            let alertController = UIAlertController(title: nil,message: "请在iphone的“设置-隐私-相机”选项中,允许应用访问你的相机", preferredStyle: .alert)
            let cancelAction = UIAlertAction(title: "取消", style: .cancel, handler: { action in
                if self.qmui_isPresented(){
                    self.dismiss(animated: true)
                }else{
                    self.navigationController?.popViewController(animated: true)
                }
            }
        })
            })
        alertController.addAction(cancelAction)
        alertController.addAction(okAction)
        self.present(alertController, animated: true, completion: nil)
            let okAction = UIAlertAction(title: "前往", style: .default, handler: {action in
                if self.qmui_isPresented(){
                    self.dismiss(animated: true)
                }else{
                    self.navigationController?.popViewController(animated: true)
                }
                let settingUrl = NSURL(string: UIApplication.openSettingsURLString)!
                if UIApplication.shared.canOpenURL(settingUrl as URL){
                    if #available(iOS 10.0, *) {
                        UIApplication.shared.open(settingUrl as URL, options: [:], completionHandler: nil)
                    } else {
                        UIApplication.shared.openURL(settingUrl as URL)
                    }
                }
            })
            alertController.addAction(cancelAction)
            alertController.addAction(okAction)
            self.present(alertController, animated: true, completion: nil)
        }
    }
    func checkCameraAuth() -> Bool {
WanPai/Root/Activity/VC/ActivityListVC.swift
@@ -34,12 +34,25 @@
    private var cityChooseSubTypeView:CityChooseSubTypeView?
    private var viewModel = ActivityListViewModel()
    private var selectSignupConditionModel:NormalSimpleModel?
    private var cityModel:HomeStoreModel?
    init(cityModel:HomeStoreModel? = nil){
        super.init(nibName: nil, bundle: nil)
        self.cityModel = cityModel
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "活动列表"
        if cityModel != nil{
            btn_holdCity.setTitle(cityModel!.city, for: .normal)
            viewModel.cityCode.accept(cityModel!.cityCode)
        }
        viewModel.configure(tableView,needMore: false)
        viewModel.beginRefresh()
    }
WanPai/Root/Course/VC/StudentMentalListVC.swift
@@ -82,7 +82,13 @@
            let vc    = YardListVC()
                push(vc: vc)
            case .sport:
                let vc = ActivityListVC()
                var storeModel:HomeStoreModel?
                if let storeStr = UserDefaults.standard.object(forKey: "CurrentStore") as? String{
                    if let deserModel = HomeStoreModel.deserialize(from: storeStr){
                        storeModel = deserModel
                    }
                }
                let vc = ActivityListVC(cityModel: storeModel)
                push(vc: vc)
            case .deepPlayer:
                let vc = CourseExerciseSubListVC()
WanPai/Root/Games/GamesVC.swift
@@ -41,21 +41,7 @@
    }
    override func setRx() {
//        NotificationCenter.default.rx.notification(StartGame_Noti).take(until: self.rx.deallocated).subscribe(onNext: {[weak self] noti in
//            guard let weakSelf = self else { return }
//            if let gameId = noti.object as? Int{
//                Services.userDetails().subscribe(onNext: {[weak self] data in
//                    guard let weakSelf = self else { return }
//                    if let model = data.data{
//                        Services.game_gameStart(gameId: gameId, spaceId: weakSelf.codeModel.space_id!, sutuId: weakSelf.codeModel.sutu_id!, userID: model.userId).subscribe(onNext: { _ in
//                            alertSuccess(msg: "启动成功")
//                        }) { error in
//
//                        }.disposed(by: weakSelf.disposeBag)
//                    }
//                }).disposed(by: weakSelf.disposeBag)
//            }
//        }).disposed(by: disposeBag)
    }
    @IBAction func scanAction(_ sender: UIButton) {
WanPai/Root/Home/VC/HomeVC.swift
@@ -308,7 +308,7 @@
                    let vc = YardListVC(selectStore: simpleModel)
                    push(vc: vc)
                case .activity:
                    let vc = ActivityListVC()
                    let vc = ActivityListVC(cityModel: storeModel)
                    push(vc: vc)
                case .video:
                    let vc = CourseOnlineListVC(position: 2)