Commit 1334471c authored by Steven杜宇's avatar Steven杜宇

Merge branch 'HIGH' into 'develop'

High

See merge request !11
parents b83e48b8 e42167d3
......@@ -34,7 +34,7 @@ platform :ios do
main_fix = "main-fix"
jiaofei = "jiaofei"
plan = "4.25-1"
push = "push"
push = "HIGH"
#打包正使用的分支
myPack_branch = push
......
......@@ -1275,6 +1275,7 @@
04E507D62D6EE856005F758B /* YHUserLevelAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E507D52D6EE856005F758B /* YHUserLevelAlertView.swift */; };
04EA376D2BEA06EF00DBAF64 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04EA376C2BEA06EF00DBAF64 /* WebKit.framework */; };
04EA376F2BEA071600DBAF64 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 04EA376E2BEA070500DBAF64 /* libc++.tbd */; };
04F1924D2DE0125B004BDAAC /* YHNewsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F1924C2DE0125B004BDAAC /* YHNewsModel.swift */; };
6203A87EDC96313BBE789D9C /* Pods_galaxy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */; };
A5573EE92B317C0100D98EC0 /* galaxyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5573EE82B317C0100D98EC0 /* galaxyTests.swift */; };
A5573EF32B317C0100D98EC0 /* galaxyUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5573EF22B317C0100D98EC0 /* galaxyUITests.swift */; };
......@@ -2587,6 +2588,7 @@
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; };
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>"; };
19B28612265782F9DC1BE0B0 /* Pods-galaxy.testenv.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.testenv.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.testenv.xcconfig"; sourceTree = "<group>"; };
58C2405158A4A6632D0E7460 /* Pods-galaxy.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.debug.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.debug.xcconfig"; sourceTree = "<group>"; };
......@@ -5789,6 +5791,7 @@
isa = PBXGroup;
children = (
045C0EC62D12CA5E00BD2DC0 /* YHMsgListModel.swift */,
04F1924C2DE0125B004BDAAC /* YHNewsModel.swift */,
);
path = M;
sourceTree = "<group>";
......@@ -7915,6 +7918,7 @@
045C121F2D12CA5F00BD2DC0 /* YHCertificateTemplateSheetView.swift in Sources */,
045C12202D12CA5F00BD2DC0 /* YHResignMaterialListVC.swift in Sources */,
045C12212D12CA5F00BD2DC0 /* YHResignUploadTravelPassportTableViewCell.swift in Sources */,
04F1924D2DE0125B004BDAAC /* YHNewsModel.swift in Sources */,
045C12222D12CA5F00BD2DC0 /* YHResignCertificatePassportTableViewCell.swift in Sources */,
045C12232D12CA5F00BD2DC0 /* YHIncomeRecordItemCell.swift in Sources */,
045C12242D12CA5F00BD2DC0 /* YHAdopterResidentViewController.swift in Sources */,
......@@ -8494,7 +8498,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxyTestEnv.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
......@@ -8521,7 +8525,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.2.3;
MARKETING_VERSION = 2.2.4;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......@@ -8642,7 +8646,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
......@@ -8669,7 +8673,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.2.3;
MARKETING_VERSION = 2.2.4;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......@@ -8852,7 +8856,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxyDebug.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
......@@ -8879,7 +8883,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.2.3;
MARKETING_VERSION = 2.2.4;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......@@ -8902,7 +8906,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
......@@ -8929,7 +8933,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.2.3;
MARKETING_VERSION = 2.2.4;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......
......@@ -22,6 +22,8 @@ import HyphenateChat
@main
class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
private lazy var liveViewModel = YHLiveSalesViewModel()
let viewModel = YHMsgViewModel()
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
......
......@@ -33,7 +33,7 @@ extension AppDelegate: JPUSHRegisterDelegate {
#if DEBUG
let isProduction = false
#elseif TESTENV
let isProduction = true
let isProduction = false
#else
let isProduction = true
#endif
......@@ -118,6 +118,21 @@ extension AppDelegate: JPUSHRegisterDelegate {
YHLoginManager.shared.needJumpToMsgTabFlag = true
DispatchQueue.main.asyncAfter(deadline: .now() + 0.25, execute: {
goToMessagePage()
if let msgType = userInfo["msg_type"] as? Int, msgType == YHMessageType.article.rawValue {
let model = YHNewsModel()
let taskId = userInfo["task_id"] as? Int ?? 0
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 ?? ""
printLog("DDDDY: \(model.id)")
yh_newsList.enterDetail(model)
self.viewModel.readMessage(taskId: taskId) { _, _ in
}
}
})
}
......
......@@ -12,6 +12,7 @@ import IQKeyboardManagerSwift
class YHAITabViewController: YHBaseViewController, UIGestureRecognizerDelegate {
var viewDidAppear: Bool = false
var defaltIndex: Int = 0
let viewModel = YHAIViewModel()
......@@ -110,34 +111,27 @@ class YHAITabViewController: YHBaseViewController, UIGestureRecognizerDelegate {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// 处于第一个item的时候,才允许屏幕边缘手势返回
self.navigationController?.interactivePopGestureRecognizer?.isEnabled = (self.segmentedView.selectedIndex == 0)
self.gk_interactivePopDisabled = (self.segmentedView.selectedIndex != 0)
self.gk_fullScreenPopDisabled = (self.segmentedView.selectedIndex != 0)
requestList()
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
viewDidAppear = true
self.navigationController?.interactivePopGestureRecognizer?.isEnabled = (self.segmentedView.selectedIndex == 0)
self.gk_interactivePopDisabled = (self.segmentedView.selectedIndex != 0)
self.gk_fullScreenPopDisabled = (self.segmentedView.selectedIndex != 0)
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
viewDidAppear = false
// 离开页面的时候,需要恢复屏幕边缘手势,不能影响其他页面
self.navigationController?.interactivePopGestureRecognizer?.isEnabled = true
self.gk_interactivePopDisabled = false
self.gk_fullScreenPopDisabled = false
}
override func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
if self.segmentedView.selectedIndex == 0 {
self.gk_interactivePopDisabled = false
self.gk_fullScreenPopDisabled = false
return true
if gestureRecognizer == navigationController?.interactivePopGestureRecognizer {
if viewDidAppear {
return self.segmentedView.selectedIndex == 0
}
}
return false
}
......@@ -281,8 +275,6 @@ extension YHAITabViewController: JXSegmentedViewDelegate {
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
self.navigationController?.interactivePopGestureRecognizer?.isEnabled = (self.segmentedView.selectedIndex == 0)
self.gk_interactivePopDisabled = (self.segmentedView.selectedIndex != 0)
self.gk_fullScreenPopDisabled = (self.segmentedView.selectedIndex != 0)
if segmentedView.selectedIndex == 1 { // AI对话
bgImgView.isHidden = false
......
......@@ -49,6 +49,9 @@ class YHOrderTipsItemView: UIView {
} else if msg.type == YHMessageType.business.rawValue {
return "银河商务"
} else if msg.type == YHMessageType.article.rawValue {
return "银河资讯"
} else {
return "--"
}
......
......@@ -341,8 +341,12 @@ extension YHServiceCenterViewController {
self.homeTableView.tableHeaderView = UIView()
if self.model.product_type == 1 {
self.titleLabel.setTitle("优才审批阶段", for: .normal)
} else {
} else if self.model.product_type == 2 {
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)
}
......@@ -362,8 +366,12 @@ extension YHServiceCenterViewController {
self.headView.dataSource = self.serviceCenterMainReqVM.mainModel.renewalSection.list
if self.model.product_type == 1 {
self.titleLabel.setTitle("优才续签阶段", for: .normal)
} else {
} else if self.model.product_type == 2 {
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.isCanSelectStep = true
......@@ -413,8 +421,12 @@ extension YHServiceCenterViewController {
self.homeTableView.tableHeaderView = UIView()
if self.model.product_type == 1 {
self.titleLabel.setTitle("优才申请阶段", for: .normal)
} else {
} else if self.model.product_type == 2 {
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)
}
......@@ -423,8 +435,12 @@ extension YHServiceCenterViewController {
self.homeTableView.tableHeaderView = UIView()
if self.model.product_type == 1 {
self.titleLabel.setTitle("优才审批阶段", for: .normal)
} else {
} else if self.model.product_type == 2 {
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 {
self.titleLabel.setImage(UIImage(named: "service_center_select_step"), for: .normal)
......@@ -448,8 +464,12 @@ extension YHServiceCenterViewController {
self.headView.dataSource = self.serviceCenterMainReqVM.mainModel.renewalSection.list
if self.model.product_type == 1 {
self.titleLabel.setTitle("优才续签阶段", for: .normal)
} else {
} else if self.model.product_type == 2 {
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)
}
......
......@@ -18,7 +18,7 @@ struct YHContactItemModel: SmartCodable {
var type: String = ""
var mobile: String = ""
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 service_name: String = ""
}
......@@ -73,8 +73,8 @@ class YHServiceSelectAlertView: UICollectionViewCell {
lazy var titleLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
let a: ASAttributedString = .init("期望银河在", .font(UIFont.PFSC_B(ofSize: 18)), .foreground(UIColor.mainTextColor))
let b: ASAttributedString = .init("审批阶段", .font(UIFont.PFSC_B(ofSize: 18)), .foreground(UIColor.brandMainColor))
let a: ASAttributedString = .init("期望银河在您的", .font(UIFont.PFSC_B(ofSize: 18)), .foreground(UIColor.mainTextColor))
let b: ASAttributedString = .init("香港新生活", .font(UIFont.PFSC_B(ofSize: 18)), .foreground(UIColor.brandMainColor))
let c: ASAttributedString = .init("\n提供哪些服务", .font(UIFont.PFSC_B(ofSize: 18)), .foreground(UIColor.mainTextColor))
label.attributed.text = a+b+c
return label
......
......@@ -344,10 +344,14 @@ private extension YHTravelDocsPreparationDetailVC {
var cerArr: [[String: Any]] = []
for item in sectionItems {
if item.type == .certificate {
var imageback = item.cerDetailModel.img_back
if self.type == .chinesePassPort || self.type == .forignPassPort {
imageback = ""
}
let dic: [String: Any] = [
"type": item.cerDetailModel.type,
"img_front": item.cerDetailModel.img_front,
"img_back": item.cerDetailModel.img_back,
"img_back": imageback,
"issue_start": item.cerDetailModel.issue_start,
"issue_end": item.cerDetailModel.issue_end
]
......
......@@ -46,6 +46,7 @@ class YHOfficialApprovalResultVC: YHBaseViewController {
// 文档内容
lazy var contentView: YHOffivialApprovalSuccessView = {
let view = YHOffivialApprovalSuccessView()
view.orderTypeString = orderTypeString
// view.isHidden = true
return view
}()
......@@ -138,6 +139,18 @@ class YHOfficialApprovalResultVC: YHBaseViewController {
// 是否来着首页的弹窗
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 = {
let tool = YHFilePreviewTool(targetVC: UIViewController.current)
......@@ -205,6 +218,7 @@ private extension YHOfficialApprovalResultVC {
let view = YHOffivialApprovalSuccessCheckView.sheetView()
view.days = self.princleVM.lettersModel?.days ?? 0
view.orderType = self.orderType
view.show()
view.block = { tag in
......
......@@ -97,6 +97,18 @@ class YHOffivialApprovalSuccessCheckView: UIView {
lastText = "从递交资料伊始,经历了" + String(days) + "天,感谢您这一路以来对银河的信赖与包容!"
}
}
var orderType: Int = 1 {
didSet {
if orderType == 1 {
fullText = "恭喜您申请的【优秀人才入境计划】"
} else if orderType == 2 {
fullText = "恭喜您申请的【高才通人才计划】"
} else if orderType == 3 {
fullText = "恭喜您申请的【输入内地人才入境计划】"
}
}
}
}
extension YHOffivialApprovalSuccessCheckView {
......
......@@ -19,7 +19,7 @@ class YHOffivialApprovalSuccessView: UIView {
private var titleLabel: UILabel!
private var arrViews: [UIView] = []
var orderTypeString: String = "优秀人才入境计划"
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
......@@ -100,13 +100,13 @@ private extension YHOffivialApprovalSuccessView {
let arr = tmp.split(separator: "-")
if arr.count == 3 {
tmp = arr[0] + "年" + arr[1] + "月" + arr[2] + "日" + "正式获批"
let fourItems = ["祝贺您和您的家人申请的", "【优秀人才入境计划】", tmp, "这意味着,您领取香港居民身份证", "仅有一步之遥!!"]
let fourItems = ["祝贺您和您的家人申请的", "【\(orderTypeString)】", tmp, "这意味着,您领取香港居民身份证", "仅有一步之遥!!"]
updataView(data: fourItems)
}
} else {
titleLabel.text = "恭喜 客户!"
let tmp = "正式获批"
let fourItems = ["祝贺您和您的家人申请的", "【优秀人才入境计划】", tmp, "这意味着,您领取香港居民身份证", "仅有一步之遥!!"]
let fourItems = ["祝贺您和您的家人申请的", "【\(orderTypeString)】", tmp, "这意味着,您领取香港居民身份证", "仅有一步之遥!!"]
updataView(data: fourItems)
}
......
......@@ -27,7 +27,22 @@ class YHPrincipleWaitResultViewController: YHBaseViewController {
var status: Int = -1
var items: [YHPrincipleWaitResultModel] = []
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()
lazy var tableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .grouped)
......@@ -237,7 +252,7 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD
tipsLabel.numberOfLines = 0
tipsLabel.font = UIFont.PFSC_R(ofSize: 14)
tipsLabel.textColor = .mainTextColor(alpha: 0.7)
tipsLabel.text = "您的【优秀人才入境计划】赴港居留申请资料已经递交港府。"
tipsLabel.text = "您的【\(orderTypeString)】赴港居留申请资料已经递交港府。"
view.addSubview(tipsLabel)
let detailLabel = UILabel()
......@@ -287,7 +302,7 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD
// 14 未获批准~
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))
var str3: ASAttributedString = .init(",请您耐心等待!", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor(alpha: 0.7)))
if self.viewModel.waitResultModel.resultImageList.count > 0 {
......@@ -302,7 +317,7 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD
} 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 str3: ASAttributedString = .init("。具体详情以及后续处理方式,请您联系专属服务您的生活管家进行详细沟通", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor(alpha: 0.7)))
return str1 + str2 + str3
......
......@@ -8,9 +8,16 @@
import UIKit
let yh_newsList = YHGalaxyNewsListViewController()
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 = {
let tableView = UITableView(frame: .zero, style: .grouped)
......@@ -27,11 +34,18 @@ class YHGalaxyNewsListViewController: YHBaseViewController {
tableView.backgroundView = emptyDataTipsView
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHGalaxyNewsCell.self, forCellReuseIdentifier: YHGalaxyNewsCell.cellReuseIdentifier)
tableView.es.addYHPullToRefresh {
self.getMsgList(more: false)
}
tableView.es.addInfiniteScrolling {
self.getMsgList(more: true)
}
return tableView
}()
lazy var emptyDataTipsView: YHEmptyDataView = {
let view = YHEmptyDataView.createView("暂无消息", kEmptyMessageBgName)
let view = YHEmptyDataView.createView("暂无资讯", kEmptyMessageBgName)
let topMargin = 310-k_Height_NavigationtBarAndStatuBar
view.topMargin = topMargin
view.isHidden = true
......@@ -50,20 +64,132 @@ class YHGalaxyNewsListViewController: YHBaseViewController {
view.backgroundColor = .init(hex: 0xF8F9FB)
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalToSuperview()
}
getMsgList()
}
@objc func didCleanBtnClicked() {
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 {
......@@ -77,7 +203,7 @@ extension YHGalaxyNewsListViewController: UITableViewDelegate, UITableViewDataSo
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHGalaxyNewsCell.cellReuseIdentifier, for: indexPath) as? YHGalaxyNewsCell else { return UITableViewCell() }
if 0 <= indexPath.row && indexPath.row < newsArr.count {
let item = newsArr[indexPath.row]
cell.updateModel(item)
}
return cell
}
......@@ -87,7 +213,11 @@ extension YHGalaxyNewsListViewController: UITableViewDelegate, UITableViewDataSo
}
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 {
......
......@@ -177,7 +177,6 @@ class YHMessageListVC: YHBaseViewController {
@objc func getUnreadMsgList() {
if !YHLoginManager.shared.isLogin() {
// 保留第一个元素银河管家,删除其他元素
msgArr.removeAll()
self.tableView.reloadData()
emptyDataTipsView.isHidden = msgArr.count > 0
......@@ -205,6 +204,9 @@ class YHMessageListVC: YHBaseViewController {
msgArr.append(self.managerSession)
}
// 银河资讯
msgArr.append(self.viewModel.msgList.article)
if success {
var hasUnreadMsg = false
......@@ -437,13 +439,6 @@ extension YHMessageListVC: UITableViewDelegate, UITableViewDataSource {
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 {
let msgItem = msgArr[indexPath.row]
......@@ -464,6 +459,12 @@ extension YHMessageListVC: UITableViewDelegate, UITableViewDataSource {
}
return
}
if msgItem.type == YHMessageType.article.rawValue { // 银河资讯
let vc = YHGalaxyNewsListViewController()
self.navigationController?.pushViewController(vc)
return
}
let vc = YHMessageDetailListVC()
vc.type = msgItem.type
vc.title = msgItem.getTitle()
......
......@@ -20,6 +20,7 @@ enum YHMessageType: Int {
case goToHK = 7 // 赴港办证
case renewal = 8 // 身份续签
case business = 9 // 商务
case article = 10 // 资讯
case yinheManager = 9527 // 银河管家
}
......@@ -73,6 +74,9 @@ class YHMessageInfoModel: SmartCodable {
} else if type == YHMessageType.business.rawValue {
return "银河商务"
} else if type == YHMessageType.article.rawValue {
return "银河资讯"
}
return ""
}
......@@ -88,6 +92,7 @@ class YHMsgListModel: SmartCodable {
var goToHK: YHMessageInfoModel = YHMessageInfoModel()
var renewal: YHMessageInfoModel = YHMessageInfoModel()
var business: YHMessageInfoModel = YHMessageInfoModel()
var article: YHMessageInfoModel = YHMessageInfoModel()
required init() {
self.information.type = YHMessageType.infoFill.rawValue
......@@ -99,10 +104,11 @@ class YHMsgListModel: SmartCodable {
self.goToHK.type = YHMessageType.goToHK.rawValue
self.renewal.type = YHMessageType.renewal.rawValue
self.business.type = YHMessageType.business.rawValue
self.article.type = YHMessageType.article.rawValue
}
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 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 {
lazy var coverImgV: UIImageView = {
let imgV = UIImageView()
imgV.contentMode = .scaleAspectFill
imgV.image = UIImage(named: "msg_news_cover_default")
imgV.clipsToBounds = true
return imgV
}()
......@@ -77,6 +79,16 @@ class YHGalaxyNewsCell: UITableViewCell {
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() {
self.selectionStyle = .none
......@@ -136,4 +148,29 @@ 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,6 +33,7 @@ class YHMessageSessionCell: UITableViewCell {
func updateModel(_ model: YHMessageInfoModel) {
self.nameLabel.text = model.getTitle()
self.iconContentView.backgroundColor = UIColor(hex: 0xF4F6FA)
if model.type == YHMessageType.yinheManager.rawValue {
self.iconImgView.image = UIImage(named: "msg_icon_yinhe_manager")
......@@ -63,6 +64,11 @@ class YHMessageSessionCell: UITableViewCell {
} else if model.type == YHMessageType.business.rawValue {
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
......
......@@ -10,6 +10,7 @@ import UIKit
import SmartCodable
let kMsgPageSize = 30
let kNewsPageSize = 10
class YHMsgViewModel: NSObject {
......@@ -17,6 +18,9 @@ class YHMsgViewModel: NSObject {
var msgDetailList: [YHDetailMessageModel] = []
var unreadTotalCount: Int = 0
var newsList: YHNewsListModel = YHNewsListModel()
var newsDetailList: [YHNewsModel] = []
func getUnreadMsgList(_ callBackBlock: @escaping (_ success: Bool, _ error: YHErrorModel?) -> Void) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Message.unreadMsgListApi
......@@ -40,6 +44,7 @@ class YHMsgViewModel: NSObject {
self.msgList.goToHK.type = YHMessageType.goToHK.rawValue
self.msgList.renewal.type = YHMessageType.renewal.rawValue
self.msgList.business.type = YHMessageType.business.rawValue
self.msgList.article.type = YHMessageType.article.rawValue
callBackBlock(true, nil)
} else {
let error: YHErrorModel = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg)
......@@ -135,6 +140,25 @@ class YHMsgViewModel: NSObject {
}
}
func readMessage(taskId: Int, _ callBackBlock: @escaping (_ success: Bool, _ error: YHErrorModel?) -> Void) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Message.readPushMsgApi
let params: [String: Any] = ["type": YHMessageType.article.rawValue,
"task_id": taskId]
_ = YHNetRequest.postRequest(url: strUrl, params: params) { json, _ in
printLog("model 是 ==> \(json)")
if json.code == 200 {
callBackBlock(true, nil)
} else {
let error: YHErrorModel = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { error in
callBackBlock(false, error)
}
}
func requestTotalUnreadMsgCount(_ callBackBlock: @escaping (_ success: Bool, _ error: YHErrorModel?) -> Void) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Message.unreadTotalCountApi
......@@ -183,4 +207,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
func appendMenu(_ giftModel: YHMemberGiftModel) {
if memberCenterInfo.currentLevel < giftModel.minLevel {
let minLevel = YHMembershipLevel(rawValue: giftModel.minLevel) ?? .normal
details.append("本月剩余兑换数量\(giftModel.num)")
details.append("可供兑换剩余库存\(giftModel.num)")
buttonTitles.append("\(minLevel.description)可兑")
buttonStates.append(.memberOnly)
} else if giftModel.num <= 0 {
......@@ -202,7 +202,7 @@ class YHMemberCenterViewController: YHBaseViewController, UIGestureRecognizerDel
buttonTitles.append("暂无库存")
buttonStates.append(.outOfStock)
} else {
details.append("本月剩余兑换数量\(giftModel.num)")
details.append("可供兑换剩余库存\(giftModel.num)")
buttonTitles.append("了解更多")
buttonStates.append(.redeemable)
}
......
......@@ -17,7 +17,7 @@ class YHAnalytics {
#if DEBUG
let options = SAConfigOptions.init(serverURL: YhConstant.SensorsAnalytics.urlForTest, launchOptions: launchOptions)
// 开启log
options.enableLog = true
options.enableLog = false
SensorsAnalyticsSDK.sharedInstance()?.set(["evn": "test"])
#elseif TESTENV
let options = SAConfigOptions.init(serverURL: YhConstant.SensorsAnalytics.urlForTest, launchOptions: launchOptions)
......
......@@ -433,10 +433,13 @@ class YHAllApiName {
static let msgDetaiListApi = "infoflow/message/list/v2"
// 标记消息已读
static let readMsgApi = "infoflow/read-push"
static let readPushMsgApi = "infoflow/read-push-from-bar"
// 获取未读消息总数
static let unreadTotalCountApi = "infoflow/unread-total"
// 报备设备信息
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 @@
"scale" : "1x"
},
{
"filename" : "Group 2033194705@2x.png",
"filename" : "Group 2033195498@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2033194705@3x.png",
"filename" : "Group 2033195498@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "2@2x.png",
"filename" : "图片替换@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "3@3x.png",
"filename" : "图片替换@3x.png",
"idiom" : "universal",
"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