diff --git a/Veloria/AppDelegate/SceneDelegate+APNS.swift b/Veloria/AppDelegate/SceneDelegate+APNS.swift index 3576cdb..e26a328 100644 --- a/Veloria/AppDelegate/SceneDelegate+APNS.swift +++ b/Veloria/AppDelegate/SceneDelegate+APNS.swift @@ -44,7 +44,7 @@ extension AppDelegate { VPAppTool.sceneDelegate?.vp_retryHandleOpenAppMessage() } - + self.uploadNoticeStatus() } UIApplication.shared.registerForRemoteNotifications() @@ -67,6 +67,17 @@ extension AppDelegate { } } + ///更新通知状态 + func uploadNoticeStatus() { + UNUserNotificationCenter.current().getNotificationSettings { settings in + if settings.authorizationStatus == .authorized { + VPRewardsAPI.requestUploadNoticeStatus(status: true) + } else if settings.authorizationStatus == .denied { + VPRewardsAPI.requestUploadNoticeStatus(status: false) + } + } + } + } diff --git a/Veloria/AppDelegate/SceneDelegate.swift b/Veloria/AppDelegate/SceneDelegate.swift index f9d8cba..76bd7b6 100644 --- a/Veloria/AppDelegate/SceneDelegate.swift +++ b/Veloria/AppDelegate/SceneDelegate.swift @@ -63,7 +63,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { func sceneWillEnterForeground(_ scene: UIScene) { vpLog(message: "++++++++++++++sceneWillEnterForeground") - + VPAppTool.appDelegate?.uploadNoticeStatus() DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { self.vp_handleOpenAppMessage(webpageURL: nil) } diff --git a/Veloria/Base/Networking/API/VPRewardsAPI.swift b/Veloria/Base/Networking/API/VPRewardsAPI.swift index 4303a49..b6bec9d 100644 --- a/Veloria/Base/Networking/API/VPRewardsAPI.swift +++ b/Veloria/Base/Networking/API/VPRewardsAPI.swift @@ -22,4 +22,18 @@ class VPRewardsAPI: NSObject { } } } + + ///上传通知状态 + static func requestUploadNoticeStatus(status: Bool) { + var param = VPNetworkParameters(path: "/customer/uploadNoticeStatus") + param.isLoding = false + param.isToast = false + param.parameters = [ + "is_open_notice" : status ? 1 : 0 + ] + + VPNetwork.request(parameters: param) { (response: VPNetworkResponse) in + + } + } } diff --git a/Veloria/Class/Explore/Controller/VPExploreViewController.swift b/Veloria/Class/Explore/Controller/VPExploreViewController.swift index d7277ea..99e13ea 100644 --- a/Veloria/Class/Explore/Controller/VPExploreViewController.swift +++ b/Veloria/Class/Explore/Controller/VPExploreViewController.swift @@ -20,7 +20,7 @@ class VPExploreViewController: VPVideoPlayerViewController { guard let self = self else { return } self.requestDataArr(page: 1) } - view.isHidden = false + view.isHidden = true return view }() @@ -140,8 +140,7 @@ extension VPExploreViewController { } self.pagination = listModel.pagination - } - else { + } else { if VPNetworkReachabilityManager.manager.isReachable != true, self.getDataCount() == 0 { self.emptyView.isHidden = false self.collectionView.isHidden = true diff --git a/Veloria/Class/Home/Controller/VPHomePageViewController.swift b/Veloria/Class/Home/Controller/VPHomePageViewController.swift index 17f8ead..72329ad 100644 --- a/Veloria/Class/Home/Controller/VPHomePageViewController.swift +++ b/Veloria/Class/Home/Controller/VPHomePageViewController.swift @@ -225,7 +225,7 @@ extension VPHomePageViewController { private func vp_setupUI() { guard VPNetworkReachabilityManager.manager.isReachable == true, pageView.superview == nil else { - if emptyView.superview == nil { + if emptyView.superview == nil, pageView.superview == nil { view.addSubview(emptyView) emptyView.snp.makeConstraints { make in make.left.equalToSuperview() diff --git a/Veloria/Class/Home/ViewModel/VPHomeViewModel.swift b/Veloria/Class/Home/ViewModel/VPHomeViewModel.swift index 97e7931..e5b6e6e 100644 --- a/Veloria/Class/Home/ViewModel/VPHomeViewModel.swift +++ b/Veloria/Class/Home/ViewModel/VPHomeViewModel.swift @@ -53,36 +53,51 @@ class VPHomeViewModel: VPModel { private func filterModuleData() { newModuleList.removeAll() + //banner + var item1: VPHomeModuleItem? + //v3数据 + var item2: VPHomeModuleItem? + //排行 + var item3: VPHomeModuleItem? + ///其余分类数据 + var item4List: [VPHomeModuleItem] = [] + oldModuleList?.forEach({ if let key = $0.module_key { if key == .banner { - newModuleList.insert($0, at: 0) - + item1 = $0 +// newModuleList.insert($0, at: 0) } - /* else if key == .category_navigation { //分类数据 - if needUpdateCategory { - categoryList.removeAll() - categoryTitleList.removeAll() - - let allCategory = VPCategoryModel() - allCategory.name = "veloria_all".localized - allCategory.id = "0" - categoryList.append(allCategory) - categoryList += ($0.categoryList ?? []) - - categoryList.forEach { model in - categoryTitleList.append(model.name ?? "") - } - } - - }*/ else if key == .marquee { //跑马灯数据 marqueeArr = $0.list ?? [] - } else { - newModuleList.append($0) + + } else if key == .v3_recommand { + item2 = $0 + } else if key == .week_ranking { + item3 = $0 + } else if key == .cagetory_recommand { + item4List.append($0) } } }) + + if let item = item1 { + newModuleList.append(item) + } + if let item = item2 { + newModuleList.append(item) + } + if let item = item4List.first { + newModuleList.append(item) + item4List.removeFirst() + } + if let item = item3 { + newModuleList.append(item) + } + item4List.forEach { + newModuleList.append($0) + } + } } diff --git a/Veloria/Class/Me/Controller/VPDeleteAccountViewController.swift b/Veloria/Class/Me/Controller/VPDeleteAccountViewController.swift index 2635f35..b92acb0 100644 --- a/Veloria/Class/Me/Controller/VPDeleteAccountViewController.swift +++ b/Veloria/Class/Me/Controller/VPDeleteAccountViewController.swift @@ -23,7 +23,7 @@ class VPDeleteAccountViewController: VPViewController { let label = UILabel() label.font = .fontRegular(ofSize: 14) label.textColor = .colorBE0069() - label.text = "DeleteAccount_tips_1".localized + label.text = "veloria_delete_title".localized return label }() @@ -42,13 +42,13 @@ class VPDeleteAccountViewController: VPViewController { private lazy var contentView1: VPDeleteAccountNormalView = { let view = VPDeleteAccountNormalView() - view.text = "DeleteAccount_tips_2".localized + view.text = "veloria_delete_account_two".localized return view }() private lazy var contentView2: VPDeleteAccountNormalView = { let view = VPDeleteAccountNormalView() - view.text = "DeleteAccount_tips_3".localized + view.text = "veloria_delete_account_six".localized return view }() @@ -73,7 +73,7 @@ class VPDeleteAccountViewController: VPViewController { label.font = .fontMedium(ofSize: 14) label.textColor = .colorFFFFFF() label.numberOfLines = 0 - label.text = "DeleteAccount_tips_4".localized + label.text = "veloria_delete_account_seven".localized return label }() diff --git a/Veloria/Class/Me/View/VPDeleteAccountDetailView.swift b/Veloria/Class/Me/View/VPDeleteAccountDetailView.swift index 9a397f1..2d95180 100644 --- a/Veloria/Class/Me/View/VPDeleteAccountDetailView.swift +++ b/Veloria/Class/Me/View/VPDeleteAccountDetailView.swift @@ -14,7 +14,7 @@ class VPDeleteAccountDetailView: VPDeleteAccountContentView { label.font = .fontRegular(ofSize: 14) label.textColor = .colorFFFFFF() label.numberOfLines = 0 - label.text = "DeleteAccount_tips_5".localized + label.text = "veloria_delete_account_three".localized return label }() @@ -28,28 +28,28 @@ class VPDeleteAccountDetailView: VPDeleteAccountContentView { private lazy var tipView1: VPDeleteAccountTipView = { let view = VPDeleteAccountTipView() - view.title = "DeleteAccount_tips_title_1".localized - view.text = "DeleteAccount_tips_text_1".localized + view.title = "veloria_delete_account_four".localized + view.text = "veloria_delete_account_five".localized return view }() private lazy var tipView2: VPDeleteAccountTipView = { let view = VPDeleteAccountTipView() - view.title = "DeleteAccount_tips_title_2".localized - view.text = "DeleteAccount_tips_text_2".localized + view.title = "veloria_delete_account_four_1".localized + view.text = "veloria_delete_account_five_1".localized return view }() private lazy var tipView3: VPDeleteAccountTipView = { let view = VPDeleteAccountTipView() - view.title = "DeleteAccount_tips_title_3".localized - view.text = "DeleteAccount_tips_text_3".localized + view.title = "veloria_delete_account_four_2".localized + view.text = "veloria_delete_account_five_2".localized return view }() private lazy var tipView4: VPDeleteAccountTipView = { let view = VPDeleteAccountTipView() - view.title = "DeleteAccount_tips_title_4".localized + view.title = "veloria_delete_account_four_3".localized // view.text = "DeleteAccount_tips_text_1".localized return view }() diff --git a/Veloria/Class/Me/View/VPVipAlertView.swift b/Veloria/Class/Me/View/VPVipAlertView.swift index a599271..ca226f7 100644 --- a/Veloria/Class/Me/View/VPVipAlertView.swift +++ b/Veloria/Class/Me/View/VPVipAlertView.swift @@ -182,9 +182,9 @@ extension VPVipAlertView { } @objc private func hadnleUnlockButton() { - guard let model = model else { return } +// guard let model = model else { return } self.dismiss() - let vc = VPVipPageViewController() + let vc = VPStoreViewController() VPAppTool.topViewController?.navigationController?.pushViewController(vc, animated: true) // VPIAPManager.manager.start(model: model) { [weak self] finish in diff --git a/Veloria/Class/MyList/Controller/VPMyListViewController.swift b/Veloria/Class/MyList/Controller/VPMyListViewController.swift index 7757dea..eea9214 100644 --- a/Veloria/Class/MyList/Controller/VPMyListViewController.swift +++ b/Veloria/Class/MyList/Controller/VPMyListViewController.swift @@ -193,7 +193,7 @@ extension VPMyListViewController { private func vp_setupUI() { guard VPNetworkReachabilityManager.manager.isReachable == true, pageView.superview == nil else { - if emptyView.superview == nil { + if emptyView.superview == nil, pageView.superview == nil { view.addSubview(emptyView) emptyView.snp.makeConstraints { make in make.left.equalToSuperview() @@ -203,6 +203,7 @@ extension VPMyListViewController { } return } + emptyView.removeFromSuperview() view.addSubview(pageView) view.addSubview(editorButton) diff --git a/Veloria/Class/Rewards/Controller/VPRewardsViewController.swift b/Veloria/Class/Rewards/Controller/VPRewardsViewController.swift index 463120f..bcb9547 100644 --- a/Veloria/Class/Rewards/Controller/VPRewardsViewController.swift +++ b/Veloria/Class/Rewards/Controller/VPRewardsViewController.swift @@ -13,7 +13,9 @@ class VPRewardsViewController: VPCampaignWebViewController { private lazy var emptyView: VPEmptyView = { let view = VPEmptyView.createNoNetworkEmptyView { [weak self] in guard let self = self else { return } - self.webView.reload() + if let url = self.urlStr { + self.load(urlString: url) + } } return view }() @@ -27,8 +29,10 @@ class VPRewardsViewController: VPCampaignWebViewController { } override func viewDidAppear(_ animated: Bool) { + if hasViewDidAppear { + self.reload() + } super.viewDidAppear(animated) - self.webView.reload() } override func webView(_ webView: VPWebView, shouldStartLoadWith navigationAction: WKNavigationAction) -> Bool { diff --git a/Veloria/Class/Wallet/Controller/VPStoreViewController.swift b/Veloria/Class/Wallet/Controller/VPStoreViewController.swift index 9ca9416..64f2b99 100644 --- a/Veloria/Class/Wallet/Controller/VPStoreViewController.swift +++ b/Veloria/Class/Wallet/Controller/VPStoreViewController.swift @@ -56,7 +56,7 @@ class VPStoreViewController: VPViewController { super.viewDidLoad() self.title = "veloria_store".localized - let rightBar = UIBarButtonItem(title: "Restore".localized, style: .plain, target: self, action: #selector(handleRestore)) + let rightBar = UIBarButtonItem(title: "veloria_restore".localized, style: .plain, target: self, action: #selector(handleRestore)) self.navigationItem.rightBarButtonItem = rightBar diff --git a/Veloria/Class/Wallet/View/VPVipBuyCell.swift b/Veloria/Class/Wallet/View/VPVipBuyCell.swift index 69273a2..c5dae7d 100644 --- a/Veloria/Class/Wallet/View/VPVipBuyCell.swift +++ b/Veloria/Class/Wallet/View/VPVipBuyCell.swift @@ -17,7 +17,7 @@ class VPVipBuyCell: ZKCycleScrollViewCell { bgIconImageView.image = UIImage(named: "vip_buy_bg_icon_\(key)") } // vipNameLabel.text = item?.vip_type_key?.getText() - vipNameLabel.text = item?.title + vipNameLabel.text = item?.brief unitLabel.text = item?.currency moneyLabel.text = item?.price durationLabel.text = "/\(item?.vip_type_key?.getText() ?? "")" diff --git a/Veloria/Libs/Empty/UIScrollView+Empty.swift b/Veloria/Libs/Empty/UIScrollView+Empty.swift index e33249b..e781bee 100644 --- a/Veloria/Libs/Empty/UIScrollView+Empty.swift +++ b/Veloria/Libs/Empty/UIScrollView+Empty.swift @@ -22,6 +22,7 @@ extension UIScrollView { self.emptyDataSetView { view in view.customView(emptyView) .verticalOffset(-130) + .isScrollAllowed(true) } } @@ -32,6 +33,7 @@ extension UIScrollView { self.emptyDataSetView { view in view.customView(emptyView) .verticalOffset(-130) + .isScrollAllowed(true) } } diff --git a/Veloria/Source/en.lproj/Localizable.strings b/Veloria/Source/en.lproj/Localizable.strings index 32fb945..7d96a03 100644 --- a/Veloria/Source/en.lproj/Localizable.strings +++ b/Veloria/Source/en.lproj/Localizable.strings @@ -153,15 +153,15 @@ "veloria_ready_to_leave" = "Ready to Leave?"; "veloria_ready_to_leave_text" = "when you sign out, your watch history will not be synced to your account."; -"DeleteAccount_tips_1" = "Your account will be permanently deleted"; -"DeleteAccount_tips_2" = "You will not be able to log in with this user ID"; -"DeleteAccount_tips_3" = "Please log out of the account on other devices in time, otherwise the App on other devices will be unavailable."; -"DeleteAccount_tips_4" = "I accept the deletion risk and agree to delete my account"; -"DeleteAccount_tips_5" = "All the following information will be deleted"; -"DeleteAccount_tips_title_1" = "Account Data"; -"DeleteAccount_tips_text_1" = "All your personal data will be deleted including username、Email address."; -"DeleteAccount_tips_title_2" = "Balance&VIP"; -"DeleteAccount_tips_text_2" = "All your coins have been consumed and you can delete your account."; -"DeleteAccount_tips_title_3" = "History"; -"DeleteAccount_tips_text_3" = "Consumption History, Recharge History, Chapter Unlock History, My Favorite."; -"DeleteAccount_tips_title_4" = "Third Party Account Information"; +"veloria_delete_title" = "Your account will be permanently deleted"; +"veloria_delete_account_two" = "You will not be able to log in with this user ID"; +"veloria_delete_account_six" = "Please log out of the account on other devices in time, otherwise the App on other devices will be unavailable."; +"veloria_delete_account_seven" = "I accept the deletion risk and agree to delete my account"; +"veloria_delete_account_three" = "All the following information will be deleted"; +"veloria_delete_account_four" = "Account Data"; +"veloria_delete_account_five" = "All your personal data will be deleted including username、Email address."; +"veloria_delete_account_four_1" = "Balance&VIP"; +"veloria_delete_account_five_1" = "All your coins have been consumed and you can delete your account."; +"veloria_delete_account_four_2" = "History"; +"veloria_delete_account_five_2" = "Consumption History, Recharge History, Chapter Unlock History, My Favorite."; +"veloria_delete_account_four_3" = "Third Party Account Information";