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

// AI

parent d6c4dc4e
......@@ -290,13 +290,6 @@ extension YHAIMainChatViewController: UITableViewDelegate, UITableViewDataSource
}
return cell
} else if msgType == .fixProductList {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFixProductListMessageCell.cellReuseIdentifier, for: indexPath) as! YHFixProductListMessageCell
if let listModel = msg.body.cardsInfo {
cell.listModel = listModel
}
return cell
} else if msgType == .cardList {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCardMessageCell.cellReuseIdentifier, for: indexPath) as! YHCardMessageCell
......
......@@ -84,6 +84,7 @@ class YHAIRobotChatViewController: YHBaseViewController {
lazy var bannerView: YHAIChatBannerView = {
let view = YHAIChatBannerView(frame: CGRectMake(0, 0, KScreenWidth, 360))
view.bgImgV.image = getBannerBg()
view.titleLabel.text = getHeaderTitle()
view.descLabel.text = getHeaderDesc()
view.bannerArr = self.getBannerForRobotType(robotType)
......@@ -311,6 +312,16 @@ class YHAIRobotChatViewController: YHBaseViewController {
}
}
func getBannerBg() -> UIImage? {
if robotType == YHAIRobotType.education.rawValue {
return UIImage(named: "ai_chat_header_bg_1")
} else if robotType == YHAIRobotType.sale.rawValue {
return UIImage(named: "ai_chat_header_bg_0")
}
return UIImage(named: "ai_chat_header_bg_0")
}
func getFlowMessages() -> [String] {
if robotType == YHAIRobotType.education.rawValue {
......@@ -345,6 +356,22 @@ class YHAIRobotChatViewController: YHBaseViewController {
return ""
}
func getBannerForRobotType(_ robotType: String) -> [YHAIChatBannerItem] {
if robotType == YHAIRobotType.sale.rawValue {
return [YHAIChatBannerItem(id: 0, title: "了解银河集团", desc: "香港身份生活一站式服务平台", msg: "银河集团,能够为我提供什么?"),
YHAIChatBannerItem(id: 1, title: "香港身份智能评估", desc: "60s快速评估,了解自身条件是否符合", msg: "开始身份办理评估"),
YHAIChatBannerItem(id: 2, title: "银河产品矩阵", desc: "香港身份、生活多样产品", msg: "介绍一下银河的产品"),]
}
if robotType == YHAIRobotType.education.rawValue {
return [YHAIChatBannerItem(id: 0, title: "幼中小学升学", desc: "去香港插班需要考核哪些"),
YHAIChatBannerItem(id: 1, title: "大学升学", desc: "DSE分数和Alevel的换算关系"),
YHAIChatBannerItem(id: 2, title: "银河教育服务", desc: "银河教育插班成功率如何?"),]
}
return []
}
func isNeedStopResonse() -> Bool {
return self.bottomInputView.status == .loading
}
......@@ -396,13 +423,6 @@ extension YHAIRobotChatViewController: UITableViewDelegate, UITableViewDataSourc
}
return cell
} else if msgType == .fixProductList {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFixProductListMessageCell.cellReuseIdentifier, for: indexPath) as! YHFixProductListMessageCell
if let listModel = msg.body.cardsInfo {
cell.listModel = listModel
}
return cell
} else if msgType == .cardList {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCardMessageCell.cellReuseIdentifier, for: indexPath) as! YHCardMessageCell
......@@ -467,22 +487,6 @@ extension YHAIRobotChatViewController: UITableViewDelegate, UITableViewDataSourc
return UITableView.automaticDimension
}
func getBannerForRobotType(_ robotType: String) -> [YHAIChatBannerItem] {
if robotType == YHAIRobotType.sale.rawValue {
return [YHAIChatBannerItem(id: 0, title: "了解银河集团", desc: "香港身份生活一站式服务平台", msg: "银河集团,能够为我提供什么?"),
YHAIChatBannerItem(id: 1, title: "香港身份智能评估", desc: "60s快速评估,了解自身条件是否符合", msg: "开始身份办理评估"),
YHAIChatBannerItem(id: 2, title: "银河产品矩阵", desc: "香港身份、生活多样产品", msg: "介绍一下银河的产品"),]
}
if robotType == YHAIRobotType.education.rawValue {
return [YHAIChatBannerItem(id: 0, title: "幼中小学升学", desc: "去香港插班需要考核哪些"),
YHAIChatBannerItem(id: 1, title: "大学升学", desc: "DSE分数和Alevel的换算关系"),
YHAIChatBannerItem(id: 2, title: "银河教育服务", desc: "银河教育插班成功率如何?"),]
}
return []
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView()
return view
......
......@@ -20,7 +20,6 @@ enum YHAIMessageType: Int {
case cardList = 2 // 卡片列表消息
case productList = 3 // 商品列表消息
case picture = 4 // 图片消息
case fixProductList = 5 // 文章列表消息
// 自定义case
case thinking = 9527 // 思考消息
......@@ -165,9 +164,7 @@ class YHAIChatMessage: CustomStringConvertible {
if contentType == YHAIMessageType.cardList.rawValue {
return .cardList
}
if contentType == YHAIMessageType.fixProductList.rawValue {
return .fixProductList
}
if contentType == YHAIMessageType.picture.rawValue {
return .picture
}
......
......@@ -57,7 +57,7 @@ class YHAIChatBannerView: UIView {
let imagV : UIImageView = UIImageView()
imagV.contentMode = .scaleAspectFill
imagV.clipsToBounds = true
imagV.image = UIImage(named: "ai_chat_header_bg")
imagV.image = UIImage(named: "ai_chat_header_bg_0")
imagV.isUserInteractionEnabled = true
return imagV
}()
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "Remove-bg.ai_1732537885367 1.png",
"filename" : "教育@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Remove-bg.ai_1732537885367 1@3x.png",
"filename" : "教育@3x.png",
"idiom" : "universal",
"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