Commit 48e5143f authored by David黄金龙's avatar David黄金龙

Merge branch 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into develop

* 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS:
  //  搜索
  // 消息
  服务中心
parents 0f3f59fb 2d71117c
...@@ -2960,7 +2960,7 @@ ...@@ -2960,7 +2960,7 @@
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 5; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
...@@ -2980,7 +2980,7 @@ ...@@ -2980,7 +2980,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 0.2.9; MARKETING_VERSION = 0.2.10;
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 = "";
...@@ -3161,7 +3161,7 @@ ...@@ -3161,7 +3161,7 @@
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 5; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
...@@ -3181,7 +3181,7 @@ ...@@ -3181,7 +3181,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 0.2.9; MARKETING_VERSION = 0.2.10;
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 = "";
...@@ -3203,7 +3203,7 @@ ...@@ -3203,7 +3203,7 @@
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 5; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
...@@ -3223,7 +3223,7 @@ ...@@ -3223,7 +3223,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 0.2.9; MARKETING_VERSION = 0.2.10;
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 = "";
......
...@@ -134,7 +134,7 @@ extension AppDelegate { ...@@ -134,7 +134,7 @@ extension AppDelegate {
v0.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "首页", image: UIImage(named: "home"), selectedImage: UIImage(named: "home_1")) v0.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "首页", image: UIImage(named: "home"), selectedImage: UIImage(named: "home_1"))
v1.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "服务中心", image: UIImage(named: "service"), selectedImage: UIImage(named: "service_1")) v1.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "服务", image: UIImage(named: "service"), selectedImage: UIImage(named: "service_1"))
v2.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "消息", image: UIImage(named: "msg"), selectedImage: UIImage(named: "msg_1")) v2.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "消息", image: UIImage(named: "msg"), selectedImage: UIImage(named: "msg_1"))
......
...@@ -202,11 +202,17 @@ class YHSearchInfomationVC: YHBaseViewController { ...@@ -202,11 +202,17 @@ class YHSearchInfomationVC: YHBaseViewController {
searchHistoryView.isHidden = true searchHistoryView.isHidden = true
self.tableView.reloadData() self.tableView.reloadData()
tableView.es.stopPullToRefresh() tableView.es.stopPullToRefresh()
// 只有一页的时候不展示没有更多数据了
if self.viewModel.totalCount < self.viewModel.searchPageSize { // 不足一页
tableView.footer?.isHidden = true
} else {
tableView.footer?.isHidden = false
if self.viewModel.hasMoreForHomeNews == false { if self.viewModel.hasMoreForHomeNews == false {
tableView.es.noticeNoMoreData() tableView.es.noticeNoMoreData()
} }
} }
} }
}
func loadMoreData() { func loadMoreData() {
viewModel.searchArticleList(self.searchStr, isFirstPage : false) { viewModel.searchArticleList(self.searchStr, isFirstPage : false) {
...@@ -221,11 +227,17 @@ class YHSearchInfomationVC: YHBaseViewController { ...@@ -221,11 +227,17 @@ class YHSearchInfomationVC: YHBaseViewController {
searchHistoryView.isHidden = true searchHistoryView.isHidden = true
self.tableView.reloadData() self.tableView.reloadData()
tableView.es.stopLoadingMore() tableView.es.stopLoadingMore()
// 只有一页的时候不展示没有更多数据了
if self.viewModel.totalCount < self.viewModel.searchPageSize { // 不足一页
tableView.footer?.isHidden = true
} else {
tableView.footer?.isHidden = false
if self.viewModel.hasMoreForHomeNews == false { if self.viewModel.hasMoreForHomeNews == false {
tableView.es.noticeNoMoreData() tableView.es.noticeNoMoreData()
} }
} }
} }
}
func loadFirstData() { func loadFirstData() {
...@@ -241,11 +253,17 @@ class YHSearchInfomationVC: YHBaseViewController { ...@@ -241,11 +253,17 @@ class YHSearchInfomationVC: YHBaseViewController {
searchHistoryView.isHidden = true searchHistoryView.isHidden = true
self.tableView.reloadData() self.tableView.reloadData()
tableView.es.stopPullToRefresh() tableView.es.stopPullToRefresh()
// 只有一页的时候不展示没有更多数据了
if self.viewModel.totalCount < self.viewModel.searchPageSize { // 不足一页
tableView.footer?.isHidden = true
} else {
tableView.footer?.isHidden = false
if self.viewModel.hasMoreForHomeNews == false { if self.viewModel.hasMoreForHomeNews == false {
tableView.es.noticeNoMoreData() tableView.es.noticeNoMoreData()
} }
} }
} }
}
func getSearchHistoryList() -> [String] { func getSearchHistoryList() -> [String] {
if let arr = UserDefaults.standard.array(forKey: Self.searchInfoHistoryKey) as? [String] { if let arr = UserDefaults.standard.array(forKey: Self.searchInfoHistoryKey) as? [String] {
......
...@@ -107,7 +107,7 @@ private extension YHStartPageViewController { ...@@ -107,7 +107,7 @@ private extension YHStartPageViewController {
v0.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "首页", image: UIImage(named: "home"), selectedImage: UIImage(named: "home_1")) v0.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "首页", image: UIImage(named: "home"), selectedImage: UIImage(named: "home_1"))
v1.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "服务中心", image: UIImage(named: "service"), selectedImage: UIImage(named: "service_1")) v1.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "服务", image: UIImage(named: "service"), selectedImage: UIImage(named: "service_1"))
v2.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "消息", image: UIImage(named: "msg"), selectedImage: UIImage(named: "msg_1")) v2.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "消息", image: UIImage(named: "msg"), selectedImage: UIImage(named: "msg_1"))
......
...@@ -81,8 +81,8 @@ class YHSearchInfoHistoryView: UIView { ...@@ -81,8 +81,8 @@ class YHSearchInfoHistoryView: UIView {
func getwith(font: UIFont, height: CGFloat, string: String) -> CGSize { func getwith(font: UIFont, height: CGFloat, string: String) -> CGSize {
let size = CGSize.init(width: CGFloat(MAXFLOAT), height: height) let size = CGSize.init(width: CGFloat(MAXFLOAT), height: height)
let dic = [NSAttributedString.Key.font: font] // swift 4.2 let dic = [NSAttributedString.Key.font: font] // swift 4.2
let strSize = string.boundingRect(with: size, options: [.usesLineFragmentOrigin], attributes: dic, context:nil).size var strSize = string.boundingRect(with: size, options: [.usesLineFragmentOrigin], attributes: dic, context:nil).size
return strSize return CGSizeMake(ceil(strSize.width), strSize.height)
} }
} }
...@@ -99,8 +99,8 @@ extension YHSearchInfoHistoryView: UICollectionViewDelegate, UICollectionViewDat ...@@ -99,8 +99,8 @@ extension YHSearchInfoHistoryView: UICollectionViewDelegate, UICollectionViewDat
let size = self.getwith(font: UIFont.systemFont(ofSize: 12), height: 24, string: historyItems[indexPath.item]) let size = self.getwith(font: UIFont.systemFont(ofSize: 12), height: 24, string: historyItems[indexPath.item])
var width = size.width + gap*2.0 var width = size.width + gap*2.0
if width > collectionView.width { if width > 226.0 {
width = collectionView.width width = 226.0
} }
return CGSize(width: width, height: cellHeight) return CGSize(width: width, height: cellHeight)
} }
......
...@@ -18,8 +18,10 @@ class YHHomePageViewModel : YHBaseViewModel { ...@@ -18,8 +18,10 @@ class YHHomePageViewModel : YHBaseViewModel {
//首页相关参数 //首页相关参数
private var curPageIndex : Int = 1 private var curPageIndex : Int = 1
private var page_Size : Int = 6 private var page_Size : Int = 6
private var totalCount : Int = 0 var totalCount : Int = 0
var hasMoreForHomeNews : Bool = true var hasMoreForHomeNews : Bool = true
// 搜索
let searchPageSize: Int = 10
} }
//接口 //接口
...@@ -261,11 +263,11 @@ extension YHHomePageViewModel { ...@@ -261,11 +263,11 @@ extension YHHomePageViewModel {
if isFirstPage { if isFirstPage {
params = ["page": 1, params = ["page": 1,
"page_size": 10, "page_size": searchPageSize,
"title": title] "title": title]
} else { } else {
params = ["page": curPageIndex + 1, params = ["page": curPageIndex + 1,
"page_size": 10, "page_size": searchPageSize,
"title": title] "title": title]
} }
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Common.article let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Common.article
......
...@@ -85,8 +85,7 @@ extension YHServiceCenterMainViewController { ...@@ -85,8 +85,7 @@ extension YHServiceCenterMainViewController {
} }
func setupUI() { func setupUI() {
title = "服务中心" gk_navTitle = "服务"
gk_navTitle = "服务中心"
gk_navBarAlpha = 1.0 gk_navBarAlpha = 1.0
loginTipsView.clickLoginBtnCallBackBlock = { loginTipsView.clickLoginBtnCallBackBlock = {
......
...@@ -40,7 +40,7 @@ class YHInformationFillVC: YHBaseViewController { ...@@ -40,7 +40,7 @@ class YHInformationFillVC: YHBaseViewController {
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped) let tableView = UITableView(frame:.zero, style:.grouped)
tableView.sectionHeaderHeight = 46.0 tableView.estimatedSectionHeaderHeight = 1.0
tableView.estimatedSectionFooterHeight = 1.0 tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none tableView.separatorStyle = .none
...@@ -96,12 +96,8 @@ class YHInformationFillVC: YHBaseViewController { ...@@ -96,12 +96,8 @@ class YHInformationFillVC: YHBaseViewController {
extension YHInformationFillVC: UITableViewDelegate, UITableViewDataSource { extension YHInformationFillVC: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return msgArr.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1 return msgArr.count
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
...@@ -119,7 +115,7 @@ extension YHInformationFillVC: UITableViewDelegate, UITableViewDataSource { ...@@ -119,7 +115,7 @@ extension YHInformationFillVC: UITableViewDelegate, UITableViewDataSource {
} }
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat { private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 46.0 return 1.0
} }
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat { private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
...@@ -133,17 +129,7 @@ extension YHInformationFillVC: UITableViewDelegate, UITableViewDataSource { ...@@ -133,17 +129,7 @@ extension YHInformationFillVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView() return UIView()
let label = UILabel()
label.textColor = UIColor(hex: 0x121A26, alpha: 0.3)
label.textAlignment = .center
label.font = UIFont.PFSC_R(ofSize:12)
label.text = "2023-09-13"
view.addSubview(label)
label.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
return view
} }
} }
......
...@@ -176,7 +176,7 @@ extension YHMsgViewController: UITableViewDelegate, UITableViewDataSource { ...@@ -176,7 +176,7 @@ extension YHMsgViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
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]
let vc = YHInformationFillVC() let vc = YHInformationFillVC()
vc.type = msgItem.type vc.type = msgItem.type
......
...@@ -20,6 +20,7 @@ class YHInformationFillCell: UITableViewCell { ...@@ -20,6 +20,7 @@ class YHInformationFillCell: UITableViewCell {
var unreadPointView:UIView! var unreadPointView:UIView!
var bottomBtn:UIButton! var bottomBtn:UIButton!
var lineView:UIView! var lineView:UIView!
var timeLabel:UILabel!
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
super.init(coder: coder) super.init(coder: coder)
...@@ -30,11 +31,50 @@ class YHInformationFillCell: UITableViewCell { ...@@ -30,11 +31,50 @@ class YHInformationFillCell: UITableViewCell {
setupUI() setupUI()
} }
func updateModel(_ model: YHDetailMessageModel) {
titleLabel.text = model.title
detailLabel.text = model.content
unreadPointView.isHidden = model.isRead
timeLabel.text = formatTimestamp(Double(model.time))
}
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)
}
func setupUI() { func setupUI() {
self.selectionStyle = .none self.selectionStyle = .none
contentView.backgroundColor = UIColor(hex:0xF8F8F8) contentView.backgroundColor = UIColor(hex:0xF8F8F8)
timeLabel = UILabel()
timeLabel.textColor = UIColor(hex: 0x121A26, alpha: 0.3)
timeLabel.textAlignment = .center
timeLabel.font = UIFont.PFSC_R(ofSize:12)
timeLabel.text = "2023-09-13"
contentView.addSubview(timeLabel)
whiteView = UIView() whiteView = UIView()
whiteView.backgroundColor = .white whiteView.backgroundColor = .white
whiteView.layer.cornerRadius = 6.0 whiteView.layer.cornerRadius = 6.0
...@@ -71,10 +111,16 @@ class YHInformationFillCell: UITableViewCell { ...@@ -71,10 +111,16 @@ class YHInformationFillCell: UITableViewCell {
bottomBtn.addTarget(self, action: #selector(didBottomBtnClicked), for: .touchUpInside) bottomBtn.addTarget(self, action: #selector(didBottomBtnClicked), for: .touchUpInside)
whiteView.addSubview(bottomBtn) whiteView.addSubview(bottomBtn)
timeLabel.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(46.0)
}
whiteView.snp.makeConstraints { make in whiteView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16) make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16) make.right.equalToSuperview().offset(-16)
make.top.bottom.equalToSuperview() make.top.equalTo(timeLabel.snp.bottom)
make.bottom.equalToSuperview()
} }
titleLabel.snp.makeConstraints { make in titleLabel.snp.makeConstraints { make in
......
...@@ -21,34 +21,34 @@ class YHMsgViewModel: NSObject { ...@@ -21,34 +21,34 @@ class YHMsgViewModel: NSObject {
var dic = json.data var dic = json.data
var json = json // var json = json
json.code = 200 // json.code = 200
dic = [ // dic = [
"information": [ // "information": [
"unread_count": 0, // "unread_count": 0,
"last_message": "阿法守法所发生的法师打发", // "last_message": "阿法守法所发生的法师打发",
"last_message_time": 1586507545, // "last_message_time": 1586507545,
"type": 0 // "type": 0
], // ],
"certificate": [ // "certificate": [
"unread_count": 3, // "unread_count": 3,
"last_message": "发生发顺丰大声道发生大发萨法沙发沙发沙发沙发阿斯顿发生发顺丰阿凡达放大第三方", // "last_message": "发生发顺丰大声道发生大发萨法沙发沙发沙发沙发阿斯顿发生发顺丰阿凡达放大第三方",
"last_message_time": 1586507545, // "last_message_time": 1586507545,
"type": 0 // "type": 0
], // ],
"draft": [ // "draft": [
"unread_count": 100, // "unread_count": 100,
"last_message": "发生发顺丰大声道发生大发", // "last_message": "发生发顺丰大声道发生大发",
"last_message_time": 1712737945, // "last_message_time": 1712737945,
"type": 0 // "type": 0
], // ],
"signature": [ // "signature": [
"unread_count": 87, // "unread_count": 87,
"last_message": "发生发", // "last_message": "发生发",
"last_message_time": 1713236425, // "last_message_time": 1713236425,
"type": 0 // "type": 0
] // ]
] // ]
printLog("model 是 ==> \(json)") printLog("model 是 ==> \(json)")
if json.code == 200 { if json.code == 200 {
......
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