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
69698f8a
Commit
69698f8a
authored
Nov 27, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// AI
parent
1aaccab7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
261 additions
and
26 deletions
+261
-26
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+8
-0
YHAIServiceListViewController.swift
...I/AI-Dialogue(AI对话)/C/YHAIServiceListViewController.swift
+53
-25
YHAITabViewController.swift
...odules/AI/AI-Dialogue(AI对话)/C/YHAITabViewController.swift
+1
-1
YHAIGreetCollectionReusableView.swift
...AI-Dialogue(AI对话)/V/YHAIGreetCollectionReusableView.swift
+76
-0
YHAIProductCell.swift
...sses/Modules/AI/AI-Dialogue(AI对话)/V/YHAIProductCell.swift
+123
-0
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
69698f8a
...
...
@@ -468,6 +468,8 @@
045F28402CF5ED3400520F19
/* YHAITabBarItemContentView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045F283F2CF5ED3400520F19
/* YHAITabBarItemContentView.swift */
;
};
045F28422CF6028A00520F19
/* YHAITabViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045F28412CF6028A00520F19
/* YHAITabViewController.swift */
;
};
045F28442CF608C100520F19
/* YHAIServiceListViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045F28432CF608C100520F19
/* YHAIServiceListViewController.swift */
;
};
045F28462CF6C47800520F19
/* YHAIProductCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045F28452CF6C47800520F19
/* YHAIProductCell.swift */
;
};
045F28482CF6EF9800520F19
/* YHAIGreetCollectionReusableView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
045F28472CF6EF9800520F19
/* YHAIGreetCollectionReusableView.swift */
;
};
0468D4222B493A5E00CFB916
/* YHPhoneMessageView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D4212B493A5E00CFB916
/* YHPhoneMessageView.swift */
;
};
0468D4262B495A5400CFB916
/* YHPickPhoneAddressViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D4252B495A5400CFB916
/* YHPickPhoneAddressViewController.swift */
;
};
0468D4282B50D4AF00CFB916
/* YHPrivacyAlertView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D4272B50D4AF00CFB916
/* YHPrivacyAlertView.swift */
;
};
...
...
@@ -1510,6 +1512,8 @@
045F283F2CF5ED3400520F19
/* YHAITabBarItemContentView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAITabBarItemContentView.swift
;
sourceTree
=
"<group>"
;
};
045F28412CF6028A00520F19
/* YHAITabViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAITabViewController.swift
;
sourceTree
=
"<group>"
;
};
045F28432CF608C100520F19
/* YHAIServiceListViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAIServiceListViewController.swift
;
sourceTree
=
"<group>"
;
};
045F28452CF6C47800520F19
/* YHAIProductCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAIProductCell.swift
;
sourceTree
=
"<group>"
;
};
045F28472CF6EF9800520F19
/* YHAIGreetCollectionReusableView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAIGreetCollectionReusableView.swift
;
sourceTree
=
"<group>"
;
};
0468D4212B493A5E00CFB916
/* YHPhoneMessageView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHPhoneMessageView.swift
;
sourceTree
=
"<group>"
;
};
0468D4252B495A5400CFB916
/* YHPickPhoneAddressViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHPickPhoneAddressViewController.swift
;
sourceTree
=
"<group>"
;
};
0468D4272B50D4AF00CFB916
/* YHPrivacyAlertView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHPrivacyAlertView.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -3951,7 +3955,9 @@
isa
=
PBXGroup
;
children
=
(
04943BF32CF4954800BF2255
/* YHAIMessageCell.swift */
,
045F28452CF6C47800520F19
/* YHAIProductCell.swift */
,
04943BF52CF49E3E00BF2255
/* YHAITextInputView.swift */
,
045F28472CF6EF9800520F19
/* YHAIGreetCollectionReusableView.swift */
,
);
path
=
V
;
sourceTree
=
"<group>"
;
...
...
@@ -6198,6 +6204,7 @@
0414708B2C88627B00B7B688
/* YHButlerServiceManager.swift in Sources */
,
0430E66A2C7493A5000511E2
/* YHAdopterExampleTableViewCell.swift in Sources */
,
04912F962CB924DA00CC3105
/* YHResignAppointTimeModifyViewController.swift in Sources */
,
045F28482CF6EF9800520F19
/* YHAIGreetCollectionReusableView.swift in Sources */
,
045EEF102B9F171A0022A143
/* YHMainApplicantInformationViewModel.swift in Sources */
,
0493B3DC2BA7EFE600AF9393
/* YHCertificateSearchViewController.swift in Sources */
,
A5DF9C632C78733200CE48E6
/* YHHKLegaldaysModel.swift in Sources */
,
...
...
@@ -6390,6 +6397,7 @@
04256E182C75BD2700A37BA4
/* YHVisaPayTypeCell.swift in Sources */
,
0430E6642C7482DD000511E2
/* YHYHAdopterTravelViewModel.swift in Sources */
,
A5CA3F502C7447FB00EB22F5
/* YHUploadCertificateVC.swift in Sources */
,
045F28462CF6C47800520F19
/* YHAIProductCell.swift in Sources */
,
04A7BD192BA441D400BD35A2
/* YHMyDocumentsUrlModel.swift in Sources */
,
04DF69BB2CBA1CC5005AA41E
/* YHResignSelectApplicantCollectCell.swift in Sources */
,
04A91E742CC6220900E5A079
/* YHCommonAlertView+AttributedMessage.swift in Sources */
,
...
...
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/C/YHAIServiceListViewController.swift
View file @
69698f8a
...
...
@@ -7,64 +7,92 @@
//
import
UIKit
import
JXSegmentedView
class
YHAIServiceListViewController
:
YHBaseViewController
{
var
serviceArr
:
[
String
]
=
[]
var
serviceArr
:
[
String
]
=
[
""
,
""
,
""
,
""
]
lazy
var
collectionView
:
UICollectionView
=
{
let
flowLayout
=
UICollectionViewFlowLayout
()
flowLayout
.
itemSize
=
CGSize
(
width
:
50
,
height
:
26
)
flowLayout
.
minimumInteritemSpacing
=
12.0
flowLayout
.
minimumLineSpacing
=
12.0
flowLayout
.
scrollDirection
=
.
horizontal
flowLayout
.
minimumInteritemSpacing
=
20.0
flowLayout
.
minimumLineSpacing
=
28.0
flowLayout
.
scrollDirection
=
.
vertical
let
collectView
=
UICollectionView
(
frame
:
.
zero
,
collectionViewLayout
:
flowLayout
)
collectView
.
backgroundColor
=
.
clear
collectView
.
delegate
=
self
collectView
.
dataSource
=
self
collectView
.
register
(
YHTopicItemCell
.
self
,
forCellWithReuseIdentifier
:
YHTopicItemCell
.
cellReuseIdentifier
)
collectView
.
contentInset
=
UIEdgeInsets
(
top
:
0
,
left
:
20
,
bottom
:
0
,
right
:
-
20
)
collectView
.
register
(
YHAIProductCell
.
self
,
forCellWithReuseIdentifier
:
YHAIProductCell
.
cellReuseIdentifier
)
collectView
.
register
(
YHAIGreetCollectionReusableView
.
self
,
forSupplementaryViewOfKind
:
UICollectionView
.
elementKindSectionHeader
,
withReuseIdentifier
:
YHAIGreetCollectionReusableView
.
reuseIdentifier
)
collectView
.
contentInset
=
.
zero
return
collectView
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
gk_navBarAlpha
=
0
gk_navigationBar
.
isHidden
=
true
view
.
backgroundColor
=
.
clear
view
.
addSubview
(
collectionView
)
collectionView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
top
.
bottom
.
equalToSuperview
()
make
.
left
.
equalTo
(
17
)
make
.
right
.
equalTo
(
-
17
)
make
.
top
.
bottom
.
equalToSuperview
()
}
}
}
extension
YHAIServiceListViewController
:
UICollectionViewDelegate
,
UICollectionViewDataSource
,
UICollectionViewDelegateFlowLayout
{
// 返回单元格数量
func
collectionView
(
_
collectionView
:
UICollectionView
,
numberOfItemsInSection
section
:
Int
)
->
Int
{
return
serviceArr
.
count
}
// 返回单元格数量
func
collectionView
(
_
collectionView
:
UICollectionView
,
numberOfItemsInSection
section
:
Int
)
->
Int
{
// 返回每个单元格的大小
func
collectionView
(
_
collectionView
:
UICollectionView
,
layout
collectionViewLayout
:
UICollectionViewLayout
,
sizeForItemAt
indexPath
:
IndexPath
)
->
CGSize
{
return
serviceArr
.
count
}
return
CGSize
(
width
:
(
KScreenWidth
-
20.0
*
2.0
)
/
2.0
,
height
:
194.0
)
}
// 返回每个单元格的大小
func
collectionView
(
_
collectionView
:
UICollectionView
,
layout
collectionViewLayout
:
UICollectionViewLayout
,
sizeForItemAt
indexPath
:
IndexPath
)
->
CGSize
{
return
CGSize
(
width
:
floor
((
KScreenWidth
-
17.0
*
2.0
-
20.0
)
/
2.0
),
height
:
178.0
)
}
// 返回自定义单元格
func
collectionView
(
_
collectionView
:
UICollectionView
,
cellForItemAt
indexPath
:
IndexPath
)
->
UICollectionViewCell
{
let
cell
=
collectionView
.
dequeueReusableCell
(
withReuseIdentifier
:
YHAIProductCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHAIProductCell
// 返回自定义单元格
func
collectionView
(
_
collectionView
:
UICollectionView
,
cellForItemAt
indexPath
:
IndexPath
)
->
UICollectionViewCell
{
let
cell
=
collectionView
.
dequeueReusableCell
(
withReuseIdentifier
:
YHTopicItemCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHTopicItemCell
if
0
<=
indexPath
.
item
&&
indexPath
.
item
<
serviceArr
.
count
{
cell
.
titleLabel
.
text
=
serviceArr
[
indexPath
.
item
]
}
return
cell
if
0
<=
indexPath
.
item
&&
indexPath
.
item
<
serviceArr
.
count
{
// 根据索引设置旋转
cell
.
rotateToRight
(
indexPath
.
item
%
2
==
0
)
}
return
cell
}
func
collectionView
(
_
collectionView
:
UICollectionView
,
didSelectItemAt
indexPath
:
IndexPath
)
{
if
0
<=
indexPath
.
item
&&
indexPath
.
item
<
serviceArr
.
count
{
let
text
=
serviceArr
[
indexPath
.
item
]
}
}
func
collectionView
(
_
collectionView
:
UICollectionView
,
viewForSupplementaryElementOfKind
kind
:
String
,
at
indexPath
:
IndexPath
)
->
UICollectionReusableView
{
if
kind
==
UICollectionView
.
elementKindSectionHeader
{
let
headerView
:
YHAIGreetCollectionReusableView
=
collectionView
.
dequeueReusableSupplementaryView
(
ofKind
:
UICollectionView
.
elementKindSectionHeader
,
withReuseIdentifier
:
YHAIGreetCollectionReusableView
.
reuseIdentifier
,
for
:
indexPath
)
as!
YHAIGreetCollectionReusableView
return
headerView
}
return
UICollectionReusableView
()
}
func
collectionView
(
_
collectionView
:
UICollectionView
,
layout
collectionViewLayout
:
UICollectionViewLayout
,
referenceSizeForHeaderInSection
:
Int
)
->
CGSize
{
return
CGSize
(
width
:
KScreenWidth
,
height
:
250
)
}
}
extension
YHAIServiceListViewController
:
JXSegmentedListContainerViewListDelegate
{
func
listView
()
->
UIView
{
return
view
}
}
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/C/YHAITabViewController.swift
View file @
69698f8a
...
...
@@ -58,7 +58,7 @@ class YHAITabViewController: YHBaseViewController {
for
i
in
0
..<
arrItemTitles
.
count
{
if
i
==
0
{
// 银河AI
let
vc
=
YH
MessageListVC
()
let
vc
=
YH
AIServiceListViewController
()
arrItemVCs
.
append
(
vc
)
}
else
if
i
==
1
{
// 对话
...
...
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/V/YHAIGreetCollectionReusableView.swift
0 → 100644
View file @
69698f8a
//
// YHAIGreetCollectionReusableView.swift
// galaxy
//
// Created by Dufet on 2024/11/27.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHAIGreetCollectionReusableView
:
UICollectionReusableView
{
static
let
reuseIdentifier
:
String
=
"YHAIGreetCollectionReusableView"
lazy
var
iconImgView
:
UIImageView
=
{
let
v
=
UIImageView
(
image
:
UIImage
(
named
:
""
))
v
.
backgroundColor
=
.
red
return
v
}()
lazy
var
titleLabel
:
UILabel
=
{
let
lable
=
UILabel
()
lable
.
textColor
=
UIColor
.
brandMainColor
lable
.
textAlignment
=
.
left
lable
.
font
=
UIFont
.
PFSC_B
(
ofSize
:
23
)
lable
.
text
=
"早上好,我是港小宝"
return
lable
}()
lazy
var
subtitleLabel
:
UILabel
=
{
let
lable
=
UILabel
()
lable
.
textColor
=
UIColor
.
init
(
hex
:
0x6D788A
)
lable
.
textAlignment
=
.
left
lable
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
14
)
lable
.
numberOfLines
=
0
lable
.
text
=
"可以为您提供申请进度查询和赴港攻略,有什么问题尽管问我~您可以试试了解以下内容~"
return
lable
}()
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
createUI
()
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
func
createUI
()
{
self
.
addSubview
(
iconImgView
)
self
.
addSubview
(
titleLabel
)
self
.
addSubview
(
subtitleLabel
)
iconImgView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
29
)
make
.
top
.
equalTo
(
16
)
make
.
width
.
height
.
equalTo
(
50
)
}
titleLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
24
)
make
.
right
.
equalTo
(
-
24
)
make
.
top
.
equalTo
(
iconImgView
.
snp
.
bottom
)
.
offset
(
16
)
make
.
height
.
equalTo
(
32
)
}
subtitleLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
24
)
make
.
right
.
equalTo
(
-
24
)
make
.
top
.
equalTo
(
titleLabel
.
snp
.
bottom
)
.
offset
(
16
)
make
.
bottom
.
equalTo
(
-
30
)
}
}
}
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/V/YHAIProductCell.swift
0 → 100644
View file @
69698f8a
//
// YHAIProductCell.swift
// galaxy
//
// Created by Dufet on 2024/11/27.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHAIProductCell
:
UICollectionViewCell
{
static
let
cellReuseIdentifier
=
"YHAIProductCell"
lazy
var
bgImgView
:
UIImageView
=
{
let
v
=
UIImageView
(
image
:
UIImage
(
named
:
""
))
v
.
layer
.
cornerRadius
=
24.0
v
.
backgroundColor
=
.
green
return
v
}()
lazy
var
iconView
:
UIImageView
=
{
let
v
=
UIImageView
(
image
:
UIImage
(
named
:
""
))
v
.
backgroundColor
=
.
red
return
v
}()
lazy
var
titleLabel
:
UILabel
=
{
let
lable
=
UILabel
()
lable
.
textColor
=
UIColor
.
mainTextColor
lable
.
textAlignment
=
.
left
lable
.
font
=
UIFont
.
PFSC_B
(
ofSize
:
14
)
lable
.
text
=
"产品智能体"
return
lable
}()
lazy
var
subtitleLabel
:
UILabel
=
{
let
lable
=
UILabel
()
lable
.
textColor
=
UIColor
.
init
(
hex
:
0x8993A2
)
lable
.
textAlignment
=
.
left
lable
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
12
)
lable
.
text
=
"银河在售商品介绍"
return
lable
}()
lazy
var
blackButton
:
UIButton
=
{
let
btn
=
UIButton
(
type
:
.
custom
)
btn
.
setTitle
(
"去了解"
,
for
:
.
normal
)
btn
.
setTitleColor
(
.
white
,
for
:
.
normal
)
btn
.
titleLabel
?
.
font
=
.
PFSC_M
(
ofSize
:
11
)
btn
.
backgroundColor
=
.
black
btn
.
addTarget
(
self
,
action
:
#selector(
didSendButtonClicked
)
,
for
:
.
touchUpInside
)
btn
.
YH_clickEdgeInsets
=
UIEdgeInsets
(
top
:
20
,
left
:
20
,
bottom
:
20
,
right
:
20
)
btn
.
layer
.
cornerRadius
=
13.0
btn
.
clipsToBounds
=
true
return
btn
}()
@objc
func
didSendButtonClicked
()
{
}
required
init
?(
coder
:
NSCoder
)
{
super
.
init
(
coder
:
coder
)
}
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
setupUI
()
}
func
setupUI
()
{
contentView
.
backgroundColor
=
.
clear
backgroundColor
=
.
clear
contentView
.
addSubview
(
bgImgView
)
bgImgView
.
addSubview
(
iconView
)
bgImgView
.
addSubview
(
titleLabel
)
bgImgView
.
addSubview
(
subtitleLabel
)
bgImgView
.
addSubview
(
blackButton
)
bgImgView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
bottom
.
equalTo
(
0
)
make
.
top
.
equalTo
(
8
)
}
iconView
.
snp
.
makeConstraints
{
make
in
make
.
width
.
equalTo
(
74
)
make
.
height
.
equalTo
(
58
)
make
.
centerX
.
equalToSuperview
()
make
.
top
.
equalTo
(
-
8
)
}
titleLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
17
)
make
.
right
.
equalTo
(
-
17
)
make
.
top
.
equalTo
(
iconView
.
snp
.
bottom
)
.
offset
(
27
)
make
.
height
.
equalTo
(
20
)
}
subtitleLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
17
)
make
.
right
.
equalTo
(
-
17
)
make
.
top
.
equalTo
(
titleLabel
.
snp
.
bottom
)
.
offset
(
5
)
make
.
height
.
equalTo
(
17
)
}
blackButton
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
17
)
make
.
top
.
equalTo
(
subtitleLabel
.
snp
.
bottom
)
.
offset
(
11
)
make
.
height
.
equalTo
(
26
)
make
.
width
.
equalTo
(
54
)
}
}
func
rotateToRight
(
_
isRotateRight
:
Bool
)
{
let
degree
=
isRotateRight
?
2.0
:
-
2.0
bgImgView
.
transform
=
CGAffineTransform
(
rotationAngle
:
CGFloat
(
degree
*
CGFloat
.
pi
/
180
))
// 10 度转换为弧度
}
}
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