Commit 0c76c47f authored by David黄金龙's avatar David黄金龙

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

* '630-dev' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS:
  我的名片
  //  我的名片
parents ecbd95be 94dc80b4
...@@ -301,6 +301,7 @@ ...@@ -301,6 +301,7 @@
04AD317B2C2428CB00DF5655 /* YHPeopleSuccessView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AD317A2C2428CB00DF5655 /* YHPeopleSuccessView.swift */; }; 04AD317B2C2428CB00DF5655 /* YHPeopleSuccessView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AD317A2C2428CB00DF5655 /* YHPeopleSuccessView.swift */; };
04AF514E2BEB585C00009E3A /* YHVideoPlayerVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AF514D2BEB585C00009E3A /* YHVideoPlayerVC.swift */; }; 04AF514E2BEB585C00009E3A /* YHVideoPlayerVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AF514D2BEB585C00009E3A /* YHVideoPlayerVC.swift */; };
04AF58C42B4FC51C0066011A /* YHLocalizable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AF58C32B4FC51C0066011A /* YHLocalizable.swift */; }; 04AF58C42B4FC51C0066011A /* YHLocalizable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AF58C32B4FC51C0066011A /* YHLocalizable.swift */; };
04AF82D62C25542D0028CE2A /* YHInterestTopicLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AF82D52C25542D0028CE2A /* YHInterestTopicLayout.swift */; };
04B9EE5A2C06CC3100A4018D /* YHCodeSueecssViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B9EE582C06CC3100A4018D /* YHCodeSueecssViewController.swift */; }; 04B9EE5A2C06CC3100A4018D /* YHCodeSueecssViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B9EE582C06CC3100A4018D /* YHCodeSueecssViewController.swift */; };
04B9EE5B2C06CC3100A4018D /* YHOtherLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B9EE592C06CC3100A4018D /* YHOtherLoginViewController.swift */; }; 04B9EE5B2C06CC3100A4018D /* YHOtherLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B9EE592C06CC3100A4018D /* YHOtherLoginViewController.swift */; };
04C693622B723AB8004C1758 /* YHMySettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04C693612B723AB8004C1758 /* YHMySettingViewController.swift */; }; 04C693622B723AB8004C1758 /* YHMySettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04C693612B723AB8004C1758 /* YHMySettingViewController.swift */; };
...@@ -854,6 +855,7 @@ ...@@ -854,6 +855,7 @@
04AD317A2C2428CB00DF5655 /* YHPeopleSuccessView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPeopleSuccessView.swift; sourceTree = "<group>"; }; 04AD317A2C2428CB00DF5655 /* YHPeopleSuccessView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPeopleSuccessView.swift; sourceTree = "<group>"; };
04AF514D2BEB585C00009E3A /* YHVideoPlayerVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHVideoPlayerVC.swift; sourceTree = "<group>"; }; 04AF514D2BEB585C00009E3A /* YHVideoPlayerVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHVideoPlayerVC.swift; sourceTree = "<group>"; };
04AF58C32B4FC51C0066011A /* YHLocalizable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLocalizable.swift; sourceTree = "<group>"; }; 04AF58C32B4FC51C0066011A /* YHLocalizable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLocalizable.swift; sourceTree = "<group>"; };
04AF82D52C25542D0028CE2A /* YHInterestTopicLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInterestTopicLayout.swift; sourceTree = "<group>"; };
04B9EE582C06CC3100A4018D /* YHCodeSueecssViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHCodeSueecssViewController.swift; sourceTree = "<group>"; }; 04B9EE582C06CC3100A4018D /* YHCodeSueecssViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHCodeSueecssViewController.swift; sourceTree = "<group>"; };
04B9EE592C06CC3100A4018D /* YHOtherLoginViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHOtherLoginViewController.swift; sourceTree = "<group>"; }; 04B9EE592C06CC3100A4018D /* YHOtherLoginViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHOtherLoginViewController.swift; sourceTree = "<group>"; };
04C693612B723AB8004C1758 /* YHMySettingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMySettingViewController.swift; sourceTree = "<group>"; }; 04C693612B723AB8004C1758 /* YHMySettingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMySettingViewController.swift; sourceTree = "<group>"; };
...@@ -2186,6 +2188,7 @@ ...@@ -2186,6 +2188,7 @@
04FB01D32C2404F50040115D /* YHMyFriendsNoDataView.swift */, 04FB01D32C2404F50040115D /* YHMyFriendsNoDataView.swift */,
043BA8742C241B38006EF02D /* YHAddFriendCardCell.swift */, 043BA8742C241B38006EF02D /* YHAddFriendCardCell.swift */,
04AD317A2C2428CB00DF5655 /* YHPeopleSuccessView.swift */, 04AD317A2C2428CB00DF5655 /* YHPeopleSuccessView.swift */,
04AF82D52C25542D0028CE2A /* YHInterestTopicLayout.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -3274,6 +3277,7 @@ ...@@ -3274,6 +3277,7 @@
04C693622B723AB8004C1758 /* YHMySettingViewController.swift in Sources */, 04C693622B723AB8004C1758 /* YHMySettingViewController.swift in Sources */,
045EEECD2B9F171A0022A143 /* YHScoreDataModel.swift in Sources */, 045EEECD2B9F171A0022A143 /* YHScoreDataModel.swift in Sources */,
A5ACE9342B4564F7002C94D2 /* YHAllApiName.swift in Sources */, A5ACE9342B4564F7002C94D2 /* YHAllApiName.swift in Sources */,
04AF82D62C25542D0028CE2A /* YHInterestTopicLayout.swift in Sources */,
045EEE902B9F171A0022A143 /* YHPreviewInfoNameAndSubNameItemsView.swift in Sources */, 045EEE902B9F171A0022A143 /* YHPreviewInfoNameAndSubNameItemsView.swift in Sources */,
A5787E342C22B45700B021D7 /* YHActivityListCell.swift in Sources */, A5787E342C22B45700B021D7 /* YHActivityListCell.swift in Sources */,
A567E5B72BD7643D00D5D5A0 /* YHHkLifeAndIdItemView.swift in Sources */, A567E5B72BD7643D00D5D5A0 /* YHHkLifeAndIdItemView.swift in Sources */,
......
...@@ -63,6 +63,16 @@ class YHMyGoodFriendsVC: YHBaseViewController { ...@@ -63,6 +63,16 @@ class YHMyGoodFriendsVC: YHBaseViewController {
make.top.equalToSuperview().offset(16+k_Height_NavigationtBarAndStatuBar) make.top.equalToSuperview().offset(16+k_Height_NavigationtBarAndStatuBar)
} }
} }
func createCorner(cell:UITableViewCell, isLastCell:Bool) {
if (isLastCell) {
let corner = UIRectCorner(rawValue: UIRectCorner.bottomLeft.rawValue | UIRectCorner.bottomRight.rawValue)
cell.createCorner(CGSizeMake(12.0, 12.0), corner)
} else {
cell.layer.mask = nil
}
}
} }
extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource { extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource {
...@@ -94,6 +104,7 @@ extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource { ...@@ -94,6 +104,7 @@ extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource {
} }
let cell = tableView.dequeueReusableCell(withIdentifier: YHMyFriendsCell.cellReuseIdentifier, for: indexPath) as! YHMyFriendsCell let cell = tableView.dequeueReusableCell(withIdentifier: YHMyFriendsCell.cellReuseIdentifier, for: indexPath) as! YHMyFriendsCell
self.createCorner(cell: cell, isLastCell: indexPath.row == self.friendsArr.count-1)
if 0 <= indexPath.row && indexPath.row < friendsArr.count { if 0 <= indexPath.row && indexPath.row < friendsArr.count {
} }
return cell return cell
......
...@@ -38,7 +38,14 @@ class YHMyNameCardViewController: YHBaseViewController { ...@@ -38,7 +38,14 @@ class YHMyNameCardViewController: YHBaseViewController {
bar.backgroundColor = .clear bar.backgroundColor = .clear
bar.title = "我的名片" bar.title = "我的名片"
bar.titleColor = .white bar.titleColor = .white
bar.rightButton.setImage(UIImage(named: "people_card_setting"), for: .normal) bar.rightButton.setImage(UIImage(named: "people_card_authorized"), for: .normal)
bar.rightButton.setTitle("授权", for: .normal)
bar.rightButton.setTitleColor(UIColor.white, for: .normal)
bar.rightButton.titleLabel?.font = UIFont.PFSC_R(ofSize:15)
bar.rightButton.snp.updateConstraints { make in
make.width.equalTo(55)
make.height.equalTo(44)
}
bar.backButton.setImage(UIImage(named: "back_icon_for_code_input"), for: .normal) bar.backButton.setImage(UIImage(named: "back_icon_for_code_input"), for: .normal)
bar.backBlock = { bar.backBlock = {
[weak self] in [weak self] in
......
//
// YHInterestTopicLayout.swift
// galaxy
//
// Created by edy on 2024/6/21.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHInterestTopicLayout: UICollectionViewFlowLayout {
var interItemSpacing: CGFloat = 12.0 // 相邻单元格之间的水平间距
override func prepare() {
super.prepare()
self.minimumInteritemSpacing = 12
self.minimumLineSpacing = 8
}
override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
let arrCell = super.layoutAttributesForElements(in: rect)
if arrCell == nil { return nil }
if arrCell!.count <= 1 { return arrCell }
for i in 1 ..< arrCell!.count {
//当前 UICollectionViewLayoutAttributes
let currentLayout = arrCell![i]
//上一个 UICollectionViewLayoutAttributes
let prevLayout = arrCell![i - 1]
if (prevLayout.indexPath.section == currentLayout.indexPath.section) {
//我们想设置的最大间距,可根据需要改
let maximumSpacing = 12.0
//前一个cell的最右边
let originX = prevLayout.frame.maxX
//如果当 (上一个cell的最右边X + 我们想要的间距 + 当前cell的宽度 + 区边距) 依然在contentSize中 (小于屏幕宽度),我们改变当前cell的原点位置
//判断 当前cell的 maxX 是否超出屏幕
if((CGFloat(originX) + CGFloat(maximumSpacing) + currentLayout.frame.size.width) + self.sectionInset.right < self.collectionViewContentSize.width) {
var frame = currentLayout.frame
frame.origin.x = CGFloat(originX) + CGFloat(maximumSpacing)
currentLayout.frame = frame
} else {
print("超出屏幕, 换一行")
var frame = currentLayout.frame
frame.origin.x = self.sectionInset.left
currentLayout.frame = frame
}
}
}
return arrCell
}
}
...@@ -51,7 +51,7 @@ class YHMyInterestTopicCell: UITableViewCell { ...@@ -51,7 +51,7 @@ class YHMyInterestTopicCell: UITableViewCell {
var editBlock: EditBlock? var editBlock: EditBlock?
static let cellReuseIdentifier = "YHMyInterestTopicCell" static let cellReuseIdentifier = "YHMyInterestTopicCell"
var topicArr:[String] = ["深度阅读爱好者", "皮划艇玩家", "创新主义", "茶道", "皮划艇玩家", "创新主义", "茶道", "深度阅读爱好者"] var topicArr:[String] = ["深度阅读爱好者", "皮划艇玩家", "创新主义", "茶道啊大法师额", "皮划艇玩家", "创新主义", "茶道", "深度阅读爱好者","玩家", "创主义", "茶道", "皮划艇玩家", "创新主义"]
lazy var cardView: UIView = { lazy var cardView: UIView = {
let view = UIView() let view = UIView()
...@@ -78,13 +78,17 @@ class YHMyInterestTopicCell: UITableViewCell { ...@@ -78,13 +78,17 @@ class YHMyInterestTopicCell: UITableViewCell {
return btn return btn
}() }()
lazy var layout:YHInterestTopicLayout = {
let layout = YHInterestTopicLayout()
layout.scrollDirection = .vertical
return layout
}()
lazy var collectionView: UICollectionView = { lazy var collectionView: UICollectionView = {
// 创建集合视图布局 // 创建集合视图布局
let layout = YHSearchItemLayout()
layout.scrollDirection = .vertical
// 创建集合视图 // 创建集合视图
let collectView = UICollectionView(frame:.zero, collectionViewLayout: layout) let collectView = UICollectionView(frame:.zero, collectionViewLayout: self.layout)
collectView.delegate = self collectView.delegate = self
collectView.dataSource = self collectView.dataSource = self
collectView.backgroundColor = .white collectView.backgroundColor = .white
...@@ -111,6 +115,7 @@ class YHMyInterestTopicCell: UITableViewCell { ...@@ -111,6 +115,7 @@ class YHMyInterestTopicCell: UITableViewCell {
self.contentView.addSubview(self.cardView) self.contentView.addSubview(self.cardView)
cardView.addSubview(self.titleLabel) cardView.addSubview(self.titleLabel)
cardView.addSubview(collectionView) cardView.addSubview(collectionView)
cardView.addSubview(self.editBtn) cardView.addSubview(self.editBtn)
cardView.snp.makeConstraints { make in cardView.snp.makeConstraints { make in
...@@ -133,9 +138,16 @@ class YHMyInterestTopicCell: UITableViewCell { ...@@ -133,9 +138,16 @@ class YHMyInterestTopicCell: UITableViewCell {
make.left.equalTo(16) make.left.equalTo(16)
make.right.equalTo(-16) make.right.equalTo(-16)
make.bottom.equalTo(-16) make.bottom.equalTo(-16)
make.height.equalTo(58) make.height.equalTo(24)
make.top.equalTo(titleLabel.snp.bottom).offset(12) make.top.equalTo(titleLabel.snp.bottom).offset(12)
} }
collectionView.reloadData {
let height = self.collectionView.contentSize.height
self.collectionView.snp.updateConstraints { make in
make.height.equalTo(height)
}
}
} }
@objc func edit() { @objc func edit() {
......
...@@ -11,10 +11,10 @@ import UIKit ...@@ -11,10 +11,10 @@ import UIKit
class YHSearchItemLayout: UICollectionViewFlowLayout { class YHSearchItemLayout: UICollectionViewFlowLayout {
var interItemSpacing: CGFloat = 12.0 // 相邻单元格之间的水平间距 var interItemSpacing: CGFloat = 12.0 // 相邻单元格之间的水平间距
override func prepare() { override func prepare() {
super.prepare() super.prepare()
self.minimumInteritemSpacing = 12 self.minimumInteritemSpacing = 12
self.minimumLineSpacing = 10
} }
override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? { override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
...@@ -37,6 +37,7 @@ class YHSearchItemLayout: UICollectionViewFlowLayout { ...@@ -37,6 +37,7 @@ class YHSearchItemLayout: UICollectionViewFlowLayout {
var frame = currentLayout.frame var frame = currentLayout.frame
frame.origin.x = CGFloat(originX) + CGFloat(maximumSpacing) frame.origin.x = CGFloat(originX) + CGFloat(maximumSpacing)
currentLayout.frame = frame currentLayout.frame = frame
} else { } else {
print("超出屏幕, 换一行") print("超出屏幕, 换一行")
var frame = currentLayout.frame var frame = currentLayout.frame
...@@ -47,5 +48,4 @@ class YHSearchItemLayout: UICollectionViewFlowLayout { ...@@ -47,5 +48,4 @@ class YHSearchItemLayout: UICollectionViewFlowLayout {
} }
return arrCell return arrCell
} }
} }
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "Vector@2x.png", "filename" : "Group 2033194953@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "Vector@3x.png", "filename" : "Group 2033194953@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