Commit 8b9bc592 authored by Steven杜宇's avatar Steven杜宇

// AI

parent c70db345
......@@ -178,6 +178,7 @@
0430E68E2C7875F4000511E2 /* YHAdopterDependentDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430E68D2C7875F4000511E2 /* YHAdopterDependentDataModel.swift */; };
0430E6902C7EC78C000511E2 /* YHCardUploadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430E68F2C7EC78C000511E2 /* YHCardUploadView.swift */; };
0430E6922C7EF08B000511E2 /* YHAdopterOtherCardTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430E6912C7EF08B000511E2 /* YHAdopterOtherCardTableViewCell.swift */; };
0430EFDA2D041F5800EC8CC0 /* YHAIEvaluationWebView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430EFD92D041F5800EC8CC0 /* YHAIEvaluationWebView.swift */; };
0431F8822C942D88003B84F4 /* YHResignMaterialNameCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0431F8812C942D88003B84F4 /* YHResignMaterialNameCell.swift */; };
0431F8842C9579F7003B84F4 /* YHResignTemplateSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0431F8832C9579F7003B84F4 /* YHResignTemplateSheetView.swift */; };
04358E042C77322700811928 /* YHHaveGrabbedNumberListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04358E032C77322700811928 /* YHHaveGrabbedNumberListCell.swift */; };
......@@ -1289,6 +1290,7 @@
0430E68D2C7875F4000511E2 /* YHAdopterDependentDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAdopterDependentDataModel.swift; sourceTree = "<group>"; };
0430E68F2C7EC78C000511E2 /* YHCardUploadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCardUploadView.swift; sourceTree = "<group>"; };
0430E6912C7EF08B000511E2 /* YHAdopterOtherCardTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAdopterOtherCardTableViewCell.swift; sourceTree = "<group>"; };
0430EFD92D041F5800EC8CC0 /* YHAIEvaluationWebView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAIEvaluationWebView.swift; sourceTree = "<group>"; };
0431F8812C942D88003B84F4 /* YHResignMaterialNameCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignMaterialNameCell.swift; sourceTree = "<group>"; };
0431F8832C9579F7003B84F4 /* YHResignTemplateSheetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignTemplateSheetView.swift; sourceTree = "<group>"; };
04358E032C77322700811928 /* YHHaveGrabbedNumberListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHaveGrabbedNumberListCell.swift; sourceTree = "<group>"; };
......@@ -4490,6 +4492,7 @@
04BE3A902CFFFF0900BD31DB /* YHFixProductMessageCell.swift */,
04BE3A912CFFFF0900BD31DB /* YHProductItemView.swift */,
04BE3A922CFFFF0900BD31DB /* YHProductListMessageCell.swift */,
0430EFD92D041F5800EC8CC0 /* YHAIEvaluationWebView.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -6271,6 +6274,7 @@
047F3DF22CE888EF001B2A6D /* YHDocumentListCell.swift in Sources */,
040AE9992CF5CB1D00310241 /* YHSelectLookHeadView.swift in Sources */,
04256DE42C72E3FA00A37BA4 /* YHInfoItemOptionView.swift in Sources */,
0430EFDA2D041F5800EC8CC0 /* YHAIEvaluationWebView.swift in Sources */,
04256DF22C734E7E00A37BA4 /* YHGrabFileCell.swift in Sources */,
04CA2C052CB8F75700F36DE7 /* YHResignUploadDocListViewModel.swift in Sources */,
A5ACE9512B4564F7002C94D2 /* YhConstant.swift in Sources */,
......
......@@ -295,11 +295,6 @@ extension YHAIMainChatViewController: UITableViewDelegate, UITableViewDataSource
}
}
cell.updateSizeBlock = {
[weak self] in
guard let self = self else { return }
self.tableView.reloadData()
}
}
return cell
......
......@@ -353,11 +353,7 @@ extension YHAIRobotChatViewController: UITableViewDelegate, UITableViewDataSourc
}
}
cell.updateSizeBlock = {
[weak self] in
guard let self = self else { return }
self.tableView.reloadData()
}
}
return cell
......
......@@ -119,7 +119,7 @@ class YHAICardItemView: UIView {
@objc func didItemViewClicked() {
YHAIJumpPageTool.jumpPageWithType(0, mode: cardModel.redirectMode, path: cardModel.redirectPath) {
YHAIJumpPageTool.jumpPageWithType(mode: cardModel.redirectMode, path: cardModel.redirectPath) {
dict in
}
}
......
//
// YHAIEvaluationWebView.swift
// galaxy
//
// Created by Dufet on 2024/12/7.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAIEvaluationWebView: UIView {
var finishBlock: (([String:Any])->())?
lazy var webVC: YHH5WebViewVC = {
let vc = YHH5WebViewVC()
vc.isFullScreenFlag = true
vc.isHideNavigationBar = true
vc.evaluationResultCallback = {
[weak self] dict in
guard let self = self else { return }
finishBlock?(dict)
self.dismiss()
}
return vc
}()
static func webView(url: String, finishBlock: (([String:Any])->())?) -> YHAIEvaluationWebView {
let view = YHAIEvaluationWebView(frame: UIScreen.main.bounds, url: url)
view.webVC.url = url
view.finishBlock = finishBlock
return view
}
func show() {
self.frame = CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight)
UIApplication.shared.yhKeyWindow()?.addSubview(self)
UIView.animate(withDuration: 1.0, delay: 0, options: .curveEaseOut, animations: {
self.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight)
}) { finished in
self.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight)
}
}
func dismiss() {
UIView.animate(withDuration: 0.5, delay: 0, options: .curveEaseOut, animations: {
self.frame = CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight)
}) { finished in
self.removeFromSuperview()
}
}
init(frame: CGRect, url: String) {
super.init(frame: frame)
self.webVC.url = url
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
self.addSubview(webVC.view)
webVC.view.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
}
}
......@@ -193,7 +193,7 @@ class YHAITextMessageCell: UITableViewCell {
@objc func didCopyTextLongGesture(_ sender: UIGestureRecognizer) {
let text = message.body.contentText
if sender.state == .began && UIPasteboard.general.string != text {
if sender.state == .began {
UIPasteboard.general.string = text
YHHUD.flash(message: "复制成功")
}
......
......@@ -8,34 +8,40 @@
import UIKit
enum YHAIJumpType: Int {
case common = 0
case evaluation = 1
}
enum YHAIJumpMode: Int {
case web = 1
case app = 2
case robot = 3
}
class YHAIJumpPageTool {
// mode = 0 // 1 web 2 原生页面 3 AI_Robot
// type = 0 // 0 普通 1 测评
static func jumpPageWithType(_ type:Int = 0, mode: Int, path: String, block:(([String:Any])->())?) {
static func jumpPageWithType(_ type:YHAIJumpType = .common, mode: Int, path: String, block:(([String:Any])->())?) {
printLog("type:\(type) mdde:\(mode) path:\(path)")
if mode == 1 { //
if mode == YHAIJumpMode.web.rawValue { //
if !path.isEmpty {
let vc = YHH5WebViewVC()
vc.url = path
if type == 1 {
vc.isPushed = false
vc.isFullScreenFlag = true
vc.isHideNavigationBar = true
vc.evaluationResultCallback = {
dict in
block?(dict)
}
UIViewController.current?.present(vc, animated: true)
if type == .evaluation {
YHAIEvaluationWebView.webView(url: path, finishBlock: block).show()
} else {
let vc = YHH5WebViewVC()
vc.url = path
UIViewController.current?.navigationController?.pushViewController(vc, animated: true)
}
}
} else if mode == 2 {
} else if mode == YHAIJumpMode.app.rawValue {
// customerVoice -> APP客户心声 productList -> APP-首页银河甄选
if path == YHAIJumpPageType.customerHeart.rawValue {
//客户心声
......@@ -55,7 +61,7 @@ class YHAIJumpPageTool {
goTabBarBy(tabType: .service)
}
} else if mode == 3 {
} else if mode == YHAIJumpMode.robot.rawValue {
}
}
......@@ -65,8 +71,6 @@ class YHCardMessageCell: UITableViewCell {
static let cellReuseIdentifier = "YHCardMessageCell"
var updateSizeBlock:(()->())?
var evaluationResultCallback: ((Dictionary<String, Any>)->()) = { dic in }
var cardListModel = YHAIListInfoModel() {
......@@ -83,7 +87,6 @@ class YHCardMessageCell: UITableViewCell {
productView.updateSizeBlock = {
[weak self] size in
guard let self = self else { return }
self.updateSizeBlock?()
}
productView.cardModel = item
listView.addSubview(productView)
......@@ -160,9 +163,9 @@ class YHCardMessageCell: UITableViewCell {
@objc func didBottomButtonClicked() {
var type = 0
var type = YHAIJumpType.common
if cardListModel.isEvaluation() {
type = 1
type = YHAIJumpType.evaluation
}
YHAIJumpPageTool.jumpPageWithType(type, mode: cardListModel.redirectMode, path: cardListModel.redirectPath) {
dict in
......@@ -196,7 +199,6 @@ class YHCardMessageCell: UITableViewCell {
make.edges.equalTo(whiteContentView)
}
whiteContentView.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.equalTo(-20)
......
......@@ -87,7 +87,7 @@ class YHProductItemView: UIView {
}
@objc func didClickProductItem() {
YHAIJumpPageTool.jumpPageWithType(0, mode: productModel.redirectMode, path: productModel.redirectPath) {
YHAIJumpPageTool.jumpPageWithType(mode: productModel.redirectMode, path: productModel.redirectPath) {
dict in
}
}
......
......@@ -111,7 +111,7 @@ class YHProductListMessageCell: UITableViewCell {
@objc func didMoreButtonClicked() {
YHAIJumpPageTool.jumpPageWithType(0, mode: listModel.redirectMode, path: listModel.redirectPath) {
YHAIJumpPageTool.jumpPageWithType(mode: listModel.redirectMode, path: listModel.redirectPath) {
dict in
}
}
......
......@@ -120,9 +120,6 @@ class YHH5WebViewVC: YHBaseViewController, WKUIDelegate, WKNavigationDelegate {
//6、是否展示 导航栏上的title
var showNavigationTitleFlag : Bool = true
// 是否push进来
var isPushed : Bool = true
//22、禁用全局手势
private var disableFullScreenGestureFlag : Bool = false
......@@ -521,14 +518,8 @@ extension YHH5WebViewVC {
if type == 2 {
printLog("web evaluation:\n")
printLog("\(dic)")
self.evaluationResultCallback?(dic)
}
if isPushed {
self.navigationController?.popViewController(animated: true)
} else {
self.dismiss(animated: true)
}
self.evaluationResultCallback?(dic)
}
//22、禁用全局手势返回
......
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