From b02746defe0efdb7a665a0920d324b0870614f86 Mon Sep 17 00:00:00 2001 From: liangzhenying <867174124@qq.com> Date: Tue, 31 Mar 2026 11:06:10 +0800 Subject: [PATCH] =?utf8?q?=E5=8A=A0=E4=BA=86=E5=AE=89=E5=8D=93=E8=AE=BE?= =?utf8?q?=E5=A4=87=E7=99=BB=E5=BD=95=E5=88=87=E6=8D=A2=E5=90=8E=E8=A7=A3?= =?utf8?q?=E7=BB=91=E6=89=80=E6=9C=89=E8=AE=BE=E5=A4=87=E3=80=82=E5=9B=A0?= =?utf8?q?=E4=B8=BA=E5=AE=89=E5=8D=93=E8=AE=BE=E5=A4=87=E7=BB=91=E5=AE=9A?= =?utf8?q?=E7=9A=84=E8=BF=94=E5=9B=9E=E7=9A=84mac=E5=9C=B0=E5=9D=80?= =?utf8?q?=E4=B8=8D=E4=B8=80=E8=87=B4=EF=BC=8C=E6=B2=A1=E6=B3=95=E6=89=AB?= =?utf8?q?=E6=8F=8F=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- ShenYin/ShenYin/Cache/Model/UserModel.swift | 2 +- .../DeepChords/Channel/Config/CCConfig.swift | 4 - .../mine/copy_icon_2.imageset/Contents.json | 22 ++++ .../copy_icon_2.imageset/Frame_1938@2x.png | Bin 0 -> 527 bytes .../copy_icon_2.imageset/Frame_1938@3x.png | Bin 0 -> 834 bytes .../mine/copy_icon_2.imageset/Contents.json | 22 ++++ .../copy_icon_2.imageset/Frame_1938@2x.png | Bin 0 -> 527 bytes .../copy_icon_2.imageset/Frame_1938@3x.png | Bin 0 -> 834 bytes .../mine/copy_icon_2.imageset/Contents.json | 22 ++++ .../copy_icon_2.imageset/Frame_1938@2x.png | Bin 0 -> 527 bytes .../copy_icon_2.imageset/Frame_1938@3x.png | Bin 0 -> 834 bytes .../UI/Login/Controller/DcLoginVC.swift | 2 +- .../ShenYin/UI/Login/Controller/LoginVC.swift | 2 +- .../UI/Login/Controller/SmsLoginVC.swift | 4 +- .../UI/Login/View/OthersLoginView.swift | 2 +- .../ShenYin/UI/Login/ViewModel/LoginVM.swift | 99 ++++++++++++++---- .../UI/Mine/UserInfo/UserInfoCell.swift | 12 ++- .../ShenYin/UI/Mine/UserInfo/UserInfoVC.swift | 5 + .../UI/common/NotificationManager.swift | 6 +- 19 files changed, 170 insertions(+), 34 deletions(-) create mode 100644 ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/mine/copy_icon_2.imageset/Contents.json create mode 100644 ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/mine/copy_icon_2.imageset/Frame_1938@2x.png create mode 100644 ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/mine/copy_icon_2.imageset/Frame_1938@3x.png create mode 100644 ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/mine/copy_icon_2.imageset/Contents.json create mode 100644 ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/mine/copy_icon_2.imageset/Frame_1938@2x.png create mode 100644 ShenYin/ShenYin/Channel/PLAYBOY/PLAYBOY.xcassets/mine/copy_icon_2.imageset/Frame_1938@3x.png create mode 100644 ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/mine/copy_icon_2.imageset/Contents.json create mode 100644 ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/mine/copy_icon_2.imageset/Frame_1938@2x.png create mode 100644 ShenYin/ShenYin/Channel/PaXa/PaXa.xcassets/mine/copy_icon_2.imageset/Frame_1938@3x.png diff --git a/ShenYin/ShenYin/Cache/Model/UserModel.swift b/ShenYin/ShenYin/Cache/Model/UserModel.swift index aea6f40..75373dc 100644 --- a/ShenYin/ShenYin/Cache/Model/UserModel.swift +++ b/ShenYin/ShenYin/Cache/Model/UserModel.swift @@ -30,7 +30,7 @@ class UserModel { extension UserModel{ func login(token:String){ self.token = token - NotificationManager.post(type: .login, objtect: nil) +// NotificationManager.post(type: .login, objtect: nil) } func logout(){ diff --git a/ShenYin/ShenYin/Channel/DeepChords/Channel/Config/CCConfig.swift b/ShenYin/ShenYin/Channel/DeepChords/Channel/Config/CCConfig.swift index f3c5663..b4d946b 100644 --- a/ShenYin/ShenYin/Channel/DeepChords/Channel/Config/CCConfig.swift +++ b/ShenYin/ShenYin/Channel/DeepChords/Channel/Config/CCConfig.swift @@ -33,14 +33,10 @@ class CCConfig{ /// 用户隐私协议地址 static let yonghuBaseURL = "https://pub-tos.deepchords.com" - - - - static let revokeText = "请您确保您是有权进行本撤回同意隐私政策操作的相关当事人。撤回同意隐私政策,您将放弃以下资产或者权益:\n\n1.数据清空\n将会停止收集您的个人信息。您使用DeepChords应用过程中产生的数据将被清空;手机中DeepChords应用的缓存数据将被清除。\n\n2.设备解除绑定\nDeepChords账号中,所有设备会与您当前登录的账号解除绑定,并清除设备之前存储在服务器的数据。存储在物理设备中的数据请通过人工本地物理重置来清除。如果您需要重新使用设备,需要您再次进行绑定并且重新授权。\n\n3.其他\n此举还将撤回您对用户协议的同意,并退出DeepChords应用。\n\n请您知悉,撤回同意隐私政策不代表撤回同意前的相关行为和责任得到豁免或减轻。若您需要重新在该账号管理设备,需要您重新授权并绑定。请谨慎操作!" static let findText = "查找耳机".l10n static let deviceType = "耳机".l10n diff --git a/ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/mine/copy_icon_2.imageset/Contents.json b/ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/mine/copy_icon_2.imageset/Contents.json new file mode 100644 index 0000000..df5635c --- /dev/null +++ b/ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/mine/copy_icon_2.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Frame_1938@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Frame_1938@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/mine/copy_icon_2.imageset/Frame_1938@2x.png b/ShenYin/ShenYin/Channel/DeepChords/DeepChords.xcassets/mine/copy_icon_2.imageset/Frame_1938@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..7b42117fe910d4999eab499617207d41ab1159e8 GIT binary patch literal 527 zcmV+q0`UEbP)ALO<{fh_QBnNQ`PH^qDDFW%L6I}ggRaN&MxC6%r zDMBwesqSNnK*jN^iaC29fphB8+^j%K781IbR=qPxmRPq+u}xaHcy~%xpiEY-d53tboVp6|JEEq27ex0wH3lfXC=1YWnf}PQ3}o5U6!X z=QeHIKI+L{5nLetBBTm+U0`pFFr631X#IdWDYC5sXUP||er zFm|qO(&{Xb+Yox5buhFL?z||FbH;Z5W~ks$}YDSB1+rnmhg%7R`sAt+1qhiF)okmyxm(LbUmz4>uf^tK*CG)OZ0 z-m(qN3^U#7=~O{^P-5@Co)GG_6tTpE!?*Ya6Dw3=?#{ULOGXS(>J|V7t&dh5m{2e6?B~ z5Z?yO8)1On2hlx%cA#e|#M=Y@JsVJOgyT4V06>DnL@Rv#fPSk8S+=j(Vp{xhyY zCzHuhuh;tmq`y!lI=-6AS)YV;=V`awP4$VUjO!xY6n@z_qChyeC8ratb7&$8n~KwA z%G_8i7Drg`+IToM6$-q}T4k7I@vqqUrlO3f`pt?kin@rVLXj%7R)nQA6=g)#Z&rk* zG!=?enYAJe2YOL&Y*T?ajbck!chuOXLJzWN>_WK6mx%d5SVWpC1Q{}1Ve>?s8Zs;* zO%;L+8LqH-0#1#>0{{_OsuHBwdw98A#xBIg5FU+27e|_c>`iC_RkBorGAo8Ko{@dj z6;EN_f!JlJ5fv}HVtm?zHsj$Jd%`pEUl)q#? zpYQPXi{1$M90SOysla(gu_BB&4|-9*(rUHdqws&w8v&nV_;zY4jBK&MiZI?hyvADA zJD7;Y{wfC9M!@H>Q&WMMjABI?b?yzadALO<{fh_QBnNQ`PH^qDDFW%L6I}ggRaN&MxC6%r zDMBwesqS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^U#7=~O{^P-5@Co)GG_6tTpE!?*Ya6Dw3=?#{ULOGXS(>J|V7t&dh5m{2e6?B~ z5Z?yO8)1On2hlx%cA#e|#M=Y@JsVJOgyT4V06>DnL@Rv#fPSk8S+=j(Vp{xhyY zCzHuhuh;tmq`y!lI=-6AS)YV;=V`awP4$VUjO!xY6n@z_qChyeC8ratb7&$8n~KwA z%G_8i7Drg`+IToM6$-q}T4k7I@vqqUrlO3f`pt?kin@rVLXj%7R)nQA6=g)#Z&rk* zG!=?enYAJe2YOL&Y*T?ajbck!chuOXLJzWN>_WK6mx%d5SVWpC1Q{}1Ve>?s8Zs;* zO%;L+8LqH-0#1#>0{{_OsuHBwdw98A#xBIg5FU+27e|_c>`iC_RkBorGAo8Ko{@dj z6;EN_f!JlJ5fv}HVtm?zHsj$Jd%`pEUl)q#? zpYQPXi{1$M90SOysla(gu_BB&4|-9*(rUHdqws&w8v&nV_;zY4jBK&MiZI?hyvADA zJD7;Y{wfC9M!@H>Q&WMMjABI?b?yzadVoid) { let api = CommomApi.login(param: param) HttpClient.request(api) { (model:LoginModel,res) in - if model.isSuccess{ - CacheManager.shared.user.login(token: model.data) - } - completion(model) + loginFinish(model: model, completion: completion) } } static public func phoneCodeLogin(param:[String:Any], completion:@escaping (_ result:LoginModel) ->Void) { let api = CommomApi.phoneCodeLogin(param: param) HttpClient.request(api) { (model:LoginModel,res) in - if model.isSuccess{ - CacheManager.shared.user.login(token: model.data) - } - completion(model) + loginFinish(model: model, completion: completion) } } static public func emailCodeLogin(param:[String:Any], completion:@escaping (_ result:LoginModel) ->Void) { let api = CommomApi.emailCodeLogin(param: param) HttpClient.request(api) { (model:LoginModel,res) in - if model.isSuccess{ - CacheManager.shared.user.login(token: model.data) - } - completion(model) + loginFinish(model: model, completion: completion) } } static public func appleLogin(param:[String:Any], completion:@escaping (_ result:LoginModel) ->Void) { let api = CommomApi.appleLogin(param: param) HttpClient.request(api) { (model:LoginModel,res) in - if model.isSuccess{ - CacheManager.shared.user.login(token: model.data) - } - completion(model) + loginFinish(model: model, completion: completion) } } static public func wechatLogin(param:[String:Any], completion:@escaping (_ result:LoginModel) ->Void) { let api = CommomApi.wechatLogin(param: param) HttpClient.request(api) { (model:LoginModel,res) in - if model.isSuccess{ - CacheManager.shared.user.login(token: model.data) - } - completion(model) + loginFinish(model: model, completion: completion) } } @@ -98,4 +84,77 @@ class LoginVM:BaseVM{ completion(model) } } + static func loginFinish(model:LoginModel,completion:@escaping (_ result:LoginModel) ->Void){ + if !model.isSuccess{ + completion(model) + return + } + CacheManager.shared.user.login(token: model.data) + checkedUnbind { success in +// if success{ +// model.isSuccess +// } + completion(model) + } + + + } +} + +extension LoginVM{ + static func checkedUnbind(finished:@escaping ((Bool) -> Void)){ + deviceLoginVM = DeviceLoginVM() + deviceLoginVM?.refresh { result in + if result.isSuccess, result.data.list.count > 1{ + let name = result.data.list[1].deviceName.lowercased() + if name.contains("iphone") || + name.contains("ios") || + name.contains("ipad") || + name.contains("homepod") || + name.contains("simulator") + { + finished(true) + } + else{ + needUnBind(finished: finished) + } + } + else{ + finished(false) + } + } + } + + static func needUnBind(finished:@escaping ((Bool) -> Void)){ + DeviceVM.shared.refresh { result in + DeviceVM.shared.dataList.removeAll() + startUnBindList(result.data,finished: finished) + } + } + + + static func startUnBindList(_ list:[HomeDeviceModel],finished:@escaping ((Bool) -> Void)){ + var isSuccess = true + let dispatchGroup = DispatchGroup() + for item in list { + dispatchGroup.enter() + startUnbind(item.deviceId) { success in + if !success { + isSuccess = false + } + dispatchGroup.leave() + } + } + + dispatchGroup.notify(queue:.main) { + finished(isSuccess) + } + } + + static func startUnbind(_ deviceId:String,finished:@escaping ((Bool) -> Void)){ + let api = CommomApi.unbind(deviceId: deviceId) + HttpClient.request(api) {(model:HomeDeviceModelRoot,res) in + finished(model.isSuccess) + } + } } diff --git a/ShenYin/ShenYin/UI/Mine/UserInfo/UserInfoCell.swift b/ShenYin/ShenYin/UI/Mine/UserInfo/UserInfoCell.swift index a61009f..06bd35f 100644 --- a/ShenYin/ShenYin/UI/Mine/UserInfo/UserInfoCell.swift +++ b/ShenYin/ShenYin/UI/Mine/UserInfo/UserInfoCell.swift @@ -46,12 +46,15 @@ class UserInfoCell: BaseTableViewCell { let titleLabel = UILabel() let nextIcon = UIImageView() let valueIcon = UIImageView() + let copyIcon = UIImageView() let valueLabel = UILabel() var type:UserInfoCellType = .area{ didSet{ titleLabel.text = type.title valueIcon.isHidden = type != .avatar + copyIcon.isHidden = type != .uid + nextIcon.isHidden = !copyIcon.isHidden if type == .avatar { valueLabel.isHidden = true @@ -85,6 +88,7 @@ class UserInfoCell: BaseTableViewCell { } else if type == .uid { valueLabel.text = info.userId + } else if type == .avatar{ valueIcon.kf.setImage(with:CacheManager.shared.user.info.avatar.yc.asUrl ) @@ -102,7 +106,7 @@ class UserInfoCell: BaseTableViewCell { } override func setupViews() { contentView.addSubview(bgView) - bgView.addSubviews([titleLabel,nextIcon,valueIcon,valueLabel]) + bgView.addSubviews([titleLabel,nextIcon,valueIcon,valueLabel,copyIcon]) backgroundColor = .color(.bgColor) contentView.backgroundColor = .clear @@ -127,6 +131,7 @@ class UserInfoCell: BaseTableViewCell { v.isHidden = true } nextIcon.image = UIImage(named: "arrow_next") + copyIcon.image = UIImage(named: "copy_icon_2") } override func setupLayout() { @@ -157,5 +162,10 @@ class UserInfoCell: BaseTableViewCell { m.height.equalToSuperview() m.left.equalToSuperview().inset(90) } + copyIcon.snp.makeConstraints { (m) in + m.size.equalTo(20) + m.right.equalToSuperview().inset(15) + m.centerY.equalToSuperview() + } } } diff --git a/ShenYin/ShenYin/UI/Mine/UserInfo/UserInfoVC.swift b/ShenYin/ShenYin/UI/Mine/UserInfo/UserInfoVC.swift index 0b069d5..f1d2d4c 100644 --- a/ShenYin/ShenYin/UI/Mine/UserInfo/UserInfoVC.swift +++ b/ShenYin/ShenYin/UI/Mine/UserInfo/UserInfoVC.swift @@ -78,6 +78,7 @@ class UserInfoVC: BaseVC{ case .weight: weightAction() case .uid: + uidAction() break case .hobbies: hobiesAction() @@ -163,6 +164,10 @@ extension UserInfoVC{ } App.shared.goToPage(vc) } + func uidAction(){ + UIPasteboard.general.string = CacheManager.shared.user.info.userId + YLprogressHUD.showAutoHiden("已复制".l10n) + } func areaAction(){ let vc = ContryListVC() vc.currentType = CountryModel() diff --git a/ShenYin/ShenYin/UI/common/NotificationManager.swift b/ShenYin/ShenYin/UI/common/NotificationManager.swift index 7596e8d..24967c7 100644 --- a/ShenYin/ShenYin/UI/common/NotificationManager.swift +++ b/ShenYin/ShenYin/UI/common/NotificationManager.swift @@ -9,7 +9,7 @@ import Foundation enum NotificationType:String{ case deviceValidChange - case login +// case login case logout case updateLocation @@ -17,8 +17,8 @@ enum NotificationType:String{ switch self { case .deviceValidChange: return "deviceValidChange" - case .login: - return "login" +// case .login: +// return "login" case .logout: return "logout" case .updateLocation: -- 2.17.1