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
922e4fb0
Commit
922e4fb0
authored
Dec 11, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// AI
parent
7aa552c9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
153 additions
and
5 deletions
+153
-5
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+4
-0
YHAIChatConfiguration.swift
...odules/AI/AI-Dialogue(AI对话)/C/YHAIChatConfiguration.swift
+1
-1
YHAIMainChatViewController.swift
...s/AI/AI-Dialogue(AI对话)/C/YHAIMainChatViewController.swift
+20
-2
YHAIRobotChatViewController.swift
.../AI/AI-Dialogue(AI对话)/C/YHAIRobotChatViewController.swift
+18
-1
YHAIChatBannerView.swift
...s/Modules/AI/AI-Dialogue(AI对话)/V/YHAIChatBannerView.swift
+2
-1
YHRecommendTextMessageCell.swift
...s/AI/AI-Dialogue(AI对话)/V/YHRecommendTextMessageCell.swift
+108
-0
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
922e4fb0
...
...
@@ -765,6 +765,7 @@
04CA2C2D2CBA537C00F36DE7
/* YHLookResignResultPrivateView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04CA2C2C2CBA537C00F36DE7
/* YHLookResignResultPrivateView.swift */
;
};
04CA2C2F2CBA5C9E00F36DE7
/* YHLookResignGuideLineView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04CA2C2E2CBA5C9E00F36DE7
/* YHLookResignGuideLineView.swift */
;
};
04CA2C312CBA653E00F36DE7
/* YHLookResignAlertView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04CA2C302CBA653E00F36DE7
/* YHLookResignAlertView.swift */
;
};
04CC1D392D0962F400173066
/* YHRecommendTextMessageCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04CC1D382D0962F400173066
/* YHRecommendTextMessageCell.swift */
;
};
04CC2EF02BC3DDB2000305DD
/* YHServiceBannerView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04CC2EEF2BC3DDB2000305DD
/* YHServiceBannerView.swift */
;
};
04CCEDF72CA0FCB10026EA70
/* YHHKImmigrationRecordsViewModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04CCEDF62CA0FCB10026EA70
/* YHHKImmigrationRecordsViewModel.swift */
;
};
04CCEDF92CA0FD5F0026EA70
/* YHHKImmigrationRecordsSummaryModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04CCEDF82CA0FD5F0026EA70
/* YHHKImmigrationRecordsSummaryModel.swift */
;
};
...
...
@@ -1885,6 +1886,7 @@
04CA2C2C2CBA537C00F36DE7
/* YHLookResignResultPrivateView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHLookResignResultPrivateView.swift
;
sourceTree
=
"<group>"
;
};
04CA2C2E2CBA5C9E00F36DE7
/* YHLookResignGuideLineView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHLookResignGuideLineView.swift
;
sourceTree
=
"<group>"
;
};
04CA2C302CBA653E00F36DE7
/* YHLookResignAlertView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHLookResignAlertView.swift
;
sourceTree
=
"<group>"
;
};
04CC1D382D0962F400173066
/* YHRecommendTextMessageCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHRecommendTextMessageCell.swift
;
sourceTree
=
"<group>"
;
};
04CC2EEF2BC3DDB2000305DD
/* YHServiceBannerView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHServiceBannerView.swift
;
sourceTree
=
"<group>"
;
};
04CCEDF62CA0FCB10026EA70
/* YHHKImmigrationRecordsViewModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHHKImmigrationRecordsViewModel.swift
;
sourceTree
=
"<group>"
;
};
04CCEDF82CA0FD5F0026EA70
/* YHHKImmigrationRecordsSummaryModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHHKImmigrationRecordsSummaryModel.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -4498,6 +4500,7 @@
04BE3A8A2CFFFF0900BD31DB
/* YHAITabIndicatorView.swift */
,
04BE3A8B2CFFFF0900BD31DB
/* YHAITextInputView.swift */
,
04BE3A8C2CFFFF0900BD31DB
/* YHAITextMessageCell.swift */
,
04CC1D382D0962F400173066
/* YHRecommendTextMessageCell.swift */
,
04BE3A8D2CFFFF0900BD31DB
/* YHAIThinkingMessageCell.swift */
,
04BE3A8E2CFFFF0900BD31DB
/* YHCardMessageCell.swift */
,
04BE3A8F2CFFFF0900BD31DB
/* YHFixProductItemView.swift */
,
...
...
@@ -6304,6 +6307,7 @@
04FD856C2C2153F000BEF9C5
/* YHMyEducationCell.swift in Sources */
,
A5DE0D3C2BB9016200976FE1
/* YHEmailInputAlertView.swift in Sources */
,
04CCEDFD2CA150ED0026EA70
/* YHHKImmigrationRecordsSingleModel.swift in Sources */
,
04CC1D392D0962F400173066
/* YHRecommendTextMessageCell.swift in Sources */
,
0418922A2C91CB2500B9FB94
/* YHResignDocumentStatus.swift in Sources */
,
047F3DF22CE888EF001B2A6D
/* YHDocumentListCell.swift in Sources */
,
040AE9992CF5CB1D00310241
/* YHSelectLookHeadView.swift in Sources */
,
...
...
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/C/YHAIChatConfiguration.swift
View file @
922e4fb0
...
...
@@ -21,7 +21,7 @@ class YHAIChatConfiguration {
tableView
.
register
(
YHFixProductListMessageCell
.
self
,
forCellReuseIdentifier
:
YHFixProductListMessageCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHCardMessageCell
.
self
,
forCellReuseIdentifier
:
YHCardMessageCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHAIPictureMessageCell
.
self
,
forCellReuseIdentifier
:
YHAIPictureMessageCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHRecommendTextMessageCell
.
self
,
forCellReuseIdentifier
:
YHRecommendTextMessageCell
.
cellReuseIdentifier
)
}
...
...
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/C/YHAIMainChatViewController.swift
View file @
922e4fb0
...
...
@@ -258,14 +258,32 @@ extension YHAIMainChatViewController: UITableViewDelegate, UITableViewDataSource
if
0
<=
indexPath
.
row
,
indexPath
.
row
<
messages
.
count
{
let
msg
=
messages
[
indexPath
.
row
]
let
msgType
=
msg
.
getType
()
if
msg
.
isTextMessage
()
{
if
msg
Type
==
.
text
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHAITextMessageCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHAITextMessageCell
cell
.
message
=
msg
cell
.
messageClick
=
{
[
weak
self
]
text
in
guard
let
self
=
self
else
{
return
}
self
.
bottomInputView
.
showKeyBoard
(
false
)
if
self
.
isNeedStopResonse
()
{
self
.
stopAutoResponse
{
success
in
self
.
sendMessage
(
text
)
}
}
else
{
self
.
sendMessage
(
text
)
}
}
return
cell
}
else
if
msgType
==
.
recommendText
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHRecommendTextMessageCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHRecommendTextMessageCell
cell
.
message
=
msg
cell
.
messageClick
=
{
[
weak
self
]
text
in
guard
let
self
=
self
else
{
return
}
self
.
bottomInputView
.
showKeyBoard
(
false
)
if
self
.
isNeedStopResonse
()
{
self
.
stopAutoResponse
{
success
in
self
.
sendMessage
(
text
)
...
...
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/C/YHAIRobotChatViewController.swift
View file @
922e4fb0
...
...
@@ -400,7 +400,7 @@ extension YHAIRobotChatViewController: UITableViewDelegate, UITableViewDataSourc
if
0
<=
indexPath
.
row
,
indexPath
.
row
<
messages
.
count
{
let
msg
=
messages
[
indexPath
.
row
]
let
msgType
=
msg
.
getType
()
if
msg
.
isTextMessage
()
{
if
msg
Type
==
.
text
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHAITextMessageCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHAITextMessageCell
cell
.
message
=
msg
cell
.
messageClick
=
{
...
...
@@ -417,6 +417,23 @@ extension YHAIRobotChatViewController: UITableViewDelegate, UITableViewDataSourc
}
return
cell
}
else
if
msgType
==
.
recommendText
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHRecommendTextMessageCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHRecommendTextMessageCell
cell
.
message
=
msg
cell
.
messageClick
=
{
[
weak
self
]
text
in
guard
let
self
=
self
else
{
return
}
if
self
.
isNeedStopResonse
()
{
self
.
stopAutoResponse
{
success
in
self
.
sendMessage
(
text
,
true
)
}
}
else
{
self
.
sendMessage
(
text
,
true
)
}
}
return
cell
}
else
if
msgType
==
.
thinking
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHAIThinkingMessageCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHAIThinkingMessageCell
return
cell
...
...
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/V/YHAIChatBannerView.swift
View file @
922e4fb0
...
...
@@ -55,6 +55,7 @@ class YHAIChatBannerView: UIView {
lazy
var
bgImgV
:
UIImageView
=
{
let
imagV
:
UIImageView
=
UIImageView
()
imagV
.
contentMode
=
.
scaleAspectFill
imagV
.
clipsToBounds
=
true
imagV
.
image
=
UIImage
(
named
:
"ai_chat_header_bg_0"
)
imagV
.
isUserInteractionEnabled
=
true
...
...
@@ -94,7 +95,7 @@ class YHAIChatBannerView: UIView {
lazy
var
indicatorView
:
YHHomeBannerIndicatorView
=
{
let
view
=
YHHomeBannerIndicatorView
()
view
.
normalColor
=
.
init
(
hex
:
0x
6D788A
)
view
.
normalColor
=
.
init
(
hex
:
0x
D5DAE1
)
view
.
selectedColor
=
.
brandMainColor
return
view
}()
...
...
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/V/YHRecommendTextMessageCell.swift
0 → 100644
View file @
922e4fb0
//
// YHRecommendTextMessageCell.swift
// galaxy
//
// Created by Dufet on 2024/12/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHRecommendTextMessageCell
:
UITableViewCell
{
static
let
cellReuseIdentifier
=
"YHRecommendTextMessageCell"
var
messageClick
:((
String
)
->
())?
var
message
:
YHAIChatMessage
=
YHAIChatMessage
()
{
didSet
{
messageLabel
.
text
=
message
.
body
.
contentText
whiteContentView
.
backgroundColor
=
.
white
messageLabel
.
textColor
=
.
mainTextColor
self
.
setNeedsLayout
()
self
.
layoutIfNeeded
()
}
}
lazy
var
whiteContentView
:
UIView
=
{
let
v
=
UIView
()
v
.
backgroundColor
=
.
white
v
.
layer
.
cornerRadius
=
12.0
v
.
clipsToBounds
=
true
let
tap
=
UITapGestureRecognizer
(
target
:
self
,
action
:
#selector(
didMessageClicked
)
)
v
.
addGestureRecognizer
(
tap
)
let
longPress
=
UILongPressGestureRecognizer
(
target
:
self
,
action
:
#selector(
didCopyTextLongGesture(_:)
)
)
v
.
addGestureRecognizer
(
longPress
)
return
v
}()
lazy
var
messageLabel
:
UILabel
=
{
let
lable
=
UILabel
()
lable
.
textColor
=
UIColor
.
mainTextColor
lable
.
textAlignment
=
.
left
lable
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
12
)
lable
.
numberOfLines
=
0
return
lable
}()
@objc
func
didCopyTextLongGesture
(
_
sender
:
UIGestureRecognizer
)
{
let
text
=
message
.
body
.
contentText
if
sender
.
state
==
.
began
{
UIPasteboard
.
general
.
string
=
text
YHHUD
.
flash
(
message
:
"复制成功"
)
}
}
lazy
var
shadowView
:
YHAIChatShadowView
=
{
let
v
=
YHAIChatShadowView
()
return
v
}()
required
init
?(
coder
:
NSCoder
)
{
super
.
init
(
coder
:
coder
)
}
override
init
(
style
:
UITableViewCell
.
CellStyle
,
reuseIdentifier
:
String
?)
{
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
setupUI
()
}
func
setupUI
()
{
selectionStyle
=
.
none
contentView
.
backgroundColor
=
.
clear
backgroundColor
=
.
clear
contentView
.
addSubview
(
shadowView
)
contentView
.
addSubview
(
whiteContentView
)
whiteContentView
.
addSubview
(
messageLabel
)
shadowView
.
snp
.
makeConstraints
{
make
in
make
.
edges
.
equalTo
(
whiteContentView
)
}
whiteContentView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
20
)
make
.
right
.
lessThanOrEqualTo
(
-
20
)
make
.
top
.
equalTo
(
16
)
make
.
bottom
.
equalTo
(
0
)
}
messageLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
16
)
make
.
right
.
equalTo
(
-
16
)
make
.
top
.
equalTo
(
16
)
make
.
bottom
.
equalTo
(
-
16
)
}
}
@objc
func
didMessageClicked
()
{
UIApplication
.
shared
.
yhKeyWindow
()?
.
endEditing
(
true
)
if
message
.
getType
()
==
.
recommendText
{
let
text
=
message
.
getText
()
messageClick
?(
text
)
}
}
}
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