1.0.4提审
This commit is contained in:
parent
7b5276ead5
commit
b2c7d5e34e
@ -3041,7 +3041,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.3;
|
MARKETING_VERSION = 1.0.4;
|
||||||
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 = "";
|
||||||
@ -3086,7 +3086,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.3;
|
MARKETING_VERSION = 1.0.4;
|
||||||
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 = "";
|
||||||
|
|||||||
@ -50,18 +50,24 @@ struct NRNovelAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
///上报阅读记录
|
///上报阅读记录
|
||||||
static func requestUploadRecord(_ id: String, chapterId: String) {
|
static func requestUploadRecord(_ id: String, chapterId: String) async -> Bool {
|
||||||
// var param = NRNetwork.Parameters(path: "/novel/watchProgressReport")
|
await withCheckedContinuation { continuation in
|
||||||
|
// var param = NRNetwork.Parameters(path: "/novel/watchProgressReport")
|
||||||
var param = NRNetwork.Parameters(path: "/createHistory")
|
var param = NRNetwork.Parameters(path: "/createHistory")
|
||||||
param.isToast = false
|
param.isToast = false
|
||||||
param.parameters = [
|
param.parameters = [
|
||||||
"short_play_id" : id,
|
"short_play_id" : id,
|
||||||
// "short_play_video_id" : chapterId
|
// "short_play_video_id" : chapterId
|
||||||
"video_id" : chapterId
|
"video_id" : chapterId
|
||||||
]
|
]
|
||||||
|
|
||||||
NRNetwork.request(parameters: param) { (response: NRNetwork.Response<String>) in
|
NRNetwork.request(parameters: param) { (response: NRNetwork.Response<String>) in
|
||||||
|
if response.isSuccess {
|
||||||
|
continuation.resume(returning: true)
|
||||||
|
} else {
|
||||||
|
continuation.resume(returning: false)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -39,7 +39,7 @@ class NRNovelReaderViewController: NRViewController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let oldBrightness: CGFloat = UIScreen.main.brightness
|
var oldBrightness: CGFloat = UIScreen.main.brightness
|
||||||
|
|
||||||
private(set) lazy var viewModel: NRNovelReadViewModel = {
|
private(set) lazy var viewModel: NRNovelReadViewModel = {
|
||||||
let vm = NRNovelReadViewModel()
|
let vm = NRNovelReadViewModel()
|
||||||
|
|||||||
@ -171,12 +171,14 @@ extension NRNovelReadViewModel {
|
|||||||
model.page = pageModel.page?.intValue
|
model.page = pageModel.page?.intValue
|
||||||
NRKeyedArchiver.archiver(folderName: kNRReadRecordFolderName, fileName: novelId, object: model)
|
NRKeyedArchiver.archiver(folderName: kNRReadRecordFolderName, fileName: novelId, object: model)
|
||||||
|
|
||||||
let lastTime = uploadRecordDate?.timeIntervalSince1970 ?? 0
|
if self.lastUploadCatalogId == nil || self.lastUploadCatalogId != catalogModel.id {
|
||||||
let nowTime = Date().timeIntervalSince1970
|
self.lastUploadCatalogId = catalogModel.id
|
||||||
|
Task {
|
||||||
if lastTime == 0 || nowTime - lastTime > 1 {//间隔5秒才能上传一次记录
|
let result = await NRNovelAPI.requestUploadRecord(novelId, chapterId: catalogModel.id ?? "")
|
||||||
uploadRecordDate = Date()
|
if !result {
|
||||||
NRNovelAPI.requestUploadRecord(novelId, chapterId: catalogModel.id ?? "")
|
self.lastUploadCatalogId = nil
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -44,8 +44,8 @@ class NRNovelReadViewModel: NSObject {
|
|||||||
return tap
|
return tap
|
||||||
}()
|
}()
|
||||||
|
|
||||||
///用来记录上报历史记录的时间
|
///上报历史记录用,用来记录上次上报的目录id(用来控制每个章节只上报一次)
|
||||||
var uploadRecordDate: Date?
|
var lastUploadCatalogId: String?
|
||||||
|
|
||||||
weak var popView: UIView?
|
weak var popView: UIView?
|
||||||
|
|
||||||
|
|||||||
@ -14,6 +14,11 @@ class NRNovelReadSetManager: NSObject {
|
|||||||
|
|
||||||
private(set) var readSet: NRNovelReadSet = UserDefaults.nr_object(forKey: kNRNovelReadSetDefaultsKey, as: NRNovelReadSet.self) ?? NRNovelReadSet()
|
private(set) var readSet: NRNovelReadSet = UserDefaults.nr_object(forKey: kNRNovelReadSetDefaultsKey, as: NRNovelReadSet.self) ?? NRNovelReadSet()
|
||||||
|
|
||||||
|
override init() {
|
||||||
|
super.init()
|
||||||
|
// NotificationCenter.default.addObserver(self, selector: #selector(willEnterForegroundNotification), name: UIApplication.willEnterForegroundNotification, object: nil)
|
||||||
|
}
|
||||||
|
|
||||||
///动画时间
|
///动画时间
|
||||||
let animateDuration = 0.2
|
let animateDuration = 0.2
|
||||||
|
|
||||||
@ -26,6 +31,8 @@ class NRNovelReadSetManager: NSObject {
|
|||||||
return .init(x: 16, y: 0, width: UIScreen.width - 32, height: UIScreen.height - contentTopViewHeight - contentBottomViewHeight)
|
return .init(x: 16, y: 0, width: UIScreen.width - 32, height: UIScreen.height - contentTopViewHeight - contentBottomViewHeight)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var systemBrightness: CGFloat = UIScreen.main.brightness
|
||||||
|
|
||||||
var currentTheme: NRReadTheme {
|
var currentTheme: NRReadTheme {
|
||||||
if isNight {
|
if isNight {
|
||||||
return nightTheme
|
return nightTheme
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user