Commit 416518c6 authored by Steven杜宇's avatar Steven杜宇

// AI

parent 7af5bd7c
...@@ -57,7 +57,7 @@ class YHAIRequestManager: NSObject { ...@@ -57,7 +57,7 @@ class YHAIRequestManager: NSObject {
} }
func requestAI(botId: String, conversationId: String, question: String = "", completion: ((_ msg: YHAIChatMessage?, _ done: Bool) -> Void)?) { func requestAI(botId: String, conversationId: String, question: String = "", callback: ((_ msg: YHAIChatMessage?, _ done: Bool) -> Void)?) {
let url = YHBaseUrlManager.shared.curURL() + YHAllApiName.AIChat.agentChat let url = YHBaseUrlManager.shared.curURL() + YHAllApiName.AIChat.agentChat
self.uuid = UUID().uuidString + NSDate().timeIntervalSince1970.description self.uuid = UUID().uuidString + NSDate().timeIntervalSince1970.description
...@@ -90,14 +90,17 @@ class YHAIRequestManager: NSObject { ...@@ -90,14 +90,17 @@ class YHAIRequestManager: NSObject {
print(string) print(string)
self.handle(dataString: string) { self.handle(dataString: string) {
response, done in response, done in
completion?(response, done) callback?(response, done)
} }
case let .failure(error): case let .failure(error):
print("\(error)") print("\(error)")
callback?(nil, true)
} }
case let .complete(completion): case let .complete(completion):
print("COMPLETE") print("COMPLETE")
callback?(nil, true)
if let af_error = completion.error { if let af_error = completion.error {
if let error = af_error.underlyingError { if let error = af_error.underlyingError {
......
...@@ -50,7 +50,7 @@ class YHAITextMessageCell: UITableViewCell { ...@@ -50,7 +50,7 @@ class YHAITextMessageCell: UITableViewCell {
whiteContentView.snp.remakeConstraints { make in whiteContentView.snp.remakeConstraints { make in
make.left.equalTo(20) make.left.equalTo(20)
make.right.lessThanOrEqualTo(-20) make.right.equalTo(-20)
make.top.equalTo(20) make.top.equalTo(20)
make.bottom.equalTo(0) make.bottom.equalTo(0)
} }
......
...@@ -149,10 +149,10 @@ class YHProductTagView: UIView { ...@@ -149,10 +149,10 @@ class YHProductTagView: UIView {
didSet { didSet {
tagLabel.text = tagModel.text tagLabel.text = tagModel.text
if !tagModel.color.isEmpty { if !tagModel.color.isEmpty {
tagLabel.layer.borderColor = UIColor(hexString: tagModel.color, transparency: 0.3)?.cgColor self.layer.borderColor = UIColor(hexString: tagModel.color, transparency: 0.3)?.cgColor
tagLabel.textColor = UIColor(hexString: tagModel.color) tagLabel.textColor = UIColor(hexString: tagModel.color)
} else { } else {
tagLabel.layer.borderColor = UIColor.mainTextColor(alpha: 0.3).cgColor self.layer.borderColor = UIColor.mainTextColor(alpha: 0.3).cgColor
tagLabel.textColor = UIColor.mainTextColor tagLabel.textColor = UIColor.mainTextColor
} }
self.setNeedsLayout() self.setNeedsLayout()
...@@ -165,7 +165,6 @@ class YHProductTagView: UIView { ...@@ -165,7 +165,6 @@ class YHProductTagView: UIView {
lable.textColor = UIColor.mainTextColor lable.textColor = UIColor.mainTextColor
lable.textAlignment = .center lable.textAlignment = .center
lable.font = UIFont.PFSC_R(ofSize:10) lable.font = UIFont.PFSC_R(ofSize:10)
lable.layer.borderWidth = 0.5
return lable return lable
}() }()
...@@ -178,8 +177,8 @@ class YHProductTagView: UIView { ...@@ -178,8 +177,8 @@ class YHProductTagView: UIView {
super.init(coder: coder) super.init(coder: coder)
} }
func createUI() { func createUI() {
self.layer.borderColor = UIColor.mainTextColor.cgColor self.layer.borderColor = UIColor.mainTextColor.cgColor
self.layer.borderWidth = 0.5 self.layer.borderWidth = 0.5
self.clipsToBounds = true self.clipsToBounds = true
......
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