Commit 37f9405b authored by Steven杜宇's avatar Steven杜宇

// AI

parent 2fa1df59
...@@ -10,6 +10,52 @@ import ESTabBarController_swift ...@@ -10,6 +10,52 @@ import ESTabBarController_swift
class YHAITabBarItemContentView: ESTabBarItemContentView { class YHAITabBarItemContentView: ESTabBarItemContentView {
var timer: Timer?
lazy var tipsView: UIView = {
let v = UIView()
let grayView = UIView()
grayView.backgroundColor = UIColor(hex: 0x000000, alpha: 0.6)
grayView.layer.cornerRadius = 6.0
grayView.clipsToBounds = true
v.addSubview(grayView)
let label = UILabel()
label.textColor = UIColor.white
label.textAlignment = .center
label.font = UIFont.PFSC_R(ofSize:12)
label.text = "Hi 我是港小宝,有什么需要帮助的,来找我吧~"
grayView.addSubview(label)
let arrowImgV = UIImageView(image: UIImage(named: "ai_tab_down_arrow"))
v.addSubview(arrowImgV)
arrowImgV.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.width.equalTo(24)
make.height.equalTo(6)
make.bottom.equalTo(-4)
}
label.snp.makeConstraints { make in
make.left.equalTo(15)
make.right.equalTo(-15)
make.height.equalTo(34)
make.top.bottom.equalToSuperview()
}
grayView.snp.makeConstraints { make in
make.left.equalTo(0)
make.right.equalTo(0)
make.top.equalToSuperview()
make.bottom.equalTo(arrowImgV.snp.top)
}
return v
}()
lazy var bottomTitleLabel: UILabel = { lazy var bottomTitleLabel: UILabel = {
let label = UILabel() let label = UILabel()
label.textColor = UIColor.mainTextColor label.textColor = UIColor.mainTextColor
...@@ -26,29 +72,66 @@ class YHAITabBarItemContentView: ESTabBarItemContentView { ...@@ -26,29 +72,66 @@ class YHAITabBarItemContentView: ESTabBarItemContentView {
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
createUI()
}
public required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func updateLayout() {
super.updateLayout()
}
func createUI() {
self.removeSubviews() self.removeSubviews()
self.addSubview(iconImgView) self.addSubview(iconImgView)
self.addSubview(bottomTitleLabel) self.addSubview(bottomTitleLabel)
self.addSubview(tipsView)
bottomTitleLabel.snp.makeConstraints { make in bottomTitleLabel.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview() make.left.right.bottom.equalToSuperview()
make.height.equalTo(14) make.height.equalTo(14)
} }
iconImgView.snp.makeConstraints { make in iconImgView.snp.makeConstraints { make in
make.width.height.equalTo(48.0) make.width.height.equalTo(48.0)
make.bottom.equalTo(bottomTitleLabel.snp.top) make.bottom.equalTo(bottomTitleLabel.snp.top)
make.centerX.equalToSuperview() make.centerX.equalToSuperview()
} }
tipsView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.bottom.equalTo(iconImgView.snp.top)
}
startTimer()
} }
public required init?(coder aDecoder: NSCoder) { func startTimer() {
fatalError("init(coder:) has not been implemented") // 每隔 1 秒调用 timerFired 方法
timer = Timer.scheduledTimer(timeInterval: 5.0,
target: self,
selector: #selector(timerFired),
userInfo: nil,
repeats: false)
} }
override func updateLayout() { @objc func timerFired() {
super.updateLayout() stopTimer()
tipsView.isHidden = true
}
// 停止定时器
func stopTimer() {
timer?.invalidate()
timer = nil
}
deinit {
// 确保在视图控制器被销毁时停止定时器
stopTimer()
} }
} }
...@@ -150,7 +150,7 @@ extension YHAIServiceListViewController: UICollectionViewDelegate, UICollectionV ...@@ -150,7 +150,7 @@ extension YHAIServiceListViewController: UICollectionViewDelegate, UICollectionV
} }
} else if model.redirectMode == 2 { } else if model.redirectMode == 2 {
// customerVoice -> APP客户心声 productList -> APP-首页银河甄选 // customerVoice -> APP客户心声 productList -> APP-首页银河甄选 AppServiceTab -> 服务页
if model.redirectPath == YHAIJumpPageType.customerHeart.rawValue { if model.redirectPath == YHAIJumpPageType.customerHeart.rawValue {
//客户心声 //客户心声
let vc = YHOtherServiceViewController() let vc = YHOtherServiceViewController()
...@@ -162,6 +162,11 @@ extension YHAIServiceListViewController: UICollectionViewDelegate, UICollectionV ...@@ -162,6 +162,11 @@ extension YHAIServiceListViewController: UICollectionViewDelegate, UICollectionV
let vc = YHSelectViewController() let vc = YHSelectViewController()
vc.hideFlag = false vc.hideFlag = false
UIViewController.current?.navigationController?.pushViewController(vc, animated: true) UIViewController.current?.navigationController?.pushViewController(vc, animated: true)
} else if model.redirectPath == YHAIJumpPageType.appServiceTab.rawValue {
// 服务页
UIViewController.current?.navigationController?.popToRootViewController(animated: true)
goTabBarBy(tabType: .service)
} }
} else if model.redirectMode == 3 { // agent } else if model.redirectMode == 3 { // agent
......
...@@ -229,8 +229,10 @@ class YHAIMessageBody: SmartCodable { ...@@ -229,8 +229,10 @@ class YHAIMessageBody: SmartCodable {
} }
enum YHAIJumpPageType: String { enum YHAIJumpPageType: String {
// customerVoice -> APP客户心声 productList -> APP-首页银河甄选 AppServiceTab -> 服务页
case customerHeart = "customerVoice" // APP客户心声 case customerHeart = "customerVoice" // APP客户心声
case galaxySelect = "productList" // APP-首页银河甄选 case galaxySelect = "productList" // APP-首页银河甄选
case appServiceTab = "AppServiceTab" // 服务页
} }
class YHAIListInfoModel: SmartCodable { class YHAIListInfoModel: SmartCodable {
......
...@@ -48,7 +48,13 @@ class YHAIJumpPageTool { ...@@ -48,7 +48,13 @@ class YHAIJumpPageTool {
let vc = YHSelectViewController() let vc = YHSelectViewController()
vc.hideFlag = false vc.hideFlag = false
UIViewController.current?.navigationController?.pushViewController(vc, animated: true) UIViewController.current?.navigationController?.pushViewController(vc, animated: true)
} else if path == YHAIJumpPageType.appServiceTab.rawValue {
// 服务页
UIViewController.current?.navigationController?.popToRootViewController(animated: true)
goTabBarBy(tabType: .service)
} }
} else if mode == 3 { } else if mode == 3 {
} }
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Rectangle 346242466@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Rectangle 346242466@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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