加了固件升级入口
authorliangzhenying <867174124@qq.com>
Mon, 30 Mar 2026 08:36:07 +0000 (16:36 +0800)
committerliangzhenying <867174124@qq.com>
Mon, 30 Mar 2026 08:36:07 +0000 (16:36 +0800)
33 files changed:
ShenYin/ShenYin.xcodeproj/project.pbxproj
ShenYin/ShenYin/Channel/DeepChords/Channel/Config/CCConfig.swift
ShenYin/ShenYin/Channel/DeepChords/Channel/UI/JoyAiFunctionVC.swift
ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/home/update_icon_normal.imageset/Contents.json [new file with mode: 0644]
ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/home/update_icon_normal.imageset/Frame@2x.png [new file with mode: 0644]
ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/home/update_icon_normal.imageset/Frame@3x.png [new file with mode: 0644]
ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/home/update_icon_tips.imageset/Contents.json [new file with mode: 0644]
ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/home/update_icon_tips.imageset/Frame@2x.png [new file with mode: 0644]
ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/home/update_icon_tips.imageset/Frame@3x.png [new file with mode: 0644]
ShenYin/ShenYin/Channel/DeviceVM.swift [moved from ShenYin/ShenYin/UI/Home/Scan/DeviceVM.swift with 100% similarity]
ShenYin/ShenYin/Channel/PLAYBOY/Channel/Config/CCConfig.swift
ShenYin/ShenYin/Channel/PLAYBOY/Channel/UI/PbAiFunctionVC.swift
ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/home/update_icon_normal.imageset/Contents.json [new file with mode: 0644]
ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/home/update_icon_normal.imageset/Frame@2x.png [new file with mode: 0644]
ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/home/update_icon_normal.imageset/Frame@3x.png [new file with mode: 0644]
ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/home/update_icon_tips.imageset/Contents.json [new file with mode: 0644]
ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/home/update_icon_tips.imageset/Frame@2x.png [new file with mode: 0644]
ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/home/update_icon_tips.imageset/Frame@3x.png [new file with mode: 0644]
ShenYin/ShenYin/Channel/PaXa/Config/CCConfig.swift
ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/home/update_icon_normal.imageset/Contents.json [new file with mode: 0644]
ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/home/update_icon_normal.imageset/Frame@2x.png [new file with mode: 0644]
ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/home/update_icon_normal.imageset/Frame@3x.png [new file with mode: 0644]
ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/home/update_icon_tips.imageset/Contents.json [new file with mode: 0644]
ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/home/update_icon_tips.imageset/Frame@2x.png [new file with mode: 0644]
ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/home/update_icon_tips.imageset/Frame@3x.png [new file with mode: 0644]
ShenYin/ShenYin/UI/Mine/AboutVC.swift
ShenYin/ShenYin/UI/Mine/Root/MineVC.swift
ShenYin/ShenYin/UI/Mine/Update/AppUpdateModel.swift
ShenYin/ShenYin/UI/Mine/Update/AppUpdateVM.swift
ShenYin/ShenYin/UI/Mine/Update/BleUpdateVC.swift [moved from ShenYin/ShenYin/UI/Mine/Update/UpdateVC.swift with 51% similarity]
ShenYin/ShenYin/UI/Mine/Update/BleUpdateVM.swift
ShenYin/ShenYin/UI/Mine/UserInfo/UserInfoCell.swift
ShenYin/ShenYin/UI/Mine/UserInfo/UserInfoVC.swift

index e4a92ca..2ede7bb 100644 (file)
                                        "@executable_path/Frameworks",
                                );
                                LIBRARY_SEARCH_PATHS = "$(inherited)";
-                               MARKETING_VERSION = 1.0.0;
+                               MARKETING_VERSION = 1.0.5;
                                PRODUCT_BUNDLE_IDENTIFIER = com.deepchords.app;
                                PRODUCT_NAME = "$(TARGET_NAME)";
                                PROVISIONING_PROFILE_SPECIFIER = "";
                                        "@executable_path/Frameworks",
                                );
                                LIBRARY_SEARCH_PATHS = "$(inherited)";
-                               MARKETING_VERSION = 1.0.0;
+                               MARKETING_VERSION = 1.0.5;
                                PRODUCT_BUNDLE_IDENTIFIER = com.deepchords.app;
                                PRODUCT_NAME = "$(TARGET_NAME)";
                                PROVISIONING_PROFILE_SPECIFIER = "";
                                        "@executable_path/Frameworks",
                                );
                                LIBRARY_SEARCH_PATHS = "$(inherited)";
-                               MARKETING_VERSION = 0.02;
+                               MARKETING_VERSION = 0.0.2;
                                PRODUCT_BUNDLE_IDENTIFIER = com.ios.playboy;
                                PRODUCT_NAME = "$(TARGET_NAME)";
                                PROVISIONING_PROFILE_SPECIFIER = "";
                                        "@executable_path/Frameworks",
                                );
                                LIBRARY_SEARCH_PATHS = "$(inherited)";
-                               MARKETING_VERSION = 0.02;
+                               MARKETING_VERSION = 0.0.2;
                                PRODUCT_BUNDLE_IDENTIFIER = com.ios.playboy;
                                PRODUCT_NAME = "$(TARGET_NAME)";
                                PROVISIONING_PROFILE_SPECIFIER = "";
index 77bfc08..f3c5663 100644 (file)
@@ -45,7 +45,7 @@ class CCConfig{
     static let findText = "查找耳机".l10n
     static let deviceType = "耳机".l10n
     static let serviceLogo = "logo_2"
-    static let userInfoList:[UserInfoCellType] =  [.avatar,.nickName,.gender,.birthday,.height,.weight,.hobbies,.area]
+    static let userInfoList:[UserInfoCellType] =  [.avatar,.nickName,.gender,.birthday,.height,.weight,.hobbies,.uid,.area]
     static let preferredStatusBarStyle: UIStatusBarStyle = .darkContent
 }
 extension YLColor: ColorRGBProviderProtocol {
index 76e579c..99b4115 100644 (file)
@@ -26,13 +26,16 @@ class JoyAiFunctionVC:BaseVC{
     }
     
     override func setupViews() {
-        navBar.title = device.productName
-        navBar.backgroundColor = .white
+        navBar.do { v in
+            v.title = device.productName
+            v.backgroundColor = .white
+            v.rightView.isHidden = false
+            v.rightView.setImage(UIImage(named: "update_icon_normal"), for: .normal)
+        }
+        
         view.backgroundColor = .white
         view.addSubview(bgView)
         
-        
-        
         bgView.addSubviews([headerView,functionView,bottomView])
         
         headerView.do { v in
@@ -64,6 +67,18 @@ class JoyAiFunctionVC:BaseVC{
             make.bottom.equalToSuperview().inset(10)
         }
     }
+    override func setupData() {
+        BleUpdateVM.shared.hasNewVerVersion(mac: device.mac) {[weak self] newVersion in
+            guard let self = self else {return}
+            let img = newVersion ? "update_icon_tips":"update_icon_normal"
+            navBar.rightView.setImage(UIImage(named: img), for: .normal)
+        }
+    }
+    override func navRightViewTapped() {
+        if CCBleManager.shared.isConected(mac: device.mac){
+            App.shared.goToPage(BleUpdateVC(checked: true))
+        }
+    }
     @objc func deviceChange(_ noti:Notification){
         updateUI()
     }
@@ -71,10 +86,12 @@ class JoyAiFunctionVC:BaseVC{
         if CCBleManager.shared.isConected(mac: device.mac){
             self.headerView.alpha = 1
             self.functionView.alpha = 1
+            self.navBar.rightView.alpha = self.headerView.alpha
         }
         else{
             self.headerView.alpha = 0.5
             self.functionView.alpha = 0.5
+            self.navBar.rightView.alpha = self.headerView.alpha
         }
         functionView.enable = CCBleManager.shared.isConected(mac: device.mac)
     }
@@ -87,7 +104,6 @@ class JoyAiFunctionVC:BaseVC{
         if CCBleManager.shared.isConected(mac: device.mac){
             CCPage.gotoSubTitle()
         }
-        
     }
 }
 
diff --git a/ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/home/update_icon_normal.imageset/Contents.json b/ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/home/update_icon_normal.imageset/Contents.json
new file mode 100644 (file)
index 0000000..5c4d3b1
--- /dev/null
@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "Frame@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "Frame@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}
diff --git a/ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/home/update_icon_normal.imageset/Frame@2x.png b/ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/home/update_icon_normal.imageset/Frame@2x.png
new file mode 100644 (file)
index 0000000..6c6568b
Binary files /dev/null and b/ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/home/update_icon_normal.imageset/Frame@2x.png differ
diff --git a/ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/home/update_icon_normal.imageset/Frame@3x.png b/ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/home/update_icon_normal.imageset/Frame@3x.png
new file mode 100644 (file)
index 0000000..a449d16
Binary files /dev/null and b/ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/home/update_icon_normal.imageset/Frame@3x.png differ
diff --git a/ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/home/update_icon_tips.imageset/Contents.json b/ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/home/update_icon_tips.imageset/Contents.json
new file mode 100644 (file)
index 0000000..5c4d3b1
--- /dev/null
@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "Frame@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "Frame@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}
diff --git a/ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/home/update_icon_tips.imageset/Frame@2x.png b/ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/home/update_icon_tips.imageset/Frame@2x.png
new file mode 100644 (file)
index 0000000..2a57909
Binary files /dev/null and b/ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/home/update_icon_tips.imageset/Frame@2x.png differ
diff --git a/ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/home/update_icon_tips.imageset/Frame@3x.png b/ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/home/update_icon_tips.imageset/Frame@3x.png
new file mode 100644 (file)
index 0000000..ec13064
Binary files /dev/null and b/ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/home/update_icon_tips.imageset/Frame@3x.png differ
index e0321eb..317ac5c 100644 (file)
@@ -25,7 +25,7 @@ class CCConfig{
     /// 服务器地址
     static let baseURL = "https://app-api.playboykq.com"
     /// 服务器地址
-//    static let baseURL = "https://app-api.deepchords.com""
+//    static let baseURL = "https://app-api.deepchords.com"
     /// 用户隐私协议地址
     static let yonghuBaseURL = "https://pub-cdn.playboykq.com"
 
@@ -37,7 +37,7 @@ class CCConfig{
     static let findText = "查找眼镜".l10n
     static let deviceType = "眼镜".l10n
     static let serviceLogo = "logo_4"
-    static let userInfoList:[UserInfoCellType] =  [.avatar,.nickName,.gender,.area]
+    static let userInfoList:[UserInfoCellType] =  [.avatar,.nickName,.gender,.uid,.area]
     static let preferredStatusBarStyle: UIStatusBarStyle = .lightContent
 }
 
index 7dc174f..994e77b 100644 (file)
@@ -25,10 +25,13 @@ class PbAiFunctionVC:BaseVC{
     }
     
     override func setupViews() {
-        navBar.title = device.productName
-        navBar.backgroundColor = .color(.bgColor)
-//        navBar.rightView.isHidden = false
-        navBar.rightView.setTitle("字幕翻译", for: .normal)
+        navBar.do { v in
+            v.title = device.productName
+            v.backgroundColor = .color(.bgColor)
+            v.rightView.isHidden = false
+            v.rightView.setImage(UIImage(named: "update_icon_normal"), for: .normal)
+        }
+        
         view.backgroundColor = .color(.bgColor)
         //        navBar.rightView.setImage(UIImage(named: "add_icon"), for: .normal)
         view.addSubview(bgView)
@@ -59,8 +62,17 @@ class PbAiFunctionVC:BaseVC{
             make.width.equalTo(kScreenWid)
         }
     }
+    override func setupData() {
+        BleUpdateVM.shared.hasNewVerVersion(mac: device.mac) {[weak self] newVersion in
+            guard let self = self else {return}
+            let img = newVersion ? "update_icon_tips":"update_icon_normal"
+            navBar.rightView.setImage(UIImage(named: img), for: .normal)
+        }
+    }
     override func navRightViewTapped() {
-        CCPage.gotoSubTitle()
+        if CCBleManager.shared.isConected(mac: device.mac){
+            App.shared.goToPage(BleUpdateVC(checked: true))
+        }
     }
     func updateUI(){
         if CCBleManager.shared.isConected(mac: device.mac){
diff --git a/ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/home/update_icon_normal.imageset/Contents.json b/ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/home/update_icon_normal.imageset/Contents.json
new file mode 100644 (file)
index 0000000..5c4d3b1
--- /dev/null
@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "Frame@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "Frame@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}
diff --git a/ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/home/update_icon_normal.imageset/Frame@2x.png b/ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/home/update_icon_normal.imageset/Frame@2x.png
new file mode 100644 (file)
index 0000000..cb311db
Binary files /dev/null and b/ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/home/update_icon_normal.imageset/Frame@2x.png differ
diff --git a/ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/home/update_icon_normal.imageset/Frame@3x.png b/ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/home/update_icon_normal.imageset/Frame@3x.png
new file mode 100644 (file)
index 0000000..cb7476f
Binary files /dev/null and b/ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/home/update_icon_normal.imageset/Frame@3x.png differ
diff --git a/ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/home/update_icon_tips.imageset/Contents.json b/ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/home/update_icon_tips.imageset/Contents.json
new file mode 100644 (file)
index 0000000..5c4d3b1
--- /dev/null
@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "Frame@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "Frame@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}
diff --git a/ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/home/update_icon_tips.imageset/Frame@2x.png b/ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/home/update_icon_tips.imageset/Frame@2x.png
new file mode 100644 (file)
index 0000000..4adee8c
Binary files /dev/null and b/ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/home/update_icon_tips.imageset/Frame@2x.png differ
diff --git a/ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/home/update_icon_tips.imageset/Frame@3x.png b/ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/home/update_icon_tips.imageset/Frame@3x.png
new file mode 100644 (file)
index 0000000..f8e1857
Binary files /dev/null and b/ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/home/update_icon_tips.imageset/Frame@3x.png differ
index 035c473..7a6a99e 100644 (file)
@@ -39,7 +39,7 @@ class CCConfig{
     static let findText = "查找耳机".l10n
     static let deviceType = "耳机".l10n
     static let serviceLogo = "logo_2"
-    static let userInfoList:[UserInfoCellType] =  [.avatar,.nickName,.gender,.birthday,.height,.weight,.hobbies,.area]
+    static let userInfoList:[UserInfoCellType] =  [.avatar,.nickName,.gender,.birthday,.height,.weight,.hobbies,.uid,.area]
     static let preferredStatusBarStyle: UIStatusBarStyle = .darkContent
 }
 extension YLColor: ColorRGBProviderProtocol {
diff --git a/ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/home/update_icon_normal.imageset/Contents.json b/ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/home/update_icon_normal.imageset/Contents.json
new file mode 100644 (file)
index 0000000..5c4d3b1
--- /dev/null
@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "Frame@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "Frame@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}
diff --git a/ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/home/update_icon_normal.imageset/Frame@2x.png b/ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/home/update_icon_normal.imageset/Frame@2x.png
new file mode 100644 (file)
index 0000000..6c6568b
Binary files /dev/null and b/ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/home/update_icon_normal.imageset/Frame@2x.png differ
diff --git a/ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/home/update_icon_normal.imageset/Frame@3x.png b/ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/home/update_icon_normal.imageset/Frame@3x.png
new file mode 100644 (file)
index 0000000..a449d16
Binary files /dev/null and b/ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/home/update_icon_normal.imageset/Frame@3x.png differ
diff --git a/ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/home/update_icon_tips.imageset/Contents.json b/ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/home/update_icon_tips.imageset/Contents.json
new file mode 100644 (file)
index 0000000..5c4d3b1
--- /dev/null
@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "Frame@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "Frame@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}
diff --git a/ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/home/update_icon_tips.imageset/Frame@2x.png b/ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/home/update_icon_tips.imageset/Frame@2x.png
new file mode 100644 (file)
index 0000000..2a57909
Binary files /dev/null and b/ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/home/update_icon_tips.imageset/Frame@2x.png differ
diff --git a/ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/home/update_icon_tips.imageset/Frame@3x.png b/ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/home/update_icon_tips.imageset/Frame@3x.png
new file mode 100644 (file)
index 0000000..ec13064
Binary files /dev/null and b/ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/home/update_icon_tips.imageset/Frame@3x.png differ
index 66e1081..967a620 100644 (file)
@@ -35,7 +35,12 @@ class AboutVC: BaseVC{
             make.top.equalTo(kNavBtm)
         }
     }
-
+    override func setupData() {
+        AppUpdateVM.shared.checkedUpdate {[weak self] model in
+            guard let self = self else {return}
+            tableView.reloadData()
+        }
+    }
 }
 
 extension AboutVC:UITableViewDelegate,UITableViewDataSource {
@@ -92,7 +97,7 @@ extension AboutVC:UITableViewDelegate,UITableViewDataSource {
             App.shared.goToPage(FileDownloadVC(type: .xitongquanxianqingdan))
         }
         else if data == .update{
-            AppUpdateVM.shared.checkedUpdate()
+            AppUpdateVM.shared.manualCheckedUpdate()
         }
         else if data == .revoke{
             App.shared.goToPage(RevokeVC())
index 8e73916..1b03b2b 100644 (file)
@@ -88,7 +88,7 @@ extension MineVC:UITableViewDelegate,UITableViewDataSource {
         case .instructions:
             App.shared.goToPage(InstructionsVC())
         case .update:
-            App.shared.goToPage(UpdateVC())
+            App.shared.goToPage(BleUpdateVC(checked: false))
         case .language:
             App.shared.goToPage(LanguageVC())
         case .more:
index a88eff1..4a6a47f 100644 (file)
@@ -22,6 +22,9 @@ class AppUpdateModel:HandyJSON {
     var newVersioon:Bool{
         return targetVersion.uppercased() > sourceVersion.uppercased()
     }
+    var optionUpdate:Bool{
+        return updateType == "0"
+    }
 }
 class AppUpdateFileModel:HandyJSON {
     var url = ""
index 62b1869..c89f1b4 100644 (file)
@@ -8,64 +8,58 @@
 class AppUpdateVM:BaseVM{
     static let shared = AppUpdateVM()
     var updateModel:AppUpdateModel?
-    
-    func checkedUpdate(){
+        
+    func checkedUpdate(finished:@escaping (_ model:AppUpdateModel?)->Void){
         var params:[String:Any] = [:]
         params["sourceVersion"] = Bundle.main.appVersion ?? "1.0.0"
         params["platform"] = "iOS"
-        YLprogressHUD.showLoading()
         HttpClient.request(.otaTaskApp(param: params)) {[weak self](model:AppUpdateModelRoot,res) in
             YLprogressHUD.hidden()
             guard let self = self else {return}
             if model.isSuccess{
-                self.updateModel = model.data
-                if model.data.newVersioon{
-                    if model.data.updateType == "0"{
-                        //可选升级
-                        optionUpdate(model: model.data)
-                    }
-                    else{
-                        //强制升级
-                        forceUpdate(model: model.data)
-                    }
-                }
-                else{
-                    YLprogressHUD.showAutoHiden("已经是最新版本".l10n)
-                }
+                updateModel = model.data
+                finished(updateModel)
             }
             else{
-                YLprogressHUD.showAutoHiden("请求失败".l10n)
+                finished(nil)
             }
         }
     }
-    func autoCheckedUpdate(){
-        var params:[String:Any] = [:]
-        params["sourceVersion"] = Bundle.main.appVersion ?? "1.0.0"
-        params["platform"] = "iOS"
+    func manualCheckedUpdate(){
         YLprogressHUD.showLoading()
-        HttpClient.request(.otaTaskApp(param: params)) {[weak self](model:AppUpdateModelRoot,res) in
+        checkedUpdate {[weak self] model in
             YLprogressHUD.hidden()
-            guard let self = self else {return}
-            if model.isSuccess{
-                self.updateModel = model.data
-                if model.data.newVersioon{
-                    if model.data.updateType == "0"{
-                        autoOptionUpdate(model: model.data)
-                    }
-                    else{
-                        forceUpdate(model: model.data)
-                    }
+            guard let self = self else{return}
+            guard let model = model else{
+                YLprogressHUD.showAutoHiden("请求失败".l10n)
+                return
+            }
+            if model.newVersioon{
+                if model.optionUpdate{
+                    optionUpdate(model: model)
                 }
                 else{
-                    YLprogressHUD.showAutoHiden("已经是最新版本".l10n)
+                    forceUpdate(model: model)
                 }
             }
             else{
-                YLprogressHUD.showAutoHiden("请求失败".l10n)
+                YLprogressHUD.showAutoHiden("已经是最新版本".l10n)
+            }
+        }
+    }
+    func autoCheckedUpdate(){
+        checkedUpdate {[weak self] model in
+            guard let self = self,let model = model else{return}
+            if model.newVersioon{
+                if model.optionUpdate{
+                    autoOptionUpdate(model: model)
+                }
+                else{
+                    forceUpdate(model: model)
+                }
             }
         }
     }
-    
     
     private func autoOptionUpdate(model:AppUpdateModel){
         if !UpdateCache.isSkip(version: model.targetVersion) {
@@ -7,14 +7,17 @@
 
 import UIKit
 
-class UpdateVC:BaseVC{
+class BleUpdateVC:BaseVC{
     let icon = UIImageView(image: UIImage(named: "update_icon"))
     let versionLabel = UILabel()
     let btn = UIButton(type: .custom)
+    let autoChecked:Bool
+    init(checked:Bool) {
+        self.autoChecked = checked
+        super.init()
+    }
     override func viewDidLoad() {
         super.viewDidLoad()
-        
-        
     }
     override func setupViews() {
         view.addSubviews([icon,versionLabel,btn])
@@ -57,20 +60,39 @@ class UpdateVC:BaseVC{
         }
     }
     override func setupData() {
-        CCDevice.getVersion {[weak self] version in
-            guard let self = self else{return}
-            let version = version ?? " --"
-            let allText = "当前版本".l10n + "\nV\(version)"
-            let attributedString = NSMutableAttributedString(string: allText)
-            let paragraphStyle = NSMutableParagraphStyle()
-            paragraphStyle.lineSpacing = 7
-            attributedString.addAttribute(.paragraphStyle, value: paragraphStyle, range: NSRange(location: 0, length: attributedString.length))
-//            attributedString.addAttribute(.font, value: UIFont.bold(16), range: NSRange(location: 0, length: attributedString.length))
-//            attributedString.addAttribute(.font, value: UIFont.bold(14), range: NSRange(location: 4, length: version.count + 2))
-            versionLabel.attributedText = attributedString
-            versionLabel.textAlignment = .center
+        if autoChecked {
+            CCDevice.getVersion {[weak self] version in
+                guard let self = self else{return}
+                let version = version ?? " --"
+                let allText = "当前版本".l10n + "\nV\(version)"
+                let attributedString = NSMutableAttributedString(string: allText)
+                let paragraphStyle = NSMutableParagraphStyle()
+                paragraphStyle.lineSpacing = 7
+                attributedString.addAttribute(.paragraphStyle, value: paragraphStyle, range: NSRange(location: 0, length: attributedString.length))
+                //            attributedString.addAttribute(.font, value: UIFont.bold(16), range: NSRange(location: 0, length: attributedString.length))
+                //            attributedString.addAttribute(.font, value: UIFont.bold(14), range: NSRange(location: 4, length: version.count + 2))
+                versionLabel.attributedText = attributedString
+                versionLabel.textAlignment = .center
+                tapAction()
+            }
+        }
+        else{
+            CCDevice.getVersion {[weak self] version in
+                guard let self = self else{return}
+                let version = version ?? " --"
+                let allText = "当前版本".l10n + "\nV\(version)"
+                let attributedString = NSMutableAttributedString(string: allText)
+                let paragraphStyle = NSMutableParagraphStyle()
+                paragraphStyle.lineSpacing = 7
+                attributedString.addAttribute(.paragraphStyle, value: paragraphStyle, range: NSRange(location: 0, length: attributedString.length))
+                //            attributedString.addAttribute(.font, value: UIFont.bold(16), range: NSRange(location: 0, length: attributedString.length))
+                //            attributedString.addAttribute(.font, value: UIFont.bold(14), range: NSRange(location: 4, length: version.count + 2))
+                versionLabel.attributedText = attributedString
+                versionLabel.textAlignment = .center
+            }
         }
     }
+    
     @objc func tapAction(){
         if !CCBleManager.shared.isConneted{
             YLprogressHUD.showAutoHiden("请先连接设备".l10n)
index 3492798..3ee8f22 100644 (file)
@@ -7,6 +7,38 @@
 
 class BleUpdateVM:BaseVM{
     static let shared = BleUpdateVM()
+    
+    func hasNewVerVersion(mac:String,finished:@escaping ((Bool) -> Void)){
+        if !CCBleManager.shared.isConected(mac: mac){
+            finished(false)
+            return
+        }
+        
+        CCDevice.getDN { dn in
+            guard let deviceName = dn else{
+                return
+            }
+            CCDevice.getVersion { version in
+                guard let version = version else{
+                    return
+                }
+
+                var params:[String:Any] = [:]
+                params["sourceVersion"] = version
+                params["deviceId"] = deviceName
+                HttpClient.request(.otaTask(param: params)) {(model:AppUpdateModelRoot,res) in
+                    if model.isSuccess,model.data.newVersioon{
+                        finished(true)
+                    }
+                    else{
+                        finished(false)
+                    }
+                }
+            }
+        }
+    }
+
+    
     func checkedUpdate(){
         CCDevice.getDN {[weak self] dn in
             guard let self = self else{return}
@@ -22,7 +54,7 @@ class BleUpdateVM:BaseVM{
             }
         }
     }
-    func startCheck(deviceName:String,version:String){
+    private func startCheck(deviceName:String,version:String){
         var params:[String:Any] = [:]
         params["sourceVersion"] = version
         params["deviceId"] = deviceName
@@ -50,7 +82,7 @@ class BleUpdateVM:BaseVM{
             }
         }
     }
-    func optionUpdate(_ url:String){
+    private func optionUpdate(_ url:String){
         CustomAlert.showWith(title: nil, messgage: "检测到新版本,是否开始更新?".l10n) {
             
         } okCallback: {
@@ -58,13 +90,13 @@ class BleUpdateVM:BaseVM{
         }
         
     }
-    func forceUpdate(_ url:String){
+    private func forceUpdate(_ url:String){
         CustomAlert.showWith(title: nil, messgage: "检测到新版本".l10n, ok: "开始更新".l10n,cancelCallback: nil) {
             self.startUpdate(url: url)
         }
     }
     
-    func startUpdate(url:String){
+   private func startUpdate(url:String){
         YLprogressHUD.showLoading()
         HttpClient.download(url: url,type: "ufw"){ path in
             if let path = path{
index 7bd880d..a61009f 100644 (file)
@@ -13,6 +13,7 @@ public enum UserInfoCellType: Int {
     case height
     case weight
     case hobbies
+    case uid
     case area
 
     var title:String{
@@ -31,6 +32,8 @@ public enum UserInfoCellType: Int {
             return "体重".l10n
         case .hobbies:
             return "运动偏好".l10n
+        case .uid:
+            return "ID".l10n
         case .area:
             return "国家与地区".l10n
         }
@@ -80,6 +83,9 @@ class UserInfoCell: BaseTableViewCell {
             else if type == .hobbies {
                 valueLabel.text = info.preference
             }
+            else if type == .uid {
+                valueLabel.text = info.userId
+            }
             else if type == .avatar{
                 valueIcon.kf.setImage(with:CacheManager.shared.user.info.avatar.yc.asUrl )
             }
index fdb1692..0b069d5 100644 (file)
@@ -71,19 +71,16 @@ class UserInfoVC: BaseVC{
                 genderAction()
             case .area:
                 areaAction()
-                break
             case .birthday:
                 birthdayAction()
-                break
             case .height:
                 heightAction()
-                break
             case .weight:
                 weightAction()
+            case .uid:
                 break
             case .hobbies:
                 hobiesAction()
-                break
             }
         }
     }