多语言文案优化,修复bug

This commit is contained in:
zjx 2025-06-20 09:21:15 +08:00
parent 348d4c869c
commit b9cb5596db
15 changed files with 104 additions and 58 deletions

View File

@ -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)
}
}
}
}

View File

@ -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)
}

View File

@ -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<String>) in
}
}
}

View File

@ -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

View File

@ -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()

View File

@ -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)
}
}
}

View File

@ -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
}()

View File

@ -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
}()

View File

@ -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

View File

@ -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)

View File

@ -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 {

View File

@ -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

View File

@ -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() ?? "")"

View File

@ -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)
}
}

View File

@ -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";