"@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 = "";
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 {
}
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
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()
}
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)
}
if CCBleManager.shared.isConected(mac: device.mac){
CCPage.gotoSubTitle()
}
-
}
}
--- /dev/null
+{
+ "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
+ }
+}
--- /dev/null
+{
+ "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
+ }
+}
/// 服务器地址
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"
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
}
}
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)
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){
--- /dev/null
+{
+ "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
+ }
+}
--- /dev/null
+{
+ "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
+ }
+}
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 {
--- /dev/null
+{
+ "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
+ }
+}
--- /dev/null
+{
+ "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
+ }
+}
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 {
App.shared.goToPage(FileDownloadVC(type: .xitongquanxianqingdan))
}
else if data == .update{
- AppUpdateVM.shared.checkedUpdate()
+ AppUpdateVM.shared.manualCheckedUpdate()
}
else if data == .revoke{
App.shared.goToPage(RevokeVC())
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:
var newVersioon:Bool{
return targetVersion.uppercased() > sourceVersion.uppercased()
}
+ var optionUpdate:Bool{
+ return updateType == "0"
+ }
}
class AppUpdateFileModel:HandyJSON {
var url = ""
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) {
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])
}
}
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)
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}
}
}
}
- func startCheck(deviceName:String,version:String){
+ private func startCheck(deviceName:String,version:String){
var params:[String:Any] = [:]
params["sourceVersion"] = version
params["deviceId"] = deviceName
}
}
}
- func optionUpdate(_ url:String){
+ private func optionUpdate(_ url:String){
CustomAlert.showWith(title: nil, messgage: "检测到新版本,是否开始更新?".l10n) {
} okCallback: {
}
}
- 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{
case height
case weight
case hobbies
+ case uid
case area
var title:String{
return "体重".l10n
case .hobbies:
return "运动偏好".l10n
+ case .uid:
+ return "ID".l10n
case .area:
return "国家与地区".l10n
}
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 )
}
genderAction()
case .area:
areaAction()
- break
case .birthday:
birthdayAction()
- break
case .height:
heightAction()
- break
case .weight:
weightAction()
+ case .uid:
break
case .hobbies:
hobiesAction()
- break
}
}
}