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
982b39ac
Commit
982b39ac
authored
Oct 10, 2025
by
Alex朱枝文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
社区调整
parent
1020b4e0
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
182 additions
and
26 deletions
+182
-26
YHCirclePublishViewController.swift
...ty(社区)/Circle(下属社区)/C/YHCirclePublishViewController.swift
+0
-0
YHCircleViewController.swift
...Community(社区)/Circle(下属社区)/C/YHCircleViewController.swift
+0
-0
YHCircleCollectionViewCell.swift
...unity(社区)/Circle(下属社区)/V/YHCircleCollectionViewCell.swift
+0
-0
YHResourceViewController.swift
...mmunity(社区)/Resource(资源)/C/YHResourceViewController.swift
+2
-3
YHResourceDetailDocumentsCell.swift
...ty(社区)/Resource(资源)/V/YHResourceDetailDocumentsCell.swift
+6
-5
YHDynamicItem.swift
...asses/Modules/Mine(我的)/NameCard(名片)/M/YHDynamicItem.swift
+97
-16
YHNameCardDynamicCell.swift
...dules/Mine(我的)/NameCard(名片)/V/YHNameCardDynamicCell.swift
+1
-1
YHDynamicViewModel.swift
...Modules/Mine(我的)/NameCard(名片)/VM/YHDynamicViewModel.swift
+62
-1
YHSelectMediaItem.swift
...asses/Modules/PictureReview(图片预览)/YHSelectMediaItem.swift
+12
-0
YHAllApiName.swift
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
+2
-0
No files found.
galaxy/galaxy/Classes/Modules/Community(社区)/Circle(下属社区)/C/YHCirclePublishViewController.swift
View file @
982b39ac
This diff is collapsed.
Click to expand it.
galaxy/galaxy/Classes/Modules/Community(社区)/Circle(下属社区)/C/YHCircleViewController.swift
View file @
982b39ac
This diff is collapsed.
Click to expand it.
galaxy/galaxy/Classes/Modules/Community(社区)/Circle(下属社区)/V/YHCircleCollectionViewCell.swift
View file @
982b39ac
This diff is collapsed.
Click to expand it.
galaxy/galaxy/Classes/Modules/Community(社区)/Resource(资源)/C/YHResourceViewController.swift
View file @
982b39ac
...
...
@@ -482,13 +482,12 @@ private extension YHResourceViewController {
return
}
YHGrayCommonAlertView
.
show
(
"需联系银河管家进行发布信息"
,
"联系银河管家发布企业服务与企业需求,快来与我们联系吧~"
,
"返回"
,
"前往联系"
,
fullGuestureEnable
:
false
)
{
[
weak
self
]
in
YHGrayCommonAlertView
.
show
(
"需联系银河管家进行发布信息"
,
"联系银河管家发布企业服务与企业需求,快来与我们联系吧~"
,
"返回"
,
"前往联系"
,
fullGuestureEnable
:
false
)
{
}
callBack
:
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
self
.
messageHandler
.
gotoChatVC
(
senderID
:
""
)
}
callBack
:
{
//
}
}
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/Resource(资源)/V/YHResourceDetailDocumentsCell.swift
View file @
982b39ac
...
...
@@ -154,12 +154,13 @@ class YHResourceDetailDocumentsCell: UITableViewCell {
return
}
let
newImageHeight
=
image
.
size
.
height
/
image
.
size
.
width
*
imageWidth
// 关键:用 updateConstraints 而不是 remakeConstraints
imageView
.
snp
.
updateConstraints
{
make
in
make
.
height
.
equalTo
(
newImageHeight
)
if
abs
(
newImageHeight
-
imageHeight
)
>
10
{
// 关键:用 updateConstraints 而不是 remakeConstraints
imageView
.
snp
.
updateConstraints
{
make
in
make
.
height
.
equalTo
(
newImageHeight
)
}
self
.
onImageHeightChanged
?()
}
self
.
onImageHeightChanged
?()
}
}
else
{
// 设置图片视图的高度
...
...
galaxy/galaxy/Classes/Modules/Mine(我的)/NameCard(名片)/M/YHDynamicItem.swift
View file @
982b39ac
...
...
@@ -6,17 +6,16 @@
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
import
SmartCodable
import
UIKit
class
YHDynamicListModel
:
SmartCodable
{
var
total
:
Int
=
0
var
page
:
Int
=
0
var
pageSize
:
Int
=
0
var
list
:
[
YHDynamicItem
]
=
[]
required
init
()
{
}
}
...
...
@@ -24,26 +23,26 @@ class YHResourceURLs: SmartCodable {
var
name
:
String
=
""
var
url
:
String
=
""
var
type
:
Int
=
0
var
width
:
String
=
"0"
var
height
:
String
=
"0"
required
init
()
{
}
}
class
YHDynamicItem
:
SmartCodable
{
var
id
:
String
=
""
// 动态id
var
user_id
:
String
=
""
var
title
:
String
=
""
var
content
:
String
=
""
var
resource_urls
:
[
YHResourceURLs
]
=
[]
var
visibility
:
Int
=
0
// 0-未知 1-公开,2-好友可见,3-仅自己可见
var
audit_status
:
Int
=
0
// 0-未知 1-待审核,2-审核通过,3-不通过
var
ai_audit_status
:
Int
=
0
// 0-未知 1-待审核,2-审核通过,3-不通过
var
violation_reason
:
Int
=
0
// 违规原因 0-未知
var
status
:
Int
=
0
// 状态:0-未知 1-上架中 2-已下架
var
violation_remark
:
String
=
""
// 违规详情
var
ai_audit_remark
:
String
=
""
// ai审核依据
var
visibility
:
Int
=
0
// 0-未知 1-公开,2-好友可见,3-仅自己可见
var
audit_status
:
Int
=
0
// 0-未知 1-待审核,2-审核通过,3-不通过
var
ai_audit_status
:
Int
=
0
// 0-未知 1-待审核,2-审核通过,3-不通过
var
violation_reason
:
Int
=
0
// 违规原因 0-未知
var
status
:
Int
=
0
// 状态:0-未知 1-上架中 2-已下架
var
violation_remark
:
String
=
""
// 违规详情
var
ai_audit_remark
:
String
=
""
// ai审核依据
var
click_count
:
Int
=
0
var
like_count
:
Int
=
0
var
comment_count
:
Int
=
0
...
...
@@ -54,9 +53,91 @@ class YHDynamicItem: SmartCodable {
var
release_time
:
String
=
""
var
format_release_time
:
String
=
""
var
created_at
:
String
=
""
var
is_self_posts
:
Int
=
0
// 是否是自己的动态
var
is_self_posts
:
Int
=
0
// 是否是自己的动态
// MARK: - 高度计算相关属性
// 实际使用的图片宽高
var
img_width_use
:
CGFloat
=
0
var
img_height_use
:
CGFloat
=
0
// cell的宽高
var
img_width_cell
:
CGFloat
=
0
var
img_height_cell
:
CGFloat
=
0
// 描述的高度
var
textH
:
CGFloat
=
16.0
var
isCalHeight
=
false
var
maxImageHeight
:
CGFloat
=
280
var
minImageHeight
:
CGFloat
=
140
var
firstImageResource
:
YHResourceURLs
?
{
return
resource_urls
.
first
{
resource
in
resource
.
type
==
1
&&
!
resource
.
url
.
isEmpty
}
}
required
init
()
{
}
func
calHeightParam
(
_
defaultImageHeight
:
CGFloat
=
0
)
{
if
isCalHeight
,
defaultImageHeight
<=
0
{
return
}
isCalHeight
=
true
let
text
=
content
let
width
=
(
KScreenWidth
-
47
)
/
2
let
font
=
UIFont
.
PFSC_R
(
ofSize
:
15
)
// 字体大小改为15
let
maxWidth
=
width
-
16
// 最大宽度限制(左右各8的内边距)
// 创建NSAttributedString对象并设置属性
let
attributes
=
[
NSAttributedString
.
Key
.
font
:
font
]
as
[
NSAttributedString
.
Key
:
Any
]
// 根据指定的最大宽度和字体大小计算文本的高度
let
size
=
(
text
as
NSString
)
.
boundingRect
(
with
:
CGSize
(
width
:
maxWidth
,
height
:
.
greatestFiniteMagnitude
),
options
:
.
usesLineFragmentOrigin
,
attributes
:
attributes
,
context
:
nil
)
.
size
var
textHeight
:
CGFloat
=
size
.
height
// 固定2行的最大高度(行高约21,2行约42)
if
textHeight
>
42.0
{
textHeight
=
42.0
}
else
if
textHeight
<
21
{
textHeight
=
21
}
textH
=
textHeight
// 计算图片高度
var
imageHeight
:
CGFloat
=
0.0
if
let
firstResource
=
firstImageResource
{
let
imageSize
=
CGSize
(
width
:
Double
(
firstResource
.
width
)
??
0
,
height
:
Double
(
firstResource
.
height
)
??
0
)
if
imageSize
.
width
==
0
||
imageSize
.
height
==
0
,
defaultImageHeight
<=
0
{
imageHeight
=
width
}
else
{
imageHeight
=
defaultImageHeight
>
0
?
defaultImageHeight
:
width
*
imageSize
.
height
/
imageSize
.
width
if
imageHeight
>
maxImageHeight
{
imageHeight
=
maxImageHeight
}
else
if
imageHeight
<
minImageHeight
{
imageHeight
=
minImageHeight
}
}
}
else
{
imageHeight
=
width
}
// 计算总高度
// 图片高度 + 顶部间距10 + 头像16 + 内容间距10 + 文本高度(约40) + 底部间距10
let
totalHeight
=
imageHeight
+
12
+
16
+
12
+
textHeight
+
12
img_width_use
=
width
img_height_use
=
imageHeight
img_width_cell
=
width
img_height_cell
=
totalHeight
}
}
galaxy/galaxy/Classes/Modules/Mine(我的)/NameCard(名片)/V/YHNameCardDynamicCell.swift
View file @
982b39ac
...
...
@@ -15,7 +15,7 @@ class YHNameCardDynamicCell: UITableViewCell {
static
let
imgH
:
CGFloat
=
(
KScreenWidth
-
20*
2
-
4*
2
)
/
3.0
var
rePublishClick
:
(()
->
()
)?
var
rePublishClick
:
(()
->
Void
)?
private
lazy
var
publishLabel
:
UILabel
=
{
let
label
=
UILabel
()
...
...
galaxy/galaxy/Classes/Modules/Mine(我的)/NameCard(名片)/VM/YHDynamicViewModel.swift
View file @
982b39ac
...
...
@@ -15,8 +15,9 @@ class YHDynamicViewModel: YHBaseViewModel {
var
totalCount
:
Int
=
0
var
dynamicArr
:
[
YHDynamicItem
]
=
[]
var
hasMore
:
Bool
=
true
var
preloadItemIndex
:
Int
=
25
func
getList
(
_
firstFlag
:
Bool
,
sourceType
:
Int
,
other_user_id
:
String
,
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
Void
)
{
func
getList
(
_
firstFlag
:
Bool
,
sourceType
:
Int
,
other_user_id
:
String
=
""
,
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
Void
)
{
var
params
:
[
String
:
Any
]
=
[
"page"
:
curPageIndex
]
if
firstFlag
{
curPageIndex
=
1
...
...
@@ -73,3 +74,63 @@ class YHDynamicViewModel: YHBaseViewModel {
}
}
}
// MARK: - 点赞功能扩展
extension
YHDynamicViewModel
{
/// 点赞/取消点赞动态
/// - Parameters:
/// - id: 动态ID
/// - operation: 操作类型 1-点赞 2-取消点赞
/// - callBackBlock: 回调
func
getLike
(
_
id
:
String
,
_
operation
:
Int
,
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
Void
)
{
let
params
:
[
String
:
Any
]
=
[
"id"
:
id
,
"operation"
:
operation
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Dynamic
.
like
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
,
params
:
params
)
{
json
,
_
in
if
json
.
code
==
200
{
callBackBlock
(
true
,
nil
)
}
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
)
callBackBlock
(
false
,
error
)
}
}
failBlock
:
{
err
in
callBackBlock
(
false
,
err
)
}
}
}
// MARK: - 发布动态
extension
YHDynamicViewModel
{
/// 发布动态
/// - Parameters:
/// - title: 标题
/// - content: 内容
/// - resources:图片/视频数组
/// - callBackBlock: 回调
func
publishCircle
(
_
title
:
String
,
_
content
:
String
,
resources
:
[
YHResourceURLs
],
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
Void
)
{
var
params
:
[
String
:
Any
]
=
[
"title"
:
title
,
"content"
:
content
]
params
[
"resource_urls"
]
=
resources
.
map
{
resource
in
[
"name"
:
resource
.
name
,
"url"
:
resource
.
url
,
"type"
:
resource
.
type
,
"width"
:
resource
.
width
,
"height"
:
resource
.
height
]
as
[
String
:
Any
]
}
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Dynamic
.
publishCircle
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
,
params
:
params
)
{
json
,
_
in
if
json
.
code
==
200
{
callBackBlock
(
true
,
nil
)
}
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
)
callBackBlock
(
false
,
error
)
}
}
failBlock
:
{
err
in
callBackBlock
(
false
,
err
)
}
}
}
galaxy/galaxy/Classes/Modules/PictureReview(图片预览)/YHSelectMediaItem.swift
View file @
982b39ac
...
...
@@ -15,6 +15,18 @@ class YHSelectMediaItem {
var
videoURL
:
URL
?
var
duration
:
TimeInterval
?
// 新增:上传状态管理
var
uploadState
:
UploadState
=
.
pending
var
resourceURL
:
YHResourceURLs
?
// 上传成功后的资源信息
var
uploadError
:
YHErrorModel
?
enum
UploadState
{
case
pending
// 待上传
case
uploading
// 上传中
case
success
// 上传成功
case
failed
// 上传失败
}
init
(
name
:
String
=
""
,
type
:
YHMediaType
=
.
image
,
image
:
UIImage
?
=
nil
,
videoURL
:
URL
?
=
nil
,
duration
:
TimeInterval
?
=
nil
)
{
self
.
name
=
name
self
.
type
=
type
...
...
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
View file @
982b39ac
...
...
@@ -786,5 +786,7 @@ class YHAllApiName {
struct
Dynamic
{
static
let
list
=
"super-app/content/posts/list"
static
let
like
=
"super-app/content/posts/message-like"
static
let
publishCircle
=
"super-app/content/posts/add"
}
}
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