Commit 56ca53e9 authored by Steven杜宇's avatar Steven杜宇

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

parents ee35fa3a 223ffa34
...@@ -8936,7 +8936,7 @@ ...@@ -8936,7 +8936,7 @@
CODE_SIGN_ENTITLEMENTS = yinheReplayExt/yinheReplayExt.entitlements; CODE_SIGN_ENTITLEMENTS = yinheReplayExt/yinheReplayExt.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 0; CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = RXHYW88XR7; DEVELOPMENT_TEAM = RXHYW88XR7;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = yinheReplayExt/Info.plist; INFOPLIST_FILE = yinheReplayExt/Info.plist;
...@@ -8966,7 +8966,7 @@ ...@@ -8966,7 +8966,7 @@
CODE_SIGN_ENTITLEMENTS = yinheReplayExt/yinheReplayExt.entitlements; CODE_SIGN_ENTITLEMENTS = yinheReplayExt/yinheReplayExt.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 0; CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = RXHYW88XR7; DEVELOPMENT_TEAM = RXHYW88XR7;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = yinheReplayExt/Info.plist; INFOPLIST_FILE = yinheReplayExt/Info.plist;
...@@ -8996,7 +8996,7 @@ ...@@ -8996,7 +8996,7 @@
CODE_SIGN_ENTITLEMENTS = yinheReplayExt/yinheReplayExt.entitlements; CODE_SIGN_ENTITLEMENTS = yinheReplayExt/yinheReplayExt.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 0; CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = RXHYW88XR7; DEVELOPMENT_TEAM = RXHYW88XR7;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = yinheReplayExt/Info.plist; INFOPLIST_FILE = yinheReplayExt/Info.plist;
...@@ -9026,7 +9026,7 @@ ...@@ -9026,7 +9026,7 @@
CODE_SIGN_ENTITLEMENTS = yinheReplayExt/yinheReplayExt.entitlements; CODE_SIGN_ENTITLEMENTS = yinheReplayExt/yinheReplayExt.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 0; CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = RXHYW88XR7; DEVELOPMENT_TEAM = RXHYW88XR7;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = yinheReplayExt/Info.plist; INFOPLIST_FILE = yinheReplayExt/Info.plist;
......
...@@ -384,7 +384,11 @@ class YHCirclePublishViewController: YHBaseViewController { ...@@ -384,7 +384,11 @@ class YHCirclePublishViewController: YHBaseViewController {
@objc private func publishButtonTapped() { @objc private func publishButtonTapped() {
view.endEditing(true) view.endEditing(true)
guard hasContent() else { guard !textView.text.isEmpty else {
YHHUD.flash(message: "标题不能为空")
return
}
guard !mediaItems.isEmpty else {
YHHUD.flash(message: "请至少添加一张图片") YHHUD.flash(message: "请至少添加一张图片")
return return
} }
...@@ -491,14 +495,7 @@ class YHCirclePublishViewController: YHBaseViewController { ...@@ -491,14 +495,7 @@ class YHCirclePublishViewController: YHBaseViewController {
// MARK: - Helper Methods // MARK: - Helper Methods
private func hasContent() -> Bool { private func hasContent() -> Bool {
return !mediaItems.isEmpty // 目前卡图片 return !textView.text.isEmpty || !detailTextView.text.isEmpty || !mediaItems.isEmpty
// return !textView.text.isEmpty || !detailTextView.text.isEmpty || !mediaItems.isEmpty
}
private func updatePublishButton() {
let hasContent = hasContent()
rightButton.isEnabled = hasContent
rightButton.backgroundColor = hasContent ? UIColor.brandGrayColor8 : UIColor.brandGrayColor4
} }
private func updateCollectionViewHeight() { private func updateCollectionViewHeight() {
...@@ -533,7 +530,6 @@ extension YHCirclePublishViewController: UITextViewDelegate { ...@@ -533,7 +530,6 @@ extension YHCirclePublishViewController: UITextViewDelegate {
detailPlaceholderLabel.isHidden = !textView.text.isEmpty detailPlaceholderLabel.isHidden = !textView.text.isEmpty
updateTextViewHeight(textView) updateTextViewHeight(textView)
} }
// updatePublishButton()
} }
func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool { func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {
...@@ -611,7 +607,6 @@ extension YHCirclePublishViewController: UICollectionViewDataSource, UICollectio ...@@ -611,7 +607,6 @@ extension YHCirclePublishViewController: UICollectionViewDataSource, UICollectio
// 刷新集合视图 // 刷新集合视图
self.mediaCollectionView.reloadData() self.mediaCollectionView.reloadData()
self.updateCollectionViewHeight() self.updateCollectionViewHeight()
// self.updatePublishButton()
printLog("已从发布页面删除媒体项,剩余: \(self.mediaItems.count)") printLog("已从发布页面删除媒体项,剩余: \(self.mediaItems.count)")
} }
...@@ -630,7 +625,6 @@ extension YHCirclePublishViewController: UICollectionViewDataSource, UICollectio ...@@ -630,7 +625,6 @@ extension YHCirclePublishViewController: UICollectionViewDataSource, UICollectio
mediaItems.remove(at: index) mediaItems.remove(at: index)
mediaCollectionView.reloadData() mediaCollectionView.reloadData()
updateCollectionViewHeight() updateCollectionViewHeight()
// updatePublishButton()
} }
private func showMediaUploadSheet() { private func showMediaUploadSheet() {
...@@ -650,7 +644,6 @@ extension YHCirclePublishViewController: UICollectionViewDataSource, UICollectio ...@@ -650,7 +644,6 @@ extension YHCirclePublishViewController: UICollectionViewDataSource, UICollectio
mediaCollectionView.reloadData() mediaCollectionView.reloadData()
updateCollectionViewHeight() updateCollectionViewHeight()
// updatePublishButton()
printLog("获得 \(itemsToAdd.count) 个媒体文件") printLog("获得 \(itemsToAdd.count) 个媒体文件")
// 为每个新添加的 item 开始上传 // 为每个新添加的 item 开始上传
......
...@@ -130,6 +130,7 @@ private extension YHCircleViewController { ...@@ -130,6 +130,7 @@ private extension YHCircleViewController {
self.circleCollectView.es.stopPullToRefresh() self.circleCollectView.es.stopPullToRefresh()
if !self.viewModel.hasMore, self.arr.count > 0 { if !self.viewModel.hasMore, self.arr.count > 0 {
self.circleCollectView.es.noticeNoMoreData() self.circleCollectView.es.noticeNoMoreData()
self.circleCollectView.footer?.alpha = 1
} }
} }
} }
...@@ -323,21 +324,6 @@ extension YHCircleViewController: CollectionViewWaterfallLayoutDelegate { ...@@ -323,21 +324,6 @@ extension YHCircleViewController: CollectionViewWaterfallLayoutDelegate {
} }
} }
// MARK: - UIScrollViewDelegate
extension YHCircleViewController {
func scrollViewDidScroll(_ scrollView: UIScrollView) {
let itemNumber = viewModel.preloadItemIndex
let section = 0
let itemIndex = itemNumber - 1
let indexPathToCheck = IndexPath(item: itemIndex, section: section)
if circleCollectView.indexPathsForVisibleItems.contains(indexPathToCheck) {
requestList(false)
}
}
}
// MARK: - JXSegmentedListContainerViewListDelegate // MARK: - JXSegmentedListContainerViewListDelegate
extension YHCircleViewController: JXSegmentedListContainerViewListDelegate { extension YHCircleViewController: JXSegmentedListContainerViewListDelegate {
......
...@@ -259,7 +259,7 @@ class YHCircleCollectionViewCell: UICollectionViewCell { ...@@ -259,7 +259,7 @@ class YHCircleCollectionViewCell: UICollectionViewCell {
} }
// 内容文本 // 内容文本
contentLabel.text = model.content.isEmpty ? model.title : model.content contentLabel.text = model.title
contentLabel.snp.removeConstraints() contentLabel.snp.removeConstraints()
contentLabel.snp.remakeConstraints { make in contentLabel.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(12) make.top.equalToSuperview().offset(12)
......
...@@ -343,14 +343,6 @@ private extension YHResourceViewController { ...@@ -343,14 +343,6 @@ private extension YHResourceViewController {
DispatchQueue.main.async { DispatchQueue.main.async {
YHHUD.hide() YHHUD.hide()
// if success, let arrData = self.viewModel.arrResourceData, arrData.count > 0 {
// let arrString = arrData.toJSONString()
// UserDefaults.standard.set(arrString, forKey: "resourceFirstPageData")
// UserDefaults.standard.synchronize()
// } else if !success, let errorMessage = message {
// YHHUD.flash(message: errorMessage)
// }
if !success, let errorMessage = message { if !success, let errorMessage = message {
YHHUD.flash(message: errorMessage) YHHUD.flash(message: errorMessage)
} }
...@@ -374,7 +366,7 @@ private extension YHResourceViewController { ...@@ -374,7 +366,7 @@ private extension YHResourceViewController {
self.resourceTableView.reloadData() self.resourceTableView.reloadData()
self.resourceTableView.es.stopLoadingMore() self.resourceTableView.es.stopLoadingMore()
if self.viewModel.hasMoreForResource == false { if self.viewModel.hasMoreForResource == false, (self.viewModel.arrResourceData?.count ?? 0) > 0 {
self.resourceTableView.es.noticeNoMoreData() self.resourceTableView.es.noticeNoMoreData()
self.resourceTableView.footer?.alpha = 1 self.resourceTableView.footer?.alpha = 1
} }
...@@ -615,20 +607,6 @@ extension YHResourceViewController: UITableViewDelegate, UITableViewDataSource { ...@@ -615,20 +607,6 @@ extension YHResourceViewController: UITableViewDelegate, UITableViewDataSource {
} }
} }
// MARK: - UIScrollViewDelegate
extension YHResourceViewController {
func scrollViewDidScroll(_ scrollView: UIScrollView) {
let itemNumber = viewModel.preloadItemIndex
let visibleRows = resourceTableView.indexPathsForVisibleRows ?? []
let lastVisibleRow = visibleRows.last?.row ?? 0
if lastVisibleRow >= itemNumber - 1 {
loadMoreData()
}
}
}
// MARK: - JXSegmentedListContainerViewListDelegate // MARK: - JXSegmentedListContainerViewListDelegate
extension YHResourceViewController: JXSegmentedListContainerViewListDelegate { extension YHResourceViewController: JXSegmentedListContainerViewListDelegate {
......
...@@ -107,7 +107,7 @@ class YHResourceListModel: SmartCodable { ...@@ -107,7 +107,7 @@ class YHResourceListModel: SmartCodable {
/// 显示名称(优先显示中文名) /// 显示名称(优先显示中文名)
var displayName: String { var displayName: String {
return company_name.isEmpty ? company_english_name : company_name return company_name.isEmpty ? "-" : company_name
} }
/// 是否有英文名 /// 是否有英文名
...@@ -117,7 +117,7 @@ class YHResourceListModel: SmartCodable { ...@@ -117,7 +117,7 @@ class YHResourceListModel: SmartCodable {
/// 行业类型显示文本 /// 行业类型显示文本
var industryDisplayText: String { var industryDisplayText: String {
return industry_type_str.isEmpty ? "其他" : industry_type_str return industry_type_str.isEmpty ? "-" : industry_type_str
} }
/// 是否提供服务 /// 是否提供服务
......
...@@ -14,7 +14,7 @@ class YHResourceViewModel: NSObject { ...@@ -14,7 +14,7 @@ class YHResourceViewModel: NSObject {
var arrResourceData: [YHResourceListModel]? var arrResourceData: [YHResourceListModel]?
var hasMoreForResource: Bool = true var hasMoreForResource: Bool = true
var currentPage: Int = 1 var currentPage: Int = 1
var pageSize: Int = 20 var pageSize: Int = 10
var preloadItemIndex: Int = 10 var preloadItemIndex: Int = 10
var totalCount: Int = 0 var totalCount: Int = 0
......
...@@ -88,7 +88,7 @@ class YHDynamicItem: SmartCodable { ...@@ -88,7 +88,7 @@ class YHDynamicItem: SmartCodable {
return return
} }
isCalHeight = true isCalHeight = true
let text = content.isEmpty ? title : content let text = title
let width = (KScreenWidth - 47) / 2 let width = (KScreenWidth - 47) / 2
let font = UIFont.PFSC_R(ofSize: 15) // 字体大小改为15 let font = UIFont.PFSC_R(ofSize: 15) // 字体大小改为15
let maxWidth = width - 16 // 最大宽度限制(左右各8的内边距) let maxWidth = width - 16 // 最大宽度限制(左右各8的内边距)
......
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