Commit 69698f8a authored by Steven杜宇's avatar Steven杜宇

// AI

parent 1aaccab7
...@@ -468,6 +468,8 @@ ...@@ -468,6 +468,8 @@
045F28402CF5ED3400520F19 /* YHAITabBarItemContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045F283F2CF5ED3400520F19 /* YHAITabBarItemContentView.swift */; }; 045F28402CF5ED3400520F19 /* YHAITabBarItemContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045F283F2CF5ED3400520F19 /* YHAITabBarItemContentView.swift */; };
045F28422CF6028A00520F19 /* YHAITabViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045F28412CF6028A00520F19 /* YHAITabViewController.swift */; }; 045F28422CF6028A00520F19 /* YHAITabViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045F28412CF6028A00520F19 /* YHAITabViewController.swift */; };
045F28442CF608C100520F19 /* YHAIServiceListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045F28432CF608C100520F19 /* YHAIServiceListViewController.swift */; }; 045F28442CF608C100520F19 /* YHAIServiceListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045F28432CF608C100520F19 /* YHAIServiceListViewController.swift */; };
045F28462CF6C47800520F19 /* YHAIProductCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045F28452CF6C47800520F19 /* YHAIProductCell.swift */; };
045F28482CF6EF9800520F19 /* YHAIGreetCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045F28472CF6EF9800520F19 /* YHAIGreetCollectionReusableView.swift */; };
0468D4222B493A5E00CFB916 /* YHPhoneMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */; }; 0468D4222B493A5E00CFB916 /* YHPhoneMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */; };
0468D4262B495A5400CFB916 /* YHPickPhoneAddressViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4252B495A5400CFB916 /* YHPickPhoneAddressViewController.swift */; }; 0468D4262B495A5400CFB916 /* YHPickPhoneAddressViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4252B495A5400CFB916 /* YHPickPhoneAddressViewController.swift */; };
0468D4282B50D4AF00CFB916 /* YHPrivacyAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4272B50D4AF00CFB916 /* YHPrivacyAlertView.swift */; }; 0468D4282B50D4AF00CFB916 /* YHPrivacyAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4272B50D4AF00CFB916 /* YHPrivacyAlertView.swift */; };
...@@ -1510,6 +1512,8 @@ ...@@ -1510,6 +1512,8 @@
045F283F2CF5ED3400520F19 /* YHAITabBarItemContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAITabBarItemContentView.swift; sourceTree = "<group>"; }; 045F283F2CF5ED3400520F19 /* YHAITabBarItemContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAITabBarItemContentView.swift; sourceTree = "<group>"; };
045F28412CF6028A00520F19 /* YHAITabViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAITabViewController.swift; sourceTree = "<group>"; }; 045F28412CF6028A00520F19 /* YHAITabViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAITabViewController.swift; sourceTree = "<group>"; };
045F28432CF608C100520F19 /* YHAIServiceListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAIServiceListViewController.swift; sourceTree = "<group>"; }; 045F28432CF608C100520F19 /* YHAIServiceListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAIServiceListViewController.swift; sourceTree = "<group>"; };
045F28452CF6C47800520F19 /* YHAIProductCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAIProductCell.swift; sourceTree = "<group>"; };
045F28472CF6EF9800520F19 /* YHAIGreetCollectionReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAIGreetCollectionReusableView.swift; sourceTree = "<group>"; };
0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPhoneMessageView.swift; sourceTree = "<group>"; }; 0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPhoneMessageView.swift; sourceTree = "<group>"; };
0468D4252B495A5400CFB916 /* YHPickPhoneAddressViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPickPhoneAddressViewController.swift; sourceTree = "<group>"; }; 0468D4252B495A5400CFB916 /* YHPickPhoneAddressViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPickPhoneAddressViewController.swift; sourceTree = "<group>"; };
0468D4272B50D4AF00CFB916 /* YHPrivacyAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrivacyAlertView.swift; sourceTree = "<group>"; }; 0468D4272B50D4AF00CFB916 /* YHPrivacyAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrivacyAlertView.swift; sourceTree = "<group>"; };
...@@ -3951,7 +3955,9 @@ ...@@ -3951,7 +3955,9 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
04943BF32CF4954800BF2255 /* YHAIMessageCell.swift */, 04943BF32CF4954800BF2255 /* YHAIMessageCell.swift */,
045F28452CF6C47800520F19 /* YHAIProductCell.swift */,
04943BF52CF49E3E00BF2255 /* YHAITextInputView.swift */, 04943BF52CF49E3E00BF2255 /* YHAITextInputView.swift */,
045F28472CF6EF9800520F19 /* YHAIGreetCollectionReusableView.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -6198,6 +6204,7 @@ ...@@ -6198,6 +6204,7 @@
0414708B2C88627B00B7B688 /* YHButlerServiceManager.swift in Sources */, 0414708B2C88627B00B7B688 /* YHButlerServiceManager.swift in Sources */,
0430E66A2C7493A5000511E2 /* YHAdopterExampleTableViewCell.swift in Sources */, 0430E66A2C7493A5000511E2 /* YHAdopterExampleTableViewCell.swift in Sources */,
04912F962CB924DA00CC3105 /* YHResignAppointTimeModifyViewController.swift in Sources */, 04912F962CB924DA00CC3105 /* YHResignAppointTimeModifyViewController.swift in Sources */,
045F28482CF6EF9800520F19 /* YHAIGreetCollectionReusableView.swift in Sources */,
045EEF102B9F171A0022A143 /* YHMainApplicantInformationViewModel.swift in Sources */, 045EEF102B9F171A0022A143 /* YHMainApplicantInformationViewModel.swift in Sources */,
0493B3DC2BA7EFE600AF9393 /* YHCertificateSearchViewController.swift in Sources */, 0493B3DC2BA7EFE600AF9393 /* YHCertificateSearchViewController.swift in Sources */,
A5DF9C632C78733200CE48E6 /* YHHKLegaldaysModel.swift in Sources */, A5DF9C632C78733200CE48E6 /* YHHKLegaldaysModel.swift in Sources */,
...@@ -6390,6 +6397,7 @@ ...@@ -6390,6 +6397,7 @@
04256E182C75BD2700A37BA4 /* YHVisaPayTypeCell.swift in Sources */, 04256E182C75BD2700A37BA4 /* YHVisaPayTypeCell.swift in Sources */,
0430E6642C7482DD000511E2 /* YHYHAdopterTravelViewModel.swift in Sources */, 0430E6642C7482DD000511E2 /* YHYHAdopterTravelViewModel.swift in Sources */,
A5CA3F502C7447FB00EB22F5 /* YHUploadCertificateVC.swift in Sources */, A5CA3F502C7447FB00EB22F5 /* YHUploadCertificateVC.swift in Sources */,
045F28462CF6C47800520F19 /* YHAIProductCell.swift in Sources */,
04A7BD192BA441D400BD35A2 /* YHMyDocumentsUrlModel.swift in Sources */, 04A7BD192BA441D400BD35A2 /* YHMyDocumentsUrlModel.swift in Sources */,
04DF69BB2CBA1CC5005AA41E /* YHResignSelectApplicantCollectCell.swift in Sources */, 04DF69BB2CBA1CC5005AA41E /* YHResignSelectApplicantCollectCell.swift in Sources */,
04A91E742CC6220900E5A079 /* YHCommonAlertView+AttributedMessage.swift in Sources */, 04A91E742CC6220900E5A079 /* YHCommonAlertView+AttributedMessage.swift in Sources */,
......
...@@ -7,64 +7,92 @@ ...@@ -7,64 +7,92 @@
// //
import UIKit import UIKit
import JXSegmentedView
class YHAIServiceListViewController: YHBaseViewController { class YHAIServiceListViewController: YHBaseViewController {
var serviceArr: [String] = [] var serviceArr: [String] = ["", "", "", ""]
lazy var collectionView: UICollectionView = { lazy var collectionView: UICollectionView = {
let flowLayout = UICollectionViewFlowLayout() let flowLayout = UICollectionViewFlowLayout()
flowLayout.itemSize = CGSize(width: 50, height: 26) flowLayout.minimumInteritemSpacing = 20.0
flowLayout.minimumInteritemSpacing = 12.0 flowLayout.minimumLineSpacing = 28.0
flowLayout.minimumLineSpacing = 12.0 flowLayout.scrollDirection = .vertical
flowLayout.scrollDirection = .horizontal
let collectView = UICollectionView(frame:.zero, collectionViewLayout: flowLayout) let collectView = UICollectionView(frame:.zero, collectionViewLayout: flowLayout)
collectView.backgroundColor = .clear
collectView.delegate = self collectView.delegate = self
collectView.dataSource = self collectView.dataSource = self
collectView.register(YHTopicItemCell.self, forCellWithReuseIdentifier: YHTopicItemCell.cellReuseIdentifier) collectView.register(YHAIProductCell.self, forCellWithReuseIdentifier: YHAIProductCell.cellReuseIdentifier)
collectView.contentInset = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: -20) collectView.register(YHAIGreetCollectionReusableView.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: YHAIGreetCollectionReusableView.reuseIdentifier)
collectView.contentInset = .zero
return collectView return collectView
}() }()
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
gk_navBarAlpha = 0
gk_navigationBar.isHidden = true
view.backgroundColor = .clear
view.addSubview(collectionView) view.addSubview(collectionView)
collectionView.snp.makeConstraints { make in collectionView.snp.makeConstraints { make in
make.left.right.top.bottom.equalToSuperview() make.left.equalTo(17)
make.right.equalTo(-17)
make.top.bottom.equalToSuperview()
} }
} }
} }
extension YHAIServiceListViewController: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout { extension YHAIServiceListViewController: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
// 返回单元格数量 // 返回单元格数量
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return serviceArr.count
}
// 返回每个单元格的大小 return serviceArr.count
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { }
return CGSize(width: (KScreenWidth-20.0*2.0)/2.0, height: 194.0) // 返回每个单元格的大小
} func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
return CGSize(width: floor((KScreenWidth-17.0*2.0-20.0)/2.0), height: 178.0)
}
// 返回自定义单元格
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHAIProductCell.cellReuseIdentifier, for: indexPath) as! YHAIProductCell
// 返回自定义单元格 if 0 <= indexPath.item && indexPath.item < serviceArr.count {
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { // 根据索引设置旋转
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHTopicItemCell.cellReuseIdentifier, for: indexPath) as! YHTopicItemCell cell.rotateToRight(indexPath.item % 2 == 0)
if 0 <= indexPath.item && indexPath.item < serviceArr.count {
cell.titleLabel.text = serviceArr[indexPath.item]
}
return cell
} }
return cell
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if 0 <= indexPath.item && indexPath.item < serviceArr.count { if 0 <= indexPath.item && indexPath.item < serviceArr.count {
let text = serviceArr[indexPath.item] let text = serviceArr[indexPath.item]
} }
} }
func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
if kind == UICollectionView.elementKindSectionHeader {
let headerView: YHAIGreetCollectionReusableView = collectionView.dequeueReusableSupplementaryView(ofKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: YHAIGreetCollectionReusableView.reuseIdentifier, for: indexPath) as! YHAIGreetCollectionReusableView
return headerView
}
return UICollectionReusableView()
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection:Int) -> CGSize {
return CGSize(width: KScreenWidth, height: 250)
}
}
extension YHAIServiceListViewController: JXSegmentedListContainerViewListDelegate {
func listView() -> UIView {
return view
}
} }
...@@ -58,7 +58,7 @@ class YHAITabViewController: YHBaseViewController { ...@@ -58,7 +58,7 @@ class YHAITabViewController: YHBaseViewController {
for i in 0..<arrItemTitles.count { for i in 0..<arrItemTitles.count {
if i == 0 { // 银河AI if i == 0 { // 银河AI
let vc = YHMessageListVC() let vc = YHAIServiceListViewController()
arrItemVCs.append(vc) arrItemVCs.append(vc)
} else if i == 1 { // 对话 } else if i == 1 { // 对话
......
//
// YHAIGreetCollectionReusableView.swift
// galaxy
//
// Created by Dufet on 2024/11/27.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAIGreetCollectionReusableView: UICollectionReusableView {
static let reuseIdentifier: String = "YHAIGreetCollectionReusableView"
lazy var iconImgView: UIImageView = {
let v = UIImageView(image: UIImage(named: ""))
v.backgroundColor = .red
return v
}()
lazy var titleLabel:UILabel = {
let lable = UILabel()
lable.textColor = UIColor.brandMainColor
lable.textAlignment = .left
lable.font = UIFont.PFSC_B(ofSize:23)
lable.text = "早上好,我是港小宝"
return lable
}()
lazy var subtitleLabel:UILabel = {
let lable = UILabel()
lable.textColor = UIColor.init(hex:0x6D788A)
lable.textAlignment = .left
lable.font = UIFont.PFSC_R(ofSize:14)
lable.numberOfLines = 0
lable.text = "可以为您提供申请进度查询和赴港攻略,有什么问题尽管问我~您可以试试了解以下内容~"
return lable
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
self.addSubview(iconImgView)
self.addSubview(titleLabel)
self.addSubview(subtitleLabel)
iconImgView.snp.makeConstraints { make in
make.left.equalTo(29)
make.top.equalTo(16)
make.width.height.equalTo(50)
}
titleLabel.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(iconImgView.snp.bottom).offset(16)
make.height.equalTo(32)
}
subtitleLabel.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(titleLabel.snp.bottom).offset(16)
make.bottom.equalTo(-30)
}
}
}
//
// YHAIProductCell.swift
// galaxy
//
// Created by Dufet on 2024/11/27.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAIProductCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHAIProductCell"
lazy var bgImgView: UIImageView = {
let v = UIImageView(image: UIImage(named: ""))
v.layer.cornerRadius = 24.0
v.backgroundColor = .green
return v
}()
lazy var iconView: UIImageView = {
let v = UIImageView(image: UIImage(named: ""))
v.backgroundColor = .red
return v
}()
lazy var titleLabel:UILabel = {
let lable = UILabel()
lable.textColor = UIColor.mainTextColor
lable.textAlignment = .left
lable.font = UIFont.PFSC_B(ofSize:14)
lable.text = "产品智能体"
return lable
}()
lazy var subtitleLabel:UILabel = {
let lable = UILabel()
lable.textColor = UIColor.init(hex:0x8993A2)
lable.textAlignment = .left
lable.font = UIFont.PFSC_R(ofSize:12)
lable.text = "银河在售商品介绍"
return lable
}()
lazy var blackButton: UIButton = {
let btn = UIButton(type: .custom)
btn.setTitle("去了解", for: .normal)
btn.setTitleColor(.white, for: .normal)
btn.titleLabel?.font = .PFSC_M(ofSize: 11)
btn.backgroundColor = .black
btn.addTarget(self, action: #selector(didSendButtonClicked), for: .touchUpInside)
btn.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
btn.layer.cornerRadius = 13.0
btn.clipsToBounds = true
return btn
}()
@objc func didSendButtonClicked() {
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
func setupUI() {
contentView.backgroundColor = .clear
backgroundColor = .clear
contentView.addSubview(bgImgView)
bgImgView.addSubview(iconView)
bgImgView.addSubview(titleLabel)
bgImgView.addSubview(subtitleLabel)
bgImgView.addSubview(blackButton)
bgImgView.snp.makeConstraints { make in
make.left.right.bottom.equalTo(0)
make.top.equalTo(8)
}
iconView.snp.makeConstraints { make in
make.width.equalTo(74)
make.height.equalTo(58)
make.centerX.equalToSuperview()
make.top.equalTo(-8)
}
titleLabel.snp.makeConstraints { make in
make.left.equalTo(17)
make.right.equalTo(-17)
make.top.equalTo(iconView.snp.bottom).offset(27)
make.height.equalTo(20)
}
subtitleLabel.snp.makeConstraints { make in
make.left.equalTo(17)
make.right.equalTo(-17)
make.top.equalTo(titleLabel.snp.bottom).offset(5)
make.height.equalTo(17)
}
blackButton.snp.makeConstraints { make in
make.left.equalTo(17)
make.top.equalTo(subtitleLabel.snp.bottom).offset(11)
make.height.equalTo(26)
make.width.equalTo(54)
}
}
func rotateToRight(_ isRotateRight: Bool) {
let degree = isRotateRight ? 2.0 : -2.0
bgImgView.transform = CGAffineTransform(rotationAngle: CGFloat(degree * CGFloat.pi / 180)) // 10 度转换为弧度
}
}
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