Commit ace7ccb2 authored by Steven杜宇's avatar Steven杜宇

// AI

parent f9b64510
......@@ -35,6 +35,11 @@ class YHAIRobotChatViewController: YHBaseViewController {
return tableView
}()
lazy var bgImgView: UIImageView = {
let v = UIImageView(image: UIImage(named: "ai_chat_bg"))
return v
}()
lazy var bottomInputView: YHAITextInputView = {
let v = YHAITextInputView(frame: .zero)
v.sendBlock = {
......@@ -67,16 +72,25 @@ class YHAIRobotChatViewController: YHBaseViewController {
super.viewDidLoad()
gk_navBarAlpha = 0
view.backgroundColor = .clear
IQKeyboardManager.shared.enable = false
view.backgroundColor = .clear
view.addSubview(bgImgView)
gk_navTitle = "新港生活规划师"
gk_navTitleColor = .mainTextColor
self.view.addSubview(self.tableView)
self.view.addSubview(self.bottomInputView)
self.view.addSubview(self.bgImgView)
self.view.insertSubview(bgImgView, belowSubview: gk_navigationBar)
bgImgView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
tableView.snp.makeConstraints { make in
make.left.right.equalTo(0)
make.top.equalTo(0)
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalTo(bottomInputView.snp.top).offset(-10)
}
bottomInputView.snp.makeConstraints { make in
......
......@@ -13,9 +13,13 @@ class YHAIMessageCell: UITableViewCell {
static let cellReuseIdentifier = "YHAIMessageCell"
var message: YHAIMessage = YHAIMessage() {
didSet {
messageLabel.text = message.body.contentText
rightAngleView.backgroundColor = message.isSelf ? .brandMainColor : .white
rightAngleView.isHidden = message.getType() != .text
if message.isSelf {
whiteContentView.backgroundColor = .brandMainColor
messageLabel.textColor = .white
......@@ -26,6 +30,11 @@ class YHAIMessageCell: UITableViewCell {
make.bottom.equalTo(0)
}
rightAngleView.snp.remakeConstraints { make in
make.top.right.equalTo(whiteContentView)
make.width.height.equalTo(15)
}
} else {
whiteContentView.backgroundColor = .white
messageLabel.textColor = .mainTextColor
......@@ -35,6 +44,11 @@ class YHAIMessageCell: UITableViewCell {
make.top.equalTo(20)
make.bottom.equalTo(0)
}
rightAngleView.snp.remakeConstraints { make in
make.top.left.equalTo(whiteContentView)
make.width.height.equalTo(15)
}
}
self.setNeedsLayout()
......@@ -45,11 +59,18 @@ class YHAIMessageCell: UITableViewCell {
var whiteContentView: UIView = {
let v = UIView()
v.backgroundColor = .white
v.layer.cornerRadius = 4.0
v.layer.cornerRadius = 12.0
v.clipsToBounds = true
return v
}()
var rightAngleView: UIView = {
let v = UIView()
v.backgroundColor = .white
v.isHidden = true
return v
}()
lazy var messageLabel:UILabel = {
let lable = UILabel()
lable.textColor = UIColor.mainTextColor
......@@ -73,9 +94,15 @@ class YHAIMessageCell: UITableViewCell {
selectionStyle = .none
contentView.backgroundColor = .clear
backgroundColor = .clear
contentView.addSubview(rightAngleView)
contentView.addSubview(whiteContentView)
whiteContentView.addSubview(messageLabel)
rightAngleView.snp.makeConstraints { make in
make.top.right.equalTo(whiteContentView)
make.width.height.equalTo(15)
}
whiteContentView.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.lessThanOrEqualTo(-20)
......
......@@ -16,7 +16,7 @@ class YHAIThinkingMessageCell: UITableViewCell {
var whiteContentView: UIView = {
let v = UIView()
v.backgroundColor = .white
v.layer.cornerRadius = 4.0
v.layer.cornerRadius = 12.0
v.clipsToBounds = true
return v
}()
......
......@@ -15,7 +15,7 @@ class YHCardMessageCell: UITableViewCell {
var whiteContentView: UIView = {
let v = UIView()
v.backgroundColor = .white
v.layer.cornerRadius = 4.0
v.layer.cornerRadius = 12.0
v.clipsToBounds = true
return v
}()
......
......@@ -53,7 +53,7 @@ class YHFixProductListMessageCell: UITableViewCell {
var whiteContentView: UIView = {
let v = UIView()
v.backgroundColor = .white
v.layer.cornerRadius = 4.0
v.layer.cornerRadius = 12.0
v.clipsToBounds = true
return v
}()
......
......@@ -54,7 +54,7 @@ class YHProductListMessageCell: UITableViewCell {
var whiteContentView: UIView = {
let v = UIView()
v.backgroundColor = .white
v.layer.cornerRadius = 4.0
v.layer.cornerRadius = 12.0
v.clipsToBounds = true
return v
}()
......
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