修复bug

This commit is contained in:
澜声世纪 2025-12-25 09:25:19 +08:00
parent 6ecceff7a9
commit 5fdccdad66
17 changed files with 118 additions and 67 deletions

View File

@ -3037,7 +3037,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.0; MARKETING_VERSION = 1.0.2;
PRODUCT_BUNDLE_IDENTIFIER = com.lssj.ReaderHive; PRODUCT_BUNDLE_IDENTIFIER = com.lssj.ReaderHive;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -3082,7 +3082,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.0; MARKETING_VERSION = 1.0.2;
PRODUCT_BUNDLE_IDENTIFIER = com.lssj.ReaderHive; PRODUCT_BUNDLE_IDENTIFIER = com.lssj.ReaderHive;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";

View File

@ -56,8 +56,7 @@
debugDocumentVersioning = "YES" debugDocumentVersioning = "YES"
debugServiceExtension = "internal" debugServiceExtension = "internal"
allowLocationSimulation = "YES" allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "2" launchAutomaticallySubstyle = "2">
notificationPayloadFile = "Example/watchOSSample/SampleWatchAppWatchKitExtension/PushNotificationPayload.apns">
<BuildableProductRunnable <BuildableProductRunnable
runnableDebuggingMode = "0"> runnableDebuggingMode = "0">
<BuildableReference <BuildableReference

View File

@ -14,15 +14,6 @@ class NRNovelGenresCell: UICollectionViewCell {
didSet { didSet {
coverImageView.nr_setImage(model?.image_url) coverImageView.nr_setImage(model?.image_url)
titleLabel.text = model?.name titleLabel.text = model?.name
if let text = model?.categoryList?.first?.name, text.count > 0 {
self.categoryView.isHidden = false
self.categoryView.text = text
} else if let text = model?.category?.first, text.count > 0 {
self.categoryView.isHidden = false
self.categoryView.text = text
} else {
self.categoryView.isHidden = true
}
if model?.tag_type == .new { if model?.tag_type == .new {
markImageView.isHidden = false markImageView.isHidden = false
@ -33,6 +24,14 @@ class NRNovelGenresCell: UICollectionViewCell {
} else { } else {
markImageView.isHidden = true markImageView.isHidden = true
} }
updateCategory()
}
}
var category: String? {
didSet {
updateCategory()
} }
} }
@ -74,6 +73,21 @@ class NRNovelGenresCell: UICollectionViewCell {
fatalError("init(coder:) has not been implemented") fatalError("init(coder:) has not been implemented")
} }
private func updateCategory() {
if let text = self.category {
self.categoryView.isHidden = false
self.categoryView.text = text
} else if let text = model?.categoryList?.first?.name, text.count > 0 {
self.categoryView.isHidden = false
self.categoryView.text = text
} else if let text = model?.category?.first, text.count > 0 {
self.categoryView.isHidden = false
self.categoryView.text = text
} else {
self.categoryView.isHidden = true
}
}
} }
extension NRNovelGenresCell { extension NRNovelGenresCell {

View File

@ -110,6 +110,7 @@ extension NRNovelGenresViewController: UICollectionViewDelegate, UICollectionVie
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as! NRNovelGenresCell let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as! NRNovelGenresCell
cell.model = self.dataArr[indexPath.row] cell.model = self.dataArr[indexPath.row]
cell.category = self.model?.name
return cell return cell
} }

View File

@ -12,7 +12,6 @@ import HWPanModal
class NRMeHeaderView: UITableViewHeaderFooterView { class NRMeHeaderView: UITableViewHeaderFooterView {
// var contentHeight: CGFloat = 200
var userInfo: NRUserInfo? { var userInfo: NRUserInfo? {
didSet { didSet {
@ -68,19 +67,29 @@ class NRMeHeaderView: UITableViewHeaderFooterView {
let button = UIButton(type: .custom, primaryAction: UIAction(handler: { [weak self] _ in let button = UIButton(type: .custom, primaryAction: UIAction(handler: { [weak self] _ in
guard let self = self else { return } guard let self = self else { return }
UIPasteboard.general.string = NRLoginManager.manager.userInfo?.customer_id UIPasteboard.general.string = NRLoginManager.manager.userInfo?.customer_id
NRToast.show(text: "Success") NRToast.show(text: "Success".localized)
})) }))
button.setImage(UIImage(named: "copy_icon_01"), for: .normal) button.setImage(UIImage(named: "copy_icon_01"), for: .normal)
return button return button
}() }()
private lazy var loginButton: UIButton = { private lazy var loginButton: UIButton = {
let button = UIButton(type: .custom, primaryAction: UIAction(handler: { [weak self] _ in var configuration = UIButton.Configuration.plain()
configuration.attributedTitle = AttributedString("Log in".localized, attributes: AttributeContainer([
.font : UIFont.font(ofSize: 14, weight: .medium),
.foregroundColor : UIColor.F_9710_D
]))
configuration.contentInsets = .init(top: 0, leading: 20, bottom: 0, trailing: 20)
let button = UIButton(configuration: configuration, primaryAction: UIAction(handler: { [weak self] _ in
guard let self = self else { return } guard let self = self else { return }
let view = NRLoginView() let view = NRLoginView()
view.present(in: nil) view.present(in: nil)
})) }))
button.setImage(UIImage(named: "login_button"), for: .normal) button.layer.cornerRadius = 18
button.layer.masksToBounds = true
button.layer.borderWidth = 1
button.layer.borderColor = UIColor.F_9710_D.cgColor
return button return button
}() }()
@ -168,6 +177,7 @@ extension NRMeHeaderView {
loginButton.snp.makeConstraints { make in loginButton.snp.makeConstraints { make in
make.centerY.equalTo(avatarImageView) make.centerY.equalTo(avatarImageView)
make.right.equalToSuperview().offset(-16) make.right.equalToSuperview().offset(-16)
make.height.equalTo(36)
} }
stackView.snp.makeConstraints { make in stackView.snp.makeConstraints { make in

View File

@ -63,7 +63,7 @@ class NRNovelHistoryCell: UICollectionViewCell {
let isCollect = !(self.model?.is_collect ?? false) let isCollect = !(self.model?.is_collect ?? false)
Task { Task {
await NRNovelAPI.requestCollect(isCollect: isCollect, id: self.model?.id ?? "") await NRNovelAPI.requestCollect(isCollect: isCollect, id: self.model?.id ?? "", chapterId: self.model?.short_play_video_id)
} }
}), for: .touchUpInside) }), for: .touchUpInside)

View File

@ -10,17 +10,7 @@ import SnapKit
class NRMeViewController: NRViewController { class NRMeViewController: NRViewController {
private lazy var dataArr: [NRMeItem] = { private lazy var dataArr: [NRMeItem] = []
let arr = [
NRMeItem(type: .history, icon: UIImage(named: "history_icon_01"), title: "History".localized),
NRMeItem(type: .wallet, icon: UIImage(named: "wallet_icon_01"), title: "My Wallet".localized),
// NRMeItem(type: .language, icon: UIImage(named: "language_icon_01"), title: "Language".localized),
NRMeItem(type: .feedback, icon: UIImage(named: "feedback_icon_01"), title: "Feedback".localized),
NRMeItem(type: .settings, icon: UIImage(named: "settings_icon_02"), title: "Settings".localized),
NRMeItem(type: .about, icon: UIImage(named: "about_icon_01"), title: "About".localized),
]
return arr
}()
private lazy var tableView: NRTableView = { private lazy var tableView: NRTableView = {
let tableView = NRTableView(frame: .zero, style: .insetGrouped) let tableView = NRTableView(frame: .zero, style: .insetGrouped)
@ -43,6 +33,7 @@ class NRMeViewController: NRViewController {
NotificationCenter.default.addObserver(self, selector: #selector(userInfoUpdateNotification), name: NRLoginManager.userInfoUpdateNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(userInfoUpdateNotification), name: NRLoginManager.userInfoUpdateNotification, object: nil)
nr_setupUI() nr_setupUI()
reloadDataArr()
} }
@ -60,7 +51,7 @@ class NRMeViewController: NRViewController {
} }
@objc private func userInfoUpdateNotification() { @objc private func userInfoUpdateNotification() {
self.tableView.reloadData() reloadDataArr()
} }
} }
@ -136,3 +127,22 @@ extension NRMeViewController: UITableViewDelegate, UITableViewDataSource {
} }
} }
} }
extension NRMeViewController {
private func reloadDataArr() {
var dataArr: [NRMeItem] = []
dataArr.append(NRMeItem(type: .history, icon: UIImage(named: "history_icon_01"), title: "History".localized))
dataArr.append(NRMeItem(type: .wallet, icon: UIImage(named: "wallet_icon_01"), title: "My Wallet".localized))
// dataArr.append(NRMeItem(type: .language, icon: UIImage(named: "language_icon_01"), title: "Language".localized))
dataArr.append(NRMeItem(type: .feedback, icon: UIImage(named: "feedback_icon_01"), title: "Feedback".localized))
if NRLoginManager.manager.userInfo?.is_tourist == false {
dataArr.append(NRMeItem(type: .settings, icon: UIImage(named: "settings_icon_02"), title: "Settings".localized))
}
dataArr.append(NRMeItem(type: .about, icon: UIImage(named: "about_icon_01"), title: "About".localized))
self.dataArr = dataArr
self.tableView.reloadData()
}
}

View File

@ -118,12 +118,12 @@ extension NRSettingViewController {
private func getDataArr() -> [NRMeItem] { private func getDataArr() -> [NRMeItem] {
if NRLoginManager.manager.userInfo?.is_tourist == true { if NRLoginManager.manager.userInfo?.is_tourist == true {
return [ return [
NRMeItem(type: .myUnlocks, title: "My Unlocks".localized), // NRMeItem(type: .myUnlocks, title: "My Unlocks".localized),
] ]
} else { } else {
return [ return [
NRMeItem(type: .accountDeletion, title: "Account Deletion".localized), NRMeItem(type: .accountDeletion, title: "Account Deletion".localized),
NRMeItem(type: .myUnlocks, title: "My Unlocks".localized), // NRMeItem(type: .myUnlocks, title: "My Unlocks".localized),
] ]
} }
} }

View File

@ -149,7 +149,7 @@ extension NRMyListNovelViewController {
await NRNovelAPI.requestCollect(isCollect: false, id: id, chapterId: model.short_play_video_id) await NRNovelAPI.requestCollect(isCollect: false, id: id, chapterId: model.short_play_video_id)
await self.requestDataArr(page: 1) // await self.requestDataArr(page: 1)
} }
} }

View File

@ -147,6 +147,7 @@ extension NRNovelDetailCatalogViewController: UITableViewDelegate, UITableViewDa
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! NRNovelCatalogCell let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! NRNovelCatalogCell
cell.model = model cell.model = model
cell.nr_isSelected = model.id == self.novelModel?.progress?.short_play_video_id
return cell return cell
} }
@ -183,7 +184,14 @@ extension NRNovelDetailCatalogViewController: UITableViewDelegate, UITableViewDa
let vc = NRNovelReaderViewController() let vc = NRNovelReaderViewController()
vc.novelId = novelId vc.novelId = novelId
vc.targetCatalogModel = model vc.targetCatalogModel = model
self.navigationController?.pushViewController(vc, animated: true)
var vcArr = self.navigationController?.viewControllers
vcArr?.removeLast()
vcArr?.append(vc)
self.navigationController?.setViewControllers(vcArr ?? [], animated: true)
// self.navigationController?.pushViewController(vc, animated: true)
} }
} }

View File

@ -23,6 +23,8 @@ class NRNovelDetailViewController: NRViewController {
private var navigationStyleScale: CGFloat = 0 private var navigationStyleScale: CGFloat = 0
private lazy var isViewDidAppear = false
lazy var coverBgImageView: NRImageView = { lazy var coverBgImageView: NRImageView = {
let imageView = NRImageView() let imageView = NRImageView()
imageView.nr_addEffectView(style: .dark) imageView.nr_addEffectView(style: .dark)
@ -79,16 +81,14 @@ class NRNovelDetailViewController: NRViewController {
nr_setupUI() nr_setupUI()
Task {
await self.viewModel.requestDetailData()
self.coverBgImageView.nr_setImage(self.viewModel.novelModel?.image_url)
self.headerView.model = self.viewModel.novelModel
await self.viewModel.requestRecommandData()
self.recommandVC.dataArr = self.viewModel.recommandDataArr ?? []
}
updateHeaderViewHeight() updateHeaderViewHeight()
Task {
await updateData()
}
} }
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
@ -97,6 +97,18 @@ class NRNovelDetailViewController: NRViewController {
updateNavigationStyle() updateNavigationStyle()
} }
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
if !isViewDidAppear {
isViewDidAppear = true
} else {
Task {
await updateData()
}
}
}
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
if self.recommandListView == object as? UIScrollView { if self.recommandListView == object as? UIScrollView {
if keyPath == "contentSize" { if keyPath == "contentSize" {
@ -249,3 +261,16 @@ extension NRNovelDetailViewController {
} }
} }
extension NRNovelDetailViewController {
private func updateData() async {
await self.viewModel.requestDetailData()
self.coverBgImageView.nr_setImage(self.viewModel.novelModel?.image_url)
self.headerView.model = self.viewModel.novelModel
await self.viewModel.requestRecommandData()
self.recommandVC.dataArr = self.viewModel.recommandDataArr ?? []
}
}

View File

@ -56,7 +56,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
} }
NRIapManager.manager.preloadingProducts() NRIapManager.manager.preloadingProducts()
NRTool.sceneDelegate?.retryHandleOpenAppMessage()
} }
} }

View File

@ -17,6 +17,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else { return } guard let windowScene = (scene as? UIWindowScene) else { return }
NotificationCenter.default.addObserver(self, selector: #selector(networkStatusDidChangeNotification), name: NRNetworkReachableManager.networkStatusDidChangeNotification, object: nil)
NRTool.sceneDelegate = self NRTool.sceneDelegate = self
NRTool.windowScene = windowScene NRTool.windowScene = windowScene
@ -101,7 +103,11 @@ extension SceneDelegate {
NRStatAPI.nr_requestStatOnLine() NRStatAPI.nr_requestStatOnLine()
} }
@objc private func networkStatusDidChangeNotification() {
guard NRNetworkReachableManager.manager.isReachable == true else { return }
handleOnLine()
self.retryHandleOpenAppMessage()
}
} }

View File

@ -1,22 +0,0 @@
{
"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.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -152,6 +152,7 @@
"Claim Now" = "Claim Now"; "Claim Now" = "Claim Now";
"Later" = "Later"; "Later" = "Later";
"Default" = "Default"; "Default" = "Default";
"Log in" = "Log in";
"retain_alert_text" = "Unlock every show you love!"; "retain_alert_text" = "Unlock every show you love!";
"logout_alert_text" = "Are you sure you want to log out?"; "logout_alert_text" = "Are you sure you want to log out?";