Commit 13f7a1f0 authored by Alex朱枝文's avatar Alex朱枝文

Merge branch 'HIGH' into develop-desk-tx

# Conflicts:
#	galaxy/galaxy.xcodeproj/project.pbxproj
parents fe3bceeb 3c022e75
...@@ -34,10 +34,10 @@ platform :ios do ...@@ -34,10 +34,10 @@ platform :ios do
main_fix = "main-fix" main_fix = "main-fix"
jiaofei = "jiaofei" jiaofei = "jiaofei"
plan = "4.25-1" plan = "4.25-1"
push = "push" push = "HIGH"
#打包正使用的分支 #打包正使用的分支
myPack_branch = push myPack_branch = notification
# 打adhoc包 执行命令 fastlane galaxyTest # 打adhoc包 执行命令 fastlane galaxyTest
......
...@@ -1278,6 +1278,7 @@ ...@@ -1278,6 +1278,7 @@
04EA376F2BEA071600DBAF64 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 04EA376E2BEA070500DBAF64 /* libc++.tbd */; }; 04EA376F2BEA071600DBAF64 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 04EA376E2BEA070500DBAF64 /* libc++.tbd */; };
04FE44D42DDC766E009BB247 /* TUIChatCustomTheme.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 04FE44D32DDC766D009BB247 /* TUIChatCustomTheme.bundle */; }; 04FE44D42DDC766E009BB247 /* TUIChatCustomTheme.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 04FE44D32DDC766D009BB247 /* TUIChatCustomTheme.bundle */; };
04FE44DA2DDEF0D1009BB247 /* YHTUIMessageListManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FE44D92DDEF0D1009BB247 /* YHTUIMessageListManager.swift */; }; 04FE44DA2DDEF0D1009BB247 /* YHTUIMessageListManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FE44D92DDEF0D1009BB247 /* YHTUIMessageListManager.swift */; };
04F1924D2DE0125B004BDAAC /* YHNewsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F1924C2DE0125B004BDAAC /* YHNewsModel.swift */; };
6203A87EDC96313BBE789D9C /* Pods_galaxy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */; }; 6203A87EDC96313BBE789D9C /* Pods_galaxy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */; };
A5573EE92B317C0100D98EC0 /* galaxyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5573EE82B317C0100D98EC0 /* galaxyTests.swift */; }; A5573EE92B317C0100D98EC0 /* galaxyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5573EE82B317C0100D98EC0 /* galaxyTests.swift */; };
A5573EF32B317C0100D98EC0 /* galaxyUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5573EF22B317C0100D98EC0 /* galaxyUITests.swift */; }; A5573EF32B317C0100D98EC0 /* galaxyUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5573EF22B317C0100D98EC0 /* galaxyUITests.swift */; };
...@@ -2591,6 +2592,7 @@ ...@@ -2591,6 +2592,7 @@
04E507D52D6EE856005F758B /* YHUserLevelAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHUserLevelAlertView.swift; sourceTree = "<group>"; }; 04E507D52D6EE856005F758B /* YHUserLevelAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHUserLevelAlertView.swift; sourceTree = "<group>"; };
04EA376C2BEA06EF00DBAF64 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; 04EA376C2BEA06EF00DBAF64 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
04EA376E2BEA070500DBAF64 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; }; 04EA376E2BEA070500DBAF64 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
04F1924C2DE0125B004BDAAC /* YHNewsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHNewsModel.swift; sourceTree = "<group>"; };
04FA8B2D2C084C7E00ABE43F /* ATAuthSDK.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = ATAuthSDK.bundle; path = "galaxy/Classes/Modules/AutoLogin(一键登录)/framework/ATAuthSDK_D.framework/ATAuthSDK.bundle"; sourceTree = "<group>"; }; 04FA8B2D2C084C7E00ABE43F /* ATAuthSDK.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = ATAuthSDK.bundle; path = "galaxy/Classes/Modules/AutoLogin(一键登录)/framework/ATAuthSDK_D.framework/ATAuthSDK.bundle"; sourceTree = "<group>"; };
04FE44D32DDC766D009BB247 /* TUIChatCustomTheme.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = TUIChatCustomTheme.bundle; sourceTree = "<group>"; }; 04FE44D32DDC766D009BB247 /* TUIChatCustomTheme.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = TUIChatCustomTheme.bundle; sourceTree = "<group>"; };
04FE44D92DDEF0D1009BB247 /* YHTUIMessageListManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHTUIMessageListManager.swift; sourceTree = "<group>"; }; 04FE44D92DDEF0D1009BB247 /* YHTUIMessageListManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHTUIMessageListManager.swift; sourceTree = "<group>"; };
...@@ -5797,6 +5799,7 @@ ...@@ -5797,6 +5799,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
045C0EC62D12CA5E00BD2DC0 /* YHMsgListModel.swift */, 045C0EC62D12CA5E00BD2DC0 /* YHMsgListModel.swift */,
04F1924C2DE0125B004BDAAC /* YHNewsModel.swift */,
); );
path = M; path = M;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -7927,6 +7930,7 @@ ...@@ -7927,6 +7930,7 @@
045C121F2D12CA5F00BD2DC0 /* YHCertificateTemplateSheetView.swift in Sources */, 045C121F2D12CA5F00BD2DC0 /* YHCertificateTemplateSheetView.swift in Sources */,
045C12202D12CA5F00BD2DC0 /* YHResignMaterialListVC.swift in Sources */, 045C12202D12CA5F00BD2DC0 /* YHResignMaterialListVC.swift in Sources */,
045C12212D12CA5F00BD2DC0 /* YHResignUploadTravelPassportTableViewCell.swift in Sources */, 045C12212D12CA5F00BD2DC0 /* YHResignUploadTravelPassportTableViewCell.swift in Sources */,
04F1924D2DE0125B004BDAAC /* YHNewsModel.swift in Sources */,
045C12222D12CA5F00BD2DC0 /* YHResignCertificatePassportTableViewCell.swift in Sources */, 045C12222D12CA5F00BD2DC0 /* YHResignCertificatePassportTableViewCell.swift in Sources */,
045C12232D12CA5F00BD2DC0 /* YHIncomeRecordItemCell.swift in Sources */, 045C12232D12CA5F00BD2DC0 /* YHIncomeRecordItemCell.swift in Sources */,
045C12242D12CA5F00BD2DC0 /* YHAdopterResidentViewController.swift in Sources */, 045C12242D12CA5F00BD2DC0 /* YHAdopterResidentViewController.swift in Sources */,
...@@ -8506,7 +8510,7 @@ ...@@ -8506,7 +8510,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxyTestEnv.entitlements; CODE_SIGN_ENTITLEMENTS = galaxy/galaxyTestEnv.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = RXHYW88XR7; DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
...@@ -8533,7 +8537,7 @@ ...@@ -8533,7 +8537,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 2.2.3; MARKETING_VERSION = 2.2.4;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy; PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
...@@ -8654,7 +8658,7 @@ ...@@ -8654,7 +8658,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements; CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = RXHYW88XR7; DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
...@@ -8681,7 +8685,7 @@ ...@@ -8681,7 +8685,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 2.2.3; MARKETING_VERSION = 2.2.4;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy; PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
...@@ -8864,7 +8868,7 @@ ...@@ -8864,7 +8868,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxyDebug.entitlements; CODE_SIGN_ENTITLEMENTS = galaxy/galaxyDebug.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = RXHYW88XR7; DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
...@@ -8891,7 +8895,7 @@ ...@@ -8891,7 +8895,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 2.2.3; MARKETING_VERSION = 2.2.4;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy; PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
...@@ -8914,7 +8918,7 @@ ...@@ -8914,7 +8918,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements; CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = RXHYW88XR7; DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
...@@ -8941,7 +8945,7 @@ ...@@ -8941,7 +8945,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 2.2.3; MARKETING_VERSION = 2.2.4;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy; PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
......
...@@ -118,6 +118,18 @@ extension AppDelegate: JPUSHRegisterDelegate { ...@@ -118,6 +118,18 @@ extension AppDelegate: JPUSHRegisterDelegate {
YHLoginManager.shared.needJumpToMsgTabFlag = true YHLoginManager.shared.needJumpToMsgTabFlag = true
DispatchQueue.main.asyncAfter(deadline: .now() + 0.25, execute: { DispatchQueue.main.asyncAfter(deadline: .now() + 0.25, execute: {
goToMessagePage() goToMessagePage()
if let msgType = userInfo["msg_type"] as? Int, msgType == YHMessageType.article.rawValue {
let model = YHNewsModel()
model.id = userInfo["msg_id"] as? String ?? ""
model.article_id = userInfo["article_id"] as? Int ?? 0
model.news_type = userInfo["news_type"] as? Int ?? 0
model.cover_img = userInfo["cover_img"] as? String ?? ""
model.url = userInfo["url"] as? String ?? ""
model.media_url = userInfo["media_url"] as? String ?? ""
model.media_transcode_url = userInfo["media_transcode_url"] as? String ?? ""
yh_newsList.enterDetail(model)
yh_newsList.markRead(model)
}
}) })
} }
......
...@@ -49,6 +49,9 @@ class YHOrderTipsItemView: UIView { ...@@ -49,6 +49,9 @@ class YHOrderTipsItemView: UIView {
} else if msg.type == YHMessageType.business.rawValue { } else if msg.type == YHMessageType.business.rawValue {
return "银河商务" return "银河商务"
} else if msg.type == YHMessageType.article.rawValue {
return "银河资讯"
} else { } else {
return "--" return "--"
} }
......
...@@ -341,8 +341,12 @@ extension YHServiceCenterViewController { ...@@ -341,8 +341,12 @@ extension YHServiceCenterViewController {
self.homeTableView.tableHeaderView = UIView() self.homeTableView.tableHeaderView = UIView()
if self.model.product_type == 1 { if self.model.product_type == 1 {
self.titleLabel.setTitle("优才审批阶段", for: .normal) self.titleLabel.setTitle("优才审批阶段", for: .normal)
} else { } else if self.model.product_type == 2 {
self.titleLabel.setTitle("高才审批阶段", for: .normal) self.titleLabel.setTitle("高才审批阶段", for: .normal)
} else if self.model.product_type == 4 {
self.titleLabel.setTitle("专才审批阶段", for: .normal)
} else if self.model.product_type == 5 {
self.titleLabel.setTitle("留学审批阶段", for: .normal)
} }
self.titleLabel.setImage(UIImage(named: "service_center_select_step"), for: .normal) self.titleLabel.setImage(UIImage(named: "service_center_select_step"), for: .normal)
} }
...@@ -362,8 +366,12 @@ extension YHServiceCenterViewController { ...@@ -362,8 +366,12 @@ extension YHServiceCenterViewController {
self.headView.dataSource = self.serviceCenterMainReqVM.mainModel.renewalSection.list self.headView.dataSource = self.serviceCenterMainReqVM.mainModel.renewalSection.list
if self.model.product_type == 1 { if self.model.product_type == 1 {
self.titleLabel.setTitle("优才续签阶段", for: .normal) self.titleLabel.setTitle("优才续签阶段", for: .normal)
} else { } else if self.model.product_type == 2 {
self.titleLabel.setTitle("高才续签阶段", for: .normal) self.titleLabel.setTitle("高才续签阶段", for: .normal)
} else if self.model.product_type == 4 {
self.titleLabel.setTitle("专才续签阶段", for: .normal)
} else if self.model.product_type == 5 {
self.titleLabel.setTitle("留学续签阶段", for: .normal)
} }
self.titleLabel.setImage(UIImage(named: "service_center_select_step"), for: .normal) self.titleLabel.setImage(UIImage(named: "service_center_select_step"), for: .normal)
self.isCanSelectStep = true self.isCanSelectStep = true
...@@ -413,8 +421,12 @@ extension YHServiceCenterViewController { ...@@ -413,8 +421,12 @@ extension YHServiceCenterViewController {
self.homeTableView.tableHeaderView = UIView() self.homeTableView.tableHeaderView = UIView()
if self.model.product_type == 1 { if self.model.product_type == 1 {
self.titleLabel.setTitle("优才申请阶段", for: .normal) self.titleLabel.setTitle("优才申请阶段", for: .normal)
} else { } else if self.model.product_type == 2 {
self.titleLabel.setTitle("高才申请阶段", for: .normal) self.titleLabel.setTitle("高才申请阶段", for: .normal)
} else if self.model.product_type == 4 {
self.titleLabel.setTitle("专才申请阶段", for: .normal)
} else if self.model.product_type == 5 {
self.titleLabel.setTitle("留学申请阶段", for: .normal)
} }
self.titleLabel.setImage(UIImage(named: ""), for: .normal) self.titleLabel.setImage(UIImage(named: ""), for: .normal)
} }
...@@ -423,8 +435,12 @@ extension YHServiceCenterViewController { ...@@ -423,8 +435,12 @@ extension YHServiceCenterViewController {
self.homeTableView.tableHeaderView = UIView() self.homeTableView.tableHeaderView = UIView()
if self.model.product_type == 1 { if self.model.product_type == 1 {
self.titleLabel.setTitle("优才审批阶段", for: .normal) self.titleLabel.setTitle("优才审批阶段", for: .normal)
} else { } else if self.model.product_type == 2 {
self.titleLabel.setTitle("高才审批阶段", for: .normal) self.titleLabel.setTitle("高才审批阶段", for: .normal)
} else if self.model.product_type == 4 {
self.titleLabel.setTitle("专才审批阶段", for: .normal)
} else if self.model.product_type == 5 {
self.titleLabel.setTitle("留学审批阶段", for: .normal)
} }
if isCanSelectStep { if isCanSelectStep {
self.titleLabel.setImage(UIImage(named: "service_center_select_step"), for: .normal) self.titleLabel.setImage(UIImage(named: "service_center_select_step"), for: .normal)
...@@ -448,8 +464,12 @@ extension YHServiceCenterViewController { ...@@ -448,8 +464,12 @@ extension YHServiceCenterViewController {
self.headView.dataSource = self.serviceCenterMainReqVM.mainModel.renewalSection.list self.headView.dataSource = self.serviceCenterMainReqVM.mainModel.renewalSection.list
if self.model.product_type == 1 { if self.model.product_type == 1 {
self.titleLabel.setTitle("优才续签阶段", for: .normal) self.titleLabel.setTitle("优才续签阶段", for: .normal)
} else { } else if self.model.product_type == 2 {
self.titleLabel.setTitle("高才续签阶段", for: .normal) self.titleLabel.setTitle("高才续签阶段", for: .normal)
} else if self.model.product_type == 4 {
self.titleLabel.setTitle("专才续签阶段", for: .normal)
} else if self.model.product_type == 5 {
self.titleLabel.setTitle("留学续签阶段", for: .normal)
} }
self.titleLabel.setImage(UIImage(named: "service_center_select_step"), for: .normal) self.titleLabel.setImage(UIImage(named: "service_center_select_step"), for: .normal)
} }
......
...@@ -18,7 +18,7 @@ struct YHContactItemModel: SmartCodable { ...@@ -18,7 +18,7 @@ struct YHContactItemModel: SmartCodable {
var type: String = "" var type: String = ""
var mobile: String = "" var mobile: String = ""
var status: Int = 0 var status: Int = 0
var product_type: Int = 0 // 1-优才 2-高才 var product_type: Int = 0 // 1-优才 2-高才 3-小项目 4-专才 5-留学
var isOther: Bool = false // 是否协作单 var isOther: Bool = false // 是否协作单
var service_name: String = "" var service_name: String = ""
} }
...@@ -344,10 +344,14 @@ private extension YHTravelDocsPreparationDetailVC { ...@@ -344,10 +344,14 @@ private extension YHTravelDocsPreparationDetailVC {
var cerArr: [[String: Any]] = [] var cerArr: [[String: Any]] = []
for item in sectionItems { for item in sectionItems {
if item.type == .certificate { if item.type == .certificate {
var imageback = item.cerDetailModel.img_back
if self.type == .chinesePassPort || self.type == .forignPassPort {
imageback = ""
}
let dic: [String: Any] = [ let dic: [String: Any] = [
"type": item.cerDetailModel.type, "type": item.cerDetailModel.type,
"img_front": item.cerDetailModel.img_front, "img_front": item.cerDetailModel.img_front,
"img_back": item.cerDetailModel.img_back, "img_back": imageback,
"issue_start": item.cerDetailModel.issue_start, "issue_start": item.cerDetailModel.issue_start,
"issue_end": item.cerDetailModel.issue_end "issue_end": item.cerDetailModel.issue_end
] ]
......
...@@ -46,6 +46,7 @@ class YHOfficialApprovalResultVC: YHBaseViewController { ...@@ -46,6 +46,7 @@ class YHOfficialApprovalResultVC: YHBaseViewController {
// 文档内容 // 文档内容
lazy var contentView: YHOffivialApprovalSuccessView = { lazy var contentView: YHOffivialApprovalSuccessView = {
let view = YHOffivialApprovalSuccessView() let view = YHOffivialApprovalSuccessView()
view.orderTypeString = orderTypeString
// view.isHidden = true // view.isHidden = true
return view return view
}() }()
...@@ -138,6 +139,18 @@ class YHOfficialApprovalResultVC: YHBaseViewController { ...@@ -138,6 +139,18 @@ class YHOfficialApprovalResultVC: YHBaseViewController {
// 是否来着首页的弹窗 // 是否来着首页的弹窗
var isFromHomeAlertViewFlag: Bool = false var isFromHomeAlertViewFlag: Bool = false
var orderTypeString = ""
var orderType: Int = 1 {
didSet {
if orderType == 1 {
orderTypeString = "优秀人才入境计划"
} else if orderType == 2 {
orderTypeString = "高才通人才计划"
} else if orderType == 3 {
orderTypeString = "输入内地人才入境计划"
}
}
}
lazy var previewFileTool: YHFilePreviewTool = { lazy var previewFileTool: YHFilePreviewTool = {
let tool = YHFilePreviewTool(targetVC: UIViewController.current) let tool = YHFilePreviewTool(targetVC: UIViewController.current)
...@@ -205,6 +218,7 @@ private extension YHOfficialApprovalResultVC { ...@@ -205,6 +218,7 @@ private extension YHOfficialApprovalResultVC {
let view = YHOffivialApprovalSuccessCheckView.sheetView() let view = YHOffivialApprovalSuccessCheckView.sheetView()
view.days = self.princleVM.lettersModel?.days ?? 0 view.days = self.princleVM.lettersModel?.days ?? 0
view.orderType = self.orderType
view.show() view.show()
view.block = { tag in view.block = { tag in
......
...@@ -97,6 +97,18 @@ class YHOffivialApprovalSuccessCheckView: UIView { ...@@ -97,6 +97,18 @@ class YHOffivialApprovalSuccessCheckView: UIView {
lastText = "从递交资料伊始,经历了" + String(days) + "天,感谢您这一路以来对银河的信赖与包容!" lastText = "从递交资料伊始,经历了" + String(days) + "天,感谢您这一路以来对银河的信赖与包容!"
} }
} }
var orderType: Int = 1 {
didSet {
if orderType == 1 {
fullText = "恭喜您申请的【优秀人才入境计划】"
} else if orderType == 2 {
fullText = "恭喜您申请的【高才通人才计划】"
} else if orderType == 3 {
fullText = "恭喜您申请的【输入内地人才入境计划】"
}
}
}
} }
extension YHOffivialApprovalSuccessCheckView { extension YHOffivialApprovalSuccessCheckView {
......
...@@ -19,7 +19,7 @@ class YHOffivialApprovalSuccessView: UIView { ...@@ -19,7 +19,7 @@ class YHOffivialApprovalSuccessView: UIView {
private var titleLabel: UILabel! private var titleLabel: UILabel!
private var arrViews: [UIView] = [] private var arrViews: [UIView] = []
var orderTypeString: String = "优秀人才入境计划"
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented") fatalError("init(coder:) has not been implemented")
} }
...@@ -100,13 +100,13 @@ private extension YHOffivialApprovalSuccessView { ...@@ -100,13 +100,13 @@ private extension YHOffivialApprovalSuccessView {
let arr = tmp.split(separator: "-") let arr = tmp.split(separator: "-")
if arr.count == 3 { if arr.count == 3 {
tmp = arr[0] + "年" + arr[1] + "月" + arr[2] + "日" + "正式获批" tmp = arr[0] + "年" + arr[1] + "月" + arr[2] + "日" + "正式获批"
let fourItems = ["祝贺您和您的家人申请的", "【优秀人才入境计划】", tmp, "这意味着,您领取香港居民身份证", "仅有一步之遥!!"] let fourItems = ["祝贺您和您的家人申请的", "【\(orderTypeString)】", tmp, "这意味着,您领取香港居民身份证", "仅有一步之遥!!"]
updataView(data: fourItems) updataView(data: fourItems)
} }
} else { } else {
titleLabel.text = "恭喜 客户!" titleLabel.text = "恭喜 客户!"
let tmp = "正式获批" let tmp = "正式获批"
let fourItems = ["祝贺您和您的家人申请的", "【优秀人才入境计划】", tmp, "这意味着,您领取香港居民身份证", "仅有一步之遥!!"] let fourItems = ["祝贺您和您的家人申请的", "【\(orderTypeString)】", tmp, "这意味着,您领取香港居民身份证", "仅有一步之遥!!"]
updataView(data: fourItems) updataView(data: fourItems)
} }
......
...@@ -27,7 +27,22 @@ class YHPrincipleWaitResultViewController: YHBaseViewController { ...@@ -27,7 +27,22 @@ class YHPrincipleWaitResultViewController: YHBaseViewController {
var status: Int = -1 var status: Int = -1
var items: [YHPrincipleWaitResultModel] = [] var items: [YHPrincipleWaitResultModel] = []
var isQuerying: Bool = false var isQuerying: Bool = false
var orderTypeString = ""
var orderTypeTime = ""
var orderType: Int = 1 {
didSet {
if orderType == 1 {
orderTypeString = "优秀人才入境计划"
orderTypeTime = "12个月"
} else if orderType == 2 {
orderTypeString = "高才通人才计划"
orderTypeTime = "2-3个月"
} else if orderType == 3 {
orderTypeString = "输入内地人才入境计划"
orderTypeTime = "3-6个月"
}
}
}
let viewModel = YHPrincleViewModel() let viewModel = YHPrincleViewModel()
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .grouped) let tableView = UITableView(frame: .zero, style: .grouped)
...@@ -237,7 +252,7 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD ...@@ -237,7 +252,7 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD
tipsLabel.numberOfLines = 0 tipsLabel.numberOfLines = 0
tipsLabel.font = UIFont.PFSC_R(ofSize: 14) tipsLabel.font = UIFont.PFSC_R(ofSize: 14)
tipsLabel.textColor = .mainTextColor(alpha: 0.7) tipsLabel.textColor = .mainTextColor(alpha: 0.7)
tipsLabel.text = "您的【优秀人才入境计划】赴港居留申请资料已经递交港府。" tipsLabel.text = "您的【\(orderTypeString)】赴港居留申请资料已经递交港府。"
view.addSubview(tipsLabel) view.addSubview(tipsLabel)
let detailLabel = UILabel() let detailLabel = UILabel()
...@@ -287,7 +302,7 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD ...@@ -287,7 +302,7 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD
// 14 未获批准~ // 14 未获批准~
if status == YHCustomerServiceStatus.principleWaitResult.rawValue { // 等待原则批结果 if status == YHCustomerServiceStatus.principleWaitResult.rawValue { // 等待原则批结果
let str1: ASAttributedString = .init("您的【优秀人才入境计划】赴港居留申请资料已经递交港府,且入境事务处已经认收受理!港府审核周期预计在12个月内,", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor(alpha: 0.7))) let str1: ASAttributedString = .init("您的【\(orderTypeString)】赴港居留申请资料已经递交港府,且入境事务处已经认收受理!港府审核周期预计在\(orderTypeTime)内,", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor(alpha: 0.7)))
let str2: ASAttributedString = .init("我们将实时为您查询身份申请进度", .font(UIFont.PFSC_B(ofSize: 14)), .foreground(UIColor.brandMainColor)) let str2: ASAttributedString = .init("我们将实时为您查询身份申请进度", .font(UIFont.PFSC_B(ofSize: 14)), .foreground(UIColor.brandMainColor))
var str3: ASAttributedString = .init(",请您耐心等待!", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor(alpha: 0.7))) var str3: ASAttributedString = .init(",请您耐心等待!", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor(alpha: 0.7)))
if self.viewModel.waitResultModel.resultImageList.count > 0 { if self.viewModel.waitResultModel.resultImageList.count > 0 {
...@@ -302,7 +317,7 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD ...@@ -302,7 +317,7 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD
} else if status == YHCustomerServiceStatus.principleRejected.rawValue { // 未获批准~ } else if status == YHCustomerServiceStatus.principleRejected.rawValue { // 未获批准~
let str1: ASAttributedString = .init("您【与家人】申请的【优秀人才入境计划】", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor(alpha: 0.7))) let str1: ASAttributedString = .init("您【与家人】申请的【\(orderTypeString)】", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor(alpha: 0.7)))
let str2: ASAttributedString = .init("未获批准", .font(UIFont.PFSC_B(ofSize: 14)), .foreground(UIColor.brandMainColor)) let str2: ASAttributedString = .init("未获批准", .font(UIFont.PFSC_B(ofSize: 14)), .foreground(UIColor.brandMainColor))
let str3: ASAttributedString = .init("。具体详情以及后续处理方式,请您联系专属服务您的生活管家进行详细沟通", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor(alpha: 0.7))) let str3: ASAttributedString = .init("。具体详情以及后续处理方式,请您联系专属服务您的生活管家进行详细沟通", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor(alpha: 0.7)))
return str1 + str2 + str3 return str1 + str2 + str3
......
...@@ -8,10 +8,17 @@ ...@@ -8,10 +8,17 @@
import UIKit import UIKit
let yh_newsList = YHGalaxyNewsListViewController()
class YHGalaxyNewsListViewController: YHBaseViewController { class YHGalaxyNewsListViewController: YHBaseViewController {
var newsArr: [String] = ["", "", ""] let type: Int = YHMessageType.article.rawValue
var newsArr: [YHNewsModel] = []
var currentPage = 1
var isLastPage = false
let viewModel = YHMsgViewModel()
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .grouped) let tableView = UITableView(frame: .zero, style: .grouped)
if #available(iOS 15.0, *) { if #available(iOS 15.0, *) {
...@@ -27,11 +34,18 @@ class YHGalaxyNewsListViewController: YHBaseViewController { ...@@ -27,11 +34,18 @@ class YHGalaxyNewsListViewController: YHBaseViewController {
tableView.backgroundView = emptyDataTipsView tableView.backgroundView = emptyDataTipsView
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell") tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHGalaxyNewsCell.self, forCellReuseIdentifier: YHGalaxyNewsCell.cellReuseIdentifier) tableView.register(YHGalaxyNewsCell.self, forCellReuseIdentifier: YHGalaxyNewsCell.cellReuseIdentifier)
tableView.es.addYHPullToRefresh {
self.getMsgList(more: false)
}
tableView.es.addInfiniteScrolling {
self.getMsgList(more: true)
}
return tableView return tableView
}() }()
lazy var emptyDataTipsView: YHEmptyDataView = { lazy var emptyDataTipsView: YHEmptyDataView = {
let view = YHEmptyDataView.createView("暂无消息", kEmptyMessageBgName) let view = YHEmptyDataView.createView("暂无资讯", kEmptyMessageBgName)
let topMargin = 310-k_Height_NavigationtBarAndStatuBar let topMargin = 310-k_Height_NavigationtBarAndStatuBar
view.topMargin = topMargin view.topMargin = topMargin
view.isHidden = true view.isHidden = true
...@@ -50,20 +64,132 @@ class YHGalaxyNewsListViewController: YHBaseViewController { ...@@ -50,20 +64,132 @@ class YHGalaxyNewsListViewController: YHBaseViewController {
view.backgroundColor = .init(hex: 0xF8F9FB) view.backgroundColor = .init(hex: 0xF8F9FB)
view.addSubview(tableView) view.addSubview(tableView)
tableView.snp.makeConstraints { make in tableView.snp.makeConstraints { make in
make.left.right.equalToSuperview() make.left.right.equalToSuperview()
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar) make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalToSuperview() make.bottom.equalToSuperview()
} }
getMsgList()
} }
@objc func didCleanBtnClicked() { @objc func didCleanBtnClicked() {
YHCommonAlertView.show("清除未读", "确定要清除所有未读提示吗?", "取消", "确认") { YHCommonAlertView.show("清除未读", "确定要清除所有未读提示吗?", "取消", "确认") {
} callBack: {
self.markAllMsgsRead()
}
}
func getMsgList(more: Bool = false) {
if isLastPage {
if more {
tableView.es.stopLoadingMore()
} else {
tableView.es.stopPullToRefresh()
}
self.tableView.es.noticeNoMoreData()
self.tableView.footer?.isHidden = false
return
}
if more {
currentPage += 1
} else {
currentPage = 1
}
self.viewModel.getNewsDetailList(type: self.type, page: currentPage) { [weak self] _, isLastPage in
guard let self = self else { return }
newsArr.removeAll()
newsArr.append(contentsOf: self.viewModel.newsDetailList)
emptyDataTipsView.isHidden = newsArr.count > 0
self.isLastPage = isLastPage
if more {
tableView.es.stopLoadingMore()
} else {
tableView.es.stopPullToRefresh()
}
if isLastPage {
self.tableView.es.noticeNoMoreData()
self.tableView.footer?.isHidden = false
}
self.tableView.reloadData()
}
}
func markAllMsgsRead() {
YHHUD.show(.progress(message: "清除中..."))
self.viewModel.readMessages(type: self.type, msgIds: nil, isAllRead: true) { [weak self] success, error in
YHHUD.hide()
guard let self = self else { return }
if success {
YHHUD.flash(message: "清除成功")
for item in self.newsArr {
item.is_read = true
}
self.tableView.reloadData()
return
}
var msg = "清除失败"
if let error = error {
if error.errorMsg.count > 0 {
msg = error.errorMsg
}
}
YHHUD.flash(message: msg)
}
}
func markRead(_ model: YHNewsModel) {
if let id = Int(model.id) {
self.viewModel.readMessages(type: self.type, msgIds: [id], isAllRead: false) { [weak self] success, _ in
guard let self = self else { return }
if success {
for msgItem in newsArr {
if msgItem.article_id == model.article_id, msgItem.id == model.id {
msgItem.is_read = true
break
}
}
self.tableView.reloadData()
return
}
}
}
}
func enterDetail(_ item: YHNewsModel) {
if item.news_type == 2 { // 图文
let vc = YHHomeWebViewController()
vc.url = YHBaseUrlManager.shared.curH5URL() + "articleDetail.html" + "?id=\(item.article_id)"
vc.id = item.article_id
UIViewController.current?.navigationController?.pushViewController(vc)
return
} else if item.news_type == 1 { // 视频
if !item.media_url.isEmpty, let _ = URL(string: item.media_url) {
let vc = YHVideoPlayerVC()
if !item.media_transcode_url.isEmpty {
vc.url = item.media_transcode_url
} else {
vc.url = item.media_url
}
vc.id = item.article_id
UIViewController.current?.navigationController?.pushViewController(vc)
}
return
} else if item.news_type == 4 { // 纯网页
let vc = YHWebViewViewController()
vc.url = item.url
vc.navTitle = item.title
UIViewController.current?.navigationController?.pushViewController(vc)
} }
} }
} }
extension YHGalaxyNewsListViewController: UITableViewDelegate, UITableViewDataSource { extension YHGalaxyNewsListViewController: UITableViewDelegate, UITableViewDataSource {
...@@ -77,7 +203,7 @@ extension YHGalaxyNewsListViewController: UITableViewDelegate, UITableViewDataSo ...@@ -77,7 +203,7 @@ extension YHGalaxyNewsListViewController: UITableViewDelegate, UITableViewDataSo
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHGalaxyNewsCell.cellReuseIdentifier, for: indexPath) as? YHGalaxyNewsCell else { return UITableViewCell() } guard let cell = tableView.dequeueReusableCell(withIdentifier: YHGalaxyNewsCell.cellReuseIdentifier, for: indexPath) as? YHGalaxyNewsCell else { return UITableViewCell() }
if 0 <= indexPath.row && indexPath.row < newsArr.count { if 0 <= indexPath.row && indexPath.row < newsArr.count {
let item = newsArr[indexPath.row] let item = newsArr[indexPath.row]
cell.updateModel(item)
} }
return cell return cell
} }
...@@ -87,7 +213,11 @@ extension YHGalaxyNewsListViewController: UITableViewDelegate, UITableViewDataSo ...@@ -87,7 +213,11 @@ extension YHGalaxyNewsListViewController: UITableViewDelegate, UITableViewDataSo
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if 0 <= indexPath.row && indexPath.row < newsArr.count {
let item = newsArr[indexPath.row]
self.enterDetail(item)
self.markRead(item)
}
} }
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat { private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
......
...@@ -177,7 +177,6 @@ class YHMessageListVC: YHBaseViewController { ...@@ -177,7 +177,6 @@ class YHMessageListVC: YHBaseViewController {
@objc func getUnreadMsgList() { @objc func getUnreadMsgList() {
if !YHLoginManager.shared.isLogin() { if !YHLoginManager.shared.isLogin() {
// 保留第一个元素银河管家,删除其他元素
msgArr.removeAll() msgArr.removeAll()
self.tableView.reloadData() self.tableView.reloadData()
emptyDataTipsView.isHidden = msgArr.count > 0 emptyDataTipsView.isHidden = msgArr.count > 0
...@@ -204,6 +203,9 @@ class YHMessageListVC: YHBaseViewController { ...@@ -204,6 +203,9 @@ class YHMessageListVC: YHBaseViewController {
} }
msgArr.append(self.managerSession) msgArr.append(self.managerSession)
} }
// 银河资讯
msgArr.append(self.viewModel.msgList.article)
if success { if success {
var hasUnreadMsg = false var hasUnreadMsg = false
...@@ -436,14 +438,7 @@ extension YHMessageListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -436,14 +438,7 @@ extension YHMessageListVC: UITableViewDelegate, UITableViewDataSource {
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
// do {
// // test
// let vc = YHGalaxyNewsListViewController()
// self.navigationController?.pushViewController(vc)
// return
// }
if 0 <= indexPath.row && indexPath.row < msgArr.count { if 0 <= indexPath.row && indexPath.row < msgArr.count {
let msgItem = msgArr[indexPath.row] let msgItem = msgArr[indexPath.row]
...@@ -464,6 +459,12 @@ extension YHMessageListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -464,6 +459,12 @@ extension YHMessageListVC: UITableViewDelegate, UITableViewDataSource {
} }
return return
} }
if msgItem.type == YHMessageType.article.rawValue { // 银河资讯
let vc = YHGalaxyNewsListViewController()
self.navigationController?.pushViewController(vc)
return
}
let vc = YHMessageDetailListVC() let vc = YHMessageDetailListVC()
vc.type = msgItem.type vc.type = msgItem.type
vc.title = msgItem.getTitle() vc.title = msgItem.getTitle()
......
...@@ -20,6 +20,7 @@ enum YHMessageType: Int { ...@@ -20,6 +20,7 @@ enum YHMessageType: Int {
case goToHK = 7 // 赴港办证 case goToHK = 7 // 赴港办证
case renewal = 8 // 身份续签 case renewal = 8 // 身份续签
case business = 9 // 商务 case business = 9 // 商务
case article = 10 // 资讯
case yinheManager = 9527 // 银河管家 case yinheManager = 9527 // 银河管家
} }
...@@ -73,6 +74,9 @@ class YHMessageInfoModel: SmartCodable { ...@@ -73,6 +74,9 @@ class YHMessageInfoModel: SmartCodable {
} else if type == YHMessageType.business.rawValue { } else if type == YHMessageType.business.rawValue {
return "银河商务" return "银河商务"
} else if type == YHMessageType.article.rawValue {
return "银河资讯"
} }
return "" return ""
} }
...@@ -88,6 +92,7 @@ class YHMsgListModel: SmartCodable { ...@@ -88,6 +92,7 @@ class YHMsgListModel: SmartCodable {
var goToHK: YHMessageInfoModel = YHMessageInfoModel() var goToHK: YHMessageInfoModel = YHMessageInfoModel()
var renewal: YHMessageInfoModel = YHMessageInfoModel() var renewal: YHMessageInfoModel = YHMessageInfoModel()
var business: YHMessageInfoModel = YHMessageInfoModel() var business: YHMessageInfoModel = YHMessageInfoModel()
var article: YHMessageInfoModel = YHMessageInfoModel()
required init() { required init() {
self.information.type = YHMessageType.infoFill.rawValue self.information.type = YHMessageType.infoFill.rawValue
...@@ -99,10 +104,11 @@ class YHMsgListModel: SmartCodable { ...@@ -99,10 +104,11 @@ class YHMsgListModel: SmartCodable {
self.goToHK.type = YHMessageType.goToHK.rawValue self.goToHK.type = YHMessageType.goToHK.rawValue
self.renewal.type = YHMessageType.renewal.rawValue self.renewal.type = YHMessageType.renewal.rawValue
self.business.type = YHMessageType.business.rawValue self.business.type = YHMessageType.business.rawValue
self.article.type = YHMessageType.article.rawValue
} }
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {
case information, certificate, draft, signature, approval, renewal, business case information, certificate, draft, signature, approval, renewal, business, article
case dataSubmission = "data_submission" case dataSubmission = "data_submission"
case goToHK = "go_to_hk" case goToHK = "go_to_hk"
} }
......
//
// YHNewsModel.swift
// galaxy
//
// Created by Dufet on 2025/5/23.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import SmartCodable
class YHNewsListModel: SmartCodable {
var page_count: Int = 0
var list: [YHNewsModel] = []
required init() {
}
}
class YHNewsModel: SmartCodable {
var id: String = ""
var title: String = ""
var content: String = ""
var time: Int64 = 0
var is_read: Bool = false
var url: String = ""
var news_type: Int = 0 // 资讯类型:1视频 2图文 4 固定链接
var article_id: Int = 0
var type: Int = 0
var media_url: String = "" // 媒体链接
var media_transcode_url: String = "" // 媒体转码链接
var cover_img: String = "" // 封面图片链接
required init() {
}
}
...@@ -31,7 +31,9 @@ class YHGalaxyNewsCell: UITableViewCell { ...@@ -31,7 +31,9 @@ class YHGalaxyNewsCell: UITableViewCell {
lazy var coverImgV: UIImageView = { lazy var coverImgV: UIImageView = {
let imgV = UIImageView() let imgV = UIImageView()
imgV.contentMode = .scaleAspectFill
imgV.image = UIImage(named: "msg_news_cover_default") imgV.image = UIImage(named: "msg_news_cover_default")
imgV.clipsToBounds = true
return imgV return imgV
}() }()
...@@ -77,6 +79,16 @@ class YHGalaxyNewsCell: UITableViewCell { ...@@ -77,6 +79,16 @@ class YHGalaxyNewsCell: UITableViewCell {
setupUI() setupUI()
} }
func updateModel(_ model: YHNewsModel) {
timeLabel.text = formatTimestamp(Double(model.time))
coverImgV.sd_setImage(with: URL(string: model.cover_img), placeholderImage: UIImage(named: "msg_news_cover_default"))
titleLabel.text = model.title
descLabel.text = model.content
redPointView.isHidden = model.is_read
playImgV.isHidden = model.news_type != 1
}
func setupUI() { func setupUI() {
self.selectionStyle = .none self.selectionStyle = .none
...@@ -135,5 +147,30 @@ class YHGalaxyNewsCell: UITableViewCell { ...@@ -135,5 +147,30 @@ class YHGalaxyNewsCell: UITableViewCell {
} }
} }
func formatTimestamp(_ timestamp: TimeInterval) -> String {
let currentDate = Date()
let calendar = Calendar.current
let currentYear = calendar.component(.year, from: currentDate)
let currentDay = calendar.component(.day, from: currentDate)
let date = Date(timeIntervalSince1970: timestamp)
let year = calendar.component(.year, from: date)
let day = calendar.component(.day, from: date)
let dateFormatter = DateFormatter()
if year == currentYear {
if day == currentDay {
dateFormatter.dateFormat = "HH:mm"
} else {
dateFormatter.dateFormat = "MM-dd"
}
} else {
dateFormatter.dateFormat = "yyyy-MM-dd"
}
return dateFormatter.string(from: date)
}
} }
...@@ -33,7 +33,8 @@ class YHMessageSessionCell: UITableViewCell { ...@@ -33,7 +33,8 @@ class YHMessageSessionCell: UITableViewCell {
func updateModel(_ model: YHMessageInfoModel) { func updateModel(_ model: YHMessageInfoModel) {
self.nameLabel.text = model.getTitle() self.nameLabel.text = model.getTitle()
self.iconContentView.backgroundColor = UIColor(hex: 0xF4F6FA)
if model.type == YHMessageType.yinheManager.rawValue { if model.type == YHMessageType.yinheManager.rawValue {
self.iconImgView.image = UIImage(named: "msg_icon_yinhe_manager") self.iconImgView.image = UIImage(named: "msg_icon_yinhe_manager")
...@@ -63,6 +64,11 @@ class YHMessageSessionCell: UITableViewCell { ...@@ -63,6 +64,11 @@ class YHMessageSessionCell: UITableViewCell {
} else if model.type == YHMessageType.business.rawValue { } else if model.type == YHMessageType.business.rawValue {
self.iconImgView.image = UIImage(named: "msg_icon_business") self.iconImgView.image = UIImage(named: "msg_icon_business")
} else if model.type == YHMessageType.article.rawValue {
self.iconImgView.image = UIImage(named: "msg_icon_news")
self.iconContentView.backgroundColor = UIColor(hex: 0xF0F5FF)
} }
self.badgeLabel.isHidden = model.unreadCount <= 0 self.badgeLabel.isHidden = model.unreadCount <= 0
......
...@@ -10,6 +10,7 @@ import UIKit ...@@ -10,6 +10,7 @@ import UIKit
import SmartCodable import SmartCodable
let kMsgPageSize = 30 let kMsgPageSize = 30
let kNewsPageSize = 10
class YHMsgViewModel: NSObject { class YHMsgViewModel: NSObject {
...@@ -17,6 +18,9 @@ class YHMsgViewModel: NSObject { ...@@ -17,6 +18,9 @@ class YHMsgViewModel: NSObject {
var msgDetailList: [YHDetailMessageModel] = [] var msgDetailList: [YHDetailMessageModel] = []
var unreadTotalCount: Int = 0 var unreadTotalCount: Int = 0
var newsList: YHNewsListModel = YHNewsListModel()
var newsDetailList: [YHNewsModel] = []
func getUnreadMsgList(_ callBackBlock: @escaping (_ success: Bool, _ error: YHErrorModel?) -> Void) { func getUnreadMsgList(_ callBackBlock: @escaping (_ success: Bool, _ error: YHErrorModel?) -> Void) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Message.unreadMsgListApi let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Message.unreadMsgListApi
...@@ -40,6 +44,7 @@ class YHMsgViewModel: NSObject { ...@@ -40,6 +44,7 @@ class YHMsgViewModel: NSObject {
self.msgList.goToHK.type = YHMessageType.goToHK.rawValue self.msgList.goToHK.type = YHMessageType.goToHK.rawValue
self.msgList.renewal.type = YHMessageType.renewal.rawValue self.msgList.renewal.type = YHMessageType.renewal.rawValue
self.msgList.business.type = YHMessageType.business.rawValue self.msgList.business.type = YHMessageType.business.rawValue
self.msgList.article.type = YHMessageType.article.rawValue
callBackBlock(true, nil) callBackBlock(true, nil)
} else { } else {
let error: YHErrorModel = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg) let error: YHErrorModel = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg)
...@@ -183,4 +188,52 @@ class YHMsgViewModel: NSObject { ...@@ -183,4 +188,52 @@ class YHMsgViewModel: NSObject {
} }
} }
func getNewsDetailList(type: Int, page: Int, _ callBackBlock: @escaping (_ success: Bool, _ isLastPage: Bool) -> Void) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Message.newsListApi
let params = ["type": type,
"page": page,
"page_size": kNewsPageSize]
_ = YHNetRequest.postRequest(url: strUrl, params: params) { json, _ in
guard let dic = json.data?.peel as? [String: Any], let totalPage = dic["page_count"] as? Int, let arrDict = dic["list"] as? [Any] else {
callBackBlock(false, false)
return
}
if json.code == 200 {
DispatchQueue.global().async {
guard let arr = [YHNewsModel].deserialize(from: arrDict) else {
DispatchQueue.main.async {
let error = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
self.newsDetailList = []
callBackBlock(false, false)
}
return
}
DispatchQueue.main.async {
if page == 1 {
self.newsDetailList.removeAll()
}
for item in arr {
self.newsDetailList.append(item)
}
let currentPage = (self.newsDetailList.count+kNewsPageSize-1)/kNewsPageSize
callBackBlock(true, currentPage == totalPage)
}
}
} else {
self.newsDetailList = []
let error: YHErrorModel = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg)
callBackBlock(false, false)
}
} failBlock: { _ in
self.newsDetailList = []
callBackBlock(false, false)
}
}
} }
...@@ -194,7 +194,7 @@ class YHMemberCenterViewController: YHBaseViewController, UIGestureRecognizerDel ...@@ -194,7 +194,7 @@ class YHMemberCenterViewController: YHBaseViewController, UIGestureRecognizerDel
func appendMenu(_ giftModel: YHMemberGiftModel) { func appendMenu(_ giftModel: YHMemberGiftModel) {
if memberCenterInfo.currentLevel < giftModel.minLevel { if memberCenterInfo.currentLevel < giftModel.minLevel {
let minLevel = YHMembershipLevel(rawValue: giftModel.minLevel) ?? .normal let minLevel = YHMembershipLevel(rawValue: giftModel.minLevel) ?? .normal
details.append("本月剩余兑换数量\(giftModel.num)") details.append("可供兑换剩余库存\(giftModel.num)")
buttonTitles.append("\(minLevel.description)可兑") buttonTitles.append("\(minLevel.description)可兑")
buttonStates.append(.memberOnly) buttonStates.append(.memberOnly)
} else if giftModel.num <= 0 { } else if giftModel.num <= 0 {
...@@ -202,7 +202,7 @@ class YHMemberCenterViewController: YHBaseViewController, UIGestureRecognizerDel ...@@ -202,7 +202,7 @@ class YHMemberCenterViewController: YHBaseViewController, UIGestureRecognizerDel
buttonTitles.append("暂无库存") buttonTitles.append("暂无库存")
buttonStates.append(.outOfStock) buttonStates.append(.outOfStock)
} else { } else {
details.append("本月剩余兑换数量\(giftModel.num)") details.append("可供兑换剩余库存\(giftModel.num)")
buttonTitles.append("了解更多") buttonTitles.append("了解更多")
buttonStates.append(.redeemable) buttonStates.append(.redeemable)
} }
......
...@@ -17,7 +17,7 @@ class YHAnalytics { ...@@ -17,7 +17,7 @@ class YHAnalytics {
#if DEBUG #if DEBUG
let options = SAConfigOptions.init(serverURL: YhConstant.SensorsAnalytics.urlForTest, launchOptions: launchOptions) let options = SAConfigOptions.init(serverURL: YhConstant.SensorsAnalytics.urlForTest, launchOptions: launchOptions)
// 开启log // 开启log
options.enableLog = true options.enableLog = false
SensorsAnalyticsSDK.sharedInstance()?.set(["evn": "test"]) SensorsAnalyticsSDK.sharedInstance()?.set(["evn": "test"])
#elseif TESTENV #elseif TESTENV
let options = SAConfigOptions.init(serverURL: YhConstant.SensorsAnalytics.urlForTest, launchOptions: launchOptions) let options = SAConfigOptions.init(serverURL: YhConstant.SensorsAnalytics.urlForTest, launchOptions: launchOptions)
......
...@@ -437,6 +437,8 @@ class YHAllApiName { ...@@ -437,6 +437,8 @@ class YHAllApiName {
static let unreadTotalCountApi = "infoflow/unread-total" static let unreadTotalCountApi = "infoflow/unread-total"
// 报备设备信息 // 报备设备信息
static let reportDeviceInfoApi = "infoflow/report-device-info" static let reportDeviceInfoApi = "infoflow/report-device-info"
// 银河资讯列表
static let newsListApi = "infoflow/message/article-list/v2"
} }
// 人脉 // 人脉
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Message_yinhezixun@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Message_yinhezixun@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "Group 2033194705@2x.png", "filename" : "Group 2033195498@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "Group 2033194705@3x.png", "filename" : "Group 2033195498@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "2@2x.png", "filename" : "图片替换@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "3@3x.png", "filename" : "图片替换@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment