Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
86317b79
Commit
86317b79
authored
Oct 12, 2025
by
Alex朱枝文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ui走查问题修复
parent
5dce3557
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
159 deletions
+48
-159
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+0
-8
YHCirclePublishViewController.swift
...ty(社区)/Circle(下属社区)/C/YHCirclePublishViewController.swift
+46
-10
YHCircleListModel.swift
...ules/Community(社区)/Circle(下属社区)/M/YHCircleListModel.swift
+0
-58
YHCircleCollectionViewCell.swift
...unity(社区)/Circle(下属社区)/V/YHCircleCollectionViewCell.swift
+1
-1
YHCircleViewModel.swift
...les/Community(社区)/Circle(下属社区)/VM/YHCircleViewModel.swift
+0
-81
YHDynamicItem.swift
...asses/Modules/Mine(我的)/NameCard(名片)/M/YHDynamicItem.swift
+1
-1
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
86317b79
...
...
@@ -1276,9 +1276,7 @@
04B30B982E891CF3004E4B12
/* YHContactViewModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04B30B972E891CF3004E4B12
/* YHContactViewModel.swift */
;
};
04D4EC312E839C1000B0329B
/* YHCircleViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04D4EC302E839C1000B0329B
/* YHCircleViewController.swift */
;
};
04D4EC332E839C2B00B0329B
/* YHResourceViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04D4EC322E839C2B00B0329B
/* YHResourceViewController.swift */
;
};
04D4EC442E83D0D500B0329B
/* YHCircleViewModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04D4EC432E83D0D500B0329B
/* YHCircleViewModel.swift */
;
};
04D4EC462E83D11500B0329B
/* YHCircleCollectionViewCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04D4EC452E83D11500B0329B
/* YHCircleCollectionViewCell.swift */
;
};
04D4EC482E83D17500B0329B
/* YHCircleListModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04D4EC472E83D17500B0329B
/* YHCircleListModel.swift */
;
};
04D4EC4A2E83D21000B0329B
/* YHCirclePublishViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04D4EC492E83D21000B0329B
/* YHCirclePublishViewController.swift */
;
};
04D4EC4E2E84F22500B0329B
/* YHCircleHeaderReusableView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04D4EC4D2E84F22500B0329B
/* YHCircleHeaderReusableView.swift */
;
};
04D6405A2E84DF07000162AF
/* YHConnectListViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04D640592E84DF07000162AF
/* YHConnectListViewController.swift */
;
};
...
...
@@ -2658,9 +2656,7 @@
04B30B972E891CF3004E4B12
/* YHContactViewModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHContactViewModel.swift
;
sourceTree
=
"<group>"
;
};
04D4EC302E839C1000B0329B
/* YHCircleViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCircleViewController.swift
;
sourceTree
=
"<group>"
;
};
04D4EC322E839C2B00B0329B
/* YHResourceViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHResourceViewController.swift
;
sourceTree
=
"<group>"
;
};
04D4EC432E83D0D500B0329B
/* YHCircleViewModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCircleViewModel.swift
;
sourceTree
=
"<group>"
;
};
04D4EC452E83D11500B0329B
/* YHCircleCollectionViewCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCircleCollectionViewCell.swift
;
sourceTree
=
"<group>"
;
};
04D4EC472E83D17500B0329B
/* YHCircleListModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCircleListModel.swift
;
sourceTree
=
"<group>"
;
};
04D4EC492E83D21000B0329B
/* YHCirclePublishViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCirclePublishViewController.swift
;
sourceTree
=
"<group>"
;
};
04D4EC4D2E84F22500B0329B
/* YHCircleHeaderReusableView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCircleHeaderReusableView.swift
;
sourceTree
=
"<group>"
;
};
04D640592E84DF07000162AF
/* YHConnectListViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHConnectListViewController.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -7030,7 +7026,6 @@
04D4EC292E839B3000B0329B
/* M */
=
{
isa
=
PBXGroup
;
children
=
(
04D4EC472E83D17500B0329B
/* YHCircleListModel.swift */
,
);
path
=
M
;
sourceTree
=
"<group>"
;
...
...
@@ -7051,7 +7046,6 @@
04D4EC2B2E839B3000B0329B
/* VM */
=
{
isa
=
PBXGroup
;
children
=
(
04D4EC432E83D0D500B0329B
/* YHCircleViewModel.swift */
,
);
path
=
VM
;
sourceTree
=
"<group>"
;
...
...
@@ -7885,7 +7879,6 @@
045C10802D12CA5F00BD2DC0
/* YHWorkExperiencePositionReasonTableViewCell.swift in Sources */
,
045C10812D12CA5F00BD2DC0
/* YHServiceOrderListViewController.swift in Sources */
,
04AE200F2D12CFAF00891D24
/* YHGCMineSchemeViewController.swift in Sources */
,
04D4EC442E83D0D500B0329B
/* YHCircleViewModel.swift in Sources */
,
04AE20102D12CFAF00891D24
/* YHGCApplicationTypeController.swift in Sources */
,
048D6ADD2D5EF0A900BC6F4C
/* YHMemberCenterHeaderView.swift in Sources */
,
04AE20112D12CFAF00891D24
/* YHGCApplicationTypeResultController.swift in Sources */
,
...
...
@@ -8118,7 +8111,6 @@
04AE20502D19425900891D24
/* YHGCCertificateListVC.swift in Sources */
,
043671432D66DDB500E8D9BA
/* YHMemberCenterInfo.swift in Sources */
,
045C113D2D12CA5F00BD2DC0
/* YHMyFileListCell.swift in Sources */
,
04D4EC482E83D17500B0329B
/* YHCircleListModel.swift in Sources */
,
045C113E2D12CA5F00BD2DC0
/* YHLookResignResultModel.swift in Sources */
,
045C113F2D12CA5F00BD2DC0
/* YHIncomeTypeSelectCell.swift in Sources */
,
045C11402D12CA5F00BD2DC0
/* YHWorkHighlightsTableViewCell.swift in Sources */
,
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/Circle(下属社区)/C/YHCirclePublishViewController.swift
View file @
86317b79
...
...
@@ -20,7 +20,6 @@ class YHCirclePublishViewController: YHBaseViewController {
// MARK: - Properties
private
var
mediaItems
:
[
YHSelectMediaItem
]
=
[]
private
let
maxMediaCount
=
9
// private var resources: [YHResourceURLs] = []
private
let
marginX
:
CGFloat
=
24
private
let
itemSpace
:
CGFloat
=
8
...
...
@@ -61,6 +60,7 @@ class YHCirclePublishViewController: YHBaseViewController {
let
scrollView
=
UIScrollView
()
scrollView
.
backgroundColor
=
.
white
scrollView
.
showsVerticalScrollIndicator
=
false
// scrollView.keyboardDismissMode = .onDrag
return
scrollView
}()
...
...
@@ -190,6 +190,7 @@ class YHCirclePublishViewController: YHBaseViewController {
setupConstraints
()
setupNotifications
()
updateUserInfo
()
initTextViewsContent
()
}
deinit
{
...
...
@@ -263,23 +264,24 @@ class YHCirclePublishViewController: YHBaseViewController {
textView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
userInfoView
.
snp
.
bottom
)
.
offset
(
24
)
make
.
left
.
right
.
equalToSuperview
()
.
inset
(
marginX
)
make
.
height
.
greaterThanOrE
qualTo
(
24
)
make
.
height
.
e
qualTo
(
24
)
}
placeholderLabel
.
snp
.
makeConstraints
{
make
in
make
.
top
.
left
.
equalTo
(
textView
)
}
let
pixelOne
=
1.0
/
UIScreen
.
main
.
scale
divideLine
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
textView
.
snp
.
bottom
)
.
offset
(
16
)
make
.
left
.
right
.
equalTo
(
textView
)
make
.
height
.
equalTo
(
1
)
make
.
height
.
equalTo
(
pixelOne
)
}
detailTextView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
divideLine
.
snp
.
bottom
)
.
offset
(
16
)
make
.
left
.
right
.
equalToSuperview
()
.
inset
(
marginX
)
make
.
height
.
greaterThanOrEqualTo
(
20
)
make
.
height
.
equalTo
(
92
)
}
detailPlaceholderLabel
.
snp
.
makeConstraints
{
make
in
...
...
@@ -287,7 +289,7 @@ class YHCirclePublishViewController: YHBaseViewController {
}
mediaCollectionView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
detailTextView
.
snp
.
bottom
)
.
offset
(
96
)
make
.
top
.
equalTo
(
detailTextView
.
snp
.
bottom
)
.
offset
(
24
)
make
.
left
.
right
.
equalToSuperview
()
.
inset
(
marginX
)
make
.
height
.
equalTo
(
200
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
30
)
...
...
@@ -296,12 +298,31 @@ class YHCirclePublishViewController: YHBaseViewController {
updateCollectionViewHeight
()
}
private
func
updateUserInfo
()
{
textView
.
text
=
self
.
titleText
detailTextView
.
text
=
self
.
content
placeholderLabel
.
isHidden
=
!
self
.
titleText
.
isEmpty
detailPlaceholderLabel
.
isHidden
=
!
self
.
content
.
isEmpty
// 动态更新 TextView 高度
private
func
updateTextViewHeight
(
_
textView
:
UITextView
)
{
let
size
=
textView
.
sizeThatFits
(
CGSize
(
width
:
textView
.
frame
.
width
,
height
:
.
infinity
))
// 设置最小和最大高度限制
let
minHeight
:
CGFloat
=
textView
==
self
.
textView
?
24
:
92
let
maxHeight
:
CGFloat
=
textView
==
self
.
textView
?
100
:
CGFloat
.
infinity
let
newHeight
=
min
(
max
(
size
.
height
,
minHeight
),
maxHeight
)
if
abs
(
newHeight
-
textView
.
frame
.
size
.
height
)
>
1
{
textView
.
snp
.
updateConstraints
{
make
in
make
.
height
.
equalTo
(
newHeight
)
}
// 启用/禁用滚动
textView
.
isScrollEnabled
=
size
.
height
>
maxHeight
// 动画更新布局
UIView
.
animate
(
withDuration
:
0.2
)
{
self
.
view
.
layoutIfNeeded
()
}
}
}
private
func
updateUserInfo
()
{
if
let
currentUser
=
currentUser
{
usernameLabel
.
text
=
currentUser
.
userName
subtitleLabel
.
text
=
currentUser
.
userTitle
...
...
@@ -327,6 +348,19 @@ class YHCirclePublishViewController: YHBaseViewController {
}
}
private
func
initTextViewsContent
()
{
textView
.
text
=
self
.
titleText
detailTextView
.
text
=
self
.
content
placeholderLabel
.
isHidden
=
!
self
.
titleText
.
isEmpty
detailPlaceholderLabel
.
isHidden
=
!
self
.
content
.
isEmpty
// 如果有初始文本,更新高度
if
!
titleText
.
isEmpty
{
updateTextViewHeight
(
textView
)
}
if
!
content
.
isEmpty
{
updateTextViewHeight
(
detailTextView
)
}
}
private
func
setupNotifications
()
{
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
keyboardWillShow
)
,
name
:
UIResponder
.
keyboardWillShowNotification
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
keyboardWillHide
)
,
name
:
UIResponder
.
keyboardWillHideNotification
,
object
:
nil
)
...
...
@@ -492,8 +526,10 @@ extension YHCirclePublishViewController: UITextViewDelegate {
func
textViewDidChange
(
_
textView
:
UITextView
)
{
if
textView
==
self
.
textView
{
placeholderLabel
.
isHidden
=
!
textView
.
text
.
isEmpty
updateTextViewHeight
(
textView
)
}
else
if
textView
==
detailTextView
{
detailPlaceholderLabel
.
isHidden
=
!
textView
.
text
.
isEmpty
updateTextViewHeight
(
textView
)
}
// updatePublishButton()
}
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/Circle(下属社区)/M/YHCircleListModel.swift
deleted
100644 → 0
View file @
5dce3557
//
// YHCircleListModel.swift
// galaxy
//
// Created by alexzzw on 2025/9/24.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import
SmartCodable
// MARK: - 数据模型
class
YHCircleListModel
:
SmartCodable
{
required
init
()
{}
var
id
:
String
=
""
var
user_id
:
String
=
""
var
user_name
:
String
=
""
var
user_avatar
:
String
=
""
var
content
:
String
=
""
var
images
:
[
String
]
=
[]
var
like_count
:
Int
=
0
var
comment_count
:
Int
=
0
var
is_like
:
Bool
=
false
var
create_time
:
String
=
""
var
location
:
String
=
""
var
type
:
Int
=
1
var
img_width_cell
:
CGFloat
=
0
var
img_height_cell
:
CGFloat
=
0
func
calHeightParam
()
{
let
screenWidth
=
KScreenWidth
let
cellWidth
=
(
screenWidth
-
47
)
/
2
var
totalHeight
:
CGFloat
=
60
+
20
+
44
if
!
content
.
isEmpty
{
let
font
=
UIFont
.
systemFont
(
ofSize
:
14
)
let
maxSize
=
CGSize
(
width
:
cellWidth
-
24
,
height
:
CGFloat
.
greatestFiniteMagnitude
)
let
textRect
=
content
.
boundingRect
(
with
:
maxSize
,
options
:
[
.
usesLineFragmentOrigin
,
.
usesFontLeading
],
attributes
:
[
.
font
:
font
],
context
:
nil
)
totalHeight
+=
ceil
(
textRect
.
height
)
+
12
}
if
!
images
.
isEmpty
{
let
imageHeight
:
CGFloat
=
120
totalHeight
+=
imageHeight
+
12
}
self
.
img_width_cell
=
cellWidth
self
.
img_height_cell
=
max
(
totalHeight
,
180
)
}
}
galaxy/galaxy/Classes/Modules/Community(社区)/Circle(下属社区)/V/YHCircleCollectionViewCell.swift
View file @
86317b79
...
...
@@ -259,7 +259,7 @@ class YHCircleCollectionViewCell: UICollectionViewCell {
}
// 内容文本
contentLabel
.
text
=
model
.
content
contentLabel
.
text
=
model
.
content
.
isEmpty
?
model
.
title
:
model
.
content
contentLabel
.
snp
.
removeConstraints
()
contentLabel
.
snp
.
remakeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
.
offset
(
12
)
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/Circle(下属社区)/VM/YHCircleViewModel.swift
deleted
100644 → 0
View file @
5dce3557
//
// YHCircleViewModel.swift
// galaxy
//
// Created by alexzzw on 2025/9/24.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
// MARK: - ViewModel
class
YHCircleViewModel
{
var
arrCircleData
:
[
YHHomeListModel
]?
=
[]
var
hasMoreForCircle
=
true
var
preloadItemIndex
=
10
private
var
currentPage
=
1
func
getCircleList
(
firstFlag
:
Bool
,
completion
:
@escaping
(
Bool
,
String
?)
->
Void
)
{
if
firstFlag
{
currentPage
=
1
arrCircleData
?
.
removeAll
()
}
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
1.0
)
{
let
mockData
=
self
.
generateMockCircleData
(
page
:
self
.
currentPage
)
if
firstFlag
{
self
.
arrCircleData
=
mockData
}
else
{
self
.
arrCircleData
?
.
append
(
contentsOf
:
mockData
)
}
self
.
arrCircleData
?
.
forEach
{
$0
.
calHeightParam
()
}
self
.
currentPage
+=
1
self
.
hasMoreForCircle
=
self
.
currentPage
<=
5
completion
(
true
,
nil
)
}
}
func
toggleLike
(
postId
:
Int
,
completion
:
@escaping
(
Bool
,
String
?)
->
Void
)
{
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
0.5
)
{
if
let
index
=
self
.
arrCircleData
?
.
firstIndex
(
where
:
{
$0
.
id
==
postId
})
{
let
item
=
self
.
arrCircleData
!
[
index
]
item
.
is_like
.
toggle
()
item
.
like_count
+=
item
.
is_like
?
1
:
-
1
completion
(
true
,
nil
)
}
else
{
completion
(
false
,
"动态不存在"
)
}
}
}
private
func
generateMockCircleData
(
page
:
Int
)
->
[
YHHomeListModel
]
{
let
contents
=
[
"今天天气真不错,出来走走心情都变好了!"
,
"分享一下最近读的这本书,非常推荐给大家"
,
"周末和朋友们一起聚餐,开心~"
,
"工作虽然忙碌,但还是要保持积极的心态"
,
"旅行中遇到的美景,忍不住分享给大家"
,
"学习新技能的路上,每天都有新收获"
,
"美食当前,减肥明天再说吧"
]
let
names
=
[
"张小明"
,
"李小红"
,
"王小强"
,
"赵小美"
,
"孙小华"
,
"周小军"
,
"吴小芳"
]
let
locations
=
[
"北京·朝阳区"
,
"上海·浦东新区"
,
"深圳·南山区"
,
"杭州·西湖区"
,
"成都·锦江区"
,
""
]
return
(
0
..<
8
)
.
map
{
i
in
let
model
=
YHHomeListModel
()
model
.
id
=
i
model
.
img_url
=
"https://picsum.photos/60/60?random=
\(
i
)
"
model
.
content
=
contents
[
i
%
contents
.
count
]
model
.
like_count
=
Int
.
random
(
in
:
0
...
99
)
model
.
is_like
=
Bool
.
random
()
return
model
}
}
}
galaxy/galaxy/Classes/Modules/Mine(我的)/NameCard(名片)/M/YHDynamicItem.swift
View file @
86317b79
...
...
@@ -88,7 +88,7 @@ class YHDynamicItem: SmartCodable {
return
}
isCalHeight
=
true
let
text
=
content
let
text
=
content
.
isEmpty
?
title
:
content
let
width
=
(
KScreenWidth
-
47
)
/
2
let
font
=
UIFont
.
PFSC_R
(
ofSize
:
15
)
// 字体大小改为15
let
maxWidth
=
width
-
16
// 最大宽度限制(左右各8的内边距)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment