3FD1DFED2F0E00BF00A62733 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 3F8F58282EBCA2B800FFC00B /* PrivacyInfo.xcprivacy */; };
3FD1DFF02F0E00BF00A62733 /* JLAudioUnitKit.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3FD1A2912F0BC9D800A62733 /* JLAudioUnitKit.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
644D1BB5EDD3EA1D77C57786 /* Pods_DeepChordsSdk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 248D8B53B5A178ACA5867275 /* Pods_DeepChordsSdk.framework */; };
+ 7A6613B4B617D6E71D34944C /* Pods_ShenYin.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 90FF0C8B0D4D6AE0933FA672 /* Pods_ShenYin.framework */; };
817510A595D00CAD05E3772C /* Pods_playboy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F69407092D551BA7F3AD217C /* Pods_playboy.framework */; };
F2E449CAD5874BE652A69B50 /* (null) in Frameworks */ = {isa = PBXBuildFile; };
/* End PBXBuildFile section */
3FD1DFF42F0E00BF00A62733 /* playboy.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = playboy.app; sourceTree = BUILT_PRODUCTS_DIR; };
5A92F7DC2CB6E6E69D2AB23E /* Pods-DeepChordsSdk.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DeepChordsSdk.debug.xcconfig"; path = "Target Support Files/Pods-DeepChordsSdk/Pods-DeepChordsSdk.debug.xcconfig"; sourceTree = "<group>"; };
5F5DE5910965D53C2B3405B0 /* Pods-ShenYin.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ShenYin.debug.xcconfig"; path = "Target Support Files/Pods-ShenYin/Pods-ShenYin.debug.xcconfig"; sourceTree = "<group>"; };
+ 90FF0C8B0D4D6AE0933FA672 /* Pods_ShenYin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ShenYin.framework; sourceTree = BUILT_PRODUCTS_DIR; };
CB933A7969ADF81D59503790 /* Pods-LingQi.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LingQi.debug.xcconfig"; path = "Target Support Files/Pods-LingQi/Pods-LingQi.debug.xcconfig"; sourceTree = "<group>"; };
CE98543C79FAAB6CEF4CBFCA /* Pods-LingQi.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LingQi.release.xcconfig"; path = "Target Support Files/Pods-LingQi/Pods-LingQi.release.xcconfig"; sourceTree = "<group>"; };
E7D3DF51BED56E93E4ED8102 /* Pods-DeepChordsSdk.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DeepChordsSdk.release.xcconfig"; path = "Target Support Files/Pods-DeepChordsSdk/Pods-DeepChordsSdk.release.xcconfig"; sourceTree = "<group>"; };
3F469CB12F0B539600121DBD /* DeepChordsSdk.framework in Frameworks */,
F2E449CAD5874BE652A69B50 /* (null) in Frameworks */,
3FD1A2952F0BCACB00A62733 /* JLAudioUnitKit.xcframework in Frameworks */,
+ 7A6613B4B617D6E71D34944C /* Pods_ShenYin.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
3F7602EA2EFA891200588C18 /* DeepChordsSdk.framework */,
248D8B53B5A178ACA5867275 /* Pods_DeepChordsSdk.framework */,
F69407092D551BA7F3AD217C /* Pods_playboy.framework */,
+ 90FF0C8B0D4D6AE0933FA672 /* Pods_ShenYin.framework */,
);
name = Frameworks;
sourceTree = "<group>";
--- /dev/null
+//
+// AiFunctionVC.swift
+// ShenYin
+//
+// Created by liangshi on 2026/1/9.
+//
+
+import UIKit
+
+class AiFunctionVC:BaseVC{
+ private let bgView = UIScrollView()
+ private let headerView = AiFunctionHeadView()
+ private let functionView = AiFunctionView()
+
+ private var device: HomeDeviceModel
+ init(device model: HomeDeviceModel) {
+ self.device = model
+ super.init()
+ }
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+ NotificationManager.add(self, selector: #selector(deviceChange(_:)), forName: .deviceValidChange)
+ updateUI()
+ }
+
+ override func setupViews() {
+ navBar.title = device.productName
+ navBar.backgroundColor = .color(.bgColor)
+ view.backgroundColor = .color(.bgColor)
+ // navBar.rightView.setImage(UIImage(named: "add_icon"), for: .normal)
+ view.addSubview(bgView)
+ bgView.addSubviews([headerView,functionView])
+ headerView.do { v in
+ v.icon.imageView.kf.setImage(with: device.image.yc.asUrl)
+ v.bottonView.yc.addTap(target: self, action: #selector(chatAction))
+ }
+ functionView.do { v in
+ v.tapCallback = {[weak self] type in
+ self?.tapFunctionAction(type)
+ }
+ }
+ }
+ override func setupLayout() {
+ bgView.snp.makeConstraints { make in
+ make.top.equalTo(kNavBtm)
+ make.left.right.bottom.equalToSuperview()
+ }
+ headerView.snp.makeConstraints { make in
+ make.top.equalToSuperview()
+ make.left.equalToSuperview()
+ make.width.equalTo(kScreenWid)
+ }
+ functionView.snp.makeConstraints { make in
+ make.top.equalTo(headerView.snp.bottom).offset(10)
+ make.left.equalToSuperview()
+ make.width.equalTo(kScreenWid)
+ }
+ }
+ func updateUI(){
+ if let mac = CCBleManager.shared.connectPeripheral?.mac, mac == device.mac, CCBleManager.shared.isConnetd{
+ headerView.enable = true
+ functionView.enable = true
+ }
+ else{
+ headerView.enable = false
+ functionView.enable = false
+ }
+ }
+ @objc func deviceChange(_ noti:Notification){
+ updateUI()
+ }
+ @objc func chatAction(){
+ if let mac = CCBleManager.shared.connectPeripheral?.mac, mac == device.mac, CCBleManager.shared.isConnetd{
+ CCPage.gotoChat()
+ }
+ }
+ func tapFunctionAction(_ type:HomeCellType){
+// if type == .recordHistory{
+// App.shared.goToPage(HistoryRecordVC())
+// return
+// }
+// if let mac = CCBleManager.shared.connectPeripheral?.mac, mac == device.mac, CCBleManager.shared.isConnetd{
+ switch type {
+ case .fileRecord:
+ CCPage.gotoFieldRecord()
+ case .callRecord:
+ CCPage.gotoCallRecord()
+ case .chinese2English:
+ CCPage.gotoChinese2Enlgish()
+ case .recordTranslate:
+ CCPage.gotoTcty()
+ case .dialogTranslate:
+ CCPage.gotoDialogTranslate()
+ case .textTranslate:
+ App.shared.goToPage(TextTranlateVC())
+ case .recordHistory:
+ App.shared.goToPage(HistoryRecordVC())
+ }
+// }
+ }
+}
+
+fileprivate class AiFunctionHeadView: BaseView {
+ let icon = CurrentDeviceView()
+ let bottonView = UIView()
+ let tipsIcon = UIImageView()
+ let titleLabel = UILabel()
+ let valueLabel = UILabel()
+ let arrowIcon = UIImageView()
+ var enable:Bool = false{
+ didSet{
+ if enable {
+ self.alpha = 1
+ }
+ else{
+ self.alpha = 0.5
+ }
+ }
+ }
+
+ override func setupViews() {
+ addSubviews([icon,bottonView])
+ bottonView.addSubviews([titleLabel,valueLabel,tipsIcon,arrowIcon])
+ // backgroundColor = .blue
+ icon.do { v in
+ // v.backgroundColor = .lightGray
+ }
+ bottonView.do { v in
+ v.backgroundColor = .color(.cellBg)
+ v.yc.setCornerRadius(8)
+ }
+ tipsIcon.do { v in
+ v.image = UIImage(named: "home_chat")
+ }
+ titleLabel.do { (v) in
+ v.textColor = .color(.first)
+ v.font = .bold(16)
+ v.text = "AI" + "智能对话".l10n
+ }
+ valueLabel.do { (v) in
+ v.textColor = .rgb(0x8d8d8d)
+ v.font = .regular(12)
+ v.text = "AI" + "伙伴,随叫随到".l10n
+ }
+ self.enable = CCBleManager.shared.isConnetd
+ }
+
+ override func setupLayout() {
+ icon.snp.makeConstraints { make in
+ make.top.width.left.equalToSuperview()
+ }
+ bottonView.snp.makeConstraints { make in
+ make.left.right.equalToSuperview().inset(15)
+ make.top.equalTo(icon.snp.bottom).offset(20)
+ make.bottom.equalToSuperview()
+ make.height.equalTo(90)
+ }
+ titleLabel.snp.makeConstraints { make in
+ make.left.equalToSuperview().inset(15)
+ make.top.equalTo(23)
+ }
+ valueLabel.snp.makeConstraints { make in
+ make.left.equalTo(titleLabel)
+ make.bottom.equalToSuperview().inset(24)
+ }
+ arrowIcon.snp.makeConstraints { make in
+ make.width.equalTo(7)
+ make.height.equalTo(13)
+ make.centerY.equalTo(valueLabel)
+ make.left.equalTo(valueLabel.snp.right).offset(2)
+ }
+ tipsIcon.snp.makeConstraints { make in
+ make.size.equalTo(50)
+ make.right.equalToSuperview().inset(16)
+ make.centerY.equalToSuperview()
+ }
+
+ }
+}
+fileprivate class AiFunctionView: BaseView {
+ let list:[HomeCellType] = [.fileRecord,.callRecord,.recordTranslate,.dialogTranslate,.textTranslate,.recordHistory]
+ var enable:Bool = false{
+ didSet{
+ for item in self.subviews{
+ if let view = item as? HomeCell {
+ view.enable = enable
+ if view.type == .recordHistory {
+ view.enable = true
+ }
+ }
+ }
+ }
+ }
+ var tapCallback:((HomeCellType)->Void)?
+
+ override func setupViews() {
+ let h = 64.0
+ var y = 0.0
+ for (index, value) in list.enumerated() {
+ let view = HomeCell()
+ view.enable = CCBleManager.shared.isConnetd
+ view.yc.addTap(target: self, action: #selector(tapAction(_:)))
+ addSubview(view)
+
+ view.type = value
+ view.snp.makeConstraints { make in
+ make.left.right.equalToSuperview().inset(18)
+ make.height.equalTo(h)
+ make.top.equalToSuperview().inset(y)
+ if index == list.count - 1 {
+ make.bottom.equalToSuperview()
+ }
+ }
+ y += h + 10
+ }
+ }
+ @objc func tapAction(_ tap:UITapGestureRecognizer){
+ if let view = tap.view as? HomeCell{
+ if view.enable {
+ tapCallback?(view.type)
+ }
+ }
+ }
+}
+fileprivate class HomeCell: BaseView {
+ let bgView = UIView()
+ let icon = UIImageView()
+ let titleLabel = UILabel()
+ let valueLabel = UILabel()
+ let arrowIcon = UIImageView()
+ var type = HomeCellType.callRecord{
+ didSet{
+ titleLabel.text = type.title
+ valueLabel.text = type.subTitle
+ icon.image = UIImage(named: type.icon)
+ }
+ }
+ var enable:Bool = false{
+ didSet{
+ if enable || type == .recordHistory {
+ alpha = 1
+ }
+ else{
+ alpha = 0.5
+ }
+ }
+ }
+
+ override func setupViews() {
+ addSubview(bgView)
+ bgView.addSubviews([titleLabel,icon,valueLabel,arrowIcon])
+ bgView.do { v in
+ v.backgroundColor = .color(.cellBg)
+ v.yc.setCornerRadius(8)
+ }
+ icon.do { v in
+ // v.backgroundColor = .lightGray
+ }
+ titleLabel.do { (v) in
+ v.textColor = .color(.first)
+ v.font = .bold(14)
+ v.numberOfLines = 2
+ }
+ valueLabel.do { (v) in
+ v.textColor = .rgb(0x8d8d8d)
+ v.font = .regular(10)
+ v.numberOfLines = 2
+ }
+ arrowIcon.image = UIImage(named: "arrow_2")
+ }
+
+ override func setupLayout() {
+ bgView.snp.makeConstraints { make in
+ make.left.right.top.bottom.equalToSuperview()
+ }
+ icon.snp.makeConstraints { (m) in
+ m.size.equalTo(36)
+ m.left.equalToSuperview().inset(14)
+ m.top.equalToSuperview().inset(14)
+ }
+ titleLabel.snp.makeConstraints { (m) in
+ m.top.equalToSuperview().inset(14)
+ m.left.equalToSuperview().offset(61)
+ m.right.lessThanOrEqualTo(arrowIcon.snp.left)
+ }
+ valueLabel.snp.makeConstraints { (m) in
+ m.bottom.equalToSuperview().inset(15)
+ m.left.equalTo(titleLabel)
+ m.right.lessThanOrEqualTo(arrowIcon.snp.left)
+ }
+ arrowIcon.snp.makeConstraints { make in
+ make.width.equalTo(7)
+ make.height.equalTo(13)
+ make.centerY.equalToSuperview()
+ make.right.equalToSuperview().inset(14)
+ }
+ }
+
+}