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
4a65f4ea
Commit
4a65f4ea
authored
Dec 09, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// AI
parent
036548b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
6 deletions
+38
-6
YHAIRobotChatViewController.swift
.../AI/AI-Dialogue(AI对话)/C/YHAIRobotChatViewController.swift
+3
-4
YHAIChatBannerView.swift
...s/Modules/AI/AI-Dialogue(AI对话)/V/YHAIChatBannerView.swift
+11
-0
YHCardMessageCell.swift
...es/Modules/AI/AI-Dialogue(AI对话)/V/YHCardMessageCell.swift
+24
-2
No files found.
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/C/YHAIRobotChatViewController.swift
View file @
4a65f4ea
...
...
@@ -17,7 +17,7 @@ class YHAIRobotChatViewController: YHBaseViewController {
var
listItemId
:
Int
=
0
var
isUserScrolling
:
Bool
=
false
var
lastUserScrollTime
:
CFTimeInterval
=
0.0
let
minimumScrollInterval
:
CFTimeInterval
=
3
.0
let
minimumScrollInterval
:
CFTimeInterval
=
2
.0
var
conversationId
:
String
=
""
var
messages
:[
YHAIChatMessage
]
=
[]
var
isNeedShowBannerHeader
:
Bool
=
false
...
...
@@ -212,9 +212,9 @@ class YHAIRobotChatViewController: YHBaseViewController {
let
question
=
YHAIChatMessage
.
createQuestionMessage
(
text
)
messages
.
append
(
question
)
messages
.
append
(
thinkingMessage
)
self
.
scrollToBottom
()
self
.
bottomInputView
.
status
=
.
loading
self
.
chatConfig
.
disableHandleMessage
=
false
self
.
scrollToBottom
()
self
.
manager
.
requestAI
(
botId
:
self
.
robotId
,
conversationId
:
self
.
conversationId
,
question
:
text
)
{
[
weak
self
]
res
,
done
in
guard
let
self
=
self
else
{
return
}
...
...
@@ -269,8 +269,7 @@ class YHAIRobotChatViewController: YHBaseViewController {
func
uploadEvaluationMessage
(
_
msg
:
YHAIChatMessage
,
callback
:((
Bool
)
->
())?
=
nil
)
{
viewModel
.
createMessage
(
conversationId
:
conversationId
,
role
:
"assistant"
,
msg
:
msg
)
{
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
success
,
error
in
callback
?(
success
)
}
}
...
...
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/V/YHAIChatBannerView.swift
View file @
4a65f4ea
...
...
@@ -119,6 +119,11 @@ class YHAIChatBannerView: UIView {
return
collectView
}()
lazy
var
shadowView
:
YHAIChatShadowView
=
{
let
v
=
YHAIChatShadowView
()
return
v
}()
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
createUI
()
...
...
@@ -130,11 +135,17 @@ class YHAIChatBannerView: UIView {
func
createUI
()
{
addSubview
(
shadowView
)
addSubview
(
bgImgV
)
bgImgV
.
addSubview
(
titleLabel
)
bgImgV
.
addSubview
(
descLabel
)
bgImgV
.
addSubview
(
bannerView
)
bannerView
.
addSubview
(
indicatorView
)
shadowView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
bottom
.
equalTo
(
bgImgV
)
make
.
top
.
equalTo
(
bgImgV
.
snp
.
top
)
.
offset
(
33
)
}
bgImgV
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
0
)
...
...
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/V/YHCardMessageCell.swift
View file @
4a65f4ea
...
...
@@ -30,13 +30,35 @@ class YHAIJumpPageTool {
if
mode
==
YHAIJumpMode
.
web
.
rawValue
{
//
if
!
path
.
isEmpty
{
var
url
=
path
if
YHLoginManager
.
shared
.
isLogin
()
{
let
token
=
YHLoginManager
.
shared
.
h5Token
url
=
path
+
"?param="
+
token
let
urlHasParam
=
String
.
hasQueryParameters
(
urlString
:
path
)
if
urlHasParam
{
url
=
path
+
"¶m="
+
token
}
}
else
{
url
=
path
}
//2.增加导航栏高度
var
resultUrl
=
url
if
!
url
.
contains
(
"navigationH="
)
{
resultUrl
=
url
+
"?navigationH=
\(
k_Height_NavigationtBarAndStatuBar
)
"
if
url
.
contains
(
"?"
)
{
resultUrl
=
url
+
"&navigationH=
\(
k_Height_NavigationtBarAndStatuBar
)
"
}
}
if
type
==
.
evaluation
{
YHAIEvaluationWebView
.
webView
(
url
:
path
,
finishBlock
:
block
)
.
show
()
YHAIEvaluationWebView
.
webView
(
url
:
resultUrl
,
finishBlock
:
block
)
.
show
()
}
else
{
let
vc
=
YHH5WebViewVC
()
vc
.
url
=
path
vc
.
url
=
resultUrl
vc
.
evaluationResultCallback
=
block
UIViewController
.
current
?
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
...
...
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