Commit 265c8830 authored by DavidHuang's avatar DavidHuang

Merge branch 'yinhe-live-1212' of...

Merge branch 'yinhe-live-1212' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into yinhe-live-1212
parents cf6fe04d 1bdabf3b
...@@ -765,6 +765,7 @@ ...@@ -765,6 +765,7 @@
04CA2C2D2CBA537C00F36DE7 /* YHLookResignResultPrivateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CA2C2C2CBA537C00F36DE7 /* YHLookResignResultPrivateView.swift */; }; 04CA2C2D2CBA537C00F36DE7 /* YHLookResignResultPrivateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CA2C2C2CBA537C00F36DE7 /* YHLookResignResultPrivateView.swift */; };
04CA2C2F2CBA5C9E00F36DE7 /* YHLookResignGuideLineView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CA2C2E2CBA5C9E00F36DE7 /* YHLookResignGuideLineView.swift */; }; 04CA2C2F2CBA5C9E00F36DE7 /* YHLookResignGuideLineView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CA2C2E2CBA5C9E00F36DE7 /* YHLookResignGuideLineView.swift */; };
04CA2C312CBA653E00F36DE7 /* YHLookResignAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CA2C302CBA653E00F36DE7 /* YHLookResignAlertView.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 */; }; 04CC2EF02BC3DDB2000305DD /* YHServiceBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CC2EEF2BC3DDB2000305DD /* YHServiceBannerView.swift */; };
04CCEDF72CA0FCB10026EA70 /* YHHKImmigrationRecordsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CCEDF62CA0FCB10026EA70 /* YHHKImmigrationRecordsViewModel.swift */; }; 04CCEDF72CA0FCB10026EA70 /* YHHKImmigrationRecordsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CCEDF62CA0FCB10026EA70 /* YHHKImmigrationRecordsViewModel.swift */; };
04CCEDF92CA0FD5F0026EA70 /* YHHKImmigrationRecordsSummaryModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CCEDF82CA0FD5F0026EA70 /* YHHKImmigrationRecordsSummaryModel.swift */; }; 04CCEDF92CA0FD5F0026EA70 /* YHHKImmigrationRecordsSummaryModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CCEDF82CA0FD5F0026EA70 /* YHHKImmigrationRecordsSummaryModel.swift */; };
...@@ -1885,6 +1886,7 @@ ...@@ -1885,6 +1886,7 @@
04CA2C2C2CBA537C00F36DE7 /* YHLookResignResultPrivateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLookResignResultPrivateView.swift; sourceTree = "<group>"; }; 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>"; }; 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>"; }; 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>"; }; 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>"; }; 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>"; }; 04CCEDF82CA0FD5F0026EA70 /* YHHKImmigrationRecordsSummaryModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHKImmigrationRecordsSummaryModel.swift; sourceTree = "<group>"; };
...@@ -4498,6 +4500,7 @@ ...@@ -4498,6 +4500,7 @@
04BE3A8A2CFFFF0900BD31DB /* YHAITabIndicatorView.swift */, 04BE3A8A2CFFFF0900BD31DB /* YHAITabIndicatorView.swift */,
04BE3A8B2CFFFF0900BD31DB /* YHAITextInputView.swift */, 04BE3A8B2CFFFF0900BD31DB /* YHAITextInputView.swift */,
04BE3A8C2CFFFF0900BD31DB /* YHAITextMessageCell.swift */, 04BE3A8C2CFFFF0900BD31DB /* YHAITextMessageCell.swift */,
04CC1D382D0962F400173066 /* YHRecommendTextMessageCell.swift */,
04BE3A8D2CFFFF0900BD31DB /* YHAIThinkingMessageCell.swift */, 04BE3A8D2CFFFF0900BD31DB /* YHAIThinkingMessageCell.swift */,
04BE3A8E2CFFFF0900BD31DB /* YHCardMessageCell.swift */, 04BE3A8E2CFFFF0900BD31DB /* YHCardMessageCell.swift */,
04BE3A8F2CFFFF0900BD31DB /* YHFixProductItemView.swift */, 04BE3A8F2CFFFF0900BD31DB /* YHFixProductItemView.swift */,
...@@ -6304,6 +6307,7 @@ ...@@ -6304,6 +6307,7 @@
04FD856C2C2153F000BEF9C5 /* YHMyEducationCell.swift in Sources */, 04FD856C2C2153F000BEF9C5 /* YHMyEducationCell.swift in Sources */,
A5DE0D3C2BB9016200976FE1 /* YHEmailInputAlertView.swift in Sources */, A5DE0D3C2BB9016200976FE1 /* YHEmailInputAlertView.swift in Sources */,
04CCEDFD2CA150ED0026EA70 /* YHHKImmigrationRecordsSingleModel.swift in Sources */, 04CCEDFD2CA150ED0026EA70 /* YHHKImmigrationRecordsSingleModel.swift in Sources */,
04CC1D392D0962F400173066 /* YHRecommendTextMessageCell.swift in Sources */,
0418922A2C91CB2500B9FB94 /* YHResignDocumentStatus.swift in Sources */, 0418922A2C91CB2500B9FB94 /* YHResignDocumentStatus.swift in Sources */,
047F3DF22CE888EF001B2A6D /* YHDocumentListCell.swift in Sources */, 047F3DF22CE888EF001B2A6D /* YHDocumentListCell.swift in Sources */,
040AE9992CF5CB1D00310241 /* YHSelectLookHeadView.swift in Sources */, 040AE9992CF5CB1D00310241 /* YHSelectLookHeadView.swift in Sources */,
......
...@@ -21,7 +21,7 @@ class YHAIChatConfiguration { ...@@ -21,7 +21,7 @@ class YHAIChatConfiguration {
tableView.register(YHFixProductListMessageCell.self, forCellReuseIdentifier: YHFixProductListMessageCell.cellReuseIdentifier) tableView.register(YHFixProductListMessageCell.self, forCellReuseIdentifier: YHFixProductListMessageCell.cellReuseIdentifier)
tableView.register(YHCardMessageCell.self, forCellReuseIdentifier: YHCardMessageCell.cellReuseIdentifier) tableView.register(YHCardMessageCell.self, forCellReuseIdentifier: YHCardMessageCell.cellReuseIdentifier)
tableView.register(YHAIPictureMessageCell.self, forCellReuseIdentifier: YHAIPictureMessageCell.cellReuseIdentifier) tableView.register(YHAIPictureMessageCell.self, forCellReuseIdentifier: YHAIPictureMessageCell.cellReuseIdentifier)
tableView.register(YHRecommendTextMessageCell.self, forCellReuseIdentifier: YHRecommendTextMessageCell.cellReuseIdentifier)
} }
......
...@@ -258,14 +258,32 @@ extension YHAIMainChatViewController: UITableViewDelegate, UITableViewDataSource ...@@ -258,14 +258,32 @@ extension YHAIMainChatViewController: UITableViewDelegate, UITableViewDataSource
if 0 <= indexPath.row, indexPath.row < messages.count { if 0 <= indexPath.row, indexPath.row < messages.count {
let msg = messages[indexPath.row] let msg = messages[indexPath.row]
let msgType = msg.getType() let msgType = msg.getType()
if msg.isTextMessage() { if msgType == .text {
let cell = tableView.dequeueReusableCell(withIdentifier: YHAITextMessageCell.cellReuseIdentifier, for: indexPath) as! YHAITextMessageCell let cell = tableView.dequeueReusableCell(withIdentifier: YHAITextMessageCell.cellReuseIdentifier, for: indexPath) as! YHAITextMessageCell
cell.message = msg cell.message = msg
cell.messageClick = { cell.messageClick = {
[weak self] text in [weak self] text in
guard let self = self else { return } guard let self = self else { return }
self.bottomInputView.showKeyBoard(false) 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() { if self.isNeedStopResonse() {
self.stopAutoResponse { success in self.stopAutoResponse { success in
self.sendMessage(text) self.sendMessage(text)
......
...@@ -400,7 +400,7 @@ extension YHAIRobotChatViewController: UITableViewDelegate, UITableViewDataSourc ...@@ -400,7 +400,7 @@ extension YHAIRobotChatViewController: UITableViewDelegate, UITableViewDataSourc
if 0 <= indexPath.row, indexPath.row < messages.count { if 0 <= indexPath.row, indexPath.row < messages.count {
let msg = messages[indexPath.row] let msg = messages[indexPath.row]
let msgType = msg.getType() let msgType = msg.getType()
if msg.isTextMessage() { if msgType == .text {
let cell = tableView.dequeueReusableCell(withIdentifier: YHAITextMessageCell.cellReuseIdentifier, for: indexPath) as! YHAITextMessageCell let cell = tableView.dequeueReusableCell(withIdentifier: YHAITextMessageCell.cellReuseIdentifier, for: indexPath) as! YHAITextMessageCell
cell.message = msg cell.message = msg
cell.messageClick = { cell.messageClick = {
...@@ -417,6 +417,23 @@ extension YHAIRobotChatViewController: UITableViewDelegate, UITableViewDataSourc ...@@ -417,6 +417,23 @@ extension YHAIRobotChatViewController: UITableViewDelegate, UITableViewDataSourc
} }
return cell 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 { } else if msgType == .thinking {
let cell = tableView.dequeueReusableCell(withIdentifier: YHAIThinkingMessageCell.cellReuseIdentifier, for: indexPath) as! YHAIThinkingMessageCell let cell = tableView.dequeueReusableCell(withIdentifier: YHAIThinkingMessageCell.cellReuseIdentifier, for: indexPath) as! YHAIThinkingMessageCell
return cell return cell
......
...@@ -55,6 +55,7 @@ class YHAIChatBannerView: UIView { ...@@ -55,6 +55,7 @@ class YHAIChatBannerView: UIView {
lazy var bgImgV: UIImageView = { lazy var bgImgV: UIImageView = {
let imagV : UIImageView = UIImageView() let imagV : UIImageView = UIImageView()
imagV.contentMode = .scaleAspectFill
imagV.clipsToBounds = true imagV.clipsToBounds = true
imagV.image = UIImage(named: "ai_chat_header_bg_0") imagV.image = UIImage(named: "ai_chat_header_bg_0")
imagV.isUserInteractionEnabled = true imagV.isUserInteractionEnabled = true
...@@ -94,7 +95,7 @@ class YHAIChatBannerView: UIView { ...@@ -94,7 +95,7 @@ class YHAIChatBannerView: UIView {
lazy var indicatorView : YHHomeBannerIndicatorView = { lazy var indicatorView : YHHomeBannerIndicatorView = {
let view = YHHomeBannerIndicatorView() let view = YHHomeBannerIndicatorView()
view.normalColor = .init(hex: 0x6D788A) view.normalColor = .init(hex: 0xD5DAE1)
view.selectedColor = .brandMainColor view.selectedColor = .brandMainColor
return view return view
}() }()
......
//
// 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)
}
}
}
...@@ -327,7 +327,7 @@ class YHShareTwoCollectionViewCell: UICollectionViewCell { ...@@ -327,7 +327,7 @@ class YHShareTwoCollectionViewCell: UICollectionViewCell {
centerImageView.addSubview(imageView) centerImageView.addSubview(imageView)
imageView.snp.makeConstraints { make in imageView.snp.makeConstraints { make in
make.bottom.equalTo(-46) make.bottom.equalTo(-46)
make.right.equalTo(-36) make.right.equalTo(-26)
make.width.height.equalTo(68) make.width.height.equalTo(68)
} }
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "invitation_with_gifts_share_detail2@2x.png", "filename" : "海报-无二维码.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "invitation_with_gifts_share_detail2@3x.png", "filename" : "海报-无二维码-1.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment