修复bug
This commit is contained in:
parent
6ecceff7a9
commit
5fdccdad66
@ -3037,7 +3037,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.0;
|
||||
MARKETING_VERSION = 1.0.2;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lssj.ReaderHive;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
@ -3082,7 +3082,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.0;
|
||||
MARKETING_VERSION = 1.0.2;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lssj.ReaderHive;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
|
||||
@ -56,8 +56,7 @@
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES"
|
||||
launchAutomaticallySubstyle = "2"
|
||||
notificationPayloadFile = "Example/watchOSSample/SampleWatchAppWatchKitExtension/PushNotificationPayload.apns">
|
||||
launchAutomaticallySubstyle = "2">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
|
||||
@ -14,15 +14,6 @@ class NRNovelGenresCell: UICollectionViewCell {
|
||||
didSet {
|
||||
coverImageView.nr_setImage(model?.image_url)
|
||||
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 {
|
||||
markImageView.isHidden = false
|
||||
@ -33,6 +24,14 @@ class NRNovelGenresCell: UICollectionViewCell {
|
||||
} else {
|
||||
markImageView.isHidden = true
|
||||
}
|
||||
|
||||
updateCategory()
|
||||
}
|
||||
}
|
||||
|
||||
var category: String? {
|
||||
didSet {
|
||||
updateCategory()
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,6 +73,21 @@ class NRNovelGenresCell: UICollectionViewCell {
|
||||
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 {
|
||||
|
||||
@ -110,6 +110,7 @@ extension NRNovelGenresViewController: UICollectionViewDelegate, UICollectionVie
|
||||
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as! NRNovelGenresCell
|
||||
cell.model = self.dataArr[indexPath.row]
|
||||
cell.category = self.model?.name
|
||||
return cell
|
||||
}
|
||||
|
||||
|
||||
@ -11,8 +11,7 @@ import YYCategories
|
||||
import HWPanModal
|
||||
|
||||
class NRMeHeaderView: UITableViewHeaderFooterView {
|
||||
|
||||
// var contentHeight: CGFloat = 200
|
||||
|
||||
|
||||
var userInfo: NRUserInfo? {
|
||||
didSet {
|
||||
@ -68,19 +67,29 @@ class NRMeHeaderView: UITableViewHeaderFooterView {
|
||||
let button = UIButton(type: .custom, primaryAction: UIAction(handler: { [weak self] _ in
|
||||
guard let self = self else { return }
|
||||
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)
|
||||
return button
|
||||
}()
|
||||
|
||||
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 }
|
||||
let view = NRLoginView()
|
||||
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
|
||||
}()
|
||||
|
||||
@ -168,6 +177,7 @@ extension NRMeHeaderView {
|
||||
loginButton.snp.makeConstraints { make in
|
||||
make.centerY.equalTo(avatarImageView)
|
||||
make.right.equalToSuperview().offset(-16)
|
||||
make.height.equalTo(36)
|
||||
}
|
||||
|
||||
stackView.snp.makeConstraints { make in
|
||||
|
||||
@ -63,7 +63,7 @@ class NRNovelHistoryCell: UICollectionViewCell {
|
||||
let isCollect = !(self.model?.is_collect ?? false)
|
||||
|
||||
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)
|
||||
|
||||
@ -10,17 +10,7 @@ import SnapKit
|
||||
|
||||
class NRMeViewController: NRViewController {
|
||||
|
||||
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 dataArr: [NRMeItem] = []
|
||||
|
||||
private lazy var tableView: NRTableView = {
|
||||
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)
|
||||
nr_setupUI()
|
||||
|
||||
reloadDataArr()
|
||||
}
|
||||
|
||||
|
||||
@ -60,7 +51,7 @@ class NRMeViewController: NRViewController {
|
||||
}
|
||||
|
||||
@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()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -118,12 +118,12 @@ extension NRSettingViewController {
|
||||
private func getDataArr() -> [NRMeItem] {
|
||||
if NRLoginManager.manager.userInfo?.is_tourist == true {
|
||||
return [
|
||||
NRMeItem(type: .myUnlocks, title: "My Unlocks".localized),
|
||||
// NRMeItem(type: .myUnlocks, title: "My Unlocks".localized),
|
||||
]
|
||||
} else {
|
||||
return [
|
||||
NRMeItem(type: .accountDeletion, title: "Account Deletion".localized),
|
||||
NRMeItem(type: .myUnlocks, title: "My Unlocks".localized),
|
||||
// NRMeItem(type: .myUnlocks, title: "My Unlocks".localized),
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,7 +149,7 @@ extension NRMyListNovelViewController {
|
||||
|
||||
await NRNovelAPI.requestCollect(isCollect: false, id: id, chapterId: model.short_play_video_id)
|
||||
|
||||
await self.requestDataArr(page: 1)
|
||||
// await self.requestDataArr(page: 1)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -147,6 +147,7 @@ extension NRNovelDetailCatalogViewController: UITableViewDelegate, UITableViewDa
|
||||
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! NRNovelCatalogCell
|
||||
cell.model = model
|
||||
cell.nr_isSelected = model.id == self.novelModel?.progress?.short_play_video_id
|
||||
return cell
|
||||
}
|
||||
|
||||
@ -183,7 +184,14 @@ extension NRNovelDetailCatalogViewController: UITableViewDelegate, UITableViewDa
|
||||
let vc = NRNovelReaderViewController()
|
||||
vc.novelId = novelId
|
||||
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)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -23,6 +23,8 @@ class NRNovelDetailViewController: NRViewController {
|
||||
|
||||
private var navigationStyleScale: CGFloat = 0
|
||||
|
||||
private lazy var isViewDidAppear = false
|
||||
|
||||
lazy var coverBgImageView: NRImageView = {
|
||||
let imageView = NRImageView()
|
||||
imageView.nr_addEffectView(style: .dark)
|
||||
@ -79,16 +81,14 @@ class NRNovelDetailViewController: NRViewController {
|
||||
|
||||
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()
|
||||
|
||||
Task {
|
||||
await updateData()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
@ -97,6 +97,18 @@ class NRNovelDetailViewController: NRViewController {
|
||||
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?) {
|
||||
if self.recommandListView == object as? UIScrollView {
|
||||
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 ?? []
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,7 +56,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
}
|
||||
NRIapManager.manager.preloadingProducts()
|
||||
|
||||
NRTool.sceneDelegate?.retryHandleOpenAppMessage()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -17,6 +17,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
|
||||
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
|
||||
guard let windowScene = (scene as? UIWindowScene) else { return }
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(networkStatusDidChangeNotification), name: NRNetworkReachableManager.networkStatusDidChangeNotification, object: nil)
|
||||
|
||||
NRTool.sceneDelegate = self
|
||||
NRTool.windowScene = windowScene
|
||||
|
||||
@ -101,7 +103,11 @@ extension SceneDelegate {
|
||||
NRStatAPI.nr_requestStatOnLine()
|
||||
}
|
||||
|
||||
|
||||
@objc private func networkStatusDidChangeNotification() {
|
||||
guard NRNetworkReachableManager.manager.isReachable == true else { return }
|
||||
handleOnLine()
|
||||
self.retryHandleOpenAppMessage()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -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 |
@ -152,6 +152,7 @@
|
||||
"Claim Now" = "Claim Now";
|
||||
"Later" = "Later";
|
||||
"Default" = "Default";
|
||||
"Log in" = "Log in";
|
||||
|
||||
"retain_alert_text" = "Unlock every show you love!";
|
||||
"logout_alert_text" = "Are you sure you want to log out?";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user