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
20d7d958
Commit
20d7d958
authored
Oct 11, 2025
by
Alex朱枝文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
我的公司相关
parent
604ef0b7
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
574 additions
and
44 deletions
+574
-44
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+8
-0
YHCompanyAuthorizationViewController.swift
...Resource(资源)/C/YHCompanyAuthorizationViewController.swift
+208
-0
YHResourceDetailViewController.swift
...y(社区)/Resource(资源)/C/YHResourceDetailViewController.swift
+79
-16
YHResourceViewController.swift
...mmunity(社区)/Resource(资源)/C/YHResourceViewController.swift
+13
-3
YHResourceListModel.swift
...es/Community(社区)/Resource(资源)/M/YHResourceListModel.swift
+9
-10
YHCompanyAuthSettingCell.swift
...mmunity(社区)/Resource(资源)/V/YHCompanyAuthSettingCell.swift
+118
-0
YHResourceDetailBaseInfoCell.swift
...ity(社区)/Resource(资源)/V/YHResourceDetailBaseInfoCell.swift
+4
-9
YHResourceDetailDemandCell.swift
...unity(社区)/Resource(资源)/V/YHResourceDetailDemandCell.swift
+1
-1
YHResourceDetailDocumentsCell.swift
...ty(社区)/Resource(资源)/V/YHResourceDetailDocumentsCell.swift
+0
-1
YHResourceViewModel.swift
...s/Community(社区)/Resource(资源)/VM/YHResourceViewModel.swift
+49
-0
YHSetExplainView.swift
...xy/Classes/Modules/Community(社区)/V/YHSetExplainView.swift
+4
-1
YHInformationAuthorizeViewModel.swift
...es/Community(社区)/VM/YHInformationAuthorizeViewModel.swift
+1
-1
YHSettingItem.swift
...xy/galaxy/Classes/Modules/Login(登录)/M/YHSettingItem.swift
+1
-0
YHAllowSettingTableViewCell.swift
...ses/Modules/Login(登录)/V/YHAllowSettingTableViewCell.swift
+1
-1
YHMyNewViewController.swift
...xy/Classes/Modules/Mine(我的)/C/YHMyNewViewController.swift
+56
-1
Contents.json
...unity/Resource/set_example_company.imageset/Contents.json
+22
-0
set_example_company@2x.png
...e/set_example_company.imageset/set_example_company@2x.png
+0
-0
set_example_company@3x.png
...e/set_example_company.imageset/set_example_company@3x.png
+0
-0
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
20d7d958
...
...
@@ -1187,6 +1187,8 @@
0487C1E02E8BCCDD00CE6472
/* YHResourceDetailDemandCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0487C1DF2E8BCCDD00CE6472
/* YHResourceDetailDemandCell.swift */
;
};
0487C1E22E8BCD0200CE6472
/* YHResourceDetailDocumentsCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0487C1E12E8BCD0200CE6472
/* YHResourceDetailDocumentsCell.swift */
;
};
0487C1FD2E99F8E800CE6472
/* YHKingfisherUtils.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0487C1FC2E99F8E800CE6472
/* YHKingfisherUtils.swift */
;
};
0487C1FF2E9A54A600CE6472
/* YHCompanyAuthorizationViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0487C1FE2E9A54A600CE6472
/* YHCompanyAuthorizationViewController.swift */
;
};
0487C2012E9A55A400CE6472
/* YHCompanyAuthSettingCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0487C2002E9A55A400CE6472
/* YHCompanyAuthSettingCell.swift */
;
};
048D6ADB2D5E00DE00BC6F4C
/* YHMemberCenterViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
048D6ADA2D5E00DE00BC6F4C
/* YHMemberCenterViewController.swift */
;
};
048D6ADD2D5EF0A900BC6F4C
/* YHMemberCenterHeaderView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
048D6ADC2D5EF0A900BC6F4C
/* YHMemberCenterHeaderView.swift */
;
};
048D6ADF2D5F0FBE00BC6F4C
/* YHMemberCenterHeaderBannerCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
048D6ADE2D5F0FBE00BC6F4C
/* YHMemberCenterHeaderBannerCell.swift */
;
};
...
...
@@ -2567,6 +2569,8 @@
0487C1DF2E8BCCDD00CE6472
/* YHResourceDetailDemandCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHResourceDetailDemandCell.swift
;
sourceTree
=
"<group>"
;
};
0487C1E12E8BCD0200CE6472
/* YHResourceDetailDocumentsCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHResourceDetailDocumentsCell.swift
;
sourceTree
=
"<group>"
;
};
0487C1FC2E99F8E800CE6472
/* YHKingfisherUtils.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHKingfisherUtils.swift
;
sourceTree
=
"<group>"
;
};
0487C1FE2E9A54A600CE6472
/* YHCompanyAuthorizationViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCompanyAuthorizationViewController.swift
;
sourceTree
=
"<group>"
;
};
0487C2002E9A55A400CE6472
/* YHCompanyAuthSettingCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCompanyAuthSettingCell.swift
;
sourceTree
=
"<group>"
;
};
048D6ADA2D5E00DE00BC6F4C
/* YHMemberCenterViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHMemberCenterViewController.swift
;
sourceTree
=
"<group>"
;
};
048D6ADC2D5EF0A900BC6F4C
/* YHMemberCenterHeaderView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHMemberCenterHeaderView.swift
;
sourceTree
=
"<group>"
;
};
048D6ADE2D5F0FBE00BC6F4C
/* YHMemberCenterHeaderBannerCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHMemberCenterHeaderBannerCell.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -7060,6 +7064,7 @@
children
=
(
04D4EC322E839C2B00B0329B
/* YHResourceViewController.swift */
,
0487C1D92E8BB58300CE6472
/* YHResourceDetailViewController.swift */
,
0487C1FE2E9A54A600CE6472
/* YHCompanyAuthorizationViewController.swift */
,
);
path
=
C
;
sourceTree
=
"<group>"
;
...
...
@@ -7082,6 +7087,7 @@
0487C1DB2E8BCC8200CE6472
/* YHResourceDetailHeaderCell.swift */
,
04355C922E8912490083BE91
/* YHResourceTableViewCell.swift */
,
04355C8F2E890E020083BE91
/* YHResourceCategoryView.swift */
,
0487C2002E9A55A400CE6472
/* YHCompanyAuthSettingCell.swift */
,
);
path
=
V
;
sourceTree
=
"<group>"
;
...
...
@@ -8316,6 +8322,7 @@
045C11DD2D12CA5F00BD2DC0
/* YHScoreDataModel.swift in Sources */
,
045C11DE2D12CA5F00BD2DC0
/* YHCertificateTemplateCell.swift in Sources */
,
045C11DF2D12CA5F00BD2DC0
/* YHCollegeSearchViewController.swift in Sources */
,
0487C1FF2E9A54A600CE6472
/* YHCompanyAuthorizationViewController.swift in Sources */
,
045C11E02D12CA5F00BD2DC0
/* YHResignInfoConfirmInfoListModel.swift in Sources */
,
045C11E12D12CA5F00BD2DC0
/* YHFileListContentView.swift in Sources */
,
045C11E22D12CA5F00BD2DC0
/* YHFamilyMemberViewModel.swift in Sources */
,
...
...
@@ -8646,6 +8653,7 @@
045C12E32D12CA5F00BD2DC0
/* YHServiceTableFootView.swift in Sources */
,
045C12E42D12CA5F00BD2DC0
/* YHMsgViewModel.swift in Sources */
,
045C12E52D12CA5F00BD2DC0
/* YHJsApi.swift in Sources */
,
0487C2012E9A55A400CE6472
/* YHCompanyAuthSettingCell.swift in Sources */
,
045C12E62D12CA5F00BD2DC0
/* YHScoreResultView.swift in Sources */
,
04AFEF492D5DDE180007A011
/* YHMyFunctionGroupItem2Cell.swift in Sources */
,
045C12E72D12CA5F00BD2DC0
/* YHAIChatShadowView.swift in Sources */
,
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/Resource(资源)/C/YHCompanyAuthorizationViewController.swift
0 → 100644
View file @
20d7d958
//
// YHCompanyAuthorizationViewController.swift
// galaxy
//
// Created by alexzzw on 2025/10/11.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHCompanyAuthorizationViewController
:
YHBaseViewController
{
// MARK: - Properties
var
detailModel
:
YHResourceDetailModel
?
// 详情数据
var
completionBlock
:
(()
->
Void
)?
private
lazy
var
viewModel
:
YHResourceViewModel
=
{
return
YHResourceViewModel
()
}()
private
var
items
:
[
YHSettingItem
]
=
[]
// MARK: - UI Components
private
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
if
#available(iOS 11.0, *)
{
tableView
.
contentInsetAdjustmentBehavior
=
.
never
}
tableView
.
backgroundColor
=
.
white
tableView
.
separatorStyle
=
.
none
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
tableView
.
register
(
cellWithClass
:
YHCompanyAuthSettingCell
.
self
)
tableView
.
showsVerticalScrollIndicator
=
false
return
tableView
}()
private
lazy
var
completeButton
:
UIButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
button
.
backgroundColor
=
UIColor
.
brandGrayColor8
button
.
titleLabel
?
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
16
)
button
.
setTitle
(
"完成"
,
for
:
.
normal
)
button
.
setTitleColor
(
.
white
,
for
:
.
normal
)
button
.
layer
.
cornerRadius
=
3
button
.
addTarget
(
self
,
action
:
#selector(
completeAction
)
,
for
:
.
touchUpInside
)
return
button
}()
// MARK: - Lifecycle
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
setupUI
()
loadData
()
}
// MARK: - Setup
private
func
setupUI
()
{
gk_navTitle
=
"信息授权"
view
.
backgroundColor
=
.
white
view
.
addSubview
(
tableView
)
view
.
addSubview
(
completeButton
)
tableView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
k_Height_NavigationtBarAndStatuBar
)
make
.
left
.
right
.
equalToSuperview
()
make
.
bottom
.
equalTo
(
completeButton
.
snp
.
top
)
.
offset
(
-
12
)
}
completeButton
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
16
)
make
.
right
.
equalTo
(
-
16
)
make
.
bottom
.
equalTo
(
-
k_Height_safeAreaInsetsBottom
()
-
12
)
make
.
height
.
equalTo
(
48
)
}
}
// MARK: - Data
private
func
loadData
()
{
guard
let
detailModel
=
detailModel
else
{
return
}
viewModel
.
isMyCompanyOpen
=
detailModel
.
isSettlement
let
item
=
YHSettingItem
.
init
(
type
:
.
companyToStrange
,
title
:
"允许公开您的公司信息"
,
subTitle
:
"开启后,您的公司信息将展示在资源列表,包括企业服务与企业需求"
,
isSelect
:
viewModel
.
isMyCompanyOpen
,
isShowAlert
:
true
)
self
.
items
=
[
item
]
self
.
tableView
.
reloadData
()
}
// MARK: - Actions
@objc
private
func
completeAction
()
{
guard
let
detailModel
=
detailModel
else
{
return
}
// 2-开启,3-关闭
let
status
=
detailModel
.
isSettlement
?
3
:
2
YHHUD
.
show
(
.
progress
(
message
:
"加载中..."
))
viewModel
.
companyAuthor
(
status
:
status
)
{
[
weak
self
]
success
,
errorMsg
in
guard
let
self
=
self
else
{
return
}
YHHUD
.
hide
()
if
success
{
self
.
completionBlock
?()
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
}
else
{
YHHUD
.
flash
(
message
:
errorMsg
??
"授权失败,请重试"
)
}
}
}
@objc
private
func
infoButtonTapped
(
_
sender
:
UIButton
)
{
guard
sender
.
tag
<
items
.
count
else
{
return
}
let
model
=
items
[
sender
.
tag
]
showExplanationView
(
for
:
model
)
}
// MARK: - Private Methods
private
func
handleSwitchToggle
(
at
index
:
Int
,
isOn
:
Bool
)
{
guard
index
<
items
.
count
else
{
return
}
let
model
=
items
[
index
]
switch
model
.
type
{
case
.
companyToStrange
:
if
!
isOn
{
YHGrayCommonAlertView
.
show
(
""
,
"关闭后,您的公司信息将不展示在资源列表"
,
"仍然关闭"
,
"保持开启"
,
fullGuestureEnable
:
false
,
cancelCallBack
:
{
[
weak
self
]
in
self
?
.
updateModelState
(
at
:
index
,
isEnabled
:
false
)
},
callBack
:
{
[
weak
self
]
in
self
?
.
revertSwitchState
(
at
:
index
,
to
:
true
)
}
)
}
else
{
updateModelState
(
at
:
index
,
isEnabled
:
true
)
}
default
:
break
}
}
private
func
updateModelState
(
at
index
:
Int
,
isEnabled
:
Bool
)
{
items
[
index
]
.
isSelect
=
isEnabled
viewModel
.
isMyCompanyOpen
=
isEnabled
tableView
.
reloadRows
(
at
:
[
IndexPath
(
row
:
index
,
section
:
0
)],
with
:
.
none
)
}
private
func
revertSwitchState
(
at
index
:
Int
,
to
value
:
Bool
)
{
items
[
index
]
.
isSelect
=
value
tableView
.
reloadRows
(
at
:
[
IndexPath
(
row
:
index
,
section
:
0
)],
with
:
.
none
)
}
private
func
showExplanationView
(
for
model
:
YHSettingItem
)
{
let
view
=
YHSetExplainView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
KScreenHeight
))
view
.
type
=
model
.
type
let
window
=
UIApplication
.
shared
.
yhKeyWindow
()
window
?
.
addSubview
(
view
)
}
}
// MARK: - UITableViewDelegate & DataSource
extension
YHCompanyAuthorizationViewController
:
UITableViewDelegate
,
UITableViewDataSource
{
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
return
items
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withClass
:
YHCompanyAuthSettingCell
.
self
)
let
model
=
items
[
indexPath
.
row
]
cell
.
configure
(
with
:
model
)
cell
.
infoButton
.
tag
=
indexPath
.
row
cell
.
infoButton
.
addTarget
(
self
,
action
:
#selector(
infoButtonTapped(_:)
)
,
for
:
.
touchUpInside
)
cell
.
onSwitchToggle
=
{
[
weak
self
]
isOn
in
self
?
.
handleSwitchToggle
(
at
:
indexPath
.
row
,
isOn
:
isOn
)
}
return
cell
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
UITableView
.
automaticDimension
}
func
tableView
(
_
tableView
:
UITableView
,
estimatedHeightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
100
}
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
func
tableView
(
_
tableView
:
UITableView
,
heightForHeaderInSection
section
:
Int
)
->
CGFloat
{
return
0.01
}
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
func
tableView
(
_
tableView
:
UITableView
,
heightForFooterInSection
section
:
Int
)
->
CGFloat
{
return
0.01
}
}
galaxy/galaxy/Classes/Modules/Community(社区)/Resource(资源)/C/YHResourceDetailViewController.swift
View file @
20d7d958
...
...
@@ -12,15 +12,11 @@ import SnapKit
class
YHResourceDetailViewController
:
YHBaseViewController
{
// MARK: - Properties
/// 如果true,对应传入detailModel,否则,必传companyId
var
isMyCompany
:
Bool
=
false
var
companyId
:
Int
=
0
// 只需要传入公司ID
var
detailModel
:
YHResourceDetailModel
?
// 详情数据
var
isMyCompany
:
Bool
=
false
{
didSet
{
updateViewIsMine
()
}
}
private
lazy
var
viewModel
:
YHResourceViewModel
=
{
return
YHResourceViewModel
()
}()
...
...
@@ -60,6 +56,12 @@ class YHResourceDetailViewController: YHBaseViewController {
return
view
}()
private
lazy
var
bottomBarView
:
UIView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
.
white
return
view
}()
private
lazy
var
bottomActionView
:
UIView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
.
white
...
...
@@ -81,7 +83,15 @@ class YHResourceDetailViewController: YHBaseViewController {
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
setupUI
()
loadData
()
if
isMyCompany
{
if
detailModel
!=
nil
{
tableView
.
reloadData
()
}
else
{
loadData
(
true
)
}
}
else
{
loadData
(
false
)
}
}
// MARK: - Setup
...
...
@@ -92,6 +102,7 @@ class YHResourceDetailViewController: YHBaseViewController {
gk_backImage
=
UIImage
(
named
:
"nav_black_24"
)
view
.
addSubview
(
bgIcon
)
view
.
addSubview
(
tableView
)
view
.
addSubview
(
bottomBarView
)
view
.
addSubview
(
bottomActionView
)
bottomActionView
.
addSubview
(
contactButton
)
setupConstraints
()
...
...
@@ -109,16 +120,30 @@ class YHResourceDetailViewController: YHBaseViewController {
make
.
top
.
left
.
right
.
bottom
.
equalToSuperview
()
}
table
View
.
snp
.
makeConstraints
{
make
in
bottomBar
View
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
top
.
equalTo
(
k_Height_NavigationtBarAndStatuBar
)
make
.
bottom
.
equalTo
(
bottomActionView
.
snp
.
top
)
make
.
bottom
.
equalToSuperview
(
)
make
.
top
.
equalTo
(
view
.
safeAreaLayoutGuide
.
snp
.
bottom
)
}
bottomActionView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
bottom
.
equalToSuperview
()
make
.
top
.
equalTo
(
view
.
safeAreaLayoutGuide
.
snp
.
bottom
)
.
offset
(
-
64
)
make
.
bottom
.
equalTo
(
bottomBarView
.
snp
.
top
)
make
.
height
.
equalTo
(
64
)
}
if
isMyCompany
{
tableView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
top
.
equalTo
(
k_Height_NavigationtBarAndStatuBar
)
make
.
bottom
.
equalTo
(
bottomBarView
.
snp
.
top
)
}
}
else
{
tableView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
top
.
equalTo
(
k_Height_NavigationtBarAndStatuBar
)
make
.
bottom
.
equalTo
(
bottomActionView
.
snp
.
top
)
}
}
contactButton
.
snp
.
makeConstraints
{
make
in
...
...
@@ -133,8 +158,13 @@ class YHResourceDetailViewController: YHBaseViewController {
private
func
updateRightBarButtonItem
()
{
if
isMyCompany
{
/*
let rightButtonItem = UIBarButtonItem(image: UIImage(named: "name_card_authorize")?.withRenderingMode(.alwaysOriginal), style: .plain, target: self, action: #selector(authorizeBtnClicked))
gk_navRightBarButtonItem = rightButtonItem
gk_navItemRightSpace = 16
*/
let
rightButtonItem
=
UIBarButtonItem
(
image
:
UIImage
(
named
:
"
service_center_mor
e"
)?
.
withRenderingMode
(
.
alwaysOriginal
),
image
:
UIImage
(
named
:
"
name_card_authoriz
e"
)?
.
withRenderingMode
(
.
alwaysOriginal
),
style
:
.
plain
,
target
:
self
,
action
:
#selector(
moreButtonClicked
)
...
...
@@ -142,6 +172,8 @@ class YHResourceDetailViewController: YHBaseViewController {
gk_navRightBarButtonItem
=
rightButtonItem
gk_navItemRightSpace
=
16
}
else
{
// 不显示按钮了
/*
let rightButtonItem = UIBarButtonItem(
image: UIImage(named: "share_item")?.withRenderingMode(.alwaysOriginal),
style: .plain,
...
...
@@ -150,12 +182,31 @@ class YHResourceDetailViewController: YHBaseViewController {
)
gk_navRightBarButtonItem = rightButtonItem
gk_navItemRightSpace = 16
*/
}
}
// MARK: - Data
private
func
loadData
()
{
private
func
loadData
(
_
isMine
:
Bool
=
false
)
{
if
isMine
{
// 直接调用详情接口
YHHUD
.
show
(
.
progress
(
message
:
"加载中..."
))
viewModel
.
getMyCompanyDetail
{
[
weak
self
]
detail
,
error
in
guard
let
self
=
self
else
{
return
}
DispatchQueue
.
main
.
async
{
YHHUD
.
hide
()
if
let
detail
=
detail
{
self
.
detailModel
=
detail
self
.
tableView
.
reloadData
()
}
else
{
YHHUD
.
flash
(
message
:
error
?
.
errorMsg
??
"获取信息异常,请重试"
)
}
}
}
}
else
{
guard
companyId
>
0
else
{
YHHUD
.
flash
(
message
:
"公司ID无效"
)
return
...
...
@@ -168,8 +219,8 @@ class YHResourceDetailViewController: YHBaseViewController {
DispatchQueue
.
main
.
async
{
YHHUD
.
hide
()
if
let
detail
=
detail
{
self
.
companyId
=
detail
.
id
self
.
detailModel
=
detail
self
.
tableView
.
reloadData
()
}
else
if
let
error
=
error
{
...
...
@@ -179,6 +230,8 @@ class YHResourceDetailViewController: YHBaseViewController {
}
}
}
// MARK: - Actions
@objc
private
func
shareButtonClicked
()
{
...
...
@@ -186,7 +239,17 @@ class YHResourceDetailViewController: YHBaseViewController {
}
@objc
private
func
moreButtonClicked
()
{
// 更多操作
// 更多操作,直接跳授权页
guard
let
detailModel
=
detailModel
else
{
YHHUD
.
flash
(
message
:
"请稍候"
)
return
}
let
ctl
=
YHCompanyAuthorizationViewController
()
ctl
.
detailModel
=
detailModel
ctl
.
completionBlock
=
{
[
weak
self
]
in
self
?
.
loadData
(
true
)
}
navigationController
?
.
pushViewController
(
ctl
,
animated
:
true
)
}
@objc
private
func
contactButtonClicked
()
{
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/Resource(资源)/C/YHResourceViewController.swift
View file @
20d7d958
...
...
@@ -277,11 +277,14 @@ private extension YHResourceViewController {
}
func
setupPullToRefresh
()
{
resourceTableView
.
es
.
addYHPullToRefresh
{
resourceTableView
.
es
.
addYHPullToRefresh
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
self
.
loadCategories
()
self
.
getData
()
}
resourceTableView
.
es
.
addInfiniteScrolling
{
resourceTableView
.
es
.
addInfiniteScrolling
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
self
.
loadMoreData
()
}
...
...
@@ -316,7 +319,7 @@ private extension YHResourceViewController {
self
.
allCategories
=
categories
self
.
categoryView
.
setCategories
(
categories
)
}
else
if
let
error
=
error
{
print
(
"加载分类失败:
\(
error
)
"
)
print
Log
(
"加载分类失败:
\(
error
)
"
)
}
}
}
...
...
@@ -579,7 +582,14 @@ extension YHResourceViewController: UITableViewDelegate, UITableViewDataSource {
// 跳转到详情页
let
vc
=
YHResourceDetailViewController
()
if
model
.
is_owner
==
1
{
vc
.
isMyCompany
=
true
vc
.
companyId
=
model
.
id
}
else
{
vc
.
isMyCompany
=
false
vc
.
companyId
=
model
.
id
}
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
}
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/Resource(资源)/M/YHResourceListModel.swift
View file @
20d7d958
...
...
@@ -37,7 +37,7 @@ class YHCompanyDocument: SmartCodable {
class
YHResourceDetailModel
:
SmartCodable
{
required
init
()
{}
var
co
ntract
_avatar
:
YHCompanyAvatar
?
var
co
mpany
_avatar
:
YHCompanyAvatar
?
var
id
:
Int
=
0
var
company_name
:
String
=
""
var
company_english_name
:
String
=
""
...
...
@@ -46,7 +46,7 @@ class YHResourceDetailModel: SmartCodable {
var
last_processed_time
:
String
=
""
var
processor_id
:
Int
=
0
var
processor
:
String
=
""
var
settlement_status
:
Int
=
0
var
settlement_status
:
Int
=
0
// 1,2 已授权 3.未授权
var
settlement_status_str
:
String
=
""
var
resource_provided
:
String
=
""
var
demand_published
:
String
=
""
...
...
@@ -62,12 +62,16 @@ class YHResourceDetailModel: SmartCodable {
// 计算属性
var
companyLogoUrl
:
String
{
return
co
ntract
_avatar
?
.
url
??
""
return
co
mpany
_avatar
?
.
url
??
""
}
var
displayName
:
String
{
return
company_name
.
isEmpty
?
company_english_name
:
company_name
}
var
isSettlement
:
Bool
{
return
settlement_status
!=
3
&&
settlement_status
!=
0
}
}
// MARK: - 资源列表模型(公司信息)
...
...
@@ -77,6 +81,7 @@ class YHResourceListModel: SmartCodable {
var
isService
=
true
// MARK: - 基本信息(匹配列表API)
var
is_owner
:
Int
=
0
// 0-非所属公司,1-所属公司
var
id
:
Int
=
0
var
company_avatar
:
YHCompanyAvatar
?
var
company_name
:
String
=
""
...
...
@@ -90,7 +95,7 @@ class YHResourceListModel: SmartCodable {
var
company_introduction
:
String
=
""
// 公司介绍
var
company_business
:
String
=
""
// 主营业务
var
company_information
:
[
YHCompanyDocument
]
=
[]
// 公司资料
var
settlement_status
:
Int
=
0
var
settlement_status
:
Int
=
0
// 1,2 已授权 3.未授权
var
settlement_status_str
:
String
=
""
// MARK: - 计算属性
...
...
@@ -188,12 +193,6 @@ class YHResourceListModel: SmartCodable {
self
.
demand_published
=
detail
.
demand_published
}
}
/// 增加浏览量(兼容方法)
func
incrementViewCount
()
{
// 如果需要调用接口增加浏览量,在这里实现
print
(
"增加浏览量"
)
}
}
// MARK: - 资源分类模型
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/Resource(资源)/V/YHCompanyAuthSettingCell.swift
0 → 100644
View file @
20d7d958
//
// YHCompanyAuthSettingCell.swift
// galaxy
//
// Created by alexzzw on 2025/10/11.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHCompanyAuthSettingCell
:
UITableViewCell
{
// MARK: - Callback
var
onSwitchToggle
:
((
Bool
)
->
Void
)?
// MARK: - UI Components
private
lazy
var
titleLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
16
)
label
.
textColor
=
UIColor
.
brandGrayColor8
return
label
}()
lazy
var
infoButton
:
UIButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
button
.
setImage
(
UIImage
(
named
:
"my_card_set_alert"
),
for
:
.
normal
)
button
.
YH_clickEdgeInsets
=
UIEdgeInsets
(
top
:
20
,
left
:
20
,
bottom
:
20
,
right
:
20
)
return
button
}()
private
lazy
var
descriptionLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
13
)
label
.
textColor
=
UIColor
.
brandGrayColor5
label
.
numberOfLines
=
0
return
label
}()
private
lazy
var
toggleSwitch
:
UISwitch
=
{
let
switchView
=
UISwitch
()
switchView
.
onTintColor
=
UIColor
.
brandGrayColor8
switchView
.
transform
=
CGAffineTransform
(
scaleX
:
0.77
,
y
:
0.77
)
switchView
.
addTarget
(
self
,
action
:
#selector(
switchValueChanged(_:)
)
,
for
:
.
valueChanged
)
return
switchView
}()
// MARK: - Initialization
override
init
(
style
:
UITableViewCell
.
CellStyle
,
reuseIdentifier
:
String
?)
{
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
setupUI
()
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
// MARK: - Setup UI
private
func
setupUI
()
{
selectionStyle
=
.
none
contentView
.
backgroundColor
=
.
white
backgroundColor
=
.
white
contentView
.
addSubview
(
titleLabel
)
contentView
.
addSubview
(
infoButton
)
contentView
.
addSubview
(
descriptionLabel
)
contentView
.
addSubview
(
toggleSwitch
)
toggleSwitch
.
snp
.
makeConstraints
{
make
in
make
.
right
.
equalTo
(
-
21
)
make
.
centerY
.
equalToSuperview
()
make
.
width
.
equalTo
(
40
)
make
.
height
.
equalTo
(
22
)
}
titleLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
21
)
make
.
top
.
equalTo
(
16
)
make
.
right
.
lessThanOrEqualTo
(
toggleSwitch
.
snp
.
left
)
.
offset
(
-
12
)
}
infoButton
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
titleLabel
.
snp
.
right
)
.
offset
(
4
)
make
.
centerY
.
equalTo
(
titleLabel
)
make
.
width
.
height
.
equalTo
(
18
)
}
descriptionLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
21
)
make
.
right
.
equalTo
(
toggleSwitch
.
snp
.
left
)
.
offset
(
-
26
)
make
.
top
.
equalTo
(
titleLabel
.
snp
.
bottom
)
.
offset
(
8
)
make
.
bottom
.
equalTo
(
-
16
)
.
priority
(
.
high
)
}
}
// MARK: - Actions
@objc
private
func
switchValueChanged
(
_
sender
:
UISwitch
)
{
onSwitchToggle
?(
sender
.
isOn
)
}
// MARK: - Public Methods
func
configure
(
with
model
:
YHSettingItem
)
{
titleLabel
.
text
=
model
.
title
descriptionLabel
.
text
=
model
.
subTitle
toggleSwitch
.
isOn
=
model
.
isSelect
infoButton
.
isHidden
=
!
model
.
isShowAlert
}
// MARK: - Reuse
override
func
prepareForReuse
()
{
super
.
prepareForReuse
()
onSwitchToggle
=
nil
infoButton
.
removeTarget
(
nil
,
action
:
nil
,
for
:
.
allEvents
)
titleLabel
.
text
=
nil
descriptionLabel
.
text
=
nil
toggleSwitch
.
isOn
=
false
infoButton
.
isHidden
=
true
}
}
galaxy/galaxy/Classes/Modules/Community(社区)/Resource(资源)/V/YHResourceDetailBaseInfoCell.swift
View file @
20d7d958
...
...
@@ -74,15 +74,10 @@ class YHResourceDetailBaseInfoCell: UITableViewCell {
stackView
.
arrangedSubviews
.
forEach
{
$0
.
removeFromSuperview
()
}
// 使用详情接口的字段
addInfoRow
(
title
:
"企业介绍"
,
content
:
model
.
company_introduction
.
isEmpty
?
"未填写"
:
model
.
company_introduction
)
addInfoRow
(
title
:
"主营业务"
,
content
:
model
.
company_business
.
isEmpty
?
"未填写"
:
model
.
company_business
)
addInfoRow
(
title
:
"提供服务"
,
content
:
model
.
resource_provided
.
isEmpty
?
"未填写"
:
model
.
resource_provided
)
addInfoRow
(
title
:
"发布需求"
,
content
:
model
.
demand_published
.
isEmpty
?
"未填写"
:
model
.
demand_published
)
addInfoRow
(
title
:
"行业类型"
,
content
:
model
.
industry_type_str
.
isEmpty
?
"未填写"
:
model
.
industry_type_str
)
if
!
model
.
settlement_status_str
.
isEmpty
{
addInfoRow
(
title
:
"入驻状态"
,
content
:
model
.
settlement_status_str
)
}
addInfoRow
(
title
:
"企业介绍"
,
content
:
model
.
company_introduction
.
isEmpty
?
"-"
:
model
.
company_introduction
)
addInfoRow
(
title
:
"主营业务"
,
content
:
model
.
company_business
.
isEmpty
?
"-"
:
model
.
company_business
)
addInfoRow
(
title
:
"提供服务"
,
content
:
model
.
resource_provided
.
isEmpty
?
"-"
:
model
.
resource_provided
)
addInfoRow
(
title
:
"行业类型"
,
content
:
model
.
industry_type_str
.
isEmpty
?
"-"
:
model
.
industry_type_str
)
}
private
func
addInfoRow
(
title
:
String
,
content
:
String
)
{
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/Resource(资源)/V/YHResourceDetailDemandCell.swift
View file @
20d7d958
...
...
@@ -87,6 +87,6 @@ class YHResourceDetailDemandCell: UITableViewCell {
func
configure
(
with
model
:
YHResourceDetailModel
)
{
// 使用详情接口的 demand_published 字段
demandContentLabel
.
text
=
model
.
demand_published
.
isEmpty
?
"
未填写
"
:
model
.
demand_published
demandContentLabel
.
text
=
model
.
demand_published
.
isEmpty
?
"
-
"
:
model
.
demand_published
}
}
galaxy/galaxy/Classes/Modules/Community(社区)/Resource(资源)/V/YHResourceDetailDocumentsCell.swift
View file @
20d7d958
...
...
@@ -138,7 +138,6 @@ class YHResourceDetailDocumentsCell: UITableViewCell {
for
(
index
,
imageUrl
)
in
images
.
enumerated
()
{
let
imageView
=
UIImageView
()
imageView
.
contentMode
=
.
scaleAspectFit
imageView
.
backgroundColor
=
UIColor
.
systemGray6
imageView
.
isUserInteractionEnabled
=
true
if
let
url
=
URL
(
string
:
imageUrl
)
{
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/Resource(资源)/VM/YHResourceViewModel.swift
View file @
20d7d958
...
...
@@ -23,6 +23,8 @@ class YHResourceViewModel: NSObject {
var
selectedCategories
:
[
YHResourceCategory
]
=
[]
var
searchKeyword
:
String
?
var
isMyCompanyOpen
:
Bool
=
false
override
init
()
{
super
.
init
()
}
...
...
@@ -177,4 +179,51 @@ class YHResourceViewModel: NSObject {
}
}
/// 获取公司详情
/// - Parameters:
/// - completion: 完成回调 // 错误码10005表示客户未注册公司
func
getMyCompanyDetail
(
completion
:
@escaping
(
YHResourceDetailModel
?,
YHErrorModel
?)
->
Void
)
{
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Resource
.
myCompany
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
,
params
:
[:])
{
json
,
_
in
if
json
.
code
==
200
{
guard
let
dic
=
json
.
data
?
.
peel
as?
[
String
:
Any
],
let
result
=
YHResourceDetailModel
.
deserialize
(
from
:
dic
)
else
{
let
errorModel
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
-
10001
,
errorMsg
:
"数据解析失败"
)
completion
(
nil
,
errorModel
)
return
}
completion
(
result
,
nil
)
}
else
{
let
errorMsg
=
json
.
msg
.
isEmpty
?
"获取详情失败"
:
json
.
msg
let
errorModel
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
errorMsg
)
completion
(
nil
,
errorModel
)
}
}
failBlock
:
{
err
in
completion
(
nil
,
err
)
}
}
/// 授权公司公开
/// - Parameters:
/// - status: 2-开启,3-关闭
/// - completion: 完成回调
func
companyAuthor
(
status
:
Int
,
completion
:
@escaping
(
Bool
,
String
?)
->
Void
)
{
let
params
:
[
String
:
Any
]
=
[
"status"
:
status
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Resource
.
author
_
=
YHNetRequest
.
putRequest
(
url
:
strUrl
,
params
:
params
)
{
json
,
_
in
if
json
.
code
==
200
{
completion
(
true
,
nil
)
}
else
{
let
errorMsg
=
json
.
msg
.
isEmpty
?
"授权失败"
:
json
.
msg
completion
(
false
,
errorMsg
)
}
}
failBlock
:
{
err
in
let
errorMsg
=
err
.
errorMsg
completion
(
false
,
errorMsg
)
}
}
}
galaxy/galaxy/Classes/Modules/Community(社区)/V/YHSetExplainView.swift
View file @
20d7d958
...
...
@@ -42,7 +42,10 @@ class YHSetExplainView: UIView {
titleLabel
.
text
=
"允许向陌生人公开您的工作经历"
messageLabel
.
text
=
"授权开启后,您的个人主页将展示最新工作信息,仅对非好友人脉开放查看权限,保护您的隐私安全"
topImageView
.
image
=
UIImage
(
named
:
"set_example_work"
)
case
.
companyToStrange
:
titleLabel
.
text
=
"允许公开您的公司信息"
messageLabel
.
text
=
"授权开启后,您的公司信息将展示在资源列表,包括企业服务与企业需求"
topImageView
.
image
=
UIImage
(
named
:
"set_example_company"
)
}
}
}
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/VM/YHInformationAuthorizeViewModel.swift
View file @
20d7d958
...
...
@@ -106,7 +106,7 @@ class YHInformationAuthorizeViewModel: YHBaseViewModel {
func
updateSetModel
(
_
item
:
YHSettingItem
)
{
switch
item
.
type
{
case
.
normal
:
break
case
.
normal
,
.
companyToStrange
:
break
case
.
people
:
setModel
.
authorization_basic_information
=
item
.
isSelect
?
2
:
1
case
.
schoolToFriend
:
...
...
galaxy/galaxy/Classes/Modules/Login(登录)/M/YHSettingItem.swift
View file @
20d7d958
...
...
@@ -15,6 +15,7 @@ enum YHSettingType: Int {
case
workToStranger
case
schoolToFriend
case
workToFriend
case
companyToStrange
}
class
YHSettingItem
:
NSObject
{
...
...
galaxy/galaxy/Classes/Modules/Login(登录)/V/YHAllowSettingTableViewCell.swift
View file @
20d7d958
...
...
@@ -104,7 +104,7 @@ class YHAllowSettingTableViewCell: UITableViewCell {
@objc
func
switchViewChange
()
{
guard
let
model
=
item
else
{
return
}
switch
model
.
type
{
case
.
normal
:
case
.
normal
,
.
companyToStrange
:
model
.
isSelect
=
detailSwitch
.
isOn
if
let
block
=
block
{
block
(
model
)
...
...
galaxy/galaxy/Classes/Modules/Mine(我的)/C/YHMyNewViewController.swift
View file @
20d7d958
...
...
@@ -44,6 +44,17 @@ class YHMyNewViewController: YHBaseViewController {
return
vm
}()
private
lazy
var
resourceViewModel
:
YHResourceViewModel
=
{
return
YHResourceViewModel
()
}()
private
lazy
var
messageHandler
:
YHIMMessageHandler
=
{
return
YHIMMessageHandler
(
viewController
:
self
,
navigationController
:
navigationController
)
}()
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
CGRect
.
zero
,
style
:
.
grouped
)
tableView
.
contentInsetAdjustmentBehavior
=
.
never
...
...
@@ -825,9 +836,53 @@ extension YHMyNewViewController {
let
vc
=
YHMyGoodFriendsVC
()
self
.
navigationController
?
.
pushViewController
(
vc
)
case
.
myEnterprise
:
print
(
""
)
YHHUD
.
show
(
.
progress
(
message
:
""
))
resourceViewModel
.
getMyCompanyDetail
{
[
weak
self
]
resourceDetailModel
,
errorModel
in
guard
let
self
=
self
else
{
return
}
YHHUD
.
hide
()
guard
let
resourceDetailModel
=
resourceDetailModel
else
{
if
let
errorModel
=
errorModel
,
errorModel
.
errorCode
==
10005
{
self
.
showContactManagerDialog
()
}
else
{
YHHUD
.
flash
(
message
:
errorModel
?
.
errorMsg
??
"请稍候"
)
}
return
}
self
.
gotoMyCompany
(
resourceDetailModel
)
}
default
:
printLog
(
"不需要响应"
)
}
}
private
func
gotoMyCompany
(
_
detailModel
:
YHResourceDetailModel
)
{
// 跳转到详情页
let
vc
=
YHResourceDetailViewController
()
vc
.
isMyCompany
=
true
vc
.
detailModel
=
detailModel
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
private
func
showContactManagerDialog
()
{
YHGrayCommonAlertView
.
show
(
"暂未绑定企业"
,
"请您联系银河管家进行企业绑定,快来与我们联系吧~"
,
"返回"
,
"去联系"
,
fullGuestureEnable
:
false
)
{
}
callBack
:
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
YHHUD
.
show
(
.
progress
(
message
:
""
))
self
.
resourceViewModel
.
getDemandYhId
{
[
weak
self
]
id
in
guard
let
self
=
self
else
{
return
}
YHHUD
.
hide
()
if
id
.
isEmpty
{
YHHUD
.
flash
(
message
:
"获取银河ID失败"
)
return
}
self
.
messageHandler
.
gotoChatVC
(
senderID
:
id
)
}
}
}
}
galaxy/galaxy/Res/Assets.xcassets/Community/Resource/set_example_company.imageset/Contents.json
0 → 100644
View file @
20d7d958
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"set_example_company@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"set_example_company@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/Community/Resource/set_example_company.imageset/set_example_company@2x.png
0 → 100644
View file @
20d7d958
83.8 KB
galaxy/galaxy/Res/Assets.xcassets/Community/Resource/set_example_company.imageset/set_example_company@3x.png
0 → 100644
View file @
20d7d958
142 KB
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