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

// AI

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