From: liangzhenying <867174124@qq.com> Date: Wed, 29 Oct 2025 09:08:46 +0000 (+0800) Subject: 修改toast提示语 X-Git-Tag: 1.0.2~82 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=255a07e5a60476da4ca499c2c8153633adf3df76;p=mirrors%2FShenYin.git 修改toast提示语 --- diff --git a/ShenYin/Podfile.lock b/ShenYin/Podfile.lock index 31d8015..10bc72b 100644 --- a/ShenYin/Podfile.lock +++ b/ShenYin/Podfile.lock @@ -69,6 +69,7 @@ PODS: - TZImagePickerController/Location (= 3.8.9) - TZImagePickerController/Basic (3.8.9) - TZImagePickerController/Location (3.8.9) + - WechatOpenSDK-XCFramework (2.0.5) - YYModel (1.0.4) - YYText (1.0.7) - ZipArchive (1.4.0) @@ -95,6 +96,7 @@ DEPENDENCIES: - swiftScan - TabPageViewController - TZImagePickerController + - WechatOpenSDK-XCFramework - YYModel - YYText - ZipArchive @@ -130,6 +132,7 @@ SPEC REPOS: - swiftScan - TabPageViewController - TZImagePickerController + - WechatOpenSDK-XCFramework - YYModel - YYText - ZipArchive @@ -164,10 +167,11 @@ SPEC CHECKSUMS: swiftScan: 0849e7d7c1c641384767a573ee8cb90b88d1ddd9 TabPageViewController: 8bd4104909754416b35a98f3b72a5b674ab20dd5 TZImagePickerController: 456f470b5dea97b37226ec7a694994a8663340b2 + WechatOpenSDK-XCFramework: b072030c9eeee91dfff1856a7846f70f7b9a88ed YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30 YYText: 5c461d709e24d55a182d1441c41dc639a18a4849 ZipArchive: e25a4373192673e3229ac8d6e9f64a3e5713c966 -PODFILE CHECKSUM: 2a2c83c3c610795228576bbe8899f7939f0e6d43 +PODFILE CHECKSUM: 06f9ef8c019046f938158cfb86472b866db8d248 COCOAPODS: 1.16.2 diff --git a/ShenYin/ShenYin.xcodeproj/project.pbxproj b/ShenYin/ShenYin.xcodeproj/project.pbxproj index 1a0c3e3..749bf6b 100644 --- a/ShenYin/ShenYin.xcodeproj/project.pbxproj +++ b/ShenYin/ShenYin.xcodeproj/project.pbxproj @@ -242,6 +242,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = ShenYin/ShenYin.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = G23X75CJ67; @@ -269,6 +270,7 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.deepchords.app; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = YES; @@ -285,6 +287,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = ShenYin/ShenYin.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = G23X75CJ67; @@ -312,6 +315,7 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.deepchords.app; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = YES; diff --git a/ShenYin/ShenYin/Api/Config.swift b/ShenYin/ShenYin/Api/Config.swift index 02e7245..97a30a8 100644 --- a/ShenYin/ShenYin/Api/Config.swift +++ b/ShenYin/ShenYin/Api/Config.swift @@ -10,3 +10,22 @@ class Config{ static var appLanguage = AppSupportLanguage.chinse } +class DCGlobal { + + /// 高德地图 app key + static let mapKey = "01d0c91a330f94bd5819d617a91d37a0" + + /// 腾讯地图 app key + static let qqmapKey = "FC6BZ-QCJWB-SOTUF-JLGK6-DTFIK-WCBIF" + /// 腾讯地图 Secret Key + static let qqmapSecretKey = "ODo3ZcRrsbzB71UTPBbRHeivpxnhSg9X" + + /// 微信开发平台 App ID + static let wxAppID = "wxf19317f23b00d8ab" + static let wxUniversalLink = "https://www.thisiot.com/flychat" + static let wxSecret = "SECRET" + + static let appStoreLink = "https://itunes.apple.com/cn/app/1542713301?mt=8" + /// 版本检测 + static let appStoreVersionURL = "https://itunes.apple.com/cn/lookup?id=1542713301" +} diff --git a/ShenYin/ShenYin/Api/HttpClient2.swift b/ShenYin/ShenYin/Api/HttpClient2.swift index e8d47d1..2d0d479 100644 --- a/ShenYin/ShenYin/Api/HttpClient2.swift +++ b/ShenYin/ShenYin/Api/HttpClient2.swift @@ -32,6 +32,10 @@ enum CommomApi case phoneCodeLogin(param:[String:Any]) /// 邮箱验证码登录 case emailCodeLogin(param:[String:Any]) + /// 苹果登录 + case appleLogin(param:[String:Any]) + /// 微信登录 + case wechatLogin(param:[String:Any]) /// 登录 case login(param:[String:Any]) /// 注销 @@ -142,6 +146,10 @@ extension CommomApi{ return "/uc/phone/sms-login" case .emailCodeLogin(_): return "/uc/email/login" + case .appleLogin(_): + return "/uc/apple-login" + case .wechatLogin(_): + return "/uc/wechat_login" case .login(_): return "/uc/sign-in" case .deactivate: @@ -243,7 +251,7 @@ extension CommomApi{ var method:RequestMethod{ switch self { - case .register(_),.phoneCodeLogin(_),.emailCodeLogin(_),.login(_),.commitFeedback(_),.voiceRecord(_): + case .register(_),.phoneCodeLogin(_),.emailCodeLogin(_),.appleLogin(_),.login(_),.commitFeedback(_),.voiceRecord(_): return .post case .updatePwd(_),.updateUserInfo(_),.updatePhone(_),.updateEmail(_),.bindDevice(_),.otaUpdateVersion(_),.voiceRecordCollection(_),.updateVoiceRecord(_): return .put @@ -279,6 +287,12 @@ extension CommomApi{ case let .emailCodeLogin(para): params += para break + case let .appleLogin(para): + params += para + break + case let .wechatLogin(para): + params += para + break case let .login(para): params += para break diff --git a/ShenYin/ShenYin/Assets.xcassets/logo.imageset/logo.png b/ShenYin/ShenYin/Assets.xcassets/logo.imageset/logo.png deleted file mode 100644 index 2bc9514..0000000 Binary files a/ShenYin/ShenYin/Assets.xcassets/logo.imageset/logo.png and /dev/null differ diff --git a/ShenYin/ShenYin/Assets.xcassets/logo.imageset/Contents.json b/ShenYin/ShenYin/Assets.xcassets/mine/login_apple.imageset/Contents.json similarity index 78% rename from ShenYin/ShenYin/Assets.xcassets/logo.imageset/Contents.json rename to ShenYin/ShenYin/Assets.xcassets/mine/login_apple.imageset/Contents.json index 5f670ca..1648464 100644 --- a/ShenYin/ShenYin/Assets.xcassets/logo.imageset/Contents.json +++ b/ShenYin/ShenYin/Assets.xcassets/mine/login_apple.imageset/Contents.json @@ -1,15 +1,16 @@ { "images" : [ { - "filename" : "logo.png", "idiom" : "universal", "scale" : "1x" }, { + "filename" : "ic_IOS_1@2x.png", "idiom" : "universal", "scale" : "2x" }, { + "filename" : "ic_IOS_1@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/ShenYin/ShenYin/Assets.xcassets/mine/login_apple.imageset/ic_IOS_1@2x.png b/ShenYin/ShenYin/Assets.xcassets/mine/login_apple.imageset/ic_IOS_1@2x.png new file mode 100644 index 0000000..774731e Binary files /dev/null and b/ShenYin/ShenYin/Assets.xcassets/mine/login_apple.imageset/ic_IOS_1@2x.png differ diff --git a/ShenYin/ShenYin/Assets.xcassets/mine/login_apple.imageset/ic_IOS_1@3x.png b/ShenYin/ShenYin/Assets.xcassets/mine/login_apple.imageset/ic_IOS_1@3x.png new file mode 100644 index 0000000..9555b19 Binary files /dev/null and b/ShenYin/ShenYin/Assets.xcassets/mine/login_apple.imageset/ic_IOS_1@3x.png differ diff --git a/ShenYin/ShenYin/Assets.xcassets/sleep/sleep_demo.imageset/Contents.json b/ShenYin/ShenYin/Assets.xcassets/mine/login_wechat.imageset/Contents.json similarity index 78% rename from ShenYin/ShenYin/Assets.xcassets/sleep/sleep_demo.imageset/Contents.json rename to ShenYin/ShenYin/Assets.xcassets/mine/login_wechat.imageset/Contents.json index 291bfd0..84da541 100644 --- a/ShenYin/ShenYin/Assets.xcassets/sleep/sleep_demo.imageset/Contents.json +++ b/ShenYin/ShenYin/Assets.xcassets/mine/login_wechat.imageset/Contents.json @@ -5,11 +5,12 @@ "scale" : "1x" }, { - "filename" : "WX20250822-154739@2x.png", + "filename" : "微信_1@2x.png", "idiom" : "universal", "scale" : "2x" }, { + "filename" : "微信_1@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git "a/ShenYin/ShenYin/Assets.xcassets/mine/login_wechat.imageset/\345\276\256\344\277\241_1@2x.png" "b/ShenYin/ShenYin/Assets.xcassets/mine/login_wechat.imageset/\345\276\256\344\277\241_1@2x.png" new file mode 100644 index 0000000..510d0db Binary files /dev/null and "b/ShenYin/ShenYin/Assets.xcassets/mine/login_wechat.imageset/\345\276\256\344\277\241_1@2x.png" differ diff --git "a/ShenYin/ShenYin/Assets.xcassets/mine/login_wechat.imageset/\345\276\256\344\277\241_1@3x.png" "b/ShenYin/ShenYin/Assets.xcassets/mine/login_wechat.imageset/\345\276\256\344\277\241_1@3x.png" new file mode 100644 index 0000000..12aa66f Binary files /dev/null and "b/ShenYin/ShenYin/Assets.xcassets/mine/login_wechat.imageset/\345\276\256\344\277\241_1@3x.png" differ diff --git a/ShenYin/ShenYin/Assets.xcassets/sleep/sleep_demo.imageset/WX20250822-154739@2x.png b/ShenYin/ShenYin/Assets.xcassets/sleep/sleep_demo.imageset/WX20250822-154739@2x.png deleted file mode 100644 index 72251e0..0000000 Binary files a/ShenYin/ShenYin/Assets.xcassets/sleep/sleep_demo.imageset/WX20250822-154739@2x.png and /dev/null differ diff --git a/ShenYin/ShenYin/Info.plist b/ShenYin/ShenYin/Info.plist index 3ff3422..82a0f3a 100644 --- a/ShenYin/ShenYin/Info.plist +++ b/ShenYin/ShenYin/Info.plist @@ -2,6 +2,25 @@ + CFBundleURLTypes + + + CFBundleTypeRole + Editor + CFBundleURLName + weixin + CFBundleURLSchemes + + wxf19317f23b00d8ab + + + + LSApplicationQueriesSchemes + + weixin + weixinURLParamsAPI + weixinULAPI + NSAppTransportSecurity NSAllowsArbitraryLoads diff --git a/ShenYin/ShenYin/ShenYin.entitlements b/ShenYin/ShenYin/ShenYin.entitlements index 0c67376..307db24 100644 --- a/ShenYin/ShenYin/ShenYin.entitlements +++ b/ShenYin/ShenYin/ShenYin.entitlements @@ -1,5 +1,14 @@ - + + com.apple.developer.applesignin + + Default + + com.apple.developer.associated-domains + + applinks:www.thisiot.com + + diff --git a/ShenYin/ShenYin/UI/Customer/CustomerVC.swift b/ShenYin/ShenYin/UI/Customer/CustomerVC.swift index 3a0dd55..e2f263a 100644 --- a/ShenYin/ShenYin/UI/Customer/CustomerVC.swift +++ b/ShenYin/ShenYin/UI/Customer/CustomerVC.swift @@ -9,7 +9,7 @@ import UIKit class CustomerVC:BaseVC{ let scrollView = UIScrollView() let toolBar = SendToolBar() - let qaView = QaHeaderView(frame: CGRect(x: 0, y: 0, width: kScreenWid, height: 160)) + let qaView = QaHeaderView(frame: CGRect(x: 0, y: 0, width: kScreenWid, height: 175)) let tableView = UITableView(frame: CGRectZero, style: .plain) var dataList:[FeedbackContentModel] = [] override func viewDidLoad() { diff --git a/ShenYin/ShenYin/UI/Customer/QaHeaderView.swift b/ShenYin/ShenYin/UI/Customer/QaHeaderView.swift index d85c1bd..9d9bfe2 100644 --- a/ShenYin/ShenYin/UI/Customer/QaHeaderView.swift +++ b/ShenYin/ShenYin/UI/Customer/QaHeaderView.swift @@ -42,7 +42,7 @@ class QaHeaderView: BaseView { } bgView.snp.makeConstraints { make in make.left.right.equalToSuperview().inset(18) - make.bottom.equalToSuperview() + make.bottom.equalToSuperview().inset(10) make.top.equalToSuperview().inset(60) } diff --git a/ShenYin/ShenYin/UI/Home/Chat/ChatVC.swift b/ShenYin/ShenYin/UI/Home/Chat/ChatVC.swift index a6e560b..919fcf4 100644 --- a/ShenYin/ShenYin/UI/Home/Chat/ChatVC.swift +++ b/ShenYin/ShenYin/UI/Home/Chat/ChatVC.swift @@ -94,9 +94,9 @@ class ChatVC:BaseVC{ if (keyPath == "isActive") { let isOpen = change?[NSKeyValueChangeKey.newKey] as? Bool if (isOpen == true) { - YLprogressHUD.showAutoHiden("AI对话开启") +// YLprogressHUD.showAutoHiden("AI对话开启") } else { - YLprogressHUD.showAutoHiden( "AI对话结束") +// YLprogressHUD.showAutoHiden( "AI对话结束") PcmSound.sharedInstance().cleanup() } } diff --git a/ShenYin/ShenYin/UI/Home/Device/HomeDeviceVC.swift b/ShenYin/ShenYin/UI/Home/Device/HomeDeviceVC.swift index dea3c14..f90ea3e 100644 --- a/ShenYin/ShenYin/UI/Home/Device/HomeDeviceVC.swift +++ b/ShenYin/ShenYin/UI/Home/Device/HomeDeviceVC.swift @@ -85,7 +85,7 @@ class HomeDeviceVC:BaseVC{ BleManager.shared.cancel() } else{ - YLprogressHUD.showAutoHiden(model.msg) + YLprogressHUD.showAutoHiden("请求失败") } } } diff --git a/ShenYin/ShenYin/UI/Home/FieldRecording/FieldRecordingVC.swift b/ShenYin/ShenYin/UI/Home/FieldRecording/FieldRecordingVC.swift index de98402..c1be8b8 100644 --- a/ShenYin/ShenYin/UI/Home/FieldRecording/FieldRecordingVC.swift +++ b/ShenYin/ShenYin/UI/Home/FieldRecording/FieldRecordingVC.swift @@ -198,7 +198,7 @@ extension FieldRecordingVC : JoyGemRecordManagerDelegate { // // } } else { - YLprogressHUD.showAutoHiden("自动结束") +// YLprogressHUD.showAutoHiden("自动结束") ///判断当前蓝牙是否连接从而确定是否因为蓝牙断开造成的录音断开 } } diff --git a/ShenYin/ShenYin/UI/Home/RecordDetail/RecordDetailVC.swift b/ShenYin/ShenYin/UI/Home/RecordDetail/RecordDetailVC.swift index e012178..e115c0a 100644 --- a/ShenYin/ShenYin/UI/Home/RecordDetail/RecordDetailVC.swift +++ b/ShenYin/ShenYin/UI/Home/RecordDetail/RecordDetailVC.swift @@ -250,7 +250,8 @@ class RecordDetailVC:BaseVC{ setupViews(data: model) } else{ - YLprogressHUD.showAutoHiden("请求失败") + YLprogressHUD.hidden() +// YLprogressHUD.showAutoHiden("请求失败") } } } @@ -417,7 +418,7 @@ extension RecordDetailVC{ self?.showUploadSuccess() } else{ - YLprogressHUD.showAutoHiden(model.msg) + YLprogressHUD.showAutoHiden("请求失败") } } } diff --git a/ShenYin/ShenYin/UI/Home/TextTranslate/TranslateCell.swift b/ShenYin/ShenYin/UI/Home/TextTranslate/TranslateCell.swift index b687552..e61d552 100644 --- a/ShenYin/ShenYin/UI/Home/TextTranslate/TranslateCell.swift +++ b/ShenYin/ShenYin/UI/Home/TextTranslate/TranslateCell.swift @@ -107,7 +107,7 @@ class TranslateCell:BaseTableViewCell{ } @objc func copyAction(){ UIPasteboard.general.string = data.send + "\n" + data.response - YLprogressHUD.showAutoHiden("已拷贝") +// YLprogressHUD.showAutoHiden("已拷贝") } } diff --git a/ShenYin/ShenYin/UI/Launch/AppDelegate.swift b/ShenYin/ShenYin/UI/Launch/AppDelegate.swift index 5bbf6f4..6b89563 100644 --- a/ShenYin/ShenYin/UI/Launch/AppDelegate.swift +++ b/ShenYin/ShenYin/UI/Launch/AppDelegate.swift @@ -29,7 +29,68 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } - - + + func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { + Logger.debug(userActivity.webpageURL?.absoluteString ?? "None") + guard IASignWithWeChat.shared.handleOpenUniversalLink(userActivity) == false else { return true } + return IAUniversalLinksHandler.shared.handle(userActivity, restorationHandler: restorationHandler) + } + + func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { +// JPush.shared.deviceToken(deviceToken) + } + + func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { + return IASignWithWeChat.shared.handleOpen(url) + } + func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool { + return IASignWithWeChat.shared.handleOpen(url) + } +// func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) { +// Logger.verbose("注册远程通知发生错误:", error) +// } +// +// func applicationDidEnterBackground(_ application: UIApplication) { +// DB.shared.save() +// JPush.shared.tellAppState(0) +// Logger.verbose("App 进入后台") +// } +// +// func applicationWillEnterForeground(_ application: UIApplication) { +// JPush.shared.tellAppState(1) +// Logger.verbose("App 将要进入前台") +// } +// +// private var previousRefreshTime: TimeInterval = 0.0 +// func applicationDidBecomeActive(_ application: UIApplication) { +// let date = Date().timeIntervalSince1970 +// if (date - previousRefreshTime > 60.0) { +// previousRefreshTime = date +// IANotify.post(.deviceListHasChange) +// Logger.verbose("刷新设备列表...") +// } +// Logger.verbose("applicationDidBecomeActive") +// } +// +// func applicationWillTerminate(_ application: UIApplication) { +// Logger.verbose("App 将要停止运行") +// } +// +// // iOS10以上静默推送会走该回调 +// func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { +// JPush.shared.handleRemoteNotification(userInfo) +// completionHandler(.newData) +// } } +class IAUniversalLinksHandler { + static let shared = IAUniversalLinksHandler() + private init() { } + + func handle(_ userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { + guard userActivity.activityType == NSUserActivityTypeBrowsingWeb else { return false } + guard let webpageURL = userActivity.webpageURL else { return false } + Logger.debug(webpageURL.absoluteString) + return true + } +} diff --git a/ShenYin/ShenYin/UI/Launch/AppLaunch.swift b/ShenYin/ShenYin/UI/Launch/AppLaunch.swift index 1e92d5e..10d790d 100644 --- a/ShenYin/ShenYin/UI/Launch/AppLaunch.swift +++ b/ShenYin/ShenYin/UI/Launch/AppLaunch.swift @@ -11,7 +11,7 @@ import netfox class AppLaunch:NSObject{ @MainActor static func start(){ // NFX.sharedInstance().start() - + IASignWithWeChat.shared.register() JoySdkManager.shared.setupSdk() setupKeyboard() loadCache() diff --git a/ShenYin/ShenYin/UI/Launch/SceneDelegate.swift b/ShenYin/ShenYin/UI/Launch/SceneDelegate.swift index 4dbefb7..0a99f64 100644 --- a/ShenYin/ShenYin/UI/Launch/SceneDelegate.swift +++ b/ShenYin/ShenYin/UI/Launch/SceneDelegate.swift @@ -50,7 +50,9 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // to restore the scene back to its current state. } - + func scene(_ scene: UIScene, continue userActivity: NSUserActivity) { + IASignWithWeChat.shared.continueUserActivity(userActivity: userActivity) + } } diff --git a/ShenYin/ShenYin/UI/Mine/Device/DeviceInfoVC.swift b/ShenYin/ShenYin/UI/Mine/Device/DeviceInfoVC.swift index c7aadad..6a52a6b 100644 --- a/ShenYin/ShenYin/UI/Mine/Device/DeviceInfoVC.swift +++ b/ShenYin/ShenYin/UI/Mine/Device/DeviceInfoVC.swift @@ -183,7 +183,8 @@ fileprivate class FooterView: BaseView { App.shared.popPage() } else{ - YLprogressHUD.showAutoHiden(model.msg) +// YLprogressHUD.showAutoHiden(model.msg) + YLprogressHUD.showAutoHiden("请求失败") } } } diff --git a/ShenYin/ShenYin/UI/Mine/Feedback/Commit/FeedbackCommitVC.swift b/ShenYin/ShenYin/UI/Mine/Feedback/Commit/FeedbackCommitVC.swift index 48c92de..b18de4f 100644 --- a/ShenYin/ShenYin/UI/Mine/Feedback/Commit/FeedbackCommitVC.swift +++ b/ShenYin/ShenYin/UI/Mine/Feedback/Commit/FeedbackCommitVC.swift @@ -162,7 +162,7 @@ class FeedbackCommitVC:BaseVC{ } } else{ - YLprogressHUD.showAutoHiden(model.msg) + YLprogressHUD.showAutoHiden("请求失败") } } diff --git a/ShenYin/ShenYin/UI/Mine/Feedback/FeekbackVC.swift b/ShenYin/ShenYin/UI/Mine/Feedback/FeekbackVC.swift index 7cc3403..c6a29f7 100644 --- a/ShenYin/ShenYin/UI/Mine/Feedback/FeekbackVC.swift +++ b/ShenYin/ShenYin/UI/Mine/Feedback/FeekbackVC.swift @@ -9,7 +9,7 @@ import UIKit class FeekbackVC:BaseVC{ let bottomView = FeedbackBottomView() - let qaView = QaHeaderView(frame: CGRect(x: 0, y: 0, width: kScreenWid, height: 160)) + let qaView = QaHeaderView(frame: CGRect(x: 0, y: 0, width: kScreenWid, height: 175)) let tableView = UITableView() var dataList:[FeedbackContentModel] = [] override func viewDidLoad() { diff --git a/ShenYin/ShenYin/UI/Mine/Login/Controller/ForgetVC.swift b/ShenYin/ShenYin/UI/Mine/Login/Controller/ForgetVC.swift index 75bc6b3..e226393 100644 --- a/ShenYin/ShenYin/UI/Mine/Login/Controller/ForgetVC.swift +++ b/ShenYin/ShenYin/UI/Mine/Login/Controller/ForgetVC.swift @@ -60,7 +60,7 @@ class ForgetVC:BaseVC{ } phoneView.do { v in v.textField.placeholder = "请输入手机号码/邮箱" - + v.textField.keyboardType = .emailAddress } codeView.do { v in v.codeButton.addTarget(self, action: #selector(codeButtonAction), for: .touchUpInside) @@ -125,9 +125,12 @@ extension ForgetVC{ YLprogressHUD.showLoading() HttpClient.request(CommomApi.sms(account: text,type: .forget)) {[weak self] (model:ResponseBaseModel, res) in if model.isSuccess{ + YLprogressHUD.hidden() self?.codeView.codeButton.start() } - YLprogressHUD.showAutoHiden(model.msg) + else{ + YLprogressHUD.showAutoHiden("请求失败") + } } } @objc func loginAction(){ @@ -165,7 +168,9 @@ extension ForgetVC{ App.shared.popPage() } } - YLprogressHUD.showAutoHiden(result.msg) + else{ + YLprogressHUD.showAutoHiden("请求失败") + } } } } diff --git a/ShenYin/ShenYin/UI/Mine/Login/Controller/LoginVC.swift b/ShenYin/ShenYin/UI/Mine/Login/Controller/LoginVC.swift index a862d0f..74dee85 100644 --- a/ShenYin/ShenYin/UI/Mine/Login/Controller/LoginVC.swift +++ b/ShenYin/ShenYin/UI/Mine/Login/Controller/LoginVC.swift @@ -51,6 +51,7 @@ class LoginVC:BaseVC{ phoneView.do { v in // v.textField.text = "13480939445" v.textField.placeholder = "请输入手机号码/邮箱" + v.textField.keyboardType = .emailAddress } pwdView.do { v in v.textField.placeholder = "请输入密码" @@ -97,7 +98,7 @@ class LoginVC:BaseVC{ } othersView.snp.makeConstraints { make in make.centerX.equalToSuperview() - make.height.equalTo(50) + make.height.equalTo(150) make.left.right.equalToSuperview() make.top.equalTo(loginBtn.snp.bottom).offset(20) } @@ -149,7 +150,9 @@ extension LoginVC{ App.shared.didLogin() } } - YLprogressHUD.showAutoHiden(result.msg) + else{ + YLprogressHUD.showAutoHiden("请求失败") + } } } } diff --git a/ShenYin/ShenYin/UI/Mine/Login/Controller/RegisterVC.swift b/ShenYin/ShenYin/UI/Mine/Login/Controller/RegisterVC.swift index 035bb69..97ead59 100644 --- a/ShenYin/ShenYin/UI/Mine/Login/Controller/RegisterVC.swift +++ b/ShenYin/ShenYin/UI/Mine/Login/Controller/RegisterVC.swift @@ -115,9 +115,11 @@ class RegisterVC:BaseVC{ func updateLayout(){ if regionView.region.isChinese{ phoneView.textField.placeholder = "请输入手机号码" + phoneView.textField.keyboardType = .phonePad } else{ phoneView.textField.placeholder = "请输入邮箱" + phoneView.textField.keyboardType = .emailAddress } } } @@ -132,8 +134,11 @@ extension RegisterVC{ HttpClient.request(CommomApi.sms(account: text,type: .reg)) {[weak self] (model:ResponseBaseModel, res) in if model.isSuccess{ self?.codeView.codeButton.start() + YLprogressHUD.hidden() + } + else{ + YLprogressHUD.showAutoHiden("请求失败") } - YLprogressHUD.showAutoHiden(model.msg) } } @objc func registerAction(){ @@ -180,7 +185,9 @@ extension RegisterVC{ App.shared.popPage() } } - YLprogressHUD.showAutoHiden(result.msg) + else{ + YLprogressHUD.showAutoHiden("请求失败") + } } } } diff --git a/ShenYin/ShenYin/UI/Mine/Login/Controller/SetPasswordVC.swift b/ShenYin/ShenYin/UI/Mine/Login/Controller/SetPasswordVC.swift index 2b73833..b91c3fb 100644 --- a/ShenYin/ShenYin/UI/Mine/Login/Controller/SetPasswordVC.swift +++ b/ShenYin/ShenYin/UI/Mine/Login/Controller/SetPasswordVC.swift @@ -80,14 +80,5 @@ extension SetPwdVC{ YLprogressHUD.showAutoHiden("请输入确认密码") return } -// YLprogressHUD.showLoading() -// LoginVM.login(phone: phone, code: code) {[weak self] result in -// if result.isSuccess{ -// YLprogressHUD.showSuccess { -// self?.view.window?.rootViewController = BaseTC() -// } -// } -// YLprogressHUD.showAutoHiden(result.msg) -// } } } diff --git a/ShenYin/ShenYin/UI/Mine/Login/Controller/SmsLoginVC.swift b/ShenYin/ShenYin/UI/Mine/Login/Controller/SmsLoginVC.swift index 4c8d5b0..0b1a74f 100644 --- a/ShenYin/ShenYin/UI/Mine/Login/Controller/SmsLoginVC.swift +++ b/ShenYin/ShenYin/UI/Mine/Login/Controller/SmsLoginVC.swift @@ -115,9 +115,11 @@ class SmsLoginVC:BaseVC{ func updateLayout(){ if regionView.region.isChinese{ phoneView.textField.placeholder = "请输入手机号码" + phoneView.textField.keyboardType = .phonePad } else{ phoneView.textField.placeholder = "请输入邮箱" + phoneView.textField.keyboardType = .emailAddress } } } @@ -135,8 +137,11 @@ extension SmsLoginVC{ HttpClient.request(CommomApi.sms(account: text,type: .login)) {[weak self] (model:ResponseBaseModel, res) in if model.isSuccess{ self?.codeView.codeButton.start() + YLprogressHUD.hidden() + } + else{ + YLprogressHUD.showAutoHiden("请求失败") } - YLprogressHUD.showAutoHiden(model.msg) } } @objc func loginAction(){ @@ -170,7 +175,9 @@ extension SmsLoginVC{ App.shared.didLogin() } } - YLprogressHUD.showAutoHiden(result.msg) + else{ + YLprogressHUD.showAutoHiden("请求失败") + } } } func emailLogin(){ @@ -197,7 +204,9 @@ extension SmsLoginVC{ App.shared.didLogin() } } - YLprogressHUD.showAutoHiden(result.msg) + else{ + YLprogressHUD.showAutoHiden("请求失败") + } } } } diff --git a/ShenYin/ShenYin/UI/Mine/Login/Controller/VerifyCodeVC.swift b/ShenYin/ShenYin/UI/Mine/Login/Controller/VerifyCodeVC.swift index ed16ab5..a96be4b 100644 --- a/ShenYin/ShenYin/UI/Mine/Login/Controller/VerifyCodeVC.swift +++ b/ShenYin/ShenYin/UI/Mine/Login/Controller/VerifyCodeVC.swift @@ -84,8 +84,11 @@ extension VerifyCodeVC{ HttpClient.request(CommomApi.sms(account: text,type: .update)) {[weak self] (model:ResponseBaseModel, res) in if model.isSuccess{ self?.codeView.codeButton.start() + YLprogressHUD.hidden() + } + else{ + YLprogressHUD.showAutoHiden("请求失败") } - YLprogressHUD.showAutoHiden(model.msg) } } @objc func loginAction(){ @@ -122,7 +125,7 @@ extension VerifyCodeVC{ } } else{ - YLprogressHUD.showAutoHiden(result.msg) + YLprogressHUD.showAutoHiden("请求失败") } } diff --git a/ShenYin/ShenYin/UI/Mine/Login/Controller/VerifyEmailVC.swift b/ShenYin/ShenYin/UI/Mine/Login/Controller/VerifyEmailVC.swift index a646a6e..d721e79 100644 --- a/ShenYin/ShenYin/UI/Mine/Login/Controller/VerifyEmailVC.swift +++ b/ShenYin/ShenYin/UI/Mine/Login/Controller/VerifyEmailVC.swift @@ -68,8 +68,11 @@ extension VerifyEmailVC{ HttpClient.request(CommomApi.sms(account: self.email,type: .update)) {[weak self] (model:ResponseBaseModel, res) in if model.isSuccess{ self?.codeView.codeButton.start() + YLprogressHUD.hidden() + } + else{ + YLprogressHUD.showAutoHiden("请求失败") } - YLprogressHUD.showAutoHiden(model.msg) } } @objc func loginAction(){ @@ -89,7 +92,9 @@ extension VerifyEmailVC{ App.shared.popToPage(num: 2) } } - YLprogressHUD.showAutoHiden(result.msg) + else{ + YLprogressHUD.showAutoHiden("请求失败") + } } } } diff --git a/ShenYin/ShenYin/UI/Mine/Login/Controller/VerifyPhoneVC.swift b/ShenYin/ShenYin/UI/Mine/Login/Controller/VerifyPhoneVC.swift index d91b52d..38a7e0f 100644 --- a/ShenYin/ShenYin/UI/Mine/Login/Controller/VerifyPhoneVC.swift +++ b/ShenYin/ShenYin/UI/Mine/Login/Controller/VerifyPhoneVC.swift @@ -67,9 +67,12 @@ extension VerifyPhoneVC{ YLprogressHUD.showLoading() HttpClient.request(CommomApi.sms(account: self.phone,type: .update)) {[weak self] (model:ResponseBaseModel, res) in if model.isSuccess{ + YLprogressHUD.hidden() self?.codeView.codeButton.start() } - YLprogressHUD.showAutoHiden(model.msg) + else{ + YLprogressHUD.showAutoHiden("请求失败") + } } } @objc func loginAction(){ @@ -89,7 +92,9 @@ extension VerifyPhoneVC{ App.shared.popToPage(num: 2) } } - YLprogressHUD.showAutoHiden(result.msg) + else{ + YLprogressHUD.showAutoHiden("请求失败") + } } } } diff --git a/ShenYin/ShenYin/UI/Mine/Login/View/OthersLoginView.swift b/ShenYin/ShenYin/UI/Mine/Login/View/OthersLoginView.swift index 239f1c8..8b0a671 100644 --- a/ShenYin/ShenYin/UI/Mine/Login/View/OthersLoginView.swift +++ b/ShenYin/ShenYin/UI/Mine/Login/View/OthersLoginView.swift @@ -6,15 +6,21 @@ // import UIKit +import DeviceKit + class OthersLoginView: BaseView { + let toolView = UIView() let registerLabel = UILabel() let pwdLabel = UILabel() let smsLabel = UILabel() let line1 = UIView() let line2 = UIView() + let thirdView = ThirdLoginView() override func setupViews() { - addSubviews([registerLabel,pwdLabel,smsLabel,line1,line2]) +// backgroundColor = .red + addSubviews([toolView,thirdView]) + toolView.addSubviews([registerLabel,pwdLabel,smsLabel,line1,line2]) line1.backgroundColor = .hexString("#666666") line2.backgroundColor = .hexString("#666666") @@ -41,6 +47,11 @@ class OthersLoginView: BaseView { } } override func setupLayout() { + toolView.snp.makeConstraints { make in + make.width.equalToSuperview() + make.top.left.equalToSuperview() + make.height.equalTo(50) + } pwdLabel.snp.makeConstraints { make in // make.width.equalTo(78) make.height.equalToSuperview() @@ -70,6 +81,12 @@ class OthersLoginView: BaseView { make.left.equalTo(pwdLabel.snp.right).offset(15) make.centerY.equalToSuperview() } + thirdView.snp.makeConstraints { make in +// make.width.equalToSuperview() + make.top.equalToSuperview().inset(60) + make.height.equalTo(80) + make.centerX.equalToSuperview() + } } @objc func forgetAction(){ App.shared.goToPage(ForgetVC(type: .forget)) @@ -82,3 +99,131 @@ class OthersLoginView: BaseView { App.shared.goToPage(SmsLoginVC()) } } + + +class ThirdLoginView: BaseView { + let label = UILabel() + let wechatView = UIButton(type: .custom) + let appleView = UIButton(type: .custom) + + override func setupViews() { +// backgroundColor = .green + addSubviews([label,wechatView,appleView]) + + + label.do { v in + v.text = "其他登录方式" + v.textColor = .hexString("#666666") + v.font = .regular(12) + v.textAlignment = .center + } + if IASignWithWeChat.shared.isInstalled{ + wechatView.do { v in + v.setImage(UIImage(named: "login_wechat"), for: .normal) + v.addTarget(self, action: #selector(wechatAction), for: .touchUpInside) + } + wechatView.isHidden = false + } + else{ + wechatView.isHidden = true + } + + appleView.do { v in + v.setImage(UIImage(named: "login_apple"), for: .normal) + v.addTarget(self, action: #selector(appleAction), for: .touchUpInside) + } + } + override func setupLayout() { + if IASignWithWeChat.shared.isInstalled { + label.snp.makeConstraints { make in + make.top.centerX.equalToSuperview() + } + wechatView.snp.makeConstraints { make in + make.size.equalTo(30) + make.left.equalToSuperview() + make.top.equalTo(label.snp.bottom).offset(20) + } + appleView.snp.makeConstraints { make in + make.size.equalTo(30) + make.left.equalTo(wechatView.snp.right).offset(30) + make.top.equalTo(label.snp.bottom).offset(20) + make.right.equalToSuperview() + } + } + else{ + label.snp.makeConstraints { make in + make.top.left.equalToSuperview() + make.width.equalTo(200) + make.right.equalToSuperview() + } + appleView.snp.makeConstraints { make in + make.size.equalTo(30) + make.centerX.equalToSuperview() + make.top.equalTo(label.snp.bottom).offset(20) + } + } + } + @objc func wechatAction(){ + Logger.debug("wechat action") + guard IASignWithWeChat.shared.isInstalled else { return } +// guard agreeAgreementBtn.isSelected else { return "请同意《App隐私政策》".asToastShow() } + + IASignWithWeChat.shared.request { [weak self] msg, code in + if let code = code{ + self?.wechatLogin(with: code) + } + else{ +// YLprogressHUD.showAutoHiden(msg) + } + } + } + @objc func appleAction(){ + Logger.debug("apple action") + + let manager = AppleLoginManager.shared + manager.loginSuccess = {[weak self] (id,token) in + guard let self = self else {return} +// Logger.debug("token = \(id)","emal = \(emal)","name = \(name)") + appleLogin(with: id,token: token) + } + manager.loginFailure = {[weak self] (msg) in +// YLprogressHUD.showAutoHiden(msg) + } + manager.appleLoginAction() + } + + func appleLogin(with id:String,token:String){ + var params:[String:Any] = [:] + params["deviceName"] = Device.current.name + params["deviceCode"] = CacheManager.uuid() + params["token"] = token + params["userName"] = "DC_\(id)".replacingOccurrences(of: ".", with: "") + +// params["userName"] = "DC_\(UUID().uuidString.replacingOccurrences(of: "-", with: "_").prefix(16))" + + + LoginVM.appleLogin(param: params) { result in + if result.isSuccess{ + YLprogressHUD.showSuccess { + App.shared.didLogin() + } + } + YLprogressHUD.showAutoHiden(result.msg) + } + } + func wechatLogin(with token:String){ + var params:[String:Any] = [:] + params["code"] = token + + LoginVM.wechatLogin(param: params) { result in + if result.isSuccess{ + YLprogressHUD.showSuccess { + App.shared.didLogin() + } + } + else{ + YLprogressHUD.showAutoHiden("请求失败") + } + } + } +} diff --git a/ShenYin/ShenYin/UI/Mine/Login/View/PasswordView.swift b/ShenYin/ShenYin/UI/Mine/Login/View/PasswordView.swift index 68fed60..8a25815 100644 --- a/ShenYin/ShenYin/UI/Mine/Login/View/PasswordView.swift +++ b/ShenYin/ShenYin/UI/Mine/Login/View/PasswordView.swift @@ -18,7 +18,8 @@ class PasswordView: BaseView { v.keyboardType = .default v.placeholder = "请输入密码" v.isSecureTextEntry = true - } +// v.returnKeyType = .done + } btn.setImage(UIImage(named: "pwd_close"), for: .normal) btn.setImage(UIImage(named: "pwd_open"), for: .selected) btn.addTarget(self, action: #selector(btnAction), for: .touchUpInside) diff --git a/ShenYin/ShenYin/UI/Mine/Login/ViewModel/AppleLoginManager.swift b/ShenYin/ShenYin/UI/Mine/Login/ViewModel/AppleLoginManager.swift new file mode 100644 index 0000000..4e09c4d --- /dev/null +++ b/ShenYin/ShenYin/UI/Mine/Login/ViewModel/AppleLoginManager.swift @@ -0,0 +1,121 @@ +// +// Untitled.swift +// ShenYin +// +// Created by liangshi on 2025/10/28. +// + +import Foundation +import AuthenticationServices + +@available(iOS 13.0, *) +class AppleLoginManager: NSObject { + static let shared = AppleLoginManager() + var loginSuccess:((_ appstore_id: String,_ token: String) -> Void)? + var loginFailure:((_ error:String) -> Void)? + + public func appleLoginAction() { + let appleIDProvider = ASAuthorizationAppleIDProvider() + let request = appleIDProvider.createRequest() + request.requestedScopes = [.fullName, .email] + + let authVC = ASAuthorizationController(authorizationRequests: [request]) + authVC.delegate = self + authVC.presentationContextProvider = self + authVC.performRequests() + } +} + +@available(iOS 13.0, *) +extension AppleLoginManager:ASAuthorizationControllerDelegate, ASAuthorizationControllerPresentationContextProviding{ + ///告诉 ASAuthorizationController 展示在哪个 window 上 + func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchor { + return App.shared.window! + } + + //返回错误 + func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) { + var errorMsg = "" + + switch error { + case ASAuthorizationError.canceled: + errorMsg = "您取消了授权请求"; + break; + case ASAuthorizationError.failed: + errorMsg = "授权请求失败"; + break; + case ASAuthorizationError.invalidResponse: + errorMsg = "授权请求响应无效"; + break; + case ASAuthorizationError.notHandled: + errorMsg = "未能处理授权请求"; + break; + case ASAuthorizationError.unknown: + errorMsg = "授权请求失败未知原因"; + + break; + default: + break; + } + print("授权结果" + errorMsg) + self.loginFailure?(errorMsg) + } + +// //授权结果 +// func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) { +// switch authorization.credential { +// case let credential as ASAuthorizationAppleIDCredential: +// if let state = credential.state{ +// print(state) +// } +// +// var email = "" +// var fullName = "" +// let userID = credential.user +// print(userID) +// +// if let name = credential.fullName,let givenName = name.givenName { +// fullName = givenName +// print(fullName) +// } +// if let em = credential.email { +// email = em +// print(email) +// } +// let realUserStatus = credential.realUserStatus +// print(realUserStatus) +// +// if let code = credential.authorizationCode,let authrizationCode = String(data:code , encoding: .utf8){ +// print(authrizationCode) +// } +// if let token = credential.identityToken,let identityToken = String(data: token, encoding: .utf8){ +// print(identityToken) +// } +// +// self.loginSuccess?(userID,email,fullName) +// +// case let passwordCredential as ASPasswordCredential: +// let username = passwordCredential.user +// let password = passwordCredential.password +// print(username) +// print(password) +// default: +// break +// } +// } + func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) { + guard let credential = authorization.credential as? ASAuthorizationAppleIDCredential else { return Logger.debug("授权数据类型异常") } + guard let identityToken = credential.identityToken, + let token = String(data: identityToken, encoding: .utf8) else { return Logger.debug("identity Token 为空") } + // let userID = credential.user + // let state = credential.state + // let fullName = credential.fullName?.familyName + // let email = credential.email + // let authorizationCode = String(data: credential.authorizationCode!, encoding: .utf8) + + // let realUserStatus = credential.realUserStatus + + Logger.debug("授权完成", "id = \(credential.user)","token = \(token)") + self.loginSuccess?(credential.user,token) + } +} diff --git a/ShenYin/ShenYin/UI/Mine/Login/ViewModel/IASignWithWeChat.swift b/ShenYin/ShenYin/UI/Mine/Login/ViewModel/IASignWithWeChat.swift new file mode 100644 index 0000000..772da2b --- /dev/null +++ b/ShenYin/ShenYin/UI/Mine/Login/ViewModel/IASignWithWeChat.swift @@ -0,0 +1,76 @@ +// +// Untitled.swift +// ShenYin +// +// Created by liangshi on 2025/10/28. +// + +import Foundation +import WechatOpenSDK + +/// 微信登陆 +class IASignWithWeChat:NSObject { + private(set) var complete: ((String,String?) -> Void)! + static let shared = IASignWithWeChat() + + + func register() { + WXApi.startLog(by: .detail) { log in + Logger.debug(log) + } + WXApi.registerApp(DCGlobal.wxAppID, universalLink: DCGlobal.wxUniversalLink) +// WXApi.checkUniversalLinkReady { step, result in +// Logger.debug("step = ",step) +// Logger.debug("result success = \(result.success),errorInfo = \(result.errorInfo),suggestion = \(result.suggestion)") +// } + } + + func handleOpen(_ url: URL) -> Bool { + return WXApi.handleOpen(url, delegate: self) + } + + func handleOpenUniversalLink(_ userActivity: NSUserActivity) -> Bool { + return WXApi.handleOpenUniversalLink(userActivity, delegate: self) + } + func continueUserActivity(userActivity: NSUserActivity) { + WXApi.handleOpenUniversalLink(userActivity, delegate: self) + } + private var requestID: String = "" + func request(complete: @escaping ( _ message: String,_ code:String?) -> Void) { + self.complete = complete + + requestID = String.uuid() + WXApi.isWXAppInstalled() + let authReq = SendAuthReq() + authReq.scope = "snsapi_userinfo" + authReq.state = requestID + WXApi.send(authReq) + } + /// true = 已安装微信app + var isInstalled: Bool { WXApi.isWXAppInstalled() } + +} +public extension String { + + static func uuid(_ suffix: String = "") -> String { + UUID().uuidString.replacingOccurrences(of: "-", with: "").appending(suffix) + } +} +extension IASignWithWeChat: WXApiDelegate { + + func onResp(_ resp: BaseResp) { + // WXSuccess = 0, /**< 成功 */ + // WXErrCodeCommon = -1, /**< 普通错误类型 */ + // WXErrCodeUserCancel = -2, /**< 用户点击取消并返回 */ + // WXErrCodeSentFail = -3, /**< 发送失败 */ + // WXErrCodeAuthDeny = -4, /**< 授权失败 */ + // WXErrCodeUnsupport = -5, /**< 微信不支持 */ + + guard let authResp = resp as? SendAuthResp else { return } + Logger.debug(authResp.errStr, authResp.errCode) + + let error = ["成功", "普通错误类型", "用户取消授权", "发送失败", "授权失败", "当前微信版本不支持"][abs(Int(authResp.errCode))] + guard authResp.errCode == 0 else { return complete( error,nil) } + complete(error,authResp.code) + } +} diff --git a/ShenYin/ShenYin/UI/Mine/Login/ViewModel/LoginVM.swift b/ShenYin/ShenYin/UI/Mine/Login/ViewModel/LoginVM.swift index f635cb9..3193418 100644 --- a/ShenYin/ShenYin/UI/Mine/Login/ViewModel/LoginVM.swift +++ b/ShenYin/ShenYin/UI/Mine/Login/ViewModel/LoginVM.swift @@ -62,6 +62,25 @@ class LoginVM:BaseVM{ completion(model) } } + 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.login(token: model.data) + } + completion(model) + } + } + 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.login(token: model.data) + } + completion(model) + } + } + static public func fetchCountryList(completion:@escaping (_ result:CountryModelRoot) ->Void) { HttpClient.request(CommomApi.countryList) { (model:CountryModelRoot, res) in if model.isSuccess{ diff --git a/ShenYin/ShenYin/UI/Mine/LoginManager/DeviceLoginDetailVC.swift b/ShenYin/ShenYin/UI/Mine/LoginManager/DeviceLoginDetailVC.swift index 9f64b66..93bceb5 100644 --- a/ShenYin/ShenYin/UI/Mine/LoginManager/DeviceLoginDetailVC.swift +++ b/ShenYin/ShenYin/UI/Mine/LoginManager/DeviceLoginDetailVC.swift @@ -114,7 +114,7 @@ fileprivate class FooterView: BaseView { } } else{ - YLprogressHUD.showAutoHiden(model.msg) + YLprogressHUD.showAutoHiden("请求失败") } } } diff --git a/ShenYin/ShenYin/UI/Mine/MoreSetVC.swift b/ShenYin/ShenYin/UI/Mine/MoreSetVC.swift index 2821266..fcc3a54 100644 --- a/ShenYin/ShenYin/UI/Mine/MoreSetVC.swift +++ b/ShenYin/ShenYin/UI/Mine/MoreSetVC.swift @@ -80,7 +80,9 @@ class MoreSetVC: BaseVC{ CacheManager.shared.logout() } } - YLprogressHUD.showAutoHiden(result.msg) + else{ + YLprogressHUD.showAutoHiden("请求失败") + } } } } diff --git a/ShenYin/ShenYin/UI/Mine/RevokeCodeVC.swift b/ShenYin/ShenYin/UI/Mine/RevokeCodeVC.swift index bc6579c..44c801d 100644 --- a/ShenYin/ShenYin/UI/Mine/RevokeCodeVC.swift +++ b/ShenYin/ShenYin/UI/Mine/RevokeCodeVC.swift @@ -67,8 +67,11 @@ extension RevokeCodeVC{ HttpClient.request(CommomApi.revokeCode) {[weak self] (model:ResponseBaseModel, res) in if model.isSuccess{ self?.codeView.codeButton.start() + YLprogressHUD.hidden() + } + else{ + YLprogressHUD.showAutoHiden("请求失败") } - YLprogressHUD.showAutoHiden(model.msg) } } @objc func loginAction(){ @@ -87,7 +90,7 @@ extension RevokeCodeVC{ } } else{ - YLprogressHUD.showAutoHiden(model.msg) + YLprogressHUD.showAutoHiden("请求失败") } } diff --git a/ShenYin/ShenYin/UI/Mine/Update/AppUpdateVM.swift b/ShenYin/ShenYin/UI/Mine/Update/AppUpdateVM.swift index ca2473c..d90cef6 100644 --- a/ShenYin/ShenYin/UI/Mine/Update/AppUpdateVM.swift +++ b/ShenYin/ShenYin/UI/Mine/Update/AppUpdateVM.swift @@ -27,7 +27,7 @@ class AppUpdateVM:BaseVM{ } } else{ - YLprogressHUD.showAutoHiden(model.msg) + YLprogressHUD.showAutoHiden("请求失败") } } } diff --git a/ShenYin/ShenYin/UI/Mine/Update/BleUpdateVM.swift b/ShenYin/ShenYin/UI/Mine/Update/BleUpdateVM.swift index f22c712..28bee8d 100644 --- a/ShenYin/ShenYin/UI/Mine/Update/BleUpdateVM.swift +++ b/ShenYin/ShenYin/UI/Mine/Update/BleUpdateVM.swift @@ -47,7 +47,7 @@ class BleUpdateVM:BaseVM{ } } else{ - YLprogressHUD.showAutoHiden(model.msg) + YLprogressHUD.showAutoHiden("请求失败") } } } diff --git a/ShenYin/ShenYin/UI/Mine/UserInfo/NickNameVC.swift b/ShenYin/ShenYin/UI/Mine/UserInfo/NickNameVC.swift index f41fe77..ca597c6 100644 --- a/ShenYin/ShenYin/UI/Mine/UserInfo/NickNameVC.swift +++ b/ShenYin/ShenYin/UI/Mine/UserInfo/NickNameVC.swift @@ -22,6 +22,7 @@ class NickNameVC:BaseVC{ phoneView.do { v in v.textField.placeholder = "请输入昵称" + v.textField.keyboardType = .default } loginBtn.set(title: "确定",style: .theme1, target: self, action: #selector(loginAction)) view.addSubviews([phoneView,loginBtn]) diff --git a/ShenYin/ShenYin/UI/Mine/UserInfo/UserInfoVC.swift b/ShenYin/ShenYin/UI/Mine/UserInfo/UserInfoVC.swift index 897f96c..86970f2 100644 --- a/ShenYin/ShenYin/UI/Mine/UserInfo/UserInfoVC.swift +++ b/ShenYin/ShenYin/UI/Mine/UserInfo/UserInfoVC.swift @@ -153,7 +153,7 @@ extension UserInfoVC{ self?.refreshUI() } else{ - YLprogressHUD.showAutoHiden(model.msg) + YLprogressHUD.showAutoHiden("请求失败") } } } diff --git a/ShenYin/ShenYin/UI/Mode/ModeEffectsView.swift b/ShenYin/ShenYin/UI/Mode/ModeEffectsView.swift index 755dc6b..7cc8bf5 100644 --- a/ShenYin/ShenYin/UI/Mode/ModeEffectsView.swift +++ b/ShenYin/ShenYin/UI/Mode/ModeEffectsView.swift @@ -148,6 +148,9 @@ class ModeEffectsView: BaseView { } @objc func tapAction(_ tap:UITapGestureRecognizer){ + if !BleManager.shared.isConnetd { + return + } let view = tap.view as! ItemView for item in itemViews { if view == item { diff --git a/ShenYin/ShenYin/UI/Mode/ModeVC.swift b/ShenYin/ShenYin/UI/Mode/ModeVC.swift index cc128af..03fc197 100644 --- a/ShenYin/ShenYin/UI/Mode/ModeVC.swift +++ b/ShenYin/ShenYin/UI/Mode/ModeVC.swift @@ -94,6 +94,9 @@ extension ModeVC{ } func selectedModeAction(_ mode:JoyGemEQMode){ + if !BleManager.shared.isConnetd { + return + } JoyGemAIManager.shared().device.setEQMode(mode) { err in Logger.debug("setEQMode:\(err)"); } @@ -102,7 +105,10 @@ extension ModeVC{ } } @objc func findAction(){ - App.shared.goToPage(FindVC()) + if BleManager.shared.isConnetd { + App.shared.goToPage(FindVC()) + } + } } diff --git a/ShenYin/podfile b/ShenYin/podfile index 3c0d57e..648b0d6 100644 --- a/ShenYin/podfile +++ b/ShenYin/podfile @@ -34,9 +34,15 @@ target 'ShenYin' do pod 'SocketRocket'#socket,AI用到 pod 'DGActivityIndicatorView'#扫描雷达 pod 'DeviceKit', '~> 5.4.0' - pod 'CryptoSwift' + pod 'CryptoSwift'#加密 pod 'ZipArchive'#压缩 + + # 微信SDK +# pod 'WechatOpenSDK-Swift' + pod 'WechatOpenSDK-XCFramework' + + # pod 'MultiSlider' # pod 'DSWaveformImage' diff --git a/document/bug.txt b/document/bug.txt new file mode 100644 index 0000000..9da502b --- /dev/null +++ b/document/bug.txt @@ -0,0 +1,9 @@ +000184.9ec81d3cc0d64640bbcbf740208cb0ac.0822 +000184.9ec81d3cc0d64640bbcbf740208cb0ac.0822 +苹果登录修改用户名闪退,估计是是检查token报错 + + +https://www.thisiot.com/flychat/apple-app-site-association +https://www.thisiot.com/flychat/apple-app-site-association + +https://www.thisiot.com/flychat/apple-app-site-association \ No newline at end of file