1.0.1提升

This commit is contained in:
zeng 2025-08-04 19:30:23 +08:00
parent a2dfc4aac5
commit 76ac6576d1
25 changed files with 283 additions and 46 deletions

View File

@ -2646,7 +2646,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = beereel/beereel.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 8NNUR9HPV3;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
@ -2667,7 +2667,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.0.1;
PRODUCT_BUNDLE_IDENTIFIER = com.breeltv.beereel;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@ -2752,7 +2752,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = beereel/beereel.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 8NNUR9HPV3;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
@ -2773,7 +2773,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.0.1;
PRODUCT_BUNDLE_IDENTIFIER = com.breeltv.beereel;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";

View File

@ -6,6 +6,7 @@
//
import UIKit
import LYEmptyView
class BRViewController: UIViewController {
@ -14,6 +15,14 @@ class BRViewController: UIViewController {
private(set) var isDidAppear = false
private(set) var hasViewDidAppear = false
lazy var notNetworkEmptyView: LYEmptyView = {
let view = BREmpty.br_noNetworkEmptyView { [weak self] in
self?.handleNoNetworkEmptyButton()
}
view.autoShowEmptyView = false
return view
}()
var statusBarStyle: UIStatusBarStyle = .darkContent {
didSet {
self.setNeedsStatusBarAppearanceUpdate()
@ -64,6 +73,9 @@ class BRViewController: UIViewController {
func handleFooterRefresh(_ completer: (() -> Void)?) {
completer?()
}
func handleNoNetworkEmptyButton() {
}
}

View File

@ -18,6 +18,12 @@ class BRTabBar: UITabBar {
return size
}
private lazy var bgView: UIView = {
let view = UIView()
view.backgroundColor = .color1C1C1C()
return view
}()
private lazy var topImageView: UIImageView = {
let imageView = UIImageView(image: UIImage(named: "tabbar_top_icon"))
return imageView
@ -31,11 +37,16 @@ class BRTabBar: UITabBar {
override init(frame: CGRect) {
super.init(frame: frame)
self.backgroundColor = .color1C1C1C()
self.br_setRoundedCorner(topLeft: 30, topRight: 30, bottomLeft: 0, bottomRight: 0)
addSubview(bgView)
addSubview(topImageView)
bgView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
topImageView.snp.makeConstraints { make in
make.top.equalToSuperview()
make.centerX.equalToSuperview()

View File

@ -63,16 +63,32 @@ class BRExploreViewController: BRPlayerListViewController {
return button
}()
deinit {
NotificationCenter.default.removeObserver(self)
}
override func viewDidLoad() {
super.viewDidLoad()
NotificationCenter.default.addObserver(self, selector: #selector(networkStatusDidChangeNotification), name: BRNetworkStatusManager.networkStatusDidChangeNotification, object: nil)
self.view.backgroundColor = .color1C1C1C()
self.edgesForExtendedLayout = .all
self.collectionView.br_onRefrsh = true
// self.collectionView.br_onRefrsh = true
self.collectionView.br_refreshDelegate = self
self.collectionView.br_addRefreshHeader { [weak self] in
self?.handleHeaderRefresh(nil)
}
self.collectionView.layer.cornerRadius = 20
self.collectionView.layer.masksToBounds = true
self.delegate = self
self.dataSource = self
self.requestDataArr(page: 1)
br_setupUI()
}
@ -99,14 +115,45 @@ class BRExploreViewController: BRPlayerListViewController {
self.collectionView.insertItems(at: indexPaths)
CATransaction.commit()
}
override func handleHeaderRefresh(_ completer: (() -> Void)?) {
requestDataArr(page: 1) { [weak self] in
self?.collectionView.br_endHeaderRefreshing()
}
}
@objc private func networkStatusDidChangeNotification() {
guard BRNetworkStatusManager.manager.isReachable == true else { return }
br_setupUI()
if self.dataArr.isEmpty {
self.requestDataArr(page: 1)
}
}
override func handleNoNetworkEmptyButton() {
self.requestDataArr(page: 1)
}
}
extension BRExploreViewController {
private func br_setupUI() {
self.view.backgroundColor = .color1C1C1C()
self.collectionView.layer.cornerRadius = 20
self.collectionView.layer.masksToBounds = true
guard self.titleImageView.superview == nil else { return }
if BRNetworkStatusManager.manager.isReachable != true {
self.collectionView.isHidden = true
notNetworkEmptyView.titleLabTextColor = .colorFFFFFF()
notNetworkEmptyView.detailLabTextColor = .colorFFFFFF(alpha: 0.8)
notNetworkEmptyView.actionBtnTitleColor = .colorFFFFFF()
notNetworkEmptyView.actionBtnBorderColor = .colorFFFFFF()
self.view.ly_emptyView = self.notNetworkEmptyView
self.view.ly_showEmpty()
return
}
self.collectionView.isHidden = false
self.view.ly_hideEmpty()
view.addSubview(titleImageView)
view.addSubview(searchButton)
@ -209,9 +256,9 @@ extension BRExploreViewController: BRPlayerListViewControllerDelegate, BRPlayerL
//MARK: BRPlayerCollectionViewDelegate
extension BRExploreViewController: BRPlayerCollectionViewDelegate {
func br_loadNewData(collectionView: BRPlayerCollectionView) {
requestDataArr(page: 1) {
collectionView.endRefresh()
}
// requestDataArr(page: 1) {
// collectionView.endRefresh()
// }
}
func br_upwardsScrollEnd(collectionView: BRPlayerCollectionView) {

View File

@ -10,6 +10,8 @@ import WMZPageController
class BRFavoritesPageViewController: BRViewController {
private var isSetupUI = false
private lazy var vcArr: [BRViewController] = {
let arr = [
BRFavoritesViewController(),
@ -54,10 +56,16 @@ class BRFavoritesPageViewController: BRViewController {
view.downSc?.backgroundColor = .clear
return view
}()
deinit {
NotificationCenter.default.removeObserver(self)
}
override func viewDidLoad() {
super.viewDidLoad()
self.edgesForExtendedLayout = [.top, .bottom]
self.navigationController?.isNavigationBarHidden = true
NotificationCenter.default.addObserver(self, selector: #selector(networkStatusDidChangeNotification), name: BRNetworkStatusManager.networkStatusDidChangeNotification, object: nil)
br_setupUI()
}
@ -67,15 +75,32 @@ class BRFavoritesPageViewController: BRViewController {
super.viewWillAppear(animated)
self.navigationController?.setNavigationBarHidden(true, animated: true)
}
override func handleNoNetworkEmptyButton() {
br_setupUI()
}
@objc private func networkStatusDidChangeNotification() {
guard BRNetworkStatusManager.manager.isReachable == true else { return }
br_setupUI()
}
}
extension BRFavoritesPageViewController {
private func br_setupUI() {
guard !isSetupUI else { return }
if BRNetworkStatusManager.manager.isReachable != true {
self.view.ly_emptyView = self.notNetworkEmptyView
self.view.ly_showEmpty()
return
}
self.view.ly_hideEmpty()
view.addSubview(pageView)
self.isSetupUI = true
}
}

View File

@ -144,6 +144,10 @@ class BRHomeViewController: BRViewController {
return button
}()
deinit {
NotificationCenter.default.removeObserver(self)
}
override func viewDidLoad() {
super.viewDidLoad()
self.edgesForExtendedLayout = [.top, .bottom]
@ -153,10 +157,8 @@ class BRHomeViewController: BRViewController {
br_setupUI()
requestHomeData()
requestPlayHistorys()
setupPageView()
requestAllData()
updateStatusBarStyle()
}
@ -202,14 +204,26 @@ class BRHomeViewController: BRViewController {
self.requestGroup.notify(queue: .main) { [weak self] in
self?.pageView.downSc?.br_endHeaderRefreshing()
}
}
override func handleNoNetworkEmptyButton() {
self.requestAllData()
}
}
extension BRHomeViewController {
private func br_setupUI() {
guard self.pageView.superview == nil else { return }
if BRNetworkStatusManager.manager.isReachable != true {
self.view.ly_emptyView = self.notNetworkEmptyView
self.view.ly_showEmpty()
return
}
self.view.ly_hideEmpty()
view.addSubview(bgImageView)
view.addSubview(pageView)
menuLeftView.addSubview(searchButton)
@ -225,6 +239,8 @@ extension BRHomeViewController {
make.left.equalToSuperview().offset(15)
make.centerY.equalToSuperview()
}
setupPageView()
}
///
@ -262,6 +278,7 @@ extension BRHomeViewController {
guard BRNetworkStatusManager.manager.isReachable == true else {
return
}
self.br_setupUI()
if self.viewModel.homeOldDataArr.isEmpty {
self.handleHeaderRefresh(nil)
@ -278,6 +295,12 @@ extension BRHomeViewController {
extension BRHomeViewController {
private func requestAllData() {
self.requestHomeData()
self.requestPlayHistorys()
}
private func requestHomeData(completer: (() -> Void)? = nil) {
BRHomeAPI.requestHomeData { [weak self] list in

View File

@ -61,6 +61,7 @@ class BRMineViewController: BRViewController {
super.viewDidLoad()
self.edgesForExtendedLayout = [.top, .bottom]
NotificationCenter.default.addObserver(self, selector: #selector(userInfoUpdateNotification), name: BRLoginManager.userInfoUpdateNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(networkStatusDidChangeNotification), name: BRNetworkStatusManager.networkStatusDidChangeNotification, object: nil)
br_setupUI()
}
@ -75,12 +76,26 @@ class BRMineViewController: BRViewController {
BRLoginManager.manager.updateUserInfo(completer: nil)
self.showVipAlert()
}
override func handleNoNetworkEmptyButton() {
br_setupUI()
BRLoginManager.manager.updateUserInfo(completer: nil)
}
}
extension BRMineViewController {
private func br_setupUI() {
guard self.tableView.superview == nil else { return }
if BRNetworkStatusManager.manager.isReachable != true {
self.view.ly_emptyView = self.notNetworkEmptyView
self.view.ly_showEmpty()
return
}
self.view.ly_hideEmpty()
view.addSubview(lightImageView)
view.addSubview(tableView)
@ -104,6 +119,12 @@ extension BRMineViewController {
self.tableView.reloadData()
}
@objc private func networkStatusDidChangeNotification() {
guard BRNetworkStatusManager.manager.isReachable == true else { return }
br_setupUI()
BRLoginManager.manager.updateUserInfo(completer: nil)
}
private func showVipAlert() {
guard BRLoginManager.manager.userInfo?.is_vip != true else { return }
guard BRVipAlert.isAllowShowAlert else { return }

View File

@ -75,7 +75,7 @@ class BRPlayerListViewController: BRViewController {
collectionView.isPagingEnabled = true
collectionView.showsVerticalScrollIndicator = false
collectionView.showsHorizontalScrollIndicator = false
collectionView.bounces = false
// collectionView.bounces = false
collectionView.scrollsToTop = false
collectionView.register(CellClass.self, forCellWithReuseIdentifier: "cell")
return collectionView

View File

@ -60,15 +60,23 @@ class BRVideoDetailViewController: BRPlayerListViewController {
}
override var previousVideoUrl: String? {
let index = self.viewModel.currentIndexPath.row - 1
guard index > 0 else { return nil }
guard self.viewModel.currentIndexPath.section < self.detailArr.count else { return nil }
let model = self.detailArr[self.viewModel.currentIndexPath.section]
let index = self.viewModel.currentIndexPath.row - 1
guard index >= 0 else { return nil }
let epCount = model.episodeList?.count ?? 0
guard index < epCount else { return nil }
return model.episodeList?[index].video_url
}
override var nextVideoUrl: String? {
let index = self.viewModel.currentIndexPath.row + 1
guard self.viewModel.currentIndexPath.section < self.detailArr.count else { return nil }
let model = self.detailArr[self.viewModel.currentIndexPath.section]
let index = self.viewModel.currentIndexPath.row + 1
guard index < (model.episodeList?.count ?? 0) else { return nil }
return model.episodeList?[index].video_url
}

View File

@ -134,14 +134,14 @@ extension BRPlayerCollectionView: UIGestureRecognizerDelegate {
override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
if gestureRecognizer == self.refreshPanGesture {
if !br_onRefrsh { return false }
// if !br_onRefrsh { return false }
let point = self.refreshPanGesture.translation(in: self)
let state = gestureRecognizer.state
if state == .began || state == .possible {
///
if point.y > 0 && self.contentOffset.y == 0 {
if point.y > 0 && self.contentOffset.y == 0, br_onRefrsh {
return true
} else if point.y < 0 && self.contentOffset.y + self.frame.height >= self.contentSize.height {//
self.br_refreshDelegate?.br_upwardsScrollEnd?(collectionView: self)

View File

@ -25,7 +25,7 @@ class BRVideoDetailRecommendView: BRPanModalContentView {
}
}
private var currentCell: BRVideoDetailRecommendCell? {
private weak var currentCell: BRVideoDetailRecommendCell? {
didSet {
oldValue?.isCurrent = false
oldValue?.pause()

View File

@ -56,6 +56,8 @@ class BRPlayerViewModel: NSObject {
}
private lazy var payDataRequest = BRPayDataRequest()
private weak var rechargeView: BRVideoRechargeView?
}
@ -156,6 +158,7 @@ extension BRPlayerViewModel {
///
func openRechargeView() {
guard let videoInfo = self.currentPlayer?.videoInfo else { return }
guard self.rechargeView == nil else { return }
self.payDataRequest.requestProducts(isLoding: true) { [weak self] model in
guard let self = self else { return }
@ -174,6 +177,7 @@ extension BRPlayerViewModel {
self.updateAllData(scrollTo: self.currentIndexPath)
}
view.present(in: nil)
self.rechargeView = view
}
}

View File

@ -84,6 +84,13 @@ extension BRConsumptionRecordViewController: UICollectionViewDelegate, UICollect
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return self.listArr.count
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
let model = self.listArr[indexPath.row]
let vc = BRVideoDetailViewController()
vc.shortPlayId = model.short_play_id
self.navigationController?.pushViewController(vc, animated: true)
}
}
extension BRConsumptionRecordViewController {

View File

@ -17,5 +17,6 @@ class BRRewardCoinRecordModel: BRModel, SmartCodable {
var created_at: String?
var diff_datetime: String?
var expired_time: TimeInterval?
var is_effective: Int?
}

View File

@ -15,14 +15,14 @@ class BRRewardCoinsRecordCell: BRCollectionViewCell {
timeLabel.text = model?.created_at
coinView.setNeedsUpdateConfiguration()
let expireDate = Date(timeIntervalSince1970: model?.expired_time ?? 0)
let nowDate = Date()
let days = nowDate.differenceDay(date: expireDate)
if days > 0 {
contentLabel.text = "Expires in ## days".localizedReplace(text: "\(days)")
// let expireDate = Date(timeIntervalSince1970: model?.expired_time ?? 0)
// let nowDate = Date()
// let days = nowDate.differenceDay(date: expireDate)
//
if model?.is_effective == 1 {
contentLabel.text = "Expires in ##".localizedReplace(text: model?.diff_datetime ?? "")
} else {
contentLabel.text = "Expired".localized
contentLabel.text = model?.diff_datetime
}
}
}

View File

@ -15,7 +15,7 @@ extension AppDelegate {
//
MJRefreshConfig.default.languageCode = BRLocalizedManager.manager.mjLocalizedKey
BRToast.config()
}
}

View File

@ -8,13 +8,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
BRNetworkStatusManager.manager.startMonitoring()
registThirdparty(application, didFinishLaunchingWithOptions: launchOptions)
BRAppTool.appDelegate = self
BRNetworkStatusManager.manager.startMonitoring()
NotificationCenter.default.addObserver(self, selector: #selector(networkStatusDidChangeNotification), name: BRNetworkStatusManager.networkStatusDidChangeNotification, object: nil)
BRLoginManager.manager.updateUserInfo(completer: nil)
addConfig()
@ -22,9 +21,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
setBadgeCount(0)
BRIAP.manager.restore(isLoding: false) { isFinish in
guard isFinish else { return }
BRLoginManager.manager.updateUserInfo(completer: nil)
DispatchQueue.main.asyncAfter(wallDeadline: .now() + 0.2) {
if BRNetworkStatusManager.manager.isReachable == true {
BRLoginManager.manager.updateUserInfo(completer: nil)
BRIAP.manager.restore(isLoding: false) { isFinish in
guard isFinish else { return }
BRLoginManager.manager.updateUserInfo(completer: nil)
}
}
}
return true

View File

@ -10,8 +10,11 @@ import LYEmptyView
class BREmpty: NSObject {
static func br_normalEmptyView(image: UIImage? = UIImage(named: "empty_normal_image"), title: String? = "kNormalRmptyTitle".localized, detailStr: String? = "kNormalRmptyDetail".localized) -> LYEmptyView {
let view = LYEmptyView.empty(with: image, titleStr: title, detailStr: detailStr)
static func br_normalEmptyView(image: UIImage? = UIImage(named: "empty_normal_image"), title: String? = "kNormalRmptyTitle".localized, detailStr: String? = "kNormalRmptyDetail".localized, btnTitleStr: String? = nil, btnClickBlock: (() -> Void)? = nil) -> LYEmptyView {
let view = LYEmptyView.emptyActionView(with: image, titleStr: title, detailStr: detailStr, btnTitleStr: btnTitleStr) {
btnClickBlock?()
}
view?.titleLabFont = .fontMedium(ofSize: 15)
view?.titleLabTextColor = .color1C1C1C()
view?.detailLabFont = .fontRegular(ofSize: 12)
@ -21,4 +24,18 @@ class BREmpty: NSObject {
return view!
}
static func br_noNetworkEmptyView(btnClickBlock: (() -> Void)?) -> LYEmptyView {
let view = br_normalEmptyView(image: UIImage(named: "empty_network_image"), title: "kNetworkEmptyTitle".localized, detailStr: "kNetworkEmptyDetail".localized, btnTitleStr: "Try again".localized, btnClickBlock: btnClickBlock)
view.actionBtnFont = .fontRegular(ofSize: 14)
view.actionBtnTitleColor = .color1C1C1C()
view.actionBtnHeight = 42
view.actionBtnWidth = 128
view.actionBtnBorderWidth = 1
view.actionBtnBorderColor = .color1C1C1C()
view.actionBtnCornerRadius = 21
view.actionBtnBackGroundColor = .clear
view.actionBtnMargin = 16
return view
}
}

View File

@ -171,6 +171,7 @@ extension BRIAP: JXIAPManagerDelegate {
NotificationCenter.default.post(name: BRIAP.buyVipFinishNotification, object: nil)
}
} else {
BRToast.show(text: "Purchase Failed".localized)
self.completionHandler?(false)
}
}

View File

@ -92,9 +92,9 @@ class BRPlayer: NSObject {
init(controlView: BRPlayerControlProtocol?) {
super.init()
self.br_controlView = controlView
player.controlLayerNeedAppear()
setupPlayer()
player.controlLayerNeedAppear()
}
func setPlayUrl(url: String) {
@ -157,7 +157,7 @@ extension BRPlayer {
//
player.controlLayerAppearObserver.onAppearChanged = { [weak self] manager in
guard let self = self else { return }
self.controlView().isHidden = !manager.isAppeared
self.controlView()?.isHidden = !self.player.isControlLayerAppeared
}
//
@ -213,7 +213,7 @@ extension BRPlayer {
//MARK: -------------- SJVideoPlayerControlLayerDataSource --------------
extension BRPlayer: SJVideoPlayerControlLayerDataSource {
func controlView() -> UIView! {
func controlView() -> UIView? {
return self.br_controlView as? UIView
}
}

View File

@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "无网络@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "无网络@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

View File

@ -326,13 +326,13 @@
}
}
},
"Expires in ## days" : {
"Expires in ##" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Expires in ## days"
"value" : "Expires in ##"
}
}
}
@ -480,6 +480,28 @@
}
}
},
"kNetworkEmptyDetail" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Check your WiFi or cellular data"
}
}
}
},
"kNetworkEmptyTitle" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Network Hiccup"
}
}
}
},
"kNormalRmptyDetail" : {
"extractionState" : "manual",
"localizations" : {
@ -766,6 +788,17 @@
}
}
},
"Purchase Failed" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Purchase Failed"
}
}
}
},
"Purchase Single Episode" : {
"extractionState" : "manual",
"localizations" : {

View File

@ -7,6 +7,7 @@ post_install do |installer|
config.build_settings['ENABLE_BITCODE'] = 'NO'
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
config.build_settings['EXCLUDED_ARCHITECTURES'] = 'i386'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
end
end