From 0bb912bac961ae9c350cb87ecbf075eead825ff1 Mon Sep 17 00:00:00 2001 From: edwinQQQ Date: Fri, 17 Oct 2025 15:54:28 +0800 Subject: [PATCH] feat: add new localization strings for login functionality MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 主要变更: 1. 新增多个与登录相关的本地化字符串,包括一键登录、手机号登录、用户服务协议等。 2. 更新了用户登录界面的提示信息,以提升用户体验。 此更新旨在增强应用的本地化支持,提供更好的用户交互体验。 --- YuMi/Appdelegate/AppDelegate.h.backup | 15 - YuMi/Appdelegate/AppDelegate.m.backup | 176 - YuMi/Config/APIConfig.swift.backup | 110 - YuMi/CustomUI/DJDKMIMOMColor.h.backup | 79 - YuMi/CustomUI/DJDKMIMOMColor.m.backup | 177 - .../Config/TTActionSheetConfig.h.backup | 60 - .../Config/TTActionSheetConfig.m.backup | 49 - .../Config/TTAlertButtonConfig.h.backup | 30 - .../Config/TTAlertButtonConfig.m.backup | 13 - .../TTPopup/Config/TTAlertConfig.h.backup | 86 - .../TTPopup/Config/TTAlertConfig.m.backup | 90 - .../TTAlertMessageAttributedConfig.h.backup | 34 - .../TTAlertMessageAttributedConfig.m.backup | 13 - .../TTPopup/Header/TTPopupConstants.h.backup | 38 - .../Manager/TTPopupManagerService.h.backup | 24 - .../Manager/TTPopupManagerService.m.backup | 200 - .../TTPopupManagerServiceProtocol.h.backup | 25 - .../TTPopup/Service/TTPopupService.h.backup | 22 - .../TTPopup/Service/TTPopupService.m.backup | 36 - .../Service/TTPopupServiceProtocol.h.backup | 78 - YuMi/CustomUI/TTPopup/TTPopup.h.backup | 126 - YuMi/CustomUI/TTPopup/TTPopup.m.backup | 243 - .../TTPopup/View/TTActionSheetView.h.backup | 26 - .../TTPopup/View/TTActionSheetView.m.backup | 159 - .../TTPopup/View/TTAlertView.h.backup | 25 - .../TTPopup/View/TTAlertView.m.backup | 255 - .../TTPopup/View/TTNewAlertView.h.backup | 20 - .../TTPopup/View/TTNewAlertView.m.backup | 118 - YuMi/CustomUI/UIImage/UIImage+Utils.h.backup | 65 - YuMi/CustomUI/UIImage/UIImage+Utils.m.backup | 592 --- .../UIImageView/NetImageConfig.h.backup | 22 - .../UIImageView/NetImageConfig.m.backup | 21 - .../UIImageView/NetImageView.h.backup | 45 - .../UIImageView/NetImageView.m.backup | 151 - .../UIImageView/UIImageConstant.h.backup | 53 - .../UIImageView/UIImageConstant.m.backup | 119 - .../UIViewCorner/UIView+Corner.h.backup | 67 - .../UIViewCorner/UIView+Corner.m.backup | 125 - .../UIView+GradientLayer.h.backup | 37 - .../UIView+GradientLayer.m.backup | 120 - .../UIImage+ImageEffects.h.backup | 108 - .../UIImage+ImageEffects.m.backup | 309 -- .../CustomUI/XCCurrentVCStackManager.h.backup | 31 - .../CustomUI/XCCurrentVCStackManager.m.backup | 123 - YuMi/CustomUI/XNDJTDDLoadingTool.h.backup | 148 - YuMi/CustomUI/XNDJTDDLoadingTool.m.backup | 391 -- YuMi/E-P/Common/EPImageUploader.swift.backup | 163 - YuMi/E-P/Common/EPProgressHUD.swift.backup | 92 - YuMi/E-P/Common/EPQCloudConfig.swift.backup | 56 - YuMi/E-P/Common/EPSDKManager.swift.backup | 253 - .../EPLoginTypesViewController.swift.backup | 696 --- .../EPLoginViewController.swift.backup | 307 -- .../Login/Models/EPLoginBridge.swift.backup | 33 - .../Login/Models/EPLoginConfig.swift.backup | 305 -- .../Login/Models/EPLoginState.swift.backup | 52 - .../Services/EPLoginManager.swift.backup | 149 - .../Services/EPLoginService.swift.backup | 303 -- .../Login/Views/EPLoginButton.swift.backup | 131 - .../Login/Views/EPLoginInputView.swift.backup | 322 -- .../Login/Views/EPPolicyLabel.swift.backup | 151 - .../EPAboutUsViewController.swift.backup | 162 - .../EPEditSettingViewController.swift.backup | 850 ---- .../Controllers/EPMineViewController.h.backup | 20 - .../Controllers/EPMineViewController.m.backup | 220 - .../Mine/Services/EPMineAPIHelper.h.backup | 40 - .../Mine/Services/EPMineAPIHelper.m.backup | 77 - YuMi/E-P/Mine/Views/EPMineHeaderView.h.backup | 26 - YuMi/E-P/Mine/Views/EPMineHeaderView.m.backup | 242 - .../EPMomentPublishViewController.h.backup | 22 - .../EPMomentPublishViewController.m.backup | 442 -- .../EPMomentViewController.h.backup | 20 - .../EPMomentViewController.m.backup | 195 - .../Services/EPEmotionColorStorage.h.backup | 58 - .../Services/EPEmotionColorStorage.m.backup | 118 - .../EPMomentAPISwiftHelper.swift.backup | 112 - .../Views/EPEmotionColorPicker.h.backup | 31 - .../Views/EPEmotionColorPicker.m.backup | 302 -- .../Views/EPEmotionColorWheelView.h.backup | 42 - .../Views/EPEmotionColorWheelView.m.backup | 147 - .../Moments/Views/EPEmotionInfoView.h.backup | 25 - .../Moments/Views/EPEmotionInfoView.m.backup | 213 - YuMi/E-P/Moments/Views/EPMomentCell.h.backup | 26 - YuMi/E-P/Moments/Views/EPMomentCell.m.backup | 564 --- .../Moments/Views/EPMomentListView.h.backup | 46 - .../Moments/Views/EPMomentListView.m.backup | 253 - .../Views/EPSignatureColorGuideView.h.backup | 36 - .../Views/EPSignatureColorGuideView.m.backup | 372 -- .../TabBar/EPTabBarController.swift.backup | 534 --- YuMi/Global/BuglyManagerExample.h.backup | 42 - YuMi/Global/BuglyManagerExample.m.backup | 79 - YuMi/Global/YUMIConstant.h.backup | 24 - YuMi/Global/YUMIConstant.m.backup | 21 - YuMi/Global/YUMIHtmlUrl.h.backup | 26 - YuMi/Global/YUMIHtmlUrl.m.backup | 43 - YuMi/Global/YUMINNNN.h.backup | 17 - YuMi/Modules/YMLogin/Api/Api+Login.h.backup | 117 - YuMi/Modules/YMLogin/Api/Api+Login.m.backup | 149 - .../View/NewLogin/PIUserSexView.h.backup | 17 - .../View/NewLogin/PIUserSexView.m.backup | 127 - .../XPForgetPwdViewController.h.backup | 16 - .../XPForgetPwdViewController.m.backup | 271 -- .../XPLoginAraeViewController.h.backup | 21 - .../XPLoginAraeViewController.m.backup | 191 - .../XPLoginAreaTableViewCell.h.backup | 24 - .../XPLoginAreaTableViewCell.m.backup | 88 - .../View/NewLogin/XPLoginAuthCodeVC.h.backup | 23 - .../View/NewLogin/XPLoginAuthCodeVC.m.backup | 165 - .../View/NewLogin/XPLoginInputView.h.backup | 37 - .../View/NewLogin/XPLoginInputView.m.backup | 168 - .../XPLoginPhoneViewController.h.backup | 16 - .../XPLoginPhoneViewController.m.backup | 430 -- .../XPLoginPwdViewController.h.backup | 16 - .../XPLoginPwdViewController.m.backup | 193 - .../Content/MessageContentUnSupport.m.backup | 20 - .../YMMine/Api/Api(GameOrder).h.backup | 16 - .../YMMine/Api/Api(GameOrder).m.backup | 12 - YuMi/Modules/YMMine/Api/Api+Mine.h.backup | 366 -- YuMi/Modules/YMMine/Api/Api+Mine.m.backup | 484 -- .../Api/Api+EnterpriseRecharge.m.backup | 40 - ...dalsCollectionViewCell_Refactored.m.backup | 214 - .../YMMonents/Api/Api+Moments.h.backup | 168 - .../YMMonents/Api/Api+Moments.m.backup | 268 -- .../YMMonents/Model/MomentsInfoModel.h.backup | 111 - .../YMMonents/Model/MomentsInfoModel.m.backup | 28 - .../Model/MomentsListInfoModel.h.backup | 19 - .../Model/MomentsListInfoModel.m.backup | 16 - .../View/Cell/XPBlankRoomModel.h.backup | 16 - .../View/Cell/XPBlankRoomModel.m.backup | 12 - .../BannerSchedulerTest.m.backup | 174 - .../Test/XPTextLayoutTest.h.backup | 41 - .../Test/XPTextLayoutTest.m.backup | 117 - .../XPTextLayoutTest.h.backup | 26 - .../XPTextLayoutTest.m.backup | 166 - .../XPRoomBackCleanMessagesAction.h.backup | 16 - .../RoomRank/ThemeColor+RoomRank.h.backup | 25 - .../RoomRank/ThemeColor+RoomRank.m.backup | 40 - .../Cell/XPRoomRankTableViewCell.m.backup | 173 - .../SubViews/XPRoomRankUserInfoView.m.backup | 224 - .../View/XPRoomRankViewController.m.backup | 234 - .../View/WishGift/Api/Api+WishGift.h.backup | 49 - .../View/WishGift/Api/Api+WishGift.m.backup | 85 - .../Model/WishGiftHistoryModel.h.backup | 21 - .../Model/WishGiftHistoryModel.m.backup | 15 - .../WishGift/Model/WishGiftInfoModel.h.backup | 42 - .../WishGift/Model/WishGiftInfoModel.m.backup | 13 - .../Model/WishGiftInfoUpdateModel.h.backup | 19 - .../Model/WishGiftInfoUpdateModel.m.backup | 15 - .../WishGift/Model/WishGiftUserModel.h.backup | 19 - .../WishGift/Model/WishGiftUserModel.m.backup | 12 - .../Presenter/XPWishGiftPresenter.h.backup | 31 - .../Presenter/XPWishGiftPresenter.m.backup | 65 - .../Protocol/XPWishGiftProtocol.h.backup | 35 - .../XPWishGiftEmptyTableViewCell.h.backup | 16 - .../XPWishGiftEmptyTableViewCell.m.backup | 73 - .../XPWishGiftHistoryTableViewCell.h.backup | 20 - .../XPWishGiftHistoryTableViewCell.m.backup | 173 - .../Cell/XPWishGiftTableViewCell.h.backup | 30 - .../Cell/XPWishGiftTableViewCell.m.backup | 235 - .../View/View/XPWishGiftEnterView.h.backup | 17 - .../View/View/XPWishGiftEnterView.m.backup | 245 - .../View/View/XPWishGiftInfoView.h.backup | 28 - .../View/View/XPWishGiftInfoView.m.backup | 245 - .../View/View/XPWishGiftListView.h.backup | 30 - .../View/View/XPWishGiftListView.m.backup | 259 - .../View/View/XPWishGiftSectionView.h.backup | 16 - .../View/View/XPWishGiftSectionView.m.backup | 55 - ...PWishGiftCreateItemViewController.h.backup | 29 - ...PWishGiftCreateItemViewController.m.backup | 522 -- .../XPWishGiftCreateViewController.h.backup | 16 - .../XPWishGiftCreateViewController.m.backup | 333 -- .../XPWishGiftHistoryViewController.h.backup | 16 - .../XPWishGiftHistoryViewController.m.backup | 162 - .../View/XPWishGiftViewController.h.backup | 29 - .../View/XPWishGiftViewController.m.backup | 375 -- YuMi/Modules/YMTabbar/Api/Api+Main.h.backup | 21 - YuMi/Modules/YMTabbar/Api/Api+Main.m.backup | 32 - YuMi/Modules/YMWeb/MSRoomGameWebVC.h.backup | 18 - YuMi/Modules/YMWeb/MSRoomGameWebVC.m.backup | 649 --- .../YMWeb/PIWebViewSavePhotoView.h.backup | 18 - .../YMWeb/PIWebViewSavePhotoView.m.backup | 180 - .../YMWeb/XPWebViewController.h.backup | 60 - .../YMWeb/XPWebViewController.m.backup | 1032 ---- YuMi/Modules/YMWeb/XPWebViewNavView.h.backup | 21 - YuMi/Modules/YMWeb/XPWebViewNavView.m.backup | 79 - YuMi/Network/HttpRequestHelper.h.backup | 64 - YuMi/Network/HttpRequestHelper.m.backup | 521 -- YuMi/Network/MSParamsDecode.h.backup | 21 - YuMi/Network/MSParamsDecode.m.backup | 64 - .../Base/BaseNavigationController.h.backup | 16 - .../Base/BaseNavigationController.m.backup | 85 - .../Base/BaseViewController.h.backup | 100 - .../Base/BaseViewController.m.backup | 198 - YuMi/Structure/MVP/Api/Api.h.backup | 103 - YuMi/Structure/MVP/Api/Api.m.backup | 158 - .../MVP/Model/AccountInfoStorage.h.backup | 40 - .../MVP/Model/AccountInfoStorage.m.backup | 171 - .../Structure/MVP/Model/AccountModel.h.backup | 31 - .../Structure/MVP/Model/AccountModel.m.backup | 15 - YuMi/Structure/MVP/Model/BaseModel.h.backup | 26 - YuMi/Structure/MVP/Model/BaseModel.m.backup | 12 - .../MVP/Model/NSObject+AutoCoding.h.backup | 25 - .../MVP/Model/NSObject+AutoCoding.m.backup | 245 - YuMi/Structure/MVP/Model/PIBaseModel.h.backup | 16 - YuMi/Structure/MVP/Model/PIBaseModel.m.backup | 36 - .../MVP/Model/UserInfoModel.h.backup | 203 - .../MVP/Model/UserInfoModel.m.backup | 76 - .../MVP/Presenter/BaseMvpPresenter.h.backup | 37 - .../MVP/Presenter/BaseMvpPresenter.m.backup | 137 - .../MVP/Protocol/BaseMvpProtocol.h.backup | 25 - .../MVP/View/MvpViewController.h.backup | 31 - .../MVP/View/MvpViewController.m.backup | 204 - .../Bundle/NSBundle+Localizable.h.backup | 20 - .../Bundle/NSBundle+Localizable.m.backup | 92 - YuMi/Tools/Bundle/YMLanguageConfig.h.backup | 31 - YuMi/Tools/Bundle/YMLanguageConfig.m.backup | 55 - YuMi/Tools/CountDown/CountDownHelper.h.backup | 48 - YuMi/Tools/CountDown/CountDownHelper.m.backup | 132 - YuMi/Tools/Date/NSDate+DateUtils.h.backup | 42 - YuMi/Tools/Date/NSDate+DateUtils.m.backup | 193 - YuMi/Tools/Date/NVDate.h.backup | 95 - YuMi/Tools/Date/NVDate.m.backup | 394 -- YuMi/Tools/Date/PLTimeUtil.h.backup | 59 - YuMi/Tools/Date/PLTimeUtil.m.backup | 307 -- YuMi/Tools/File/UploadFile.h.backup | 51 - YuMi/Tools/File/UploadFile.m.backup | 409 -- YuMi/Tools/File/UploadFileModel.h.backup | 25 - YuMi/Tools/File/UploadFileModel.m.backup | 12 - YuMi/Tools/GCDHelper/GCDHelper.h.backup | 11 - YuMi/Tools/GCDHelper/GCDHelper.m.backup | 16 - .../MJExtension/NSObject+MJExtension.h.backup | 43 - .../MJExtension/NSObject+MJExtension.m.backup | 64 - YuMi/Tools/MedalMediaDisplayManager.h.backup | 101 - YuMi/Tools/MedalMediaDisplayManager.m.backup | 328 -- YuMi/Tools/NSString/NSString+Utils.h.backup | 64 - YuMi/Tools/NSString/NSString+Utils.m.backup | 524 -- .../Reachability/YYReachability.h.backup | 109 - .../Reachability/YYReachability.m.backup | 527 --- .../SDBrowserImageView.h.backup | 27 - .../SDBrowserImageView.m.backup | 237 - .../SDPhotoBrowser/SDPhotoBrowser.h.backup | 39 - .../SDPhotoBrowser/SDPhotoBrowser.m.backup | 407 -- .../SDPhotoBrowserConfig.h.backup | 42 - .../SDPhotoBrowser/SDWaitingView.h.backup | 17 - .../SDPhotoBrowser/SDWaitingView.m.backup | 93 - YuMi/Tools/Safe/NSArray+Safe.h.backup | 16 - YuMi/Tools/Safe/NSArray+Safe.m.backup | 23 - YuMi/Tools/Safe/NSMutableArray+Safe.h.backup | 64 - YuMi/Tools/Safe/NSMutableArray+Safe.m.backup | 69 - .../Safe/NSMutableDictionary+Saft.h.backup | 16 - .../Safe/NSMutableDictionary+Saft.m.backup | 17 - YuMi/Tools/Security/AESUtils.h.backup | 19 - YuMi/Tools/Security/AESUtils.m.backup | 151 - YuMi/Tools/Security/Base64.h.backup | 16 - YuMi/Tools/Security/Base64.m.backup | 133 - YuMi/Tools/Security/DESEncrypt.h.backup | 16 - YuMi/Tools/Security/DESEncrypt.m.backup | 63 - YuMi/Tools/Timer/XPWeakTimer.h.backup | 24 - YuMi/Tools/Timer/XPWeakTimer.m.backup | 63 - YuMi/Tools/Timestamp/Timestamp.h.backup | 20 - YuMi/Tools/Timestamp/Timestamp.m.backup | 68 - YuMi/Tools/UILabel/UILabel+Utils.h.backup | 20 - YuMi/Tools/UILabel/UILabel+Utils.m.backup | 70 - .../3Party/fmdb/BSSDLayoutUtil.h.backup | 31 - .../3Party/fmdb/BSSDLayoutUtil.m.backup | 17 - .../catagory/Util/BSNSDictionary.h.backup | 39 - .../catagory/Util/BSNSDictionary.m.backup | 47 - .../catagory/Util/BSNSStringUtil.h.backup | 71 - .../catagory/Util/BSNSStringUtil.m.backup | 168 - .../catagory/Util/BSUIDemoUtil.h.backup | 17 - .../catagory/Util/BSUIDemoUtil.m.backup | 33 - .../catagory/Util/BSXWDateUtil.h.backup | 106 - .../catagory/Util/BSXWDateUtil.m.backup | 222 - .../catagory/Util/BS_UIColor.h.backup | 16 - .../catagory/Util/BS_UIColor.m.backup | 31 - .../catagory/system/BS_Define.h.backup | 32 - .../catagory/system/SystemUtil.h.backup | 18 - .../catagory/system/SystemUtil.m.backup | 35 - .../UILabel+YBAttributeTextTapAction.h.backup | 62 - .../UILabel+YBAttributeTextTapAction.m.backup | 396 -- .../BSFileOptionModel.h.backup | 32 - .../BSFileOptionModel.m.backup | 206 - .../sdkContent/content/K/BSDrawLine.h.backup | 90 - .../sdkContent/content/K/BSDrawLine.m.backup | 530 --- .../sdkContent/content/K/BSkObject.h.backup | 45 - .../sdkContent/content/K/BSkObject.m.backup | 14 - .../BSNetListenModel.h.backup | 60 - .../BSNetListenModel.m.backup | 263 -- .../BSLogNetDetailViewController.h.backup | 18 - .../BSLogNetDetailViewController.m.backup | 90 - .../BSLogTableViewController.h.backup | 13 - .../BSLogTableViewController.m.backup | 260 - .../RealTime(实时)/BSRealTextView.h.backup | 19 - .../RealTime(实时)/BSRealTextView.m.backup | 154 - .../RealTime(实时)/BSRealTimeView.h.backup | 20 - .../RealTime(实时)/BSRealTimeView.m.backup | 613 --- .../model/RealViewCellModel.h.backup | 45 - .../model/RealViewCellModel.m.backup | 13 - .../view/RealViewNetWorkCell_0.h.backup | 21 - .../view/RealViewNetWorkCell_0.m.backup | 154 - .../component(组件)/BSSelectView.h.backup | 29 - .../component(组件)/BSSelectView.m.backup | 71 - .../model/BSRecordModel.h.backup | 50 - .../model/BSRecordModel.m.backup | 89 - .../BSNotification.h.backup | 132 - .../BSNotification.m.backup | 193 - YuMi/YuMi-Bridging-Header.h.backup | 90 - YuMi/en.lproj/Localizable.strings | 20 + YuMi/en.lproj/Localizable.strings.backup | 4200 ----------------- YuMi/main.m.backup | 13 - 309 files changed, 20 insertions(+), 40874 deletions(-) delete mode 100644 YuMi/Appdelegate/AppDelegate.h.backup delete mode 100644 YuMi/Appdelegate/AppDelegate.m.backup delete mode 100644 YuMi/Config/APIConfig.swift.backup delete mode 100644 YuMi/CustomUI/DJDKMIMOMColor.h.backup delete mode 100644 YuMi/CustomUI/DJDKMIMOMColor.m.backup delete mode 100644 YuMi/CustomUI/TTPopup/Config/TTActionSheetConfig.h.backup delete mode 100644 YuMi/CustomUI/TTPopup/Config/TTActionSheetConfig.m.backup delete mode 100644 YuMi/CustomUI/TTPopup/Config/TTAlertButtonConfig.h.backup delete mode 100644 YuMi/CustomUI/TTPopup/Config/TTAlertButtonConfig.m.backup delete mode 100644 YuMi/CustomUI/TTPopup/Config/TTAlertConfig.h.backup delete mode 100644 YuMi/CustomUI/TTPopup/Config/TTAlertConfig.m.backup delete mode 100644 YuMi/CustomUI/TTPopup/Config/TTAlertMessageAttributedConfig.h.backup delete mode 100644 YuMi/CustomUI/TTPopup/Config/TTAlertMessageAttributedConfig.m.backup delete mode 100644 YuMi/CustomUI/TTPopup/Header/TTPopupConstants.h.backup delete mode 100644 YuMi/CustomUI/TTPopup/Manager/TTPopupManagerService.h.backup delete mode 100644 YuMi/CustomUI/TTPopup/Manager/TTPopupManagerService.m.backup delete mode 100644 YuMi/CustomUI/TTPopup/Manager/TTPopupManagerServiceProtocol.h.backup delete mode 100644 YuMi/CustomUI/TTPopup/Service/TTPopupService.h.backup delete mode 100644 YuMi/CustomUI/TTPopup/Service/TTPopupService.m.backup delete mode 100644 YuMi/CustomUI/TTPopup/Service/TTPopupServiceProtocol.h.backup delete mode 100644 YuMi/CustomUI/TTPopup/TTPopup.h.backup delete mode 100644 YuMi/CustomUI/TTPopup/TTPopup.m.backup delete mode 100644 YuMi/CustomUI/TTPopup/View/TTActionSheetView.h.backup delete mode 100644 YuMi/CustomUI/TTPopup/View/TTActionSheetView.m.backup delete mode 100644 YuMi/CustomUI/TTPopup/View/TTAlertView.h.backup delete mode 100644 YuMi/CustomUI/TTPopup/View/TTAlertView.m.backup delete mode 100644 YuMi/CustomUI/TTPopup/View/TTNewAlertView.h.backup delete mode 100644 YuMi/CustomUI/TTPopup/View/TTNewAlertView.m.backup delete mode 100644 YuMi/CustomUI/UIImage/UIImage+Utils.h.backup delete mode 100644 YuMi/CustomUI/UIImage/UIImage+Utils.m.backup delete mode 100644 YuMi/CustomUI/UIImageView/NetImageConfig.h.backup delete mode 100644 YuMi/CustomUI/UIImageView/NetImageConfig.m.backup delete mode 100644 YuMi/CustomUI/UIImageView/NetImageView.h.backup delete mode 100644 YuMi/CustomUI/UIImageView/NetImageView.m.backup delete mode 100644 YuMi/CustomUI/UIImageView/UIImageConstant.h.backup delete mode 100644 YuMi/CustomUI/UIImageView/UIImageConstant.m.backup delete mode 100644 YuMi/CustomUI/UIViewCorner/UIView+Corner.h.backup delete mode 100644 YuMi/CustomUI/UIViewCorner/UIView+Corner.m.backup delete mode 100644 YuMi/CustomUI/UIViewGradientLayer/UIView+GradientLayer.h.backup delete mode 100644 YuMi/CustomUI/UIViewGradientLayer/UIView+GradientLayer.m.backup delete mode 100755 YuMi/CustomUI/VagueImageView/UIImage+ImageEffects.h.backup delete mode 100755 YuMi/CustomUI/VagueImageView/UIImage+ImageEffects.m.backup delete mode 100644 YuMi/CustomUI/XCCurrentVCStackManager.h.backup delete mode 100644 YuMi/CustomUI/XCCurrentVCStackManager.m.backup delete mode 100644 YuMi/CustomUI/XNDJTDDLoadingTool.h.backup delete mode 100644 YuMi/CustomUI/XNDJTDDLoadingTool.m.backup delete mode 100644 YuMi/E-P/Common/EPImageUploader.swift.backup delete mode 100644 YuMi/E-P/Common/EPProgressHUD.swift.backup delete mode 100644 YuMi/E-P/Common/EPQCloudConfig.swift.backup delete mode 100644 YuMi/E-P/Common/EPSDKManager.swift.backup delete mode 100644 YuMi/E-P/Login/Controllers/EPLoginTypesViewController.swift.backup delete mode 100644 YuMi/E-P/Login/Controllers/EPLoginViewController.swift.backup delete mode 100644 YuMi/E-P/Login/Models/EPLoginBridge.swift.backup delete mode 100644 YuMi/E-P/Login/Models/EPLoginConfig.swift.backup delete mode 100644 YuMi/E-P/Login/Models/EPLoginState.swift.backup delete mode 100644 YuMi/E-P/Login/Services/EPLoginManager.swift.backup delete mode 100644 YuMi/E-P/Login/Services/EPLoginService.swift.backup delete mode 100644 YuMi/E-P/Login/Views/EPLoginButton.swift.backup delete mode 100644 YuMi/E-P/Login/Views/EPLoginInputView.swift.backup delete mode 100644 YuMi/E-P/Login/Views/EPPolicyLabel.swift.backup delete mode 100644 YuMi/E-P/Mine/Controllers/EPAboutUsViewController.swift.backup delete mode 100644 YuMi/E-P/Mine/Controllers/EPEditSettingViewController.swift.backup delete mode 100644 YuMi/E-P/Mine/Controllers/EPMineViewController.h.backup delete mode 100644 YuMi/E-P/Mine/Controllers/EPMineViewController.m.backup delete mode 100644 YuMi/E-P/Mine/Services/EPMineAPIHelper.h.backup delete mode 100644 YuMi/E-P/Mine/Services/EPMineAPIHelper.m.backup delete mode 100644 YuMi/E-P/Mine/Views/EPMineHeaderView.h.backup delete mode 100644 YuMi/E-P/Mine/Views/EPMineHeaderView.m.backup delete mode 100644 YuMi/E-P/Moments/Controllers/EPMomentPublishViewController.h.backup delete mode 100644 YuMi/E-P/Moments/Controllers/EPMomentPublishViewController.m.backup delete mode 100644 YuMi/E-P/Moments/Controllers/EPMomentViewController.h.backup delete mode 100644 YuMi/E-P/Moments/Controllers/EPMomentViewController.m.backup delete mode 100644 YuMi/E-P/Moments/Services/EPEmotionColorStorage.h.backup delete mode 100644 YuMi/E-P/Moments/Services/EPEmotionColorStorage.m.backup delete mode 100644 YuMi/E-P/Moments/Services/EPMomentAPISwiftHelper.swift.backup delete mode 100644 YuMi/E-P/Moments/Views/EPEmotionColorPicker.h.backup delete mode 100644 YuMi/E-P/Moments/Views/EPEmotionColorPicker.m.backup delete mode 100644 YuMi/E-P/Moments/Views/EPEmotionColorWheelView.h.backup delete mode 100644 YuMi/E-P/Moments/Views/EPEmotionColorWheelView.m.backup delete mode 100644 YuMi/E-P/Moments/Views/EPEmotionInfoView.h.backup delete mode 100644 YuMi/E-P/Moments/Views/EPEmotionInfoView.m.backup delete mode 100644 YuMi/E-P/Moments/Views/EPMomentCell.h.backup delete mode 100644 YuMi/E-P/Moments/Views/EPMomentCell.m.backup delete mode 100644 YuMi/E-P/Moments/Views/EPMomentListView.h.backup delete mode 100644 YuMi/E-P/Moments/Views/EPMomentListView.m.backup delete mode 100644 YuMi/E-P/Moments/Views/EPSignatureColorGuideView.h.backup delete mode 100644 YuMi/E-P/Moments/Views/EPSignatureColorGuideView.m.backup delete mode 100644 YuMi/E-P/TabBar/EPTabBarController.swift.backup delete mode 100644 YuMi/Global/BuglyManagerExample.h.backup delete mode 100644 YuMi/Global/BuglyManagerExample.m.backup delete mode 100644 YuMi/Global/YUMIConstant.h.backup delete mode 100644 YuMi/Global/YUMIConstant.m.backup delete mode 100644 YuMi/Global/YUMIHtmlUrl.h.backup delete mode 100644 YuMi/Global/YUMIHtmlUrl.m.backup delete mode 100644 YuMi/Global/YUMINNNN.h.backup delete mode 100644 YuMi/Modules/YMLogin/Api/Api+Login.h.backup delete mode 100644 YuMi/Modules/YMLogin/Api/Api+Login.m.backup delete mode 100644 YuMi/Modules/YMLogin/View/NewLogin/PIUserSexView.h.backup delete mode 100644 YuMi/Modules/YMLogin/View/NewLogin/PIUserSexView.m.backup delete mode 100644 YuMi/Modules/YMLogin/View/NewLogin/XPForgetPwdViewController.h.backup delete mode 100644 YuMi/Modules/YMLogin/View/NewLogin/XPForgetPwdViewController.m.backup delete mode 100644 YuMi/Modules/YMLogin/View/NewLogin/XPLoginAraeViewController.h.backup delete mode 100644 YuMi/Modules/YMLogin/View/NewLogin/XPLoginAraeViewController.m.backup delete mode 100644 YuMi/Modules/YMLogin/View/NewLogin/XPLoginAreaTableViewCell.h.backup delete mode 100644 YuMi/Modules/YMLogin/View/NewLogin/XPLoginAreaTableViewCell.m.backup delete mode 100644 YuMi/Modules/YMLogin/View/NewLogin/XPLoginAuthCodeVC.h.backup delete mode 100644 YuMi/Modules/YMLogin/View/NewLogin/XPLoginAuthCodeVC.m.backup delete mode 100644 YuMi/Modules/YMLogin/View/NewLogin/XPLoginInputView.h.backup delete mode 100644 YuMi/Modules/YMLogin/View/NewLogin/XPLoginInputView.m.backup delete mode 100644 YuMi/Modules/YMLogin/View/NewLogin/XPLoginPhoneViewController.h.backup delete mode 100644 YuMi/Modules/YMLogin/View/NewLogin/XPLoginPhoneViewController.m.backup delete mode 100644 YuMi/Modules/YMLogin/View/NewLogin/XPLoginPwdViewController.h.backup delete mode 100644 YuMi/Modules/YMLogin/View/NewLogin/XPLoginPwdViewController.m.backup delete mode 100644 YuMi/Modules/YMMessage/View/Session/Content/MessageContentUnSupport.m.backup delete mode 100644 YuMi/Modules/YMMine/Api/Api(GameOrder).h.backup delete mode 100644 YuMi/Modules/YMMine/Api/Api(GameOrder).m.backup delete mode 100644 YuMi/Modules/YMMine/Api/Api+Mine.h.backup delete mode 100644 YuMi/Modules/YMMine/Api/Api+Mine.m.backup delete mode 100644 YuMi/Modules/YMMine/View/EnterpriseRecharge/Api/Api+EnterpriseRecharge.m.backup delete mode 100644 YuMi/Modules/YMMine/View/Medals/MedalsCollectionViewCell_Refactored.m.backup delete mode 100644 YuMi/Modules/YMMonents/Api/Api+Moments.h.backup delete mode 100644 YuMi/Modules/YMMonents/Api/Api+Moments.m.backup delete mode 100644 YuMi/Modules/YMMonents/Model/MomentsInfoModel.h.backup delete mode 100644 YuMi/Modules/YMMonents/Model/MomentsInfoModel.m.backup delete mode 100644 YuMi/Modules/YMMonents/Model/MomentsListInfoModel.h.backup delete mode 100644 YuMi/Modules/YMMonents/Model/MomentsListInfoModel.m.backup delete mode 100644 YuMi/Modules/YMNewHome/View/Cell/XPBlankRoomModel.h.backup delete mode 100644 YuMi/Modules/YMNewHome/View/Cell/XPBlankRoomModel.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/AnimationView/BannerSchedulerTest.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/MessageContainerView/Test/XPTextLayoutTest.h.backup delete mode 100644 YuMi/Modules/YMRoom/View/MessageContainerView/Test/XPTextLayoutTest.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/MessageContainerView/XPTextLayoutTest.h.backup delete mode 100644 YuMi/Modules/YMRoom/View/MessageContainerView/XPTextLayoutTest.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomBackCleanMessagesAction.h.backup delete mode 100644 YuMi/Modules/YMRoom/View/RoomRank/ThemeColor+RoomRank.h.backup delete mode 100644 YuMi/Modules/YMRoom/View/RoomRank/ThemeColor+RoomRank.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/RoomRank/View/Cell/XPRoomRankTableViewCell.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/RoomRank/View/SubViews/XPRoomRankUserInfoView.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/RoomRank/View/XPRoomRankViewController.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/Api/Api+WishGift.h.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/Api/Api+WishGift.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftHistoryModel.h.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftHistoryModel.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftInfoModel.h.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftInfoModel.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftInfoUpdateModel.h.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftInfoUpdateModel.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftUserModel.h.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftUserModel.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/Presenter/XPWishGiftPresenter.h.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/Presenter/XPWishGiftPresenter.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/Protocol/XPWishGiftProtocol.h.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftEmptyTableViewCell.h.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftEmptyTableViewCell.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftHistoryTableViewCell.h.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftHistoryTableViewCell.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftTableViewCell.h.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftTableViewCell.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftEnterView.h.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftEnterView.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftInfoView.h.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftInfoView.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftListView.h.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftListView.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftSectionView.h.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftSectionView.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftCreateItemViewController.h.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftCreateItemViewController.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftCreateViewController.h.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftCreateViewController.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftHistoryViewController.h.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftHistoryViewController.m.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftViewController.h.backup delete mode 100644 YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftViewController.m.backup delete mode 100644 YuMi/Modules/YMTabbar/Api/Api+Main.h.backup delete mode 100644 YuMi/Modules/YMTabbar/Api/Api+Main.m.backup delete mode 100644 YuMi/Modules/YMWeb/MSRoomGameWebVC.h.backup delete mode 100644 YuMi/Modules/YMWeb/MSRoomGameWebVC.m.backup delete mode 100644 YuMi/Modules/YMWeb/PIWebViewSavePhotoView.h.backup delete mode 100644 YuMi/Modules/YMWeb/PIWebViewSavePhotoView.m.backup delete mode 100644 YuMi/Modules/YMWeb/XPWebViewController.h.backup delete mode 100644 YuMi/Modules/YMWeb/XPWebViewController.m.backup delete mode 100644 YuMi/Modules/YMWeb/XPWebViewNavView.h.backup delete mode 100644 YuMi/Modules/YMWeb/XPWebViewNavView.m.backup delete mode 100644 YuMi/Network/HttpRequestHelper.h.backup delete mode 100644 YuMi/Network/HttpRequestHelper.m.backup delete mode 100644 YuMi/Network/MSParamsDecode.h.backup delete mode 100644 YuMi/Network/MSParamsDecode.m.backup delete mode 100644 YuMi/Structure/Base/BaseNavigationController.h.backup delete mode 100644 YuMi/Structure/Base/BaseNavigationController.m.backup delete mode 100644 YuMi/Structure/Base/BaseViewController.h.backup delete mode 100644 YuMi/Structure/Base/BaseViewController.m.backup delete mode 100644 YuMi/Structure/MVP/Api/Api.h.backup delete mode 100644 YuMi/Structure/MVP/Api/Api.m.backup delete mode 100644 YuMi/Structure/MVP/Model/AccountInfoStorage.h.backup delete mode 100644 YuMi/Structure/MVP/Model/AccountInfoStorage.m.backup delete mode 100644 YuMi/Structure/MVP/Model/AccountModel.h.backup delete mode 100644 YuMi/Structure/MVP/Model/AccountModel.m.backup delete mode 100644 YuMi/Structure/MVP/Model/BaseModel.h.backup delete mode 100644 YuMi/Structure/MVP/Model/BaseModel.m.backup delete mode 100644 YuMi/Structure/MVP/Model/NSObject+AutoCoding.h.backup delete mode 100644 YuMi/Structure/MVP/Model/NSObject+AutoCoding.m.backup delete mode 100644 YuMi/Structure/MVP/Model/PIBaseModel.h.backup delete mode 100644 YuMi/Structure/MVP/Model/PIBaseModel.m.backup delete mode 100644 YuMi/Structure/MVP/Model/UserInfoModel.h.backup delete mode 100644 YuMi/Structure/MVP/Model/UserInfoModel.m.backup delete mode 100644 YuMi/Structure/MVP/Presenter/BaseMvpPresenter.h.backup delete mode 100644 YuMi/Structure/MVP/Presenter/BaseMvpPresenter.m.backup delete mode 100644 YuMi/Structure/MVP/Protocol/BaseMvpProtocol.h.backup delete mode 100644 YuMi/Structure/MVP/View/MvpViewController.h.backup delete mode 100644 YuMi/Structure/MVP/View/MvpViewController.m.backup delete mode 100644 YuMi/Tools/Bundle/NSBundle+Localizable.h.backup delete mode 100644 YuMi/Tools/Bundle/NSBundle+Localizable.m.backup delete mode 100644 YuMi/Tools/Bundle/YMLanguageConfig.h.backup delete mode 100644 YuMi/Tools/Bundle/YMLanguageConfig.m.backup delete mode 100644 YuMi/Tools/CountDown/CountDownHelper.h.backup delete mode 100644 YuMi/Tools/CountDown/CountDownHelper.m.backup delete mode 100644 YuMi/Tools/Date/NSDate+DateUtils.h.backup delete mode 100644 YuMi/Tools/Date/NSDate+DateUtils.m.backup delete mode 100644 YuMi/Tools/Date/NVDate.h.backup delete mode 100644 YuMi/Tools/Date/NVDate.m.backup delete mode 100644 YuMi/Tools/Date/PLTimeUtil.h.backup delete mode 100644 YuMi/Tools/Date/PLTimeUtil.m.backup delete mode 100644 YuMi/Tools/File/UploadFile.h.backup delete mode 100644 YuMi/Tools/File/UploadFile.m.backup delete mode 100644 YuMi/Tools/File/UploadFileModel.h.backup delete mode 100644 YuMi/Tools/File/UploadFileModel.m.backup delete mode 100644 YuMi/Tools/GCDHelper/GCDHelper.h.backup delete mode 100644 YuMi/Tools/GCDHelper/GCDHelper.m.backup delete mode 100644 YuMi/Tools/MJExtension/NSObject+MJExtension.h.backup delete mode 100644 YuMi/Tools/MJExtension/NSObject+MJExtension.m.backup delete mode 100644 YuMi/Tools/MedalMediaDisplayManager.h.backup delete mode 100644 YuMi/Tools/MedalMediaDisplayManager.m.backup delete mode 100644 YuMi/Tools/NSString/NSString+Utils.h.backup delete mode 100644 YuMi/Tools/NSString/NSString+Utils.m.backup delete mode 100644 YuMi/Tools/Reachability/YYReachability.h.backup delete mode 100644 YuMi/Tools/Reachability/YYReachability.m.backup delete mode 100755 YuMi/Tools/SDPhotoBrowser/SDBrowserImageView.h.backup delete mode 100755 YuMi/Tools/SDPhotoBrowser/SDBrowserImageView.m.backup delete mode 100755 YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.h.backup delete mode 100755 YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.m.backup delete mode 100755 YuMi/Tools/SDPhotoBrowser/SDPhotoBrowserConfig.h.backup delete mode 100755 YuMi/Tools/SDPhotoBrowser/SDWaitingView.h.backup delete mode 100755 YuMi/Tools/SDPhotoBrowser/SDWaitingView.m.backup delete mode 100644 YuMi/Tools/Safe/NSArray+Safe.h.backup delete mode 100644 YuMi/Tools/Safe/NSArray+Safe.m.backup delete mode 100644 YuMi/Tools/Safe/NSMutableArray+Safe.h.backup delete mode 100644 YuMi/Tools/Safe/NSMutableArray+Safe.m.backup delete mode 100644 YuMi/Tools/Safe/NSMutableDictionary+Saft.h.backup delete mode 100644 YuMi/Tools/Safe/NSMutableDictionary+Saft.m.backup delete mode 100644 YuMi/Tools/Security/AESUtils.h.backup delete mode 100644 YuMi/Tools/Security/AESUtils.m.backup delete mode 100644 YuMi/Tools/Security/Base64.h.backup delete mode 100644 YuMi/Tools/Security/Base64.m.backup delete mode 100644 YuMi/Tools/Security/DESEncrypt.h.backup delete mode 100644 YuMi/Tools/Security/DESEncrypt.m.backup delete mode 100644 YuMi/Tools/Timer/XPWeakTimer.h.backup delete mode 100644 YuMi/Tools/Timer/XPWeakTimer.m.backup delete mode 100644 YuMi/Tools/Timestamp/Timestamp.h.backup delete mode 100644 YuMi/Tools/Timestamp/Timestamp.m.backup delete mode 100644 YuMi/Tools/UILabel/UILabel+Utils.h.backup delete mode 100644 YuMi/Tools/UILabel/UILabel+Utils.m.backup delete mode 100644 YuMi/Tools/sdkContent/catagory/3Party/fmdb/BSSDLayoutUtil.h.backup delete mode 100644 YuMi/Tools/sdkContent/catagory/3Party/fmdb/BSSDLayoutUtil.m.backup delete mode 100644 YuMi/Tools/sdkContent/catagory/Util/BSNSDictionary.h.backup delete mode 100644 YuMi/Tools/sdkContent/catagory/Util/BSNSDictionary.m.backup delete mode 100644 YuMi/Tools/sdkContent/catagory/Util/BSNSStringUtil.h.backup delete mode 100644 YuMi/Tools/sdkContent/catagory/Util/BSNSStringUtil.m.backup delete mode 100644 YuMi/Tools/sdkContent/catagory/Util/BSUIDemoUtil.h.backup delete mode 100644 YuMi/Tools/sdkContent/catagory/Util/BSUIDemoUtil.m.backup delete mode 100644 YuMi/Tools/sdkContent/catagory/Util/BSXWDateUtil.h.backup delete mode 100644 YuMi/Tools/sdkContent/catagory/Util/BSXWDateUtil.m.backup delete mode 100644 YuMi/Tools/sdkContent/catagory/Util/BS_UIColor.h.backup delete mode 100644 YuMi/Tools/sdkContent/catagory/Util/BS_UIColor.m.backup delete mode 100644 YuMi/Tools/sdkContent/catagory/system/BS_Define.h.backup delete mode 100644 YuMi/Tools/sdkContent/catagory/system/SystemUtil.h.backup delete mode 100644 YuMi/Tools/sdkContent/catagory/system/SystemUtil.m.backup delete mode 100755 YuMi/Tools/sdkContent/catagory/system/UILabel+YBAttributeTextTapAction.h.backup delete mode 100755 YuMi/Tools/sdkContent/catagory/system/UILabel+YBAttributeTextTapAction.m.backup delete mode 100644 YuMi/Tools/sdkContent/content/FileOption(文件操作)/BSFileOptionModel.h.backup delete mode 100644 YuMi/Tools/sdkContent/content/FileOption(文件操作)/BSFileOptionModel.m.backup delete mode 100644 YuMi/Tools/sdkContent/content/K/BSDrawLine.h.backup delete mode 100644 YuMi/Tools/sdkContent/content/K/BSDrawLine.m.backup delete mode 100644 YuMi/Tools/sdkContent/content/K/BSkObject.h.backup delete mode 100644 YuMi/Tools/sdkContent/content/K/BSkObject.m.backup delete mode 100644 YuMi/Tools/sdkContent/content/NetListen(网络监听)/BSNetListenModel.h.backup delete mode 100644 YuMi/Tools/sdkContent/content/NetListen(网络监听)/BSNetListenModel.m.backup delete mode 100644 YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSLogNetDetailViewController.h.backup delete mode 100644 YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSLogNetDetailViewController.m.backup delete mode 100644 YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSLogTableViewController.h.backup delete mode 100644 YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSLogTableViewController.m.backup delete mode 100644 YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSRealTextView.h.backup delete mode 100644 YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSRealTextView.m.backup delete mode 100644 YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSRealTimeView.h.backup delete mode 100644 YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSRealTimeView.m.backup delete mode 100644 YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/model/RealViewCellModel.h.backup delete mode 100644 YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/model/RealViewCellModel.m.backup delete mode 100644 YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/view/RealViewNetWorkCell_0.h.backup delete mode 100644 YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/view/RealViewNetWorkCell_0.m.backup delete mode 100644 YuMi/Tools/sdkContent/content/NetListen(网络监听)/component(组件)/BSSelectView.h.backup delete mode 100644 YuMi/Tools/sdkContent/content/NetListen(网络监听)/component(组件)/BSSelectView.m.backup delete mode 100644 YuMi/Tools/sdkContent/content/NetListen(网络监听)/model/BSRecordModel.h.backup delete mode 100644 YuMi/Tools/sdkContent/content/NetListen(网络监听)/model/BSRecordModel.m.backup delete mode 100644 YuMi/Tools/sdkContent/content/XWNotification(通知)/BSNotification.h.backup delete mode 100644 YuMi/Tools/sdkContent/content/XWNotification(通知)/BSNotification.m.backup delete mode 100644 YuMi/YuMi-Bridging-Header.h.backup delete mode 100644 YuMi/en.lproj/Localizable.strings.backup delete mode 100644 YuMi/main.m.backup diff --git a/YuMi/Appdelegate/AppDelegate.h.backup b/YuMi/Appdelegate/AppDelegate.h.backup deleted file mode 100644 index d4ddd22..0000000 --- a/YuMi/Appdelegate/AppDelegate.h.backup +++ /dev/null @@ -1,15 +0,0 @@ -// -// AppDelegate.h -// YUMI -// -// Created by admin on 2023/3/9. -// - -#import - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end - diff --git a/YuMi/Appdelegate/AppDelegate.m.backup b/YuMi/Appdelegate/AppDelegate.m.backup deleted file mode 100644 index 231713c..0000000 --- a/YuMi/Appdelegate/AppDelegate.m.backup +++ /dev/null @@ -1,176 +0,0 @@ -// -// AppDelegate.m -// YUMI -// -// Created by admin on 2023/3/9. -// - - -#import "AppDelegate.h" - -#import "BaseNavigationController.h" -#import -#import "YuMi-swift.h" - -UIKIT_EXTERN NSString * const kOpenRoomNotification; - -@interface AppDelegate () - -@end - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - - self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - - UIStoryboard *launchStoryboard = [UIStoryboard storyboardWithName:@"Launch Screen" bundle:nil]; - UIViewController *launchScreenVC = [launchStoryboard instantiateInitialViewController]; - self.window.rootViewController = launchScreenVC; - [self.window makeKeyAndVisible]; - - [self loadMainPage]; - - if (@available(iOS 15, *)) { - [[UITableView appearance] setSectionHeaderTopPadding:0]; - } - - return YES; -} - -// MARK: - Helper Methods - -/// 获取 keyWindow(iOS 13+ 兼容) -- (UIWindow *)getKeyWindow { - // iOS 13+ 使用 connectedScenes 获取 window - if (@available(iOS 13.0, *)) { - for (UIWindowScene *scene in [UIApplication sharedApplication].connectedScenes) { - if (scene.activationState == UISceneActivationStateForegroundActive) { - for (UIWindow *window in scene.windows) { - if (window.isKeyWindow) { - return window; - } - } - // 如果没有 keyWindow,返回第一个 window - return scene.windows.firstObject; - } - } - } - - // iOS 13 以下,使用旧方法(已废弃但仍然可用) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - return [UIApplication sharedApplication].keyWindow; -#pragma clang diagnostic pop -} - - -- (void)loadMainPage { - AccountModel *accountModel = [[AccountInfoStorage instance] getCurrentAccountInfo]; - if (accountModel == nil || - accountModel.uid == nil || - accountModel.access_token == nil) { - [self toLoginPage]; - }else{ - [self toHomeTabbarPage]; - - // 延迟检查专属颜色(等待 window 初始化完成) - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.8 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [self checkAndShowSignatureColorGuide]; - }); - } -} - -/// 检查并显示专属颜色引导页 -- (void)checkAndShowSignatureColorGuide { - UIWindow *keyWindow = [self getKeyWindow]; - if (!keyWindow) return; - - BOOL hasSignatureColor = [EPEmotionColorStorage hasUserSignatureColor]; - -#if DEBUG - // Debug 环境:总是显示引导页 - NSLog(@"[AppDelegate] Debug 模式:显示专属颜色引导页(已有颜色: %@)", hasSignatureColor ? @"YES" : @"NO"); - - EPSignatureColorGuideView *guideView = [[EPSignatureColorGuideView alloc] init]; - - // 设置颜色确认回调 - guideView.onColorConfirmed = ^(NSString *hexColor) { - [EPEmotionColorStorage saveUserSignatureColor:hexColor]; - NSLog(@"[AppDelegate] 用户选择专属颜色: %@", hexColor); - }; - - // 如果已有颜色,设置 Skip 回调 - if (hasSignatureColor) { - guideView.onSkipTapped = ^{ - NSLog(@"[AppDelegate] 用户跳过专属颜色选择"); - }; - } - - // 显示引导页,已有颜色时显示 Skip 按钮 - [guideView showInWindow:keyWindow showSkipButton:hasSignatureColor]; - -#else - // Release 环境:仅在未设置专属颜色时显示 - if (!hasSignatureColor) { - EPSignatureColorGuideView *guideView = [[EPSignatureColorGuideView alloc] init]; - guideView.onColorConfirmed = ^(NSString *hexColor) { - [EPEmotionColorStorage saveUserSignatureColor:hexColor]; - NSLog(@"[AppDelegate] 用户选择专属颜色: %@", hexColor); - }; - [guideView showInWindow:keyWindow]; - } -#endif -} - -- (void)toLoginPage { - // 使用新的 Swift 登录页面 - EPLoginViewController *lvc = [[EPLoginViewController alloc] init]; - BaseNavigationController *navigationController = - [[BaseNavigationController alloc] initWithRootViewController:lvc]; - navigationController.modalPresentationStyle = UIModalPresentationFullScreen; - self.window.rootViewController = navigationController; -} - -- (void)toHomeTabbarPage { - EPTabBarController *epTabBar = [EPTabBarController create]; - [epTabBar refreshTabBarWithIsLogin:YES]; - - UIWindow *window = [self getKeyWindow]; - if (window) { - window.rootViewController = epTabBar; - [window makeKeyAndVisible]; - } -} - - -- (void)applicationDidBecomeActive:(UIApplication *)application { - [self getAdvertisingTrackingAuthority]; - [[NSNotificationCenter defaultCenter]postNotificationName:@"kAppDidBecomeActive" object:nil]; -} - -- (void)getAdvertisingTrackingAuthority { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - if (@available(iOS 14, *)) { - ATTrackingManagerAuthorizationStatus status = ATTrackingManager.trackingAuthorizationStatus; - switch (status) { - case ATTrackingManagerAuthorizationStatusDenied: - break; - case ATTrackingManagerAuthorizationStatusAuthorized: - break; - case ATTrackingManagerAuthorizationStatusNotDetermined: { -// NSLog(@"用户未做选择或未弹窗IDFA"); - //请求弹出用户授权框,只会在程序运行是弹框1次,除非卸载app重装,通地图、相机等权限弹框一样 - [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) { -// NSLog(@"app追踪IDFA权限:%lu",(unsigned long)status); - }]; - } - break; - default: - break; - } - } - }); -} - -@end diff --git a/YuMi/Config/APIConfig.swift.backup b/YuMi/Config/APIConfig.swift.backup deleted file mode 100644 index 8ba49c3..0000000 --- a/YuMi/Config/APIConfig.swift.backup +++ /dev/null @@ -1,110 +0,0 @@ -// -// APIConfig.swift -// YuMi -// -// Created by AI on 2025-10-09. -// Copyright © 2025 YuMi. All rights reserved. -// - -import Foundation - -/// API 域名配置类 -/// 使用 XOR + Base64 双重混淆防止反编译 -@objc class APIConfig: NSObject { - - // MARK: - Private Properties - - /// XOR 加密密钥 - private static let xorKey: UInt8 = 77 - - /// RELEASE 环境域名(加密后) - /// 原始域名:https://api.epartylive.com - private static let releaseEncodedParts: [String] = [ - "JTk5PT53YmI=", // https:// (XOR 后 Base64) - "LD0kYw==", // api. (XOR 后 Base64) - "KD0sPzk0ISQ7KGMuIiA=", // epartylive.com (XOR 后 Base64) - ] - - // MARK: - Public Methods - - /// 获取 API 基础域名 - /// - Returns: 根据编译环境返回对应的域名 - @objc static func baseURL() -> String { - #if DEBUG - // DEV 环境:临时使用硬编码(等 Bridging 修复后再改回 HttpRequestHelper) - // TODO: 修复后改为 return HttpRequestHelper.getHostUrl() - return getDevBaseURL() - #else - // RELEASE 环境:使用动态生成的新域名 - let url = decodeURL(from: releaseEncodedParts) - - // 验证解密结果 - if url.isEmpty || !url.hasPrefix("http") { - NSLog("[APIConfig] 警告:域名解密失败,使用备用域名") - return backupURL() - } - - return url - #endif - } - - /// 获取 DEV 环境域名(临时方案) - /// - Returns: DEV 域名 - private static func getDevBaseURL() -> String { - // 从 UserDefaults 读取(原 HttpRequestHelper 的逻辑) - #if DEBUG - let isProduction = UserDefaults.standard.string(forKey: "kIsProductionEnvironment") - if isProduction == "YES" { - return "https://api.epartylive.com" // 正式环境 - } else { - return "https://test-api.yourdomain.com" // 测试环境(请替换为实际测试域名) - } - #else - return "https://api.epartylive.com" - #endif - } - - /// 备用域名(降级方案) - /// - Returns: 原域名(仅在解密失败时使用) - @objc static func backupURL() -> String { - return getDevBaseURL() - } - - // MARK: - Private Methods - - /// 解密域名 - /// - Parameter parts: 加密后的域名片段数组 - /// - Returns: 解密后的完整域名 - private static func decodeURL(from parts: [String]) -> String { - let decoded = parts.compactMap { part -> String? in - guard let data = Data(base64Encoded: part) else { - NSLog("[APIConfig] Base64 解码失败: \(part)") - return nil - } - let xored = data.map { $0 ^ xorKey } - return String(bytes: xored, encoding: .utf8) - } - - let result = decoded.joined() - - #if DEBUG - NSLog("[APIConfig] 解密后的域名: \(result)") - #endif - - return result - } -} - -// MARK: - Debug Helper - -#if DEBUG -extension APIConfig { - /// 测试方法:验证域名加密/解密是否正常 - @objc static func testEncryption() { - print("=== APIConfig 加密测试 ===") - print("Release 域名: \(decodeURL(from: releaseEncodedParts))") - print("当前环境域名: \(baseURL())") - print("备用域名: \(backupURL())") - } -} -#endif diff --git a/YuMi/CustomUI/DJDKMIMOMColor.h.backup b/YuMi/CustomUI/DJDKMIMOMColor.h.backup deleted file mode 100644 index ec898b0..0000000 --- a/YuMi/CustomUI/DJDKMIMOMColor.h.backup +++ /dev/null @@ -1,79 +0,0 @@ -// -// DJDKMIMOMColor.h -// YUMI -// -// Created by YUMI on 2021/9/9. -// - -#import - -#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] - -#define UIColorRGBAlpha(rgbValue,a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:(a)] -NS_ASSUME_NONNULL_BEGIN - -@interface DJDKMIMOMColor : NSObject -/// 主题色0x9682FF -+ (UIColor *)appMainColor; -///强调色 #248CFE -+ (UIColor *)appEmphasizeColor; -///强调色1 0xBF36FF -+ (UIColor *)appEmphasizeColor1; -///强调色2 0xFB486A -+ (UIColor *)appEmphasizeColor2; -/* ------页面相关颜色 START------ */ -/// view的背景色 0xF3F5FA -+ (UIColor *)appBackgroundColor; -/// cell的背景色 0xFFFFFF -+ (UIColor *)appCellBackgroundColor; -///正文颜色 0x333333 -+ (UIColor *)mainTextColor; -/// 二级文字颜色 0x666666 -+ (UIColor *)secondTextColor; -///三级文字的颜色 0x999999 -+ (UIColor *)textThirdColor; -///分割线的颜色 0xE8E8E8 -+ (UIColor *)dividerColor; -/* ------页面相关颜色 END------ */ - -/* ------Button 相关颜色 START------ */ -/// button 可用 渐变色的开始 0xFFA936 -+ (UIColor *)confirmButtonGradientStartColor; -/// button 可用 渐变色的中间 #9CB3FF -+ (UIColor *)confirmButtonGradientMiddleColor; -/// button 可用 渐变色的开始 0xFFCB47 -+ (UIColor *)confirmButtonGradientEndColor; -/// 确定的按钮文字颜色 #FFFFFF -+ (UIColor *)confirmButtonTextColor; -/// 取消按钮 渐变色的开始 0xF7DDBF -+ (UIColor *)cancelButtonGradientStartColor; -/// 取消按钮 渐变色的结束 0xF7E8C4 -+ (UIColor *)cancelButtonGradientEndColor; -/// 取消的按钮文字颜色 0xFFA936 -+ (UIColor *)cancelButtonTextColor; -/// 取消按钮单一普通背景色 0xFFCE4E -+ (UIColor *)cancelButtonNormalBgColor; -/// 按钮不可点击背景色 0xD2D5D7 -+ (UIColor *)disableButtonColor; -/// 按钮不可点击文字颜色 0xF9F9F9 -+ (UIColor *)disableButtonTextColor; -/* ------Button 相关颜色 END------ */ - -/* ------弹窗相关颜色 START------ */ -+ (UIColor *)alertBackgroundColor; -+ (UIColor *)alertTitleColor; -+ (UIColor *)alertMessageColor; -+ (UIColor *)actionSeparatorColor; -/* ------弹窗相关颜色 END------ */ - -///tabbar 没有点击的时候颜色 0x333333, 0.4 -+ (UIColor *)tabbarNormalColor; -/// tabbar的View的color 0xFFFFFF -+ (UIColor *)tabbarViewColor; - -+ (UIColor *)colorWithHexString:(NSString *)hexString; - -+ (UIColor *)inputTextColor; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/CustomUI/DJDKMIMOMColor.m.backup b/YuMi/CustomUI/DJDKMIMOMColor.m.backup deleted file mode 100644 index e7e84d9..0000000 --- a/YuMi/CustomUI/DJDKMIMOMColor.m.backup +++ /dev/null @@ -1,177 +0,0 @@ -// -// DJDKMIMOMColor.m -// YUMI -// -// Created by YUMI on 2021/9/9. -// - -#import "DJDKMIMOMColor.h" - -@implementation DJDKMIMOMColor -/// 主题色0x9682FF -+ (UIColor *)appMainColor { - return UIColorFromRGB(0x9682FF); -} - -///强调色 #248CFE -+ (UIColor *)appEmphasizeColor { - return UIColorFromRGB(0x248CFE); -} - -///强调色1 0xBF36FF -+ (UIColor *)appEmphasizeColor1 { - return UIColorFromRGB(0xBF36FF); -} - -///强调色2 0xFB486A -+ (UIColor *)appEmphasizeColor2 { - return UIColorFromRGB(0xFB486A); -} - -/* ------页面相关颜色 START------ */ -/// view的背景色 0xF3F5FA -+ (UIColor *)appBackgroundColor { - return UIColorFromRGB(0xF3F5FA); -} -/// cell的背景色 0xFFFFFF -+ (UIColor *)appCellBackgroundColor { - return UIColorFromRGB(0xFFFFFF); -} -///正文颜色 0x333333 -+ (UIColor *)mainTextColor { - return UIColorFromRGB(0x161958); -} -/// 二级文字颜色 0x666666 -+ (UIColor *)secondTextColor { - return UIColorFromRGB(0x8A8CAB); -} -///三级文字的颜色 0x999999 -+ (UIColor *)textThirdColor { - return UIColorFromRGB(0xBABBCD); -} -///分割线的颜色 0xE8E8E8 -+ (UIColor *)dividerColor { - return UIColorFromRGB(0xE8E8E8); -} -/* ------页面相关颜色 END------ */ - -/* ------Button 相关颜色 START------ */ -/// button 可用 渐变色的开始 0x3CAAFF -+ (UIColor *)confirmButtonGradientStartColor { - return UIColorFromRGB(0x13E2F5); -} -/// button 可用 渐变色的开始 0xB176FF -+ (UIColor *)confirmButtonGradientEndColor { - return UIColorFromRGB(0xCC66FF); -} -/// 确定的按钮文字颜色 #FFFFFF -+ (UIColor *)confirmButtonTextColor { - return UIColorFromRGB(0xFFFFFF); -} -/// 取消按钮 渐变色的开始 0xF7DDBF -+ (UIColor *)cancelButtonGradientStartColor { - return UIColorFromRGB(0xCEEFFD); -} - -/// button 可用 渐变色的中间 #9CB3FF -+ (UIColor *)confirmButtonGradientMiddleColor { - return UIColorFromRGB(0xf9CB3FF); -} -/// 取消按钮 渐变色的结束 0xF7E8C4 -+ (UIColor *)cancelButtonGradientEndColor { - return UIColorFromRGB(0xD2F4F4); -} -/// 取消的按钮文字颜色 0xFFA936 -+ (UIColor *)cancelButtonTextColor { - return UIColorFromRGB(0x5FCCE4); -} -/// 取消按钮单一普通背景色 0xFFCE4E -+ (UIColor *)cancelButtonNormalBgColor { - return UIColorFromRGB(0xCEEFFD); -} -/// 按钮不可点击背景色 0xD2D5D7 -+ (UIColor *)disableButtonColor { - return UIColorFromRGB(0xCEEFFD); -} -/// 按钮不可点击文字颜色 0xF9F9F9 -+ (UIColor *)disableButtonTextColor { - return UIColorFromRGB(0xB3B3C3); -} -/* ------Button 相关颜色 END------ */ - -/* ------弹窗相关颜色 START------ */ -+ (UIColor *)alertBackgroundColor { - return UIColorFromRGB(0xFFFFFF); -} -+ (UIColor *)alertTitleColor { - return UIColorFromRGB(0x333333); -} -+ (UIColor *)alertMessageColor { - return UIColorFromRGB(0x333333); -} -+ (UIColor *)actionSeparatorColor { - return UIColorFromRGB(0xF0F0F0); -} -/* ------弹窗相关颜色 END------ */ - -///tabbar 没有点击的时候颜色 0x333333, 0.4 -+ (UIColor *)tabbarNormalColor { - return UIColorRGBAlpha(0x333333, 0.4); -} -/// tabbar的View的color 0xFFFFFF -+ (UIColor *)tabbarViewColor { - return UIColorFromRGB(0xFFFFFF); -} - -+ (UIColor *)colorWithHexString: (NSString *) hexString { - if (hexString.length == 0) { - return [UIColor blackColor]; - } - NSString *colorString = [[hexString stringByReplacingOccurrencesOfString: @"#" withString: @""] uppercaseString]; - CGFloat alpha, red, blue, green; - switch ([colorString length]) { - case 3: // #RGB - alpha = 1.0f; - red = [self colorComponentFrom: colorString start: 0 length: 1]; - green = [self colorComponentFrom: colorString start: 1 length: 1]; - blue = [self colorComponentFrom: colorString start: 2 length: 1]; - break; - case 4: // #ARGB - alpha = [self colorComponentFrom: colorString start: 0 length: 1]; - red = [self colorComponentFrom: colorString start: 1 length: 1]; - green = [self colorComponentFrom: colorString start: 2 length: 1]; - blue = [self colorComponentFrom: colorString start: 3 length: 1]; - break; - case 6: // #RRGGBB - alpha = 1.0f; - red = [self colorComponentFrom: colorString start: 0 length: 2]; - green = [self colorComponentFrom: colorString start: 2 length: 2]; - blue = [self colorComponentFrom: colorString start: 4 length: 2]; - break; - case 8: // #AARRGGBB - alpha = [self colorComponentFrom: colorString start: 0 length: 2]; - red = [self colorComponentFrom: colorString start: 2 length: 2]; - green = [self colorComponentFrom: colorString start: 4 length: 2]; - blue = [self colorComponentFrom: colorString start: 6 length: 2]; - break; - default: - [NSException raise:@"Invalid color value" format: @"Color value %@ is invalid. It should be a hex value of the form #RBG, #ARGB, #RRGGBB, or #AARRGGBB", hexString]; - break; - } - return [UIColor colorWithRed: red green: green blue: blue alpha: alpha]; -} - -+ (CGFloat) colorComponentFrom: (NSString *) string start: (NSUInteger) start length: (NSUInteger) length { - NSString *substring = [string substringWithRange: NSMakeRange(start, length)]; - NSString *fullHex = length == 2 ? substring : [NSString stringWithFormat: @"%@%@", substring, substring]; - unsigned hexComponent; - [[NSScanner scannerWithString: fullHex] scanHexInt: &hexComponent]; - return hexComponent / 255.0; -} - -///输入框的文本颜色 #1F1A4E -+ (UIColor *)inputTextColor { - return [self colorWithHexString:@"#1F1A4E"]; -} - -@end diff --git a/YuMi/CustomUI/TTPopup/Config/TTActionSheetConfig.h.backup b/YuMi/CustomUI/TTPopup/Config/TTActionSheetConfig.h.backup deleted file mode 100644 index fe92d43..0000000 --- a/YuMi/CustomUI/TTPopup/Config/TTActionSheetConfig.h.backup +++ /dev/null @@ -1,60 +0,0 @@ -// -// TTActionSheetConfig.h -// AFNetworking -// -// Created by lee on 2019/5/23. -// action sheet item 配置 - -#import - -typedef enum : NSUInteger { - TTItemSelectNormal, - TTItemSelectHighLight, -} TTItemSelectType; - - -NS_ASSUME_NONNULL_BEGIN -typedef void(^TTActionSheetClickAction)(void); - -@interface TTActionSheetConfig : NSObject - -/** 标题 */ -@property (nonatomic, copy) NSString *title; - -/** - 标题颜色 - */ -@property (nonatomic, strong) UIColor *titleColor; - -/** 是否选中 */ -@property (nonatomic, assign) TTItemSelectType type; - -/** 点击事件 */ -@property (nonatomic, copy) TTActionSheetClickAction clickAction; - -@property(nonatomic, assign) BOOL displayMoliCoin; - -/** - 构建 actionSheet item 实例 - - @param title 标题 - @param clickAction 点击事件 - @return item 实例 - */ -+ (TTActionSheetConfig *)normalTitle:(NSString *)title - clickAction:(TTActionSheetClickAction)clickAction; -+ (TTActionSheetConfig *)normalTitle:(NSString *)title - selectColorType:(TTItemSelectType)type clickAction:(TTActionSheetClickAction)clickAction; - - -/// 构建实例 -/// @param title 标题 -/// @param textColor 颜色 -/// @param handler 事件处理 -+ (TTActionSheetConfig *)actionWithTitle:(NSString *)title - color:(UIColor *)textColor - handler:(TTActionSheetClickAction)handler; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/CustomUI/TTPopup/Config/TTActionSheetConfig.m.backup b/YuMi/CustomUI/TTPopup/Config/TTActionSheetConfig.m.backup deleted file mode 100644 index e26cb40..0000000 --- a/YuMi/CustomUI/TTPopup/Config/TTActionSheetConfig.m.backup +++ /dev/null @@ -1,49 +0,0 @@ -// -// TTActionSheetConfig.m -// AFNetworking -// -// Created by lee on 2019/5/23. -// - -#import "TTActionSheetConfig.h" -#import "DJDKMIMOMColor.h" - -@implementation TTActionSheetConfig - -/** - 构建 actionSheet item 实例 - - @param title 标题 - @param clickAction 点击事件 - @return item 实例 - */ -+ (TTActionSheetConfig *)normalTitle:(NSString *)title clickAction:(TTActionSheetClickAction)clickAction { - - return [self normalTitle:title selectColorType:TTItemSelectNormal clickAction:clickAction]; -} - -+ (TTActionSheetConfig *)normalTitle:(NSString *)title selectColorType:(TTItemSelectType)type clickAction:(TTActionSheetClickAction)clickAction { - - UIColor *color = type == TTItemSelectHighLight ? [DJDKMIMOMColor alertTitleColor] : [DJDKMIMOMColor alertTitleColor]; - - TTActionSheetConfig *config = [self actionWithTitle:title color:color handler:clickAction]; - config.type = type; - - return config; -} - -+ (TTActionSheetConfig *)actionWithTitle:(NSString *)title - color:(UIColor *)textColor - handler:(TTActionSheetClickAction)handler { - - TTActionSheetConfig *config = [[TTActionSheetConfig alloc] init]; - config.type = TTItemSelectNormal; - config.title = title; - config.titleColor = textColor; - config.clickAction = handler; - - return config; -} - - -@end diff --git a/YuMi/CustomUI/TTPopup/Config/TTAlertButtonConfig.h.backup b/YuMi/CustomUI/TTPopup/Config/TTAlertButtonConfig.h.backup deleted file mode 100644 index f886cc4..0000000 --- a/YuMi/CustomUI/TTPopup/Config/TTAlertButtonConfig.h.backup +++ /dev/null @@ -1,30 +0,0 @@ -// -// TTAlertButtonConfig.h -// YM_TTChatViewKit -// -// Created by lee on 2019/5/21. -// Copyright © 2023 YUMI. All rights reserved. -// alert 按钮配置 - -#import -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface TTAlertButtonConfig : NSObject -/** 按钮标题 */ -@property (nonatomic, copy) NSString *title; -/** 按钮字体 */ -@property (nonatomic, strong) UIFont *font; -/** 按钮字体颜色 */ -@property (nonatomic, strong) UIColor *titleColor; -/** 背景色 */ -@property (nonatomic, strong) UIColor *backgroundColor; -/** 背景图 */ -@property (nonatomic, strong) UIImage *backgroundImage; -/** 圆角 */ -@property (nonatomic, assign) CGFloat cornerRadius; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/CustomUI/TTPopup/Config/TTAlertButtonConfig.m.backup b/YuMi/CustomUI/TTPopup/Config/TTAlertButtonConfig.m.backup deleted file mode 100644 index 4c85122..0000000 --- a/YuMi/CustomUI/TTPopup/Config/TTAlertButtonConfig.m.backup +++ /dev/null @@ -1,13 +0,0 @@ -// -// TTAlertButtonConfig.m -// YM_TTChatViewKit -// -// Created by lee on 2019/5/21. -// Copyright © 2023 YUMI. All rights reserved. -// - -#import "TTAlertButtonConfig.h" - -@implementation TTAlertButtonConfig - -@end diff --git a/YuMi/CustomUI/TTPopup/Config/TTAlertConfig.h.backup b/YuMi/CustomUI/TTPopup/Config/TTAlertConfig.h.backup deleted file mode 100644 index a88fde3..0000000 --- a/YuMi/CustomUI/TTPopup/Config/TTAlertConfig.h.backup +++ /dev/null @@ -1,86 +0,0 @@ -// -// TTAlertConfig.h -// YM_TTChatViewKit -// -// Created by lee on 2019/5/20. -// Copyright © 2023 YUMI. All rights reserved. -// alert 配置 - -#import -#import -#import "TTAlertButtonConfig.h" -#import "TTAlertMessageAttributedConfig.h" - -NS_ASSUME_NONNULL_BEGIN - -typedef NS_ENUM(NSUInteger, TTAlertActionStyle) { - TTAlertActionConfirmStyle = 0, // 只有确定按钮 - TTAlertActionCancelStyle = 1, // 只有取消按钮 - TTAlertActionBothStyle = 2, // 全部按钮 -}; - - -@interface TTAlertConfig : NSObject -// 按钮显示风格 -@property (nonatomic, assign) TTAlertActionStyle actionStyle; -// 容器背景设置 -@property (nonatomic, strong) UIColor *backgroundColor; - -// 标题设置 -@property (nonatomic, copy) NSString *title; -@property (nonatomic, strong) UIFont *titleFont; -@property (nonatomic, strong) UIColor *titleColor; - -// 内容设置 -@property (nonatomic, copy) NSString *message; -@property (nonatomic, strong) UIFont *messageFont; -@property (nonatomic, strong) UIColor *messageColor; -/** 内容的行间距,默认不设置,当值为 0 或负数时无效 */ -@property (nonatomic, assign) CGFloat messageLineSpacing; -@property(nonatomic, assign) NSTextAlignment messageTextAlignment; -/** 内容富文本配置 */ -@property (nonatomic, strong) NSArray *messageAttributedConfig; -///配置内容的富文本 -@property (nonatomic,strong) NSMutableAttributedString *messageAttributed; - -// 取消按钮配置 -@property (nonatomic, strong) TTAlertButtonConfig *cancelButtonConfig; - -// 确定按钮配置 -@property (nonatomic, strong) TTAlertButtonConfig *confirmButtonConfig; - -/** - 背景蒙层的透明度 - @Description 默认是 000000 黑色 0.3 alpha - */ -@property (nonatomic, assign) CGFloat maskBackgroundAlpha; - -// 圆角 -@property (nonatomic, assign) CGFloat cornerRadius; - -// 点击蒙层是否消失,默认:YES -@property (nonatomic, assign) BOOL shouldDismissOnBackgroundTouch; - -/** - 点击‘确定’‘取消’按钮时禁止弹窗自动消失,默认:NO - - @discussion 若值为 YES,需要主动调用 [TTPopup dismiss] 消除弹窗 - */ -@property (nonatomic, assign) BOOL disableAutoDismissWhenClickButton; - -/** - 重复弹窗过滤,默认:NO - - @discussion 设置过滤时,队列中将不会出现相同过滤标识的弹窗 - 过滤标识通过 # 设置 - */ -@property (nonatomic, assign) BOOL shouldFilterPopup; - -/** - 过滤标识,默认:nil - */ -@property (nonatomic, copy) NSString *filterIdentifier; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/CustomUI/TTPopup/Config/TTAlertConfig.m.backup b/YuMi/CustomUI/TTPopup/Config/TTAlertConfig.m.backup deleted file mode 100644 index ce12879..0000000 --- a/YuMi/CustomUI/TTPopup/Config/TTAlertConfig.m.backup +++ /dev/null @@ -1,90 +0,0 @@ -// -// TTAlertConfig.m -// YM_TTChatViewKit -// -// Created by lee on 2019/5/20. -// Copyright © 2023 YUMI. All rights reserved. -// - -#import "TTAlertConfig.h" -#import "UIImage+Utils.h" -#import "DJDKMIMOMColor.h" - -static CGFloat kAlertTitleFont = 18.f; -static CGFloat kAlertButtonFont = 15.f; -static CGFloat kAlertMessageFont = 15.f; -static CGFloat kAlertCornerRadius = 12.f; -static CGFloat kAlertBackgroundColorAlpha = 0.3; -static CGFloat kAlertMessageFontLineSpace = -1; -static CGFloat kAlertButtonCornerRadius = 8.f; - -@implementation TTAlertConfig - -- (instancetype)init { - self = [super init]; - if (self) { - - _backgroundColor = [DJDKMIMOMColor alertBackgroundColor]; - - //背景颜色 - kAlertTitleFont = 16.f; - kAlertCornerRadius = 14.f; - kAlertButtonCornerRadius = 19.f; - - _actionStyle = TTAlertActionBothStyle; - - // title - _title = @"";// 标题 - _titleFont = [UIFont fontWithName:@"PingFangSC-Medium" size:kAlertTitleFont];// 字体 - _titleColor = [DJDKMIMOMColor alertTitleColor];// 颜色 - - // message - _message = @""; - _messageFont = [UIFont systemFontOfSize:kAlertMessageFont];// 内容 - _messageColor = [DJDKMIMOMColor alertMessageColor];// 颜色 - _messageLineSpacing = kAlertMessageFontLineSpace;// 字体行间距 - _messageAttributedConfig = @[];// 自定义富文本样式 - _messageTextAlignment = NSTextAlignmentCenter; - - // cancel button - _cancelButtonConfig = [[TTAlertButtonConfig alloc] init]; - _cancelButtonConfig.title = YMLocalizedString(@"XPRoomSettingInputView4");// 取消按钮 - _cancelButtonConfig.font = [UIFont systemFontOfSize:kAlertButtonFont];// 按钮字体 - _cancelButtonConfig.titleColor = [DJDKMIMOMColor cancelButtonTextColor];// 字体颜色 - _cancelButtonConfig.backgroundImage = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor cancelButtonGradientStartColor], [DJDKMIMOMColor cancelButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)]; - _cancelButtonConfig.cornerRadius = kAlertButtonCornerRadius;// 按钮背景图 - - - // confirm button - _confirmButtonConfig = [[TTAlertButtonConfig alloc] init]; - _confirmButtonConfig.title = YMLocalizedString(@"TTAlertConfig0"); - _confirmButtonConfig.font = [UIFont systemFontOfSize:kAlertButtonFont]; - _confirmButtonConfig.titleColor = [DJDKMIMOMColor confirmButtonTextColor]; - _confirmButtonConfig.backgroundImage = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xE29030), UIColorFromRGB(0xFCC074)] - gradientType:GradientTypeLeftToRight - imgSize:CGSizeMake(10, 10)]; - _confirmButtonConfig.cornerRadius = kAlertButtonCornerRadius; - -// // 创建渐变图层 -// CAGradientLayer *gradientLayer = [CAGradientLayer layer]; -// gradientLayer.colors = @[(__bridge id)UIColorFromRGB(0xE29030).CGColor, -// (__bridge id)UIColorFromRGB(0xFCC074).CGColor]; -// gradientLayer.startPoint = CGPointMake(0.0, 0.0); // 顶部中央 -// gradientLayer.endPoint = CGPointMake(0.0, 1.0); // 底部中央 -// gradientLayer.frame = CGRectMake(0, 0, 120, 38); // 设置渐变图层大小 -// -// // 将渐变图层添加到按钮图层 -// [_previewActionButton.layer insertSublayer:gradientLayer atIndex:0]; - - _cornerRadius = kAlertCornerRadius;// 默认圆角 - _shouldDismissOnBackgroundTouch = YES;// 点击蒙层是否消失 - - // mask default 0.3 black - _maskBackgroundAlpha = kAlertBackgroundColorAlpha; // alert 背景色 - _disableAutoDismissWhenClickButton = NO; - } - return self; -} - -@end - diff --git a/YuMi/CustomUI/TTPopup/Config/TTAlertMessageAttributedConfig.h.backup b/YuMi/CustomUI/TTPopup/Config/TTAlertMessageAttributedConfig.h.backup deleted file mode 100644 index 374c57d..0000000 --- a/YuMi/CustomUI/TTPopup/Config/TTAlertMessageAttributedConfig.h.backup +++ /dev/null @@ -1,34 +0,0 @@ -// -// TTAlertContentAttributedConfig.h -// YM_TTChatViewKit -// -// Created by lee on 2019/5/21. -// Copyright © 2023 YUMI. All rights reserved. -// alert 提示内容富文本配置 - -#import -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface TTAlertMessageAttributedConfig : NSObject - -/** 富文本字段需要特殊显示的文本 */ -@property (nonatomic, copy) NSString *text; - -/** 颜色 */ -@property (nonatomic, strong) UIColor *color; - -/** 字体 */ -@property (nonatomic, strong) UIFont *font; - -/** - 目标文本指定位置,一旦设置则无视 text 的值 - - @discussion 内容文本中出现相同的目标文本时,可通过设置 range 精确指定位置 - */ -@property (nonatomic, assign) NSRange range; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/CustomUI/TTPopup/Config/TTAlertMessageAttributedConfig.m.backup b/YuMi/CustomUI/TTPopup/Config/TTAlertMessageAttributedConfig.m.backup deleted file mode 100644 index 91a2a92..0000000 --- a/YuMi/CustomUI/TTPopup/Config/TTAlertMessageAttributedConfig.m.backup +++ /dev/null @@ -1,13 +0,0 @@ -// -// TTAlertContentAttributedConfig.m -// YM_TTChatViewKit -// -// Created by lee on 2019/5/21. -// Copyright © 2023 YUMI. All rights reserved. -// - -#import "TTAlertMessageAttributedConfig.h" - -@implementation TTAlertMessageAttributedConfig - -@end diff --git a/YuMi/CustomUI/TTPopup/Header/TTPopupConstants.h.backup b/YuMi/CustomUI/TTPopup/Header/TTPopupConstants.h.backup deleted file mode 100644 index 01fcb35..0000000 --- a/YuMi/CustomUI/TTPopup/Header/TTPopupConstants.h.backup +++ /dev/null @@ -1,38 +0,0 @@ -// -// TTPopupConstants.h -// YM_TTChatViewKit -// -// Created by lvjunhang on 2019/5/21. -// Copyright © 2023 YUMI. All rights reserved. -// - -#import - -/** - Popup 组件通用回调 - */ -typedef void(^TTPopupCompletionHandler)(void); - -/** - 弹窗类型 - - - TTPopupStyleAlert: Alert - - TTPopupStyleActionSheet: ActionSheet - */ -typedef NS_ENUM(NSUInteger, TTPopupStyle) { - TTPopupStyleAlert = 0, - TTPopupStyleActionSheet -}; - -/** - 弹窗优先级 - - - TTPopupPriorityNormal: 普通 - - TTPopupPriorityHigh: 高 - - TTPopupPriorityRequired: 必须 - */ -typedef NS_ENUM(NSUInteger, TTPopupPriority) { - TTPopupPriorityNormal = 0, - TTPopupPriorityHigh, - TTPopupPriorityRequired -}; diff --git a/YuMi/CustomUI/TTPopup/Manager/TTPopupManagerService.h.backup b/YuMi/CustomUI/TTPopup/Manager/TTPopupManagerService.h.backup deleted file mode 100644 index 3d4718a..0000000 --- a/YuMi/CustomUI/TTPopup/Manager/TTPopupManagerService.h.backup +++ /dev/null @@ -1,24 +0,0 @@ -// -// TTPopupManagerService.h -// YM_TTChatViewKit -// -// Created by lvjunhang on 2019/5/21. -// Copyright © 2023 YUMI. All rights reserved. -// - -#import -#import "TTPopupManagerServiceProtocol.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface TTPopupManagerService : NSObject -/** - 当前显示的弹窗服务 - */ -@property (nonatomic, strong) id currentPopupService; - -+ (instancetype)sharedInstance; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/CustomUI/TTPopup/Manager/TTPopupManagerService.m.backup b/YuMi/CustomUI/TTPopup/Manager/TTPopupManagerService.m.backup deleted file mode 100644 index c6d8267..0000000 --- a/YuMi/CustomUI/TTPopup/Manager/TTPopupManagerService.m.backup +++ /dev/null @@ -1,200 +0,0 @@ -// -// TTPopupManagerService.m -// YM_TTChatViewKit -// -// Created by lvjunhang on 2019/5/21. -// Copyright © 2023 YUMI. All rights reserved. -// - -#import "TTPopupManagerService.h" - -#import - -@interface TTPopupManagerService () - -@property (nonatomic, strong) NSMutableArray< id > *queue; -/** - 当前是否正在显示状态 - */ -@property (nonatomic, assign, getter=isShowingPopup) BOOL showingPopup; - -@end - -@implementation TTPopupManagerService - -#pragma mark - Life Cycle -+ (instancetype)sharedInstance { - static TTPopupManagerService *instance = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - instance = [[self alloc] init]; - }); - - return instance; -} - -- (instancetype)init { - if (self = [super init]) { - _queue = [NSMutableArray array]; - } - return self; -} - -#pragma mark - TTPopupManagerServiceProtocol -- (void)addPopupService:(id)service { - if (![service conformsToProtocol:@protocol(TTPopupServiceProtocol)]) { - return; - } - if ([_queue containsObject:service]) { - return; - } - NSInteger insertPosition = [self insertPositionForPopupService:service]; - if (insertPosition == NSNotFound) { - return; - } - [_queue insertObject:service atIndex:insertPosition]; - //当前没有弹窗显示且队列只有一个元素时,显示弹窗 - if (_currentPopupService == nil && _queue.count == 1) { - [self showPopup]; - } -} - -- (void)removePopupService { - - //防止当弹窗还未显示完成,在显示过程中频繁调用 dismiss - //使得 _currentPopupService 被清空,导致弹窗无法消失,从而假死现象 - if (!self.isShowingPopup) { - return; - } - - if (_currentPopupService == nil) { - return; - } - - if (_queue.count > 0) { - [_queue removeObjectAtIndex:0]; - } - - [FFPopup dismissPopupForView:_currentPopupService.contentView animated:YES]; - _currentPopupService = nil; -} - -/** - 点击蒙层时移除队列中的数据源 - - @discussion 注意无需调用 dismissPopupForView - */ -- (void)removeSourceWhenTouchMaskView { - if (_currentPopupService == nil) { - return; - } - if (_queue.count > 0) { - [_queue removeObjectAtIndex:0]; - } - _currentPopupService = nil; -} - -#pragma mark - Private Methods -/** - 显示弹窗 - */ -- (void)showPopup { - if (self.isShowingPopup) { - return; - } - if (_currentPopupService) { - return; - } - if (_queue.count == 0) { - return; - } - id popupService = _queue.firstObject; - if (![popupService conformsToProtocol:@protocol(TTPopupServiceProtocol)]) { - return; - } - _currentPopupService = popupService; - FFPopupHorizontalLayout horizontalLayout = FFPopupHorizontalLayout_Center; - FFPopupVerticalLayout verticalLayout = FFPopupVerticalLayout_Center; - FFPopupShowType showType = (FFPopupShowType)popupService.showType; - FFPopupDismissType dismissType = FFPopupDismissType_GrowOut; - if (popupService.style == TTPopupStyleActionSheet) { - verticalLayout = FFPopupVerticalLayout_Bottom; - showType = FFPopupShowType_SlideInFromBottom; - dismissType = FFPopupDismissType_SlideOutToBottom; - } - FFPopup *popup = [FFPopup popupWithContentView:popupService.contentView]; - popup.showType = showType; - popup.dismissType = dismissType; - popup.maskType = FFPopupMaskType_Dimmed; - popup.dimmedMaskAlpha = popupService.maskBackgroundAlpha; - popup.shouldDismissOnBackgroundTouch = popupService.shouldDismissOnBackgroundTouch; - - [popup showWithLayout:FFPopupLayoutMake(horizontalLayout, verticalLayout) duration:0.0]; - __weak typeof(self) weakSelf = self; - // 不管是调用’dismissPopupForView:animated:‘ 还是‘点击蒙层消除’,最终都会走到这里 - // 适合在此展示队列中下一个弹窗 - // 通过 _currentPopupService 是否为空可以判断是哪种消除方式 - popup.didFinishDismissingBlock = ^{ - __strong typeof(weakSelf) strongSelf = weakSelf; - BOOL isDismissOnBackgroundTouch = strongSelf.currentPopupService != nil; - if (isDismissOnBackgroundTouch) { - // ‘点击蒙层消除’时,在展现下一个弹窗前移除数据源 - [self removeSourceWhenTouchMaskView]; - } - if (popupService.didFinishDismissHandler) { - popupService.didFinishDismissHandler(isDismissOnBackgroundTouch); - } - // 弹窗消除结束,更新状态 - strongSelf.showingPopup = NO; - // 显示下一个弹窗 - [strongSelf showPopup]; - }; - - popup.didFinishShowingBlock = ^{ - // 开始弹窗,更新状态 - self.showingPopup = YES; - if (popupService.didFinishShowingHandler) { - popupService.didFinishShowingHandler(); - } - }; -} - -/** - 弹窗将要插入队列的位置 - @param service 弹窗服务实例 - @return 队列的位置 - */ -- (NSInteger)insertPositionForPopupService:(id)service { - __block NSInteger result = NSNotFound; - if (service == nil) { - return result; - } - if (_queue.count == 0) { - return 0; - } - // 设置重复弹窗过滤 - if (service.shouldFilterPopup && service.filterIdentifier.length > 0) { - BOOL filterFlag = NO; - for (id serv in _queue) { - if ([serv.filterIdentifier isEqualToString:service.filterIdentifier]) { - filterFlag = YES; - break; - } - } - if (filterFlag) { - return result; - } - } - [_queue enumerateObjectsUsingBlock:^(id _Nonnull model, NSUInteger idx, BOOL * _Nonnull stop) { - // 找到队中比当前弹窗优先级低的位置 - if (service.priority > model.priority) { - result = idx; - *stop = YES; - } - }]; - // 如果没有合适的位置,则将新的弹窗放在队尾 - result = MIN(result, _queue.count); - return result; -} - -@end diff --git a/YuMi/CustomUI/TTPopup/Manager/TTPopupManagerServiceProtocol.h.backup b/YuMi/CustomUI/TTPopup/Manager/TTPopupManagerServiceProtocol.h.backup deleted file mode 100644 index c5f4c06..0000000 --- a/YuMi/CustomUI/TTPopup/Manager/TTPopupManagerServiceProtocol.h.backup +++ /dev/null @@ -1,25 +0,0 @@ -// -// TTPopupManagerServiceProtocol.h -// YM_TTChatViewKit -// -// Created by lvjunhang on 2019/5/21. -// Copyright © 2023 YUMI. All rights reserved. -// - -#import "TTPopupServiceProtocol.h" - -@protocol TTPopupManagerServiceProtocol - -/** - 添加一个弹窗 - - @param service 服从弹窗服务的实例 - */ -- (void)addPopupService:(id)service; - -/** - 移除一个弹窗 - */ -- (void)removePopupService; - -@end diff --git a/YuMi/CustomUI/TTPopup/Service/TTPopupService.h.backup b/YuMi/CustomUI/TTPopup/Service/TTPopupService.h.backup deleted file mode 100644 index 4532865..0000000 --- a/YuMi/CustomUI/TTPopup/Service/TTPopupService.h.backup +++ /dev/null @@ -1,22 +0,0 @@ -// -// TTPopupService.h -// YM_TTChatViewKit -// -// Created by lvjunhang on 2019/5/21. -// Copyright © 2023 YUMI. All rights reserved. -// - -#import -#import "TTPopupServiceProtocol.h" - -// TTPopupConfig 是 TTPopupService 的别称 -// 具体信息见 TTPopupService -#define TTPopupConfig TTPopupService - -NS_ASSUME_NONNULL_BEGIN - -@interface TTPopupService : NSObject - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/CustomUI/TTPopup/Service/TTPopupService.m.backup b/YuMi/CustomUI/TTPopup/Service/TTPopupService.m.backup deleted file mode 100644 index 82db3c1..0000000 --- a/YuMi/CustomUI/TTPopup/Service/TTPopupService.m.backup +++ /dev/null @@ -1,36 +0,0 @@ -// -// TTPopupService.m -// YM_TTChatViewKit -// -// Created by lvjunhang on 2019/5/21. -// Copyright © 2023 YUMI. All rights reserved. -// - -#import "TTPopupService.h" - -@implementation TTPopupService - -@synthesize style = _style; -@synthesize priority = _priority; -@synthesize contentView = _contentView; -@synthesize maskBackgroundAlpha = _maskBackgroundAlpha; -@synthesize shouldDismissOnBackgroundTouch = _shouldDismissOnBackgroundTouch; -@synthesize didFinishDismissHandler = _didFinishDismissHandler; -@synthesize didFinishShowingHandler = _didFinishShowingHandler; -@synthesize shouldFilterPopup = _shouldFilterPopup; -@synthesize filterIdentifier = _filterIdentifier; -@synthesize showType = _showType; -- (instancetype)init { - self = [super init]; - if (self) { - _style = TTPopupStyleAlert; - _priority = TTPopupPriorityNormal; - _maskBackgroundAlpha = 0.5; - _shouldDismissOnBackgroundTouch = YES; - _shouldFilterPopup = NO; - _showType = TTPopupShowTypeDefault; - } - return self; -} - -@end diff --git a/YuMi/CustomUI/TTPopup/Service/TTPopupServiceProtocol.h.backup b/YuMi/CustomUI/TTPopup/Service/TTPopupServiceProtocol.h.backup deleted file mode 100644 index c19a37d..0000000 --- a/YuMi/CustomUI/TTPopup/Service/TTPopupServiceProtocol.h.backup +++ /dev/null @@ -1,78 +0,0 @@ -// -// TTPopupServiceProtocol.h -// YM_TTChatViewKit -// -// Created by lvjunhang on 2019/5/21. -// Copyright © 2023 YUMI. All rights reserved. -// - -#import "TTPopupConstants.h" - -typedef NS_ENUM(NSUInteger, TTPopupShowType) { - TTPopupShowType_FadeIn = 1, - TTPopupShowTypeDefault = 8, -}; - -@class UIView; - -@protocol TTPopupServiceProtocol - -/** - 弹窗样式,默认:TTPopupStyleAlert - */ -@property (nonatomic, assign) TTPopupStyle style; - -/** - 弹窗优先级权重,默认:TTPopupPriorityNormal - - @discussion 权重越高在弹窗队列的优先级越高,即优先弹出;相同权重按先来后到原则 - */ -@property (nonatomic, assign) TTPopupPriority priority; - -/** - 自定义视图内容,默认:nil - - @discussion 如果未配置,或 contentView 未继承自 UIView 及其子类,将忽略该弹窗 - */ -@property (nonatomic, strong) UIView *contentView; - -/** - 背景蒙层透明度,默认:0x000000 0.3 alpha - - @discussion 由于第三方原因,暂不支持蒙层颜色修改 - */ -@property (nonatomic, assign) CGFloat maskBackgroundAlpha; - -/** - 点击蒙层是否消除弹窗,默认:YES - */ -@property (nonatomic, assign) BOOL shouldDismissOnBackgroundTouch; - -/** - 弹窗消失回调,isDismissOnBackgroundTouch 区分是否点击蒙层触发 - */ -@property (nonatomic, copy) void (^didFinishDismissHandler)(BOOL isDismissOnBackgroundTouch); - -/** - 弹窗显示成功回调 - */ -@property (nonatomic, copy) void (^didFinishShowingHandler)(void); - -/** - 重复弹窗过滤,默认:NO - - @discussion 设置过滤时,队列中将不会出现相同过滤标识的弹窗 - 过滤标识通过 # 设置 - */ -@property (nonatomic, assign) BOOL shouldFilterPopup; - -/** - 过滤标识,默认:nil - */ -@property (nonatomic, copy) NSString *filterIdentifier; - -/** - 显示动画类型, 默认是 default - */ -@property (nonatomic, assign) TTPopupShowType showType; -@end diff --git a/YuMi/CustomUI/TTPopup/TTPopup.h.backup b/YuMi/CustomUI/TTPopup/TTPopup.h.backup deleted file mode 100644 index bdee4c7..0000000 --- a/YuMi/CustomUI/TTPopup/TTPopup.h.backup +++ /dev/null @@ -1,126 +0,0 @@ -// -// TTPopup.h -// YM_TTChatViewKit -// -// Created by lvjunhang on 2019/5/22. -// Copyright © 2023 YUMI. All rights reserved. -// 弹窗工具类 - -#import -#import "TTPopupConstants.h" -#import "TTAlertConfig.h" -#import "TTActionSheetConfig.h" -#import "TTPopupService.h" - -NS_ASSUME_NONNULL_BEGIN - -@class UIView; - -@interface TTPopup : NSObject - -#pragma mark Alert -/** - 显示 alert 弹窗 - - @discussion 显示四个内容:默认标题‘提示’,提示内容,取消按钮,确认按钮 - - @param message 提示内容,不能为空(⊙o⊙)哦 - @param confirmHandler 确认操作 - @param cancelHandler 取消操作 - */ -+ (void)alertWithMessage:(NSString *)message - confirmHandler:(TTPopupCompletionHandler)confirmHandler - cancelHandler:(TTPopupCompletionHandler)cancelHandler; - - -/** -显示 alert 弹窗 - -@discussion 显示四个内容:默认标题‘提示’,提示内容,取消按钮,确认按钮 - -@param config 完善的视图配置,为您变态的需求保驾护航 -@param isShowBorder 是否显示边框 -@param confirmHandler 确认操作 -@param cancelHandler 取消操作 -*/ -+ (void)alertWithConfig:(TTAlertConfig *)config - showBorder:(BOOL)isShowBorder - confirmHandler:(TTPopupCompletionHandler)confirmHandler - cancelHandler:(TTPopupCompletionHandler)cancelHandler; - - - -+ (void)alertWithMessage:(NSString *)message - config:(TTAlertConfig *)config - showBorder:(BOOL)isShowBorder - cancelHandler:(TTPopupCompletionHandler)cancelHandler - confirmHandler:(TTPopupCompletionHandler)confirmHandler; - -/** - 显示 alert 弹窗 - @discussion 显示四个内容:标题,提示内容,取消按钮,确认按钮 - @param config 完善的视图配置,为您变态的需求保驾护航 - @param cancelHandler 取消操作 - @param confirmHandler 确认操作 - */ -+ (void)alertWithConfig:(TTAlertConfig *)config - confirmHandler:(TTPopupCompletionHandler)confirmHandler - cancelHandler:(TTPopupCompletionHandler)cancelHandler; - -#pragma mark Action Sheet -/** - 显示 action sheet 弹窗,自带贴心的取消按钮😊 - - @param items 配置列表 - */ -+ (void)actionSheetWithItems:(NSArray *)items; - -/** - 显示 action sheet 弹窗 - - @param items 配置列表 - @param showCancelItem 是否显示取消按钮 - */ -+ (void)actionSheetWithItems:(NSArray *)items - showCancelItem:(BOOL)showCancelItem; - -/** - 显示 action sheet 弹窗 - - @param items 配置列表 - @param cancelHandler 取消按钮回调 - */ -+ (void)actionSheetWithItems:(NSArray *)items - cancelHandler:(TTActionSheetClickAction)cancelHandler; - -#pragma mark Popup -/** - 显示自定义弹窗 - @param customView 自定义 view - @param style 弹窗样式 - */ -+ (void)popupView:(UIView *)customView - style:(TTPopupStyle)style; - -/** - 显示自定义弹窗 - - @param config 自定义弹窗配置 - */ -+ (void)popupWithConfig:(TTPopupService *)config; - -#pragma mark Dismiss -/** - 消除当前弹窗 - */ -+ (void)dismiss; - -#pragma mark Query -/** - 当前是否有显示弹窗 - */ -+ (BOOL)hasShowPopup; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/CustomUI/TTPopup/TTPopup.m.backup b/YuMi/CustomUI/TTPopup/TTPopup.m.backup deleted file mode 100644 index 1edb23a..0000000 --- a/YuMi/CustomUI/TTPopup/TTPopup.m.backup +++ /dev/null @@ -1,243 +0,0 @@ -// -// TTPopup.m -// YM_TTChatViewKit -// -// Created by lvjunhang on 2019/5/22. -// Copyright © 2023 YUMI. All rights reserved. -// - -#import "TTPopup.h" -#import "TTAlertView.h" -#import "TTActionSheetView.h" -#import "TTPopupService.h" -#import "TTPopupManagerService.h" - -static CGFloat const kActionSheetViewPadding = 15.f; -static CGFloat const kActionSheetViewCellHeight = 52.f; -static CGFloat const kActionSheetViewCancelViewHeight = 67.f; -static CGFloat const kActionSheetViewBottomPadding = 15.f; -static CGFloat const kMixHeight = 200.f; -static CGFloat const kMaxHeight = 450.f; - -@implementation TTPopup - -#pragma mark - Public Methods -#pragma mark Alert -+ (void)alertWithMessage:(NSString *)message - confirmHandler:(TTPopupCompletionHandler)confirmHandler - cancelHandler:(TTPopupCompletionHandler)cancelHandler { - - [self alertWithMessage:message - config:nil - cancelHandler:cancelHandler - confirmHandler:confirmHandler]; -} - -+ (void)alertWithConfig:(TTAlertConfig *)config - confirmHandler:(TTPopupCompletionHandler)confirmHandler - cancelHandler:(TTPopupCompletionHandler)cancelHandler { - - [self alertWithMessage:nil - config:config - cancelHandler:cancelHandler - confirmHandler:confirmHandler]; -} - -+ (void)alertWithMessage:(NSString *)message - config:(TTAlertConfig *)config - cancelHandler:(TTPopupCompletionHandler)cancelHandler - confirmHandler:(TTPopupCompletionHandler)confirmHandler { - - if (!config) { - config = [[TTAlertConfig alloc] init]; - config.title = YMLocalizedString(@"UserDetail_CP_Toast_0"); - config.message = message; - } - - if (config.message.length <= 0 && config.messageAttributed.length <=0 && config.messageAttributedConfig.count <=0) { -#if DEBUG - NSAssert(NO, @" message can not be nil, 弹窗文案不可以为空"); - return; -#else - // 防止正式环境 crash - config.message = @" "; -#endif - } - CGFloat width = [UIScreen mainScreen].bounds.size.width - 40 * 2; - CGFloat height = ([self messageSize:config.message width:width].height + 160); - // 最小 200, 最大 450 - if (height < kMixHeight) { - height = kMixHeight; - } else if (height > KScreenHeight - kSafeAreaTopHeight - kSafeAreaBottomHeight) { - height = KScreenHeight - kSafeAreaTopHeight - kSafeAreaBottomHeight; - } - TTAlertView *contentView = [[TTAlertView alloc] initWithFrame:CGRectMake(0, 0, width, height)]; - contentView.config = config; - contentView.isConfigBoard = NO; - contentView.cancelAction = cancelHandler; - contentView.confirmAction = confirmHandler; - if (!contentView.config.disableAutoDismissWhenClickButton) { - // 设置弹窗按钮自动消除 - contentView.dismissAction = ^{ - [TTPopup dismiss]; - }; - } - [self popupView:contentView style:TTPopupStyleAlert config:config]; -} - -+ (void)alertWithConfig:(TTAlertConfig *)config - showBorder:(BOOL)isShowBorder - confirmHandler:(TTPopupCompletionHandler)confirmHandler - cancelHandler:(TTPopupCompletionHandler)cancelHandler { - [self alertWithMessage:@"" - config:config - showBorder:isShowBorder - cancelHandler:cancelHandler - confirmHandler:confirmHandler]; -} - -+ (void)alertWithMessage:(NSString *)message - config:(TTAlertConfig *)config - showBorder:(BOOL)isShowBorder - cancelHandler:(TTPopupCompletionHandler)cancelHandler - confirmHandler:(TTPopupCompletionHandler)confirmHandler { - - if (!config) { - config = [[TTAlertConfig alloc] init]; - config.message = message; - } - - if (config.message.length <= 0) { - NSAssert(NO, @" message can not be nil, 弹窗文案不可以为空"); - return; - } - - CGFloat width = [UIScreen mainScreen].bounds.size.width - 40 * 2; - CGFloat height = ([self messageSize:config.message width:width].height + 160); - - // 最小 200, 最大 450 - if (height < kMixHeight) { - height = kMixHeight; - } else if (height > kMaxHeight) { - height = kMaxHeight; - } - - TTAlertView *contentView = [[TTAlertView alloc] initWithFrame:CGRectMake(0, 0, width, height)]; - contentView.config = config; - contentView.cancelAction = cancelHandler; - contentView.confirmAction = confirmHandler; - contentView.isConfigBoard = isShowBorder; - - if (!contentView.config.disableAutoDismissWhenClickButton) { - // 设置弹窗按钮自动消除 - contentView.dismissAction = ^{ - [TTPopup dismiss]; - }; - } - - [self popupView:contentView style:TTPopupStyleAlert config:config]; -} - -#pragma mark Action Sheet -+ (void)actionSheetWithItems:(NSArray *)items { - - [TTPopup actionSheetWithItems:items showCancelItem:YES cancelHandler:nil]; -} - -+ (void)actionSheetWithItems:(NSArray *)items - showCancelItem:(BOOL)showCancelItem { - - [TTPopup actionSheetWithItems:items showCancelItem:showCancelItem cancelHandler:nil]; -} - -+ (void)actionSheetWithItems:(NSArray *)items cancelHandler:(TTActionSheetClickAction)cancelHandler { - - [TTPopup actionSheetWithItems:items showCancelItem:YES cancelHandler:cancelHandler]; -} - -+ (void)actionSheetWithItems:(NSArray *)items - showCancelItem:(BOOL)showCancelItem - cancelHandler:(TTActionSheetClickAction)cancelHandler { - - CGFloat width = [UIScreen mainScreen].bounds.size.width - kActionSheetViewPadding * 2; - CGFloat height = kActionSheetViewCellHeight * items.count + kActionSheetViewBottomPadding; - - // 如果需要显示取消按钮则增加响应的高度 - if (showCancelItem) { - // 按钮的高度和间距 - height += kActionSheetViewCancelViewHeight; - } - - if (@available(iOS 11.0, *)) { - // 如果是 iPhone X 系列(刘海屏幕系列) 底部则需要添加 34 的高度 - height += [UIApplication sharedApplication].keyWindow.safeAreaInsets.bottom; - } - - CGRect rect = CGRectMake(0, 0, width, height); - - TTActionSheetView *sheetView = [[TTActionSheetView alloc] initWithFrame:rect - needCancel:showCancelItem - items:items]; - sheetView.cancelAction = cancelHandler; - - // 设置弹窗按钮自动消除 - sheetView.dismissAction = ^{ - [TTPopup dismiss]; - }; - - [self popupView:sheetView style:TTPopupStyleActionSheet]; -} - - -#pragma mark Popup -+ (void)popupView:(UIView *)customView - style:(TTPopupStyle)style { - - TTPopupService *service = [[TTPopupService alloc] init]; - service.style = style; - service.contentView = customView; - - [self popupWithConfig:service]; -} - -+ (void)popupView:(UIView *)customView - style:(TTPopupStyle)style - config:(TTAlertConfig *)config { - - TTPopupService *service = [[TTPopupService alloc] init]; - service.style = style; - service.contentView = customView; - service.shouldDismissOnBackgroundTouch = config.shouldDismissOnBackgroundTouch; - service.maskBackgroundAlpha = config.maskBackgroundAlpha; - [self popupWithConfig:service]; -} - - -+ (void)popupWithConfig:(TTPopupService *)config { - if (![config.contentView isKindOfClass:UIView.class]) { - NSAssert(NO, @"TTPopup customView should inherit from UIView."); - return; - } - [[TTPopupManagerService sharedInstance] addPopupService:config]; -} - -#pragma mark Dismiss -+ (void)dismiss { - [[TTPopupManagerService sharedInstance] removePopupService]; -} - -#pragma mark Query -/** - 当前是否有显示弹窗 - */ -+ (BOOL)hasShowPopup { - return [TTPopupManagerService sharedInstance].currentPopupService != nil; -} - -#pragma mark - Privite -+ (CGSize)messageSize:(NSString *)text width:(CGFloat)width { - CGRect stringRect = [text boundingRectWithSize:CGSizeMake(width - 2 * 20, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:15.f]} context:nil]; - return stringRect.size; -} - -@end diff --git a/YuMi/CustomUI/TTPopup/View/TTActionSheetView.h.backup b/YuMi/CustomUI/TTPopup/View/TTActionSheetView.h.backup deleted file mode 100644 index 64aac06..0000000 --- a/YuMi/CustomUI/TTPopup/View/TTActionSheetView.h.backup +++ /dev/null @@ -1,26 +0,0 @@ -// -// TTActionSheetView.h -// YM_TTChatViewKit -// -// Created by lee on 2019/5/22. -// Copyright © 2023 YUMI. All rights reserved. -// - -#import -#import "TTPopupConstants.h" - -NS_ASSUME_NONNULL_BEGIN - -@class TTActionSheetConfig; - -@interface TTActionSheetView : UIView - -@property (nonatomic, copy) TTPopupCompletionHandler cancelAction; -@property (nonatomic, copy) TTPopupCompletionHandler dismissAction; - -- (instancetype)initWithFrame:(CGRect)frame - needCancel:(BOOL)needCancel - items:(NSArray *)items; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/CustomUI/TTPopup/View/TTActionSheetView.m.backup b/YuMi/CustomUI/TTPopup/View/TTActionSheetView.m.backup deleted file mode 100644 index bc27380..0000000 --- a/YuMi/CustomUI/TTPopup/View/TTActionSheetView.m.backup +++ /dev/null @@ -1,159 +0,0 @@ -// -// TTActionSheetView.m -// YM_TTChatViewKit -// -// Created by lee on 2019/5/22. -// Copyright © 2023 YUMI. All rights reserved. -// - -#import "TTActionSheetView.h" -#import "TTActionSheetConfig.h" -#import "DJDKMIMOMColor.h" -#import - -static CGFloat const kSheetViewCellHeight = 51.f; -static CGFloat const kSheetViewCornerRadius = 14.f; -static NSString *const kSheetViewCellConst = @"kSheetViewCellConst"; - -@interface TTActionSheetView () - -/** sheetView 载体 */ -@property (nonatomic, strong) UITableView *tableView; -/** 数据源 */ -@property (nonatomic, strong) NSArray *items; -/** 是否需要显示取消按钮 */ -@property (nonatomic, assign) BOOL needCancel; -/** 取消按钮 */ -@property (nonatomic, strong) UIButton *cancelButton; - -@end - -@implementation TTActionSheetView - -#pragma mark - -#pragma mark lifeCycle -- (instancetype)initWithFrame:(CGRect)frame needCancel:(BOOL)needCancel items:(NSArray *)items { - self = [super initWithFrame:frame]; - if (self) { - _items = items; - _needCancel = needCancel; - [self initViews]; - [self initConstraints]; - } - return self; -} - -- (void)initViews { - [self addSubview:self.tableView]; - [self addSubview:self.cancelButton]; -} - -- (void)initConstraints { - - [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.top.mas_equalTo(self); - make.height.mas_equalTo(self.items.count * kSheetViewCellHeight); - }]; - - if (_needCancel) { - // 显示 cancel view - self.cancelButton.hidden = NO; - [self.cancelButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.mas_equalTo(self); - make.height.mas_equalTo(kSheetViewCellHeight); - make.top.mas_equalTo(self.tableView.mas_bottom).offset(15); - }]; - } - -} - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 1; -} - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return self.items.count; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kSheetViewCellConst]; - cell.backgroundColor = UIColor.clearColor; - cell.textLabel.textAlignment = NSTextAlignmentCenter; - cell.textLabel.text = _items[indexPath.row].title; - cell.textLabel.textColor = _items[indexPath.row].titleColor; - - if ([_items[indexPath.row] displayMoliCoin]) { - NSTextAttachment *coinAttachment = [[NSTextAttachment alloc] init]; - coinAttachment.image = kImage(@"moli_money_icon"); - coinAttachment.bounds = CGRectMake(0, -3.5, 20, 20); - NSAttributedString *coinAttributedString = [NSAttributedString attributedStringWithAttachment:coinAttachment]; - NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithAttributedString:coinAttributedString]; - NSAttributedString *titleAttributedString = [[NSAttributedString alloc] initWithString:_items[indexPath.row].title - attributes:@{ - NSForegroundColorAttributeName: _items[indexPath.row].titleColor, - NSFontAttributeName: cell.textLabel.font - }]; - [string insertAttributedString:titleAttributedString atIndex:0]; - cell.textLabel.attributedText = string.copy; - - UIImageView *questionMark = [[UIImageView alloc] initWithImage:kImage(@"question_mark")]; - [cell.contentView addSubview:questionMark]; - [questionMark mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.mas_equalTo(cell.textLabel); - make.trailing.mas_equalTo(-20); - make.size.mas_equalTo(CGSizeMake(22, 22)); - }]; - } - - return cell; -} - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - [tableView deselectRowAtIndexPath:indexPath animated:YES]; - - // 配置中的事件处理 - TTActionSheetConfig *config = _items[indexPath.row]; - !config.clickAction ?: config.clickAction(); - - !_dismissAction ?: _dismissAction(); -} - -- (void)onClickCancelButtonAction:(UIButton *)cancelButton { - !_cancelAction ?: _cancelAction(); - !_dismissAction ?: _dismissAction(); -} - -- (UITableView *)tableView { - if (!_tableView) { - _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; - _tableView.delegate = self; - _tableView.dataSource = self; - _tableView.separatorColor = [DJDKMIMOMColor actionSeparatorColor]; - _tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; - _tableView.rowHeight = kSheetViewCellHeight; - _tableView.tableFooterView = [[UIView alloc] init]; - _tableView.backgroundColor = [UIColor whiteColor]; - _tableView.layer.cornerRadius = kSheetViewCornerRadius; - _tableView.layer.masksToBounds = YES; - _tableView.bounces = NO; - [_tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:kSheetViewCellConst]; - } - return _tableView; -} - -- (UIButton *)cancelButton { - if (!_cancelButton) { - _cancelButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_cancelButton setTitle:YMLocalizedString(@"TTActionSheetView0") forState:UIControlStateNormal]; - [_cancelButton setBackgroundColor:UIColor.whiteColor]; - [_cancelButton setTitleColor:[DJDKMIMOMColor alertMessageColor] forState:UIControlStateNormal]; - [_cancelButton.titleLabel setFont:[UIFont systemFontOfSize:16]]; - _cancelButton.layer.cornerRadius = kSheetViewCornerRadius; - _cancelButton.layer.masksToBounds = YES; - [_cancelButton addTarget:self action:@selector(onClickCancelButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - _cancelButton.hidden = YES; - } - return _cancelButton; -} - -@end diff --git a/YuMi/CustomUI/TTPopup/View/TTAlertView.h.backup b/YuMi/CustomUI/TTPopup/View/TTAlertView.h.backup deleted file mode 100644 index bc6bcca..0000000 --- a/YuMi/CustomUI/TTPopup/View/TTAlertView.h.backup +++ /dev/null @@ -1,25 +0,0 @@ -// -// TTAlertView.h -// YM_TTChatViewKit -// -// Created by lee on 2019/5/20. -// Copyright © 2023 YUMI. All rights reserved. -// - -#import -#import "TTPopupConstants.h" - -@class TTAlertConfig; - -NS_ASSUME_NONNULL_BEGIN - -@interface TTAlertView : UIView -@property (nonatomic, strong) TTAlertConfig *config;// 配置 -@property (nonatomic, assign) BOOL isConfigBoard;// 是否配置边框 -@property (nonatomic, copy) TTPopupCompletionHandler cancelAction; -@property (nonatomic, copy) TTPopupCompletionHandler confirmAction; -@property (nonatomic, copy) TTPopupCompletionHandler dismissAction; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/CustomUI/TTPopup/View/TTAlertView.m.backup b/YuMi/CustomUI/TTPopup/View/TTAlertView.m.backup deleted file mode 100644 index f1e3587..0000000 --- a/YuMi/CustomUI/TTPopup/View/TTAlertView.m.backup +++ /dev/null @@ -1,255 +0,0 @@ -// -// TTAlertView.m -// YM_TTChatViewKit -// -// Created by lee on 2019/5/20. -// Copyright © 2023 YUMI. All rights reserved. -// - -#import "TTAlertView.h" -#import "TTAlertConfig.h" -#import "DJDKMIMOMColor.h" -#import - -static CGFloat const kMargin = 25.f; -static CGFloat const kPadding = 20.f; -static CGFloat const kBtnHeight = 38.f; - -@interface TTAlertView () - -@property (nonatomic, strong) UILabel *titleLabel; // 标题 -@property (nonatomic, strong) UILabel *messageLabel; // 内容 -@property (nonatomic, strong) UIButton *cancelButton; // 取消按钮 -@property (nonatomic, strong) UIButton *confirmButton; // 确认按钮 -@property (nonatomic, strong) UIStackView *stackView; - -@end - -@implementation TTAlertView - -#pragma mark - lifeCyle -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - [self initViews]; - [self initConstraints]; - } - return self; -} - -- (void)initViews { - [self addSubview:self.titleLabel]; - [self addSubview:self.messageLabel]; - [self addSubview:self.stackView]; - [self.stackView addSubview:self.cancelButton]; - [self.stackView addSubview:self.confirmButton]; -} - -- (void)initConstraints { - [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.mas_equalTo(self); - make.top.mas_equalTo(kPadding); - make.leading.trailing.mas_equalTo(self).inset(kPadding); - }]; - - [self.messageLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(kMargin); - make.leading.trailing.mas_equalTo(self).inset(kPadding); - make.bottom.mas_equalTo(self).offset(-kBtnHeight * 2); - }]; - - [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) { - make.bottom.mas_equalTo(-kPadding); - make.centerX.mas_equalTo(self); - }]; - - [self.cancelButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.height.mas_equalTo(kBtnHeight); - make.width.mas_equalTo(self.mas_width).multipliedBy(0.4); - }]; - - [self.confirmButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.height.mas_equalTo(kBtnHeight); - make.width.mas_equalTo(self.mas_width).multipliedBy(0.4); - }]; -} - -#pragma mark - Button Events -- (void)onClickConfirmButtonAction:(UIButton *)confirmButton { - !_confirmAction ?: _confirmAction(); - !_dismissAction ?: _dismissAction(); -} - -- (void)onClickCancelButtonAction:(UIButton *)cancelButton { - !_cancelAction ?: _cancelAction(); - !_dismissAction ?: _dismissAction(); -} - -#pragma mark - private method -/** - 设置 messageLabel 需要显示的富文本效果 - @param config 弹窗配置 - @return 富文本内容 - */ -- (NSMutableAttributedString *)messageAttributeString:(TTAlertConfig *)config { - NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:config.message]; - if (config.messageLineSpacing > 0) { // 行间距 - NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; - paragraphStyle.lineSpacing = config.messageLineSpacing; - paragraphStyle.alignment = config.messageTextAlignment; - [attString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, config.message.length)]; - } - - // 富文本显示效果 - [config.messageAttributedConfig enumerateObjectsUsingBlock:^(TTAlertMessageAttributedConfig * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - // 遍历数组,添加展示富文本效果 - if ([obj isKindOfClass:[TTAlertMessageAttributedConfig class]]) { - if (obj.text && obj.text.length > 0) { - NSRange range = [config.message rangeOfString:obj.text]; - // 如果外部指定了 range 。就不用查找出的 range - if (obj.range.length != 0) { - if (obj.range.location + obj.range.length > config.message.length) { - NSAssert(NO, @"obj.range out of bounds"); - return; - } - range = obj.range; - } - if (obj.font) { // 字体 - [attString addAttribute:NSFontAttributeName value:obj.font range:range]; - } - if (obj.color) { // 颜色 - [attString addAttribute:NSForegroundColorAttributeName value:obj.color range:range]; - } - } - } - }]; - return attString; -} - -#pragma mark - getter && setter - -- (void)setConfig:(TTAlertConfig *)config { - _config = config; - // cornerRadius - if (config.cornerRadius > 0) { - self.layer.cornerRadius = config.cornerRadius; - self.layer.masksToBounds = YES; - } - //背景 - self.backgroundColor = config.backgroundColor; - // title - _titleLabel.text = config.title; - _titleLabel.textColor = config.titleColor; - _titleLabel.font = config.titleFont; - - _cancelButton.hidden = config.actionStyle == TTAlertActionConfirmStyle; - _confirmButton.hidden = config.actionStyle == TTAlertActionCancelStyle; - - // cancel button - [_cancelButton setTitle:config.cancelButtonConfig.title forState:UIControlStateNormal]; - [_cancelButton setTitleColor:config.cancelButtonConfig.titleColor forState:UIControlStateNormal]; - [_cancelButton.titleLabel setFont:config.cancelButtonConfig.font]; - [_cancelButton setBackgroundColor:config.cancelButtonConfig.backgroundColor]; - [_cancelButton setBackgroundImage:config.cancelButtonConfig.backgroundImage forState:UIControlStateNormal]; - if (config.cancelButtonConfig.cornerRadius > 0) { - _cancelButton.layer.cornerRadius = config.cancelButtonConfig.cornerRadius; - _cancelButton.layer.masksToBounds = YES; - } - - // confirm button - [_confirmButton setTitle:config.confirmButtonConfig.title forState:UIControlStateNormal]; - [_confirmButton setTitleColor:config.confirmButtonConfig.titleColor forState:UIControlStateNormal]; - [_confirmButton.titleLabel setFont:config.confirmButtonConfig.font]; - [_confirmButton setBackgroundColor:config.confirmButtonConfig.backgroundColor]; - [_confirmButton setBackgroundImage:config.confirmButtonConfig.backgroundImage forState:UIControlStateNormal]; - if (config.confirmButtonConfig.cornerRadius > 0) { - _confirmButton.layer.cornerRadius = config.confirmButtonConfig.cornerRadius; - _confirmButton.layer.masksToBounds = YES; - } - - // message - _messageLabel.font = config.messageFont; - _messageLabel.textColor = config.messageColor; - - if (config.messageAttributedConfig.count > 0) { - _messageLabel.attributedText = [self messageAttributeString:config]; - _messageLabel.textAlignment = NSTextAlignmentCenter; - } else if(config.messageAttributed.length > 0) { - _messageLabel.attributedText = config.messageAttributed; - _messageLabel.textAlignment = NSTextAlignmentCenter; - } else { - _messageLabel.text = config.message; - _messageLabel.textAlignment = config.messageTextAlignment; - } - - _cancelButton.layer.borderColor = [DJDKMIMOMColor dividerColor].CGColor; - _cancelButton.layer.borderWidth = 2.f; - _confirmButton.layer.borderColor = [DJDKMIMOMColor dividerColor].CGColor; - _confirmButton.layer.borderWidth = 2.f; -} - -- (void)setIsConfigBoard:(BOOL)isConfigBoard { - _isConfigBoard = isConfigBoard; - if (isConfigBoard) { - //需要边框 - _cancelButton.layer.borderColor = [DJDKMIMOMColor dividerColor].CGColor; - _cancelButton.layer.borderWidth = 2.f; - _confirmButton.layer.borderColor = [DJDKMIMOMColor dividerColor].CGColor; - _confirmButton.layer.borderWidth = 2.f; - }else { - //不需要边框 - _cancelButton.layer.borderColor = [DJDKMIMOMColor dividerColor].CGColor; - _cancelButton.layer.borderWidth = 0; - _confirmButton.layer.borderColor = [DJDKMIMOMColor dividerColor].CGColor; - _confirmButton.layer.borderWidth = 0; - } -} - - -- (UILabel *)titleLabel { - if (!_titleLabel) { - _titleLabel = [[UILabel alloc] init]; - _titleLabel.textAlignment = NSTextAlignmentCenter; - _titleLabel.numberOfLines = 0; - } - return _titleLabel ; -} - -- (UILabel *)messageLabel { - if (!_messageLabel) { - _messageLabel = [[UILabel alloc] init]; - _messageLabel.numberOfLines = 0; - _messageLabel.textAlignment = NSTextAlignmentCenter; - _messageLabel.minimumScaleFactor = 0.7; - _messageLabel.adjustsFontSizeToFitWidth = YES; - } - return _messageLabel; -} - -- (UIButton *)cancelButton { - if (!_cancelButton) { - _cancelButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_cancelButton addTarget:self action:@selector(onClickCancelButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - } - return _cancelButton; -} - -- (UIButton *)confirmButton { - if (!_confirmButton) { - _confirmButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_confirmButton addTarget:self action:@selector(onClickConfirmButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - } - return _confirmButton; -} - -- (UIStackView *)stackView { - if (!_stackView) { - _stackView = [[UIStackView alloc] initWithArrangedSubviews:@[self.cancelButton, self.confirmButton]]; - _stackView.distribution = UIStackViewDistributionFillEqually; - _stackView.alignment = UIStackViewAlignmentCenter; - _stackView.spacing = 16; - } - return _stackView; -} - -@end diff --git a/YuMi/CustomUI/TTPopup/View/TTNewAlertView.h.backup b/YuMi/CustomUI/TTPopup/View/TTNewAlertView.h.backup deleted file mode 100644 index 0fadf88..0000000 --- a/YuMi/CustomUI/TTPopup/View/TTNewAlertView.h.backup +++ /dev/null @@ -1,20 +0,0 @@ -// -// TTNewAlertView.h -// xplan-ios -// -// Created by duoban on 2023/1/9. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - - - - -@interface TTNewAlertView : UIView -@property (nonatomic,copy) NSString *message; -@property (nonatomic, copy) TTPopupCompletionHandler confirmHandle; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/CustomUI/TTPopup/View/TTNewAlertView.m.backup b/YuMi/CustomUI/TTPopup/View/TTNewAlertView.m.backup deleted file mode 100644 index 5936960..0000000 --- a/YuMi/CustomUI/TTPopup/View/TTNewAlertView.m.backup +++ /dev/null @@ -1,118 +0,0 @@ -// -// TTNewAlertView.m -// xplan-ios -// -// Created by duoban on 2023/1/9. -// - -#import "TTNewAlertView.h" -@interface TTNewAlertView() -@property (nonatomic,strong) UIView *bgView; -@property (nonatomic,strong) UILabel *messageView; -@property (nonatomic,strong) UIButton *confirmBtn; -@property (nonatomic,strong) UIButton *cancelBtn; -@end -@implementation TTNewAlertView - --(instancetype)initWithFrame:(CGRect)frame{ - self = [super initWithFrame:frame]; - if(self){ - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; -} - -#pragma mark - Private Method -- (void)initSubViews { - self.backgroundColor = [UIColor clearColor]; - [self addSubview:self.bgView]; - [self.bgView addSubview:self.messageView]; - [self.bgView addSubview:self.confirmBtn]; - [self.bgView addSubview:self.cancelBtn]; -} -- (void)initSubViewConstraints { - [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(kGetScaleWidth(310)); - make.height.mas_equalTo(kGetScaleWidth(149)); - make.center.equalTo(self); - }]; - - - [self.confirmBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.height.mas_equalTo(kGetScaleWidth(110)); - make.height.mas_equalTo(kGetScaleWidth(37)); - make.leading.mas_equalTo(kGetScaleWidth(31)); - make.bottom.mas_equalTo(-kGetScaleWidth(31)); - }]; - - [self.cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.height.centerY.equalTo(self.confirmBtn); - make.trailing.mas_equalTo(-kGetScaleWidth(31)); - }]; - - [self.messageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(kGetScaleWidth(25)); - make.centerX.equalTo(self); - make.leading.trailing.equalTo(self).inset(kGetScaleWidth(10)); - }]; - - - -} --(void)setMessage:(NSString *)message{ - _message = message; - _messageView.text = message; -} --(void)confirmAction{ - [TTPopup dismiss]; - if(self.confirmHandle){ - self.confirmHandle(); - } -} --(void)cancelAction{ - [TTPopup dismiss]; -} - -#pragma mark -懒加载 - -- (UIView *)bgView{ - if (!_bgView){ - _bgView = [UIView new]; - _bgView.backgroundColor = [UIColor whiteColor]; - [_bgView setCornerWithLeftTopCorner:kGetScaleWidth(12) rightTopCorner:kGetScaleWidth(12) bottomLeftCorner:kGetScaleWidth(12) bottomRightCorner:kGetScaleWidth(12) size:CGSizeMake(kGetScaleWidth(310), kGetScaleWidth(149))]; - } - return _bgView; -} -- (UILabel *)messageView{ - if (!_messageView){ - _messageView = [UILabel labelInitWithText:@"" font:kFontRegular(15) textColor:[DJDKMIMOMColor inputTextColor]]; - _messageView.textAlignment = NSTextAlignmentCenter; - _messageView.numberOfLines = 0; - } - return _messageView; -} --(UIButton *)confirmBtn{ - if (!_confirmBtn){ - _confirmBtn = [UIButton new]; - [_confirmBtn setTitle:YMLocalizedString(@"TTAlertConfig0") forState:UIControlStateNormal]; - _confirmBtn.backgroundColor = UIColorFromRGB(0xE6E6F0); - _confirmBtn.layer.cornerRadius = kGetScaleWidth(37)/2; - _confirmBtn.layer.masksToBounds = YES; - [_confirmBtn addTarget:self action:@selector(confirmAction) forControlEvents:UIControlEventTouchUpInside]; - } - return _confirmBtn; -} --(UIButton *)cancelBtn{ - if (!_cancelBtn){ - _cancelBtn = [UIButton new]; - [_cancelBtn setTitle:YMLocalizedString(@"XPShareView7") forState:UIControlStateNormal]; - UIImage *image = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor],[DJDKMIMOMColor confirmButtonGradientMiddleColor],[DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(110), kGetScaleWidth(37))]; - _cancelBtn.backgroundColor = [UIColor colorWithPatternImage:image]; - _cancelBtn.layer.cornerRadius = kGetScaleWidth(37)/2; - _cancelBtn.layer.masksToBounds = YES; - [_cancelBtn addTarget:self action:@selector(cancelAction) forControlEvents:UIControlEventTouchUpInside]; - } - return _cancelBtn; -} -@end diff --git a/YuMi/CustomUI/UIImage/UIImage+Utils.h.backup b/YuMi/CustomUI/UIImage/UIImage+Utils.h.backup deleted file mode 100644 index e0db37d..0000000 --- a/YuMi/CustomUI/UIImage/UIImage+Utils.h.backup +++ /dev/null @@ -1,65 +0,0 @@ -// -// UIImage+Utils.h -// YYMobileFramework -// -// Created by wuwei on 14/6/20. -// Copyright (c) 2014年 YY Inc. All rights reserved. -// - -#import - -typedef NS_ENUM(NSUInteger, GradientType) { - GradientTypeTopToBottom = 0,//从上到小 - GradientTypeLeftToRight = 1,//从左到右 - GradientTypeUpleftToLowright = 2,//左上到右下 - GradientTypeUprightToLowleft = 3,//右上到左下 -}; - -@interface UIImage (Utils) - -- (UIImage *)grayscaleImage; - -- (UIImage *)imageBlendInGray; - -- (UIImage *)imageWithBlendMode:(CGBlendMode)blendMode; - -+ (UIImage *)imageWithColor:(UIColor *)color; - -+ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size; - -+ (UIImage *)fixOrientation:(UIImage *)aImage; - -- (UIImage *)imageWithColor:(UIColor *)color; - -- (UIImage *)setCornerWithRadius:(CGFloat)radius andSize:(CGSize)size; - -//异步生成纯色圆角图片 -- (void)imageWithSize:(CGSize)size radius:(CGFloat)radius backColor:(UIColor *)backColor completion:(void(^)(UIImage *image))completion; -/** - 返回指定大小,颜色,渐变模式的渐变色图片 - */ -+ (UIImage *)gradientColorImageFromColors:(NSArray*)colors gradientType:(GradientType)gradientType imgSize:(CGSize)imgSize; - -+ (UIImage *)waterImageWithImage:(UIImage *)image waterImage:(UIImage *)waterImage waterImageRect:(CGRect)rect; - -+ (CGSize)sizeWithImageOriginSize:(CGSize)originSize - minSize:(CGSize)imageMinSize - maxSize:(CGSize)imageMaxSize; - -///裁剪图片 -- (UIImage *)cutImage:(CGSize)newSize; - -- (UIImage *)cropRightAndBottomPixels:(NSUInteger)pixels; - --(UIImage *)compressWithMaxLength:(NSUInteger)maxLength; -- (UIImage *)roundedImageWithCornerRadius:(CGFloat)cornerRadius size:(CGSize)size; -+(UIImage *)getImageFromView:(UIView *)view; -+ (NSString *)getImageTypeWithImageData: (NSData *)data; -+(UIImage *)getLanguageImage:(NSString *)image; -+(NSString *)getLanguageText:(NSString *)image; - -- (UIImage *)resizeTo:(CGSize)size; - -- (UIImage *)imageByApplyingAlpha:(CGFloat)alpha; - -@end diff --git a/YuMi/CustomUI/UIImage/UIImage+Utils.m.backup b/YuMi/CustomUI/UIImage/UIImage+Utils.m.backup deleted file mode 100644 index e1c59ea..0000000 --- a/YuMi/CustomUI/UIImage/UIImage+Utils.m.backup +++ /dev/null @@ -1,592 +0,0 @@ -// -// UIImage+Utils.m -// YYMobileFramework -// -// Created by wuwei on 14/6/20. -// Copyright (c) 2014年 YY Inc. All rights reserved. -// - -#import "UIImage+Utils.h" -#import - -@implementation UIImage (Utils) -- (UIImage *)grayscaleImage -{ - CGFloat width = self.size.width; - CGFloat height = self.size.height; - - CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray(); - - CGContextRef context = CGBitmapContextCreate(nil, - width, - height, - 8, - 0, - colorSpace, - kCGImageAlphaNone); -// kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedLast); - - - if (context == NULL) { - return nil; - } - - CGContextDrawImage(context, CGRectMake(0, 0, width, height), self.CGImage); - CGImageRef imageRef = CGBitmapContextCreateImage(context); - UIImage *grayscaleImage = [UIImage imageWithCGImage:imageRef]; - CGImageRelease(imageRef); - CGContextRelease(context); - CGColorSpaceRelease(colorSpace); - - return grayscaleImage; -} - - -- (UIImage *)imageBlendInGray { - - UIGraphicsBeginImageContext(self.size); - CGRect bounds = CGRectMake(0, 0, self.size.width, self.size.height); - CGContextRef context = UIGraphicsGetCurrentContext(); - CGContextFillRect(context, bounds); - [self drawInRect:bounds blendMode:kCGBlendModeLuminosity alpha:1.0f]; - [self drawInRect:bounds blendMode:kCGBlendModeDestinationIn alpha:1.0f]; - UIImage *newImg = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - - return newImg; -} - - - -- (UIImage *)imageWithBlendMode:(CGBlendMode)blendMode { - - UIGraphicsBeginImageContextWithOptions(self.size, NO, 0.0f); - CGRect bounds = CGRectMake(0, 0, self.size.width, self.size.height); - UIRectFill(bounds); - - [self drawInRect:bounds blendMode:blendMode alpha:1.0f]; - - if (blendMode != kCGBlendModeDestinationIn) { - [self drawInRect:bounds blendMode:kCGBlendModeDestinationIn alpha:1.0f]; - } - UIImage *newImg = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return newImg; -} - -+ (UIImage *)imageWithColor:(UIColor *)color -{ - return [self imageWithColor:color size:CGSizeMake(1, 1)]; -} - -+ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size { - if (!color || size.width <= 0 || size.height <= 0) return nil; - CGRect rect = CGRectMake(0.0f, 0.0f, size.width + 1, size.height); - UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0); - CGContextRef context = UIGraphicsGetCurrentContext(); - CGContextSetFillColorWithColor(context, color.CGColor); - CGContextFillRect(context, rect); - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return image; -} - -+ (UIImage *)fixOrientation:(UIImage *)aImage { - - // No-op if the orientation is already correct - if (aImage.imageOrientation == UIImageOrientationUp) - return aImage; - - // We need to calculate the proper transformation to make the image upright. - // We do it in 2 steps: Rotate if Left/Right/Down, and then flip if Mirrored. - CGAffineTransform transform = CGAffineTransformIdentity; - - switch (aImage.imageOrientation) { - case UIImageOrientationDown: - case UIImageOrientationDownMirrored: - transform = CGAffineTransformTranslate(transform, aImage.size.width, aImage.size.height); - transform = CGAffineTransformRotate(transform, M_PI); - break; - - case UIImageOrientationLeft: - case UIImageOrientationLeftMirrored: - transform = CGAffineTransformTranslate(transform, aImage.size.width, 0); - transform = CGAffineTransformRotate(transform, M_PI_2); - break; - - case UIImageOrientationRight: - case UIImageOrientationRightMirrored: - transform = CGAffineTransformTranslate(transform, 0, aImage.size.height); - transform = CGAffineTransformRotate(transform, -M_PI_2); - break; - default: - break; - } - - switch (aImage.imageOrientation) { - case UIImageOrientationUpMirrored: - case UIImageOrientationDownMirrored: - transform = CGAffineTransformTranslate(transform, aImage.size.width, 0); - transform = CGAffineTransformScale(transform, -1, 1); - break; - - case UIImageOrientationLeftMirrored: - case UIImageOrientationRightMirrored: - transform = CGAffineTransformTranslate(transform, aImage.size.height, 0); - transform = CGAffineTransformScale(transform, -1, 1); - break; - default: - break; - } - - // Now we draw the underlying CGImage into a new context, applying the transform - // calculated above. - CGContextRef ctx = CGBitmapContextCreate(NULL, aImage.size.width, aImage.size.height, - CGImageGetBitsPerComponent(aImage.CGImage), 0, - CGImageGetColorSpace(aImage.CGImage), - CGImageGetBitmapInfo(aImage.CGImage)); - CGContextConcatCTM(ctx, transform); - switch (aImage.imageOrientation) { - case UIImageOrientationLeft: - case UIImageOrientationLeftMirrored: - case UIImageOrientationRight: - case UIImageOrientationRightMirrored: - // Grr... - CGContextDrawImage(ctx, CGRectMake(0,0,aImage.size.height,aImage.size.width), aImage.CGImage); - break; - - default: - CGContextDrawImage(ctx, CGRectMake(0,0,aImage.size.width,aImage.size.height), aImage.CGImage); - break; - } - - // And now we just create a new UIImage from the drawing context - CGImageRef cgimg = CGBitmapContextCreateImage(ctx); - UIImage *img = [UIImage imageWithCGImage:cgimg]; - CGContextRelease(ctx); - CGImageRelease(cgimg); - return img; -} - -- (UIImage *)imageWithColor:(UIColor *)color { - CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f); - UIGraphicsBeginImageContext(rect.size); - CGContextRef context = UIGraphicsGetCurrentContext(); - - CGContextSetFillColorWithColor(context, [color CGColor]); - CGContextFillRect(context, rect); - - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - - return image; - -} - -//异步生成纯色圆角图片 -- (void)imageWithSize:(CGSize)size radius:(CGFloat)radius backColor:(UIColor *)backColor completion:(void(^)(UIImage *image))completion { - // 异步绘制裁切 - dispatch_async(dispatch_get_global_queue(0, 0), ^{ - // 利用绘图建立上下文 - UIGraphicsBeginImageContextWithOptions(size, true, 0); - CGRect rect = CGRectMake(0, 0, size.width, size.height); - // 填充颜色 - [backColor setFill]; - UIRectFill(rect); - // // 贝塞尔裁切 - // UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:radius]; - // [path addClip]; - // [self drawInRect:rect]; - - // 获取结果 - UIImage *resultImage = [UIGraphicsGetImageFromCurrentImageContext() circularImage]; - // 关闭上下文 - UIGraphicsEndImageContext(); - // 主队列回调 - dispatch_async(dispatch_get_main_queue(), ^{ - completion(resultImage); - }); - }); - -} - -- (UIImage *)circularImage { - // 1. 开启图形上下文 - UIGraphicsBeginImageContextWithOptions(self.size, NO, 0); - - // 2. 描述路径 - - UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, self.size.width, self.size.height) byRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRight | UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(self.size.width, self.size.height)]; - // UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(0, 0, self.size.width, self.size.height)]; - - // 3. 添加裁减区域 - [path addClip]; - - // 4. 绘制图片 - [self drawAtPoint:CGPointZero]; - - // 5. 从上下文获取图片 - UIImage * image = UIGraphicsGetImageFromCurrentImageContext(); - - // 6. 关闭上下文 - UIGraphicsEndImageContext(); - - // 7. 设置图片 - return image; -} - -+ (UIImage *)gradientColorImageFromColors:(NSArray *)colors gradientType:(GradientType)gradientType imgSize:(CGSize)imgSize{ - - NSMutableArray *ar = [NSMutableArray array]; - for(UIColor *c in colors) { - [ar addObject:(id)c.CGColor]; - } - UIGraphicsBeginImageContextWithOptions(imgSize, YES, 1); - CGContextRef context = UIGraphicsGetCurrentContext(); - CGContextSaveGState(context); - CGColorSpaceRef colorSpace = CGColorGetColorSpace([[colors lastObject] CGColor]); - CGGradientRef gradient = CGGradientCreateWithColors(colorSpace, (CFArrayRef)ar, NULL); - CGPoint start; - CGPoint end; - switch (gradientType) { - case GradientTypeTopToBottom: - start = CGPointMake(0.0, 0.0); - end = CGPointMake(0.0, imgSize.height); - break; - case GradientTypeLeftToRight: - start = CGPointMake(0.0, 0.0); - end = CGPointMake(imgSize.width, 0.0); - break; - case GradientTypeUpleftToLowright: - start = CGPointMake(0.0, 0.0); - end = CGPointMake(imgSize.width, imgSize.height); - break; - case GradientTypeUprightToLowleft: - start = CGPointMake(imgSize.width, 0.0); - end = CGPointMake(0.0, imgSize.height); - break; - default: - break; - } - CGContextDrawLinearGradient(context, gradient, start, end, kCGGradientDrawsBeforeStartLocation | kCGGradientDrawsAfterEndLocation); - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - CGGradientRelease(gradient); - CGContextRestoreGState(context); - CGColorSpaceRelease(colorSpace); - UIGraphicsEndImageContext(); - - return image; -} - -- (UIImage *)setCornerWithRadius:(CGFloat)radius andSize:(CGSize)size { - //开启图形上下文 - UIGraphicsBeginImageContext(size); - //绘制圆角矩形 - CGRect rect = CGRectMake(0, 0, size.width, size.height); - UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect byRoundingCorners:UIRectCornerAllCorners cornerRadii:CGSizeMake(radius, radius)]; - //将Path添加到上下文中 - CGContextAddPath(UIGraphicsGetCurrentContext(), path.CGPath); - //裁剪上下文 - CGContextClip(UIGraphicsGetCurrentContext()); - //将图片绘制到上下文中 - [self drawInRect:rect]; - //设置绘制模式 - CGContextDrawPath(UIGraphicsGetCurrentContext(), kCGPathStroke); - //获取图片 - UIImage *output = UIGraphicsGetImageFromCurrentImageContext(); - //关闭上下文 - UIGraphicsEndImageContext(); - //返回裁剪好的图片 - return output; -} - -// 给图片添加图片水印 -+ (UIImage *)waterImageWithImage:(UIImage *)image waterImage:(UIImage *)waterImage waterImageRect:(CGRect)rect -{ - //1.获取图片 - //2.开启上下文 - UIGraphicsBeginImageContextWithOptions(image.size, NO, 0); - //3.绘制背景图片 - [image drawInRect:CGRectMake(0, 0, image.size.width, image.size.height)]; - //绘制水印图片到当前上下文 - [waterImage drawInRect:rect]; - //4.从上下文中获取新图片 - UIImage * newImage = UIGraphicsGetImageFromCurrentImageContext(); - //5.关闭图形上下文 - UIGraphicsEndImageContext(); - //返回图片 - return newImage; -} - -+ (CGSize)sizeWithImageOriginSize:(CGSize)originSize - minSize:(CGSize)imageMinSize - maxSize:(CGSize)imageMaxSiz { - CGSize size; - NSInteger imageWidth = originSize.width ,imageHeight = originSize.height; - NSInteger imageMinWidth = imageMinSize.width, imageMinHeight = imageMinSize.height; - NSInteger imageMaxWidth = imageMaxSiz.width, imageMaxHeight = imageMaxSiz.height; - if (imageWidth > imageHeight) //宽图 - { - size.height = imageMinHeight; //高度取最小高度 - size.width = imageWidth * imageMinHeight / imageHeight; - if (size.width > imageMaxWidth) - { - size.width = imageMaxWidth; - } - } - else if(imageWidth < imageHeight)//高图 - { - size.width = imageMinWidth; - size.height = imageHeight *imageMinWidth / imageWidth; - if (size.height > imageMaxHeight){ - size.height = imageMaxHeight; - } - } - else//方图 - { - if (imageWidth > imageMaxWidth){ - size.width = imageMaxWidth; - size.height = imageMaxHeight; - }else if(imageWidth > imageMinWidth){ - size.width = imageWidth; - size.height = imageHeight; - }else{ - size.width = imageMinWidth; - size.height = imageMinHeight; - } - } - return size; -} - -- (UIImage *)cutImage:(CGSize)newSize{ - - CGFloat scale = newSize.height / self.size.height; - UIImage *scaleImage = [self originImage:self scaleToSize:CGSizeMake(self.size.width*scale, self.size.height*scale)]; - //裁剪暂时有问题 - return scaleImage; -} - -- (UIImage *)resizeTo:(CGSize)size { - UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:size]; - return [renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull context) { - [self drawInRect:CGRectMake(0, 0, size.width, size.height)]; - }]; -} - -- (UIImage *)cropRightAndBottomPixels:(NSUInteger)pixels { - // 获取原图像的大小 - CGSize originalSize = self.size; - - // 计算新的裁剪后的图像大小 - CGSize newSize = CGSizeMake(originalSize.width - pixels, originalSize.height - pixels); - - // 开始图像上下文 - UIGraphicsBeginImageContextWithOptions(newSize, NO, self.scale); - - // 绘制裁剪后的图像到上下文 - [self drawAtPoint:CGPointZero]; - - // 获取裁剪后的图像 - UIImage *croppedImage = UIGraphicsGetImageFromCurrentImageContext(); - - // 结束图像上下文 - UIGraphicsEndImageContext(); - - return croppedImage; -} - -- (UIImage*) originImage:(UIImage *)image scaleToSize:(CGSize)size { - - UIGraphicsBeginImageContextWithOptions(size, NO, [UIScreen mainScreen].scale); - - [image drawInRect:CGRectMake(0, 0, size.width, size.height)]; - - UIImage* scaledImage = UIGraphicsGetImageFromCurrentImageContext(); - - UIGraphicsEndImageContext(); - - return scaledImage; -} - - --(UIImage *)compressWithMaxLength:(NSUInteger)maxLength{ - // Compress by quality - CGFloat compression = 1; - NSData *data = UIImageJPEGRepresentation(self, compression); - if (data.length < maxLength) return self; - - CGFloat max = 1; - CGFloat min = 0; - for (int i = 0; i < 6; ++i) { - compression = (max + min) / 2; - data = UIImageJPEGRepresentation(self, compression); - //NSLog(@"Compression = %.1f", compression); - //NSLog(@"In compressing quality loop, image size = %ld KB", data.length / 1024); - if (data.length < maxLength * 0.9) { - min = compression; - } else if (data.length > maxLength) { - max = compression; - } else { - break; - } - } - //NSLog(@"After compressing quality, image size = %ld KB", data.length / 1024); - if (data.length < maxLength) return self; - UIImage *resultImage = [UIImage imageWithData:data]; - // Compress by size - NSUInteger lastDataLength = 0; - while (data.length > maxLength && data.length != lastDataLength) { - lastDataLength = data.length; - CGFloat ratio = (CGFloat)maxLength / data.length; - //NSLog(@"Ratio = %.1f", ratio); - CGSize size = CGSizeMake((NSUInteger)(resultImage.size.width * sqrtf(ratio)), - (NSUInteger)(resultImage.size.height * sqrtf(ratio))); // Use NSUInteger to prevent white blank - UIGraphicsBeginImageContext(size); - [resultImage drawInRect:CGRectMake(0, 0, size.width, size.height)]; - resultImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - data = UIImageJPEGRepresentation(resultImage, compression); - //NSLog(@"In compressing size loop, image size = %ld KB", data.length / 1024); - } - if (data) { - return [UIImage imageWithData:data];; - } else { - return self; - } -} -- (UIImage *)roundedImageWithCornerRadius:(CGFloat)cornerRadius size:(CGSize)size{ - UIGraphicsBeginImageContextWithOptions(size, NO, 1); - UIBezierPath *clippingPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, size.width, size.height) cornerRadius:cornerRadius]; - [clippingPath addClip]; - [self drawInRect:CGRectMake(0, 0, size.width, size.height)]; - UIImage *roundedImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return roundedImage; -} -+(UIImage *)getImageFromView:(UIView *)view { - // 1. 创建一个新的图像上下文,大小与view的bounds相匹配 - UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0); - - // 2. 获取当前图像上下文 - CGContextRef context = UIGraphicsGetCurrentContext(); - - // 3. 将view的层级渲染到上下文中 - [view.layer renderInContext:context]; - - // 4. 从上下文中获取生成的图片 - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - - // 5. 结束图像上下文 - UIGraphicsEndImageContext(); - - // 6. 返回生成的图片 - return image; -} -+ (NSString *)getImageTypeWithImageData:(NSData *)data { - - uint8_t c; - - [data getBytes:&c length:1]; - - switch (c) { - - case 0xFF: - - return @"jpeg"; - - case 0x89: - - return @"png"; - - case 0x47: - - return @"gif"; - - case 0x49: - - case 0x4D: - - return @"tiff"; - - case 0x52: - - if ([data length] < 12) { - - return nil; - - } - - NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding]; - - if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) { - - return @"webp"; - - } - - return nil; - - } - - return nil; -} -+(UIImage *)getLanguageImage:(NSString *)image{ - NSString *curImage = image; - NSString *language = [NSBundle getLanguageText]; - - if (isMSZH()) { - // 不處理 - } else if (isMSTR()) { - image = [NSString stringWithFormat:@"%@_tr", image]; - } else if (isMSRTL()) { - image = [NSString stringWithFormat:@"%@_ar", image]; - } else { - image = [NSString stringWithFormat:@"%@_en", image]; - } - - // 尝试获取带语言后缀的图片 - UIImage *getImage = kImage(image); - - // 若图片不存在,尝试使用英语图片作为默认 - if (getImage == nil) { - NSString *defaultImageName = [NSString stringWithFormat:@"%@_en", curImage]; - getImage = kImage(defaultImageName) ?: kImage(curImage); - } - - return getImage; -} -+(NSString *)getLanguageText:(NSString *)image{ - NSString *curImage = image; - NSString *language = [NSBundle getLanguageText]; - if ([language isEqualToString:@"en"]){ - image = [NSString stringWithFormat:@"%@_en",image]; - } else if ([language isEqualToString:@"ar"]){ - image = [NSString stringWithFormat:@"%@_ar",image]; - } else if ([language isEqualToString:@"tr"]) { // 土耳其语默认使用英语内容 - image = [NSString stringWithFormat:@"%@_en",image]; - } - if (kImage(image) == nil){ - return curImage; - } - return image; -} - -- (UIImage *)imageByApplyingAlpha:(CGFloat)alpha { - UIGraphicsBeginImageContextWithOptions(self.size, NO, 0.0f); - CGContextRef ctx = UIGraphicsGetCurrentContext(); - CGRect area = CGRectMake(0, 0, self.size.width, self.size.height); - - CGContextScaleCTM(ctx, 1, -1); - CGContextTranslateCTM(ctx, 0, -area.size.height); - - CGContextSetBlendMode(ctx, kCGBlendModeMultiply); - CGContextSetAlpha(ctx, alpha); - CGContextDrawImage(ctx, area, self.CGImage); - - UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - - return newImage; -} - -@end diff --git a/YuMi/CustomUI/UIImageView/NetImageConfig.h.backup b/YuMi/CustomUI/UIImageView/NetImageConfig.h.backup deleted file mode 100644 index 9c00444..0000000 --- a/YuMi/CustomUI/UIImageView/NetImageConfig.h.backup +++ /dev/null @@ -1,22 +0,0 @@ -// -// NetImageConfig.h -// YUMI -// -// Created by zu on 2021/11/25. -// - -#import -#import "UIImageConstant.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface NetImageConfig : NSObject - -@property (nonatomic, assign) BOOL autoLoad; -@property (nonatomic, assign) ImageType imageType; -@property (nonatomic, assign) CGFloat radius; -@property (nonatomic, strong) UIImage * placeHolder; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/CustomUI/UIImageView/NetImageConfig.m.backup b/YuMi/CustomUI/UIImageView/NetImageConfig.m.backup deleted file mode 100644 index f1274d4..0000000 --- a/YuMi/CustomUI/UIImageView/NetImageConfig.m.backup +++ /dev/null @@ -1,21 +0,0 @@ -// -// NetImageConfig.m -// YUMI -// -// Created by zu on 2021/11/25. -// - -#import "NetImageConfig.h" - -@implementation NetImageConfig - -- (instancetype)init -{ - self = [super init]; - if (self) { - _autoLoad = YES; - } - return self; -} - -@end diff --git a/YuMi/CustomUI/UIImageView/NetImageView.h.backup b/YuMi/CustomUI/UIImageView/NetImageView.h.backup deleted file mode 100644 index d299c75..0000000 --- a/YuMi/CustomUI/UIImageView/NetImageView.h.backup +++ /dev/null @@ -1,45 +0,0 @@ -// -// NetImageView.h -// YUMI -// -// Created by zu on 2021/11/2. -// - -#import -#import "UIImageConstant.h" -#import "NetImageConfig.h" - -NS_ASSUME_NONNULL_BEGIN - -typedef void(^LoadCompletion)(UIImage *_Nullable image, NSURL * url); -typedef void(^LoadFail)(NSError *error); - -typedef NS_ENUM(NSInteger, NetImageState){ - NetImageStateUnload = 1, - NetImageStateLoading, - NetImageStateLoaded, -}; - -@interface NetImageView : UIImageView - -@property (nonatomic, assign, readonly) NetImageState state; -@property (nonatomic, copy) NSString* imageUrl; -@property (nonatomic, assign) NSInteger backgroundLightType; // 0: non; 1: gold; 2: gray; 3: purple - -- (instancetype)initWithUrl:(NSString * _Nonnull)imageUrl; -- (instancetype)initWithConfig:(NetImageConfig * _Nullable)config; -- (instancetype)initWithUrl:(NSString * _Nonnull)imageUrl config:(NetImageConfig * _Nullable)config; - -- (UIImage *)lightImage:(NSInteger)type; - -- (void)loadImage:(LoadCompletion _Nullable)completion; -- (void)loadImageWithUrl:(NSString * _Nonnull)imageUrl completion:(LoadCompletion _Nullable)completion; -- (void)loadImageWithUrl:(NSString * _Nonnull)imageUrl completion:(LoadCompletion _Nullable)completion fail:(LoadFail _Nullable)fail; - -- (void)updateConfigPlaceHolder:(UIImage *)image; - -- (void)cancelLoadImage; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/CustomUI/UIImageView/NetImageView.m.backup b/YuMi/CustomUI/UIImageView/NetImageView.m.backup deleted file mode 100644 index d773ec0..0000000 --- a/YuMi/CustomUI/UIImageView/NetImageView.m.backup +++ /dev/null @@ -1,151 +0,0 @@ -// -// NetImageView.m -// YUMI -// -// Created by zu on 2021/11/2. -// - -#import "NetImageView.h" -#import -#import - -@interface NetImageView() - -@property (nonatomic, assign, readwrite) NetImageState state; -@property (nonatomic, copy) NSString * innerConfigUrl; -@property (nonatomic, strong) NetImageConfig * config; -@property (nonatomic, strong) UIImageView *lightImageView; - -@end - -@implementation NetImageView - -- (instancetype)initWithUrl:(NSString *)url { - return [self initWithUrl:url config:nil]; -} - -- (instancetype)initWithConfig:(NetImageConfig *)config { - return [self initWithUrl:@"" config:config]; -} - -- (instancetype)initWithUrl:(NSString *)url config:(NetImageConfig *)config { - self = [super init]; - if (self) { - _state = NetImageStateUnload; - _config = config; - if (_config.autoLoad) { - [self setImageUrl:url]; - } else { - [self initImageUrl:url]; - } - - } - return self; -} - -- (void)cancelLoadImage { - [self sd_cancelCurrentImageLoad]; -} - -- (void)initImageUrl:(NSString *)imageUrl { - _imageUrl = imageUrl; - _innerConfigUrl = [UIImageConstant configUrl:_imageUrl type:self.config.imageType radius:self.config.radius]; -} - -- (void)setBackgroundLightType:(NSInteger)backgroundLightType { - _backgroundLightType = backgroundLightType; - if (!_lightImageView) { - _lightImageView = [[UIImageView alloc] init]; - [self insertSubview:_lightImageView atIndex:0]; - [_lightImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.mas_equalTo(self); - }]; - } - switch (_backgroundLightType) { - case 1: - _lightImageView.image = [UIImage imageNamed:@"room_pk_result_avatar_bg_yellow"]; - break; - case 2: - _lightImageView.image = [UIImage imageNamed:@"room_pk_result_avatar_bg_gray"]; - break; - case 3: - _lightImageView.image = [UIImage imageNamed:@"room_pk_result_avatar_bg_purple"]; - break; - default: - _lightImageView.image = nil; - break; - } -} - -- (UIImage *)lightImage:(NSInteger)type { - switch (type) { - case 1: - return [UIImage imageNamed:@"room_pk_result_avatar_bg_yellow"]; - case 2: - return [UIImage imageNamed:@"room_pk_result_avatar_bg_gray"]; - case 3: - return [UIImage imageNamed:@"room_pk_result_avatar_bg_purple"]; - default: - return nil; - } -} - -- (void)setImageUrl:(NSString *)imageUrl { - [self initImageUrl:imageUrl]; - [self loadImage:nil fail:nil]; -} - -- (void)loadImage:(LoadCompletion)completion { - [self loadImage:completion fail:nil]; -} - -- (void)loadImageWithUrl:(NSString *)imageUrl completion:(LoadCompletion)completion { - [self initImageUrl:imageUrl]; - [self loadImage:completion fail:nil]; -} - -- (void)loadImageWithUrl:(NSString * _Nonnull)imageUrl completion:(LoadCompletion _Nullable)completion fail:(LoadFail _Nullable)fail{ - [self initImageUrl:imageUrl]; - [self loadImage:completion fail:fail]; -} - -- (void)loadImage:(LoadCompletion _Nullable)completion fail:(LoadFail _Nullable)fail{ - self.state = NetImageStateLoading; - @kWeakify(self); - [self sd_setImageWithURL:[NSURL URLWithString:self.innerConfigUrl] - placeholderImage:self.config.placeHolder - options:SDWebImageRetryFailed | SDWebImageQueryMemoryData | SDWebImageQueryDiskDataSync - completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) { - @kStrongify(self); - dispatch_async(dispatch_get_main_queue(), ^{ - if (error) { - self.state = NetImageStateUnload; - if (fail){ - fail(error); - } - } else { - self.image = image; - self.state = NetImageStateLoaded; - if (completion) { - completion(image, imageURL); - }; - } - }); - }]; -} - -- (NetImageConfig *)config { - if (!_config) { - _config = [[NetImageConfig alloc] init]; - } - return _config; -} - -- (void)updateConfigPlaceHolder:(UIImage *)image { - self.config.placeHolder = image; - if (self.state == NetImageStateUnload) { - self.image = image; - } -} - -@end diff --git a/YuMi/CustomUI/UIImageView/UIImageConstant.h.backup b/YuMi/CustomUI/UIImageView/UIImageConstant.h.backup deleted file mode 100644 index 55a4cc5..0000000 --- a/YuMi/CustomUI/UIImageView/UIImageConstant.h.backup +++ /dev/null @@ -1,53 +0,0 @@ -// -// UIImageViewConstant.h -// YUMI -// -// Created by YUMI on 2021/9/17. -// 存放一些 加载图片 需要做的裁剪的key - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface UIImageConstant : NSObject - - -#pragma mark - 图片相关的 -UIKIT_EXTERN NSString * const kImageTypeRoomFace; //房间表情 -UIKIT_EXTERN NSString * const kImageTypeRoomGift; //房间礼物 -UIKIT_EXTERN NSString * const kImageTypeUserIcon; //用户头像60x60 -UIKIT_EXTERN NSString * const kImageTypeUserLibaryDetail;//用户相册大图nil -UIKIT_EXTERN NSString * const kImageTypeCornerAvatar;//圆角图形,会先把图形裁剪成正方形,并且转换为png -UIKIT_EXTERN NSString * const kImageTypeUserInfoAlbum;//用户信息里面相册 -UIKIT_EXTERN NSString * const kImageTypeUserCardLevel;///用户资料卡中 等级以高度20等比例缩放 -UIKIT_EXTERN NSString * const kImageTypeMonentsPhoto;///动态中的图片 -typedef NS_ENUM(NSUInteger, ImageType){ - ImageTypeRoomFace = 1, //房间表情 - ImageTypeRoomGift, //房间礼物 - ImageTypeUserIcon, //用户头像60x60 - ImageTypeUserLibaryDetail, //用户相册大图 - ImageTypeCornerAvatar, //圆角图形,会先把图形裁剪成正方形,并且转换为png - ImageTypeUserInfoAlbum, ///用户信息里面相册 - ImageTypeUserCardLevel, /// 用户资料卡中 等级以高度20等比例缩放 - ImageTypeMonentsPhoto, ///动态中的图片 -}; - -///展位图 - -/// 头像的默认占位图 -+ (UIImage *)defaultAvatarPlaceholder; -///空白头像缺省图 -+ (UIImage *)defaultEmptyAvatarPlaceholder; -/// 空白图的占位图 -+ (UIImage *)defaultEmptyPlaceholder; -+ (UIImage *)defaultEmptyPlaceholder_UFO; -/// banner的占位图 -+ (UIImage *)defaultBannerPlaceholder; - -+ (NSString*)configUrl:(NSString*)url type:(ImageType)type; -+ (NSString*)configUrl:(NSString*)url radius:(CGFloat)radius; -+ (NSString*)configUrl:(NSString*)url type:(ImageType)type radius:(CGFloat)radius; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/CustomUI/UIImageView/UIImageConstant.m.backup b/YuMi/CustomUI/UIImageView/UIImageConstant.m.backup deleted file mode 100644 index b5249f4..0000000 --- a/YuMi/CustomUI/UIImageView/UIImageConstant.m.backup +++ /dev/null @@ -1,119 +0,0 @@ -// -// UIImageViewConstant.m -// YUMI -// -// Created by YUMI on 2021/9/17. -// - -#import "UIImageConstant.h" - -@implementation UIImageConstant - -/// 房间表情 -NSString * const kImageTypeRoomFace = @""; -/// 房间礼物 -NSString * const kImageTypeRoomGift = @""; -/// 用户头像150x150 -NSString * const kImageTypeUserIcon = @"imageMogr2/auto-orient/thumbnail/150x150"; -/// 用户相册大图 -NSString * const kImageTypeUserLibaryDetail = @"imageMogr2/auto-orient/thumbnail/300x300"; -NSString * const kImageTypeCornerAvatar = @"imageMogr2/auto-orient/thumbnail/300x300/format/png"; -/// 用户信息里面相册 -NSString * const kImageTypeUserInfoAlbum = @"imageMogr2/auto-orient/blur/375x375"; -/// 用户信息里面相册 -NSString * const kImageTypeUserCardLevel = @"imageMogr2/thumbnail/x40"; -/// 动态中的图片 400 * 400 -NSString * const kImageTypeMonentsPhoto = @"imageMogr2/auto-orient/thumbnail/400x400"; - -/// 头像的默认占位图 -+ (UIImage *)defaultAvatarPlaceholder { - return [UIImage imageNamed:@"common_avatar"]; -} - -///空白头像缺省图 -+ (UIImage *)defaultEmptyAvatarPlaceholder { - return [UIImage imageNamed:@"common_avatar"]; -} - -/// 空白图的占位图 -+ (UIImage *)defaultEmptyPlaceholder { - return [UIImage imageNamed:@"common_empty"]; -} -/// banner的占位图 -+ (UIImage *)defaultBannerPlaceholder { - return [UIImage imageNamed:@"common_banner"]; -} - -+ (UIImage *)defaultEmptyPlaceholder_UFO { - return [UIImage imageNamed:@"common_empty_UFO"]; -} - - -+ (NSString *)configUrl:(NSString *)url type:(ImageType)type { - return [self configUrl:url type:type radius:0]; -} - -+ (NSString *)configUrl:(NSString *)url radius:(CGFloat)radius { - return [self configUrl:url type:-1 radius:radius]; -} - -+ (NSString *)configUrl:(NSString *)url type:(ImageType)type radius:(CGFloat)radius { - if (!url || url.length <= 0) return nil; - NSMutableString *urlString = [NSMutableString stringWithString:url]; - NSString *configUrl = nil; - switch (type) { - case ImageTypeUserIcon: - configUrl = kImageTypeUserIcon; - break; - case ImageTypeCornerAvatar: - configUrl = kImageTypeCornerAvatar; - break; - case ImageTypeRoomFace: - configUrl = kImageTypeRoomFace; - break; - case ImageTypeUserLibaryDetail: - configUrl = kImageTypeUserLibaryDetail; - break; - case ImageTypeRoomGift: - configUrl = kImageTypeRoomGift; - break; - case ImageTypeUserInfoAlbum: - configUrl = kImageTypeUserInfoAlbum; - break; - case ImageTypeUserCardLevel: - configUrl = kImageTypeUserCardLevel; - break; - case ImageTypeMonentsPhoto: - configUrl = kImageTypeMonentsPhoto; - break; - default: - break; - } - - if (configUrl) { - if ([url containsString:@"?"]) { - [urlString appendString:@"|"]; - }else{ - [urlString appendString:@"?"]; - } - [urlString appendString:configUrl]; - } - - if (radius > 0) { - [urlString appendString:[NSString stringWithFormat:@"|roundPic/radius/%f", radius]]; - } - - return percentEscapeString(urlString); -} - -NSString *percentEscapeString(NSString *string) { - // 创建一个包含所有不需要百分比编码的字符集 - NSMutableCharacterSet *allowedCharacterSet = [[NSCharacterSet URLQueryAllowedCharacterSet] mutableCopy]; - - // 手动删除你想要百分比编码的字符, 其余的非字符将会变成带 % 的转义符 - [allowedCharacterSet removeCharactersInString:@"|"]; - - return [string stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacterSet]; -} - -@end diff --git a/YuMi/CustomUI/UIViewCorner/UIView+Corner.h.backup b/YuMi/CustomUI/UIViewCorner/UIView+Corner.h.backup deleted file mode 100644 index 23781a5..0000000 --- a/YuMi/CustomUI/UIViewCorner/UIView+Corner.h.backup +++ /dev/null @@ -1,67 +0,0 @@ -// -// UIView+Corner.h -// YUMI -// -// Created by YUMI on 2022/6/15. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface UIView (Corner) -- (void)setCornerWithLeftTopCorner:(CGFloat)leftTop - rightTopCorner:(CGFloat)rigtTop - bottomLeftCorner:(CGFloat)bottemLeft - bottomRightCorner:(CGFloat)bottemRight - size:(CGSize)size; - -///** -// * 设置视图的圆角半径,边框宽度和颜色 -// * -// * @param radius 圆角半径 -// * @param corners 圆角位置 (可以组合使用 UIRectCornerTopLeft、UIRectCornerTopRight、UIRectCornerBottomLeft、UIRectCornerBottomRight) -// * @param borderWidth 边框宽度 -// * @param borderColor 边框颜色 -// */ -//- (void)setCornerRadius:(CGFloat)radius -// corners:(UIRectCorner)corners -// borderWidth:(CGFloat)borderWidth -// borderColor:(UIColor *)borderColor; - -/** - * 直接设置视图的圆角半径,应用到所有角 - * - * @param radius 圆角半径 - */ -- (void)setCornerRadius:(CGFloat)radius; - -/** - * 直接设置视图的圆角半径和指定角 - * - * @param radius 圆角半径 - * @param corners 指定需要圆角的位置 (UIRectCornerTopLeft, UIRectCornerTopRight, etc.) - */ -- (void)setCornerRadius:(CGFloat)radius corners:(UIRectCorner)corners; - -- (void)setCornerRadius:(CGFloat)radius cornerMask:(CACornerMask)cornerMask; - -/** - * 设置视图的指定圆角、圆角半径、边框宽度和边框颜色 - * - * @param radius 圆角半径 - * @param corners 需要圆角的角位置 (可以组合,例如 `kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner`) - * @param borderWidth 边框宽度 - * @param borderColor 边框颜色 - */ -- (void)setCornerRadius:(CGFloat)radius - corners:(CACornerMask)corners - borderWidth:(CGFloat)borderWidth - borderColor:(UIColor *)borderColor; - -- (void)setAllCornerRadius:(CGFloat)radius - borderWidth:(CGFloat)borderWidth - borderColor:(UIColor *)borderColor; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/CustomUI/UIViewCorner/UIView+Corner.m.backup b/YuMi/CustomUI/UIViewCorner/UIView+Corner.m.backup deleted file mode 100644 index b274a0f..0000000 --- a/YuMi/CustomUI/UIViewCorner/UIView+Corner.m.backup +++ /dev/null @@ -1,125 +0,0 @@ -// -// UIView+Corner.m -// YUMI -// -// Created by YUMI on 2022/6/15. -// - -#import "UIView+Corner.h" - -@implementation UIView (Corner) - -- (void)setCornerWithLeftTopCorner:(CGFloat)leftTop - rightTopCorner:(CGFloat)rigtTop - bottomLeftCorner:(CGFloat)bottemLeft - bottomRightCorner:(CGFloat)bottemRight - size:(CGSize)size { - - CGFloat width = size.width; - CGFloat height = size.height; - UIBezierPath *maskPath = [UIBezierPath bezierPath]; - maskPath.lineWidth = 1.0; - maskPath.lineCapStyle = kCGLineCapRound; - maskPath.lineJoinStyle = kCGLineJoinRound; - [maskPath moveToPoint:CGPointMake(bottemRight, height)]; //左下角 - [maskPath addLineToPoint:CGPointMake(width - bottemRight, height)]; - - [maskPath addQuadCurveToPoint:CGPointMake(width, height- bottemRight) controlPoint:CGPointMake(width, height)]; //右下角的圆弧 - [maskPath addLineToPoint:CGPointMake(width, rigtTop)]; //右边直线 - - [maskPath addQuadCurveToPoint:CGPointMake(width - rigtTop, 0) controlPoint:CGPointMake(width, 0)]; //右上角圆弧 - [maskPath addLineToPoint:CGPointMake(leftTop, 0)]; //顶部直线 - - [maskPath addQuadCurveToPoint:CGPointMake(0, leftTop) controlPoint:CGPointMake(0, 0)]; //左上角圆弧 - [maskPath addLineToPoint:CGPointMake(0, height - bottemLeft)]; //左边直线 - [maskPath addQuadCurveToPoint:CGPointMake(bottemLeft, height) controlPoint:CGPointMake(0, height)]; //左下角圆弧 - - CAShapeLayer *maskLayer = [CAShapeLayer layer]; - maskLayer.frame = CGRectMake(0, 0, size.width, size.height); - maskLayer.path = maskPath.CGPath; - self.layer.mask = maskLayer; -} - -//- (void)setCornerRadius:(CGFloat)radius -// corners:(UIRectCorner)corners -// borderWidth:(CGFloat)borderWidth -// borderColor:(UIColor *)borderColor { -// -// // 创建 UIBezierPath 并应用圆角 -// UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:self.bounds -// byRoundingCorners:corners -// cornerRadii:CGSizeMake(radius, radius)]; -// -// // 创建 CAShapeLayer 并设置 path -// CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; -// maskLayer.path = path.CGPath; -// self.layer.mask = maskLayer; -// -// // 设置边框 -// if (borderWidth > 0 && borderColor) { -// CAShapeLayer *borderLayer = [[CAShapeLayer alloc] init]; -// borderLayer.path = path.CGPath; -// borderLayer.lineWidth = borderWidth; -// borderLayer.strokeColor = borderColor.CGColor; -// borderLayer.fillColor = UIColor.clearColor.CGColor; -// borderLayer.frame = self.bounds; -// [self.layer addSublayer:borderLayer]; -// } -//} - -- (void)setCornerRadius:(CGFloat)radius { - self.layer.cornerRadius = radius; - self.layer.masksToBounds = YES; // 确保视图内容不会超出边界 -} - -- (void)setCornerRadius:(CGFloat)radius corners:(UIRectCorner)corners { - if (corners == UIRectCornerAllCorners) { - [self setCornerRadius:radius]; - } else { - // 如果是部分圆角,使用 `CAShapeLayer` 和 `UIBezierPath`,但仅在必要时使用 - UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:self.bounds - byRoundingCorners:corners - cornerRadii:CGSizeMake(radius, radius)]; - CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; - maskLayer.path = path.CGPath; - self.layer.mask = maskLayer; - } -} - -- (void)setCornerRadius:(CGFloat)radius cornerMask:(CACornerMask)cornerMask { - self.layer.maskedCorners = cornerMask; - self.layer.cornerRadius = radius; - self.layer.masksToBounds = YES; -} - - -- (void)setCornerRadius:(CGFloat)radius - corners:(CACornerMask)corners - borderWidth:(CGFloat)borderWidth - borderColor:(UIColor *)borderColor { - - // 设置指定角的圆角 - self.layer.cornerRadius = radius; - self.layer.maskedCorners = corners; - self.layer.masksToBounds = YES; // 确保内容不会超出边界 - - // 设置边框 - self.layer.borderWidth = borderWidth; - self.layer.borderColor = borderColor.CGColor; -} - -- (void)setAllCornerRadius:(CGFloat)radius - borderWidth:(CGFloat)borderWidth - borderColor:(UIColor *)borderColor { - // 设置指定角的圆角 - self.layer.cornerRadius = radius; - self.layer.maskedCorners = UIRectCornerTopLeft | UIRectCornerTopRight | UIRectCornerBottomLeft | UIRectCornerBottomRight; - self.layer.masksToBounds = YES; // 确保内容不会超出边界 - - // 设置边框 - self.layer.borderWidth = borderWidth; - self.layer.borderColor = borderColor.CGColor; -} - -@end - diff --git a/YuMi/CustomUI/UIViewGradientLayer/UIView+GradientLayer.h.backup b/YuMi/CustomUI/UIViewGradientLayer/UIView+GradientLayer.h.backup deleted file mode 100644 index 26d1df4..0000000 --- a/YuMi/CustomUI/UIViewGradientLayer/UIView+GradientLayer.h.backup +++ /dev/null @@ -1,37 +0,0 @@ -// -// UIView+GradientLayer.h -// YuMi -// -// Created by P on 2024/11/18. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface UIView (GradientLayer) - -/// 为视图添加渐变背景 -/// @param colors 渐变颜色数组 (NSArray *) -/// @param startPoint 渐变起点 (CGPoint) -/// @param endPoint 渐变终点 (CGPoint) -/// @param cornerRadius 圆角半径 (CGFloat) -- (void)addGradientBackgroundWithColors:(NSArray *)colors - startPoint:(CGPoint)startPoint - endPoint:(CGPoint)endPoint - cornerRadius:(CGFloat)cornerRadius; - -/// 移除渐变背景 -- (void)removeGradientBackground; - -/// 更新渐变背景 -/// @param colors 渐变颜色数组 (NSArray *) -/// @param startPoint 渐变起点 (CGPoint) -/// @param endPoint 渐变终点 (CGPoint) -- (void)updateGradientBackgroundWithColors:(NSArray *)colors - startPoint:(CGPoint)startPoint - endPoint:(CGPoint)endPoint; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/CustomUI/UIViewGradientLayer/UIView+GradientLayer.m.backup b/YuMi/CustomUI/UIViewGradientLayer/UIView+GradientLayer.m.backup deleted file mode 100644 index f71feb9..0000000 --- a/YuMi/CustomUI/UIViewGradientLayer/UIView+GradientLayer.m.backup +++ /dev/null @@ -1,120 +0,0 @@ -// -// UIView+GradientLayer.m -// YuMi -// -// Created by P on 2024/11/18. -// - -#import "UIView+GradientLayer.h" -#import - -@implementation UIView (GradientLayer) - -static NSString * const kGradientLayerName = @"GradientLayer"; -static void *kGradientObserverKey = &kGradientObserverKey; - -// 添加渐变背景 -- (void)addGradientBackgroundWithColors:(NSArray *)colors - startPoint:(CGPoint)startPoint - endPoint:(CGPoint)endPoint - cornerRadius:(CGFloat)cornerRadius { - // 确保移除已有的渐变背景和 KVO 监听 - [self removeGradientBackground]; - - // 创建渐变图层 - CAGradientLayer *gradientLayer = [CAGradientLayer layer]; - gradientLayer.name = kGradientLayerName; - gradientLayer.colors = [self cgColorsFromUIColors:colors]; - gradientLayer.startPoint = startPoint; - gradientLayer.endPoint = endPoint; - gradientLayer.cornerRadius = cornerRadius; - - // 初次设置 frame - gradientLayer.frame = self.bounds; - - [self.layer insertSublayer:gradientLayer atIndex:0]; - - // 添加 KVO 监听 - [self setupLayoutObserverForGradientLayer:gradientLayer]; -} - -// 动态更新渐变背景 -- (void)updateGradientBackgroundWithColors:(NSArray *)colors - startPoint:(CGPoint)startPoint - endPoint:(CGPoint)endPoint { - CAGradientLayer *gradientLayer = [self gradientLayer]; - if (gradientLayer) { - gradientLayer.colors = [self cgColorsFromUIColors:colors]; - gradientLayer.startPoint = startPoint; - gradientLayer.endPoint = endPoint; - } -} - -// 移除渐变背景和监听 -- (void)removeGradientBackground { - // 移除渐变图层 - CAGradientLayer *gradientLayer = [self gradientLayer]; - if (gradientLayer) { - [gradientLayer removeFromSuperlayer]; - } - - // 移除 KVO 监听 - if ([self hasAddedObserver]) { - [self removeObserver:self forKeyPath:@"bounds"]; - [self setHasAddedObserver:NO]; - } -} - -// 获取渐变图层 -- (CAGradientLayer *)gradientLayer { - for (CALayer *layer in self.layer.sublayers) { - if ([layer.name isEqualToString:kGradientLayerName] && - [layer isKindOfClass:[CAGradientLayer class]]) { - return (CAGradientLayer *)layer; - } - } - return nil; -} - -// 添加 KVO 监听 -- (void)setupLayoutObserverForGradientLayer:(CAGradientLayer *)gradientLayer { - if (![self hasAddedObserver]) { - [self addObserver:self forKeyPath:@"bounds" options:NSKeyValueObservingOptionNew context:(__bridge void *)gradientLayer]; - [self setHasAddedObserver:YES]; - } -} - -// KVO 监听回调 -- (void)observeValueForKeyPath:(NSString *)keyPath - ofObject:(id)object - change:(NSDictionary *)change - context:(void *)context { - if ([keyPath isEqualToString:@"bounds"]) { - CAGradientLayer *gradientLayer = (__bridge CAGradientLayer *)context; - gradientLayer.frame = self.bounds; // 更新渐变图层的 frame - } else { - [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; - } -} - -// 工具方法:转换颜色数组 -- (NSArray *)cgColorsFromUIColors:(NSArray *)colors { - NSMutableArray *cgColors = [NSMutableArray array]; - for (UIColor *color in colors) { - [cgColors addObject:(id)color.CGColor]; - } - return [cgColors copy]; -} - -// 工具方法:判断是否已注册 KVO -- (BOOL)hasAddedObserver { - return [objc_getAssociatedObject(self, kGradientObserverKey) boolValue]; -} - -// 工具方法:设置是否已注册 KVO -- (void)setHasAddedObserver:(BOOL)added { - objc_setAssociatedObject(self, kGradientObserverKey, @(added), OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - - -@end diff --git a/YuMi/CustomUI/VagueImageView/UIImage+ImageEffects.h.backup b/YuMi/CustomUI/VagueImageView/UIImage+ImageEffects.h.backup deleted file mode 100755 index 3033e40..0000000 --- a/YuMi/CustomUI/VagueImageView/UIImage+ImageEffects.h.backup +++ /dev/null @@ -1,108 +0,0 @@ -/* - File: UIImage+ImageEffects.h - Abstract: This is a category of UIImage that adds methods to apply blur and tint effects to an image. This is the code you’ll want to look out to find out how to use vImage to efficiently calculate a blur. - Version: 1.0 - - Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple - Inc. ("Apple") in consideration of your agreement to the following - terms, and your use, installation, modification or redistribution of - this Apple software constitutes acceptance of these terms. If you do - not agree with these terms, please do not use, install, modify or - redistribute this Apple software. - - In consideration of your agreement to abide by the following terms, and - subject to these terms, Apple grants you a personal, non-exclusive - license, under Apple's copyrights in this original Apple software (the - "Apple Software"), to use, reproduce, modify and redistribute the Apple - Software, with or without modifications, in source and/or binary forms; - provided that if you redistribute the Apple Software in its entirety and - without modifications, you must retain this notice and the following - text and disclaimers in all such redistributions of the Apple Software. - Neither the name, trademarks, service marks or logos of Apple Inc. may - be used to endorse or promote products derived from the Apple Software - without specific prior written permission from Apple. Except as - expressly stated in this notice, no other rights or licenses, express or - implied, are granted by Apple herein, including but not limited to any - patent rights that may be infringed by your derivative works or by other - works in which the Apple Software may be incorporated. - - The Apple Software is provided by Apple on an "AS IS" basis. APPLE - MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION - THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS - FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND - OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. - - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, - MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED - AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), - STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - - Copyright (C) 2013 Apple Inc. All Rights Reserved. - - - Copyright © 2013 Apple Inc. All rights reserved. - WWDC 2013 License - - NOTE: This Apple Software was supplied by Apple as part of a WWDC 2013 - Session. Please refer to the applicable WWDC 2013 Session for further - information. - - IMPORTANT: This Apple software is supplied to you by Apple Inc. - ("Apple") in consideration of your agreement to the following terms, and - your use, installation, modification or redistribution of this Apple - software constitutes acceptance of these terms. If you do not agree with - these terms, please do not use, install, modify or redistribute this - Apple software. - - In consideration of your agreement to abide by the following terms, and - subject to these terms, Apple grants you a non-exclusive license, under - Apple's copyrights in this original Apple software (the "Apple - Software"), to use, reproduce, modify and redistribute the Apple - Software, with or without modifications, in source and/or binary forms; - provided that if you redistribute the Apple Software in its entirety and - without modifications, you must retain this notice and the following - text and disclaimers in all such redistributions of the Apple Software. - Neither the name, trademarks, service marks or logos of Apple Inc. may - be used to endorse or promote products derived from the Apple Software - without specific prior written permission from Apple. Except as - expressly stated in this notice, no other rights or licenses, express or - implied, are granted by Apple herein, including but not limited to any - patent rights that may be infringed by your derivative works or by other - works in which the Apple Software may be incorporated. - - The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES - NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND - OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. - - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, - MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED - AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), - STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - - EA1002 - 5/3/2013 - */ - -#import - -@interface UIImage (ImageEffects) - -- (UIImage *)applyLightEffect; -- (UIImage *)applyExtraLightEffect; -- (UIImage *)applyDarkEffect; -- (UIImage *)applyTintEffectWithColor:(UIColor *)tintColor; - -- (UIImage *)applyBlurWithRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor maskImage:(UIImage *)maskImage; -///为图片增加毛玻璃,value模糊程度 -+(UIImage *)setBlurImage:(UIImage *)image value:(CGFloat)value; -@end diff --git a/YuMi/CustomUI/VagueImageView/UIImage+ImageEffects.m.backup b/YuMi/CustomUI/VagueImageView/UIImage+ImageEffects.m.backup deleted file mode 100755 index 606bffd..0000000 --- a/YuMi/CustomUI/VagueImageView/UIImage+ImageEffects.m.backup +++ /dev/null @@ -1,309 +0,0 @@ -/* - File: UIImage+ImageEffects.m - Abstract: This is a category of UIImage that adds methods to apply blur and tint effects to an image. This is the code you’ll want to look out to find out how to use vImage to efficiently calculate a blur. - Version: 1.0 - - Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple - Inc. ("Apple") in consideration of your agreement to the following - terms, and your use, installation, modification or redistribution of - this Apple software constitutes acceptance of these terms. If you do - not agree with these terms, please do not use, install, modify or - redistribute this Apple software. - - In consideration of your agreement to abide by the following terms, and - subject to these terms, Apple grants you a personal, non-exclusive - license, under Apple's copyrights in this original Apple software (the - "Apple Software"), to use, reproduce, modify and redistribute the Apple - Software, with or without modifications, in source and/or binary forms; - provided that if you redistribute the Apple Software in its entirety and - without modifications, you must retain this notice and the following - text and disclaimers in all such redistributions of the Apple Software. - Neither the name, trademarks, service marks or logos of Apple Inc. may - be used to endorse or promote products derived from the Apple Software - without specific prior written permission from Apple. Except as - expressly stated in this notice, no other rights or licenses, express or - implied, are granted by Apple herein, including but not limited to any - patent rights that may be infringed by your derivative works or by other - works in which the Apple Software may be incorporated. - - The Apple Software is provided by Apple on an "AS IS" basis. APPLE - MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION - THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS - FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND - OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. - - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, - MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED - AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), - STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - - Copyright (C) 2013 Apple Inc. All Rights Reserved. - - - Copyright © 2013 Apple Inc. All rights reserved. - WWDC 2013 License - - NOTE: This Apple Software was supplied by Apple as part of a WWDC 2013 - Session. Please refer to the applicable WWDC 2013 Session for further - information. - - IMPORTANT: This Apple software is supplied to you by Apple Inc. - ("Apple") in consideration of your agreement to the following terms, and - your use, installation, modification or redistribution of this Apple - software constitutes acceptance of these terms. If you do not agree with - these terms, please do not use, install, modify or redistribute this - Apple software. - - In consideration of your agreement to abide by the following terms, and - subject to these terms, Apple grants you a non-exclusive license, under - Apple's copyrights in this original Apple software (the "Apple - Software"), to use, reproduce, modify and redistribute the Apple - Software, with or without modifications, in source and/or binary forms; - provided that if you redistribute the Apple Software in its entirety and - without modifications, you must retain this notice and the following - text and disclaimers in all such redistributions of the Apple Software. - Neither the name, trademarks, service marks or logos of Apple Inc. may - be used to endorse or promote products derived from the Apple Software - without specific prior written permission from Apple. Except as - expressly stated in this notice, no other rights or licenses, express or - implied, are granted by Apple herein, including but not limited to any - patent rights that may be infringed by your derivative works or by other - works in which the Apple Software may be incorporated. - - The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES - NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND - OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. - - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, - MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED - AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), - STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - - EA1002 - 5/3/2013 - */ - -#import "UIImage+ImageEffects.h" - -#import -#import - - -@implementation UIImage (ImageEffects) - - -- (UIImage *)applyLightEffect -{ - UIColor *tintColor = [UIColor colorWithWhite:1.0 alpha:0.3]; - return [self applyBlurWithRadius:30 tintColor:tintColor saturationDeltaFactor:1.8 maskImage:nil]; -} - - -- (UIImage *)applyExtraLightEffect -{ - UIColor *tintColor = [UIColor colorWithWhite:0.97 alpha:0.82]; - return [self applyBlurWithRadius:20 tintColor:tintColor saturationDeltaFactor:1.8 maskImage:nil]; -} - - -- (UIImage *)applyDarkEffect -{ - UIColor *tintColor = [UIColor colorWithWhite:0.11 alpha:0.73]; - return [self applyBlurWithRadius:20 tintColor:tintColor saturationDeltaFactor:1.8 maskImage:nil]; -} - - -- (UIImage *)applyTintEffectWithColor:(UIColor *)tintColor -{ - const CGFloat EffectColorAlpha = 0.6; - UIColor *effectColor = tintColor; - int componentCount = CGColorGetNumberOfComponents(tintColor.CGColor); - if (componentCount == 2) { - CGFloat b; - if ([tintColor getWhite:&b alpha:NULL]) { - effectColor = [UIColor colorWithWhite:b alpha:EffectColorAlpha]; - } - } - else { - CGFloat r, g, b; - if ([tintColor getRed:&r green:&g blue:&b alpha:NULL]) { - effectColor = [UIColor colorWithRed:r green:g blue:b alpha:EffectColorAlpha]; - } - } - return [self applyBlurWithRadius:10 tintColor:effectColor saturationDeltaFactor:-1.0 maskImage:nil]; -} - - -- (UIImage *)applyBlurWithRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor maskImage:(UIImage *)maskImage -{ - // Check pre-conditions. - if (self.size.width < 1 || self.size.height < 1) { -// NSLog (@"*** error: invalid size: (%.2f x %.2f). Both dimensions must be >= 1: %@", self.size.width, self.size.height, self); - return nil; - } - if (!self.CGImage) { -// NSLog (@"*** error: image must be backed by a CGImage: %@", self); - return nil; - } - if (maskImage && !maskImage.CGImage) { -// NSLog (@"*** error: maskImage must be backed by a CGImage: %@", maskImage); - return nil; - } - - CGRect imageRect = { CGPointZero, self.size }; - UIImage *effectImage = self; - - BOOL hasBlur = blurRadius > __FLT_EPSILON__; - BOOL hasSaturationChange = fabs(saturationDeltaFactor - 1.) > __FLT_EPSILON__; - if (hasBlur || hasSaturationChange) { - UIGraphicsBeginImageContextWithOptions(self.size, NO, [[UIScreen mainScreen] scale]); - CGContextRef effectInContext = UIGraphicsGetCurrentContext(); - CGContextScaleCTM(effectInContext, 1.0, -1.0); - CGContextTranslateCTM(effectInContext, 0, -self.size.height); - CGContextDrawImage(effectInContext, imageRect, self.CGImage); - - vImage_Buffer effectInBuffer; - effectInBuffer.data = CGBitmapContextGetData(effectInContext); - effectInBuffer.width = CGBitmapContextGetWidth(effectInContext); - effectInBuffer.height = CGBitmapContextGetHeight(effectInContext); - effectInBuffer.rowBytes = CGBitmapContextGetBytesPerRow(effectInContext); - - UIGraphicsBeginImageContextWithOptions(self.size, NO, [[UIScreen mainScreen] scale]); - CGContextRef effectOutContext = UIGraphicsGetCurrentContext(); - vImage_Buffer effectOutBuffer; - effectOutBuffer.data = CGBitmapContextGetData(effectOutContext); - effectOutBuffer.width = CGBitmapContextGetWidth(effectOutContext); - effectOutBuffer.height = CGBitmapContextGetHeight(effectOutContext); - effectOutBuffer.rowBytes = CGBitmapContextGetBytesPerRow(effectOutContext); - - if (hasBlur) { - // A description of how to compute the box kernel width from the Gaussian - // radius (aka standard deviation) appears in the SVG spec: - // http://www.w3.org/TR/SVG/filters.html#feGaussianBlurElement - // - // For larger values of 's' (s >= 2.0), an approximation can be used: Three - // successive box-blurs build a piece-wise quadratic convolution kernel, which - // approximates the Gaussian kernel to within roughly 3%. - // - // let d = floor(s * 3*sqrt(2*pi)/4 + 0.5) - // - // ... if d is odd, use three box-blurs of size 'd', centered on the output pixel. - // - CGFloat inputRadius = blurRadius * [[UIScreen mainScreen] scale]; - NSUInteger radius = floor(inputRadius * 3. * sqrt(2 * M_PI) / 4 + 0.5); - if (radius % 2 != 1) { - radius += 1; // force radius to be odd so that the three box-blur methodology works. - } - vImageBoxConvolve_ARGB8888(&effectInBuffer, &effectOutBuffer, NULL, 0, 0, radius, radius, 0, kvImageEdgeExtend); - vImageBoxConvolve_ARGB8888(&effectOutBuffer, &effectInBuffer, NULL, 0, 0, radius, radius, 0, kvImageEdgeExtend); - vImageBoxConvolve_ARGB8888(&effectInBuffer, &effectOutBuffer, NULL, 0, 0, radius, radius, 0, kvImageEdgeExtend); - } - BOOL effectImageBuffersAreSwapped = NO; - if (hasSaturationChange) { - CGFloat s = saturationDeltaFactor; - CGFloat floatingPointSaturationMatrix[] = { - 0.0722 + 0.9278 * s, 0.0722 - 0.0722 * s, 0.0722 - 0.0722 * s, 0, - 0.7152 - 0.7152 * s, 0.7152 + 0.2848 * s, 0.7152 - 0.7152 * s, 0, - 0.2126 - 0.2126 * s, 0.2126 - 0.2126 * s, 0.2126 + 0.7873 * s, 0, - 0, 0, 0, 1, - }; - const int32_t divisor = 256; - NSUInteger matrixSize = sizeof(floatingPointSaturationMatrix)/sizeof(floatingPointSaturationMatrix[0]); - int16_t saturationMatrix[matrixSize]; - for (NSUInteger i = 0; i < matrixSize; ++i) { - saturationMatrix[i] = (int16_t)roundf(floatingPointSaturationMatrix[i] * divisor); - } - if (hasBlur) { - vImageMatrixMultiply_ARGB8888(&effectOutBuffer, &effectInBuffer, saturationMatrix, divisor, NULL, NULL, kvImageNoFlags); - effectImageBuffersAreSwapped = YES; - } - else { - vImageMatrixMultiply_ARGB8888(&effectInBuffer, &effectOutBuffer, saturationMatrix, divisor, NULL, NULL, kvImageNoFlags); - } - } - if (!effectImageBuffersAreSwapped) - effectImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - - if (effectImageBuffersAreSwapped) - effectImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - } - - // Set up output context. - UIGraphicsBeginImageContextWithOptions(self.size, NO, [[UIScreen mainScreen] scale]); - CGContextRef outputContext = UIGraphicsGetCurrentContext(); - CGContextScaleCTM(outputContext, 1.0, -1.0); - CGContextTranslateCTM(outputContext, 0, -self.size.height); - - // Draw base image. - CGContextDrawImage(outputContext, imageRect, self.CGImage); - - // Draw effect image. - if (hasBlur) { - CGContextSaveGState(outputContext); - if (maskImage) { - CGContextClipToMask(outputContext, imageRect, maskImage.CGImage); - } - CGContextDrawImage(outputContext, imageRect, effectImage.CGImage); - CGContextRestoreGState(outputContext); - } - - // Add in color tint. - if (tintColor) { - CGContextSaveGState(outputContext); - CGContextSetFillColorWithColor(outputContext, tintColor.CGColor); - CGContextFillRect(outputContext, imageRect); - CGContextRestoreGState(outputContext); - } - - // Output image is ready. - UIImage *outputImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - - return outputImage; -} -+(UIImage *)setBlurImage:(UIImage *)image value:(CGFloat)value{ - - - CIContext *context = [CIContext contextWithOptions:nil]; - CIImage * sourceImage = [CIImage imageWithCGImage:image.CGImage];//将图片转换成CIImage - - ///图片仿射滤镜 - - CIFilter * clamp = [CIFilter filterWithName:@"CIAffineClamp"];//设置绘制类型 - - [clamp setValue:sourceImage forKey:kCIInputImageKey];//设置要绘制的图片 - - CIImage *clampResult = [clamp valueForKey:kCIOutputImageKey]; - - ///高斯模糊滤镜 - - CIFilter* gaussianBlur = [CIFilter filterWithName:@"CIGaussianBlur"]; - - [gaussianBlur setValue:clampResult forKey:kCIInputImageKey]; - - [gaussianBlur setValue:[NSNumber numberWithFloat:value] forKey:@"inputRadius"];//设置模糊值 - - CIImage * gaussianBlurResult = [gaussianBlur valueForKey:kCIOutputImageKey]; - - ///转化获取图片 - - CGImageRef cgImage = [context createCGImage:gaussianBlurResult fromRect:[sourceImage extent]]; - - UIImage * resultImage = [UIImage imageWithCGImage:cgImage]; - return resultImage; - -} - -@end diff --git a/YuMi/CustomUI/XCCurrentVCStackManager.h.backup b/YuMi/CustomUI/XCCurrentVCStackManager.h.backup deleted file mode 100644 index aaa03a8..0000000 --- a/YuMi/CustomUI/XCCurrentVCStackManager.h.backup +++ /dev/null @@ -1,31 +0,0 @@ -// -// YMCurrentVCStackManager.h -// YMBaseUIKit -// -// Created by 卫明何 on 2018/8/9. -// Copyright © 2018年 YUIMI. All rights reserved. -// - -#import -#import - -@interface XCCurrentVCStackManager : NSObject - -+ (instancetype)shareManager; - -/** - 当前的导航控制器 - - @return 导航控制器 - */ -- (UINavigationController *)currentNavigationController; - -/** - 当前最顶层控制器 - - @return 当前最顶层控制器 - */ -- (UIViewController *)getCurrentVC; - - -@end diff --git a/YuMi/CustomUI/XCCurrentVCStackManager.m.backup b/YuMi/CustomUI/XCCurrentVCStackManager.m.backup deleted file mode 100644 index 41a4372..0000000 --- a/YuMi/CustomUI/XCCurrentVCStackManager.m.backup +++ /dev/null @@ -1,123 +0,0 @@ -// -// YMCurrentVCStackManager.m -// YMBaseUIKit -// -// Created by 卫明何 on 2018/8/9. -// Copyright © 2018年 YUIMI. All rights reserved. -// - -#import "XCCurrentVCStackManager.h" - -NSString * const kRoomChatPushViewKey = @"kRoomChatPushViewKey"; -@implementation XCCurrentVCStackManager - -+ (instancetype)shareManager { - static dispatch_once_t onceToken = 0; - static id instance; - dispatch_once(&onceToken, ^{ - instance = [[self alloc] init]; - }); - - return instance; -} - -- (UIViewController *)getCurrentVC { - ///兼容房间内私聊的 - [[NSNotificationCenter defaultCenter] postNotificationName:kRoomChatPushViewKey object:nil]; - - UIViewController *rootViewController = [UIApplication sharedApplication].delegate.window.rootViewController; - UIViewController *currentVC = [self getCurrentVCFrom:rootViewController]; - return currentVC; -} - -- (UIViewController *)getCurrentVCFrom:(UIViewController *)rootVC { - UIViewController *currentVC; - if ([rootVC presentedViewController]) { - // 视图是被presented出来的 - rootVC = [rootVC presentedViewController]; - } - if ([rootVC isKindOfClass:[UITabBarController class]]) { - // 根视图为UITabBarController - currentVC = [self getCurrentVCFrom:[(UITabBarController *)rootVC selectedViewController]]; - - } else if ([rootVC isKindOfClass:[UINavigationController class]]) { - // 根视图为UINavigationController - currentVC = [self getCurrentVCFrom:[(UINavigationController *)rootVC visibleViewController]]; - - } else { - // 根视图为非导航类 - currentVC = rootVC; - } - return currentVC; -} - -- (UIViewController *)currentViewController { - UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow; - UIViewController *vc = keyWindow.rootViewController; - while (vc.presentedViewController) { - vc = vc.presentedViewController; - if ([vc isKindOfClass:[UINavigationController class]]) { - vc = [(UINavigationController *)vc visibleViewController]; - } - else if ([vc isKindOfClass:[UITabBarController class]]) { - vc = [(UITabBarController *)vc selectedViewController]; - } - } - return vc; -} - -- (UINavigationController *)currentNavigationController { - return [self currentNC]; -} - -- (UINavigationController *)currentNC{ - if (![[UIApplication sharedApplication].windows.lastObject isKindOfClass:[UIWindow class]]) { - NSAssert(0, @"未获取到导航控制器"); - return nil; - } - UIViewController *rootViewController = [UIApplication sharedApplication].keyWindow.rootViewController; - return [self getCurrentNCFrom:rootViewController]; -} - - -//递归 -- (UINavigationController *)getCurrentNCFrom:(UIViewController *)vc{ - if ([vc isKindOfClass:NSClassFromString(@"MMDrawerController")]) { - vc = (UIViewController *)[vc valueForKey:@"centerViewController"]; - } - if ([vc isKindOfClass:[UITabBarController class]]) { - UINavigationController *nc = ((UITabBarController *)vc).selectedViewController; - return [self getCurrentNCFrom:nc]; - } - else if ([vc isKindOfClass:[UINavigationController class]]) { - if (((UINavigationController *)vc).presentedViewController) { - return [self getCurrentNCFrom:((UINavigationController *)vc).presentedViewController]; - } - return [self getCurrentNCFrom:((UINavigationController *)vc).topViewController]; - } - else if ([vc isKindOfClass:[UIViewController class]]) { - if (vc.presentedViewController) { - return [self getCurrentNCFrom:vc.presentedViewController]; - } - else { - if (!vc.navigationController) { - if (vc.presentingViewController) { - [vc dismissViewControllerAnimated:NO completion:nil]; - - return [self getCurrentNCFrom:vc.presentingViewController]; - } else { - NSAssert(0, @"未获取到导航控制器"); - return nil; - } - } else { - return vc.navigationController; - } - } - } - else { - NSAssert(0, @"未获取到导航控制器"); - return nil; - } -} - -@end diff --git a/YuMi/CustomUI/XNDJTDDLoadingTool.h.backup b/YuMi/CustomUI/XNDJTDDLoadingTool.h.backup deleted file mode 100644 index 039a7c9..0000000 --- a/YuMi/CustomUI/XNDJTDDLoadingTool.h.backup +++ /dev/null @@ -1,148 +0,0 @@ -// -// YMHUDTool.h -// TTPlay -// -// Created by YM on 2022/5/15. -// Copyright © 2023 YUMI. All rights reserved. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - showGIFLoading使用注意: - 1.谁负责showLoading, 谁负责hideHUD - 2.showLoading是指定了加载在那个View, hideHUD时请指定hide那个view的hud - */ - -@interface XNDJTDDLoadingTool : NSObject -/** - 隐藏HUD - */ -+ (void)hideHUD; - -/** - 隐藏HUD, 如果view为nil, 则默认隐藏主窗口的HUD - - @param view view - */ -+ (void)hideHUDInView:(nullable UIView *)view; - - -+(void)hideOnlyView:(UIView *)view; -+(void)showOnlyView:(UIView *)view; - - - -/** - 显示成功message, 默认显示在窗口上, 2.5s后消失, 默认不拦截点击事件 - - @param message 文字 - */ -+ (void)showSuccessWithMessage:(NSString *)message; - -/** - 显示成功message, 2.5s后消失, 默认不拦截点击事件 - - @param message 文字 - @param view 显示在哪个view上 - */ -+ (void)showSuccessWithMessage:(NSString *)message inView:(nullable UIView *)view; - -/** - 显示成功message - - @param message 文字 - @param view 显示在哪个view上 - @param afterDelay 延迟消失时间 - @param enabled 是否可以拦截事件 no:不拦截 yes:拦截 - */ -+ (void)showSuccessWithMessage:(NSString *)message inView:(nullable UIView *)view delay:(NSTimeInterval)afterDelay enabled:(BOOL)enabled; - -/** - 显示错误message, 默认显示在窗口上, 2.5s后消失, 默认不拦截点击事件 - - @param message 文字 - */ -+ (void)showErrorWithMessage:(NSString *)message; - -/** - 显示错误message, 2.5s后消失, 默认不拦截点击事件 - - @param message 文字 - @param view 显示在哪个view上 - */ -+ (void)showErrorWithMessage:(NSString *)message inView:(nullable UIView *)view; - -/** - 显示错误message - - @param message 文字 - @param view 显示在哪个view上 - @param afterDelay 延迟消失时间 - @param enabled 是否可以拦截事件 no:不拦截 yes:拦截 - */ -+ (void)showErrorWithMessage:(NSString *)message inView:(nullable UIView *)view delay:(NSTimeInterval)afterDelay enabled:(BOOL)enabled; - -/** - 在窗口上显示自定义GIFLoading, 背景默认黑色0.35透明度, 默认拦截点击事件 - */ -+ (void)showGIFLoading; - -/** - 在指定的view上显示自定义GIFLoading, 背景默认黑色0.35透明度, 默认拦截点击事件 - - @param view 显示在哪个view上 - */ -+ (void)showGIFLoadingInView:(nullable UIView *)view; - -/** - 在指定的view上显示自定义GIFLoading - - @param view 显示在哪个view上 - @param bgColor 背景颜色, 遮盖 - @param enabled 是否可以拦截事件 no:不拦截 yes:拦截 - */ -+ (void)showGIFLoadingInView:(nullable UIView *)view bgColor:(nullable UIColor *)bgColor enabled:(BOOL)enabled; - -/** - 加载下一个个播房 - */ -+ (void)showAnchorLoading; - -+ (void)showAnchorLoading:(UIView *)view; - -/** - 在窗口上显示菊花 - */ -+ (void)showLoading; - -/** - 在view上显示菊花 - */ -+ (void)showLoadingInView:(nullable UIView *)view; - -/** - 在view上显示菊花 - */ -+ (void)showLoadingInView:(nullable UIView *)view enabled:(BOOL)enabled; - -/** - 在窗口上显示菊花+文字 - */ -+ (void)showLoadingWithMessage:(NSString *)message; - -/** - 在view上显示菊花+文字 - */ -+ (void)showLoadingWithMessage:(NSString *)message inView:(nullable UIView *)view; - -/** - 在view上显示菊花+文字 - */ -+ (void)showLoadingWithMessage:(NSString *)message inView:(nullable UIView *)view enabled:(BOOL)enabled; -+(void)showOnlyView:(UIView *)view enabled:(BOOL)enabled; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/CustomUI/XNDJTDDLoadingTool.m.backup b/YuMi/CustomUI/XNDJTDDLoadingTool.m.backup deleted file mode 100644 index 8c361f6..0000000 --- a/YuMi/CustomUI/XNDJTDDLoadingTool.m.backup +++ /dev/null @@ -1,391 +0,0 @@ -// -// YMHUDTool.m -// TTPlay -// -// Created by YM on 2022/5/15. -// Copyright © 2023 YUMI. All rights reserved. -// - -#import "XNDJTDDLoadingTool.h" -#import "GCDHelper.h" -#import -#import "MvpViewController.h" - -#define kDelayTime 2.5 -@interface XNDJTDDLoadingTool () -/// -@property (class,nonatomic,copy) NSArray *animationImages; -@end - -@implementation XNDJTDDLoadingTool - -static NSArray * _animationImages = nil; - -/** - 隐藏HUD, 如果view为nil, 则默认隐藏主窗口的HUD - - @param view view - */ -+ (void)hideHUDInView:(nullable UIView *)view { - dispatch_main_sync_safe(^{ - if (view) { - MBProgressHUD *hud = [XNDJTDDLoadingTool HUDForView:view]; - - if (hud != nil && hud.mode != MBProgressHUDModeText) { - hud.removeFromSuperViewOnHide = YES; - [hud hideAnimated:NO]; - } - MBProgressHUD *windowHud = [XNDJTDDLoadingTool HUDForView:kWindow]; - if (windowHud != nil && windowHud.mode != MBProgressHUDModeText) { - windowHud.removeFromSuperViewOnHide = YES; - [windowHud hideAnimated:NO]; - } - } else { - MBProgressHUD *windowHud = [XNDJTDDLoadingTool HUDForView:kWindow]; - if (windowHud != nil && windowHud.mode != MBProgressHUDModeText) { - windowHud.removeFromSuperViewOnHide = YES; - [windowHud hideAnimated:NO]; - } - } - }); -} - - -+ (MBProgressHUD *)HUDForView:(UIView *)view { - NSEnumerator *subviewsEnum = [view.subviews reverseObjectEnumerator]; - for (UIView *subview in subviewsEnum) { - if ([subview isKindOfClass:[MBProgressHUD class]]) { - MBProgressHUD *hud = (MBProgressHUD *)subview; - id hasFinished = [hud valueForKey:@"hasFinished"]; - if (hasFinished != nil) { - if([hasFinished boolValue] == NO){ - return hud; - } - - } - } - } - return nil; -} - -/** - 隐藏HUD - */ -+ (void)hideHUD { - [self hideHUDInView:nil]; -} - -/** - 显示成功message, 默认显示在窗口上, 2.5s后消失, 默认不拦截点击事件 - - @param message 文字 - */ -+ (void)showSuccessWithMessage:(NSString *)message { - [self showSuccessWithMessage:message inView:[UIApplication sharedApplication].keyWindow]; -} - -/** - 显示成功message, 2.5s后消失, 默认不拦截点击事件 - - @param message 文字 - @param view 显示在哪个view上 - */ -+ (void)showSuccessWithMessage:(NSString *)message inView:(nullable UIView *)view { - [self showSuccessWithMessage:message inView:view delay:kDelayTime enabled:NO]; -} - -/** - 显示成功message - @param message 文字 - @param view 显示在哪个view上 - @param afterDelay 延迟消失时间 - @param enabled 是否可以拦截事件 no:不拦截 yes:拦截 - */ -+ (void)showSuccessWithMessage:(NSString *)message inView:(nullable UIView *)view delay:(NSTimeInterval)afterDelay enabled:(BOOL)enabled { - - if (message.length == 0) { return; } - __block UIView *inView = view; - - dispatch_main_sync_safe(^{ - if (!inView) { - inView = [UIApplication sharedApplication].keyWindow; - } - [self hideHUDInView:view]; // 先隐藏 - MBProgressHUD *hud = [self normalProgressHUD:view]; - hud.userInteractionEnabled = enabled; - hud.mode = MBProgressHUDModeText; - hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor; - hud.margin = 8; - // 方框背景颜色 - hud.bezelView.color = [[UIColor blackColor] colorWithAlphaComponent:0.8]; - hud.label.text = message; - hud.label.numberOfLines = 0; - hud.label.textColor = [UIColor whiteColor]; - hud.label.font = [UIFont systemFontOfSize:14]; - [hud hideAnimated:YES afterDelay:afterDelay]; - }); -} - -/** - 显示错误message, 默认显示在窗口上, 2.5s后消失, 默认不拦截点击事件 - - @param message 文字 - */ -+ (void)showErrorWithMessage:(NSString *)message { - [self showErrorWithMessage:message inView:[UIApplication sharedApplication].keyWindow]; -} - -/** - 显示错误message, 2.5s后消失, 默认不拦截点击事件 - - @param message 文字 - @param view 显示在哪个view上 - */ -+ (void)showErrorWithMessage:(NSString *)message inView:(nullable UIView *)view { - [self showErrorWithMessage:message inView:view delay:kDelayTime enabled:NO]; -} - -/** - 显示错误message - - @param message 文字 - @param view 显示在哪个view上 - @param afterDelay 延迟消失时间 - @param enabled 是否可以拦截事件 no:不拦截 yes:拦截 - */ -+ (void)showErrorWithMessage:(NSString *)message inView:(nullable UIView *)view delay:(NSTimeInterval)afterDelay enabled:(BOOL)enabled { - if (message.length == 0) { return; } - if (!view) { - view = [UIApplication sharedApplication].keyWindow; - } - - [self hideHUDInView:view]; // 先隐藏 - - dispatch_main_sync_safe(^{ - MBProgressHUD *hud = [self normalProgressHUD:view]; - hud.userInteractionEnabled = enabled; - hud.mode = MBProgressHUDModeText; - hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor; - hud.margin = 8; - // 方框背景颜色 - hud.bezelView.color = [[UIColor blackColor] colorWithAlphaComponent:0.8]; - hud.label.text = message; - hud.label.numberOfLines = 0; - hud.label.textColor = [UIColor whiteColor]; - hud.label.font = [UIFont systemFontOfSize:14]; - [hud hideAnimated:YES afterDelay:afterDelay]; - }); -} - -/** - * 在窗口上显示菊花 - */ -+ (void)showLoading { - [self showGIFLoadingInView:[UIApplication sharedApplication].keyWindow]; - return; - [self showLoadingInView:[UIApplication sharedApplication].keyWindow]; -} - -/** - * 在view上显示菊花 - */ -+ (void)showLoadingInView:(nullable UIView *)view { - [self showGIFLoadingInView:[UIApplication sharedApplication].keyWindow]; - return; - [self showLoadingInView:view enabled:YES]; -} - -/** - * 在view上显示菊花 - */ -+ (void)showLoadingInView:(nullable UIView *)view enabled:(BOOL)enabled { - [self showGIFLoadingInView:[UIApplication sharedApplication].keyWindow]; - return; - [self showLoadingWithMessage:@"" inView:view enabled:enabled]; -} - -/** - * 在窗口上显示菊花+文字 - */ -+ (void)showLoadingWithMessage:(NSString *)message { - - [self showLoadingWithMessage:message inView:[UIApplication sharedApplication].keyWindow]; -} - -/** - * 在view上显示菊花+文字 - */ -+ (void)showLoadingWithMessage:(NSString *)message inView:(nullable UIView *)view { - - [self showLoadingWithMessage:message inView:view enabled:YES]; -} - -/** - * 在view上显示菊花+文字 - */ -+ (void)showLoadingWithMessage:(NSString *)message inView:(nullable UIView *)view enabled:(BOOL)enabled { - - - if (!view) { - view = [UIApplication sharedApplication].keyWindow; - } - [self hideHUDInView:view]; - - dispatch_main_sync_safe(^{ - MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES]; - hud.userInteractionEnabled = enabled; - hud.bezelView.color = [[UIColor whiteColor] colorWithAlphaComponent:0.8]; - hud.removeFromSuperViewOnHide = YES; - if (message.length) { - hud.label.text = message; - hud.label.numberOfLines = 0; - hud.label.textColor = [UIColor blackColor]; - hud.label.font = [UIFont systemFontOfSize:14]; - } - }); - -} - -/** - 在窗口上显示自定义GIFLoading, 背景默认黑色0.35透明度, 默认拦截点击事件 - */ -+ (void)showGIFLoading { - [self showGIFLoadingInView:[UIApplication sharedApplication].keyWindow]; -} - -/** - 在指定的view上显示自定义GIFLoading, 背景默认黑色0.35透明度, 默认拦截点击事件 - - @param view 显示在哪个view上 - */ -+ (void)showGIFLoadingInView:(nullable UIView *)view { - [self showGIFLoadingInView:view bgColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:0.35] enabled:YES]; -} - -/** - 在指定的view上显示自定义GIFLoading - @param view 显示在哪个view上 - @param bgColor 背景颜色, 遮盖 - @param enabled 是否可以拦截事件 no:不拦截 yes:拦截 - */ -+ (void)showGIFLoadingInView:(nullable UIView *)view bgColor:(nullable UIColor *)bgColor enabled:(BOOL)enabled { - if (!view) { - view = [UIApplication sharedApplication].keyWindow; - } - [self hideHUDInView:view]; - dispatch_main_sync_safe(^{ - MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES]; - hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor; - hud.minSize = CGSizeMake(100, 150); - hud.userInteractionEnabled = NO; - hud.mode = MBProgressHUDModeCustomView; - [hud.bezelView addSubview:[self loadingView]]; - hud.backgroundColor = bgColor; - hud.bezelView.color = [UIColor clearColor]; - hud.removeFromSuperViewOnHide = YES; - }); -} - - -+ (void)showAnchorLoading { - - UIView *view = [UIApplication sharedApplication].delegate.window; - dispatch_main_sync_safe(^{ - MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES]; - hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor; - hud.userInteractionEnabled = NO; - hud.mode = MBProgressHUDModeCustomView; - hud.minSize = CGSizeMake(100, 150); - [hud.bezelView addSubview:[self loadingView ]]; - hud.bezelView.color = [UIColor clearColor]; - hud.removeFromSuperViewOnHide = YES; - }); -} - -+ (void)showAnchorLoading:(UIView *)view { - - dispatch_main_sync_safe(^{ - MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES]; - hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor; - hud.userInteractionEnabled = NO; - hud.mode = MBProgressHUDModeCustomView; - hud.minSize = CGSizeMake(100, 150); - [hud.bezelView addSubview:[self loadingView ]]; - hud.bezelView.color = [UIColor clearColor]; - hud.removeFromSuperViewOnHide = YES; - }); -} - -#pragma mark - private -+ (MBProgressHUD *)normalProgressHUD:(UIView *)view { - MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES]; - hud.removeFromSuperViewOnHide = YES; - return hud; -} - - - -+ (UIView *)loadingView { - UIView *bgView = [UIView new]; - bgView.backgroundColor = [UIColor clearColor]; - bgView.frame = CGRectMake(0, 0, 100, 150); - - return bgView; -} - - - -+(void)hideOnlyView:(UIView *)view{ - - dispatch_main_sync_safe(^{ - if (view) { - UIView *getView; - if([view isKindOfClass:[MvpViewController class]]){ - getView = ((MvpViewController *)view).view; - }else{ - getView = view; - } - MBProgressHUD *hud = [XNDJTDDLoadingTool HUDForView:getView]; - if (hud != nil && hud.mode != MBProgressHUDModeText) { - hud.removeFromSuperViewOnHide = YES; - [hud hideAnimated:NO]; - } - } - }); -} -+(void)showOnlyView:(UIView *)view{ - if (!view) { - view = [UIApplication sharedApplication].keyWindow; - } - [self hideOnlyView:view]; - dispatch_main_sync_safe(^{ - MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES]; - hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor; - hud.minSize = CGSizeMake(100, 150); - hud.userInteractionEnabled = NO; - hud.mode = MBProgressHUDModeCustomView; - [hud.bezelView addSubview:[self loadingView]]; - hud.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.35]; - hud.bezelView.color = [UIColor clearColor]; - hud.removeFromSuperViewOnHide = YES; - }); -} -+(void)showOnlyView:(UIView *)view enabled:(BOOL)enabled{ - if (!view) { - view = [UIApplication sharedApplication].keyWindow; - } - [self hideOnlyView:view]; - dispatch_main_sync_safe(^{ - MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES]; - hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor; - hud.minSize = CGSizeMake(100, 150); - hud.userInteractionEnabled = enabled; - hud.mode = MBProgressHUDModeCustomView; - [hud.bezelView addSubview:[self loadingView]]; - hud.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.35]; - hud.bezelView.color = [UIColor clearColor]; - hud.removeFromSuperViewOnHide = YES; - }); -} - -@end diff --git a/YuMi/E-P/Common/EPImageUploader.swift.backup b/YuMi/E-P/Common/EPImageUploader.swift.backup deleted file mode 100644 index 98995bc..0000000 --- a/YuMi/E-P/Common/EPImageUploader.swift.backup +++ /dev/null @@ -1,163 +0,0 @@ -// -// EPImageUploader.swift -// YuMi -// -// Created by AI on 2025-10-11. -// - -import UIKit -import Foundation - -/// 图片批量上传工具(纯 Swift 内部类,直接使用 QCloudCOSXML SDK) -/// 不对外暴露,由 EPSDKManager 内部调用 -class EPImageUploader { - - init() {} - - /// 批量上传图片(内部方法) - /// - Parameters: - /// - images: 要上传的图片数组 - /// - bucket: QCloud bucket 名称 - /// - customDomain: 自定义域名 - /// - progress: 进度回调 (已上传数, 总数) - /// - success: 成功回调 - /// - failure: 失败回调 - func performBatchUpload( - _ images: [UIImage], - bucket: String, - customDomain: String, - progress: @escaping (Int, Int) -> Void, - success: @escaping ([[String: Any]]) -> Void, - failure: @escaping (String) -> Void - ) { - let total = images.count - let queue = DispatchQueue(label: "com.yumi.imageupload", attributes: .concurrent) - let semaphore = DispatchSemaphore(value: 3) // 最多同时上传 3 张 - var uploadedCount = 0 - var resultList: [[String: Any]] = [] - var hasError = false - let lock = NSLock() - - for (_, image) in images.enumerated() { - queue.async { - semaphore.wait() - - // 检查是否已经失败 - lock.lock() - if hasError { - lock.unlock() - semaphore.signal() - return - } - lock.unlock() - - // 压缩图片 - guard let imageData = image.jpegData(compressionQuality: 0.5) else { - lock.lock() - hasError = true - lock.unlock() - semaphore.signal() - DispatchQueue.main.async { - failure(YMLocalizedString("error.image_compress_failed")) - } - return - } - - // 获取图片格式 - let format = UIImage.getImageType(withImageData: imageData) ?? "jpeg" - - // 生成文件名 - let uuid = NSString.createUUID() - let fileName = "image/\(uuid).\(format)" - - // 直接使用 QCloud SDK 上传 - let request = QCloudCOSXMLUploadObjectRequest() - request.bucket = bucket - request.object = fileName - request.body = imageData as NSData - - // 监听上传进度(可选) - request.sendProcessBlock = { bytesSent, totalBytesSent, totalBytesExpectedToSend in - // 单个文件的上传进度(当前不使用) - } - - // 监听上传结果 - request.finishBlock = { [weak self] result, error in - guard let self = self else { - semaphore.signal() - return - } - - if let error = error { - // 上传失败 - lock.lock() - if !hasError { - hasError = true - lock.unlock() - semaphore.signal() - DispatchQueue.main.async { - failure(error.localizedDescription) - } - } else { - lock.unlock() - semaphore.signal() - } - } else if let result = result as? QCloudUploadObjectResult { - // 上传成功 - lock.lock() - if !hasError { - uploadedCount += 1 - - // 解析上传 URL(参考 UploadFile.m line 217-223) - let uploadedURL = self.parseUploadURL(result.location, customDomain: customDomain) - - let imageInfo: [String: Any] = [ - "resUrl": uploadedURL, - "width": image.size.width, - "height": image.size.height, - "format": format - ] - resultList.append(imageInfo) - - let currentUploaded = uploadedCount - lock.unlock() - - // 进度回调 - DispatchQueue.main.async { - progress(currentUploaded, total) - } - - // 全部完成 - if currentUploaded == total { - DispatchQueue.main.async { - success(resultList) - } - } - } else { - lock.unlock() - } - semaphore.signal() - } else { - semaphore.signal() - } - } - - // 执行上传 - QCloudCOSTransferMangerService.defaultCOSTransferManager().uploadObject(request) - } - } - } - - /// 解析上传返回的 URL(参考 UploadFile.m line 217-223) - /// - Parameters: - /// - location: QCloud 返回的原始 URL - /// - customDomain: 自定义域名 - /// - Returns: 解析后的 URL - private func parseUploadURL(_ location: String, customDomain: String) -> String { - let components = location.components(separatedBy: ".com/") - if components.count == 2 { - return "\(customDomain)/\(components[1])" - } - return location - } -} diff --git a/YuMi/E-P/Common/EPProgressHUD.swift.backup b/YuMi/E-P/Common/EPProgressHUD.swift.backup deleted file mode 100644 index fcad5d3..0000000 --- a/YuMi/E-P/Common/EPProgressHUD.swift.backup +++ /dev/null @@ -1,92 +0,0 @@ -// -// EPProgressHUD.swift -// YuMi -// -// Created by AI on 2025-10-11. -// - -import UIKit -import Foundation - -/// 带进度的 Loading 组件(基于 MBProgressHUD) -@objc class EPProgressHUD: NSObject { - - private static var currentHUD: MBProgressHUD? - - /// 获取当前活跃的 window(兼容 iOS 13+) - private static var keyWindow: UIWindow? { - if #available(iOS 13.0, *) { - return UIApplication.shared.connectedScenes - .compactMap { $0 as? UIWindowScene } - .flatMap { $0.windows } - .first { $0.isKeyWindow } - } else { - return UIApplication.shared.keyWindow - } - } - - /// 显示上传进度 - /// - Parameters: - /// - uploaded: 已上传数量 - /// - total: 总数量 - @objc static func showProgress(_ uploaded: Int, total: Int) { - DispatchQueue.main.async { - guard let window = keyWindow else { return } - - if let hud = currentHUD { - // 更新现有 HUD - hud.label.text = String(format: YMLocalizedString("upload.progress_format"), uploaded, total) - hud.progress = Float(uploaded) / Float(total) - } else { - // 创建新 HUD - let hud = MBProgressHUD.showAdded(to: window, animated: true) - hud.mode = .determinateHorizontalBar - hud.label.text = String(format: YMLocalizedString("upload.progress_format"), uploaded, total) - hud.progress = Float(uploaded) / Float(total) - hud.removeFromSuperViewOnHide = true - currentHUD = hud - } - } - } - - /// 显示错误提示 - /// - Parameter message: 错误信息 - @objc static func showError(_ message: String) { - DispatchQueue.main.async { - guard let window = keyWindow else { return } - - let hud = MBProgressHUD.showAdded(to: window, animated: true) - hud.mode = .text - hud.label.text = message - hud.label.numberOfLines = 0 - hud.removeFromSuperViewOnHide = true - hud.hide(animated: true, afterDelay: 2.0) - } - } - - /// 显示成功提示 - /// - Parameter message: 成功信息 - @objc static func showSuccess(_ message: String) { - DispatchQueue.main.async { - guard let window = keyWindow else { return } - - let hud = MBProgressHUD.showAdded(to: window, animated: true) - hud.mode = .text - hud.label.text = message - hud.label.numberOfLines = 0 - hud.removeFromSuperViewOnHide = true - hud.hide(animated: true, afterDelay: 2.0) - } - } - - /// 关闭 HUD - @objc static func dismiss() { - DispatchQueue.main.async { - guard let hud = currentHUD else { return } - - hud.hide(animated: true) - currentHUD = nil - } - } -} - diff --git a/YuMi/E-P/Common/EPQCloudConfig.swift.backup b/YuMi/E-P/Common/EPQCloudConfig.swift.backup deleted file mode 100644 index 77a5afc..0000000 --- a/YuMi/E-P/Common/EPQCloudConfig.swift.backup +++ /dev/null @@ -1,56 +0,0 @@ -// -// EPQCloudConfig.swift -// YuMi -// -// Created by AI on 2025-10-11. -// - -import Foundation - -/// QCloud 配置数据模型(对应 UploadFileModel) -struct EPQCloudConfig { - let secretId: String - let secretKey: String - let sessionToken: String - let bucket: String - let region: String - let customDomain: String - let startTime: Int64 - let expireTime: Int64 - let appId: String - let accelerate: Int - - /// 从 API 返回的 dictionary 初始化 - /// API: GET tencent/cos/getToken - init?(dictionary: [String: Any]) { - // 必填字段检查 - guard let secretId = dictionary["secretId"] as? String, - let secretKey = dictionary["secretKey"] as? String, - let sessionToken = dictionary["sessionToken"] as? String, - let bucket = dictionary["bucket"] as? String, - let region = dictionary["region"] as? String, - let customDomain = dictionary["customDomain"] as? String, - let appId = dictionary["appId"] as? String else { - return nil - } - - self.secretId = secretId - self.secretKey = secretKey - self.sessionToken = sessionToken - self.bucket = bucket - self.region = region - self.customDomain = customDomain - self.appId = appId - - // 可选字段使用默认值 - self.startTime = (dictionary["startTime"] as? Int64) ?? 0 - self.expireTime = (dictionary["expireTime"] as? Int64) ?? 0 - self.accelerate = (dictionary["accelerate"] as? Int) ?? 0 - } - - /// 检查配置是否过期 - var isExpired: Bool { - return Date().timeIntervalSince1970 > Double(expireTime) - } -} - diff --git a/YuMi/E-P/Common/EPSDKManager.swift.backup b/YuMi/E-P/Common/EPSDKManager.swift.backup deleted file mode 100644 index 4b4f27a..0000000 --- a/YuMi/E-P/Common/EPSDKManager.swift.backup +++ /dev/null @@ -1,253 +0,0 @@ -// -// EPSDKManager.swift -// YuMi -// -// Created by AI on 2025-10-11. -// - -import Foundation - -/// 第三方 SDK 统一管理器(单例) -/// 统一入口:对外提供所有 SDK 能力 -/// 内部管理:QCloud 初始化、配置、上传等 -@objc class EPSDKManager: NSObject, QCloudSignatureProvider, QCloudCredentailFenceQueueDelegate { - - // MARK: - Singleton - - @objc static let shared = EPSDKManager() - - // MARK: - Properties - - // QCloud 配置缓存 - private var qcloudConfig: EPQCloudConfig? - - // QCloud 初始化状态 - private var isQCloudInitializing = false - - // QCloud 初始化回调队列 - private var qcloudInitCallbacks: [(Bool, String?) -> Void] = [] - - // QCloud 凭证队列 - private var credentialFenceQueue: QCloudCredentailFenceQueue? - - // 线程安全锁 - private let lock = NSLock() - - // 内部图片上传器 - private let uploader = EPImageUploader() - - // MARK: - Initialization - - private override init() { - super.init() - } - - // MARK: - Public API (对外统一入口) - - /// 批量上传图片(统一入口) - /// - Parameters: - /// - images: 要上传的图片数组 - /// - progress: 进度回调 (已上传数, 总数) - /// - success: 成功回调,返回图片信息数组 - /// - failure: 失败回调 - @objc func uploadImages( - _ images: [UIImage], - progress: @escaping (Int, Int) -> Void, - success: @escaping ([[String: Any]]) -> Void, - failure: @escaping (String) -> Void - ) { - guard !images.isEmpty else { - success([]) - return - } - - // 确保 QCloud 已就绪 - ensureQCloudReady { [weak self] isReady, errorMsg in - guard let self = self, isReady else { - DispatchQueue.main.async { - failure(errorMsg ?? YMLocalizedString("error.qcloud_init_failed")) - } - return - } - - // 委托给内部 uploader 执行 - self.uploader.performBatchUpload( - images, - bucket: self.qcloudConfig?.bucket ?? "", - customDomain: self.qcloudConfig?.customDomain ?? "", - progress: progress, - success: success, - failure: failure - ) - } - } - - /// 检查 QCloud 是否已就绪 - /// - Returns: true 表示已初始化且未过期 - @objc func isQCloudReady() -> Bool { - lock.lock() - defer { lock.unlock() } - - guard let config = qcloudConfig else { - return false - } - return !config.isExpired - } - - // MARK: - Internal Methods - - /// 确保 QCloud 已就绪(自动初始化) - private func ensureQCloudReady(completion: @escaping (Bool, String?) -> Void) { - if isQCloudReady() { - completion(true, nil) - return - } - - // 未初始化或已过期,重新初始化 - initializeQCloud(completion: completion) - } - - /// 初始化 QCloud(获取 Token 并配置 SDK) - private func initializeQCloud(completion: @escaping (Bool, String?) -> Void) { - lock.lock() - - // 如果正在初始化,加入回调队列 - if isQCloudInitializing { - qcloudInitCallbacks.append(completion) - lock.unlock() - return - } - - // 如果已初始化且未过期,直接返回 - if let config = qcloudConfig, !config.isExpired { - lock.unlock() - completion(true, nil) - return - } - - // 开始初始化 - isQCloudInitializing = true - qcloudInitCallbacks.append(completion) - lock.unlock() - - // 调用 API 获取 QCloud Token - // API: GET tencent/cos/getToken - Api.getQCloudInfo { [weak self] (data, code, msg) in - guard let self = self else { return } - - self.lock.lock() - - if code == 200, - let dict = data?.data as? [String: Any], - let config = EPQCloudConfig(dictionary: dict) { - - // 保存配置 - self.qcloudConfig = config - - // 配置 QCloud SDK - self.configureQCloudSDK(with: config) - - // 初始化完成 - self.isQCloudInitializing = false - let callbacks = self.qcloudInitCallbacks - self.qcloudInitCallbacks.removeAll() - self.lock.unlock() - - // 短暂延迟确保 SDK 配置完成 - DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) { - callbacks.forEach { $0(true, nil) } - } - } else { - // 初始化失败 - self.isQCloudInitializing = false - let callbacks = self.qcloudInitCallbacks - self.qcloudInitCallbacks.removeAll() - self.lock.unlock() - - let errorMsg = msg ?? YMLocalizedString("error.qcloud_config_failed") - DispatchQueue.main.async { - callbacks.forEach { $0(false, errorMsg) } - } - } - } - } - - /// 配置 QCloud SDK(参考 UploadFile.m line 42-64) - private func configureQCloudSDK(with config: EPQCloudConfig) { - let configuration = QCloudServiceConfiguration() - configuration.appID = config.appId - - let endpoint = QCloudCOSXMLEndPoint() - endpoint.regionName = config.region - endpoint.useHTTPS = true - - // 全球加速(参考 UploadFile.m line 56-59) - if config.accelerate == 1 { - endpoint.suffix = "cos.accelerate.myqcloud.com" - } - - configuration.endpoint = endpoint - configuration.signatureProvider = self - - // 注册 COS 服务 - QCloudCOSXMLService.registerDefaultCOSXML(with: configuration) - QCloudCOSTransferMangerService.registerDefaultCOSTransferManger(with: configuration) - - // 初始化凭证队列 - credentialFenceQueue = QCloudCredentailFenceQueue() - credentialFenceQueue?.delegate = self - } - - // MARK: - QCloudSignatureProvider Protocol - - /// 提供签名(参考 UploadFile.m line 67-104) - func signature( - with fields: QCloudSignatureFields, - request: QCloudBizHTTPRequest, - urlRequest: NSMutableURLRequest, - compelete: @escaping QCloudHTTPAuthentationContinueBlock - ) { - guard let config = qcloudConfig else { - let error = NSError(domain: "com.yumi.qcloud", code: -1, - userInfo: [NSLocalizedDescriptionKey: YMLocalizedString("error.qcloud_config_not_initialized")]) - compelete(nil, error) - return - } - - let credential = QCloudCredential() - credential.secretID = config.secretId - credential.secretKey = config.secretKey - credential.token = config.sessionToken - credential.startDate = Date(timeIntervalSince1970: TimeInterval(config.startTime)) - credential.expirationDate = Date(timeIntervalSince1970: TimeInterval(config.expireTime)) - - let creator = QCloudAuthentationV5Creator(credential: credential) - let signature = creator?.signature(forData: urlRequest) - compelete(signature, nil) - } - - // MARK: - QCloudCredentailFenceQueueDelegate Protocol - - /// 管理凭证(参考 UploadFile.m line 107-133) - func fenceQueue( - _ queue: QCloudCredentailFenceQueue, - requestCreatorWithContinue continueBlock: @escaping QCloudCredentailFenceQueueContinue - ) { - guard let config = qcloudConfig else { - let error = NSError(domain: "com.yumi.qcloud", code: -1, - userInfo: [NSLocalizedDescriptionKey: YMLocalizedString("error.qcloud_config_not_initialized")]) - continueBlock(nil, error) - return - } - - let credential = QCloudCredential() - credential.secretID = config.secretId - credential.secretKey = config.secretKey - credential.token = config.sessionToken - credential.startDate = Date(timeIntervalSince1970: TimeInterval(config.startTime)) - credential.expirationDate = Date(timeIntervalSince1970: TimeInterval(config.expireTime)) - - let creator = QCloudAuthentationV5Creator(credential: credential) - continueBlock(creator, nil) - } -} diff --git a/YuMi/E-P/Login/Controllers/EPLoginTypesViewController.swift.backup b/YuMi/E-P/Login/Controllers/EPLoginTypesViewController.swift.backup deleted file mode 100644 index 6ea39eb..0000000 --- a/YuMi/E-P/Login/Controllers/EPLoginTypesViewController.swift.backup +++ /dev/null @@ -1,696 +0,0 @@ -// -// EPLoginTypesViewController.swift -// YuMi -// -// Created by AI on 2025-01-27. -// - -import UIKit - -class EPLoginTypesViewController: BaseViewController { - - // MARK: - Properties - - var displayType: EPLoginDisplayType = .id - - private let loginService = EPLoginService() - - private let backgroundImageView = UIImageView() - private let titleLabel = UILabel() - private let backButton = UIButton(type: .system) - - private let firstInputView = EPLoginInputView() - private let secondInputView = EPLoginInputView() - private var thirdInputView: EPLoginInputView? - - private let actionButton = UIButton(type: .system) - private var forgotPasswordButton: UIButton? - - private var hasAddedGradient = false - - // MARK: - Lifecycle - - override func viewDidLoad() { - super.viewDidLoad() - setupUI() - configureForDisplayType() - } - - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - navigationController?.setNavigationBarHidden(true, animated: false) - } - - override func viewDidLayoutSubviews() { - super.viewDidLayoutSubviews() - - // 添加渐变背景到 actionButton(只添加一次) - if !hasAddedGradient && actionButton.bounds.width > 0 { - actionButton.addGradientBackground( - with: [ - EPLoginConfig.Colors.gradientStart, - EPLoginConfig.Colors.gradientEnd - ], - start: CGPoint(x: 0, y: 0.5), - end: CGPoint(x: 1, y: 0.5), - cornerRadius: EPLoginConfig.Layout.uniformCornerRadius - ) - hasAddedGradient = true - } - } - - // MARK: - Setup - - private func setupUI() { - setupBackground() - setupNavigationBar() - setupTitle() - setupInputViews() - setupActionButton() - } - - private func setupBackground() { - view.addSubview(backgroundImageView) - backgroundImageView.translatesAutoresizingMaskIntoConstraints = false - backgroundImageView.image = kImage(EPLoginConfig.Images.background) - backgroundImageView.contentMode = .scaleAspectFill - - backgroundImageView.snp.makeConstraints { make in - make.edges.equalToSuperview() - } - } - - private func setupNavigationBar() { - view.addSubview(backButton) - backButton.translatesAutoresizingMaskIntoConstraints = false - backButton.setImage(UIImage(systemName: EPLoginConfig.Images.iconBack), for: .normal) - backButton.tintColor = EPLoginConfig.Colors.textLight - backButton.addTarget(self, action: #selector(handleBack), for: .touchUpInside) - - backButton.snp.makeConstraints { make in - make.leading.equalToSuperview().offset(EPLoginConfig.Layout.compactHorizontalPadding) - make.top.equalTo(view.safeAreaLayoutGuide).offset(8) - make.size.equalTo(EPLoginConfig.Layout.backButtonSize) - } - } - - private func setupTitle() { - view.addSubview(titleLabel) - titleLabel.translatesAutoresizingMaskIntoConstraints = false - titleLabel.font = .systemFont(ofSize: EPLoginConfig.Layout.titleFontSize, weight: .bold) - titleLabel.textColor = EPLoginConfig.Colors.textLight - - titleLabel.snp.makeConstraints { make in - make.centerX.equalToSuperview() - make.centerY.equalTo(backButton) // 与返回按钮垂直居中对齐 - } - } - - private func setupInputViews() { - firstInputView.translatesAutoresizingMaskIntoConstraints = false - secondInputView.translatesAutoresizingMaskIntoConstraints = false - - view.addSubview(firstInputView) - view.addSubview(secondInputView) - - firstInputView.snp.makeConstraints { make in - make.leading.equalToSuperview().offset(EPLoginConfig.Layout.uniformHorizontalPadding) - make.trailing.equalToSuperview().offset(-EPLoginConfig.Layout.uniformHorizontalPadding) - make.top.equalTo(titleLabel.snp.bottom).offset(EPLoginConfig.Layout.inputTitleSpacing) - make.height.equalTo(EPLoginConfig.Layout.uniformHeight) - } - - secondInputView.snp.makeConstraints { make in - make.leading.trailing.equalTo(firstInputView) - make.top.equalTo(firstInputView.snp.bottom).offset(EPLoginConfig.Layout.inputVerticalSpacing) - make.height.equalTo(EPLoginConfig.Layout.uniformHeight) - } - } - - private func setupActionButton() { - view.addSubview(actionButton) - actionButton.translatesAutoresizingMaskIntoConstraints = false - actionButton.setTitle("Login", for: .normal) - actionButton.setTitleColor(EPLoginConfig.Colors.textLight, for: .normal) - actionButton.layer.cornerRadius = EPLoginConfig.Layout.uniformCornerRadius - actionButton.titleLabel?.font = .systemFont(ofSize: EPLoginConfig.Layout.buttonFontSize, weight: .semibold) - actionButton.addTarget(self, action: #selector(handleAction), for: .touchUpInside) - - // 初始状态:禁用按钮 - actionButton.isEnabled = false - actionButton.alpha = 0.5 - - actionButton.snp.makeConstraints { make in - make.leading.trailing.equalTo(firstInputView) - make.top.equalTo(secondInputView.snp.bottom).offset(EPLoginConfig.Layout.buttonTopSpacing) - make.height.equalTo(EPLoginConfig.Layout.uniformHeight) - } - } - - // MARK: - Configuration - - private func configureForDisplayType() { - switch displayType { - case .id: - titleLabel.text = YMLocalizedString("1.0.37_text_26") // ID Login - firstInputView.configure(with: EPLoginInputConfig( - showAreaCode: false, - showCodeButton: false, - isSecure: false, - icon: "icon_login_id", - placeholder: "Please enter ID", - keyboardType: .numberPad // ID 使用数字键盘 - )) - firstInputView.onTextChanged = { [weak self] _ in - self?.checkActionButtonStatus() - } - - secondInputView.configure(with: EPLoginInputConfig( - showAreaCode: false, - showCodeButton: false, - isSecure: true, - icon: "icon_login_id", - placeholder: "Please enter password", - keyboardType: .default // 密码使用默认键盘(需要字母+数字) - )) - secondInputView.onTextChanged = { [weak self] _ in - self?.checkActionButtonStatus() - } - - actionButton.setTitle("Login", for: .normal) - - // 添加忘记密码按钮 - setupForgotPasswordButton() - - case .email: - titleLabel.text = YMLocalizedString("20.20.51_text_1") // Email Login - firstInputView.configure(with: EPLoginInputConfig( - showAreaCode: false, - showCodeButton: false, - isSecure: false, - icon: "envelope", - placeholder: "Please enter email", - keyboardType: .emailAddress // Email 使用邮箱键盘 - )) - firstInputView.onTextChanged = { [weak self] _ in - self?.checkActionButtonStatus() - } - - secondInputView.configure(with: EPLoginInputConfig( - showAreaCode: false, - showCodeButton: true, - isSecure: false, - icon: "number", - placeholder: "Please enter verification code", - keyboardType: .numberPad // 验证码使用数字键盘 - )) - secondInputView.onTextChanged = { [weak self] _ in - self?.checkActionButtonStatus() - } - secondInputView.delegate = self - actionButton.setTitle("Login", for: .normal) - - case .phone: - titleLabel.text = "Phone Login" - firstInputView.configure(with: EPLoginInputConfig( - showAreaCode: false, - showCodeButton: false, - isSecure: false, - icon: "phone", - placeholder: "Please enter phone", - keyboardType: .numberPad // 手机号使用数字键盘 - )) - firstInputView.onTextChanged = { [weak self] _ in - self?.checkActionButtonStatus() - } - - secondInputView.configure(with: EPLoginInputConfig( - showAreaCode: false, - showCodeButton: true, - isSecure: false, - icon: "number", - placeholder: "Please enter verification code", - keyboardType: .numberPad // 验证码使用数字键盘 - )) - secondInputView.onTextChanged = { [weak self] _ in - self?.checkActionButtonStatus() - } - secondInputView.delegate = self - actionButton.setTitle("Login", for: .normal) - - case .emailReset: - titleLabel.text = YMLocalizedString("20.20.51_text_20") - firstInputView.configure(with: EPLoginInputConfig( - showAreaCode: false, - showCodeButton: false, - isSecure: false, - icon: "envelope", - placeholder: "Please enter email", - keyboardType: .emailAddress // Email 使用邮箱键盘 - )) - firstInputView.onTextChanged = { [weak self] _ in - self?.checkActionButtonStatus() - } - - secondInputView.configure(with: EPLoginInputConfig( - showAreaCode: false, - showCodeButton: true, - isSecure: false, - icon: "number", - placeholder: "Please enter verification code", - keyboardType: .numberPad // 验证码使用数字键盘 - )) - secondInputView.onTextChanged = { [weak self] _ in - self?.checkActionButtonStatus() - } - secondInputView.delegate = self - - // 添加第三个输入框 - setupThirdInputView() - actionButton.setTitle("Confirm", for: .normal) - - case .phoneReset: - titleLabel.text = YMLocalizedString("20.20.51_text_20") - firstInputView.configure(with: EPLoginInputConfig( - showAreaCode: false, - showCodeButton: false, - isSecure: false, - icon: "phone", - placeholder: "Please enter phone", - keyboardType: .numberPad // 手机号使用数字键盘 - )) - firstInputView.onTextChanged = { [weak self] _ in - self?.checkActionButtonStatus() - } - - secondInputView.configure(with: EPLoginInputConfig( - showAreaCode: false, - showCodeButton: true, - isSecure: false, - icon: "number", - placeholder: "Please enter verification code", - keyboardType: .numberPad // 验证码使用数字键盘 - )) - secondInputView.onTextChanged = { [weak self] _ in - self?.checkActionButtonStatus() - } - secondInputView.delegate = self - - // 添加第三个输入框 - setupThirdInputView() - actionButton.setTitle("Confirm", for: .normal) - } - } - - private func setupForgotPasswordButton() { - let button = UIButton(type: .system) - button.translatesAutoresizingMaskIntoConstraints = false - button.setTitle("Forgot Password?", for: .normal) - button.setTitleColor(EPLoginConfig.Colors.textLight, for: .normal) - button.titleLabel?.font = .systemFont(ofSize: EPLoginConfig.Layout.smallFontSize) - button.addTarget(self, action: #selector(handleForgotPassword), for: .touchUpInside) - - view.addSubview(button) - - button.snp.makeConstraints { make in - make.trailing.equalTo(secondInputView) - make.top.equalTo(secondInputView.snp.bottom).offset(8) - } - - forgotPasswordButton = button - } - - private func setupThirdInputView() { - let inputView = EPLoginInputView() - inputView.translatesAutoresizingMaskIntoConstraints = false - inputView.configure(with: EPLoginInputConfig( - showAreaCode: false, - showCodeButton: false, - isSecure: true, - icon: EPLoginConfig.Images.iconLock, - placeholder: "6-16 Digits + English Letters", - keyboardType: .default // 密码使用默认键盘(需要字母+数字) - )) - inputView.onTextChanged = { [weak self] _ in - self?.checkActionButtonStatus() - } - view.addSubview(inputView) - - inputView.snp.makeConstraints { make in - make.leading.trailing.equalTo(firstInputView) - make.top.equalTo(secondInputView.snp.bottom).offset(EPLoginConfig.Layout.inputVerticalSpacing) - make.height.equalTo(EPLoginConfig.Layout.uniformHeight) - } - - // 重新调整 actionButton 位置 - actionButton.snp.remakeConstraints { make in - make.leading.trailing.equalTo(firstInputView) - make.top.equalTo(inputView.snp.bottom).offset(EPLoginConfig.Layout.buttonTopSpacing) - make.height.equalTo(EPLoginConfig.Layout.uniformHeight) - } - - thirdInputView = inputView - } - - // MARK: - Actions - - @objc private func handleBack() { - navigationController?.popViewController(animated: true) - } - - @objc private func handleAction() { - view.endEditing(true) - - // 执行对应类型的操作 - switch displayType { - case .id: - handleIDLogin() - case .email: - handleEmailLogin() - case .phone: - handlePhoneLogin() - case .emailReset: - handleEmailResetPassword() - case .phoneReset: - handlePhoneResetPassword() - } - } - - @objc private func handleForgotPassword() { - let vc = EPLoginTypesViewController() - vc.displayType = .emailReset - navigationController?.pushViewController(vc, animated: true) - } - - // MARK: - 登录逻辑 - - private func handleIDLogin() { - let id = firstInputView.text.trimmingCharacters(in: .whitespacesAndNewlines) - let password = secondInputView.text - - // 表单验证(简化,仅检查空值) - guard !id.isEmpty else { - showErrorToast(YMLocalizedString("LoginPresenter0")) - return - } - - guard !password.isEmpty else { - showErrorToast(YMLocalizedString("LoginPresenter1")) - return - } - - // 显示加载状态 - showLoading(true) - - loginService.loginWithID(id: id, password: password) { [weak self] (accountModel: AccountModel) in - DispatchQueue.main.async { - self?.showLoading(false) - print("[EPLogin] ID登录成功: \(accountModel.uid)") - self?.showSuccessToast(YMLocalizedString("XPLoginPhoneViewController1")) - EPLoginManager.jumpToHome(from: self!) - } - } failure: { [weak self] (code: Int, msg: String) in - DispatchQueue.main.async { - self?.showLoading(false) - self?.showErrorToast(msg) - } - } - } - - private func handleEmailLogin() { - let email = firstInputView.text.trimmingCharacters(in: .whitespacesAndNewlines) - let code = secondInputView.text - - // 表单验证(简化,仅检查空值) - guard !email.isEmpty else { - showErrorToast(YMLocalizedString("LoginPresenter0")) - return - } - - guard !code.isEmpty else { - showErrorToast(YMLocalizedString("LoginPresenter1")) - return - } - - showLoading(true) - - loginService.loginWithEmail(email: email, code: code) { [weak self] (accountModel: AccountModel) in - DispatchQueue.main.async { - self?.showLoading(false) - print("[EPLogin] 邮箱登录成功: \(accountModel.uid)") - self?.showSuccessToast(YMLocalizedString("XPLoginPhoneViewController1")) - EPLoginManager.jumpToHome(from: self!) - } - } failure: { [weak self] (code: Int, msg: String) in - DispatchQueue.main.async { - self?.showLoading(false) - self?.showErrorToast(msg) - } - } - } - - private func handlePhoneLogin() { - let phone = firstInputView.text.trimmingCharacters(in: .whitespacesAndNewlines) - let code = secondInputView.text - - // 表单验证(简化,仅检查空值) - guard !phone.isEmpty else { - showErrorToast(YMLocalizedString("XPLoginPhoneViewController0")) - return - } - - guard !code.isEmpty else { - showErrorToast(YMLocalizedString("LoginPresenter1")) - return - } - - showLoading(true) - - loginService.loginWithPhone(phone: phone, code: code, areaCode: "+86") { [weak self] (accountModel: AccountModel) in - DispatchQueue.main.async { - self?.showLoading(false) - print("[EPLogin] 手机登录成功: \(accountModel.uid)") - self?.showSuccessToast(YMLocalizedString("XPLoginPhoneViewController1")) - EPLoginManager.jumpToHome(from: self!) - } - } failure: { [weak self] (code: Int, msg: String) in - DispatchQueue.main.async { - self?.showLoading(false) - self?.showErrorToast(msg) - } - } - } - - private func handleEmailResetPassword() { - guard let thirdInput = thirdInputView else { return } - - let email = firstInputView.text.trimmingCharacters(in: .whitespacesAndNewlines) - let code = secondInputView.text - let newPassword = thirdInput.text - - // 表单验证(简化,仅检查空值) - guard !email.isEmpty else { - showErrorToast(YMLocalizedString("LoginPresenter0")) - return - } - - guard !code.isEmpty else { - showErrorToast(YMLocalizedString("LoginPresenter1")) - return - } - - guard !newPassword.isEmpty else { - showErrorToast(YMLocalizedString("LoginPresenter1")) - return - } - - showLoading(true) - - loginService.resetEmailPassword(email: email, code: code, newPassword: newPassword) { [weak self] in - DispatchQueue.main.async { - self?.showLoading(false) - self?.showSuccessToast(YMLocalizedString("XPForgetPwdViewController1")) - self?.navigationController?.popViewController(animated: true) - } - } failure: { [weak self] (code: Int, msg: String) in - DispatchQueue.main.async { - self?.showLoading(false) - self?.showErrorToast(msg) - } - } - } - - private func handlePhoneResetPassword() { - guard let thirdInput = thirdInputView else { return } - - let phone = firstInputView.text.trimmingCharacters(in: .whitespacesAndNewlines) - let code = secondInputView.text - let newPassword = thirdInput.text - - // 表单验证(简化,仅检查空值) - guard !phone.isEmpty else { - showErrorToast(YMLocalizedString("XPLoginPhoneViewController0")) - return - } - - guard !code.isEmpty else { - showErrorToast(YMLocalizedString("LoginPresenter1")) - return - } - - guard !newPassword.isEmpty else { - showErrorToast(YMLocalizedString("LoginPresenter1")) - return - } - - showLoading(true) - - loginService.resetPhonePassword(phone: phone, code: code, areaCode: "+86", newPassword: newPassword) { [weak self] in - DispatchQueue.main.async { - self?.showLoading(false) - self?.showSuccessToast(YMLocalizedString("XPForgetPwdViewController1")) - self?.navigationController?.popViewController(animated: true) - } - } failure: { [weak self] (code: Int, msg: String) in - DispatchQueue.main.async { - self?.showLoading(false) - self?.showErrorToast(msg) - } - } - } - - // MARK: - 验证码发送 - - private func sendEmailCode() { - let email = firstInputView.text.trimmingCharacters(in: .whitespacesAndNewlines) - - // 简化验证,仅检查空值 - guard !email.isEmpty else { - secondInputView.stopCountdown() - return - } - - let type = (displayType == .emailReset) ? 2 : 1 // 2=找回密码, 1=登录 - - loginService.sendEmailCode(email: email, type: type) { [weak self] in - DispatchQueue.main.async { - self?.secondInputView.startCountdown() - self?.secondInputView.displayKeyboard() - self?.showSuccessToast(YMLocalizedString("XPLoginPhoneViewController2")) - } - } failure: { [weak self] (code: Int, msg: String) in - DispatchQueue.main.async { - self?.secondInputView.stopCountdown() - self?.showErrorToast(msg) - } - } - } - - private func sendPhoneCode() { - let phone = firstInputView.text.trimmingCharacters(in: .whitespacesAndNewlines) - - // 简化验证,仅检查空值 - guard !phone.isEmpty else { - showErrorToast(YMLocalizedString("XPLoginPhoneViewController0")) - secondInputView.stopCountdown() - return - } - - // 检查是否需要人机验证 - loadCaptchaWebView { [weak self] in - guard let self = self else { return } - - let type = (self.displayType == .phoneReset) ? 2 : 1 // 2=找回密码, 1=登录 - - self.loginService.sendPhoneCode(phone: phone, areaCode: "+86", type: type) { [weak self] in - DispatchQueue.main.async { - self?.secondInputView.startCountdown() - self?.secondInputView.displayKeyboard() - self?.showSuccessToast(YMLocalizedString("XPLoginPhoneViewController2")) - } - } failure: { [weak self] (code: Int, msg: String) in - DispatchQueue.main.async { - self?.secondInputView.stopCountdown() - self?.showErrorToast(msg) - } - } - } - } - - private func sendEmailResetCode() { - sendEmailCode() // 复用邮箱验证码逻辑 - } - - private func sendPhoneResetCode() { - sendPhoneCode() // 复用手机验证码逻辑 - } - - // MARK: - UI Helpers - - private func showLoading(_ show: Bool) { - if show { - actionButton.isEnabled = false - actionButton.alpha = 0.5 - actionButton.setTitle("Loading...", for: .normal) - } else { - switch displayType { - case .id, .email, .phone: - actionButton.setTitle("Login", for: .normal) - case .emailReset, .phoneReset: - actionButton.setTitle("Confirm", for: .normal) - } - checkActionButtonStatus() - } - } - - /// 检查并更新按钮启用状态 - private func checkActionButtonStatus() { - let isEnabled: Bool - - switch displayType { - case .id: - let hasId = !firstInputView.text.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty - let hasPassword = !secondInputView.text.isEmpty - isEnabled = hasId && hasPassword - - case .email, .phone: - let hasAccount = !firstInputView.text.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty - let hasCode = !secondInputView.text.isEmpty - isEnabled = hasAccount && hasCode - - case .emailReset, .phoneReset: - let hasAccount = !firstInputView.text.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty - let hasCode = !secondInputView.text.isEmpty - let hasPassword = !(thirdInputView?.text.isEmpty ?? true) - isEnabled = hasAccount && hasCode && hasPassword - } - - actionButton.isEnabled = isEnabled - actionButton.alpha = isEnabled ? 1.0 : 0.5 - } - - /// 加载人机验证 Captcha WebView - /// - Parameter completion: 验证成功后的回调 - private func loadCaptchaWebView(completion: @escaping () -> Void) { - completion() - } -} - -// MARK: - EPLoginInputViewDelegate - -extension EPLoginTypesViewController: EPLoginInputViewDelegate { - func inputViewDidRequestCode(_ inputView: EPLoginInputView) { - if inputView == secondInputView { - if displayType == .email || displayType == .emailReset { - sendEmailCode() - } else if displayType == .phone || displayType == .phoneReset { - sendPhoneCode() - } - } - } - - func inputViewDidSelectArea(_ inputView: EPLoginInputView) { - // 区号选择(暂不实现) - print("[EPLogin] Area selection - 占位,Phase 2 实现") - } -} diff --git a/YuMi/E-P/Login/Controllers/EPLoginViewController.swift.backup b/YuMi/E-P/Login/Controllers/EPLoginViewController.swift.backup deleted file mode 100644 index 90a914e..0000000 --- a/YuMi/E-P/Login/Controllers/EPLoginViewController.swift.backup +++ /dev/null @@ -1,307 +0,0 @@ -// -// EPLoginViewController.swift -// YuMi -// -// Created by AI on 2025-01-27. -// - -import UIKit - -@objc class EPLoginViewController: UIViewController { - - // MARK: - Properties - - private let backgroundImageView = UIImageView() - private let logoImageView = UIImageView() - private let epartiTitleLabel = UILabel() - - private let idLoginButton = EPLoginButton() - private let emailLoginButton = EPLoginButton() - - private let agreeCheckbox = UIButton(type: .custom) - private let policyLabel = EPPolicyLabel() - - private let feedbackButton = UIButton(type: .custom) - - #if DEBUG - private let debugButton = UIButton(type: .custom) - #endif - - private let policySelectedKey = EPLoginConfig.Keys.policyAgreed - - // MARK: - Lifecycle - - override func viewDidLoad() { - super.viewDidLoad() - - // 验证 DEBUG 编译条件 - #if DEBUG - print("✅ [EPLogin] DEBUG 模式已激活") - #else - print("⚠️ [EPLogin] 当前为 Release 模式") - #endif - - navigationController?.setNavigationBarHidden(true, animated: false) - setupUI() - loadPolicyStatus() - } - - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - navigationController?.setNavigationBarHidden(true, animated: false) - } - - override func viewWillDisappear(_ animated: Bool) { - super.viewWillDisappear(animated) - } - - // MARK: - Setup - - private func setupUI() { - setupBackground() - setupLogo() - setupLoginButtons() - setupPolicyArea() - setupNavigationBar() - } - - private func setupBackground() { - view.addSubview(backgroundImageView) - backgroundImageView.image = kImage(EPLoginConfig.Images.background) - backgroundImageView.contentMode = .scaleAspectFill - - backgroundImageView.snp.makeConstraints { make in - make.edges.equalToSuperview() - } - } - - private func setupLogo() { - view.addSubview(logoImageView) - logoImageView.image = kImage(EPLoginConfig.Images.loginBg) - - logoImageView.snp.makeConstraints { make in - make.top.leading.trailing.equalTo(view) - make.height.equalTo(EPLoginConfig.Layout.logoHeight) - } - - // E-PARTY 标题 - view.addSubview(epartiTitleLabel) - epartiTitleLabel.text = "E-PARTY" - epartiTitleLabel.font = .systemFont(ofSize: EPLoginConfig.Layout.epartiTitleFontSize, weight: .bold) - epartiTitleLabel.textColor = EPLoginConfig.Colors.textLight - epartiTitleLabel.transform = CGAffineTransform(a: 1, b: 0, c: -0.2, d: 1, tx: 0, ty: 0) // 斜体效果 - - epartiTitleLabel.snp.makeConstraints { make in - make.leading.equalToSuperview().offset(EPLoginConfig.Layout.epartiTitleLeading) - make.bottom.equalTo(logoImageView.snp.bottom).offset(EPLoginConfig.Layout.epartiTitleBottomOffset) - } - } - - private func setupLoginButtons() { - // 配置按钮 - idLoginButton.configure( - icon: EPLoginConfig.Images.iconLoginId, - title: YMLocalizedString(EPLoginConfig.LocalizedKeys.idLogin) - ) - idLoginButton.delegate = self - - emailLoginButton.configure( - icon: EPLoginConfig.Images.iconLoginEmail, - title: YMLocalizedString(EPLoginConfig.LocalizedKeys.emailLogin) - ) - emailLoginButton.delegate = self - - // StackView 布局 - let stackView = UIStackView(arrangedSubviews: [idLoginButton, emailLoginButton]) - stackView.axis = .vertical - stackView.spacing = EPLoginConfig.Layout.loginButtonSpacing - stackView.distribution = .fillEqually - view.addSubview(stackView) - - stackView.snp.makeConstraints { make in - make.leading.equalToSuperview().offset(EPLoginConfig.Layout.loginButtonHorizontalPadding) - make.trailing.equalToSuperview().offset(-EPLoginConfig.Layout.loginButtonHorizontalPadding) - make.top.equalTo(logoImageView.snp.bottom) - } - - idLoginButton.snp.makeConstraints { make in - make.height.equalTo(EPLoginConfig.Layout.loginButtonHeight) - } - - emailLoginButton.snp.makeConstraints { make in - make.height.equalTo(EPLoginConfig.Layout.loginButtonHeight) - } - } - - private func setupPolicyArea() { - view.addSubview(agreeCheckbox) - view.addSubview(policyLabel) - - agreeCheckbox.setImage(kImage("login_privace_select"), for: .selected) - agreeCheckbox.setImage(kImage("login_privace_unselect"), for: .normal) - agreeCheckbox.addTarget(self, action: #selector(togglePolicyCheckbox), for: .touchUpInside) - - policyLabel.onUserAgreementTapped = { [weak self] in - print("[EPLogin] User agreement tapped callback triggered") - let url = self?.getUserAgreementURL() ?? "" - print("[EPLogin] User agreement URL: \(url)") - self?.openPolicyInExternalBrowser(url) - } - policyLabel.onPrivacyPolicyTapped = { [weak self] in - print("[EPLogin] Privacy policy tapped callback triggered") - let url = self?.getPrivacyPolicyURL() ?? "" - print("[EPLogin] Privacy policy URL: \(url)") - self?.openPolicyInExternalBrowser(url) - } - - agreeCheckbox.snp.makeConstraints { make in - make.leading.equalToSuperview().offset(EPLoginConfig.Layout.horizontalPadding) - make.bottom.equalTo(view.safeAreaLayoutGuide).offset(-30) - make.size.equalTo(EPLoginConfig.Layout.checkboxSize) - } - - policyLabel.snp.makeConstraints { make in - make.leading.equalTo(agreeCheckbox.snp.trailing).offset(8) - make.trailing.equalToSuperview().offset(-EPLoginConfig.Layout.horizontalPadding) - make.centerY.equalTo(agreeCheckbox) - } - } - - private func setupNavigationBar() { -#if DEBUG - view.addSubview(feedbackButton) - feedbackButton.setTitle(YMLocalizedString(EPLoginConfig.LocalizedKeys.feedback), for: .normal) - feedbackButton.titleLabel?.font = .systemFont(ofSize: EPLoginConfig.Layout.smallFontSize) - feedbackButton.backgroundColor = EPLoginConfig.Colors.backgroundTransparent - feedbackButton.layer.cornerRadius = EPLoginConfig.Layout.feedbackButtonCornerRadius - feedbackButton.addTarget(self, action: #selector(handleFeedback), for: .touchUpInside) - - feedbackButton.snp.makeConstraints { make in - make.trailing.equalToSuperview().offset(-EPLoginConfig.Layout.compactHorizontalPadding) - make.top.equalTo(view.safeAreaLayoutGuide).offset(8) - make.height.equalTo(EPLoginConfig.Layout.feedbackButtonHeight) - } - - view.addSubview(debugButton) - debugButton.setTitle("切换环境", for: .normal) - debugButton.setTitleColor(.blue, for: .normal) - debugButton.addTarget(self, action: #selector(handleDebug), for: .touchUpInside) - - debugButton.snp.makeConstraints { make in - make.leading.equalToSuperview().offset(EPLoginConfig.Layout.compactHorizontalPadding) - make.top.equalTo(view.safeAreaLayoutGuide).offset(8) - } -#endif // DEBUG - } - - // MARK: - Actions - - private func handleIDLogin() { - let vc = EPLoginTypesViewController() - vc.displayType = .id - navigationController?.pushViewController(vc, animated: true) - } - - private func handleEmailLogin() { - let vc = EPLoginTypesViewController() - vc.displayType = .email - navigationController?.pushViewController(vc, animated: true) - } - - @objc private func togglePolicyCheckbox() { - agreeCheckbox.isSelected.toggle() - UserDefaults.standard.set(agreeCheckbox.isSelected, forKey: policySelectedKey) - } - - @objc private func handleFeedback() { - print("[EPLogin] Feedback - 占位,Phase 2 实现") - } - - #if DEBUG - @objc private func handleDebug() { - print("[EPLogin] Debug - 占位,Phase 2 实现") - } - #endif - - private func openPolicyInExternalBrowser(_ urlString: String) { - print("[EPLogin] Original URL: \(urlString)") - - // 如果不是完整 URL,拼接域名(参考 XPWebViewController.m 第 697-698 行) - var fullUrl = urlString - if !urlString.hasPrefix("http") && !urlString.hasPrefix("https") { - let hostUrl = HttpRequestHelper.getHostUrl() - fullUrl = "\(hostUrl)/\(urlString)" - print("[EPLogin] Added host URL, full URL: \(fullUrl)") - } - - print("[EPLogin] Opening URL in external browser: \(fullUrl)") - - guard let url = URL(string: fullUrl) else { - print("[EPLogin] ❌ Invalid URL: \(fullUrl)") - return - } - - print("[EPLogin] URL object created: \(url)") - - // 在外部浏览器中打开 - if UIApplication.shared.canOpenURL(url) { - print("[EPLogin] ✅ Can open URL, attempting to open...") - UIApplication.shared.open(url, options: [:]) { success in - print("[EPLogin] Open external browser: \(success ? "✅ Success" : "❌ Failed")") - } - } else { - print("[EPLogin] ❌ Cannot open URL: \(fullUrl)") - } - } - - // MARK: - Helpers - - private func loadPolicyStatus() { - agreeCheckbox.isSelected = UserDefaults.standard.bool(forKey: policySelectedKey) - // 默认勾选 - if !UserDefaults.standard.bool(forKey: EPLoginConfig.Keys.hasLaunchedBefore) { - agreeCheckbox.isSelected = true - UserDefaults.standard.set(true, forKey: policySelectedKey) - UserDefaults.standard.set(true, forKey: EPLoginConfig.Keys.hasLaunchedBefore) - } - } - - /// 获取用户协议 URL - private func getUserAgreementURL() -> String { - // kUserProtocalURL 对应枚举值 4 - let url = URLWithType(URLType(rawValue: 4)!) as String - print("[EPLogin] User agreement URL from URLWithType: \(url)") - return url - } - - /// 获取隐私政策 URL - private func getPrivacyPolicyURL() -> String { - // kPrivacyURL 对应枚举值 0 - let url = URLWithType(URLType(rawValue: 0)!) as String - print("[EPLogin] Privacy policy URL from URLWithType: \(url)") - return url - } - - private func checkPolicyAgreed() -> Bool { - if !agreeCheckbox.isSelected { - // Phase 2: 显示提示 - print("[EPLogin] Please agree to policy first") - return false - } - return true - } -} - -// MARK: - EPLoginButtonDelegate - -extension EPLoginViewController: EPLoginButtonDelegate { - func loginButtonDidTap(_ button: EPLoginButton) { - guard checkPolicyAgreed() else { return } - - if button == idLoginButton { - handleIDLogin() - } else if button == emailLoginButton { - handleEmailLogin() - } - } -} diff --git a/YuMi/E-P/Login/Models/EPLoginBridge.swift.backup b/YuMi/E-P/Login/Models/EPLoginBridge.swift.backup deleted file mode 100644 index 929191a..0000000 --- a/YuMi/E-P/Login/Models/EPLoginBridge.swift.backup +++ /dev/null @@ -1,33 +0,0 @@ -// -// EPLoginBridge.swift -// YuMi -// -// Created by AI on 2025-01-27. -// 桥接 Objective-C 宏到 Swift -// - -import UIKit - -/// 桥接 kImage 宏 -func kImage(_ name: String) -> UIImage? { - return UIImage(named: name) -} - -/// 桥接 YMLocalizedString 宏 -func YMLocalizedString(_ key: String) -> String { - return Bundle.ymLocalizedString(forKey: key) -} - -/// 桥接 URLType 枚举常量 -extension URLType { - static var captchaSwitch: URLType { - return URLType(rawValue: 113)! // kCaptchaSwitchPath - } -} - -/// DES 加密辅助函数 -func encryptDES(_ plainText: String) -> String { - // 直接使用加密密钥(与 ObjC 版本保持一致) - let key = "1ea53d260ecf11e7b56e00163e046a26" - return DESEncrypt.encryptUseDES(plainText, key: key) ?? plainText -} diff --git a/YuMi/E-P/Login/Models/EPLoginConfig.swift.backup b/YuMi/E-P/Login/Models/EPLoginConfig.swift.backup deleted file mode 100644 index d2f7cce..0000000 --- a/YuMi/E-P/Login/Models/EPLoginConfig.swift.backup +++ /dev/null @@ -1,305 +0,0 @@ -// -// EPLoginConfig.swift -// YuMi -// -// Created by AI on 2025-01-27. -// 统一配置文件 - 消除硬编码 -// - -import UIKit - -/// 登录模块统一配置 -struct EPLoginConfig { - - // MARK: - Layout 布局尺寸 - - struct Layout { - /// 标准按钮宽度 - static let buttonWidth: CGFloat = 294 - /// 标准按钮高度 - static let buttonHeight: CGFloat = 46 - /// 登录按钮高度 - static let loginButtonHeight: CGFloat = 56 - /// 登录按钮间距 - static let loginButtonSpacing: CGFloat = 24 - /// 登录按钮左右边距 - static let loginButtonHorizontalPadding: CGFloat = 30 - - /// 输入框/按钮统一高度 - static let uniformHeight: CGFloat = 56 - /// 输入框/按钮统一左右边距 - static let uniformHorizontalPadding: CGFloat = 29 - /// 输入框/按钮统一圆角 - static let uniformCornerRadius: CGFloat = 28 - /// 标准圆角半径(按钮/输入框) - static let cornerRadius: CGFloat = 23 - - /// Logo 尺寸 - static let logoHeight: CGFloat = 400 - /// Logo 距离顶部的距离 - static let logoTopOffset: CGFloat = 80 - - /// E-PARTY 标题字号 - static let epartiTitleFontSize: CGFloat = 56 - /// E-PARTY 标题距离 view leading - static let epartiTitleLeading: CGFloat = 40 - /// E-PARTY 标题距离 logoImage bottom 的偏移(负值表示向上) - static let epartiTitleBottomOffset: CGFloat = -30 - - /// 输入框之间的垂直间距 - static let inputVerticalSpacing: CGFloat = 16 - /// 输入框距离标题的距离 - static let inputTitleSpacing: CGFloat = 60 - - /// 按钮距离输入框的距离 - static let buttonTopSpacing: CGFloat = 40 - - /// 页面左右边距 - static let horizontalPadding: CGFloat = 40 - /// 紧凑左右边距 - static let compactHorizontalPadding: CGFloat = 16 - - /// 标题字体大小 - static let titleFontSize: CGFloat = 28 - /// 按钮字体大小 - static let buttonFontSize: CGFloat = 16 - /// 输入框字体大小 - static let inputFontSize: CGFloat = 14 - /// 小字体大小(提示文字等) - static let smallFontSize: CGFloat = 12 - - /// 图标尺寸 - static let iconSize: CGFloat = 24 - /// 登录按钮图标尺寸 - static let loginButtonIconSize: CGFloat = 30 - /// 登录按钮图标左边距(距离白色背景) - static let loginButtonIconLeading: CGFloat = 33 - /// 图标左边距 - static let iconLeading: CGFloat = 15 - /// 图标与文字间距 - static let iconTextSpacing: CGFloat = 12 - - /// Checkbox 尺寸 - static let checkboxSize: CGFloat = 18 - - /// 返回按钮尺寸 - static let backButtonSize: CGFloat = 44 - - /// Feedback 按钮高度 - static let feedbackButtonHeight: CGFloat = 22 - static let feedbackButtonCornerRadius: CGFloat = 10.5 - - /// 输入框高度 - static let inputHeight: CGFloat = 56 - /// 输入框圆角 - static let inputCornerRadius: CGFloat = 28 - /// 输入框左右内边距 - static let inputHorizontalPadding: CGFloat = 24 - /// 输入框 icon 尺寸 - static let inputIconSize: CGFloat = 20 - /// 输入框边框宽度 - static let inputBorderWidth: CGFloat = 1 - - /// 验证码按钮宽度 - static let codeButtonWidth: CGFloat = 102 - /// 验证码按钮高度 - static let codeButtonHeight: CGFloat = 38 - } - - // MARK: - Colors 颜色主题 - - struct Colors { - /// 主题色(按钮背景) - static let primary = UIColor.systemPurple - - /// 背景色 - static let background = UIColor.white - static let backgroundTransparent = UIColor.white.withAlphaComponent(0.5) - - /// 文字颜色 - static let text = UIColor.darkText - static let textSecondary = UIColor.darkGray - static let textLight = UIColor.white - - /// 图标颜色 - static let icon = UIColor.darkGray - static let iconDisabled = UIColor.gray - - /// 输入框颜色 - static let inputBackground = UIColor.white.withAlphaComponent(0.1) - static let inputText = UIColor(red: 0x1F/255.0, green: 0x1B/255.0, blue: 0x4F/255.0, alpha: 1.0) - static let inputBorder = UIColor.white - static let inputBorderFocused = UIColor.systemPurple - - /// 渐变色(Login/Confirm按钮) - static let gradientStart = UIColor(red: 0xF8/255.0, green: 0x54/255.0, blue: 0xFC/255.0, alpha: 1.0) // #F854FC - static let gradientEnd = UIColor(red: 0x50/255.0, green: 0x0F/255.0, blue: 0xFF/255.0, alpha: 1.0) // #500FFF - - /// 验证码按钮颜色 - static let codeButtonBackground = UIColor(red: 0x91/255.0, green: 0x68/255.0, blue: 0xFA/255.0, alpha: 1.0) - - /// 按钮状态颜色 - static let buttonEnabled = UIColor.systemPurple - static let buttonDisabled = UIColor.lightGray - - /// 错误提示色 - static let error = UIColor.systemRed - static let success = UIColor.systemGreen - - /// 链接颜色 - static let link = UIColor.black - static let linkUnderline = UIColor.black - } - - // MARK: - Animation 动画配置 - - struct Animation { - /// 标准动画时长 - static let duration: TimeInterval = 0.3 - /// 短动画时长 - static let shortDuration: TimeInterval = 0.15 - /// 长动画时长 - static let longDuration: TimeInterval = 0.5 - - /// 弹簧动画阻尼 - static let springDamping: CGFloat = 0.75 - /// 弹簧动画初速度 - static let springVelocity: CGFloat = 0.5 - - /// 按钮点击缩放比例 - static let buttonPressScale: CGFloat = 0.95 - - /// 错误抖动距离 - static let shakeOffset: CGFloat = 10 - /// 错误抖动次数 - static let shakeCount: Int = 3 - } - - // MARK: - Validation 验证规则 - - struct Validation { - /// 密码最小长度 - static let passwordMinLength = 6 - /// 密码最大长度 - static let passwordMaxLength = 16 - - /// 验证码长度 - static let codeLength = 6 - - /// 手机号最小长度 - static let phoneMinLength = 10 - /// 手机号最大长度 - static let phoneMaxLength = 15 - - /// 邮箱正则表达式 - static let emailRegex = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}" - /// 手机号正则表达式 - static let phoneRegex = "^[0-9]{10,15}$" - } - - // MARK: - Timing 时间配置 - - struct Timing { - /// 验证码倒计时秒数 - static let codeCountdownSeconds = 60 - - /// Toast 显示时长 - static let toastDuration: TimeInterval = 2.0 - - /// 加载超时时间 - static let requestTimeout: TimeInterval = 30.0 - } - - // MARK: - API 接口配置 - - struct API { - /// Client Secret - static let clientSecret = "uyzjdhds" - /// Client ID - static let clientId = "erban-client" - /// Grant Type - static let grantType = "password" - /// 版本号 - static let version = "1" - - /// 验证码类型:登录 - static let codeTypeLogin = 1 - /// 验证码类型:找回密码 - static let codeTypeReset = 2 - } - - // MARK: - UserDefaults Keys - - struct Keys { - /// 隐私协议已同意 - static let policyAgreed = "HadAgreePrivacy" - /// 首次启动标识 - static let hasLaunchedBefore = "HasLaunchedBefore" - } - - // MARK: - Images 图片资源名称 - - struct Images { - /// 背景图 - static let background = "vc_bg" - /// Logo 背景图 - static let loginBg = "login_bg" - - /// 登录按钮图标 - ID - static let iconLoginId = "icon_login_id" - /// 登录按钮图标 - Email - static let iconLoginEmail = "icon_login_email" - - /// 图标 - 用户 - static let iconPerson = "person.circle" - static let iconPersonFill = "person" - /// 图标 - 邮箱 - static let iconEmail = "envelope.circle" - static let iconEmailFill = "envelope" - /// 图标 - 手机 - static let iconPhone = "phone.circle" - static let iconPhoneFill = "phone" - /// 图标 - Apple - static let iconApple = "apple.logo" - /// 图标 - 锁 - static let iconLock = "lock" - /// 图标 - 数字 - static let iconNumber = "number" - - /// 密码可见性图标 - static let iconPasswordSee = "icon_password_see" - static let iconPasswordUnsee = "icon_password_unsee" - - /// 图标 - 返回 - static let iconBack = "chevron.left" - /// 图标 - 眼睛(隐藏) - static let iconEyeSlash = "eye.slash" - /// 图标 - 眼睛(显示) - static let iconEye = "eye" - - /// Checkbox - 未选中 - static let checkboxEmpty = "circle" - /// Checkbox - 已选中 - static let checkboxFilled = "checkmark.circle" - } - - // MARK: - Localized Strings Keys - - struct LocalizedKeys { - /// ID 登录 - static let idLogin = "1.0.37_text_26" - /// 邮箱登录 - static let emailLogin = "20.20.51_text_1" - - /// 隐私协议完整文本 - static let policyFullText = "XPLoginViewController6" - /// 用户协议 - static let userAgreement = "XPLoginViewController7" - /// 隐私政策 - static let privacyPolicy = "XPLoginViewController9" - - /// 反馈 - static let feedback = "XPMineFeedbackViewController0" - } -} - diff --git a/YuMi/E-P/Login/Models/EPLoginState.swift.backup b/YuMi/E-P/Login/Models/EPLoginState.swift.backup deleted file mode 100644 index 3ec7b04..0000000 --- a/YuMi/E-P/Login/Models/EPLoginState.swift.backup +++ /dev/null @@ -1,52 +0,0 @@ -// -// EPLoginState.swift -// YuMi -// -// Created by AI on 2025-01-27. -// - -import Foundation - -/// 登录显示类型枚举 -enum EPLoginDisplayType { - case id // ID + 密码 - case email // 邮箱 + 验证码 - case phone // 手机号 + 验证码 - case emailReset // 邮箱找回密码 - case phoneReset // 手机号找回密码 -} - -/// 登录状态验证器(Phase 2 实现) -class EPLoginValidator { - - /// 密码强度验证:6-16位,必须包含字母+数字 - func validatePassword(_ password: String) -> Bool { - guard password.count >= 6 && password.count <= 16 else { return false } - - let hasLetter = password.rangeOfCharacter(from: .letters) != nil - let hasDigit = password.rangeOfCharacter(from: .decimalDigits) != nil - - return hasLetter && hasDigit - } - - /// 邮箱格式验证 - func validateEmail(_ email: String) -> Bool { - let emailRegex = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}" - let emailPredicate = NSPredicate(format: "SELF MATCHES %@", emailRegex) - return emailPredicate.evaluate(with: email) - } - - /// 验证码格式验证(6位数字) - func validateCode(_ code: String) -> Bool { - guard code.count == 6 else { return false } - return code.allSatisfy { $0.isNumber } - } - - /// 手机号格式验证(简单验证) - func validatePhone(_ phone: String) -> Bool { - let phoneRegex = "^[0-9]{10,15}$" - let phonePredicate = NSPredicate(format: "SELF MATCHES %@", phoneRegex) - return phonePredicate.evaluate(with: phone) - } -} - diff --git a/YuMi/E-P/Login/Services/EPLoginManager.swift.backup b/YuMi/E-P/Login/Services/EPLoginManager.swift.backup deleted file mode 100644 index e84a972..0000000 --- a/YuMi/E-P/Login/Services/EPLoginManager.swift.backup +++ /dev/null @@ -1,149 +0,0 @@ -// -// EPLoginManager.swift -// YuMi -// -// Created by AI on 2025-01-27. -// - -import UIKit - -/// 登录管理器(Swift 版本) -/// 替代 PILoginManager,处理登录成功后的路由和初始化 -@objc class EPLoginManager: NSObject { - - // MARK: - Login Success Navigation - - /// 登录成功后跳转首页 - /// - Parameter viewController: 当前视图控制器 - static func jumpToHome(from viewController: UIViewController) { - - // 1. 获取当前账号信息 - guard let accountModel = AccountInfoStorage.instance().getCurrentAccountInfo() else { - print("[EPLoginManager] 账号信息不完整,无法继续") - return - } - - let accessToken = accountModel.access_token - guard !accessToken.isEmpty else { - print("[EPLoginManager] access_token 为空,无法继续") - return - } - - // 2. 请求 ticket - let loginService = EPLoginService() - loginService.requestTicket(accessToken: accessToken) { ticket in - - // 3. 保存 ticket - AccountInfoStorage.instance().saveTicket(ticket) - - // 4. 切换到 EPTabBarController - DispatchQueue.main.async { - let epTabBar = EPTabBarController.create() - epTabBar.refreshTabBarWithIsLogin(true) - - // 设置为根控制器 - if let window = getKeyWindow() { - window.rootViewController = epTabBar - window.makeKeyAndVisible() - - // 延迟检查专属颜色(登录成功后引导) - DispatchQueue.main.asyncAfter(deadline: .now() + 0.8) { - Self.checkAndShowSignatureColorGuide(in: window) - } - } - - print("[EPLoginManager] 登录成功,已切换到 EPTabBarController") - } - - } failure: { code, msg in - print("[EPLoginManager] 请求 Ticket 失败: \(code) - \(msg)") - - // Ticket 请求失败,仍然跳转到首页(保持原有行为) - DispatchQueue.main.async { - let epTabBar = EPTabBarController.create() - epTabBar.refreshTabBarWithIsLogin(true) - - if let window = getKeyWindow() { - window.rootViewController = epTabBar - window.makeKeyAndVisible() - - // 延迟检查专属颜色(登录成功后引导) - DispatchQueue.main.asyncAfter(deadline: .now() + 0.8) { - Self.checkAndShowSignatureColorGuide(in: window) - } - } - - print("[EPLoginManager] Ticket 请求失败,仍跳转到首页") - } - } - } - - /// Apple Login 接口占位(不实现) - /// - Parameter viewController: 当前视图控制器 - static func loginWithApple(from viewController: UIViewController) { - print("[EPLoginManager] Apple Login - 占位,Phase 2 实现") - // 占位,打印 log - } - - // MARK: - Helper Methods - - /// 获取 keyWindow(iOS 13+ 兼容) - private static func getKeyWindow() -> UIWindow? { - if #available(iOS 13.0, *) { - for windowScene in UIApplication.shared.connectedScenes { - if let windowScene = windowScene as? UIWindowScene, - windowScene.activationState == .foregroundActive { - for window in windowScene.windows { - if window.isKeyWindow { - return window - } - } - // 如果没有 keyWindow,返回第一个 window - return windowScene.windows.first - } - } - } else { - // iOS 13 以下,使用旧方法(已废弃但仍然可用) - return UIApplication.shared.keyWindow - } - return nil - } - - /// 检查并显示专属颜色引导页 - private static func checkAndShowSignatureColorGuide(in window: UIWindow) { - let hasSignatureColor = EPEmotionColorStorage.hasUserSignatureColor() - -// #if DEBUG - print("[EPLoginManager] Debug 模式:显示专属颜色引导页(已有颜色: \(hasSignatureColor))") - - let guideView = EPSignatureColorGuideView() - - // 设置颜色确认回调 - guideView.onColorConfirmed = { (hexColor: String) in - EPEmotionColorStorage.saveUserSignatureColor(hexColor) - print("[EPLoginManager] 用户选择专属颜色: \(hexColor)") - } - - // 如果已有颜色,设置 Skip 回调 - if hasSignatureColor { - guideView.onSkipTapped = { - print("[EPLoginManager] 用户跳过专属颜色选择") - } - } - - // 显示引导页,已有颜色时显示 Skip 按钮 - guideView.show(in: window, showSkipButton: hasSignatureColor) - -// #else -// // Release 环境:仅在未设置专属颜色时显示 -// if !hasSignatureColor { -// let guideView = EPSignatureColorGuideView() -// guideView.onColorConfirmed = { (hexColor: String) in -// EPEmotionColorStorage.saveUserSignatureColor(hexColor) -// } -// guideView.show(in: window) -// } -// #endif - } -} - diff --git a/YuMi/E-P/Login/Services/EPLoginService.swift.backup b/YuMi/E-P/Login/Services/EPLoginService.swift.backup deleted file mode 100644 index 980f509..0000000 --- a/YuMi/E-P/Login/Services/EPLoginService.swift.backup +++ /dev/null @@ -1,303 +0,0 @@ -// -// EPLoginService.swift -// YuMi -// -// Created by AI on 2025-01-27. -// - -import Foundation - -/// 登录服务封装(Swift 现代化版本) -/// 统一封装所有登录相关 API,完全替代 OC 版本的 LoginPresenter -@objc class EPLoginService: NSObject { - - // MARK: - Constants - - private let clientSecret = EPLoginConfig.API.clientSecret - private let clientId = EPLoginConfig.API.clientId - private let version = EPLoginConfig.API.version - - // MARK: - Private Helper Methods - - /// 解析并保存 AccountModel - /// - Parameters: - /// - data: API 返回的数据 - /// - code: 状态码 - /// - completion: 成功回调 - /// - failure: 失败回调 - private func parseAndSaveAccount(data: BaseModel?, - code: Int64, - completion: @escaping (AccountModel) -> Void, - failure: @escaping (Int, String) -> Void) { - if code == 200 { - if let accountDict = data?.data as? NSDictionary, - let accountModel = AccountModel.mj_object(withKeyValues: accountDict) { - // 保存账号信息 - AccountInfoStorage.instance().saveAccountInfo(accountModel) - completion(accountModel) - } else { - failure(Int(code), YMLocalizedString("error.account_parse_failed")) - } - } else { - failure(Int(code), YMLocalizedString("error.operation_failed")) - } - } - - // MARK: - Request Ticket - - /// 请求 Ticket(登录成功后调用) - /// - Parameters: - /// - accessToken: 访问令牌 - /// - completion: 成功回调 (ticket) - /// - failure: 失败回调 (错误码, 错误信息) - @objc func requestTicket(accessToken: String, - completion: @escaping (String) -> Void, - failure: @escaping (Int, String) -> Void) { - - Api.requestTicket({ (data, code, msg) in - if code == 200, let dict = data?.data as? NSDictionary { - if let tickets = dict["tickets"] as? NSArray, - let firstTicket = tickets.firstObject as? NSDictionary, - let ticket = firstTicket["ticket"] as? String { - completion(ticket) - } else { - failure(Int(code), YMLocalizedString("error.ticket_parse_failed")) - } - } else { - failure(Int(code), msg ?? YMLocalizedString("error.request_ticket_failed")) - } - }, access_token: accessToken, issue_type: "multi") - } - - // MARK: - Send Verification Code - - /// 发送邮箱验证码 - /// - Parameters: - /// - email: 邮箱地址 - /// - type: 类型 (1=登录, 2=找回密码) - /// - completion: 成功回调 - /// - failure: 失败回调 - @objc func sendEmailCode(email: String, - type: Int, - completion: @escaping () -> Void, - failure: @escaping (Int, String) -> Void) { - - // 🔐 DES 加密邮箱 - let encryptedEmail = encryptDES(email) - - Api.emailGetCode({ (data, code, msg) in - if code == 200 { - completion() - } else { - failure(Int(code), msg ?? YMLocalizedString("error.send_email_code_failed")) - } - }, emailAddress: encryptedEmail, type: NSNumber(value: type)) - } - - /// 发送手机验证码 - /// - Parameters: - /// - phone: 手机号 - /// - areaCode: 区号 - /// - type: 类型 (1=登录, 2=找回密码) - /// - completion: 成功回调 - /// - failure: 失败回调 - @objc func sendPhoneCode(phone: String, - areaCode: String, - type: Int, - completion: @escaping () -> Void, - failure: @escaping (Int, String) -> Void) { - - // 🔐 DES 加密手机号 - let encryptedPhone = encryptDES(phone) - - Api.phoneSmsCode({ (data, code, msg) in - if code == 200 { - completion() - } else { - failure(Int(code), msg ?? YMLocalizedString("error.send_phone_code_failed")) - } - }, mobile: encryptedPhone, type: String(type), phoneAreaCode: areaCode) - } - - // MARK: - Login Methods - - /// ID + 密码登录 - /// - Parameters: - /// - id: 用户 ID - /// - password: 密码 - /// - completion: 成功回调 (AccountModel) - /// - failure: 失败回调 - @objc func loginWithID(id: String, - password: String, - completion: @escaping (AccountModel) -> Void, - failure: @escaping (Int, String) -> Void) { - - // 🔐 DES 加密 ID 和密码 - let encryptedId = encryptDES(id) - let encryptedPassword = encryptDES(password) - - Api.login(password: { [weak self] (data, code, msg) in - self?.parseAndSaveAccount( - data: data, - code: Int64(code), - completion: completion, - failure: { errorCode, _ in - failure(errorCode, msg ?? YMLocalizedString("error.login_failed")) - }) - }, - phone: encryptedId, - password: encryptedPassword, - client_secret: clientSecret, - version: version, - client_id: clientId, - grant_type: "password") - } - - /// 邮箱 + 验证码登录 - /// - Parameters: - /// - email: 邮箱地址 - /// - code: 验证码 - /// - completion: 成功回调 (AccountModel) - /// - failure: 失败回调 - @objc func loginWithEmail(email: String, - code: String, - completion: @escaping (AccountModel) -> Void, - failure: @escaping (Int, String) -> Void) { - - // 🔐 DES 加密邮箱 - let encryptedEmail = encryptDES(email) - - Api.login(code: { [weak self] (data, code, msg) in - self?.parseAndSaveAccount( - data: data, - code: Int64(code), - completion: completion, - failure: { errorCode, _ in - failure(errorCode, msg ?? YMLocalizedString("error.login_failed")) - }) - }, - email: encryptedEmail, - code: code, - client_secret: clientSecret, - version: version, - client_id: clientId, - grant_type: "email") - } - - /// 手机号 + 验证码登录 - /// - Parameters: - /// - phone: 手机号 - /// - code: 验证码 - /// - areaCode: 区号 - /// - completion: 成功回调 (AccountModel) - /// - failure: 失败回调 - @objc func loginWithPhone(phone: String, - code: String, - areaCode: String, - completion: @escaping (AccountModel) -> Void, - failure: @escaping (Int, String) -> Void) { - - // 🔐 DES 加密手机号 - let encryptedPhone = encryptDES(phone) - - Api.login(code: { [weak self] (data, code, msg) in - self?.parseAndSaveAccount( - data: data, - code: Int64(code), - completion: completion, - failure: { errorCode, _ in - failure(errorCode, msg ?? YMLocalizedString("error.login_failed")) - }) - }, - phone: encryptedPhone, - code: code, - client_secret: clientSecret, - version: version, - client_id: clientId, - grant_type: "password", - phoneAreaCode: areaCode) - } - - // MARK: - Reset Password - - /// 邮箱重置密码 - /// - Parameters: - /// - email: 邮箱地址 - /// - code: 验证码 - /// - newPassword: 新密码 - /// - completion: 成功回调 - /// - failure: 失败回调 - @objc func resetEmailPassword(email: String, - code: String, - newPassword: String, - completion: @escaping () -> Void, - failure: @escaping (Int, String) -> Void) { - - // 🔐 DES 加密邮箱和新密码 - let encryptedEmail = encryptDES(email) - let encryptedPassword = encryptDES(newPassword) - - Api.resetPassword(email: { (data, code, msg) in - if code == 200 { - completion() - } else { - failure(Int(code), msg ?? YMLocalizedString("error.reset_password_failed")) - } - }, email: encryptedEmail, newPwd: encryptedPassword, code: code) - } - - /// 手机号重置密码 - /// - Parameters: - /// - phone: 手机号 - /// - code: 验证码 - /// - areaCode: 区号 - /// - newPassword: 新密码 - /// - completion: 成功回调 - /// - failure: 失败回调 - @objc func resetPhonePassword(phone: String, - code: String, - areaCode: String, - newPassword: String, - completion: @escaping () -> Void, - failure: @escaping (Int, String) -> Void) { - - // 🔐 DES 加密手机号和新密码 - let encryptedPhone = encryptDES(phone) - let encryptedPassword = encryptDES(newPassword) - - Api.resetPassword(phone: { (data, code, msg) in - if code == 200 { - completion() - } else { - failure(Int(code), msg ?? YMLocalizedString("error.reset_password_failed")) - } - }, phone: encryptedPhone, newPwd: encryptedPassword, smsCode: code, phoneAreaCode: areaCode) - } - - // MARK: - Phone Quick Login (保留接口) - - /// 手机快速登录(保留接口但 UI 暂不暴露) - /// - Parameters: - /// - accessToken: 访问令牌 - /// - token: 令牌 - /// - completion: 成功回调 (AccountModel) - /// - failure: 失败回调 - @objc func phoneQuickLogin(accessToken: String, - token: String, - completion: @escaping (AccountModel) -> Void, - failure: @escaping (Int, String) -> Void) { - - Api.phoneQuickLogin({ [weak self] (data, code, msg) in - self?.parseAndSaveAccount( - data: data, - code: Int64(code), - completion: completion, - failure: { errorCode, _ in - failure(errorCode, msg ?? YMLocalizedString("error.quick_login_failed")) - }) - }, - accessToken: accessToken, - token: token) - } -} - diff --git a/YuMi/E-P/Login/Views/EPLoginButton.swift.backup b/YuMi/E-P/Login/Views/EPLoginButton.swift.backup deleted file mode 100644 index f85a9fb..0000000 --- a/YuMi/E-P/Login/Views/EPLoginButton.swift.backup +++ /dev/null @@ -1,131 +0,0 @@ -// -// EPLoginButton.swift -// YuMi -// -// Created by AI on 2025-01-27. -// 登录按钮组件 - 使用 StackView 实现 icon 左侧固定 + title 居中 -// - -import UIKit -import SnapKit - -/// 登录按钮点击代理 -protocol EPLoginButtonDelegate: AnyObject { - func loginButtonDidTap(_ button: EPLoginButton) -} - -/// 登录按钮组件 -class EPLoginButton: UIControl { - - // MARK: - Properties - - weak var delegate: EPLoginButtonDelegate? - - private let stackView = UIStackView() - private let iconImageView = UIImageView() - private let titleLabel = UILabel() - private let leftSpacer = UIView() - private let rightSpacer = UIView() - - // MARK: - Initialization - - override init(frame: CGRect) { - super.init(frame: frame) - setupUI() - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - // MARK: - Setup - - private func setupUI() { - backgroundColor = EPLoginConfig.Colors.background - layer.cornerRadius = EPLoginConfig.Layout.cornerRadius - - // StackView 配置 - stackView.axis = .horizontal - stackView.alignment = .center - stackView.distribution = .fill - stackView.spacing = 0 - stackView.isUserInteractionEnabled = false - addSubview(stackView) - - // Icon - iconImageView.contentMode = .scaleAspectFit - - // Title - titleLabel.font = .systemFont(ofSize: EPLoginConfig.Layout.inputFontSize, weight: .semibold) - titleLabel.textColor = EPLoginConfig.Colors.text - titleLabel.textAlignment = .center - - // Spacers - 让 title 居中 - leftSpacer.setContentHuggingPriority(.defaultLow, for: .horizontal) - rightSpacer.setContentHuggingPriority(.defaultLow, for: .horizontal) - - // 布局顺序: [Leading 33] + [Icon] + [Flexible Spacer] + [Title] + [Flexible Spacer] + [Trailing 33] - let leadingPadding = UIView() - let trailingPadding = UIView() - - stackView.addArrangedSubview(leadingPadding) - stackView.addArrangedSubview(iconImageView) - stackView.addArrangedSubview(leftSpacer) - stackView.addArrangedSubview(titleLabel) - stackView.addArrangedSubview(rightSpacer) - stackView.addArrangedSubview(trailingPadding) - - // 约束 - stackView.snp.makeConstraints { make in - make.edges.equalToSuperview() - } - - leadingPadding.snp.makeConstraints { make in - make.width.equalTo(EPLoginConfig.Layout.loginButtonIconLeading) - } - - iconImageView.snp.makeConstraints { make in - make.size.equalTo(EPLoginConfig.Layout.loginButtonIconSize) - } - - trailingPadding.snp.makeConstraints { make in - make.width.equalTo(EPLoginConfig.Layout.loginButtonIconLeading) - } - - // 设置 leftSpacer 和 rightSpacer 宽度相等,实现 title 居中 - leftSpacer.snp.makeConstraints { make in - make.width.equalTo(rightSpacer) - } - - // 添加点击事件 - addTarget(self, action: #selector(handleTap), for: .touchUpInside) - } - - // MARK: - Configuration - - /// 配置按钮 - /// - Parameters: - /// - icon: 图标名称 - /// - title: 标题文字 - func configure(icon: String, title: String) { - iconImageView.image = kImage(icon) - titleLabel.text = title - } - - // MARK: - Actions - - @objc private func handleTap() { - delegate?.loginButtonDidTap(self) - } - - // MARK: - Touch Feedback - - override var isHighlighted: Bool { - didSet { - UIView.animate(withDuration: 0.1) { - self.alpha = self.isHighlighted ? 0.7 : 1.0 - } - } - } -} - diff --git a/YuMi/E-P/Login/Views/EPLoginInputView.swift.backup b/YuMi/E-P/Login/Views/EPLoginInputView.swift.backup deleted file mode 100644 index 6854ff5..0000000 --- a/YuMi/E-P/Login/Views/EPLoginInputView.swift.backup +++ /dev/null @@ -1,322 +0,0 @@ -// -// EPLoginInputView.swift -// YuMi -// -// Created by AI on 2025-01-27. -// 登录输入框组件 - 支持区号、验证码、密码切换等完整功能 -// - -import UIKit -import SnapKit - -/// 输入框配置 -struct EPLoginInputConfig { - var showAreaCode: Bool = false - var showCodeButton: Bool = false - var isSecure: Bool = false - var icon: String? - var placeholder: String - var keyboardType: UIKeyboardType = .default -} - -/// 输入框代理 -protocol EPLoginInputViewDelegate: AnyObject { - func inputViewDidRequestCode(_ inputView: EPLoginInputView) - func inputViewDidSelectArea(_ inputView: EPLoginInputView) -} - -/// 登录输入框组件 -class EPLoginInputView: UIView { - - // MARK: - Properties - - weak var delegate: EPLoginInputViewDelegate? - - /// 输入内容变化回调 - var onTextChanged: ((String) -> Void)? - - private let stackView = UIStackView() - - // 区号区域 - private let areaStackView = UIStackView() - private let areaCodeButton = UIButton(type: .custom) - private let areaArrowImageView = UIImageView() - private let areaTapButton = UIButton(type: .custom) - - // 输入框 - private let inputTextField = UITextField() - private let iconImageView = UIImageView() - - // 眼睛按钮(密码可见性切换) - private let eyeButton = UIButton(type: .custom) - - // 验证码按钮 - private let codeButton = UIButton(type: .custom) - - // 倒计时 - private var timer: DispatchSourceTimer? - private var countdownSeconds = 60 - private var isCountingDown = false - - // 配置 - private var config: EPLoginInputConfig? - - /// 获取输入内容 - var text: String { - return inputTextField.text ?? "" - } - - // MARK: - Initialization - - override init(frame: CGRect) { - super.init(frame: frame) - setupUI() - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - deinit { - stopCountdown() - } - - // MARK: - Setup - - private func setupUI() { - backgroundColor = EPLoginConfig.Colors.inputBackground - layer.cornerRadius = EPLoginConfig.Layout.inputCornerRadius - layer.borderWidth = EPLoginConfig.Layout.inputBorderWidth - layer.borderColor = EPLoginConfig.Colors.inputBorder.cgColor - - // Main StackView - stackView.axis = .horizontal - stackView.alignment = .center - stackView.distribution = .fill - stackView.spacing = 8 - stackView.translatesAutoresizingMaskIntoConstraints = false - addSubview(stackView) - - setupAreaCodeView() - setupInputTextField() - setupEyeButton() - setupCodeButton() - - stackView.snp.makeConstraints { make in - make.leading.equalToSuperview().offset(EPLoginConfig.Layout.inputHorizontalPadding) - make.trailing.equalToSuperview().offset(-EPLoginConfig.Layout.inputHorizontalPadding) - make.top.bottom.equalToSuperview() - } - - // 默认隐藏所有可选组件 - areaStackView.isHidden = true - eyeButton.isHidden = true - codeButton.isHidden = true - iconImageView.isHidden = true - } - - private func setupAreaCodeView() { - // 区号 StackView - areaStackView.axis = .horizontal - areaStackView.alignment = .center - areaStackView.distribution = .fill - areaStackView.spacing = 8 - areaStackView.translatesAutoresizingMaskIntoConstraints = false - - // 区号按钮 - areaCodeButton.setTitle("+86", for: .normal) - areaCodeButton.setTitleColor(EPLoginConfig.Colors.inputText, for: .normal) - areaCodeButton.titleLabel?.font = .systemFont(ofSize: 16, weight: .medium) - areaCodeButton.isUserInteractionEnabled = false - areaCodeButton.translatesAutoresizingMaskIntoConstraints = false - - // 箭头图标 - areaArrowImageView.image = kImage("login_area_arrow") - areaArrowImageView.contentMode = .scaleAspectFit - areaArrowImageView.isUserInteractionEnabled = false - areaArrowImageView.translatesAutoresizingMaskIntoConstraints = false - - // 点击区域按钮 - areaTapButton.translatesAutoresizingMaskIntoConstraints = false - areaTapButton.addTarget(self, action: #selector(handleAreaTap), for: .touchUpInside) - - areaStackView.addSubview(areaTapButton) - areaStackView.addArrangedSubview(areaCodeButton) - areaStackView.addArrangedSubview(areaArrowImageView) - - stackView.addArrangedSubview(areaStackView) - - areaTapButton.snp.makeConstraints { make in - make.edges.equalToSuperview() - } - - areaCodeButton.snp.makeConstraints { make in - make.width.lessThanOrEqualTo(60) - } - - areaArrowImageView.snp.makeConstraints { make in - make.width.equalTo(12) - make.height.equalTo(8) - } - } - - private func setupInputTextField() { - // Icon (可选) - iconImageView.contentMode = .scaleAspectFit - iconImageView.tintColor = EPLoginConfig.Colors.icon - iconImageView.translatesAutoresizingMaskIntoConstraints = false - stackView.addArrangedSubview(iconImageView) - - iconImageView.snp.makeConstraints { make in - make.size.equalTo(EPLoginConfig.Layout.inputIconSize) - } - - // TextField - inputTextField.textColor = EPLoginConfig.Colors.textLight - inputTextField.font = .systemFont(ofSize: 14) - inputTextField.tintColor = EPLoginConfig.Colors.textLight - inputTextField.translatesAutoresizingMaskIntoConstraints = false - inputTextField.addTarget(self, action: #selector(textFieldDidChange), for: .editingChanged) - stackView.addArrangedSubview(inputTextField) - } - - @objc private func textFieldDidChange() { - onTextChanged?(inputTextField.text ?? "") - } - - private func setupEyeButton() { - eyeButton.translatesAutoresizingMaskIntoConstraints = false - eyeButton.setImage(kImage(EPLoginConfig.Images.iconPasswordUnsee), for: .normal) - eyeButton.setImage(kImage(EPLoginConfig.Images.iconPasswordSee), for: .selected) - eyeButton.addTarget(self, action: #selector(handleEyeTap), for: .touchUpInside) - stackView.addArrangedSubview(eyeButton) - - eyeButton.snp.makeConstraints { make in - make.size.equalTo(24) - } - } - - private func setupCodeButton() { - codeButton.translatesAutoresizingMaskIntoConstraints = false - codeButton.setTitle(YMLocalizedString("XPLoginInputView0"), for: .normal) - codeButton.setTitleColor(.white, for: .normal) - codeButton.titleLabel?.font = .systemFont(ofSize: 12, weight: .medium) - codeButton.titleLabel?.textAlignment = .center - codeButton.titleLabel?.numberOfLines = 2 - codeButton.layer.cornerRadius = EPLoginConfig.Layout.codeButtonHeight / 2 - codeButton.backgroundColor = EPLoginConfig.Colors.codeButtonBackground - codeButton.addTarget(self, action: #selector(handleCodeTap), for: .touchUpInside) - stackView.addArrangedSubview(codeButton) - - codeButton.snp.makeConstraints { make in - make.width.equalTo(EPLoginConfig.Layout.codeButtonWidth) - make.height.equalTo(EPLoginConfig.Layout.codeButtonHeight) - } - } - - // MARK: - Configuration - - /// 配置输入框 - func configure(with config: EPLoginInputConfig) { - self.config = config - - // 区号 - areaStackView.isHidden = !config.showAreaCode - - // Icon - 默认隐藏,不再使用 - iconImageView.isHidden = true - - // Placeholder(60% 白色) - inputTextField.attributedPlaceholder = NSAttributedString( - string: config.placeholder, - attributes: [NSAttributedString.Key.foregroundColor: UIColor.white.withAlphaComponent(0.6)] - ) - - // 键盘类型 - inputTextField.keyboardType = config.keyboardType - - // 密码模式 - inputTextField.isSecureTextEntry = config.isSecure - eyeButton.isHidden = !config.isSecure - - // 验证码按钮 - codeButton.isHidden = !config.showCodeButton - } - - /// 设置区号 - func setAreaCode(_ code: String) { - areaCodeButton.setTitle(code, for: .normal) - } - - /// 清空输入 - func clearInput() { - inputTextField.text = "" - } - - /// 弹出键盘(自动聚焦输入框) - func displayKeyboard() { - inputTextField.becomeFirstResponder() - } - - // MARK: - Actions - - @objc private func handleAreaTap() { - delegate?.inputViewDidSelectArea(self) - } - - @objc private func handleEyeTap() { - eyeButton.isSelected.toggle() - inputTextField.isSecureTextEntry = !eyeButton.isSelected - } - - @objc private func handleCodeTap() { - guard !isCountingDown else { return } - delegate?.inputViewDidRequestCode(self) - } - - // MARK: - Countdown - - /// 开始倒计时 - func startCountdown() { - guard !isCountingDown else { return } - - isCountingDown = true - countdownSeconds = 60 - codeButton.isEnabled = false - codeButton.backgroundColor = EPLoginConfig.Colors.iconDisabled - - let queue = DispatchQueue.main - let timer = DispatchSource.makeTimerSource(queue: queue) - timer.schedule(deadline: .now(), repeating: 1.0) - - timer.setEventHandler { [weak self] in - guard let self = self else { return } - - self.countdownSeconds -= 1 - - if self.countdownSeconds <= 0 { - self.stopCountdown() - self.codeButton.setTitle(YMLocalizedString("XPLoginInputView1"), for: .normal) - } else { - self.codeButton.setTitle("\(self.countdownSeconds)s", for: .normal) - } - } - - timer.resume() - self.timer = timer - } - - /// 停止倒计时 - func stopCountdown() { - guard let timer = timer else { return } - - timer.cancel() - self.timer = nil - isCountingDown = false - - codeButton.isEnabled = true - codeButton.backgroundColor = EPLoginConfig.Colors.codeButtonBackground - codeButton.setTitle(YMLocalizedString("XPLoginInputView0"), for: .normal) - } -} - diff --git a/YuMi/E-P/Login/Views/EPPolicyLabel.swift.backup b/YuMi/E-P/Login/Views/EPPolicyLabel.swift.backup deleted file mode 100644 index ed48d0c..0000000 --- a/YuMi/E-P/Login/Views/EPPolicyLabel.swift.backup +++ /dev/null @@ -1,151 +0,0 @@ -// -// EPPolicyLabel.swift -// YuMi -// -// Created by AI on 2025-01-27. -// - -import UIKit - -class EPPolicyLabel: UILabel { - - // MARK: - Properties - - var onUserAgreementTapped: (() -> Void)? - var onPrivacyPolicyTapped: (() -> Void)? - - // MARK: - Initialization - - override init(frame: CGRect) { - super.init(frame: frame) - setup() - } - - required init?(coder: NSCoder) { - super.init(coder: coder) - setup() - } - - // MARK: - Setup - - private func setup() { - numberOfLines = 0 - isUserInteractionEnabled = true - - // 使用 YMLocalizedString 获取文案 - let fullText = YMLocalizedString("XPLoginViewController6") - let userAgreementText = YMLocalizedString("XPLoginViewController7") - let privacyPolicyText = YMLocalizedString("XPLoginViewController9") - - let attributedString = NSMutableAttributedString(string: fullText) - attributedString.addAttribute(NSAttributedString.Key.foregroundColor, - value: UIColor.darkGray, - range: NSRange(location: 0, length: fullText.count)) - attributedString.addAttribute(NSAttributedString.Key.font, - value: UIFont.systemFont(ofSize: 12), - range: NSRange(location: 0, length: fullText.count)) - - // 高亮用户协议(蓝色) - if let userRange = fullText.range(of: userAgreementText) { - let nsRange = NSRange(userRange, in: fullText) - attributedString.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor.systemBlue, range: nsRange) - attributedString.addAttribute(NSAttributedString.Key.underlineStyle, value: NSUnderlineStyle.single.rawValue, range: nsRange) - } - - // 高亮隐私政策(蓝色) - if let privacyRange = fullText.range(of: privacyPolicyText) { - let nsRange = NSRange(privacyRange, in: fullText) - attributedString.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor.systemBlue, range: nsRange) - attributedString.addAttribute(NSAttributedString.Key.underlineStyle, value: NSUnderlineStyle.single.rawValue, range: nsRange) - } - - attributedText = attributedString - - // 添加点击手势 - let tapGesture = UITapGestureRecognizer(target: self, action: #selector(handleTap(_:))) - addGestureRecognizer(tapGesture) - } - - // MARK: - Actions - - @objc private func handleTap(_ gesture: UITapGestureRecognizer) { - guard let attributedText = self.attributedText else { - print("[EPPolicyLabel] No attributed text") - return - } - - let text = attributedText.string - let userAgreementText = YMLocalizedString("XPLoginViewController7") - let privacyPolicyText = YMLocalizedString("XPLoginViewController9") - - print("[EPPolicyLabel] Tap detected, text: \(text)") - - let layoutManager = NSLayoutManager() - let textContainer = NSTextContainer(size: bounds.size) - let textStorage = NSTextStorage(attributedString: attributedText) - - layoutManager.addTextContainer(textContainer) - textStorage.addLayoutManager(layoutManager) - - textContainer.lineFragmentPadding = 0 - textContainer.maximumNumberOfLines = numberOfLines - textContainer.lineBreakMode = lineBreakMode - - let locationOfTouchInLabel = gesture.location(in: self) - let textBoundingBox = layoutManager.usedRect(for: textContainer) - - // 根据 textAlignment 计算偏移 - var textContainerOffset = CGPoint.zero - switch textAlignment { - case .left, .natural, .justified: - textContainerOffset = CGPoint(x: 0, y: (bounds.height - textBoundingBox.height) / 2) - case .center: - textContainerOffset = CGPoint(x: (bounds.width - textBoundingBox.width) / 2, - y: (bounds.height - textBoundingBox.height) / 2) - case .right: - textContainerOffset = CGPoint(x: bounds.width - textBoundingBox.width, - y: (bounds.height - textBoundingBox.height) / 2) - @unknown default: - textContainerOffset = CGPoint(x: 0, y: (bounds.height - textBoundingBox.height) / 2) - } - - let locationOfTouchInTextContainer = CGPoint(x: locationOfTouchInLabel.x - textContainerOffset.x, - y: locationOfTouchInLabel.y - textContainerOffset.y) - - // 确保点击在文本区域内 - guard textBoundingBox.contains(locationOfTouchInTextContainer) else { - print("[EPPolicyLabel] Tap outside text bounds") - return - } - - let indexOfCharacter = layoutManager.characterIndex(for: locationOfTouchInTextContainer, - in: textContainer, - fractionOfDistanceBetweenInsertionPoints: nil) - - print("[EPPolicyLabel] Character index: \(indexOfCharacter)") - - // 检查点击位置 - if let userRange = text.range(of: userAgreementText) { - let nsRange = NSRange(userRange, in: text) - print("[EPPolicyLabel] User agreement range: \(nsRange)") - if NSLocationInRange(indexOfCharacter, nsRange) { - print("[EPPolicyLabel] User agreement tapped!") - onUserAgreementTapped?() - return - } - } - - if let privacyRange = text.range(of: privacyPolicyText) { - let nsRange = NSRange(privacyRange, in: text) - print("[EPPolicyLabel] Privacy policy range: \(nsRange)") - if NSLocationInRange(indexOfCharacter, nsRange) { - print("[EPPolicyLabel] Privacy policy tapped!") - onPrivacyPolicyTapped?() - return - } - } - - print("[EPPolicyLabel] No link tapped") - } -} - diff --git a/YuMi/E-P/Mine/Controllers/EPAboutUsViewController.swift.backup b/YuMi/E-P/Mine/Controllers/EPAboutUsViewController.swift.backup deleted file mode 100644 index 716b287..0000000 --- a/YuMi/E-P/Mine/Controllers/EPAboutUsViewController.swift.backup +++ /dev/null @@ -1,162 +0,0 @@ -// -// EPAboutUsViewController.swift -// YuMi -// -// Created by AI on 2025-01-28. -// - -import UIKit -import SnapKit - -/// About Us 页面 -/// 展示应用图标和版本信息 -class EPAboutUsViewController: BaseViewController { - - // MARK: - UI Components - - private lazy var appIconImageView: UIImageView = { - let imageView = UIImageView() - imageView.contentMode = .scaleAspectFit - imageView.layer.cornerRadius = 20 - imageView.layer.masksToBounds = true - // 获取应用图标 - if let iconName = Bundle.main.object(forInfoDictionaryKey: "CFBundleIconName") as? String { - imageView.image = UIImage(named: iconName) - } else if let icons = Bundle.main.object(forInfoDictionaryKey: "CFBundleIcons") as? [String: Any], - let primaryIcon = icons["CFBundlePrimaryIcon"] as? [String: Any], - let iconFiles = primaryIcon["CFBundleIconFiles"] as? [String], - let lastIcon = iconFiles.last { - imageView.image = UIImage(named: lastIcon) - } else { - // 使用占位图标 - imageView.image = UIImage(named: "pi_app_logo_new_bg") - } - return imageView - }() - - private lazy var appNameLabel: UILabel = { - let label = UILabel() - label.text = Bundle.main.object(forInfoDictionaryKey: "CFBundleDisplayName") as? String - ?? Bundle.main.object(forInfoDictionaryKey: "CFBundleName") as? String - ?? "YuMi" - label.textColor = .white - label.font = .systemFont(ofSize: 24, weight: .bold) - label.textAlignment = .center - return label - }() - - private lazy var versionLabel: UILabel = { - let label = UILabel() - let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "1.0.0" - let build = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String ?? "1" - label.text = "Version \(version) (\(build))" - label.textColor = UIColor.white.withAlphaComponent(0.7) - label.font = .systemFont(ofSize: 16) - label.textAlignment = .center - return label - }() - - // MARK: - Lifecycle - - override func viewDidLoad() { - super.viewDidLoad() - setupNavigationBar() - setupUI() - } - - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - navigationController?.setNavigationBarHidden(false, animated: animated) - } - - // MARK: - Setup - - private func setupNavigationBar() { - title = YMLocalizedString("EPEditSetting.AboutUs") - - // 配置导航栏外观(iOS 13+) - let appearance = UINavigationBarAppearance() - appearance.configureWithOpaqueBackground() - appearance.backgroundColor = UIColor(hex: "#0C0527") - appearance.titleTextAttributes = [ - .foregroundColor: UIColor.white, - .font: UIFont.systemFont(ofSize: 18, weight: .medium) - ] - appearance.shadowColor = .clear // 移除底部分割线 - - navigationController?.navigationBar.standardAppearance = appearance - navigationController?.navigationBar.scrollEdgeAppearance = appearance - navigationController?.navigationBar.compactAppearance = appearance - navigationController?.navigationBar.tintColor = .white // 返回按钮颜色 - - // 隐藏返回按钮文字,只保留箭头 - navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil) - } - - private func setupUI() { - view.backgroundColor = UIColor(hex: "#0C0527") - - // 创建容器视图 - let containerView = UIView() - view.addSubview(containerView) - - // 添加 UI 组件到容器 - containerView.addSubview(appIconImageView) - containerView.addSubview(appNameLabel) - containerView.addSubview(versionLabel) - - // 布局容器(垂直居中) - containerView.snp.makeConstraints { make in - make.centerY.equalTo(view).offset(-50) // 稍微偏上 - make.leading.trailing.equalTo(view).inset(40) - } - - // 应用图标 - appIconImageView.snp.makeConstraints { make in - make.top.equalTo(containerView) - make.centerX.equalTo(containerView) - make.size.equalTo(100) - } - - // 应用名称 - appNameLabel.snp.makeConstraints { make in - make.top.equalTo(appIconImageView.snp.bottom).offset(24) - make.leading.trailing.equalTo(containerView) - } - - // 版本号 - versionLabel.snp.makeConstraints { make in - make.top.equalTo(appNameLabel.snp.bottom).offset(12) - make.leading.trailing.equalTo(containerView) - } - } -} - -// MARK: - UIColor Extension - -private extension UIColor { - convenience init(hex: String) { - let hex = hex.trimmingCharacters(in: CharacterSet.alphanumerics.inverted) - var int: UInt64 = 0 - Scanner(string: hex).scanHexInt64(&int) - let a, r, g, b: UInt64 - switch hex.count { - case 3: // RGB (12-bit) - (a, r, g, b) = (255, (int >> 8) * 17, (int >> 4 & 0xF) * 17, (int & 0xF) * 17) - case 6: // RGB (24-bit) - (a, r, g, b) = (255, int >> 16, int >> 8 & 0xFF, int & 0xFF) - case 8: // ARGB (32-bit) - (a, r, g, b) = (int >> 24, int >> 16 & 0xFF, int >> 8 & 0xFF, int & 0xFF) - default: - (a, r, g, b) = (1, 1, 1, 0) - } - - self.init( - red: CGFloat(r) / 255, - green: CGFloat(g) / 255, - blue: CGFloat(b) / 255, - alpha: CGFloat(a) / 255 - ) - } -} - diff --git a/YuMi/E-P/Mine/Controllers/EPEditSettingViewController.swift.backup b/YuMi/E-P/Mine/Controllers/EPEditSettingViewController.swift.backup deleted file mode 100644 index 5bdd941..0000000 --- a/YuMi/E-P/Mine/Controllers/EPEditSettingViewController.swift.backup +++ /dev/null @@ -1,850 +0,0 @@ -// -// EPEditSettingViewController.swift -// YuMi -// -// Created by AI on 2025-01-27. -// - -import UIKit -import Photos -import SnapKit -import WebKit - -/// 设置编辑页面 -/// 支持头像更新、昵称修改和退出登录功能 -class EPEditSettingViewController: BaseViewController { - - // MARK: - UI Components - private lazy var profileImageView: UIImageView = { - let imageView = UIImageView() - imageView.contentMode = .scaleAspectFill - imageView.layer.cornerRadius = 60 // 120/2 = 60 - imageView.layer.masksToBounds = true - imageView.backgroundColor = .systemGray5 - imageView.isUserInteractionEnabled = true - return imageView - }() - - private lazy var cameraIconView: UIImageView = { - let imageView = UIImageView() - imageView.contentMode = .scaleAspectFit - imageView.image = UIImage(named: "icon_setting_camear") - imageView.backgroundColor = UIColor(hex: "#0C0527") - imageView.layer.cornerRadius = 15 // 30/2 = 15 - imageView.layer.masksToBounds = true - return imageView - }() - - private lazy var tableView: UITableView = { - let tableView = UITableView(frame: .zero, style: .plain) - tableView.backgroundColor = UIColor(hex: "#0C0527") - tableView.separatorStyle = .none - tableView.delegate = self - tableView.dataSource = self - tableView.register(UITableViewCell.self, forCellReuseIdentifier: "SettingCell") - tableView.isScrollEnabled = true // 启用内部滚动 - return tableView - }() - - private lazy var logoutButton: UIButton = { - let button = UIButton(type: .system) - button.setTitle(YMLocalizedString("EPEditSetting.Logout"), for: .normal) - button.setTitleColor(.white, for: .normal) - button.titleLabel?.font = .systemFont(ofSize: 17, weight: .semibold) - button.layer.cornerRadius = 25 - button.addTarget(self, action: #selector(logoutButtonTapped), for: .touchUpInside) - return button - }() - - // MARK: - Data - - private var settingItems: [SettingItem] = [] - private var userInfo: UserInfoModel? - private var apiHelper: EPMineAPIHelper = EPMineAPIHelper() - private var hasAddedGradient = false - - // MARK: - Lifecycle - - override func viewDidLoad() { - super.viewDidLoad() - setupNavigationBar() - setupUI() - setupData() - loadUserInfo() - } - - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - navigationController?.setNavigationBarHidden(false, animated: animated) - } - - override func viewWillDisappear(_ animated: Bool) { - super.viewWillDisappear(animated) - // 恢复父页面的导航栏配置(透明) - restoreParentNavigationBarStyle() - } - - override func viewDidLayoutSubviews() { - super.viewDidLayoutSubviews() - - // 添加渐变背景到 Logout 按钮(只添加一次) - if !hasAddedGradient && logoutButton.bounds.width > 0 { - logoutButton.addGradientBackground( - with: [ - UIColor(red: 0xF8/255.0, green: 0x54/255.0, blue: 0xFC/255.0, alpha: 1.0), // #F854FC - UIColor(red: 0x50/255.0, green: 0x0F/255.0, blue: 0xFF/255.0, alpha: 1.0) // #500FFF - ], - start: CGPoint(x: 0, y: 0.5), - end: CGPoint(x: 1, y: 0.5), - cornerRadius: 25 - ) - hasAddedGradient = true - } - } - - // MARK: - Setup - - private func setupNavigationBar() { - title = YMLocalizedString("EPEditSetting.Title") - - // 配置导航栏外观(iOS 13+) - let appearance = UINavigationBarAppearance() - appearance.configureWithOpaqueBackground() - appearance.backgroundColor = UIColor(hex: "#0C0527") - appearance.titleTextAttributes = [ - .foregroundColor: UIColor.white, - .font: UIFont.systemFont(ofSize: 18, weight: .medium) - ] - appearance.shadowColor = .clear // 移除底部分割线 - - navigationController?.navigationBar.standardAppearance = appearance - navigationController?.navigationBar.scrollEdgeAppearance = appearance - navigationController?.navigationBar.compactAppearance = appearance - navigationController?.navigationBar.tintColor = .white // 返回按钮颜色 - - // 隐藏返回按钮文字,只保留箭头 - navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil) - - // 如果是从上一页 push 进来的,也要修改上一页的 backButtonTitle - navigationController?.navigationBar.topItem?.backBarButtonItem = UIBarButtonItem( - title: "", - style: .plain, - target: nil, - action: nil - ) - } - - private func restoreParentNavigationBarStyle() { - // 恢复透明导航栏(EPMineViewController 使用的是透明导航栏) - let transparentAppearance = UINavigationBarAppearance() - transparentAppearance.configureWithTransparentBackground() - transparentAppearance.backgroundColor = .clear - transparentAppearance.shadowColor = .clear - - navigationController?.navigationBar.standardAppearance = transparentAppearance - navigationController?.navigationBar.scrollEdgeAppearance = transparentAppearance - navigationController?.navigationBar.compactAppearance = transparentAppearance - } - - private func setupUI() { - view.backgroundColor = UIColor(hex: "#0C0527") - - // 设置头像布局 - view.addSubview(profileImageView) - profileImageView.snp.makeConstraints { make in - make.top.equalTo(view.safeAreaLayoutGuide.snp.top).offset(40) - make.centerX.equalTo(view) - make.size.equalTo(120) - } - - // 设置相机图标布局 - view.addSubview(cameraIconView) - cameraIconView.snp.makeConstraints { make in - make.bottom.equalTo(profileImageView.snp.bottom) - make.trailing.equalTo(profileImageView.snp.trailing) - make.size.equalTo(30) - } - - // 设置 Logout 按钮布局 - view.addSubview(logoutButton) - logoutButton.snp.makeConstraints { make in - make.leading.trailing.equalTo(view).inset(20) - make.bottom.equalTo(view.safeAreaLayoutGuide).offset(-40) - make.height.equalTo(50) - } - - // 设置 TableView 布局 - view.addSubview(tableView) - tableView.snp.makeConstraints { make in - make.top.equalTo(profileImageView.snp.bottom).offset(40) - make.leading.trailing.equalTo(view) - make.bottom.equalTo(logoutButton.snp.top).offset(-20) - } - - // 添加头像点击手势 - let tapGesture = UITapGestureRecognizer(target: self, action: #selector(profileImageTapped)) - profileImageView.addGestureRecognizer(tapGesture) - - // 添加相机图标点击手势 - let cameraTapGesture = UITapGestureRecognizer(target: self, action: #selector(profileImageTapped)) - cameraIconView.addGestureRecognizer(cameraTapGesture) - } - - - - private func setupData() { - settingItems = [ - SettingItem( - title: YMLocalizedString("EPEditSetting.PersonalInfo"), - action: { [weak self] in self?.handleReservedAction("PersonalInfo") } - ), - SettingItem( - title: YMLocalizedString("EPEditSetting.Help"), - action: { [weak self] in self?.handleReservedAction("Help") } - ), - SettingItem( - title: YMLocalizedString("EPEditSetting.ClearCache"), - action: { [weak self] in self?.handleReservedAction("ClearCache") } - ), - SettingItem( - title: YMLocalizedString("EPEditSetting.AboutUs"), - action: { [weak self] in self?.handleReservedAction("AboutUs") } - ) - ] - NSLog("[EPEditSetting] setupData 完成,设置项数量: \(settingItems.count)") - } - - private func loadUserInfo() { - // 如果已经有用户信息(从 EPMineViewController 传递),则不需要重新加载 - if userInfo != nil { - updateProfileImage() - tableView.reloadData() - return - } - - // 获取当前用户信息 - guard let uid = AccountInfoStorage.instance().getUid(), !uid.isEmpty else { - print("[EPEditSetting] 未登录,无法获取用户信息") - return - } - - // TODO: 调用API获取用户详细信息 - // 这里暂时创建默认的UserInfoModel用于显示 - let tempUserInfo = UserInfoModel() - tempUserInfo.nick = "User" - tempUserInfo.avatar = "" - userInfo = tempUserInfo - - updateProfileImage() - tableView.reloadData() - } - - private func updateProfileImage() { - guard let avatarUrl = userInfo?.avatar, !avatarUrl.isEmpty else { - profileImageView.image = UIImage(systemName: "person.circle.fill") - return - } - - // 使用SDWebImage加载头像 - if let url = URL(string: avatarUrl) { - profileImageView.sd_setImage(with: url, placeholderImage: UIImage(systemName: "person.circle.fill")) - } - } - - // MARK: - Actions - - @objc private func profileImageTapped() { - showAvatarSelectionSheet() - } - - @objc private func openSettings() { - // 预留设置按钮功能 - handleReservedAction("Settings") - } - - @objc private func logoutButtonTapped() { - showLogoutConfirm() - } - - private func showAvatarSelectionSheet() { - let alert = UIAlertController(title: YMLocalizedString("EPEditSetting.EditNickname"), message: nil, preferredStyle: .actionSheet) - - // 拍照选项 - alert.addAction(UIAlertAction(title: YMLocalizedString("EPEditSetting.Camera"), style: .default) { [weak self] _ in - self?.checkCameraPermissionAndPresent() - }) - - // 相册选项 - alert.addAction(UIAlertAction(title: YMLocalizedString("EPEditSetting.PhotoLibrary"), style: .default) { [weak self] _ in - self?.checkPhotoLibraryPermissionAndPresent() - }) - - alert.addAction(UIAlertAction(title: YMLocalizedString("EPEditSetting.Cancel"), style: .cancel)) - - // iPad支持 - if let popover = alert.popoverPresentationController { - popover.sourceView = profileImageView - popover.sourceRect = profileImageView.bounds - } - - present(alert, animated: true) - } - - private func checkCameraPermissionAndPresent() { - YYUtility.checkCameraAvailable { [weak self] in - self?.presentImagePicker(sourceType: .camera) - } denied: { [weak self] in - self?.showPermissionAlert(title: "Camera Access", message: "Please allow camera access in Settings") - } restriction: { [weak self] in - self?.showPermissionAlert(title: "Camera Restricted", message: "Camera access is restricted on this device") - } - } - - private func checkPhotoLibraryPermissionAndPresent() { - YYUtility.checkAssetsLibrayAvailable { [weak self] in - self?.presentImagePicker(sourceType: .photoLibrary) - } denied: { [weak self] in - self?.showPermissionAlert(title: "Photo Library Access", message: "Please allow photo library access in Settings") - } restriction: { [weak self] in - self?.showPermissionAlert(title: "Photo Library Restricted", message: "Photo library access is restricted on this device") - } - } - - private func presentImagePicker(sourceType: UIImagePickerController.SourceType) { - let imagePicker = UIImagePickerController() - imagePicker.delegate = self - imagePicker.sourceType = sourceType - imagePicker.allowsEditing = true - present(imagePicker, animated: true) - } - - private func showPermissionAlert(title: String, message: String) { - let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: "Settings", style: .default) { _ in - if let settingsURL = URL(string: UIApplication.openSettingsURLString) { - UIApplication.shared.open(settingsURL) - } - }) - alert.addAction(UIAlertAction(title: YMLocalizedString("EPEditSetting.Cancel"), style: .cancel)) - present(alert, animated: true) - } - - private func showNicknameEditAlert() { - let alert = UIAlertController( - title: YMLocalizedString("EPEditSetting.EditNickname"), - message: nil, - preferredStyle: .alert - ) - - alert.addTextField { [weak self] textField in - textField.text = self?.userInfo?.nick ?? "" - textField.placeholder = YMLocalizedString("EPEditSetting.EnterNickname") - } - - alert.addAction(UIAlertAction(title: YMLocalizedString("EPEditSetting.Cancel"), style: .cancel)) - alert.addAction(UIAlertAction(title: YMLocalizedString("EPEditSetting.Confirm"), style: .default) { [weak self] _ in - guard let newNickname = alert.textFields?.first?.text, !newNickname.isEmpty else { return } - self?.updateNickname(newNickname) - }) - - present(alert, animated: true) - } - - private func updateNickname(_ newNickname: String) { - // 显示加载状态 - showLoading() - - // 调用 API 更新昵称 - apiHelper.updateNickname(withNick: newNickname, - completion: { [weak self] in - self?.hideHUD() - - // 更新成功后才更新本地显示 - self?.userInfo?.nick = newNickname - self?.tableView.reloadData() - - // 显示成功提示 - self?.showSuccessToast(YMLocalizedString("XPMineUserInfoEditViewController13")) - - print("[EPEditSetting] 昵称更新成功: \(newNickname)") - }, - failure: { [weak self] (code: Int, msg: String?) in - self?.hideHUD() - - // 显示错误提示 - let errorMsg = msg ?? YMLocalizedString("setting.nickname_update_failed") - self?.showErrorToast(errorMsg) - - print("[EPEditSetting] 昵称更新失败: \(code) - \(errorMsg)") - } - ) - } - - private func showLogoutConfirm() { - let alert = UIAlertController( - title: YMLocalizedString("EPEditSetting.LogoutConfirm"), - message: nil, - preferredStyle: .alert - ) - - alert.addAction(UIAlertAction(title: YMLocalizedString("EPEditSetting.Cancel"), style: .cancel)) - alert.addAction(UIAlertAction(title: YMLocalizedString("EPEditSetting.Logout"), style: .destructive) { [weak self] _ in - self?.performLogout() - }) - - present(alert, animated: true) - } - - private func performLogout() { - guard let account = AccountInfoStorage.instance().accountModel else { - print("[EPEditSetting] 账号信息不存在") - return - } - - // 调用登出API - Api.logoutCurrentAccount({ [weak self] (data, code, msg) in - DispatchQueue.main.async { - // 清除本地数据 - AccountInfoStorage.instance().saveAccountInfo(nil) - AccountInfoStorage.instance().saveTicket(nil) - - // 跳转登录页 - self?.navigateToLogin() - } - }, access_token: account.access_token) - } - - private func navigateToLogin() { - let loginVC = EPLoginViewController() - let nav = UINavigationController(rootViewController: loginVC) - - if let window = UIApplication.shared.windows.first { - window.rootViewController = nav - window.makeKeyAndVisible() - } - - print("[EPEditSetting] 已跳转到登录页面") - } - - private func handleReservedAction(_ title: String) { - print("[\(title)] - 功能触发") - - // About Us 已实现 - if title == "AboutUs" { - let aboutVC = EPAboutUsViewController() - navigationController?.pushViewController(aboutVC, animated: true) - return - } - - // Personal Info - 显示协议和隐私政策选项 - if title == "PersonalInfo" { - showPolicyOptionsSheet() - return - } - - // Help - 跳转到 FAQ 页面 - if title == "Help" { - let faqUrl = getFAQURL() - openPolicyInExternalBrowser(faqUrl) - return - } - - // Clear Cache - 清理图片和网页缓存 - if title == "ClearCache" { - showClearCacheConfirmation() - return - } - - // 其他功能预留 - // TODO: Phase 2 implementation - let alert = UIAlertController(title: "Coming Soon", message: "This feature will be available in the next update.", preferredStyle: .alert) - alert.addAction(UIAlertAction(title: "OK", style: .default)) - present(alert, animated: true) - } - - private func showClearCacheConfirmation() { - let alert = UIAlertController( - title: YMLocalizedString("EPEditSetting.ClearCacheTitle"), - message: YMLocalizedString("EPEditSetting.ClearCacheMessage"), - preferredStyle: .alert - ) - - alert.addAction(UIAlertAction(title: YMLocalizedString("EPEditSetting.Cancel"), style: .cancel)) - alert.addAction(UIAlertAction(title: YMLocalizedString("EPEditSetting.Confirm"), style: .destructive) { [weak self] _ in - self?.performClearCache() - }) - - present(alert, animated: true) - } - - private func performClearCache() { - print("[EPEditSetting] 开始清理缓存") - - // 显示加载状态 - showLoading() - - // 1. 清理 SDWebImage 图片缓存 - SDWebImageManager.shared.imageCache.clear?(with: .all) { - print("[EPEditSetting] SDWebImage 缓存已清理") - - // 2. 清理 WKWebsiteDataStore 网页缓存 - let websiteDataTypes = WKWebsiteDataStore.allWebsiteDataTypes() - let dateFrom = Date(timeIntervalSince1970: 0) - WKWebsiteDataStore.default().removeData(ofTypes: websiteDataTypes, modifiedSince: dateFrom) { [weak self] in - print("[EPEditSetting] WKWebsiteDataStore 缓存已清理") - - DispatchQueue.main.async { - self?.hideHUD() - self?.showSuccessToast(YMLocalizedString("EPEditSetting.ClearCacheSuccess")) - print("[EPEditSetting] 缓存清理完成") - } - } - } - } - - private func showPolicyOptionsSheet() { - let alert = UIAlertController( - title: nil, - message: nil, - preferredStyle: .actionSheet - ) - - // 用户服务协议 - alert.addAction(UIAlertAction( - title: YMLocalizedString("EPEditSetting.UserAgreement"), - style: .default - ) { [weak self] _ in - let url = self?.getUserAgreementURL() ?? "" - self?.openPolicyInExternalBrowser(url) - }) - - // 隐私政策 - alert.addAction(UIAlertAction( - title: YMLocalizedString("EPEditSetting.PrivacyPolicy"), - style: .default - ) { [weak self] _ in - let url = self?.getPrivacyPolicyURL() ?? "" - self?.openPolicyInExternalBrowser(url) - }) - - // 取消 - alert.addAction(UIAlertAction( - title: YMLocalizedString("EPEditSetting.Cancel"), - style: .cancel - )) - - // iPad 支持 - if let popover = alert.popoverPresentationController { - popover.sourceView = view - popover.sourceRect = CGRect(x: view.bounds.midX, y: view.bounds.midY, width: 0, height: 0) - popover.permittedArrowDirections = [] - } - - present(alert, animated: true) - } - - /// 获取用户协议 URL - private func getUserAgreementURL() -> String { - // kUserProtocalURL 对应枚举值 4 - let url = URLWithType(URLType(rawValue: 4)!) as String - print("[EPEditSetting] User agreement URL from URLWithType: \(url)") - return url - } - - /// 获取隐私政策 URL - private func getPrivacyPolicyURL() -> String { - // kPrivacyURL 对应枚举值 0 - let url = URLWithType(URLType(rawValue: 0)!) as String - print("[EPEditSetting] Privacy policy URL from URLWithType: \(url)") - return url - } - - /// 获取 FAQ 帮助页面 URL - private func getFAQURL() -> String { - // kFAQURL 对应枚举值 6 - let url = URLWithType(URLType(rawValue: 6)!) as String - print("[EPEditSetting] FAQ URL from URLWithType: \(url)") - return url - } - - private func openPolicyInExternalBrowser(_ urlString: String) { - print("[EPEditSetting] Original URL: \(urlString)") - - // 如果不是完整 URL,拼接域名 - var fullUrl = urlString - if !urlString.hasPrefix("http") && !urlString.hasPrefix("https") { - let hostUrl = HttpRequestHelper.getHostUrl() - fullUrl = "\(hostUrl)/\(urlString)" - print("[EPEditSetting] Added host URL, full URL: \(fullUrl)") - } - - print("[EPEditSetting] Opening URL in external browser: \(fullUrl)") - - guard let url = URL(string: fullUrl) else { - print("[EPEditSetting] ❌ Invalid URL: \(fullUrl)") - return - } - - print("[EPEditSetting] URL object created: \(url)") - - // 在外部浏览器中打开 - if UIApplication.shared.canOpenURL(url) { - print("[EPEditSetting] ✅ Can open URL, attempting to open...") - UIApplication.shared.open(url, options: [:]) { success in - print("[EPEditSetting] Open external browser: \(success ? "✅ Success" : "❌ Failed")") - } - } else { - print("[EPEditSetting] ❌ Cannot open URL: \(fullUrl)") - } - } - - // MARK: - Public Methods - - /// 更新用户信息(从 EPMineViewController 传递) - @objc func updateWithUserInfo(_ userInfo: UserInfoModel) { - self.userInfo = userInfo - updateProfileImage() - tableView.reloadData() - NSLog("[EPEditSetting] 已更新用户信息: \(userInfo.nick)") - } -} - -// MARK: - UITableViewDataSource & UITableViewDelegate - -extension EPEditSettingViewController: UITableViewDataSource, UITableViewDelegate { - - func numberOfSections(in tableView: UITableView) -> Int { - return 1 // 只有一个 section - } - - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - let count = settingItems.count + 1 // +1 for nickname row - NSLog("[EPEditSetting] TableView rows count: \(count), settingItems: \(settingItems.count)") - return count - } - - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = tableView.dequeueReusableCell(withIdentifier: "SettingCell", for: indexPath) - cell.backgroundColor = UIColor(hex: "#0C0527") - cell.textLabel?.textColor = .white - cell.selectionStyle = .none - - // 清除之前的自定义视图 - cell.contentView.subviews.forEach { $0.removeFromSuperview() } - - if indexPath.row == 0 { - // 昵称行 - cell.textLabel?.text = YMLocalizedString("EPEditSetting.Nickname") - - // 添加右箭头图标 - let arrowImageView = UIImageView() - arrowImageView.image = UIImage(named: "icon_setting_right_arrow") - arrowImageView.contentMode = .scaleAspectFit - cell.contentView.addSubview(arrowImageView) - arrowImageView.snp.makeConstraints { make in - make.trailing.equalToSuperview().offset(-20) - make.centerY.equalToSuperview() - make.size.equalTo(22) - } - - // 添加用户昵称标签 - let nicknameLabel = UILabel() - nicknameLabel.text = userInfo?.nick ?? YMLocalizedString("user.not_set") - nicknameLabel.textColor = .lightGray - nicknameLabel.font = UIFont.systemFont(ofSize: 16) - cell.contentView.addSubview(nicknameLabel) - nicknameLabel.snp.makeConstraints { make in - make.trailing.equalTo(arrowImageView.snp.leading).offset(-12) - make.centerY.equalToSuperview() - } - - } else { - // 其他设置项 - let item = settingItems[indexPath.row - 1] - cell.textLabel?.text = item.title - cell.textLabel?.textColor = .white - - // 添加右箭头图标 - let arrowImageView = UIImageView() - arrowImageView.image = UIImage(named: "icon_setting_right_arrow") - arrowImageView.contentMode = .scaleAspectFit - cell.contentView.addSubview(arrowImageView) - arrowImageView.snp.makeConstraints { make in - make.trailing.equalToSuperview().offset(-20) - make.centerY.equalToSuperview() - make.size.equalTo(22) - } - } - - return cell - } - - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { - return 60 // 所有行都是 60pt 高度 - } - - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - tableView.deselectRow(at: indexPath, animated: true) - - if indexPath.row == 0 { - // 昵称点击 - showNicknameEditAlert() - } else { - // 设置项点击 - let item = settingItems[indexPath.row - 1] - item.action() - } - } - - func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { - return 0 - } - - func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { - return nil - } - - func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { - return 0 - } - - func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { - return nil - } -} - -// MARK: - UIImagePickerControllerDelegate & UINavigationControllerDelegate - -extension EPEditSettingViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate { - - func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { - picker.dismiss(animated: true) - - guard let image = info[.editedImage] as? UIImage ?? info[.originalImage] as? UIImage else { - print("[EPEditSetting] 未能获取选择的图片") - return - } - - // 更新头像显示 - profileImageView.image = image - - // 上传头像到腾讯云 - uploadAvatar(image) - } - - func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { - picker.dismiss(animated: true) - } - - private func uploadAvatar(_ image: UIImage) { - // 显示上传进度 - EPProgressHUD.showProgress(0, total: 1) - - // 使用 EPSDKManager 统一上传接口(避免腾讯云 OCR 配置问题) - EPSDKManager.shared.uploadImages([image], - progress: { uploaded, total in - EPProgressHUD.showProgress(uploaded, total: total) - }, - success: { [weak self] resList in - EPProgressHUD.dismiss() - - guard !resList.isEmpty, - let firstRes = resList.first, - let avatarUrl = firstRes["resUrl"] as? String else { - print("[EPEditSetting] 头像上传成功但无法获取URL") - - return - } - - print("[EPEditSetting] 头像上传成功: \(avatarUrl)") - - // 调用API更新头像 - self?.updateAvatarAPI(avatarUrl: avatarUrl) - }, - failure: { [weak self] errorMsg in - EPProgressHUD.dismiss() - print("[EPEditSetting] 头像上传失败: \(errorMsg)") - - // 显示错误提示 - DispatchQueue.main.async { - let alert = UIAlertController(title: YMLocalizedString("common.upload_failed"), message: errorMsg, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: YMLocalizedString("common.confirm"), style: .default)) - self?.present(alert, animated: true) - } - } - ) - } - - private func updateAvatarAPI(avatarUrl: String) { - // 使用 API Helper 更新头像 - apiHelper.updateAvatar(withUrl: avatarUrl, completion: { [weak self] in - print("[EPEditSetting] 头像更新成功") - - // 更新本地用户信息 - self?.userInfo?.avatar = avatarUrl - - // 通知父页面头像已更新 - self?.notifyParentAvatarUpdated(avatarUrl) - - }, failure: { [weak self] (code: Int, msg: String?) in - print("[EPEditSetting] 头像更新失败: \(code) - \(msg ?? "未知错误")") - - // 显示错误提示 - DispatchQueue.main.async { - let alert = UIAlertController( - title: YMLocalizedString("common.update_failed"), - message: msg ?? YMLocalizedString("setting.avatar_update_failed"), - preferredStyle: .alert - ) - alert.addAction(UIAlertAction(title: YMLocalizedString("common.confirm"), style: .default)) - self?.present(alert, animated: true) - } - }) - } - - private func notifyParentAvatarUpdated(_ avatarUrl: String) { - // 发送通知给 EPMineViewController 更新头像 - let userInfo = ["avatarUrl": avatarUrl] - NotificationCenter.default.post(name: NSNotification.Name("EPEditSettingAvatarUpdated"), object: nil, userInfo: userInfo) - } -} - -// MARK: - Helper Models - -private struct SettingItem { - let title: String - let action: () -> Void - - init(title: String, action: @escaping () -> Void) { - self.title = title - self.action = action - } -} - -// MARK: - UIColor Extension - -private extension UIColor { - convenience init(hex: String) { - let hex = hex.trimmingCharacters(in: CharacterSet.alphanumerics.inverted) - var int: UInt64 = 0 - Scanner(string: hex).scanHexInt64(&int) - let a, r, g, b: UInt64 - switch hex.count { - case 3: // RGB (12-bit) - (a, r, g, b) = (255, (int >> 8) * 17, (int >> 4 & 0xF) * 17, (int & 0xF) * 17) - case 6: // RGB (24-bit) - (a, r, g, b) = (255, int >> 16, int >> 8 & 0xFF, int & 0xFF) - case 8: // ARGB (32-bit) - (a, r, g, b) = (int >> 24, int >> 16 & 0xFF, int >> 8 & 0xFF, int & 0xFF) - default: - (a, r, g, b) = (1, 1, 1, 0) - } - - self.init( - red: CGFloat(r) / 255, - green: CGFloat(g) / 255, - blue: CGFloat(b) / 255, - alpha: CGFloat(a) / 255 - ) - } -} diff --git a/YuMi/E-P/Mine/Controllers/EPMineViewController.h.backup b/YuMi/E-P/Mine/Controllers/EPMineViewController.h.backup deleted file mode 100644 index 279a85c..0000000 --- a/YuMi/E-P/Mine/Controllers/EPMineViewController.h.backup +++ /dev/null @@ -1,20 +0,0 @@ -// -// EPMineViewController.h -// YuMi -// -// Created by AI on 2025-10-09. -// Copyright © 2025 YuMi. All rights reserved. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/// 新的个人中心页面控制器 -/// 采用纵向卡片式设计,完全不同于原 XPMineViewController -/// 注意:直接继承 UIViewController,不继承 BaseViewController(避免依赖链) -@interface EPMineViewController : UIViewController - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/E-P/Mine/Controllers/EPMineViewController.m.backup b/YuMi/E-P/Mine/Controllers/EPMineViewController.m.backup deleted file mode 100644 index b7978a9..0000000 --- a/YuMi/E-P/Mine/Controllers/EPMineViewController.m.backup +++ /dev/null @@ -1,220 +0,0 @@ -// -// EPMineViewController.m -// YuMi -// -// Created by AI on 2025-10-09. -// Copyright © 2025 YuMi. All rights reserved. -// - -#import "EPMineViewController.h" -#import "EPMineHeaderView.h" -#import "EPMomentListView.h" -#import "EPMineAPIHelper.h" -#import "AccountInfoStorage.h" -#import "UserInfoModel.h" -#import -#import "YuMi-Swift.h" // 导入Swift桥接 - -@interface EPMineViewController () - -// MARK: - UI Components - -/// 动态列表视图(复用 EPMomentListView) -@property (nonatomic, strong) EPMomentListView *momentListView; - -/// 顶部个人信息卡片 -@property (nonatomic, strong) EPMineHeaderView *headerView; - -// MARK: - Data - -/// 用户信息模型 -@property (nonatomic, strong) UserInfoModel *userInfo; - -/// API Helper -@property (nonatomic, strong) EPMineAPIHelper *apiHelper; - -@end - -@implementation EPMineViewController - -// MARK: - Lifecycle - -- (void)viewDidLoad { - [super viewDidLoad]; - [self setupUI]; - - NSLog(@"[EPMineViewController] viewDidLoad 完成"); -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - [self.navigationController setNavigationBarHidden:YES animated:animated]; - // 每次显示时加载最新数据 - [self loadUserDetailInfo]; -} - -// MARK: - Setup - -- (void)setupUI { - UIImageView *bgImageView = [[UIImageView alloc] initWithImage:kImage(@"vc_bg")]; - bgImageView.contentMode = UIViewContentModeScaleAspectFill; - bgImageView.clipsToBounds = YES; - [self.view addSubview:bgImageView]; - [bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.mas_equalTo(self.view); - }]; - - [self setupHeaderView]; - [self setupMomentListView]; - - NSLog(@"[EPMineViewController] UI 设置完成"); -} - -- (void)setupHeaderView { - self.headerView = [[EPMineHeaderView alloc] initWithFrame:CGRectZero]; - [self.view addSubview:self.headerView]; - - // 使用 Masonry 约束布局 - [self.headerView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.view); - make.leading.mas_equalTo(self.view); - make.trailing.mas_equalTo(self.view); - make.height.mas_equalTo(kGetScaleWidth(260)); - }]; - - // 设置按钮点击回调 - __weak typeof(self) weakSelf = self; - self.headerView.onSettingsButtonTapped = ^{ - __strong typeof(weakSelf) self = weakSelf; - [self openSettings]; - }; - - // 监听头像更新事件 - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(onAvatarUpdated:) - name:@"EPEditSettingAvatarUpdated" - object:nil]; -} - -- (void)setupMomentListView { - self.momentListView = [[EPMomentListView alloc] initWithFrame:CGRectZero]; - [self.view addSubview:self.momentListView]; - - [self.momentListView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.headerView.mas_bottom); - make.bottom.mas_equalTo(self.view); - make.leading.mas_equalTo(self.view); - make.trailing.mas_equalTo(self.view); - }]; - - // 初始化为空的本地模式,避免在数据加载前触发网络请求 - __weak typeof(self) weakSelf = self; - [self.momentListView loadWithDynamicInfo:@[] refreshCallback:^{ - __strong typeof(weakSelf) self = weakSelf; - [self loadUserDetailInfo]; - }]; -} - -// MARK: - Data Loading - -- (void)loadUserDetailInfo { - NSString *uid = [[AccountInfoStorage instance] getUid]; - if (!uid || uid.length == 0) { - NSLog(@"[EPMineViewController] 用户未登录"); - return; - } - - @kWeakify(self); - [self.apiHelper getUserDetailInfoWithUid:uid - completion:^(UserInfoModel * _Nullable userInfo) { - @kStrongify(self); - if (!userInfo) { - NSLog(@"[EPMineViewController] 加载用户信息失败"); - return; - } - - self.userInfo = userInfo; - [self updateHeaderWithUserInfo:userInfo]; - - // 如果有动态信息,直接使用 - if (userInfo.dynamicInfo && userInfo.dynamicInfo.count > 0) { - [self.momentListView loadWithDynamicInfo:userInfo.dynamicInfo refreshCallback:^{ - [self loadUserDetailInfo]; // 刷新时重新加载 - }]; - } - } failure:^(NSInteger code, NSString * _Nullable msg) { - NSLog(@"[EPMineViewController] 加载用户信息失败: %@", msg); - }]; -} - -- (void)updateHeaderWithUserInfo:(UserInfoModel *)userInfo { - NSDictionary *userInfoDict = @{ - @"nickname": userInfo.nick ?: @"未设置昵称", - @"uid": [NSString stringWithFormat:@"%ld", (long)userInfo.erbanNo], - @"avatar": userInfo.avatar ?: @"", - @"following": @(userInfo.followNum), - @"followers": @(userInfo.fansNum) - }; - - [self.headerView updateWithUserInfo:userInfoDict]; -} - -// MARK: - Lazy Loading - -- (EPMomentListView *)momentListView { - if (!_momentListView) { - _momentListView = [[EPMomentListView alloc] init]; - __weak typeof(self) weakSelf = self; - _momentListView.onSelectMoment = ^(NSInteger index) { - __strong typeof(weakSelf) self = weakSelf; - NSLog(@"[EPMineViewController] 点击了第 %ld 条动态", (long)index); - // TODO: 跳转到动态详情页 - }; - } - return _momentListView; -} - -- (EPMineAPIHelper *)apiHelper { - if (!_apiHelper) { - _apiHelper = [[EPMineAPIHelper alloc] init]; - } - return _apiHelper; -} - -// MARK: - Actions - -- (void)openSettings { - // 隐藏返回按钮文字,只保留白色箭头 - self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" - style:UIBarButtonItemStylePlain - target:nil - action:nil]; - - EPEditSettingViewController *settingsVC = [[EPEditSettingViewController alloc] init]; - // 传递用户信息到设置页面 - if (self.userInfo) { - [settingsVC updateWithUserInfo:self.userInfo]; - } - [self.navigationController pushViewController:settingsVC animated:YES]; - NSLog(@"[EPMineViewController] 打开设置页面,已传递用户信息"); -} - -- (void)onAvatarUpdated:(NSNotification *)notification { - NSString *avatarUrl = notification.userInfo[@"avatarUrl"]; - if (avatarUrl && self.userInfo) { - // 更新本地用户信息 - self.userInfo.avatar = avatarUrl; - - // 更新 UI 显示 - [self updateHeaderWithUserInfo:self.userInfo]; - - NSLog(@"[EPMineViewController] 头像已更新: %@", avatarUrl); - } -} - -- (void)dealloc { - // 只移除头像更新通知的观察者,设置按钮现在使用 block 回调 - [[NSNotificationCenter defaultCenter] removeObserver:self name:@"EPEditSettingAvatarUpdated" object:nil]; -} - -@end diff --git a/YuMi/E-P/Mine/Services/EPMineAPIHelper.h.backup b/YuMi/E-P/Mine/Services/EPMineAPIHelper.h.backup deleted file mode 100644 index c38d506..0000000 --- a/YuMi/E-P/Mine/Services/EPMineAPIHelper.h.backup +++ /dev/null @@ -1,40 +0,0 @@ -// -// EPMineAPIHelper.h -// YuMi -// -// Created by AI on 2025-10-10. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@class UserInfoModel; - -/// 封装用户信息相关 API -@interface EPMineAPIHelper : NSObject - -/// 获取用户基础信息 -- (void)getUserInfoWithUid:(NSString *)uid - completion:(void (^)(UserInfoModel * _Nullable userInfo))completion - failure:(void (^)(NSInteger code, NSString * _Nullable msg))failure; - -/// 获取用户详细信息(包含 dynamicInfo) -- (void)getUserDetailInfoWithUid:(NSString *)uid - completion:(void (^)(UserInfoModel * _Nullable userInfo))completion - failure:(void (^)(NSInteger code, NSString * _Nullable msg))failure; - -/// 更新用户头像 -- (void)updateAvatarWithUrl:(NSString *)avatarUrl - completion:(void (^)(void))completion - failure:(void (^)(NSInteger code, NSString * _Nullable msg))failure; - -/// 更新用户昵称 -- (void)updateNicknameWithNick:(NSString *)nickname - completion:(void (^)(void))completion - failure:(void (^)(NSInteger code, NSString * _Nullable msg))failure; - -@end - -NS_ASSUME_NONNULL_END - diff --git a/YuMi/E-P/Mine/Services/EPMineAPIHelper.m.backup b/YuMi/E-P/Mine/Services/EPMineAPIHelper.m.backup deleted file mode 100644 index 148d9e2..0000000 --- a/YuMi/E-P/Mine/Services/EPMineAPIHelper.m.backup +++ /dev/null @@ -1,77 +0,0 @@ -// -// EPMineAPIHelper.m -// YuMi -// -// Created by AI on 2025-10-10. -// - -#import "EPMineAPIHelper.h" -#import "Api+Mine.h" -#import "UserInfoModel.h" -#import "BaseModel.h" -#import "AccountInfoStorage.h" - -@implementation EPMineAPIHelper - -- (void)getUserInfoWithUid:(NSString *)uid - completion:(void (^)(UserInfoModel * _Nullable userInfo))completion - failure:(void (^)(NSInteger code, NSString * _Nullable msg))failure { - [Api getUserInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { - if (code == 200 && data.data) { - UserInfoModel *userInfo = [UserInfoModel modelWithDictionary:data.data]; - if (completion) completion(userInfo); - } else { - if (failure) failure(code, msg); - } - } uid:uid]; -} - -- (void)getUserDetailInfoWithUid:(NSString *)uid - completion:(void (^)(UserInfoModel * _Nullable userInfo))completion - failure:(void (^)(NSInteger code, NSString * _Nullable msg))failure { - [Api userDetailInfoCompletion:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { - if (code == 200 && data.data) { - UserInfoModel *userInfo = [UserInfoModel modelWithDictionary:data.data]; - if (completion) completion(userInfo); - } else { - if (failure) failure(code, msg); - } - } uid:uid page:@"1" pageSize:@"20"]; -} - -- (void)updateAvatarWithUrl:(NSString *)avatarUrl - completion:(void (^)(void))completion - failure:(void (^)(NSInteger code, NSString * _Nullable msg))failure { - [Api userV2UploadAvatar:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { - if (code == 200) { - if (completion) completion(); - } else { - if (failure) failure(code, msg); - } - } avatarUrl:avatarUrl needPay:@NO]; -} - -- (void)updateNicknameWithNick:(NSString *)nickname - completion:(void (^)(void))completion - failure:(void (^)(NSInteger code, NSString * _Nullable msg))failure { - NSString *uid = [[AccountInfoStorage instance] getUid]; - NSString *ticket = [[AccountInfoStorage instance] getTicket]; - - NSMutableDictionary *params = [NSMutableDictionary dictionary]; - if (nickname.length > 0) { - [params setValue:nickname forKey:@"nick"]; - } - [params setObject:uid forKey:@"uid"]; - [params setObject:ticket forKey:@"ticket"]; - - [Api completeUserInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { - if (code == 200) { - if (completion) completion(); - } else { - if (failure) failure(code, msg); - } - } userInfo:params]; -} - -@end - diff --git a/YuMi/E-P/Mine/Views/EPMineHeaderView.h.backup b/YuMi/E-P/Mine/Views/EPMineHeaderView.h.backup deleted file mode 100644 index f9de325..0000000 --- a/YuMi/E-P/Mine/Views/EPMineHeaderView.h.backup +++ /dev/null @@ -1,26 +0,0 @@ -// -// EPMineHeaderView.h -// YuMi -// -// Created by AI on 2025-10-09. -// Copyright © 2025 YuMi. All rights reserved. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/// EP 系列个人主页头部视图 -/// 大圆形头像 + 渐变背景 + 用户信息展示 -@interface EPMineHeaderView : UIView - -/// 设置按钮点击回调 -@property (nonatomic, copy, nullable) void(^onSettingsButtonTapped)(void); - -/// 更新用户信息 -/// @param userInfoDict 用户信息字典 -- (void)updateWithUserInfo:(NSDictionary *)userInfoDict; - -@end - -NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/YuMi/E-P/Mine/Views/EPMineHeaderView.m.backup b/YuMi/E-P/Mine/Views/EPMineHeaderView.m.backup deleted file mode 100644 index 9908d19..0000000 --- a/YuMi/E-P/Mine/Views/EPMineHeaderView.m.backup +++ /dev/null @@ -1,242 +0,0 @@ -// -// EPMineHeaderView.m -// YuMi -// -// Created by AI on 2025-10-09. -// Copyright © 2025 YuMi. All rights reserved. -// - -#import "EPMineHeaderView.h" -#import -#import -#import "EPEmotionColorStorage.h" - -@interface EPMineHeaderView () - -/// 头像视图 -@property (nonatomic, strong) UIImageView *avatarImageView; - -/// 呼吸光晕层 -@property (nonatomic, strong) CALayer *glowLayer; - -/// 昵称标签 -@property (nonatomic, strong) UILabel *nicknameLabel; - -/// ID 标签 -@property (nonatomic, strong) UILabel *idLabel; - -/// 设置按钮 -@property (nonatomic, strong) UIButton *settingsButton; - -@end - -@implementation EPMineHeaderView - -- (instancetype)initWithFrame:(CGRect)frame { - if (self = [super initWithFrame:frame]) { - [self setupUI]; - } - return self; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - - // 更新光晕层 frame(跟随头像位置) - if (self.glowLayer) { - self.glowLayer.frame = CGRectInset(self.avatarImageView.frame, -8, -8); - } -} - -- (void)setupUI { - // 大圆形头像 - self.avatarImageView = [[UIImageView alloc] init]; - self.avatarImageView.layer.cornerRadius = 60; - self.avatarImageView.layer.masksToBounds = NO; // 改为 NO 以显示阴影 - self.avatarImageView.layer.borderWidth = 0; // 移除边框 - self.avatarImageView.backgroundColor = [UIColor whiteColor]; - self.avatarImageView.contentMode = UIViewContentModeScaleAspectFill; - - // 为了同时显示圆角和阴影,需要设置 clipsToBounds - self.avatarImageView.clipsToBounds = YES; - - [self addSubview:self.avatarImageView]; - - [self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.equalTo(self); - make.top.equalTo(self).offset(60); - make.size.mas_equalTo(CGSizeMake(120, 120)); - }]; - - // 昵称 - self.nicknameLabel = [[UILabel alloc] init]; - self.nicknameLabel.font = [UIFont boldSystemFontOfSize:24]; - self.nicknameLabel.textColor = [UIColor whiteColor]; - self.nicknameLabel.textAlignment = NSTextAlignmentCenter; - [self addSubview:self.nicknameLabel]; - - [self.nicknameLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.equalTo(self); - make.top.equalTo(self.avatarImageView.mas_bottom).offset(16); - }]; - - // ID - self.idLabel = [[UILabel alloc] init]; - self.idLabel.font = [UIFont systemFontOfSize:14]; - self.idLabel.textColor = [UIColor whiteColor]; - self.idLabel.alpha = 0.8; - self.idLabel.textAlignment = NSTextAlignmentCenter; - [self addSubview:self.idLabel]; - - [self.idLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.equalTo(self); - make.top.equalTo(self.nicknameLabel.mas_bottom).offset(8); - }]; - - // 设置按钮(右上角) - self.settingsButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [self.settingsButton setImage:[UIImage systemImageNamed:@"gearshape"] forState:UIControlStateNormal]; - self.settingsButton.tintColor = [UIColor whiteColor]; - self.settingsButton.backgroundColor = [UIColor colorWithWhite:1.0 alpha:0.2]; - self.settingsButton.layer.cornerRadius = 20; - [self.settingsButton addTarget:self action:@selector(settingsButtonTapped) forControlEvents:UIControlEventTouchUpInside]; - [self addSubview:self.settingsButton]; - - [self.settingsButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self).offset(50); - make.trailing.equalTo(self).offset(-20); - make.size.mas_equalTo(CGSizeMake(40, 40)); - }]; -} - -- (void)updateWithUserInfo:(NSDictionary *)userInfoDict { - // 更新昵称 - NSString *nickname = userInfoDict[@"nickname"] ?: YMLocalizedString(@"user.nickname_not_set"); - self.nicknameLabel.text = nickname; - - // 更新 ID - NSString *uid = userInfoDict[@"uid"] ?: @""; - self.idLabel.text = [NSString stringWithFormat:@"ID:%@", uid]; - - // 加载头像 - NSString *avatarURL = userInfoDict[@"avatar"]; - if (avatarURL && avatarURL.length > 0) { - [self.avatarImageView sd_setImageWithURL:[NSURL URLWithString:avatarURL] - placeholderImage:[UIImage imageNamed:@"default_avatar"]]; - } else { - // 使用默认头像 - self.avatarImageView.image = [UIImage imageNamed:@"default_avatar"]; - } - - // 应用用户专属情绪颜色 - [self applyUserSignatureColor]; -} - -/// 应用用户专属情绪颜色到头像边框和阴影 -- (void)applyUserSignatureColor { - NSString *signatureColor = [EPEmotionColorStorage userSignatureColor]; - - if (signatureColor) { - // 有专属颜色,使用该颜色 - UIColor *color = [self colorFromHex:signatureColor]; - - // 取消边框 - self.avatarImageView.layer.borderWidth = 0; - - // 设置阴影(使用情绪颜色) - self.avatarImageView.layer.shadowColor = color.CGColor; - self.avatarImageView.layer.shadowOffset = CGSizeMake(0, 4); - self.avatarImageView.layer.shadowOpacity = 0.6; - self.avatarImageView.layer.shadowRadius = 12; - - NSLog(@"[EPMineHeaderView] 应用专属颜色: %@", signatureColor); - - // 应用呼吸光晕动效 ⭐ - [self applyBreathingGlow]; - } else { - // 没有专属颜色,保持无边框 - self.avatarImageView.layer.borderWidth = 0; - - // 默认轻微阴影 - self.avatarImageView.layer.shadowColor = [UIColor blackColor].CGColor; - self.avatarImageView.layer.shadowOffset = CGSizeMake(0, 2); - self.avatarImageView.layer.shadowOpacity = 0.2; - self.avatarImageView.layer.shadowRadius = 8; - - // 移除光晕层 - if (self.glowLayer) { - [self.glowLayer removeFromSuperlayer]; - self.glowLayer = nil; - } - } -} - -/// 应用呼吸光晕动效 -- (void)applyBreathingGlow { - NSString *signatureColor = [EPEmotionColorStorage userSignatureColor]; - if (!signatureColor) return; - - UIColor *color = [self colorFromHex:signatureColor]; - - // 创建光晕层(如果不存在) - if (!self.glowLayer) { - self.glowLayer = [CALayer layer]; - self.glowLayer.frame = CGRectInset(self.avatarImageView.frame, -8, -8); // 比头像大 16pt - self.glowLayer.cornerRadius = 68; // 头像 60 + 扩展 8 - self.glowLayer.backgroundColor = [color colorWithAlphaComponent:0.75].CGColor; // 大幅加深 - - // 插入到头像 layer 下方 - [self.layer insertSublayer:self.glowLayer below:self.avatarImageView.layer]; - } else { - // 更新颜色 - self.glowLayer.backgroundColor = [color colorWithAlphaComponent:0.75].CGColor; // 大幅加深 - } - - // 移除旧动画 - [self.glowLayer removeAllAnimations]; - - // 创建呼吸动画组 - CAAnimationGroup *breathingGroup = [CAAnimationGroup animation]; - breathingGroup.duration = 1.8; // 加速 - breathingGroup.repeatCount = HUGE_VALF; // 无限循环 - breathingGroup.autoreverses = YES; - breathingGroup.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; - - // 动画 1:透明度变化(呼吸亮度) - CABasicAnimation *opacityAnim = [CABasicAnimation animationWithKeyPath:@"opacity"]; - opacityAnim.fromValue = @(0.65); - opacityAnim.toValue = @(1.0); // 接近完全不透明,颜色饱和 - - // 动画 2:缩放变化(呼吸扩散) - CABasicAnimation *scaleAnim = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; - scaleAnim.fromValue = @(1.0); - scaleAnim.toValue = @(1.1); - - breathingGroup.animations = @[opacityAnim, scaleAnim]; - - [self.glowLayer addAnimation:breathingGroup forKey:@"breathing"]; - - NSLog(@"[EPMineHeaderView] 启动呼吸光晕动效"); -} - -/// Hex 转 UIColor -- (UIColor *)colorFromHex:(NSString *)hexString { - unsigned rgbValue = 0; - NSScanner *scanner = [NSScanner scannerWithString:hexString]; - [scanner setScanLocation:1]; // 跳过 # - [scanner scanHexInt:&rgbValue]; - return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16)/255.0 - green:((rgbValue & 0xFF00) >> 8)/255.0 - blue:(rgbValue & 0xFF)/255.0 - alpha:1.0]; -} - -- (void)settingsButtonTapped { - NSLog(@"[EPMineHeaderView] 设置按钮点击"); - // 使用 block 回调 - if (self.onSettingsButtonTapped) { - self.onSettingsButtonTapped(); - } -} - -@end diff --git a/YuMi/E-P/Moments/Controllers/EPMomentPublishViewController.h.backup b/YuMi/E-P/Moments/Controllers/EPMomentPublishViewController.h.backup deleted file mode 100644 index 69bd355..0000000 --- a/YuMi/E-P/Moments/Controllers/EPMomentPublishViewController.h.backup +++ /dev/null @@ -1,22 +0,0 @@ -// -// EPMomentPublishViewController.h -// YuMi -// -// Created by AI on 2025-10-10. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/// 发布成功通知 -extern NSString *const EPMomentPublishSuccessNotification; - -/// EP 版:图文发布页面 -@interface EPMomentPublishViewController : UIViewController - -@end - -NS_ASSUME_NONNULL_END - - diff --git a/YuMi/E-P/Moments/Controllers/EPMomentPublishViewController.m.backup b/YuMi/E-P/Moments/Controllers/EPMomentPublishViewController.m.backup deleted file mode 100644 index 3c66907..0000000 --- a/YuMi/E-P/Moments/Controllers/EPMomentPublishViewController.m.backup +++ /dev/null @@ -1,442 +0,0 @@ -// -// EPMomentPublishViewController.m -// YuMi -// -// Created by AI on 2025-10-10. -// - -// NOTE: 话题选择功能未实现 -// 旧版本 XPMonentsPublishViewController 包含话题选择 UI (addTopicView) -// 但实际业务中话题功能使用率低,新版本暂不实现 -// 如需实现参考: YuMi/Modules/YMMonents/View/XPMonentsPublishTopicView - -#import "EPMomentPublishViewController.h" -#import -#import -#import "DJDKMIMOMColor.h" -#import "SZTextView.h" -#import "YuMi-Swift.h" -#import "EPEmotionColorPicker.h" -#import "EPEmotionColorStorage.h" -#import "UIView+GradientLayer.h" - -// 发布成功通知 -NSString *const EPMomentPublishSuccessNotification = @"EPMomentPublishSuccessNotification"; - -@interface EPMomentPublishViewController () - -@property (nonatomic, strong) UIView *navView; -@property (nonatomic, strong) UIButton *backButton; -@property (nonatomic, strong) UILabel *titleLabel; -@property (nonatomic, strong) UIButton *publishButton; - -@property (nonatomic, strong) UIView *contentView; -@property (nonatomic, strong) SZTextView *textView; -@property (nonatomic, strong) UILabel *limitLabel; -@property (nonatomic, strong) UIView *lineView; -@property (nonatomic, strong) UIButton *emotionButton; -@property (nonatomic, strong) UICollectionView *collectionView; -@property (nonatomic, strong) NSMutableArray *images; -@property (nonatomic, strong) NSMutableArray *selectedAssets; // TZImagePicker 已选资源 -@property (nonatomic, copy) NSString *selectedEmotionColor; // 选中的情绪颜色 - -@property (nonatomic, assign) BOOL hasAddedGradient; // 标记是否已添加渐变背景 - -@end - -@implementation EPMomentPublishViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - self.view.backgroundColor = [UIColor colorWithRed:0x0C/255.0 green:0x05/255.0 blue:0x27/255.0 alpha:1.0]; - [self setupUI]; - - // 自动加载用户专属颜色 - [self loadUserSignatureColor]; -} - -- (void)viewDidLayoutSubviews { - [super viewDidLayoutSubviews]; - - // 添加渐变背景到发布按钮(只添加一次) - if (!self.hasAddedGradient && self.publishButton.bounds.size.width > 0) { - // 使用与登录页面相同的渐变颜色(EPLoginConfig.Colors) - // gradientStart: #F854FC, gradientEnd: #500FFF - [self.publishButton addGradientBackgroundWithColors:@[ - [UIColor colorWithRed:0xF8/255.0 green:0x54/255.0 blue:0xFC/255.0 alpha:1.0], // #F854FC - [UIColor colorWithRed:0x50/255.0 green:0x0F/255.0 blue:0xFF/255.0 alpha:1.0] // #500FFF - ] startPoint:CGPointMake(0, 0.5) endPoint:CGPointMake(1, 0.5) cornerRadius:25]; - - self.hasAddedGradient = YES; - } -} - -/// 加载用户专属颜色作为默认选中 -- (void)loadUserSignatureColor { - NSString *signatureColor = [EPEmotionColorStorage userSignatureColor]; - if (signatureColor) { - self.selectedEmotionColor = signatureColor; - [self updateEmotionButtonAppearance]; - NSLog(@"[Publish] 自动选中专属颜色: %@", signatureColor); - } -} - -- (void)setupUI { - [self.view addSubview:self.navView]; - [self.view addSubview:self.contentView]; - [self.navView addSubview:self.backButton]; - [self.navView addSubview:self.titleLabel]; - // 发布按钮移到底部 - [self.contentView addSubview:self.textView]; - [self.contentView addSubview:self.limitLabel]; - [self.contentView addSubview:self.lineView]; - [self.contentView addSubview:self.emotionButton]; - [self.contentView addSubview:self.collectionView]; - [self.contentView addSubview:self.publishButton]; - - [self.navView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.top.equalTo(self.view); - make.height.mas_equalTo(kNavigationHeight); - }]; - [self.backButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.equalTo(self.view).offset(10); - make.top.mas_equalTo(statusbarHeight); - make.size.mas_equalTo(CGSizeMake(44, 44)); - }]; - [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.equalTo(self.navView); - make.centerY.equalTo(self.backButton); - }]; - // 发布按钮约束移到底部 - [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.equalTo(self.view); - make.top.equalTo(self.navView.mas_bottom); - make.bottom.equalTo(self.view); - }]; - [self.textView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.equalTo(self.contentView).inset(15); - make.top.equalTo(self.contentView).offset(10); - make.height.mas_equalTo(150); - }]; - [self.limitLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.textView.mas_bottom).offset(5); - make.trailing.equalTo(self.textView); - }]; - [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.limitLabel.mas_bottom).offset(10); - make.leading.trailing.equalTo(self.textView); - make.height.mas_equalTo(1); - }]; - - // 情绪按钮 - [self.emotionButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.equalTo(self.contentView).inset(15); - make.top.equalTo(self.lineView.mas_bottom).offset(10); - make.height.mas_equalTo(44); - }]; - - // 计算显示3行图片所需的高度 - // itemW = (屏幕宽度 - 左右边距30 - 列间距20) / 3 - // 总高度 = 3行itemW + 2个行间距(10*2) - CGFloat itemW = (KScreenWidth - 15*2 - 10*2)/3.0; - CGFloat collectionHeight = itemW * 3 + 10 * 2; - - [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.equalTo(self.contentView).inset(15); - make.top.equalTo(self.emotionButton.mas_bottom).offset(10); - make.height.mas_equalTo(collectionHeight); - }]; - - // 底部发布按钮 - [self.publishButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.equalTo(self.view).inset(20); - make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom).offset(-20); - make.height.mas_equalTo(50); - }]; -} - -#pragma mark - Actions - -- (void)onBack { - [self dismissViewControllerAnimated:YES completion:nil]; -} - -- (void)onEmotionButtonTapped { - EPEmotionColorPicker *picker = [[EPEmotionColorPicker alloc] init]; - - // 预选中当前颜色(如果有) - picker.preselectedColor = self.selectedEmotionColor; - - __weak typeof(self) weakSelf = self; - picker.onColorSelected = ^(NSString *hexColor) { - __strong typeof(weakSelf) self = weakSelf; - self.selectedEmotionColor = hexColor; - [self updateEmotionButtonAppearance]; - }; - [picker showInView:self.view]; -} - -- (void)updateEmotionButtonAppearance { - if (self.selectedEmotionColor) { - // 显示选中的颜色 - UIColor *color = [self colorFromHex:self.selectedEmotionColor]; - - // 创建色块视图 - UIView *colorDot = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 20, 20)]; - colorDot.backgroundColor = color; - colorDot.layer.cornerRadius = 10; - colorDot.layer.masksToBounds = YES; - colorDot.layer.borderWidth = 2; - colorDot.layer.borderColor = [UIColor whiteColor].CGColor; - - // 转换为 UIImage - UIGraphicsBeginImageContextWithOptions(colorDot.bounds.size, NO, 0); - [colorDot.layer renderInContext:UIGraphicsGetCurrentContext()]; - UIImage *colorDotImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - - [self.emotionButton setImage:colorDotImage forState:UIControlStateNormal]; - - // 获取情绪名称 - NSString *emotionName = [EPEmotionColorStorage emotionNameForColor:self.selectedEmotionColor]; - NSString *title = emotionName - ? [NSString stringWithFormat:@" Selected Emotion: %@", emotionName] - : @" Emotion Selected"; - [self.emotionButton setTitle:title forState:UIControlStateNormal]; - } else { - [self.emotionButton setImage:nil forState:UIControlStateNormal]; - [self.emotionButton setTitle:@"🎨 Add Emotion" forState:UIControlStateNormal]; - } -} - -- (UIColor *)colorFromHex:(NSString *)hexString { - unsigned rgbValue = 0; - NSScanner *scanner = [NSScanner scannerWithString:hexString]; - [scanner setScanLocation:1]; // 跳过 # - [scanner scanHexInt:&rgbValue]; - return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16)/255.0 - green:((rgbValue & 0xFF00) >> 8)/255.0 - blue:(rgbValue & 0xFF)/255.0 - alpha:1.0]; -} - -- (void)onPublish { - [self.view endEditing:YES]; - - // 验证:文本或图片至少有一项 - if (self.textView.text.length == 0 && self.images.count == 0) { - [EPProgressHUD showError:YMLocalizedString(@"publish.content_or_image_required")]; - return; - } - - // 创建 Swift API Helper - EPMomentAPISwiftHelper *apiHelper = [[EPMomentAPISwiftHelper alloc] init]; - - // 保存情绪颜色用于发布后关联 - NSString *emotionColorToSave = self.selectedEmotionColor; - - if (self.images.count > 0) { - // 有图片:上传后发布(统一入口) - [[EPSDKManager shared] uploadImages:self.images - progress:^(NSInteger uploaded, NSInteger total) { - [EPProgressHUD showProgress:uploaded total:total]; - } - success:^(NSArray *resList) { - [EPProgressHUD dismiss]; - [apiHelper publishMomentWithType:@"2" - content:self.textView.text ?: @"" - resList:resList - completion:^{ - // 保存临时情绪颜色(等待列表刷新后匹配) - if (emotionColorToSave) { - [self savePendingEmotionColor:emotionColorToSave]; - } - // 发送发布成功通知 - [[NSNotificationCenter defaultCenter] postNotificationName:EPMomentPublishSuccessNotification object:nil]; - [self dismissViewControllerAnimated:YES completion:nil]; - } failure:^(NSInteger code, NSString *msg) { - // TODO: 显示错误 Toast - NSLog(@"发布失败: %ld - %@", (long)code, msg); - }]; - } - failure:^(NSString *errorMsg) { - [EPProgressHUD dismiss]; - // TODO: 显示错误 Toast - NSLog(@"上传失败: %@", errorMsg); - }]; - } else { - // 纯文本:直接发布 - [apiHelper publishMomentWithType:@"0" - content:self.textView.text - resList:@[] - completion:^{ - // 保存临时情绪颜色(等待列表刷新后匹配) - if (emotionColorToSave) { - [self savePendingEmotionColor:emotionColorToSave]; - } - // 发送发布成功通知 - [[NSNotificationCenter defaultCenter] postNotificationName:EPMomentPublishSuccessNotification object:nil]; - [self dismissViewControllerAnimated:YES completion:nil]; - } failure:^(NSInteger code, NSString *msg) { - // TODO: 显示错误 Toast - NSLog(@"发布失败: %ld - %@", (long)code, msg); - }]; - } -} - -/// 保存待处理的情绪颜色(临时存储,供列表刷新后匹配) -- (void)savePendingEmotionColor:(NSString *)color { - [[NSUserDefaults standardUserDefaults] setObject:color forKey:@"EP_Pending_Emotion_Color"]; - [[NSUserDefaults standardUserDefaults] setObject:@([[NSDate date] timeIntervalSince1970]) forKey:@"EP_Pending_Emotion_Timestamp"]; - [[NSUserDefaults standardUserDefaults] synchronize]; -} - -#pragma mark - UICollectionView - -- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { - return self.images.count + 1; // 最后一个是添加按钮 -} - -- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { - UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"ep.publish.cell" forIndexPath:indexPath]; - cell.contentView.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.06]; - cell.contentView.layer.cornerRadius = 12; - // 清空复用子视图,避免加号被覆盖 - for (UIView *sub in cell.contentView.subviews) { [sub removeFromSuperview]; } - BOOL showAdd = (self.images.count < 9) && (indexPath.item == self.images.count); - if (showAdd) { - UIImageView *iv = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_moment_addphoto"]]; - iv.contentMode = UIViewContentModeScaleAspectFill; - iv.clipsToBounds = YES; - [cell.contentView addSubview:iv]; - [iv mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.equalTo(cell.contentView); }]; - } else { - UIImageView *iv = [[UIImageView alloc] init]; - iv.contentMode = UIViewContentModeScaleAspectFill; - iv.layer.masksToBounds = YES; - [cell.contentView addSubview:iv]; - [iv mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.equalTo(cell.contentView); }]; - NSInteger idx = MIN(indexPath.item, (NSInteger)self.images.count - 1); - if (idx >= 0 && idx < self.images.count) iv.image = self.images[idx]; - } - return cell; -} - -- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { - if (indexPath.item == self.images.count) { - TZImagePickerController *picker = [[TZImagePickerController alloc] initWithMaxImagesCount:9 delegate:self]; - picker.allowPickingVideo = NO; - picker.allowTakeVideo = NO; - picker.selectedAssets = self.selectedAssets; // 预选 - picker.maxImagesCount = 9; // 总上限 - [self presentViewController:picker animated:YES completion:nil]; - } -} - -#pragma mark - TZImagePickerControllerDelegate -- (void)imagePickerController:(TZImagePickerController *)picker didFinishPickingPhotos:(NSArray *)photos sourceAssets:(NSArray *)assets isSelectOriginalPhoto:(BOOL)isSelectOriginalPhoto infos:(NSArray *)infos { - // 合并选择:在已有基础上追加,最多 9 张 - for (NSInteger i = 0; i < assets.count; i++) { - id asset = assets[i]; - UIImage *img = [photos xpSafeObjectAtIndex:i] ?: photos[i]; - if (![self.selectedAssets containsObject:asset] && self.images.count < 9) { - [self.selectedAssets addObject:asset]; - [self.images addObject:img]; - } - } - [self.collectionView reloadData]; -} - -#pragma mark - UITextViewDelegate -- (void)textViewDidChange:(UITextView *)textView { - if (textView.text.length > 500) { - textView.text = [textView.text substringToIndex:500]; - } - self.limitLabel.text = [NSString stringWithFormat:@"%lu/500", (unsigned long)textView.text.length]; -} - -#pragma mark - Lazy - -- (UIView *)navView { if (!_navView) { _navView = [UIView new]; _navView.backgroundColor = [UIColor clearColor]; } return _navView; } -- (UIButton *)backButton { - if (!_backButton) { - _backButton = [UIButton buttonWithType:UIButtonTypeCustom]; - // 使用系统返回图标 - UIImage *backImage = [UIImage systemImageNamed:@"chevron.left"]; - UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:20 weight:UIImageSymbolWeightMedium]; - backImage = [backImage imageByApplyingSymbolConfiguration:config]; - [_backButton setImage:backImage forState:UIControlStateNormal]; - [_backButton setTintColor:[UIColor whiteColor]]; // 白色适配深色背景 - [_backButton addTarget:self action:@selector(onBack) forControlEvents:UIControlEventTouchUpInside]; - } - return _backButton; -} -- (UILabel *)titleLabel { - if (!_titleLabel) { - _titleLabel = [UILabel new]; - _titleLabel.text = YMLocalizedString(@"publish.title"); - _titleLabel.textColor = [UIColor whiteColor]; // 白色适配深色背景 - _titleLabel.font = [UIFont systemFontOfSize:17]; - } - return _titleLabel; -} -- (UIButton *)publishButton { - if (!_publishButton) { - _publishButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_publishButton setTitle:YMLocalizedString(@"common.publish") forState:UIControlStateNormal]; - [_publishButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - _publishButton.titleLabel.font = [UIFont systemFontOfSize:17 weight:UIFontWeightMedium]; - _publishButton.layer.cornerRadius = 25; - _publishButton.layer.masksToBounds = NO; // 改为 NO 以便渐变层正常显示 - // 渐变背景将在 viewDidLayoutSubviews 中添加(与登录页面统一) - [_publishButton addTarget:self action:@selector(onPublish) forControlEvents:UIControlEventTouchUpInside]; - } - return _publishButton; -} -- (UIView *)contentView { if (!_contentView) { _contentView = [UIView new]; _contentView.backgroundColor = [UIColor clearColor]; } return _contentView; } -- (SZTextView *)textView { - if (!_textView) { - _textView = [SZTextView new]; - _textView.placeholder = @"Enter Content"; - _textView.textColor = [UIColor whiteColor]; // 白色文本适配深色背景 - _textView.placeholderTextColor = [[UIColor whiteColor] colorWithAlphaComponent:0.4]; // 半透明白色占位符 - _textView.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.08]; // 轻微背景色 - _textView.layer.cornerRadius = 12; - _textView.layer.masksToBounds = YES; - _textView.font = [UIFont systemFontOfSize:15]; - _textView.delegate = self; - } - return _textView; -} -- (UILabel *)limitLabel { - if (!_limitLabel) { - _limitLabel = [UILabel new]; - _limitLabel.text = @"0/500"; - _limitLabel.textColor = [[UIColor whiteColor] colorWithAlphaComponent:0.6]; // 浅色适配深色背景 - _limitLabel.font = [UIFont systemFontOfSize:12]; - } - return _limitLabel; -} -- (UIView *)lineView { if (!_lineView) { _lineView = [UIView new]; _lineView.backgroundColor = [DJDKMIMOMColor dividerColor]; } return _lineView; } -- (UIButton *)emotionButton { - if (!_emotionButton) { - _emotionButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_emotionButton setTitle:@"🎨 Add Emotion" forState:UIControlStateNormal]; - [_emotionButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; // 白色文本 - _emotionButton.titleLabel.font = [UIFont systemFontOfSize:15]; - _emotionButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; - _emotionButton.contentEdgeInsets = UIEdgeInsetsMake(0, 15, 0, 0); - _emotionButton.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.08]; // 稍微提亮背景 - _emotionButton.layer.cornerRadius = 8; - _emotionButton.layer.masksToBounds = YES; - [_emotionButton addTarget:self action:@selector(onEmotionButtonTapped) forControlEvents:UIControlEventTouchUpInside]; - } - return _emotionButton; -} -- (UICollectionView *)collectionView { if (!_collectionView) { UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; layout.minimumLineSpacing = 10; layout.minimumInteritemSpacing = 10; CGFloat itemW = (KScreenWidth - 15*2 - 10*2)/3.0; layout.itemSize = CGSizeMake(itemW, itemW); _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; _collectionView.delegate = self; _collectionView.dataSource = self; _collectionView.backgroundColor = [UIColor clearColor]; [_collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"ep.publish.cell"]; } return _collectionView; } -- (NSMutableArray *)images { if (!_images) { _images = [NSMutableArray array]; } return _images; } -- (NSMutableArray *)selectedAssets { if (!_selectedAssets) { _selectedAssets = [NSMutableArray array]; } return _selectedAssets; } - -@end - - diff --git a/YuMi/E-P/Moments/Controllers/EPMomentViewController.h.backup b/YuMi/E-P/Moments/Controllers/EPMomentViewController.h.backup deleted file mode 100644 index 4872b5f..0000000 --- a/YuMi/E-P/Moments/Controllers/EPMomentViewController.h.backup +++ /dev/null @@ -1,20 +0,0 @@ -// -// EPMomentViewController.h -// YuMi -// -// Created by AI on 2025-10-09. -// Copyright © 2025 YuMi. All rights reserved. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/// 新的动态页面控制器 -/// 采用卡片式布局,完全不同于原 XPMomentsViewController -/// 注意:直接继承 UIViewController,不继承 BaseViewController(避免依赖链) -@interface EPMomentViewController : UIViewController - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/E-P/Moments/Controllers/EPMomentViewController.m.backup b/YuMi/E-P/Moments/Controllers/EPMomentViewController.m.backup deleted file mode 100644 index de42bf9..0000000 --- a/YuMi/E-P/Moments/Controllers/EPMomentViewController.m.backup +++ /dev/null @@ -1,195 +0,0 @@ -// -// EPMomentViewController.m -// YuMi -// -// Created by AI on 2025-10-09. -// Copyright © 2025 YuMi. All rights reserved. -// - -#import "EPMomentViewController.h" -#import -#import -#import "EPMomentCell.h" -#import "EPMomentListView.h" -#import "EPMomentPublishViewController.h" -#import "YUMIMacroUitls.h" - -@interface EPMomentViewController () - -// MARK: - UI Components - -/// 列表视图(MVVM:View) -@property (nonatomic, strong) EPMomentListView *listView; - -/// 顶部图标 -@property (nonatomic, strong) UIImageView *topIconImageView; - -/// 顶部固定文案 -@property (nonatomic, strong) UILabel *topTipLabel; - -@end - -@implementation EPMomentViewController - -// MARK: - Lifecycle - -- (void)viewDidLoad { - [super viewDidLoad]; - - self.title = @"Enjoy your Life Time"; - - // 设置 title 为白色 - [self.navigationController.navigationBar setTitleTextAttributes:@{ - NSForegroundColorAttributeName: [UIColor whiteColor] - }]; - - [self setupUI]; - [self.listView reloadFirstPage]; - - // 监听发布成功通知 - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(onMomentPublishSuccess:) - name:EPMomentPublishSuccessNotification - object:nil]; - - // ✅ 新增:冷启动时延迟检查数据,如果没有数据则自动刷新一次 - [self scheduleAutoRefreshIfNeeded]; - - NSLog(@"[EPMomentViewController] 页面加载完成"); -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; -} - -// MARK: - Setup UI - -- (void)setupUI { - UIImageView *bgImageView = [[UIImageView alloc] initWithImage:kImage(@"vc_bg")]; - bgImageView.contentMode = UIViewContentModeScaleAspectFill; - bgImageView.clipsToBounds = YES; - [self.view addSubview:bgImageView]; - [bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.mas_equalTo(self.view); - }]; - - // 顶部图标 - [self.view addSubview:self.topIconImageView]; - [self.topIconImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.equalTo(self.view); - make.top.equalTo(self.view.mas_safeAreaLayoutGuideTop).offset(14); - make.size.mas_equalTo(CGSizeMake(56, 41)); - }]; - - // 顶部固定文案 - [self.view addSubview:self.topTipLabel]; - [self.topTipLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.topIconImageView.mas_bottom).offset(14); - make.leading.trailing.equalTo(self.view).inset(20); - }]; - - // 列表视图 - [self.view addSubview:self.listView]; - [self.listView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.bottom.equalTo(self.view); - make.top.equalTo(self.topTipLabel.mas_bottom).offset(8); - }]; - - // 右上角发布按钮 - UIImage *addIcon = [UIImage imageNamed:@"icon_moment_add"]; - UIButton *publishButton = [UIButton buttonWithType:UIButtonTypeCustom]; - publishButton.contentMode = UIViewContentModeScaleAspectFit; - [publishButton setImage:addIcon forState:UIControlStateNormal]; - publishButton.frame = CGRectMake(0, 0, 40, 40); - [publishButton addTarget:self action:@selector(onPublishButtonTapped) forControlEvents:UIControlEventTouchUpInside]; - UIBarButtonItem *publishItem = [[UIBarButtonItem alloc] initWithCustomView:publishButton]; - self.navigationItem.rightBarButtonItem = publishItem; - - NSLog(@"[EPMomentViewController] UI 设置完成"); -} - -// 不再在 VC 内部直接发请求/维护分页 - -// MARK: - Auto Refresh - -/// 延迟检查数据,如果没有数据则自动刷新(解决冷启动数据未加载问题) -- (void)scheduleAutoRefreshIfNeeded { - __weak typeof(self) weakSelf = self; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - __strong typeof(weakSelf) self = weakSelf; - if (!self) return; - - // 检查是否有数据 - if (self.listView.rawList.count == 0) { - NSLog(@"[EPMomentViewController] ⚠️ 冷启动 1 秒后检测到无数据,自动刷新一次"); - [self.listView reloadFirstPage]; - } else { - NSLog(@"[EPMomentViewController] ✅ 冷启动 1 秒后检测到已有 %lu 条数据,无需刷新", (unsigned long)self.listView.rawList.count); - } - }); -} - -// MARK: - Actions - -- (void)onPublishButtonTapped { - NSLog(@"[EPMomentViewController] 发布按钮点击"); - EPMomentPublishViewController *vc = [[EPMomentPublishViewController alloc] init]; - vc.modalPresentationStyle = UIModalPresentationFullScreen; - [self.navigationController presentViewController:vc animated:YES completion:nil]; -} - -- (void)showAlertWithMessage:(NSString *)message { - UIAlertController *alert = [UIAlertController alertControllerWithTitle:YMLocalizedString(@"common.tips") - message:message - preferredStyle:UIAlertControllerStyleAlert]; - [alert addAction:[UIAlertAction actionWithTitle:YMLocalizedString(@"common.confirm") style:UIAlertActionStyleDefault handler:nil]]; - [self presentViewController:alert animated:YES completion:nil]; -} - -- (void)onMomentPublishSuccess:(NSNotification *)notification { - NSLog(@"[EPMomentViewController] 收到发布成功通知,刷新列表"); - [self.listView reloadFirstPage]; -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -// 列表点击回调由 listView 暴露 - -// MARK: - Lazy Loading - -- (EPMomentListView *)listView { - if (!_listView) { - _listView = [[EPMomentListView alloc] initWithFrame:CGRectZero]; -// __weak typeof(self) weakSelf = self; - _listView.onSelectMoment = ^(NSInteger index) { -// __strong typeof(weakSelf) self = weakSelf; -// [self showAlertWithMessage:[NSString stringWithFormat:YMLocalizedString(@"moment.item_clicked"), (long)index]]; - }; - } - return _listView; -} - -- (UIImageView *)topIconImageView { - if (!_topIconImageView) { - _topIconImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_moment_Volume"]]; - _topIconImageView.contentMode = UIViewContentModeScaleAspectFit; - } - return _topIconImageView; -} - -- (UILabel *)topTipLabel { - if (!_topTipLabel) { - _topTipLabel = [UILabel new]; - _topTipLabel.numberOfLines = 0; - _topTipLabel.textColor = [UIColor whiteColor]; - _topTipLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightRegular]; - _topTipLabel.text = @"In the quiet gallery of the heart, we learn to see the colors of emotion. And in the shared silence between souls, we begin to find the sound of resonance. This is more than an app—it's a space where your inner world is both a masterpiece and a melody."; - } - return _topTipLabel; -} - -// 无数据源属性 - -@end diff --git a/YuMi/E-P/Moments/Services/EPEmotionColorStorage.h.backup b/YuMi/E-P/Moments/Services/EPEmotionColorStorage.h.backup deleted file mode 100644 index d0d8617..0000000 --- a/YuMi/E-P/Moments/Services/EPEmotionColorStorage.h.backup +++ /dev/null @@ -1,58 +0,0 @@ -// -// EPEmotionColorStorage.h -// YuMi -// -// Created by AI on 2025-10-14. -// 本地情绪颜色存储管理器(基于 UserDefaults) -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface EPEmotionColorStorage : NSObject - -/// 保存动态的情绪颜色 -/// @param hexColor Hex 格式颜色值,如 #FF0000 -/// @param dynamicId 动态 ID -+ (void)saveColor:(NSString *)hexColor forDynamicId:(NSString *)dynamicId; - -/// 获取动态关联的情绪颜色 -/// @param dynamicId 动态 ID -/// @return Hex 格式颜色值,若未设置则返回 nil -+ (nullable NSString *)colorForDynamicId:(NSString *)dynamicId; - -/// 删除动态的情绪颜色 -/// @param dynamicId 动态 ID -+ (void)removeColorForDynamicId:(NSString *)dynamicId; - -/// 获取所有预设情绪颜色(6种基础情绪) -/// @return Hex 颜色数组 -+ (NSArray *)allEmotionColors; - -/// 获取随机情绪颜色(不持久化) -+ (NSString *)randomEmotionColor; - -/// 根据颜色值获取情绪名称 -/// @param hexColor Hex 格式颜色值,如 #FFD700 -/// @return 情绪名称(如 "Joy"),若未匹配返回 nil -+ (nullable NSString *)emotionNameForColor:(NSString *)hexColor; - -#pragma mark - User Signature Color - -/// 保存用户专属颜色 -+ (void)saveUserSignatureColor:(NSString *)hexColor; - -/// 获取用户专属颜色 -+ (nullable NSString *)userSignatureColor; - -/// 是否已设置专属颜色 -+ (BOOL)hasUserSignatureColor; - -/// 清除专属颜色(调试用) -+ (void)clearUserSignatureColor; - -@end - -NS_ASSUME_NONNULL_END - diff --git a/YuMi/E-P/Moments/Services/EPEmotionColorStorage.m.backup b/YuMi/E-P/Moments/Services/EPEmotionColorStorage.m.backup deleted file mode 100644 index 62fb9eb..0000000 --- a/YuMi/E-P/Moments/Services/EPEmotionColorStorage.m.backup +++ /dev/null @@ -1,118 +0,0 @@ -// -// EPEmotionColorStorage.m -// YuMi -// -// Created by AI on 2025-10-14. -// - -#import "EPEmotionColorStorage.h" - -static NSString *const kEmotionColorStorageKey = @"EP_Emotion_Colors"; -static NSString *const kUserSignatureColorKey = @"EP_User_Signature_Color"; -static NSString *const kUserSignatureTimestampKey = @"EP_User_Signature_Timestamp"; - -@implementation EPEmotionColorStorage - -#pragma mark - Public Methods - -+ (void)saveColor:(NSString *)hexColor forDynamicId:(NSString *)dynamicId { - if (!hexColor || !dynamicId) return; - - NSMutableDictionary *colorDict = [[self loadColorDictionary] mutableCopy]; - colorDict[dynamicId] = hexColor; - - [[NSUserDefaults standardUserDefaults] setObject:colorDict forKey:kEmotionColorStorageKey]; - [[NSUserDefaults standardUserDefaults] synchronize]; -} - -+ (NSString *)colorForDynamicId:(NSString *)dynamicId { - if (!dynamicId) return nil; - - NSDictionary *colorDict = [self loadColorDictionary]; - return colorDict[dynamicId]; -} - -+ (void)removeColorForDynamicId:(NSString *)dynamicId { - if (!dynamicId) return; - - NSMutableDictionary *colorDict = [[self loadColorDictionary] mutableCopy]; - [colorDict removeObjectForKey:dynamicId]; - - [[NSUserDefaults standardUserDefaults] setObject:colorDict forKey:kEmotionColorStorageKey]; - [[NSUserDefaults standardUserDefaults] synchronize]; -} - -+ (NSArray *)allEmotionColors { - return @[ - @"#FFD700", // 喜悦 Joy(金黄)- 降低亮度,更温暖 - @"#4A90E2", // 悲伤 Sadness(天蓝)- 提高亮度,更柔和 - @"#E74C3C", // 愤怒 Anger(珊瑚红)- 降低饱和度 - @"#9B59B6", // 恐惧 Fear(紫罗兰)- 稍微提亮 - @"#FF9A3D", // 惊讶 Surprise(柔和橙)- 略微调暗 - @"#2ECC71", // 厌恶 Disgust(翡翠绿)- 大幅降低亮度 - @"#3498DB", // 信任 Trust(亮蓝)- 清新明亮 - @"#F39C12" // 期待 Anticipation(琥珀色)- 温暖期待 - ]; -} - -+ (NSString *)randomEmotionColor { - NSArray *colors = [self allEmotionColors]; - uint32_t randomIndex = arc4random_uniform((uint32_t)colors.count); - return colors[randomIndex]; -} - -+ (NSString *)emotionNameForColor:(NSString *)hexColor { - if (!hexColor || hexColor.length == 0) return nil; - - NSArray *colors = [self allEmotionColors]; - NSArray *emotions = @[@"Joy", @"Sadness", @"Anger", @"Fear", @"Surprise", @"Disgust", @"Trust", @"Anticipation"]; - - // 大小写不敏感比较 - NSString *upperHex = [hexColor uppercaseString]; - for (NSInteger i = 0; i < colors.count; i++) { - if ([[colors[i] uppercaseString] isEqualToString:upperHex]) { - return emotions[i]; - } - } - - return nil; -} - -#pragma mark - Private Methods - -+ (NSDictionary *)loadColorDictionary { - NSDictionary *dict = [[NSUserDefaults standardUserDefaults] dictionaryForKey:kEmotionColorStorageKey]; - return dict ?: @{}; -} - -#pragma mark - User Signature Color - -+ (void)saveUserSignatureColor:(NSString *)hexColor { - if (!hexColor) return; - - [[NSUserDefaults standardUserDefaults] setObject:hexColor forKey:kUserSignatureColorKey]; - [[NSUserDefaults standardUserDefaults] setObject:@([[NSDate date] timeIntervalSince1970]) - forKey:kUserSignatureTimestampKey]; - [[NSUserDefaults standardUserDefaults] synchronize]; - - NSLog(@"[EPEmotionColorStorage] 保存用户专属颜色: %@", hexColor); -} - -+ (NSString *)userSignatureColor { - return [[NSUserDefaults standardUserDefaults] stringForKey:kUserSignatureColorKey]; -} - -+ (BOOL)hasUserSignatureColor { - return [self userSignatureColor] != nil; -} - -+ (void)clearUserSignatureColor { - [[NSUserDefaults standardUserDefaults] removeObjectForKey:kUserSignatureColorKey]; - [[NSUserDefaults standardUserDefaults] removeObjectForKey:kUserSignatureTimestampKey]; - [[NSUserDefaults standardUserDefaults] synchronize]; - - NSLog(@"[EPEmotionColorStorage] 清除用户专属颜色"); -} - -@end - diff --git a/YuMi/E-P/Moments/Services/EPMomentAPISwiftHelper.swift.backup b/YuMi/E-P/Moments/Services/EPMomentAPISwiftHelper.swift.backup deleted file mode 100644 index 8d96032..0000000 --- a/YuMi/E-P/Moments/Services/EPMomentAPISwiftHelper.swift.backup +++ /dev/null @@ -1,112 +0,0 @@ -// -// EPMomentAPISwiftHelper.swift -// YuMi -// -// Created by AI on 2025-10-11. -// - -import Foundation - -/// 动态 API 封装(Swift 现代化版本) -/// 统一封装列表获取和发布功能,完全替代 OC 版本 -@objc class EPMomentAPISwiftHelper: NSObject { - - /// 拉取最新动态列表 - /// - Parameters: - /// - nextID: 下一页 ID,首次传空字符串 - /// - completion: 成功回调 (动态列表, 下一页ID) - /// - failure: 失败回调 (错误码, 错误信息) - @objc func fetchLatestMomentsWithNextID( - _ nextID: String, - completion: @escaping ([MomentsInfoModel], String) -> Void, - failure: @escaping (Int, String) -> Void - ) { - let pageSize = "20" - let types = "0,2" // 图片+文字 - - Api.momentsLatestList({ (data, code, msg) in - if code == 200, let dict = data?.data as? NSDictionary { - // 使用 MomentsListInfoModel 序列化响应数据(标准化方式) - // 参考: XPMomentsLatestPresenter.m line 25 / EPLoginService.swift line 34 - // Swift 中使用 mj_object(withKeyValues:) 而不是 model(withJSON:) - if let listInfo = MomentsListInfoModel.mj_object(withKeyValues: dict) { - let dynamicList = listInfo.dynamicList - let nextDynamicId = listInfo.nextDynamicId - completion(dynamicList, nextDynamicId) - } else { - // 序列化失败时返回空数据 - completion([], "") - } - } else { - failure(Int(code), msg ?? YMLocalizedString("error.request_failed")) - } - }, dynamicId: nextID, pageSize: pageSize, types: types) - } - - /// 发布动态 - /// - Parameters: - /// - type: "0"=纯文本, "2"=图片 - /// - content: 文本内容 - /// - resList: 图片信息数组 - /// - completion: 成功回调 - /// - failure: 失败回调 (错误码, 错误信息) - @objc func publishMoment( - type: String, - content: String, - resList: [[String: Any]], - completion: @escaping () -> Void, - failure: @escaping (Int, String) -> Void - ) { - guard let uid = AccountInfoStorage.instance().getUid() else { - failure(-1, YMLocalizedString("error.not_logged_in")) - return - } - - // worldId 传空字符串(话题功能不实现) - // NOTE: 旧版本 XPMonentsPublishViewController 包含话题选择功能 - // 但实际业务中话题功能使用率低,新版本暂不实现 - // 如需实现参考: YuMi/Modules/YMMonents/View/XPMonentsPublishTopicView - - Api.momentsPublish({ (data, code, msg) in - if code == 200 { - completion() - } else { - failure(Int(code), msg ?? YMLocalizedString("error.publish_failed")) - } - }, uid: uid, type: type, worldId: "", content: content, resList: resList) - } - - /// 点赞/取消点赞动态 - /// - Parameters: - /// - dynamicId: 动态 ID - /// - isLike: true=点赞,false=取消点赞 - /// - likedUid: 动态发布者 UID - /// - worldId: 话题 ID - /// - completion: 成功回调 - /// - failure: 失败回调 (错误码, 错误信息) - @objc func likeMoment( - dynamicId: String, - isLike: Bool, - likedUid: String, - worldId: Int, - completion: @escaping () -> Void, - failure: @escaping (Int, String) -> Void - ) { - guard let uid = AccountInfoStorage.instance().getUid() else { - failure(-1, YMLocalizedString("error.not_logged_in")) - return - } - - let status = isLike ? "1" : "0" - let worldIdStr = String(format: "%ld", worldId) - - Api.momentsLike({ (data, code, msg) in - if code == 200 { - completion() - } else { - failure(Int(code), msg ?? YMLocalizedString("error.like_failed")) - } - }, dynamicId: dynamicId, uid: uid, status: status, likedUid: likedUid, worldId: worldIdStr) - } -} - diff --git a/YuMi/E-P/Moments/Views/EPEmotionColorPicker.h.backup b/YuMi/E-P/Moments/Views/EPEmotionColorPicker.h.backup deleted file mode 100644 index 17a99d5..0000000 --- a/YuMi/E-P/Moments/Views/EPEmotionColorPicker.h.backup +++ /dev/null @@ -1,31 +0,0 @@ -// -// EPEmotionColorPicker.h -// YuMi -// -// Created by AI on 2025-10-14. -// 情绪色轮选择器 - 环形布局 -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface EPEmotionColorPicker : UIView - -/// 颜色选择回调 -@property (nonatomic, copy) void(^onColorSelected)(NSString *hexColor); - -/// 预选中的颜色(用于标记默认选中状态) -@property (nonatomic, copy) NSString *preselectedColor; - -/// 在指定视图中显示选择器 -/// @param parentView 父视图(通常是 ViewController 的 view) -- (void)showInView:(UIView *)parentView; - -/// 关闭选择器 -- (void)dismiss; - -@end - -NS_ASSUME_NONNULL_END - diff --git a/YuMi/E-P/Moments/Views/EPEmotionColorPicker.m.backup b/YuMi/E-P/Moments/Views/EPEmotionColorPicker.m.backup deleted file mode 100644 index 35defa9..0000000 --- a/YuMi/E-P/Moments/Views/EPEmotionColorPicker.m.backup +++ /dev/null @@ -1,302 +0,0 @@ -// -// EPEmotionColorPicker.m -// YuMi -// -// Created by AI on 2025-10-14. -// - -#import "EPEmotionColorPicker.h" -#import "EPEmotionColorWheelView.h" -#import "EPEmotionInfoView.h" -#import - -@interface EPEmotionColorPicker () - -@property (nonatomic, strong) UIView *backgroundMask; -@property (nonatomic, strong) UIView *containerView; -@property (nonatomic, strong) UILabel *titleLabel; -@property (nonatomic, strong) UIButton *infoButton; -@property (nonatomic, strong) UIView *selectedColorView; -@property (nonatomic, strong) UILabel *selectedColorLabel; -@property (nonatomic, strong) UIButton *okButton; -@property (nonatomic, strong) EPEmotionColorWheelView *colorWheelView; -@property (nonatomic, copy) NSString *currentSelectedColor; -@property (nonatomic, assign) NSInteger currentSelectedIndex; - -@end - -@implementation EPEmotionColorPicker - -#pragma mark - Lifecycle - -- (instancetype)initWithFrame:(CGRect)frame { - if (self = [super initWithFrame:frame]) { - [self setupUI]; - } - return self; -} - -- (void)setupUI { - self.backgroundColor = [UIColor clearColor]; - - // 背景遮罩 - [self addSubview:self.backgroundMask]; - [self.backgroundMask mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(self); - }]; - - // 底部卡片容器 - [self addSubview:self.containerView]; - [self.containerView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.bottom.equalTo(self); - make.height.mas_equalTo(450); // 增加高度以适应新布局 - }]; - - // 标题 - [self.containerView addSubview:self.titleLabel]; - [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.containerView).offset(20); - make.centerX.equalTo(self.containerView); - }]; - - // Info 按钮(左上角) - [self.containerView addSubview:self.infoButton]; - [self.infoButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.equalTo(self.containerView).offset(16); - make.centerY.equalTo(self.titleLabel); - make.size.mas_equalTo(CGSizeMake(28, 28)); - }]; - - // OK 按钮(右上角) - [self.containerView addSubview:self.okButton]; - [self.okButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.trailing.equalTo(self.containerView).offset(-16); - make.centerY.equalTo(self.titleLabel); - make.size.mas_equalTo(CGSizeMake(60, 32)); - }]; - - // 选中状态显示区域 - [self.containerView addSubview:self.selectedColorView]; - [self.selectedColorView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.titleLabel.mas_bottom).offset(20); - make.centerX.equalTo(self.containerView); - make.height.mas_equalTo(50); - make.leading.trailing.equalTo(self.containerView).inset(20); - }]; - - // 色轮视图(使用共享组件) - [self.containerView addSubview:self.colorWheelView]; - [self.colorWheelView mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.equalTo(self.containerView); - make.top.equalTo(self.selectedColorView.mas_bottom).offset(20); - make.size.mas_equalTo(CGSizeMake(280, 280)); // 调整尺寸 - }]; -} - -#pragma mark - Actions - -- (void)onBackgroundTapped { - [self dismiss]; -} - -- (void)onInfoButtonTapped { - EPEmotionInfoView *infoView = [[EPEmotionInfoView alloc] init]; - [infoView showInView:self]; -} - -- (void)onOkButtonTapped { - if (self.currentSelectedColor && self.onColorSelected) { - self.onColorSelected(self.currentSelectedColor); - } - [self dismiss]; -} - -#pragma mark - Public Methods - -- (void)showInView:(UIView *)parentView { - [parentView addSubview:self]; - [self mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(parentView); - }]; - - // 初始状态 - self.backgroundMask.alpha = 0; - self.containerView.transform = CGAffineTransformMakeTranslation(0, 450); // 更新动画偏移量 - - // 弹出动画 - [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ - self.backgroundMask.alpha = 1; - self.containerView.transform = CGAffineTransformIdentity; - } completion:nil]; -} - -- (void)dismiss { - [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^{ - self.backgroundMask.alpha = 0; - self.containerView.transform = CGAffineTransformMakeTranslation(0, 450); // 更新动画偏移量 - } completion:^(BOOL finished) { - [self removeFromSuperview]; - }]; -} - -#pragma mark - Lazy Loading - -- (UIView *)backgroundMask { - if (!_backgroundMask) { - _backgroundMask = [[UIView alloc] init]; - _backgroundMask.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5]; - UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onBackgroundTapped)]; - [_backgroundMask addGestureRecognizer:tap]; - } - return _backgroundMask; -} - -- (UIView *)containerView { - if (!_containerView) { - _containerView = [[UIView alloc] init]; - _containerView.backgroundColor = [UIColor colorWithRed:0x0C/255.0 green:0x05/255.0 blue:0x27/255.0 alpha:1.0]; - _containerView.layer.cornerRadius = 20; - _containerView.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner; - _containerView.layer.masksToBounds = YES; - } - return _containerView; -} - -- (UILabel *)titleLabel { - if (!_titleLabel) { - _titleLabel = [[UILabel alloc] init]; - _titleLabel.text = @"Choose your emotion"; - _titleLabel.textColor = [UIColor whiteColor]; - _titleLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightSemibold]; - _titleLabel.textAlignment = NSTextAlignmentCenter; - } - return _titleLabel; -} - -- (UIButton *)infoButton { - if (!_infoButton) { - _infoButton = [UIButton buttonWithType:UIButtonTypeCustom]; - - // 使用系统 info.circle 图标 - UIImage *infoIcon = [UIImage systemImageNamed:@"info.circle"]; - [_infoButton setImage:infoIcon forState:UIControlStateNormal]; - _infoButton.tintColor = [[UIColor whiteColor] colorWithAlphaComponent:0.7]; - - // 点击效果 - [_infoButton addTarget:self action:@selector(onInfoButtonTapped) forControlEvents:UIControlEventTouchUpInside]; - } - return _infoButton; -} - -- (UIView *)selectedColorView { - if (!_selectedColorView) { - _selectedColorView = [[UIView alloc] init]; - _selectedColorView.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.1]; - _selectedColorView.layer.cornerRadius = 25; - _selectedColorView.layer.masksToBounds = YES; - _selectedColorView.hidden = YES; // 初始隐藏 - - // 颜色圆点 - UIView *colorDot = [[UIView alloc] init]; - colorDot.tag = 100; // 用于后续查找 - colorDot.layer.cornerRadius = 12; - colorDot.layer.masksToBounds = YES; - [_selectedColorView addSubview:colorDot]; - [colorDot mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.equalTo(_selectedColorView).offset(15); - make.centerY.equalTo(_selectedColorView); - make.size.mas_equalTo(CGSizeMake(24, 24)); - }]; - - // 情绪名称标签 - [_selectedColorView addSubview:self.selectedColorLabel]; - [self.selectedColorLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.equalTo(colorDot.mas_trailing).offset(12); - make.centerY.equalTo(_selectedColorView); - make.trailing.equalTo(_selectedColorView).offset(-15); - }]; - } - return _selectedColorView; -} - -- (UILabel *)selectedColorLabel { - if (!_selectedColorLabel) { - _selectedColorLabel = [[UILabel alloc] init]; - _selectedColorLabel.textColor = [UIColor whiteColor]; - _selectedColorLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium]; - _selectedColorLabel.text = @"Select an emotion"; - } - return _selectedColorLabel; -} - -- (UIButton *)okButton { - if (!_okButton) { - _okButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_okButton setTitle:@"OK" forState:UIControlStateNormal]; - [_okButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - _okButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold]; - _okButton.backgroundColor = [UIColor colorWithRed:0x9B/255.0 green:0x59/255.0 blue:0xB6/255.0 alpha:1.0]; - _okButton.layer.cornerRadius = 16; - _okButton.layer.masksToBounds = YES; - _okButton.enabled = NO; // 初始禁用 - _okButton.alpha = 0.5; - [_okButton addTarget:self action:@selector(onOkButtonTapped) forControlEvents:UIControlEventTouchUpInside]; - } - return _okButton; -} - -- (EPEmotionColorWheelView *)colorWheelView { - if (!_colorWheelView) { - _colorWheelView = [[EPEmotionColorWheelView alloc] init]; - _colorWheelView.radius = 100.0; - _colorWheelView.buttonSize = 50.0; - _colorWheelView.preselectedColor = self.preselectedColor; - - __weak typeof(self) weakSelf = self; - _colorWheelView.onColorTapped = ^(NSString *hexColor, NSInteger index) { - __strong typeof(weakSelf) self = weakSelf; - - // 保存当前选择 - self.currentSelectedColor = hexColor; - self.currentSelectedIndex = index; - - // 更新选中状态显示 - [self updateSelectedColorDisplay:hexColor index:index]; - }; - } - return _colorWheelView; -} - -/// 更新选中颜色显示 -- (void)updateSelectedColorDisplay:(NSString *)hexColor index:(NSInteger)index { - NSArray *emotions = @[@"Joy", @"Sadness", @"Anger", @"Fear", @"Surprise", @"Disgust", @"Trust", @"Anticipation"]; - - // 显示选中状态区域 - self.selectedColorView.hidden = NO; - - // 更新颜色圆点 - UIView *colorDot = [self.selectedColorView viewWithTag:100]; - colorDot.backgroundColor = [self colorFromHex:hexColor]; - - // 更新情绪名称 - self.selectedColorLabel.text = emotions[index]; - - // 启用OK按钮 - self.okButton.enabled = YES; - self.okButton.alpha = 1.0; -} - -/// Hex 转 UIColor -- (UIColor *)colorFromHex:(NSString *)hexString { - unsigned rgbValue = 0; - NSScanner *scanner = [NSScanner scannerWithString:hexString]; - [scanner setScanLocation:1]; // 跳过 # - [scanner scanHexInt:&rgbValue]; - return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16)/255.0 - green:((rgbValue & 0xFF00) >> 8)/255.0 - blue:(rgbValue & 0xFF)/255.0 - alpha:1.0]; -} - -@end - diff --git a/YuMi/E-P/Moments/Views/EPEmotionColorWheelView.h.backup b/YuMi/E-P/Moments/Views/EPEmotionColorWheelView.h.backup deleted file mode 100644 index ba5e3c3..0000000 --- a/YuMi/E-P/Moments/Views/EPEmotionColorWheelView.h.backup +++ /dev/null @@ -1,42 +0,0 @@ -// -// EPEmotionColorWheelView.h -// YuMi -// -// Created by AI on 2025-10-15. -// 共享情绪色轮组件 - 纯渲染逻辑,不包含容器和外部交互 -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface EPEmotionColorWheelView : UIView - -#pragma mark - Configuration - -/// 圆周半径(默认 80pt) -@property (nonatomic, assign) CGFloat radius; - -/// 按钮直径(默认 50pt) -@property (nonatomic, assign) CGFloat buttonSize; - -/// 预选中的颜色(Hex 格式,如 #FFD700) -@property (nonatomic, copy, nullable) NSString *preselectedColor; - -#pragma mark - Callbacks - -/// 颜色点击回调 -/// @param hexColor 选中的颜色值 -/// @param index 颜色索引 (0-7) -@property (nonatomic, copy) void(^onColorTapped)(NSString *hexColor, NSInteger index); - -#pragma mark - Methods - -/// 刷新色轮(支持动态更新预选中颜色) -/// @param color 新的预选中颜色 -- (void)reloadWithPreselectedColor:(nullable NSString *)color; - -@end - -NS_ASSUME_NONNULL_END - diff --git a/YuMi/E-P/Moments/Views/EPEmotionColorWheelView.m.backup b/YuMi/E-P/Moments/Views/EPEmotionColorWheelView.m.backup deleted file mode 100644 index 2a79ecc..0000000 --- a/YuMi/E-P/Moments/Views/EPEmotionColorWheelView.m.backup +++ /dev/null @@ -1,147 +0,0 @@ -// -// EPEmotionColorWheelView.m -// YuMi -// -// Created by AI on 2025-10-15. -// - -#import "EPEmotionColorWheelView.h" -#import "EPEmotionColorStorage.h" - -@interface EPEmotionColorWheelView () - -@property (nonatomic, strong) NSMutableArray *colorButtons; -@property (nonatomic, assign) NSInteger selectedIndex; // 当前选中的索引 - -@end - -@implementation EPEmotionColorWheelView - -#pragma mark - Lifecycle - -- (instancetype)initWithFrame:(CGRect)frame { - if (self = [super initWithFrame:frame]) { - // 默认配置 - _radius = 80.0; - _buttonSize = 50.0; - _colorButtons = [NSMutableArray array]; - - self.backgroundColor = [UIColor clearColor]; - } - return self; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - - // 如果色轮还未创建,自动创建 - if (self.colorButtons.count == 0) { - [self createColorButtons]; - } -} - -#pragma mark - Public Methods - -- (void)reloadWithPreselectedColor:(NSString *)color { - self.preselectedColor = color; - - // 清除旧按钮 - for (UIButton *btn in self.colorButtons) { - [btn removeFromSuperview]; - } - [self.colorButtons removeAllObjects]; - - // 重新创建 - [self createColorButtons]; -} - -#pragma mark - Private Methods - -- (void)createColorButtons { - NSArray *colors = [EPEmotionColorStorage allEmotionColors]; - NSArray *emotions = @[@"Joy", @"Sadness", @"Anger", @"Fear", @"Surprise", @"Disgust", @"Trust", @"Anticipation"]; - - CGFloat angleStep = M_PI * 2.0 / colors.count; - CGFloat centerX = CGRectGetWidth(self.bounds) / 2.0; - CGFloat centerY = CGRectGetHeight(self.bounds) / 2.0; - - for (NSInteger i = 0; i < colors.count; i++) { - // 从顶部开始,顺时针排列 - CGFloat angle = angleStep * i - M_PI_2; - CGFloat x = centerX + self.radius * cos(angle) - self.buttonSize / 2.0; - CGFloat y = centerY + self.radius * sin(angle) - self.buttonSize / 2.0; - - UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; - button.frame = CGRectMake(x, y, self.buttonSize, self.buttonSize); - button.backgroundColor = [self colorFromHex:colors[i]]; - button.layer.cornerRadius = self.buttonSize / 2.0; - button.layer.masksToBounds = YES; - button.layer.borderWidth = 3.0; - button.layer.borderColor = [UIColor whiteColor].CGColor; - button.tag = i; - [button addTarget:self action:@selector(onButtonTapped:) forControlEvents:UIControlEventTouchUpInside]; - - // 如果是预选中颜色,添加选中态标识 - if (self.preselectedColor && [colors[i] isEqualToString:self.preselectedColor]) { - button.layer.borderWidth = 5.0; // 加粗边框 - button.transform = CGAffineTransformMakeScale(1.1, 1.1); // 稍微放大 - } - - // 添加阴影效果 - button.layer.shadowColor = [self colorFromHex:colors[i]].CGColor; - button.layer.shadowOffset = CGSizeMake(0, 2); - button.layer.shadowOpacity = 0.6; - button.layer.shadowRadius = 8; - button.layer.masksToBounds = NO; - - [self addSubview:button]; - [self.colorButtons addObject:button]; - } -} - -- (void)onButtonTapped:(UIButton *)sender { - NSInteger index = sender.tag; - self.selectedIndex = index; - - // 更新选中状态 - [self updateSelectionState]; - - // 执行回调(仅用于更新UI,不直接确认选择) - NSArray *colors = [EPEmotionColorStorage allEmotionColors]; - NSString *selectedColor = colors[index]; - if (self.onColorTapped) { - self.onColorTapped(selectedColor, index); - } -} - -/// 更新选中状态 -- (void)updateSelectionState { - for (NSInteger i = 0; i < self.colorButtons.count; i++) { - UIButton *button = self.colorButtons[i]; - if (i == self.selectedIndex) { - // 选中状态:加粗边框,稍微放大 - button.layer.borderWidth = 5.0; - button.transform = CGAffineTransformMakeScale(1.1, 1.1); - } else { - // 未选中状态:正常边框,正常大小 - button.layer.borderWidth = 3.0; - button.transform = CGAffineTransformIdentity; - } - } -} - -#pragma mark - Utilities - -- (UIColor *)colorFromHex:(NSString *)hexString { - unsigned rgbValue = 0; - NSScanner *scanner = [NSScanner scannerWithString:hexString]; - [scanner setScanLocation:1]; // 跳过 # - [scanner scanHexInt:&rgbValue]; - return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16)/255.0 - green:((rgbValue & 0xFF00) >> 8)/255.0 - blue:(rgbValue & 0xFF)/255.0 - alpha:1.0]; -} - -@end - diff --git a/YuMi/E-P/Moments/Views/EPEmotionInfoView.h.backup b/YuMi/E-P/Moments/Views/EPEmotionInfoView.h.backup deleted file mode 100644 index 1d95f97..0000000 --- a/YuMi/E-P/Moments/Views/EPEmotionInfoView.h.backup +++ /dev/null @@ -1,25 +0,0 @@ -// -// EPEmotionInfoView.h -// YuMi -// -// Created by AI on 2025-10-16. -// 普拉奇克情绪轮说明视图 -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface EPEmotionInfoView : UIView - -/// 在指定视图中显示说明 -/// @param parentView 父视图 -- (void)showInView:(UIView *)parentView; - -/// 关闭说明视图 -- (void)dismiss; - -@end - -NS_ASSUME_NONNULL_END - diff --git a/YuMi/E-P/Moments/Views/EPEmotionInfoView.m.backup b/YuMi/E-P/Moments/Views/EPEmotionInfoView.m.backup deleted file mode 100644 index dc4da14..0000000 --- a/YuMi/E-P/Moments/Views/EPEmotionInfoView.m.backup +++ /dev/null @@ -1,213 +0,0 @@ -// -// EPEmotionInfoView.m -// YuMi -// -// Created by AI on 2025-10-16. -// - -#import "EPEmotionInfoView.h" -#import - -@interface EPEmotionInfoView () - -@property (nonatomic, strong) UIView *backgroundMask; -@property (nonatomic, strong) UIView *contentContainer; -@property (nonatomic, strong) UILabel *titleLabel; -@property (nonatomic, strong) UIScrollView *scrollView; -@property (nonatomic, strong) UILabel *contentLabel; -@property (nonatomic, strong) UIButton *closeButton; - -@end - -@implementation EPEmotionInfoView - -#pragma mark - Lifecycle - -- (instancetype)initWithFrame:(CGRect)frame { - if (self = [super initWithFrame:frame]) { - [self setupUI]; - } - return self; -} - -- (void)setupUI { - self.backgroundColor = [UIColor clearColor]; - - // 背景遮罩 - [self addSubview:self.backgroundMask]; - [self.backgroundMask mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(self); - }]; - - // 内容容器 - [self addSubview:self.contentContainer]; - [self.contentContainer mas_makeConstraints:^(MASConstraintMaker *make) { - make.center.equalTo(self); - make.leading.trailing.equalTo(self).inset(30); - make.height.mas_lessThanOrEqualTo(500); - }]; - - // 标题 - [self.contentContainer addSubview:self.titleLabel]; - [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.contentContainer).offset(24); - make.leading.trailing.equalTo(self.contentContainer).inset(20); - }]; - - // 滚动视图 - [self.contentContainer addSubview:self.scrollView]; - [self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.titleLabel.mas_bottom).offset(16); - make.leading.trailing.equalTo(self.contentContainer).inset(20); - make.height.mas_lessThanOrEqualTo(320); - }]; - - // 内容文本 - [self.scrollView addSubview:self.contentLabel]; - [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(self.scrollView); - make.width.equalTo(self.scrollView); - }]; - - // 关闭按钮 - [self.contentContainer addSubview:self.closeButton]; - [self.closeButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.scrollView.mas_bottom).offset(20); - make.centerX.equalTo(self.contentContainer); - make.leading.trailing.equalTo(self.contentContainer).inset(20); - make.height.mas_equalTo(50); - make.bottom.equalTo(self.contentContainer).offset(-24); - }]; -} - -#pragma mark - Actions - -- (void)onBackgroundTapped { - [self dismiss]; -} - -- (void)onCloseButtonTapped { - [self dismiss]; -} - -#pragma mark - Public Methods - -- (void)showInView:(UIView *)parentView { - [parentView addSubview:self]; - [self mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(parentView); - }]; - - // 初始状态 - self.backgroundMask.alpha = 0; - self.contentContainer.alpha = 0; - self.contentContainer.transform = CGAffineTransformMakeScale(0.9, 0.9); - - // 弹出动画 - [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ - self.backgroundMask.alpha = 1; - self.contentContainer.alpha = 1; - self.contentContainer.transform = CGAffineTransformIdentity; - } completion:nil]; -} - -- (void)dismiss { - [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^{ - self.backgroundMask.alpha = 0; - self.contentContainer.alpha = 0; - self.contentContainer.transform = CGAffineTransformMakeScale(0.95, 0.95); - } completion:^(BOOL finished) { - [self removeFromSuperview]; - }]; -} - -#pragma mark - Lazy Loading - -- (UIView *)backgroundMask { - if (!_backgroundMask) { - _backgroundMask = [[UIView alloc] init]; - _backgroundMask.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.6]; - UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onBackgroundTapped)]; - [_backgroundMask addGestureRecognizer:tap]; - } - return _backgroundMask; -} - -- (UIView *)contentContainer { - if (!_contentContainer) { - _contentContainer = [[UIView alloc] init]; - _contentContainer.backgroundColor = [UIColor colorWithRed:0x1a/255.0 green:0x1a/255.0 blue:0x2e/255.0 alpha:1.0]; - _contentContainer.layer.cornerRadius = 16; - _contentContainer.layer.masksToBounds = YES; - } - return _contentContainer; -} - -- (UILabel *)titleLabel { - if (!_titleLabel) { - _titleLabel = [[UILabel alloc] init]; - _titleLabel.text = @"About Emotion Colors"; - _titleLabel.textColor = [UIColor whiteColor]; - _titleLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightBold]; - _titleLabel.textAlignment = NSTextAlignmentCenter; - } - return _titleLabel; -} - -- (UIScrollView *)scrollView { - if (!_scrollView) { - _scrollView = [[UIScrollView alloc] init]; - _scrollView.showsVerticalScrollIndicator = YES; - _scrollView.alwaysBounceVertical = YES; - } - return _scrollView; -} - -- (UILabel *)contentLabel { - if (!_contentLabel) { - _contentLabel = [[UILabel alloc] init]; - _contentLabel.numberOfLines = 0; - _contentLabel.textColor = [[UIColor whiteColor] colorWithAlphaComponent:0.9]; - _contentLabel.font = [UIFont systemFontOfSize:15]; - - // 普拉奇克情绪轮说明文本 - NSString *content = @"Based on Plutchik's Wheel of Emotions, we use 8 core colors to represent fundamental human emotions:\n\n" - "🟡 Joy (Gold)\n" - "Represents happiness, delight, and cheerfulness. Like sunshine warming your heart.\n\n" - "🔵 Sadness (Sky Blue)\n" - "Reflects sorrow, melancholy, and contemplation. The quiet depth of blue skies.\n\n" - "🔴 Anger (Coral Red)\n" - "Expresses frustration, rage, and intensity. The fire of passionate emotions.\n\n" - "🟣 Fear (Violet)\n" - "Embodies anxiety, worry, and apprehension. The uncertainty of purple twilight.\n\n" - "🟠 Surprise (Amber)\n" - "Captures amazement, shock, and wonder. The spark of unexpected moments.\n\n" - "🟢 Disgust (Emerald)\n" - "Conveys aversion, distaste, and rejection. The instinctive green of caution.\n\n" - "🔵 Trust (Bright Blue)\n" - "Symbolizes confidence, faith, and security. The clarity of open skies.\n\n" - "🟡 Anticipation (Amber)\n" - "Represents expectation, hope, and eagerness. The warmth of looking forward.\n\n" - "Each color helps you express your current emotional state in moments you share."; - - _contentLabel.text = content; - } - return _contentLabel; -} - -- (UIButton *)closeButton { - if (!_closeButton) { - _closeButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_closeButton setTitle:@"Got it" forState:UIControlStateNormal]; - [_closeButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - _closeButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold]; - _closeButton.backgroundColor = [UIColor colorWithRed:0x9B/255.0 green:0x59/255.0 blue:0xB6/255.0 alpha:1.0]; - _closeButton.layer.cornerRadius = 25; - _closeButton.layer.masksToBounds = YES; - [_closeButton addTarget:self action:@selector(onCloseButtonTapped) forControlEvents:UIControlEventTouchUpInside]; - } - return _closeButton; -} - -@end - diff --git a/YuMi/E-P/Moments/Views/EPMomentCell.h.backup b/YuMi/E-P/Moments/Views/EPMomentCell.h.backup deleted file mode 100644 index 4fac4bb..0000000 --- a/YuMi/E-P/Moments/Views/EPMomentCell.h.backup +++ /dev/null @@ -1,26 +0,0 @@ -// -// NewMomentCell.h -// YuMi -// -// Created by AI on 2025-10-09. -// Copyright © 2025 YuMi. All rights reserved. -// - -#import - -@class MomentsInfoModel; -@class SDPhotoBrowser; - -NS_ASSUME_NONNULL_BEGIN - -/// 新的动态 Cell(卡片式设计) -/// 完全不同于原 XPMomentsCell 的列表式设计 -@interface EPMomentCell : UITableViewCell - -/// 配置 Cell 数据 -/// @param model 动态数据模型 -- (void)configureWithModel:(MomentsInfoModel *)model; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/E-P/Moments/Views/EPMomentCell.m.backup b/YuMi/E-P/Moments/Views/EPMomentCell.m.backup deleted file mode 100644 index ff00a44..0000000 --- a/YuMi/E-P/Moments/Views/EPMomentCell.m.backup +++ /dev/null @@ -1,564 +0,0 @@ -// -// NewMomentCell.m -// YuMi -// -// Created by AI on 2025-10-09. -// Copyright © 2025 YuMi. All rights reserved. -// - -#import "EPMomentCell.h" -#import "MomentsInfoModel.h" -#import "AccountInfoStorage.h" -#import "NetImageView.h" -#import "EPEmotionColorStorage.h" -#import "SDPhotoBrowser.h" -#import "YuMi-Swift.h" // Swift 互操作 - -@interface EPMomentCell () - -// MARK: - UI Components - -/// 卡片容器 -@property (nonatomic, strong) UIView *cardView; - -/// 彩色背景层(毛玻璃下方) -@property (nonatomic, strong) UIView *colorBackgroundView; - -/// 毛玻璃效果视图 -@property (nonatomic, strong) UIVisualEffectView *blurEffectView; - -/// 头像(网络) -@property (nonatomic, strong) NetImageView *avatarImageView; - -/// 用户名 -@property (nonatomic, strong) UILabel *nameLabel; - -/// 时间标签 -@property (nonatomic, strong) UILabel *timeLabel; - -/// 内容标签 -@property (nonatomic, strong) UILabel *contentLabel; - -/// 图片容器(九宫格) -@property (nonatomic, strong) UIView *imagesContainer; -@property (nonatomic, strong) NSMutableArray *imageViews; - -/// 底部操作栏 -@property (nonatomic, strong) UIView *actionBar; - -/// 点赞按钮 -@property (nonatomic, strong) UIButton *likeButton; - -/// 评论按钮 -@property (nonatomic, strong) UIButton *commentButton; - -// 分享按钮已移除 - -/// 当前数据模型 -@property (nonatomic, strong) MomentsInfoModel *currentModel; - -/// API Helper (Swift 版本) -@property (nonatomic, strong) EPMomentAPISwiftHelper *apiHelper; - -@end - -@implementation EPMomentCell - -// MARK: - Lifecycle - -- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { - if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { - self.selectionStyle = UITableViewCellSelectionStyleNone; - self.backgroundColor = [UIColor clearColor]; - [self setupUI]; - } - return self; -} - -// MARK: - Setup UI - -- (void)setupUI { - // 卡片容器(圆角矩形 + 阴影) - [self.contentView addSubview:self.cardView]; - [self.cardView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.equalTo(self.contentView).inset(15); - make.top.equalTo(self.contentView).offset(8); - make.bottom.equalTo(self.contentView).offset(-8).priority(UILayoutPriorityRequired - 1); - }]; - - // 彩色背景层(最底层) - [self.cardView addSubview:self.colorBackgroundView]; - [self.colorBackgroundView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(self.cardView); - }]; - - // 毛玻璃效果视图(在彩色背景层之上) - [self.cardView addSubview:self.blurEffectView]; - [self.blurEffectView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(self.cardView); - }]; - - // 头像( - [self.blurEffectView.contentView addSubview:self.avatarImageView]; - [self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.equalTo(self.cardView).offset(15); - make.top.equalTo(self.cardView).offset(15); - make.size.mas_equalTo(CGSizeMake(40, 40)); - }]; - - // 用户名 - [self.blurEffectView.contentView addSubview:self.nameLabel]; - [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.equalTo(self.avatarImageView.mas_trailing).offset(10); - make.top.equalTo(self.avatarImageView); - make.trailing.equalTo(self.cardView).offset(-15); - }]; - - // 时间 - [self.blurEffectView.contentView addSubview:self.timeLabel]; - [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.equalTo(self.nameLabel); - make.bottom.equalTo(self.avatarImageView); - make.trailing.equalTo(self.cardView).offset(-15); - }]; - - // 内容 - [self.blurEffectView.contentView addSubview:self.contentLabel]; - [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.equalTo(self.cardView).inset(15); - make.top.equalTo(self.avatarImageView.mas_bottom).offset(12); - }]; - - // 图片九宫格 - [self.blurEffectView.contentView addSubview:self.imagesContainer]; - [self.imagesContainer mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.equalTo(self.cardView).inset(15); - make.top.equalTo(self.contentLabel.mas_bottom).offset(12); - make.height.mas_equalTo(0); // 初始高度为0,renderImages 时会 remakeConstraints - }]; - - // 底部操作栏 - [self.blurEffectView.contentView addSubview:self.actionBar]; - [self.actionBar mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.equalTo(self.cardView); - make.top.equalTo(self.imagesContainer.mas_bottom).offset(12); - make.height.mas_equalTo(50); - // 设置较高优先级,确保底部约束生效 - make.bottom.equalTo(self.cardView).offset(-8).priority(UILayoutPriorityRequired - 2); - }]; - - // 点赞按钮(居左显示,评论功能已隐藏) - [self.actionBar addSubview:self.likeButton]; - [self.likeButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.equalTo(self.actionBar); - make.centerY.equalTo(self.actionBar); - make.width.mas_greaterThanOrEqualTo(80); - }]; -} - -// MARK: - Public Methods - -- (void)configureWithModel:(MomentsInfoModel *)model { - self.currentModel = model; - - // 配置用户名 - self.nameLabel.text = model.nick ?: YMLocalizedString(@"user.anonymous"); - - // 配置时间(将时间戳转换为 MM/dd 格式) - self.timeLabel.text = [self formatTimestampToDate:model.publishTime]; - - // 配置内容 - self.contentLabel.text = model.content ?: @""; - - // 配置图片九宫格 - [self renderImages:model.dynamicResList]; - - // 配置点赞按钮状态和数字 - NSInteger likeCnt = MAX(0, model.likeCount.integerValue); - self.likeButton.selected = model.isLike; - [self.likeButton setTitle:[NSString stringWithFormat:@" %ld", (long)likeCnt] forState:UIControlStateNormal]; - [self.likeButton setTitle:[NSString stringWithFormat:@" %ld", (long)likeCnt] forState:UIControlStateSelected]; - - self.avatarImageView.imageUrl = model.avatar; - - // 配置情绪颜色 border 和 shadow - [self applyEmotionColorEffect:model.emotionColor]; - - // 确保布局完成后 cell 高度正确 - [self setNeedsLayout]; -} - -/// 应用情绪颜色视觉效果(Background + Shadow) -- (void)applyEmotionColorEffect:(NSString *)emotionColorHex { - // 获取颜色(已在列表加载时处理,这里直接使用) - if (!emotionColorHex) { - NSLog(@"[EPMomentCell] 警告:emotionColorHex 为 nil"); - return; - } - - UIColor *color = [self colorFromHex:emotionColorHex]; - - // 移除边框 - self.cardView.layer.borderWidth = 0; - - // 设置彩色背景(50% 透明度,在毛玻璃下方) - self.colorBackgroundView.backgroundColor = [color colorWithAlphaComponent:0.5]; - - // 设置 shadow(使用情绪颜色) - self.cardView.layer.shadowColor = color.CGColor; - self.cardView.layer.shadowOffset = CGSizeMake(0, 2); - self.cardView.layer.shadowOpacity = 0.5; - self.cardView.layer.shadowRadius = 16.0; -} - -/// Hex 转 UIColor -- (UIColor *)colorFromHex:(NSString *)hexString { - unsigned rgbValue = 0; - NSScanner *scanner = [NSScanner scannerWithString:hexString]; - [scanner setScanLocation:1]; // 跳过 # - [scanner scanHexInt:&rgbValue]; - return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16)/255.0 - green:((rgbValue & 0xFF00) >> 8)/255.0 - blue:(rgbValue & 0xFF)/255.0 - alpha:1.0]; -} - -// MARK: - Images Grid - -- (void)renderImages:(NSArray *)resList { - // 清理旧视图 - for (UIView *iv in self.imageViews) { [iv removeFromSuperview]; } - [self.imageViews removeAllObjects]; - if (resList.count == 0) { - [self.imagesContainer mas_remakeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.equalTo(self.cardView).inset(15); - make.top.equalTo(self.contentLabel.mas_bottom).offset(0); - make.height.mas_equalTo(0); - }]; - - // 强制触发布局更新 - [self.contentView setNeedsLayout]; - [self.contentView layoutIfNeeded]; - return; - } - NSInteger columns = 3; - CGFloat spacing = 6.0; - CGFloat totalWidth = [UIScreen mainScreen].bounds.size.width - 30 - 30; // 左右各 15 内边距,再减卡片左右 15 - CGFloat itemW = floor((totalWidth - spacing * (columns - 1)) / columns); - - for (NSInteger i = 0; i < resList.count && i < 9; i++) { - NetImageConfig *config = [[NetImageConfig alloc] init]; - config.placeHolder = [UIImageConstant defaultBannerPlaceholder]; - NetImageView *iv = [[NetImageView alloc] initWithConfig:config]; - iv.backgroundColor = [UIColor colorWithWhite:0.95 alpha:1.0]; - iv.layer.cornerRadius = 6; - iv.layer.masksToBounds = YES; - iv.contentMode = UIViewContentModeScaleAspectFill; - iv.userInteractionEnabled = YES; - iv.tag = i; // 用于识别点击的图片索引 - - // 添加点击手势 - UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onImageTapped:)]; - [iv addGestureRecognizer:tap]; - - [self.imagesContainer addSubview:iv]; - [self.imageViews addObject:iv]; - NSInteger row = i / columns; - NSInteger col = i % columns; - [iv mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.equalTo(self.imagesContainer).offset((itemW + spacing) * col); - make.top.equalTo(self.imagesContainer).offset((itemW + spacing) * row); - make.size.mas_equalTo(CGSizeMake(itemW, itemW)); - }]; - // 绑定网络图片 - NSString *url = nil; - id item = resList[i]; - if ([item isKindOfClass:[NSDictionary class]]) { - url = [item valueForKey:@"resUrl"] ?: [item valueForKey:@"url"]; - } else if ([item respondsToSelector:@selector(resUrl)]) { - url = [item valueForKey:@"resUrl"]; - } - iv.imageUrl = url; - } - - NSInteger rows = ((MIN(resList.count, 9) - 1) / columns) + 1; - CGFloat height = rows * itemW + (rows - 1) * spacing; - [self.imagesContainer mas_remakeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.equalTo(self.cardView).inset(15); - make.top.equalTo(self.contentLabel.mas_bottom).offset(12); - make.height.mas_equalTo(height); - }]; - - // 强制触发布局更新,确保 cell 高度正确计算 - [self.contentView setNeedsLayout]; - [self.contentView layoutIfNeeded]; -} - -/// 格式化时间戳为 MM/dd 格式 -- (NSString *)formatTimestampToDate:(NSString *)timestampString { - if (!timestampString || timestampString.length == 0) { - return @""; - } - - // 将字符串转换为时间戳(毫秒) - NSTimeInterval timestamp = [timestampString doubleValue] / 1000.0; - - if (timestamp <= 0) { - return @""; - } - - NSDate *date = [NSDate dateWithTimeIntervalSince1970:timestamp]; - NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; - formatter.dateFormat = @"MM/dd"; - - return [formatter stringFromDate:date]; -} - -/// 格式化时间戳为相对时间 -- (NSString *)formatTimeInterval:(NSInteger)timestamp { - if (timestamp <= 0) return YMLocalizedString(@"time.just_now"); - - NSTimeInterval interval = [[NSDate date] timeIntervalSince1970] - timestamp / 1000.0; - - if (interval < 60) { - return YMLocalizedString(@"time.just_now"); - } else if (interval < 3600) { - return [NSString stringWithFormat:YMLocalizedString(@"time.minutes_ago"), interval / 60]; - } else if (interval < 86400) { - return [NSString stringWithFormat:YMLocalizedString(@"time.hours_ago"), interval / 3600]; - } else if (interval < 604800) { - return [NSString stringWithFormat:YMLocalizedString(@"time.days_ago"), interval / 86400]; - } else { - NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; - formatter.dateFormat = @"yyyy-MM-dd"; - return [formatter stringFromDate:[NSDate dateWithTimeIntervalSince1970:timestamp / 1000.0]]; - } -} - -// MARK: - Actions - -- (void)onLikeButtonTapped { - if (!self.currentModel) return; - - // 如果已点赞,执行取消点赞 - if (self.currentModel.isLike) { - [self performLikeAction:NO]; - return; - } - - // 审核中的动态不可点赞 - if (self.currentModel.status == 0) { - NSLog(@"[EPMomentCell] 动态审核中,无法点赞"); - // TODO: 可选择显示提示 Toast - return; - } - - // 执行点赞 - [self performLikeAction:YES]; -} - -- (void)performLikeAction:(BOOL)isLike { - NSLog(@"[EPMomentCell] %@ 动态: %@", isLike ? @"点赞" : @"取消点赞", self.currentModel.dynamicId); - - NSString *dynamicId = self.currentModel.dynamicId; - NSString *likedUid = self.currentModel.uid; - long worldId = self.currentModel.worldId; - - // 使用 Swift API Helper - @kWeakify(self); - [self.apiHelper likeMomentWithDynamicId:dynamicId - isLike:isLike - likedUid:likedUid - worldId:worldId - completion:^{ - @kStrongify(self); - // 更新点赞状态 - self.currentModel.isLike = isLike; - NSInteger likeCount = [self.currentModel.likeCount integerValue]; - likeCount += isLike ? 1 : -1; - likeCount = MAX(0, likeCount); // 防止负数 - self.currentModel.likeCount = @(likeCount).stringValue; - - // 更新 UI - self.likeButton.selected = self.currentModel.isLike; - [self.likeButton setTitle:[NSString stringWithFormat:@" %ld", (long)likeCount] forState:UIControlStateNormal]; - [self.likeButton setTitle:[NSString stringWithFormat:@" %ld", (long)likeCount] forState:UIControlStateSelected]; - - NSLog(@"[EPMomentCell] %@ 成功", isLike ? @"点赞" : @"取消点赞"); - } failure:^(NSInteger code, NSString * _Nonnull msg) { - NSLog(@"[EPMomentCell] %@ 失败 (code: %ld): %@", isLike ? @"点赞" : @"取消点赞", (long)code, msg); - }]; -} - -// 评论功能已隐藏 -// - (void)onCommentButtonTapped { -// NSLog(@"[EPMomentCell] 评论"); -// } - -- (void)onImageTapped:(UITapGestureRecognizer *)gesture { - if (!self.currentModel || !self.currentModel.dynamicResList.count) return; - - NSInteger index = gesture.view.tag; - NSLog(@"[EPMomentCell] 点击图片索引: %ld", (long)index); - - SDPhotoBrowser *browser = [[SDPhotoBrowser alloc] init]; - browser.sourceImagesContainerView = self.imagesContainer; - browser.delegate = self; - browser.imageCount = self.currentModel.dynamicResList.count; - browser.currentImageIndex = index; - [browser show]; -} - -#pragma mark - SDPhotoBrowserDelegate - -- (NSURL *)photoBrowser:(SDPhotoBrowser *)browser highQualityImageURLForIndex:(NSInteger)index { - if (index >= 0 && index < self.currentModel.dynamicResList.count) { - id item = self.currentModel.dynamicResList[index]; - NSString *url = nil; - if ([item isKindOfClass:[NSDictionary class]]) { - url = [item valueForKey:@"resUrl"] ?: [item valueForKey:@"url"]; - } else if ([item respondsToSelector:@selector(resUrl)]) { - url = [item valueForKey:@"resUrl"]; - } - if (url) { - return [NSURL URLWithString:url]; - } - } - return nil; -} - -- (UIImage *)photoBrowser:(SDPhotoBrowser *)browser placeholderImageForIndex:(NSInteger)index { - return [UIImageConstant defaultBannerPlaceholder]; -} - -// MARK: - Lazy Loading - -- (UIView *)cardView { - if (!_cardView) { - _cardView = [[UIView alloc] init]; - _cardView.backgroundColor = [UIColor clearColor]; // 透明背景,颜色由 colorBackgroundView 提供 - _cardView.layer.cornerRadius = 12; // 圆角 - // Shadow 将由 applyEmotionColorEffect 动态设置 - _cardView.layer.masksToBounds = NO; - } - return _cardView; -} - -- (UIView *)colorBackgroundView { - if (!_colorBackgroundView) { - _colorBackgroundView = [[UIView alloc] init]; - _colorBackgroundView.layer.cornerRadius = 12; - _colorBackgroundView.layer.masksToBounds = YES; - } - return _colorBackgroundView; -} - -- (UIVisualEffectView *)blurEffectView { - if (!_blurEffectView) { - UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; - _blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect]; - _blurEffectView.layer.cornerRadius = 12; - _blurEffectView.layer.masksToBounds = YES; - } - return _blurEffectView; -} - -- (UIImageView *)avatarImageView { - if (!_avatarImageView) { - NetImageConfig *config = [[NetImageConfig alloc] init]; - _avatarImageView = [[NetImageView alloc] initWithConfig:config]; - _avatarImageView.backgroundColor = [UIColor colorWithWhite:0.9 alpha:1.0]; - _avatarImageView.layer.cornerRadius = 20; - _avatarImageView.layer.masksToBounds = YES; - _avatarImageView.contentMode = UIViewContentModeScaleAspectFill; - } - return _avatarImageView; -} - -- (UILabel *)nameLabel { - if (!_nameLabel) { - _nameLabel = [[UILabel alloc] init]; - _nameLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium]; - _nameLabel.textColor = [UIColor whiteColor]; - } - return _nameLabel; -} - -- (UILabel *)timeLabel { - if (!_timeLabel) { - _timeLabel = [[UILabel alloc] init]; - _timeLabel.font = [UIFont systemFontOfSize:12]; - _timeLabel.textColor = [UIColor colorWithWhite:1 alpha:0.6]; - } - return _timeLabel; -} - -- (UILabel *)contentLabel { - if (!_contentLabel) { - _contentLabel = [[UILabel alloc] init]; - _contentLabel.font = [UIFont systemFontOfSize:15]; - _contentLabel.textColor = [UIColor whiteColor]; - _contentLabel.numberOfLines = 0; - _contentLabel.lineBreakMode = NSLineBreakByWordWrapping; - } - return _contentLabel; -} - -- (UIView *)actionBar { - if (!_actionBar) { - _actionBar = [[UIView alloc] init]; - _actionBar.backgroundColor = [UIColor clearColor]; // 半透明白色,与毛玻璃效果搭配 - } - return _actionBar; -} - -- (UIButton *)likeButton { - if (!_likeButton) { - _likeButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_likeButton setImage:[UIImage imageNamed:@"monents_info_like_count_normal"] forState:UIControlStateNormal]; - [_likeButton setImage:[UIImage imageNamed:@"monents_info_like_count_select"] forState:UIControlStateSelected]; - [_likeButton setTitle:@" 0" forState:UIControlStateNormal]; - _likeButton.titleLabel.font = [UIFont systemFontOfSize:13]; - [_likeButton setTitleColor:[UIColor colorWithWhite:1 alpha:0.6] forState:UIControlStateNormal]; - [_likeButton setTitleColor:[UIColor colorWithWhite:1 alpha:1.0] forState:UIControlStateSelected]; - [_likeButton addTarget:self action:@selector(onLikeButtonTapped) forControlEvents:UIControlEventTouchUpInside]; - } - return _likeButton; -} - -// 评论按钮已移除 -- (UIButton *)commentButton { - return nil; -} - -- (UIButton *)createActionButtonWithTitle:(NSString *)title { - UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem]; - [button setTitle:title forState:UIControlStateNormal]; - button.titleLabel.font = [UIFont systemFontOfSize:13]; - [button setTitleColor:[UIColor colorWithWhite:0.5 alpha:1.0] forState:UIControlStateNormal]; - return button; -} - -- (UIView *)imagesContainer { - if (!_imagesContainer) { - _imagesContainer = [[UIView alloc] init]; - _imagesContainer.backgroundColor = [UIColor clearColor]; - } - return _imagesContainer; -} - -- (NSMutableArray *)imageViews { - if (!_imageViews) { - _imageViews = [NSMutableArray array]; - } - return _imageViews; -} - -- (EPMomentAPISwiftHelper *)apiHelper { - if (!_apiHelper) { - _apiHelper = [[EPMomentAPISwiftHelper alloc] init]; - } - return _apiHelper; -} - -@end diff --git a/YuMi/E-P/Moments/Views/EPMomentListView.h.backup b/YuMi/E-P/Moments/Views/EPMomentListView.h.backup deleted file mode 100644 index 5376032..0000000 --- a/YuMi/E-P/Moments/Views/EPMomentListView.h.backup +++ /dev/null @@ -1,46 +0,0 @@ -// -// EPMomentListView.h -// YuMi -// -// Created by AI on 2025-10-10. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@class EPMomentAPISwiftHelper; -@class MomentsInfoModel; - -/// 推荐/我的动态列表数据源类型 -typedef NS_ENUM(NSInteger, EPMomentListSourceType) { - EPMomentListSourceTypeRecommend = 0, - EPMomentListSourceTypeMine = 1 -}; - -/// 承载 Moments 列表与分页刷新的视图 -@interface EPMomentListView : UIView - -/// 当前数据源(外部可读) -@property (nonatomic, strong, readonly) NSArray *rawList; - -/// 列表类型:推荐 / 我的 -@property (nonatomic, assign) EPMomentListSourceType sourceType; - -/// 外部可设置:当某一项被点击 -@property (nonatomic, copy) void (^onSelectMoment)(NSInteger index); - -/// 重新加载(刷新到第一页) -- (void)reloadFirstPage; - -/// 使用本地数组模式显示动态(禁用分页加载) -/// @param dynamicInfo 本地动态数组 -/// @param refreshCallback 下拉刷新回调(由外部重新获取数据) -- (void)loadWithDynamicInfo:(NSArray *)dynamicInfo - refreshCallback:(void(^)(void))refreshCallback; - -@end - -NS_ASSUME_NONNULL_END - - diff --git a/YuMi/E-P/Moments/Views/EPMomentListView.m.backup b/YuMi/E-P/Moments/Views/EPMomentListView.m.backup deleted file mode 100644 index 18ff7e1..0000000 --- a/YuMi/E-P/Moments/Views/EPMomentListView.m.backup +++ /dev/null @@ -1,253 +0,0 @@ -// -// EPMomentListView.m -// YuMi -// -// Created by AI on 2025-10-10. -// - -#import -#import "EPMomentListView.h" -#import "EPMomentCell.h" -#import -#import "YuMi-Swift.h" -#import "EPEmotionColorStorage.h" - - -@interface EPMomentListView () - -@property (nonatomic, strong) UITableView *tableView; -@property (nonatomic, strong) UIRefreshControl *refreshControl; -@property (nonatomic, strong) NSMutableArray *mutableRawList; -@property (nonatomic, strong) EPMomentAPISwiftHelper *api; -@property (nonatomic, assign) BOOL isLoading; -@property (nonatomic, copy) NSString *nextID; -@property (nonatomic, assign) BOOL isLocalMode; -@property (nonatomic, copy) void (^refreshCallback)(void); -@end - -@implementation EPMomentListView - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - self.backgroundColor = [UIColor clearColor]; - _api = [[EPMomentAPISwiftHelper alloc] init]; - _mutableRawList = [NSMutableArray array]; - _sourceType = EPMomentListSourceTypeRecommend; - _isLocalMode = NO; // 明确初始化为网络模式 - - [self addSubview:self.tableView]; - [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(self); - }]; - } - return self; -} - -- (NSArray *)rawList { - return [self.mutableRawList copy]; -} - -- (void)reloadFirstPage { - if (self.isLocalMode) { - // 本地模式:调用外部刷新回调 - if (self.refreshCallback) { - self.refreshCallback(); - } - [self.refreshControl endRefreshing]; - return; - } - - // 网络模式:重新请求第一页 - self.nextID = @""; - [self.mutableRawList removeAllObjects]; - [self.tableView reloadData]; - [self.tableView.mj_footer resetNoMoreData]; - [self requestNextPage]; -} - -- (void)loadWithDynamicInfo:(NSArray *)dynamicInfo - refreshCallback:(void (^)(void))refreshCallback { - self.isLocalMode = YES; - self.refreshCallback = refreshCallback; - - [self.mutableRawList removeAllObjects]; - if (dynamicInfo.count > 0) { - [self.mutableRawList addObjectsFromArray:dynamicInfo]; - } - - // 隐藏加载更多 footer - self.tableView.mj_footer.hidden = YES; - - [self.tableView reloadData]; - [self.refreshControl endRefreshing]; -} - -- (void)requestNextPage { - if (self.isLoading) return; - self.isLoading = YES; - - @kWeakify(self); - [self.api fetchLatestMomentsWithNextID:self.nextID - completion:^(NSArray * _Nonnull list, NSString * _Nonnull nextMomentID) { - @kStrongify(self); - [self endLoading]; - if (list.count > 0) { - // 处理情绪颜色 - [self processEmotionColors:list isFirstPage:(self.nextID.length == 0)]; - - self.nextID = nextMomentID; - [self.mutableRawList addObjectsFromArray:list]; - [self.tableView reloadData]; - if (nextMomentID.length > 0) { - [self.tableView.mj_footer endRefreshing]; - } else { - [self.tableView.mj_footer endRefreshingWithNoMoreData]; - } - } else { - // 返回空数据:显示 "no more data" 状态 - [self.tableView.mj_footer endRefreshingWithNoMoreData]; - } - } failure:^(NSInteger code, NSString * _Nonnull msg) { - @kStrongify(self); - [self endLoading]; - // TODO: 完全没有数据情况下,后续补充数据异常页面 - [self.tableView.mj_footer endRefreshing]; - }]; -} - -- (void)endLoading { - self.isLoading = NO; - [self.refreshControl endRefreshing]; -} - -/// 处理动态的情绪颜色(从 UserDefaults 匹配 + 处理临时颜色) -- (void)processEmotionColors:(NSArray *)list isFirstPage:(BOOL)isFirstPage { - // 检查是否有待处理的临时情绪颜色 - NSString *pendingColor = [[NSUserDefaults standardUserDefaults] stringForKey:@"EP_Pending_Emotion_Color"]; - NSNumber *pendingTimestamp = [[NSUserDefaults standardUserDefaults] objectForKey:@"EP_Pending_Emotion_Timestamp"]; - - for (NSInteger i = 0; i < list.count; i++) { - MomentsInfoModel *model = list[i]; - - // 优先检查临时颜色(仅第一页第一条) - if (isFirstPage && i == 0 && pendingColor && pendingTimestamp) { - // 检查时间戳(5秒内有效,避免误匹配) - NSTimeInterval now = [[NSDate date] timeIntervalSince1970]; - NSTimeInterval pending = pendingTimestamp.doubleValue; - if ((now - pending) < 5.0) { - model.emotionColor = pendingColor; - // 保存到持久化存储 - [EPEmotionColorStorage saveColor:pendingColor forDynamicId:model.dynamicId]; - // 清除临时数据 - [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"EP_Pending_Emotion_Color"]; - [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"EP_Pending_Emotion_Timestamp"]; - [[NSUserDefaults standardUserDefaults] synchronize]; - continue; - } - } - - // 从持久化存储中匹配 - NSString *savedColor = [EPEmotionColorStorage colorForDynamicId:model.dynamicId]; - if (savedColor) { - model.emotionColor = savedColor; - } else { - // 无保存颜色,生成随机颜色并立即持久化 - NSString *randomColor = [EPEmotionColorStorage randomEmotionColor]; - model.emotionColor = randomColor; - [EPEmotionColorStorage saveColor:randomColor forDynamicId:model.dynamicId]; - NSLog(@"[EPMomentListView] 为动态 %@ 分配随机颜色: %@", model.dynamicId, randomColor); - } - } -} - -#pragma mark - UITableView - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return self.mutableRawList.count; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - EPMomentCell *cell = [tableView dequeueReusableCellWithIdentifier:@"NewMomentCell" forIndexPath:indexPath]; - if (indexPath.row < self.mutableRawList.count) { - MomentsInfoModel *model = [self.mutableRawList xpSafeObjectAtIndex:indexPath.row]; - [cell configureWithModel:model]; - } - return cell; -} - -- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - return UITableViewAutomaticDimension; -} - -- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath { - return 200; -} - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - [tableView deselectRowAtIndexPath:indexPath animated:YES]; - if (self.onSelectMoment) self.onSelectMoment(indexPath.row); -} - -- (void)scrollViewDidScroll:(UIScrollView *)scrollView { - // 本地模式下不触发加载更多 - if (self.isLocalMode) return; - - CGFloat offsetY = scrollView.contentOffset.y; - CGFloat contentHeight = scrollView.contentSize.height; - CGFloat screenHeight = scrollView.frame.size.height; - if (offsetY > contentHeight - screenHeight - 100 && !self.isLoading) { - [self requestNextPage]; - } -} - -#pragma mark - Lazy - -- (UITableView *)tableView { - if (!_tableView) { - _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; - _tableView.delegate = self; - _tableView.dataSource = self; - _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; - _tableView.backgroundColor = [UIColor clearColor]; - _tableView.estimatedRowHeight = 200; - _tableView.rowHeight = UITableViewAutomaticDimension; - _tableView.showsVerticalScrollIndicator = NO; - // 底部留出更高空间,避免被悬浮 TabBar 遮挡 - _tableView.contentInset = UIEdgeInsetsMake(10, 0, 120, 0); - _tableView.scrollIndicatorInsets = UIEdgeInsetsMake(10, 0, 120, 0); - [_tableView registerClass:[EPMomentCell class] forCellReuseIdentifier:@"NewMomentCell"]; - _tableView.refreshControl = self.refreshControl; - - // MJRefresh Footer - 加载更多 - __weak typeof(self) weakSelf = self; - MJRefreshAutoNormalFooter *footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{ - __strong typeof(weakSelf) self = weakSelf; - if (!self.isLoading && self.nextID.length > 0) { - [self requestNextPage]; - } else if (self.nextID.length == 0) { - [self.tableView.mj_footer endRefreshingWithNoMoreData]; - } else { - [self.tableView.mj_footer endRefreshing]; - } - }]; - // 设置白色文字和指示器 - footer.stateLabel.textColor = [UIColor whiteColor]; - footer.loadingView.color = [UIColor whiteColor]; - _tableView.mj_footer = footer; - } - return _tableView; -} - -- (UIRefreshControl *)refreshControl { - if (!_refreshControl) { - _refreshControl = [[UIRefreshControl alloc] init]; - _refreshControl.tintColor = [UIColor whiteColor]; // 白色加载指示器 - [_refreshControl addTarget:self action:@selector(reloadFirstPage) forControlEvents:UIControlEventValueChanged]; - } - return _refreshControl; -} - -@end - - diff --git a/YuMi/E-P/Moments/Views/EPSignatureColorGuideView.h.backup b/YuMi/E-P/Moments/Views/EPSignatureColorGuideView.h.backup deleted file mode 100644 index 220b391..0000000 --- a/YuMi/E-P/Moments/Views/EPSignatureColorGuideView.h.backup +++ /dev/null @@ -1,36 +0,0 @@ -// -// EPSignatureColorGuideView.h -// YuMi -// -// Created by AI on 2025-10-15. -// 用户专属情绪颜色首次引导页 -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface EPSignatureColorGuideView : UIView - -/// 颜色确认回调 -@property (nonatomic, copy) void(^onColorConfirmed)(NSString *hexColor); - -/// Skip 按钮点击回调(仅 debug 模式且已有颜色时显示) -@property (nonatomic, copy) void(^onSkipTapped)(void); - -/// 在 window 中显示引导页(全屏模态) -/// @param window 应用主 window -- (void)showInWindow:(UIWindow *)window; - -/// 在 window 中显示引导页(带 Skip 按钮) -/// @param window 应用主 window -/// @param showSkip 是否显示 Skip 按钮(用于 debug 模式) -- (void)showInWindow:(UIWindow *)window showSkipButton:(BOOL)showSkip; - -/// 关闭引导页 -- (void)dismiss; - -@end - -NS_ASSUME_NONNULL_END - diff --git a/YuMi/E-P/Moments/Views/EPSignatureColorGuideView.m.backup b/YuMi/E-P/Moments/Views/EPSignatureColorGuideView.m.backup deleted file mode 100644 index 9785107..0000000 --- a/YuMi/E-P/Moments/Views/EPSignatureColorGuideView.m.backup +++ /dev/null @@ -1,372 +0,0 @@ -// -// EPSignatureColorGuideView.m -// YuMi -// -// Created by AI on 2025-10-15. -// - -#import "EPSignatureColorGuideView.h" -#import "EPEmotionColorWheelView.h" -#import "EPEmotionInfoView.h" -#import - -@interface EPSignatureColorGuideView () - -@property (nonatomic, strong) CAGradientLayer *gradientLayer; -@property (nonatomic, strong) UIView *contentContainer; -@property (nonatomic, strong) UILabel *titleLabel; -@property (nonatomic, strong) UILabel *subtitleLabel; -@property (nonatomic, strong) UIButton *infoButton; -@property (nonatomic, strong) UIView *selectedColorView; -@property (nonatomic, strong) UILabel *selectedColorLabel; -@property (nonatomic, strong) EPEmotionColorWheelView *colorWheelView; -@property (nonatomic, strong) UIButton *confirmButton; -@property (nonatomic, strong) UIButton *skipButton; -@property (nonatomic, copy) NSString *selectedColor; // 当前选中的颜色 - -@end - -@implementation EPSignatureColorGuideView - -#pragma mark - Lifecycle - -- (instancetype)initWithFrame:(CGRect)frame { - if (self = [super initWithFrame:frame]) { - [self setupUI]; - } - return self; -} - -- (void)setupUI { - // 渐变背景 - CAGradientLayer *gradientLayer = [CAGradientLayer layer]; - gradientLayer.colors = @[ - (id)[UIColor colorWithRed:0x1a/255.0 green:0x09/255.0 blue:0x33/255.0 alpha:1.0].CGColor, - (id)[UIColor colorWithRed:0x0d/255.0 green:0x1b/255.0 blue:0x2a/255.0 alpha:1.0].CGColor - ]; - gradientLayer.startPoint = CGPointMake(0.5, 0); - gradientLayer.endPoint = CGPointMake(0.5, 1); - [self.layer insertSublayer:gradientLayer atIndex:0]; - self.gradientLayer = gradientLayer; - - // 内容容器 - [self addSubview:self.contentContainer]; - [self.contentContainer mas_makeConstraints:^(MASConstraintMaker *make) { - make.center.equalTo(self); - make.leading.trailing.equalTo(self).inset(30); - }]; - - // 标题 - [self.contentContainer addSubview:self.titleLabel]; - [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.contentContainer); - make.centerX.equalTo(self.contentContainer); - }]; - - // 副标题 - [self.contentContainer addSubview:self.subtitleLabel]; - [self.subtitleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.titleLabel.mas_bottom).offset(12); - make.centerX.equalTo(self.contentContainer); - make.leading.trailing.equalTo(self.contentContainer).inset(20); - }]; - - // Info 按钮(左上角,与 Skip 按钮对齐) - [self addSubview:self.infoButton]; - [self.infoButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.equalTo(self).offset(20); - make.top.equalTo(self).offset(60); - make.size.mas_equalTo(CGSizeMake(36, 36)); - }]; - - // 选中状态显示区域 - [self.contentContainer addSubview:self.selectedColorView]; - [self.selectedColorView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.subtitleLabel.mas_bottom).offset(30); - make.centerX.equalTo(self.contentContainer); - make.height.mas_equalTo(60); - make.leading.trailing.equalTo(self.contentContainer).inset(40); - }]; - - // 色轮视图(使用共享组件) - [self.contentContainer addSubview:self.colorWheelView]; - [self.colorWheelView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.selectedColorView.mas_bottom).offset(30); - make.centerX.equalTo(self.contentContainer); - make.size.mas_equalTo(CGSizeMake(360, 360)); // 从280x280增加到360x360 - }]; - - // 确认按钮 - [self.contentContainer addSubview:self.confirmButton]; - [self.confirmButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.colorWheelView.mas_bottom).offset(50); - make.leading.trailing.equalTo(self.contentContainer).inset(20); - make.height.mas_equalTo(56); - make.bottom.equalTo(self.contentContainer); - }]; - - // Skip 按钮(右上角,初始隐藏) - [self addSubview:self.skipButton]; - [self.skipButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self).offset(60); - make.trailing.equalTo(self).offset(-20); - make.size.mas_equalTo(CGSizeMake(60, 36)); - }]; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - // 更新渐变层 frame - self.gradientLayer.frame = self.bounds; -} - -#pragma mark - Actions - -- (void)onConfirmButtonTapped { - if (!self.selectedColor) return; - - // 执行回调 - if (self.onColorConfirmed) { - self.onColorConfirmed(self.selectedColor); - } - - // 关闭引导页 - [self dismiss]; -} - -- (void)onSkipButtonTapped { - // 执行 skip 回调 - if (self.onSkipTapped) { - self.onSkipTapped(); - } - - // 关闭引导页 - [self dismiss]; -} - -- (void)onInfoButtonTapped { - EPEmotionInfoView *infoView = [[EPEmotionInfoView alloc] init]; - [infoView showInView:self]; -} - -#pragma mark - Public Methods - -- (void)showInWindow:(UIWindow *)window { - [self showInWindow:window showSkipButton:NO]; -} - -- (void)showInWindow:(UIWindow *)window showSkipButton:(BOOL)showSkip { - [window addSubview:self]; - [self mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(window); - }]; - - // 控制 Skip 按钮显示 - self.skipButton.hidden = !showSkip; - - // 初始状态 - self.alpha = 0; - self.contentContainer.transform = CGAffineTransformMakeScale(0.8, 0.8); - - // 显示动画 - [UIView animateWithDuration:0.4 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ - self.alpha = 1.0; - self.contentContainer.transform = CGAffineTransformIdentity; - } completion:nil]; -} - -- (void)dismiss { - [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^{ - self.alpha = 0; - self.contentContainer.transform = CGAffineTransformMakeScale(0.95, 0.95); - } completion:^(BOOL finished) { - [self removeFromSuperview]; - }]; -} - -#pragma mark - Lazy Loading - -- (UIView *)contentContainer { - if (!_contentContainer) { - _contentContainer = [[UIView alloc] init]; - _contentContainer.backgroundColor = [UIColor clearColor]; - } - return _contentContainer; -} - -- (UILabel *)titleLabel { - if (!_titleLabel) { - _titleLabel = [[UILabel alloc] init]; - _titleLabel.text = @"Choose your signature emotion"; - _titleLabel.textColor = [UIColor whiteColor]; - _titleLabel.font = [UIFont systemFontOfSize:24 weight:UIFontWeightBold]; - _titleLabel.textAlignment = NSTextAlignmentCenter; - } - return _titleLabel; -} - -- (UILabel *)subtitleLabel { - if (!_subtitleLabel) { - _subtitleLabel = [[UILabel alloc] init]; - _subtitleLabel.text = @"This color represents your emotional identity"; - _subtitleLabel.textColor = [[UIColor whiteColor] colorWithAlphaComponent:0.7]; - _subtitleLabel.font = [UIFont systemFontOfSize:14]; - _subtitleLabel.textAlignment = NSTextAlignmentCenter; - _subtitleLabel.numberOfLines = 0; - } - return _subtitleLabel; -} - -- (UIView *)selectedColorView { - if (!_selectedColorView) { - _selectedColorView = [[UIView alloc] init]; - _selectedColorView.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.15]; - _selectedColorView.layer.cornerRadius = 30; - _selectedColorView.layer.masksToBounds = YES; - _selectedColorView.hidden = YES; // 初始隐藏 - - // 颜色圆点 - UIView *colorDot = [[UIView alloc] init]; - colorDot.tag = 100; // 用于后续查找 - colorDot.layer.cornerRadius = 16; - colorDot.layer.masksToBounds = YES; - [_selectedColorView addSubview:colorDot]; - [colorDot mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.equalTo(_selectedColorView).offset(20); - make.centerY.equalTo(_selectedColorView); - make.size.mas_equalTo(CGSizeMake(32, 32)); - }]; - - // 情绪名称标签 - [_selectedColorView addSubview:self.selectedColorLabel]; - [self.selectedColorLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.equalTo(colorDot.mas_trailing).offset(16); - make.centerY.equalTo(_selectedColorView); - make.trailing.equalTo(_selectedColorView).offset(-20); - }]; - } - return _selectedColorView; -} - -- (UILabel *)selectedColorLabel { - if (!_selectedColorLabel) { - _selectedColorLabel = [[UILabel alloc] init]; - _selectedColorLabel.textColor = [UIColor whiteColor]; - _selectedColorLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium]; - _selectedColorLabel.text = @"Select your signature emotion"; - } - return _selectedColorLabel; -} - -- (EPEmotionColorWheelView *)colorWheelView { - if (!_colorWheelView) { - _colorWheelView = [[EPEmotionColorWheelView alloc] init]; - _colorWheelView.radius = 100.0; - _colorWheelView.buttonSize = 54.0; - - __weak typeof(self) weakSelf = self; - _colorWheelView.onColorTapped = ^(NSString *hexColor, NSInteger index) { - __strong typeof(weakSelf) self = weakSelf; - - // 保存选中的颜色 - self.selectedColor = hexColor; - - // 更新选中状态显示 - [self updateSelectedColorDisplay:hexColor index:index]; - - // 启用确认按钮 - self.confirmButton.enabled = YES; - self.confirmButton.alpha = 1.0; - }; - } - return _colorWheelView; -} - -/// 更新选中颜色显示 -- (void)updateSelectedColorDisplay:(NSString *)hexColor index:(NSInteger)index { - NSArray *emotions = @[@"Joy", @"Sadness", @"Anger", @"Fear", @"Surprise", @"Disgust", @"Trust", @"Anticipation"]; - - // 显示选中状态区域 - self.selectedColorView.hidden = NO; - - // 更新颜色圆点 - UIView *colorDot = [self.selectedColorView viewWithTag:100]; - colorDot.backgroundColor = [self colorFromHex:hexColor]; - - // 更新情绪名称 - self.selectedColorLabel.text = emotions[index]; -} - -/// Hex 转 UIColor -- (UIColor *)colorFromHex:(NSString *)hexString { - unsigned rgbValue = 0; - NSScanner *scanner = [NSScanner scannerWithString:hexString]; - [scanner setScanLocation:1]; // 跳过 # - [scanner scanHexInt:&rgbValue]; - return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16)/255.0 - green:((rgbValue & 0xFF00) >> 8)/255.0 - blue:(rgbValue & 0xFF)/255.0 - alpha:1.0]; -} - -- (UIButton *)confirmButton { - if (!_confirmButton) { - _confirmButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_confirmButton setTitle:@"Confirm & Continue" forState:UIControlStateNormal]; - [_confirmButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - _confirmButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold]; - _confirmButton.layer.cornerRadius = 28; - _confirmButton.layer.masksToBounds = YES; - - // 渐变背景 - CAGradientLayer *gradient = [CAGradientLayer layer]; - gradient.colors = @[ - (id)[UIColor colorWithRed:0x9B/255.0 green:0x59/255.0 blue:0xB6/255.0 alpha:1.0].CGColor, - (id)[UIColor colorWithRed:0x6C/255.0 green:0x34/255.0 blue:0x83/255.0 alpha:1.0].CGColor - ]; - gradient.startPoint = CGPointMake(0, 0); - gradient.endPoint = CGPointMake(1, 0); - gradient.frame = CGRectMake(0, 0, 1000, 56); // 宽度设大一点 - [_confirmButton.layer insertSublayer:gradient atIndex:0]; - - [_confirmButton addTarget:self action:@selector(onConfirmButtonTapped) forControlEvents:UIControlEventTouchUpInside]; - - // 初始禁用状态 - _confirmButton.enabled = NO; - _confirmButton.alpha = 0.5; - } - return _confirmButton; -} - -- (UIButton *)infoButton { - if (!_infoButton) { - _infoButton = [UIButton buttonWithType:UIButtonTypeCustom]; - - // 使用系统 info.circle 图标 - UIImage *infoIcon = [UIImage systemImageNamed:@"info.circle"]; - [_infoButton setImage:infoIcon forState:UIControlStateNormal]; - _infoButton.tintColor = [[UIColor whiteColor] colorWithAlphaComponent:0.8]; - - // 点击效果 - [_infoButton addTarget:self action:@selector(onInfoButtonTapped) forControlEvents:UIControlEventTouchUpInside]; - } - return _infoButton; -} - -- (UIButton *)skipButton { - if (!_skipButton) { - _skipButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_skipButton setTitle:@"Skip" forState:UIControlStateNormal]; - [_skipButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - _skipButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium]; - _skipButton.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.2]; - _skipButton.layer.cornerRadius = 18; - _skipButton.layer.masksToBounds = YES; - [_skipButton addTarget:self action:@selector(onSkipButtonTapped) forControlEvents:UIControlEventTouchUpInside]; - _skipButton.hidden = YES; // 默认隐藏 - } - return _skipButton; -} - -@end - diff --git a/YuMi/E-P/TabBar/EPTabBarController.swift.backup b/YuMi/E-P/TabBar/EPTabBarController.swift.backup deleted file mode 100644 index 496c57b..0000000 --- a/YuMi/E-P/TabBar/EPTabBarController.swift.backup +++ /dev/null @@ -1,534 +0,0 @@ -// -// EPTabBarController.swift -// YuMi -// -// Created by AI on 2025-10-09. -// Copyright © 2025 YuMi. All rights reserved. -// - -import UIKit -import SnapKit - -/// EP 系列 TabBar 控制器 -/// 悬浮设计 + 液态玻璃效果,只包含 Moment 和 Mine 两个 Tab -@objc class EPTabBarController: UITabBarController { - - // MARK: - Properties - - /// 是否已登录 - private var isLoggedIn: Bool = false - - /// 自定义悬浮 TabBar 容器 - private var customTabBarView: UIView! - - /// 毛玻璃背景视图 - private var tabBarBackgroundView: UIVisualEffectView! - - /// Tab 按钮数组 - private var tabButtons: [UIButton] = [] - - // MARK: - Lifecycle - - override func viewDidLoad() { - super.viewDidLoad() - - // 测试域名配置 - #if DEBUG - APIConfig.testEncryption() - #endif - - // 隐藏原生 TabBar - self.tabBar.isHidden = true - - // 设置 delegate 以完全控制切换行为 - self.delegate = self - - // ✅ 启动时验证 ticket(与 OC 版本保持一致) - performAutoLogin() - - setupCustomFloatingTabBar() - setupInitialViewControllers() - - NSLog("[EPTabBarController] 悬浮 TabBar 初始化完成") - } - - deinit { - NSLog("[EPTabBarController] 已释放") - } - - // MARK: - Setup - - /// 设置自定义悬浮 TabBar - private func setupCustomFloatingTabBar() { - // 创建悬浮容器 - customTabBarView = UIView() - customTabBarView.translatesAutoresizingMaskIntoConstraints = false - customTabBarView.backgroundColor = .clear - view.addSubview(customTabBarView) - - // 液态玻璃/毛玻璃效果 - let effect: UIVisualEffect - if #available(iOS 26.0, *) { - // iOS 26+ 使用液态玻璃(Material) - effect = UIGlassEffect() - } else { - // iOS 13-17 使用毛玻璃 - effect = UIBlurEffect(style: .systemMaterial) - } - - tabBarBackgroundView = UIVisualEffectView(effect: effect) - tabBarBackgroundView.translatesAutoresizingMaskIntoConstraints = false - tabBarBackgroundView.layer.cornerRadius = 28 - tabBarBackgroundView.layer.masksToBounds = true - - // 添加边框 - tabBarBackgroundView.layer.borderWidth = 0.5 - tabBarBackgroundView.layer.borderColor = UIColor.white.withAlphaComponent(0.2).cgColor - - customTabBarView.addSubview(tabBarBackgroundView) - - // 简化的布局约束(类似 Masonry 风格) - customTabBarView.snp.makeConstraints { make in - make.leading.equalTo(view).offset(16) - make.trailing.equalTo(view).offset(-16) - make.bottom.equalTo(view.safeAreaLayoutGuide).offset(-12) - make.height.equalTo(64) - } - - tabBarBackgroundView.snp.makeConstraints { make in - make.edges.equalTo(customTabBarView) - } - - // 添加 Tab 按钮 - setupTabButtons() - - NSLog("[EPTabBarController] 悬浮 TabBar 设置完成") - } - - /// 设置 Tab 按钮 - private func setupTabButtons() { - let momentButton = createTabButton( - normalImage: "tab_moment_off", - selectedImage: "tab_moment_on", - tag: 0 - ) - - let mineButton = createTabButton( - normalImage: "tab_mine_off", - selectedImage: "tab_mine_on", - tag: 1 - ) - - tabButtons = [momentButton, mineButton] - - let stackView = UIStackView(arrangedSubviews: tabButtons) - stackView.axis = .horizontal - stackView.distribution = .fillEqually - stackView.spacing = 20 - stackView.translatesAutoresizingMaskIntoConstraints = false - tabBarBackgroundView.contentView.addSubview(stackView) - - stackView.snp.makeConstraints { make in - make.top.equalTo(tabBarBackgroundView).offset(8) - make.leading.equalTo(tabBarBackgroundView).offset(20) - make.trailing.equalTo(tabBarBackgroundView).offset(-20) - make.bottom.equalTo(tabBarBackgroundView).offset(-8) - } - - // 默认选中第一个 - updateTabButtonStates(selectedIndex: 0) - } - - /// 创建 Tab 按钮 - private func createTabButton(normalImage: String, selectedImage: String, tag: Int) -> UIButton { - let button = UIButton(type: .custom) - button.tag = tag - button.adjustsImageWhenHighlighted = false // 禁用高亮效果,避免闪烁 - - // 尝试设置自定义图片,如果不存在则使用 SF Symbols - if let normalImg = UIImage(named: normalImage), let selectedImg = UIImage(named: selectedImage) { - // 正确设置:分别为 normal 和 selected 状态设置图片 - button.setImage(normalImg, for: .normal) - button.setImage(selectedImg, for: .selected) - } else { - // 使用 SF Symbols 作为备用 - let fallbackIcons = ["sparkles", "person.circle"] - let iconName = fallbackIcons[tag] - let imageConfig = UIImage.SymbolConfiguration(pointSize: 24, weight: .medium) - let normalIcon = UIImage(systemName: iconName, withConfiguration: imageConfig) - - button.setImage(normalIcon, for: .normal) - button.setImage(normalIcon, for: .selected) - button.tintColor = .white.withAlphaComponent(0.6) - } - - // 图片渲染模式 - button.imageView?.contentMode = .scaleAspectFit - - // 移除标题 - button.setTitle(nil, for: .normal) - button.setTitle(nil, for: .selected) - - // 设置图片大小约束 - button.imageView?.snp.makeConstraints { make in - make.size.equalTo(28) - } - - button.addTarget(self, action: #selector(tabButtonTapped(_:)), for: .touchUpInside) - return button - } - - /// Tab 按钮点击事件 - @objc private func tabButtonTapped(_ sender: UIButton) { - let newIndex = sender.tag - - // 如果点击的是当前已选中的 tab,不做任何操作 - if newIndex == selectedIndex { - return - } - - // 先更新按钮状态 - updateTabButtonStates(selectedIndex: newIndex) - - // 禁用 UITabBarController 的默认切换动画,避免闪烁 - UIView.performWithoutAnimation { - selectedIndex = newIndex - } - - let tabNames = [YMLocalizedString("tab.moment"), YMLocalizedString("tab.mine")] - NSLog("[EPTabBarController] 选中 Tab: \(tabNames[newIndex])") - } - - /// 更新 Tab 按钮状态 - private func updateTabButtonStates(selectedIndex: Int) { - // 禁用按钮交互,避免快速点击 - tabButtons.forEach { $0.isUserInteractionEnabled = false } - - for (index, button) in tabButtons.enumerated() { - let isSelected = (index == selectedIndex) - - // 直接设置 isSelected 属性即可,图片会自动切换 - button.isSelected = isSelected - - // SF Symbols 的情况需要手动更新 tintColor - if button.currentImage?.isSymbolImage == true { - button.tintColor = isSelected ? .white : .white.withAlphaComponent(0.6) - } - - // 选中状态缩放动画 - UIView.animate(withDuration: 0.2, delay: 0, options: [.curveEaseOut], animations: { - button.transform = isSelected ? CGAffineTransform(scaleX: 1.1, y: 1.1) : .identity - }) - } - - // 延迟恢复按钮交互 - DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) { - self.tabButtons.forEach { $0.isUserInteractionEnabled = true } - } - } - - /// 设置初始 ViewController(未登录状态) - private func setupInitialViewControllers() { - // TODO: 暂时使用空白页面占位 - let blankVC1 = UIViewController() - blankVC1.view.backgroundColor = .white - blankVC1.tabBarItem = createTabBarItem( - title: YMLocalizedString("tab.moment"), - normalImage: "tab_moment_normal", - selectedImage: "tab_moment_selected" - ) - - let blankVC2 = UIViewController() - blankVC2.view.backgroundColor = .white - blankVC2.tabBarItem = createTabBarItem( - title: YMLocalizedString("tab.mine"), - normalImage: "tab_mine_normal", - selectedImage: "tab_mine_selected" - ) - - viewControllers = [blankVC1, blankVC2] - selectedIndex = 0 - - NSLog("[EPTabBarController] 初始 ViewControllers 设置完成") - } - - /// 创建 TabBarItem - /// - Parameters: - /// - title: 标题 - /// - normalImage: 未选中图标名称 - /// - selectedImage: 选中图标名称 - /// - Returns: UITabBarItem - private func createTabBarItem(title: String, normalImage: String, selectedImage: String) -> UITabBarItem { - let item = UITabBarItem( - title: title, - image: UIImage(named: normalImage)?.withRenderingMode(.alwaysOriginal), - selectedImage: UIImage(named: selectedImage)?.withRenderingMode(.alwaysOriginal) - ) - return item - } - - // MARK: - Public Methods - - /// 登录成功后刷新 TabBar - /// - Parameter isLogin: 是否已登录 - func refreshTabBar(isLogin: Bool) { - isLoggedIn = isLogin - - if isLogin { - setupLoggedInViewControllers() - } else { - setupInitialViewControllers() - } - - NSLog("[EPTabBarController] TabBar 已刷新,登录状态: \(isLogin)") - } - - /// 设置登录后的 ViewControllers - private func setupLoggedInViewControllers() { - // 只在 viewControllers 为空或不是正确类型时才创建 - if viewControllers?.count != 2 || - !(viewControllers?[0] is UINavigationController) || - !(viewControllers?[1] is UINavigationController) { - - // 创建动态页 - let momentVC = EPMomentViewController() - momentVC.title = YMLocalizedString("tab.moment") - let momentNav = createTransparentNavigationController( - rootViewController: momentVC, - tabTitle: YMLocalizedString("tab.moment"), - normalImage: "tab_moment_normal", - selectedImage: "tab_moment_selected" - ) - - // 创建我的页 - let mineVC = EPMineViewController() - mineVC.title = YMLocalizedString("tab.mine") - let mineNav = createTransparentNavigationController( - rootViewController: mineVC, - tabTitle: YMLocalizedString("tab.mine"), - normalImage: "tab_mine_normal", - selectedImage: "tab_mine_selected" - ) - - viewControllers = [momentNav, mineNav] - NSLog("[EPTabBarController] 登录后 ViewControllers 创建完成 - Moment & Mine") - } - - selectedIndex = 0 - } - - /// 创建透明导航控制器(统一配置) - /// - Parameters: - /// - rootViewController: 根视图控制器 - /// - tabTitle: TabBar 标题 - /// - normalImage: 未选中图标 - /// - selectedImage: 选中图标 - /// - Returns: 配置好的 UINavigationController - private func createTransparentNavigationController( - rootViewController: UIViewController, - tabTitle: String, - normalImage: String, - selectedImage: String - ) -> UINavigationController { - let nav = UINavigationController(rootViewController: rootViewController) - nav.navigationBar.isTranslucent = true - nav.navigationBar.setBackgroundImage(UIImage(), for: .default) - nav.navigationBar.shadowImage = UIImage() - nav.view.backgroundColor = .clear - nav.tabBarItem = createTabBarItem( - title: tabTitle, - normalImage: normalImage, - selectedImage: selectedImage - ) - - // 设置 delegate 以监听页面切换 - nav.delegate = self - - return nav - } - - // MARK: - TabBar Visibility Control - - /// 显示悬浮 TabBar - private func showCustomTabBar(animated: Bool = true) { - guard customTabBarView.isHidden else { return } - - if animated { - customTabBarView.isHidden = false - customTabBarView.alpha = 0 - customTabBarView.transform = CGAffineTransform(translationX: 0, y: 20) - - UIView.animate(withDuration: 0.25, delay: 0, options: .curveEaseOut) { - self.customTabBarView.alpha = 1 - self.customTabBarView.transform = .identity - } - } else { - customTabBarView.isHidden = false - customTabBarView.alpha = 1 - } - } - - /// 隐藏悬浮 TabBar - private func hideCustomTabBar(animated: Bool = true) { - guard !customTabBarView.isHidden else { return } - - if animated { - UIView.animate(withDuration: 0.25, delay: 0, options: .curveEaseIn, animations: { - self.customTabBarView.alpha = 0 - self.customTabBarView.transform = CGAffineTransform(translationX: 0, y: 20) - }) { _ in - self.customTabBarView.isHidden = true - self.customTabBarView.transform = .identity - } - } else { - customTabBarView.isHidden = true - customTabBarView.alpha = 0 - } - } -} - -// MARK: - UITabBarControllerDelegate - -extension EPTabBarController: UITabBarControllerDelegate { - - override func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) { - NSLog("[EPTabBarController] 选中 Tab: \(item.title ?? "Unknown")") - } - - /// 禁用系统默认的切换动画 - func tabBarController(_ tabBarController: UITabBarController, - animationControllerForTransitionFrom fromVC: UIViewController, - to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? { - // 返回 nil 表示不使用动画 - return nil - } - - /// 完全控制是否允许切换 - func tabBarController(_ tabBarController: UITabBarController, - shouldSelect viewController: UIViewController) -> Bool { - // 允许切换,但通过返回 nil 的 animationController 来禁用动画 - return true - } -} - -// MARK: - UINavigationControllerDelegate - -extension EPTabBarController: UINavigationControllerDelegate { - - func navigationController(_ navigationController: UINavigationController, - willShow viewController: UIViewController, - animated: Bool) { - - // 判断是否是根页面(一级页面) - let isRootViewController = navigationController.viewControllers.count == 1 - - if isRootViewController { - // 一级页面:显示 TabBar - showCustomTabBar(animated: animated) - NSLog("[EPTabBarController] 显示 TabBar - 根页面") - } else { - // 二级及以上页面:隐藏 TabBar - hideCustomTabBar(animated: animated) - NSLog("[EPTabBarController] 隐藏 TabBar - 子页面 (层级: \(navigationController.viewControllers.count))") - } - } -} - -// MARK: - Auto Login & Ticket Validation - -extension EPTabBarController { - - /// 自动登录:验证 ticket 有效性(与 OC MainPresenter.autoLogin 保持一致) - private func performAutoLogin() { - // 1. 检查账号信息 - guard let accountModel = AccountInfoStorage.instance().getCurrentAccountInfo() else { - NSLog("[EPTabBarController] ⚠️ 账号信息不存在,跳转到登录页") - handleTokenInvalid() - return - } - - // 2. 检查 uid 和 access_token - let uid = accountModel.uid - let accessToken = accountModel.access_token - - guard !uid.isEmpty, !accessToken.isEmpty else { - NSLog("[EPTabBarController] ⚠️ uid 或 access_token 为空,跳转到登录页") - handleTokenInvalid() - return - } - - // 3. 检查 ticket 是否已存在(内存缓存) - let existingTicket = AccountInfoStorage.instance().getTicket() ?? "" - if !existingTicket.isEmpty { - NSLog("[EPTabBarController] ✅ Ticket 已存在,自动登录成功") - return - } - - // 4. Ticket 不存在,请求新的 ticket - NSLog("[EPTabBarController] 🔄 Ticket 不存在,正在请求...") - let loginService = EPLoginService() - - loginService.requestTicket(accessToken: accessToken) { ticket in - NSLog("[EPTabBarController] ✅ Ticket 请求成功: \(ticket)") - AccountInfoStorage.instance().saveTicket(ticket) - } failure: { [weak self] code, msg in - NSLog("[EPTabBarController] ❌ Ticket 请求失败 (\(code)): \(msg)") - - // ⚠️ Ticket 失败,强制退出登录(与 OC MainPresenter 保持一致) - DispatchQueue.main.async { - self?.handleTokenInvalid() - } - } - } - - /// 处理 Token 失效:清空数据并跳转到登录页 - private func handleTokenInvalid() { - NSLog("[EPTabBarController] ⚠️ Token 失效,清空账号数据...") - - // 1. 清空账号信息 - AccountInfoStorage.instance().saveAccountInfo(nil) - AccountInfoStorage.instance().saveTicket("") - - // 2. 跳转到登录页 - DispatchQueue.main.async { - let loginVC = EPLoginViewController() - let nav = BaseNavigationController(rootViewController: loginVC) - nav.modalPresentationStyle = .fullScreen - - // 获取 keyWindow(iOS 13+ 兼容) - if #available(iOS 13.0, *) { - for scene in UIApplication.shared.connectedScenes { - if let windowScene = scene as? UIWindowScene, - windowScene.activationState == .foregroundActive, - let window = windowScene.windows.first(where: { $0.isKeyWindow }) { - window.rootViewController = nav - window.makeKeyAndVisible() - break - } - } - } else { - if let window = UIApplication.shared.keyWindow { - window.rootViewController = nav - window.makeKeyAndVisible() - } - } - - NSLog("[EPTabBarController] ✅ 已跳转到登录页") - } - } -} - -// MARK: - OC Compatibility - -extension EPTabBarController { - - /// OC 兼容:创建实例的工厂方法 - @objc static func create() -> EPTabBarController { - return EPTabBarController() - } - - /// OC 兼容:刷新 TabBar 方法 - @objc func refreshTabBarWithIsLogin(_ isLogin: Bool) { - refreshTabBar(isLogin: isLogin) - } -} diff --git a/YuMi/Global/BuglyManagerExample.h.backup b/YuMi/Global/BuglyManagerExample.h.backup deleted file mode 100644 index dd3d945..0000000 --- a/YuMi/Global/BuglyManagerExample.h.backup +++ /dev/null @@ -1,42 +0,0 @@ -// -// BuglyManagerExample.h -// YuMi -// -// Created by BuglyManager Example -// Copyright © 2024 YuMi. All rights reserved. -// - -#import -#import "BuglyManager.h" - -NS_ASSUME_NONNULL_BEGIN - -/** - * BuglyManager 使用示例类 - * 展示如何使用 BuglyManager 的各种功能 - */ -@interface BuglyManagerExample : NSObject - -/** - * 设置 Bugly 代理 - */ -- (void)setupBuglyDelegate; - -/** - * 上报业务错误示例 - */ -- (void)reportBusinessErrorExample; - -/** - * 上报网络错误示例 - */ -- (void)reportNetworkErrorExample; - -/** - * 上报内购错误示例 - */ -- (void)reportIAPErrorExample; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Global/BuglyManagerExample.m.backup b/YuMi/Global/BuglyManagerExample.m.backup deleted file mode 100644 index 5810ec3..0000000 --- a/YuMi/Global/BuglyManagerExample.m.backup +++ /dev/null @@ -1,79 +0,0 @@ -// -// BuglyManagerExample.m -// YuMi -// -// Created by BuglyManager Example -// Copyright © 2024 YuMi. All rights reserved. -// - -#import "BuglyManagerExample.h" -#import "BuglyManager.h" - -@implementation BuglyManagerExample - -#pragma mark - 使用示例 - -// 示例1:设置代理监听卡顿 -- (void)setupBuglyDelegate { - [BuglyManager sharedManager].delegate = self; -} - -// 示例2:上报业务错误 -- (void)reportBusinessErrorExample { - NSDictionary *context = @{ - @"page": @"HomePage", - @"action": @"loadData", - @"timestamp": @([[NSDate date] timeIntervalSince1970]) - }; - - [[BuglyManager sharedManager] reportBusinessError:@"数据加载失败" - code:1001 - context:context]; -} - -// 示例3:上报网络错误 -- (void)reportNetworkErrorExample { - NSDictionary *userInfo = @{ - @"requestParams": @{@"userId": @"12345"}, - @"responseData": @"服务器错误" - }; - - [[BuglyManager sharedManager] reportNetworkError:@"user123" - api:@"user/profile" - code:500 - userInfo:userInfo]; -} - -// 示例4:上报内购错误 -- (void)reportIAPErrorExample { - NSDictionary *context = @{ - @"retryCount": @3, - @"productId": @"com.yumi.coin100" - }; - - [[BuglyManager sharedManager] reportIAPError:@"user123" - transactionId:@"txn_123456" - orderId:@"order_789" - status:2 - context:context]; -} - -#pragma mark - BuglyManagerDelegate - -- (void)buglyManager:(BuglyManager *)manager didDetectLag:(NSTimeInterval)duration { - NSLog(@"[Example] 检测到卡顿,持续时间: %.2f 秒", duration); - - // TODO: 在这里实现卡顿通知逻辑 - // 1. 记录到本地日志 - // 2. 发送本地通知 - // 3. 上报到性能监控系统 - // 4. 触发用户反馈机制 -} - -- (void)buglyManager:(BuglyManager *)manager didDetectBlock:(NSTimeInterval)duration { - NSLog(@"[Example] 检测到主线程阻塞,持续时间: %.2f 秒", duration); - - // TODO: 在这里实现阻塞通知逻辑 -} - -@end diff --git a/YuMi/Global/YUMIConstant.h.backup b/YuMi/Global/YUMIConstant.h.backup deleted file mode 100644 index acd68a9..0000000 --- a/YuMi/Global/YUMIConstant.h.backup +++ /dev/null @@ -1,24 +0,0 @@ -// -// YMConstant.h -// YUMI -// -// Created by YUMI on 2021/9/13. -// -///项目配置常量 -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface YUMIConstant : NSObject - -/// 配置Key类型枚举(仅保留实际使用的类型) -typedef NS_ENUM(NSUInteger, Pi_KeyType) { - KeyType_Sign = 0, ///参数加密签名Key -}; - -/// 获取指定类型的配置值 -NSString * const KeyWithType(Pi_KeyType type); - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Global/YUMIConstant.m.backup b/YuMi/Global/YUMIConstant.m.backup deleted file mode 100644 index 3fc369b..0000000 --- a/YuMi/Global/YUMIConstant.m.backup +++ /dev/null @@ -1,21 +0,0 @@ -// -// YMConstant.m -// YUMI -// -// Created by YUMI on 2021/9/13. -// - -#import "YUMIConstant.h" - -@implementation YUMIConstant - -/// 获取指定类型的配置值 -NSString * const KeyWithType(Pi_KeyType type) { - // 参数加密签名Key(用于API请求签名) - if (type == KeyType_Sign) { - return @"rpbs6us1m8r2j9g6u06ff2bo18orwaya"; - } - return @""; -} - -@end diff --git a/YuMi/Global/YUMIHtmlUrl.h.backup b/YuMi/Global/YUMIHtmlUrl.h.backup deleted file mode 100644 index 092d8db..0000000 --- a/YuMi/Global/YUMIHtmlUrl.h.backup +++ /dev/null @@ -1,26 +0,0 @@ -// -// YMHtmlUrl.h -// YUMI -// -// Created by YUMI on 2021/9/13. -// -///放置h5的链接地址 -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface YUMIHtmlUrl : NSObject - -/// URL类型枚举(仅保留实际使用的类型) -typedef NS_ENUM(NSUInteger, URLType) { - kPrivacyURL = 0, ///隐私政策 - kUserProtocalURL = 4, ///用户协议 - kFAQURL = 6, ///帮助/常见问题 - kCaptchaSwitchPath = 113, ///人机验证 -}; - -NSString * const URLWithType(URLType type); - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Global/YUMIHtmlUrl.m.backup b/YuMi/Global/YUMIHtmlUrl.m.backup deleted file mode 100644 index f9bb2e9..0000000 --- a/YuMi/Global/YUMIHtmlUrl.m.backup +++ /dev/null @@ -1,43 +0,0 @@ -// -// YMHtmlUrl.m -// YUMI -// -// Created by YUMI on 2021/9/13. -// - -#import "YUMIHtmlUrl.h" -#import "AESUtils.h" - -@implementation YUMIHtmlUrl - -NSString * const URLWithType(URLType type) { - NSString *prefix = @"eparty"; - - // 明文 URL 配置(无需加密的路径) - NSDictionary *plainUrls = @{ - @(kCaptchaSwitchPath): @"modules/humanMachineVerification/index.html", - }; - - NSString *plainUrl = plainUrls[@(type)]; - if (plainUrl) { - return [NSString stringWithFormat:@"%@/%@", prefix, plainUrl]; - } - - // 加密 URL 配置(需要 AES 解密的路径) - NSDictionary *encryptedUrls = @{ - @(kPrivacyURL): @"sPa8x4YF1hFEeCeH5v+RMOulemxgjjZLbxkN8ZrBSM8=", // modules/rule/privacy-wap.html - @(kUserProtocalURL): @"0sBhBaRqf7oBlYvNK4azCrVPTFjv9FYF0A2v9+qkSxg=", // modules/rule/protocol.html - @(kFAQURL): @"k/Bqnh8nGkuhV8KhU6xN5a8EkxEQrbDMAWNBtaAdJCo=", // modules/rule/guide.html - }; - - NSString *encryptedUrl = encryptedUrls[@(type)]; - if (encryptedUrl) { - NSString *decryptedPath = [AESUtils aesDecrypt:encryptedUrl]; - return [NSString stringWithFormat:@"%@/%@", prefix, decryptedPath]; - } - - // 未找到对应的 URL 配置 - return @""; -} - -@end diff --git a/YuMi/Global/YUMINNNN.h.backup b/YuMi/Global/YUMINNNN.h.backup deleted file mode 100644 index a108cad..0000000 --- a/YuMi/Global/YUMINNNN.h.backup +++ /dev/null @@ -1,17 +0,0 @@ -// -// YMEnum.h -// YUMI -// -// Created by YUMI on 2021/9/13. -// -///全局枚举定义(仅保留实际使用的类型) -#ifndef YUMINNNN_h -#define YUMINNNN_h - -/// 短信验证码业务类型(仅保留实际使用的类型) -typedef NS_ENUM(NSUInteger, GetSmsType) { - GetSmsType_Regist = 1, ///注册 - GetSmsType_Reset_Password = 3, ///重设密码 -}; - -#endif /* YUMINNNN_h */ diff --git a/YuMi/Modules/YMLogin/Api/Api+Login.h.backup b/YuMi/Modules/YMLogin/Api/Api+Login.h.backup deleted file mode 100644 index 49fe781..0000000 --- a/YuMi/Modules/YMLogin/Api/Api+Login.h.backup +++ /dev/null @@ -1,117 +0,0 @@ -// -// Api+Login.h -// YUMI -// -// Created by zu on 2021/9/6. -// - -#import "Api.h" -NS_ASSUME_NONNULL_BEGIN - -@interface Api (Login) - -+ (void)phoneQuickLogin:(HttpRequestHelperCompletion)completion - accessToken:(NSString *)accessToken - token:(NSString *)token; -/// 手机验证码登录 -/// @param completion 完成 -/// @param phone 手机号 -/// @param code 验证码 -+ (void)loginWithCode:(HttpRequestHelperCompletion)completion - phone:(NSString *)phone - code:(NSString *)code - client_secret:(NSString *)client_secret - version:(NSString *)version - client_id:(NSString *)client_id - grant_type:(NSString *)grant_type - phoneAreaCode:(NSString *)phoneAreaCode; - -/// 手机密码登录 -/// @param completion 完成 -/// @param phone 手机号 -/// @param password 验证码 -+ (void)loginWithPassword:(HttpRequestHelperCompletion)completion - phone:(NSString *)phone - password:(NSString *)password - client_secret:(NSString *)client_secret - version:(NSString *)version - client_id:(NSString *)client_id - grant_type:(NSString *)grant_type; - -/// 充值密码 没有登录的时候 -/// @param complction 完成 -/// @param phone 手机号 -/// @param newPwd 新的密码 -/// @param smsCode 验证码 -+ (void)resetPasswordWithPhone:(HttpRequestHelperCompletion)complction - phone:(NSString *)phone - newPwd:(NSString *)newPwd - smsCode:(NSString *)smsCode phoneAreaCode:(NSString *)phoneAreaCode; - -/// 第三方登录 -/// @param complction 完成 -/// @param openid 唯一标识符 -/// @param unionid unionid -/// @param access_token access_token -/// @param type 第三方登录的类型 -+ (void)loginWithThirdPart:(HttpRequestHelperCompletion)complction - openid:(NSString *)openid - unionid:(NSString *)unionid - access_token:(NSString *)access_token - type:(NSString *)type; - -/// 随机获取一个昵称 -/// @param completion 完成 -+ (void)randomNick:(HttpRequestHelperCompletion)completion; - -/// 绑定手机号码 -/// @param complection 完成 -/// @param phone 手机号 -/// @param code 验证码 -/// @param ticket ticket -+ (void)bindMoblieCode:(HttpRequestHelperCompletion)complection - phone:(NSString *)phone - code:(NSString *)code - ticket:(NSString *)ticket phoneAreaCode:(NSString *)phoneAreaCode; - -+(void)getPhoneAreaCodeList:(HttpRequestHelperCompletion)complection; -/// 绑定授权码 -/// @param complection 完成 - -+(void)bindAuthorizationCode:(HttpRequestHelperCompletion)complection authCode:(NSString *)authCode; - - -///反馈 -+ (void)loadFeedbackConfig:(HttpRequestHelperCompletion)completion; -+ (void)commitFeedback:(HttpRequestHelperCompletion)completion - type:(NSString *)type - desc:(NSString *)desc - screenUrl:(NSString *)screenUrl - contact:(NSString *)contact; - -+ (void)emailGetCode:(HttpRequestHelperCompletion)completion emailAddress:(NSString *)emailAddress type:(NSNumber *)type; - -+ (void)emailVerify:(HttpRequestHelperCompletion)completion emailAddress:(NSString *)emailAddress code:(NSString *)code; - - -+ (void)loginWithCode:(HttpRequestHelperCompletion)completion - email:(NSString *)email - code:(NSString *)code - client_secret:(NSString *)client_secret - version:(NSString *)version - client_id:(NSString *)client_id - grant_type:(NSString *)grant_type; - -+ (void)userBoundEmail:(HttpRequestHelperCompletion)completion - email:(NSString *)email - code:(NSString *)code; -+ (void)userBoundPhone:(HttpRequestHelperCompletion)completion - phone:(NSString *)email - code:(NSString *)code - phoneAreaCode:(NSString *)phoneAreaCode; - -+ (void)resetPasswordWithEmail:(HttpRequestHelperCompletion)completion email:(NSString *)email newPwd:(NSString *)newPwd code:(NSString *)code; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMLogin/Api/Api+Login.m.backup b/YuMi/Modules/YMLogin/Api/Api+Login.m.backup deleted file mode 100644 index 5eb5bfb..0000000 --- a/YuMi/Modules/YMLogin/Api/Api+Login.m.backup +++ /dev/null @@ -1,149 +0,0 @@ -// -// Api+Login.m -// YUMI -// -// Created by zu on 2021/9/6. -// - -#import "Api+Login.h" -#import -@implementation Api (Login) - -+ (void)phoneQuickLogin:(HttpRequestHelperCompletion)completion accessToken:(NSString *)accessToken token:(NSString *)token { - NSString * fang = [NSString stringFromBase64String:@"YWNjL29uZWNsaWNrL2xvZ2lu"];///acc/oneclick/login - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, accessToken, token, nil]; -} - -/// 手机验证码登录 -/// @param completion 完成 -/// @param phone 手机号 -/// @param code 验证码 -+ (void)loginWithCode:(HttpRequestHelperCompletion)completion phone:(NSString *)phone code:(NSString *)code client_secret:(NSString *)client_secret version:(NSString *)version client_id:(NSString *)client_id grant_type:(NSString *)grant_type phoneAreaCode:(NSString *)phoneAreaCode{ - NSString * fang = [NSString stringFromBase64String:@"b2F1dGgvdG9rZW4="];///oauth/token - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,phone,code,client_secret,version, client_id, grant_type,phoneAreaCode, nil]; -} - -/// 手机密码登录 -/// @param completion 完成 -/// @param phone 手机号 -/// @param password 验证码 -+ (void)loginWithPassword:(HttpRequestHelperCompletion)completion phone:(NSString *)phone password:(NSString *)password client_secret:(NSString *)client_secret version:(NSString *)version client_id:(NSString *)client_id grant_type:(NSString *)grant_type { - - [self makeRequest:@"oauth/token" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,phone,password,client_secret,version, client_id, grant_type, nil]; -} - -/// 重置手机号登录密码 -/// @param completion 完成 -/// @param phone 手机号 -/// @param newPwd 新的密码 -/// @param smsCode 验证码 -+ (void)resetPasswordWithPhone:(HttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd smsCode:(NSString *)smsCode phoneAreaCode:(NSString *)phoneAreaCode{ - NSString * fang = [NSString stringFromBase64String:@"YWNjL3B3ZC9yZXNldA=="];/// acc/pwd/reset - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, phone, newPwd, smsCode,phoneAreaCode, nil]; -} - -+ (void)resetPasswordWithEmail:(HttpRequestHelperCompletion)completion email:(NSString *)email newPwd:(NSString *)newPwd code:(NSString *)code{ - [self makeRequest:@"acc/pwd/resetByEmail" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, email, newPwd, code, nil]; -} - - -/// 第三方登录 -/// @param completion 完成 -/// @param openid 唯一标识符 -/// @param unionid unionid -/// @param access_token access_token -/// @param type 第三方登录的类型 -+ (void)loginWithThirdPart:(HttpRequestHelperCompletion)completion openid:(NSString *)openid unionid:(NSString *)unionid access_token:(NSString *)access_token type:(NSString *)type { - NSString * fang = [NSString stringFromBase64String:@"YWNjL3RoaXJkL2xvZ2lu"];///acc/third/login - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, openid, unionid, access_token, type, nil]; -} - -/// 随机获取一个昵称 -/// @param completion 完成 -+ (void)randomNick:(HttpRequestHelperCompletion)completion { - NSString * fang = [NSString stringFromBase64String:@"cmFuZG9tL25pY2svZ2V0"];///random/nick/get - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, nil]; -} - -/// 绑定手机号码 -/// @param complection 完成 -/// @param phone 手机号 -/// @param code 验证码 -/// @param ticket ticket -+ (void)bindMoblieCode:(HttpRequestHelperCompletion)complection - phone:(NSString *)phone - code:(NSString *)code - ticket:(NSString *)ticket phoneAreaCode:(NSString *)phoneAreaCode{ - NSString * fang = [NSString stringFromBase64String:@"d2l0aERyYXcvcGhvbmU="];///withDraw/phone - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__, phone, code, ticket,phoneAreaCode, nil]; -} - -+(void)getPhoneAreaCodeList:(HttpRequestHelperCompletion)complection{ - NSString * fang = [NSString stringFromBase64String:@"YXJlYUluZm8vbGlzdA=="];///areaInfo/list - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__,nil]; -} -/// 绑定授权码 -/// @param complection 完成 - -+(void)bindAuthorizationCode:(HttpRequestHelperCompletion)complection authCode:(NSString *)authCode{ - [self makeRequest:@"phone/auth/bound" method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__,authCode, nil]; -} - -///反馈 -+ (void)loadFeedbackConfig:(HttpRequestHelperCompletion)completion { - [self makeRequest:@"feedback/getConfig" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil]; -} - -+ (void)commitFeedback:(HttpRequestHelperCompletion)completion - type:(NSString *)type - desc:(NSString *)desc - screenUrl:(NSString *)screenUrl - contact:(NSString *)contact { - [self makeRequest:@"feedback/commit" - method:HttpRequestHelperMethodPOST - completion:completion, __FUNCTION__, type, desc, screenUrl, contact, nil]; - -} - -+ (void)emailGetCode:(HttpRequestHelperCompletion)completion emailAddress:(NSString *)emailAddress type:(NSNumber *)type { - [self makeRequest:@"email/getCode" - method:HttpRequestHelperMethodPOST - completion:completion, __FUNCTION__, emailAddress, type, nil]; -} - - -+ (void)emailVerify:(HttpRequestHelperCompletion)completion emailAddress:(NSString *)emailAddress code:(NSString *)code { - [self makeRequest:@"email/verify" - method:HttpRequestHelperMethodPOST - completion:completion, __FUNCTION__, emailAddress, code, nil]; -} - -+ (void)loginWithCode:(HttpRequestHelperCompletion)completion - email:(NSString *)email - code:(NSString *)code - client_secret:(NSString *)client_secret - version:(NSString *)version - client_id:(NSString *)client_id - grant_type:(NSString *)grant_type { - NSString * fang = [NSString stringFromBase64String:@"b2F1dGgvdG9rZW4="];///oauth/token - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,email,code,client_secret,version, client_id, grant_type, nil]; -} - -+ (void)userBoundEmail:(HttpRequestHelperCompletion)completion - email:(NSString *)email - code:(NSString *)code { - [self makeRequest:@"user/boundEmail" - method:HttpRequestHelperMethodPOST - completion:completion, __FUNCTION__, email, code, nil]; -} - -+ (void)userBoundPhone:(HttpRequestHelperCompletion)completion - phone:(NSString *)email - code:(NSString *)code - phoneAreaCode:(NSString *)phoneAreaCode { - [self makeRequest:@"user/boundPhone" - method:HttpRequestHelperMethodPOST - completion:completion, __FUNCTION__, email, code, nil]; -} - -@end diff --git a/YuMi/Modules/YMLogin/View/NewLogin/PIUserSexView.h.backup b/YuMi/Modules/YMLogin/View/NewLogin/PIUserSexView.h.backup deleted file mode 100644 index 09b044c..0000000 --- a/YuMi/Modules/YMLogin/View/NewLogin/PIUserSexView.h.backup +++ /dev/null @@ -1,17 +0,0 @@ -// -// PIUserSexView.h -// YuMi -// -// Created by duoban on 2023/8/14. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface PIUserSexView : UIView -@property (nonatomic,assign) NSInteger gender; /// 性别 1:男 2:女 -@property (nonatomic,assign) BOOL selected; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMLogin/View/NewLogin/PIUserSexView.m.backup b/YuMi/Modules/YMLogin/View/NewLogin/PIUserSexView.m.backup deleted file mode 100644 index 0e21b21..0000000 --- a/YuMi/Modules/YMLogin/View/NewLogin/PIUserSexView.m.backup +++ /dev/null @@ -1,127 +0,0 @@ -// -// PIUserSexView.m -// YuMi -// -// Created by duoban on 2023/8/14. -// - -#import "PIUserSexView.h" -@interface PIUserSexView () -///背景 -@property (nonatomic,strong) UIImageView *backImageView; -///头像 -@property (nonatomic,strong) UIImageView *logoImageView; -///性别图标 -@property (nonatomic,strong) UIImageView *sexImageView; -///性别 -@property (nonatomic,strong) UILabel *sexLb; -@end -@implementation PIUserSexView - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; -} - -- (void)initSubViews { - [self addSubview:self.backImageView]; - [self.backImageView addSubview:self.logoImageView]; - [self.backImageView addSubview:self.sexLb]; - [self.backImageView addSubview:self.sexImageView]; -} - -- (void)initSubViewConstraints { - [self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.mas_equalTo(self); - }]; - - [self.logoImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(66), kGetScaleWidth(66))); - make.centerX.mas_equalTo(self.backImageView); - make.top.mas_equalTo(self.backImageView).offset(kGetScaleWidth(8)); - }]; - - [self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(16), kGetScaleWidth(16))); - make.trailing.mas_equalTo(self.backImageView.mas_centerX).offset(-1.5); - make.top.mas_equalTo(self.logoImageView.mas_bottom).offset(kGetScaleWidth(8)); - }]; - - [self.sexLb mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(self.backImageView.mas_centerX).offset(1.5); - make.centerY.mas_equalTo(self.sexImageView); - }]; -} - -- (void)setGender:(NSInteger)gender { - _gender = gender; - if (_gender == 1) { // 男性 - self.logoImageView.image = [UIImage imageNamed:@"login_full_male_logo"]; - self.sexLb.text = YMLocalizedString(@"PIUserSexView0"); - self.sexImageView.image = [UIImage imageNamed:@"login_full_male"]; - } else if (_gender == 2) { // 女性 - self.logoImageView.image = [UIImage imageNamed:@"login_full_female_logo"]; - self.sexLb.text = YMLocalizedString(@"PIUserSexView1"); - self.sexImageView.image = [UIImage imageNamed:@"login_full_female"]; - } -} - -- (void)setSelected:(BOOL)selected { - _selected = selected; - if (_selected) { - if (self.gender == 1) { // 男性 - self.backImageView.image = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor colorWithHexString:@"#EBF5FF"],[DJDKMIMOMColor colorWithHexString:@"#FFFFFF"]] gradientType:GradientTypeTopToBottom imgSize:CGSizeMake(10, 10)]; - self.backImageView.layer.borderColor = [DJDKMIMOMColor colorWithHexString:@"#B8E5FF"].CGColor; - } else { // 女性 - self.backImageView.image = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor colorWithHexString:@"#FFEBFA"],[DJDKMIMOMColor colorWithHexString:@"#FFFFFF"]] gradientType:GradientTypeTopToBottom imgSize:CGSizeMake(10, 10)]; - self.backImageView.layer.borderColor = [DJDKMIMOMColor colorWithHexString:@"#FFB8E2"].CGColor; - } - - } else { - self.backImageView.image = [UIImage imageWithColor:[UIColor clearColor]]; - self.backImageView.layer.borderColor = [DJDKMIMOMColor colorWithHexString:@"#FAFBFC"].CGColor; - } -} - -- (UIImageView *)backImageView { - if (!_backImageView) { - _backImageView = [[UIImageView alloc] init]; - _backImageView.userInteractionEnabled = YES; - _backImageView.layer.masksToBounds = YES; - _backImageView.layer.borderWidth = 1; - _backImageView.layer.cornerRadius = kGetScaleWidth(18); - } - return _backImageView; -} - -- (UIImageView *)logoImageView { - if (!_logoImageView) { - _logoImageView = [[UIImageView alloc] init]; - _logoImageView.userInteractionEnabled = YES; - } - return _logoImageView; -} - -- (UIImageView *)sexImageView { - if (!_sexImageView) { - _sexImageView = [[UIImageView alloc] init]; - _sexImageView.userInteractionEnabled = YES; - } - return _sexImageView; -} - -- (UILabel *)sexLb { - if (!_sexLb) { - _sexLb = [[UILabel alloc] init]; - _sexLb.font = kFontMedium(14); - _sexLb.textColor = [DJDKMIMOMColor colorWithHexString:@"#1F1A4E"]; - } - return _sexLb; -} - - -@end diff --git a/YuMi/Modules/YMLogin/View/NewLogin/XPForgetPwdViewController.h.backup b/YuMi/Modules/YMLogin/View/NewLogin/XPForgetPwdViewController.h.backup deleted file mode 100644 index d3f3aae..0000000 --- a/YuMi/Modules/YMLogin/View/NewLogin/XPForgetPwdViewController.h.backup +++ /dev/null @@ -1,16 +0,0 @@ -// -// YMForgetPwdViewController.h -// YUMI -// -// Created by XY on 2023/2/14. -// - -#import "MvpViewController.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface XPForgetPwdViewController : MvpViewController - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMLogin/View/NewLogin/XPForgetPwdViewController.m.backup b/YuMi/Modules/YMLogin/View/NewLogin/XPForgetPwdViewController.m.backup deleted file mode 100644 index 676bdc3..0000000 --- a/YuMi/Modules/YMLogin/View/NewLogin/XPForgetPwdViewController.m.backup +++ /dev/null @@ -1,271 +0,0 @@ -// -// YMForgetPwdViewController.m -// YUMI -// -// Created by XY on 2023/2/14. -// - -#import "XPForgetPwdViewController.h" -#import -#import "YUMIMacroUitls.h" -#import - -#import "XPLoginInputView.h" - -#import "LoginForgetPasswordPresent.h" -#import "LoginForgetPasswordProtocol.h" -#import "XPLoginAraeViewController.h" - -@interface XPForgetPwdViewController () -///背景 -@property(nonatomic,strong) UIImageView *bgImageView; -///返回 -@property(nonatomic,strong) UIButton *backBnt; -/// 标题 -@property (nonatomic, strong) UILabel *titleLabel; -/// 手机号输入框 -@property (nonatomic, strong) XPLoginInputView *phoneInputView; -/// 验证码输入框 -@property (nonatomic, strong) XPLoginInputView *codeInputView; -/// 密码输入框 -@property (nonatomic, strong) XPLoginInputView *pwdInputView; -/// 确定按钮 -@property (nonatomic, strong) UIButton *sureBtn; -@property (nonatomic,copy) NSString *pi_phoneAreaCode; - -@end - -@implementation XPForgetPwdViewController -- (BOOL)isHiddenNavBar { - return YES; -} -- (LoginForgetPasswordPresent *)createPresenter { - return [[LoginForgetPasswordPresent alloc] init]; -} -- (void)viewWillDisappear:(BOOL)animated{ - [super viewWillDisappear:animated]; - [self.codeInputView cancelTimer]; -} -- (void)viewDidLoad { - NSString *code = [NSString getCountryCode]; - self.pi_phoneAreaCode = [code stringByReplacingOccurrencesOfString:@"+" withString:@""]; - - [super viewDidLoad]; - [self createUI]; - [self racBind]; -} - -- (void)createUI { - self.view.backgroundColor = [UIColor whiteColor]; - [self.view addSubview:self.bgImageView]; - [self.view addSubview:self.backBnt]; - [self.view addSubview:self.titleLabel]; - UIView *bgView = [UIView new]; - bgView.backgroundColor = [UIColor whiteColor]; - [self.view addSubview:bgView]; - bgView.layer.cornerRadius = kGetScaleWidth(20); - bgView.layer.masksToBounds = YES; - [self.view addSubview:self.phoneInputView]; - [self.view addSubview:self.codeInputView]; - [self.view addSubview:self.pwdInputView]; - [self.view addSubview:self.sureBtn]; - - - [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.top.equalTo(self.view); - make.height.mas_equalTo(kGetScaleWidth(418)); - }]; - [self.backBnt mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(kGetScaleWidth(20)); - make.width.mas_equalTo(kGetScaleWidth(28)); - make.height.mas_equalTo(kGetScaleWidth(28)); - make.top.mas_equalTo(kGetScaleWidth(52)); - }]; - - [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.mas_equalTo(self.view); - make.top.equalTo(self.backBnt.mas_bottom).mas_offset(kGetScaleWidth(48)); - make.leading.mas_equalTo(kGetScaleWidth(24)); - make.height.mas_equalTo(kGetScaleWidth(40)); - }]; - [bgView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.bottom.equalTo(self.view); - make.top.mas_equalTo(kGetScaleWidth(257)); - }]; - [self.phoneInputView mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.equalTo(self.view); - make.width.mas_equalTo(kGetScaleWidth(303)); - make.top.mas_equalTo(kGetScaleWidth(296)); - make.height.mas_equalTo(kGetScaleWidth(52)); - }]; - [self.codeInputView mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.equalTo(self.view); - make.width.mas_equalTo(kGetScaleWidth(303)); - make.top.mas_equalTo(self.phoneInputView.mas_bottom).offset(kGetScaleWidth(20)); - make.height.mas_equalTo(kGetScaleWidth(52)); - }]; - [self.pwdInputView mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.equalTo(self.view); - make.width.mas_equalTo(kGetScaleWidth(303)); - make.top.mas_equalTo(self.codeInputView.mas_bottom).offset(kGetScaleWidth(20)); - make.height.mas_equalTo(kGetScaleWidth(52)); - }]; - [self.sureBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.pwdInputView.mas_bottom).offset(kGetScaleWidth(48)); - make.centerX.mas_equalTo(self.view); - make.height.mas_equalTo(kGetScaleWidth(48)); - make.width.mas_equalTo(kGetScaleWidth(303)); - }]; - -} -- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ - [self.view endEditing:YES]; -} -- (void)racBind { - RAC(self.sureBtn, enabled) = [[RACSignal combineLatest:@[self.phoneInputView.inputTextField.rac_textSignal, self.pwdInputView.inputTextField.rac_textSignal, self.pwdInputView.inputTextField.rac_textSignal] reduce:^id _Nonnull(NSString *phone, NSString* smsCode, NSString *password){ - return @((phone.length > 0) && smsCode.length >= 5 && (password.length >= 6 && password.length <= 16)); - }] takeUntil:self.rac_willDeallocSignal]; -} - -/// 确认 -- (void)sureBtnClicked { - NSString *phone = self.phoneInputView.inputTextField.text; - NSString *smsCode = self.codeInputView.inputTextField.text; - NSString *password = self.pwdInputView.inputTextField.text; - [self.presenter resetPassword:[NSString stringWithFormat:@"%@%@",self.pi_phoneAreaCode,phone] newPwd:password smsCode:smsCode phoneAreaCode:self.pi_phoneAreaCode]; -} - -#pragma mark - XPLoginInputViewDelegate - -- (void)smsCodeAction { - NSString *phone = self.phoneInputView.inputTextField.text; - if (phone.length <= 0) { - [self showErrorToast:YMLocalizedString(@"XPForgetPwdViewController0")]; - return; - } - [self.presenter phoneSmsCode:[NSString stringWithFormat:@"%@%@",self.pi_phoneAreaCode,phone] type:GetSmsType_Reset_Password phoneAreaCode:self.pi_phoneAreaCode]; - -} - -- (void)areaListAction { - XPLoginAraeViewController *codeVC = [XPLoginAraeViewController new]; - codeVC.delegate = self; - [self.navigationController pushViewController:codeVC animated:YES]; -} - -- (void)chooseAreaCodeSuccess:(NSString *)code { - if (code.length > 0) { - self.pi_phoneAreaCode = code; - [self.phoneInputView.areaCodeBtn setTitle:[NSString stringWithFormat:@"+%@", code] forState:UIControlStateNormal]; - } -} - -#pragma mark - LoginForgetPasswordProtocol - -///请求手机号的验证码成功 -- (void)phoneSmsCodeSuccess { - [self showSuccessToast:YMLocalizedString(@"XPForgetPwdViewController1")]; - [self.codeInputView fireTimer]; -} - -///重置密码成功 -- (void)resetPasswrodSuccess { - [self showSuccessToast:YMLocalizedString(@"XPForgetPwdViewController2")]; - [self.navigationController popViewControllerAnimated:YES]; - -} --(void)backViewAction1{ - [self.navigationController popViewControllerAnimated:YES]; -} -#pragma mark - 懒加载 - -- (UILabel *)titleLabel { - if (!_titleLabel) { - _titleLabel = [[UILabel alloc] init]; - _titleLabel.font = kFontBold(28); - _titleLabel.textColor = UIColorFromRGB(0x1F1B4F); - _titleLabel.text = YMLocalizedString(@"XPForgetPwdViewController3"); - - } - return _titleLabel; -} - -- (XPLoginInputView *)phoneInputView { - if (!_phoneInputView) { - _phoneInputView = [[XPLoginInputView alloc] init]; - _phoneInputView.areaStackView.hidden = NO; - _phoneInputView.delegate = self; - NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPForgetPwdViewController4")]; - [placeholder addAttribute:NSForegroundColorAttributeName value:UIColorFromRGB(0xB3B3C3) range:NSMakeRange(0, placeholder.length)]; - _phoneInputView.inputTextField.attributedPlaceholder = placeholder; - _phoneInputView.inputTextField.keyboardType = UIKeyboardTypeNumberPad; - } - return _phoneInputView; -} - -- (XPLoginInputView *)codeInputView { - if (!_codeInputView) { - _codeInputView = [[XPLoginInputView alloc] init]; - _codeInputView.smsCodeBtn.hidden = NO; - NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPForgetPwdViewController5")]; - [placeholder addAttribute:NSForegroundColorAttributeName value:UIColorFromRGB(0xB3B3C3) range:NSMakeRange(0, placeholder.length)]; - _codeInputView.inputTextField.attributedPlaceholder = placeholder; - _codeInputView.inputTextField.keyboardType = UIKeyboardTypeNumberPad; - _codeInputView.delegate = self; - } - return _codeInputView; -} - -- (XPLoginInputView *)pwdInputView { - if (!_pwdInputView) { - _pwdInputView = [[XPLoginInputView alloc] init]; - NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPForgetPwdViewController6")]; - [placeholder addAttribute:NSForegroundColorAttributeName value:UIColorFromRGB(0xB3B3C3) range:NSMakeRange(0, placeholder.length)]; - _pwdInputView.inputTextField.attributedPlaceholder = placeholder; - _pwdInputView.inputTextField.keyboardType = UIKeyboardTypeAlphabet; - _pwdInputView.inputTextField.secureTextEntry = YES; - } - return _pwdInputView; -} - -- (UIButton *)sureBtn { - if (!_sureBtn) { - _sureBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - - UIImage *nextImage = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor],[DJDKMIMOMColor confirmButtonGradientMiddleColor],[DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(303), kGetScaleWidth(48))]; - UIImage *disableImage = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xD1F9FF),UIColorFromRGB(0xDEE4FF),UIColorFromRGB(0xEEDCFF)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(303), kGetScaleWidth(48))]; - - [_sureBtn setImage:nextImage forState:UIControlStateNormal]; - [_sureBtn setImage:disableImage forState:UIControlStateDisabled]; - _sureBtn.layer.cornerRadius = kGetScaleWidth(48)/2; - _sureBtn.layer.masksToBounds = YES; - - - UILabel *titleView = [UILabel labelInitWithText:YMLocalizedString(@"XPLoginPhoneViewController8") font:kFontMedium(16) textColor:[UIColor whiteColor]]; - titleView.textAlignment = NSTextAlignmentCenter; - [_sureBtn addSubview:titleView]; - [titleView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(self.sureBtn); - }]; - [_sureBtn addTarget:self action:@selector(sureBtnClicked) forControlEvents:UIControlEventTouchUpInside]; - } - return _sureBtn; -} -- (UIImageView *)bgImageView{ - if(!_bgImageView){ - _bgImageView = [[UIImageView alloc]init]; - _bgImageView.image = kImage(@"login_phone_pwd_bg"); - _bgImageView.contentMode = 2; - } - return _bgImageView; -} -- (UIButton *)backBnt{ - if(!_backBnt){ - _backBnt = [UIButton new]; - [_backBnt setImage:[kImage(@"common_nav_back")ms_SetImageForRTL] forState:UIControlStateNormal]; - [_backBnt addTarget:self action:@selector(backViewAction1) forControlEvents:UIControlEventTouchUpInside]; - [_backBnt setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10]; - } - return _backBnt; -} -@end diff --git a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginAraeViewController.h.backup b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginAraeViewController.h.backup deleted file mode 100644 index 1a1f289..0000000 --- a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginAraeViewController.h.backup +++ /dev/null @@ -1,21 +0,0 @@ -// -// XPLoginAraeViewController.h -// YuMi -// -// Created by YuMi on 2023/6/25. -// - -#import "BaseViewController.h" - -NS_ASSUME_NONNULL_BEGIN -@protocol XPLoginAraeViewControllerDelegate - --(void)chooseAreaCodeSuccess:(NSString *)code; - -@end -@interface XPLoginAraeViewController : BaseViewController -///代理 -@property (nonatomic,weak) id delegate; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginAraeViewController.m.backup b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginAraeViewController.m.backup deleted file mode 100644 index f314a1e..0000000 --- a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginAraeViewController.m.backup +++ /dev/null @@ -1,191 +0,0 @@ -// -// XPLoginAraeViewController.m -// YuMi -// -// Created by YuMi on 2023/6/25. -// - -#import "XPLoginAraeViewController.h" -///view -#import "XPLoginAreaTableViewCell.h" -#import "LoginAreaModel.h" -#import "NSObject+MJExtension.h" -#import "YUMIMacroUitls.h" -#import "Api+Login.h" -///Third -#import -@interface XPLoginAraeViewController () -@property (nonatomic,strong) UITableView *tableView; -@property (nonatomic,strong) NSMutableArray *listData; -@property (nonatomic,strong) NSMutableArray *titleList; -@end - -@implementation XPLoginAraeViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - [self initSubViews]; - [self initSubViewConstraints]; - [self getPhoneAreaCodeList]; -} -#pragma mark - LoginVerifCodeProtocol - --(void)getPhoneAreaCodeList{ - // 获取文件路径 - NSString *path = [[NSBundle mainBundle] pathForResource:@"pi_area_info" ofType:@"json"]; - // 将文件数据化 - NSData *data = [[NSData alloc] initWithContentsOfFile:path]; - // 对数据进行JSON格式化并返回字典形式 - NSError *error = nil; - NSDictionary *codeData = [NSJSONSerialization JSONObjectWithData:data - options:NSJSONReadingMutableLeaves - error:&error]; - if (error) { -// NSLog(@"JSON Parsing Error: %@", error.localizedDescription); - } - NSArray *codeList = [LoginAreaModel modelsWithArray:codeData[@"RECORDS"]]; - [self getLocalPlistWithList:codeList]; -} --(void)getLocalPlistWithList:(NSArray *)list{ - - NSArray * letterList = @[@"",@"A",@"B",@"C",@"D",@"E",@"F",@"G",@"H",@"I",@"J",@"K",@"L",@"M",@"N",@"O",@"P",@"Q",@"R",@"S",@"T",@"U",@"V",@"W",@"X",@"Y",@"Z"]; - NSMutableArray *otherList = [NSMutableArray array]; - NSMutableArray *defaultList = [NSMutableArray array]; - LoginAreaModel *TwModel; - LoginAreaModel *HKModel ; - LoginAreaModel *SPModel ; - LoginAreaModel *MYModel ; - LoginAreaModel *ChinsModel ; - [self.titleList addObject:@""]; - for (NSString *letter in letterList) { - NSMutableArray *modelList = [NSMutableArray array]; - for (LoginAreaModel *model in list) { - if([model.code isEqualToString:@"886"]){ - TwModel = model; - } - if([model.code isEqualToString:@"852"]){ - HKModel = model; - } - if([model.code isEqualToString:@"65"]){ - SPModel = model; - } - if([model.code isEqualToString:@"60"]){ - MYModel = model; - } - if([model.code isEqualToString:@"86"]){ - ChinsModel = model; - } - NSString *fristLetter = [model.name substringWithRange:NSMakeRange(0, 1)]; - if([letter isEqualToString:fristLetter]){ - [modelList addObject:model]; - }else{ - if(![letterList containsObject:fristLetter] && ![otherList containsObject:model]){ - [otherList addObject:model]; - } - } - } - if(modelList.count > 0){ - - [self.titleList addObject:letter]; - [self.listData addObject:modelList]; - } - } - if(TwModel != nil){ - [defaultList addObject:TwModel]; - } - if(HKModel != nil){ - [defaultList addObject:HKModel]; - } - if(SPModel != nil){ - [defaultList addObject:SPModel]; - } - if(MYModel != nil){ - [defaultList addObject:MYModel]; - } - if(ChinsModel != nil){ - [defaultList addObject:ChinsModel]; - } - [self.listData insertObject:defaultList atIndex:0]; - if(otherList.count > 0){ - [self.listData addObject:otherList]; - [self.titleList addObject:@"#"]; - } - [self.tableView reloadData]; -} -#pragma mark - UITableViewDelegate -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ - return self.listData.count; -} -- (nullable NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{ - - return self.titleList[section]; -} --(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ - return [self.listData[section] count]; -} - -- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView { - return self.titleList; -} - --(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ - XPLoginAreaTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPLoginAreaTableViewCell class]) forIndexPath:indexPath]; - if(cell.delegate == nil){ - cell.delegate = self; - } - if(indexPath.section < self.listData.count){ - NSArray *listModel = self.listData[indexPath.section]; - if(indexPath.row < listModel.count){ - cell.areaModel =listModel[indexPath.row]; - } - } - return cell; -} - -#pragma mark - XPLoginAreaTableViewCellDelegate -- (void)didSelectModel:(LoginAreaModel *)model{ - LoginAreaModel *codeModel = model; - if(self.delegate && [self.delegate respondsToSelector:@selector(chooseAreaCodeSuccess:)]){ - - [self.delegate chooseAreaCodeSuccess:codeModel.code]; - } - [self.navigationController popViewControllerAnimated:YES]; -} -#pragma mark - Private Method -- (void)initSubViews { - self.title = YMLocalizedString(@"XPChooseRreaCodeVC0"); - [self.view addSubview:self.tableView]; -} -- (void)initSubViewConstraints { - [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(self.view); - }]; -} -#pragma mark - Getters And Setters -- (UITableView *)tableView { - if (!_tableView) { - _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; - _tableView.delegate = self; - _tableView.dataSource = self; - _tableView.rowHeight = kGetScaleWidth(37); - _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;; - _tableView.backgroundColor = [UIColor whiteColor]; - [_tableView registerClass:[XPLoginAreaTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPLoginAreaTableViewCell class])]; - } - return _tableView; -} -- (NSMutableArray *)titleList{ - if (!_titleList){ - _titleList = [NSMutableArray array]; - } - return _titleList; -} -- (NSMutableArray *)listData{ - if (!_listData){ - _listData = [NSMutableArray array]; - } - return _listData; -} - - -@end diff --git a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginAreaTableViewCell.h.backup b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginAreaTableViewCell.h.backup deleted file mode 100644 index 9042756..0000000 --- a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginAreaTableViewCell.h.backup +++ /dev/null @@ -1,24 +0,0 @@ -// -// XPLoginAreaTableViewCell.h -// YuMi -// -// Created by YuMi on 2023/6/25. -// - -#import -@class LoginAreaModel; -@protocol XPLoginAreaTableViewCellDelegate - --(void)didSelectModel:(LoginAreaModel *_Nullable)model; - -@end - -NS_ASSUME_NONNULL_BEGIN - -@interface XPLoginAreaTableViewCell : UITableViewCell - -@property (nonatomic,strong) LoginAreaModel *areaModel; -@property(nonatomic,weak) iddelegate; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginAreaTableViewCell.m.backup b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginAreaTableViewCell.m.backup deleted file mode 100644 index 097a023..0000000 --- a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginAreaTableViewCell.m.backup +++ /dev/null @@ -1,88 +0,0 @@ -// -// XPLoginAreaTableViewCell.m -// YuMi -// -// Created by YuMi on 2023/6/25. -// - -#import "XPLoginAreaTableViewCell.h" -///Third -#import -///Tool -#import "DJDKMIMOMColor.h" -#import "LoginAreaModel.h" -@interface XPLoginAreaTableViewCell() -@property (nonatomic,strong) UILabel *areaVeiw; -@property (nonatomic,strong) UILabel *codeView; -@property(nonatomic,strong) UIButton *clickBtn; -@end -@implementation XPLoginAreaTableViewCell -- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { - if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; -} - -#pragma mark - Private Method -- (void)initSubViews { - self.backgroundColor = [UIColor whiteColor]; - self.selectionStyle = UITableViewCellSelectionStyleNone; - [self.contentView addSubview:self.areaVeiw]; - [self.contentView addSubview:self.codeView]; - [self.contentView addSubview:self.clickBtn]; -} -- (void)initSubViewConstraints { - [self.areaVeiw mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(kGetScaleWidth(15)); - make.centerY.equalTo(self.contentView); - }]; - [self.codeView mas_makeConstraints:^(MASConstraintMaker *make) { - make.trailing.mas_equalTo(-kGetScaleWidth(15)); - make.centerY.equalTo(self.contentView); - }]; - [self.clickBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.leading.bottom.equalTo(self.contentView); - make.trailing.mas_equalTo(-kGetScaleWidth(20)); - }]; -} --(void)didClickBtnAction{ - if(self.delegate && [self.delegate respondsToSelector:@selector(didSelectModel:)]){ - [self.delegate didSelectModel:self.areaModel]; - } -} -- (void)setAreaModel:(LoginAreaModel *)areaModel{ - _areaModel = areaModel; - _areaVeiw.text = _areaModel.name; - _codeView.text = _areaModel.code; - -} -#pragma mark - 懒加载 - -- (UILabel *)areaVeiw { - if (!_areaVeiw) { - _areaVeiw = [[UILabel alloc] init]; - _areaVeiw.font = [UIFont systemFontOfSize:14]; - _areaVeiw.textColor = [DJDKMIMOMColor colorWithHexString:@"#1F1A4E"]; - } - return _areaVeiw; -} - - -- (UILabel *)codeView { - if (!_codeView) { - _codeView = [[UILabel alloc] init]; - _codeView.font = [UIFont systemFontOfSize:14]; - _codeView.textColor = [DJDKMIMOMColor colorWithHexString:@"#1F1A4E"]; - } - return _codeView; -} -- (UIButton *)clickBtn{ - if(!_clickBtn){ - _clickBtn = [UIButton new]; - [_clickBtn addTarget:self action:@selector(didClickBtnAction) forControlEvents:UIControlEventTouchUpInside]; - } - return _clickBtn; -} -@end diff --git a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginAuthCodeVC.h.backup b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginAuthCodeVC.h.backup deleted file mode 100644 index ce32dd1..0000000 --- a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginAuthCodeVC.h.backup +++ /dev/null @@ -1,23 +0,0 @@ -// -// XPLoginAuthCodeVC.h -// YuMi -// -// Created by duoban on 2023/8/11. -// - -#import "MvpViewController.h" - -@protocol XPLoginAuthCodeVCDelegate - --(void)bindCodeSuccess; - -@end - -NS_ASSUME_NONNULL_BEGIN - -@interface XPLoginAuthCodeVC : MvpViewController -@property(nonatomic,weak) iddelegate; -@property(nonatomic,assign) BOOL pi_isPush; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginAuthCodeVC.m.backup b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginAuthCodeVC.m.backup deleted file mode 100644 index 23cdfdb..0000000 --- a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginAuthCodeVC.m.backup +++ /dev/null @@ -1,165 +0,0 @@ -// -// XPLoginAuthCodeVC.m -// YuMi -// -// Created by duoban on 2023/8/11. -// - -#import "XPLoginAuthCodeVC.h" -#import "XPLoginInputView.h" -#import -#import "LoginVerifCodePresent.h" -#import "LoginFullInfoViewController.h" -@interface XPLoginAuthCodeVC () -///背景 -@property(nonatomic,strong) UIImageView *bgImageView; - -/// 手机号登录 -@property (nonatomic, strong) UILabel *titleLabel; -/// 手机号输入框 -@property (nonatomic, strong) XPLoginInputView *codeInputView; -/// 登录按钮 -@property (nonatomic, strong) UIButton *loginBtn; -@end - -@implementation XPLoginAuthCodeVC -- (BOOL)isHiddenNavBar { - return YES; -} -- (LoginVerifCodePresent *)createPresenter { - return [[LoginVerifCodePresent alloc] init]; -} -- (void)viewDidLoad { - [super viewDidLoad]; - [self installUI]; - [self installConstraints]; - [self racBind]; -} --(void)installUI{ - self.view.backgroundColor = [UIColor whiteColor]; - [self.view addSubview:self.bgImageView]; - [self.view addSubview:self.titleLabel]; - - -} --(void)installConstraints{ - UIView *bgView = [UIView new]; - bgView.backgroundColor = [UIColor whiteColor]; - [self.view addSubview:bgView]; - bgView.layer.cornerRadius = kGetScaleWidth(20); - bgView.layer.masksToBounds = YES; - [self.view addSubview:self.codeInputView]; - [self.view addSubview:self.loginBtn]; - [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.top.equalTo(self.view); - make.height.mas_equalTo(kGetScaleWidth(418)); - }]; - - [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.mas_equalTo(self.view); - make.top.mas_equalTo(kGetScaleWidth(128)); - make.leading.mas_equalTo(kGetScaleWidth(24)); - make.height.mas_equalTo(kGetScaleWidth(40)); - }]; - [bgView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.bottom.equalTo(self.view); - make.top.mas_equalTo(kGetScaleWidth(192)); - }]; - [self.codeInputView mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.equalTo(self.view); - make.width.mas_equalTo(kGetScaleWidth(303)); - make.top.mas_equalTo(kGetScaleWidth(260)); - make.height.mas_equalTo(kGetScaleWidth(52)); - }]; - [self.loginBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.codeInputView.mas_bottom).offset(kGetScaleWidth(48)); - make.centerX.mas_equalTo(self.view); - make.height.mas_equalTo(kGetScaleWidth(48)); - make.width.mas_equalTo(kGetScaleWidth(303)); - }]; -} -- (void)racBind { - - RAC(self.loginBtn, enabled) = [[RACSignal combineLatest:@[self.codeInputView.inputTextField.rac_textSignal] reduce:^id _Nonnull(NSString *account){ - - return @(account.length > 0); - }] takeUntil:self.rac_willDeallocSignal]; -} --(void)loginBtnClicked{ - [self showLoading]; - [self.presenter bindAuthorizationCodeWithAuthCode:self.codeInputView.inputTextField.text]; -} -#pragma mark - LoginVerifCodeProtocol -- (void)bindAuthorizationCodeSuccess{ - [self hideHUD]; - [self showSuccessToast:YMLocalizedString(@"XPLoginAuthCodeVC2")]; - self.loginBtn.enabled = YES; - if(self.pi_isPush == YES){ - LoginFullInfoViewController * FullVC = [[LoginFullInfoViewController alloc] init]; - [self.navigationController pushViewController:FullVC animated:YES]; - return; - } - [self dismissViewControllerAnimated:YES completion:nil]; - if(self.delegate && [self.delegate respondsToSelector:@selector(bindCodeSuccess)]){ - [self.delegate bindCodeSuccess]; - } - -} --(void)bindAuthorizationCodeFail{ - [self hideHUD]; - self.loginBtn.enabled = YES; -} -#pragma mark - 懒加载 - -- (UILabel *)titleLabel { - if (!_titleLabel) { - _titleLabel = [[UILabel alloc] init]; - _titleLabel.text = YMLocalizedString(@"XPLoginAuthCodeVC0"); - _titleLabel.font = kFontBold(28); - _titleLabel.textColor = UIColorFromRGB(0x1F1B4F); - } - return _titleLabel; -} -- (UIImageView *)bgImageView{ - if(!_bgImageView){ - _bgImageView = [[UIImageView alloc]init]; - _bgImageView.image = kImage(@"login_phone_pwd_bg"); - _bgImageView.contentMode = 2; - } - return _bgImageView; -} -- (XPLoginInputView *)codeInputView { - if (!_codeInputView) { - _codeInputView = [[XPLoginInputView alloc] init]; - NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginAuthCodeVC1")]; - [placeholder addAttribute:NSForegroundColorAttributeName value:UIColorFromRGB(0xB3B3C3) range:NSMakeRange(0, placeholder.length)]; - _codeInputView.inputTextField.attributedPlaceholder = placeholder; - _codeInputView.inputTextField.keyboardType = UIKeyboardTypeNumberPad; - - } - return _codeInputView; -} -- (UIButton *)loginBtn { - if (!_loginBtn) { - _loginBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - - UIImage *nextImage = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor],[DJDKMIMOMColor confirmButtonGradientMiddleColor],[DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(303), kGetScaleWidth(48))]; - UIImage *disableImage = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xD1F9FF),UIColorFromRGB(0xDEE4FF),UIColorFromRGB(0xEEDCFF)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(303), kGetScaleWidth(48))]; - - [_loginBtn setImage:nextImage forState:UIControlStateNormal]; - [_loginBtn setImage:disableImage forState:UIControlStateDisabled]; - _loginBtn.layer.cornerRadius = kGetScaleWidth(48)/2; - _loginBtn.layer.masksToBounds = YES; - - - UILabel *titleView = [UILabel labelInitWithText:YMLocalizedString(@"XPLoginAuthCodeVC3") font:kFontMedium(16) textColor:[UIColor whiteColor]]; - titleView.textAlignment = NSTextAlignmentCenter; - [_loginBtn addSubview:titleView]; - [titleView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(self.loginBtn); - }]; - [_loginBtn addTarget:self action:@selector(loginBtnClicked) forControlEvents:UIControlEventTouchUpInside]; - } - return _loginBtn; -} -@end diff --git a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginInputView.h.backup b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginInputView.h.backup deleted file mode 100644 index 9a753e7..0000000 --- a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginInputView.h.backup +++ /dev/null @@ -1,37 +0,0 @@ -// -// YMLoginInputView.h -// YUMI -// -// Created by XY on 2023/2/14. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@protocol XPLoginInputViewDelegate - -- (void)smsCodeAction; - -- (void)areaListAction; - -@end - -@interface XPLoginInputView : UIView -/// -@property (nonatomic,strong) UIStackView *areaStackView; -/// 区号 -@property (nonatomic, strong) UIButton *areaCodeBtn; -/// 输入框 -@property (nonatomic, strong) UITextField *inputTextField; -/// 验证码 -@property (nonatomic, strong) UIButton *smsCodeBtn; - -@property (nonatomic, weak) id delegate; - -//开启倒计时 -- (void)fireTimer; --(void)cancelTimer; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginInputView.m.backup b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginInputView.m.backup deleted file mode 100644 index 204adf0..0000000 --- a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginInputView.m.backup +++ /dev/null @@ -1,168 +0,0 @@ -// -// YMLoginInputView.m -// YUMI -// -// Created by XY on 2023/2/14. -// - -#import "XPLoginInputView.h" -#import "DJDKMIMOMColor.h" -#import -#import -#import "LoginAreaModel.h" -#import "MSBaseTextField.h" -@interface XPLoginInputView() - -@property (nonatomic, strong) dispatch_source_t timer; - -@property (nonatomic,strong) UIImageView *areaImageView; -@end - -@implementation XPLoginInputView - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - self.backgroundColor = UIColorFromRGB(0xF3F5FA); - self.layer.cornerRadius = kGetScaleWidth(52)/2; - self.layer.masksToBounds = YES; - - [self createUI]; - } - return self; -} - -- (void)createUI { - UIStackView *stackView = [[UIStackView alloc] init]; - stackView.axis = UILayoutConstraintAxisHorizontal; - stackView.distribution = UIStackViewDistributionFill; - stackView.alignment = UIStackViewAlignmentCenter; - stackView.spacing = kGetScaleWidth(8); - [self addSubview:stackView]; - - - UIImageView * areaImageView = [[UIImageView alloc] init]; - areaImageView.userInteractionEnabled = YES; - areaImageView.image = [UIImage imageNamed:@"login_area_arrow"]; - areaImageView.userInteractionEnabled = NO; - - /// 区号 - NSString *code = [NSString getCountryCode]; - UIButton *areaCodeBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - [areaCodeBtn setTitle:code forState:UIControlStateNormal]; - [areaCodeBtn setTitleColor:UIColorFromRGB(0x1F1B4F) forState:UIControlStateNormal]; - areaCodeBtn.titleLabel.font = kFontMedium(16); - _areaCodeBtn = areaCodeBtn; - areaCodeBtn.userInteractionEnabled = NO; - - UIStackView *areaStackView = [[UIStackView alloc] init]; - areaStackView.axis = UILayoutConstraintAxisHorizontal; - areaStackView.distribution = UIStackViewDistributionFill; - areaStackView.alignment = UIStackViewAlignmentCenter; - areaStackView.spacing = kGetScaleWidth(8); - - UIButton *areaBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - [areaBtn addTarget:self action:@selector(areaChooseClicked) forControlEvents:UIControlEventTouchUpInside]; - [areaStackView addSubview:areaBtn]; - - [areaStackView addArrangedSubview:areaCodeBtn]; - [areaStackView addArrangedSubview:areaImageView]; - - [stackView addArrangedSubview:areaStackView]; - self.areaStackView = areaStackView; - - /// 输入框 - MSBaseTextField *inputTextField = [[MSBaseTextField alloc] init]; - inputTextField.textColor = UIColorFromRGB(0x1F1B4F); - inputTextField.font = kFontRegular(14); - [stackView addArrangedSubview:inputTextField]; - self.inputTextField = inputTextField; - /// 获取验证码 - UIButton *smsCodeBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - [smsCodeBtn setTitle:YMLocalizedString(@"XPLoginInputView0") forState:UIControlStateNormal]; - [smsCodeBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - smsCodeBtn.titleLabel.font = kFontMedium(12); - smsCodeBtn.titleLabel.textAlignment = NSTextAlignmentCenter; - smsCodeBtn.titleLabel.numberOfLines = 2; - smsCodeBtn.layer.cornerRadius = kGetScaleWidth(38)/2; - smsCodeBtn.layer.masksToBounds = YES; - smsCodeBtn.backgroundColor = UIColorFromRGB(0x9168FA); - [smsCodeBtn addTarget:self action:@selector(smsCodeBtnClicked) forControlEvents:UIControlEventTouchUpInside]; - [stackView addArrangedSubview:smsCodeBtn]; - self.smsCodeBtn = smsCodeBtn; - - [stackView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(kGetScaleWidth(24)); - make.trailing.mas_equalTo(-kGetScaleWidth(24)); - make.top.bottom.mas_equalTo(0); - }]; - - - [areaImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(kGetScaleWidth(12)); - make.height.mas_equalTo(kGetScaleWidth(8)); - }]; - - [areaCodeBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_lessThanOrEqualTo(kGetScaleWidth(60)); - make.height.mas_equalTo(stackView); - }]; - [inputTextField mas_makeConstraints:^(MASConstraintMaker *make) { - make.height.mas_equalTo(stackView); - }]; - [smsCodeBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(kGetScaleWidth(102)); - make.height.mas_equalTo(kGetScaleWidth(38)); - }]; - - [areaBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.mas_equalTo(areaStackView); - }]; - - - self.areaStackView.hidden = YES; - self.smsCodeBtn.hidden = YES; -} - -- (void)smsCodeBtnClicked { - if (self.delegate && [self.delegate respondsToSelector:@selector(smsCodeAction)]) { - [self.delegate smsCodeAction]; - } -} - -- (void)areaChooseClicked { - if (self.delegate && [self.delegate respondsToSelector:@selector(areaListAction)]) { - [self.delegate areaListAction]; - } -} - -//开启倒计时 -- (void)fireTimer { - __block NSInteger count = 60; - dispatch_queue_t queue = dispatch_get_main_queue(); - dispatch_source_t timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue); - dispatch_source_set_timer(timer, DISPATCH_TIME_NOW, 1.0 * NSEC_PER_SEC, 0 * NSEC_PER_SEC); - @weakify(self); - dispatch_source_set_event_handler(timer, ^{ - @strongify(self); - count--; - if (count < 0) { - [self.smsCodeBtn setTitle:YMLocalizedString(@"XPLoginInputView1") forState:UIControlStateNormal]; - self.smsCodeBtn.userInteractionEnabled = YES; - dispatch_cancel(self.timer); - self.timer = nil; - }else{ - [self.smsCodeBtn setTitle:[NSString stringWithFormat:@"%lds",count] forState:UIControlStateNormal]; - self.smsCodeBtn.userInteractionEnabled = NO; - } - }); - dispatch_resume(timer); - self.timer = timer; -} --(void)cancelTimer{ - if (self.timer != nil){ - dispatch_cancel(self.timer); - self.timer = nil; - } -} -@end diff --git a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginPhoneViewController.h.backup b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginPhoneViewController.h.backup deleted file mode 100644 index ecf4326..0000000 --- a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginPhoneViewController.h.backup +++ /dev/null @@ -1,16 +0,0 @@ -// -// YMLoginPhoneViewController.h -// YUMI -// -// Created by XY on 2023/2/13. -// - -#import "MvpViewController.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface XPLoginPhoneViewController : MvpViewController - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginPhoneViewController.m.backup b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginPhoneViewController.m.backup deleted file mode 100644 index 55bcbca..0000000 --- a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginPhoneViewController.m.backup +++ /dev/null @@ -1,430 +0,0 @@ -// -// YMLoginPhoneViewController.m -// YUMI -// -// Created by XY on 2023/2/13. -// - -#import "XPLoginPhoneViewController.h" -#import -#import "YUMIMacroUitls.h" -#import - -#import "XPLoginInputView.h" -#import "PILoginManager.h" -#import "XPLoginPwdViewController.h" -#import "XPLoginAraeViewController.h" -#import "LoginVerifCodePresent.h" -#import "LoginVerifCodeProtocol.h" -#import "XPForgetPwdViewController.h" - -@interface XPLoginPhoneViewController () -///背景 -@property(nonatomic,strong) UIImageView *bgImageView; -///返回 -@property(nonatomic,strong) UIButton *backBnt; - -/// 手机号登录 -@property (nonatomic, strong) UILabel *titleLabel; -/// 未注册的手机号自动登录 -@property (nonatomic, strong) UILabel *despLabel; -///选择类型背景 -@property(nonatomic,strong) UIImageView *chooseTypeView; -///选择手机登录 -@property(nonatomic,strong) UIButton *choosePhoneBtn; -///选择密码登录 -@property(nonatomic,strong) UIButton *choosePsdBtn; -/// 手机号输入框 -@property (nonatomic, strong) XPLoginInputView *phoneInputView; -/// 验证码输入框 -@property (nonatomic, strong) XPLoginInputView *codeInputView; - - -///// 账号登录手机号输入框 -@property (nonatomic, strong) XPLoginInputView *accountView; -/// 账号登录密码输入框 -@property (nonatomic, strong) XPLoginInputView *accountPwdView; -/// 忘记密码 -@property (nonatomic, strong) UIButton *forgetBtn; - -/// 登录按钮 -@property (nonatomic, strong) UIButton *loginBtn; - -///区号 -@property (nonatomic,copy) NSString *pi_phoneAreaCode; -///类型,0,密码,1.手机 -@property(nonatomic,assign) int selectType; -@end - -@implementation XPLoginPhoneViewController -- (BOOL)isHiddenNavBar { - return YES; -} -- (LoginVerifCodePresent *)createPresenter { - return [[LoginVerifCodePresent alloc] init]; -} - - -- (void)viewDidLoad { - self.selectType = 0; - NSString *code = [NSString getCountryCode]; - self.pi_phoneAreaCode = [code stringByReplacingOccurrencesOfString:@"+" withString:@""]; - [super viewDidLoad]; - [self createUI]; - [self racBind]; -} - -- (void)createUI { - self.view.backgroundColor = [UIColor whiteColor]; - [self.view addSubview:self.bgImageView]; - [self.view addSubview:self.backBnt]; - [self.view addSubview:self.titleLabel]; - - [self.view addSubview:self.chooseTypeView]; - [self.chooseTypeView addSubview:self.choosePhoneBtn]; - [self.chooseTypeView addSubview:self.choosePsdBtn]; - UIView *bgView = [UIView new]; - bgView.backgroundColor = [UIColor whiteColor]; - [self.view addSubview:bgView]; - [self.view addSubview:self.phoneInputView]; - [self.view addSubview:self.codeInputView]; - [self.view addSubview:self.accountView]; - [self.view addSubview:self.accountPwdView]; - [self.view addSubview:self.forgetBtn]; - - [self.view addSubview:self.loginBtn]; - [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.top.equalTo(self.view); - make.height.mas_equalTo(kGetScaleWidth(418)); - }]; - [self.backBnt mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(kGetScaleWidth(20)); - make.width.mas_equalTo(kGetScaleWidth(28)); - make.height.mas_equalTo(kGetScaleWidth(28)); - make.top.mas_equalTo(kGetScaleWidth(52)); - }]; - [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.mas_equalTo(self.view); - make.top.equalTo(self.backBnt.mas_bottom).mas_offset(kGetScaleWidth(48)); - make.leading.mas_equalTo(kGetScaleWidth(24)); - make.height.mas_equalTo(kGetScaleWidth(40)); - }]; - - [self.chooseTypeView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.titleLabel.mas_bottom).mas_offset(kGetScaleWidth(24)); - make.leading.trailing.equalTo(self.view); - make.height.mas_equalTo(kGetScaleWidth(65)); - }]; - - [self.choosePsdBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(kGetScaleWidth(16)); - make.height.mas_equalTo(kGetScaleWidth(22)); - make.width.mas_equalTo(KScreenWidth/2); - make.leading.mas_equalTo(0); - }]; - [self.choosePhoneBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(kGetScaleWidth(16)); - make.height.mas_equalTo(kGetScaleWidth(22)); - make.width.mas_equalTo(KScreenWidth/2); - make.trailing.mas_equalTo(0); - }]; - [bgView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.bottom.equalTo(self.view); - make.top.equalTo(self.chooseTypeView.mas_bottom); - }]; - [self.phoneInputView mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.equalTo(self.view); - make.width.mas_equalTo(kGetScaleWidth(303)); - make.top.mas_equalTo(self.chooseTypeView.mas_bottom).offset(kGetScaleWidth(39)); - make.height.mas_equalTo(kGetScaleWidth(52)); - }]; - [self.codeInputView mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.equalTo(self.view); - make.width.mas_equalTo(kGetScaleWidth(303)); - make.top.mas_equalTo(self.phoneInputView.mas_bottom).offset(kGetScaleWidth(20)); - make.height.mas_equalTo(kGetScaleWidth(52)); - }]; - - [self.accountView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(self.phoneInputView); - }]; - [self.accountPwdView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(self.codeInputView); - }]; - [self.forgetBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.trailing.mas_equalTo(-kGetScaleWidth(52)); - make.height.mas_equalTo(kGetScaleWidth(17)); - make.top.equalTo(self.accountPwdView.mas_bottom).mas_offset(kGetScaleWidth(8)); - }]; - [self.loginBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.codeInputView.mas_bottom).offset(kGetScaleWidth(48)); - make.centerX.mas_equalTo(self.view); - make.height.mas_equalTo(kGetScaleWidth(48)); - make.width.mas_equalTo(kGetScaleWidth(303)); - }]; -} - -- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ - [self.view endEditing:YES]; -} - -- (void)racBind { - @weakify(self); - RAC(self.loginBtn, enabled) = [[RACSignal combineLatest:@[self.phoneInputView.inputTextField.rac_textSignal, self.codeInputView.inputTextField.rac_textSignal,self.accountView.inputTextField.rac_textSignal,self.accountPwdView.inputTextField.rac_textSignal] reduce:^id _Nonnull(NSString *phone, NSString* smsCode,NSString *account,NSString *accountPwd){ - @strongify(self); - if(self.selectType == 0){ - return @((account.length > 0) && accountPwd.length >= 6); - } - return @((phone.length > 0) && smsCode.length >= 5); - }] takeUntil:self.rac_willDeallocSignal]; -} - -/// 登录 -- (void)loginBtnClicked { - [XNDJTDDLoadingTool showOnlyView:self.view]; - if(self.selectType == 0){ - NSString *phone = self.accountView.inputTextField.text; - NSString *password = self.accountPwdView.inputTextField.text; - [self.presenter loginWithPhone:phone password:password]; - return; - } - - NSString *phone = self.phoneInputView.inputTextField.text; - NSString *smsCode = self.codeInputView.inputTextField.text; - NSString * phoneStr = [NSString stringWithFormat:@"%@%@",self.pi_phoneAreaCode, phone]; - [self.presenter loginWithPhone:phoneStr code:smsCode phoneAreaCode:self.pi_phoneAreaCode]; -} - -- (void)forgetBtnClicked { - XPForgetPwdViewController *forgetVC = [[XPForgetPwdViewController alloc] init]; - [self.navigationController pushViewController:forgetVC animated:YES]; -} - -#pragma mark - XPLoginInputViewDelegate - -- (void)smsCodeAction { - NSString *phone = self.phoneInputView.inputTextField.text; - if (phone.length == 0 ) { - [self showErrorToast:YMLocalizedString(@"XPLoginPhoneViewController0")]; - return; - } - [self.presenter phoneSmsCode:[NSString stringWithFormat:@"%@%@",self.pi_phoneAreaCode,phone] type:GetSmsType_Regist phoneAreaCode:self.pi_phoneAreaCode]; -} - -- (void)areaListAction { - XPLoginAraeViewController *codeVC = [XPLoginAraeViewController new]; - codeVC.delegate = self; - [self.navigationController pushViewController:codeVC animated:YES]; -} - -- (void)chooseAreaCodeSuccess:(NSString *)code { - if (code.length > 0) { - self.pi_phoneAreaCode = code; - [self.phoneInputView.areaCodeBtn setTitle:[NSString stringWithFormat:@"+%@", code] forState:UIControlStateNormal]; - } -} - -#pragma mark - LoginVerifCodeProtocol -- (void)loginWithPhoenSuccess{ - [XNDJTDDLoadingTool hideOnlyView:self.view]; - [self showSuccessToast:YMLocalizedString(@"XPLoginPhoneViewController1")]; - [PILoginManager loginWithVC:self isLoginPhone:YES]; -} -- (void)loginSuccess { - [XNDJTDDLoadingTool hideOnlyView:self.view]; - [self showSuccessToast:YMLocalizedString(@"XPLoginPhoneViewController1")]; - [PILoginManager loginWithVC:self isLoginPhone:NO]; -} -- (void)loginFailWithMsg:(NSString *)msg{ - [self showErrorToast:msg]; - [XNDJTDDLoadingTool hideOnlyView:self.view]; -} --(void)backViewAction{ - [self.navigationController popViewControllerAnimated:YES]; -} - -#pragma mark - LoginProtocol -- (void)phoneSmsCodeSuccess { - [self showSuccessToast:YMLocalizedString(@"XPLoginPhoneViewController2")]; - [self.codeInputView fireTimer]; -} - - --(void)setSelectType:(int)selectType{ - _selectType = selectType; - _chooseTypeView.image = _selectType == 0 ? kImage(@"login_choose_phone_bg"): kImage(@"login_choose_pwd_bg"); - _choosePhoneBtn.selected = _selectType != 0; - _choosePsdBtn.selected = _selectType == 0; - _forgetBtn.hidden = _selectType != 0; - - _phoneInputView.hidden = _selectType == 0; - _codeInputView.hidden = _selectType == 0; - _accountView.hidden = _selectType != 0; - _accountPwdView.hidden = _selectType != 0; - -} --(void)choosePhoneAction{ - self.selectType = 1; -} --(void)choosePwdAction{ - self.selectType = 0; -} -#pragma mark - 懒加载 - -- (UILabel *)titleLabel { - if (!_titleLabel) { - _titleLabel = [[UILabel alloc] init]; - _titleLabel.text = @"Welcome to E-Party!"; - _titleLabel.font = kFontBold(28); - _titleLabel.textColor = UIColorFromRGB(0x1F1B4F); - } - return _titleLabel; -} - -- (UILabel *)despLabel { - if (!_despLabel) { - _despLabel = [[UILabel alloc] init]; - _despLabel.text = YMLocalizedString(@"XPLoginPhoneViewController4"); - _despLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular]; - _despLabel.textColor = [UIColor.whiteColor colorWithAlphaComponent:0.6]; - } - return _despLabel; -} - -- (XPLoginInputView *)phoneInputView { - if (!_phoneInputView) { - _phoneInputView = [[XPLoginInputView alloc] init]; - _phoneInputView.areaStackView.hidden = NO; - _phoneInputView.delegate = self; - NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginPhoneViewController5")]; - [placeholder addAttribute:NSForegroundColorAttributeName value:UIColorFromRGB(0xB3B3C3) range:NSMakeRange(0, placeholder.length)]; - _phoneInputView.inputTextField.attributedPlaceholder = placeholder; - _phoneInputView.inputTextField.keyboardType = UIKeyboardTypeNumberPad; - _phoneInputView.hidden = YES; - } - return _phoneInputView; -} - -- (XPLoginInputView *)codeInputView { - if (!_codeInputView) { - _codeInputView = [[XPLoginInputView alloc] init]; - _codeInputView.smsCodeBtn.hidden = NO; - NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginPhoneViewController6")]; - [placeholder addAttribute:NSForegroundColorAttributeName value:UIColorFromRGB(0xB3B3C3) range:NSMakeRange(0, placeholder.length)]; - _codeInputView.inputTextField.attributedPlaceholder = placeholder; - _codeInputView.inputTextField.keyboardType = UIKeyboardTypeNumberPad; - _codeInputView.delegate = self; - _codeInputView.hidden = YES; - } - return _codeInputView; -} - -- (UIButton *)loginBtn { - if (!_loginBtn) { - _loginBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - - UIImage *nextImage = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor],[DJDKMIMOMColor confirmButtonGradientMiddleColor],[DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(303), kGetScaleWidth(48))]; - UIImage *disableImage = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xD1F9FF),UIColorFromRGB(0xDEE4FF),UIColorFromRGB(0xEEDCFF)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(303), kGetScaleWidth(48))]; - - [_loginBtn setImage:nextImage forState:UIControlStateNormal]; - [_loginBtn setImage:disableImage forState:UIControlStateDisabled]; - _loginBtn.layer.cornerRadius = kGetScaleWidth(48)/2; - _loginBtn.layer.masksToBounds = YES; - - - UILabel *titleView = [UILabel labelInitWithText:YMLocalizedString(@"XPLoginPhoneViewController8") font:kFontMedium(16) textColor:[UIColor whiteColor]]; - titleView.textAlignment = NSTextAlignmentCenter; - [_loginBtn addSubview:titleView]; - [titleView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(self.loginBtn); - }]; - [_loginBtn addTarget:self action:@selector(loginBtnClicked) forControlEvents:UIControlEventTouchUpInside]; - } - return _loginBtn; -} - -- (UIImageView *)bgImageView{ - if(!_bgImageView){ - _bgImageView = [[UIImageView alloc]init]; - _bgImageView.image = kImage(@"login_phone_pwd_bg"); - _bgImageView.contentMode = 2; - } - return _bgImageView; -} -- (UIButton *)backBnt{ - if(!_backBnt){ - _backBnt = [UIButton new]; - [_backBnt setImage:[kImage(@"common_nav_back")ms_SetImageForRTL] forState:UIControlStateNormal]; - [_backBnt addTarget:self action:@selector(backViewAction) forControlEvents:UIControlEventTouchUpInside]; - [_backBnt setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10]; - } - return _backBnt; -} -- (UIImageView *)chooseTypeView{ - if(!_chooseTypeView){ - _chooseTypeView = [UIImageView new]; - _chooseTypeView.userInteractionEnabled = YES; - [_chooseTypeView setImage:kImage(@"login_choose_phone_bg")]; - } - return _chooseTypeView; -} -- (UIButton *)choosePhoneBtn{ - if(!_choosePhoneBtn){ - _choosePhoneBtn = [UIButton new]; - [_choosePhoneBtn setTitle:YMLocalizedString(@"1.0.37_text_26") forState:UIControlStateNormal]; - [_choosePhoneBtn setTitleColor:UIColorFromRGB(0x6D6B89) forState:UIControlStateNormal]; - [_choosePhoneBtn setTitleColor:UIColorFromRGB(0x1F1B4F) forState:UIControlStateSelected]; - _choosePhoneBtn.titleLabel.font = kFontSemibold(16); - [ _choosePhoneBtn setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10]; - [_choosePhoneBtn addTarget:self action:@selector(choosePhoneAction) forControlEvents:UIControlEventTouchUpInside]; - } - return _choosePhoneBtn; -} -- (UIButton *)choosePsdBtn{ - if(!_choosePsdBtn){ - _choosePsdBtn = [UIButton new]; - [_choosePsdBtn setTitle:YMLocalizedString(@"1.0.37_text_27") forState:UIControlStateNormal]; - [_choosePsdBtn setTitleColor:UIColorFromRGB(0x6D6B89) forState:UIControlStateNormal]; - [_choosePsdBtn setTitleColor:UIColorFromRGB(0x1F1B4F) forState:UIControlStateSelected]; - _choosePsdBtn.titleLabel.font = kFontSemibold(16); - [_choosePsdBtn setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10]; - [_choosePsdBtn addTarget:self action:@selector(choosePwdAction) forControlEvents:UIControlEventTouchUpInside]; - _choosePsdBtn.selected = YES; - } - return _choosePsdBtn; -} - -- (XPLoginInputView *)accountView { - if (!_accountView) { - _accountView = [[XPLoginInputView alloc] init]; - _accountView.areaStackView.hidden = YES; - NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginPwdViewController6")]; - [placeholder addAttribute:NSForegroundColorAttributeName value:UIColorFromRGB(0xB3B3C3) range:NSMakeRange(0, placeholder.length)]; - _accountView.inputTextField.attributedPlaceholder = placeholder; - _accountView.inputTextField.keyboardType = UIKeyboardTypeNumberPad; - } - return _accountView; -} - -- (XPLoginInputView *)accountPwdView { - if (!_accountPwdView) { - _accountPwdView = [[XPLoginInputView alloc] init]; - NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginPwdViewController3")]; - [placeholder addAttribute:NSForegroundColorAttributeName value:UIColorFromRGB(0xB3B3C3) range:NSMakeRange(0, placeholder.length)]; - _accountPwdView.inputTextField.attributedPlaceholder = placeholder; - _accountPwdView.inputTextField.keyboardType = UIKeyboardTypeAlphabet; - _accountPwdView.inputTextField.secureTextEntry = YES; - } - return _accountPwdView; -} -- (UIButton *)forgetBtn { - if (!_forgetBtn) { - _forgetBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - [_forgetBtn setTitle:YMLocalizedString(@"XPRoomRedPacketPwdView1") forState:UIControlStateNormal]; - [_forgetBtn setTitleColor:UIColorFromRGB(0xB3B3C3) forState:UIControlStateNormal]; - _forgetBtn.titleLabel.font = kFontRegular(12); - [_forgetBtn addTarget:self action:@selector(forgetBtnClicked) forControlEvents:UIControlEventTouchUpInside]; - } - return _forgetBtn; -} -@end diff --git a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginPwdViewController.h.backup b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginPwdViewController.h.backup deleted file mode 100644 index 04ae51d..0000000 --- a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginPwdViewController.h.backup +++ /dev/null @@ -1,16 +0,0 @@ -// -// YMLoginPwdViewController.h -// YUMI -// -// Created by XY on 2023/2/14. -// - -#import "MvpViewController.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface XPLoginPwdViewController : MvpViewController - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginPwdViewController.m.backup b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginPwdViewController.m.backup deleted file mode 100644 index 28da678..0000000 --- a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginPwdViewController.m.backup +++ /dev/null @@ -1,193 +0,0 @@ -// -// YMLoginPwdViewController.m -// YUMI -// -// Created by XY on 2023/2/14. -// - -#import "XPLoginPwdViewController.h" -#import -#import "YUMIMacroUitls.h" -#import - -#import "XPLoginInputView.h" -#import "XPLoginPwdViewController.h" -#import "XPForgetPwdViewController.h" - -#import "LoginPasswordPresent.h" -#import "LoginPasswordProtocol.h" - -@interface XPLoginPwdViewController () - -/// 密码登录 -@property (nonatomic, strong) UILabel *titleLabel; -/// 手机号输入框 -@property (nonatomic, strong) XPLoginInputView *phoneInputView; -/// 密码输入框 -@property (nonatomic, strong) XPLoginInputView *pwdInputView; -/// 忘记密码 -@property (nonatomic, strong) UIButton *forgetBtn; -/// 登录按钮 -@property (nonatomic, strong) UIButton *loginBtn; -/// 密码登录 -@property (nonatomic, strong) UIButton *phoneLoginBtn; - - -@end - -@implementation XPLoginPwdViewController - -- (LoginPasswordPresent *)createPresenter { - return [[LoginPasswordPresent alloc] init]; -} - -- (void)viewDidLoad { - - [super viewDidLoad]; - [self createUI]; - [self racBind]; -} - -- (void)createUI { - [self.view addSubview:self.titleLabel]; - [self.view addSubview:self.phoneInputView]; - [self.view addSubview:self.pwdInputView]; - [self.view addSubview:self.loginBtn]; - [self.view addSubview:self.phoneLoginBtn]; - [self.view addSubview:self.forgetBtn]; - - [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.mas_equalTo(self.view); - make.top.mas_equalTo(146.0/812.0*KScreenHeight); - }]; - [self.phoneInputView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(38); - make.trailing.mas_equalTo(-38); - make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(41); - make.height.mas_equalTo(66); - }]; - [self.pwdInputView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(self.phoneInputView); - make.trailing.mas_equalTo(self.phoneInputView); - make.top.mas_equalTo(self.phoneInputView.mas_bottom).offset(16); - make.height.mas_equalTo(self.phoneInputView); - }]; - [self.loginBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.pwdInputView.mas_bottom).offset(51); - make.centerX.mas_equalTo(self.view); - make.width.height.mas_equalTo(96); - }]; - [self.phoneLoginBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.loginBtn.mas_bottom).offset(24); - make.centerX.mas_equalTo(self.view); - }]; - [self.forgetBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.trailing.mas_equalTo(self.pwdInputView); - make.top.mas_equalTo(self.pwdInputView.mas_bottom).offset(10); - }]; - -} - -- (void)racBind { - RAC(self.loginBtn, enabled) = [[RACSignal combineLatest:@[self.phoneInputView.inputTextField.rac_textSignal, self.pwdInputView.inputTextField.rac_textSignal] reduce:^id _Nonnull(NSString *phone, NSString* password){ - return @((phone.length > 0) && password.length >= 6); - }] takeUntil:self.rac_willDeallocSignal]; -} - -- (void)loginBtnClicked { - NSString *phone = self.phoneInputView.inputTextField.text; - NSString *password = self.pwdInputView.inputTextField.text; - [self.presenter loginWithPhone:phone password:password]; -} - -- (void)phoneLoginBtnClicked { - [self.navigationController popViewControllerAnimated:YES]; -} - -- (void)forgetBtnClicked { - XPForgetPwdViewController *forgetVC = [[XPForgetPwdViewController alloc] init]; - [self.navigationController pushViewController:forgetVC animated:YES]; -} - -#pragma mark - LoginPasswordProtocol -- (void)phoneAndPasswordLoginSuccess { - [self showSuccessToast:YMLocalizedString(@"XPLoginPwdViewController0")]; - UIViewController *vc = self.presentingViewController; - while (vc.presentingViewController) { - vc = vc.presentingViewController; - } - [vc dismissViewControllerAnimated:YES completion:nil]; - [self.navigationController popToRootViewControllerAnimated:NO]; -} - -#pragma mark - 懒加载 - -- (UILabel *)titleLabel { - if (!_titleLabel) { - _titleLabel = [[UILabel alloc] init]; - _titleLabel.text = YMLocalizedString(@"XPLoginPwdViewController1"); - _titleLabel.font = [UIFont systemFontOfSize:24 weight:UIFontWeightMedium]; - _titleLabel.textColor = UIColor.whiteColor; - } - return _titleLabel; -} - -- (XPLoginInputView *)phoneInputView { - if (!_phoneInputView) { - _phoneInputView = [[XPLoginInputView alloc] init]; - _phoneInputView.areaStackView.hidden = YES; - NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginPwdViewController2")]; - [placeholder addAttribute:NSForegroundColorAttributeName value:UIColor.whiteColor range:NSMakeRange(0, placeholder.length)]; - _phoneInputView.inputTextField.attributedPlaceholder = placeholder; - _phoneInputView.inputTextField.keyboardType = UIKeyboardTypeNumberPad; - } - return _phoneInputView; -} - -- (XPLoginInputView *)pwdInputView { - if (!_pwdInputView) { - _pwdInputView = [[XPLoginInputView alloc] init]; - NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginPwdViewController3")]; - [placeholder addAttribute:NSForegroundColorAttributeName value:UIColor.whiteColor range:NSMakeRange(0, placeholder.length)]; - _pwdInputView.inputTextField.attributedPlaceholder = placeholder; - _pwdInputView.inputTextField.keyboardType = UIKeyboardTypeAlphabet; - _pwdInputView.inputTextField.secureTextEntry = YES; - } - return _pwdInputView; -} -- (UIButton *)forgetBtn { - if (!_forgetBtn) { - _forgetBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - [_forgetBtn setTitle:YMLocalizedString(@"XPRoomRedPacketPwdView1") forState:UIControlStateNormal]; - [_forgetBtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal]; - _forgetBtn.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular]; - [_forgetBtn addTarget:self action:@selector(forgetBtnClicked) forControlEvents:UIControlEventTouchUpInside]; - } - return _forgetBtn; -} -- (UIButton *)loginBtn { - if (!_loginBtn) { - _loginBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - [_loginBtn setImage:[UIImage imageNamed:@"login_next"] forState:UIControlStateNormal]; - [_loginBtn setImage:[UIImage imageNamed:@"login_next_disable"] forState:UIControlStateDisabled]; - [_loginBtn addTarget:self action:@selector(loginBtnClicked) forControlEvents:UIControlEventTouchUpInside]; - } - return _loginBtn; -} - -- (UIButton *)phoneLoginBtn { - if (!_phoneLoginBtn) { - _phoneLoginBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - NSMutableAttributedString *title = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPLoginPwdViewController4")]; - [title addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:NSMakeRange(0, title.length)]; - [_phoneLoginBtn setAttributedTitle:title forState:UIControlStateNormal]; - [_phoneLoginBtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal]; - _phoneLoginBtn.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightRegular]; - [_phoneLoginBtn addTarget:self action:@selector(phoneLoginBtnClicked) forControlEvents:UIControlEventTouchUpInside]; - } - return _phoneLoginBtn; -} - - - -@end diff --git a/YuMi/Modules/YMMessage/View/Session/Content/MessageContentUnSupport.m.backup b/YuMi/Modules/YMMessage/View/Session/Content/MessageContentUnSupport.m.backup deleted file mode 100644 index c503cf2..0000000 --- a/YuMi/Modules/YMMessage/View/Session/Content/MessageContentUnSupport.m.backup +++ /dev/null @@ -1,20 +0,0 @@ -// -// MessageContentUnSupport.m -// xplan-ios -// -// Created by 冯硕 on 2022/4/19. -// - -#import "MessageContentUnSupportView.h" - -@implementation MessageContentUnSupportView - -/* -// Only override drawRect: if you perform custom drawing. -// An empty implementation adversely affects performance during animation. -- (void)drawRect:(CGRect)rect { - // Drawing code -} -*/ - -@end diff --git a/YuMi/Modules/YMMine/Api/Api(GameOrder).h.backup b/YuMi/Modules/YMMine/Api/Api(GameOrder).h.backup deleted file mode 100644 index d6a84e9..0000000 --- a/YuMi/Modules/YMMine/Api/Api(GameOrder).h.backup +++ /dev/null @@ -1,16 +0,0 @@ -// -// Api(GameOrder).h -// YuMi -// -// Created by P on 2024/7/10. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface Api_GameOrder_ : NSObject - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMine/Api/Api(GameOrder).m.backup b/YuMi/Modules/YMMine/Api/Api(GameOrder).m.backup deleted file mode 100644 index 862d69e..0000000 --- a/YuMi/Modules/YMMine/Api/Api(GameOrder).m.backup +++ /dev/null @@ -1,12 +0,0 @@ -// -// Api(GameOrder).m -// YuMi -// -// Created by P on 2024/7/10. -// - -#import "Api(GameOrder).h" - -@implementation Api_GameOrder_ - -@end diff --git a/YuMi/Modules/YMMine/Api/Api+Mine.h.backup b/YuMi/Modules/YMMine/Api/Api+Mine.h.backup deleted file mode 100644 index fd75750..0000000 --- a/YuMi/Modules/YMMine/Api/Api+Mine.h.backup +++ /dev/null @@ -1,366 +0,0 @@ -// -// Api+Mine.h -// YUMI -// -// Created by YUMI on 2021/9/16. -// - -#import "Api.h" - -NS_ASSUME_NONNULL_BEGIN - - -@interface Api (Mine) - -/// 获取个人中心功能列表 -/// @param completion 完成 -/// @param uid uid -+ (void)requestPersonalFunctionItem:(HttpRequestHelperCompletion)completion - uid:(NSString *)uid; - -/// 获取个人中心banner列表 -/// @param completion 完成 -/// @param uid 用户的uid -/// @param type 类型 10 -+ (void)requestMineBannerList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid type:(NSString *)type; - -/// 保存反馈的信息 -/// @param complection 完成 -/// @param feedbackDesc 反馈的内容 -/// @param contact 联系方式 -/// @param uid uid -/// @param ticket ticket -+ (void)saveFeedBackWith:(HttpRequestHelperCompletion)complection - feedbackDesc:(NSString *)feedbackDesc - contact:(NSString *)contact - uid:(NSString *)uid - ticket:(NSString *)ticket; - -/// 查询当前用户开启通知的状态 -/// @param complection 完成 -/// @param uid 用户的uid -+ (void)requestUserInfoNotifyStatus:(HttpRequestHelperCompletion)complection - uid:(NSString *)uid; - -/// 更新系统通知 -/// @param complection 完成 -/// @param sysMsgNotify 状态 -/// @param uid 用户的uid -+ (void)updateUserInfoSystemNotifyWith:(HttpRequestHelperCompletion)complection - sysMsgNotify:(NSString *)sysMsgNotify - uid:(NSString *)uid; - -/// 更新个播开播通知 -/// @param completion 完成 -/// @param msgNotify 状态 -/// @param uid 用户的uid -+ (void)updateAnchorBroadCastNotifyWith:(HttpRequestHelperCompletion)completion - msgNotify:(NSString *)msgNotify - uid:(NSString *)uid; - -/// 设置支付密码 -/// @param complection 完成 -/// @param newPasswd 支付密码 -/// @param phone 手机号 -/// @param code 验证码 -/// @param uid uid -/// @param ticket ticket -+ (void)setPayPassword:(HttpRequestHelperCompletion)complection - newPasswd:(NSString *)newPasswd - phone:(NSString *)phone - code:(NSString *)code - uid:(NSString *)uid - ticket:(NSString *)ticket; - -/// 修改支付密码 -/// @param complection 完成 -/// @param newPasswd 新的支付密码 -/// @param oldPasswd 旧的支付密码 -/// @param uid uid -/// @param ticket ticket -+ (void)modifPayPassword:(HttpRequestHelperCompletion)complection - newPasswd:(NSString *)newPasswd - oldPasswd:(NSString *)oldPasswd - uid:(NSString *)uid - ticket:(NSString *)ticket; - -/// 设置登录密码 -/// @param completion 完成 -/// @param phone 手机号 -/// @param newPwd 新的密码 -+ (void)setLoingPassword:(HttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd; - -/// 重置登录密码 -/// @param completion 完成 -/// @param phone 手机号 -/// @param newPwd 新的密码 -/// @param smsCode 验证码 -+ (void)resetLoingPassword:(HttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd smsCode:(NSString *)smsCode; - -/// 修改 登录密码 -/// @param completion 完成 -/// @param phone 手机号 -/// @param newPwd 新的密码 -/// @param pwd 旧密码 -+ (void)modifyLoingPassword:(HttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd pwd:(NSString *)pwd; - -/// 开启关闭家长模式 -/// @param complection 完成 -/// @param password 密码 -/// @param status 状态 0 开启 1 关闭 -/// @param uid 用户的uid -+ (void)openOrCloseParentModel:(HttpRequestHelperCompletion)complection - password:(NSString *)password - status:(NSNumber *)status - uid:(NSString *)uid; - - -/// 上传用户图像到服务器 -/// @param complection 完成 -/// @param photoStr 相册 -/// @param uid 用户的uid -/// @param ticket ticket -+ (void)uploadUserAlbum:(HttpRequestHelperCompletion)complection - photoStr:(NSString *)photoStr - uid:(NSString *)uid - ticket:(NSString *)ticket; -/// 删除用户图像从服务器 -/// @param complection 完成 -/// @param pid 相册 -/// @param uid 用户的uid -/// @param ticket ticket -+ (void)deleteImageFromServer:(HttpRequestHelperCompletion)complection - pid:(NSString *)pid - uid:(NSString *)uid - ticket:(NSString *)ticket; - -/// 请求充值列表 -/// @param complection 完成 -/// @param channelType channel -+ (void)getRechargeList:(HttpRequestHelperCompletion)complection - channelType:(NSString *)channelType; - -/// 苹果下单 -/// @param complection 完成 -/// @param chargeProdId 充值id -/// @param uid 用户的uid -/// @param ticket ticket -/// @param deviceInfo uuid -/// @param clientIp ip地址 -+ (void)requestIAPRecharge:(HttpRequestHelperCompletion)complection - chargeProdId:(NSString *)chargeProdId - uid:(NSString *)uid - ticket:(NSString *)ticket - deviceInfo:(NSString *)deviceInfo - clientIp:(NSString *)clientIp; - -/// 验证凭据 -/// @param complection 完成 -/// @param chooseEnv @"true" -/// @param chargeRecordId 服务端生成的订单编号 -/// @param transcationId 内购的唯一标识符 -/// @param uid 用户uid -/// @param ticket ticket -+ (void)checkReceipt:(HttpRequestHelperCompletion)complection - chooseEnv:(NSString *)chooseEnv - chargeRecordId:(NSString *)chargeRecordId - transcationId:(NSString *)transcationId - uid:(NSString *)uid - ticket:(NSString *)ticket; - -/// 退出当前账号 -/// @param complection 完成 -/// @param access_token token -+ (void)logoutCurrentAccount:(HttpRequestHelperCompletion)complection - access_token:(NSString *)access_token; - -/// 查询两个人的关注状态 -/// @param complection 完成 -/// @param uid 自己的uid -/// @param isLikeUid 要查询的那个人的uid -+ (void)attentionStatusCompletion:(HttpRequestHelperCompletion)complection - uid:(NSString *)uid - isLikeUid:(NSString *)isLikeUid; - -/// 关注某人 -/// @param complection 完成 -/// @param uid 发起关注的人 -/// @param likedUid 被关注的人 -/// @param ticket ticket -/// @param type l类型默认1 -+ (void)attentionCompletion:(HttpRequestHelperCompletion)complection - uid:(NSString *)uid - likedUid:(NSString *)likedUid - ticket:(NSString *)ticket - type:(NSString *)type; - -/// 获取用户详情 -/// @param complection 完成 -/// @param uid 发起关注的人 -/// @param page page -/// @param pageSize pagesize -+ (void)userDetailInfoCompletion:(HttpRequestHelperCompletion)complection uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize; - -/// 获取粉丝列表 -/// @param completion 完成 -/// @param uid 用户的uid -/// @param pageNo 当前页数 -/// @param pageSize 一页多少个 -+ (void)getFansListCompletion:(HttpRequestHelperCompletion)completion uid:(NSString *)uid pageNo:(NSString *)pageNo pageSize:(NSString *)pageSize; - -/// 获取访客列表 -/// @param completion 完成 -/// @param pageNum 当前页数 -/// @param pageSize 一页多少个 -+ (void)getVisitorListCompletion:(HttpRequestHelperCompletion)completion pageNum:(NSString *)pageNum pageSize:(NSString *)pageSize; - -/// 获取关注列表 -/// @param completion 完成 -/// @param uid 用户的uid -/// @param pageNo 当前页数 -/// @param pageSize 一页多少个 -+ (void)getattentionListCompletion:(HttpRequestHelperCompletion)completion uid:(NSString *)uid pageNo:(NSString *)pageNo pageSize:(NSString *)pageSize; - -/// 上传访问用户的记录 -/// @param completion 完成 -/// @param uid 被访问的用户uid -+ (void)uploadVisitUserCompletion:(HttpRequestHelperCompletion)completion uid:(NSString *)uid; - -/// 获取粉丝团列表 -/// @param completion 完成 -/// @param pageNum 当前页数 -/// @param pageSize 一页多少个 -+ (void)getAnchorFansTeamListCompletion:(HttpRequestHelperCompletion)completion pageNum:(NSString *)pageNum pageSize:(NSString *)pageSize; - -/// 获取用户的礼物墙 -/// @param comletion 完成 -/// @param uid 用户的uid -/// @param giftType 礼物类型 1:普通礼物;2:幸运礼物 -+ (void)getUserGiftWall:(HttpRequestHelperCompletion)comletion uid:(NSString *)uid giftType:(NSString *)giftType; - -/// 批量获取用户信息 -/// @param completion 完成 -/// @param uids 用户的uid -+ (void)getUsersListInfo:(HttpRequestHelperCompletion)completion uids:(NSString *)uids; - -/// 获取用户进房记录 -/// @param completion 完成 -/// @param uid 用户的uid -+ (void)requestFootPrint:(HttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize; - -/// 清除进房记录 -/// @param completion 完成 -/// @param uid 用户uid -/// @param roomUid 房间uid -+ (void)requestCleanFootPrint:(HttpRequestHelperCompletion)completion uid:(NSString *)uid roomUid:(NSString *)roomUid; - -/// 快捷进房 -/// @param completion 完成 -/// @param uid 用户的uid -/// @param mgId 游戏id -+ (void)requestMineQuickMatchLittleGame:(HttpRequestHelperCompletion)completion uid:(NSString *)uid mgId:(NSString *)mgId; - -/// 请求收藏房间列表 -/// @param completion 完成 -/// @param uid 用户的uid -/// @param page 当前页数 -/// @param pageSize 一页多少个 -/// @param roomType 类型:4:个播房;其他:派对房;不传:所有房间 -+ (void)requestMineCollectRoomList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize roomType:(NSString *)roomType; - -/// 请求大家都在搜列表 -/// @param completion 完成 -/// @param uid uid -+ (void)requestEveryoneSearch:(HttpRequestHelperCompletion)completion uid:(NSString *)uid; - -/// 获取好友派对列表 -/// @param completion 完成 -+ (void)requestFansParty:(HttpRequestHelperCompletion)completion; - -/// 请求主播评级 -/// @param completion 完成 -+ (void)requestAnchorGradeInfo:(HttpRequestHelperCompletion)completion; - -/// 請求公會列表 -/// @param completion 完成 -+ (void)requestMineGuildList:(HttpRequestHelperCompletion)completion; -/// 請求房间列表 -/// @param completion 完成 -+ (void)requestMineRoomList:(HttpRequestHelperCompletion)completion; -///申请加入公会 -+(void)applyClanWith:(HttpRequestHelperCompletion)completion uid:(NSString *)uid clanId:(NSString *)clanId; - -+(void)getGoldDetailsData:(HttpRequestHelperCompletion)completion startTime:(NSString *)startTime endTime:(NSString *)endTime; - -/// 设置支付密码 重置支付密码 -/// @param completion 完成 -/// @param newPasswd 支付密码 -/// @param phone 手机号 - -/// @param uid uid -/// @param ticket ticket -+ (void)setPayPassword:(HttpRequestHelperCompletion)completion newPasswd:(NSString *)newPasswd uid:(NSString *)uid ticket:(NSString *)ticket; - - -///收益记录 -+(void)requestRecordIncome:(HttpRequestHelperCompletion)completion; -///得到兑换界面信息 -+(void)getExchangeDiamondInformation:(HttpRequestHelperCompletion)completion; - -+(void)confirmExchangeDiamond:(HttpRequestHelperCompletion)completion goldNum:(NSString *)goldNum diamondNum:(NSString *)diamondNum currency:(NSString *)currency; -///得到个人简介标签 -+(void)getTagList:(HttpRequestHelperCompletion)completion; -///保存个人简介标签 -+(void)saveTagList:(HttpRequestHelperCompletion)completion labels:(NSString *)labels; -//////获取地区列表 -+(void)getAreaList:(HttpRequestHelperCompletion)completion; -///保存地区列表 -+(void)saveAreaConfigWithArea:(HttpRequestHelperCompletion)completion id:(NSString *)id; -/// -+(void)requestQueryWithRoomType:(HttpRequestHelperCompletion)completion; -///屏蔽房间列表 -/// - Parameter completion: 完成 -+(void)getBlackRoomList:(HttpRequestHelperCompletion)completion pageNum:(NSString *)pageNum pageSize:(NSString *)pageSize; - -/// 解除屏蔽 -/// - Parameters: -/// - completion: 完成 -/// - roomUid: 房间id -/// - type: 1=房间 -+(void)requestUnmaskingFromBlackRoomList:(HttpRequestHelperCompletion)completion objId:(NSString *)objId type:(NSString *)type ; -///得到腾讯存储信息 -+ (void)getQCloudInfo:(HttpRequestHelperCompletion)completion; - -//获取 cp 列表 -+(void)requestCPList:(HttpRequestHelperCompletion)completion page:(NSNumber *)page pageSize:(NSNumber *)pageSize; -//取消 cp 关系 -+(void)cancelCPList:(HttpRequestHelperCompletion)completion uid:(NSNumber *)uid loverUid:(NSNumber *)loverUid goldNum:(NSNumber *)goldNum; - - -/// 用户设置 CP 内容展示开关 -/// - Parameters: -/// - completion: completion description -/// - type: 1-cp头像是否展示,2-cp动画 -/// - isShow: 是否开启 -+(void)updateCPSetting:(HttpRequestHelperCompletion)completion type:(NSNumber *)type isShow:(NSNumber *)isShow; - -+(void)requestBlockTime:(HttpRequestHelperCompletion)completion; - -+(void)blockUser:(HttpRequestHelperCompletion)completion uid:(NSNumber *)uid hours:(NSNumber *)hours blockReason:(NSString *)blockReason; - -+ (void)userDetailMine:(HttpRequestHelperCompletion)completion; - -+ (void)userV2UploadAvatar:(HttpRequestHelperCompletion)completion avatarUrl:(NSString *)avatarUrl needPay:(NSNumber *)needPay; - -+ (void)fansFriendList:(HttpRequestHelperCompletion)completion pageNo:(NSNumber *)pageNo pageSize:(NSNumber *)pageSize; - -+ (void)userCpNameChange:(HttpRequestHelperCompletion)completion uid:(NSInteger)uid loverUid:(NSInteger)loverUid relationNameType:(NSInteger)relationNameType; - -+ (void)userCpNameChangeAudit:(HttpRequestHelperCompletion)completion recordId:(NSInteger)recordId status:(NSInteger)status; - -+ (void)userCpNameTypeTopList:(HttpRequestHelperCompletion)completion uid:(NSInteger)uid; - - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMine/Api/Api+Mine.m.backup b/YuMi/Modules/YMMine/Api/Api+Mine.m.backup deleted file mode 100644 index eb7d2e1..0000000 --- a/YuMi/Modules/YMMine/Api/Api+Mine.m.backup +++ /dev/null @@ -1,484 +0,0 @@ -// -// Api+Mine.m -// YUMI -// -// Created by YUMI on 2021/9/16. -// - -#import "Api+Mine.h" -#import -@implementation Api (Mine) - -/// 获取个人中心功能列表 -/// @param completion 完成 -/// @param uid uid -+ (void)requestPersonalFunctionItem:(HttpRequestHelperCompletion)completion - uid:(NSString *)uid { - NSString * fang = [NSString stringFromBase64String:@"cGVyc29uYWwvY2VudGVyL2xpc3Q="];///personal/center/list - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, nil]; -} - -/// 获取个人中心banner列表 -/// @param completion 完成 -/// @param uid 用户的uid -/// @param type 类型 10 -+ (void)requestMineBannerList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid type:(NSString *)type { - NSString * fang = [NSString stringFromBase64String:@"aG9tZS9iYW5uZXI="];///home/banner - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, type, nil]; -} - -/// 保存反馈的信息 -/// @param completion 完成 -/// @param feedbackDesc 反馈的内容 -/// @param contact 联系方式 -/// @param uid uid -/// @param ticket ticket -+ (void)saveFeedBackWith:(HttpRequestHelperCompletion)completion - feedbackDesc:(NSString *)feedbackDesc - contact:(NSString *)contact - uid:(NSString *)uid - ticket:(NSString *)ticket { - NSString * fang = [NSString stringFromBase64String:@"ZmVlZGJhY2s="];///feedback - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, feedbackDesc, contact, uid, ticket, nil]; -} - - -/// 查询当前用户开启通知的状态 -/// @param completion 完成 -/// @param uid 用户的uid -+ (void)requestUserInfoNotifyStatus:(HttpRequestHelperCompletion)completion uid:(NSString *)uid { - NSString * fang = [NSString stringFromBase64String:@"dXNlci9tc2dOb3RpZnk="];///user/msgNotify - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, nil]; -} - - -/// 更新系统通知 -/// @param completion 完成 -/// @param sysMsgNotify 状态 -/// @param uid 用户的uid -+ (void)updateUserInfoSystemNotifyWith:(HttpRequestHelperCompletion)completion sysMsgNotify:(NSString *)sysMsgNotify uid:(NSString *)uid { - NSString * fang = [NSString stringFromBase64String:@"dXNlci9zeXNNc2dOb3RpZnk="];///user/sysMsgNotify - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, sysMsgNotify,uid, nil]; -} - -/// 更新个播开播通知 -/// @param completion 完成 -/// @param msgNotify 状态 -/// @param uid 用户的uid -+ (void)updateAnchorBroadCastNotifyWith:(HttpRequestHelperCompletion)completion msgNotify:(NSString *)msgNotify uid:(NSString *)uid { - NSString * fang = [NSString stringFromBase64String:@"dXNlci9zaW5nbGVCcm9hZGNhc3RNc2dOb3RpZnk="];///user/singleBroadcastMsgNotify - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, msgNotify,uid, nil]; -} - -/// 设置支付密码 重置支付密码 -/// @param completion 完成 -/// @param newPasswd 支付密码 -/// @param phone 手机号 -/// @param code 验证码 -/// @param uid uid -/// @param ticket ticket -+ (void)setPayPassword:(HttpRequestHelperCompletion)completion newPasswd:(NSString *)newPasswd phone:(NSString *)phone code:(NSString *)code uid:(NSString *)uid ticket:(NSString *)ticket { - NSString * fang = [NSString stringFromBase64String:@"dXNlci9wYXltZW50UGFzc3dkL3Jlc2V0"];///user/paymentPasswd/reset - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, newPasswd, phone, code,uid,ticket, nil]; -} - - -/// 修改支付密码 -/// @param completion 完成 -/// @param newPasswd 新的支付密码 -/// @param oldPasswd 旧的支付密码 -/// @param uid uid -/// @param ticket ticket -+ (void)modifPayPassword:(HttpRequestHelperCompletion)completion newPasswd:(NSString *)newPasswd oldPasswd:(NSString *)oldPasswd uid:(NSString *)uid ticket:(NSString *)ticket { - NSString * fang = [NSString stringFromBase64String:@"dXNlci9wYXltZW50UGFzc3dkL21vZGlmeQ=="];///user/paymentPasswd/modify - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, newPasswd,oldPasswd,uid,ticket, nil]; -} - -/// 设置登录密码 -/// @param completion 完成 -/// @param phone 手机号 -/// @param newPwd 新的密码 -+ (void)setLoingPassword:(HttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd { - NSString * fang = [NSString stringFromBase64String:@"YWNjL3B3ZC9zZXQ="];///acc/pwd/set - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, phone, newPwd, nil]; -} - -/// 重置登录密码 -/// @param completion 完成 -/// @param phone 手机号 -/// @param newPwd 新的密码 -/// @param smsCode 验证码 -+ (void)resetLoingPassword:(HttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd smsCode:(NSString *)smsCode { - NSString * fang = [NSString stringFromBase64String:@"YWNjL3B3ZC9yZXNldA=="];///acc/pwd/reset - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, phone, newPwd,smsCode, nil]; -} - -/// 修改 登录密码 -/// @param completion 完成 -/// @param phone 手机号 -/// @param newPwd 新的密码 -/// @param pwd 旧密码 -+ (void)modifyLoingPassword:(HttpRequestHelperCompletion)completion phone:(NSString *)phone newPwd:(NSString *)newPwd pwd:(NSString *)pwd { - NSString * fang = [NSString stringFromBase64String:@"YWNjL3B3ZC9tb2RpZnk="];///acc/pwd/modify - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion,__FUNCTION__, phone, newPwd, pwd, nil]; -} - -/// 开启关闭家长模式 -/// @param completion 完成 -/// @param password 密码 -/// @param status 状态 0 开启 1 关闭 -/// @param uid 用户的uid -+ (void)openOrCloseParentModel:(HttpRequestHelperCompletion)completion password:(NSString *)password status:(NSNumber *)status uid:(NSString *)uid { - NSString * fang = [NSString stringFromBase64String:@"dXNlci9vcGVuT3JDbG9zZQ=="];///user/openOrClose - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, password,status,uid, nil]; -} - - -///得到腾讯存储信息 -+ (void)getQCloudInfo:(HttpRequestHelperCompletion)completion{ - [self makeRequest:@"tencent/cos/getToken" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil]; -} - -/// 上传用户图像到服务器 -/// @param completion 完成 -/// @param photoStr 相册 -/// @param uid 用户的uid -/// @param ticket ticket -+ (void)uploadUserAlbum:(HttpRequestHelperCompletion)completion photoStr:(NSString *)photoStr uid:(NSString *)uid ticket:(NSString *)ticket { - NSString * fang = [NSString stringFromBase64String:@"cGhvdG8vdjIvdXBsb2Fk"];///photo/v2/upload - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,photoStr, uid, ticket, nil]; -} - -/// 删除用户图像从服务器 -/// @param completion 完成 -/// @param pid 相册 -/// @param uid 用户的uid -/// @param ticket ticket -+ (void)deleteImageFromServer:(HttpRequestHelperCompletion)completion pid:(NSString *)pid uid:(NSString *)uid ticket:(NSString *)ticket { - NSString * fang = [NSString stringFromBase64String:@"cGhvdG8vZGVsUGhvdG8="];///photo/delPhoto - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,pid, uid, ticket, nil]; -} - - -/// 请求充值列表 -/// @param completion 完成 -/// @param channelType channel -+ (void)getRechargeList:(HttpRequestHelperCompletion)completion channelType:(NSString *)channelType { - NSString * fang = [NSString stringFromBase64String:@"Y2hhcmdlcHJvZC9saXN0"];///chargeprod/list - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,channelType, nil]; -} - -/// 苹果下单 -/// @param completion 完成 -/// @param chargeProdId 充值id -/// @param uid 用户的uid -/// @param ticket ticket -/// @param deviceInfo uuid -/// @param clientIp ip地址 -+ (void)requestIAPRecharge:(HttpRequestHelperCompletion)completion chargeProdId:(NSString *)chargeProdId uid:(NSString *)uid ticket:(NSString *)ticket deviceInfo:(NSString *)deviceInfo clientIp:(NSString *)clientIp { - [self makeRequest:@"storeKitV2/placeOrder" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,chargeProdId, uid, ticket, deviceInfo, clientIp, nil]; -} - - -/// 验证凭据 -/// @param completion 完成 -/// @param chooseEnv @"true" -/// @param chargeRecordId 服务端生成的订单编号 -/// @param transcationId 内购的唯一标识符 “transcationId” 后端的参数是拼错的!不要调整! -/// @param uid 用户uid -/// @param ticket ticket -+ (void)checkReceipt:(HttpRequestHelperCompletion)completion chooseEnv:(NSString *)chooseEnv chargeRecordId:(NSString *)chargeRecordId transcationId:(NSString *)transcationId uid:(NSString *)uid ticket:(NSString *)ticket { - [self makeRequest:@"storeKitV2/verifyOrder" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, chooseEnv, chargeRecordId, transcationId, uid, ticket, nil]; -} - - -/// 退出当前账号 -/// @param completion 完成 -/// @param access_token token -+ (void)logoutCurrentAccount:(HttpRequestHelperCompletion)completion access_token:(NSString *)access_token { - NSString * fang = [NSString stringFromBase64String:@"YWNjL2xvZ291dA=="];///acc/logout - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, access_token, nil]; -} - -/// 查询两个人的关注状态 -/// @param completion 完成 -/// @param uid 自己的uid -/// @param isLikeUid 要查询的那个人的uid -+ (void)attentionStatusCompletion:(HttpRequestHelperCompletion)completion uid:(NSString *)uid isLikeUid:(NSString *)isLikeUid { - NSString * fang = [NSString stringFromBase64String:@"ZmFucy9pc2xpa2U="];///fans/islike - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion,__FUNCTION__, uid, isLikeUid, nil]; -} - -/// 关注某人 -/// @param completion 完成 -/// @param uid 发起关注的人 -/// @param likedUid 被关注的人 -/// @param ticket ticket -/// @param type 1 关注 2取消关注 -+ (void)attentionCompletion:(HttpRequestHelperCompletion)completion uid:(NSString *)uid likedUid:(NSString *)likedUid ticket:(NSString *)ticket type:(NSString *)type { - NSString * fang = [NSString stringFromBase64String:@"ZmFucy9saWtl"];///fans/like - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, uid, likedUid, ticket, type, nil]; -} - -/// 获取用户详情 -/// @param completion 完成 -/// @param uid 发起关注的人 -/// @param page page -/// @param pageSize pagesize -+ (void)userDetailInfoCompletion:(HttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize { - NSString * fang = [NSString stringFromBase64String:@"dXNlci9kZXRhaWwvZ2V0"];///user/detail/get - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, page, pageSize, nil]; -} - -/// 获取粉丝列表 -/// @param completion 完成 -/// @param uid 用户的uid -/// @param pageNo 当前页数 -/// @param pageSize 一页多少个 -+ (void)getFansListCompletion:(HttpRequestHelperCompletion)completion uid:(NSString *)uid pageNo:(NSString *)pageNo pageSize:(NSString *)pageSize { - NSString * fang = [NSString stringFromBase64String:@"ZmFucy9mYW5zbGlzdA=="];///@"fans/fanslist" - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, pageNo, pageSize, nil]; -} - -/// 获取关注列表 -/// @param completion 完成 -/// @param uid 用户的uid -/// @param pageNo 当前页数 -/// @param pageSize 一页多少个 -+ (void)getattentionListCompletion:(HttpRequestHelperCompletion)completion uid:(NSString *)uid pageNo:(NSString *)pageNo pageSize:(NSString *)pageSize { - NSString * fang = [NSString stringFromBase64String:@"ZmFucy9mb2xsb3dpbmc="];///fans/following - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, pageNo, pageSize, nil]; -} - -/// 获取访客列表 -/// @param completion 完成 -/// @param pageNum 当前页数 -/// @param pageSize 一页多少个 -+ (void)getVisitorListCompletion:(HttpRequestHelperCompletion)completion pageNum:(NSString *)pageNum pageSize:(NSString *)pageSize { - NSString * fang = [NSString stringFromBase64String:@"dXNlcnZpc2l0cmVjb3JkL3Zpc2l0VXNlckxpc3Q="];///uservisitrecord/visitUserList - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, pageNum, pageSize, nil]; -} - -/// 上传访问用户的记录 -/// @param completion 完成 -/// @param uid 被访问的用户uid -+ (void)uploadVisitUserCompletion:(HttpRequestHelperCompletion)completion uid:(NSString *)uid { - NSString * fang = [NSString stringFromBase64String:@"dXNlci9kZXRhaWwvdmlzaXRVc2VyRGV0YWls"];///user/detail/visitUserDetail - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, nil]; -} - -/// 获取粉丝团列表 -/// @param completion 完成 -/// @param pageNum 当前页数 -/// @param pageSize 一页多少个 -+ (void)getAnchorFansTeamListCompletion:(HttpRequestHelperCompletion)completion pageNum:(NSString *)pageNum pageSize:(NSString *)pageSize { - NSString * fang = [NSString stringFromBase64String:@"YW5jaG9yRmFuc1RlYW0vZ2V0Sm9pbkZhbnNUZWFtTGlzdA=="];///anchorFansTeam/getJoinFansTeamList - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, pageNum, pageSize, nil]; -} - -/// 获取用户的礼物墙 -/// @param comletion 完成 -/// @param uid 用户的uid -/// @param giftType 类型2 -+ (void)getUserGiftWall:(HttpRequestHelperCompletion)comletion uid:(NSString *)uid giftType:(NSString *)giftType { - NSString * fang = [NSString stringFromBase64String:@"Z2lmdHdhbGwvZ2V0QnlHaWZ0VHlwZQ=="];///giftwall/getByGiftType - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:comletion, __FUNCTION__, uid, giftType, nil]; -} - -/// 批量获取用户信息 -/// @param completion 完成 -/// @param uids 用户的uid -+ (void)getUsersListInfo:(HttpRequestHelperCompletion)completion uids:(NSString *)uids { - NSString * fang = [NSString stringFromBase64String:@"dXNlci9saXN0"];///user/list - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uids, nil]; -} - -+ (void)fansFriendList:(HttpRequestHelperCompletion)completion pageNo:(NSNumber *)pageNo pageSize:(NSNumber *)pageSize { - [self makeRequest:@"fans/friend/list" method:HttpRequestHelperMethodGET completion:completion, - __FUNCTION__, pageNo, pageSize, nil]; -} - -/// 获取用户进房记录 -/// @param completion 完成 -/// @param uid 用户的uid -+ (void)requestFootPrint:(HttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize { - NSString * fang = [NSString stringFromBase64String:@"dXNlcnJvb20vZ2V0SW5Sb29tUmVjb3Jk"];///userroom/getInRoomRecord - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, page, pageSize, nil]; -} - -/// 清除进房记录 -/// @param completion 完成 -/// @param uid 用户uid -/// @param roomUid 房间uid -+ (void)requestCleanFootPrint:(HttpRequestHelperCompletion)completion uid:(NSString *)uid roomUid:(NSString *)roomUid { - NSString * fang = [NSString stringFromBase64String:@"dXNlcnJvb20vZGVsZXRlSW5Sb29tUmVjb3Jk"];///userroom/deleteInRoomRecord - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, uid, roomUid, nil]; -} - -/// 快捷进房 -/// @param completion 完成 -/// @param uid 用户的uid -/// @param mgId 游戏id -+ (void)requestMineQuickMatchLittleGame:(HttpRequestHelperCompletion)completion uid:(NSString *)uid mgId:(NSString *)mgId { - NSString * fang = [NSString stringFromBase64String:@"aG9tZS9mYXN0UGlja1Yy"];///home/fastPickV2 - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, mgId, nil]; -} - -/// 请求收藏房间列表 -/// @param completion 完成 -/// @param uid 用户的uid -/// @param page 当前页数 -/// @param pageSize 一页多少个 -/// @param roomType 类型:4:个播房;其他:派对房;不传:所有房间 -+ (void)requestMineCollectRoomList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize roomType:(NSString *)roomType { - NSString * fang = [NSString stringFromBase64String:@"ZmFucy9mYW5zUm9vbUxpc3Q="];///fans/fansRoomList - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,uid , page, pageSize, roomType, nil]; -} - -/// 请求大家都在搜列表 -/// @param completion 完成 -/// @param uid uid -+ (void)requestEveryoneSearch:(HttpRequestHelperCompletion)completion uid:(NSString *)uid { - NSString * fang = [NSString stringFromBase64String:@"ZXZlcnkvb25lL3NlYXJjaC9nZXRMaXN0"];///every/one/search/getList - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, nil]; -} - -/// 获取好友派对列表 -/// @param completion 完成 -+ (void)requestFansParty:(HttpRequestHelperCompletion)completion { - NSString * fang = [NSString stringFromBase64String:@"ZmFucy9mYW5zUGFydExpc3Q="];///fans/fansPartList - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil]; -} -/// 请求主播评级 -/// @param completion 完成 -+ (void)requestAnchorGradeInfo:(HttpRequestHelperCompletion)completion { - NSString * fang = [NSString stringFromBase64String:@"YW5jaG9yR3JhZGUvZ2V0"];///anchorGrade/get - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, nil]; -} - -+ (void)requestMineGuildList:(HttpRequestHelperCompletion)completion { - NSString * fang = [NSString stringFromBase64String:@"Y2xhbi9saXN0"];///clan/list - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil]; -} -+ (void)requestMineRoomList:(HttpRequestHelperCompletion)completion { - NSString * fang = [NSString stringFromBase64String:@"aGFsbC9saXN0"];///hall/list - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil]; -} -+(void)applyClanWith:(HttpRequestHelperCompletion)completion uid:(NSString *)uid clanId:(NSString *)clanId { - NSString * fang = [NSString stringFromBase64String:@"Y2xhbi9hcHBseQ=="];///clan/apply - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion,__FUNCTION__,uid, clanId, nil]; -} - -+(void)getGoldDetailsData:(HttpRequestHelperCompletion)completion startTime:(NSString *)startTime endTime:(NSString *)endTime{ - NSString * fang = [NSString stringFromBase64String:@"Y2xhbkdvbGRGbG93L2NsYW5Ub3RhbExpc3Q="];///clanGoldFlow/clanTotalList - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion,__FUNCTION__,startTime,endTime, nil]; -} - -/// 设置支付密码 重置支付密码 -/// @param completion 完成 -/// @param newPasswd 支付密码 -/// @param phone 手机号 - -/// @param uid uid -/// @param ticket ticket -+ (void)setPayPassword:(HttpRequestHelperCompletion)completion newPasswd:(NSString *)newPasswd uid:(NSString *)uid ticket:(NSString *)ticket { - NSString * fang = [NSString stringFromBase64String:@"dXNlci9wYXltZW50UGFzc3dkL3Jlc2V0"];///user/paymentPasswd/reset - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, newPasswd,uid,ticket, nil]; -} - -+(void)requestQueryWithRoomType:(HttpRequestHelperCompletion)completion{ - NSString * fang = [NSString stringFromBase64String:@"cHVyc2UvcXVlcnlXaXRoUm9vbVR5cGU="];///purse/queryWithRoomType - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil]; -} - -+(void)requestRecordIncome:(HttpRequestHelperCompletion)completion{ - NSString * fang = [NSString stringFromBase64String:@"cHVyc2UvcXVlcnk="];///purse/query - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil]; -} - -+(void)getExchangeDiamondInformation:(HttpRequestHelperCompletion)completion{ - NSString * fang = [NSString stringFromBase64String:@"Z29sZEV4Y2hhbmdlRGlhbW9uZC9nZXRDb25maWc="];///goldExchangeDiamond/getConfig - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil]; -} - -+(void)confirmExchangeDiamond:(HttpRequestHelperCompletion)completion goldNum:(NSString *)goldNum diamondNum:(NSString *)diamondNum currency:(NSString *)currency{ - NSString * fang = [NSString stringFromBase64String:@"Z29sZEV4Y2hhbmdlRGlhbW9uZC9leGNoYW5nZQ=="];///goldExchangeDiamond/exchange - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion,__FUNCTION__,goldNum,diamondNum,currency, nil]; -} - -+(void)getTagList:(HttpRequestHelperCompletion)completion{ - [self makeRequest:@"label/edit" method:HttpRequestHelperMethodGET completion:completion,__FUNCTION__, nil]; -} -///保存个人简介标签 -+(void)saveTagList:(HttpRequestHelperCompletion)completion labels:(NSString *)labels{ - [self makeRequest:@"label/save" method:HttpRequestHelperMethodPOST completion:completion,__FUNCTION__,labels, nil]; -} -//////获取地区列表 -+(void)getAreaList:(HttpRequestHelperCompletion)completion{ - [self makeRequest:@"regionInfo/list" method:HttpRequestHelperMethodGET completion:completion,__FUNCTION__, nil]; -} -///保存地区列表 -+(void)saveAreaConfigWithArea:(HttpRequestHelperCompletion)completion id:(NSString *)id{ - [self makeRequest:@"regionInfo/save" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, id, nil]; -} - -+(void)getBlackRoomList:(HttpRequestHelperCompletion)completion pageNum:(NSString *)pageNum pageSize:(NSString *)pageSize{ - [self makeRequest:@"user/black/pageRoom" method:HttpRequestHelperMethodGET completion:completion,__FUNCTION__, pageNum,pageSize,nil]; -} -/// 解除屏蔽 -/// - Parameters: -/// - completion: 完成 -/// - roomUid: 房间id -/// - type: 1=房间 -+(void)requestUnmaskingFromBlackRoomList:(HttpRequestHelperCompletion)completion objId:(NSString *)objId type:(NSString *)type { - [self makeRequest:@"user/black/delete" method:HttpRequestHelperMethodPOST completion:completion,__FUNCTION__,objId,type, nil]; -} - - -//获取 cp 列表 -+(void)requestCPList:(HttpRequestHelperCompletion)completion page:(NSNumber *)page pageSize:(NSNumber *)pageSize{ - [self makeRequest:@"user/cp/list" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, page, pageSize, nil]; -} - -+(void)cancelCPList:(HttpRequestHelperCompletion)completion uid:(NSNumber *)uid loverUid:(NSNumber *)loverUid goldNum:(NSNumber *)goldNum { - [self makeRequest:@"user/cp/cancel" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, uid, loverUid, goldNum, nil]; -} - -+(void)updateCPSetting:(HttpRequestHelperCompletion)completion type:(NSNumber *)type isShow:(NSNumber *)isShow { - [self makeRequest:@"user/setting/update" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, type, isShow, nil]; -} - -+(void)requestBlockTime:(HttpRequestHelperCompletion)completion { - [self makeRequest:@"user/blockTime" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil]; -} - -+(void)blockUser:(HttpRequestHelperCompletion)completion uid:(NSNumber *)uid hours:(NSNumber *)hours blockReason:(NSString *)blockReason { - [self makeRequest:@"user/block" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, uid, hours, blockReason, nil]; -} - -+ (void)userDetailMine:(HttpRequestHelperCompletion)completion { - [self makeRequest:@"user/detail/mine" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil]; -} - -+ (void)userV2UploadAvatar:(HttpRequestHelperCompletion)completion avatarUrl:(NSString *)avatarUrl needPay:(NSNumber *)needPay { - [self makeRequest:@"user/v2/uploadAvatar" method:HttpRequestHelperMethodPOST completion:completion, - __FUNCTION__, avatarUrl, needPay, nil]; -} - -+ (void)userCpNameChange:(HttpRequestHelperCompletion)completion uid:(NSInteger)uid loverUid:(NSInteger)loverUid relationNameType:(NSInteger)relationNameType { - [self makeRequest:@"user/cp/nameChange" method:HttpRequestHelperMethodPOST completion:completion, - __FUNCTION__, @(uid), @(loverUid), @(relationNameType), nil]; -} - -+ (void)userCpNameChangeAudit:(HttpRequestHelperCompletion)completion recordId:(NSInteger)recordId status:(NSInteger)status { - [self makeRequest:@"user/cp/nameChangeAudit" method:HttpRequestHelperMethodPOST completion:completion, - __FUNCTION__, @(recordId), @(status), nil]; -} - -+ (void)userCpNameTypeTopList:(HttpRequestHelperCompletion)completion uid:(NSInteger)uid { - [self makeRequest:@"user/cp/nameTypeTopList" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, @(uid), nil]; -} - - - -@end diff --git a/YuMi/Modules/YMMine/View/EnterpriseRecharge/Api/Api+EnterpriseRecharge.m.backup b/YuMi/Modules/YMMine/View/EnterpriseRecharge/Api/Api+EnterpriseRecharge.m.backup deleted file mode 100644 index 44241fc..0000000 --- a/YuMi/Modules/YMMine/View/EnterpriseRecharge/Api/Api+EnterpriseRecharge.m.backup +++ /dev/null @@ -1,40 +0,0 @@ -// -// Api+EnterpriseRecharge.m -// xplan-ios -// -// Created by 冯硕 on 2022/5/14. -// - -#import "Api+EnterpriseRecharge.h" -#import "NSMutableDictionary+Saft.h" -@implementation Api (EnterpriseRecharge) - -///企业包的充值列表 -+ (void)enterpriseRechargeList:(HttpRequestHelperCompletion)completion channelType:(NSString *)channelType { - [self makeRequest:@"chargeprod/listV2" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, channelType, nil]; -} - - -/// 请求支付参数 -/// @param completion 完成 -/// @param chargeProdId 订单的id -/// @param payChannel 支付的渠道 -/// @param clientIp ip -/// @param uid uid -/// @param ticket ticket -+ (void)requestPay:(HttpRequestHelperCompletion)completion chargeProdId:(NSString *)chargeProdId payChannel:(NSString *)payChannel clientIp:(NSString *)clientIp uid:(NSString *)uid ticket:(NSString *)ticket roomUid:(NSString *)roomUid { - NSMutableDictionary * dic = [NSMutableDictionary dictionary]; - [dic safeSetObject:chargeProdId forKey:@"chargeProdId"]; - [dic safeSetObject:payChannel forKey:@"payChannel"]; - [dic safeSetObject:clientIp forKey:@"clientIp"]; - [dic safeSetObject:uid forKey:@"uid"]; - [dic safeSetObject:ticket forKey:@"ticket"]; - if (roomUid.integerValue> 0) { - [dic safeSetObject:roomUid forKey:@"roomUid"]; - } - [HttpRequestHelper request:@"charge/pay/apply" method:HttpRequestHelperMethodPOST params:dic completion:completion]; -} - - - -@end diff --git a/YuMi/Modules/YMMine/View/Medals/MedalsCollectionViewCell_Refactored.m.backup b/YuMi/Modules/YMMine/View/Medals/MedalsCollectionViewCell_Refactored.m.backup deleted file mode 100644 index 7fd6a71..0000000 --- a/YuMi/Modules/YMMine/View/Medals/MedalsCollectionViewCell_Refactored.m.backup +++ /dev/null @@ -1,214 +0,0 @@ -// -// MedalsCollectionViewCell_Refactored.m -// YuMi -// -// 重构示例:使用 MedalMediaDisplayManager 简化媒体处理逻辑 -// - -#import "MedalsCollectionViewCell.h" -#import "MedalsModel.h" -#import "MedalMediaDisplayManager.h" -#import "MedalsLevelIndicatorView.h" - -@interface MedalsCollectionViewCell () - -// 媒体显示管理器 - 替代原来的所有媒体相关属性和方法 -@property (nonatomic, strong) MedalMediaDisplayManager *mediaManager; - -// UI 元素 -@property (nonatomic, strong) NetImageView *imageView; -@property (nonatomic, strong) VAPView *mp4View; -@property (nonatomic, strong) UILabel *titleLabel; -@property (nonatomic, strong) UILabel *subLabel; -@property (nonatomic, strong) MedalsLevelIndicatorView *levelIndicatorView; - -// 数据模型 -@property (nonatomic, strong) MedalVo *displayModel; -@property (nonatomic, strong) MedalSeriesItemVo *currentItemVo; - -@end - -@implementation MedalsCollectionViewCell - -+ (NSString *)cellID { - return NSStringFromClass([MedalsCollectionViewCell class]); -} - -+ (void)registerTo:(UICollectionView *)collectionView { - [collectionView registerClass:[self class] forCellWithReuseIdentifier:[self cellID]]; -} - -+ (instancetype)cellFor:(UICollectionView *)collectionView atIndexPath:(NSIndexPath *)index { - MedalsCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:[self cellID] - forIndexPath:index]; - return cell; -} - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - [self setupUI]; - [self setupMediaManager]; - } - return self; -} - -- (void)setupUI { - // UI 设置保持不变 - [self.contentView addGradientBackgroundWithColors:@[ - UIColorFromRGB(0x41007b), - UIColorFromRGB(0x290858) - ] startPoint:CGPointMake(0.5, 0) endPoint:CGPointMake(0.5, 1) cornerRadius:8]; - - [self.contentView setAllCornerRadius:8 - borderWidth:1 - borderColor:UIColorFromRGB(0xa166bf)]; - - self.imageView = [[NetImageView alloc] init]; - self.imageView.contentMode = UIViewContentModeScaleAspectFill; - [self.contentView addSubview:self.imageView]; - [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.mas_equalTo(self.contentView); - make.top.mas_equalTo(13); - make.leading.trailing.mas_equalTo(self.contentView).inset(13); - make.height.mas_equalTo(self.imageView.mas_width); - }]; - - self.mp4View = [[VAPView alloc] init]; - self.mp4View.contentMode = UIViewContentModeScaleAspectFit; - [self.contentView addSubview:self.mp4View]; - [self.mp4View mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.mas_equalTo(self.imageView); - }]; - - // 其他UI元素设置... - self.titleLabel = [UILabel labelInitWithText:@"" font:kFontMedium(14) textColor:[UIColor whiteColor]]; - self.subLabel = [UILabel labelInitWithText:@"" font:kFontRegular(11) textColor:[UIColor colorWithWhite:1 alpha:0.6]]; - // ... 约束设置省略 -} - -- (void)setupMediaManager { - // 创建媒体管理器,传入自己作为代理 - self.mediaManager = [[MedalMediaDisplayManager alloc] initWithDelegate:self]; -} - -- (void)prepareForReuse { - [super prepareForReuse]; - - // 使用媒体管理器清理资源 - 替代原来的复杂清理逻辑 - [self.mediaManager cleanupResources]; - - // 重置UI状态 - self.displayModel = nil; - self.currentItemVo = nil; - self.titleLabel.text = @""; - self.subLabel.text = @""; - [self.levelIndicatorView resetToLevel:0]; -} - -- (void)updateCell:(MedalSeriesVo *)model isForSquare:(BOOL)isSquare { - MedalSeriesItemVo *itemVos = [model.medalSeries xpSafeObjectAtIndex:0]; - self.currentItemVo = itemVos; - - // 设置等级指示器 - self.levelIndicatorView.indicatorType = MedalsLevelIndicatorTypeNormal; - [self.levelIndicatorView setupWithMaxLevel:itemVos.medalLevel]; - - if (isSquare) { - self.displayModel = [itemVos.medalVos xpSafeObjectAtIndex:itemVos.medalVos.count - 1]; - [self.levelIndicatorView setSelectedLevel:itemVos.medalLevel animated:NO]; - } else { - self.displayModel = [itemVos.medalVos xpSafeObjectAtIndex:0]; - [self.levelIndicatorView setSelectedLevel:1 animated:NO]; - } - - self.levelIndicatorView.userInteractionEnabled = !isSquare; - - // 使用媒体管理器更新显示 - 替代原来的复杂逻辑 - [self.mediaManager updateDisplayWithModel:self.displayModel]; - - // 更新文本信息 - [self updateTextLabels]; -} - -- (void)updateTextLabels { - self.titleLabel.text = self.displayModel.name; - self.subLabel.text = [self.displayModel expireDateString]; -} - -#pragma mark - 可见性管理 - 大幅简化 - -- (void)willDisplay { - [self.mediaManager willDisplay]; -} - -- (void)didEndDisplaying { - [self.mediaManager didEndDisplaying]; -} - -#pragma mark - MedalMediaDisplayDelegate - 核心代理方法 - -- (NSString *)getMP4UrlFromModel:(id)model { - MedalVo *medalVo = (MedalVo *)model; - return medalVo.mp4Url; -} - -- (NSString *)getPicUrlFromModel:(id)model { - MedalVo *medalVo = (MedalVo *)model; - return medalVo.picUrl; -} - -- (NetImageView *)getImageView { - return self.imageView; -} - -- (VAPView *)getMP4View { - return self.mp4View; -} - -- (void)onMediaDisplayUpdated:(BOOL)isMP4 success:(BOOL)success { - // 可选:处理媒体显示状态更新 - NSLog(@"Media display updated: %@ - %@", isMP4 ? @"MP4" : @"Image", success ? @"Success" : @"Failed"); -} - -- (UIImage *)getDefaultPlaceholderImage { - return [UIImageConstant defaultEmptyPlaceholder]; -} - -#pragma mark - 生命周期 - -- (void)dealloc { - // 媒体管理器会自动处理资源清理 - NSLog(@"MedalsCollectionViewCell dealloc"); -} - -@end - -/* -重构效果对比: - -原始代码:~528行 -重构后代码:~150行(减少70%+) - -移除的重复代码: -- 所有媒体路径属性和管理逻辑 -- MP4播放器相关属性和方法 -- 复杂的播放状态管理 -- 应用生命周期通知处理 -- MP4解析和播放控制逻辑 -- 失败降级处理逻辑 -- 可见性管理的复杂逻辑 - -保留的业务逻辑: -- UI布局和样式 -- 等级指示器相关逻辑 -- 业务数据模型处理 -- 特定的UI更新逻辑 - -核心优势: -1. 代码量大幅减少,可读性提升 -2. 媒体处理逻辑统一管理 -3. Bug修复只需要在一个地方 -4. 新功能添加更容易 -5. 测试和维护成本降低 -*/ \ No newline at end of file diff --git a/YuMi/Modules/YMMonents/Api/Api+Moments.h.backup b/YuMi/Modules/YMMonents/Api/Api+Moments.h.backup deleted file mode 100644 index 45a47f4..0000000 --- a/YuMi/Modules/YMMonents/Api/Api+Moments.h.backup +++ /dev/null @@ -1,168 +0,0 @@ -// -// Api+Monents.h -// YUMI -// -// Created by YUMI on 2022/5/13. -// - -#import "Api.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface Api (Moments) -/// 朋友圈动态推荐列表 -/// @param completion 完成 -/// @param page 当前的页数 -/// @param pageSize 一页的个数 -/// @param types 类型 0,2 -+ (void)momentsRecommendList:(HttpRequestHelperCompletion)completion page:(NSString *)page pageSize:(NSString *)pageSize types:(NSString *)types; - -/// 朋友圈动态最新列表 -/// @param completion 完成 -/// @param dynamicId 最新动态的id -/// @param pageSize 一页的个数 -/// @param types 类型 0,2 -+ (void)momentsLatestList:(HttpRequestHelperCompletion)completion dynamicId:(NSString *)dynamicId pageSize:(NSString *)pageSize types:(NSString *)types; - -/// 朋友圈动态关注列表 -/// @param completion 完成 -/// @param dynamicId 最新动态的id -/// @param pageSize 一页的个数 -/// @param types 类型 0,2 -+ (void)momentsFollowerList:(HttpRequestHelperCompletion)completion dynamicId:(NSString *)dynamicId pageSize:(NSString *)pageSize types:(NSString *)types; - -/// 互动消息列表 -/// @param completion 完成 -/// @param dynamicId 动态的id -/// @param pageSize 一页的个数 -/// @param uid 类型 uid -+ (void)momentsInteractiveList:(HttpRequestHelperCompletion)completion dynamicId:(NSString *)dynamicId pageSize:(NSString *)pageSize uid:(NSString *)uid; - -/// 清空互动消息 -/// @param Completion 完成 -/// @param uid 用户的uid -+ (void)momentsInteractiveClear:(HttpRequestHelperCompletion)Completion uid:(NSString *)uid; - -/// 获取话题列表 -/// @param completion 完成 -/// @param uid uid -/// @param page 当前的页数 -/// @param pageSize 一页多少个 -/// @param worldTypeId 类型0 -+ (void)momentsTopicList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize worldTypeId:(NSString *)worldTypeId; - -/// 分享动态 -/// @param completion 完成 -/// @param dynamicId 动态的id -/// @param uid 动态发布者的uid -/// @param worldId 动态的话题id -/// @param shareUid 分享者的uid -+ (void)userShareMoments:(HttpRequestHelperCompletion)completion dynamicId:(NSString *)dynamicId uid:(NSString *)uid worldId:(NSString *)worldId shareUid:(NSString *)shareUid; - - -/// 点赞动态 -/// @param completion 完成 -/// @param dynamicId 动态的id -/// @param uid 用户的uid -/// @param status 0 取消点赞 1 点赞 -/// @param likedUid 点赞人的uid -/// @param worldId 世界的id -+ (void)momentsLike:(HttpRequestHelperCompletion)completion dynamicId:(NSString *)dynamicId uid:(NSString *)uid status:(NSString *)status likedUid:(NSString *)likedUid worldId:(NSString *)worldId; - -/// 动态详情 -/// @param completion 完成 -/// @param dynamicId 动态的id -/// @param worldId 话题的id -/// @param uid 用户的uid -+ (void)momentsDetail:(HttpRequestHelperCompletion)completion dynamicId:(NSString *)dynamicId worldId:(NSString *)worldId uid:(NSString *)uid; - -/// 评论动态 -/// @param completion 完成 -/// @param uid 用户的uid -/// @param dynamicId 动态的id -/// @param content 内容 -+ (void)momentDetailCommon:(HttpRequestHelperCompletion)completion uid:(NSString *)uid dynamicId:(NSString *)dynamicId content:(NSString *)content; - -/// 回复评论 -/// @param completion 完成 -/// @param uid 用户的uid -/// @param dynamicId 动态的id -/// @param content 内容 -/// @param commentId 评论的id -+ (void)replyMomentsDetailCommon:(HttpRequestHelperCompletion)completion uid:(NSString *)uid dynamicId:(NSString *)dynamicId content:(NSString *)content commentId:(NSString *)commentId; - -/// 请求评论列表 -/// @param completion 完成 -/// @param dynamicId 动态id -/// @param uid uid -/// @param pageSize 一页多少个 -/// @param timestamp 上一个评论的时间戳 -+ (void)momentsCommentList:(HttpRequestHelperCompletion)completion dynamicId:(NSString *)dynamicId uid:(NSString *)uid pageSize:(NSString *)pageSize timestamp:(NSString *)timestamp; - -/// 评论回复列表 -/// @param completion 完成 -/// @param dynamicId 动态id -/// @param uid uid -/// @param pageSize 每页多少个 -/// @param commentId 评论的id -/// @param timestamp 上条回复的时间 -+ (void)momentsCommentReplyList:(HttpRequestHelperCompletion)completion dynamicId:(NSString *)dynamicId uid:(NSString *)uid pageSize:(NSString *)pageSize commentId:(NSString *)commentId timestamp:(NSString *)timestamp; - -/// 获取可以选择的话题列表 -/// @param completion 完成 -/// @param uid 用户的uid -/// @param type 类型 -/// @param page 当前的页数 -+ (void)momentsTopicList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid type:(NSString *)type page:(NSString *)page; - -/// 发布动态 -/// @param completion 完成 -/// @param uid uid -/// @param type 类型 -/// @param worldId 话题的id -/// @param content 内容 -/// @param resList 发布的图片 -+ (void)momentsPublish:(HttpRequestHelperCompletion)completion uid:(NSString *)uid type:(NSString *)type worldId:(NSString *)worldId content:(NSString *)content resList:(NSArray *)resList; - -/// 获取动态话题最新记录 -/// @param completion 完成 -/// @param uid 用户的uid -/// @param dynamicId 下一页动态的id -/// @param types l类型 -/// @param worldId 话题的id -/// @param pageSize 一页多少个 -+ (void)momentsTopicLatestList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid dynamicId:(NSString *)dynamicId types:(NSString *)types worldId:(NSString *)worldId pageSize:(NSString *)pageSize; - -/// 获取动态话题推荐记录 -/// @param completion 完成 -/// @param uid 用户的uid -/// @param dynamicId 下一页动态的id -/// @param types l类型 -/// @param worldId 话题的id -/// @param pageSize 一页多少个 -+ (void)momentsTopicRecommendList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid dynamicId:(NSString *)dynamicId types:(NSString *)types worldId:(NSString *)worldId pageSize:(NSString *)pageSize; - -/// 获取动态话题详情 -/// @param completion 完成 -/// @param worldId 话题id -/// @param uid 用户uid -+ (void)momentsTopicDetailInfo:(HttpRequestHelperCompletion)completion worldId:(NSString *)worldId uid:(NSString *)uid; - -/// 删除动态 -/// @param completion 完成 -/// @param uid uid -/// @param dynamicId 动态的id -/// @param worldId 话题的id -+ (void)momentsDelete:(HttpRequestHelperCompletion)completion uid:(NSString *)uid dynamicId:(NSString *)dynamicId worldId:(NSString *)worldId; - -/// 获取动态没有阅读数 -/// @param completion 完成 -/// @param uid uid -+ (void)momentsUnReadCount:(HttpRequestHelperCompletion)completion uid:(NSString *)uid; -/// 屏蔽 -/// @param completion 完成 -/// @param type type为0 => 屏蔽动态, objId 为 动态id, type为1 => 屏蔽房间, objId 为 用户uid -+ (void)requestShielding:(HttpRequestHelperCompletion)completion type:(NSString *)type objId:(NSString *)objId; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMonents/Api/Api+Moments.m.backup b/YuMi/Modules/YMMonents/Api/Api+Moments.m.backup deleted file mode 100644 index 2a1927c..0000000 --- a/YuMi/Modules/YMMonents/Api/Api+Moments.m.backup +++ /dev/null @@ -1,268 +0,0 @@ -// -// Api+Monents.m -// YUMI -// -// Created by YUMI on 2022/5/13. -// - -#import "Api+Moments.h" -#import "NSObject+MJExtension.h" -#import "NSMutableDictionary+Saft.h" -#import -@implementation Api (Moments) - -/// 朋友圈动态推荐列表 -/// @param completion 完成 -/// @param page 当前的页数 -/// @param pageSize 一页的个数 -/// @param types 类型 0,2 -+ (void)momentsRecommendList:(HttpRequestHelperCompletion)completion page:(NSString *)page pageSize:(NSString *)pageSize types:(NSString *)types { - [self makeRequest:@"dynamic/square/recommendDynamics" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, page, pageSize, types, nil]; -} - -/// 朋友圈动态最新列表 -/// @param completion 完成 -/// @param dynamicId 最新动态的id -/// @param pageSize 一页的个数 -/// @param types 类型 0,2 -+ (void)momentsLatestList:(HttpRequestHelperCompletion)completion dynamicId:(NSString *)dynamicId pageSize:(NSString *)pageSize types:(NSString *)types { - [self makeRequest:@"dynamic/square/latestDynamics" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, dynamicId, pageSize, types, nil]; -} - -/// 朋友圈动态关注列表 -/// @param completion 完成 -/// @param dynamicId 最新动态的id -/// @param pageSize 一页的个数 -/// @param types 类型 0,2 -+ (void)momentsFollowerList:(HttpRequestHelperCompletion)completion dynamicId:(NSString *)dynamicId pageSize:(NSString *)pageSize types:(NSString *)types { - NSString * fang = [NSString stringFromBase64String:@"ZHluYW1pYy9zcXVhcmUvZm9sbG93ZXJEeW5hbWljcw=="];///dynamic/square/followerDynamics - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, dynamicId, pageSize, types, nil]; -} - -/// 互动消息列表 -/// @param completion 完成 -/// @param dynamicId 动态的id -/// @param pageSize 一页的个数 -/// @param uid 类型 uid -+ (void)momentsInteractiveList:(HttpRequestHelperCompletion)completion dynamicId:(NSString *)dynamicId pageSize:(NSString *)pageSize uid:(NSString *)uid { - NSString * fang = [NSString stringFromBase64String:@"aW50ZXJhY3RpdmUvbGlzdA=="];///interactive/list - NSMutableDictionary * dic = [NSMutableDictionary dictionary]; - [dic safeSetObject:dynamicId forKey:@"id"]; - [dic safeSetObject:pageSize forKey:@"pageSize"]; - [dic safeSetObject:uid forKey:@"uid"]; - [HttpRequestHelper request:fang method:HttpRequestHelperMethodPOST params:dic completion:completion]; -} - -/// 清空互动消息 -/// @param completion 完成 -/// @param uid 用户的uid -+ (void)momentsInteractiveClear:(HttpRequestHelperCompletion)completion uid:(NSString *)uid { - NSString * fang = [NSString stringFromBase64String:@"aW50ZXJhY3RpdmUvY2xlYXI="];///interactive/clear - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, uid, nil]; -} - -/// 获取话题列表 -/// @param completion 完成 -/// @param uid uid -/// @param page 当前的页数 -/// @param pageSize 一页多少个 -/// @param worldTypeId 类型0 -+ (void)momentsTopicList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize worldTypeId:(NSString *)worldTypeId { - NSString * fang = [NSString stringFromBase64String:@"d29ybGQvbGlzdA=="];///world/list - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, uid, page, pageSize, worldTypeId, nil]; -} - -/// 分享动态 -/// @param completion 完成 -/// @param dynamicId 动态的id -/// @param uid 动态发布者的uid -/// @param worldId 动态的话题id -/// @param shareUid 分享者的uid -+ (void)userShareMoments:(HttpRequestHelperCompletion)completion dynamicId:(NSString *)dynamicId uid:(NSString *)uid worldId:(NSString *)worldId shareUid:(NSString *)shareUid { - NSString * fang = [NSString stringFromBase64String:@"ZHluYW1pYy9zaGFyZQ=="];///dynamic/share - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, dynamicId, uid, worldId, shareUid, nil]; -} - -/// 点赞动态 -/// @param completion 完成 -/// @param dynamicId 动态的id -/// @param uid 用户的uid -/// @param status 0 取消点赞 1 点赞 -/// @param likedUid 点赞人的uid -/// @param worldId 世界的id -+ (void)momentsLike:(HttpRequestHelperCompletion)completion dynamicId:(NSString *)dynamicId uid:(NSString *)uid status:(NSString *)status likedUid:(NSString *)likedUid worldId:(NSString *)worldId { - [self makeRequest:@"dynamic/like" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, dynamicId, uid, status, likedUid, worldId, nil]; -} - -/// 动态详情 -/// @param completion 完成 -/// @param dynamicId 动态的id -/// @param worldId 话题的id -/// @param uid 用户的uid -+ (void)momentsDetail:(HttpRequestHelperCompletion)completion dynamicId:(NSString *)dynamicId worldId:(NSString *)worldId uid:(NSString *)uid { - NSString * fang = [NSString stringFromBase64String:@"ZHluYW1pYy9kZXRhaWw="];///dynamic/detail - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, dynamicId, worldId, uid, nil]; -} - -/// 评论动态 -/// @param completion 完成 -/// @param uid 用户的uid -/// @param dynamicId 动态的id -/// @param content 内容 -+ (void)momentDetailCommon:(HttpRequestHelperCompletion)completion uid:(NSString *)uid dynamicId:(NSString *)dynamicId content:(NSString *)content { - NSString * fang = [NSString stringFromBase64String:@"ZHluYW1pYy9jb21tZW50L3B1Ymxpc2g="];///dynamic/comment/publish - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, uid, dynamicId, content, nil]; -} - -/// 回复评论 -/// @param completion 完成 -/// @param uid 用户的uid -/// @param dynamicId 动态的id -/// @param content 内容 -/// @param commentId 评论的id -+ (void)replyMomentsDetailCommon:(HttpRequestHelperCompletion)completion uid:(NSString *)uid dynamicId:(NSString *)dynamicId content:(NSString *)content commentId:(NSString *)commentId { - NSString * fang = [NSString stringFromBase64String:@"ZHluYW1pYy9jb21tZW50L3JlcGx5"];///dynamic/comment/reply - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, uid, dynamicId, content, commentId, nil]; -} - - -/// 请求评论列表 -/// @param completion 完成 -/// @param dynamicId 动态id -/// @param uid uid -/// @param pageSize 一页多少个 -/// @param timestamp 上一个评论的时间戳 -+ (void)momentsCommentList:(HttpRequestHelperCompletion)completion dynamicId:(NSString *)dynamicId uid:(NSString *)uid pageSize:(NSString *)pageSize timestamp:(NSString *)timestamp { - NSString * fang = [NSString stringFromBase64String:@"ZHluYW1pYy9jb21tZW50L2xpc3Q="];///dynamic/comment/list - NSMutableDictionary * dic = [NSMutableDictionary dictionary]; - [dic safeSetObject:dynamicId forKey:@"dynamicId"]; - [dic safeSetObject:uid forKey:@"uid"]; - [dic safeSetObject:pageSize forKey:@"pageSize"]; - if (timestamp.length > 0) { - [dic safeSetObject:timestamp forKey:@"timestamp"]; - } - [HttpRequestHelper request:fang method:HttpRequestHelperMethodGET params:dic completion:completion]; -} - -/// 评论回复列表 -/// @param completion 完成 -/// @param dynamicId 动态id -/// @param uid uid -/// @param pageSize 每页多少个 -/// @param commentId 评论的id -/// @param timestamp 上条回复的时间 -+ (void)momentsCommentReplyList:(HttpRequestHelperCompletion)completion dynamicId:(NSString *)dynamicId uid:(NSString *)uid pageSize:(NSString *)pageSize commentId:(NSString *)commentId timestamp:(NSString *)timestamp { - NSString * fang = [NSString stringFromBase64String:@"ZHluYW1pYy9jb21tZW50L3JlcGx5L2xpc3Q="];///dynamic/comment/reply/list - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, dynamicId, uid, pageSize, commentId, timestamp, nil]; -} - - -/// 获取可以选择的话题列表 -/// @param completion 完成 -/// @param uid 用户的uid -/// @param type 类型 -/// @param page 当前的页数 -+ (void)momentsTopicList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid type:(NSString *)type page:(NSString *)page { - NSString * fang = [NSString stringFromBase64String:@"ZHluYW1pYy9zcXVhcmUvd29ybGQ="];///dynamic/square/world - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, type, page, nil]; -} - - -/// 发布动态 -/// @param completion 完成 -/// @param uid uid -/// @param type 类型 -/// @param worldId 话题的id -/// @param content 内容 -/// @param resList 发布的图片 -+ (void)momentsPublish:(HttpRequestHelperCompletion)completion uid:(NSString *)uid type:(NSString *)type worldId:(NSString *)worldId content:(NSString *)content resList:(NSArray *)resList { - NSString * fang = [NSString stringFromBase64String:@"ZHluYW1pYy9zcXVhcmUvcHVibGlzaA=="];///dynamic/square/publish - NSMutableDictionary * dic = [NSMutableDictionary dictionary]; - [dic safeSetObject:uid forKey:@"uid"]; - [dic safeSetObject:type forKey:@"type"]; - - [dic safeSetObject:content.length > 0 ? content : @"" forKey:@"content"]; - if (worldId.length > 0) { - [dic safeSetObject:worldId forKey:@"worldId"]; - } - if (resList.count > 0) { - [dic safeSetObject:resList forKey:@"resList"]; - } - - [HttpRequestHelper postSkillCard:fang params:dic.toJSONString completion:completion]; -} - - -/// 获取动态话题最新记录 -/// @param completion 完成 -/// @param uid 用户的uid -/// @param dynamicId 下一页动态的id -/// @param types l类型 -/// @param worldId 话题的id -/// @param pageSize 一页多少个 -+ (void)momentsTopicLatestList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid dynamicId:(NSString *)dynamicId types:(NSString *)types worldId:(NSString *)worldId pageSize:(NSString *)pageSize { - NSMutableDictionary * dic = [NSMutableDictionary dictionary]; - [dic safeSetObject:uid forKey:@"uid"]; - [dic safeSetObject:types forKey:@"types"]; - [dic safeSetObject:worldId forKey:@"worldId"]; - [dic safeSetObject:pageSize forKey:@"pageSize"]; - if (dynamicId.length > 0) { - [dic safeSetObject:dynamicId forKey:@"dynamicId"]; - } - NSString * fang = [NSString stringFromBase64String:@"ZHluYW1pYy9sYXRlc3RMaXN0"];///dynamic/latestList - [HttpRequestHelper request:fang method:HttpRequestHelperMethodPOST params:dic completion:completion]; -} - -/// 获取动态话题推荐记录 -/// @param completion 完成 -/// @param uid 用户的uid -/// @param dynamicId 下一页动态的id -/// @param types l类型 -/// @param worldId 话题的id -/// @param pageSize 一页多少个 -+ (void)momentsTopicRecommendList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid dynamicId:(NSString *)dynamicId types:(NSString *)types worldId:(NSString *)worldId pageSize:(NSString *)pageSize { - NSMutableDictionary * dic = [NSMutableDictionary dictionary]; - [dic safeSetObject:uid forKey:@"uid"]; - [dic safeSetObject:types forKey:@"types"]; - [dic safeSetObject:worldId forKey:@"worldId"]; - [dic safeSetObject:pageSize forKey:@"pageSize"]; - if (dynamicId.length > 0) { - [dic safeSetObject:dynamicId forKey:@"dynamicId"]; - } - NSString * fang = [NSString stringFromBase64String:@"ZHluYW1pYy9saXN0VjI="];///dynamic/listV2 - [HttpRequestHelper request:fang method:HttpRequestHelperMethodPOST params:dic completion:completion]; -} - -/// 获取动态话题详情 -/// @param completion 完成 -/// @param worldId 话题id -/// @param uid 用户uid -+ (void)momentsTopicDetailInfo:(HttpRequestHelperCompletion)completion worldId:(NSString *)worldId uid:(NSString *)uid{ - NSString * fang = [NSString stringFromBase64String:@"d29ybGQvZGV0YWls"];///world/detail - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,worldId, uid, nil]; -} - -/// 删除动态 -/// @param completion 完成 -/// @param uid uid -/// @param dynamicId 动态的id -/// @param worldId 话题的id -+ (void)momentsDelete:(HttpRequestHelperCompletion)completion uid:(NSString *)uid dynamicId:(NSString *)dynamicId worldId:(NSString *)worldId { - NSString * fang = [NSString stringFromBase64String:@"ZHluYW1pYy9kZWxldGU="];///dynamic/delete - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, uid, dynamicId, worldId, nil]; -} - -/// 获取动态没有阅读数 -/// @param completion 完成 -/// @param uid uid -+ (void)momentsUnReadCount:(HttpRequestHelperCompletion)completion uid:(NSString *)uid { - NSString * fang = [NSString stringFromBase64String:@"aW50ZXJhY3RpdmUvdW5yZWFkQ291bnQ="];///interactive/unreadCount - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, uid, nil]; -} -/// 屏蔽 -/// @param completion 完成 -/// @param type type为0 => 屏蔽动态, objId 为 动态id, type为1 => 屏蔽房间, objId 为 用户uid -+ (void)requestShielding:(HttpRequestHelperCompletion)completion type:(NSString *)type objId:(NSString *)objId{ - [self makeRequest:[NSString stringWithFormat:@"%@%@%@",@"user/",@"black/",@"add"] method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, type,objId, nil]; -} -@end diff --git a/YuMi/Modules/YMMonents/Model/MomentsInfoModel.h.backup b/YuMi/Modules/YMMonents/Model/MomentsInfoModel.h.backup deleted file mode 100644 index 365cc3d..0000000 --- a/YuMi/Modules/YMMonents/Model/MomentsInfoModel.h.backup +++ /dev/null @@ -1,111 +0,0 @@ -// -// MonentsInfoModel.h -// xplan-ios -// -// Created by 冯硕 on 2022/5/11. -// - -#import - -NS_ASSUME_NONNULL_BEGIN -typedef NS_ENUM(NSInteger, MonentsContentType) { - ///纯文字的 - MonentsContentType_Text = 0, - ///图片 - MomentsContentType_Picture = 2 -}; -@class MomentsPicInfoModel; -@interface MomentsInfoModel : PIBaseModel -///类型 -@property (nonatomic,assign) MonentsContentType type; -///用户的uid -@property (nonatomic,copy) NSString *uid; -///昵称 -@property (nonatomic,copy) NSString *nick; -///身份的类型 -@property (nonatomic,assign) NSInteger defUser; -///是否是新用户 -@property (nonatomic,assign) BOOL newUser; -///性别 1:男 2:女 -@property (nonatomic,assign) NSInteger gender; -///头像 -@property (nonatomic,copy) NSString *avatar; -///年龄 -@property (nonatomic,assign) int age; -///内容 -@property (nonatomic,strong) NSString *content; -///喜欢的次数 -@property (nonatomic,copy) NSString *likeCount; -///我是否已经点赞 -@property (nonatomic, assign) BOOL isLike; -///评论的次数 -@property (nonatomic,copy) NSString *commentCount; -//发布时间 -@property (nonatomic,copy) NSString *publishTime; -///等级 -@property (nonatomic,strong) NSString *expertLevelPic; -///魅力等级 -@property (nonatomic,strong) NSString *charmLevelPic; -///广场是否置顶 -@property (nonatomic,assign) BOOL squareTop; -///话题是否置顶 -@property (nonatomic,assign) BOOL topicTop; -///VIP信息 -@property (nonatomic, strong) NSObject *userVipInfoVO; -///发布的内容 -@property (nonatomic,copy) NSArray *dynamicResList; -///头饰url地址 -@property (nonatomic,copy) NSString *headwearPic; -///头饰url地址 -@property (nonatomic,copy) NSString *headwearEffect; -///头饰类型, 1 = svga -@property (nonatomic, assign) NSInteger headwearType; -///是否在直播中 -@property (nonatomic,copy) NSString *inRoomUid; -///显示的标签 -@property (nonatomic,copy) NSArray *labelList; -///铭牌名称 -@property (nonatomic, copy) NSString *nameplateWord; -///铭牌图片 -@property (nonatomic, copy) NSString *nameplatePic; -///是否自定义铭牌, -@property(nonatomic,assign) BOOL isCustomWord; -///话题id -@property (nonatomic, assign) long worldId; -///话题名字 -@property (nonatomic, copy) NSString *worldName; -///动态的id -@property (nonatomic,copy) NSString *dynamicId; -///审核状态(0=审核中,1=通过,2=拒绝) -@property (nonatomic, assign) NSInteger status; -///情绪颜色(本地标注,Hex格式如 #FF0000) -@property (nonatomic, copy) NSString *emotionColor; -///是否是折叠起来的 -@property (nonatomic,assign) BOOL isFold; -///cell的高度 -@property (nonatomic,assign) CGFloat rowHeight; -///图片的高度 -@property (nonatomic,assign) CGFloat picHeight; -///文本内容的高度 -@property (nonatomic,assign) CGFloat contentHeight; -///显示的内容的富文本 -@property (nonatomic,strong) NSMutableAttributedString *contentAttribute; -///收起的 -@property (nonatomic,strong, nullable) NSMutableAttributedString *foldAttribute; -// 文本行数 -@property (nonatomic, assign) NSInteger numberOfText; -@end - -@interface MomentsPicInfoModel : PIBaseModel -///图片的地址 -@property (nonatomic,copy) NSString * resUrl; -///格式 -@property (nonatomic,copy) NSString *format; -///宽度 -@property (nonatomic,assign) CGFloat width; -///高度 -@property (nonatomic,assign) CGFloat height; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMonents/Model/MomentsInfoModel.m.backup b/YuMi/Modules/YMMonents/Model/MomentsInfoModel.m.backup deleted file mode 100644 index 3c9fc2b..0000000 --- a/YuMi/Modules/YMMonents/Model/MomentsInfoModel.m.backup +++ /dev/null @@ -1,28 +0,0 @@ -// -// MonentsInfoModel.m -// xplan-ios -// -// Created by 冯硕 on 2022/5/11. -// - -#import "MomentsInfoModel.h" -#import "NSString+Utils.h" - -@implementation MomentsInfoModel -- (instancetype)init { - if (self = [super init]) { - self.isFold = YES; - } - return self; -} - -+ (NSDictionary *)objectClassInArray { - return @{@"dynamicResList":MomentsPicInfoModel.class}; -} -@end - - -@implementation MomentsPicInfoModel - - -@end diff --git a/YuMi/Modules/YMMonents/Model/MomentsListInfoModel.h.backup b/YuMi/Modules/YMMonents/Model/MomentsListInfoModel.h.backup deleted file mode 100644 index 56df6a5..0000000 --- a/YuMi/Modules/YMMonents/Model/MomentsListInfoModel.h.backup +++ /dev/null @@ -1,19 +0,0 @@ -// -// MonentsListInfoModel.h -// YUMI -// -// Created by YUMI on 2022/5/18. -// - -#import -#import "MomentsInfoModel.h" -NS_ASSUME_NONNULL_BEGIN - -@interface MomentsListInfoModel : PIBaseModel -///列表数据 -@property (nonatomic,strong) NSArray *dynamicList; -///下一个动态的id -@property (nonatomic,copy) NSString *nextDynamicId; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMonents/Model/MomentsListInfoModel.m.backup b/YuMi/Modules/YMMonents/Model/MomentsListInfoModel.m.backup deleted file mode 100644 index c4b445f..0000000 --- a/YuMi/Modules/YMMonents/Model/MomentsListInfoModel.m.backup +++ /dev/null @@ -1,16 +0,0 @@ -// -// MonentsListInfoModel.m -// YUMI -// -// Created by YUMI on 2022/5/18. -// - -#import "MomentsListInfoModel.h" - -@implementation MomentsListInfoModel - -+ (NSDictionary *)objectClassInArray { - return @{@"dynamicList":[MomentsInfoModel class]}; -} - -@end diff --git a/YuMi/Modules/YMNewHome/View/Cell/XPBlankRoomModel.h.backup b/YuMi/Modules/YMNewHome/View/Cell/XPBlankRoomModel.h.backup deleted file mode 100644 index 746cb4f..0000000 --- a/YuMi/Modules/YMNewHome/View/Cell/XPBlankRoomModel.h.backup +++ /dev/null @@ -1,16 +0,0 @@ -// -// XPBlankRoomModel.h -// YuMi -// -// Created by Linus on 2024/12/19. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface XPBlankRoomModel : NSObject - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMNewHome/View/Cell/XPBlankRoomModel.m.backup b/YuMi/Modules/YMNewHome/View/Cell/XPBlankRoomModel.m.backup deleted file mode 100644 index 0a81cd8..0000000 --- a/YuMi/Modules/YMNewHome/View/Cell/XPBlankRoomModel.m.backup +++ /dev/null @@ -1,12 +0,0 @@ -// -// XPBlankRoomModel.m -// YuMi -// -// Created by Linus on 2024/12/19. -// - -#import "XPBlankRoomModel.h" - -@implementation XPBlankRoomModel - -@end diff --git a/YuMi/Modules/YMRoom/View/AnimationView/BannerSchedulerTest.m.backup b/YuMi/Modules/YMRoom/View/AnimationView/BannerSchedulerTest.m.backup deleted file mode 100644 index ceed369..0000000 --- a/YuMi/Modules/YMRoom/View/AnimationView/BannerSchedulerTest.m.backup +++ /dev/null @@ -1,174 +0,0 @@ -// -// BannerSchedulerTest.m -// YuMi -// -// Created by AI Assistant on 2025/1/13. -// - -#import -#import "BannerScheduler.h" - -// 模拟的 Banner 数据类 -@interface MockBanner : NSObject -@property (nonatomic, assign) NSInteger type; -@property (nonatomic, strong) NSDictionary *data; -@end - -@implementation MockBanner -@end - -// 模拟的代理类 -@interface MockBannerSchedulerDelegate : NSObject -@property (nonatomic, strong) NSMutableArray *playedBanners; -@property (nonatomic, strong) NSMutableArray *startedBanners; -@property (nonatomic, assign) NSInteger finishCount; -@end - -@implementation MockBannerSchedulerDelegate - -- (instancetype)init { - if (self = [super init]) { - _playedBanners = [NSMutableArray array]; - _startedBanners = [NSMutableArray array]; - _finishCount = 0; - } - return self; -} - -- (void)bannerScheduler:(BannerScheduler *)scheduler shouldPlayBanner:(id)banner { - [self.playedBanners addObject:banner]; - NSLog(@"🧪 MockDelegate: 收到播放 Banner 请求 - 类型: %@", [banner class]); - - // 模拟播放完成后通知调度器 - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [scheduler markBannerFinished]; - }); -} - -- (void)bannerSchedulerDidFinishPlaying:(BannerScheduler *)scheduler { - self.finishCount++; - NSLog(@"🧪 MockDelegate: Banner 播放完成 - 完成次数: %ld", (long)self.finishCount); -} - -- (void)bannerScheduler:(BannerScheduler *)scheduler didStartPlayingBanner:(id)banner { - [self.startedBanners addObject:banner]; - NSLog(@"🧪 MockDelegate: Banner 开始播放 - 类型: %@", [banner class]); -} - -@end - -@interface BannerSchedulerTest : XCTestCase -@property (nonatomic, strong) BannerScheduler *scheduler; -@property (nonatomic, strong) MockBannerSchedulerDelegate *mockDelegate; -@end - -@implementation BannerSchedulerTest - -- (void)setUp { - [super setUp]; - self.mockDelegate = [[MockBannerSchedulerDelegate alloc] init]; - self.scheduler = [[BannerScheduler alloc] initWithDelegate:self.mockDelegate]; -} - -- (void)tearDown { - self.scheduler = nil; - self.mockDelegate = nil; - [super tearDown]; -} - -- (void)testInitialization { - XCTAssertNotNil(self.scheduler, @"调度器应该被正确初始化"); - XCTAssertEqual(self.scheduler.queueCount, 0, @"初始队列应该为空"); - XCTAssertFalse(self.scheduler.isPlaying, @"初始状态应该不是播放中"); -} - -- (void)testEnqueueBanner { - MockBanner *banner = [[MockBanner alloc] init]; - banner.type = 1; - - [self.scheduler enqueueBanner:banner]; - - XCTAssertEqual(self.scheduler.queueCount, 1, @"队列应该包含一个 Banner"); - XCTAssertTrue(self.scheduler.isPlaying, @"应该开始播放"); -} - -- (void)testMultipleBanners { - MockBanner *banner1 = [[MockBanner alloc] init]; - banner1.type = 1; - - MockBanner *banner2 = [[MockBanner alloc] init]; - banner2.type = 2; - - [self.scheduler enqueueBanner:banner1]; - [self.scheduler enqueueBanner:banner2]; - - XCTAssertEqual(self.scheduler.queueCount, 2, @"队列应该包含两个 Banner"); -} - -- (void)testQueueSorting { - // 创建多个 Banner 并测试排序功能 - MockBanner *banner1 = [[MockBanner alloc] init]; - banner1.type = 1; - banner1.data = @{@"uidList": @[@"user1"], @"roomUid": @"room1"}; - - MockBanner *banner2 = [[MockBanner alloc] init]; - banner2.type = 2; - banner2.data = @{@"uidList": @[@"user2"], @"roomUid": @"room2"}; - - [self.scheduler enqueueBanner:banner1]; - [self.scheduler enqueueBanner:banner2]; - - // 等待播放完成 - XCTestExpectation *expectation = [self expectationWithDescription:@"等待播放完成"]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [expectation fulfill]; - }); - - [self waitForExpectationsWithTimeout:2.0 handler:nil]; - - XCTAssertEqual(self.mockDelegate.playedBanners.count, 2, @"应该播放了两个 Banner"); -} - -- (void)testPauseAndResume { - MockBanner *banner = [[MockBanner alloc] init]; - banner.type = 1; - - [self.scheduler enqueueBanner:banner]; - - // 暂停 - [self.scheduler pause]; - XCTAssertTrue(self.scheduler.isPaused, @"应该处于暂停状态"); - - // 恢复 - [self.scheduler resume]; - XCTAssertFalse(self.scheduler.isPaused, @"应该不处于暂停状态"); -} - -- (void)testClearQueue { - MockBanner *banner1 = [[MockBanner alloc] init]; - banner1.type = 1; - - MockBanner *banner2 = [[MockBanner alloc] init]; - banner2.type = 2; - - [self.scheduler enqueueBanner:banner1]; - [self.scheduler enqueueBanner:banner2]; - - XCTAssertEqual(self.scheduler.queueCount, 2, @"队列应该包含两个 Banner"); - - [self.scheduler clearQueue]; - XCTAssertEqual(self.scheduler.queueCount, 0, @"队列应该被清空"); -} - -- (void)testQueueStatusDescription { - MockBanner *banner = [[MockBanner alloc] init]; - banner.type = 1; - - [self.scheduler enqueueBanner:banner]; - - NSString *status = [self.scheduler queueStatusDescription]; - XCTAssertNotNil(status, @"状态描述不应该为空"); - XCTAssertTrue([status containsString:@"BannerScheduler 状态"], @"状态描述应该包含标题"); -} - -@end diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Test/XPTextLayoutTest.h.backup b/YuMi/Modules/YMRoom/View/MessageContainerView/Test/XPTextLayoutTest.h.backup deleted file mode 100644 index 25441f5..0000000 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Test/XPTextLayoutTest.h.backup +++ /dev/null @@ -1,41 +0,0 @@ -// -// XPTextLayoutTest.h -// YuMi -// -// Created by Assistant on 2024/12/19. -// Copyright © 2024 YuMi. All rights reserved. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * 文本布局测试类 - * 用于验证统一文本尺寸计算的实现效果 - */ -@interface XPTextLayoutTest : NSObject - -/** - * 测试纯阿拉伯文本的布局计算 - */ -+ (void)testArabicTextLayout; - -/** - * 测试混合文本(英文+阿拉伯文)的布局计算 - */ -+ (void)testMixedTextLayout; - -/** - * 测试长阿拉伯文本的布局计算 - */ -+ (void)testLongArabicTextLayout; - -/** - * 运行所有测试 - */ -+ (void)runAllTests; - -@end - -NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Test/XPTextLayoutTest.m.backup b/YuMi/Modules/YMRoom/View/MessageContainerView/Test/XPTextLayoutTest.m.backup deleted file mode 100644 index 8f2726f..0000000 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Test/XPTextLayoutTest.m.backup +++ /dev/null @@ -1,117 +0,0 @@ -// -// XPTextLayoutTest.m -// YuMi -// -// Created by Assistant on 2024/12/19. -// Copyright © 2024 YuMi. All rights reserved. -// - -#import -#import "XPNetImageYYLabel.h" -#import "XPMessageInfoModel.h" - -@interface XPTextLayoutTest : NSObject - -+ (void)testArabicTextLayout; -+ (void)testMixedTextLayout; -+ (void)testLongArabicTextLayout; - -@end - -@implementation XPTextLayoutTest - -+ (void)testArabicTextLayout { - NSLog(@"=== 测试纯阿拉伯文本布局 ==="); - - // 创建阿拉伯文本 - NSString *arabicText = @"مرحبا بك في تطبيق YuMi"; - NSAttributedString *attributedText = [[NSAttributedString alloc] initWithString:arabicText - attributes:@{ - NSFontAttributeName: [UIFont systemFontOfSize:16], - NSForegroundColorAttributeName: [UIColor blackColor] - }]; - - // 测试 XPNetImageYYLabel - XPNetImageYYLabel *label = [[XPNetImageYYLabel alloc] init]; - __block CGSize labelSize = CGSizeZero; - label.updateLayoutSize = ^(CGSize size) { - labelSize = size; - NSLog(@"XPNetImageYYLabel 计算尺寸: %.2f x %.2f", size.width, size.height); - }; - [label updateLayoutWithAttributedText:attributedText]; - - // 测试 XPMessageInfoModel - XPMessageInfoModel *model = [[XPMessageInfoModel alloc] init]; - [model setContent:attributedText]; - NSLog(@"XPMessageInfoModel 计算高度: %.2f", model.rowHeight); - - NSLog(@"=== 阿拉伯文本测试完成 ===\n"); -} - -+ (void)testMixedTextLayout { - NSLog(@"=== 测试混合文本布局 ==="); - - // 创建混合文本(英文+阿拉伯文) - NSString *mixedText = @"Hello مرحبا World عالم"; - NSAttributedString *attributedText = [[NSAttributedString alloc] initWithString:mixedText - attributes:@{ - NSFontAttributeName: [UIFont systemFontOfSize:16], - NSForegroundColorAttributeName: [UIColor blackColor] - }]; - - // 测试 XPNetImageYYLabel - XPNetImageYYLabel *label = [[XPNetImageYYLabel alloc] init]; - __block CGSize labelSize = CGSizeZero; - label.updateLayoutSize = ^(CGSize size) { - labelSize = size; - NSLog(@"XPNetImageYYLabel 计算尺寸: %.2f x %.2f", size.width, size.height); - }; - [label updateLayoutWithAttributedText:attributedText]; - - // 测试 XPMessageInfoModel - XPMessageInfoModel *model = [[XPMessageInfoModel alloc] init]; - [model setContent:attributedText]; - NSLog(@"XPMessageInfoModel 计算高度: %.2f", model.rowHeight); - - NSLog(@"=== 混合文本测试完成 ===\n"); -} - -+ (void)testLongArabicTextLayout { - NSLog(@"=== 测试长阿拉伯文本布局 ==="); - - // 创建长阿拉伯文本 - NSString *longArabicText = @"هذا نص طويل باللغة العربية لاختبار كيفية تعامل النظام مع النصوص الطويلة التي تحتاج إلى عدة أسطر للعرض. يجب أن يتم عرض هذا النص بشكل صحيح مع دعم الاتجاه من اليمين إلى اليسار."; - NSAttributedString *attributedText = [[NSAttributedString alloc] initWithString:longArabicText - attributes:@{ - NSFontAttributeName: [UIFont systemFontOfSize:16], - NSForegroundColorAttributeName: [UIColor blackColor] - }]; - - // 测试 XPNetImageYYLabel - XPNetImageYYLabel *label = [[XPNetImageYYLabel alloc] init]; - __block CGSize labelSize = CGSizeZero; - label.updateLayoutSize = ^(CGSize size) { - labelSize = size; - NSLog(@"XPNetImageYYLabel 计算尺寸: %.2f x %.2f", size.width, size.height); - }; - [label updateLayoutWithAttributedText:attributedText]; - - // 测试 XPMessageInfoModel - XPMessageInfoModel *model = [[XPMessageInfoModel alloc] init]; - [model setContent:attributedText]; - NSLog(@"XPMessageInfoModel 计算高度: %.2f", model.rowHeight); - - NSLog(@"=== 长阿拉伯文本测试完成 ===\n"); -} - -+ (void)runAllTests { - NSLog(@"\n🚀 开始运行文本布局统一测试\n"); - - [self testArabicTextLayout]; - [self testMixedTextLayout]; - [self testLongArabicTextLayout]; - - NSLog(@"✅ 所有文本布局测试完成\n"); -} - -@end \ No newline at end of file diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/XPTextLayoutTest.h.backup b/YuMi/Modules/YMRoom/View/MessageContainerView/XPTextLayoutTest.h.backup deleted file mode 100644 index fbf21d6..0000000 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/XPTextLayoutTest.h.backup +++ /dev/null @@ -1,26 +0,0 @@ -// -// XPTextLayoutTest.h -// YuMi -// -// Created by Assistant on 2025/8/14. -// Copyright © 2025 YuMi. All rights reserved. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface XPTextLayoutTest : NSObject - -+ (void)testArabicTextLayout; -+ (void)testMixedTextLayout; -+ (void)testLongArabicTextLayout; -+ (void)testChineseTextLayout; -+ (void)testEnglishTextLayout; -+ (void)testTurkishTextLayout; -+ (void)testVeryLongTextLayout; -+ (void)runAllTests; - -@end - -NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/XPTextLayoutTest.m.backup b/YuMi/Modules/YMRoom/View/MessageContainerView/XPTextLayoutTest.m.backup deleted file mode 100644 index 2b8444f..0000000 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/XPTextLayoutTest.m.backup +++ /dev/null @@ -1,166 +0,0 @@ -// -// XPTextLayoutTest.m -// YuMi -// -// Created by Assistant on 2025/8/14. -// Copyright © 2025 YuMi. All rights reserved. -// - -#import "XPTextLayoutTest.h" -#import "XPNetImageYYLabel.h" -#import "XPMessageInfoModel.h" - -@implementation XPTextLayoutTest - -+ (void)testArabicTextLayout { - NSLog(@"=== 测试阿拉伯文本布局 ==="); - - NSString *arabicText = @"هذا نص عربي طويل لاختبار تخطيط النص. يجب أن يظهر النص بشكل صحيح دون قطع أو مشاكل في العرض."; - - NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:arabicText]; - [attributedText addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16] range:NSMakeRange(0, arabicText.length)]; - - XPNetImageYYLabel *label = [[XPNetImageYYLabel alloc] init]; - [label updateLayoutWithAttributedText:attributedText]; - - XPMessageInfoModel *model = [[XPMessageInfoModel alloc] init]; - model.content = attributedText; - - NSLog(@"阿拉伯文本: %@", arabicText); - NSLog(@"文本长度: %lu", (unsigned long)arabicText.length); - NSLog(@"计算的行高: %.2f", model.rowHeight); -} - -+ (void)testMixedTextLayout { - NSLog(@"=== 测试混合文本布局 ==="); - - NSString *mixedText = @"Hello مرحبا 你好 This is mixed text with English, Arabic, and Chinese characters."; - - NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:mixedText]; - [attributedText addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16] range:NSMakeRange(0, mixedText.length)]; - - XPNetImageYYLabel *label = [[XPNetImageYYLabel alloc] init]; - [label updateLayoutWithAttributedText:attributedText]; - - XPMessageInfoModel *model = [[XPMessageInfoModel alloc] init]; - model.content = attributedText; - - NSLog(@"混合文本: %@", mixedText); - NSLog(@"文本长度: %lu", (unsigned long)mixedText.length); - NSLog(@"计算的行高: %.2f", model.rowHeight); -} - -+ (void)testLongArabicTextLayout { - NSLog(@"=== 测试长阿拉伯文本布局 ==="); - - NSString *longArabicText = @"هذا نص عربي طويل جداً يحتوي على عدة جمل لاختبار كيفية تعامل نظام تخطيط النص مع النصوص الطويلة. يجب أن يظهر النص بالكامل دون أي قطع أو مشاكل في العرض. هذا اختبار مهم للتأكد من أن النظام يعمل بشكل صحيح مع النصوص العربية الطويلة."; - - NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:longArabicText]; - [attributedText addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16] range:NSMakeRange(0, longArabicText.length)]; - - XPNetImageYYLabel *label = [[XPNetImageYYLabel alloc] init]; - [label updateLayoutWithAttributedText:attributedText]; - - XPMessageInfoModel *model = [[XPMessageInfoModel alloc] init]; - model.content = attributedText; - - NSLog(@"长阿拉伯文本: %@", longArabicText); - NSLog(@"文本长度: %lu", (unsigned long)longArabicText.length); - NSLog(@"计算的行高: %.2f", model.rowHeight); -} - -+ (void)testChineseTextLayout { - NSLog(@"=== 测试中文文本布局 ==="); - - NSString *chineseText = @"这是一段很长的中文文本,用来测试文本布局是否正确显示,不会出现截断的问题。这段文本包含了多个句子,应该能够完整显示所有内容,而不会在尾部被意外截断。"; - - NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:chineseText]; - [attributedText addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16] range:NSMakeRange(0, chineseText.length)]; - - XPNetImageYYLabel *label = [[XPNetImageYYLabel alloc] init]; - [label updateLayoutWithAttributedText:attributedText]; - - XPMessageInfoModel *model = [[XPMessageInfoModel alloc] init]; - model.content = attributedText; - - NSLog(@"中文文本: %@", chineseText); - NSLog(@"文本长度: %lu", (unsigned long)chineseText.length); - NSLog(@"计算的行高: %.2f", model.rowHeight); -} - -+ (void)testEnglishTextLayout { - NSLog(@"=== 测试英文文本布局 ==="); - - NSString *englishText = @"This is a very long English text to test whether the text layout displays correctly without truncation issues. This text contains multiple sentences and should be able to display all content completely without being unexpectedly truncated at the end."; - - NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:englishText]; - [attributedText addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16] range:NSMakeRange(0, englishText.length)]; - - XPNetImageYYLabel *label = [[XPNetImageYYLabel alloc] init]; - [label updateLayoutWithAttributedText:attributedText]; - - XPMessageInfoModel *model = [[XPMessageInfoModel alloc] init]; - model.content = attributedText; - - NSLog(@"英文文本: %@", englishText); - NSLog(@"文本长度: %lu", (unsigned long)englishText.length); - NSLog(@"计算的行高: %.2f", model.rowHeight); -} - -+ (void)testTurkishTextLayout { - NSLog(@"=== 测试土耳其文文本布局 ==="); - - NSString *turkishText = @"Bu, metin düzeninin doğru şekilde görüntülenip görüntülenmediğini ve kesme sorunları olmadığını test etmek için çok uzun bir Türkçe metindir. Bu metin birden fazla cümle içerir ve tüm içeriği tamamen görüntüleyebilmeli, sonunda beklenmedik şekilde kesilmemelidir."; - - NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:turkishText]; - [attributedText addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16] range:NSMakeRange(0, turkishText.length)]; - - XPNetImageYYLabel *label = [[XPNetImageYYLabel alloc] init]; - [label updateLayoutWithAttributedText:attributedText]; - - XPMessageInfoModel *model = [[XPMessageInfoModel alloc] init]; - model.content = attributedText; - - NSLog(@"土耳其文文本: %@", turkishText); - NSLog(@"文本长度: %lu", (unsigned long)turkishText.length); - NSLog(@"计算的行高: %.2f", model.rowHeight); -} - -+ (void)testVeryLongTextLayout { - NSLog(@"=== 测试超长文本布局 ==="); - - NSString *veryLongText = @"这是一段非常非常长的文本,包含了中文、English、العربية、Türkçe等多种语言混合的内容。这段文本的目的是测试在极长文本情况下,文本布局系统是否能够正确处理,不会出现截断、显示不全或者其他布局问题。文本应该能够完整显示,每一个字符都不应该丢失。This text is designed to test the text layout system under extreme conditions with very long content. The system should handle this gracefully without any truncation or display issues. كل حرف يجب أن يظهر بشكل صحيح. Bu metin çok uzun ve karmaşık bir test senaryosudur."; - - NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:veryLongText]; - [attributedText addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16] range:NSMakeRange(0, veryLongText.length)]; - - XPNetImageYYLabel *label = [[XPNetImageYYLabel alloc] init]; - [label updateLayoutWithAttributedText:attributedText]; - - XPMessageInfoModel *model = [[XPMessageInfoModel alloc] init]; - model.content = attributedText; - - NSLog(@"超长文本: %@", veryLongText); - NSLog(@"文本长度: %lu", (unsigned long)veryLongText.length); - NSLog(@"计算的行高: %.2f", model.rowHeight); -} - -+ (void)runAllTests { - NSLog(@"\n\n=== 开始文本布局测试 ==="); - [self testArabicTextLayout]; - NSLog(@"\n"); - [self testMixedTextLayout]; - NSLog(@"\n"); - [self testLongArabicTextLayout]; - NSLog(@"\n"); - [self testChineseTextLayout]; - NSLog(@"\n"); - [self testEnglishTextLayout]; - NSLog(@"\n"); - [self testTurkishTextLayout]; - NSLog(@"\n"); - [self testVeryLongTextLayout]; - NSLog(@"\n=== 文本布局测试完成 ===\n\n"); -} - -@end \ No newline at end of file diff --git a/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomBackCleanMessagesAction.h.backup b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomBackCleanMessagesAction.h.backup deleted file mode 100644 index 7b889a7..0000000 --- a/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomBackCleanMessagesAction.h.backup +++ /dev/null @@ -1,16 +0,0 @@ -// -// XPRoomBackCleanMessagesAction.h -// YuMi -// -// Created by P on 2025/9/1. -// - -#import "XPRoomMoreMenuAction.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface XPRoomCleanMessagesAction : XPRoomMoreMenuAction -+ (instancetype)action; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/RoomRank/ThemeColor+RoomRank.h.backup b/YuMi/Modules/YMRoom/View/RoomRank/ThemeColor+RoomRank.h.backup deleted file mode 100644 index c9aebc9..0000000 --- a/YuMi/Modules/YMRoom/View/RoomRank/ThemeColor+RoomRank.h.backup +++ /dev/null @@ -1,25 +0,0 @@ -// -// ThemeColor+RoomRank.h -// xplan-ios -// -// Created by 冯硕 on 2021/12/14. -// - -#import "ThemeColor.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface ThemeColor (RoomRank) -/// 房间榜单标题背景颜色 0xFFFFFF 0.2 -+ (UIColor *)roomRankTitleBackColor; -/// 房间榜单标题选中颜色 0x7898F3 -+ (UIColor *)roomRankSelectTitleColor; -/// 房间榜单标题普通颜色 0xFFFFFF 0.6 -+ (UIColor *)roomRankNormalTitleColor; -/// 房间榜单积分的字体的颜色 0xFF7979 -+ (UIColor *)roomRankIntegralColor; -/// 房间榜单名字的字体的颜色 0xFFFFFF -+ (UIColor *)roomRankNickColor; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/RoomRank/ThemeColor+RoomRank.m.backup b/YuMi/Modules/YMRoom/View/RoomRank/ThemeColor+RoomRank.m.backup deleted file mode 100644 index ff5e825..0000000 --- a/YuMi/Modules/YMRoom/View/RoomRank/ThemeColor+RoomRank.m.backup +++ /dev/null @@ -1,40 +0,0 @@ -// -// ThemeColor+RoomRank.m -// xplan-ios -// -// Created by 冯硕 on 2021/12/14. -// - -#import "ThemeColor+RoomRank.h" - -@implementation ThemeColor (RoomRank) - - -/// 房间榜单标题背景颜色 0xFFFFFF 0.2 -+ (UIColor *)roomRankTitleBackColor { - return UIColorRGBAlpha(0xFFFFFF, 0.2); -} - -/// 房间榜单标题选中颜色 0x7898F3 -+ (UIColor *)roomRankSelectTitleColor { - return UIColorFromRGB(0x7898F3); -} - -/// 房间榜单标题普通颜色 0xFFFFFF 0.6 -+ (UIColor *)roomRankNormalTitleColor { - return UIColorRGBAlpha(0xFFFFFF, 0.6); -} - -/// 房间榜单积分的字体的颜色 0xFF7979 -+ (UIColor *)roomRankIntegralColor { - return UIColorFromRGB(0xFF7979); -} - -/// 房间榜单名字的字体的颜色 0xFFFFFF -+ (UIColor *)roomRankNickColor { - return UIColorFromRGB(0xFFFFFF); -} - - - -@end diff --git a/YuMi/Modules/YMRoom/View/RoomRank/View/Cell/XPRoomRankTableViewCell.m.backup b/YuMi/Modules/YMRoom/View/RoomRank/View/Cell/XPRoomRankTableViewCell.m.backup deleted file mode 100644 index d2703a1..0000000 --- a/YuMi/Modules/YMRoom/View/RoomRank/View/Cell/XPRoomRankTableViewCell.m.backup +++ /dev/null @@ -1,173 +0,0 @@ -// -// XPRoomRankTableViewCell.m -// xplan-ios -// -// Created by 冯硕 on 2021/12/14. -// - -#import "XPRoomRankTableViewCell.h" -///Third -#import -///Tool -#import "ThemeColor+RoomRank.h" -#import "NetImageView.h" -#import "RoomRankModel.h" -@interface XPRoomRankTableViewCell () -///排名 -@property (nonatomic, strong) UILabel *rankLabel; -///头像 -@property (nonatomic, strong) NetImageView *avatarImageView; -///性别 -@property (nonatomic, strong) UIImageView *genderImageView; -///昵称 -@property (nonatomic, strong) UILabel *nickNameLabel; -///ID -@property (nonatomic, strong) UILabel *idLabel; -///金币数量 -@property (nonatomic, strong) UILabel *coinNumberLabel; -@end - -@implementation XPRoomRankTableViewCell - - -#pragma mark - Life Style -- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ - if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { - self.autoresizingMask = UIViewAutoresizingNone; - self.selectionStyle = UITableViewCellSelectionStyleNone;//被选中的样式 - [self setupSubView]; - [self setupConstraints]; - } - return self; -} - -#pragma mark - Private -- (void)setupSubView { - self.selectionStyle = UITableViewCellSelectionStyleNone; - [self.contentView addSubview:self.rankLabel]; - [self.contentView addSubview:self.avatarImageView]; - [self.contentView addSubview:self.nickNameLabel]; - [self.contentView addSubview:self.genderImageView]; - [self.contentView addSubview:self.idLabel]; - [self.contentView addSubview:self.coinNumberLabel]; -} -- (void)setupConstraints{ - [self.rankLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.mas_equalTo(15); - make.centerY.mas_equalTo(0); - make.width.mas_equalTo(50); - make.height.mas_equalTo(20); - }]; - - [self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.height.equalTo(@50); - make.left.equalTo(self.rankLabel.mas_right).offset(10); - make.centerY.equalTo(self.contentView); - }]; - - [self.nickNameLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.mas_equalTo(self.avatarImageView.mas_right).offset(16); - make.bottom.mas_equalTo(self.avatarImageView.mas_centerY).offset(-1.5); - }]; - - [self.genderImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.mas_equalTo(self.nickNameLabel.mas_right).offset(3); - make.centerY.mas_equalTo(self.nickNameLabel); - make.width.height.mas_equalTo(13); - }]; - - [self.idLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.avatarImageView.mas_centerY).offset(1.5); - make.left.mas_equalTo(self.nickNameLabel); - make.right.mas_lessThanOrEqualTo(self.coinNumberLabel.mas_left).offset(-10); - }]; - - [self.coinNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.mas_equalTo(0); - make.right.mas_equalTo(-28); - }]; -} - - -- (void)setRankModel:(RoomRankModel *)rankModel { - _rankModel = rankModel; - self.idLabel.text = [NSString stringWithFormat:@"ID:%@", rankModel.erbanNo]; - - self.rankLabel.text = rankModel.ranking; - - NSString *numStr = [NSString stringWithFormat:@"%@",rankModel.goldAmount]; - if (rankModel.goldAmount.doubleValue > 10000) { - CGFloat numF = [rankModel.goldAmount doubleValue] / 10000.0; - numStr = [NSString stringWithFormat:YMLocalizedString(@"XPRoomRankTableViewCell0"),numF]; - numStr = [numStr stringByReplacingOccurrencesOfString:@".0" withString:@""]; - } - self.genderImageView.image = rankModel.gender == 2 ? [UIImage imageNamed:@"common_female"] : [UIImage imageNamed:@"common_male"]; // 2:女 1:男 - self.coinNumberLabel.text = numStr; - self.avatarImageView.imageUrl = rankModel.avatar; - self.nickNameLabel.text = rankModel.nick; -} -#pragma mark - Getters And Setters -- (NetImageView *)avatarImageView { - if (!_avatarImageView) { - _avatarImageView = [[NetImageView alloc] init]; - _avatarImageView.layer.masksToBounds = YES; - _avatarImageView.layer.cornerRadius = 25; - _avatarImageView.image = [UIImageConstant defaultAvatarPlaceholder]; - _avatarImageView.contentMode = UIViewContentModeScaleAspectFill; - } - return _avatarImageView;; -} - - -- (UILabel *)rankLabel { - if (!_rankLabel) { - _rankLabel = [[UILabel alloc] init]; - _rankLabel.font = [UIFont systemFontOfSize:18]; - _rankLabel.textAlignment = NSTextAlignmentCenter; - _rankLabel.textColor = [ThemeColor secondTextColor]; - } - return _rankLabel; -} - -- (UIImageView *)genderImageView { - if (!_genderImageView) { - _genderImageView = [[UIImageView alloc] init]; - _genderImageView.image = [UIImage imageNamed:@"common_sex_female"]; - _genderImageView.hidden = YES; - [_genderImageView setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; - } - return _genderImageView; -} - -- (UILabel *)nickNameLabel { - if (!_nickNameLabel) { - _nickNameLabel = [[UILabel alloc] init]; - _nickNameLabel.font = [UIFont systemFontOfSize:14]; - _nickNameLabel.textColor = [ThemeColor mainTextColor]; - } - return _nickNameLabel; -} -- (UILabel *)idLabel { - if (!_idLabel) { - UILabel *label = [[UILabel alloc] init]; - label.font = [UIFont systemFontOfSize:12]; - label.textColor = [ThemeColor textThirdColor]; - label.textAlignment = NSTextAlignmentRight; - _idLabel = label; - } - return _idLabel; -} - -- (UILabel *)coinNumberLabel{ - if (!_coinNumberLabel) { - _coinNumberLabel = [[UILabel alloc] init]; - _coinNumberLabel.font = [UIFont systemFontOfSize:16]; - _coinNumberLabel.textColor = [ThemeColor roomRankIntegralColor]; - _coinNumberLabel.textAlignment = NSTextAlignmentRight; - [_coinNumberLabel setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; - } - return _coinNumberLabel; -} - - -@end diff --git a/YuMi/Modules/YMRoom/View/RoomRank/View/SubViews/XPRoomRankUserInfoView.m.backup b/YuMi/Modules/YMRoom/View/RoomRank/View/SubViews/XPRoomRankUserInfoView.m.backup deleted file mode 100644 index afe4900..0000000 --- a/YuMi/Modules/YMRoom/View/RoomRank/View/SubViews/XPRoomRankUserInfoView.m.backup +++ /dev/null @@ -1,224 +0,0 @@ -// -// XPRoomRankUserInfoView.m -// xplan-ios -// -// Created by 冯硕 on 2021/12/14. -// - -#import "XPRoomRankUserInfoView.h" -///Third -#import -///Tool -#import "NetImageView.h" -#import "ThemeColor+RoomRank.h" -///Model -#import "RoomRankModel.h" - -@interface XPRoomRankUserInfoView () -///皇冠 -@property (nonatomic,strong) UIImageView *crownImageView; -///头像 -@property (nonatomic,strong) NetImageView *avatarImageView; -///昵称和性别的容器 -@property (nonatomic,strong) UIStackView *stackView; -///昵称 -@property (nonatomic,strong) UILabel *nickLabel; -///性别 -@property (nonatomic,strong) UIImageView *sexImageView; -///id -@property (nonatomic,strong) UILabel *idLabel; -///金币 -@property (nonatomic,strong) UILabel *coinLabel; -@end - -@implementation XPRoomRankUserInfoView - - -- (instancetype)initWithFrame:(CGRect)frame -{ - self = [super initWithFrame:frame]; - if (self) { - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - self.avatarImageView.layer.cornerRadius = self.avatarImageView.bounds.size.width / 2; -} - -#pragma mark - Private Method -- (void)initSubViews { - [self addSubview:self.avatarImageView]; - [self addSubview:self.crownImageView]; - [self addSubview:self.stackView]; - [self addSubview:self.idLabel]; - [self addSubview:self.coinLabel]; - - [self.stackView addArrangedSubview:self.nickLabel]; - [self.stackView addArrangedSubview:self.sexImageView]; - - UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(recognizer:)]; - [self addGestureRecognizer:tap]; -} - -- (void)initSubViewConstraints { - [self mas_makeConstraints:^(MASConstraintMaker *make) { - make.bottom.mas_equalTo(self.coinLabel.mas_bottom); - }]; - - [self.crownImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.centerX.mas_equalTo(self); - make.width.mas_equalTo(87); - make.height.mas_equalTo(99); - }]; - - [self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.mas_equalTo(self.crownImageView).inset(6); - make.bottom.mas_equalTo(self.crownImageView.mas_bottom).offset(-6); - make.height.mas_equalTo(self.avatarImageView.mas_width); - }]; - - [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.mas_equalTo(self); - make.top.mas_equalTo(self.crownImageView.mas_bottom).offset(4); - }]; - - [self.idLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.mas_equalTo(self); - make.top.mas_equalTo(self.stackView.mas_bottom).offset(1); - }]; - - [self.coinLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.idLabel.mas_bottom).offset(2); - make.left.right.mas_equalTo(self); - }]; -} - -#pragma mark - Event Response -- (void)recognizer:(UITapGestureRecognizer *)tap { - if (self.delegate && [self.delegate respondsToSelector:@selector(didTapUserInfo:)]) { - [self.delegate didTapUserInfo:self.rankModel.uid]; - } -} - -#pragma mark - Getters And Setters -- (void)setRankModel:(RoomRankModel *)rankModel { - _rankModel = rankModel; - self.idLabel.text = [NSString stringWithFormat:@"ID:%@", rankModel.erbanNo]; - NSString *numStr = [NSString stringWithFormat:@"%@",rankModel.goldAmount]; - if (rankModel.goldAmount.doubleValue > 10000) { - CGFloat numF = [rankModel.goldAmount doubleValue] / 10000.0; - numStr = [NSString stringWithFormat:YMLocalizedString(@"XPRoomRankUserInfoView0"),numF]; - numStr = [numStr stringByReplacingOccurrencesOfString:@".0" withString:@""]; - } - self.sexImageView.hidden = NO; - self.sexImageView.image = rankModel.gender == 2 ? [UIImage imageNamed:@"common_female"] : [UIImage imageNamed:@"common_male"]; // 2:女 1:男 - self.coinLabel.text = numStr; - self.avatarImageView.imageUrl = rankModel.avatar; - self.nickLabel.text = rankModel.nick; -} - - -- (void)setType:(RankUserInfoType)type { - NSString * crownName; - NSString * avatarPlace; - switch (type) { - case RankUserInfoType_First: - crownName = @"room_rank_crown_first"; - avatarPlace = @"room_rank_avatar_first_place"; - break; - case RankUserInfoType_Second: - crownName = @"room_rank_crown_second"; - avatarPlace = @"room_rank_avatar_second_place"; - break; - case RankUserInfoType_Third: - crownName = @"room_rank_crown_third"; - avatarPlace = @"room_rank_avatar_third_place"; - break; - default: - break; - } - - if (crownName.length >0) { - self.crownImageView.image = [UIImage imageNamed:crownName]; - } - - if (avatarPlace.length > 0) { - self.avatarImageView.image = [UIImage imageNamed:avatarPlace]; - } - self.sexImageView.hidden = YES; -} - -- (UIImageView *)crownImageView { - if (!_crownImageView) { - _crownImageView = [[UIImageView alloc] init]; - _crownImageView.userInteractionEnabled = YES; - } - return _crownImageView; -} - -- (NetImageView *)avatarImageView { - if (!_avatarImageView) { - _avatarImageView = [[NetImageView alloc] init]; - _avatarImageView.layer.masksToBounds = YES; - _avatarImageView.image = [UIImageConstant defaultAvatarPlaceholder]; - _avatarImageView.contentMode = UIViewContentModeScaleAspectFill; - } - return _avatarImageView;; -} - -- (UIStackView *)stackView { - if (!_stackView) { - _stackView = [[UIStackView alloc] init]; - _stackView.axis = UILayoutConstraintAxisHorizontal; - _stackView.distribution = UIStackViewDistributionFill; - _stackView.alignment = UIStackViewAlignmentCenter; - _stackView.spacing = 4; - } - return _stackView; -} - -- (UILabel *)nickLabel { - if (!_nickLabel) { - _nickLabel = [[UILabel alloc] init]; - _nickLabel.textAlignment = NSTextAlignmentCenter; - _nickLabel.font = [UIFont systemFontOfSize:14]; - _nickLabel.text = YMLocalizedString(@"XPRoomRankUserInfoView1"); - _nickLabel.textAlignment = NSTextAlignmentCenter; - _nickLabel.textColor = [ThemeColor roomRankNickColor]; - } - return _nickLabel; -} - -- (UIImageView *)sexImageView { - if (!_sexImageView) { - _sexImageView = [[UIImageView alloc] init]; - _sexImageView.userInteractionEnabled = YES; - } - return _sexImageView; -} - -- (UILabel *)idLabel { - if (!_idLabel) { - _idLabel = [[UILabel alloc] init]; - _idLabel.textAlignment = NSTextAlignmentCenter; - _idLabel.font = [UIFont systemFontOfSize:10]; - _idLabel.textColor = [ThemeColor roomRankNormalTitleColor]; - } - return _idLabel; -} - -- (UILabel *)coinLabel { - if (!_coinLabel) { - _coinLabel = [[UILabel alloc] init]; - _coinLabel.font = [UIFont boldSystemFontOfSize:14]; - _coinLabel.textColor = [ThemeColor roomRankIntegralColor]; - _coinLabel.textAlignment = NSTextAlignmentCenter; - } - return _coinLabel; -} - -@end diff --git a/YuMi/Modules/YMRoom/View/RoomRank/View/XPRoomRankViewController.m.backup b/YuMi/Modules/YMRoom/View/RoomRank/View/XPRoomRankViewController.m.backup deleted file mode 100644 index 3f145f1..0000000 --- a/YuMi/Modules/YMRoom/View/RoomRank/View/XPRoomRankViewController.m.backup +++ /dev/null @@ -1,234 +0,0 @@ -// -// XPRoomRankViewController.m -// xplan-ios -// -// Created by 冯硕 on 2021/12/14. -// - -#import "XPRoomRankViewController.h" -///Third -#import -#import -#import -///Tool -#import "ThemeColor+RoomRank.h" -#import "XPMacro.h" -///Model -#import "MicroQueueModel.h" -#import "UserInfoModel.h" -#import "MicroStateModel.h" -#import "RoomInfoModel.h" -///View -#import "XPRoomDayRankViewController.h" -#import "XPUserCardViewController.h" -@interface XPRoomRankViewController () -///顶部的View -@property (nonatomic,strong) UIView * topView; -///显示内容的 -@property (nonatomic,strong) UIView * backView; -///分页标题 -@property (nonatomic, strong) NSArray *titles; -///分页控件 -@property (nonatomic, strong) JXCategoryTitleView *titleView; -///分页lineView -@property (nonatomic, strong) JXCategoryListContainerView *contentView; -///顶部的背景视图 -@property (nonatomic,strong) UIImageView *headBackImageView; -///财富榜 -@property (nonatomic,strong) XPRoomDayRankViewController *wealthRankVC; -///魅力榜 -@property (nonatomic,strong) XPRoomDayRankViewController *charmRankVC; -///房间的uid -@property (nonatomic,copy) NSString *roomUid; -///host -@property (nonatomic,weak) idhostDelegate; -@end - -@implementation XPRoomRankViewController - -- (instancetype)initWithRoomUid:(NSString *)roomUid delegate:(id)delegate; { - if (self = [super init]) { - self.roomUid = roomUid; - self.hostDelegate = delegate; - self.modalPresentationStyle = UIModalPresentationOverFullScreen; - } - return self; -} - - -- (void)viewDidLoad { - [super viewDidLoad]; - [self initSubViews]; - [self initSubViewConstraints]; -} - -#pragma mark - JXCategoryViewDelegate -- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView { - return self.titles.count; -} - -- (id)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index { - if (index == 0) { - return self.wealthRankVC; - } - return self.charmRankVC; -} - -#pragma mark - XPRoomRankHostDelegate -- (NSString *)getRoomUid { - return self.roomUid; -} - -- (void)didSelectUser:(NSString *)uid { - if (uid.integerValue <=0) return; - [self dismissViewControllerAnimated:YES completion:nil]; - RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo; - NSString * targetUid = uid; - XPUserCardInfoModel * model = [[XPUserCardInfoModel alloc] init]; - [[self.hostDelegate.getMicroQueue allValues] enumerateObjectsUsingBlock:^(MicroQueueModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - if (uid.integerValue == obj.userInfo.uid) { - model.position = [NSString stringWithFormat:@"%d", obj.microState.position]; - model.posState = obj.microState.posState; - model.micState = obj.microState.micState; - *stop = YES; - } - }]; - model.nick = self.hostDelegate.getUserInfo.nick; - model.uid = targetUid; - model.roomInfo = roomInfo; - model.micQueue = self.hostDelegate.getMicroQueue; - model.delegate = self.hostDelegate; - XPUserCardViewController * userCardVC = [[XPUserCardViewController alloc] initWithUser:model]; - [self.hostDelegate.getCurrentNav presentViewController:userCardVC animated:YES completion:nil]; -} -#pragma mark - Private Method -- (void)initSubViews { - self.view.backgroundColor = [UIColor clearColor]; - [self.view addSubview:self.topView]; - [self.view addSubview:self.backView]; - - [self.backView addSubview:self.headBackImageView]; - [self.backView addSubview:self.titleView]; - [self.backView addSubview:self.contentView]; -} - -- (void)initSubViewConstraints { - [self.topView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.top.mas_equalTo(self.view); - make.bottom.mas_equalTo(self.backView.mas_top); - }]; - - [self.backView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.bottom.right.mas_equalTo(self.view); - make.height.mas_equalTo(550); - }]; - - [self.titleView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.mas_equalTo(self.backView).inset(30); - make.height.mas_equalTo(36); - make.top.mas_equalTo(self.backView).offset(25); - }]; - - [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.bottom.mas_equalTo(self.backView); - make.top.mas_equalTo(self.titleView.mas_bottom); - }]; - - [self.headBackImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.right.left.top.mas_equalTo(self.backView); - make.height.mas_equalTo(100); - }]; -} -#pragma mark - Event Response -- (void)disMissRoomRankCongnizer { - [self dismissViewControllerAnimated:YES completion:nil]; -} - -#pragma mark - Getters And Setters -- (JXCategoryTitleView *)titleView { - if (!_titleView) { - _titleView = [[JXCategoryTitleView alloc] init]; - _titleView.delegate = self; - _titleView.titles = self.titles; - _titleView.layer.masksToBounds= YES; - _titleView.layer.cornerRadius = 36/2; - _titleView.backgroundColor = [ThemeColor roomRankTitleBackColor]; - _titleView.titleColor = [ThemeColor roomRankNormalTitleColor]; - _titleView.titleSelectedColor = [ThemeColor roomRankSelectTitleColor]; - _titleView.titleFont = [UIFont fontWithName:@"PingFang-SC-Medium" size:15]; - _titleView.titleSelectedFont = [UIFont fontWithName:@"PingFang-SC-Medium" size:15]; - _titleView.titleLabelAnchorPointStyle = JXCategoryTitleLabelAnchorPointStyleCenter; - _titleView.contentScrollViewClickTransitionAnimationEnabled = NO; - _titleView.defaultSelectedIndex = 0; - _titleView.cellWidth = (KScreenWidth - 30* 2)/2; - _titleView.cellSpacing = 0; - _titleView.averageCellSpacingEnabled = YES; - _titleView.listContainer = self.contentView; - - JXCategoryIndicatorBackgroundView *backgroundView = [[JXCategoryIndicatorBackgroundView alloc] init]; - backgroundView.indicatorHeight = 34; - backgroundView.indicatorColor = [UIColor whiteColor]; - backgroundView.indicatorWidth = (KScreenWidth - 30* 2)/2; - backgroundView.layer.cornerRadius = 17; - backgroundView.layer.masksToBounds = YES; - _titleView.indicators = @[backgroundView]; - } - return _titleView; -} - -- (JXCategoryListContainerView *)contentView { - if (!_contentView) { - _contentView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self]; - _contentView.defaultSelectedIndex = 0; - } - return _contentView; -} - -- (NSArray *)titles { - return @[@"贡献榜", YMLocalizedString(@"XPRoomRankViewController1")]; -} - -- (UIView *)topView { - if (!_topView) { - _topView = [[UIView alloc] init]; - _topView.backgroundColor = [UIColor clearColor]; - UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(disMissRoomRankCongnizer)]; - [_topView addGestureRecognizer:tap]; - } - return _topView; -} - -- (UIView *)backView { - if (!_backView) { - _backView = [[UIView alloc] init]; - _backView.backgroundColor = [UIColor clearColor]; - } - return _backView; -} - -- (UIImageView *)headBackImageView { - if (!_headBackImageView) { - _headBackImageView = [[UIImageView alloc] init]; - _headBackImageView.userInteractionEnabled = YES; - _headBackImageView.image = [UIImage imageNamed:@"room_rank_header_bg"]; - } - return _headBackImageView; -} - -- (XPRoomDayRankViewController *)charmRankVC { - if (!_charmRankVC) { - _charmRankVC = [[XPRoomDayRankViewController alloc] initWithDelegate:self]; - _charmRankVC.type = RoomRankType_Charm; - } - return _charmRankVC; -} - -- (XPRoomDayRankViewController *)wealthRankVC { - if (!_wealthRankVC) { - _wealthRankVC = [[XPRoomDayRankViewController alloc] initWithDelegate:self]; - _wealthRankVC.type = RoomRankType_Contribute; - } - return _wealthRankVC; -} - -@end diff --git a/YuMi/Modules/YMRoom/View/WishGift/Api/Api+WishGift.h.backup b/YuMi/Modules/YMRoom/View/WishGift/Api/Api+WishGift.h.backup deleted file mode 100644 index e8b9ac5..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/Api/Api+WishGift.h.backup +++ /dev/null @@ -1,49 +0,0 @@ -// -// Api+WishGift.h -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import "Api.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface Api (WishGift) -///添加心愿礼物 -/// @param roomUid 房主的uid -+ (void)wishGiftAdd:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid; -/// 删除心愿礼物 -/// @param completion 完成 -/// @param roomUid 房主的uid -/// @param itemId item id -+ (void)wishGiftDeleteItem:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid itemId:(NSString *)itemId; -/// 创建心愿礼物 -/// @param completion 完成 -/// @param roomUid 房主的uid -/// @param giftId 礼物id -/// @param itemId item id -/// @param seq 编号 1 2 3 -/// @param targetNum 目标数量 -+ (void)wishGiftAddItem:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid giftId:(NSString *)giftId itemId:(NSString *)itemId seq:(NSString *)seq targetNum:(NSString *)targetNum; -/// 获取房间心愿礼物列表 -/// @param roomUid 房主的uid -+ (void)wishGiftList:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid; -/// 获取房间心愿礼物助力用户列表 -/// @param roomUid 房主的uid -+ (void)wishGiftAssistUserList:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid; -/// 获取心愿礼物配置列表 -/// @param roomUid 房主的uid -/// @param level 等级 -+ (void)wishGiftCondfigList:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid level:(NSString *)level; -/// 获取房间历史心愿列表 -/// @param roomUid 房主的uid -+ (void)wishGiftHistoryList:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid; - -/// 发送心愿完成庆祝特效 -/// @param roomUid 房主的uid -+ (void)wishGiftSendCelebrate:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/WishGift/Api/Api+WishGift.m.backup b/YuMi/Modules/YMRoom/View/WishGift/Api/Api+WishGift.m.backup deleted file mode 100644 index bc41282..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/Api/Api+WishGift.m.backup +++ /dev/null @@ -1,85 +0,0 @@ -// -// Api+WishGift.m -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import "Api+WishGift.h" -#import "NSMutableDictionary+Saft.h" -#import -@implementation Api (WishGift) - -///添加心愿礼物 -/// @param roomUid 房主的uid -+ (void)wishGiftAdd:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid { - NSString * fang = [NSString stringFromBase64String:@"d2lzaEdpZnQvYWRk"];// - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, roomUid, nil]; -} - -/// 删除心愿礼物 -/// @param completion 完成 -/// @param roomUid 房主的uid -/// @param itemId item id -+ (void)wishGiftDeleteItem:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid itemId:(NSString *)itemId { - NSString * fang = [NSString stringFromBase64String:@"d2lzaEdpZnQvZGVsSXRlbQ=="];// - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, roomUid, itemId, nil]; -} - -/// 创建心愿礼物 -/// @param completion 完成 -/// @param roomUid 房主的uid -/// @param giftId 礼物id -/// @param itemId item id -/// @param seq 编号 1 2 3 -/// @param targetNum 目标数量 -+ (void)wishGiftAddItem:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid giftId:(NSString *)giftId itemId:(NSString *)itemId seq:(NSString *)seq targetNum:(NSString *)targetNum { - NSMutableDictionary * dic = [NSMutableDictionary dictionary]; - if (itemId.length > 0) { - [dic safeSetObject:itemId forKey:@"itemId"]; - } - [dic safeSetObject:roomUid forKey:@"roomUid"]; - [dic safeSetObject:giftId forKey:@"giftId"]; - [dic safeSetObject:seq forKey:@"seq"]; - [dic safeSetObject:targetNum forKey:@"targetNum"]; - NSString * fang = [NSString stringFromBase64String:@"d2lzaEdpZnQvYWRkSXRlbQ=="];//wishGift/addItem - [HttpRequestHelper request:fang method:HttpRequestHelperMethodPOST params:dic completion:completion]; -} - -/// 获取房间心愿礼物列表 -/// @param roomUid 房主的uid -+ (void)wishGiftList:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid { - NSString * fang = [NSString stringFromBase64String:@"d2lzaEdpZnQvbGlzdA=="];//wishGift/list - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, roomUid, nil]; -} - -/// 获取房间心愿礼物助力用户列表 -/// @param roomUid 房主的uid -+ (void)wishGiftAssistUserList:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid { - NSString * fang = [NSString stringFromBase64String:@"d2lzaEdpZnQvbGlzdEFzc2lzdFVzZXI="];// - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, roomUid, nil]; -} - -/// 获取心愿礼物配置列表 -/// @param roomUid 房主的uid -/// @param level 等级 -+ (void)wishGiftCondfigList:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid level:(NSString *)level { - NSString * fang = [NSString stringFromBase64String:@"d2lzaEdpZnQvbGlzdENvbmZpZw=="];// - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, roomUid, level, nil]; -} - -/// 获取房间历史心愿列表 -/// @param roomUid 房主的uid -+ (void)wishGiftHistoryList:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid { - NSString * fang = [NSString stringFromBase64String:@"d2lzaEdpZnQvbGlzdFdpc2hHaWZ0SGlzdG9yeQ=="];//wishGift/listWishGiftHistory - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, roomUid, nil]; -} - -/// 发送心愿完成庆祝特效 -/// @param roomUid 房主的uid -+ (void)wishGiftSendCelebrate:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid { - NSString * fang = [NSString stringFromBase64String:@"d2lzaEdpZnQvc2VuZENlbGVicmF0ZQ=="];//wishGift/sendCelebrate - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, roomUid, nil]; -} - -@end diff --git a/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftHistoryModel.h.backup b/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftHistoryModel.h.backup deleted file mode 100644 index 1c03e4a..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftHistoryModel.h.backup +++ /dev/null @@ -1,21 +0,0 @@ -// -// WishGiftHistoryModel.h -// YUMI -// -// Created by YUMI on 2022/10/20. -// - -#import -#import "WishGiftInfoModel.h" -NS_ASSUME_NONNULL_BEGIN - -@interface WishGiftHistoryModel : PIBaseModel - -///创建时间 -@property (nonatomic,strong) NSString *createDate; -///礼物列表 -@property (nonatomic,strong) NSArray *gifts; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftHistoryModel.m.backup b/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftHistoryModel.m.backup deleted file mode 100644 index 60803ff..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftHistoryModel.m.backup +++ /dev/null @@ -1,15 +0,0 @@ -// -// WishGiftHistoryModel.m -// YUMI -// -// Created by YUMI on 2022/10/20. -// - -#import "WishGiftHistoryModel.h" - -@implementation WishGiftHistoryModel -+ (NSDictionary *)objectClassInArray { - return @{@"gifts" : WishGiftInfoModel.class}; -} - -@end diff --git a/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftInfoModel.h.backup b/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftInfoModel.h.backup deleted file mode 100644 index 3bd3d4a..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftInfoModel.h.backup +++ /dev/null @@ -1,42 +0,0 @@ -// -// WishGiftInfoModel.h -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import - -NS_ASSUME_NONNULL_BEGIN -typedef NS_ENUM(int, WishGiftLevel) { - WishGiftLevel_Normal = 1, - WishGiftLevel_Middle = 2, - WishGiftLevel_High = 3 -}; - - -@interface WishGiftInfoModel : PIBaseModel -/// 实际收到数量 -@property (nonatomic, assign) NSInteger actualNum; -///礼物id -@property (nonatomic, assign) NSInteger giftId; -///礼物名称 -@property (nonatomic, copy) NSString *giftName; -/// 礼物价值 -@property (nonatomic, assign) NSInteger goldPrice; -/// 礼物心愿itemid -@property (nonatomic, assign) NSInteger itemId; -/// 目标数量 -@property (nonatomic, assign) NSInteger targetNum; -///礼物图片 -@property (nonatomic,copy) NSString *giftUrl; -///本地字段 -@property (nonatomic,assign) NSInteger row; -///创建的时间 -@property (nonatomic,strong) NSString *createTime; -///等级的名称 -@property (nonatomic,copy) NSString *levelName; -///等级 -@property (nonatomic,assign) WishGiftLevel level; -@end -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftInfoModel.m.backup b/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftInfoModel.m.backup deleted file mode 100644 index fdc2c57..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftInfoModel.m.backup +++ /dev/null @@ -1,13 +0,0 @@ -// -// WishGiftInfoModel.m -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import "WishGiftInfoModel.h" - -@implementation WishGiftInfoModel - -@end - diff --git a/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftInfoUpdateModel.h.backup b/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftInfoUpdateModel.h.backup deleted file mode 100644 index 79f89b3..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftInfoUpdateModel.h.backup +++ /dev/null @@ -1,19 +0,0 @@ -// -// WishGiftInfoUpdateModel.h -// YUMI -// -// Created by YUMI on 2022/10/28. -// - -#import -#import "WishGiftInfoModel.h" -NS_ASSUME_NONNULL_BEGIN - -@interface WishGiftInfoUpdateModel : PIBaseModel -///送礼物的人 -@property (nonatomic,strong) NSString *senderUid; -///礼物 -@property (nonatomic,copy) NSArray *gifts; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftInfoUpdateModel.m.backup b/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftInfoUpdateModel.m.backup deleted file mode 100644 index dfd23c5..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftInfoUpdateModel.m.backup +++ /dev/null @@ -1,15 +0,0 @@ -// -// WishGiftInfoUpdateModel.m -// YUMI -// -// Created by YUMI on 2022/10/28. -// - -#import "WishGiftInfoUpdateModel.h" - -@implementation WishGiftInfoUpdateModel -+ (NSDictionary *)objectClassInArray { - return @{@"gifts":WishGiftInfoModel.class}; -} - -@end diff --git a/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftUserModel.h.backup b/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftUserModel.h.backup deleted file mode 100644 index 307afd2..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftUserModel.h.backup +++ /dev/null @@ -1,19 +0,0 @@ -// -// WishGiftUserModel.h -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface WishGiftUserModel : PIBaseModel -@property (nonatomic, copy) NSString *avatar; -@property (nonatomic, assign) NSInteger erbanNo; -@property (nonatomic, copy) NSString *nick; -@property (nonatomic, assign) NSInteger uid; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftUserModel.m.backup b/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftUserModel.m.backup deleted file mode 100644 index 7c73946..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/Model/WishGiftUserModel.m.backup +++ /dev/null @@ -1,12 +0,0 @@ -// -// WishGiftUserModel.m -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import "WishGiftUserModel.h" - -@implementation WishGiftUserModel - -@end diff --git a/YuMi/Modules/YMRoom/View/WishGift/Presenter/XPWishGiftPresenter.h.backup b/YuMi/Modules/YMRoom/View/WishGift/Presenter/XPWishGiftPresenter.h.backup deleted file mode 100644 index b25f53b..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/Presenter/XPWishGiftPresenter.h.backup +++ /dev/null @@ -1,31 +0,0 @@ -// -// WishGiftPresenter.h -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import "BaseMvpPresenter.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface XPWishGiftPresenter : BaseMvpPresenter - -/// 添加许愿礼物 -- (void)addWishGift:(NSString *)roomUid; - -///创建心愿礼物 -- (void)createWishGiftItem:(NSString *)roomUid itemId:(NSString *)itemId giftId:(NSString *)giftId seq:(int)seq targetNum:(int)targetNum; -///删除心愿礼物 -- (void)deleteWishGiftItem:(NSString *)roomUid itemId:(NSString *)itemId; -///房间许愿礼物列表 -- (void)wishGiftList:(NSString *)roomUid; -///助理用户列表 -- (void)wishGiftAssistUserList:(NSString *)roomUid; -/// 心愿礼物配置表 -- (void)wishGiftConfigList:(NSString *)roomUid level:(NSString *)level ; -///获取房间历史列表 -- (void)wishGiftHistroyList:(NSString *)roomUid; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/WishGift/Presenter/XPWishGiftPresenter.m.backup b/YuMi/Modules/YMRoom/View/WishGift/Presenter/XPWishGiftPresenter.m.backup deleted file mode 100644 index 50e9c71..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/Presenter/XPWishGiftPresenter.m.backup +++ /dev/null @@ -1,65 +0,0 @@ -// -// WishGiftPresenter.m -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import "XPWishGiftPresenter.h" -#import "Api+WishGift.h" -#import "XPWishGiftProtocol.h" -#import "WishGiftInfoModel.h" -#import "WishGiftUserModel.h" -#import "WishGiftHistoryModel.h" - -@implementation XPWishGiftPresenter - -/// 添加许愿礼物 -- (void)addWishGift:(NSString *)roomUid { - [Api wishGiftAdd:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - [[self getView] addWishGiftSuccess]; - } showLoading:YES] roomUid:roomUid]; -} - -///创建心愿礼物 -- (void)createWishGiftItem:(NSString *)roomUid itemId:(NSString *)itemId giftId:(NSString *)giftId seq:(int)seq targetNum:(int)targetNum { - [Api wishGiftAddItem:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - [[self getView] createWishGiftItemSuccess]; - } showLoading:YES] roomUid:roomUid giftId:giftId itemId:itemId seq:[NSString stringWithFormat:@"%d", seq] targetNum:[NSString stringWithFormat:@"%d", targetNum]]; -} -///删除心愿礼物 -- (void)deleteWishGiftItem:(NSString *)roomUid itemId:(NSString *)itemId { - [Api wishGiftDeleteItem:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - [[self getView] deleteWishGiftItemSuccess]; - } showLoading:YES] roomUid:roomUid itemId:itemId]; -} -///房间许愿礼物列表 -- (void)wishGiftList:(NSString *)roomUid { - [Api wishGiftList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - NSArray * array = [WishGiftInfoModel modelsWithArray:data.data]; - [[self getView] getWishGiftListSuccess:array]; - }] roomUid:roomUid]; -} -///助理用户列表 -- (void)wishGiftAssistUserList:(NSString *)roomUid { - [Api wishGiftAssistUserList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - NSArray * array = [WishGiftUserModel modelsWithArray:data.data]; - [[self getView] getWishGiftAssistUserListSuccess:array]; - }] roomUid:roomUid]; -} -/// 心愿礼物配置表 -- (void)wishGiftConfigList:(NSString *)roomUid level:(NSString *)level { - [Api wishGiftCondfigList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - NSArray * array = [WishGiftInfoModel modelsWithArray:data.data]; - [[self getView] wishGiftConfigListSucces:array level:level]; - }] roomUid:roomUid level:level]; -} -///获取房间历史列表 -- (void)wishGiftHistroyList:(NSString *)roomUid { - [Api wishGiftHistoryList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - NSArray * array = [WishGiftHistoryModel modelsWithArray:data.data]; - [[self getView] wishGiftHistroyListSuccess:array]; - } showLoading:YES] roomUid:roomUid]; -} - -@end diff --git a/YuMi/Modules/YMRoom/View/WishGift/Protocol/XPWishGiftProtocol.h.backup b/YuMi/Modules/YMRoom/View/WishGift/Protocol/XPWishGiftProtocol.h.backup deleted file mode 100644 index 1bdaa3d..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/Protocol/XPWishGiftProtocol.h.backup +++ /dev/null @@ -1,35 +0,0 @@ -// -// YMWishGiftProtocol.h -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@protocol XPWishGiftProtocol -@optional -///添加礼物心愿成功 -- (void)addWishGiftSuccess; - -///创建心愿单成功 -- (void)createWishGiftItemSuccess; - -///删除心愿单成功 -- (void)deleteWishGiftItemSuccess; -///获取心愿礼物列表 -- (void)getWishGiftListSuccess:(NSArray *)list; - -///助理用户列表 -- (void)getWishGiftAssistUserListSuccess:(NSArray *)list; - -///礼物配置列表 -- (void)wishGiftConfigListSucces:(NSArray *)list level:(NSString *)level; - -///历史心愿成功 -- (void)wishGiftHistroyListSuccess:(NSArray *)list; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftEmptyTableViewCell.h.backup b/YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftEmptyTableViewCell.h.backup deleted file mode 100644 index 476cdd9..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftEmptyTableViewCell.h.backup +++ /dev/null @@ -1,16 +0,0 @@ -// -// YMWishGiftEmptyTableViewCell.h -// YUMI -// -// Created by YUMI on 2022/10/19. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface XPWishGiftEmptyTableViewCell : UITableViewCell - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftEmptyTableViewCell.m.backup b/YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftEmptyTableViewCell.m.backup deleted file mode 100644 index 6348dbc..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftEmptyTableViewCell.m.backup +++ /dev/null @@ -1,73 +0,0 @@ -// -// YMWishGiftEmptyTableViewCell.m -// YUMI -// -// Created by YUMI on 2022/10/19. -// - -#import "XPWishGiftEmptyTableViewCell.h" - -///Third -#import -///Tool -#import "DJDKMIMOMColor.h" -#import "UIImageConstant.h" - -@interface XPWishGiftEmptyTableViewCell () -@property (nonatomic,strong) UIImageView *emptyImageView; -@property (nonatomic,strong) UILabel *titleLabel; -@end - -@implementation XPWishGiftEmptyTableViewCell - -- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { - if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; -} -#pragma mark - Private Method -- (void)initSubViews { - self.backgroundColor = [UIColor clearColor]; - self.selectionStyle = UITableViewCellSelectionStyleNone; - [self.contentView addSubview:self.emptyImageView]; - [self.contentView addSubview:self.titleLabel]; -} - -- (void)initSubViewConstraints { - [self.emptyImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.contentView).offset(150); - make.centerX.mas_equalTo(self.contentView); - make.size.mas_equalTo(CGSizeMake(200, 200)); - }]; - - [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.emptyImageView.mas_bottom).offset(20); - make.leading.trailing.mas_equalTo(self.contentView); - }]; -} -#pragma mark - Getters And Setters -- (UIImageView *)emptyImageView { - if (!_emptyImageView) { - _emptyImageView = [[UIImageView alloc] init]; - _emptyImageView.userInteractionEnabled = YES; - _emptyImageView.image = [UIImageConstant defaultEmptyPlaceholder]; - _emptyImageView.layer.masksToBounds = YES; - _emptyImageView.contentMode = UIViewContentModeScaleAspectFit; - } - return _emptyImageView; -} - -- (UILabel *)titleLabel { - if (!_titleLabel) { - _titleLabel = [[UILabel alloc] init]; - _titleLabel.text = YMLocalizedString(@"XPWishGiftEmptyTableViewCell0"); - _titleLabel.font = [UIFont systemFontOfSize:16]; - _titleLabel.textAlignment = NSTextAlignmentCenter; - _titleLabel.textColor = [DJDKMIMOMColor secondTextColor]; - } - return _titleLabel; -} - -@end diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftHistoryTableViewCell.h.backup b/YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftHistoryTableViewCell.h.backup deleted file mode 100644 index 08a4ff6..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftHistoryTableViewCell.h.backup +++ /dev/null @@ -1,20 +0,0 @@ -// -// YMWishGiftHistoryTableViewCell.h -// YUMI -// -// Created by YUMI on 2022/10/19. -// - -#import - -NS_ASSUME_NONNULL_BEGIN -@class WishGiftInfoModel; -@interface XPWishGiftHistoryTableViewCell : UITableViewCell -///是不是第一个 -@property (nonatomic,assign) BOOL isTop; -///是不是底部 -@property (nonatomic,assign) BOOL isBottom; -@property (nonatomic,strong) WishGiftInfoModel *giftInfo; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftHistoryTableViewCell.m.backup b/YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftHistoryTableViewCell.m.backup deleted file mode 100644 index a51cbcf..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftHistoryTableViewCell.m.backup +++ /dev/null @@ -1,173 +0,0 @@ -// -// YMWishGiftHistoryTableViewCell.m -// YUMI -// -// Created by YUMI on 2022/10/19. -// - -#import "XPWishGiftHistoryTableViewCell.h" -///Third -#import -///Tool -#import "DJDKMIMOMColor.h" -#import "UIImage+Utils.h" -#import "NetImageView.h" -#import "WishGiftInfoModel.h" -#import "UIView+Corner.h" -#import "YUMIMacroUitls.h" - -@interface XPWishGiftHistoryTableViewCell () -///容器 -@property (nonatomic,strong) UIView *backView; -///等级 -@property (nonatomic,strong) UILabel *levleLabel; -///礼物图片 -@property (nonatomic,strong) NetImageView *giftImageView; -///礼物名称 -@property (nonatomic,strong) UILabel *giftLabel; -///目标 -@property (nonatomic,strong) UILabel *targetNumLabel; -///分割下 -@property (nonatomic,strong) UIView *lineView; - -@end -@implementation XPWishGiftHistoryTableViewCell - - -- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { - if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; -} - -#pragma mark - Private Method -- (void)initSubViews { - self.selectionStyle = UITableViewCellSelectionStyleNone; - self.backgroundColor = [UIColor clearColor]; - [self.contentView addSubview:self.backView]; - - [self.backView addSubview:self.levleLabel]; - [self.backView addSubview:self.giftImageView]; - [self.backView addSubview:self.giftLabel]; - [self.backView addSubview:self.targetNumLabel]; - [self.backView addSubview:self.lineView]; -} - -- (void)initSubViewConstraints { - [self.backView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.equalTo(self.contentView).inset(15); - make.top.bottom.mas_equalTo(self.contentView); - }]; - - [self.levleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.mas_equalTo(self.backView); - make.leading.mas_equalTo(self.backView).offset(15); - }]; - - [self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(24, 24)); - make.centerY.mas_equalTo(self.backView); - make.leading.mas_equalTo(self.levleLabel.mas_trailing).offset(20); - }]; - - [self.giftLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.mas_equalTo(self.backView); - make.leading.mas_equalTo(self.giftImageView.mas_trailing).offset(8); - make.trailing.lessThanOrEqualTo(self.targetNumLabel.mas_leading).offset(-5); - }]; - - [self.targetNumLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.mas_equalTo(self.backView); - make.trailing.mas_equalTo(self.backView).offset(-15); - }]; - - [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.mas_equalTo(self.backView).inset(13); - make.bottom.mas_equalTo(self.backView); - make.height.mas_equalTo(1); - }]; - -} -#pragma mark - Getters And Setters -- (void)setIsTop:(BOOL)isTop { - _isTop = isTop; - if(_isTop) { - [self.backView setCornerWithLeftTopCorner:8 rightTopCorner:8 bottomLeftCorner:0 bottomRightCorner:0 size:(CGSizeMake(KScreenWidth - 30, 44))]; - } -} - -- (void)setIsBottom:(BOOL)isBottom { - _isBottom = isBottom; - if (_isBottom) { - [self.backView setCornerWithLeftTopCorner:0 rightTopCorner:0 bottomLeftCorner:8 bottomRightCorner:8 size:(CGSizeMake(KScreenWidth - 30, 44))]; - } -} - -- (void)setGiftInfo:(WishGiftInfoModel *)giftInfo { - _giftInfo = giftInfo; - if (_giftInfo) { - self.levleLabel.text = [NSString stringWithFormat:@"%ld", _giftInfo.row]; - self.giftImageView.imageUrl = _giftInfo.giftUrl; - self.giftLabel.text = _giftInfo.giftName; - self.targetNumLabel.text = [NSString stringWithFormat:@"%ld/%ld", _giftInfo.actualNum, _giftInfo.targetNum]; - } -} - -- (UIView *)backView { - if (!_backView) { - _backView = [[UIView alloc] init]; - _backView.backgroundColor = [UIColor whiteColor]; - } - return _backView; -} - -- (UILabel *)levleLabel { - if (!_levleLabel) { - _levleLabel = [[UILabel alloc] init]; - _levleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold]; - _levleLabel.textColor = [DJDKMIMOMColor mainTextColor]; - } - return _levleLabel; -} - -- (NetImageView *)giftImageView { - if (!_giftImageView) { - NetImageConfig * config = [[NetImageConfig alloc]init]; - config.imageType = ImageTypeUserIcon; - config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; - _giftImageView = [[NetImageView alloc] initWithConfig:config]; - _giftImageView.layer.masksToBounds = YES; - _giftImageView.contentMode = UIViewContentModeScaleAspectFit; - } - return _giftImageView; -} - -- (UILabel *)giftLabel { - if (!_giftLabel) { - _giftLabel = [[UILabel alloc] init]; - _giftLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold]; - _giftLabel.textColor = [DJDKMIMOMColor mainTextColor]; - } - return _giftLabel; -} - -- (UILabel *)targetNumLabel { - if (!_targetNumLabel) { - _targetNumLabel = [[UILabel alloc] init]; - _targetNumLabel.font = [UIFont systemFontOfSize:14]; - _targetNumLabel.textColor = [DJDKMIMOMColor textThirdColor]; - } - return _targetNumLabel; -} - -- (UIView *)lineView { - if (!_lineView) { - _lineView = [[UIView alloc] init]; - _lineView.backgroundColor = [DJDKMIMOMColor dividerColor]; - } - return _lineView; -} - -@end diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftTableViewCell.h.backup b/YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftTableViewCell.h.backup deleted file mode 100644 index 75a5120..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftTableViewCell.h.backup +++ /dev/null @@ -1,30 +0,0 @@ -// -// YMWishGiftTableViewCell.h -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import - -NS_ASSUME_NONNULL_BEGIN -@class XPWishGiftTableViewCell, WishGiftInfoModel; -@protocol XPWishGiftTableViewCellDelegate - -///更新礼物信息 -- (void)xPWishGiftTableViewCell:(XPWishGiftTableViewCell *)view didUpdateWishGift:(WishGiftInfoModel *)info; - -///删除礼物信息 -- (void)xPWishGiftTableViewCell:(XPWishGiftTableViewCell *)view didClearWishGift:(WishGiftInfoModel *)info; - -@end - -@interface XPWishGiftTableViewCell : UITableViewCell -///代理 -@property (nonatomic,weak) id delegate; -@property (nonatomic,strong) WishGiftInfoModel *giftInfo; -///是否隐藏编辑 -@property (nonatomic,assign) BOOL isHiddenEdit; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftTableViewCell.m.backup b/YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftTableViewCell.m.backup deleted file mode 100644 index 5298bd5..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftTableViewCell.m.backup +++ /dev/null @@ -1,235 +0,0 @@ -// -// YMWishGiftTableViewCell.m -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import "XPWishGiftTableViewCell.h" -///Third -#import -///Tool -#import "DJDKMIMOMColor.h" -#import "UIImage+Utils.h" -#import "NetImageView.h" -#import "WishGiftInfoModel.h" - -@interface XPWishGiftTableViewCell () - -///等级 -@property (nonatomic,strong) UILabel *levleLabel; -///礼物图片 -@property (nonatomic,strong) NetImageView *giftImageView; -///礼物名称 -@property (nonatomic,strong) UILabel *giftLabel; -///目标和编辑删除的容器 -@property (nonatomic,strong) UIStackView *stackView; -///目标 -@property (nonatomic,strong) UILabel *targetNumLabel; -///编辑 删除 -@property (nonatomic,strong) UIStackView *editStackView; -///编辑 -@property (nonatomic,strong) UIButton *updateButton; -///删除 -@property (nonatomic,strong) UIButton *clearButton; -///分割下 -@property (nonatomic,strong) UIView *lineView; - -@end -@implementation XPWishGiftTableViewCell - - -- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { - if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; -} - -#pragma mark - Private Method -- (void)initSubViews { - self.selectionStyle = UITableViewCellSelectionStyleNone; - self.backgroundColor = [UIColor clearColor]; - [self.contentView addSubview:self.levleLabel]; - [self.contentView addSubview:self.giftImageView]; - [self.contentView addSubview:self.giftLabel]; - [self.contentView addSubview:self.stackView]; - [self.contentView addSubview:self.lineView]; - - [self.stackView addArrangedSubview:self.targetNumLabel]; - [self.stackView addArrangedSubview:self.editStackView]; - - [self.editStackView addArrangedSubview:self.updateButton]; - [self.editStackView addArrangedSubview:self.clearButton]; -} - -- (void)initSubViewConstraints { - [self.levleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.mas_equalTo(self.contentView); - make.leading.mas_equalTo(self.contentView).offset(15); - }]; - - [self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(24, 24)); - make.centerY.mas_equalTo(self.contentView); - make.leading.mas_equalTo(self.levleLabel.mas_trailing).offset(20); - }]; - - [self.giftLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.mas_equalTo(self.contentView); - make.leading.mas_equalTo(self.giftImageView.mas_trailing).offset(8); - make.trailing.lessThanOrEqualTo(self.targetNumLabel.mas_leading).offset(-5); - }]; - - [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) { - make.height.mas_equalTo(18); - make.trailing.mas_equalTo(self.contentView).offset(-15); - make.centerY.mas_equalTo(self.contentView); - }]; - - [self.updateButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(44); - }]; - - [self.clearButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(44); - }]; - - [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.mas_equalTo(self.contentView).inset(13); - make.bottom.mas_equalTo(self.contentView); - make.height.mas_equalTo(1); - }]; - -} - -#pragma mark - Event Response -- (void)updateButtonAction:(UIButton *)sender { - if (self.delegate && [self.delegate respondsToSelector:@selector(xPWishGiftTableViewCell:didUpdateWishGift:)]) { - [self.delegate xPWishGiftTableViewCell:self didUpdateWishGift:self.giftInfo]; - } -} - - -- (void)clearButtonAction:(UIButton *)sender { - if (self.delegate && [self.delegate respondsToSelector:@selector(xPWishGiftTableViewCell:didClearWishGift:)]) { - [self.delegate xPWishGiftTableViewCell:self didClearWishGift:self.giftInfo]; - } -} - -#pragma mark - Getters And Setters -- (void)setIsHiddenEdit:(BOOL)isHiddenEdit { - _isHiddenEdit = isHiddenEdit; - self.editStackView.hidden = _isHiddenEdit; -} - -- (void)setGiftInfo:(WishGiftInfoModel *)giftInfo { - _giftInfo = giftInfo; - if (_giftInfo) { - self.levleLabel.text = [NSString stringWithFormat:@"%ld", _giftInfo.row]; - self.giftImageView.imageUrl = _giftInfo.giftUrl; - self.giftLabel.text = _giftInfo.giftName; - self.targetNumLabel.text = [NSString stringWithFormat:@"%ld/%ld", _giftInfo.actualNum, _giftInfo.targetNum]; - } -} - -- (UILabel *)levleLabel { - if (!_levleLabel) { - _levleLabel = [[UILabel alloc] init]; - _levleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold]; - _levleLabel.textColor = [DJDKMIMOMColor mainTextColor]; - } - return _levleLabel; -} - -- (NetImageView *)giftImageView { - if (!_giftImageView) { - NetImageConfig * config = [[NetImageConfig alloc]init]; - config.imageType = ImageTypeUserIcon; - config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; - _giftImageView = [[NetImageView alloc] initWithConfig:config]; - _giftImageView.layer.masksToBounds = YES; - _giftImageView.contentMode = UIViewContentModeScaleAspectFit; - } - return _giftImageView; -} - -- (UILabel *)giftLabel { - if (!_giftLabel) { - _giftLabel = [[UILabel alloc] init]; - _giftLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold]; - _giftLabel.textColor = [DJDKMIMOMColor mainTextColor]; - } - return _giftLabel; -} - -- (UIStackView *)stackView { - if (!_stackView) { - _stackView = [[UIStackView alloc] init]; - _stackView.axis = UILayoutConstraintAxisHorizontal; - _stackView.distribution = UIStackViewDistributionFill; - _stackView.alignment = UIStackViewAlignmentFill; - _stackView.spacing = 26; - } - return _stackView; -} - -- (UILabel *)targetNumLabel { - if (!_targetNumLabel) { - _targetNumLabel = [[UILabel alloc] init]; - _targetNumLabel.font = [UIFont systemFontOfSize:14]; - _targetNumLabel.textColor = [DJDKMIMOMColor textThirdColor]; - } - return _targetNumLabel; -} - -- (UIStackView *)editStackView { - if (!_editStackView) { - _editStackView = [[UIStackView alloc] init]; - _editStackView.axis = UILayoutConstraintAxisHorizontal; - _editStackView.distribution = UIStackViewDistributionFill; - _editStackView.alignment = UIStackViewAlignmentFill; - _editStackView.spacing = 5; - } - return _editStackView; -} - -- (UIButton *)updateButton { - if (!_updateButton) { - _updateButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_updateButton setTitle:YMLocalizedString(@"XPWishGiftTableViewCell0") forState:UIControlStateNormal]; - [_updateButton setTitleColor:[DJDKMIMOMColor confirmButtonTextColor] forState:UIControlStateNormal]; - _updateButton.titleLabel.font = [UIFont systemFontOfSize:10]; - [_updateButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor cancelButtonGradientStartColor], [DJDKMIMOMColor cancelButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; - _updateButton.layer.masksToBounds = YES; - _updateButton.layer.cornerRadius = 9; - [_updateButton addTarget:self action:@selector(updateButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - } - return _updateButton; -} - -- (UIButton *)clearButton { - if (!_clearButton) { - _clearButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_clearButton setTitle:YMLocalizedString(@"XPWishGiftTableViewCell1") forState:UIControlStateNormal]; - [_clearButton setTitleColor:[DJDKMIMOMColor confirmButtonTextColor] forState:UIControlStateNormal]; - _clearButton.titleLabel.font = [UIFont systemFontOfSize:10]; - [_clearButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor], [DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; - _clearButton.layer.masksToBounds = YES; - _clearButton.layer.cornerRadius = 9; - [_clearButton addTarget:self action:@selector(clearButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - } - return _clearButton; -} - -- (UIView *)lineView { - if (!_lineView) { - _lineView = [[UIView alloc] init]; - _lineView.backgroundColor = [DJDKMIMOMColor dividerColor]; - } - return _lineView; -} - - -@end diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftEnterView.h.backup b/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftEnterView.h.backup deleted file mode 100644 index 54573af..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftEnterView.h.backup +++ /dev/null @@ -1,17 +0,0 @@ -// -// YMWishGiftEnterView.h -// YUMI -// -// Created by YUMI on 2022/10/20. -// - -#import - -NS_ASSUME_NONNULL_BEGIN -@interface XPWishGiftEnterView : UIView -@property (nonatomic,strong) NSArray * giftList; -///是否在左边 -@property (nonatomic,assign) BOOL isLeft; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftEnterView.m.backup b/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftEnterView.m.backup deleted file mode 100644 index f33c620..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftEnterView.m.backup +++ /dev/null @@ -1,245 +0,0 @@ -// -// YMWishGiftEnterView.m -// YUMI -// -// Created by YUMI on 2022/10/20. -// - -#import "XPWishGiftEnterView.h" -///Third -#import -#import -#import -///Tool -#import "DJDKMIMOMColor.h" -#import "NetImageView.h" -#import "UIImage+Utils.h" -#import "UIView+Corner.h" -#import "NSArray+Safe.h" -///Model -#import "WishGiftInfoModel.h" - -@interface XPWishGiftEnterCell : SDCollectionViewCell -///礼物 -@property (nonatomic,strong) NetImageView *giftImageView; -///礼物名称 -@property (nonatomic,strong) UILabel *giftLabel; -///进度 -@property (nonatomic,strong) UILabel *progressLabel; -///进度 -@property (nonatomic,strong) UIProgressView *progressView; -@property (nonatomic,strong) WishGiftInfoModel *giftInfo; -@end - -@implementation XPWishGiftEnterCell - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; -} - -#pragma mark - Private Method -- (void)initSubViews { - self.contentView.backgroundColor = [UIColor clearColor]; - [self.contentView addSubview:self.giftImageView]; - [self.contentView addSubview:self.giftLabel]; - [self.contentView addSubview:self.progressLabel]; - [self.contentView addSubview:self.progressView]; -} - -- (void)initSubViewConstraints { - - [self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.top.bottom.mas_equalTo(self.contentView); - make.width.mas_equalTo(self.giftImageView.mas_height); - }]; - - [self.giftLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(self.giftImageView.mas_trailing).offset(6); - make.top.mas_equalTo(self.contentView).offset(0); - make.trailing.mas_equalTo(self.contentView).offset(-2); - }]; - - [self.progressLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(self.giftLabel); - make.trailing.mas_equalTo(self.contentView); - make.top.mas_equalTo(self.giftLabel.mas_bottom).offset(1); - }]; - - [self.progressView mas_makeConstraints:^(MASConstraintMaker *make) { - make.height.mas_equalTo(3); - make.bottom.mas_equalTo(self.contentView.mas_bottom).offset(-2); - make.leading.mas_equalTo(self.giftImageView.mas_trailing).offset(2); - make.trailing.mas_equalTo(self.contentView).offset(-5); - }]; -} - -- (NSAttributedString *)createProgressAttribute { - NSString * targetNum = [NSString stringWithFormat:@"/%ld", self.giftInfo.targetNum]; - NSString * actualNum = (self.giftInfo.actualNum > self.giftInfo.targetNum) ? [NSString stringWithFormat:@"%ld+", self.giftInfo.targetNum] : [NSString stringWithFormat:@"%ld", self.giftInfo.actualNum]; - NSString * title = [NSString stringWithFormat:@"%@%@", actualNum, targetNum]; - NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10], NSForegroundColorAttributeName:[DJDKMIMOMColor colorWithHexString:@"#FFC300"]}]; - if (self.giftInfo.targetNum <= self.giftInfo.actualNum) { - [attribute addAttribute:NSForegroundColorAttributeName value:[DJDKMIMOMColor colorWithHexString:@"#FFC300"] range:[title rangeOfString:targetNum]]; - } else { - [attribute addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithWhite:1 alpha:1] range:[title rangeOfString:targetNum]]; - } - return attribute; -} - -#pragma mark - Getters And Setters -- (void)setGiftInfo:(WishGiftInfoModel *)giftInfo { - _giftInfo = giftInfo; - if (_giftInfo) { - self.giftImageView.imageUrl = _giftInfo.giftUrl; - self.giftLabel.text = _giftInfo.giftName; - CGFloat value = (CGFloat)giftInfo.actualNum / (CGFloat)giftInfo.targetNum; - if (value > 1){ - value = 1; - } - [self.progressView setProgress:value animated:NO]; - self.progressLabel.attributedText = [self createProgressAttribute]; - self.progressLabel.textAlignment = NSTextAlignmentCenter; - } -} - -- (UIProgressView *)progressView { - if(!_progressView) { - _progressView = [[UIProgressView alloc] init]; - _progressView.layer.masksToBounds = YES; - _progressView.layer.cornerRadius = 1.5; - _progressView.trackImage = [UIImage imageWithColor:[DJDKMIMOMColor colorWithHexString:@"#17093E"]]; - _progressView.progressImage = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor colorWithHexString:@"#FFA0C3"], [DJDKMIMOMColor colorWithHexString:@"#C176FF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(1, 1)]; - } - return _progressView; -} - -- (NetImageView *)giftImageView { - if (!_giftImageView) { - NetImageConfig * config = [[NetImageConfig alloc]init]; - config.imageType = ImageTypeUserIcon; - config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; - _giftImageView = [[NetImageView alloc] initWithConfig:config]; - _giftImageView.layer.masksToBounds = YES; - _giftImageView.layer.cornerRadius = 15; - _giftImageView.layer.borderWidth = 0.5; - _giftImageView.layer.borderColor = UIColorRGBAlpha(0xFFEEBE, 0.7).CGColor; - _giftImageView.contentMode = UIViewContentModeScaleAspectFill; - } - return _giftImageView; -} - -- (UILabel *)giftLabel { - if (!_giftLabel) { - _giftLabel = [[UILabel alloc] init]; - _giftLabel.font = [UIFont systemFontOfSize:10]; - _giftLabel.textAlignment = NSTextAlignmentCenter; - _giftLabel.textColor = [UIColor whiteColor]; - _giftLabel.textAlignment = NSTextAlignmentCenter; - } - return _giftLabel; -} - -- (UILabel *)progressLabel { - if (!_progressLabel) { - _progressLabel = [[UILabel alloc] init]; - } - return _progressLabel; -} - -@end - -@interface XPWishGiftEnterView() -///文字轮播 -@property (nonatomic, strong) SDCycleScrollView *pi_BannerView; - -@end - -@implementation XPWishGiftEnterView - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - [self initSubViews]; - [self initSubViewConstraints]; - self.isLeft = NO; - } - return self; -} - - -#pragma mark - Private Method -- (void)initSubViews { - self.backgroundColor = [UIColor colorWithWhite:1 alpha:0.2]; - [self addSubview:self.pi_BannerView]; - self.layer.masksToBounds = YES; -} - -- (void)initSubViewConstraints { - [self.pi_BannerView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.mas_equalTo(self); - }]; - -} - -#pragma mark - SDCycleScrollViewDelegate -- (Class)customCollectionViewCellClassForCycleScrollView:(SDCycleScrollView *)view { - return XPWishGiftEnterCell.class; -} - -- (void)setupCustomCell:(UICollectionViewCell *)cell forIndex:(NSInteger)index cycleScrollView:(SDCycleScrollView *)view { - XPWishGiftEnterCell *myCell = (XPWishGiftEnterCell *)cell; - WishGiftInfoModel * info = [self.giftList xpSafeObjectAtIndex:index]; - myCell.giftInfo = info; -} -#pragma mark - Getters And Setters -- (void)setIsLeft:(BOOL)isLeft { - _isLeft = isLeft; - for (CALayer * layer in self.layer.sublayers) { - if ([layer isKindOfClass:[CAShapeLayer class]]) { - [layer removeFromSuperlayer]; - } - } - - if (_isLeft) { - [self setCornerWithLeftTopCorner:0 rightTopCorner:15 bottomLeftCorner:0 bottomRightCorner:15 size:CGSizeMake(81, 30)]; - } else { - [self setCornerWithLeftTopCorner:15 rightTopCorner:0 bottomLeftCorner:15 bottomRightCorner:0 size:CGSizeMake(81, 30)]; - } -} - -- (void)setGiftList:(NSArray *)giftList { - _giftList = giftList; - if (_giftList.count > 0) { - NSMutableArray * array = [NSMutableArray array]; - for (WishGiftInfoModel * item in _giftList) { - [array addObject:item.giftName]; - } - if (array.count > 0) { - self.pi_BannerView.imageURLStringsGroup = array; - [self.pi_BannerView autoScroll]; - } - } -} - -- (SDCycleScrollView *)pi_BannerView { - if (!_pi_BannerView) { - _pi_BannerView = [[SDCycleScrollView alloc] init]; - _pi_BannerView.backgroundColor = [UIColor clearColor]; - _pi_BannerView.layer.masksToBounds = YES; - _pi_BannerView.delegate = self; - _pi_BannerView.showPageControl = NO; - _pi_BannerView.autoScrollTimeInterval = 10.0; - // SDCycleScrollView没有适配阿语,在RTL下会乱滚,都用LTR算了 - _pi_BannerView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight; - for (UIView *subView in _pi_BannerView.subviews) { - subView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight; - } - } - return _pi_BannerView; -} -@end diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftInfoView.h.backup b/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftInfoView.h.backup deleted file mode 100644 index d35eef9..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftInfoView.h.backup +++ /dev/null @@ -1,28 +0,0 @@ -// -// YMWishGiftInfoView.h -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import - -NS_ASSUME_NONNULL_BEGIN -@class WishGiftInfoModel, XPWishGiftInfoView; - -@protocol XPWishGiftInfoViewDelegate - -- (void)xPWishGiftInfoView:(XPWishGiftInfoView *)view didClickSender:(WishGiftInfoModel *)info; - -@end - -@interface XPWishGiftInfoView : UIView - -@property (nonatomic,strong) WishGiftInfoModel *giftInfo; - -///代理 -@property (nonatomic,weak) id delegate; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftInfoView.m.backup b/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftInfoView.m.backup deleted file mode 100644 index 96f0515..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftInfoView.m.backup +++ /dev/null @@ -1,245 +0,0 @@ -// -// YMWishGiftInfoView.m -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import "XPWishGiftInfoView.h" -///Third -#import -///Tool -#import "NetImageView.h" -#import "DJDKMIMOMColor.h" -#import "UIImage+Utils.h" -///Model -#import "WishGiftInfoModel.h" - -@interface XPWishGiftInfoView () -///背景 -@property (nonatomic,strong) UIImageView *bgView; -///礼物的图片 -@property (nonatomic,strong) NetImageView *giftImageView; -///礼物名称 -@property (nonatomic,strong) UILabel *giftLabel; -///价格 -@property (nonatomic,strong) UILabel *priceLabel; -///进度 -@property (nonatomic,strong) UILabel *progressLabel; -///进度条 -@property (nonatomic,strong) UIProgressView *progressView; -///赠送按钮 -@property (nonatomic,strong) UIButton *senderButton; -///完成按钮 -@property (nonatomic,strong) UIImageView *completionImageView; - -@end - -@implementation XPWishGiftInfoView - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; -} - -#pragma mark - Private Method -- (void)initSubViews { - [self addSubview:self.bgView]; - [self.bgView addSubview:self.giftImageView]; - [self.bgView addSubview:self.giftLabel]; - [self.bgView addSubview:self.priceLabel]; - [self.bgView addSubview:self.progressLabel]; - [self.bgView addSubview:self.progressView]; - [self.bgView addSubview:self.senderButton]; -} - -- (void)initSubViewConstraints { - [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(self); - }]; - - [self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(50, 50)); - make.top.mas_equalTo(self.bgView).offset(6); - make.centerX.mas_equalTo(self.bgView); - }]; - - [self.giftLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.mas_equalTo(self.bgView).inset(2); - make.top.mas_equalTo(self.giftImageView.mas_bottom).offset(4); - }]; - - [self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.mas_equalTo(self.bgView).inset(2); - make.top.mas_equalTo(self.giftLabel.mas_bottom).offset(4); - }]; - - [self.progressView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.mas_equalTo(self.bgView).inset(10); - make.top.mas_equalTo(self.priceLabel.mas_bottom).offset(10); - make.height.mas_equalTo(5); - }]; - - [self.progressLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.mas_equalTo(self.bgView); - make.top.mas_equalTo(self.progressView.mas_bottom).offset(4); - }]; - - [self.senderButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(76, 22)); - make.centerX.mas_equalTo(self.bgView); - make.bottom.mas_equalTo(self.bgView.mas_bottom).offset(-10); - }]; -} - -- (NSAttributedString *)createProgressAttribute { - NSString * targetNum = [NSString stringWithFormat:@"/%ld", self.giftInfo.targetNum]; - NSString * actualNum = (self.giftInfo.actualNum > self.giftInfo.targetNum) ? [NSString stringWithFormat:@"%ld+", self.giftInfo.targetNum] : [NSString stringWithFormat:@"%ld", self.giftInfo.actualNum]; - NSString * title = [NSString stringWithFormat:@"%@%@", actualNum, targetNum]; - NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10], NSForegroundColorAttributeName:[DJDKMIMOMColor colorWithHexString:@"#FFA0C3"]}]; - if (self.giftInfo.targetNum <= self.giftInfo.actualNum) { - [attribute addAttribute:NSForegroundColorAttributeName value:[DJDKMIMOMColor colorWithHexString:@"#FFA0C3"] range:[title rangeOfString:targetNum]]; - } else { - [attribute addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithWhite:1 alpha:0.5] range:[title rangeOfString:targetNum]]; - } - return attribute; -} - -#pragma mark - Event Response -- (void)senderButtonAction:(UIButton *)sender { - if (self.delegate && [self.delegate respondsToSelector:@selector(xPWishGiftInfoView:didClickSender:)]) { - [self.delegate xPWishGiftInfoView:self didClickSender:self.giftInfo]; - } -} - -#pragma mark - Getters And Setters -- (void)setGiftInfo:(WishGiftInfoModel *)giftInfo { - _giftInfo = giftInfo; - if (_giftInfo) { - self.giftImageView.imageUrl = giftInfo.giftUrl; - self.giftLabel.text = _giftInfo.giftName; - self.priceLabel.text = [NSString stringWithFormat:YMLocalizedString(@"XPWishGiftInfoView0"), _giftInfo.goldPrice]; - CGFloat value = (CGFloat)giftInfo.actualNum / (CGFloat)giftInfo.targetNum; - if (value > 1) { - value = 1; - } - self.progressView.progress = value; - self.progressLabel.attributedText = [self createProgressAttribute]; - self.progressLabel.textAlignment = NSTextAlignmentCenter; - self.completionImageView.hidden = _giftInfo.targetNum != _giftInfo.actualNum; - } -} - -- (UIImageView *)bgView { - if (!_bgView) { - _bgView = [[UIImageView alloc] init]; - _bgView.userInteractionEnabled = YES; - _bgView.image = [UIImage imageNamed:@"room_wish_gift_panel_gift_bg"]; - } - return _bgView; -} - -- (UIImageView *)completionImageView { - if (!_completionImageView) { - _completionImageView = [[UIImageView alloc] init]; - _completionImageView.userInteractionEnabled = YES; - _completionImageView.image = [UIImage imageNamed:@"room_wish_gift_completion"]; - } - return _completionImageView; -} - - -- (NetImageView *)giftImageView { - if (!_giftImageView) { - NetImageConfig * config = [[NetImageConfig alloc]init]; - config.imageType = ImageTypeUserIcon; - config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; - _giftImageView = [[NetImageView alloc] initWithConfig:config]; - _giftImageView.layer.masksToBounds = YES; - _giftImageView.layer.cornerRadius = 20; - _giftImageView.contentMode = UIViewContentModeScaleAspectFill; - } - return _giftImageView; -} - -- (UILabel *)giftLabel { - if (!_giftLabel) { - _giftLabel = [[UILabel alloc] init]; - _giftLabel.font = [UIFont systemFontOfSize:14]; - _giftLabel.textAlignment = NSTextAlignmentCenter; - _giftLabel.textColor = [UIColor whiteColor]; - } - return _giftLabel; -} - -- (UILabel *)priceLabel { - if (!_priceLabel) { - _priceLabel = [[UILabel alloc] init]; - _priceLabel.font = [UIFont systemFontOfSize:12]; - _priceLabel.textColor = [UIColor colorWithWhite:1 alpha:0.5]; - _priceLabel.textAlignment = NSTextAlignmentCenter; - } - return _priceLabel; -} - -- (UIProgressView *)progressView { - if(!_progressView) { - _progressView = [[UIProgressView alloc] init]; - _progressView.progressImage = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor colorWithHexString:@"#FFA0C3"], [DJDKMIMOMColor colorWithHexString:@"#C176FF"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(1, 1)]; - _progressView.layer.masksToBounds = YES; - _progressView.layer.cornerRadius = 2.5; - _progressView.trackImage = [UIImage imageWithColor:[DJDKMIMOMColor colorWithHexString:@"#17093E"]]; - } - return _progressView; -} - --(UIImage *)getGradientImageWithColors:(NSArray*)colors imgSize:(CGSize)imgSize -{ - NSMutableArray *arRef = [NSMutableArray array]; - for(UIColor *ref in colors) { - [arRef addObject:(id)ref.CGColor]; - - } - UIGraphicsBeginImageContextWithOptions(imgSize, YES, 1); - CGContextRef context = UIGraphicsGetCurrentContext(); - CGContextSaveGState(context); - CGColorSpaceRef colorSpace = CGColorGetColorSpace([[colors lastObject] CGColor]); - CGGradientRef gradient = CGGradientCreateWithColors(colorSpace, (CFArrayRef)arRef, NULL); - CGPoint start = CGPointMake(0.0, 0.0); - CGPoint end = CGPointMake(imgSize.width, imgSize.height); - CGContextDrawLinearGradient(context, gradient, start, end, kCGGradientDrawsBeforeStartLocation); - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - CGGradientRelease(gradient); - CGContextRestoreGState(context); - CGColorSpaceRelease(colorSpace); - UIGraphicsEndImageContext(); - return image; -} - -- (UILabel *)progressLabel { - if (!_progressLabel) { - _progressLabel = [[UILabel alloc] init]; - } - return _progressLabel; -} - -- (UIButton *)senderButton { - if (!_senderButton) { - _senderButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_senderButton setTitle:YMLocalizedString(@"XPWishGiftInfoView1") forState:UIControlStateNormal]; - [_senderButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - _senderButton.titleLabel.font = [UIFont systemFontOfSize:12]; - [_senderButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor colorWithHexString:@"#FFA0C3"], [DJDKMIMOMColor colorWithHexString:@"#C176FF"]] gradientType:GradientTypeUpleftToLowright imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; - _senderButton.layer.masksToBounds = YES; - _senderButton.layer.cornerRadius = 11; - [_senderButton addTarget:self action:@selector(senderButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - } - return _senderButton; -} - - -@end diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftListView.h.backup b/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftListView.h.backup deleted file mode 100644 index f8971d9..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftListView.h.backup +++ /dev/null @@ -1,30 +0,0 @@ -// -// YMWishGiftListView.h -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import - -NS_ASSUME_NONNULL_BEGIN -@class WishGiftInfoModel, XPWishGiftListView; - -@protocol XPWishGiftListViewDelegate - -///点击了某个item -- (void)xPWishGiftListView:(XPWishGiftListView *)view didSelectItem:(WishGiftInfoModel *)info; - -@end - -@interface XPWishGiftListView : UIView - -///显示的数据源 -@property (nonatomic,strong) NSArray *datasource; - -///代理 -@property (nonatomic,weak) id delegate; -- (void)configDefaultInfo:(WishGiftInfoModel *)giftInfo; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftListView.m.backup b/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftListView.m.backup deleted file mode 100644 index 4ead0c3..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftListView.m.backup +++ /dev/null @@ -1,259 +0,0 @@ -// -// YMWishGiftListView.m -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import "XPWishGiftListView.h" -///Third -#import -///Tool -#import "DJDKMIMOMColor.h" -#import "NSArray+Safe.h" -///Model -#import "WishGiftInfoModel.h" - -@interface XPWishGiftListTableViewCell : UITableViewCell -///显示内容 -@property (nonatomic,strong) UILabel *titleLabel; -@end - -@implementation XPWishGiftListTableViewCell - -- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { - if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; -} - -- (void)initSubViews { - self.backgroundColor = UIColor.clearColor; - self.selectionStyle = UITableViewCellSelectionStyleNone; - [self.contentView addSubview:self.titleLabel]; -} - -- (void)initSubViewConstraints { - - [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.mas_equalTo(self.contentView).inset(13); - make.centerY.mas_equalTo(self.contentView); - }]; -} - -#pragma mark - Getters And Setters - -- (UILabel *)titleLabel { - if (!_titleLabel) { - _titleLabel = [[UILabel alloc] init]; - _titleLabel.font = [UIFont systemFontOfSize:14]; - _titleLabel.textColor = [DJDKMIMOMColor secondTextColor]; - } - return _titleLabel; -} - -@end - - -@interface XPWishGiftListView () -///容器 -@property (nonatomic,strong) UIStackView *stackView; -///选中的时候容器 -@property (nonatomic,strong) UIView *selectView; -///标题 -@property (nonatomic,strong) UILabel *titlelable; -///箭头 -@property (nonatomic,strong) UIImageView *arrowImageView; -///列表 -@property (nonatomic,strong) UITableView *tableView; -///原始数据源 -@property (nonatomic,strong) NSArray *gameList; -///s是否选择 -@property (nonatomic,assign) BOOL isSelect; -@end - -@implementation XPWishGiftListView - -- (instancetype)initWithFrame:(CGRect)frame -{ - self = [super initWithFrame:frame]; - if (self) { - [self initSubViews]; - [self initSubViewConstraints]; - - } - return self; -} -#pragma mark - Public Method -- (void)configDefaultInfo:(WishGiftInfoModel *)giftInfo { - if (giftInfo.levelName) { - self.titlelable.text = giftInfo.levelName; - } else { - self.titlelable.text = giftInfo.giftName; - } -} - -#pragma mark - Private Method -- (void)initSubViews { - self.layer.masksToBounds = YES; - self.layer.cornerRadius = 4; - self.backgroundColor = UIColor.clearColor; - [self addSubview:self.stackView]; - [self.stackView addArrangedSubview:self.selectView]; - [self.stackView addArrangedSubview:self.tableView]; - - [self.selectView addSubview:self.titlelable]; - [self.selectView addSubview:self.arrowImageView]; - -} - -- (void)initSubViewConstraints { - [self mas_makeConstraints:^(MASConstraintMaker *make) { - make.bottom.mas_equalTo(self.stackView.mas_bottom); - }]; - - [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.mas_equalTo(self); - make.top.mas_equalTo(self); - }]; - - [self.selectView mas_makeConstraints:^(MASConstraintMaker *make) { - make.height.mas_equalTo(36); - }]; - - [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { - make.height.mas_equalTo(36); - }]; - - [self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(22, 22)); - make.trailing.mas_equalTo(self.selectView.mas_trailing).offset(-11); - make.centerY.mas_equalTo(self.selectView); - }]; - - [self.titlelable mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.mas_equalTo(self.selectView); - make.leading.mas_equalTo(self.selectView).offset(13); - }]; -} - - -#pragma mark - UITableViewDelegate And UITableViewDataSource -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return self.datasource.count; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - XPWishGiftListTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPWishGiftListTableViewCell class])]; - if (cell == nil) { - cell = [[XPWishGiftListTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPWishGiftListTableViewCell class])]; - } - if (self.datasource.count > 0 ) { - WishGiftInfoModel * giftInfo = [self.datasource xpSafeObjectAtIndex:indexPath.row]; - if (giftInfo.level > 0) { - cell.titleLabel.text = giftInfo.levelName; - } else { - cell.titleLabel.text = giftInfo.giftName; - } - } - return cell; -} - -- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - return 36; -} - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - [tableView deselectRowAtIndexPath:indexPath animated:YES]; - if (self.datasource.count > 0) { - if (self.delegate && [self.delegate respondsToSelector:@selector(xPWishGiftListView:didSelectItem:)]) { - WishGiftInfoModel * giftInfo = [self.datasource xpSafeObjectAtIndex:indexPath.row]; - [self configDefaultInfo:giftInfo]; - [self.delegate xPWishGiftListView:self didSelectItem:giftInfo]; - } - self.tableView.hidden = YES; - } -} - -#pragma mark - Event Response -- (void)gamePlayButtonAction:(UIButton *)sender { - self.isSelect = !self.isSelect; - self.tableView.hidden = !self.isSelect; - if (!self.tableView.hidden) { - if (_datasource.count > 0 && _datasource.count < 4) { - [self.tableView mas_updateConstraints:^(MASConstraintMaker *make) { - make.height.mas_equalTo(36 * self.datasource.count); - }]; - } else { - [self.tableView mas_updateConstraints:^(MASConstraintMaker *make) { - make.height.mas_equalTo(36 * 3); - }]; - } - } -} - -#pragma mark - Getters And Setters -- (void)setDatasource:(NSArray *)datasource { - _datasource = datasource; - [self.tableView reloadData]; -} - -- (UIStackView *)stackView { - if (!_stackView) { - _stackView = [[UIStackView alloc] init]; - _stackView.axis = UILayoutConstraintAxisVertical; - _stackView.distribution = UIStackViewDistributionFill; - _stackView.alignment = UIStackViewAlignmentFill; - _stackView.spacing = 0; - } - return _stackView; -} - -- (UIView *)selectView { - if (!_selectView) { - _selectView = [[UIView alloc] init]; - _selectView.backgroundColor = [UIColor clearColor]; - _selectView.backgroundColor = [DJDKMIMOMColor colorWithHexString:@"#E4E4E4"]; - UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(gamePlayButtonAction:)]; - [_selectView addGestureRecognizer:tap]; - } - return _selectView; -} -- (UITableView *)tableView { - if (!_tableView) { - _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; - _tableView.delegate = self; - _tableView.dataSource = self; - _tableView.tableFooterView = [UIView new]; - _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; - _tableView.backgroundColor = [DJDKMIMOMColor colorWithHexString:@"#F4F4F4"]; - _tableView.hidden = YES; - if (@available(iOS 11.0, *)) { - _tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; - } - [_tableView registerClass:[XPWishGiftListTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPWishGiftListTableViewCell class])]; - } - return _tableView; -} - -- (UIImageView *)arrowImageView { - if (!_arrowImageView) { - _arrowImageView = [[UIImageView alloc] init]; - _arrowImageView.userInteractionEnabled = YES; - _arrowImageView.image = [UIImage imageNamed:@"room_wish_create_arrow"]; - } - return _arrowImageView; -} - -- (UILabel *)titlelable { - if (!_titlelable) { - _titlelable = [[UILabel alloc] init]; - _titlelable.font = [UIFont systemFontOfSize:14]; - _titlelable.textColor = [DJDKMIMOMColor mainTextColor]; - } - return _titlelable; -} - -@end diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftSectionView.h.backup b/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftSectionView.h.backup deleted file mode 100644 index 197aa73..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftSectionView.h.backup +++ /dev/null @@ -1,16 +0,0 @@ -// -// YMWishGiftSectionView.h -// YUMI -// -// Created by YUMI on 2022/10/19. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface XPWishGiftSectionView : UIView -@property (nonatomic,copy) NSString *title; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftSectionView.m.backup b/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftSectionView.m.backup deleted file mode 100644 index f732a38..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/View/View/XPWishGiftSectionView.m.backup +++ /dev/null @@ -1,55 +0,0 @@ -// -// YMWishGiftSectionView.m -// YUMI -// -// Created by YUMI on 2022/10/19. -// - -#import "XPWishGiftSectionView.h" -///Third -#import -///Tool -#import "DJDKMIMOMColor.h" - -@interface XPWishGiftSectionView () -///标题 -@property (nonatomic,strong) UILabel *titleLabel; -@end - -@implementation XPWishGiftSectionView -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; -} - -- (void)initSubViews { - [self addSubview:self.titleLabel]; -} - -- (void)initSubViewConstraints { - [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(self).offset(24); - make.centerY.mas_equalTo(self); - }]; -} - -- (void)setTitle:(NSString *)title { - _title = title; - self.titleLabel.text = _title; -} - -- (UILabel *)titleLabel { - if (!_titleLabel) { - _titleLabel = [[UILabel alloc] init]; - _titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium]; - _titleLabel.textColor = [DJDKMIMOMColor mainTextColor]; - } - return _titleLabel; -} - - -@end diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftCreateItemViewController.h.backup b/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftCreateItemViewController.h.backup deleted file mode 100644 index ed7fb9a..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftCreateItemViewController.h.backup +++ /dev/null @@ -1,29 +0,0 @@ -// -// YMWishGiftCreateItemViewController.h -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import "MvpViewController.h" - -NS_ASSUME_NONNULL_BEGIN -@class WishGiftInfoModel; -@interface XPWishGiftCreateItemViewController : MvpViewController -///初级礼物 -@property (nonatomic,strong) NSArray *levelOneGiftList; -///中级礼物 -@property (nonatomic,strong) NSArray *levelTwoGiftList; -///高级礼物 -@property (nonatomic,strong) NSArray *levelThirdGiftList; -///房主的uid -@property (nonatomic,strong) NSString *roomUid; - -///需要修改的礼物信息 -@property (nonatomic,strong) WishGiftInfoModel *modifiGiftInfo; - -///创建完成 -@property (nonatomic,copy) void(^Dismiss)(BOOL finish); -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftCreateItemViewController.m.backup b/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftCreateItemViewController.m.backup deleted file mode 100644 index 538714e..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftCreateItemViewController.m.backup +++ /dev/null @@ -1,522 +0,0 @@ -// -// YMWishGiftCreateItemViewController.m -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import "XPWishGiftCreateItemViewController.h" -///Third -#import -///Tool -#import "DJDKMIMOMColor.h" -#import "UIImage+Utils.h" -#import "NSArray+Safe.h" -///View -#import "XPWishGiftListView.h" -#import "WishGiftInfoModel.h" -///P -#import "XPWishGiftPresenter.h" -#import "XPWishGiftProtocol.h" - -@interface XPWishGiftCreateItemViewController () -///背景 -@property (nonatomic,strong) UIView *topView; -///背景 -@property (nonatomic,strong) UIView * bottomView; -///背景 -@property (nonatomic,strong) UIView *backView; -///等级 -@property (nonatomic,strong) XPWishGiftListView *levelView; -///礼物 -@property (nonatomic,strong) XPWishGiftListView *giftView; -///数量 -@property (nonatomic,strong) UIStackView *numberStackView; -///减 -@property (nonatomic,strong) UIButton *subtractButton; -///输入框 -@property (nonatomic,strong) MSBaseTextField *textField; -///添加 -@property (nonatomic,strong) UIButton *addButton; -///关闭按钮 -@property (nonatomic,strong) UIButton *sureButton; -///个数 -@property (nonatomic,assign) int number; -///礼物等级 -@property (nonatomic,strong) NSArray *levelLists; -///礼物等级 -@property (nonatomic,strong) WishGiftInfoModel *levleInfo; -///礼物信息 -@property (nonatomic,strong) WishGiftInfoModel *giftInfo; -@end - -@implementation XPWishGiftCreateItemViewController - -- (__kindof id)createPresenter { - return [[XPWishGiftPresenter alloc] init]; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - self.view.backgroundColor = UIColorRGBAlpha(0x000000, 0.5); - [self initWishGiftCongifList]; - [self initSubViews]; - [self initSubViewConstraints]; -} - - -#pragma mark - Private Method -- (void)initWishGiftCongifList { - if (self.modifiGiftInfo == nil) { - self.number = 10; - self.levleInfo = self.levelLists.firstObject; - [self handleLevleDatasource:self.levleInfo.level]; - [self.levelView configDefaultInfo:self.levleInfo]; - if (self.levelOneGiftList.count > 0) { - self.giftInfo = self.levelOneGiftList.firstObject; - [self.giftView configDefaultInfo:self.giftInfo]; - [self handleGiftDatasource:self.levelOneGiftList giftId:self.giftInfo.giftId];; - } - } - [self loadWishGiftLevelList]; -} - -- (void)loadWishGiftLevelList { - if (self.levelOneGiftList.count <= 0) { - [self.presenter wishGiftConfigList:self.roomUid level:@"1"]; - } else if(self.levelTwoGiftList.count <= 0) { - [self.presenter wishGiftConfigList:self.roomUid level:@"2"]; - } else if(self.levelThirdGiftList.count <= 0) { - [self.presenter wishGiftConfigList:self.roomUid level:@"3"]; - } -} - -- (void)initSubViews { - [self.view addSubview:self.topView]; - [self.view addSubview:self.backView]; - [self.view addSubview:self.bottomView]; - - [self.backView addSubview:self.sureButton]; - [self.backView addSubview:self.numberStackView]; - [self.backView addSubview:self.giftView]; - [self.backView addSubview:self.levelView]; - - [self.numberStackView addArrangedSubview:self.subtractButton]; - [self.numberStackView addArrangedSubview:self.textField]; - [self.numberStackView addArrangedSubview:self.addButton]; -} - -- (void)initSubViewConstraints { - [self.topView mas_makeConstraints:^(MASConstraintMaker *make) { - make.trailing.top.leading.mas_equalTo(self.view); - make.bottom.mas_equalTo(self.backView.mas_top); - }]; - - [self.backView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.mas_equalTo(self.view).inset(38); - make.height.mas_equalTo(245); - make.centerY.mas_equalTo(self.view); - }]; - - [self.bottomView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.bottom.mas_equalTo(self.view); - make.top.mas_equalTo(self.backView.mas_bottom); - }]; - - [self.levelView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.mas_equalTo(self.backView).inset(30); - make.top.mas_equalTo(self.backView).offset(36); - }]; - - - [self.giftView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.mas_equalTo(self.backView).inset(30); - make.top.mas_equalTo(self.backView).offset(84); - }]; - - [self.numberStackView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.mas_equalTo(self.levelView); - make.height.mas_equalTo(36); - make.bottom.mas_equalTo(self.sureButton.mas_top).offset(-20); - }]; - - [self.subtractButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(36); - }]; - - [self.addButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(36); - }]; - - [self.sureButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(129, 37)); - make.centerX.mas_equalTo(self.backView); - make.bottom.mas_equalTo(self.backView.mas_bottom).offset(-20); - }]; -} - -- (int)addMaxCount { - if ([self.levleInfo.levelName isEqualToString:YMLocalizedString(@"XPWishGiftCreateItemViewController0")]) { - return 999; - } else if ([self.levleInfo.levelName isEqualToString:YMLocalizedString(@"XPWishGiftCreateItemViewController1")]) { - return 99; - } else { - return 30; - } -} - -- (BOOL)canAddMaxCount:(int)count { - if ([self.levleInfo.levelName isEqualToString:YMLocalizedString(@"XPWishGiftCreateItemViewController2")]) { - return count <= 999; - } else if ([self.levleInfo.levelName isEqualToString:YMLocalizedString(@"XPWishGiftCreateItemViewController3")]) { - return count <= 99; - } else { - return count <= 30; - } -} - -- (BOOL)canSubtractMinCount:(int)count { - if ([self.levleInfo.levelName isEqualToString:YMLocalizedString(@"XPWishGiftCreateItemViewController4")]) { - return count >= 10; - } else if ([self.levleInfo.levelName isEqualToString:YMLocalizedString(@"XPWishGiftCreateItemViewController5")]) { - return count >= 10; - } else { - return count >= 1; - } -} - -- (int)subtractMinCount { - if ([self.levleInfo.levelName isEqualToString:YMLocalizedString(@"XPWishGiftCreateItemViewController6")]) { - return 10; - } else if ([self.levleInfo.levelName isEqualToString:YMLocalizedString(@"XPWishGiftCreateItemViewController7")]) { - return 10; - } else { - return 1; - } -} - - -- (void)handleLevleDatasource:(WishGiftLevel)levele { - NSMutableArray * array = [self.levelLists mutableCopy]; - for (int i = 0;i < self.levelLists.count;i++) { - WishGiftInfoModel * infor = [self.levelLists xpSafeObjectAtIndex:i]; - if (infor.level == levele) { - [array removeObject:infor]; - } - } - self.levelView.datasource = array.copy; -} - -- (void)handleGiftDatasource:(NSArray *)levels giftId:(NSInteger)giftId { - NSMutableArray * array = [levels mutableCopy]; - for (int i = 0;i < levels.count;i++) { - WishGiftInfoModel * infor = [levels xpSafeObjectAtIndex:i]; - if (infor.giftId == giftId) { - [array removeObject:infor]; - } - } - self.giftView.datasource = array.copy; -} - -#pragma mark - XPWishGiftListViewDelegate -- (void)xPWishGiftListView:(XPWishGiftListView *)view didSelectItem:(WishGiftInfoModel *)info { - if (view == self.levelView) { - self.levleInfo = info; - ///处理等级 - [self handleLevleDatasource:info.level]; - WishGiftInfoModel * giftInfo; - if (info.level == WishGiftLevel_Normal) { - ///处理等级对应的礼物 - if (self.levelOneGiftList.count > 0) { - giftInfo = self.levelOneGiftList.firstObject; - } - self.textField.text = @"10"; - [self handleGiftDatasource:self.levelOneGiftList giftId:giftInfo.giftId]; - } else if (info.level == WishGiftLevel_Middle) { - if (self.levelTwoGiftList.count > 0) { - giftInfo = self.levelTwoGiftList.firstObject; - } - self.textField.text = @"10"; - [self handleGiftDatasource:self.levelTwoGiftList giftId:giftInfo.giftId]; - } else { - if (self.levelThirdGiftList.count > 0) { - giftInfo = self.levelThirdGiftList.firstObject; - } - self.textField.text = @"1"; - [self handleGiftDatasource:self.levelThirdGiftList giftId:giftInfo.giftId]; - } - self.giftInfo = giftInfo; - self.number = self.textField.text.intValue; - [self.giftView configDefaultInfo:giftInfo]; - } else { - self.giftInfo = info; - [self.giftView configDefaultInfo:info]; - if (self.levleInfo.level == WishGiftLevel_Normal) { - [self handleGiftDatasource:self.levelOneGiftList giftId:info.giftId]; - } else if (self.levleInfo.level == WishGiftLevel_Middle) { - [self handleGiftDatasource:self.levelTwoGiftList giftId:info.giftId]; - } else { - [self handleGiftDatasource:self.levelThirdGiftList giftId:info.giftId]; - } - } -} - -#pragma mark - XPWishGiftProtocol -- (void)wishGiftConfigListSucces:(NSArray *)list level:(NSString *)level { - if (level.intValue == 1) { - self.levelOneGiftList = list; - if (list.count > 0 && !self.modifiGiftInfo) { - self.giftInfo = list.firstObject; - [self.giftView configDefaultInfo:self.giftInfo]; - [self handleGiftDatasource:self.levelOneGiftList giftId:self.giftInfo.giftId];; - } - if (self.modifiGiftInfo) { - [self handleGiftDatasource:self.levelThirdGiftList giftId:_modifiGiftInfo.giftId]; - } - } else if (level.intValue == 2) { - self.levelTwoGiftList = list; - if (self.modifiGiftInfo) { - [self handleGiftDatasource:self.levelTwoGiftList giftId:_modifiGiftInfo.giftId]; - } - } else { - self.levelThirdGiftList = list; - if (self.modifiGiftInfo) { - [self handleGiftDatasource:self.levelThirdGiftList giftId:_modifiGiftInfo.giftId]; - } - } -} - -- (void)createWishGiftItemSuccess { - [self disMissView]; - if(self.Dismiss) { - self.Dismiss(YES); - } -} - -#pragma mark - Event Response -- (void)subtractButtonAction:(UIButton *)sener { - if([self canSubtractMinCount:self.number]) { - self.number --; - } else { - self.number = [self subtractMinCount]; - } - self.textField.text = [NSString stringWithFormat:@"%d", self.number]; -} - -- (void)addButtonAction:(UIButton *)sener { - if([self canAddMaxCount:self.number]) { - self.number ++; - } else { - self.number = [self addMaxCount]; - } - self.textField.text = [NSString stringWithFormat:@"%d", self.number]; -} - -- (void)textFieldDidChanged:(UITextField *)textField { - self.number = textField.text.intValue; -} - -- (void)disMissView { - [self dismissViewControllerAnimated:YES completion:nil]; -} -#pragma mark - Event Response -- (void)sureButtonAction:(UIButton *)sender { - if (![self canSubtractMinCount:self.number]) { - NSString * toast = [NSString stringWithFormat:YMLocalizedString(@"XPWishGiftCreateItemViewController8"), [self subtractMinCount], [self addMaxCount]]; - [self showErrorToast:toast]; - self.textField.text = [NSString stringWithFormat:@"%d", [self subtractMinCount]]; - self.number = [self subtractMinCount]; - return; - } else if(![self canAddMaxCount:self.number]){ - NSString * toast = [NSString stringWithFormat:YMLocalizedString(@"XPWishGiftCreateItemViewController8"), [self subtractMinCount], [self addMaxCount]]; - [self showErrorToast:toast]; - self.textField.text = [NSString stringWithFormat:@"%d", [self addMaxCount]]; - self.number = [self addMaxCount]; - return; - } - NSString * itemId = self.modifiGiftInfo ? [NSString stringWithFormat:@"%ld", self.modifiGiftInfo.itemId] : @""; - [self.presenter createWishGiftItem:self.roomUid itemId:itemId giftId:[NSString stringWithFormat:@"%ld", self.giftInfo.giftId] seq:self.levleInfo.level targetNum:self.number]; -} - -#pragma mark - Getters And Setters -- (void)setModifiGiftInfo:(WishGiftInfoModel *)modifiGiftInfo { - _modifiGiftInfo = modifiGiftInfo; - if (_modifiGiftInfo) { - WishGiftInfoModel * levelInfo; - for (WishGiftInfoModel * info in self.levelLists) { - if (info.level == _modifiGiftInfo.level) { - levelInfo = info; - } - } - if (levelInfo) { - self.levleInfo = levelInfo; - self.giftInfo = _modifiGiftInfo; - [self.levelView configDefaultInfo:levelInfo]; - [self.giftView configDefaultInfo:_modifiGiftInfo]; - ///处理等级 - [self handleLevleDatasource:levelInfo.level]; - ///处理等级 - if (_modifiGiftInfo.level == WishGiftLevel_Normal) { - if (self.levelOneGiftList.count <=0) { - [self.presenter wishGiftConfigList:self.roomUid level:@"1"]; - } else { - [self handleGiftDatasource:self.levelOneGiftList giftId:_modifiGiftInfo.giftId]; - } - } else if (_modifiGiftInfo.level == WishGiftLevel_Middle) { - if (self.levelTwoGiftList.count <= 0) { - [self.presenter wishGiftConfigList:self.roomUid level:@"2"]; - } else { - [self handleGiftDatasource:self.levelTwoGiftList giftId:_modifiGiftInfo.giftId]; - } - } else { - if (self.levelThirdGiftList.count <= 0) { - [self.presenter wishGiftConfigList:self.roomUid level:@"3"]; - } else { - [self handleGiftDatasource:self.levelThirdGiftList giftId:_modifiGiftInfo.giftId]; - } - } - self.textField.text = [NSString stringWithFormat:@"%ld", _modifiGiftInfo.targetNum]; - self.number = (int)_modifiGiftInfo.targetNum; - - } else { - [self disMissView]; - } - } -} - -- (UIView *)topView { - if (!_topView) { - _topView = [[UIView alloc] init]; - _topView.backgroundColor = [UIColor clearColor]; - UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(disMissView)]; - [_topView addGestureRecognizer:tap]; - } - return _topView; -} - - -- (UIView *)bottomView { - if (!_bottomView) { - _bottomView = [[UIView alloc] init]; - _bottomView.backgroundColor = [UIColor clearColor]; - UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(disMissView)]; - [_bottomView addGestureRecognizer:tap]; - } - return _bottomView; -} - - -- (UIView *)backView { - if (!_backView) { - _backView = [[UIView alloc] init]; - _backView.layer.masksToBounds = YES; - _backView.layer.cornerRadius = 20; - _backView.backgroundColor = [UIColor whiteColor]; - } - return _backView; -} - -- (XPWishGiftListView *)levelView { - if(!_levelView) { - _levelView = [[XPWishGiftListView alloc] init]; - _levelView.delegate = self; - } - return _levelView; -} - -- (XPWishGiftListView *)giftView { - if(!_giftView) { - _giftView = [[XPWishGiftListView alloc] init]; - _giftView.delegate = self; - } - return _giftView; -} - -- (UIButton *)subtractButton { - if (!_subtractButton) { - _subtractButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_subtractButton setImage:[UIImage imageNamed:@"room_wish_gift_subtract"] forState:UIControlStateNormal]; - [_subtractButton setImage:[UIImage imageNamed:@"room_wish_gift_subtract"] forState:UIControlStateSelected]; - [_subtractButton addTarget:self action:@selector(subtractButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - } - return _subtractButton; -} - - -- (UIButton *)addButton { - if (!_addButton) { - _addButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_addButton setImage:[UIImage imageNamed:@"room_wish_gift_add"] forState:UIControlStateNormal]; - [_addButton setImage:[UIImage imageNamed:@"room_wish_gift_add"] forState:UIControlStateSelected]; - [_addButton addTarget:self action:@selector(addButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - } - return _addButton; -} - -- (UIStackView *)numberStackView { - if (!_numberStackView) { - _numberStackView = [[UIStackView alloc] init]; - _numberStackView.axis = UILayoutConstraintAxisHorizontal; - _numberStackView.distribution = UIStackViewDistributionFill; - _numberStackView.alignment = UIStackViewAlignmentFill; - _numberStackView.spacing = 10; - } - return _numberStackView; -} - -- (MSBaseTextField *)textField { - if (!_textField) { - _textField = [[MSBaseTextField alloc] init]; - _textField.layer.cornerRadius = 4; - _textField.layer.masksToBounds = YES; - _textField.tintColor = [DJDKMIMOMColor secondTextColor]; - _textField.textColor = [DJDKMIMOMColor mainTextColor]; - _textField.backgroundColor = [UIColor clearColor]; - _textField.font = [UIFont systemFontOfSize:10]; - _textField.clearButtonMode = UITextFieldViewModeWhileEditing; - _textField.returnKeyType = UIReturnKeySearch; - _textField.enablesReturnKeyAutomatically = YES; - _textField.text = @"10"; - _textField.textAlignment = NSTextAlignmentCenter; - _textField.keyboardType = UIKeyboardTypeNumberPad; - _textField.backgroundColor = [DJDKMIMOMColor colorWithHexString:@"#E4E4E4"]; - [_textField addTarget:self action:@selector(textFieldDidChanged:) forControlEvents:UIControlEventEditingChanged]; - } - return _textField; -} - -- (UIButton *)sureButton { - if (!_sureButton) { - _sureButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_sureButton setTitle:YMLocalizedString(@"TTAlertConfig0") forState:UIControlStateNormal]; - [_sureButton setTitleColor:[DJDKMIMOMColor confirmButtonTextColor] forState:UIControlStateNormal]; - _sureButton.titleLabel.font = [UIFont systemFontOfSize:14]; - [_sureButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor], [DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; - _sureButton.layer.masksToBounds = YES; - _sureButton.layer.cornerRadius = 10; - [_sureButton addTarget:self action:@selector(sureButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - } - return _sureButton; -} - -- (NSArray *)levelLists { - if (!_levelLists) { - WishGiftInfoModel * levelOne = [[WishGiftInfoModel alloc] init]; - levelOne.levelName = YMLocalizedString(@"XPWishGiftCreateItemViewController11"); - levelOne.level = WishGiftLevel_Normal; - - WishGiftInfoModel * levelTwo = [[WishGiftInfoModel alloc] init]; - levelTwo.levelName = YMLocalizedString(@"XPWishGiftCreateItemViewController12"); - levelTwo.level = WishGiftLevel_Middle; - - WishGiftInfoModel * levelThree = [[WishGiftInfoModel alloc] init]; - levelThree.levelName = YMLocalizedString(@"XPWishGiftCreateItemViewController13"); - levelThree.level = WishGiftLevel_High; - _levelLists = @[levelOne, levelTwo, levelThree]; - } - return _levelLists; -} - - - -@end diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftCreateViewController.h.backup b/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftCreateViewController.h.backup deleted file mode 100644 index 6f5e8b2..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftCreateViewController.h.backup +++ /dev/null @@ -1,16 +0,0 @@ -// -// YMWishGiftCreateViewController.h -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import "MvpViewController.h" -#import "RoomHostDelegate.h" -NS_ASSUME_NONNULL_BEGIN - -@interface XPWishGiftCreateViewController : MvpViewController -- (instancetype)initWithDelegate:(id)delegate; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftCreateViewController.m.backup b/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftCreateViewController.m.backup deleted file mode 100644 index 2ca7035..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftCreateViewController.m.backup +++ /dev/null @@ -1,333 +0,0 @@ -// -// YMWishGiftCreateViewController.m -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import "XPWishGiftCreateViewController.h" -///Third -#import -///Tool -#import "DJDKMIMOMColor.h" -#import "UIImage+Utils.h" -#import "TTPopup.h" -#import "YUMIMacroUitls.h" -#import "NSArray+Safe.h" -///Model -#import "WishGiftInfoModel.h" -#import "RoomInfoModel.h" -///View -#import "XPWishGiftTableViewCell.h" -#import "XPWishGiftHistoryViewController.h" -#import "XPWishGiftCreateItemViewController.h" -///P -#import "XPWishGiftPresenter.h" -#import "XPWishGiftProtocol.h" -@interface XPWishGiftCreateViewController () -///设置心愿 -@property (nonatomic,strong) UILabel *configLabel; -///清除心愿 -@property (nonatomic,strong) UIButton *clearWishButton; -///添加心愿 -@property (nonatomic,strong) UIButton *addWishButton; -///列表 -@property (nonatomic,strong) UITableView *tableView; -///创建 -@property (nonatomic,strong) UIButton *createButton; -///数据源 -@property (nonatomic,strong) NSArray *datasource; -///房主的uid -@property (nonatomic,strong) NSString *roomUid; -///代理 -@property (nonatomic,weak) id delegate; -///初级礼物 -@property (nonatomic,strong) NSArray *levelOneGiftList; -///中级礼物 -@property (nonatomic,strong) NSArray *levelTwoGiftList; -///高级礼物 -@property (nonatomic,strong) NSArray *levelThirdGiftList; -@end - -@implementation XPWishGiftCreateViewController - -- (__kindof id)createPresenter { - return [[XPWishGiftPresenter alloc] init]; -} -- (instancetype)initWithDelegate:(id)delegate{ - if (self = [super init]) { - self.delegate = delegate; - self.roomUid = [NSString stringWithFormat:@"%ld", [self.delegate getRoomInfo].uid]; - [self initWishGiftList]; - [self initWishLevleGiftList]; - RoomInfoModel * roomInfo = [self.delegate getRoomInfo]; - if (roomInfo.hasOpenWishGift) { - self.addWishButton.hidden = YES; - self.clearWishButton.hidden = YES; - [self.createButton setTitle:YMLocalizedString(@"XPWishGiftCreateViewController0") forState:UIControlStateNormal]; - self.createButton.enabled = NO; - } - } - return self; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - [self initSubViews]; - [self initSubViewConstraints]; -} - -#pragma mark - Private Method -- (void)initWishGiftList { - [self.presenter wishGiftList:self.roomUid]; -} - -- (void)initWishLevleGiftList { - [self.presenter wishGiftConfigList:self.roomUid level:@"1"]; - [self.presenter wishGiftConfigList:self.roomUid level:@"2"]; - [self.presenter wishGiftConfigList:self.roomUid level:@"3"]; -} - -- (void)initSubViews { - self.title = YMLocalizedString(@"XPWishGiftCreateViewController1"); - [self.view addSubview:self.configLabel]; - [self.view addSubview:self.clearWishButton]; - [self.view addSubview:self.addWishButton]; - [self.view addSubview:self.tableView]; - [self.view addSubview:self.createButton]; - [self addNavigationItemWithTitles:@[YMLocalizedString(@"XPWishGiftCreateViewController2")] titleColor:[DJDKMIMOMColor secondTextColor] isLeft:NO target:self action:@selector(rightButtonAction:) tags:nil]; -} - -- (void)initSubViewConstraints { - [self.configLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(self.view).offset(24); - make.top.mas_equalTo(self.view).offset(14); - }]; - - [self.clearWishButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(60, 20)); - make.centerY.mas_equalTo(self.configLabel); - make.trailing.mas_equalTo(self.addWishButton.mas_leading).offset(-10); - }]; - - [self.addWishButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.equalTo(self.configLabel); - make.trailing.mas_equalTo(self.view).offset(-18); - make.size.mas_equalTo(CGSizeMake(60, 20)); - }]; - - [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.mas_equalTo(self.view).inset(15); - make.height.mas_equalTo(135); - make.top.mas_equalTo(self.configLabel.mas_bottom).offset(13); - }]; - - [self.createButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.mas_equalTo(self.view).inset(80); - make.height.mas_equalTo(37); - make.top.mas_equalTo(self.tableView.mas_bottom).offset(48); - }]; -} -#pragma mark - UITableViewDelegate And UITableViewDataSource -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return self.datasource.count; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - XPWishGiftTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPWishGiftTableViewCell class])]; - if (cell == nil) { - cell = [[XPWishGiftTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPWishGiftTableViewCell class])]; - } - WishGiftInfoModel *giftInfo = [self.datasource xpSafeObjectAtIndex:indexPath.row]; - giftInfo.row = indexPath.row + 1; - cell.giftInfo = giftInfo; - cell.delegate = self; - RoomInfoModel * roomInfo = [self.delegate getRoomInfo]; - cell.isHiddenEdit = roomInfo.hasOpenWishGift; - return cell; -} - -#pragma mark - XPWishGiftTableViewCellDelegate -- (void)xPWishGiftTableViewCell:(XPWishGiftTableViewCell *)view didClearWishGift:(WishGiftInfoModel *)info { - if (info) { - TTAlertConfig * config = [[TTAlertConfig alloc] init]; - config.title = @""; - config.message = YMLocalizedString(@"XPWishGiftCreateViewController3"); - [TTPopup alertWithConfig:config confirmHandler:^{ - [self.presenter deleteWishGiftItem:self.roomUid itemId:[NSString stringWithFormat:@"%ld", info.itemId]]; - } cancelHandler:^{ - - }]; - } -} - -- (void)xPWishGiftTableViewCell:(XPWishGiftTableViewCell *)view didUpdateWishGift:(WishGiftInfoModel *)info { - XPWishGiftCreateItemViewController * createItemVC = [[XPWishGiftCreateItemViewController alloc] init]; - createItemVC.roomUid = self.roomUid; - createItemVC.levelOneGiftList = self.levelOneGiftList; - createItemVC.levelTwoGiftList = self.levelTwoGiftList; - createItemVC.levelThirdGiftList = self.levelThirdGiftList; - createItemVC.modifiGiftInfo = info; - @kWeakify(self); - createItemVC.Dismiss = ^(BOOL finish) { - @kStrongify(self); - [self initWishGiftList]; - }; - createItemVC.modalPresentationStyle = UIModalPresentationOverFullScreen; - [self.navigationController presentViewController:createItemVC animated:YES completion:nil]; -} - -#pragma mark - XPWishGiftProtocol -- (void)addWishGiftSuccess { - [self.navigationController popViewControllerAnimated:YES]; -} - -- (void)getWishGiftListSuccess:(NSArray *)list { - self.datasource = list; - [self.tableView reloadData]; -} - -- (void)deleteWishGiftItemSuccess { - [self initWishGiftList]; -} - -- (void)wishGiftConfigListSucces:(NSArray *)list level:(NSString *)level { - if (level.intValue == 1) { - self.levelOneGiftList = list; - } else if (level.intValue == 2) { - self.levelTwoGiftList = list; - } else { - self.levelThirdGiftList = list; - } -} - -#pragma mark - Event Response -- (void)rightButtonAction:(UIButton *)sender { - XPWishGiftHistoryViewController * historyVC = [[XPWishGiftHistoryViewController alloc] init]; - historyVC.roomUid = self.roomUid; - [self.navigationController pushViewController:historyVC animated:YES]; -} - -- (void)clearButtonAction:(UIButton *)sender { - if (self.datasource.count > 0) { - TTAlertConfig * config = [[TTAlertConfig alloc] init]; - config.title = @""; - config.message = YMLocalizedString(@"XPWishGiftCreateViewController4"); - [TTPopup alertWithConfig:config confirmHandler:^{ - [self.presenter deleteWishGiftItem:self.roomUid itemId:@"-1"]; - } cancelHandler:^{ - - }]; - } else { - [self showErrorToast:YMLocalizedString(@"XPWishGiftCreateViewController5")]; - } -} - -- (void)addWishButtonAction:(UIButton *)sender { - if (self.datasource.count == 3) { - [self showErrorToast:YMLocalizedString(@"XPWishGiftCreateViewController6")]; - return; - } - XPWishGiftCreateItemViewController * createItemVC = [[XPWishGiftCreateItemViewController alloc] init]; - createItemVC.levelOneGiftList = self.levelOneGiftList; - createItemVC.levelTwoGiftList = self.levelTwoGiftList; - createItemVC.levelThirdGiftList = self.levelThirdGiftList; - createItemVC.roomUid = self.roomUid; - @kWeakify(self); - createItemVC.Dismiss = ^(BOOL finish) { - @kStrongify(self); - [self initWishGiftList]; - }; - createItemVC.modalPresentationStyle = UIModalPresentationOverFullScreen; - [self.navigationController presentViewController:createItemVC animated:YES completion:nil]; -} - -- (void)createButtonAction:(UIButton *)sender { - if (self.datasource.count > 0) { - TTAlertConfig * config = [[TTAlertConfig alloc] init]; - config.title = @""; - config.message = YMLocalizedString(@"XPWishGiftCreateViewController7"); - [TTPopup alertWithConfig:config confirmHandler:^{ - [self.presenter addWishGift:self.roomUid]; - } cancelHandler:^{ - - }]; - } else { - [self showErrorToast:YMLocalizedString(@"XPWishGiftCreateViewController8")]; - } -} - -#pragma mark - Getters And Setters -- (UILabel *)configLabel { - if (!_configLabel) { - _configLabel = [[UILabel alloc] init]; - _configLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold]; - _configLabel.textColor = [DJDKMIMOMColor mainTextColor]; - _configLabel.text = YMLocalizedString(@"XPWishGiftCreateViewController9"); - } - return _configLabel; -} - -- (UIButton *)clearWishButton { - if (!_clearWishButton) { - _clearWishButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_clearWishButton setTitle:YMLocalizedString(@"XPWishGiftCreateViewController10") forState:UIControlStateNormal]; - [_clearWishButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - _clearWishButton.titleLabel.font = [UIFont systemFontOfSize:10]; - _clearWishButton.backgroundColor = [DJDKMIMOMColor colorWithHexString:@"#C7DAEA"]; - _clearWishButton.layer.masksToBounds = YES; - _clearWishButton.layer.cornerRadius = 10; - [_clearWishButton addTarget:self action:@selector(clearButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - } - return _clearWishButton; -} - -- (UIButton *)addWishButton { - if (!_addWishButton) { - _addWishButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_addWishButton setTitle:YMLocalizedString(@"XPWishGiftCreateViewController11") forState:UIControlStateNormal]; - [_addWishButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - _addWishButton.titleLabel.font = [UIFont systemFontOfSize:10]; - [_addWishButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor], [DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; - _addWishButton.layer.masksToBounds = YES; - _addWishButton.layer.cornerRadius = 10; - [_addWishButton addTarget:self action:@selector(addWishButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - } - return _addWishButton; -} - - -- (UITableView *)tableView { - if (!_tableView) { - _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; - _tableView.delegate = self; - _tableView.dataSource = self; - _tableView.tableFooterView = [UIView new]; - _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; - _tableView.backgroundColor = [UIColor whiteColor]; - _tableView.layer.masksToBounds = YES; - _tableView.layer.cornerRadius = 8; - if (@available(iOS 11.0, *)) { - _tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; - } - [_tableView registerClass:[XPWishGiftTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPWishGiftTableViewCell class])]; - } - return _tableView; -} - -- (UIButton *)createButton { - if (!_createButton) { - _createButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_createButton setTitle:YMLocalizedString(@"XPWishGiftCreateViewController12") forState:UIControlStateNormal]; - [_createButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - _createButton.titleLabel.font = [UIFont systemFontOfSize:12]; - [_createButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor], [DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; - _createButton.layer.masksToBounds = YES; - _createButton.layer.cornerRadius = 37 / 2; - [_createButton addTarget:self action:@selector(createButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - } - return _createButton; -} - - -@end diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftHistoryViewController.h.backup b/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftHistoryViewController.h.backup deleted file mode 100644 index 7a2025e..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftHistoryViewController.h.backup +++ /dev/null @@ -1,16 +0,0 @@ -// -// YMWishGiftHistoryViewController.h -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import "MvpViewController.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface XPWishGiftHistoryViewController : MvpViewController -@property (nonatomic,strong) NSString *roomUid; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftHistoryViewController.m.backup b/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftHistoryViewController.m.backup deleted file mode 100644 index 895b7b0..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftHistoryViewController.m.backup +++ /dev/null @@ -1,162 +0,0 @@ -// -// YMWishGiftHistoryViewController.m -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import "XPWishGiftHistoryViewController.h" -///Third -#import -///Tool -#import "DJDKMIMOMColor.h" -#import "YUMIMacroUitls.h" -#import "PLTimeUtil.h" -#import "NSArray+Safe.h" -///Model -#import "WishGiftHistoryModel.h" -///View -#import "XPWishGiftHistoryTableViewCell.h" -#import "XPWishGiftEmptyTableViewCell.h" -#import "XPWishGiftSectionView.h" -///P -#import "XPWishGiftPresenter.h" -#import "XPWishGiftProtocol.h" - -@interface XPWishGiftHistoryViewController () -///列表 -@property (nonatomic,strong) UITableView *tableView; -///数据源 -@property (nonatomic,strong) NSArray *datasource; -@end - -@implementation XPWishGiftHistoryViewController - -- (__kindof id)createPresenter { - return [[XPWishGiftPresenter alloc] init]; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - [self initWishGiftHistoryList]; - [self initSubViews]; - [self initSubViewConstraints]; -} - - -- (void)initSubViews { - self.title = YMLocalizedString(@"XPWishGiftHistoryViewController0"); - [self.view addSubview:self.tableView]; -} - -- (void)initSubViewConstraints { - [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(self.view); - }]; -} - -- (void)initWishGiftHistoryList { - [self.presenter wishGiftHistroyList:self.roomUid]; -} - -#pragma mark - UITableViewDelegate And UITableViewDataSource -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return self.datasource.count > 0 ? self.datasource.count : 1; -} - -- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - if (self.datasource.count > 0) { - return 44; - } - return (KScreenHeight - kNavigationHeight); -} - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - if (self.datasource.count > 0) { - WishGiftHistoryModel *info = [self.datasource xpSafeObjectAtIndex:section]; - return info.gifts.count; - } - return 0; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - if (self.datasource.count > 0) { - XPWishGiftHistoryTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPWishGiftHistoryTableViewCell class])]; - if (cell == nil) { - cell = [[XPWishGiftHistoryTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPWishGiftHistoryTableViewCell class])]; - } - WishGiftHistoryModel *historyInfo = [self.datasource xpSafeObjectAtIndex:indexPath.section]; - WishGiftInfoModel * info= [historyInfo.gifts xpSafeObjectAtIndex:indexPath.row]; - info.row = (indexPath.row + 1); - cell.giftInfo = info; - if (indexPath.row == 0) { - cell.isTop = YES; - } else { - cell.isTop = NO; - } - - if (indexPath.row == historyInfo.gifts.count -1) { - cell.isBottom = YES; - } else { - cell.isBottom = false; - } - return cell; - } - - XPWishGiftEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPWishGiftEmptyTableViewCell class])]; - if (cell == nil) { - cell = [[XPWishGiftEmptyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPWishGiftEmptyTableViewCell class])]; - } - return cell; -} - -- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { - return 0.01; -} - -- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { - return [[UIView alloc] init];; -} - -- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { - return self.datasource.count > 0 ? 45 : 0.01; -} - -- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { - if (self.datasource.count > 0) { - XPWishGiftSectionView * view = [[XPWishGiftSectionView alloc] init]; - view.frame = CGRectMake(0, 0, KScreenWidth, 45); - WishGiftHistoryModel *historyInfo = [self.datasource xpSafeObjectAtIndex:section]; - view.title = historyInfo.createDate; - return view; - } - return [UIView new]; -} - -#pragma mark - XPWishGiftProtocol -///历史心愿成功 -- (void)wishGiftHistroyListSuccess:(NSArray *)list { - self.datasource = list; - [self.tableView reloadData]; -} - -#pragma mark - Getters And Setters -- (UITableView *)tableView { - if (!_tableView) { - _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; - _tableView.delegate = self; - _tableView.dataSource = self; - _tableView.tableFooterView = [UIView new]; - _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; - _tableView.backgroundColor = [UIColor clearColor]; - if (@available(iOS 11.0, *)) { - _tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; - } - [_tableView registerClass:[XPWishGiftHistoryTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPWishGiftHistoryTableViewCell class])]; - [self.tableView registerClass:[XPWishGiftEmptyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPWishGiftEmptyTableViewCell class])]; - } - return _tableView; -} - - -@end diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftViewController.h.backup b/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftViewController.h.backup deleted file mode 100644 index ae39d4d..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftViewController.h.backup +++ /dev/null @@ -1,29 +0,0 @@ -// -// YMWishGIftViewController.h -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import "MvpViewController.h" - -NS_ASSUME_NONNULL_BEGIN - -@protocol XPWishGiftViewControllerDelegate - -- (void)xPWishGiftViewControllerSendClick:(NSString *)giftId; - -@end - -@interface XPWishGiftViewController : MvpViewController - -- (instancetype)initWithRoomUid:(NSString *)roomUid; - -///代理 -@property (nonatomic,weak) id delegate; - -- (void)getWishGiftListSuccess:(NSArray *)list; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftViewController.m.backup b/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftViewController.m.backup deleted file mode 100644 index c72522f..0000000 --- a/YuMi/Modules/YMRoom/View/WishGift/View/XPWishGiftViewController.m.backup +++ /dev/null @@ -1,375 +0,0 @@ -// -// YMWishGIftViewController.m -// YUMI -// -// Created by YUMI on 2022/10/18. -// - -#import "XPWishGiftViewController.h" -///Third -#import -///Tool -#import "DJDKMIMOMColor.h" -#import "NetImageView.h" -#import "YUMIMacroUitls.h" -#import "NSArray+Safe.h" -///View -#import "XPWishGiftInfoView.h" -///Model -#import "WishGiftInfoModel.h" -#import "WishGiftUserModel.h" -///P -#import "XPWishGiftPresenter.h" -#import "XPWishGiftProtocol.h" -@interface XPWishGiftViewController () -///顶部的view -@property (nonatomic,strong) UIView *topView; -///背景 -@property (nonatomic,strong) UIImageView *backImageView; -///显示标题 -@property (nonatomic,strong) UILabel *titleLabel; -///提示 -@property (nonatomic,strong) UILabel *tipsLbel; -///分割线 -@property (nonatomic,strong) UIView *lineView; -///头像的容器 -@property (nonatomic,strong) UIStackView *userStackView; -///第一个头像 -@property (nonatomic,strong) NetImageView *firstAvatarImageView; -///第二个头像 -@property (nonatomic,strong) NetImageView *secondAvatarImageView; -///第三个头像 -@property (nonatomic,strong) NetImageView *thirdAvatarImageView; -@property (nonatomic,strong) NSArray * avatarViews; -///贡献的人数 -@property (nonatomic,strong) UILabel *assistNumLabel; -///礼物 -@property (nonatomic,strong) UIStackView *giftStackView; -///第一个 -@property (nonatomic,strong) XPWishGiftInfoView *firstView; -///第二个 -@property (nonatomic,strong) XPWishGiftInfoView *secondView; -///第三个 -@property (nonatomic,strong) XPWishGiftInfoView *thirdView; -///礼物数组 -@property (nonatomic,strong) NSArray *giftViews; -///房主的uid -@property (nonatomic,strong) NSString *roomUid; -@end - -@implementation XPWishGiftViewController - -- (instancetype)initWithRoomUid:(NSString *)roomUid { - if (self = [super init]) { - self.roomUid = roomUid; - [self initDefaultData]; - } - return self; -} - -- (__kindof id)createPresenter { - return [[XPWishGiftPresenter alloc] init]; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - [self initSubViews]; - [self initSubViewConstraints]; -} - -- (void)initDefaultData { - [self.presenter wishGiftAssistUserList:self.roomUid]; - [self.presenter wishGiftList:self.roomUid]; -} - -- (void)initSubViews { - self.view.backgroundColor = [UIColor clearColor]; - [self.view addSubview:self.topView]; - [self.view addSubview:self.backImageView]; - [self.backImageView addSubview:self.titleLabel]; - [self.backImageView addSubview:self.tipsLbel]; - [self.backImageView addSubview:self.lineView]; - [self.backImageView addSubview:self.userStackView]; - [self.backImageView addSubview:self.assistNumLabel]; - [self.backImageView addSubview:self.giftStackView]; - - [self.userStackView addArrangedSubview:self.firstAvatarImageView]; - [self.userStackView addArrangedSubview:self.secondAvatarImageView]; - [self.userStackView addArrangedSubview:self.thirdAvatarImageView]; - - [self.giftStackView addArrangedSubview:self.firstView]; - [self.giftStackView addArrangedSubview:self.secondView]; - [self.giftStackView addArrangedSubview:self.thirdView]; - self.giftViews = @[self.firstView, self.secondView, self.thirdView]; -} - -- (void)initSubViewConstraints { - [self.topView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.top.trailing.equalTo(self.view); - make.bottom.mas_equalTo(self.backImageView.mas_top); - }]; - - [self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.bottom.mas_equalTo(self.view); - make.height.mas_equalTo(283 + kSafeAreaBottomHeight); - }]; - - [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.mas_equalTo(self.backImageView); - make.top.mas_equalTo(self.backImageView).offset(16); - }]; - - [self.tipsLbel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.mas_equalTo(self.backImageView); - make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(8); - }]; - - [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.mas_equalTo(self.backImageView); - make.top.mas_equalTo(self.tipsLbel.mas_bottom).offset(12); - make.height.mas_equalTo(0.5); - }]; - - [self.userStackView mas_makeConstraints:^(MASConstraintMaker *make) { - make.height.mas_equalTo(28); - make.leading.mas_equalTo(self.backImageView).offset(16); - make.top.mas_equalTo(self.lineView.mas_bottom).offset(10); - }]; - - [self.firstAvatarImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(28); - }]; - - [self.secondAvatarImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(28); - }]; - - [self.thirdAvatarImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(28); - }]; - - [self.assistNumLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.mas_equalTo(self.backImageView).inset(15); - make.centerY.mas_equalTo(self.userStackView); - }]; - - [self.giftStackView mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.mas_equalTo(self.backImageView); - make.height.mas_equalTo(165); - make.bottom.mas_equalTo(self.backImageView).offset(-9 -kSafeAreaBottomHeight); - }]; - - [self.firstView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(106); - }]; - - [self.secondView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(106); - }]; - - [self.thirdView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(106); - }]; -} - -#pragma mark - XPWishGiftInfoViewDelegate -- (void)xPWishGiftInfoView:(XPWishGiftInfoView *)view didClickSender:(WishGiftInfoModel *)info { - [self disMissView]; - if (info.giftId > 0 && self.delegate && [self.delegate respondsToSelector:@selector(xPWishGiftViewControllerSendClick:)]) { - NSString * giftId = [NSString stringWithFormat:@"%ld", info.giftId]; - [self.delegate xPWishGiftViewControllerSendClick:giftId]; - } -} - -#pragma mark - XPWishGiftProtocol -- (void)getWishGiftAssistUserListSuccess:(NSArray *)list { - for (int i = 0; i < self.userStackView.arrangedSubviews.count; i++) { - NetImageView * imageView = [self.userStackView.subviews xpSafeObjectAtIndex:i]; - if (i < list.count) { - WishGiftUserModel * userInfo = [list xpSafeObjectAtIndex:i]; - imageView.hidden = NO; - imageView.imageUrl = userInfo.avatar; - }else { - imageView.hidden = YES; - } - } - - NSString * number = [NSString stringWithFormat:@"%ld", list.count]; - if (list.count <= 0) { - NSString * title = YMLocalizedString(@"XPWishGiftViewController0"); - NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12], NSForegroundColorAttributeName:[DJDKMIMOMColor textThirdColor]}]; - self.assistNumLabel.attributedText = attribute; - self.assistNumLabel.textAlignment = NSTextAlignmentCenter; - } else { - NSString * title = [NSString stringWithFormat:@"%@%@", number, YMLocalizedString(@"XPWishGiftViewController1")]; - NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12], NSForegroundColorAttributeName:[DJDKMIMOMColor textThirdColor]}]; - [attribute addAttribute:NSForegroundColorAttributeName value:[DJDKMIMOMColor colorWithHexString:@"#FFC300"] range:[title rangeOfString:number]]; - self.assistNumLabel.attributedText = attribute; - self.assistNumLabel.textAlignment = NSTextAlignmentRight; - } -} - -- (void)getWishGiftListSuccess:(NSArray *)list { - int finishNumber = 0; - for (WishGiftInfoModel * info in list) { - if (info.actualNum >= info.targetNum) { - finishNumber ++; - } - } - - for (int i = 0; i < self.giftViews.count; i++) { - XPWishGiftInfoView * view = [self.giftViews xpSafeObjectAtIndex:i]; - if(i < list.count) { - WishGiftInfoModel * info = [list xpSafeObjectAtIndex:i]; - view.giftInfo = info; - view.hidden = NO; - } else { - view.hidden = YES; - } - } - self.titleLabel.text = [NSString stringWithFormat:YMLocalizedString(@"XPWishGiftViewController2"),finishNumber,list.count]; -} - -#pragma mark - Event Response -- (void)disMissView { - [self dismissViewControllerAnimated:YES completion:nil]; -} - -#pragma mark - Getters And Setters -- (UIView *)topView { - if (!_topView) { - _topView = [[UIView alloc] init]; - _topView.backgroundColor = [UIColor clearColor]; - UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(disMissView)]; - [_topView addGestureRecognizer:tap]; - } - return _topView; -} - -- (UIImageView *)backImageView { - if (!_backImageView) { - _backImageView = [[UIImageView alloc] init]; - _backImageView.userInteractionEnabled = YES; - _backImageView.image = [UIImage imageNamed:@"room_wish_gift_panel_bg"]; - } - return _backImageView; -} - -- (UILabel *)titleLabel { - if (!_titleLabel) { - _titleLabel = [[UILabel alloc] init]; - _titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium]; - _titleLabel.textColor = [UIColor whiteColor]; - } - return _titleLabel; -} - -- (UILabel *)tipsLbel { - if (!_tipsLbel) { - _tipsLbel = [[UILabel alloc] init]; - _tipsLbel.font = [UIFont systemFontOfSize:10]; - _tipsLbel.text = YMLocalizedString(@"XPWishGiftViewController3"); - _tipsLbel.textColor = [DJDKMIMOMColor textThirdColor]; - } - return _tipsLbel; -} - -- (UIView *)lineView { - if (!_lineView) { - _lineView = [[UIView alloc] init]; - _lineView.backgroundColor = [UIColor colorWithWhite:1 alpha:0.1]; - } - return _lineView; -} - -- (UIStackView *)userStackView { - if (!_userStackView) { - _userStackView = [[UIStackView alloc] init]; - _userStackView.axis = UILayoutConstraintAxisHorizontal; - _userStackView.distribution = UIStackViewDistributionFill; - _userStackView.alignment = UIStackViewAlignmentCenter; - _userStackView.spacing = 4; - } - return _userStackView; -} - -- (NetImageView *)firstAvatarImageView { - if (!_firstAvatarImageView) { - NetImageConfig * config = [[NetImageConfig alloc]init]; - config.imageType = ImageTypeUserIcon; - config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; - _firstAvatarImageView = [[NetImageView alloc] initWithConfig:config]; - _firstAvatarImageView.layer.masksToBounds = YES; - _firstAvatarImageView.layer.cornerRadius = 28/2; - } - return _firstAvatarImageView; -} - -- (NetImageView *)secondAvatarImageView { - if (!_secondAvatarImageView) { - NetImageConfig * config = [[NetImageConfig alloc]init]; - config.imageType = ImageTypeUserIcon; - config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; - _secondAvatarImageView = [[NetImageView alloc] initWithConfig:config]; - _secondAvatarImageView.layer.masksToBounds = YES; - _secondAvatarImageView.layer.cornerRadius = 28/2; - } - return _secondAvatarImageView; -} - -- (NetImageView *)thirdAvatarImageView { - if (!_thirdAvatarImageView) { - NetImageConfig * config = [[NetImageConfig alloc]init]; - config.imageType = ImageTypeUserIcon; - config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; - _thirdAvatarImageView = [[NetImageView alloc] initWithConfig:config]; - _thirdAvatarImageView.layer.masksToBounds = YES; - _thirdAvatarImageView.layer.cornerRadius = 28/2; - } - return _thirdAvatarImageView; -} - -- (UILabel *)assistNumLabel { - if (!_assistNumLabel) { - _assistNumLabel = [[UILabel alloc] init]; - } - return _assistNumLabel; -} - -- (UIStackView *)giftStackView { - if (!_giftStackView) { - _giftStackView = [[UIStackView alloc] init]; - _giftStackView.axis = UILayoutConstraintAxisHorizontal; - _giftStackView.distribution = UIStackViewDistributionFill; - _giftStackView.alignment = UIStackViewAlignmentFill; - _giftStackView.spacing = 12; - } - return _giftStackView; -} - -- (XPWishGiftInfoView *)firstView { - if(!_firstView) { - _firstView = [[XPWishGiftInfoView alloc] init]; - _firstView.delegate = self; - } - return _firstView; -} - -- (XPWishGiftInfoView *)secondView { - if(!_secondView) { - _secondView = [[XPWishGiftInfoView alloc] init]; - _secondView.delegate = self; - } - return _secondView; -} - -- (XPWishGiftInfoView *)thirdView { - if(!_thirdView) { - _thirdView = [[XPWishGiftInfoView alloc] init]; - _thirdView.delegate = self; - } - return _thirdView; -} - - -@end diff --git a/YuMi/Modules/YMTabbar/Api/Api+Main.h.backup b/YuMi/Modules/YMTabbar/Api/Api+Main.h.backup deleted file mode 100644 index 3857d7e..0000000 --- a/YuMi/Modules/YMTabbar/Api/Api+Main.h.backup +++ /dev/null @@ -1,21 +0,0 @@ -// -// Api+Main.h -// YUMI -// -// Created by zu on 2021/9/8. -// - -#import "Api.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface Api (Main) - -+ (void)requestTicket:(HttpRequestHelperCompletion)completion access_token:(NSString *)accessToken issue_type:(NSString *)issueType; - -+ (void)clientInitConfig:(HttpRequestHelperCompletion)complection; -// -+ (void)clientConfig:(HttpRequestHelperCompletion)completion; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMTabbar/Api/Api+Main.m.backup b/YuMi/Modules/YMTabbar/Api/Api+Main.m.backup deleted file mode 100644 index ba60b01..0000000 --- a/YuMi/Modules/YMTabbar/Api/Api+Main.m.backup +++ /dev/null @@ -1,32 +0,0 @@ -// -// Api+Main.m -// YUMI -// -// Created by zu on 2021/9/8. -// - -#import "Api+Main.h" -#import "YYUtility.h" -#import "NSString+Utils.h" -#import "NSMutableDictionary+Saft.h" -#import -@implementation Api (Main) - -+ (void)requestTicket:(HttpRequestHelperCompletion)completion access_token:(NSString *)accessToken issue_type:(NSString *)issueType { - NSString * fang = [NSString stringFromBase64String:@"b2F1dGgvdGlja2V0"];///oauth/ticket - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, accessToken, issueType, nil]; -} - -/// 初始化配置 -/// @param complection 完成 -+ (void)clientInitConfig:(HttpRequestHelperCompletion)complection { - NSString * fang = [NSString stringFromBase64String:@"Y2xpZW50L2luaXQ="];///client/init - [HttpRequestHelper request:fang method:HttpRequestHelperMethodGET params:@{} completion:complection]; -} - -+ (void)clientConfig:(HttpRequestHelperCompletion)completion { - [HttpRequestHelper request:@"client/config" method:HttpRequestHelperMethodGET params:@{@"NeedChangeTimeOut":@(10)} completion:completion]; -} - - -@end diff --git a/YuMi/Modules/YMWeb/MSRoomGameWebVC.h.backup b/YuMi/Modules/YMWeb/MSRoomGameWebVC.h.backup deleted file mode 100644 index 91562eb..0000000 --- a/YuMi/Modules/YMWeb/MSRoomGameWebVC.h.backup +++ /dev/null @@ -1,18 +0,0 @@ -// -// MSRoomGameWebVC.h -// YuMi -// -// Created by duoban on 2024/4/28. -// - -#import "BaseViewController.h" -#import -#import "RoomHostDelegate.h" -#import "ActivityInfoModel.h" -NS_ASSUME_NONNULL_BEGIN - -@interface MSRoomGameWebVC : BaseViewController -- (instancetype)initWithDelegate:(id)delegate gameModel:(ActivityInfoModel *)gameModel; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMWeb/MSRoomGameWebVC.m.backup b/YuMi/Modules/YMWeb/MSRoomGameWebVC.m.backup deleted file mode 100644 index 3c26a88..0000000 --- a/YuMi/Modules/YMWeb/MSRoomGameWebVC.m.backup +++ /dev/null @@ -1,649 +0,0 @@ -// -// MSRoomGameWebVC.m -// YuMi -// -// Created by duoban on 2024/4/28. -// - -#import "MSRoomGameWebVC.h" -#import "LittleGameInfoModel.h" -#import "RoomInfoModel.h" -#import "XPIAPRechargeViewController.h" - -@interface MSWeakWebViewScriptMessageDelegate : NSObject - -//WKScriptMessageHandler 这个协议类专门用来处理JavaScript调用原生OC的方法 -@property (nonatomic, weak) id scriptDelegate; - -- (instancetype)initWithDelegate:(id)scriptDelegate; - -@end -@implementation MSWeakWebViewScriptMessageDelegate - -- (instancetype)initWithDelegate:(id)scriptDelegate { - self = [super init]; - if (self) { - _scriptDelegate = scriptDelegate; - } - return self; -} - -//遵循WKScriptMessageHandler协议,必须实现如下方法,然后把方法向外传递 -//通过接收JS传出消息的name进行捕捉的回调方法 -- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message { - - if ([self.scriptDelegate respondsToSelector:@selector(userContentController:didReceiveScriptMessage:)]) { - [self.scriptDelegate userContentController:userContentController didReceiveScriptMessage:message]; - } -} - -@end - - -typedef NS_ENUM(NSInteger, MSGameType) { - MSGameTypeBaiShun, // 百顺游戏 - MSGameTypeJoyPlay, // JoyPlay游戏 - MSGameTypeCC // CC游戏 -}; - -NSString * const kMSGetConfig = @"getConfig"; -NSString * const kMSDestroy = @"destroy"; -NSString * const kMSGameRecharge = @"gameRecharge"; -NSString * const kMSGameLoaded = @"gameLoaded"; - -NSString * const kJPRecharge = @"recharge"; -NSString * const kJPClickRecharge = @"clickRecharge"; -NSString * const kJPClose = @"newTppClose"; - - - -@interface MSRoomGameWebVC () -@property (strong, nonatomic) WKWebView *webView; -@property (strong, nonatomic) UIProgressView *progressView; -@property (nonatomic, strong) WKUserContentController *ms_userContentController; -@property (nonatomic,weak) id hostDelegate; -@property(nonatomic,strong) ActivityInfoModel *gameModel; -@property(nonatomic,strong) UIButton *backBtn; -@property (nonatomic, assign) MSGameType gameType; -@property (nonatomic, assign) BOOL isCharing; -@property (nonatomic, strong) NSURLRequest *lastRequest; -@property (nonatomic, assign) NSInteger retryCount; -@property (nonatomic, strong) NSTimer *loadingTimer; -@end - -@implementation MSRoomGameWebVC - -- (void)dealloc { - [self cleanupWebView]; - [self hideHUD]; - [self.loadingTimer invalidate]; - self.loadingTimer = nil; - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -- (void)cleanupWebView { - if (_webView) { - [_webView stopLoading]; - _webView.navigationDelegate = nil; - _webView.UIDelegate = nil; - [_webView removeFromSuperview]; - _webView = nil; - } - - if (_ms_userContentController) { - [_ms_userContentController removeScriptMessageHandlerForName:kMSGetConfig]; - [_ms_userContentController removeScriptMessageHandlerForName:kMSDestroy]; - [_ms_userContentController removeScriptMessageHandlerForName:kMSGameRecharge]; - [_ms_userContentController removeScriptMessageHandlerForName:kMSGameLoaded]; - [_ms_userContentController removeScriptMessageHandlerForName:@"closeGame"]; - [_ms_userContentController removeScriptMessageHandlerForName:@"pay"]; - [_ms_userContentController removeScriptMessageHandlerForName:kJPClose]; - [_ms_userContentController removeScriptMessageHandlerForName:kJPRecharge]; - [_ms_userContentController removeScriptMessageHandlerForName:kJPClickRecharge]; - _ms_userContentController = nil; - } -} - -- (instancetype)initWithDelegate:(id)delegate gameModel:(ActivityInfoModel *)gameModel -{ - self = [super init]; - if (self) { - self.hostDelegate = delegate; - self.gameModel = gameModel; - NSString *upperCode = gameModel.code.uppercaseString; - if ([upperCode isEqualToString:@"BAISHUN"]) { - self.gameType = MSGameTypeBaiShun; - } else if ([upperCode isEqualToString:@"JOYPLAY"]) { - self.gameType = MSGameTypeJoyPlay; - } else { - self.gameType = MSGameTypeCC; - } - } - return self; -} -- (BOOL)isHiddenNavBar { - return YES; -} -- (void)viewDidLoad { - [super viewDidLoad]; - [self installUI]; - [self setupBackButton]; -#if DEBUG -// [self setupLoadingTimer]; -#endif - [self setupNotifications]; - [self showLoading]; -} - -- (void)setupLoadingTimer { - self.loadingTimer = [NSTimer scheduledTimerWithTimeInterval:15.0 - target:self - selector:@selector(handleLoadingTimeout) - userInfo:nil - repeats:NO]; -} - -- (void)setupNotifications { - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(handleApplicationDidBecomeActive) - name:UIApplicationDidBecomeActiveNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(handleApplicationWillResignActive) - name:UIApplicationWillResignActiveNotification - object:nil]; -} - -- (void)handleLoadingTimeout { - [self hideHUD]; - [XNDJTDDLoadingTool showErrorWithMessage:@"加载超时,请检查网络后重试"]; -} - -- (void)handleApplicationDidBecomeActive { - if (self.webView && !self.webView.isLoading) { - [self.webView reload]; - } -} - -- (void)handleApplicationWillResignActive { - [self.webView evaluateJavaScript:@"if(typeof(onAppPause) === 'function') { onAppPause(); }" completionHandler:nil]; -} - - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - if (self.gameType != MSGameTypeBaiShun && - self.isCharing) { - self.isCharing = NO; - [self updateCoin]; - } -} - -- (void)setupBackButton { - if (self.gameType == MSGameTypeJoyPlay && self.gameModel.showType == ActivityShowType_Full) { - return; - } - self.backBtn = [UIButton new]; - [self.view addSubview:self.backBtn]; - self.backBtn.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight); - [self.backBtn addTarget:self action:@selector(backBtnAction) forControlEvents:UIControlEventTouchUpInside]; -} - -- (void)installUI { - self.view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.4]; - [self setupWebViewConfiguration]; - [self setupWebViewConfiguration]; - [self loadGameContent]; -} - -- (void)setupWebViewConfiguration { - MSWeakWebViewScriptMessageDelegate *weakScriptMessageDelegate = [[MSWeakWebViewScriptMessageDelegate alloc] initWithDelegate:self]; - _ms_userContentController = [[WKUserContentController alloc] init]; - [_ms_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kMSGetConfig]; - [_ms_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kMSDestroy]; - [_ms_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kMSGameRecharge]; - [_ms_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kMSGameLoaded]; - - /// LEADERCC - [_ms_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:@"closeGame"]; - [_ms_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:@"pay"]; - - /// JOYPLAY - [_ms_userContentController addScriptMessageHandler:weakScriptMessageDelegate - name:kJPClose]; - [_ms_userContentController addScriptMessageHandler:weakScriptMessageDelegate - name:kJPRecharge]; - [_ms_userContentController addScriptMessageHandler:weakScriptMessageDelegate - name:kJPClickRecharge]; - - - WKWebViewConfiguration *config = [WKWebViewConfiguration new]; - config.allowsInlineMediaPlayback = YES; - config.mediaTypesRequiringUserActionForPlayback = NO; - [config setValue:@YES forKey:@"allowUniversalAccessFromFileURLs"]; - //⾳视频的播放不需要⽤⼾⼿势触发, 即为⾃动播放 - config.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeNone; - config.preferences = [[WKPreferences alloc]init]; - WKPreferences *preferences = [WKPreferences new]; - preferences.javaScriptCanOpenWindowsAutomatically = YES; - config.preferences = preferences; - config.preferences.javaScriptEnabled = YES; - config.userContentController = _ms_userContentController; - - CGRect frame = CGRectZero; - if (self.gameType == MSGameTypeBaiShun) { - frame = CGRectMake(0,0, - KScreenWidth, KScreenHeight); - } else { - if(self.gameModel.showType == ActivityShowType_Half){ - frame = CGRectMake(0, KScreenHeight * 0.3, - KScreenWidth, KScreenHeight * 0.7); - } else { - frame = CGRectMake(0,0, - KScreenWidth, KScreenHeight); - } - } - - self.webView = [[WKWebView alloc] initWithFrame:frame - configuration:config]; - [self.webView.scrollView setBackgroundColor:[UIColor clearColor]]; - [self.webView setBackgroundColor:[UIColor clearColor]]; - [self.webView setUIDelegate:self]; - self.webView.navigationDelegate = self; - //设置⽹⻚透明 - [self.webView setOpaque:NO]; - //设置⽹⻚全屏 - if (@available(iOS 11.0, *)) { - self.webView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; - } - [self.view addSubview:self.webView]; -} - -- (void)loadGameContent { - NSString *h5Url = self.gameModel.skipContent; - NSURL *url = [self handleGameURL:h5Url]; - - if (!url) { - [self hideHUD]; - [XNDJTDDLoadingTool showErrorWithMessage:@"游戏链接无效"]; - return; - } - - NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url - cachePolicy:NSURLRequestUseProtocolCachePolicy - timeoutInterval:15.0]; - self.lastRequest = request; - [self.webView loadRequest:request]; -} - -- (BOOL)isValidGameURL:(NSString *)urlString { - if ([NSString isEmpty:urlString]) { - return NO; - } - - NSURL *url = [NSURL URLWithString:urlString]; - return (url && url.scheme && url.host); -} - -- (NSURL *)handleGameURL:(NSString *)url { - if (![self isValidGameURL:url]) { - return nil; - } - - switch (self.gameType) { - case MSGameTypeBaiShun: - url = [self addSupportLanguage:url]; - return [NSURL URLWithString:url]; - case MSGameTypeJoyPlay: - url = [url stringByAppendingFormat:@"?gameId=%@", @(self.gameModel.gameModel.gameId)]; - url = [url stringByAppendingFormat:@"&appKey=%@", - self.gameModel.gameModel.appKey]; - url = [url stringByAppendingFormat:@"&mini=%@", @(self.gameModel.showType == ActivityShowType_Half ? 1 : 0)]; - if (self.gameModel.showType == ActivityShowType_Full) { - url = [url stringByAppendingFormat:@"&safeTop=1"]; - } - url = [url stringByAppendingFormat:@"&roomId=%ld", - (long)self.hostDelegate.getRoomInfo.uid]; - break; - case MSGameTypeCC: - url = [url stringByAppendingFormat:@"&roomid=%ld", - (long)self.hostDelegate.getRoomInfo.uid]; - break; - default: - break; - } - - url = [self addSupportLanguage:url]; - - if (![NSString isEmpty:self.gameModel.gameModel.urlParam]) { - url = [url stringByAppendingString:[NSString stringWithFormat:@"&%@", self.gameModel.gameModel.urlParam]]; - } - - url = [url stringByAppendingFormat:@"&token=%@", self.gameModel.gameModel.code]; - url = [url stringByAppendingFormat:@"&uid=%@", [AccountInfoStorage instance].getUid]; - - return [NSURL URLWithString:url]; -} - -- (NSString *)addSupportLanguage:(NSString *)url { - NSString *mark = @"&"; - NSString *lang = @"en-US"; - if (![url containsString:@"?"]) { - mark = @"?"; - } - if (isMSTR()) { - lang = @"tr-TR"; - } else if (isMSZH()) { - lang = @"zh-TW"; - } else if (isMSRTL()) { - lang = @"ar-EG"; - } else if (isMSPT()) { - lang = @"pt-BR"; - } else if (isMSES()) { - lang = @"es-ES"; - } - url = [url stringByAppendingFormat:@"%@lang=%@", mark, lang]; - return url; -} - -- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation { - [self hideHUD]; - self.retryCount = 0; - [self.loadingTimer invalidate]; - self.loadingTimer = nil; - - if (self.gameType != MSGameTypeBaiShun) { - self.backBtn.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight*0.3); - } - - // 注入错误处理脚本 - NSString *errorHandler = @"window.onerror = function(msg, url, line, col, error) { window.webkit.messageHandlers.error.postMessage({message: msg, url: url, line: line, col: col}); return false; }"; - [webView evaluateJavaScript:errorHandler completionHandler:nil]; - -#if DEBUG - NSString *fileName = @"vconsole.min.js"; // 你要查找的文件名 - NSString *directory = [[NSBundle mainBundle] resourcePath]; - - NSFileManager *fileManager = [NSFileManager defaultManager]; - NSDirectoryEnumerator *enumerator = [fileManager enumeratorAtPath:directory]; - NSString *filePath; - - for (NSString *path in enumerator) { - if ([[path lastPathComponent] containsString:fileName]) { - filePath = [directory stringByAppendingPathComponent:path]; - break; - } - } - - if (filePath.length > 0) { - NSString *vConsoleScript = [NSString stringWithContentsOfFile:filePath - encoding:NSUTF8StringEncoding error:nil]; - [self.webView evaluateJavaScript:vConsoleScript completionHandler:nil]; - - // 初始化 vConsole - NSString *initVConsoleScript = @"var vConsole = new VConsole();"; - [self.webView evaluateJavaScript:initVConsoleScript completionHandler:nil]; - } -#endif -} - -- (void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error { - [self handleWebViewError:error]; -} - -- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error { - [self handleWebViewError:error]; -} - -- (void)handleWebViewError:(NSError *)error { - if (self.retryCount < 3) { - self.retryCount++; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [self.webView loadRequest:self.lastRequest]; - }); - } else { - [self hideHUD]; - [XNDJTDDLoadingTool showErrorWithMessage:@"网络连接失败,请稍后重试"]; - - } -} - -- (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler { - if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { - NSURLCredential *card = [[NSURLCredential alloc] initWithTrust:challenge.protectionSpace.serverTrust]; - completionHandler(NSURLSessionAuthChallengeUseCredential, card); - } else { - completionHandler(NSURLSessionAuthChallengeRejectProtectionSpace, nil); - } -} - -// 调⽤JS -- (void)callJs:(NSString*)method withJavaScriptValue:(nullable id)arguments -{ - @kWeakify(self); - if (arguments) { - NSData *data = [NSJSONSerialization dataWithJSONObject:arguments - options:(NSJSONWritingPrettyPrinted) error:nil]; - NSString *jsonStr = [[NSString alloc] initWithData:data - encoding:NSUTF8StringEncoding]; - NSString *jsMethods = [NSString stringWithFormat:@"%@(%@)", method, - jsonStr]; - [self.webView evaluateJavaScript:jsMethods completionHandler:^(id - _Nullable resp, NSError * _Nullable error) { - @kStrongify(self); - NSLog(@"error = %@ , response = %@",error, resp); - [self.backBtn removeFromSuperview]; - }]; - } else { - NSString *jsMethods = [NSString stringWithFormat:@"%@({})", method]; - [self.webView evaluateJavaScript:jsMethods completionHandler:^(id - _Nullable resp, NSError * _Nullable error) { - @kStrongify(self); - NSLog(@"error = %@ , response = %@",error, resp); - [self.backBtn removeFromSuperview]; - }]; - } -} -- (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString -{ - if (jsonString == nil && jsonString.length == 0) { - return nil; - } - - NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding]; - NSError *err; - NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData - options:NSJSONReadingMutableContainers - error:&err]; - if(err) - { - NSLog(@"json解析失败:%@",err); - return nil; - } - return dic; -} -// 绑定协议⽅法 -- (void)userContentController:(WKUserContentController *)userContentController - didReceiveScriptMessage:(WKScriptMessage *)message -{ - /// BaiShun - switch (self.gameType) { - case MSGameTypeBaiShun: { - NSDictionary *dicBody = [self dictionaryWithJsonString:message.body]; - if ([message.name isEqualToString:kMSGetConfig]) { - [self getConfig:dicBody]; - } else if ([message.name isEqualToString:kMSDestroy]) { - [self destroy:dicBody]; - } else if ([message.name isEqualToString:kMSGameLoaded]) { - [self gameLoaded:dicBody]; - } else if ([message.name isEqualToString:kMSGameRecharge]) { - [self gameRecharge:dicBody]; - } else { - NSLog(@"未实现⽅法 : %@ --> %@", message.name, message.body); - } - break; - } - case MSGameTypeJoyPlay: { - if ([message.name isEqualToString:kJPRecharge]) { - XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init]; - webVC.type = @"4"; - [self.navigationController pushViewController:webVC animated:YES]; - self.isCharing = YES; - } else if ([message.name isEqualToString:kJPClickRecharge]) { - [self gameRecharge:@{}]; - } else if ([message.name isEqualToString:kJPClose]) { - [self backBtnAction]; - } - break; - } - case MSGameTypeCC: { - /// LeaderCC - NSString* method = [NSString stringWithFormat:@"%@:", message.name]; - SEL selector = NSSelectorFromString(method); - if([self respondsToSelector:selector]){ - [self performSelector:selector withObject:message.body]; - }else{ - NSLog(@"未實現方法 : %@ --> %@", message.name, message.body); - } - break; - } - } -} - -#pragma mark - LeaderCC Delegate -// 关闭游戏 -- (void)closeGame:(NSDictionary*)args { - [self backBtnAction]; -} - -// 显示充值界面 -- (void)pay:(NSDictionary*)args { - //拉起充值商城 - TTAlertConfig *config = [[TTAlertConfig alloc]init]; - config.title = YMLocalizedString(@"UserDetail_CP_Toast_0"); - config.message = YMLocalizedString(@"XPNobleCenterViewController3"); - config.actionStyle = TTAlertActionBothStyle; - @kWeakify(self); - [TTPopup alertWithConfig:config showBorder:NO confirmHandler:^{ - @kStrongify(self); - XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init]; - webVC.type = @"4"; - [self.navigationController pushViewController:webVC animated:YES]; - self.isCharing = YES; - } cancelHandler:^{ - - }]; -} - -- (void)updateCoin { - // 平时游戏币更新不需要调用该方法,以防止影响游戏开奖动画。 - [self.webView evaluateJavaScript:@"updateCoin()" completionHandler:^(id _Nullable result, NSError * _Nullable error) { - if (error) { - NSLog(@"Error calling JS function: %@", error.localizedDescription); - } else { - NSLog(@"JS function called successfully, result: %@", result); - } - }]; -} - -#pragma mark - BaiShun Delegate -// 获取信息配置 -- (void) getConfig:(NSDictionary*)args -{ - NSLog(@"BSGAME %s","游戏调⽤getConfig"); - NSString* method = [args objectForKey:@"jsCallback"]; - RoomInfoModel *roomInfo = self.hostDelegate.getRoomInfo; - ActivityInfoItemModel *gameModel = self.gameModel.gameModel; - NSString *appChannel = gameModel.appChannel ?: @""; - int64_t appId = gameModel.appId; - NSString *userId = [AccountInfoStorage instance].getUid; - NSString *code = gameModel.code ?: @""; - NSString *roomId = [NSString stringWithFormat:@"%ld",roomInfo.uid]; - NSString *gameMode = gameModel.gameMode ?: @""; - NSDictionary *gameConfig = gameModel.gameConfig ?: @{}; - int gsp = gameModel.gsp; - // 数据只是参考值,需要根据⾃⼰APP进⾏赋值 - NSObject* configData = @{ - @"appChannel":appChannel, - @"appId":@(appId), - @"userId":userId, - @"code":code, - @"roomId":roomId, - @"gameMode":gameMode, - @"language":[self getlanguage], - @"gameConfig":gameConfig, - @"gsp":@(gsp), - }; - [self callJs:method withJavaScriptValue:configData]; -} --(NSString *)getlanguage{ - NSString *language = [NSBundle getLanguageText]; - if ([language hasPrefix:@"zh"]) { - if ([language rangeOfString:@"Hans"].location != NSNotFound) { - language = @"0"; // 简体中文 - } else { - language = @"1"; // 繁體中文 - } - }else if([language hasPrefix:@"ar"]){///阿拉伯语 - language = @"7"; - }else{///英文 - language = @"2"; - } - return language; -} -// 销毁游戏 -- (void) destroy:(NSDictionary*)args -{ - NSLog(@"BSGAME %s","游戏调⽤destroy"); - //关闭游戏 - [self willMoveToParentViewController:nil]; //1 - [self.view removeFromSuperview]; //2 - [self removeFromParentViewController]; //3 -} --(void)backBtnAction{ - TTAlertConfig *config = [[TTAlertConfig alloc]init]; - config.title = YMLocalizedString(@"UserDetail_CP_Toast_0"); - config.message = YMLocalizedString(@"MSRoomGameWebVC0"); - config.actionStyle = TTAlertActionBothStyle; - @kWeakify(self); - [TTPopup alertWithConfig:config showBorder:NO confirmHandler:^{ - @kStrongify(self); - [self destroy:nil]; - } cancelHandler:^{ - }]; -} -// 提⽰余额不⾜ -- (void) gameRecharge:(NSDictionary*)args -{ - NSLog(@"BSGAME %s","游戏调⽤gameRecharge"); - //拉起充值商城 - TTAlertConfig *config = [[TTAlertConfig alloc]init]; - config.title = YMLocalizedString(@"UserDetail_CP_Toast_0"); - config.message = YMLocalizedString(@"XPNobleCenterViewController3"); - config.actionStyle = TTAlertActionBothStyle; - @kWeakify(self); - [TTPopup alertWithConfig:config showBorder:NO confirmHandler:^{ - @kStrongify(self); - XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init]; - webVC.type = @"4"; - [self.navigationController pushViewController:webVC animated:YES]; - self.isCharing = YES; - } cancelHandler:^{ - - }]; -} -// 游戏加载完毕 -- (void) gameLoaded:(NSDictionary*)args -{ - // 游戏加载完毕 - [self.backBtn removeFromSuperview]; -} - -@end - - - - - - diff --git a/YuMi/Modules/YMWeb/PIWebViewSavePhotoView.h.backup b/YuMi/Modules/YMWeb/PIWebViewSavePhotoView.h.backup deleted file mode 100644 index 95b1aa7..0000000 --- a/YuMi/Modules/YMWeb/PIWebViewSavePhotoView.h.backup +++ /dev/null @@ -1,18 +0,0 @@ -// -// PIWebViewSavePhotoView.h -// YuMi -// -// Created by duoban on 2024/3/14. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface PIWebViewSavePhotoView : UIView -@property(nonatomic,copy) NSString *text; -@property(nonatomic,copy) UIImage *image; -@property(nonatomic,copy) NSString *code; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMWeb/PIWebViewSavePhotoView.m.backup b/YuMi/Modules/YMWeb/PIWebViewSavePhotoView.m.backup deleted file mode 100644 index 6f83574..0000000 --- a/YuMi/Modules/YMWeb/PIWebViewSavePhotoView.m.backup +++ /dev/null @@ -1,180 +0,0 @@ -// -// PIWebViewSavePhotoView.m -// YuMi -// -// Created by duoban on 2024/3/14. -// - -#import "PIWebViewSavePhotoView.h" -@interface PIWebViewSavePhotoView() -@property(nonatomic,strong) UIImageView *topView; -@property(nonatomic,strong) UIImageView *bottomView; -@property(nonatomic,strong) UIImageView *topTextImageView; -@property(nonatomic,strong) UIView *bgCodeView; -@property(nonatomic,strong) UIImageView *bgCodeText; -@property(nonatomic,strong) UILabel *codeText; -@property(nonatomic,strong) NetImageView *codeView; -@property(nonatomic,strong) UILabel *tipView; -@property(nonatomic,strong) UIButton *codeBtn; -@end -@implementation PIWebViewSavePhotoView - --(instancetype)initWithFrame:(CGRect)frame{ - self = [super initWithFrame:frame]; - if(self){ - [self installUI]; - [self installConstraints]; - } - return self; -} --(void)installUI{ - [self addSubview:self.topView]; - [self addSubview:self.bottomView]; - [self addSubview:self.topTextImageView]; - [self addSubview:self.bgCodeView]; - [self.bgCodeView addSubview:self.bgCodeText]; - [self.bgCodeText addSubview:self.codeText]; - - [self.bgCodeView addSubview:self.codeView]; - [self.bgCodeView addSubview:self.tipView]; - - [self.bgCodeView addSubview:self.codeBtn]; - - -} --(void)installConstraints{ - [self.topView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.leading.trailing.mas_equalTo(0); - make.height.mas_equalTo(kGetScaleWidth(326)); - }]; - [self.bottomView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.equalTo(self); - make.top.mas_equalTo(kGetScaleWidth(303)); - make.height.mas_equalTo(kGetScaleWidth(509)); - }]; - [self.topTextImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(kGetScaleWidth(132)); - make.width.mas_equalTo(kGetScaleWidth(297)); - make.height.mas_equalTo(kGetScaleWidth(32.5)); - make.centerX.equalTo(self); - }]; - [self.bgCodeView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(kGetScaleWidth(345)); - make.height.mas_equalTo(kGetScaleWidth(431)); - make.top.equalTo(self.topTextImageView.mas_bottom).mas_offset(kGetScaleWidth(186.5)); - make.centerX.equalTo(self); - }]; - [self.bgCodeText mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.centerX.equalTo(self.bgCodeView); - make.width.mas_equalTo(kGetScaleWidth(290)); - make.height.mas_equalTo(kGetScaleWidth(43)); - }]; - [self.codeText mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(kGetScaleWidth(3)); - make.bottom.mas_equalTo(-kGetScaleWidth(3)); - make.leading.trailing.equalTo(self.bgCodeText).inset(kGetScaleWidth(10)); - }]; - [self.codeView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.height.mas_equalTo(kGetScaleWidth(200)); - make.centerX.equalTo(self.bgCodeView); - make.top.mas_equalTo(kGetScaleWidth(96)); - }]; - [self.tipView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(kGetScaleWidth(321)); - make.height.mas_equalTo(kGetScaleWidth(14)); - make.centerX.equalTo(self.bgCodeView); - }]; - [self.codeBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(kGetScaleWidth(355)); - make.width.mas_equalTo(kGetScaleWidth(241)); - make.height.mas_equalTo(kGetScaleWidth(46)); - make.centerX.equalTo(self.bgCodeView); - }]; -} --(void)setText:(NSString *)text{ - _text = text; - _codeText.text = text; - -} --(void)setImage:(UIImage *)image{ - _image = image; - _codeView.image = _image; -} - -- (void)setCode:(NSString *)code{ - _code = code; - NSString *text = [NSString stringWithFormat:@"%@%@",YMLocalizedString(@"PIWebViewSavePhotoView1"),_code]; - [_codeBtn setTitle:text forState:UIControlStateNormal]; -} -#pragma mark - 懒加载 -- (UIImageView *)topView{ - if(!_topView){ - _topView = [UIImageView new]; - _topView.image = kImage(@"pi_webView_code_top"); - } - return _topView; -} - -- (UIImageView *)bottomView{ - if(!_bottomView){ - _bottomView = [UIImageView new]; - _bottomView.image = kImage(@"pi_webView_code_bottom"); - } - return _bottomView; -} -- (UIImageView *)topTextImageView{ - if(!_topTextImageView){ - _topTextImageView = [UIImageView new]; - _topTextImageView.image = [UIImage getLanguageImage:@"pi_webView_code_top_text"]; - } - return _topTextImageView; -} -- (UIImageView *)bgCodeText{ - if(!_bgCodeText){ - _bgCodeText = [UIImageView new]; - _bgCodeText.image = kImage(@"pi_webView_code_code_text"); - } - return _bgCodeText; -} -- (UIView *)bgCodeView{ - if(!_bgCodeView){ - _bgCodeView = [UIView new]; - _bgCodeView.layer.cornerRadius = kGetScaleWidth(20); - _bgCodeView.layer.masksToBounds = YES; - _bgCodeView.backgroundColor = [UIColor whiteColor]; - } - return _bgCodeView; -} -- (UILabel *)codeText{ - if(!_codeText){ - _codeText = [UILabel labelInitWithText:@"" font:kFontRegular(12) textColor:[UIColor whiteColor]]; - _codeText.textAlignment = NSTextAlignmentCenter; - _codeText.numberOfLines = 0; - } - return _codeText; -} - -- (UILabel *)tipView{ - if(!_tipView){ - _tipView = [UILabel labelInitWithText:YMLocalizedString(@"PIWebViewSavePhotoView0") font:kFontRegular(10) textColor:UIColorFromRGB(0x999999)]; - } - return _tipView; -} -- (UIButton *)codeBtn{ - if(!_codeBtn){ - _codeBtn = [UIButton new]; - NSString *text = [NSString stringWithFormat:@"%@GHT32",YMLocalizedString(@"PIWebViewSavePhotoView1")]; - [_codeBtn setTitle:text forState:UIControlStateNormal]; - _codeBtn.titleLabel.font = kFontRegular(16); - [_codeBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - [_codeBtn setBackgroundImage:kImage(@"pi_webView_code_btn_bg") forState:UIControlStateNormal]; - } - return _codeBtn; -} -- (NetImageView *)codeView{ - if(!_codeView){ - _codeView = [NetImageView new]; - } - return _codeView; -} -@end diff --git a/YuMi/Modules/YMWeb/XPWebViewController.h.backup b/YuMi/Modules/YMWeb/XPWebViewController.h.backup deleted file mode 100644 index eda8983..0000000 --- a/YuMi/Modules/YMWeb/XPWebViewController.h.backup +++ /dev/null @@ -1,60 +0,0 @@ -// -// XPWebViewController.h -// YuMi -// -// Created by z on 2021/9/16. -// - -#import "BaseViewController.h" -#import - -NS_ASSUME_NONNULL_BEGIN - -@protocol XPWebViewControllerDelegate - --(void)payHandler; - -@end - - -@interface XPWebViewController : BaseViewController -/// -@property (nonatomic,weak) id delegate; -@property (strong, nonatomic) WKWebView *webview; -///跳转方式,如果push的直接pushViewController,不用dismissViewControllerAnimated后再pushViewController -@property (nonatomic,assign) BOOL isPush; - -///是否从精灵页面过来 -@property (nonatomic,assign) BOOL isFairyPay; -@property (nonatomic,assign) BOOL is_Pi_FairyPay; - -///XPWebViewController是否作为属性,yes则 -@property (nonatomic,assign) BOOL isProperty; -@property (copy, nonatomic) NSString *url; - -@property(nonatomic, assign) BOOL isLoginStatus; - -/// URL加载完成回调,result:加载结果成功/失败,error:失败原因 -@property (nonatomic, copy) void (^urlLoadCompleted)(BOOL result, NSError * _Nullable error); -///是都隐藏导航栏 目前适用于半屏的情况下 -@property (nonatomic,copy) void (^InitShowNavBlock)(BOOL show); -///关闭webView 目前适用于半屏的情况下 -@property (nonatomic,copy) void (^CloseWebViewBlock)(BOOL result); - -@property(nonatomic, copy) void (^verifyCaptcha)(BOOL result); - -@property (nonatomic, copy) void(^didTapCharge)(void); - -- (instancetype)initWithCustomizeNav:(BOOL)isCustom; - -///强制使用 roomUID 初始化,尽量传入,防止 web 在需要时取不到数据 -// 更好的做法是,全具保持一个 roomUID 记录 -@property (nonatomic,copy) NSString *roomUid; -- (instancetype)initWithRoomUID:(NSString * _Nullable)roomUid; -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)new NS_UNAVAILABLE; - - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMWeb/XPWebViewController.m.backup b/YuMi/Modules/YMWeb/XPWebViewController.m.backup deleted file mode 100644 index a708a43..0000000 --- a/YuMi/Modules/YMWeb/XPWebViewController.m.backup +++ /dev/null @@ -1,1032 +0,0 @@ -// -// XPWebViewController.m -// YuMi -// -// Created by zu on 2021/9/16. -// - -#import "XPWebViewController.h" -#import "AccountInfoStorage.h" -#import "DJDKMIMOMColor.h" -#import "YUMIMacroUitls.h" -#import "YYUtility.h" -#import "HttpRequestHelper.h" -#import "XPShareView.h" -#import "TTPopup.h" -#import -#import -#import "XCCurrentVCStackManager.h" -#import "XPMineUserInfoViewController.h" -#import "ShareHelder.h" -#import "Api+Mine.h" -#import "YuMi-swift.h" -#import "RechargeStorage.h" - -///vc -#import "MyDressingViewController.h" -#import "ShoppingMallViewController.h" -#import "XPRoomViewController.h" -#import "RoomHostDelegate.h" -#import "WalletInfoModel.h" -#import "Api+Mine.h" -#import "XPSkillCardPlayerManager.h" -#import "XPWebViewNavView.h" -#import "XPIAPRechargeViewController.h" -#import "SessionViewController.h" -#import "XPMomentTopicContainerViewController.h" -#import "XPIncomeRecordVC.h" - -#import "PIWebViewSavePhotoView.h" -#import "IAPManager.h" - -typedef NS_ENUM(NSUInteger, RightNavigationPushType){ - ///跳转h5页面 - RightNavigationPushType_Web = 1, - ///分享 - RightNavigationPushType_Share = 2, - ///跳转原生页面 - RightNavigationPushType_AppPage = 3, - ///分享图片 - RightNavigationPushType_SharePicture = 5 -}; - -@interface WeakWebViewScriptMessageDelegate : NSObject - -//WKScriptMessageHandler 这个协议类专门用来处理JavaScript调用原生OC的方法 -@property (nonatomic, weak) id scriptDelegate; - -- (instancetype)initWithDelegate:(id)scriptDelegate; - -@end -@implementation WeakWebViewScriptMessageDelegate - -- (instancetype)initWithDelegate:(id)scriptDelegate { - self = [super init]; - if (self) { - _scriptDelegate = scriptDelegate; - } - return self; -} - -//遵循WKScriptMessageHandler协议,必须实现如下方法,然后把方法向外传递 -//通过接收JS传出消息的name进行捕捉的回调方法 -- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message { - - if ([self.scriptDelegate respondsToSelector:@selector(userContentController:didReceiveScriptMessage:)]) { - [self.scriptDelegate userContentController:userContentController didReceiveScriptMessage:message]; - } -} - -@end - -@interface XPWebViewController () -@property (nonatomic,strong) WalletInfoModel *model ; -//@property (strong, nonatomic) WKWebView *webview; -@property (strong, nonatomic) UIProgressView *progressView; -@property (nonatomic, strong) WKUserContentController *pi_userContentController; -///分享的内容 -@property (nonatomic,copy) NSDictionary *shareDic; -///分享的内容 -@property (nonatomic,copy) NSDictionary *savePhotoDic; - -/// -@property (nonatomic,strong) XPWebViewNavView *navView; -/// -@property (nonatomic,assign) BOOL isCustom; -@property(nonatomic,strong) PIWebViewSavePhotoView *saveView; - -/// 订单编号 -@property (nonatomic,copy) NSString *orderId; - -@property (nonatomic, assign) BOOL isHideNavBar; - -@end - -NSString * const kJSOpenPurse = @"openPurse"; -NSString * const kJSOpenChargePage = @"openChargePage"; -NSString * const kJSChargePayPage = @"chargePayPage"; -NSString * const kJSChargePayClickPage = @"chargePayClickPage"; -NSString * const kJSOpenSharePage = @"openSharePage"; -NSString * const kJSGetUid = @"getUid"; -NSString * const kJSGetDeviceId = @"getDeviceId"; -NSString * const kJSGetTicket = @"getTicket"; -NSString * const kJSGetDeviceInfo = @"getDeviceInfo"; -NSString * const kJSOpenFaceLiveness = @"openFaceLiveness"; -NSString * const kJSInitNav = @"initNav"; -NSString * const kJSGetRoomUid = @"getRoomUid"; -NSString * const kOpenPersonPage = @"openPersonPage"; -NSString * const kInitShowNav = @"initShowNav"; -NSString * const kCloseWebView = @"closeWebView"; -NSString * const kJumpAppointPage = @"jumpAppointPage"; -NSString * const kJSOpenRoom = @"openRoom"; -NSString * const kJSOpenRoomForGiftId = @"openRoomForGiftId"; -NSString * const kJSOpenChatPage = @"geToChatPage"; -NSString * const kJSOpenAppConcernedChat = @"openAppConcernedChat"; -NSString * const kJSSavePictureShare = @"savePictureShare"; -NSString * const kJSGoToExchangeGold = @"goToExchangeGold"; -NSString * const kJSOpenPayment = @"openPayment"; -NSString * const kJSOpenPaymentCallback = @"openPaymentCallback"; -NSString * const kJSVerifyCaptchaCallBack = @"closeToVerify"; -NSString * const kJSShowShareCallBack = @"showShareAction"; - - -@implementation XPWebViewController - -- (instancetype)initWithCustomizeNav:(BOOL)isCustom -{ - self = [super init]; - if (self) { - self.isCustom = isCustom; - } - return self; -} - -- (instancetype)initWithRoomUID:(NSString * _Nullable)roomUid { - self = [super init]; - if (self) { - self.roomUid = roomUid; - self.isLoginStatus = YES; - } - return self; -} - --(void)viewWillAppear:(BOOL)animated{ - [super viewWillAppear:animated]; - - if([XPSkillCardPlayerManager shareInstance].isInRoom == YES && self.isProperty == NO && [XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge == NO){ - [XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge = YES; - } - - if (self.isHideNavBar) { - if (self.navigationController) { - [self.navigationController setNavigationBarHidden:YES]; - } - } -} - -- (void)viewDidLoad { - [super viewDidLoad]; - [self.view addSubview:self.saveView]; - self.saveView.hidden = YES; - [self initView]; -} - -- (void)saveImageToPhotoAlbum:(NSDictionary *)data{ - if (data.allKeys.count == 0){ - [self showSuccessToast:YMLocalizedString(@"PIWebViewSavePhotoView3")]; - return; - } - - NSString *qrCodeUrl = data[@"qrCodeUrl"]; - if (qrCodeUrl.length == 0){ - [self showSuccessToast:YMLocalizedString(@"PIWebViewSavePhotoView3")]; - return; - } - [self showLoading]; - NetImageView *imageView = [NetImageView new]; - @kWeakify(self); - [imageView loadImageWithUrl:qrCodeUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { - @kStrongify(self); - [self hideHUD]; - if (image != nil){ - self.saveView.hidden = NO; - NSString *text = data[@"text"]; - NSString *invitationCode = data[@"invitationCode"]; - self.saveView.text = text; - self.saveView.image = image; - self.saveView.code = invitationCode; - UIImage *saveImage = [UIImage getImageFromView:self.saveView]; - UIImageWriteToSavedPhotosAlbum(saveImage, self, @selector(image:didFinishSavingWithError:contextInfo:), NULL); - return; - } - [self showSuccessToast:YMLocalizedString(@"PIWebViewSavePhotoView3")]; - }]; -} - -//指定回调方法 -- (void)image: (UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo{ - self.saveView.hidden = YES; - NSString *msg = YMLocalizedString(@"PIWebViewSavePhotoView2"); - if(error != NULL){ - msg = YMLocalizedString(@"PIWebViewSavePhotoView3"); - } - [self showSuccessToast:msg]; - - -} -- (void)initView { - if (self.navigationController.viewControllers.count > 1){ - UIBarButtonItem *leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[[UIImage imageNamed:@"common_nav_back"]ms_SetImageForRTL] style:UIBarButtonItemStylePlain target:self action:@selector(backButtonClick)]; - - leftBarButtonItem.tintColor = [DJDKMIMOMColor mainTextColor]; - - self.navigationItem.leftBarButtonItem = leftBarButtonItem; - } - - self.webview.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; - - if(self.isCustom == YES){ - [self.view addSubview:self.navView]; - [self.view addSubview:self.webview]; - [self.view addSubview:self.progressView]; - [self.navView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.top.equalTo(self.view); - make.height.mas_equalTo(kNavigationHeight); - }]; - [self.webview mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.bottom.equalTo(self.view); - make.top.equalTo(self.navView.mas_bottom); - }]; - [self.progressView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.equalTo(self.view); - make.height.mas_equalTo(1); - make.top.equalTo(self.navView.mas_bottom); - }]; - }else{ - [self.view addSubview:self.webview]; - [self.view addSubview:self.progressView]; - [self.webview mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.top.bottom.mas_equalTo(self.view); - }]; - } - - if (self.isLoginStatus) { - NSString * uid = [AccountInfoStorage instance].getUid; - NSString * ticket = [AccountInfoStorage instance].getTicket; - @kWeakify(self); - [Api getUserWalletInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { - @kStrongify(self); - if(code == 200){ - WalletInfoModel * model = [WalletInfoModel modelWithDictionary:data.data]; - self.model = model; - } - } uid:uid ticket:ticket]; - } -} -- (void)xPWebViewNavView:(XPWebViewNavView *)view didClickBack:(UIButton *)sender{ - if(self.is_Pi_FairyPay){ - [self willMoveToParentViewController:nil]; //1 - [self.view removeFromSuperview]; //2 - [self removeFromParentViewController]; //3 - return; - } - if(self.isFairyPay){ - if(self.CloseWebViewBlock){ - self.CloseWebViewBlock(YES); - } - return; - } - [self dismissViewControllerAnimated:YES completion:nil]; -} -//加载完成 -- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation { - //加载完成后隐藏progressView - self.progressView.hidden = YES; - if (self.urlLoadCompleted) { - self.urlLoadCompleted(YES, nil); - } -#if DEBUG - NSString *fileName = @"vconsole.min.js"; // 你要查找的文件名 - NSString *directory = [[NSBundle mainBundle] resourcePath]; - - NSFileManager *fileManager = [NSFileManager defaultManager]; - NSDirectoryEnumerator *enumerator = [fileManager enumeratorAtPath:directory]; - NSString *filePath; - - for (NSString *path in enumerator) { - if ([[path lastPathComponent] containsString:fileName]) { - filePath = [directory stringByAppendingPathComponent:path]; - break; - } - } - - if (filePath.length > 0) { - NSString *vConsoleScript = [NSString stringWithContentsOfFile:filePath - encoding:NSUTF8StringEncoding error:nil]; - [webView evaluateJavaScript:vConsoleScript completionHandler:nil]; - - // 初始化 vConsole - NSString *initVConsoleScript = @"var vConsole = new VConsole();"; - [webView evaluateJavaScript:initVConsoleScript completionHandler:nil]; - } -#endif -} - -#if DEBUG -- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse - decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler { - - NSHTTPURLResponse *response = (NSHTTPURLResponse *)navigationResponse.response; - NSDictionary *headers = response.allHeaderFields; - // NSLog(@"Response Headers: %@", headers); - - NSString *contentEncoding = headers[@"Content-Encoding"]; - if ([contentEncoding isEqualToString:@"gzip"]) { - // NSLog(@"✅ Gzip 响应已启用"); - } else { - // NSLog(@"❌ Gzip 响应未启用"); - } - - decisionHandler(WKNavigationResponsePolicyAllow); -} -#endif - -//加载失败 -- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error { - //加载失败同样需要隐藏progressView - self.progressView.hidden = YES; - if (self.urlLoadCompleted) { - self.urlLoadCompleted(NO, error); - } -} - -//捕抓打电话事件 -- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler { - NSURL *URL = navigationAction.request.URL; - NSString *scheme = [URL scheme]; - NSURLRequest *request = navigationAction.request; - // Judge is whether to jump to other app. - if (![scheme isEqualToString:@"https"] && ![scheme isEqualToString:@"http"]) { - BOOL canOpen = [[UIApplication sharedApplication] canOpenURL:request.URL]; - if (canOpen) { - [[UIApplication sharedApplication] openURL:request.URL options:@{} completionHandler:^(BOOL success) { - - }]; - } - decisionHandler(WKNavigationActionPolicyCancel); - return; - } - decisionHandler(WKNavigationActionPolicyAllow); -} -- (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler{ - if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { - dispatch_async(dispatch_get_global_queue(0, 0), ^{ - NSURLCredential *card = [[NSURLCredential alloc]initWithTrust:challenge.protectionSpace.serverTrust]; - completionHandler(NSURLSessionAuthChallengeUseCredential,card); - }); - } -} -- (void)userContentController:(WKUserContentController *)userContentController - didReceiveScriptMessage:(WKScriptMessage *)message { - [self.webview evaluateJavaScript:@"document.location.href" - completionHandler:^(id _Nullable response, NSError * _Nullable error) { - NSString *currentUrl = [NSString stringWithFormat:@"%@", response]; - ///测试环境只要有host就执行,方便h5连接本地调试 - BOOL condition = currentUrl != nil && [currentUrl containsString:API_HOST_URL]; - - NSLog(@"-- -- - -- - - | -- -- - -- - -%@", response); - NSLog(@"-- -- - -- - -%@: %@", message.name, message.body); -#ifdef DEBUG - condition = currentUrl != nil; -#endif - if(condition) { - if ([message.name isEqualToString:kJSOpenSharePage]) { - if (message.body && message.body != [NSNull null]) { - NSDictionary *body; - //不知道是哪个蓝精灵弄的,变成了个dic,所以我们要判断类型 - if ([message.body isKindOfClass:[NSDictionary class]]) { - body = message.body; - } else if ([message.body isKindOfClass:[NSString class]]) { - body = [message.body toJSONObject]; - } - self.shareDic = body[@"data"]; - [self showSharePanel]; - } - } else if ([message.name isEqualToString:kJSGetUid]) { - NSString *uid = [[AccountInfoStorage instance] getUid]; - NSString *js = [NSString stringWithFormat:@"getMessage(\"uid\",%@)", uid]; - [self.webview evaluateJavaScript:js completionHandler:^(id _Nullable other, NSError * _Nullable error) { - // NSLog(@"%@",error); - }]; - } else if ([message.name isEqualToString:kJSGetTicket]) { - NSString *ticket = [[AccountInfoStorage instance] getTicket]; - NSString *js = [NSString stringWithFormat:@"getMessage(\"ticket\",\"%@\")",ticket]; - [self.webview evaluateJavaScript:js completionHandler:^(id _Nullable other, NSError * _Nullable error) { - // NSLog(@"%@",error); - }]; - } else if ([message.name isEqualToString:kJSGetDeviceId]) { - NSString *js = [NSString stringWithFormat:@"getMessage(\"deviceId\",\"%@\")",[YYUtility deviceUniqueIdentification]]; - [self.webview evaluateJavaScript:js completionHandler:^(id _Nullable other, NSError * _Nullable error) { - // NSLog(@"%@",error); - }]; - } else if ([message.name isEqualToString:kJSGetDeviceInfo]) { - NSDictionary *basicParmars = [HttpRequestHelper configBaseParmars:[[NSDictionary alloc] init]]; - NSString *json = [basicParmars mj_JSONString]; - NSString *js = [NSString stringWithFormat:@"getMessage(\"deviceInfo\",%@)", json]; - [self.webview evaluateJavaScript:js completionHandler:^(id _Nullable ohter, NSError * _Nullable error) { - // NSLog(@"%@", error); - }]; - } else if ([message.name isEqualToString:kJSOpenPurse]) { - - }else if([message.name isEqualToString:kJSChargePayPage]){ - // NSString *money = [NSString stringWithFormat:@"%@",message.body] ; - - }else if([message.name isEqualToString:kJSChargePayClickPage]){ - if(message.body != nil && self.model.diamonds != nil){ - // NSString *type = [NSString stringWithFormat:@"%@",message.body]; - } - }else if ([message.name isEqualToString:kJSOpenChargePage]) { - if(self.delegate && [self.delegate respondsToSelector:@selector(payHandler)]){ - [self.delegate payHandler]; - return; - } - [TTPopup dismiss]; - if(self.isPush){ - XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init]; - webVC.type = @"4"; - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES]; - return; - } - UIViewController *controller = [XCCurrentVCStackManager shareManager].getCurrentVC; - if (controller.presentingViewController) { - [controller dismissViewControllerAnimated:NO completion:nil]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - - XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init]; - webVC.type = @"4"; - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES]; - }); - }else { - XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init]; - webVC.type = @"4"; - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES]; - } - - if (self.didTapCharge) { - self.didTapCharge(); - } - - } else if ([message.name isEqualToString:kOpenPersonPage]) { - NSString *uid = [NSString stringWithFormat:@"%@",message.body]; - if (uid.integerValue > 0) { - [TTPopup dismiss]; - XPMineUserInfoViewController * userInfoVC = [[XPMineUserInfoViewController alloc] init]; - userInfoVC.uid = uid.integerValue; - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:userInfoVC animated:YES]; - } - } else if([message.name isEqualToString:kJSInitNav]) { - [self initNav:message.body]; - } else if([message.name isEqualToString:kJSGetRoomUid]) { - NSString *js = [NSString stringWithFormat:@"getMessage(\"roomUid\",\"%@\")",self.roomUid]; - [self.webview evaluateJavaScript:js completionHandler:^(id _Nullable other, NSError * _Nullable error) { - // NSLog(@"%@",error); - }]; - } else if([message.name isEqualToString:kInitShowNav]) { - if (((NSNumber *)message.body).intValue == 0) { - if (self.InitShowNavBlock) { - self.InitShowNavBlock(YES); - return; - } - self.isHideNavBar = YES; - if (self.navigationController) { - [self.navigationController setNavigationBarHidden:YES]; - } - } - } else if([message.name isEqualToString:kCloseWebView]) { - if (self.CloseWebViewBlock) { - self.CloseWebViewBlock(YES); - return; - } - if (self.navigationController) { - [self.navigationController popViewControllerAnimated:YES]; - } - } else if ([message.name isEqualToString:kJumpAppointPage]) { - // h5与原生交互新协议 - NSDictionary *bodyDict; - if ([message.body isKindOfClass:[NSDictionary class]]) { - bodyDict = message.body; - } else if ([message.body isKindOfClass:[NSString class]]) { - NSString *str = (NSString *)message.body; - bodyDict = [str toJSONObject]; - } - NSInteger skyType = [bodyDict[@"routerType"] integerValue]; - [self handleRouterType:skyType message:message]; - }else if ([message.name isEqualToString:kJSOpenChatPage]){ - NSString *uid = [NSString stringWithFormat:@"%@",message.body]; - if (uid.length > 0) { - NIMSession * session = [NIMSession session:uid type:NIMSessionTypeP2P]; - SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session]; - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:sessionVC animated:YES]; - } - }else if([message.name isEqualToString:kJSOpenAppConcernedChat]){ - NSString *uid = [NSString stringWithFormat:@"%@",message.body]; - if (uid.length > 0) { - NIMSession * session = [NIMSession session:uid type:NIMSessionTypeP2P]; - SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session]; - sessionVC.isAttention = YES; - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:sessionVC animated:YES]; - } - }else if ([message.name isEqualToString:kJSOpenRoom]) { - NSString *uid = [NSString stringWithFormat:@"%@",message.body]; - if (uid.length > 0) { - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController.viewControllers enumerateObjectsUsingBlock:^(__kindof UIViewController * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - if ([obj isKindOfClass:[XPRoomViewController class]]) { - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController popToRootViewControllerAnimated:NO]; - XPRoomViewController * rooomVC = obj; - [rooomVC exitRoom]; - *stop = YES; - } - }]; - if(self.view.superview){ - [TTPopup dismiss]; - } - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [XPRoomViewController openRoom:uid viewController:[XCCurrentVCStackManager shareManager].getCurrentVC]; - }); - } - } else if([message.name isEqualToString:kJSOpenRoomForGiftId]) { - // NSLog(@"%@", message.body); - NSDictionary *bodyDict; - if ([message.body isKindOfClass:[NSDictionary class]]) { - bodyDict = message.body; - } else if ([message.body isKindOfClass:[NSString class]]) { - NSString *str = (NSString *)message.body; - bodyDict = [str toJSONObject]; - } - //房间页 传参:uid - NSString *uid = [NSString stringWithFormat:@"%@", bodyDict[@"uid"]]; - NSString *giftId = [NSString stringWithFormat:@"%@", bodyDict[@"giftId"]]; - if (uid.length) { - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController.viewControllers enumerateObjectsUsingBlock:^(__kindof UIViewController * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - if ([obj isKindOfClass:[XPRoomViewController class]]) { - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController popToRootViewControllerAnimated:NO]; - XPRoomViewController * roomVC = obj; - [roomVC exitRoom]; - *stop = YES; - } - }]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [XPRoomViewController openRoom:uid giftId:giftId viewController:[XCCurrentVCStackManager shareManager].getCurrentVC]; - }); - } - }else if ([message.name isEqualToString:kJSSavePictureShare]){ - NSDictionary *bodyDic; - if ([message.body isKindOfClass:[NSDictionary class]]) { - bodyDic = message.body; - } else if ([message.body isKindOfClass:[NSString class]]) { - bodyDic = [message.body toJSONObject]; - } - NSString *type = [NSString stringWithFormat:@"%@",bodyDic[@"type"]]; - if ([type isEqualToString:@"2"]){ - [self saveImageToPhotoAlbum:bodyDic]; - }else if ([type isEqualToString:@"1"]){ - self.savePhotoDic = bodyDic; - [self showShareSavePhote]; - } - } else if([message.name isEqualToString:kJSGoToExchangeGold]){ - XPIncomeRecordVC *incomeRecordVC = [XPIncomeRecordVC new]; - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:incomeRecordVC animated:YES]; - } else if([message.name isEqualToString:kJSOpenPayment]) { - [self handleOpenPayment:message.body]; - } else if([message.name isEqualToString:kJSVerifyCaptchaCallBack]) { - [self handleCaptchaResult:[message.body integerValue] == 1]; - } else if([message.name isEqualToString:kJSShowShareCallBack]) { - [self handleShareActioin:message.body]; - } - } - }]; -} - -#pragma mark - -- (void)handleShareActioin:(NSString *)content { - [ShareHelder shareImage:kImage(@"share_icon") - url:[NSString isEmpty:content] ? self.url : content - fromController:[XCCurrentVCStackManager shareManager].getCurrentVC]; -} - -- (void)handleCaptchaResult:(BOOL)reuslt { - if (_verifyCaptcha) { - self.verifyCaptcha(reuslt); - } -} - -#pragma mark - Payment Method -- (void)handleOpenPayment:(NSString *)chargeProdId { - if (chargeProdId.length == 0) { - [self showErrorToast:@"no charge ID"]; - return; - } - - [self showLoading]; - - @kWeakify(self); - [[IAPManager sharedManager] purchase:chargeProdId - success:^(NSString *transactionID, NSString *orderID){ - @kStrongify(self); - [self hideHUD]; - [self triggerOpenPaymentCallback:200 - orderID:self.orderId - productID:transactionID]; - } failure:^(NSError * _Nonnull error) { - @kStrongify(self); - [self hideHUD]; - if (error) { - [self showErrorToast:error.domain]; - } - } contactCS:^(NSString * _Nonnull uid) { - @kStrongify(self); - [self hideHUD]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - NIMSession * session = [NIMSession session:uid type:NIMSessionTypeP2P]; - SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session]; - [self.navigationController pushViewController:sessionVC animated:YES]; - }); - }]; -} - -- (void)triggerOpenPaymentCallback:(NSInteger)code - orderID:(NSString *)orderID - productID:(NSString *)productID { - NSDictionary *dic = @{@"code":@(code), @"orderId":orderID, @"productId":productID}; - NSString *js = [NSString stringWithFormat:@"openPaymentCallback(%@)", dic.toJSONString]; - @kWeakify(self); - [self.webview evaluateJavaScript:js - completionHandler:^(id _Nullable result, NSError * _Nullable error) { - @kStrongify(self); - [self hideHUD]; - }]; -} - -#pragma mark - private method -- (void)handleRouterType:(NSInteger)skyType message:(WKScriptMessage *)message { - NSDictionary *bodyDict = (NSDictionary *)message.body; - switch (skyType) { - case 1: - { - //房间页 传参:uid - NSString *uid = [NSString stringWithFormat:@"%@", bodyDict[@"routerVal"]]; - if (uid.length) { - [XPRoomViewController openRoom:uid viewController:[XCCurrentVCStackManager shareManager].getCurrentVC]; - } - } - break; - case 7: - { - //座驾 - MyDressingViewController *vc = [[MyDressingViewController alloc] init]; -// vc.currentIndex = 1; - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:vc animated:YES]; - } - break; - case 8: - { - //头饰 - MyDressingViewController *vc = [[MyDressingViewController alloc] init]; -// vc.currentIndex = 0; - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:vc animated:YES]; - } - break; - case 75: - {//跳转对应的话题 - bodyDict = [bodyDict toJSONObject]; - NSString *topicId = bodyDict[@"routerVal"]; - XPMomentTopicContainerViewController * topicVC = [[XPMomentTopicContainerViewController alloc] init]; - topicVC.worldId = topicId; - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:topicVC animated:YES]; - } - break; - default: - break; - } -} -- (void)setUrl:(NSString *)urlString{ - _url = urlString; - if (_url == nil) { - return; - } - if (![_url hasPrefix:@"http"] && ![_url hasPrefix:@"https"]){ - _url = [NSString stringWithFormat:@"%@/%@", [HttpRequestHelper getHostUrl], _url]; - } - - if (![_url containsString:@"?"]) { - _url = [NSString stringWithFormat:@"%@", _url]; - } else { - _url = [NSString stringWithFormat:@"%@", _url]; - } - - // 去掉 urlString 中的空格。 - NSString *noSpaceTextUrl = [_url stringByReplacingOccurrencesOfString:@" " withString:@""]; - - NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:noSpaceTextUrl]]; - [self.webview loadRequest:request]; -} -- (void)backButtonClick { - BOOL canGoBack = YES; - if (self.webview.backForwardList.backList.count <= 1) { - canGoBack = NO; - } - - if ([self.webview canGoBack]) { - [self.webview goBack]; - } else { - [self.navigationController popViewControllerAnimated:YES]; - [self.pi_userContentController removeAllUserScripts]; - } -} -#pragma mark - 分享 -- (void)initNav:(NSDictionary *)response{ - if(!response || ![response isKindOfClass:[NSDictionary class]])return; - self.shareDic = response[@"data"]; - if ([response[@"type"] intValue]== RightNavigationPushType_Web) { - [self addNavigationItemWithTitles:@[response[@"data"][@"title"]] titleColor:[DJDKMIMOMColor alertTitleColor] isLeft:NO target:self action:@selector(gotoWebView) tags:nil]; - }else if ([response[@"type"] intValue]== RightNavigationPushType_Share || [response[@"type"] intValue]== RightNavigationPushType_SharePicture){ - [self addNavigationItemWithImageNames:@[@"family_person_share"] isLeft:NO - target:self action:@selector(showSharePanel) tags:nil]; - } -} - -- (void)gotoWebView { - if (self.shareDic[@"link"]) { - XPWebViewController * webVC = [[XPWebViewController alloc] init]; - webVC.url = self.shareDic[@"link"]; - [self.navigationController pushViewController:webVC animated:YES]; - } -} --(void)showShareSavePhote{ - if (self.savePhotoDic.allKeys.count <= 0) { - return; - } - NSDictionary * dic = self.savePhotoDic; - XPShareInfoModel * shareInfo = [[XPShareInfoModel alloc] init]; - shareInfo.shareContent = dic[@"shareText"]; - shareInfo.type = ShareType_H5; - shareInfo.uid = [AccountInfoStorage instance].getUid; - NSString *urlStr = ((NSString *)dic[@"toUrl"]).length > 0 ? dic[@"toUrl"] : @""; - NSString *title = ((NSString *)dic[@"shareTitle"]).length > 0 ? dic[@"shareTitle"] : @""; - NSString *shareText = ((NSString *)dic[@"shareText"]).length > 0 ? dic[@"shareText"] : @""; - NSString *shareImg = ((NSString *)dic[@"shareImg"]).length > 0 ? dic[@"shareImg"] : @""; - shareInfo.shareUrl = [NSString stringWithFormat:@"%@&image=%@&title=%@&subTitle=%@",urlStr,shareImg,title,shareText]; - XPShareItem *cycle = [XPShareItem itemWitTag:XPShareItemTagFaceBook title:@"FaceBook" imageName:@"share_fb" disableImageName:@"share_fb"]; - XPShareItem *wechat = [XPShareItem itemWitTag:XPShareItemTagLine title:@"Line" imageName:@"share_line" disableImageName:@"share_line"]; - wechat.isShareInvite = YES; - wechat.inviteTitle = title; - XPShareItem *qq = [XPShareItem itemWitTag:XPShareItemTagCopyLink title:YMLocalizedString(@"XPWebViewNavView1") imageName:@"share_copy_link" disableImageName:@"share_copy_link"]; - XPShareItem *save = [XPShareItem itemWitTag:XPShareItemTagAppSaveAlbum title:YMLocalizedString(@"PIWebViewSavePhotoView4") imageName:@"share_save_icon" disableImageName:@"share_save_icon"]; - - NSArray * items = @[wechat,cycle, qq,save]; - CGFloat margin = 15; - CGSize itemSize = CGSizeMake((KScreenWidth-2*margin)/4, 65); - XPShareView *shareView = [[XPShareView alloc] initWithItems:items itemSize:itemSize shareInfo:shareInfo]; - shareView.delegate = self; - - [TTPopup popupView:shareView style:TTPopupStyleActionSheet]; - -} -- (void)showSharePanel { - if (self.shareDic.allKeys.count <= 0) { - return; - } - NSDictionary * dic = self.shareDic; - XPShareInfoModel * shareInfo = [[XPShareInfoModel alloc] init]; - shareInfo.shareTitle = self.shareDic[@"title"]; - shareInfo.shareContent = dic[@"desc"]; - shareInfo.shareImageUrl = dic[@"imgUrl"]; - shareInfo.type = ShareType_H5; - shareInfo.uid = [AccountInfoStorage instance].getUid; - NSString *urlStr = ((NSString *)dic[@"url"]).length > 0 ? dic[@"url"] : dic[@"showUrl"]; - if (urlStr.length) { - if ([urlStr containsString:@"?"]) { - urlStr = [NSString stringWithFormat:@"%@&shareUid=%@",urlStr,[AccountInfoStorage instance].getUid]; - } else { - urlStr = [NSString stringWithFormat:@"%@?shareUid=%@",urlStr,[AccountInfoStorage instance].getUid]; - } - } - shareInfo.shareUrl = urlStr; - XPShareItem *cycle = [XPShareItem itemWitTag:XPShareItemTagFaceBook title:@"FaceBook" imageName:@"share_fb" disableImageName:@"share_fb"]; - XPShareItem *wechat = [XPShareItem itemWitTag:XPShareItemTagLine title:@"Line" imageName:@"share_line" disableImageName:@"share_line"]; - XPShareItem *qq = [XPShareItem itemWitTag:XPShareItemTagCopyLink title:YMLocalizedString(@"XPWebViewNavView1") imageName:@"share_copy_link" disableImageName:@"share_copy_link"]; - XPShareItem *save = [XPShareItem itemWitTag:XPShareItemTagAppSaveAlbum title:YMLocalizedString(@"PIWebViewSavePhotoView4") imageName:@"share_save_icon" disableImageName:@"share_save_icon"]; - - NSArray * items = @[wechat,cycle, qq,save]; - CGFloat margin = 15; - CGSize itemSize = CGSizeMake((KScreenWidth-2*margin)/4, 65); - XPShareView *shareView = [[XPShareView alloc] initWithItems:items itemSize:itemSize shareInfo:shareInfo]; - shareView.delegate = self; - - [TTPopup popupView:shareView style:TTPopupStyleActionSheet]; -} - -#pragma mark - XCShareViewDelegate -- (void)shareView:(XPShareView *)shareView savePhoto:(XPShareInfoModel *)shareInfo{ - [self saveImageToPhotoAlbum:self.savePhotoDic]; -} -- (void)shareViewDidClickCancle:(XPShareView *)shareView { - [TTPopup dismiss]; -} -- (void)shareView:(XPShareView *)shareView didSuccess:(XPShareInfoModel *)shareInfo { - [TTPopup dismiss]; - NSMutableDictionary *params = [NSMutableDictionary dictionary]; - NSString *uid = [AccountInfoStorage instance].getUid; - NSString *ticket = [AccountInfoStorage instance].getTicket; - [params setObject:uid forKey:@"uid"]; - - // 添加类型安全检查,防止NSTaggedPointerString错误 - if ([shareInfo isKindOfClass:[XPShareInfoModel class]]) { - [params setObject:@(shareInfo.shareType) forKey:@"shareType"]; - } else { - // 如果不是预期类型,提供默认值 - [params setObject:@(0) forKey:@"shareType"]; - NSLog(@"警告:shareInfo不是XPShareInfoModel类型,而是%@类型", NSStringFromClass([shareInfo class])); - } - - [params setObject:ticket forKey:@"ticket"]; - if ([shareInfo isKindOfClass:[XPShareInfoModel class]]) { - [params setObject:@(shareInfo.type) forKey:@"sharePageId"]; - if (shareInfo.shareUrl.length > 0) { - [params setObject:shareInfo.shareUrl forKey:@"shareUrl"]; - } - if (shareInfo.roomUid > 0) { - [params setObject:@(shareInfo.roomUid) forKey:@"targetUid"]; - } - } - - [HttpRequestHelper POST:@"usershare/save" params:params success:^(BaseModel * _Nonnull data) { - - } failure:^(NSInteger resCode, NSString * _Nonnull message) { - - }]; -} - -- (void)shareView:(XPShareView *)shareView shareFail:(NSString *)message { - [TTPopup dismiss]; - [self showErrorToast:message]; -} - -- (void)shareViewDidClickCancel:(XPShareView *)shareView { - [TTPopup dismiss]; -} - -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { - if ([keyPath isEqualToString:@"estimatedProgress"]) { - self.progressView.progress = self.webview.estimatedProgress; - if (self.progressView.progress == 1) { - __weak typeof (self)weakSelf = self; - [UIView animateWithDuration:0.25f delay:0.3f options:UIViewAnimationOptionCurveEaseOut animations:^{ - weakSelf.progressView.transform = CGAffineTransformMakeScale(1.0f, 1.0f); - } completion:^(BOOL finished) { - weakSelf.progressView.hidden = YES; - }]; - } - } else if ([keyPath isEqualToString:@"title"]) { - if (object == self.webview) { - self.navigationItem.title = self.webview.title; - if (self.urlLoadCompleted) {//半屏webview如果在加载完成回调后标题还会改变,在此处重新设置一遍 - self.urlLoadCompleted(YES, nil); - } - }else{ - [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; - } - } else { - [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; - } -} - -- (void)dealloc { - [self.webview removeObserver:self forKeyPath:@"estimatedProgress"]; - [self.webview removeObserver:self forKeyPath:@"title"]; -} - -- (WKWebView *)webview { - if (_webview == nil) { - WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc]init]; - - if (@available(iOS 10.0, *)) { - configuration.mediaTypesRequiringUserActionForPlayback = NO; - } else { - // Fallback on earlier versions - } - configuration.allowsInlineMediaPlayback = YES; - - NSString *uid = [[AccountInfoStorage instance] getUid]; - NSString *realCookie = [NSString stringWithFormat:@"%@=%@",@"uid",uid]; - - WKUserScript *cookieScript = [[WKUserScript alloc] initWithSource: [NSString stringWithFormat:@"document.cookie = '%@';", realCookie] injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:NO]; - [self.pi_userContentController addUserScript:cookieScript]; - ///禁止缩放 - NSString *scaleJs = @"$('meta[name=description]').remove(); $('head').append( '' );"; - WKUserScript *scaleScript = [[WKUserScript alloc] initWithSource:scaleJs injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:NO]; - [self.pi_userContentController addUserScript:scaleScript]; - - //根据生成的WKUserScript对象,初始化WKWebViewConfiguration - configuration.preferences.javaScriptEnabled = YES; - configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES; - configuration.preferences.minimumFontSize = 10; - configuration.selectionGranularity = WKSelectionGranularityCharacter; - configuration.userContentController = self.pi_userContentController; - - CGSize size = [UIScreen mainScreen].bounds.size; - _webview = [[WKWebView alloc]initWithFrame:CGRectMake(0, 0, size.width,size.height) configuration:configuration]; - - _webview.navigationDelegate = self; - //添加KVO,WKWebView有一个属性estimatedProgress,就是当前网页加载的进度,所以监听这个属性 - [_webview addObserver:self forKeyPath:@"estimatedProgress" options:NSKeyValueObservingOptionNew context:nil]; - //添加KVO,监听title属性 - [_webview addObserver:self forKeyPath:@"title" options:NSKeyValueObservingOptionNew context:NULL]; - - UISwipeGestureRecognizer *swipeGesture = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(backButtonClick)]; - [_webview addGestureRecognizer:swipeGesture]; - - [_webview.scrollView setShowsVerticalScrollIndicator:NO]; - [_webview.scrollView setShowsHorizontalScrollIndicator:NO]; - - //set useragent - __weak typeof(self) weakSelf = self; - [_webview evaluateJavaScript:@"navigator.userAgent" completionHandler:^(id result, NSError *error) { - NSString *userAgent = result; - - if (![userAgent containsString:@"molistarAppIos erbanAppIos"]){ - NSString *newUserAgent = [userAgent stringByAppendingString:@" molistarAppIos erbanAppIos"]; - NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:newUserAgent, @"UserAgent", nil]; - [[NSUserDefaults standardUserDefaults] registerDefaults:dictionary]; - [[NSUserDefaults standardUserDefaults] synchronize]; - [weakSelf.webview setCustomUserAgent:newUserAgent]; - } - - }]; - _webview.scrollView.bounces = NO; - } - return _webview; -} -- (UIProgressView *)progressView{ - if (!_progressView) { - _progressView = [[UIProgressView alloc] initWithFrame:CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width, 1)]; - _progressView.progressTintColor = [DJDKMIMOMColor appMainColor]; - _progressView.trackTintColor = [UIColor clearColor]; - _progressView.transform = CGAffineTransformMakeScale(1.0f, 1.0f); - } - return _progressView; -} - -- (WKUserContentController *)pi_userContentController{ - if (!_pi_userContentController) { - //自定义的WKScriptMessageHandler 是为了解决内存不释放的问题 - WeakWebViewScriptMessageDelegate *weakScriptMessageDelegate = [[WeakWebViewScriptMessageDelegate alloc] initWithDelegate:self]; - _pi_userContentController = [[WKUserContentController alloc] init]; - // 分享面板 - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenSharePage]; - // 钱包页面 - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenPurse]; - // 充值页面 - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenChargePage]; - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSChargePayPage]; - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSChargePayClickPage]; - // 获取uid - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetUid]; - // 获取设备id - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetDeviceId]; - // 获取Ticket - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetTicket]; - // 获取设备info - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetDeviceInfo]; - // 实人认证: 打开原生人脸认证 - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenFaceLiveness]; - // 分享按钮 - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSInitNav]; - // 获取房间uid - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetRoomUid]; - // 进入个人主页 - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kOpenPersonPage]; - // 隐藏导航栏 - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kInitShowNav]; - // 隐藏导航栏 - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kCloseWebView]; - //装扮及其他活动页面 - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJumpAppointPage]; - //进入房间 - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenRoom]; - //进房并弹出礼物面板 - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenRoomForGiftId]; - ///进入聊天 - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenChatPage]; - ///进入聊天并关注 - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenAppConcernedChat]; - ///分享及保存 - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSSavePictureShare]; - ///兑换金币 - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGoToExchangeGold]; - ///周卡内购 - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenPayment]; - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenPaymentCallback]; - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSVerifyCaptchaCallBack]; - [_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSShowShareCallBack]; - - } - return _pi_userContentController; - -} --(XPWebViewNavView *)navView{ - if (!_navView){ - _navView = [[XPWebViewNavView alloc]initWithFrame:CGRectZero]; - _navView.delegate = self; - } - return _navView; -} -- (PIWebViewSavePhotoView *)saveView{ - if(!_saveView){ - _saveView = [[PIWebViewSavePhotoView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)]; - } - return _saveView; -} - - -@end diff --git a/YuMi/Modules/YMWeb/XPWebViewNavView.h.backup b/YuMi/Modules/YMWeb/XPWebViewNavView.h.backup deleted file mode 100644 index f5af434..0000000 --- a/YuMi/Modules/YMWeb/XPWebViewNavView.h.backup +++ /dev/null @@ -1,21 +0,0 @@ -// -// XPWebViewNavView.h -// YuMi -// -// Created by YuMi on 2023/2/27. -// - -#import -@class XPWebViewNavView; -NS_ASSUME_NONNULL_BEGIN -@protocol XPWebViewNavViewDelegate -//点击了返回 -- (void)xPWebViewNavView:(XPWebViewNavView *)view didClickBack:(UIButton *)sender; - -@end -@interface XPWebViewNavView : UIView -/// -@property (nonatomic,weak) id delegate; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMWeb/XPWebViewNavView.m.backup b/YuMi/Modules/YMWeb/XPWebViewNavView.m.backup deleted file mode 100644 index 7f91bd1..0000000 --- a/YuMi/Modules/YMWeb/XPWebViewNavView.m.backup +++ /dev/null @@ -1,79 +0,0 @@ -// -// XPWebViewNavView.m -// YuMi -// -// Created by YuMi on 2023/2/27. -// - -#import "XPWebViewNavView.h" -///Third -#import -#import "UIButton+EnlargeTouchArea.h" -#import "DJDKMIMOMColor.h" -#import "YUMIMacroUitls.h" -@interface XPWebViewNavView() -///返回 -@property (nonatomic,strong) UIButton *backButton; -///标题 -@property (nonatomic,strong) UILabel *titleView; -@end -@implementation XPWebViewNavView - --(instancetype)initWithFrame:(CGRect)frame{ - self = [super initWithFrame:frame]; - if(self){ - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; -} - -#pragma mark - Private Method -- (void)initSubViews { - [self addSubview:self.backButton]; - [self addSubview:self.titleView]; - -} -- (void)initSubViewConstraints { - [self.backButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.height.mas_equalTo(kGetScaleWidth(28)); - make.leading.mas_equalTo(0); - make.bottom.mas_equalTo(-kGetScaleWidth(8)); - }]; - [self.titleView mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.equalTo(self.backButton); - make.centerX.equalTo(self); - }]; - -} --(void)backButtonAction{ - if(self.delegate && [self.delegate respondsToSelector:@selector(xPWebViewNavView:didClickBack:)]){ - [self.delegate xPWebViewNavView:self didClickBack:self.backButton]; - } -} - -#pragma mark -懒加载 -- (UIButton *)backButton { - if (!_backButton) { - _backButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_backButton setImage:[[UIImage imageNamed:@"common_nav_back"]ms_SetImageForRTL] forState:UIControlStateNormal]; - [_backButton setImage:[[UIImage imageNamed:@"common_nav_back"]ms_SetImageForRTL] forState:UIControlStateSelected]; - [_backButton addTarget:self action:@selector(backButtonAction) forControlEvents:UIControlEventTouchUpInside]; - [_backButton setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10]; - } - return _backButton; -} - - -- (UILabel *)titleView { - if (!_titleView) { - _titleView = [[UILabel alloc] init]; - _titleView.font = [UIFont systemFontOfSize:17 weight:UIFontWeightSemibold]; - _titleView.textColor = UIColorFromRGB(0x1F1B4F); - _titleView.text = YMLocalizedString(@"XPWebViewNavView0"); - } - return _titleView; -} - - -@end diff --git a/YuMi/Network/HttpRequestHelper.h.backup b/YuMi/Network/HttpRequestHelper.h.backup deleted file mode 100644 index 9b63cac..0000000 --- a/YuMi/Network/HttpRequestHelper.h.backup +++ /dev/null @@ -1,64 +0,0 @@ -// -// HttpRequestHelper.h -// YUMI -// -// Created by zu on 2021/9/3. -// - -#import -#import "BaseModel.h" - -typedef NS_ENUM(NSUInteger, HttpRequestHelperMethod) { - HttpRequestHelperMethodPOST, - HttpRequestHelperMethodGET, - HttpRequestHelperMethodDELETE -}; - -static dispatch_once_t onceToken; - -typedef void(^HttpRequestHelperCompletion)(BaseModel* _Nullable data, NSInteger code, NSString * _Nullable msg); - -NS_ASSUME_NONNULL_BEGIN - -@interface HttpRequestHelper : NSObject -+(NSString *)getHostUrl; -+ (NSDictionary*)configBaseParmars:(NSDictionary * _Nullable)parmars; - -+ (void)GET:(NSString *)method -params:(NSDictionary *)params -success:(void (^)(BaseModel *data))success - failure:(void (^)(NSInteger resCode, NSString *message))failure; - -+ (void)POST:(NSString *)method - params:(NSDictionary *)params - success:(void (^)(BaseModel *data))success - failure:(void (^)(NSInteger resCode, NSString *message))failure; - -+ (void)DELETE:(NSString *)method - params:(NSDictionary *)params - success:(void (^)(BaseModel *data))success - failure:(void (^)(NSInteger resCode, NSString *message))failure; - -+ (void)request:(NSString *)url - method:(HttpRequestHelperMethod)method - params:(NSDictionary *)params - success:(void (^)(BaseModel *data))success - failure:(void (^)(NSInteger resCode, NSString *message))failure; - -+ (void)request:(NSString *)path - method:(HttpRequestHelperMethod)method - params:(NSDictionary *)params - completion:(HttpRequestHelperCompletion)completion; - - -/// 增加或编辑技能卡专用接口 Post 请求参数放入到 body 里 使用 application/json 类型传递 -/// @param path 请求地址 -/// @param params 参数 -/// @param completion 回调 -+ (void)postSkillCard:(NSString *)path - params:(NSString *)params - completion:(HttpRequestHelperCompletion)completion; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Network/HttpRequestHelper.m.backup b/YuMi/Network/HttpRequestHelper.m.backup deleted file mode 100644 index f1ec657..0000000 --- a/YuMi/Network/HttpRequestHelper.m.backup +++ /dev/null @@ -1,521 +0,0 @@ -// -// HttpRequestHelper.m -// YUMI -// -// Created by zu on 2021/9/3. -// - -#import "HttpRequestHelper.h" -#import "YYUtility.h" -#import "AccountInfoStorage.h" -#import "YYReachability.h" -#import -#import "YUMIMacroUitls.h" -#import "MSParamsDecode.h" -#import "NSData+GZIP.h" - -@implementation HttpRequestHelper - -+(AFHTTPSessionManager *)requestManager -{ - static AFHTTPSessionManager *manager = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; - configuration.HTTPShouldUsePipelining = YES; // 启用 HTTP/2 pipelining - configuration.HTTPMaximumConnectionsPerHost = 15; // 提升并发 - - manager = [[AFHTTPSessionManager alloc] initWithBaseURL:[NSURL URLWithString:[HttpRequestHelper getHostUrl]] - sessionConfiguration:configuration]; - - manager.responseSerializer = [AFJSONResponseSerializer serializer]; - manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects: - @"application/json", - @"text/json", - @"text/javascript", - @"text/html", - @"text/plain", - @"image/jpeg", - @"image/png", nil]; - - manager.requestSerializer.HTTPShouldHandleCookies = YES; - manager.requestSerializer.timeoutInterval = 60; - // 声明开启 gzip 和 br - [manager.requestSerializer setValue:@"gzip, br" forHTTPHeaderField:@"Accept-Encoding"]; - - // 确保所有请求走 HTTPS,避免降级到 HTTP/1.1 - manager.securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone]; - manager.securityPolicy.allowInvalidCertificates = NO; - manager.securityPolicy.validatesDomainName = YES; - }); - return manager; -} -+(NSString *)getHostUrl{ - return API_HOST_URL; -#if DEBUG - NSString *isProduction = [[NSUserDefaults standardUserDefaults]valueForKey:@"kIsProductionEnvironment"]; - if([isProduction isEqualToString:@"YES"]){ - return API_HOST_URL; - } - return API_HOST_TEST_URL; -#else - return API_HOST_URL; -#endif -} -+ (void)GET:(NSString *)method - params:(NSDictionary *)params - success:(void (^)(BaseModel *data))success - failure:(void (^)(NSInteger resCode, NSString *message))failure -{ - if ([self checkNetworkStatusWithFailure:^{ - failure(-1, YMLocalizedString(@"HttpRequestHelper0")); - }]) { - return; - } - - [self configHeaders]; - - AFHTTPSessionManager *manager = [HttpRequestHelper requestManager]; - - NSString *key = @"NeedChangeTimeOut"; - NSMutableDictionary *editParam = [params mutableCopy]; - if ([editParam.allKeys containsObject:key]) { - NSInteger timeout = [[editParam objectForKey:key] integerValue]; - [editParam removeObjectForKey:key]; - if (timeout > 0) { - manager.requestSerializer.timeoutInterval = timeout; - } - } - else { - manager.requestSerializer.timeoutInterval = 60; - } - - editParam = [MSParamsDecode msDecodeParams:editParam]; - params = [self configBaseParmars:editParam]; - -#if DEBUG - // 构建完整的 URL - NSString *baseUrl = [HttpRequestHelper getHostUrl]; - NSString *fullUrl = [NSString stringWithFormat:@"%@/%@", baseUrl, method]; - - // 构建查询字符串 - NSMutableArray *queryItems = [NSMutableArray array]; - [params enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - [queryItems addObject:[NSString stringWithFormat:@"%@=%@", key, obj]]; - }]; - NSString *queryString = [queryItems componentsJoinedByString:@"&"]; - if (queryString.length > 0) { - fullUrl = [NSString stringWithFormat:@"%@?%@", fullUrl, queryString]; - } - - NSLog(@"\n🌐 API Request Info:"); - NSLog(@"📍 Full URL: %@", fullUrl); - NSLog(@"🔧 Method: %@", method); - NSLog(@"📦 Parameter Type: queryParameters"); - NSLog(@"📋 Parameters: %@\n", params); -#endif - @kWeakify(self); - [manager GET:method parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject]; -#if DEBUG - NSLog(@"%@ - \n%@\n", method, [baseModel toJSONString]); -#else -#endif - success(baseModel); - } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { - @kStrongify(self); - [self handleNetError:error method:method failure:failure]; - }]; -} - -+ (void)POST:(NSString *)method - params:(NSDictionary *)params - success:(void (^)(BaseModel *data))success - failure:(void (^)(NSInteger resCode, NSString *message))failure -{ - if ([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == 0) { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - failure(-1, YMLocalizedString(@"HttpRequestHelper0")); - }); - return; - } - -// [self configHeaders]; - AFHTTPSessionManager *manager = [HttpRequestHelper requestManager]; - params = [MSParamsDecode msDecodeParams:[params mutableCopy] ]; - - - params = [self configBaseParmars:params]; - -#if DEBUG - // 构建完整的 URL - NSString *baseUrl = [HttpRequestHelper getHostUrl]; - NSString *fullUrl = [NSString stringWithFormat:@"%@/%@", baseUrl, method]; - - NSLog(@"\n🌐 API Request Info:"); - NSLog(@"📍 Full URL: %@", fullUrl); - NSLog(@"🔧 Method: %@", method); - NSLog(@"📦 Parameter Type: bodyParameters"); - NSLog(@"📋 Parameters: %@\n", params); -#else -#endif - - [manager POST:method parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject]; -#if DEBUG - NSLog(@"\n%@", [baseModel toJSONString]); -#else -#endif - success(baseModel); - } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { - [self handleNetError:error method:method failure:failure]; - }]; -} - -+ (void)__POST:(NSString *)method - params:(NSDictionary *)params - success:(void (^)(BaseModel *data))success - failure:(void (^)(NSInteger resCode, NSString *message))failure -{ - if ([self checkNetworkStatusWithFailure:^{ - failure(-1, YMLocalizedString(@"HttpRequestHelper0")); - }]) { - return; - } - - [self configHeaders]; - AFHTTPSessionManager *manager = [HttpRequestHelper requestManager]; - params = [MSParamsDecode msDecodeParams:[params mutableCopy] ]; - params = [self configBaseParmars:params]; - -#if DEBUG - NSLog(@"\nmethod:\n%@\nparameter:\n%@\n 超時:%@", - method, - params, - @(manager.session.configuration.timeoutIntervalForRequest)); -#else -#endif - - // 将 NSDictionary 转换为 JSON - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:params options:0 error:nil]; - - // Gzip 压缩数据 - NSData *gzipData = [jsonData gzippedData]; - @kWeakify(self); - [manager POST:method - parameters:params - headers:nil -constructingBodyWithBlock:^(id _Nonnull formData) { - [formData appendPartWithFormData:gzipData name:@"data"]; - } - progress:nil - success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject]; -#if DEBUG - NSLog(@"%@ - \n%@\n", method, [baseModel toJSONString]); -#else -#endif - success(baseModel); - } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { -#if DEBUG - NSLog(@"%@ - \n%@\n", method, error); -#else -#endif - @kStrongify(self); - [self handleNetError:error method:method failure:failure]; - }]; -} - -+ (void)DELETE:(NSString *)method - params:(NSDictionary *)params - success:(void (^)(BaseModel *data))success - failure:(void (^)(NSInteger resCode, NSString *message))failure -{ - if ([self checkNetworkStatusWithFailure:^{ - failure(-1, YMLocalizedString(@"HttpRequestHelper0")); - }]) { - return; - } -// [self configHeaders]; - params = [MSParamsDecode msDecodeParams:[params mutableCopy] ]; - params = [self configBaseParmars:params]; - AFHTTPSessionManager *manager = [HttpRequestHelper requestManager]; -#if DEBUG - // 构建完整的 URL - NSString *baseUrl = [HttpRequestHelper getHostUrl]; - NSString *fullUrl = [NSString stringWithFormat:@"%@/%@", baseUrl, method]; - - // 构建查询字符串 - NSMutableArray *queryItems = [NSMutableArray array]; - [params enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - [queryItems addObject:[NSString stringWithFormat:@"%@=%@", key, obj]]; - }]; - NSString *queryString = [queryItems componentsJoinedByString:@"&"]; - if (queryString.length > 0) { - fullUrl = [NSString stringWithFormat:@"%@?%@", fullUrl, queryString]; - } - - NSLog(@"\n🌐 API Request Info:"); - NSLog(@"📍 Full URL: %@", fullUrl); - NSLog(@"🔧 Method: %@", method); - NSLog(@"📦 Parameter Type: queryParameters"); - NSLog(@"📋 Parameters: %@\n", params); -#else -#endif - @kWeakify(self); - [manager DELETE:method parameters:params headers:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject]; -#if DEBUG - NSLog(@"\n%@\n", [baseModel toJSONString]); -#else -#endif - success(baseModel); - } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { - @kStrongify(self); - [self handleNetError:error method:method failure:failure]; - }]; -} - -+ (void)request:(NSString *)url - method:(HttpRequestHelperMethod)method - params:(NSDictionary *)params - success:(void (^)(BaseModel *data))success - failure:(void (^)(NSInteger resCode, NSString *message))failure -{ - switch (method) { - case HttpRequestHelperMethodGET: { - [self GET:url params:params success:success failure:failure]; - } - break; - case HttpRequestHelperMethodPOST:{ - [self POST:url params:params success:success failure:failure]; - } - break; - case HttpRequestHelperMethodDELETE:{ - [self DELETE:url params:params success:success failure:failure]; - } - break; - } -} - -+ (void)request:(NSString *)path - method:(HttpRequestHelperMethod)method - params:(NSDictionary *)params - completion:(HttpRequestHelperCompletion)completion -{ - [self request:path method:method params:params success:^(BaseModel *data) { - if (completion) { - completion(data, data.code, data.message); - } - } failure:^(NSInteger resCode, NSString *message) { - if (completion) { - completion(nil, resCode, message); - } - if (resCode > 500 && resCode < 600) { - // 使用 BuglyManager 统一上报网络错误 - NSString *uid = [AccountInfoStorage instance].getUid ?: @"未知用户"; - NSMutableDictionary *userInfo = [params mutableCopy]; - [userInfo setObject:message forKey:@"error message"]; - [userInfo setObject:@(method) forKey:@"http method"]; - } - }]; -} - -+ (void)configHeaders -{ - AFHTTPSessionManager *client = [HttpRequestHelper requestManager]; - if ([[AccountInfoStorage instance] getUid].length > 0) { - [client.requestSerializer setValue:[[AccountInfoStorage instance] getUid] forHTTPHeaderField:@"pub_uid"]; - } else { - [client.requestSerializer setValue:nil forHTTPHeaderField:@"pub_uid"]; - } - if ([[AccountInfoStorage instance] getTicket].length > 0) { - [client.requestSerializer setValue:[[AccountInfoStorage instance] getTicket] forHTTPHeaderField:@"pub_ticket"]; - }else { - [client.requestSerializer setValue:nil forHTTPHeaderField:@"pub_ticket"]; - } - [client.requestSerializer setValue:[NSBundle uploadLanguageText] forHTTPHeaderField:@"Accept-Language"]; - [client.requestSerializer setValue:PI_App_Version forHTTPHeaderField:@"App-Version"]; -} - -+ (NSDictionary*)configBaseParmars:(NSDictionary * _Nullable)parmars -{ - NSDictionary *defaultBasciParame = @{ - @"Accept-Language":[NSBundle uploadLanguageText], - @"os" : @"iOS", - @"osVersion" : [YYUtility systemVersion], - @"netType" : ([YYUtility networkStatus] == ReachableViaWiFi) ? @2 : @1, - @"ispType" : @([YYUtility carrierIdentifier]), - @"channel" : [YYUtility getAppSource] ? : @"", - @"model" : [YYUtility modelType], - @"deviceId" : [YYUtility deviceUniqueIdentification], - @"appVersion" : [YYUtility appVersion], - @"app" : [YYUtility appName], - @"lang" : [YYUtility getLanguage], - }; - - if (!parmars||![parmars isKindOfClass:[NSDictionary class]]){ - NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithDictionary:defaultBasciParame]; - if(![[YYUtility getMobileCountryCode] isEqualToString:@"65535"]){ - [dic setValue:[YYUtility getMobileCountryCode] forKey:@"mcc"]; - } - return dic; - } - - NSMutableDictionary * dic = [NSMutableDictionary dictionaryWithDictionary:parmars]; - if(![[YYUtility getMobileCountryCode] isEqualToString:@"65535"]){ - [dic setValue:[YYUtility getMobileCountryCode] forKey:@"mcc"]; - } - [dic addEntriesFromDictionary:defaultBasciParame]; - - if ([[AccountInfoStorage instance] getUid].length > 0) { - [dic setValue:[[AccountInfoStorage instance] getUid] - forKey:@"pub_uid"]; - } - - if ([[AccountInfoStorage instance] getTicket].length > 0) { - [dic setValue:[[AccountInfoStorage instance] getTicket] - forKey:@"pub_ticket"]; - } - - return dic; -} - -+ (void)handleNetError:(NSError *)error method:(NSString *)method - failure:(void (^)(NSInteger resCode, NSString *message))failure -{ - // 别问,反正 oauth/ticket 接口要通过这种方式取错误码。 - NSHTTPURLResponse *response = error.userInfo[@"com.alamofire.serialization.response.error.response"]; - NSString *NETWORK_ERROR = error.description.length > 0 ? error.description : YMLocalizedString(@"HttpRequestHelper5");; - if (response && response.statusCode == 401) { - failure(response.statusCode, YMLocalizedString(@"HttpRequestHelper7")); - } else { - if (error.code == -1009 || error.code == -1001 || error.code == -1004 || error.code == -1003 || error.code == -1002 || error.code == 3840) { - failure(error.code, @""); - } else { - failure(error.code, error.localizedDescription.length > 0 ? error.localizedDescription : YMLocalizedString(@"HttpRequestHelper4")); - } - } -#if DEBUG - NSLog(@"\n%@", error); - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - NSDictionary *allHeaders = response.allHeaderFields; - //3, - NSMutableDictionary *blockDict = [[NSMutableDictionary alloc]init]; - [blockDict setObject:@(response.statusCode) forKey:@"resultCode"]; - [blockDict setObject:NETWORK_ERROR forKey:@"resultDesc"]; - [BSNetListenModel addHttpRsp:method header:allHeaders result:blockDict isSuccess:NO time:[NSDate getCurrentTimeWithFormat:@"yyyy-MM-dd HH:mm:ss"]]; - }); -#else -#endif -} - -/// 增加或编辑技能卡专用接口 Post 请求参数放入到 body 里 使用 application/json 类型传递 -/// @param path 请求地址 -/// @param params 参数 -/// @param completion 回调 -+ (void)postSkillCard:(NSString *)path - params:(NSString *)params - completion:(HttpRequestHelperCompletion)completion{ - - if ([self checkNetworkStatusWithFailure:^{ - completion(nil, -1, YMLocalizedString(@"HttpRequestHelper0")); - }]) { - return; - } - -// [self configHeaders]; - params = [MSParamsDecode msDecodeParams:[params.mj_JSONObject mutableCopy] ].toJSONString; - - NSDictionary *baseParams = [self configBaseParmars:nil]; - AFHTTPSessionManager *manager = [HttpRequestHelper requestManager]; - NSString *url = [self getHostUrl]; - NSString *urlPath = [NSString stringWithFormat:@"%@/%@", url ,path]; -#if DEBUG - NSLog(@"\nmethod:\n%@\nparameter:\n%@", path, params); - dispatch_async(dispatch_get_global_queue(0, 0), ^{ - [BSNetListenModel addHttpReq:urlPath header:manager.requestSerializer.HTTPRequestHeaders param:[params copy] time:[NSDate getCurrentTimeWithFormat:@"yyyy-MM-dd HH:mm:ss"]]; - }); -#else -#endif - - __block NSString *requestUrl = @""; - [baseParams.allKeys enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - NSString *value = baseParams[obj]; - requestUrl = [requestUrl stringByAppendingString:[NSString stringWithFormat:@"%@=%@&", obj, value]]; - }]; - - urlPath = [NSString stringWithFormat:@"%@?%@", urlPath, requestUrl]; - urlPath = [urlPath stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; - - NSMutableURLRequest *request = [[AFJSONRequestSerializer serializer] requestWithMethod:@"POST" URLString:urlPath parameters:baseParams error:nil]; - request.timeoutInterval= [[[NSUserDefaults standardUserDefaults] valueForKey:@"timeoutInterval"] longValue]; - - [request setValue:@"application/json; charset=UTF-8" forHTTPHeaderField:@"Content-Type"]; - - if ([[AccountInfoStorage instance] getUid].length > 0) { - [request setValue:[[AccountInfoStorage instance] getUid] forHTTPHeaderField:@"pub_uid"]; - [manager.requestSerializer setValue:[[AccountInfoStorage instance] getUid] forHTTPHeaderField:@"pub_uid"]; - } else { - [request setValue:nil forHTTPHeaderField:@"pub_uid"]; - } - if ([[AccountInfoStorage instance] getTicket].length > 0) { - [request setValue:[[AccountInfoStorage instance] getTicket] forHTTPHeaderField:@"pub_ticket"]; - [manager.requestSerializer setValue:[[AccountInfoStorage instance] getTicket] forHTTPHeaderField:@"pub_ticket"]; - }else { - [request setValue:nil forHTTPHeaderField:@"pub_ticket"]; - } - [request setValue:[NSBundle uploadLanguageText] forHTTPHeaderField:@"Accept-Language"]; - [request setValue:PI_App_Version forHTTPHeaderField:@"App-Version"]; - [manager.requestSerializer setValue:[NSBundle uploadLanguageText] forHTTPHeaderField:@"Accept-Language"]; - [manager.requestSerializer setValue:PI_App_Version forHTTPHeaderField:@"App-Version"]; - - [request setHTTPBody:[params dataUsingEncoding:NSUTF8StringEncoding]]; - - [[manager dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { - if (responseObject) { - BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject]; - -#if DEBUG - NSLog(@"\n%@", [baseModel toJSONString]); -#else -#endif - if (baseModel.code == 200) { -#if DEBUG - NSHTTPURLResponse *urlresponse = (NSHTTPURLResponse *)response; - NSDictionary *allHeaders = urlresponse.allHeaderFields; - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - [BSNetListenModel addHttpRsp:urlPath header:allHeaders result:baseModel.data isSuccess:YES time:[NSDate getCurrentTimeWithFormat:@"yyyy-MM-dd HH:mm:ss"]]; - }); -#else -#endif - if (completion) { - completion(baseModel, 200, nil); - } - } else { - if (completion) { - completion(nil, baseModel.code, baseModel.message); - } - } - } - if (error) { - [self handleNetError:error method:path failure:^(NSInteger resCode, NSString *message) { - completion(nil, resCode, message); - }]; - } - }] resume]; -} - -+ (BOOL)checkNetworkStatusWithFailure:(void (^)(void))failure { - if ([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable) { - if (failure) { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - failure(); - }); - } - return YES; - } - return NO; -} - -@end diff --git a/YuMi/Network/MSParamsDecode.h.backup b/YuMi/Network/MSParamsDecode.h.backup deleted file mode 100644 index 19aca87..0000000 --- a/YuMi/Network/MSParamsDecode.h.backup +++ /dev/null @@ -1,21 +0,0 @@ -// -// MSParamsDecode.h -// YuMi -// -// Created by duoban on 2024/4/23. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface MSParamsDecode : NSObject -/** - 加密方法 - @param params 参数 - */ -+ (NSMutableDictionary *)msDecodeParams:(NSMutableDictionary *)params ; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Network/MSParamsDecode.m.backup b/YuMi/Network/MSParamsDecode.m.backup deleted file mode 100644 index ac76968..0000000 --- a/YuMi/Network/MSParamsDecode.m.backup +++ /dev/null @@ -1,64 +0,0 @@ -// -// MSParamsDecode.m -// YuMi -// -// Created by duoban on 2024/4/23. -// - -#import "MSParamsDecode.h" - -@implementation MSParamsDecode -+ (NSMutableDictionary *)msDecodeParams:(NSMutableDictionary *)params { - if (!params) { - params = [NSMutableDictionary dictionary]; - } - - [params setObject:[MSParamsDecode msSign:[params mutableCopy]] forKey:@"pub_sign"]; - return params; -} - - -+ (NSString *)msSign:(NSMutableDictionary *)dic { - [dic removeObjectForKey:@"Accept-Language"]; - [dic removeObjectForKey:@"pub_uid"]; - [dic removeObjectForKey:@"appVersion"]; - [dic removeObjectForKey:@"appVersionCode"]; - [dic removeObjectForKey:@"channel"]; - [dic removeObjectForKey:@"deviceId"]; - [dic removeObjectForKey:@"ispType"]; - [dic removeObjectForKey:@"netType"]; - [dic removeObjectForKey:@"os"]; - [dic removeObjectForKey:@"osVersion"]; - [dic removeObjectForKey:@"app"]; - [dic removeObjectForKey:@"ticket"]; - [dic removeObjectForKey:@"client"]; - [dic removeObjectForKey:@"channel"]; - [dic removeObjectForKey:@"deviceId"]; - [dic removeObjectForKey:@"lang"]; - [dic removeObjectForKey:@"mcc"]; - - - NSMutableString *stringA = [NSMutableString string]; - //按字典key升序排序 - NSArray *sortKeys = [[dic allKeys] sortedArrayUsingSelector:@selector(compare:)]; - //拼接格式 “key0=value0&key1=value1&key2=value2” - for (NSString *key in sortKeys) { - [stringA appendString:[NSString stringWithFormat:@"%@=%@&", key, dic[key]]]; - } - //拼接参数加密签名 PARAMSSECRET - [stringA appendString:[NSString stringWithFormat:@"key=%@", KeyWithType(KeyType_Sign)]]; - //MD5加密签名 - NSString *stringB = [stringA MD5String]; - //返回大写字母 - return stringB.uppercaseString; -} - -+ (NSString *)uuidString{ - CFUUIDRef uuid_ref = CFUUIDCreate(NULL); - CFStringRef uuid_string_ref= CFUUIDCreateString(NULL, uuid_ref); - NSString *uuid = [NSString stringWithString:(__bridge NSString *)uuid_string_ref]; - CFRelease(uuid_ref); - CFRelease(uuid_string_ref); - return [uuid lowercaseString]; -} -@end diff --git a/YuMi/Structure/Base/BaseNavigationController.h.backup b/YuMi/Structure/Base/BaseNavigationController.h.backup deleted file mode 100644 index 0b228a0..0000000 --- a/YuMi/Structure/Base/BaseNavigationController.h.backup +++ /dev/null @@ -1,16 +0,0 @@ -// -// BaseNavigationController.h -// YUMI -// -// Created by zu on 2021/9/7. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface BaseNavigationController : UINavigationController - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Structure/Base/BaseNavigationController.m.backup b/YuMi/Structure/Base/BaseNavigationController.m.backup deleted file mode 100644 index 388105a..0000000 --- a/YuMi/Structure/Base/BaseNavigationController.m.backup +++ /dev/null @@ -1,85 +0,0 @@ -// -// BaseNavigationController.m -// YUMI -// -// Created by zu on 2021/9/7. -// - -#import "BaseNavigationController.h" -///Tool -#import "DJDKMIMOMColor.h" - -@interface BaseNavigationController () - -@end - -@implementation BaseNavigationController --(void)dealloc{ - [[NSNotificationCenter defaultCenter]removeObserver:self]; -} -- (void)viewDidLoad { - [super viewDidLoad]; - if ([self respondsToSelector:@selector(interactivePopGestureRecognizer)]) { - self.interactivePopGestureRecognizer.delegate = self; - } - [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(switchLanguage) name:@"kNavViewUpdateWhenLanguageUpdate" object:nil]; - [self themeConfig]; - if(isMSRTL()){ - self.navigationBar.semanticContentAttribute = UISemanticContentAttributeForceRightToLeft;; - self.view.semanticContentAttribute = UISemanticContentAttributeForceRightToLeft; - }else{ - self.navigationBar.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;; - self.view.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight; - } -} --(void)switchLanguage{ - if(isMSRTL()){ - self.navigationBar.semanticContentAttribute = UISemanticContentAttributeForceRightToLeft; - self.view.semanticContentAttribute = UISemanticContentAttributeForceRightToLeft; - }else{ - self.navigationBar.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight; - self.view.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight; - } - -} -- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated { - if(self.topViewController == viewController) return; - - - [super pushViewController:viewController animated:animated]; -} - -- (void)backClick{ - [self popViewControllerAnimated:YES]; -} - -- (void)themeConfig { - self.navigationBar.shadowImage = [[UIImage alloc] init]; - self.navigationBar.barTintColor = [DJDKMIMOMColor appBackgroundColor]; - self.navigationBar.tintColor = [UIColor whiteColor]; - self.navigationBar.translucent = NO; - self.view.backgroundColor = [DJDKMIMOMColor appBackgroundColor]; - [self.navigationBar setTitleTextAttributes:@{ - NSFontAttributeName:[UIFont systemFontOfSize:18 weight:UIFontWeightMedium], - NSForegroundColorAttributeName:[DJDKMIMOMColor mainTextColor] - }]; - - /// scrollEdgeAppearance 属性iOS15 强制适用于 所有导航器 如果为nil 则使用 standardAppearance属性中的设置,并修改为使用透明背景 @fengshuo - if (@available(iOS 15.0, *)) { - UINavigationBarAppearance *appearance = [UINavigationBarAppearance new]; - appearance.titleTextAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:18 weight:UIFontWeightMedium], - NSForegroundColorAttributeName:[DJDKMIMOMColor mainTextColor]}; - appearance.backgroundColor = [DJDKMIMOMColor appCellBackgroundColor]; - self.navigationBar.standardAppearance = appearance; - self.navigationBar.scrollEdgeAppearance = appearance; - } -} - -#pragma mark - UIGestureRecognizerDelegate - -- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { - return YES; -} - - -@end diff --git a/YuMi/Structure/Base/BaseViewController.h.backup b/YuMi/Structure/Base/BaseViewController.h.backup deleted file mode 100644 index 7ce2976..0000000 --- a/YuMi/Structure/Base/BaseViewController.h.backup +++ /dev/null @@ -1,100 +0,0 @@ -// -// BaseViewController.h -// YUMI -// -// Created by admin on 2023/3/9. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@protocol BaseViewControllerProtocol -@optional -/** - 成功 toast - */ -- (void)showSuccessToast:(NSString *)msg; - -/** - 失败 toast - */ -- (void)showErrorToast:(NSString *)msg; - -/** - 加载 loading - */ -- (void)showLoading; - -/** - 隐藏 XNDJTDDLoadingTool - */ -- (void)hideHUD; - -/** - 显示加载个播房loading - */ -- (void)showAnchorLoading; - -@end - -@interface BaseViewController : UIViewController - -// 是否隐藏导航 默认是不隐藏的 -@property(nonatomic,assign,getter=isHiddenNavBar) BOOL hiddenNavBar; - - -/** - 显示/隐藏导航 - */ -- (void)hideNavigationBar; - -/** - 隐藏导航栏 - */ -- (void)showNavigationBar; - - -/** - 显示/隐藏状态栏 - */ -- (void)showStatusBar; - - -/** - 隐藏状态栏 - */ -- (void)hideStatusBar; -#pragma mark - 导航栏添加操作按钮 - -/// 添加图片 -/// @param imageNames 图片的数组 -/// @param isLeft 是否在左边 -/// @param target 接受事件的 -/// @param action 点击 -/// @param tags tag -- (void)addNavigationItemWithImageNames:(NSArray *)imageNames - isLeft:(BOOL)isLeft - target:(id)target - action:(SEL)action - tags:(NSArray * _Nullable)tags; - -/// 添加文字 不可点击的时候颜色 -/// @param titles 文字的数组 -/// @param titleColor 文字的颜色 -/// @param isLeft 是否在左边 -/// @param target 目标 -/// @param action 点击 -/// @param tags tag -- (void)addNavigationItemWithTitles:(NSArray *)titles titleColor:(UIColor *)titleColor isLeft:(BOOL)isLeft target:(id)target action:(SEL)action tags:(NSArray * _Nullable)tags; - -/// 自定义的View -/// @param isLeft 是否在左边 -- (void)addNavigationItemWithItems:(NSArray *)items - isLeft:(BOOL)isLeft; - - - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Structure/Base/BaseViewController.m.backup b/YuMi/Structure/Base/BaseViewController.m.backup deleted file mode 100644 index b826e52..0000000 --- a/YuMi/Structure/Base/BaseViewController.m.backup +++ /dev/null @@ -1,198 +0,0 @@ -// -// BaseViewController.m -// YUMI -// -// Created by admin on 2023/3/9. -// - -#import "BaseViewController.h" -///Tool -#import "XNDJTDDLoadingTool.h" -#import "DJDKMIMOMColor.h" - -@interface BaseViewController () - -@end - -@implementation BaseViewController - -- (void)viewWillAppear:(BOOL)animated{ - [super viewWillAppear:animated]; - if (@available(iOS 13.0, *)) { - [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDarkContent; - } else { - // Fallback on earlier versions - [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault; - } - // 根据子类属性重写判断是否隐藏导航栏 - [self.navigationController setNavigationBarHidden:self.isHiddenNavBar animated:animated]; - ///解决iOS15 导航栏下面有一条黑色的线 @fengshuo - if (@available(iOS 15.0, *)) { - [self.navigationController.navigationBar.subviews enumerateObjectsUsingBlock:^(UIView *view, NSUInteger idx, BOOL *stop) { - if ([[UIDevice currentDevice].systemVersion doubleValue] >= 10.0) { - //iOS10,改变了导航栏的私有接口为_UIBarBackground - if ([view isKindOfClass:NSClassFromString(@"_UIBarBackground")]) { - [view.subviews enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - if ([obj isKindOfClass:NSClassFromString(@"_UIBarBackgroundShadowView")]) { - obj.hidden = YES; - } - }]; - } - } - }]; - } -} -- (void)viewDidLoad { - [super viewDidLoad]; - [self themeConfig]; -} - -- (void)themeConfig { - self.view.backgroundColor = [DJDKMIMOMColor appBackgroundColor]; - [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault; -} - -/** - 隐藏导航条 - */ -- (void)hideNavigationBar { - [self.navigationController setNavigationBarHidden:YES animated:YES]; -} - - -/** - 显示导航条 - */ -- (void)showNavigationBar { - [self.navigationController setNavigationBarHidden:NO]; -} - -/** - 显示状态栏 - */ -- (void)showStatusBar { - [UIApplication sharedApplication].statusBarHidden = NO; -} - -/** - 隐藏状态栏 - */ -- (void)hideStatusBar { - [UIApplication sharedApplication].statusBarHidden = YES; -} - -- (void)showSuccessToast:(NSString *)msg { - [XNDJTDDLoadingTool showSuccessWithMessage:msg]; -} - -- (void)showErrorToast:(NSString *)msg { - [XNDJTDDLoadingTool showErrorWithMessage:msg]; -} - -- (void)showLoading { - [XNDJTDDLoadingTool showLoading]; -} - -- (void)hideHUD { - [XNDJTDDLoadingTool hideHUD]; -} - -/** - 显示加载个播房loading - */ -- (void)showAnchorLoading { - [XNDJTDDLoadingTool showAnchorLoading]; -} -#pragma mark - 导航栏添加操作按钮 - -/// 添加图片 -/// @param imageNames 图片的数组 -/// @param isLeft 是否在左边 -/// @param target 接受事件的 -/// @param action 点击 -/// @param tags tag -- (void)addNavigationItemWithImageNames:(NSArray *)imageNames isLeft:(BOOL)isLeft target:(id)target action:(SEL)action tags:(NSArray * _Nullable)tags { - NSMutableArray * items = [[NSMutableArray alloc] init]; - NSInteger i = 0; - for (NSString * imageName in imageNames) { - UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom]; - [btn setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal]; - btn.frame = CGRectMake(0, 0, 30, 30); - if(isLeft){ - [btn setImageEdgeInsets:UIEdgeInsetsMake(0, -10, 0, 10)]; - }else{ - [btn setImageEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; - } - [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside]; - btn.tag = [tags[i++] integerValue]; - UIBarButtonItem * item = [[UIBarButtonItem alloc] initWithCustomView:btn]; - [items addObject:item]; - } - if (isLeft) { - self.navigationItem.leftBarButtonItems = items; - } else { - self.navigationItem.rightBarButtonItems = items; - } -} - -/// 添加文字 不可点击的时候颜色 -/// @param titles 文字的数组 -/// @param titleColor 文字的颜色 -/// @param isLeft 是否在左边 -/// @param target 目标 -/// @param action 点击 -/// @param tags tag -- (void)addNavigationItemWithTitles:(NSArray *)titles titleColor:(UIColor *)titleColor isLeft:(BOOL)isLeft target:(id)target action:(SEL)action tags:(NSArray * _Nullable)tags { - NSMutableArray * items = [[NSMutableArray alloc] init]; - //调整按钮位置 - UIBarButtonItem* spaceItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; - //将宽度设为负值 - spaceItem.width= -10; - [items addObject:spaceItem]; - if (titleColor == nil) { - titleColor = [DJDKMIMOMColor mainTextColor]; - } - NSInteger i = 0; - for (NSString * title in titles) { - UIButton * btn = [UIButton buttonWithType:UIButtonTypeSystem]; - btn.frame = CGRectMake(0, 0, 30, 20); - [btn setTitle:title forState:UIControlStateNormal]; - [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside]; - btn.titleLabel.font = [UIFont systemFontOfSize:14]; - [btn setTitleColor:titleColor forState:UIControlStateNormal]; - btn.tag = [tags[i++] integerValue]; - [btn sizeToFit]; - UIBarButtonItem * item = [[UIBarButtonItem alloc] initWithCustomView:btn]; - [items addObject:item]; - } - if (isLeft) { - self.navigationItem.leftBarButtonItems = items; - } else { - self.navigationItem.rightBarButtonItems = items; - } -} - - -/// 自定义的View -/// @param isLeft 是否在左边 -- (void)addNavigationItemWithItems:(NSArray *)views - isLeft:(BOOL)isLeft { - NSMutableArray * items = [[NSMutableArray alloc] init]; - //调整按钮位置 - UIBarButtonItem* spaceItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; - //将宽度设为负值 - spaceItem.width= -10; - [items addObject:spaceItem]; - for (UIView * view in views) { - UIBarButtonItem * item = [[UIBarButtonItem alloc] initWithCustomView:view]; - [items addObject:item]; - } - if (isLeft) { - self.navigationItem.leftBarButtonItems = items; - } else { - self.navigationItem.rightBarButtonItems = items; - } -} - - -@end diff --git a/YuMi/Structure/MVP/Api/Api.h.backup b/YuMi/Structure/MVP/Api/Api.h.backup deleted file mode 100644 index f8bf214..0000000 --- a/YuMi/Structure/MVP/Api/Api.h.backup +++ /dev/null @@ -1,103 +0,0 @@ -// -// Api.h -// YUMI -// -// Created by zu on 2021/9/6. -// - -#import -#import "HttpRequestHelper.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface Api : NSObject - -/** - route : 接口路径 - method : http 请求方法(POST、GET等) - completion : 网络请求完成的回调 - ... : 可变参数,第一个为 __FUNCTION__ ,接下来依次为该接口的协议参数 - */ -+ (void)makeRequest:(NSString *)route method:(HttpRequestHelperMethod)method completion:(HttpRequestHelperCompletion)completion, ...; - -+ (void)getUserInfo:(HttpRequestHelperCompletion)completion uid:(NSString *)uid; -///获取多个用户的信息 -+ (void)getUserInfos:(HttpRequestHelperCompletion)completion uids:(NSString *)uids; - +(void)testMsg:(HttpRequestHelperCompletion)completion uid:(NSString *)uid ticket:(NSString *)ticket; -/// 获取手机号的验证码 -/// @param completion 请求完成 -/// @param mobile 手机号 -/// @param type 类型 请看XPEunm中的枚举 -+ (void)phoneSmsCode:(HttpRequestHelperCompletion)completion mobile:(NSString *)mobile type:(NSString *)type phoneAreaCode:(NSString *)phoneAreaCode; - -/// 校验手机号码 -/// @param completion 完成 -/// @param mobile 手机号 -/// @param code 验证码 -/// @param uid 用户的uid -/// @param ticket ticket -+ (void)checkMoblieCode:(HttpRequestHelperCompletion)completion - mobile:(NSString *)mobile - code:(NSString *)code - uid:(NSString *)uid - ticket:(NSString *)ticket phoneAreaCode:(NSString *)phoneAreaCode; - -/// 补全用户资料 -/// @param completion 完成 -/// @param userInfo 需要更新的用户信息 -+ (void)completeUserInfo:(HttpRequestHelperCompletion)completion - userInfo:(NSDictionary *)userInfo; -/// 获取用户钱包余额信息 -/// @param completion 完成 -/// @param uid 用户uid -/// @param ticket ticketg -+ (void)getUserWalletInfo:(HttpRequestHelperCompletion)completion - uid:(NSString *)uid - ticket:(NSString *)ticket; -/// 批量验证 -/// @param completion 完成 -/// @param transcationIdStr 需要验证的数据 -+ (void)requestCheckTranscationIds:(HttpRequestHelperCompletion)completion - transcationIdStr:(NSString *)transcationIdStr; - -/// 锁麦/开麦 -/// @param completion 完成 -/// @param roomUid 房主的uid -/// @param state 0 开麦 1 锁麦 -/// @param position 坑位 -/// @param ticket 用户的ticket -/// @param uid uid -+ (void)microMuteCompletion:(HttpRequestHelperCompletion)completion - roomUid:(NSString *)roomUid - state:(NSString *)state - position:(NSString *)position - ticket:(NSString *)ticket - uid:(NSString *)uid; - -/// 锁坑/开锁 -/// @param completion 完成 -/// @param roomUid 房主的uid -/// @param state 1锁坑位,0取消锁(即取消锁坑位) -/// @param position 坑位 -/// @param ticket 用户的ticket -/// @param uid uid -+ (void)microLockCompletion:(HttpRequestHelperCompletion)completion - roomUid:(NSString *)roomUid - state:(NSString *)state - position:(NSString *)position - ticket:(NSString *)ticket - uid:(NSString *)uid; -//充值banner位 -+(void)requestBannerListCompletion:(HttpRequestHelperCompletion)completion; -//联系客服 -+(void)requestContactCustomerServiceCompletion:(HttpRequestHelperCompletion)completion; - -+ (void)requestAllRegionInfoCompletion:(HttpRequestHelperCompletion)completion; - -+ (void)requestBossMicUp:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid uid:(NSString *)uid; - -+ (void)shareGetInfo:(HttpRequestHelperCompletion)completion code:(NSString *)code; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Structure/MVP/Api/Api.m.backup b/YuMi/Structure/MVP/Api/Api.m.backup deleted file mode 100644 index 2553549..0000000 --- a/YuMi/Structure/MVP/Api/Api.m.backup +++ /dev/null @@ -1,158 +0,0 @@ -// -// Api.m -// YUMI -// -// Created by zu on 2021/9/6. -// - -#import "Api.h" -#import -@implementation Api -+ (void)makeRequest:(NSString *)route method:(HttpRequestHelperMethod)method completion:(HttpRequestHelperCompletion)completion, ... { - va_list arg_lists; - va_start(arg_lists, completion); - - // 获取第一个参数 __FUNCTION__ ,然后解析出来 key 。 - const char *functionName = va_arg(arg_lists, const char *); - NSString *fn = [[NSString alloc] initWithUTF8String:functionName]; - // NSLog 一下 __FUNCTION__ 就知道为什么这么截取了。 - NSRange blankRange = [fn rangeOfString:@":"]; - NSUInteger start = blankRange.location + 1; - NSUInteger length; - if ((start + 2) < fn.length) { - length = fn.length - start - 2; - } else if ((start + 1) < fn.length) { - length = fn.length -start - 1; - } else { - length = fn.length -start; - } - - NSString *fromatParamKeys = [fn substringWithRange:NSMakeRange(start, length)]; - // 构造请求的 NSMutableDictionary *params 。 - NSMutableDictionary *params = [NSMutableDictionary dictionary]; - - NSArray *paramKeys = [fromatParamKeys componentsSeparatedByString:@":"]; - NSEnumerator *enumerator = [paramKeys objectEnumerator]; - NSString *value = nil; - while((value = va_arg(arg_lists, NSString*))){ - [params setValue:value forKey:enumerator.nextObject]; - }; - va_end(arg_lists); - - [HttpRequestHelper request:route method:method params:params completion:completion]; -} - -+ (void)getUserInfo:(HttpRequestHelperCompletion)completion uid:(NSString *)uid { - NSString * fang = [NSString stringFromBase64String:@"dXNlci9nZXQ="];///user/get - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, nil]; -} - -+ (void)getUserInfos:(HttpRequestHelperCompletion)completion uids:(NSString *)uids { - NSString * fang = [NSString stringFromBase64String:@"dXNlci9saXN0"];///user/list - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uids, nil]; -} -+(void)testMsg:(HttpRequestHelperCompletion)completion uid:(NSString *)uid ticket:(NSString *)ticket{ - - [self makeRequest:@"user/testMsg" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,uid,ticket, nil]; -} -/// 获取手机号的验证码 -/// @param completion 请求完成 -/// @param mobile 手机号 -/// @param type 类型 请看XPEunm中的枚举 -+ (void)phoneSmsCode:(HttpRequestHelperCompletion)completion mobile:(NSString *)mobile type:(NSString *)type phoneAreaCode:(NSString *)phoneAreaCode { - NSString * fang = [NSString stringFromBase64String:@"c21zL2dldENvZGU="];///sms/getCode - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, mobile, type, phoneAreaCode,nil]; -} - -/// 校验手机号码 -/// @param completion 完成 -/// @param mobile 手机号 -/// @param code 验证码 -/// @param uid 用户的uid -/// @param ticket ticket -+ (void)checkMoblieCode:(HttpRequestHelperCompletion)completion - mobile:(NSString *)mobile - code:(NSString *)code - uid:(NSString *)uid - ticket:(NSString *)ticket phoneAreaCode:(NSString *)phoneAreaCode{ - NSString * fang = [NSString stringFromBase64String:@"c21zL3ZlcmlmeQ=="];///sms/verify - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, mobile, code, uid, ticket,phoneAreaCode,nil]; -} - -/// 补全用户资料 -/// @param completion 完成 -/// @param userInfo 需要更新的用户信息 -+ (void)completeUserInfo:(HttpRequestHelperCompletion)completion - userInfo:(NSDictionary *)userInfo { - NSString * fang = [NSString stringFromBase64String:@"dXNlci92Mi91cGRhdGU="];///user/v2/update - [HttpRequestHelper request:fang method:HttpRequestHelperMethodPOST params:userInfo completion:completion]; -} - - -/// 获取用户钱包余额信息 -/// @param completion 完成 -/// @param uid 用户uid -/// @param ticket ticketg -+ (void)getUserWalletInfo:(HttpRequestHelperCompletion)completion uid:(NSString *)uid ticket:(NSString *)ticket { - NSString * fang = [NSString stringFromBase64String:@"cHVyc2UvcXVlcnk="];///purse/query - [self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, ticket,nil]; -} - -/// 批量验证 -/// @param completion 完成 -/// @param transcationIdStr 需要验证的数据 -+ (void)requestCheckTranscationIds:(HttpRequestHelperCompletion)completion - transcationIdStr:(NSString *)transcationIdStr { - NSString * fang = [NSString stringFromBase64String:@"dmVyaWZ5L2NoZWNrSU9TQ2hhcmdlUmVjb3Jk"];///verify/checkIOSChargeRecord - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,transcationIdStr, nil]; -} - -/// 锁麦/开麦 -/// @param completion 完成 -/// @param roomUid 房主的uid -/// @param state 0 开麦 1 锁麦 -/// @param position 坑位 -/// @param ticket 用户的ticket -/// @param uid uid -+ (void)microMuteCompletion:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid state:(NSString *)state position:(NSString *)position ticket:(NSString *)ticket uid:(NSString *)uid { - NSString * fang = [NSString stringFromBase64String:@"cm9vbS9taWMvbG9ja21pYw=="];///@"room/mic/lockmic" - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, roomUid, state, position, ticket, uid, nil]; -} - -/// 锁坑/开锁 -/// @param completion 完成 -/// @param roomUid 房主的uid -/// @param state 1锁坑位,0取消锁(即取消锁坑位) -/// @param position 坑位 -/// @param ticket 用户的ticket -/// @param uid uid -+ (void)microLockCompletion:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid state:(NSString *)state position:(NSString *)position ticket:(NSString *)ticket uid:(NSString *)uid { - NSString * fang = [NSString stringFromBase64String:@"cm9vbS9taWMvbG9ja3Bvcw=="];///room/mic/lockpos - [self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, roomUid, state, position, ticket, uid, nil]; -} -//充值banner位 -+(void)requestBannerListCompletion:(HttpRequestHelperCompletion)completion{ - [self makeRequest:@"charge/guide/banner" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil]; -} -//联系客服 -+(void)requestContactCustomerServiceCompletion:(HttpRequestHelperCompletion)completion{ - [self makeRequest:@"charge/guide/contact" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil]; -} - -+ (void)requestAllRegionInfoCompletion:(HttpRequestHelperCompletion)completion { - [self makeRequest:@"regionInfo/listAll" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil]; -} - -+ (void)requestBossMicUp:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid uid:(NSString *)uid { - [self makeRequest:@"room/bossMic/up" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, roomUid, uid, nil]; -} - -+ (void)shareGetInfo:(HttpRequestHelperCompletion)completion code:(NSString *)code { - [self makeRequest:@"share/getInfo" - method:HttpRequestHelperMethodGET - completion:completion, - __FUNCTION__, - code, nil]; -} - -@end diff --git a/YuMi/Structure/MVP/Model/AccountInfoStorage.h.backup b/YuMi/Structure/MVP/Model/AccountInfoStorage.h.backup deleted file mode 100644 index ad699c6..0000000 --- a/YuMi/Structure/MVP/Model/AccountInfoStorage.h.backup +++ /dev/null @@ -1,40 +0,0 @@ -// -// DataUtils.h -// YYFaceAuth -// -// Created by chenran on 16/10/18. -// Copyright © 2016年 zhangji. All rights reserved. -// - -#import - -@class AccountModel, ThirdUserInfo, HomeTagModel,HomeUserModel; -@interface AccountInfoStorage : NSObject - -@property (nonatomic, strong, readonly) AccountModel *accountModel; -@property(nonatomic,copy) NSString *name;///判断帐号是否填写资料 -///判断是否正在请求ticket,yes的话,不能用ticket请求数据,不然会出现401,要重新登录 -@property (nonatomic,assign) BOOL isRequestTicket; -///如果是第三方登录的话 保存一下用户信息 -@property (nonatomic,strong) ThirdUserInfo *thirdUserInfo; -@property(nonatomic,assign) BOOL isNative; -+ (instancetype)instance; - -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)new NS_UNAVAILABLE; -- (id)copy NS_UNAVAILABLE; -- (id)mutableCopy NS_UNAVAILABLE; - -- (AccountModel *)getCurrentAccountInfo; -- (void)saveAccountInfo:(AccountModel *)accountInfo; -///用于判断是否填写用户资料,没有将跳到用户填写用户资料界面 -- (HomeUserModel *)getCurrentHomeUserInfo; -- (void)saveHomeUserInfo:(HomeUserModel *)homeUserInfo; -- (void)saveTicket:(NSString *)ticket; -- (NSString *)getTicket; -- (NSString *)getUid; - -///首页的tag列表,增加缓存,加快加载速度的优化 -- (NSArray *)getCurrentTagList; -- (void)saveTagList:(NSArray *)tagList; -@end diff --git a/YuMi/Structure/MVP/Model/AccountInfoStorage.m.backup b/YuMi/Structure/MVP/Model/AccountInfoStorage.m.backup deleted file mode 100644 index ce2a983..0000000 --- a/YuMi/Structure/MVP/Model/AccountInfoStorage.m.backup +++ /dev/null @@ -1,171 +0,0 @@ -// -// DataUtils.m -// YYFaceAuth -// -// Created by chenran on 16/10/18. -// Copyright © 2016年 zhangji. All rights reserved. -// -#define kFileName @"AccountInfo.data" -#define kDataKey @"accountInfo" -#define kHomeUserDataKey @"homeUserInfo" -#define kHomeUserName @"HomeUserModel.data" - -#import "AccountInfoStorage.h" -#import "AccountModel.h" - - -#define kTagListDataKey @"homeaaNewTagModel" -#define kTagListDataName @"HomeTagNewModel.data" -@interface AccountInfoStorage() -@property (nonatomic,strong) HomeUserModel *homeUserInfo; -@property (nonatomic, copy) NSString *ticket; -@property (nonatomic, strong) AccountModel *accountModel; -@property (nonatomic,strong) NSArray *tagList; -@end - -@implementation AccountInfoStorage - -static AccountInfoStorage *_instance = nil; - -+ (AccountInfoStorage *)instance { - - static dispatch_once_t onceToken; - - dispatch_once(&onceToken, ^{ - _instance = [[self alloc] init]; - }) ; - - return _instance; -} - --(NSString *) getFilePath{ - NSArray *array = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *path = [[array objectAtIndex:0] stringByAppendingPathComponent:kFileName]; - if (![[NSFileManager defaultManager] fileExistsAtPath:path]) { - [[NSFileManager defaultManager] createFileAtPath:path contents:nil attributes:nil]; - } - return path; -} - -- (AccountModel *)getCurrentAccountInfo -{ - if (self.accountModel != nil) { - return self.accountModel; - } - - if ([[NSFileManager defaultManager] fileExistsAtPath:[self getFilePath]] == NO) { - return nil; - } - - NSData *data = [[NSData alloc] initWithContentsOfFile:[self getFilePath]]; - if (data == nil) { - return nil; - } - - NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data]; - //解档出数据模型 - self.accountModel = [unarchiver decodeObjectForKey:kDataKey]; - [unarchiver finishDecoding];//一定不要忘记finishDecoding,否则会报错 - return self.accountModel; -} - -- (void)saveAccountInfo:(AccountModel *)accountInfo -{ - if (accountInfo == nil) { - accountInfo = [[AccountModel alloc] init]; - } - self.accountModel = accountInfo; - NSMutableData *data = [[NSMutableData alloc] init]; - NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data]; - [archiver encodeObject:accountInfo forKey:kDataKey]; - [archiver finishEncoding]; - [data writeToFile:[self getFilePath] atomically:YES]; -} -- (HomeUserModel *)getCurrentHomeUserInfo -{ - if (self.homeUserInfo != nil) { - return self.homeUserInfo; - } - NSData *data = [[NSData alloc] initWithContentsOfFile:[self getHomeUserFilePath]]; - - NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data]; - //解档出数据模型 - self.homeUserInfo = [unarchiver decodeObjectForKey:kHomeUserDataKey]; - [unarchiver finishDecoding];//一定不要忘记finishDecoding,否则会报错 - return self.homeUserInfo; -} -- (void)saveHomeUserInfo:(HomeUserModel *)homeUserInfo -{ - if (homeUserInfo == nil) { - homeUserInfo = [[HomeUserModel alloc] init]; - } - self.homeUserInfo = homeUserInfo; - NSMutableData *data = [[NSMutableData alloc] init]; - NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data]; - [archiver encodeObject:homeUserInfo forKey:kHomeUserDataKey]; - [archiver finishEncoding]; - [data writeToFile:[self getHomeUserFilePath] atomically:YES]; -} --(NSString *) getHomeUserFilePath{ - NSArray *array = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *path = [[array objectAtIndex:0] stringByAppendingPathComponent:kHomeUserName]; - if (![[NSFileManager defaultManager] fileExistsAtPath:path]) { - [[NSFileManager defaultManager] createFileAtPath:path contents:nil attributes:nil]; - } - return path; -} -- (void)saveTicket:(NSString *)t -{ - self.ticket = t; -} - -- (NSString *)getTicket -{ - if (self.ticket == nil) { - return @""; - } - return self.ticket; -} - -- (NSString *)getUid -{ - AccountModel *am = [self getCurrentAccountInfo]; - if (am == nil) { - return @""; - } - return am.uid; -} - -- (NSArray *)getCurrentTagList{ - if (self.tagList != nil) { - return self.tagList; - } - NSData *data = [[NSData alloc] initWithContentsOfFile:[self getTagListFilePath]]; - - NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data]; - //解档出数据模型 - self.tagList = [unarchiver decodeObjectForKey:kTagListDataKey]; - [unarchiver finishDecoding];//一定不要忘记finishDecoding,否则会报错 - return self.tagList != nil ? self.tagList : @[]; -} -- (void)saveTagList:(NSArray *)tagList{ - if(tagList == nil){ - tagList = @[]; - } - self.tagList = tagList; - NSMutableData *data = [[NSMutableData alloc] init]; - NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data]; - [archiver encodeObject:tagList forKey:kTagListDataKey]; - [archiver finishEncoding]; - [data writeToFile:[self getTagListFilePath] atomically:YES]; -} - --(NSString *) getTagListFilePath{ - NSArray *array = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *path = [[array objectAtIndex:0] stringByAppendingPathComponent:kTagListDataName]; - if (![[NSFileManager defaultManager] fileExistsAtPath:path]) { - [[NSFileManager defaultManager] createFileAtPath:path contents:nil attributes:nil]; - } - return path; -} -@end diff --git a/YuMi/Structure/MVP/Model/AccountModel.h.backup b/YuMi/Structure/MVP/Model/AccountModel.h.backup deleted file mode 100644 index 44751c6..0000000 --- a/YuMi/Structure/MVP/Model/AccountModel.h.backup +++ /dev/null @@ -1,31 +0,0 @@ -// -// TokenModel.h -// YUMI -// -// Created by zu on 2021/9/8. -// - -#import "NSObject+MJExtension.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface AccountModel : PIBaseModel - -@property (nonatomic , copy) NSString *uid; -@property (nonatomic , copy) NSString *jti; -@property (nonatomic , copy) NSString *token_type; -@property (nonatomic , copy) NSString *refresh_token; -@property (nonatomic , copy) NSString *netEaseToken; -@property (nonatomic , copy) NSString *access_token; -@property (nonatomic , copy) NSNumber *expires_in; - -@end -@interface HomeUserModel : PIBaseModel -@property (nonatomic,copy)NSString *nick; -@property (nonatomic,copy)NSString *avatar; -@property (nonatomic,assign)BOOL isBindPhone; -@property (nonatomic,copy) NSString *ticket; -@property (nonatomic,assign) BOOL isGetUserInfoSuccess; - -@end -NS_ASSUME_NONNULL_END diff --git a/YuMi/Structure/MVP/Model/AccountModel.m.backup b/YuMi/Structure/MVP/Model/AccountModel.m.backup deleted file mode 100644 index 331487a..0000000 --- a/YuMi/Structure/MVP/Model/AccountModel.m.backup +++ /dev/null @@ -1,15 +0,0 @@ -// -// TokenModel.m -// YUMI -// -// Created by zu on 2021/9/8. -// - -#import "AccountModel.h" - -@implementation AccountModel - -@end -@implementation HomeUserModel - -@end diff --git a/YuMi/Structure/MVP/Model/BaseModel.h.backup b/YuMi/Structure/MVP/Model/BaseModel.h.backup deleted file mode 100644 index b9e7606..0000000 --- a/YuMi/Structure/MVP/Model/BaseModel.h.backup +++ /dev/null @@ -1,26 +0,0 @@ -// -// BaseModel.h -// YUMI -// -// Created by zu on 2021/9/8. -// - -#import "NSObject+MJExtension.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface BaseModel : NSObject -@property(nonatomic,assign) long timestamp; -@property (nonatomic , strong) id data; -@property (nonatomic , assign) NSInteger code; -@property (nonatomic , copy) NSString * message; -///注销的时间戳 因为后端返回的内容和code在同一层级 安卓已经发出去了 兼容就写在这里吧 请不要模仿 -@property (nonatomic,assign) long long cancelDate; -///账号封禁返回的code -///时间 -@property (nonatomic,copy) NSString * date; -///封禁的理由 -@property (nonatomic,copy) NSString *reason; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Structure/MVP/Model/BaseModel.m.backup b/YuMi/Structure/MVP/Model/BaseModel.m.backup deleted file mode 100644 index f532d96..0000000 --- a/YuMi/Structure/MVP/Model/BaseModel.m.backup +++ /dev/null @@ -1,12 +0,0 @@ -// -// BaseModel.m -// YUMI -// -// Created by zu on 2021/9/8. -// - -#import "BaseModel.h" - -@implementation BaseModel - -@end diff --git a/YuMi/Structure/MVP/Model/NSObject+AutoCoding.h.backup b/YuMi/Structure/MVP/Model/NSObject+AutoCoding.h.backup deleted file mode 100644 index 76b615f..0000000 --- a/YuMi/Structure/MVP/Model/NSObject+AutoCoding.h.backup +++ /dev/null @@ -1,25 +0,0 @@ -// -// NSObject+AutoCoding.h -// YYMobileFramework -// -// Created by wuwei on 14/6/13. -// Copyright (c) 2014年 YY Inc. All rights reserved. -// - -#import - -@interface NSObject (AutoCoding) - -// Coding -+ (NSDictionary *)codableProperties; -- (void)setWithCoder:(NSCoder *)aDecoder; - -// Properties access -- (NSDictionary *)codableProperties; -- (NSDictionary *)dictionaryRepresentation; - -// Loading / Saving -+ (instancetype)objectWithContentsOfFile:(NSString *)path; -- (BOOL)writeToFile:(NSString *)filePath atomically:(BOOL)useAuxiliaryFile; - -@end \ No newline at end of file diff --git a/YuMi/Structure/MVP/Model/NSObject+AutoCoding.m.backup b/YuMi/Structure/MVP/Model/NSObject+AutoCoding.m.backup deleted file mode 100644 index 6045f37..0000000 --- a/YuMi/Structure/MVP/Model/NSObject+AutoCoding.m.backup +++ /dev/null @@ -1,245 +0,0 @@ -// -// NSObject+AutoCoding.m -// YYMobileFramework -// -// Created by wuwei on 14/6/13. -// Copyright (c) 2014年 YY Inc. All rights reserved. -// - -#import "NSObject+AutoCoding.h" -#import - -#pragma GCC diagnostic ignored "-Wgnu" - -static NSString *const AutocodingException = @"AutocodingException"; - -@implementation NSObject (AutoCoding) - -+ (BOOL)supportsSecureCoding -{ - return YES; -} - -+ (instancetype)objectWithContentsOfFile:(NSString *)filePath -{ - //load the file - NSData *data = [NSData dataWithContentsOfFile:filePath]; - - //attempt to deserialise data as a plist - id object = nil; - if (data) - { - NSPropertyListFormat format; - object = [NSPropertyListSerialization propertyListWithData:data options:NSPropertyListImmutable format:&format error:NULL]; - - //success? - if (object) - { - //check if object is an NSCoded unarchive - if ([object respondsToSelector:@selector(objectForKey:)] && [(NSDictionary *)object objectForKey:@"$archiver"]) - { - object = [NSKeyedUnarchiver unarchiveObjectWithData:data]; - } - } - else - { - //return raw data - object = data; - } - } - - //return object - return object; -} - -- (BOOL)writeToFile:(NSString *)filePath atomically:(BOOL)useAuxiliaryFile -{ - //note: NSData, NSDictionary and NSArray already implement this method - //and do not save using NSCoding, however the objectWithContentsOfFile - //method will correctly recover these objects anyway - - //archive object - NSData *data = [NSKeyedArchiver archivedDataWithRootObject:self]; - return [data writeToFile:filePath atomically:useAuxiliaryFile]; -} - -+ (NSDictionary *)codableProperties -{ - unsigned int propertyCount; - __autoreleasing NSMutableDictionary *codableProperties = [NSMutableDictionary dictionary]; - objc_property_t *properties = class_copyPropertyList(self, &propertyCount); - for (unsigned int i = 0; i < propertyCount; i++) - { - //get property name - objc_property_t property = properties[i]; - const char *propertyName = property_getName(property); - __autoreleasing NSString *key = @(propertyName); - - //check if codable - //get property type - Class propertyClass = nil; - char *typeEncoding = property_copyAttributeValue(property, "T"); - switch (typeEncoding[0]) - { - case '@': - { - if (strlen(typeEncoding) >= 3) - { - char *className = strndup(typeEncoding + 2, strlen(typeEncoding) - 3); - __autoreleasing NSString *name = @(className); - NSRange range = [name rangeOfString:@"<"]; - if (range.location != NSNotFound) - { - name = [name substringToIndex:range.location]; - } - propertyClass = NSClassFromString(name) ?: [NSObject class]; - free(className); - } - break; - } - case 'c': - case 'i': - case 's': - case 'l': - case 'q': - case 'C': - case 'I': - case 'S': - case 'L': - case 'Q': - case 'f': - case 'd': - case 'B': - { - propertyClass = [NSNumber class]; - break; - } - case '{': - { - propertyClass = [NSValue class]; - break; - } - default: - break; - } - free(typeEncoding); - - if (propertyClass && [propertyClass conformsToProtocol:@protocol(NSSecureCoding)]) - { - //check if there is a backing ivar - char *ivar = property_copyAttributeValue(property, "V"); - if (ivar) - { - //check if ivar has KVC-compliant name - __autoreleasing NSString *ivarName = @(ivar); - if ([ivarName isEqualToString:key] || [ivarName isEqualToString:[@"_" stringByAppendingString:key]]) - { - //no setter, but setValue:forKey: will still work - codableProperties[key] = propertyClass; - } - free(ivar); - } - else - { - //check if property is dynamic and readwrite - char *dynamic = property_copyAttributeValue(property, "D"); - char *readonly = property_copyAttributeValue(property, "R"); - if (dynamic && !readonly) - { - //no ivar, but setValue:forKey: will still work - codableProperties[key] = propertyClass; - } - free(dynamic); - free(readonly); - } - } - } - - free(properties); - return codableProperties; -} - -- (NSDictionary *)codableProperties -{ - __autoreleasing NSDictionary *codableProperties = objc_getAssociatedObject([self class], _cmd); - if (!codableProperties) - { - codableProperties = [NSMutableDictionary dictionary]; - Class subclass = [self class]; - while (subclass != [NSObject class]) - { - [(NSMutableDictionary *)codableProperties addEntriesFromDictionary:[subclass codableProperties]]; - subclass = [subclass superclass]; - } - codableProperties = [NSDictionary dictionaryWithDictionary:codableProperties]; - - //make the association atomically so that we don't need to bother with an @synchronize - objc_setAssociatedObject([self class], _cmd, codableProperties, OBJC_ASSOCIATION_RETAIN); - } - return codableProperties; -} - -- (NSDictionary *)dictionaryRepresentation -{ - NSMutableDictionary *dict = [NSMutableDictionary dictionary]; - for (__unsafe_unretained NSString *key in [self codableProperties]) - { - id value = [self valueForKey:key]; - if (value) - dict[key] = value; - else - dict[key] = @"nil"; - } - return dict; -} - -- (void)setWithCoder:(NSCoder *)aDecoder -{ - BOOL secureAvailable = [aDecoder respondsToSelector:@selector(decodeObjectOfClass:forKey:)]; - BOOL secureSupported = [[self class] supportsSecureCoding]; - NSDictionary *properties = [self codableProperties]; - for (NSString *key in properties) - { - id object = nil; - Class propertyClass = properties[key]; - if (secureAvailable) - { - if ([propertyClass isEqual:[NSMutableAttributedString class]]) { - continue; - } - object = [aDecoder decodeObjectOfClass:propertyClass forKey:key]; - } - else - { - if ([propertyClass isEqual:[NSMutableAttributedString class]]) { - continue; - } - object = [aDecoder decodeObjectForKey:key]; - } - if (object) - { - if (secureSupported && ![object isKindOfClass:propertyClass]) - { - [NSException raise:AutocodingException format:@"Expected '%@' to be a %@, but was actually a %@", key, propertyClass, [object class]]; - } - [self setValue:object forKey:key]; - } - } -} - -- (instancetype)initWithCoder:(NSCoder *)aDecoder -{ - [self setWithCoder:aDecoder]; - return self; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder -{ - for (NSString *key in [self codableProperties]) - { - id object = [self valueForKey:key]; - if (object) [aCoder encodeObject:object forKey:key]; - } -} - -@end diff --git a/YuMi/Structure/MVP/Model/PIBaseModel.h.backup b/YuMi/Structure/MVP/Model/PIBaseModel.h.backup deleted file mode 100644 index 2b17959..0000000 --- a/YuMi/Structure/MVP/Model/PIBaseModel.h.backup +++ /dev/null @@ -1,16 +0,0 @@ -// -// PIBaseModel.h -// YuMi -// -// Created by duoban on 2023/11/15. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface PIBaseModel : NSObject - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Structure/MVP/Model/PIBaseModel.m.backup b/YuMi/Structure/MVP/Model/PIBaseModel.m.backup deleted file mode 100644 index 989c4bb..0000000 --- a/YuMi/Structure/MVP/Model/PIBaseModel.m.backup +++ /dev/null @@ -1,36 +0,0 @@ -// -// PIBaseModel.m -// YuMi -// -// Created by duoban on 2023/11/15. -// - -#import "PIBaseModel.h" - -@implementation PIBaseModel -- (NSString *)debugDescription { - //判断是否时NSArray 或者NSDictionary NSNumber 如果是的话直接返回 debugDescription - if ([self isKindOfClass:[NSArray class]] || [self isKindOfClass:[NSDictionary class]] || [self isKindOfClass:[NSString class]] || [self isKindOfClass:[NSNumber class]]) { - return [self debugDescription]; - } - //声明一个字典 - NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; - //得到当前class的所有属性 - uint count; - objc_property_t *properties = class_copyPropertyList([self class], &count); - - //循环并用KVC得到每个属性的值 - for (int i = 0; i -- %@",[self class],self,dictionary]; -} -@end diff --git a/YuMi/Structure/MVP/Model/UserInfoModel.h.backup b/YuMi/Structure/MVP/Model/UserInfoModel.h.backup deleted file mode 100644 index 79c257a..0000000 --- a/YuMi/Structure/MVP/Model/UserInfoModel.h.backup +++ /dev/null @@ -1,203 +0,0 @@ -// -// UserInfoModel.h -// xplan-ios -// -// Created by zu on 2021/9/14. -// - -#import "NSObject+MJExtension.h" - -#import "MomentsInfoModel.h" - - -NS_ASSUME_NONNULL_BEGIN - -@interface UsingPersonalBackground : PIBaseModel - -@property(nonatomic, assign) NSInteger effectType; // 装扮动效图片类型 空/0-图,1-mp4,2-svga -@property(nonatomic, assign) NSInteger status; -@property(nonatomic, assign) NSInteger id; -@property(nonatomic, assign) NSInteger partitionFlag; -@property(nonatomic, assign) NSTimeInterval updateTime; -@property(nonatomic, assign) NSTimeInterval createTime; -@property(nonatomic, copy) NSString *pic; -@property(nonatomic, copy) NSString *effect; -@property(nonatomic, copy) NSString *name; - -@end - -@interface InfoCardVO : PIBaseModel - -@property(nonatomic, assign) NSInteger effectType; // 装扮动效图片类型 空/0-图,1-mp4,2-svga -@property(nonatomic, copy) NSString *effect; - -@end - - -@interface UserInfoModel : PIBaseModel -@property (nonatomic , assign) NSInteger bindType; -@property (nonatomic , assign) NSInteger createTime; -@property (nonatomic , assign) BOOL parentMode; -@property (nonatomic , assign) BOOL isBindPhone; -@property (nonatomic , strong) NSObject * userExpand; -@property (nonatomic , assign) NSInteger erbanNo; -@property (nonatomic , assign) NSInteger registerDay; -@property (nonatomic , assign) BOOL isFirstCharge; -@property (nonatomic , assign) BOOL hasPrettyErbanNo; -@property (nonatomic , strong) NSObject * userLevelVo; -@property (nonatomic , assign) BOOL isBindApple; -@property (nonatomic , assign) NSInteger fansNum; -@property (nonatomic , assign) BOOL isBindBankCard; -@property (nonatomic , assign) BOOL hasRegPacket; -@property (nonatomic , assign) NSInteger gender; /// 性别 1:男 2:女 -@property (nonatomic , assign) NSInteger platformRole; /// 0 普通 1超管 -@property (nonatomic , assign) NSInteger uid; -@property (nonatomic , assign) NSInteger defUser; -@property (nonatomic , copy) NSString * phone; -@property (nonatomic , copy) NSString * email; -@property (nonatomic , copy) NSString * nick; -@property (nonatomic , assign) NSInteger remainDay; -@property (nonatomic , copy) NSString * avatar; -@property (nonatomic , copy) NSString * reviewingAvatar; -@property (nonatomic , assign) BOOL isReview; -@property (nonatomic , strong) NSObject * userInfoSkillVo; -@property (nonatomic,copy) NSString *region; -@property (nonatomic,copy) NSArray *labels; -@property (nonatomic , assign) BOOL newUser; -@property (nonatomic , assign) NSInteger followNum; -@property (nonatomic , assign) BOOL isBindPaymentPwd; -@property (nonatomic , assign) BOOL isBindXCZAccount; -@property (nonatomic , assign) BOOL isBindAlipay; -///是否绑定了密码 -@property (nonatomic , assign) BOOL isBindPasswd; -@property (nonatomic, assign) NSInteger visitNum;///访客数量 -@property (nonatomic, assign) NSInteger inRoomNum;///足迹 -///是否需要展示限时首充列表 -@property (nonatomic, assign) BOOL showLimitCharge; -///限时首充结束时间 -@property (nonatomic, assign) long limitChargeEndTime; -///相册 -@property (nonatomic, strong) NSArray *privatePhoto;//相册 -///签名 -@property (nonatomic,copy) NSString *userDesc; -///出生日期 -@property (nonatomic,assign) long birth; -///是否实名认证 -@property (nonatomic,assign) BOOL isCertified; -///铭牌背景 -@property (nonatomic, copy) NSString *nameplatePic; -///铭牌名称 -@property (nonatomic, copy) NSString *nameplateWord; -///是否自定义铭牌, -@property(nonatomic,assign) BOOL isCustomWord; -///如果在房间有直播中字段 -@property(nonatomic, copy) NSString * roomUid; -///如果在房间,房间的标题 -@property (nonatomic, copy) NSString *roomTitle; -///用户信息中的 座驾 并不需要CarModel 映射一下吧 -@property (nonatomic,copy) NSString *carEffect; -///座驾特效类型 0:普通, 1:VAP特效 -@property (nonatomic, assign) NSInteger otherViewType; -///用户信息中需要用VAP播放的座驾, 映射一下 -@property (nonatomic, copy) NSString *viewUrl; -///用户信息中的 座驾昵称 并不需要CarModel 映射一下吧 -@property (nonatomic,copy) NSString *carName; -///用户信息中的 头饰的动画 从 HeadwearModel 映射而来 -@property (nonatomic,copy) NSString *headwearEffect; -///用户信息中的 头饰的动画 如果没有的话 就用这个 从 HeadwearModel 映射而来 -@property (nonatomic,copy) NSString *headwearPic; -@property (nonatomic,assign) NSInteger headwearType; // 1 = svga, 表示 headwearEffect 是 svga 的链接 -@property (nonatomic,assign) NSInteger headWearType; // 1 = svga, 表示 headwearEffect 是 svga 的链接, W 大小写不一致是后端的原因,这里做个兼容 -///头饰(新字段) 上麦的时候 在扩展字段中的 只用在坑位上 从 HeadwearModel 映射而来 -@property (nonatomic,copy) NSString *headWearUrl; -#pragma mark - 相亲房的字段 -///是否为相亲模式VIP坑位 -@property (nonatomic,assign) BOOL vipMic; -///帽子 相亲中收到礼物值最高的那个人 男神 女神都有 -@property (nonatomic,copy) NSString *capUrl; -///是不是选择了人 -@property (nonatomic,assign) BOOL hasSelectUser; -///所选择的麦序 -@property (nonatomic,assign) int selectMicPosition; -///VIP信息 -@property (nonatomic, strong) NSObject *userVipInfoVO; -///当前使用的资料卡装扮 -@property (nonatomic, copy) NSString *userInfoCardPic; -///麦位光圈链接 -@property (nonatomic, copy) NSString *micCircle; -///麦位昵称颜色 -@property (nonatomic, copy) NSString *micNickColor; - -///技能卡图标列表 -@property (nonatomic, strong) NSArray *absCardPics; - -///跟随的 本地添加的字段 -@property (nonatomic,copy) NSString *fromNick; -@property (nonatomic,copy) NSString *fromUid; -///安卓房间公屏气泡 -@property (nonatomic, copy) NSString *androidBubbleUrl; -///iOS房间公屏气泡 -@property (nonatomic, copy) NSString *iosBubbleUrl; -#pragma mark - 小游戏 -///礼物墙中的礼物 -@property (nonatomic,strong) NSArray *userGiftWall; -///礼物墙中的幸运礼物礼物 -@property (nonatomic,strong) NSArray *userLuckyBagGiftWall; -///是否防被踢 -@property (nonatomic, assign) BOOL preventKick; -///是否符合渠道打招呼 -@property (nonatomic,assign) BOOL fromSayHelloChannel; -///是否是封号用户 -@property (nonatomic,assign) BOOL banAccount; -///用户的动态 -@property (nonatomic,strong) NSArray *dynamicInfo; -///区号 -@property (nonatomic,copy) NSString *phoneAreaCode; - - -///用户所在区 -@property(nonatomic,copy) NSString *partitionId; -/// -/// -@property (nonatomic,strong) NSMutableAttributedString *levelAtt; -@property (nonatomic,strong) NSMutableAttributedString *idAtt; -///是否是代充代理 -@property(nonatomic,assign) BOOL isRechargeUser; -///pk时不能禁麦 -@property(nonatomic,assign) BOOL isNoProhibitMic; - -@property (nonatomic, strong) NSObject *medals; - -@property (nonatomic, strong) NSObject *relationUserVO; - -@property (nonatomic, strong) NSObject *guildInfo; - -@property (nonatomic, copy) NSArray *userNameplateList; - -@property(nonatomic, strong) UsingPersonalBackground *usingPersonalBackground; - -@property(nonatomic, strong) InfoCardVO *infoCardVo; - -/// 是否超管身份 -@property(nonatomic, assign) BOOL hasSuperRole; - -@property(nonatomic, copy) NSString *guildNameplateIcon; - -@property(nonatomic, assign) NSInteger uploadGifAvatarPrice; - -@property(nonatomic, copy) NSString *regionIcon; -@property(nonatomic, copy) NSString *visitTimeDesc; - -@property (nonatomic, copy) NSArray *medalsPic; - -- (BOOL)isUserValid; -- (NSString *)userIDString; - -- (BOOL)isHeadWearSVGA; - -- (BOOL)isArabia; -- (BOOL)isEnglish; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Structure/MVP/Model/UserInfoModel.m.backup b/YuMi/Structure/MVP/Model/UserInfoModel.m.backup deleted file mode 100644 index d6e6fdb..0000000 --- a/YuMi/Structure/MVP/Model/UserInfoModel.m.backup +++ /dev/null @@ -1,76 +0,0 @@ -// -// UserInfoModel.m -// xplan-ios -// -// Created by zu on 2021/9/14. -// - -#import "UserInfoModel.h" - -@implementation InfoCardVO - -@end - -@implementation UsingPersonalBackground - -@end - -@implementation UserInfoModel - -+ (NSDictionary *)objectClassInArray { - return @{ - @"dynamicInfo":MomentsInfoModel.class, - }; -} - -///如果一个模型中需要字段映射的话 比如id -> ID name -> other.name -+ (NSDictionary *)replacedKeyFromPropertyName { - return @{@"carEffect": @"carport.effect", - @"viewUrl": @"carport.viewUrl", - @"otherViewType": @"carport.otherViewType", - @"headwearEffect" : @"userHeadwear.effect", - @"headwearPic" : @"userHeadwear.pic", - @"headwearType" : @"userHeadwear.type", - @"carName": @"carport.name", - @"reviewingAvatar" : @"newAvatar" - }; -} - -- (BOOL)isUserValid { - return self.uid > 0; -} - -- (NSString *)userIDString { - return [NSString stringWithFormat:@"%ld", (long)self.uid]; -} - -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[UserInfoModel class]]) { - return NO; - } - UserInfoModel *other = (UserInfoModel *)object; - return self.uid == other.uid && - [self.nick isEqualToString:other.nick] && - [self.avatar isEqualToString:self.avatar]; -} - -- (NSUInteger)hash { - return self.nick.hash ^ self.uid; -} - -- (BOOL)isHeadWearSVGA { - return self.headwearType == 1 || self.headWearType == 1; -} - -- (BOOL)isArabia { - return [self.partitionId isEqualToString:@"2"]; -} - -- (BOOL)isEnglish { - return [self.partitionId isEqualToString:@"1"]; -} - -@end diff --git a/YuMi/Structure/MVP/Presenter/BaseMvpPresenter.h.backup b/YuMi/Structure/MVP/Presenter/BaseMvpPresenter.h.backup deleted file mode 100644 index a1e396b..0000000 --- a/YuMi/Structure/MVP/Presenter/BaseMvpPresenter.h.backup +++ /dev/null @@ -1,37 +0,0 @@ -// -// BaseMvpPresenter.h -// YUMI -// -// Created by admin on 2023/3/9. -// - -#import -#import "BaseMvpProtocol.h" -#import "HttpRequestHelper.h" - -NS_ASSUME_NONNULL_BEGIN - -typedef void(^HttpSuccess)(BaseModel *data); -typedef void(^HttpFail)(NSInteger code, NSString * _Nullable msg); - -@interface BaseMvpPresenter : NSObject - -- (void)attatchView:(id)view; -- (id)getView; -- (void)detatchView; -- (void)logout; -- (void)tokenInvalid; -- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success; -- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success showLoading:(BOOL)loading; -- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success errorToast:(BOOL)toast; -- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success showLoading:(BOOL)loading errorToast:(BOOL)toast; -- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success fail:(HttpFail _Nullable)fail; -- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success fail:(HttpFail _Nullable)fail showLoading:(BOOL)loading; -- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success fail:(HttpFail _Nullable)fail errorToast:(BOOL)toast; -- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess _Nonnull)success fail:(HttpFail _Nullable)fail showLoading:(BOOL)loading errorToast:(BOOL)toast; - - - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Structure/MVP/Presenter/BaseMvpPresenter.m.backup b/YuMi/Structure/MVP/Presenter/BaseMvpPresenter.m.backup deleted file mode 100644 index 71ae103..0000000 --- a/YuMi/Structure/MVP/Presenter/BaseMvpPresenter.m.backup +++ /dev/null @@ -1,137 +0,0 @@ -// -// BaseMvpPresenter.m -// YUMI -// -// Created by admin on 2023/3/9. -// - -#import "BaseMvpPresenter.h" -#import "AccountInfoStorage.h" -#import "BaseNavigationController.h" - -@interface BaseMvpPresenter() - -@property (nonatomic, weak) id view; - -@end - -@implementation BaseMvpPresenter - -- (void)attatchView:(id)view { - self.view = view; -} - -- (id)getView { - return self.view; -} - -- (void)logout { - -} - -- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success { - return [self createHttpCompletion:success fail:nil]; -} - -- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success showLoading:(BOOL)loading { - return [self createHttpCompletion:success fail:nil showLoading:loading]; -} - -- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success errorToast:(BOOL)toast { - return [self createHttpCompletion:success fail:nil errorToast:toast]; -} - -- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success showLoading:(BOOL)loading errorToast:(BOOL)toast { - return [self createHttpCompletion:success fail:nil showLoading:loading errorToast:toast]; -} - -- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail { - return [self createHttpCompletion:success fail:fail showLoading:NO errorToast:YES]; -} - -- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail showLoading:(BOOL)loading { - return [self createHttpCompletion:success fail:fail showLoading:loading errorToast:YES]; -} - -- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail errorToast:(BOOL)toast { - return [self createHttpCompletion:success fail:fail showLoading:NO errorToast:toast]; -} - -- (HttpRequestHelperCompletion)createHttpCompletion:(HttpSuccess)success fail:(HttpFail)fail showLoading:(BOOL)loading errorToast:(BOOL)toast { - if (loading) { - [self.view showAnchorLoading]; - } - return ^(BaseModel *data, NSInteger code, NSString * _Nullable msg) { - if (loading) { - [self.view hideHUD]; - } - if (code == 200) { - success(data); - return; - } - - switch (code) { - case 401: // 登录过期 - [self logout]; - return; - case 407: - case 408: - [self accountBanned:data]; - return; - case 1415: // 未完善用户信息 - [[self getView] completeUserInfo]; - return; - case 3009: // 账号已注销 -// [[self getView] accountCanceled:data.model2dictionary]; -// return; - case 31005: {//余额不足 - } - break; - case 30000: {// 青少年模式进房错误,进行弹窗处理,同时不显示 toast。 - } - break; - case 10111: // 金额过大,需要先实名认证 - [self.view hideHUD]; - [[self getView] showRealNameAuthenticationTipsAlertView]; - return; - case 10108: // 未实名认证 - [self.view hideHUD]; - [[self getView] showRealNameAuthenticationTipsAlertView]; - return; - case 25000: {// 在青少年模式下,充值已达上限 - } - } - - if (toast && [self.view respondsToSelector:@selector(showErrorToast:)]) { - [self.view showErrorToast:msg]; - } - - if (fail) { - fail(code, msg); - } - }; -} - -- (void)detatchView { - -} - -- (void)accountBanned:(BaseModel *)data { - TTAlertConfig * config = [[TTAlertConfig alloc] init]; - config.title = YMLocalizedString(@"MvpViewController6"); - NSString *dateDes = [PLTimeUtil getDateWithYYMMDD:data.date]; - NSString * title = [NSString stringWithFormat:YMLocalizedString(@"MvpViewController7"), data.reason,dateDes]; - TTAlertMessageAttributedConfig * inviteAlertConfig = [[TTAlertMessageAttributedConfig alloc] init]; - inviteAlertConfig.text = dateDes; - inviteAlertConfig.color = [DJDKMIMOMColor appMainColor]; - inviteAlertConfig.font = [UIFont systemFontOfSize:15]; - config.message = title; - config.messageAttributedConfig = @[inviteAlertConfig]; - [TTPopup alertWithConfig:config confirmHandler:^{ } cancelHandler:^{ }]; -} - -- (void)tokenInvalid { - -} - -@end diff --git a/YuMi/Structure/MVP/Protocol/BaseMvpProtocol.h.backup b/YuMi/Structure/MVP/Protocol/BaseMvpProtocol.h.backup deleted file mode 100644 index e74fd59..0000000 --- a/YuMi/Structure/MVP/Protocol/BaseMvpProtocol.h.backup +++ /dev/null @@ -1,25 +0,0 @@ -// -// BaseMvpProtocol.h -// YUMI -// -// Created by admin on 2023/3/9. -// - -#import -#import "BaseViewController.h" - -NS_ASSUME_NONNULL_BEGIN -@class BaseModel; -@protocol BaseMvpProtocol - -@optional - -- (void)completeUserInfo; -- (void)accountCanceled:(NSDictionary *)data; - -///实名认证弹窗 -- (void)showRealNameAuthenticationTipsAlertView; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Structure/MVP/View/MvpViewController.h.backup b/YuMi/Structure/MVP/View/MvpViewController.h.backup deleted file mode 100644 index 51dd361..0000000 --- a/YuMi/Structure/MVP/View/MvpViewController.h.backup +++ /dev/null @@ -1,31 +0,0 @@ -// -// MvpViewController.h -// YUMI -// -// Created by admin on 2023/3/9. -// - -#import "BaseViewController.h" -#import "BaseMvpPresenter.h" - - - -NS_ASSUME_NONNULL_BEGIN - - -typedef void(^HeaderRefreshComplete)(void); - -@interface MvpViewController : BaseViewController - -@property (nonatomic, strong) __kindof T presenter; - -- (__kindof T)createPresenter; - -- (void)setupTopTheme; - -- (void)setupCustomNavigationBar:(void(^)(void))backAction title:(NSString *)title titleColor:(UIColor *)color; -- (void)setupCustonNavigationRightButtons:(NSArray *)array sizes:(NSArray *)sizes; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Structure/MVP/View/MvpViewController.m.backup b/YuMi/Structure/MVP/View/MvpViewController.m.backup deleted file mode 100644 index 0394cc4..0000000 --- a/YuMi/Structure/MVP/View/MvpViewController.m.backup +++ /dev/null @@ -1,204 +0,0 @@ -// -// MvpViewController.m -// YUMI -// -// Created by admin on 2023/3/9. -// - -#import "MvpViewController.h" -#import "BaseMvpProtocol.h" -#import "BaseMvpPresenter.h" -#import "BaseNavigationController.h" -//Tool -#import "TTPopup.h" -#import "PLTimeUtil.h" -#import "DJDKMIMOMColor.h" -#import "YUMIMacroUitls.h" -#import "YUMIHtmlUrl.h" -#import "BSRealTimeView.h" - -@interface MvpViewController () - -@property (nonatomic, copy) void(^backAction)(void); -@property (nonatomic, strong) UILabel *mvpTitleLabel; -@property (nonatomic, strong) UIButton *backButton; - -@end - -@implementation MvpViewController - -- (__kindof id)presenter { - if (_presenter == nil) { - _presenter = [self createPresenter]; - [_presenter attatchView:self]; - } - return _presenter; -} - -- (__kindof id)createPresenter { - return [[BaseMvpPresenter alloc] init]; -} - -- (void)setupTopTheme { - -} - -- (void)setupCustomNavigationBar:(void(^)(void))backAction title:(NSString *)title titleColor:(UIColor *)color { - UILabel *titleLabel = [self mvpTitleLabel]; - titleLabel.text = title; - titleLabel.textColor = color; - [self.view addSubview:titleLabel]; - [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.mas_equalTo(self.view); - make.top.mas_equalTo(self.view).offset(kStatusBarHeight); - make.height.mas_equalTo(22); - }]; - - UIButton *backButton = [self mvpBackButton]; - [self.view addSubview:backButton]; - [backButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(self.view).offset(16); - make.centerY.mas_equalTo(titleLabel); - make.size.mas_equalTo(CGSizeMake(22, 22)); - }]; - - self.backAction = backAction; -} - -- (void)setupCustonNavigationRightButtons:(NSArray *)array - sizes:(NSArray *)sizes { - if (array.count > 0 && self->_mvpTitleLabel) { - CGFloat trailing = -16; - for (UIButton *b in array) { - NSInteger index = [array indexOfObject:b]; - NSValue *sizeValue = [sizes xpSafeObjectAtIndex:index]; - [self.view addSubview:b]; - [b mas_makeConstraints:^(MASConstraintMaker *make) { - make.trailing.mas_equalTo(self.view).offset(trailing); - make.centerY.mas_equalTo(self.mvpTitleLabel); - make.size.mas_equalTo([sizeValue CGSizeValue]); - }]; - - trailing -= 14 + [sizeValue CGSizeValue].width; - } - } -} - -- (void)didTapBack { - if (self.backAction) { - self.backAction(); - } - [self.navigationController popViewControllerAnimated:YES]; -} - -- (void)viewDidLoad { - [super viewDidLoad]; -#ifdef DEBUG - for (id obj in kWindow.subviews) { - if([obj isKindOfClass:[BSRealTimeView class]]){ - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - BSRealTimeView *timeView = (BSRealTimeView *)obj; - [timeView removeFromSuperview]; - [kWindow addSubview:timeView]; - }); - break; - } - } -#else -#endif -} - -- (void)accountCanceled:(NSDictionary *)data { - NSString *date = [NSString stringWithFormat:@"%.0f",[[data objectForKey:@"cancelDate"] doubleValue]]; - NSString *dateDes = [NSString stringWithFormat:YMLocalizedString(@"MvpViewController0"), [PLTimeUtil getDateWithYYMMDD:date]]; - NSString *msg = [NSString stringWithFormat:YMLocalizedString(@"MvpViewController1.1"), dateDes]; - if ([[data objectForKey:@"cancelDate"] doubleValue] == 0) { - dateDes = @""; - msg = YMLocalizedString(@"MvpViewController1.2"); - } - - TTAlertMessageAttributedConfig *dateAttrConfig = [[TTAlertMessageAttributedConfig alloc] init]; - dateAttrConfig.text = dateDes; - dateAttrConfig.color = DJDKMIMOMColor.appMainColor; - - TTAlertConfig *config = [[TTAlertConfig alloc] init]; - config.actionStyle = 0; - config.title = YMLocalizedString(@"MvpViewController2"); - config.message = msg; - config.messageAttributedConfig = @[dateAttrConfig]; - - [TTPopup alertWithConfig:config confirmHandler:^{ - - } cancelHandler:^{ - - }]; -} - -- (void)completeUserInfo { - -} - -///实名认证弹窗 -- (void)showRealNameAuthenticationTipsAlertView { - TTAlertConfig *config = [[TTAlertConfig alloc] init]; - config.message = YMLocalizedString(@"MvpViewController3"); - config.messageLineSpacing = 4; - config.confirmButtonConfig.title = YMLocalizedString(@"TTAlertConfig0"); - config.confirmButtonConfig.titleColor = UIColor.whiteColor; - config.confirmButtonConfig.backgroundColor = [DJDKMIMOMColor appMainColor]; - - TTAlertMessageAttributedConfig *nameAttrConf = [[TTAlertMessageAttributedConfig alloc] init]; - nameAttrConf.text = YMLocalizedString(@"MvpViewController5"); - nameAttrConf.color = [DJDKMIMOMColor appMainColor]; - config.messageAttributedConfig = @[nameAttrConf]; - - [TTPopup alertWithConfig:config confirmHandler:^{ - - } cancelHandler:^{ - }]; -} - -/////封禁账号 -//- (void)accountBanned:(BaseModel *)data { -// TTAlertConfig * config = [[TTAlertConfig alloc] init]; -// config.title = YMLocalizedString(@"MvpViewController6"); -// NSString *dateDes = [PLTimeUtil getDateWithYYMMDD:data.date]; -// NSString * title = [NSString stringWithFormat:YMLocalizedString(@"MvpViewController7"), data.reason,dateDes]; -// TTAlertMessageAttributedConfig * inviteAlertConfig = [[TTAlertMessageAttributedConfig alloc] init]; -// inviteAlertConfig.text = dateDes; -// inviteAlertConfig.color = [DJDKMIMOMColor appMainColor]; -// inviteAlertConfig.font = [UIFont systemFontOfSize:15]; -// config.message = title; -// config.messageAttributedConfig = @[inviteAlertConfig]; -// [TTPopup alertWithConfig:config confirmHandler:^{ -// -// } cancelHandler:^{ -// -// }]; -//} - -- (UILabel *)mvpTitleLabel { - if (!_mvpTitleLabel) { - UILabel *label = [[UILabel alloc] init]; - label.textAlignment = NSTextAlignmentCenter; - label.font = kFontMedium(17); - label.textColor = UIColorFromRGB(0xD9E7F7); - _mvpTitleLabel = label; - } - return _mvpTitleLabel; -} - -- (UIButton *)mvpBackButton { - if (!_backButton) { - UIButton *b = [UIButton buttonWithType:UIButtonTypeCustom]; - [b setImage:kImage(@"common_nav_back_white") - forState:UIControlStateNormal]; - [b addTarget:self - action:@selector(didTapBack) - forControlEvents:UIControlEventTouchUpInside]; - _backButton = b; - } - return _backButton; -} - -@end diff --git a/YuMi/Tools/Bundle/NSBundle+Localizable.h.backup b/YuMi/Tools/Bundle/NSBundle+Localizable.h.backup deleted file mode 100644 index 52f544b..0000000 --- a/YuMi/Tools/Bundle/NSBundle+Localizable.h.backup +++ /dev/null @@ -1,20 +0,0 @@ -// -// NSBundle+Localizable.h -// YuMi -// -// Created by YuMi on 2023/6/19. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface NSBundle (Localizable) -+(NSString *)ymLocalizedStringForKey:(NSString *)key; -+(NSString *)ymLocalizedStringForKey:(NSString *)key value:(NSString *)value; -+(void)setLanguageText:(NSString *)language; -+(NSString *)uploadLanguageText; -+(NSString *)getLanguageText; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Tools/Bundle/NSBundle+Localizable.m.backup b/YuMi/Tools/Bundle/NSBundle+Localizable.m.backup deleted file mode 100644 index a2f4662..0000000 --- a/YuMi/Tools/Bundle/NSBundle+Localizable.m.backup +++ /dev/null @@ -1,92 +0,0 @@ -// -// NSBundle+Localizable.m -// YuMi -// -// Created by YuMi on 2023/6/19. -// - -#import "NSBundle+Localizable.h" -#import "YMLanguageConfig.h" -#import - -// 定义常量用于存储当前语言的 key -static NSString * const kSaveCurLanguageKey = @"kSaveCurLanguage"; -static NSString * const kResourceType = @"lproj"; - -@implementation NSBundle (Localizable) - -+(void)load{ - Method oldMethod = class_getClassMethod(self, @selector(mj_localizedStringForKey:)); - Method newMethod = class_getClassMethod(self, @selector(ms_localizedStringForKey:)); - method_exchangeImplementations(oldMethod, newMethod); -} -+ (NSString *)ms_localizedStringForKey:(NSString *)key{ - return [self ymLocalizedStringForKey:key]; -} -+(NSString *)ymLocalizedStringForKey:(NSString *)key -{ - return [self ymLocalizedStringForKey:key value:@""]; -} - -+(NSString *)ymLocalizedStringForKey:(NSString *)key value:(NSString *)value -{ - NSString *language = [NSBundle getLanguageText]; - NSBundle *bundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:language - ofType:kResourceType]]; - value = [bundle localizedStringForKey:key - value:value - table:nil]; - return value; -} - -+(NSString *)getLanguageText{ - // EP 白包版本强制使用英文 - NSString *saveLanguage = [[NSUserDefaults standardUserDefaults] valueForKey:kSaveCurLanguageKey]; - if (saveLanguage && [saveLanguage isEqualToString:@"en"]){ - return saveLanguage; - } - - // 强制返回英文,忽略系统语言设置 - return @"en"; -} - -+(NSString *)uploadLanguageText{ - // EP 白包版本强制使用英文 - return @"en"; -} - -+(void)setLanguageText:(NSString *)language{ - [[NSUserDefaults standardUserDefaults]setValue:language forKey:kSaveCurLanguageKey]; - [[NSUserDefaults standardUserDefaults]synchronize]; -} - -// 辅助方法,用于映射本地化语言 - 重构为使用统一配置 -+ (NSString *)mapLanguageForLocalization:(NSString *)language { - // 首先尝试精确匹配 - for (NSDictionary *langConfig in [YMLanguageConfig supportedLanguages]) { - NSString *code = langConfig[@"code"]; - NSString *localizationCode = langConfig[@"localizationCode"]; - - if ([language isEqualToString:code] || [language isEqualToString:localizationCode]) { - return localizationCode; - } - } - - // 然后尝试前缀匹配 - for (NSDictionary *langConfig in [YMLanguageConfig supportedLanguages]) { - NSString *code = langConfig[@"code"]; - if ([language hasPrefix:code]) { - return langConfig[@"localizationCode"]; - } - } - - // 特殊处理:pt-BR 和 pt 的映射 - if ([language hasPrefix:@"pt"]) { - return @"pt-BR"; - } - - // 默认返回英文 - return [YMLanguageConfig defaultLanguage]; -} - -@end diff --git a/YuMi/Tools/Bundle/YMLanguageConfig.h.backup b/YuMi/Tools/Bundle/YMLanguageConfig.h.backup deleted file mode 100644 index 05905af..0000000 --- a/YuMi/Tools/Bundle/YMLanguageConfig.h.backup +++ /dev/null @@ -1,31 +0,0 @@ -// -// YMLanguageConfig.h -// YuMi -// -// Created by Linus on 2024/12/19. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface YMLanguageConfig : NSObject - -/// 支持的语言列表 -+ (NSArray *)supportedLanguages; - -/// 根据语言代码获取显示名称 -+ (NSString *)displayNameForLanguageCode:(NSString *)languageCode; - -/// 根据语言代码获取本地化代码 -+ (NSString *)localizationCodeForLanguageCode:(NSString *)languageCode; - -/// 检查是否为RTL语言 -+ (BOOL)isRTLanguage:(NSString *)languageCode; - -/// 获取默认语言 -+ (NSString *)defaultLanguage; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Tools/Bundle/YMLanguageConfig.m.backup b/YuMi/Tools/Bundle/YMLanguageConfig.m.backup deleted file mode 100644 index e19ccef..0000000 --- a/YuMi/Tools/Bundle/YMLanguageConfig.m.backup +++ /dev/null @@ -1,55 +0,0 @@ -// -// YMLanguageConfig.m -// YuMi -// -// Created by Linus on 2024/12/19. -// - -#import "YMLanguageConfig.h" - -@implementation YMLanguageConfig - -+ (NSArray *)supportedLanguages { - static NSArray *languages = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - // EP 白包版本只支持英文 - languages = @[ - @{@"code": @"en", @"localizationCode": @"en", @"displayName": @"English", @"isRTL": @NO} - ]; - }); - return languages; -} - -+ (NSString *)displayNameForLanguageCode:(NSString *)languageCode { - for (NSDictionary *language in [self supportedLanguages]) { - if ([language[@"code"] isEqualToString:languageCode]) { - return language[@"displayName"]; - } - } - return @"English"; // 默认返回英文 -} - -+ (NSString *)localizationCodeForLanguageCode:(NSString *)languageCode { - for (NSDictionary *language in [self supportedLanguages]) { - if ([language[@"code"] isEqualToString:languageCode]) { - return language[@"localizationCode"]; - } - } - return @"en"; // 默认返回英文 -} - -+ (BOOL)isRTLanguage:(NSString *)languageCode { - for (NSDictionary *language in [self supportedLanguages]) { - if ([language[@"code"] isEqualToString:languageCode]) { - return [language[@"isRTL"] boolValue]; - } - } - return NO; -} - -+ (NSString *)defaultLanguage { - return @"en"; -} - -@end diff --git a/YuMi/Tools/CountDown/CountDownHelper.h.backup b/YuMi/Tools/CountDown/CountDownHelper.h.backup deleted file mode 100644 index 0dfda72..0000000 --- a/YuMi/Tools/CountDown/CountDownHelper.h.backup +++ /dev/null @@ -1,48 +0,0 @@ -// -// CountDownHelper.h -// xplan-ios -// -// Created by 冯硕 on 2021/9/15. -// 倒计时 - -#import - -NS_ASSUME_NONNULL_BEGIN - -@protocol CountDownHelperDelegate -@optional -///倒计时结束 -- (void)onCountdownFinish; -///倒计时进行 -- (void)onCountdownOpen:(int)time; -///顺计时结束 -- (void)onClockwiseFinish; -///顺计时进行 -- (void)onClockwiseOpen:(CGFloat)time; -@end - - -@interface CountDownHelper : NSObject -///倒计时是否完成 -@property (nonatomic,assign) BOOL isCountdownFinish; -///顺计时的秒数 -@property (nonatomic,assign) CGFloat seconds; -///代理 -@property (nonatomic,weak) id delegate; - -///单例 -+ (instancetype)shareHelper; -// 停止倒计时 -- (void)stopCountDown; -///开始倒计时 -- (void)openCountdownWithTime:(int)totalTime; - -// 停止顺计时 -- (void)stopClockwise; -///开始顺计时 -- (void)openClockwiseWithTime:(int)totalTime; - - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Tools/CountDown/CountDownHelper.m.backup b/YuMi/Tools/CountDown/CountDownHelper.m.backup deleted file mode 100644 index 7219eba..0000000 --- a/YuMi/Tools/CountDown/CountDownHelper.m.backup +++ /dev/null @@ -1,132 +0,0 @@ -// -// CountDownHelper.m -// xplan-ios -// -// Created by 冯硕 on 2021/9/15. -// - -#import "CountDownHelper.h" - -@interface CountDownHelper () -@property (strong, nonatomic) dispatch_source_t timer; -@property (strong, nonatomic) dispatch_source_t clockwiseTimer; -@end - -@implementation CountDownHelper --(void)dealloc{ - [self stopCountDown]; -} --(instancetype)init{ - self = [super init]; - if(self){ - self.isCountdownFinish = YES; - self.seconds = 1.0; - } - return self; -} -+ (instancetype)shareHelper { - static dispatch_once_t onceToken; - static CountDownHelper * helper = nil; - dispatch_once(&onceToken, ^{ - helper = [[CountDownHelper alloc] init]; - }); - return helper; -} - -// 停止倒计时 -- (void)stopCountDown { - if (self.timer != nil) { - dispatch_source_cancel(self.timer); - self.timer = nil; - } - self.isCountdownFinish = YES; -} -- (void)stopClockwise { - if (self.clockwiseTimer != nil) { - dispatch_source_cancel(self.clockwiseTimer); - self.clockwiseTimer = nil; - } - self.isCountdownFinish = YES; -} -// 开始倒计时 -- (void)openCountdownWithTime:(int)totalTime{ - if (time <= 0) { - return; - } - - __block CGFloat time = (CGFloat)totalTime; //倒计时时间 - - if (self.timer != nil) { - dispatch_source_cancel(self.timer); - } - dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); - self.timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue); - dispatch_source_set_timer(self.timer,dispatch_walltime(NULL, 0),1*NSEC_PER_SEC, 0); //每秒执行 - __weak typeof(self) weakself = self; - dispatch_source_set_event_handler(self.timer, ^{ - __strong typeof(weakself) self = weakself; - if(time <= 0){ //倒计时结束,关闭 - dispatch_source_cancel(self.timer); - dispatch_async(dispatch_get_main_queue(), ^{ - self.isCountdownFinish = YES; - if (self.delegate && [self.delegate respondsToSelector:@selector(onCountdownFinish)]) { - [self.delegate onCountdownFinish]; - - } - }); - }else{ - time--; - self.isCountdownFinish = NO; - dispatch_async(dispatch_get_main_queue(), ^{ - //设置按钮显示读秒效果 - if (self.delegate && [self.delegate respondsToSelector:@selector(onCountdownOpen:)]) { - [self.delegate onCountdownOpen:time]; - } - }); - - } - }); - dispatch_resume(self.timer); -} - -- (void)openClockwiseWithTime:(int)totalTime{ - if (totalTime <= 0) { - return; - } - __block CGFloat backTime = 0; //倒计时时间 - if (self.clockwiseTimer != nil) { - dispatch_source_cancel(self.clockwiseTimer); - } - dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); - self.clockwiseTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue); - dispatch_source_set_timer(self.clockwiseTimer,dispatch_walltime(NULL, 0),self.seconds*NSEC_PER_SEC, 0); //每秒执行 - __weak typeof(self) weakself = self; - dispatch_source_set_event_handler(self.clockwiseTimer, ^{ - __strong typeof(weakself) self = weakself; - if(backTime > totalTime){ //倒计时结束,关闭 - dispatch_source_cancel(self.clockwiseTimer); - dispatch_async(dispatch_get_main_queue(), ^{ - self.isCountdownFinish = YES; - if (self.delegate && [self.delegate respondsToSelector:@selector(onClockwiseFinish)]) { - [self.delegate onClockwiseFinish]; - - } - }); - }else{ - backTime = backTime + self.seconds; - self.isCountdownFinish = NO; - dispatch_async(dispatch_get_main_queue(), ^{ - //设置按钮显示读秒效果 - - if(self.delegate && [self.delegate respondsToSelector:@selector(onClockwiseOpen:)]){ - [self.delegate onClockwiseOpen:backTime]; - } - - - }); - - } - }); - dispatch_resume(self.clockwiseTimer); -} -@end diff --git a/YuMi/Tools/Date/NSDate+DateUtils.h.backup b/YuMi/Tools/Date/NSDate+DateUtils.h.backup deleted file mode 100644 index 32ed6f7..0000000 --- a/YuMi/Tools/Date/NSDate+DateUtils.h.backup +++ /dev/null @@ -1,42 +0,0 @@ -// -// NSDate+DateUtils.h -// YUMI -// -// Created by YUMI on 2022/4/12. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface NSDate (DateUtils) -+ (NSDateFormatter *)shareDateFormatter; - -- (NSInteger)daysBetween:(NSDate *)aDate; - -- (NSDate *)dateByAddingDays:(NSInteger)days; -- (NSDate *)dateByAddingSeconds:(NSInteger)seconds; - -- (NSString *)stringForFormat:(NSString *)format; - -+ (NSString *)stringFromDate:(NSDate *)date; -+ (NSDate *)at_dateFromString:(NSString *)dateString; -+(NSString *)getNowTimeTimestamp; -+ (NSString *)getCurrentTimeWithFormat:(NSString *)format; -+(NSString *)timestampSwitchTime:(NSInteger)timestamp andFormatter:(NSString *)format; -#pragma mark - 将某个时间戳转化成 时间 -+ (NSString *)timestampSwitchTime:(NSInteger)timestamp formatter:(NSString *)format; -+ (NSInteger)pleaseInsertStarTimeo:(NSString *)time1 andInsertEndTime:(NSString *)time2; - -- (NSString *) stringForYearMonthDayDashed; - -@end - -@interface NSCalendar (Pick) - -+ (instancetype)sharedCalendar; - -@end - - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Tools/Date/NSDate+DateUtils.m.backup b/YuMi/Tools/Date/NSDate+DateUtils.m.backup deleted file mode 100644 index e24d4da..0000000 --- a/YuMi/Tools/Date/NSDate+DateUtils.m.backup +++ /dev/null @@ -1,193 +0,0 @@ -// -// NSDate+DateUtils.m -// YUMI -// -// Created by YUMI on 2022/4/12. -// - -#import "NSDate+DateUtils.h" - -NSString * const kDateFormatYYYYMMDD = @"yyyy-MM-dd"; -NSString * const kDateFormatYYMMDDTHHmmss = @"yyyy-MM-dd'T'HH:mm:ss"; - -@implementation NSDate (DateUtils) -+ (NSDateFormatter *)shareDateFormatter { - static NSDateFormatter *currentFormatter = nil; - static dispatch_once_t sharedDateFormatter_onceToken; - dispatch_once(&sharedDateFormatter_onceToken, ^{ - if (!currentFormatter) { - currentFormatter = [[NSDateFormatter alloc] init]; - [currentFormatter setDateFormat:kDateFormatYYYYMMDD]; - [currentFormatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]]; - } - }); - return currentFormatter; -} - -- (NSDate *)dateByAddingDays:(NSInteger)days { - NSCalendar *calendar = [NSCalendar sharedCalendar]; - NSDateComponents *components = [[NSDateComponents alloc] init]; - [components setDay:days]; - return [calendar dateByAddingComponents:components toDate:self options:0]; -} - -- (NSDate *)dateByAddingSeconds:(NSInteger)seconds { - NSCalendar *calendar = [NSCalendar sharedCalendar]; - NSDateComponents *components = [[NSDateComponents alloc] init]; - [components setSecond:seconds]; - return [calendar dateByAddingComponents:components toDate:self options:0]; -} - -- (NSInteger)daysBetween:(NSDate *)aDate { - NSUInteger unitFlags = NSCalendarUnitDay; - NSDate *from = [NSDate at_dateFromString:[self stringForYearMonthDayDashed]]; - NSDate *to = [NSDate at_dateFromString:[aDate stringForYearMonthDayDashed]]; - NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; - NSDateComponents *components = [calendar components:unitFlags fromDate:from toDate:to options:0]; - return labs([components day]) + 1; -} - -- (NSString *) stringForYearMonthDayDashed { - return [self stringForFormat:kDateFormatYYYYMMDD]; -} - -- (NSString *)stringForFormat:(NSString *)format { - if (!format) { - return nil; - } - - NSDateFormatter *formatter = [NSDate shareDateFormatter]; - [formatter setDateFormat:format]; - - NSString *timeStr = [formatter stringFromDate:self]; - return timeStr; -} - -+ (NSDate *)at_dateFromString:(NSString *)dateString { - NSDateFormatter *dateFormatter = [self shareDateFormatter]; - if (dateString.length > kDateFormatYYYYMMDD.length) { - [dateFormatter setDateFormat:kDateFormatYYMMDDTHHmmss]; - } else { - [dateFormatter setDateFormat:kDateFormatYYYYMMDD]; - } - NSDate *date = [dateFormatter dateFromString:dateString]; - if (!date) { - date = [NSDate date]; - } - return date; -} - -+ (NSString *)stringFromDate:(NSDate *)date { - NSDateFormatter * currentFormatter = [[NSDateFormatter alloc] init]; - if ([self isDateInToday:date]) { - [currentFormatter setDateFormat:@"HH:mm"]; - } else { - if (date.timeIntervalSince1970 > 0) { - [currentFormatter setDateFormat:YMLocalizedString(@"DateUtils0")]; - } else{ - [currentFormatter setDateFormat:YMLocalizedString(@"DateUtils1")]; - } - } - NSString *dateString = [currentFormatter stringFromDate: date]; - return dateString; -} - - - -+(BOOL)isDateInToday:(NSDate *)date{ - - NSTimeInterval secondsPerDay = 24 * 60 * 60; - NSDate *today = [[NSDate alloc] init]; - NSDate *tomorrow, *yesterday; - - tomorrow = [today dateByAddingTimeInterval: secondsPerDay]; - yesterday = [today dateByAddingTimeInterval: -secondsPerDay]; - - // 10 first characters of description is the calendar date: - NSString * todayString = [[today description] substringToIndex:10]; - NSString * yesterdayString = [[yesterday description] substringToIndex:10]; - NSString * tomorrowString = [[tomorrow description] substringToIndex:10]; - NSString * dateString = [[date description] substringToIndex:10]; - if ([dateString isEqualToString:todayString]){ - return YES; - } else { - return NO; - } -} - -+(NSString *)getNowTimeTimestamp{ - - NSDate* dat = [NSDate dateWithTimeIntervalSinceNow:0]; - - NSTimeInterval a=[dat timeIntervalSince1970]; - - NSString*timeString = [NSString stringWithFormat:@"%0.f", a];//转为字符型 - - return timeString; -} - -+(NSString *)timestampSwitchTime:(NSInteger)timestamp andFormatter:(NSString *)format{ - - - - NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; - [formatter setDateStyle:NSDateFormatterMediumStyle]; - - [formatter setTimeStyle:NSDateFormatterShortStyle]; - - [formatter setDateFormat:format]; // (@"YYYY-MM-dd hh:mm:ss")----------设置你想要的格式,hh与HH的区别:分别表示12小时制,24小时制 - NSDate *confromTimesp = [NSDate dateWithTimeIntervalSince1970:timestamp]; - NSString *confromTimespStr = [formatter stringFromDate:confromTimesp]; - return confromTimespStr; -} -#pragma mark - 将某个时间戳转化成 时间 -+ (NSString *)timestampSwitchTime:(NSInteger)timestamp formatter:(NSString *)format{ - NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; - [formatter setDateStyle:NSDateFormatterMediumStyle]; - [formatter setTimeStyle:NSDateFormatterShortStyle]; - [formatter setDateFormat:format]; // (@"YYYY-MM-dd hh:mm:ss")----------设置你想要的格式,hh与HH的区别:分别表示12小时制,24小时制 - NSTimeZone *timeZone = [NSTimeZone timeZoneWithName:@"Asia/Beijing"]; - [formatter setTimeZone:timeZone]; - NSDate *confromTimesp = [NSDate dateWithTimeIntervalSince1970:timestamp]; - /// 在当前时间,后退30分钟 = 1800 -// confromTimesp = [confromTimesp dateByAddingTimeInterval:-1800]; - NSString *confromTimespStr = [formatter stringFromDate:confromTimesp]; - return confromTimespStr; -} -+ (NSInteger)pleaseInsertStarTimeo:(NSString *)time1 andInsertEndTime:(NSString *)time2{ - // 1.将时间转换为date - NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; - formatter.dateFormat = @"YYYY-MM-dd hh:mm:ss"; - NSDate *date1 = [formatter dateFromString:time1]; - NSDate *date2 = [formatter dateFromString:time2]; - // 2.创建日历 - NSCalendar *calendar = [NSCalendar currentCalendar]; -// NSCalendarUnit type = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitHour | NSCalendarUnitMinute | NSCalendarUnitSecond; - NSCalendarUnit type = NSCalendarUnitSecond; - // 3.利用日历对象比较两个时间的差值 - NSDateComponents *cmps = [calendar components:type fromDate:date1 toDate:date2 options:0]; - // 4.输出结果 -// NSLog(@"两个时间相差%ld年%ld月%ld日%ld小时%ld分钟%ld秒", cmps.year, cmps.month, cmps.day, cmps.hour, cmps.minute, cmps.second); - return cmps.second; -} -+ (NSString *)getCurrentTimeWithFormat:(NSString *)format{ - NSDate *now = [NSDate date]; - NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; - formatter.dateFormat = format; - NSString *dateStr = [formatter stringFromDate:now]; - return dateStr; -} -@end - -@implementation NSCalendar (Pick) - -+ (instancetype)sharedCalendar -{ - static id instance; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - instance = [NSCalendar currentCalendar]; - }); - return instance; -} -@end diff --git a/YuMi/Tools/Date/NVDate.h.backup b/YuMi/Tools/Date/NVDate.h.backup deleted file mode 100644 index 7889a8b..0000000 --- a/YuMi/Tools/Date/NVDate.h.backup +++ /dev/null @@ -1,95 +0,0 @@ -// -// NVDate.h -// -// Created by Noval Agung Prayogo on 2/5/14. -// Copyright (c) 2014 Noval Agung Prayogo. All rights reserved. -// - -#import - -typedef NS_OPTIONS(NSUInteger, NVDayUnit) { - NVDayUnitSunday = 1, - NVDayUnitMonday = 2, - NVDayUnitTuesday = 3, - NVDayUnitWednesday = 4, - NVDayUnitThursday = 5, - NVDayUnitFriday = 6, - NVDayUnitSaturday = 7 -}; - -typedef NS_OPTIONS(NSUInteger, NVMonthUnit) { - NVMonthUnitJanuary = 1, - NVMonthUnitFebruary = 2, - NVMonthUnitMarch = 3, - NVMonthUnitApril = 4, - NVMonthUnitMay = 5, - NVMonthUnitJune = 6, - NVMonthUnitJuly = 7, - NVMonthUnitAugust = 8, - NVMonthUnitSeptember = 9, - NVMonthUnitOctober = 10, - NVMonthUnitNovember = 11, - NVMonthUnitDecember = 12, -}; - -@interface NVDate : NSObject - -- (id)initUsingToday; -- (id)initUsingDate:(NSDate *)date; -- (id)initUsingYear:(NSInteger)year month:(NSInteger)month day:(NSInteger)day; -- (id)initUsingYear:(NSInteger)year month:(NSInteger)month day:(NSInteger)day hour:(NSInteger)hour minute:(NSInteger)minute second:(NSInteger)second; -- (id)initUsingString:(NSString *)stringDate; -- (id)initUsingString:(NSString *)stringDate withFormat:(NSString *)dateFormat; -- (id)initUsingSeconds:(NSInteger)seconds; - -- (NSDate *)date; - -- (NSString *)stringValue; -- (NSString *)stringValueWithFormat:(NSString *)dateFormat; - -- (instancetype)zeroTime; - -- (instancetype)previousDay; -- (instancetype)previousDays:(NSInteger)days; -- (instancetype)nextDay; -- (instancetype)nextDays:(NSInteger)days; - -- (instancetype)previousWeek; -- (instancetype)previousWeeks:(NSInteger)weeks; -- (instancetype)nextWeek; -- (instancetype)nextWeeks:(NSInteger)weeks; - -- (instancetype)previousMonth; -- (instancetype)previousMonths:(NSInteger)months; -- (instancetype)nextMonth; -- (instancetype)nextMonths:(NSInteger)months; - -- (instancetype)previousYear; -- (instancetype)previousYears:(NSInteger)years; -- (instancetype)nextYear; -- (instancetype)nextYears:(NSInteger)years; - -- (instancetype)firstDayOfMonth; -- (instancetype)lastDayOfMonth; - -- (instancetype)firstMonthOfYear; -- (instancetype)lastMonthOfYear; - -- (instancetype)previousDayOfDayName:(NVDayUnit)dayUnit; -- (instancetype)nextDayOfDayName:(NVDayUnit)dayUnit; - -- (BOOL)isCurrentDayName:(NVDayUnit)dayUnit; -- (BOOL)isCurrentMonthName:(NVMonthUnit)monthUnit; - -@property NSString *dateFormatUsingString; -@property NSDateFormatterStyle dateFormatUsingStyle; -@property NSDateFormatterStyle timeFormatUsingStyle; -@property NSInteger year; -@property NSInteger month; -@property (readonly) NSInteger week; -@property NSInteger day; -@property NSInteger hour; -@property NSInteger minute; -@property NSInteger second; - -@end diff --git a/YuMi/Tools/Date/NVDate.m.backup b/YuMi/Tools/Date/NVDate.m.backup deleted file mode 100644 index 06840ed..0000000 --- a/YuMi/Tools/Date/NVDate.m.backup +++ /dev/null @@ -1,394 +0,0 @@ -// -// NVDate.m -// -// Created by Noval Agung Prayogo on 2/5/14. -// Copyright (c) 2014 Noval Agung Prayogo. All rights reserved. -// - -#import "NVDate.h" - -@implementation NVDate { - NSDateFormatter *_dateFormatter; - NSCalendar *_calendar; - NSDate *_date; - NSCalendarUnit _dateTimeCalendarUnit; -} - -- (id)init { - if (self = [super init]) { - _dateFormatter = [[NSDateFormatter alloc] init]; - _dateFormatter.dateStyle = NSDateFormatterFullStyle; - _dateFormatter.timeStyle = NSDateFormatterFullStyle; - - _calendar = [NSCalendar currentCalendar]; - - _date = [[NSDate alloc] init]; - - _dateTimeCalendarUnit = (NSYearCalendarUnit | NSMonthCalendarUnit | NSWeekCalendarUnit | NSWeekdayCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit); - } - return self; -} - -- (id)initUsingToday { - if (self = [self init]) { - _date = [NSDate date]; - } - return self; -} - -- (id)initUsingString:(NSString *)stringDate { - if (self = [self init]) { - _date = [_dateFormatter dateFromString:stringDate]; - } - return self; -} - -- (id)initUsingString:(NSString *)stringDate withFormat:(NSString *)dateFormat { - if (self = [self init]) { - _dateFormatter.dateFormat = dateFormat; - _date = [_dateFormatter dateFromString:stringDate]; - } - return self; -} - -- (id)initUsingYear:(NSInteger)year month:(NSInteger)month day:(NSInteger)day { - if (self = [self init]) { - NSDateComponents *dateComponents = [[NSDateComponents alloc] init]; - dateComponents.year = year; - dateComponents.month = month; - dateComponents.day = day; - _date = [_calendar dateFromComponents:dateComponents]; - } - return self; -} - -- (id)initUsingYear:(NSInteger)year month:(NSInteger)month day:(NSInteger)day hour:(NSInteger)hour minute:(NSInteger)minute second:(NSInteger)second { - if (self = [self init]) { - NSDateComponents *dateComponents = [[NSDateComponents alloc] init]; - dateComponents.year = year; - dateComponents.month = month; - dateComponents.day = day; - dateComponents.hour = hour; - dateComponents.minute = minute; - dateComponents.second = second; - _date = [_calendar dateFromComponents:dateComponents]; - } - return self; -} - -- (id)initUsingDate:(NSDate *)date { - if (self = [self init]) { - _date = date; - } - return self; -} - -- (id)initUsingSeconds:(NSInteger)seconds { - if (self = [self init]) { - _date = [NSDate dateWithTimeIntervalSinceReferenceDate:seconds]; - } - return self; -} - -- (NSDate *)date { - return _date; -} - -- (NSString *)stringValue { - return [_dateFormatter stringFromDate:_date]; -} - -- (NSString *)stringValueWithFormat:(NSString *)dateFormat { - NSDateFormatter *localDateFormatter = [_dateFormatter copy]; - localDateFormatter.dateFormat = dateFormat; - - return [localDateFormatter stringFromDate:_date]; -} - -- (instancetype)zeroTime { - NSDateComponents *dateComponents = [_calendar components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit) fromDate:_date]; - dateComponents.hour = 0; - dateComponents.minute = 0; - dateComponents.second = 0; - - _date = [_calendar dateFromComponents:dateComponents]; - - return self; -} - -- (void)setDateFormatUsingString:(NSString *)dateFormatUsingString { - _dateFormatter.dateFormat = dateFormatUsingString; -} - -- (NSString *)dateFormatUsingString { - return _dateFormatter.dateFormat; -} - -- (void)setDateFormatUsingStyle:(NSDateFormatterStyle)dateFormatUsingStyle { - _dateFormatter.dateStyle = dateFormatUsingStyle; -} - -- (NSDateFormatterStyle)dateFormatUsingStyle { - return _dateFormatter.dateStyle; -} - -- (void)setTimeFormatUsingStyle:(NSDateFormatterStyle)timeFormatUsingStyle { - _dateFormatter.timeStyle = timeFormatUsingStyle; -} - -- (NSDateFormatterStyle)timeFormatUsingStyle { - return _dateFormatter.timeStyle; -} - -- (instancetype)daysCalculate:(NSInteger)days isForward:(BOOL)isForward { - NSDateComponents *dateComponents = [[NSDateComponents alloc] init]; - dateComponents.day = days * (isForward ? 1 : -1); - _date = [_calendar dateByAddingComponents:dateComponents toDate:_date options:0]; - - return self; -} - -- (instancetype)previousDay { - return [self previousDays:1]; -} - -- (instancetype)previousDays:(NSInteger)days { - return [self daysCalculate:days isForward:NO]; -} - -- (instancetype)nextDay { - return [self nextDays:1]; -} - -- (instancetype)nextDays:(NSInteger)days { - return [self daysCalculate:days isForward:YES]; -} - -- (instancetype)weeksCalculate:(NSInteger)weeks isForward:(BOOL)isForward { - NSDateComponents *dateComponents = [[NSDateComponents alloc] init]; - dateComponents.day = (7 * weeks) * (isForward ? 1 : -1); - _date = [_calendar dateByAddingComponents:dateComponents toDate:_date options:0]; - - return self; -} - -- (instancetype)previousWeek { - return [self previousWeeks:1]; -} - -- (instancetype)previousWeeks:(NSInteger)weeks { - return [self weeksCalculate:weeks isForward:NO]; -} - -- (instancetype)nextWeek { - return [self nextWeeks:1]; -} - -- (instancetype)nextWeeks:(NSInteger)weeks { - return [self weeksCalculate:weeks isForward:YES]; -} - -- (instancetype)monthsCalculate:(NSInteger)months isForward:(BOOL)isForward { - NSDateComponents *dateComponents = [[NSDateComponents alloc] init]; - dateComponents.month = months * (isForward ? 1 : -1); - _date = [_calendar dateByAddingComponents:dateComponents toDate:_date options:0]; - - return self; -} - -- (instancetype)previousMonth { - return [self previousMonths:1]; -} - -- (instancetype)previousMonths:(NSInteger)months { - return [self monthsCalculate:months isForward:NO]; -} - -- (instancetype)nextMonth { - return [self nextMonths:1]; -} - -- (instancetype)nextMonths:(NSInteger)months { - return [self monthsCalculate:months isForward:YES]; -} - -- (instancetype)yearsCalculate:(NSInteger)years isForward:(BOOL)isForward { - NSDateComponents *dateComponents = [[NSDateComponents alloc] init]; - dateComponents.year = years * (isForward ? 1 : -1); - _date = [_calendar dateByAddingComponents:dateComponents toDate:_date options:0]; - - return self; -} - -- (instancetype)previousYear { - return [self previousYears:1]; -} - -- (instancetype)previousYears:(NSInteger)years { - return [self yearsCalculate:years isForward:NO]; -} - -- (instancetype)nextYear { - return [self nextYears:1]; -} - -- (instancetype)nextYears:(NSInteger)years { - return [self yearsCalculate:years isForward:YES]; -} - -- (instancetype)firstDayOfMonth { - NSDateComponents *dateComponents = [_calendar components:_dateTimeCalendarUnit fromDate:_date]; - dateComponents.day = 1; - _date = [_calendar dateFromComponents:dateComponents]; - - return self; -} - -- (instancetype)lastDayOfMonth { - NSDateComponents *dateComponents; - NSDate *date; - - dateComponents = [_calendar components:_dateTimeCalendarUnit fromDate:_date]; - dateComponents.day = 1; - date = [_calendar dateFromComponents:dateComponents]; - dateComponents = [[NSDateComponents alloc] init]; - dateComponents.month = 1; - date = [_calendar dateByAddingComponents:dateComponents toDate:date options:0]; - dateComponents = [[NSDateComponents alloc] init]; - dateComponents.day = -1; - _date = [_calendar dateByAddingComponents:dateComponents toDate:date options:0]; - - return self; -} - -- (instancetype)firstMonthOfYear { - NSDateComponents *dateComponents = [_calendar components:_dateTimeCalendarUnit fromDate:_date]; - dateComponents.month = NVMonthUnitJanuary; - _date = [_calendar dateFromComponents:dateComponents]; - - return self; -} - -- (instancetype)lastMonthOfYear { - NSDateComponents *dateComponents = [_calendar components:_dateTimeCalendarUnit fromDate:_date]; - dateComponents.month = NVMonthUnitDecember; - _date = [_calendar dateFromComponents:dateComponents]; - - return self; -} - -- (instancetype)previousDayOfDayName:(NVDayUnit)dayUnit { - NSInteger currentWeekDay = [_calendar components:_dateTimeCalendarUnit fromDate:_date].weekday; - - if (currentWeekDay == dayUnit) - return [self previousWeek]; - - NSDateComponents *dateComponents = [[NSDateComponents alloc] init]; - - if (currentWeekDay > dayUnit) - dateComponents.day = -(currentWeekDay - dayUnit); - else - dateComponents.day = -currentWeekDay - (7 - dayUnit); - - _date = [_calendar dateByAddingComponents:dateComponents toDate:_date options:0]; - - return self; -} - -- (instancetype)nextDayOfDayName:(NVDayUnit)dayUnit { - NSInteger currentWeekDay = [_calendar components:_dateTimeCalendarUnit fromDate:_date].weekday; - - if (currentWeekDay == dayUnit) - return [self nextWeek]; - - NSDateComponents *dateComponents = [[NSDateComponents alloc] init]; - - if (currentWeekDay < dayUnit) - dateComponents.day = dayUnit - currentWeekDay; - else - dateComponents.day = -currentWeekDay + dayUnit; - - _date = [_calendar dateByAddingComponents:dateComponents toDate:_date options:0]; - - return self; -} - -- (BOOL)isCurrentDayName:(NVDayUnit)dayUnit { - return ([_calendar components:_dateTimeCalendarUnit fromDate:_date].weekday == dayUnit); -} - -- (BOOL)isCurrentMonthName:(NVMonthUnit)monthUnit { - return ([_calendar components:_dateTimeCalendarUnit fromDate:_date].month == monthUnit); -} - -- (NSInteger)year { - return [_calendar components:_dateTimeCalendarUnit fromDate:_date].year; -} - -- (void)setYear:(NSInteger)year { - NSDateComponents *components = [_calendar components:_dateTimeCalendarUnit fromDate:_date]; - components.year = year; - - _date = [_calendar dateFromComponents:components]; -} - -- (NSInteger)month { - return [_calendar components:_dateTimeCalendarUnit fromDate:_date].month; -} - -- (void)setMonth:(NSInteger)month { - NSDateComponents *components = [_calendar components:_dateTimeCalendarUnit fromDate:_date]; - components.month = month; - - _date = [_calendar dateFromComponents:components]; -} - -- (NSInteger)week { - return [_calendar components:_dateTimeCalendarUnit fromDate:_date].weekday; -} - -- (NSInteger)day { - return [_calendar components:_dateTimeCalendarUnit fromDate:_date].day; -} - -- (void)setDay:(NSInteger)day { - NSDateComponents *components = [_calendar components:_dateTimeCalendarUnit fromDate:_date]; - components.day = day; - - _date = [_calendar dateFromComponents:components]; -} - -- (NSInteger)hour { - return [_calendar components:_dateTimeCalendarUnit fromDate:_date].hour; -} - -- (void)setHour:(NSInteger)hour { - NSDateComponents *components = [_calendar components:_dateTimeCalendarUnit fromDate:_date]; - components.hour = hour; - - _date = [_calendar dateFromComponents:components]; -} - -- (NSInteger)minute { - return [_calendar components:_dateTimeCalendarUnit fromDate:_date].minute; -} - -- (void)setMinute:(NSInteger)minute { - NSDateComponents *components = [_calendar components:_dateTimeCalendarUnit fromDate:_date]; - components.minute = minute; - - _date = [_calendar dateFromComponents:components]; -} - -- (NSInteger)second { - return [_calendar components:_dateTimeCalendarUnit fromDate:_date].second; -} - -- (void)setSecond:(NSInteger)second { - NSDateComponents *components = [_calendar components:_dateTimeCalendarUnit fromDate:_date]; - components.second = second; - - _date = [_calendar dateFromComponents:components]; -} - -@end diff --git a/YuMi/Tools/Date/PLTimeUtil.h.backup b/YuMi/Tools/Date/PLTimeUtil.h.backup deleted file mode 100644 index 4ac4ce2..0000000 --- a/YuMi/Tools/Date/PLTimeUtil.h.backup +++ /dev/null @@ -1,59 +0,0 @@ -// -// PLTimeUtil.h -// YYMobile -// -// Created by penglong on 14/10/28. -// Copyright (c) 2014年 YY.inc. All rights reserved. -// - -#import - -@interface PLTimeUtil : PIBaseModel - -/** - * 根据秒数获取倒计时时间 - * - * @param second 秒 - * - * @return 格式为 01:02:00 - */ -+ (NSString *)getTimeWithSecond:(NSUInteger)second; - -+ (NSDate *)getDateWithCompleteTime:(NSString *)time; - -+ (NSDate *)getDateWithTime:(NSString *)time; - -+ (NSDate *)getDateWithYmd:(NSString *)time; - -+ (NSString *)getDateWithHHMMSS:(NSString *)time; - -+ (NSString *)getDateWithYYMMDD:(NSString *)time; - -+ (NSString *)getDateWitMMDDHHSS:(NSString *)time; - -+ (NSString *)getDateWithYYMM:(NSString *)time; - -+ (NSString *)getDateWithMMDD:(NSString *)time; - -+ (NSDate *)getDateWithYearMonthDay:(NSString *)time; - -+ (NSString *)getMonthDayContent:(NSDate *)date; - -+ (NSString *)getYYMMWithDate:(NSDate *)date; - -+ (NSString *)getYYMMDDWithDate:(NSDate *)date; - -+ (NSString *)getYYMMDDWithDateFormatter:(NSDate *)date; - -+ (NSString *)getDateWithTotalTimeWith:(NSString *)time; - -+ (NSString *)getNowTimeTimestampMillisecond; - -///比较两个时间的差值 -+ (NSDateComponents *)compareTwoDate:(NSDate *)firstDate secondDate:(NSDate *)secondDate; - -///计算年龄 -+ (NSInteger)ageWithDateFromBirth:(NSInteger)birth; - -@end - diff --git a/YuMi/Tools/Date/PLTimeUtil.m.backup b/YuMi/Tools/Date/PLTimeUtil.m.backup deleted file mode 100644 index e8a46bd..0000000 --- a/YuMi/Tools/Date/PLTimeUtil.m.backup +++ /dev/null @@ -1,307 +0,0 @@ -// -// PLTimeUtil.m -// YYMobile -// -// Created by penglong on 14/10/28. -// Copyright (c) 2014年 YY.inc. All rights reserved. -// - -#import "PLTimeUtil.h" -#import "NVDate.h" -#import "YYUtility.h" -@implementation PLTimeUtil - -+ (NSString *)getTimeWithSecond:(NSUInteger)second -{ - NSUInteger hours = second / 3600; - NSUInteger minutes = (second % 3600) / 60; - NSUInteger seconds = second % 60; - return [NSString stringWithFormat:@"%@:%@:%@",[self getConent:hours], - [self getConent:minutes],[self getConent:seconds]]; -} - -+ (NSString *)getConent:(NSUInteger)count -{ - if(count >= 10){ - return [NSString stringWithFormat:@"%lu",(unsigned long)count]; - } - return [NSString stringWithFormat:@"0%lu",(unsigned long)count]; -} - -+(NSDate *)getDateWithYmd:(NSString *)time -{ - NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; - [dateFormatter setDateFormat:@"yyyy:MM:dd"]; - NSDate* date = [dateFormatter dateFromString:time]; - return date; -} - -+(NSDate *)getDateWithYearMonthDay:(NSString *)time -{ - NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; - [dateFormatter setDateFormat:@"yyyy-MM-dd"]; - NSDate* date = [dateFormatter dateFromString:time]; - return date; -} - -+ (NSDate *)getDateWithCompleteTime:(NSString *)time -{ - NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; - [dateFormatter setDateFormat:@"yyyy:MM:dd HH:mm:ss"]; - NSDate* date = [dateFormatter dateFromString:time]; - return date; -} - -+ (NSDate *)getDateWithTime:(NSString *)time -{ - NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; - [dateFormatter setDateFormat:@"HH:mm:ss"]; - NSDate* date = [dateFormatter dateFromString:time]; - return date; -} - - -+ (NSString *)getMonthDayContent:(NSDate *)date -{ - NVDate *currentNVDate = [[NVDate alloc] initUsingDate:date]; - - NSString *month = [self getContent:currentNVDate.month]; - NSString *day = [self getContent:currentNVDate.day]; - - NSString *content = [NSString stringWithFormat:@"%@-%@",month,day]; - return content; -} - -+ (NSString *)getContent:(NSUInteger)count -{ - if(count >= 10){ - return [NSString stringWithFormat:@"%lu",(unsigned long)count]; - } - return [NSString stringWithFormat:@"0%lu",(unsigned long)count]; -} - -+ (NSString *)getYYMMDDWithDate:(NSDate *)date { -// NSTimeZone *zome = [NSTimeZone systemTimeZone]; -// NSTimeInterval seconds1 = [zome secondsFromGMTForDate:date]; -// NSDate *date2 = [date dateByAddingTimeInterval:seconds1]; - NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; - NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Beijing"]; - [formatter setTimeZone:timeZone]; - formatter.dateFormat = @"yyyy-MM-dd"; - NSString *dateStr = [formatter stringFromDate:date]; - return dateStr; -} - -+ (NSString *)getYYMMDDWithDateFormatter:(NSDate *)date { -// NSTimeZone *zome = [NSTimeZone systemTimeZone]; -// NSTimeInterval seconds1 = [zome secondsFromGMTForDate:date]; -// NSDate *date2 = [date dateByAddingTimeInterval:seconds1]; - NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; - NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Beijing"]; - [formatter setTimeZone:timeZone]; - formatter.dateFormat = YMLocalizedString(@"PLTimeUtil0"); - NSString *dateStr = [formatter stringFromDate:date]; - return dateStr; -} - - -+ (NSString *)getYYMMWithDate:(NSDate *)date { - NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; - NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Beijing"]; - [formatter setTimeZone:timeZone]; - formatter.dateFormat = YMLocalizedString(@"PLTimeUtil1"); - NSString *dateStr = [formatter stringFromDate:date]; - return dateStr; -} - - -+ (NSString *)getDateWithYYMMDD:(NSString *)time { - NSDateFormatter* formatter = [[NSDateFormatter alloc] init]; - formatter.timeZone = [NSTimeZone timeZoneWithName:@"Asia/Beijing"]; - [formatter setDateStyle:NSDateFormatterMediumStyle]; - [formatter setTimeStyle:NSDateFormatterShortStyle]; - [formatter setDateFormat:YMLocalizedString(@"PLTimeUtil2")]; - // 毫秒值转化为秒 - NSString * times; - if ([self is32bit] && [[YYUtility systemVersion] floatValue] <= 10.0) { - times = [NSString stringWithFormat:@"%f", ([time doubleValue] + 3600 * 1000 * 8)]; - }else{ - times = time; - } - NSDate* date = [NSDate dateWithTimeIntervalSince1970:[times longLongValue]/ 1000.0]; - NSString* dateString = [formatter stringFromDate:date]; - return dateString; -} - -+ (NSString *)getDateWitMMDDHHSS:(NSString *)time { - NSDateFormatter* formatter = [[NSDateFormatter alloc] init]; - formatter.timeZone = [NSTimeZone timeZoneWithName:@"Asia/Beijing"]; - [formatter setDateStyle:NSDateFormatterMediumStyle]; - [formatter setTimeStyle:NSDateFormatterShortStyle]; - [formatter setDateFormat:@"MM-dd HH:mm"]; - // 毫秒值转化为秒 - NSString * times; - if ([self is32bit] && [[YYUtility systemVersion] floatValue] <= 10.0) { - times = [NSString stringWithFormat:@"%f", ([time doubleValue] + 3600 * 1000 * 8)]; - }else{ - times = time; - } - NSDate* date = [NSDate dateWithTimeIntervalSince1970:[times longLongValue]/ 1000.0]; - NSString* dateString = [formatter stringFromDate:date]; - return dateString; -} - -+ (BOOL)is32bit - -{ - -#if defined(__LP64__) && __LP64__ - - return NO; - -#else - - return YES; - -#endif - -} - - -+ (NSString *)getDateWithYYMM:(NSString *)time { - NSDateFormatter* formatter = [[NSDateFormatter alloc] init]; - formatter.timeZone = [NSTimeZone timeZoneWithName:@"Asia/Beijing"]; - [formatter setDateStyle:NSDateFormatterMediumStyle]; - [formatter setTimeStyle:NSDateFormatterShortStyle]; - [formatter setDateFormat:YMLocalizedString(@"PLTimeUtil3")]; - // 毫秒值转化为秒 - NSString * times; - if ([self is32bit] && [[YYUtility systemVersion] floatValue] <= 10.0) { - times = [NSString stringWithFormat:@"%f", ([time doubleValue] + 3600 * 1000 * 8)]; - }else{ - times = time; - } - NSDate* date = [NSDate dateWithTimeIntervalSince1970:[times doubleValue]/ 1000.0]; - NSString* dateString = [formatter stringFromDate:date]; - return dateString; -} - -+ (NSString *)getDateWithMMDD:(NSString *)time { - NSDateFormatter* formatter = [[NSDateFormatter alloc] init]; - formatter.timeZone = [NSTimeZone timeZoneWithName:@"Asia/Beijing"]; - [formatter setDateStyle:NSDateFormatterMediumStyle]; - [formatter setTimeStyle:NSDateFormatterShortStyle]; - [formatter setDateFormat:YMLocalizedString(@"PLTimeUtil4")]; - // 毫秒值转化为秒 - NSString * times; - if ([self is32bit] && [[YYUtility systemVersion] floatValue] <= 10.0) { - times = [NSString stringWithFormat:@"%f", ([time doubleValue] + 3600 * 1000 * 8)]; - }else{ - times = time; - } - NSDate* date = [NSDate dateWithTimeIntervalSince1970:[times doubleValue]/ 1000.0]; - NSString* dateString = [formatter stringFromDate:date]; - return dateString; -} - - - - -+ (NSString *)getDateWithHHMMSS:(NSString *)time { - NSDateFormatter* formatter = [[NSDateFormatter alloc] init]; - formatter.timeZone = [NSTimeZone timeZoneWithName:@"Asia/Beijing"]; - [formatter setDateStyle:NSDateFormatterMediumStyle]; - [formatter setTimeStyle:NSDateFormatterShortStyle]; - [formatter setDateFormat:@"HH:mm:ss"]; - // 毫秒值转化为秒 - NSString * times; - if ([self is32bit] && [[YYUtility systemVersion] floatValue] <= 10.0) { - times = [NSString stringWithFormat:@"%f", ([time doubleValue] + 3600 * 1000 * 8)]; - }else{ - times = time; - } - NSDate* date = [NSDate dateWithTimeIntervalSince1970:[times doubleValue]/ 1000.0]; - NSString* dateString = [formatter stringFromDate:date]; - return dateString; -} - -+ (NSString *)getDateWithTotalTimeWith:(NSString *)time { - NSDateFormatter* formatter = [[NSDateFormatter alloc] init]; - formatter.timeZone = [NSTimeZone timeZoneWithName:@"Asia/Beijing"]; - [formatter setDateStyle:NSDateFormatterMediumStyle]; - [formatter setTimeStyle:NSDateFormatterShortStyle]; - [formatter setDateFormat:@"yyyy.MM.dd HH:mm:ss"]; - // 毫秒值转化为秒 - NSString * times; - if ([self is32bit] && [[YYUtility systemVersion] floatValue] <= 10.0) { - times = [NSString stringWithFormat:@"%f", ([time doubleValue] + 3600 * 1000 * 8)]; - }else{ - times = time; - } - NSDate* date = [NSDate dateWithTimeIntervalSince1970:[times doubleValue]/ 1000.0]; - NSString* dateString = [formatter stringFromDate:date]; - return dateString; -} - - -+ (NSString *)getNowTimeTimestampMillisecond{ - - NSDateFormatter *formatter = [[NSDateFormatter alloc] init] ; - - [formatter setDateStyle:NSDateFormatterMediumStyle]; - - [formatter setTimeStyle:NSDateFormatterShortStyle]; - - [formatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"]; // ----------设置你想要的格式,hh与HH的区别:分别表示12小时制,24小时制 - - //设置时区,这个对于时间的处理有时很重要 - - NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Beijing"]; - - [formatter setTimeZone:timeZone]; - - NSDate* dat = [NSDate dateWithTimeIntervalSinceNow:0]; - NSTimeInterval a=[dat timeIntervalSince1970]; - NSString * timeSp = [NSString stringWithFormat:@"%.0f", a]; - - return timeSp; -} - - -+ (NSDateComponents *)compareTwoDate:(NSDate *)firstDate secondDate:(NSDate *)secondDate { - // 当前日历 - NSCalendar *calendar = [NSCalendar currentCalendar]; - // 需要对比的时间数据 - NSCalendarUnit unit = NSCalendarUnitYear | NSCalendarUnitMonth - | NSCalendarUnitDay | NSCalendarUnitHour | NSCalendarUnitMinute | NSCalendarUnitSecond; - // 对比时间差 - NSDateComponents *dateCom = [calendar components:unit fromDate:firstDate toDate:secondDate options:0]; - return dateCom; -} - -///计算年龄 -+ (NSInteger)ageWithDateFromBirth:(NSInteger)birth{ - // 出生日期转换 年月日 - NSDate *date = [NSDate dateWithTimeIntervalSince1970:birth/1000]; - NSDateComponents *components1 = [[NSCalendar currentCalendar] components:NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear fromDate:date]; - NSInteger brithDateYear = [components1 year]; - NSInteger brithDateDay = [components1 day]; - NSInteger brithDateMonth = [components1 month]; - - // 获取系统当前 年月日 - NSDateComponents *components2 = [[NSCalendar currentCalendar] components:NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear fromDate:[NSDate date]]; - NSInteger currentDateYear = [components2 year]; - NSInteger currentDateDay = [components2 day]; - NSInteger currentDateMonth = [components2 month]; - - // 计算年龄 - NSInteger iAge = currentDateYear - brithDateYear - 1; - if ((currentDateMonth > brithDateMonth) || (currentDateMonth == brithDateMonth && currentDateDay >= brithDateDay)) { - iAge++; - } - - return iAge; -} - -@end - diff --git a/YuMi/Tools/File/UploadFile.h.backup b/YuMi/Tools/File/UploadFile.h.backup deleted file mode 100644 index 0ce0e05..0000000 --- a/YuMi/Tools/File/UploadFile.h.backup +++ /dev/null @@ -1,51 +0,0 @@ -// -// UploadFile.h -// YUMI -// -// Created by YUMI on 2022/2/23. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface UploadFile : NSObject -+ (instancetype)share; --(void)initQCloud; - -+ (void)downloadAudioWithFileName:(NSString *)fileName musicUrl:(NSString *)musicUrl mainFileName:(NSString *)mainFileName completion:(void (^) (BOOL isSuccess, NSString *editAudioPath))completion; -/// 上传一个文件 -/// @param filePath 文件地址 -/// @param fileName 文件的名字 - -/// @param success 成功 -/// @param failure 失败 -- (void)QCloudUploadFile:(NSString *)filePath - named:(NSString *)fileName - - success:(void (^)(NSString *key, NSDictionary *resp))success - failure:(void (^)(NSNumber *resCode, NSString *message))failure; -/// 上传一个Image -/// @param image 图片 -/// @param imageName 图片的名字 - -/// @param success 成功 -/// @param failure 失败 -- (void)QCloudUploadImage:(NSData *)data - named:(NSString *)name - success:(void (^)(NSString *key, NSDictionary *resp))success - failure:(void (^)(NSNumber *resCode, NSString *message))failure; - -///下载资料 -- (void)downloadAnimationFileName:(NSString *)fileName localPath:(NSString *)localPath completion:(void (^) (BOOL isSuccess, NSString *editAudioPath))completion; - -///下载并缓存礼物特效 -- (void)startBatchDownloadWithURLs:(NSArray *)URLs; -- (void)pauseBatchDownload; -- (void)resumeBatchDownload; - -- (void)download:(NSString *)targetURLString path:(NSString *)localFilePath complete:(void(^)(void))complete failure:(void(^)(void))failure; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Tools/File/UploadFile.m.backup b/YuMi/Tools/File/UploadFile.m.backup deleted file mode 100644 index 878b29d..0000000 --- a/YuMi/Tools/File/UploadFile.m.backup +++ /dev/null @@ -1,409 +0,0 @@ -// -// UploadFile.m -// xplan-ios -// -// Created by GreenLand on 2022/2/23. -// -#import -#import "UploadFile.h" -#import -#import "Api+Mine.h" -#import "UploadFileModel.h" -static UploadFile* manager; - -@interface UploadFile() -// 一个脚手架实例 -@property (nonatomic) QCloudCredentailFenceQueue* credentialFenceQueue; -@property(nonatomic,strong) UploadFileModel *fileModel; - -// MARK: 批量下载部分, 后续要新建一个 object 来承载业务 -@property (nonatomic, strong) AFHTTPSessionManager *manager; -@property (nonatomic, strong) NSMutableArray *tasks; - -@end - -@implementation UploadFile - -+ (instancetype)share { - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - manager = [[UploadFile alloc] init]; - }); - return manager; -} - --(void)initQCloud{ - @kWeakify(self); - [Api getQCloudInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { - @kStrongify(self); - if (code == 200){ - UploadFileModel *fileModel = [UploadFileModel modelWithDictionary:data.data]; - self.fileModel = fileModel; - QCloudServiceConfiguration* configuration = [QCloudServiceConfiguration new]; - configuration.appID = fileModel.appId; - QCloudCOSXMLEndPoint* endpoint = [[QCloudCOSXMLEndPoint alloc] init]; - endpoint.regionName = fileModel.region; - // 使用 HTTPS - endpoint.useHTTPS = YES; - configuration.endpoint = endpoint; - // 密钥提供者为自己 - configuration.signatureProvider = self; - // 初始化 COS 服务示例 - [QCloudCOSXMLService registerDefaultCOSXMLWithConfiguration:configuration]; - [QCloudCOSTransferMangerService registerDefaultCOSTransferMangerWithConfiguration: - configuration]; - - // 全球加速! https://www.tencentcloud.com/zh/document/product/436/38113 - if (fileModel.accelerate == 1) { - endpoint.suffix = @"cos.accelerate.myqcloud.com"; - } - - self.credentialFenceQueue = [QCloudCredentailFenceQueue new]; - self.credentialFenceQueue.delegate = self; - } - }]; -} -#pragma mark- QCloudSignatureProvider -- (void) signatureWithFields:(QCloudSignatureFields*)fileds - request:(QCloudBizHTTPRequest*)request - urlRequest:(NSMutableURLRequest*)urlRequst - compelete:(QCloudHTTPAuthentationContinueBlock)continueBlock -{ - - [Api getQCloudInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { - if (code == 200){ - UploadFileModel *fileModel = [UploadFileModel modelWithDictionary:data.data]; - QCloudCredential* credential = [QCloudCredential new]; - - - // 临时密钥 SecretId - - credential.secretID = fileModel.secretId; - // 临时密钥 SecretKey - - credential.secretKey = fileModel.secretKey; - // 临时密钥 Token - - credential.token = fileModel.sessionToken; - /** 强烈建议返回服务器时间作为签名的开始时间, 用来避免由于用户手机本地时间偏差过大导致的签名不正确(参数startTime和expiredTime单位为秒) - */ - credential.startDate = [NSDate dateWithTimeIntervalSince1970:fileModel.startTime]; // 单位是秒 - credential.expirationDate = [NSDate dateWithTimeIntervalSince1970:fileModel.expireTime];// 单位是秒 - - - QCloudAuthentationV5Creator* creator = [[QCloudAuthentationV5Creator alloc] - initWithCredential:credential]; - // 注意 这里不要对urlRequst 进行copy以及mutableCopy操作 - QCloudSignature *signature = [creator signatureForData:urlRequst]; - continueBlock(signature, nil); - - } - } - ]; - -} - -#pragma mark - QCloudCredentailFenceQueueDelegate -- (void) fenceQueue:(QCloudCredentailFenceQueue * )queue requestCreatorWithContinue:(QCloudCredentailFenceQueueContinue)continueBlock -{ - //这里同步从◊后台服务器获取临时密钥,强烈建议将获取临时密钥的逻辑放在这里,最大程度上保证密钥的可用性 - //... - - [Api getQCloudInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { - if (code == 200){ - UploadFileModel *fileModel = [UploadFileModel modelWithDictionary:data.data]; - QCloudCredential* credential = [QCloudCredential new]; - // 临时密钥 SecretId - credential.secretID = fileModel.secretId; - // 临时密钥 SecretKey - - credential.secretKey = fileModel.secretKey; - // 临时密钥 Token - - credential.token = fileModel.sessionToken; - /** 强烈建议返回服务器时间作为签名的开始时间, 用来避免由于用户手机本地时间偏差过大导致的签名不正确(参数startTime和expiredTime单位为秒) - */ - credential.startDate = [NSDate dateWithTimeIntervalSince1970:fileModel.startTime]; // 单位是秒 - credential.expirationDate = [NSDate dateWithTimeIntervalSince1970:fileModel.expireTime];// 单位是秒 - QCloudAuthentationV5Creator* creator = [[QCloudAuthentationV5Creator alloc] - initWithCredential:credential]; - continueBlock(creator, nil); - } - }]; -} -/// 上传一个文件 -/// @param filePath 文件地址 -/// @param fileName 文件的名字 -/// @param success 成功 -/// @param failure 失败 -- (void)QCloudUploadFile:(NSString *)filePath - named:(NSString *)fileName - success:(void (^)(NSString *key, NSDictionary *resp))success - failure:(void (^)(NSNumber *resCode, NSString *message))failure { - - - QCloudCOSXMLUploadObjectRequest* put = [QCloudCOSXMLUploadObjectRequest new]; - // 本地文件路径 - NSURL* url = [NSURL fileURLWithPath:filePath]; - // 存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket - put.bucket = self.fileModel.bucket; - // 对象键,是对象在 COS 上的完整路径,如果带目录的话,格式为 "video/xxx/movie.mp4" - put.object = fileName; - //需要上传的对象内容。可以传入NSData*或者NSURL*类型的变量 - put.body = url; - //监听上传进度 - [put setSendProcessBlock:^(int64_t bytesSent, - int64_t totalBytesSent, - int64_t totalBytesExpectedToSend) { - // bytesSent 本次要发送的字节数(一个大文件可能要分多次发送) - // totalBytesSent 已发送的字节数 - // totalBytesExpectedToSend 本次上传要发送的总字节数(即一个文件大小) - }]; - - //监听上传结果 - [put setFinishBlock:^(id outputObject, NSError *error) { - //可以从 outputObject 中获取 response 中 etag 或者自定义头部等信息 - if (error) { - failure(@(error.code),error.localizedDescription); - return; - } - QCloudUploadObjectResult * result = (QCloudUploadObjectResult *)outputObject; - NSArray *urlList = [result.location componentsSeparatedByString:@".com/"]; - if (urlList.count == 2){ - NSString *url = [NSString stringWithFormat:@"%@/%@",self.fileModel.customDomain,urlList[1]]; - success(url,nil); - return; - } - success(result.location,nil); - }]; - - [[QCloudCOSTransferMangerService defaultCOSTransferManager] UploadObject:put]; -} - -/// 上传一个Image -/// @param image 图片 -/// @param imageName 图片的名字 - -/// @param success 成功 -/// @param failure 失败 -- (void)QCloudUploadImage:(NSData *)data - named:(NSString *)name - success:(void (^)(NSString *key, NSDictionary *resp))success - failure:(void (^)(NSNumber *resCode, NSString *message))failure{ - - QCloudCOSXMLUploadObjectRequest* put = [QCloudCOSXMLUploadObjectRequest new]; - put.bucket = self.fileModel.bucket; - // 对象键,是对象在 COS 上的完整路径,如果带目录的话,格式为 "video/xxx/movie.mp4" - put.object = name; - //需要上传的对象内容。可以传入NSData*或者NSURL*类型的变量 - put.body = data; - //监听上传进度 - [put setSendProcessBlock:^(int64_t bytesSent, - int64_t totalBytesSent, - int64_t totalBytesExpectedToSend) { - // bytesSent 本次要发送的字节数(一个大文件可能要分多次发送) - // totalBytesSent 已发送的字节数 - // totalBytesExpectedToSend 本次上传要发送的总字节数(即一个文件大小) - }]; - - //监听上传结果 - [put setFinishBlock:^(id outputObject, NSError *error) { - - if (error) { - failure(@(error.code),error.localizedDescription); - return; - } - QCloudUploadObjectResult * result = (QCloudUploadObjectResult *)outputObject; - NSArray *urlList = [result.location componentsSeparatedByString:@".com/"]; - if (urlList.count == 2){ - NSString *url = [NSString stringWithFormat:@"%@/%@",self.fileModel.customDomain,urlList[1]]; - success(url,nil); - return; - } - success(result.location,nil); - }]; - - [[QCloudCOSTransferMangerService defaultCOSTransferManager] UploadObject:put]; -} - --(void)downloadAnimationFileName:(NSString *)fileName localPath:(NSString *)localPath completion:(void (^) (BOOL isSuccess, NSString *editAudioPath))completion{ - QCloudCOSXMLDownloadObjectRequest * request = [QCloudCOSXMLDownloadObjectRequest new]; - - - // 存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket - request.bucket = self.fileModel.bucket; - - NSArray *urlList = [fileName componentsSeparatedByString:@".com/"]; - - // 对象键,是对象在 COS 上的完整路径,如果带目录的话,格式为 "video/xxx/movie.mp4" - request.object = [urlList xpSafeObjectAtIndex:1]; - - - // 设置下载的路径 URL,如果设置了,文件将会被下载到指定路径中 - request.downloadingURL = [NSURL fileURLWithPath:localPath]; - - - - - // 监听下载结果 - [request setFinishBlock:^(id outputObject, NSError *error) { - // outputObject 包含所有的响应 http 头部 - NSDictionary* info = (NSDictionary *) outputObject; -// NSLog(@"%@",info); - }]; - - - // 监听下载进度 - [request setDownProcessBlock:^(int64_t bytesDownload, - int64_t totalBytesDownload, - int64_t totalBytesExpectedToDownload) { - - - // bytesDownload 新增字节数 - // totalBytesDownload 本次下载接收的总字节数 - // totalBytesExpectedToDownload 本次下载的目标字节数 - }]; - - - [[QCloudCOSTransferMangerService defaultCOSTransferManager] DownloadObject:request]; - -} -+(void)downloadAudioWithFileName:(NSString *)fileName - musicUrl:(NSString *)musicUrl - mainFileName:(NSString *)mainFileName - completion:(void (^) (BOOL isSuccess, NSString *editAudioPath))completion { - AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; - NSURL *url = [NSURL URLWithString:[musicUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]]; - NSURLRequest *request = [NSURLRequest requestWithURL :url]; - NSURLSessionDownloadTask *download = [manager downloadTaskWithRequest:request progress:^(NSProgress * _Nonnull downloadProgress) { - } destination:^NSURL * _Nonnull(NSURL * _Nonnull targetPath, NSURLResponse * _Nonnull response) { - NSString *filePath = [[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) xpSafeObjectAtIndex:0] stringByAppendingPathComponent:mainFileName] stringByAppendingPathComponent:fileName]; - return [NSURL fileURLWithPath:filePath]; - } completionHandler:^(NSURLResponse * _Nonnull response, NSURL * _Nullable filePath, NSError * _Nullable error) { - if (!error) { - completion(YES, filePath.path); - } else { - completion(NO, nil); - } - }]; - [download resume]; -} - -// 批量下载 -- (void)startBatchDownloadWithURLs:(NSArray *)URLs { - if (_manager == nil) { - _manager = [AFHTTPSessionManager manager]; - _manager.operationQueue.maxConcurrentOperationCount = 10; - _tasks = [NSMutableArray array]; - } - - if (URLs.count == 0) { - return; - } - - [self createCacheLocalPath]; - - for (NSString *urlStr in URLs) { - // 缓存本地目标位置 - NSURL *destinationURL = [self localPath:urlStr]; - - // 检查文件是否已经存在 - if ([[NSFileManager defaultManager] fileExistsAtPath:[destinationURL path]]) { - continue; - } - - NSURL *url = [NSURL URLWithString:urlStr]; - NSURLRequest *request = [NSURLRequest requestWithURL:url]; - - @kWeakify(self); - __block NSURLSessionDownloadTask *downloadTask; - downloadTask = [self.manager downloadTaskWithRequest:request - progress:nil - destination:^NSURL * _Nonnull(NSURL * _Nonnull targetPath, NSURLResponse * _Nonnull response) { - return destinationURL; - } completionHandler:^(NSURLResponse * _Nonnull response, NSURL * _Nullable filePath, NSError * _Nullable error) { - @kStrongify(self); - if ([self.tasks containsObject:downloadTask]) { - [self.tasks removeObject:downloadTask]; - } - }]; - - [self.tasks addObject:downloadTask]; - } - - [self resumeBatchDownload]; -} - -- (void)pauseBatchDownload { - for (NSURLSessionDownloadTask *task in self.tasks) { - if (task.state == NSURLSessionTaskStateRunning) { - [task suspend]; - } - } -} - -- (void)resumeBatchDownload { - for (NSURLSessionDownloadTask *task in self.tasks) { - if (task.state == NSURLSessionTaskStateSuspended) { - [task resume]; - } - } -} - -- (void)createCacheLocalPath { - NSError *error = nil; - NSFileManager *fileManager = [NSFileManager defaultManager]; - NSString *filePath = [self cacheFilePath]; - if ([fileManager fileExistsAtPath:filePath] == NO) { - NSFileManager *fileMgr = [[NSFileManager alloc] init]; - BOOL success = [fileMgr createDirectoryAtPath:filePath withIntermediateDirectories:YES attributes:nil error:&error]; - if (success) { -// NSLog(@"Folder created successfully."); - } else { -// NSLog(@"Could not create folder: %@", [error localizedDescription]); - } - } -} - -- (NSURL *)localPath:(NSString *)encodingUrl { - NSString *fileName = [[encodingUrl componentsSeparatedByString:@"/"] lastObject]; - NSString *filePath = [self cacheFilePath]; - NSString *cacheLocalPath = [filePath stringByAppendingPathComponent:fileName]; - return [NSURL fileURLWithPath:cacheLocalPath]; -} - -- (NSString *)cacheFilePath { - return [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) xpSafeObjectAtIndex:0] stringByAppendingPathComponent:@"GiftDynamicEffectList"]; -} - -- (void)download:(NSString *)targetURLString path:(NSString *)localFilePath complete:(void(^)(void))complete failure:(void(^)(void))failure { - AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; - NSURL *pathURL = [NSURL fileURLWithPath:localFilePath]; - if ([[NSFileManager defaultManager] fileExistsAtPath:pathURL.path]) { - return; - } - - NSURL *url = [NSURL URLWithString:targetURLString]; - NSURLRequest *request = [NSURLRequest requestWithURL:url]; - - @kWeakify(self); - NSURLSessionDownloadTask *downloadTask = [manager downloadTaskWithRequest:request - progress:nil - destination:^NSURL * _Nonnull(NSURL * _Nonnull targetPath, NSURLResponse * _Nonnull response) { - return pathURL; - } completionHandler:^(NSURLResponse * _Nonnull response, NSURL * _Nullable filePath, NSError * _Nullable error) { - if (error) { - if (failure) { - failure(); - } - } else { - if (complete) { - complete(); - } - } - }]; - - [downloadTask resume]; -} - -@end diff --git a/YuMi/Tools/File/UploadFileModel.h.backup b/YuMi/Tools/File/UploadFileModel.h.backup deleted file mode 100644 index d5cbd39..0000000 --- a/YuMi/Tools/File/UploadFileModel.h.backup +++ /dev/null @@ -1,25 +0,0 @@ -// -// UploadFileModel.h -// YuMi -// -// Created by duoban on 2024/3/25. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface UploadFileModel : NSObject -@property(nonatomic,copy) NSString *secretId; -@property(nonatomic,copy) NSString *secretKey; -@property(nonatomic,copy) NSString *sessionToken; -@property(nonatomic,copy) NSString *bucket; -@property(nonatomic,copy) NSString *region; -@property(nonatomic,copy) NSString *customDomain; -@property(nonatomic,assign) long startTime; -@property(nonatomic,assign) long expireTime; -@property(nonatomic,copy) NSString *appId; -@property (nonatomic, assign) NSInteger accelerate; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Tools/File/UploadFileModel.m.backup b/YuMi/Tools/File/UploadFileModel.m.backup deleted file mode 100644 index 8c68b45..0000000 --- a/YuMi/Tools/File/UploadFileModel.m.backup +++ /dev/null @@ -1,12 +0,0 @@ -// -// UploadFileModel.m -// YuMi -// -// Created by duoban on 2024/3/25. -// - -#import "UploadFileModel.h" - -@implementation UploadFileModel - -@end diff --git a/YuMi/Tools/GCDHelper/GCDHelper.h.backup b/YuMi/Tools/GCDHelper/GCDHelper.h.backup deleted file mode 100644 index 587e2cd..0000000 --- a/YuMi/Tools/GCDHelper/GCDHelper.h.backup +++ /dev/null @@ -1,11 +0,0 @@ -// -// GCDHelper.h -// YYMobileFramework -// -// Created by wuwei on 14/7/18. -// Copyright (c) 2014年 YY Inc. All rights reserved. -// - -#import - -void dispatch_main_sync_safe(dispatch_block_t block); \ No newline at end of file diff --git a/YuMi/Tools/GCDHelper/GCDHelper.m.backup b/YuMi/Tools/GCDHelper/GCDHelper.m.backup deleted file mode 100644 index f4fc1a5..0000000 --- a/YuMi/Tools/GCDHelper/GCDHelper.m.backup +++ /dev/null @@ -1,16 +0,0 @@ -// -// GCDHelper.m -// YYMobileFramework -// -// Created by wuwei on 14/7/18. -// Copyright (c) 2014年 YY Inc. All rights reserved. -// - -#import "GCDHelper.h" -void dispatch_main_sync_safe(dispatch_block_t block) { - if ([NSThread isMainThread]) { - block(); - }else { - dispatch_sync(dispatch_get_main_queue(), block); - } -} diff --git a/YuMi/Tools/MJExtension/NSObject+MJExtension.h.backup b/YuMi/Tools/MJExtension/NSObject+MJExtension.h.backup deleted file mode 100644 index ac97712..0000000 --- a/YuMi/Tools/MJExtension/NSObject+MJExtension.h.backup +++ /dev/null @@ -1,43 +0,0 @@ -// -// NSObject+MJExtension.h -// YUMI -// -// Created by zu on 2021/10/27. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface NSObject (MJExtension) - -/// 依据数组初始化一个实例数组 -/// @param json json 数据 -+ (NSArray *)modelsWithArray:(id)json; - -/// 依据字典初始化一个实例 -/// @param dictionary 字典 -+ (instancetype)modelWithDictionary:(NSDictionary *)dictionary; - -/// 依据JSON对象初始化一个实例 -/// @param json json 数据 -+ (instancetype)modelWithJSON:(id)json; - -///model 转字典 -- (NSDictionary *)model2dictionary; - -///转 json string -- (NSString *)toJSONString; - -///转 json object -- (id)toJSONObject; - -///扩展方法 按需索取 重写即可 -///如果一个模型中 包含一个数组 数组中是另一个模型 -+ (NSDictionary *)objectClassInArray; -///如果一个模型中需要字段映射的话 比如id -> ID name -> other.name -+ (NSDictionary *)replacedKeyFromPropertyName; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Tools/MJExtension/NSObject+MJExtension.m.backup b/YuMi/Tools/MJExtension/NSObject+MJExtension.m.backup deleted file mode 100644 index 340753d..0000000 --- a/YuMi/Tools/MJExtension/NSObject+MJExtension.m.backup +++ /dev/null @@ -1,64 +0,0 @@ -// -// NSObject+MJExtension.m -// YUMI -// -// Created by zu on 2021/10/27. -// - -#import "NSObject+MJExtension.h" -#import - -@implementation NSObject (MJExtension) - -/// 依据数组初始化一个实例数组 -/// @param json json 数据 -+ (NSArray *)modelsWithArray:(id)json { - return [self mj_objectArrayWithKeyValuesArray:json]; -} - -/// 依据字典初始化一个实例 -/// @param dictionary 字典 -+ (instancetype)modelWithDictionary:(NSDictionary *)dictionary { - return [self mj_objectWithKeyValues:dictionary]; -} - -/// 依据JSON对象初始化一个实例 -/// @param json json 数据 -+ (instancetype)modelWithJSON:(id)json { - return [self mj_objectWithKeyValues:json]; -} - -///model 转字典 -- (NSDictionary *)model2dictionary { - return [[self mj_keyValues] copy]; -} - -- (NSString *)toJSONString { - return [self mj_JSONString]; -} - -- (id)toJSONObject { - return [self mj_JSONObject]; -} - -///如果模型中包含数组的话 -+ (NSDictionary *)mj_objectClassInArray { - return [self objectClassInArray]; -} - -///模型中需要映射 重写整个方法 -+ (NSDictionary *)mj_replacedKeyFromPropertyName { - return [self replacedKeyFromPropertyName]; -} - -///扩展方法 按需索取 重写即可 -///如果一个模型中 包含一个数组 数组中是另一个模型 -+ (NSDictionary *)objectClassInArray { - return @{}; -} -///如果一个模型中需要字段映射的话 比如id -> ID name -> other.name -+ (NSDictionary *)replacedKeyFromPropertyName { - return @{}; -} - -@end diff --git a/YuMi/Tools/MedalMediaDisplayManager.h.backup b/YuMi/Tools/MedalMediaDisplayManager.h.backup deleted file mode 100644 index 315c3ca..0000000 --- a/YuMi/Tools/MedalMediaDisplayManager.h.backup +++ /dev/null @@ -1,101 +0,0 @@ -// -// MedalMediaDisplayManager.h -// YuMi -// -// Created by AI on 2025/1/20. -// - -#import -#import - -@class VAPView, NetImageView, XPRoomGiftAnimationParser; - -NS_ASSUME_NONNULL_BEGIN - -/** - * 媒体显示代理协议 - * 需要使用媒体显示功能的类实现此协议 - */ -@protocol MedalMediaDisplayDelegate - -@required -/// 从数据模型中获取MP4 URL -- (NSString * _Nullable)getMP4UrlFromModel:(id _Nullable)model; - -/// 从数据模型中获取图片 URL -- (NSString * _Nullable)getPicUrlFromModel:(id _Nullable)model; - -/// 获取图片显示视图 -- (NetImageView *)getImageView; - -/// 获取MP4播放视图 -- (VAPView *)getMP4View; - -@optional -/// 媒体显示状态更新回调 -- (void)onMediaDisplayUpdated:(BOOL)isMP4 success:(BOOL)success; - -/// 获取默认占位图 -- (UIImage * _Nullable)getDefaultPlaceholderImage; - -@end - -/** - * 勋章媒体显示管理器 - * 统一处理MP4和PNG的显示逻辑 - */ -@interface MedalMediaDisplayManager : NSObject - -/// 代理对象 -@property (nonatomic, weak) id delegate; - -/// 当前显示的数据模型 -@property (nonatomic, strong, nullable) id currentModel; - -/// 可见性状态 -@property (nonatomic, assign) BOOL isVisible; - -/// 当前媒体路径 -@property (nonatomic, copy, readonly, nullable) NSString *currentImagePath; -@property (nonatomic, copy, readonly, nullable) NSString *currentMP4Path; - -/** - * 初始化方法 - * @param delegate 实现MedalMediaDisplayDelegate协议的对象 - */ -- (instancetype)initWithDelegate:(id)delegate; - -/** - * 更新显示内容 - * @param model 数据模型 - */ -- (void)updateDisplayWithModel:(id _Nullable)model; - -/** - * 可见性管理 - */ -- (void)willDisplay; -- (void)didEndDisplaying; - -/** - * 播放控制 - */ -- (void)stopMP4Playback; -- (void)pauseMP4Playback; -- (void)resumeMP4Playback; - -/** - * 资源清理 - */ -- (void)cleanupResources; - -/** - * 应用生命周期通知处理 - */ -- (void)handleAppDidEnterBackground; -- (void)handleAppWillEnterForeground; -- (void)handleMemoryWarning; - -@end - -NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/YuMi/Tools/MedalMediaDisplayManager.m.backup b/YuMi/Tools/MedalMediaDisplayManager.m.backup deleted file mode 100644 index 86dffd1..0000000 --- a/YuMi/Tools/MedalMediaDisplayManager.m.backup +++ /dev/null @@ -1,328 +0,0 @@ -// -// MedalMediaDisplayManager.m -// YuMi -// -// Created by AI on 2025/1/20. -// - -#import "MedalMediaDisplayManager.h" -#import -#import "XPRoomGiftAnimationParser.h" -#import "NSString+XPExtension.h" -#import "UIImageConstant.h" - -@interface MedalMediaDisplayManager () - -@property (nonatomic, copy, readwrite, nullable) NSString *currentImagePath; -@property (nonatomic, copy, readwrite, nullable) NSString *currentMP4Path; -@property (nonatomic, strong) XPRoomGiftAnimationParser *mp4Parser; -@property (nonatomic, assign) NSInteger mp4PlaybackTag; // 播放状态标记 - -@end - -@implementation MedalMediaDisplayManager - -#pragma mark - 初始化 - -- (instancetype)initWithDelegate:(id)delegate { - self = [super init]; - if (self) { - _delegate = delegate; - _isVisible = YES; - _mp4PlaybackTag = 0; - [self setupNotifications]; - } - return self; -} - -- (void)dealloc { - [self cleanupResources]; - [[NSNotificationCenter defaultCenter] removeObserver:self]; - NSLog(@"MedalMediaDisplayManager dealloc"); -} - -#pragma mark - 公共接口 - -- (void)updateDisplayWithModel:(id)model { - self.currentModel = model; - [self handleMediaDisplayWithModel:model]; -} - -- (void)willDisplay { - self.isVisible = YES; - [self resumeMP4PlaybackIfNeeded]; -} - -- (void)didEndDisplaying { - self.isVisible = NO; - [self pauseMP4Playback]; -} - -- (void)stopMP4Playback { - VAPView *mp4View = [self.delegate getMP4View]; - if (mp4View) { - [mp4View stopHWDMP4]; - self.mp4PlaybackTag = 0; - } -} - -- (void)pauseMP4Playback { - VAPView *mp4View = [self.delegate getMP4View]; - if (mp4View && !mp4View.hidden) { - [mp4View pauseHWDMP4]; - } -} - -- (void)resumeMP4Playback { - [self resumeMP4PlaybackIfNeeded]; -} - -- (void)cleanupResources { - [self stopMP4Playback]; - self.mp4Parser = nil; - self.currentImagePath = nil; - self.currentMP4Path = nil; - self.currentModel = nil; -} - -#pragma mark - 核心媒体处理逻辑 - -- (void)handleMediaDisplayWithModel:(id)model { - if (!model || !self.delegate) { - [self showDefaultPlaceholder]; - return; - } - - NSString *mp4Url = [self.delegate getMP4UrlFromModel:model]; - NSString *picUrl = [self.delegate getPicUrlFromModel:model]; - - // 优先判断 MP4 URL - if (![NSString isEmpty:mp4Url] && [self isValidMP4URL:mp4Url]) { - [self setMp4Path:mp4Url]; - return; - } - - // MP4 URL 无效,检查图片 URL - if (![NSString isEmpty:picUrl]) { - if ([self isValidMP4URL:picUrl]) { - // picUrl 实际上是 MP4(兼容旧逻辑) - [self setMp4Path:picUrl]; - return; - } else if ([NSString isValidImageURL:picUrl]) { - // 有效的图片 URL - [self setImagePath:picUrl]; - return; - } - } - - // 都无效,显示默认占位图 - [self showDefaultPlaceholder]; -} - -- (void)setImagePath:(NSString *)imagePath { - [self stopMP4Playback]; - - self.currentImagePath = imagePath; - self.currentMP4Path = nil; - - VAPView *mp4View = [self.delegate getMP4View]; - NetImageView *imageView = [self.delegate getImageView]; - - mp4View.hidden = YES; - imageView.hidden = NO; - imageView.imageUrl = imagePath ?: @""; - - [self notifyDisplayUpdated:NO success:![NSString isEmpty:imagePath]]; -} - -- (void)setMp4Path:(NSString *)mp4Path { - if ([NSString isEmpty:mp4Path]) { - [self showDefaultPlaceholder]; - return; - } - - [self stopMP4Playback]; - - self.currentMP4Path = mp4Path; - self.currentImagePath = nil; - - VAPView *mp4View = [self.delegate getMP4View]; - NetImageView *imageView = [self.delegate getImageView]; - - mp4View.hidden = NO; - imageView.hidden = YES; - - if (!self.mp4Parser) { - self.mp4Parser = [[XPRoomGiftAnimationParser alloc] init]; - } - - @kWeakify(self); - [self.mp4Parser parseWithURL:mp4Path - completionBlock:^(NSString * _Nullable videoUrl) { - @kStrongify(self); - if (![NSString isEmpty:videoUrl]) { - self.mp4PlaybackTag = 1; // 标记已准备好播放 - - if (self.isVisible) { - [self startMP4PlaybackWithURL:videoUrl]; - } - } - } failureBlock:^(NSError * _Nullable error) { - @kStrongify(self); - NSLog(@"[MedalMediaDisplayManager] Failed to parse mp4: %@", error); - [self handleMP4FailureWithFallback]; - }]; -} - -- (void)startMP4PlaybackWithURL:(NSString *)videoUrl { - if ([NSString isEmpty:videoUrl] || !self.delegate) { - return; - } - - VAPView *mp4View = [self.delegate getMP4View]; - if (mp4View && !mp4View.hidden) { - [mp4View playHWDMP4:videoUrl repeatCount:-1 delegate:self]; - [self notifyDisplayUpdated:YES success:YES]; - NSLog(@"[MedalMediaDisplayManager] Started MP4 playback: %@", videoUrl); - } -} - -- (void)handleMP4FailureWithFallback { - if (!self.delegate || !self.currentModel) { - [self showDefaultPlaceholder]; - return; - } - - // MP4 失败,尝试降级到图片 - NSString *picUrl = [self.delegate getPicUrlFromModel:self.currentModel]; - if (![NSString isEmpty:picUrl] && [NSString isValidImageURL:picUrl]) { - [self setImagePath:picUrl]; - } else { - [self showDefaultPlaceholder]; - } -} - -- (void)showDefaultPlaceholder { - [self stopMP4Playback]; - - VAPView *mp4View = [self.delegate getMP4View]; - NetImageView *imageView = [self.delegate getImageView]; - - mp4View.hidden = YES; - imageView.hidden = NO; - imageView.imageUrl = @""; - - // 获取默认占位图 - UIImage *placeholderImage = nil; - if ([self.delegate respondsToSelector:@selector(getDefaultPlaceholderImage)]) { - placeholderImage = [self.delegate getDefaultPlaceholderImage]; - } - if (!placeholderImage) { - placeholderImage = [UIImageConstant defaultEmptyPlaceholder]; - } - imageView.image = placeholderImage; - - [self notifyDisplayUpdated:NO success:NO]; -} - -- (void)resumeMP4PlaybackIfNeeded { - if (!self.isVisible || [NSString isEmpty:self.currentMP4Path]) { - return; - } - - VAPView *mp4View = [self.delegate getMP4View]; - if (mp4View && !mp4View.hidden) { - if (self.mp4PlaybackTag == 1) { - // 已准备好但尚未播放,重新解析并播放 - @kWeakify(self); - [self.mp4Parser parseWithURL:self.currentMP4Path - completionBlock:^(NSString * _Nullable videoUrl) { - @kStrongify(self); - if (![NSString isEmpty:videoUrl] && self.isVisible) { - [self startMP4PlaybackWithURL:videoUrl]; - } - } failureBlock:^(NSError * _Nullable error) { - @kStrongify(self); - [self handleMP4FailureWithFallback]; - }]; - } else { - // 恢复暂停的播放 - [mp4View resumeHWDMP4]; - } - } -} - -#pragma mark - 辅助方法 - -- (BOOL)isValidMP4URL:(NSString *)url { - if ([NSString isEmpty:url]) { - return NO; - } - - NSString *lowercaseUrl = [url lowercaseString]; - return [lowercaseUrl hasSuffix:@".mp4"] || - [lowercaseUrl containsString:@"mp4"] || - [lowercaseUrl containsString:@"video"]; -} - -- (void)notifyDisplayUpdated:(BOOL)isMP4 success:(BOOL)success { - if ([self.delegate respondsToSelector:@selector(onMediaDisplayUpdated:success:)]) { - [self.delegate onMediaDisplayUpdated:isMP4 success:success]; - } -} - -#pragma mark - 通知处理 - -- (void)setupNotifications { - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(handleAppDidEnterBackground) - name:UIApplicationDidEnterBackgroundNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(handleAppWillEnterForeground) - name:UIApplicationWillEnterForegroundNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(handleMemoryWarning) - name:UIApplicationDidReceiveMemoryWarningNotification - object:nil]; -} - -- (void)handleAppDidEnterBackground { - [self pauseMP4Playback]; -} - -- (void)handleAppWillEnterForeground { - if (self.isVisible) { - [self resumeMP4PlaybackIfNeeded]; - } -} - -- (void)handleMemoryWarning { - if (!self.isVisible) { - [self stopMP4Playback]; - } -} - -#pragma mark - HWDMP4PlayDelegate - -- (BOOL)shouldStartPlayMP4:(VAPView *)container config:(QGVAPConfigModel *)config { - return YES; -} - -- (void)viewDidFinishPlayMP4:(NSInteger)totalFrameCount view:(VAPView *)container { - // MP4 播放完成,循环播放会自动重新开始 -} - -- (void)viewDidStopPlayMP4:(NSInteger)lastFrameIndex view:(VAPView *)container { - // MP4 播放停止 -} - -- (void)viewDidFailPlayMP4:(NSError *)error { - NSLog(@"[MedalMediaDisplayManager] MP4 播放失败: %@", error); - [self handleMP4FailureWithFallback]; -} - -@end \ No newline at end of file diff --git a/YuMi/Tools/NSString/NSString+Utils.h.backup b/YuMi/Tools/NSString/NSString+Utils.h.backup deleted file mode 100644 index 5749028..0000000 --- a/YuMi/Tools/NSString/NSString+Utils.h.backup +++ /dev/null @@ -1,64 +0,0 @@ -// -// NSString+Regex.h -// YUMI -// -// Created by YUMI on 2021/9/14. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface NSString (Utils) - -///是否是正确的手机号 -- (BOOL)isPhoneNumber; - - -///MD5加密 -- (NSString *)MD5String; - -+ (BOOL)versionCompareOldStr:(NSString *)first andNewStr: (NSString *)second; - -///数字转化为万 -+ (NSString *)getDealNumWithString:(NSString *)string; -///数字转化为十万 -+(NSString *)getDealTenNumWithString:(NSString *)string; - -+ (NSString *)formatNumberToKOrM:(NSString *)string; - -///时间戳转化为需要显示的内容 -+ (NSString *)stringWithTimeStamp:(NSString *)timeStamp; -///通过生日获取星座 -+ (NSString *)calculateConstellationWithMonth:(long)time; -///通过生日获取星座 -+ (NSString *)getCalculateConstellationTextWithMonth:(long)time; -///通过生日获取星座图片 -+ (NSString *)getCalculateConstellationImageWithMonth:(long)time; -///得到年龄 -+(NSString *)getAgeWithBirth:(long)birth; -///得到区号 -+(NSString *)getCountryCode; -///产生唯一的key,用于图片或文件上传 -+ (NSString *)createUUID; - -+ (BOOL)isEmpty:(NSString *)string; -//- (BOOL)isEmpty; - -- (NSString *)pureURLString; - -+ (NSString *)formatNumberToKOrM_NoRounding:(NSString *)string; - -+ (NSString *)stringByRemovingRedundantZeros:(NSString *)string; - -+ (NSString *)trimString:(NSString *)input lengthLimit:(NSInteger)limit; - -+ (BOOL)isValidImageURL:(NSString *)url; - -/// 检查字符串是否为图片格式(通过扩展名判断) -+ (BOOL)isImageFormat:(NSString *)url; - -@end - - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Tools/NSString/NSString+Utils.m.backup b/YuMi/Tools/NSString/NSString+Utils.m.backup deleted file mode 100644 index ce091de..0000000 --- a/YuMi/Tools/NSString/NSString+Utils.m.backup +++ /dev/null @@ -1,524 +0,0 @@ -// -// NSString+Regex.m -// YUMI -// -// Created by YUMI on 2021/9/14. -// - -#import "NSString+Utils.h" -#import - - -@implementation NSString (Utils) - -///是否是正确的手机号 -- (BOOL)isPhoneNumber{ - NSString *regex =@"^((1[3-9][0-9])|(147)|(15[^4,\\D])|(18[0,5-9]))\\d{8}$"; - NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex]; - return [pred evaluateWithObject:self]; -} - -///MD5加密 -- (NSString *)MD5String { - const char *cstr = [self UTF8String]; - unsigned char result[16]; - CC_MD5(cstr, (CC_LONG)strlen(cstr), result); - return [NSString stringWithFormat: - @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", - result[0], result[1], result[2], result[3], - result[4], result[5], result[6], result[7], - result[8], result[9], result[10], result[11], - result[12], result[13], result[14], result[15] - ]; -} - -+ (BOOL)versionCompareOldStr:(NSString *)first andNewStr: (NSString *)second{ - if ([first compare:second options:NSNumericSearch] == NSOrderedAscending){ - return NO; - }else if ([first compare:second options:NSNumericSearch] == NSOrderedSame){ - return YES; - }else{ - return YES; - } -} -+(NSString *)getDealTenNumWithString:(NSString *)string{ - if (string.floatValue < 100000) { - return [NSString stringWithFormat:@"%@", string]; - } - NSDecimalNumber *numberA = [NSDecimalNumber decimalNumberWithString:string]; - NSDecimalNumber *numberB = [NSDecimalNumber decimalNumberWithString:@"1000"]; - //NSDecimalNumberBehaviors对象的创建 参数 1.RoundingMode 一个取舍枚举值 2.scale 处理范围 3.raiseOnExactness 精确出现异常是否抛出原因 4.raiseOnOverflow 上溢出是否抛出原因 4.raiseOnUnderflow 下溢出是否抛出原因 5.raiseOnDivideByZero 除以0是否抛出原因。 - NSDecimalNumberHandler *roundingBehavior = [NSDecimalNumberHandler decimalNumberHandlerWithRoundingMode:NSRoundDown scale:0 raiseOnExactness:NO raiseOnOverflow:NO raiseOnUnderflow:NO raiseOnDivideByZero:NO]; - /// 这里不仅包含Multiply还有加 减 乘。 - NSDecimalNumber *numResult = [numberA decimalNumberByDividingBy:numberB withBehavior:roundingBehavior]; - NSString *strResult = [numResult stringValue]; - return [NSString stringWithFormat:@"%@k", strResult]; -} -///数字转化为万 -+ (NSString *)getDealNumWithString:(NSString *)string{ - if (string.floatValue < 10000) { - return [NSString stringWithFormat:@"%@", string]; - } - NSDecimalNumber *numberA = [NSDecimalNumber decimalNumberWithString:string]; - NSDecimalNumber *numberB = [NSDecimalNumber decimalNumberWithString:@"10000"]; - //NSDecimalNumberBehaviors对象的创建 参数 1.RoundingMode 一个取舍枚举值 2.scale 处理范围 3.raiseOnExactness 精确出现异常是否抛出原因 4.raiseOnOverflow 上溢出是否抛出原因 4.raiseOnUnderflow 下溢出是否抛出原因 5.raiseOnDivideByZero 除以0是否抛出原因。 - NSDecimalNumberHandler *roundingBehavior = [NSDecimalNumberHandler decimalNumberHandlerWithRoundingMode:NSRoundDown scale:2 raiseOnExactness:NO raiseOnOverflow:NO raiseOnUnderflow:NO raiseOnDivideByZero:NO]; - /// 这里不仅包含Multiply还有加 减 乘。 - NSDecimalNumber *numResult = [numberA decimalNumberByDividingBy:numberB withBehavior:roundingBehavior]; - NSString *strResult = [numResult stringValue]; - return [NSString stringWithFormat:YMLocalizedString(@"NSString_Utils4"), strResult]; -} - -+ (NSString *)formatNumberToKOrM:(NSString *)string { - // 定义数值单位 - NSDecimalNumber *thousand = [NSDecimalNumber decimalNumberWithString:@"1000"]; - NSDecimalNumber *nine = [NSDecimalNumber decimalNumberWithString:@"9999"]; - NSDecimalNumber *million = [NSDecimalNumber decimalNumberWithString:@"1000000"]; - NSDecimalNumber *billion = [NSDecimalNumber decimalNumberWithString:@"1000000000"]; - NSDecimalNumber *trillion = [NSDecimalNumber decimalNumberWithString:@"1000000000000"]; - // 创建 NSDecimalNumber 对象 - NSDecimalNumber *number = [NSDecimalNumber decimalNumberWithString:string]; - - // 判断数值范围并处理 - if ([number compare:nine] == NSOrderedAscending) { - // 小于 10000,直接返回原始值 - return [NSString stringWithFormat:@"%@", string]; - } else if ([number compare:nine] != NSOrderedAscending && [number compare:million] == NSOrderedAscending) { - // 10000 到 9999999,用K表示 - NSDecimalNumber *result = [number decimalNumberByDividingBy:thousand]; - return [self formatResult:result withUnit:@"K"];//[NSString stringWithFormat:@"%.1fK", result.doubleValue]; - } else if ([number compare:million] != NSOrderedAscending && [number compare:billion] == NSOrderedAscending) { - // 超过 1000000,用M表示 - NSDecimalNumber *result = [number decimalNumberByDividingBy:million]; - return [self formatResult:result withUnit:@"M"];//[NSString stringWithFormat:@"%.1fM", result.doubleValue]; - } else if ([number compare:billion] != NSOrderedAscending && [number compare:trillion] == NSOrderedAscending) { - // 超过十亿,用 B 表示 - NSDecimalNumber *result = [number decimalNumberByDividingBy:billion]; - return [self formatResult:result withUnit:@"B"]; - } else { - // 超过一万亿,可以继续增加更高单位 - NSDecimalNumber *result = [number decimalNumberByDividingBy:trillion]; - return [self formatResult:result withUnit:@"T"]; // T 表示万亿 (Trillion) - } -} - -+ (NSString *)formatNumberToKOrM_NoRounding:(NSString *)string { - // 定义数值单位 - NSDecimalNumber *thousand = [NSDecimalNumber decimalNumberWithString:@"1000"]; - NSDecimalNumber *nine = [NSDecimalNumber decimalNumberWithString:@"9999"]; - NSDecimalNumber *million = [NSDecimalNumber decimalNumberWithString:@"1000000"]; - NSDecimalNumber *billion = [NSDecimalNumber decimalNumberWithString:@"1000000000"]; - NSDecimalNumber *trillion = [NSDecimalNumber decimalNumberWithString:@"1000000000000"]; - // 创建 NSDecimalNumber 对象 - NSDecimalNumber *number = [NSDecimalNumber decimalNumberWithString:string]; - - // 判断数值范围并处理 - if ([number compare:nine] == NSOrderedAscending) { - // 小于 10000,直接返回原始值 - return [NSString stringWithFormat:@"%@", string]; - } else if ([number compare:nine] != NSOrderedAscending && [number compare:million] == NSOrderedAscending) { - // 10000 到 9999999,用K表示 - NSDecimalNumber *result = [number decimalNumberByDividingBy:thousand]; - return [self truncateDecimal:result withUnit:@"K"]; - } else if ([number compare:million] != NSOrderedAscending && [number compare:billion] == NSOrderedAscending) { - // 超过 1000000,用M表示 - NSDecimalNumber *result = [number decimalNumberByDividingBy:million]; - return [self truncateDecimal:result withUnit:@"M"]; - } else if ([number compare:billion] != NSOrderedAscending && [number compare:trillion] == NSOrderedAscending) { - // 超过十亿,用 B 表示 - NSDecimalNumber *result = [number decimalNumberByDividingBy:billion]; - return [self truncateDecimal:result withUnit:@"B"]; - } else { - // 超过一万亿,可以继续增加更高单位 - NSDecimalNumber *result = [number decimalNumberByDividingBy:trillion]; - return [self truncateDecimal:result withUnit:@"T"]; // T 表示万亿 (Trillion) - } -} - -// 格式化并截断小数位 -+ (NSString *)truncateDecimal:(NSDecimalNumber *)decimal withUnit:(NSString *)unit { - // 获取字符串形式的结果,并截断到一位小数 - NSString *decimalString = decimal.stringValue; - NSArray *components = [decimalString componentsSeparatedByString:@"."]; - NSString *integerPart = components.firstObject; - NSString *decimalPart = components.count > 1 ? components[1] : @""; - - if (decimalPart.length > 1) { - decimalPart = [decimalPart substringToIndex:1]; // 截断到一位小数 - } - - if (decimalPart.length == 0 || [decimalPart isEqualToString:@"0"]) { - // 如果小数部分为空或为 0,只返回整数部分 - return [NSString stringWithFormat:@"%@%@", integerPart, unit]; - } else { - // 返回截断后的结果 - return [NSString stringWithFormat:@"%@.%@%@", integerPart, decimalPart, unit]; - } -} - - -+ (NSString *)formatResult:(NSDecimalNumber *)result withUnit:(NSString *)unit { - // 将 NSDecimalNumber 转为浮点数 - CGFloat floatValue = result.floatValue; - - // 格式化字符串,保留两位小数 - NSString *formattedString = [NSString stringWithFormat:@"%.2f", floatValue]; - - // 移除多余的 .00 或 .0 - if ([formattedString hasSuffix:@".00"]) { - formattedString = [formattedString substringToIndex:formattedString.length - 3]; // 移除 ".00" - } else if ([formattedString hasSuffix:@".0"]) { - formattedString = [formattedString substringToIndex:formattedString.length - 2]; // 移除 ".0" - } - - return [NSString stringWithFormat:@"%@%@", formattedString, unit]; -} - -+ (NSString *)stringWithTimeStamp:(NSString *)timeStamp { - // 转为秒为单位 - NSTimeInterval second = timeStamp.longLongValue / 1000; - NSDate *date = [NSDate dateWithTimeIntervalSince1970:second]; - - //把字符串转为NSdate - NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; - [dateFormatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"]; - // 时间 10点10分 - NSDateFormatter *timeFormatter = [[NSDateFormatter alloc] init]; - [timeFormatter setDateFormat:@"HH:mm"]; - // 日期 2月18号 - NSDateFormatter *dayFormatter = [[NSDateFormatter alloc] init]; - [dayFormatter setDateFormat:YMLocalizedString(@"NSString_Utils0")]; - // 日期 年月日 - NSDateFormatter *yearFormatter = [[NSDateFormatter alloc] init]; - [yearFormatter setDateFormat:YMLocalizedString(@"NSString_Utils1")]; - - //得到与当前时间差 - NSTimeInterval timeInterval = [date timeIntervalSinceNow]; - timeInterval = -timeInterval; - - long temp = 0; - NSString *result; - - BOOL isSameDay = [[NSCalendar currentCalendar] isDateInToday:date]; // 是否是同一天 - - // A. 当天,且 timeInterval < 1分钟,显示“刚刚”; - if (timeInterval < 60) { - return [NSString stringWithFormat:@"%@", YMLocalizedString(@"NSString_Utils2")]; - - // B. 当天,且1分钟≤ timeInterval <60分钟,显示“n分钟前”; - } else if((temp = timeInterval/60) < 60){ - return [NSString stringWithFormat:YMLocalizedString(@"NSString_Utils3"),temp]; - - // C. 当天,且n≥60分钟,显示“xx:xx”; - } else if((temp = temp/60) < 24 && isSameDay){ - return [timeFormatter stringFromDate:date]; - - // C. 非当天,且n≥60分钟,显示“xx:xx”; - } else if((temp = temp/60) < 24 && !isSameDay){ - return [dayFormatter stringFromDate:date]; - - // D. 跨天,且未跨年,显示“mm-dd”; - } else if((temp = temp/30) < 30){ - return [dayFormatter stringFromDate:date]; - - } else { - // E. 跨年,显示“yyyy-mm-dd”; - return [yearFormatter stringFromDate:date]; - } - - return result; -} - -+ (NSString *)calculateConstellationWithMonth:(long)time -{ - NSString *astroString = YMLocalizedString(@"XPMineHeadView0"); - NSString *astroFormat = @"102123444543"; - NSString *result; - - NSInteger month = [NSString getMonth:time]; - NSInteger day = [NSString getDay:time]; - - if (month<1 || month>12 || day<1 || day>31){ - return YMLocalizedString(@"XPMineHeadView1"); - } - - if(month==2 && day>29) - { - return YMLocalizedString(@"XPMineHeadView2"); - }else if(month==4 || month==6 || month==9 || month==11) { - if (day>30) { - return YMLocalizedString(@"XPMineHeadView3"); - } - } - - result=[NSString stringWithFormat:@"%@",[astroString substringWithRange:NSMakeRange(month*2-(day < [[astroFormat substringWithRange:NSMakeRange((month-1), 1)] intValue] - (-19))*2,2)]]; - - return [NSString stringWithFormat:YMLocalizedString(@"XPMineHeadView6"),result]; - -} -///通过生日获取星座图片 -+ (NSString *)getCalculateConstellationImageWithMonth:(long)time{ - NSString *astroString = YMLocalizedString(@"XPMineHeadView0"); - NSString *astroFormat = @"102123444543"; - NSString *result; - - NSInteger month = [self getMonth:time]; - NSInteger day = [self getDay:time]; - - if (month<1 || month>12 || day<1 || day>31){ - return @""; - } - - if(month==2 && day>29) - { - return @""; - }else if(month==4 || month==6 || month==9 || month==11) { - if (day>30) { - return @""; - } - } - - result=[NSString stringWithFormat:@"%@",[astroString substringWithRange:NSMakeRange(month*2-(day < [[astroFormat substringWithRange:NSMakeRange((month-1), 1)] intValue] - (-19))*2,2)]]; - NSDictionary *starDic = @{YMLocalizedString(@"XPMineHeadView9"):@"pi_capricorn",YMLocalizedString(@"XPMineHeadView10"):@"pi_water_bottle",YMLocalizedString(@"XPMineHeadView11"):@"pi_pisces",YMLocalizedString(@"XPMineHeadView12"):@"pi_aries",YMLocalizedString(@"XPMineHeadView13"):@"pi_taurus",YMLocalizedString(@"XPMineHeadView14"):@"pi_gemini",YMLocalizedString(@"XPMineHeadView15"):@"pi_cancer",YMLocalizedString(@"XPMineHeadView16"):@"pi_lion",YMLocalizedString(@"XPMineHeadView17"):@"pi_virgin",YMLocalizedString(@"XPMineHeadView18"):@"pi_libra",YMLocalizedString(@"XPMineHeadView19"):@"pi_scorpion",YMLocalizedString(@"XPMineHeadView20"):@"pi_shooter"}; - return starDic[result]; -} -///通过生日获取星座 -+ (NSString *)getCalculateConstellationTextWithMonth:(long)time{ - NSString *astroString = YMLocalizedString(@"XPMineHeadView0"); - NSString *astroFormat = @"102123444543"; - NSString *result; - - NSInteger month = [self getMonth:time]; - NSInteger day = [self getDay:time]; - - if (month<1 || month>12 || day<1 || day>31){ - return @""; - } - - if(month==2 && day>29) - { - return @""; - }else if(month==4 || month==6 || month==9 || month==11) { - if (day>30) { - return @""; - } - } - - result=[NSString stringWithFormat:@"%@",[astroString substringWithRange:NSMakeRange(month*2-(day < [[astroFormat substringWithRange:NSMakeRange((month-1), 1)] intValue] - (-19))*2,2)]]; - return result; -} -+(NSInteger) getMonth:(long )time -{ - NSDate *date = [NSDate dateWithTimeIntervalSince1970:time/1000]; - NSCalendar* calendar = [NSCalendar currentCalendar]; - NSDateComponents* components = [calendar components:NSCalendarUnitMonth fromDate:date]; - NSInteger month = components.month; - return month; -} - -+ (NSInteger) getDay:(long) time -{ - NSDate *date = [NSDate dateWithTimeIntervalSince1970:time/1000]; - NSCalendar* calendar = [NSCalendar currentCalendar]; - NSDateComponents* components = [calendar components:NSCalendarUnitDay fromDate:date]; - NSInteger day = components.day; - return day; -} -+(NSString *)getAgeWithBirth:(long)birth{ - if (birth == 0) { - return @" "; - } - NSDateComponents *components1 = [[NSCalendar currentCalendar] components:NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear fromDate:[NSDate dateWithTimeIntervalSince1970:birth/1000]]; - NSInteger brithDateYear = [components1 year]; - NSInteger brithDateDay = [components1 day]; - NSInteger brithDateMonth = [components1 month]; - // 获取系统当前 年月日 - NSDateComponents *components2 = [[NSCalendar currentCalendar] components:NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear fromDate:[NSDate date]]; NSInteger currentDateYear = [components2 year]; - NSInteger currentDateDay = [components2 day]; NSInteger currentDateMonth = [components2 month]; // 计算年龄 - NSInteger iAge = currentDateYear - brithDateYear - 1; - if ((currentDateMonth > brithDateMonth) || (currentDateMonth == brithDateMonth && currentDateDay >= brithDateDay)) { - iAge++; - } - return [NSString stringWithFormat:@" %ld ", iAge]; -} -///得到区号 -+(NSString *)getCountryCode{ - return @""; -} -+(NSString *)createUUID{ - - CFUUIDRef uuid; - CFStringRef uuidText; - uuid = CFUUIDCreate(NULL); - uuidText = CFUUIDCreateString(NULL, uuid); - NSString *time = [NSDate getNowTimeTimestamp]; - NSString *result = [NSString stringWithFormat:@"%@%@",uuidText,time]; - return [result MD5String]; - -} - -+ (BOOL)isEmpty:(NSString *)string { - if (string == nil || [string isKindOfClass:[NSNull class]]) { - return YES; - } - NSString *trimmedString = [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; - return trimmedString.length == 0; -} - -- (NSString *)pureURLString { - NSString *encodingUrl = [self stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet]; - return encodingUrl;//[self stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; -// NSURLComponents *components = [NSURLComponents componentsWithString:self]; -// components.query = [components.query stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; -// return components.string; -} - -+ (NSString *)stringByRemovingRedundantZeros:(NSString *)string { - // 1. 检查输入是否有效 - if (!string || string.length == 0) { - return string; - } - - // 2. 检查字符串是否包含小数点 - if ([string rangeOfString:@"."].location == NSNotFound) { - return string; // 没有小数点,直接返回原始字符串 - } - - // 3. 使用NSDecimalNumber进行精确的数值处理 - NSDecimalNumber *decimalNumber = [NSDecimalNumber decimalNumberWithString:string]; - if ([decimalNumber isEqual:[NSDecimalNumber notANumber]]) { - return string; // 转换失败,返回原始字符串 - } - - // 4. 设置四舍五入处理器,精确到小数点后2位 - NSDecimalNumberHandler *handler = [NSDecimalNumberHandler - decimalNumberHandlerWithRoundingMode:NSRoundPlain - scale:2 - raiseOnExactness:NO - raiseOnOverflow:NO - raiseOnUnderflow:NO - raiseOnDivideByZero:NO]; - - // 5. 执行四舍五入操作 - NSDecimalNumber *roundedNumber = [decimalNumber decimalNumberByRoundingAccordingToBehavior:handler]; - - // 6. 将四舍五入后的数字转换为字符串 - NSString *formattedString = [roundedNumber stringValue]; - - // 7. 分离整数部分和小数部分 - NSArray *components = [formattedString componentsSeparatedByString:@"."]; - NSString *integerPart = components[0]; - - // 8. 如果没有小数部分,直接返回整数部分 - if (components.count < 2) { - return integerPart; - } - - NSString *fractionalPart = components[1]; - - // 9. 如果小数部分为空,返回整数部分 - if (fractionalPart.length == 0) { - return integerPart; - } - - // 10. 移除小数部分末尾的0 - NSUInteger lastNonZeroIndex = NSNotFound; - for (NSInteger i = fractionalPart.length - 1; i >= 0; i--) { - if ([fractionalPart characterAtIndex:i] != '0') { - lastNonZeroIndex = i; - break; - } - } - - // 11. 如果小数部分全是0,返回整数部分 - if (lastNonZeroIndex == NSNotFound) { - return integerPart; - } else { - // 12. 组合整数部分和修剪后的小数部分 - NSString *trimmedFraction = [fractionalPart substringToIndex:lastNonZeroIndex + 1]; - return [NSString stringWithFormat:@"%@.%@", integerPart, trimmedFraction]; - } -} - -//+ (NSString *)stringByRemovingRedundantZeros:(NSString *)string { -// if (![string containsString:@"."]) { -// return string; // 不包含小數點,直接返回 -// } -// -// // 將字串分割成整數部分和小數部分 -// NSArray *components = [string componentsSeparatedByString:@"."]; -// if (components.count > 2) { -// return string; // 包含多個小數點,不處理直接返回 (或者您可以考慮拋出錯誤) -// } -// -// NSString *integerPart = components[0]; -// NSString *fractionalPart = components.count > 1 ? components[1] : @""; -// -// if (fractionalPart.length == 0) { -// return integerPart; // 沒有小數部分,直接返回整數部分 -// } -// -// // 從後向前移除小數部分末尾的 0 -// NSInteger lastNonZeroIndex = -1; -// for (NSInteger i = fractionalPart.length - 1; i >= 0; i--) { -// if ([fractionalPart characterAtIndex:i] != '0') { -// lastNonZeroIndex = i; -// break; -// } -// } -// -// if (lastNonZeroIndex == -1) { -// return integerPart; // 小數部分全是 0,返回整數部分 -// } else { -// // 截取到最後一個非零數字 -// NSString *trimmedFractionalPart = [fractionalPart substringToIndex:lastNonZeroIndex + 1]; -// return [NSString stringWithFormat:@"%@.%@", integerPart, trimmedFractionalPart]; -// } -//} - -+ (NSString *)trimString:(NSString *)input lengthLimit:(NSInteger)limit { - if (input.length <= limit) { - return input; - } else { - NSString *trimmedString = [input substringToIndex:limit]; - return [trimmedString stringByAppendingString:@"..."]; - } -} - -/// 判断 URL 是否为有效的图片格式 -+ (BOOL)isValidImageURL:(NSString *)url { - if ([NSString isEmpty:url]) { - return NO; - } - - NSString *lowercaseURL = url.lowercaseString; - NSArray *imageExtensions = @[@"png", @"jpg", @"jpeg", @"gif", @"webp", @"bmp", @"svg"]; - - for (NSString *extension in imageExtensions) { - if ([lowercaseURL hasSuffix:extension]) { - return YES; - } - } - - return NO; -} - -/// 检查字符串是否为图片格式(通过扩展名判断) -+ (BOOL)isImageFormat:(NSString *)url { - if ([NSString isEmpty:url]) { - return NO; - } - - NSString *lowercaseURL = url.lowercaseString; - NSArray *imageExtensions = @[@".png", @".jpg", @".jpeg", @".gif", @".webp", @".bmp", @".svg"]; - - for (NSString *extension in imageExtensions) { - if ([lowercaseURL hasSuffix:extension]) { - return YES; - } - } - - return NO; -} - -@end diff --git a/YuMi/Tools/Reachability/YYReachability.h.backup b/YuMi/Tools/Reachability/YYReachability.h.backup deleted file mode 100644 index 0591044..0000000 --- a/YuMi/Tools/Reachability/YYReachability.h.backup +++ /dev/null @@ -1,109 +0,0 @@ -/* - Copyright (c) 2011, Tony Million. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - */ - -#import -#import - -#import -#import -#import -#import -#import -#import - -/** - * Does ARC support GCD objects? - * It does if the minimum deployment target is iOS 6+ or Mac OS X 8+ - * - * @see http://opensource.apple.com/source/libdispatch/libdispatch-228.18/os/object.h - **/ -#if OS_OBJECT_USE_OBJC -#define NEEDS_DISPATCH_RETAIN_RELEASE 0 -#else -#define NEEDS_DISPATCH_RETAIN_RELEASE 1 -#endif - -/** - * Create NS_ENUM macro if it does not exist on the targeted version of iOS or OS X. - * - * @see http://nshipster.com/ns_enum-ns_options/ - **/ -#ifndef NS_ENUM -#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type -#endif - -extern NSString *const kYYReachabilityChangedNotification; - -typedef NS_ENUM(NSInteger, NetworkStatus) { - // Apple NetworkStatus Compatible Names. - NotReachable = 0, - ReachableViaWiFi = 2, - ReachableViaWWAN = 1 -}; - -@class YYReachability; - -typedef void (^NetworkReachable)(YYReachability * reachability); -typedef void (^NetworkUnreachable)(YYReachability * reachability); - -@interface YYReachability : NSObject - -@property (nonatomic, copy) NetworkReachable reachableBlock; -@property (nonatomic, copy) NetworkUnreachable unreachableBlock; - - -@property (nonatomic, assign) BOOL reachableOnWWAN; - -+(YYReachability*)reachabilityWithHostname:(NSString*)hostname; -+(YYReachability*)reachabilityForInternetConnection; -+(YYReachability*)reachabilityWithAddress:(const struct sockaddr_in*)hostAddress; -+(YYReachability*)reachabilityForLocalWiFi; - --(YYReachability *)initWithReachabilityRef:(SCNetworkReachabilityRef)ref; - --(BOOL)startNotifier; --(void)stopNotifier; - --(BOOL)isReachable; --(BOOL)isReachableViaWWAN; --(BOOL)isReachableViaWiFi; - -// WWAN may be available, but not active until a connection has been established. -// WiFi may require a connection for VPN on Demand. --(BOOL)isConnectionRequired; // Identical DDG variant. --(BOOL)connectionRequired; // Apple's routine. -// Dynamic, on demand connection? --(BOOL)isConnectionOnDemand; -// Is user intervention required? --(BOOL)isInterventionRequired; - --(NetworkStatus)currentReachabilityStatus; --(SCNetworkReachabilityFlags)reachabilityFlags; --(NSString*)currentReachabilityString; --(NSString*)currentReachabilityFlags; - -@end diff --git a/YuMi/Tools/Reachability/YYReachability.m.backup b/YuMi/Tools/Reachability/YYReachability.m.backup deleted file mode 100644 index fcd8ba1..0000000 --- a/YuMi/Tools/Reachability/YYReachability.m.backup +++ /dev/null @@ -1,527 +0,0 @@ -/* - Copyright (c) 2011, Tony Million. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - */ - -#import "YYReachability.h" - - -NSString *const kYYReachabilityChangedNotification = @"kYYReachabilityChangedNotification"; - -@interface YYReachability () - -@property (nonatomic, assign) SCNetworkReachabilityRef reachabilityRef; - - -#if NEEDS_DISPATCH_RETAIN_RELEASE -@property (nonatomic, assign) dispatch_queue_t reachabilitySerialQueue; -#else -@property (nonatomic, strong) dispatch_queue_t reachabilitySerialQueue; -#endif - - -@property (nonatomic, strong) id reachabilityObject; - --(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags; --(BOOL)isReachableWithFlags:(SCNetworkReachabilityFlags)flags; - -@end - -static NSString *reachabilityFlags(SCNetworkReachabilityFlags flags) -{ - return [NSString stringWithFormat:@"%c%c %c%c%c%c%c%c%c", -#if TARGET_OS_IPHONE - (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-', -#else - 'X', -#endif - (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-', - (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-', - (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-', - (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-', - (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-', - (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-', - (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-', - (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-']; -} - -// Start listening for reachability notifications on the current run loop -static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info) -{ -#pragma unused (target) -#if __has_feature(objc_arc) - YYReachability *reachability = ((__bridge YYReachability*)info); -#else - YYReachability *reachability = ((YYReachability*)info); -#endif - - // We probably don't need an autoreleasepool here, as GCD docs state each queue has its own autorelease pool, - // but what the heck eh? - @autoreleasepool - { - [reachability reachabilityChanged:flags]; - } -} - - -@implementation YYReachability - -@synthesize reachabilityRef; -@synthesize reachabilitySerialQueue; - -@synthesize reachableOnWWAN; - -@synthesize reachableBlock; -@synthesize unreachableBlock; - -@synthesize reachabilityObject; - -#pragma mark - Class Constructor Methods - -+(YYReachability*)reachabilityWithHostName:(NSString*)hostname -{ - return [YYReachability reachabilityWithHostname:hostname]; -} - -+(YYReachability*)reachabilityWithHostname:(NSString*)hostname -{ - SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithName(NULL, [hostname UTF8String]); - if (ref) - { - id reachability = [[self alloc] initWithReachabilityRef:ref]; - -#if __has_feature(objc_arc) - return reachability; -#else - return [reachability autorelease]; -#endif - - } - - return nil; -} - -+(YYReachability *)reachabilityWithAddress:(const struct sockaddr_in *)hostAddress -{ - SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress); - if (ref) - { - id reachability = [[self alloc] initWithReachabilityRef:ref]; - -#if __has_feature(objc_arc) - return reachability; -#else - return [reachability autorelease]; -#endif - } - - return nil; -} - -+(YYReachability *)reachabilityForInternetConnection -{ - struct sockaddr_in zeroAddress; - bzero(&zeroAddress, sizeof(zeroAddress)); - zeroAddress.sin_len = sizeof(zeroAddress); - zeroAddress.sin_family = AF_INET; - - return [self reachabilityWithAddress:&zeroAddress]; -} - -+(YYReachability*)reachabilityForLocalWiFi -{ - struct sockaddr_in localWifiAddress; - bzero(&localWifiAddress, sizeof(localWifiAddress)); - localWifiAddress.sin_len = sizeof(localWifiAddress); - localWifiAddress.sin_family = AF_INET; - // IN_LINKLOCALNETNUM is defined in as 169.254.0.0 - localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM); - - return [self reachabilityWithAddress:&localWifiAddress]; -} - - -// Initialization methods - --(YYReachability *)initWithReachabilityRef:(SCNetworkReachabilityRef)ref -{ - self = [super init]; - if (self != nil) - { - self.reachableOnWWAN = YES; - self.reachabilityRef = ref; - } - - return self; -} - --(void)dealloc -{ - [self stopNotifier]; - - if(self.reachabilityRef) - { - CFRelease(self.reachabilityRef); - self.reachabilityRef = nil; - } - - self.reachableBlock = nil; - self.unreachableBlock = nil; - -#if !(__has_feature(objc_arc)) - [super dealloc]; -#endif - - -} - -#pragma mark - Notifier Methods - -// Notifier -// NOTE: This uses GCD to trigger the blocks - they *WILL NOT* be called on THE MAIN THREAD -// - In other words DO NOT DO ANY UI UPDATES IN THE BLOCKS. -// INSTEAD USE dispatch_async(dispatch_get_main_queue(), ^{UISTUFF}) (or dispatch_sync if you want) - --(BOOL)startNotifier -{ - SCNetworkReachabilityContext context = { 0, NULL, NULL, NULL, NULL }; - - // this should do a retain on ourself, so as long as we're in notifier mode we shouldn't disappear out from under ourselves - // woah - self.reachabilityObject = self; - - - - // First, we need to create a serial queue. - // We allocate this once for the lifetime of the notifier. - self.reachabilitySerialQueue = dispatch_queue_create("com.tonymillion.reachability", NULL); - if(!self.reachabilitySerialQueue) - { - return NO; - } - -#if __has_feature(objc_arc) - context.info = (__bridge void *)self; -#else - context.info = (void *)self; -#endif - - if (!SCNetworkReachabilitySetCallback(self.reachabilityRef, TMReachabilityCallback, &context)) - { -#ifdef DEBUG - NSLog(@"SCNetworkReachabilitySetCallback() failed: %s", SCErrorString(SCError())); -#endif - - // Clear out the dispatch queue - if(self.reachabilitySerialQueue) - { -#if NEEDS_DISPATCH_RETAIN_RELEASE - dispatch_release(self.reachabilitySerialQueue); -#endif - self.reachabilitySerialQueue = nil; - } - - self.reachabilityObject = nil; - - return NO; - } - - // Set it as our reachability queue, which will retain the queue - if(!SCNetworkReachabilitySetDispatchQueue(self.reachabilityRef, self.reachabilitySerialQueue)) - { -#ifdef DEBUG - NSLog(@"SCNetworkReachabilitySetDispatchQueue() failed: %s", SCErrorString(SCError())); -#endif - - // UH OH - FAILURE! - - // First stop, any callbacks! - SCNetworkReachabilitySetCallback(self.reachabilityRef, NULL, NULL); - - // Then clear out the dispatch queue. - if(self.reachabilitySerialQueue) - { -#if NEEDS_DISPATCH_RETAIN_RELEASE - dispatch_release(self.reachabilitySerialQueue); -#endif - self.reachabilitySerialQueue = nil; - } - - self.reachabilityObject = nil; - - return NO; - } - - return YES; -} - --(void)stopNotifier -{ - // First stop, any callbacks! - SCNetworkReachabilitySetCallback(self.reachabilityRef, NULL, NULL); - - // Unregister target from the GCD serial dispatch queue. - SCNetworkReachabilitySetDispatchQueue(self.reachabilityRef, NULL); - - if(self.reachabilitySerialQueue) - { -#if NEEDS_DISPATCH_RETAIN_RELEASE - dispatch_release(self.reachabilitySerialQueue); -#endif - self.reachabilitySerialQueue = nil; - } - - self.reachabilityObject = nil; -} - -#pragma mark - reachability tests - -// This is for the case where you flick the airplane mode; -// you end up getting something like this: -//Reachability: WR ct----- -//Reachability: -- ------- -//Reachability: WR ct----- -//Reachability: -- ------- -// We treat this as 4 UNREACHABLE triggers - really apple should do better than this - -#define testcase (kSCNetworkReachabilityFlagsConnectionRequired | kSCNetworkReachabilityFlagsTransientConnection) - --(BOOL)isReachableWithFlags:(SCNetworkReachabilityFlags)flags -{ - BOOL connectionUP = YES; - - if(!(flags & kSCNetworkReachabilityFlagsReachable)) - connectionUP = NO; - - if( (flags & testcase) == testcase ) - connectionUP = NO; - -#if TARGET_OS_IPHONE - if(flags & kSCNetworkReachabilityFlagsIsWWAN) - { - // We're on 3G. - if(!self.reachableOnWWAN) - { - // We don't want to connect when on 3G. - connectionUP = NO; - } - } -#endif - - return connectionUP; -} - --(BOOL)isReachable -{ - SCNetworkReachabilityFlags flags; - - if(!SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) - return NO; - - return [self isReachableWithFlags:flags]; -} - --(BOOL)isReachableViaWWAN -{ -#if TARGET_OS_IPHONE - - SCNetworkReachabilityFlags flags = 0; - - if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) - { - // Check we're REACHABLE - if(flags & kSCNetworkReachabilityFlagsReachable) - { - // Now, check we're on WWAN - if(flags & kSCNetworkReachabilityFlagsIsWWAN) - { - return YES; - } - } - } -#endif - - return NO; -} - --(BOOL)isReachableViaWiFi -{ - SCNetworkReachabilityFlags flags = 0; - - if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) - { - // Check we're reachable - if((flags & kSCNetworkReachabilityFlagsReachable)) - { -#if TARGET_OS_IPHONE - // Check we're NOT on WWAN - if((flags & kSCNetworkReachabilityFlagsIsWWAN)) - { - return NO; - } -#endif - return YES; - } - } - - return NO; -} - - -// WWAN may be available, but not active until a connection has been established. -// WiFi may require a connection for VPN on Demand. --(BOOL)isConnectionRequired -{ - return [self connectionRequired]; -} - --(BOOL)connectionRequired -{ - SCNetworkReachabilityFlags flags; - - if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) - { - return (flags & kSCNetworkReachabilityFlagsConnectionRequired); - } - - return NO; -} - -// Dynamic, on demand connection? --(BOOL)isConnectionOnDemand -{ - SCNetworkReachabilityFlags flags; - - if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) - { - return ((flags & kSCNetworkReachabilityFlagsConnectionRequired) && - (flags & (kSCNetworkReachabilityFlagsConnectionOnTraffic | kSCNetworkReachabilityFlagsConnectionOnDemand))); - } - - return NO; -} - -// Is user intervention required? --(BOOL)isInterventionRequired -{ - SCNetworkReachabilityFlags flags; - - if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) - { - return ((flags & kSCNetworkReachabilityFlagsConnectionRequired) && - (flags & kSCNetworkReachabilityFlagsInterventionRequired)); - } - - return NO; -} - - -#pragma mark - reachability status stuff - --(NetworkStatus)currentReachabilityStatus -{ - if([self isReachable]) - { - if([self isReachableViaWiFi]) - return ReachableViaWiFi; - -#if TARGET_OS_IPHONE - return ReachableViaWWAN; -#endif - } - - return NotReachable; -} - --(SCNetworkReachabilityFlags)reachabilityFlags -{ - SCNetworkReachabilityFlags flags = 0; - - if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) - { - return flags; - } - - return 0; -} - --(NSString*)currentReachabilityString -{ - NetworkStatus temp = [self currentReachabilityStatus]; - - if(temp == reachableOnWWAN) - { - // Updated for the fact that we have CDMA phones now! - return NSLocalizedString(@"Cellular", @""); - } - if (temp == ReachableViaWiFi) - { - return NSLocalizedString(@"WiFi", @""); - } - - return NSLocalizedString(@"No Connection", @""); -} - --(NSString*)currentReachabilityFlags -{ - return reachabilityFlags([self reachabilityFlags]); -} - -#pragma mark - Callback function calls this method - --(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags -{ - if([self isReachableWithFlags:flags]) - { - if(self.reachableBlock) - { - self.reachableBlock(self); - } - } - else - { - if(self.unreachableBlock) - { - self.unreachableBlock(self); - } - } - - // this makes sure the change notification happens on the MAIN THREAD - dispatch_async(dispatch_get_main_queue(), ^{ - [[NSNotificationCenter defaultCenter] postNotificationName:kYYReachabilityChangedNotification - object:self]; - }); -} - -#pragma mark - Debug Description - -- (NSString *) description -{ - NSString *description = [NSString stringWithFormat:@"<%@: %#x>", - NSStringFromClass([self class]), (unsigned int) self]; - return description; -} - -@end diff --git a/YuMi/Tools/SDPhotoBrowser/SDBrowserImageView.h.backup b/YuMi/Tools/SDPhotoBrowser/SDBrowserImageView.h.backup deleted file mode 100755 index ec33cec..0000000 --- a/YuMi/Tools/SDPhotoBrowser/SDBrowserImageView.h.backup +++ /dev/null @@ -1,27 +0,0 @@ -// -// SDBrowserImageView.h -// SDPhotoBrowser -// -// Created by aier on 15-2-6. -// Copyright (c) 2015年 GSD. All rights reserved. -// - -#import -#import "SDWaitingView.h" - - -@interface SDBrowserImageView : UIImageView - -@property (nonatomic, assign) CGFloat progress; -@property (nonatomic, assign, readonly) BOOL isScaled; -@property (nonatomic, assign) BOOL hasLoadedImage; - -- (void)eliminateScale; // 清除缩放 - -- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder; - -- (void)doubleTapToZommWithScale:(CGFloat)scale; - -- (void)clear; - -@end diff --git a/YuMi/Tools/SDPhotoBrowser/SDBrowserImageView.m.backup b/YuMi/Tools/SDPhotoBrowser/SDBrowserImageView.m.backup deleted file mode 100755 index d1c3fb4..0000000 --- a/YuMi/Tools/SDPhotoBrowser/SDBrowserImageView.m.backup +++ /dev/null @@ -1,237 +0,0 @@ -// -// SDBrowserImageView.m -// SDPhotoBrowser -// -// Created by aier on 15-2-6. -// Copyright (c) 2015年 GSD. All rights reserved. -// - -#import "SDBrowserImageView.h" -#import "UIImageView+WebCache.h" -#import "SDPhotoBrowserConfig.h" - -@implementation SDBrowserImageView -{ - __weak SDWaitingView *_waitingView; - BOOL _didCheckSize; - UIScrollView *_scroll; - UIImageView *_scrollImageView; - UIScrollView *_zoomingScroolView; - UIImageView *_zoomingImageView; - CGFloat _totalScale; -} - - -- (id)initWithFrame:(CGRect)frame -{ - self = [super initWithFrame:frame]; - if (self) { - self.userInteractionEnabled = YES; - self.contentMode = UIViewContentModeScaleAspectFit; - _totalScale = 1.0; - - // 捏合手势缩放图片 - UIPinchGestureRecognizer *pinch = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(zoomImage:)]; - pinch.delegate = self; - [self addGestureRecognizer:pinch]; - - - - } - return self; -} - -- (BOOL)isScaled -{ - return 1.0 != _totalScale; -} - -- (void)layoutSubviews -{ - [super layoutSubviews]; - _waitingView.center = CGPointMake(self.frame.size.width * 0.5, self.frame.size.height * 0.5); - - CGSize imageSize = self.image.size; - - if (self.bounds.size.width * (imageSize.height / imageSize.width) > self.bounds.size.height) { - if (!_scroll) { - UIScrollView *scroll = [[UIScrollView alloc] init]; - scroll.backgroundColor = [UIColor whiteColor]; - UIImageView *imageView = [[UIImageView alloc] init]; - imageView.image = self.image; - _scrollImageView = imageView; - [scroll addSubview:imageView]; - scroll.backgroundColor = SDPhotoBrowserBackgroundColor; - _scroll = scroll; - [self addSubview:scroll]; - if (_waitingView) { - [self bringSubviewToFront:_waitingView]; - } - } - _scroll.frame = self.bounds; - - CGFloat imageViewH = self.bounds.size.width * (imageSize.height / imageSize.width); - - _scrollImageView.bounds = CGRectMake(0, 0, _scroll.frame.size.width, imageViewH); - _scrollImageView.center = CGPointMake(_scroll.frame.size.width * 0.5, _scrollImageView.frame.size.height * 0.5); - _scroll.contentSize = CGSizeMake(0, _scrollImageView.bounds.size.height); - - } else { - if (_scroll) [_scroll removeFromSuperview]; // 防止旋转时适配的scrollView的影响 - } - -} - - - -- (void)setProgress:(CGFloat)progress -{ - _progress = progress; - _waitingView.progress = progress; - -} - -- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder -{ - SDWaitingView *waiting = [[SDWaitingView alloc] init]; - waiting.bounds = CGRectMake(0, 0, 100, 100); - waiting.mode = SDWaitingViewProgressMode; - _waitingView = waiting; - [self addSubview:waiting]; - - - __weak SDBrowserImageView *imageViewWeak = self; - - - [self sd_setImageWithURL:url placeholderImage:placeholder options:SDWebImageRetryFailed progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) { - imageViewWeak.progress = (CGFloat)receivedSize / expectedSize; - } completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) { - [imageViewWeak removeWaitingView]; - - - if (error) { - UILabel *label = [[UILabel alloc] init]; - label.bounds = CGRectMake(0, 0, 160, 30); - label.center = CGPointMake(imageViewWeak.bounds.size.width * 0.5, imageViewWeak.bounds.size.height * 0.5); - label.text = YMLocalizedString(@"SDBrowserImageView0"); - label.font = [UIFont systemFontOfSize:16]; - label.textColor = [UIColor whiteColor]; - label.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.8]; - label.layer.cornerRadius = 5; - label.clipsToBounds = YES; - label.textAlignment = NSTextAlignmentCenter; - [imageViewWeak addSubview:label]; - } else { - _scrollImageView.image = image; - [_scrollImageView setNeedsDisplay]; - } - - }]; - -} - -- (void)zoomImage:(UIPinchGestureRecognizer *)recognizer -{ - [self prepareForImageViewScaling]; - CGFloat scale = recognizer.scale; - CGFloat temp = _totalScale + (scale - 1); - [self setTotalScale:temp]; - recognizer.scale = 1.0; -} - -- (void)setTotalScale:(CGFloat)totalScale -{ - if ((_totalScale < 0.5 && totalScale < _totalScale) || (_totalScale > 2.0 && totalScale > _totalScale)) return; // 最大缩放 2倍,最小0.5倍 - - [self zoomWithScale:totalScale]; -} - -- (void)zoomWithScale:(CGFloat)scale -{ - _totalScale = scale; - - _zoomingImageView.transform = CGAffineTransformMakeScale(scale, scale); - - if (scale > 1) { - CGFloat contentW = _zoomingImageView.frame.size.width; - CGFloat contentH = MAX(_zoomingImageView.frame.size.height, self.frame.size.height); - - _zoomingImageView.center = CGPointMake(contentW * 0.5, contentH * 0.5); - _zoomingScroolView.contentSize = CGSizeMake(contentW, contentH); - - - CGPoint offset = _zoomingScroolView.contentOffset; - offset.x = (contentW - _zoomingScroolView.frame.size.width) * 0.5; -// offset.y = (contentH - _zoomingImageView.frame.size.height) * 0.5; - _zoomingScroolView.contentOffset = offset; - - } else { - _zoomingScroolView.contentSize = _zoomingScroolView.frame.size; - _zoomingScroolView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0); - _zoomingImageView.center = _zoomingScroolView.center; - } -} - -- (void)doubleTapToZommWithScale:(CGFloat)scale -{ - [self prepareForImageViewScaling]; - [UIView animateWithDuration:0.5 animations:^{ - [self zoomWithScale:scale]; - } completion:^(BOOL finished) { - if (scale == 1) { - [self clear]; - } - }]; -} - -- (void)prepareForImageViewScaling -{ - if (!_zoomingScroolView) { - _zoomingScroolView = [[UIScrollView alloc] initWithFrame:self.bounds]; - _zoomingScroolView.backgroundColor = SDPhotoBrowserBackgroundColor; - _zoomingScroolView.contentSize = self.bounds.size; - UIImageView *zoomingImageView = [[UIImageView alloc] initWithImage:self.image]; - CGSize imageSize = zoomingImageView.image.size; - CGFloat imageViewH = self.bounds.size.height; - if (imageSize.width > 0) { - imageViewH = self.bounds.size.width * (imageSize.height / imageSize.width); - } - zoomingImageView.bounds = CGRectMake(0, 0, self.bounds.size.width, imageViewH); - zoomingImageView.center = _zoomingScroolView.center; - zoomingImageView.contentMode = UIViewContentModeScaleAspectFit; - _zoomingImageView = zoomingImageView; - [_zoomingScroolView addSubview:zoomingImageView]; - [self addSubview:_zoomingScroolView]; - } -} - -- (void)scaleImage:(CGFloat)scale -{ - [self prepareForImageViewScaling]; - [self setTotalScale:scale]; -} - -// 清除缩放 -- (void)eliminateScale -{ - [self clear]; - _totalScale = 1.0; -} - -- (void)clear -{ - [_zoomingScroolView removeFromSuperview]; - _zoomingScroolView = nil; - _zoomingImageView = nil; - -} - -- (void)removeWaitingView -{ - [_waitingView removeFromSuperview]; -} - - - - -@end diff --git a/YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.h.backup b/YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.h.backup deleted file mode 100755 index 301ecce..0000000 --- a/YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.h.backup +++ /dev/null @@ -1,39 +0,0 @@ -// -// SDPhotoBrowser.h -// photobrowser -// -// Created by aier on 15-2-3. -// Copyright (c) 2015年 aier. All rights reserved. -// - -#import - - -@class SDButton, SDPhotoBrowser; - -@protocol SDPhotoBrowserDelegate - -@required - -- (UIImage *)photoBrowser:(SDPhotoBrowser *)browser placeholderImageForIndex:(NSInteger)index; - -@optional - -- (NSURL *)photoBrowser:(SDPhotoBrowser *)browser highQualityImageURLForIndex:(NSInteger)index; -- (UIImage *)photoBrowser:(SDPhotoBrowser *)browser highQualityImageForIndex:(NSInteger)index; -@end - - -@interface SDPhotoBrowser : UIView - -@property (nonatomic, weak) UIView *sourceImagesContainerView; -@property (nonatomic, assign) NSInteger currentImageIndex; -@property (nonatomic, assign) NSInteger imageCount; -@property (nonatomic, assign) BOOL isMe; -@property (nonatomic, assign) BOOL isAvatar; -@property (nonatomic, assign) CGRect sourceImagesFrame; -@property (nonatomic, strong) id delegate; -@property (nonatomic, assign) BOOL isHaveUserAdd; // 为了区分当前页面的cell是否第一个是添加图片的Icon -- (void)show; - -@end diff --git a/YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.m.backup b/YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.m.backup deleted file mode 100755 index e5002ad..0000000 --- a/YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.m.backup +++ /dev/null @@ -1,407 +0,0 @@ -// -// SDPhotoBrowser.m -// photobrowser -// -// Created by aier on 15-2-3. -// Copyright (c) 2015年 aier. All rights reserved. -// - -#import "SDPhotoBrowser.h" -#import "UIImageView+WebCache.h" -#import "SDBrowserImageView.h" - -#define iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO) //判断是否iPhoneX - -#define iPhoneX_NavSafeArea ([[UIScreen mainScreen] bounds].size.height >= 812.0 ? 24 : 0) // 如果是iphoneX 顶部安全区域 24 - -// ============在这里方便配置样式相关设置=========== - -// || -// || -// || -// \\// -// \/ - -#import "SDPhotoBrowserConfig.h" - -// ============================================= - -@implementation SDPhotoBrowser -{ - UIScrollView *_scrollView; - BOOL _hasShowedFistView; - UILabel *_indexLabel; - UIButton *_saveButton; - UIActivityIndicatorView *_indicatorView; - BOOL _willDisappear; - UIWindow *currentWindows; -} - -- (id)initWithFrame:(CGRect)frame -{ - self = [super initWithFrame:frame]; - - if (self) { - self.backgroundColor = SDPhotoBrowserBackgroundColor; - _isMe = NO; - } - return self; -} - - -- (void)didMoveToSuperview -{ - [self setupScrollView]; - [self setupToolbars]; -} - -- (void)dealloc -{ - [currentWindows removeObserver:self forKeyPath:@"frame"]; - self.delegate = nil; -} - - -- (void)setupToolbars -{ - // 1. 序标 - UILabel *indexLabel = [[UILabel alloc] init]; - indexLabel.bounds = CGRectMake(0, 0, 80, 30); - indexLabel.textAlignment = NSTextAlignmentCenter; - indexLabel.textColor = [UIColor whiteColor]; - indexLabel.font = [UIFont boldSystemFontOfSize:20]; - indexLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5]; - indexLabel.layer.cornerRadius = indexLabel.bounds.size.height * 0.5; - indexLabel.clipsToBounds = YES; - if (self.imageCount >= 1) { - indexLabel.text = [NSString stringWithFormat:@"1/%ld", (long)self.imageCount]; - } - _indexLabel = indexLabel; - [self addSubview:indexLabel]; - - // 2.保存按钮 - UIButton *saveButton = [[UIButton alloc] init]; - [saveButton setTitle:YMLocalizedString(@"SDPhotoBrowser0") forState:UIControlStateNormal]; - [saveButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - saveButton.backgroundColor = [UIColor colorWithRed:0.1f green:0.1f blue:0.1f alpha:0.90f]; - saveButton.layer.cornerRadius = 5; - saveButton.clipsToBounds = YES; - [saveButton addTarget:self action:@selector(saveImage) forControlEvents:UIControlEventTouchUpInside]; - _saveButton = saveButton; - [self addSubview:saveButton]; -} - -- (void)saveImage -{ - int index = _scrollView.contentOffset.x / _scrollView.bounds.size.width; - UIImageView *currentImageView = _scrollView.subviews[index]; - - UIImageWriteToSavedPhotosAlbum(currentImageView.image, self, @selector(image:didFinishSavingWithError:contextInfo:), NULL); - - if (_indicatorView == nil) { - _indicatorView = [[UIActivityIndicatorView alloc] init]; - _indicatorView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge; - _indicatorView.center = self.center; - [[UIApplication sharedApplication].keyWindow addSubview:_indicatorView]; - } - - [_indicatorView startAnimating]; -} - -- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo; -{ - [_indicatorView stopAnimating]; - - UILabel *label = [[UILabel alloc] init]; - label.textColor = [UIColor whiteColor]; - label.backgroundColor = [UIColor colorWithRed:0.1f green:0.1f blue:0.1f alpha:0.90f]; - label.layer.cornerRadius = 5; - label.clipsToBounds = YES; - label.bounds = CGRectMake(0, 0, 150, 30); - label.center = self.center; - label.textAlignment = NSTextAlignmentCenter; - label.font = [UIFont boldSystemFontOfSize:17]; - [[UIApplication sharedApplication].keyWindow addSubview:label]; - [[UIApplication sharedApplication].keyWindow bringSubviewToFront:label]; - if (error) { - label.text = SDPhotoBrowserSaveImageFailText; - } else { - label.text = SDPhotoBrowserSaveImageSuccessText; - } - [label performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1.0]; -} - -- (void)setupScrollView -{ - _scrollView = [[UIScrollView alloc] init]; - _scrollView.delegate = self; - _scrollView.showsHorizontalScrollIndicator = NO; - _scrollView.showsVerticalScrollIndicator = NO; - _scrollView.pagingEnabled = YES; - [self addSubview:_scrollView]; - - for (int i = 0; i < self.imageCount; i++) { - SDBrowserImageView *imageView = [[SDBrowserImageView alloc] init]; - imageView.tag = i; - - // 单击图片 - UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(photoClick:)]; - - // 双击放大图片 - UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imageViewDoubleTaped:)]; - doubleTap.numberOfTapsRequired = 2; - - [singleTap requireGestureRecognizerToFail:doubleTap]; - - [imageView addGestureRecognizer:singleTap]; - [imageView addGestureRecognizer:doubleTap]; - [_scrollView addSubview:imageView]; - } - - [self setupImageOfImageViewForIndex:self.currentImageIndex]; - -} - -// 加载图片 -- (void)setupImageOfImageViewForIndex:(NSInteger)index -{ - if(index < _scrollView.subviews.count){ - SDBrowserImageView *imageView = _scrollView.subviews[index]; - self.currentImageIndex = index; - if (imageView.hasLoadedImage) return; - if ([self highQualityImageURLForIndex:index]) { - [imageView setImageWithURL:[self highQualityImageURLForIndex:index] placeholderImage:[self placeholderImageForIndex:index]]; - } else { - if([self highQualityImageForIndex: index]){ - imageView.image = [self highQualityImageForIndex: index]; - }else{ - imageView.image = [self placeholderImageForIndex:index]; - } - - } - imageView.hasLoadedImage = YES; - } - -} - -- (void)photoClick:(UITapGestureRecognizer *)recognizer -{ - _scrollView.hidden = YES; - _willDisappear = YES; - - SDBrowserImageView *currentImageView = (SDBrowserImageView *)recognizer.view; - NSInteger currentIndex = currentImageView.tag; - if (self.isHaveUserAdd) { - currentIndex = currentImageView.tag + 1; - } - - UIView *sourceView = nil; - if ([self.sourceImagesContainerView isKindOfClass:UICollectionView.class]) { - UICollectionView *view = (UICollectionView *)self.sourceImagesContainerView; - NSIndexPath *path = [NSIndexPath indexPathForItem:currentIndex inSection:0]; - sourceView = [view cellForItemAtIndexPath:path]; - }else { - if (self.currentImageIndex margin || (x - index * self.bounds.size.width) < - margin) { - if(index < _scrollView.subviews.count){ - SDBrowserImageView *imageView = _scrollView.subviews[index]; - if (imageView.isScaled) { - [UIView animateWithDuration:0.5 animations:^{ - imageView.transform = CGAffineTransformIdentity; - } completion:^(BOOL finished) { - [imageView eliminateScale]; - }]; - } - } - } - - - if (!_willDisappear) { - if (self.isMe) { - if (self.isHaveUserAdd) { - _indexLabel.text = [NSString stringWithFormat:@"%d/%ld", index + 1, (long)self.imageCount]; - } else { - _indexLabel.text = [NSString stringWithFormat:@"%d/%ld", index, (long)self.imageCount]; - } - }else{ - _indexLabel.text = [NSString stringWithFormat:@"%d/%ld", index + 1, (long)self.imageCount]; - } - - } - [self setupImageOfImageViewForIndex:index]; -} - - - -@end diff --git a/YuMi/Tools/SDPhotoBrowser/SDPhotoBrowserConfig.h.backup b/YuMi/Tools/SDPhotoBrowser/SDPhotoBrowserConfig.h.backup deleted file mode 100755 index 6c0dceb..0000000 --- a/YuMi/Tools/SDPhotoBrowser/SDPhotoBrowserConfig.h.backup +++ /dev/null @@ -1,42 +0,0 @@ -// -// SDPhotoBrowserConfig.h -// SDPhotoBrowser -// -// Created by aier on 15-2-9. -// Copyright (c) 2015年 GSD. All rights reserved. -// - - -typedef enum { - SDWaitingViewModeLoopDiagram, // 环形 - SDWaitingViewModePieDiagram // 饼型 -} SDWaitingViewMode; - -// 图片保存成功提示文字 -#define SDPhotoBrowserSaveImageSuccessText @" ^_^ 保存成功 "; - -// 图片保存失败提示文字 -#define SDPhotoBrowserSaveImageFailText @" >_< 保存失敗 "; - -// browser背景颜色 -#define SDPhotoBrowserBackgroundColor [UIColor colorWithRed:0 green:0 blue:0 alpha:0.95] - -// browser中图片间的margin -#define SDPhotoBrowserImageViewMargin 10 - -// browser中显示图片动画时长 -#define SDPhotoBrowserShowImageAnimationDuration 0.4f - -// browser中显示图片动画时长 -#define SDPhotoBrowserHideImageAnimationDuration 0.4f - -// 图片下载进度指示进度显示样式(SDWaitingViewModeLoopDiagram 环形,SDWaitingViewModePieDiagram 饼型) -#define SDWaitingViewProgressMode SDWaitingViewModeLoopDiagram - -// 图片下载进度指示器背景色 -#define SDWaitingViewBackgroundColor [UIColor colorWithRed:0 green:0 blue:0 alpha:0.7] - -// 图片下载进度指示器内部控件间的间距 -#define SDWaitingViewItemMargin 10 - - diff --git a/YuMi/Tools/SDPhotoBrowser/SDWaitingView.h.backup b/YuMi/Tools/SDPhotoBrowser/SDWaitingView.h.backup deleted file mode 100755 index fa60171..0000000 --- a/YuMi/Tools/SDPhotoBrowser/SDWaitingView.h.backup +++ /dev/null @@ -1,17 +0,0 @@ -// -// SDWaitingView.h -// SDPhotoBrowser -// -// Created by aier on 15-2-6. -// Copyright (c) 2015年 GSD. All rights reserved. -// - -#import -#import "SDPhotoBrowserConfig.h" - -@interface SDWaitingView : UIView - -@property (nonatomic, assign) CGFloat progress; -@property (nonatomic, assign) int mode; - -@end diff --git a/YuMi/Tools/SDPhotoBrowser/SDWaitingView.m.backup b/YuMi/Tools/SDPhotoBrowser/SDWaitingView.m.backup deleted file mode 100755 index ca8ae36..0000000 --- a/YuMi/Tools/SDPhotoBrowser/SDWaitingView.m.backup +++ /dev/null @@ -1,93 +0,0 @@ -// -// SDWaitingView.m -// SDPhotoBrowser -// -// Created by aier on 15-2-6. -// Copyright (c) 2015年 GSD. All rights reserved. -// - -#import "SDWaitingView.h" - -//// 图片下载进度指示器背景色 -//#define SDWaitingViewBackgroundColor [UIColor colorWithRed:0 green:0 blue:0 alpha:0.7] -// -//// 图片下载进度指示器内部控件间的间距 -// -//#define SDWaitingViewItemMargin 10 - - -@implementation SDWaitingView - - -- (id)initWithFrame:(CGRect)frame -{ - self = [super initWithFrame:frame]; - if (self) { - self.backgroundColor = SDWaitingViewBackgroundColor; - self.layer.cornerRadius = 5; - self.clipsToBounds = YES; - self.mode = SDWaitingViewModeLoopDiagram; - } - return self; -} - -- (void)setProgress:(CGFloat)progress -{ - _progress = progress; -// NSLog(@"%@",[NSThread currentThread]); - //将重绘操作放在主线程,解决自动布局控制台报错的问题 - dispatch_async(dispatch_get_main_queue(), ^{ - - [self setNeedsDisplay]; - if (progress >= 1) { - [self removeFromSuperview]; - } - }); -} - -- (void)drawRect:(CGRect)rect -{ - CGContextRef ctx = UIGraphicsGetCurrentContext(); - - CGFloat xCenter = rect.size.width * 0.5; - CGFloat yCenter = rect.size.height * 0.5; - [[UIColor whiteColor] set]; - - switch (self.mode) { - case SDWaitingViewModePieDiagram: - { - CGFloat radius = MIN(rect.size.width * 0.5, rect.size.height * 0.5) - SDWaitingViewItemMargin; - - - CGFloat w = radius * 2 + SDWaitingViewItemMargin; - CGFloat h = w; - CGFloat x = (rect.size.width - w) * 0.5; - CGFloat y = (rect.size.height - h) * 0.5; - CGContextAddEllipseInRect(ctx, CGRectMake(x, y, w, h)); - CGContextFillPath(ctx); - - [SDWaitingViewBackgroundColor set]; - CGContextMoveToPoint(ctx, xCenter, yCenter); - CGContextAddLineToPoint(ctx, xCenter, 0); - CGFloat to = - M_PI * 0.5 + self.progress * M_PI * 2 + 0.001; // 初始值 - CGContextAddArc(ctx, xCenter, yCenter, radius, - M_PI * 0.5, to, 1); - CGContextClosePath(ctx); - - CGContextFillPath(ctx); - } - break; - - default: - { - CGContextSetLineWidth(ctx, 15); - CGContextSetLineCap(ctx, kCGLineCapRound); - CGFloat to = - M_PI * 0.5 + self.progress * M_PI * 2 + 0.05; // 初始值0.05 - CGFloat radius = MIN(rect.size.width, rect.size.height) * 0.5 - SDWaitingViewItemMargin; - CGContextAddArc(ctx, xCenter, yCenter, radius, - M_PI * 0.5, to, 0); - CGContextStrokePath(ctx); - } - break; - } -} - -@end diff --git a/YuMi/Tools/Safe/NSArray+Safe.h.backup b/YuMi/Tools/Safe/NSArray+Safe.h.backup deleted file mode 100644 index 4e4b098..0000000 --- a/YuMi/Tools/Safe/NSArray+Safe.h.backup +++ /dev/null @@ -1,16 +0,0 @@ -// -// NSArray+Safe.h -// YUMI -// -// Created by YUMI on 2022/11/11. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface NSArray (Safe) --(id)xpSafeObjectAtIndex:(NSUInteger)index; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Tools/Safe/NSArray+Safe.m.backup b/YuMi/Tools/Safe/NSArray+Safe.m.backup deleted file mode 100644 index 13729c7..0000000 --- a/YuMi/Tools/Safe/NSArray+Safe.m.backup +++ /dev/null @@ -1,23 +0,0 @@ -// -// NSArray+Safe.m -// YUMI -// -// Created by YUMI on 2022/11/11. -// - -#import "NSArray+Safe.h" - -@implementation NSArray (Safe) - --(id)xpSafeObjectAtIndex:(NSUInteger)index{ - if ([self isKindOfClass:[NSArray class]]){ - if (self.count){ - if (self.count>index){ - return self[index]; - } - } - } - return nil; -} - -@end diff --git a/YuMi/Tools/Safe/NSMutableArray+Safe.h.backup b/YuMi/Tools/Safe/NSMutableArray+Safe.h.backup deleted file mode 100644 index 1894935..0000000 --- a/YuMi/Tools/Safe/NSMutableArray+Safe.h.backup +++ /dev/null @@ -1,64 +0,0 @@ -// -// NSMutableArray+Safe.h -// YUMI -// -// Created by YUMI on 2023/11/15. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface NSMutableArray (Safe) - -/** - 安全地从数组中移除指定索引的对象 - 如果索引超出范围,则不执行任何操作 - - @param index 要移除的对象的索引 - */ -- (void)xpSafeRemoveObjectAtIndex:(NSUInteger)index; - -/** - 安全地从数组中移除指定的对象 - 如果对象不存在,则不执行任何操作 - - @param anObject 要移除的对象 - */ -- (void)xpSafeRemoveObject:(id)anObject; - -/** - 安全地从数组中移除指定索引集合中的对象 - 如果索引集合中的任何索引超出范围,则跳过该索引 - - @param indexes 要移除的对象的索引集合 - */ -- (void)xpSafeRemoveObjectsAtIndexes:(NSIndexSet *)indexes; - -/** - 安全地在指定索引处插入对象 - 如果索引超出范围,则不执行任何操作或在末尾添加(取决于索引) - - @param anObject 要插入的对象 - @param index 要插入的位置 - */ -- (void)xpSafeInsertObject:(id)anObject atIndex:(NSUInteger)index; - -/** - 安全地替换指定索引处的对象 - 如果索引超出范围,则不执行任何操作 - - @param index 要替换的对象的索引 - @param anObject 替换的对象 - */ -- (void)xpSafeReplaceObjectAtIndex:(NSUInteger)index withObject:(id)anObject; - -/** - 安全地移除数组中的所有对象 - 如果数组为空,则不执行任何操作 - */ -- (void)xpSafeRemoveAllObjects; - -@end - -NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/YuMi/Tools/Safe/NSMutableArray+Safe.m.backup b/YuMi/Tools/Safe/NSMutableArray+Safe.m.backup deleted file mode 100644 index e024538..0000000 --- a/YuMi/Tools/Safe/NSMutableArray+Safe.m.backup +++ /dev/null @@ -1,69 +0,0 @@ -// -// NSMutableArray+Safe.m -// YUMI -// -// Created by YUMI on 2023/11/15. -// - -#import "NSMutableArray+Safe.h" - -@implementation NSMutableArray (Safe) - -- (void)xpSafeRemoveObjectAtIndex:(NSUInteger)index { - if ([self isKindOfClass:[NSMutableArray class]]) { - if (self.count > 0 && index < self.count) { - [self removeObjectAtIndex:index]; - } - } -} - -- (void)xpSafeRemoveObject:(id)anObject { - if ([self isKindOfClass:[NSMutableArray class]]) { - if (anObject && [self containsObject:anObject]) { - [self removeObject:anObject]; - } - } -} - -- (void)xpSafeRemoveObjectsAtIndexes:(NSIndexSet *)indexes { - if ([self isKindOfClass:[NSMutableArray class]] && indexes) { - // 创建一个有效索引的集合 - NSMutableIndexSet *validIndexes = [NSMutableIndexSet indexSet]; - [indexes enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) { - if (idx < self.count) { - [validIndexes addIndex:idx]; - } - }]; - - if (validIndexes.count > 0) { - [self removeObjectsAtIndexes:validIndexes]; - } - } -} - -- (void)xpSafeInsertObject:(id)anObject atIndex:(NSUInteger)index { - if ([self isKindOfClass:[NSMutableArray class]] && anObject) { - if (index <= self.count) { - [self insertObject:anObject atIndex:index]; - } else if (index > self.count) { - // 如果索引超出范围,则添加到末尾 - [self addObject:anObject]; - } - } -} - -- (void)xpSafeReplaceObjectAtIndex:(NSUInteger)index withObject:(id)anObject { - if ([self isKindOfClass:[NSMutableArray class]] && anObject) { - if (index < self.count) { - [self replaceObjectAtIndex:index withObject:anObject]; - } - } -} - -- (void)xpSafeRemoveAllObjects { - if ([self isKindOfClass:[NSMutableArray class]] && self.count > 0) { - [self removeAllObjects]; - } -} - -@end \ No newline at end of file diff --git a/YuMi/Tools/Safe/NSMutableDictionary+Saft.h.backup b/YuMi/Tools/Safe/NSMutableDictionary+Saft.h.backup deleted file mode 100644 index 86118dd..0000000 --- a/YuMi/Tools/Safe/NSMutableDictionary+Saft.h.backup +++ /dev/null @@ -1,16 +0,0 @@ -// -// NSMutableDictionary+Saft.h -// YUMI -// -// Created by YUMI on 2022/11/11. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface NSMutableDictionary (Saft) -- (void)safeSetObject:(id)anObject forKey:(id )aKey; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Tools/Safe/NSMutableDictionary+Saft.m.backup b/YuMi/Tools/Safe/NSMutableDictionary+Saft.m.backup deleted file mode 100644 index 4c9b450..0000000 --- a/YuMi/Tools/Safe/NSMutableDictionary+Saft.m.backup +++ /dev/null @@ -1,17 +0,0 @@ -// -// NSMutableDictionary+Saft.m -// YUMI -// -// Created by YUMI on 2022/11/11. -// - -#import "NSMutableDictionary+Saft.h" - -@implementation NSMutableDictionary (Saft) - -- (void)safeSetObject:(id)anObject forKey:(id )aKey{ - if (anObject == nil || aKey == nil)return; - [self setObject:anObject forKey:aKey]; -} - -@end diff --git a/YuMi/Tools/Security/AESUtils.h.backup b/YuMi/Tools/Security/AESUtils.h.backup deleted file mode 100644 index 1bf73dc..0000000 --- a/YuMi/Tools/Security/AESUtils.h.backup +++ /dev/null @@ -1,19 +0,0 @@ -// -// AESUtils.h -// YUMI -// -// Created by YUMI on 2023/2/13. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface AESUtils : NSObject -//MARK: AES加解密 -+ (NSString *)aesEncrypt:(NSString *)sourceStr; - -+ (NSString *)aesDecrypt:(NSString *)secretStr; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Tools/Security/AESUtils.m.backup b/YuMi/Tools/Security/AESUtils.m.backup deleted file mode 100644 index af7ba8b..0000000 --- a/YuMi/Tools/Security/AESUtils.m.backup +++ /dev/null @@ -1,151 +0,0 @@ -// -// AESUtils.m -// YUMI -// -// Created by YUMI on 2023/2/13. -// - -#import "AESUtils.h" -#import - -#define GL_AES_KEY @"aef01238765abcdeaaageggbeggsded" -#define GL_AES_IV @"edgcdgrtc" -@implementation AESUtils -//MARK: AES加解密相关 start -+ (NSString *)aesEncrypt:(NSString *)sourceStr { - if (!sourceStr) { - return nil; - } - - //秘钥 - char keyPtr[kCCKeySizeAES256 + 1]; - bzero(keyPtr, sizeof(keyPtr)); - [GL_AES_KEY getCString:keyPtr maxLength:sizeof(keyPtr) encoding:NSUTF8StringEncoding]; - - //向量 - char ivPtr[kCCBlockSizeAES128 + 1]; - bzero(ivPtr, sizeof(ivPtr)); - [GL_AES_IV getCString:ivPtr maxLength:sizeof(ivPtr) encoding:NSUTF8StringEncoding]; - - NSData *sourceData = [sourceStr dataUsingEncoding:NSUTF8StringEncoding]; - NSUInteger dataLength = [sourceData length]; - size_t buffersize = dataLength + kCCBlockSizeAES128; - void *buffer = malloc(buffersize); - size_t numBytesEncrypted = 0; - /* - //CBC模式 - kCCOptionPKCS7Padding - //ECB模式 - kCCOptionPKCS7Padding | kCCOptionECBMode - */ - CCCryptorStatus cryptStatus = CCCrypt(kCCEncrypt, - kCCAlgorithmAES128, - kCCOptionPKCS7Padding, - keyPtr, - kCCBlockSizeAES128, - ivPtr,//ECB模式下可以为NULL - [sourceData bytes], - dataLength, - buffer, - buffersize, - &numBytesEncrypted); - - if (cryptStatus == kCCSuccess) { - NSData *encryptData = [NSData dataWithBytesNoCopy:buffer length:numBytesEncrypted]; - //对加密后的二进制数据进行base64转码 - //return [encryptData base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed]; - - //转换为16进制字符串 - NSMutableString *output = [NSMutableString stringWithCapacity:encryptData.length * 2]; - if (encryptData && encryptData.length > 0) { - Byte *datas = (Byte*)[encryptData bytes]; - for(int i = 0; i < encryptData.length; i++){ - [output appendFormat:@"%02x", datas[i]]; - } - } - return output; - - } else { - free(buffer); - return nil; - } -} - -+ (NSString *)aesDecrypt:(NSString *)secretStr { - if (!secretStr) { - return nil; - } -// //先对加密的字符串进行base64解码 - NSData *decodeData = [[NSData alloc] initWithBase64EncodedString:secretStr options:NSDataBase64DecodingIgnoreUnknownCharacters]; - //先对加密的字符串进行16进制解码 -// NSData *decodeData = [self convertHexStrToData:secretStr]; - - //秘钥 - char keyPtr[kCCKeySizeAES256 + 1]; - bzero(keyPtr, sizeof(keyPtr)); - [GL_AES_KEY getCString:keyPtr maxLength:sizeof(keyPtr) encoding:NSUTF8StringEncoding]; - - //向量 - char ivPtr[kCCBlockSizeAES128 + 1]; - bzero(ivPtr, sizeof(ivPtr)); - [GL_AES_IV getCString:ivPtr maxLength:sizeof(ivPtr) encoding:NSUTF8StringEncoding]; - - NSUInteger dataLength = [decodeData length]; - size_t bufferSize = dataLength + kCCBlockSizeAES128; - void *buffer = malloc(bufferSize); - size_t numBytesDecrypted = 0; - /* - //CBC模式 - kCCOptionPKCS7Padding - //ECB模式 - kCCOptionPKCS7Padding | kCCOptionECBMode - */ - CCCryptorStatus cryptStatus = CCCrypt(kCCDecrypt, - kCCAlgorithmAES128, - kCCOptionPKCS7Padding, - keyPtr, - kCCBlockSizeAES128, - ivPtr,//ECB模式下可以为NULL - [decodeData bytes], - dataLength, - buffer, - bufferSize, - &numBytesDecrypted); - if (cryptStatus == kCCSuccess) { - NSData *data = [NSData dataWithBytesNoCopy:buffer length:numBytesDecrypted]; - NSString *result = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; - return result; - } else { - free(buffer); - return nil; - } -} - -// 16进制转NSData -+ (NSData *)convertHexStrToData:(NSString *)str { - if (!str || [str length] == 0) { - return nil; - } - - NSMutableData *hexData = [[NSMutableData alloc] initWithCapacity:20]; - NSRange range; - if ([str length] % 2 == 0) { - range = NSMakeRange(0, 2); - } else { - range = NSMakeRange(0, 1); - } - for (NSInteger i = range.location; i < [str length]; i += 2) { - unsigned int anInt; - NSString *hexCharStr = [str substringWithRange:range]; - NSScanner *scanner = [[NSScanner alloc] initWithString:hexCharStr]; - - [scanner scanHexInt:&anInt]; - NSData *entity = [[NSData alloc] initWithBytes:&anInt length:1]; - [hexData appendData:entity]; - - range.location += range.length; - range.length = 2; - } - return hexData; -} -@end diff --git a/YuMi/Tools/Security/Base64.h.backup b/YuMi/Tools/Security/Base64.h.backup deleted file mode 100644 index f0c90df..0000000 --- a/YuMi/Tools/Security/Base64.h.backup +++ /dev/null @@ -1,16 +0,0 @@ -// -// Base64.h -// YMhatFramework -// -// Created by chenran on 2017/5/4. -// Copyright © 2017年 chenran. All rights reserved. -// - -#import - -@interface Base64 : NSObject - -+(NSString *)encode:(NSData *)data; -+(NSData *)decode:(NSString *)dataString; - -@end diff --git a/YuMi/Tools/Security/Base64.m.backup b/YuMi/Tools/Security/Base64.m.backup deleted file mode 100644 index 1f74c46..0000000 --- a/YuMi/Tools/Security/Base64.m.backup +++ /dev/null @@ -1,133 +0,0 @@ -// -// Base64.m -// YMhatFramework -// -// Created by chenran on 2017/5/4. -// Copyright © 2017年 chenran. All rights reserved. -// - -#import "Base64.h" - -@interface Base64() -+(int)char2Int:(char)c; -@end - -@implementation Base64 - -static const char encodingTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - -+(NSString *)encode:(NSData *)data -{ - if (data.length == 0) - return nil; - - char *characters = malloc(data.length * 3 / 2); - - if (characters == NULL) - return nil; - - int end = data.length - 3; - int index = 0; - int charCount = 0; - int n = 0; - - while (index <= end) { - int d = (((int)(((char *)[data bytes])[index]) & 0x0ff) << 16) - | (((int)(((char *)[data bytes])[index + 1]) & 0x0ff) << 8) - | ((int)(((char *)[data bytes])[index + 2]) & 0x0ff); - - characters[charCount++] = encodingTable[(d >> 18) & 63]; - characters[charCount++] = encodingTable[(d >> 12) & 63]; - characters[charCount++] = encodingTable[(d >> 6) & 63]; - characters[charCount++] = encodingTable[d & 63]; - - index += 3; - - if(n++ >= 14) - { - n = 0; - characters[charCount++] = ' '; - } - } - - if(index == data.length - 2) - { - int d = (((int)(((char *)[data bytes])[index]) & 0x0ff) << 16) - | (((int)(((char *)[data bytes])[index + 1]) & 255) << 8); - characters[charCount++] = encodingTable[(d >> 18) & 63]; - characters[charCount++] = encodingTable[(d >> 12) & 63]; - characters[charCount++] = encodingTable[(d >> 6) & 63]; - characters[charCount++] = '='; - } - else if(index == data.length - 1) - { - int d = ((int)(((char *)[data bytes])[index]) & 0x0ff) << 16; - characters[charCount++] = encodingTable[(d >> 18) & 63]; - characters[charCount++] = encodingTable[(d >> 12) & 63]; - characters[charCount++] = '='; - characters[charCount++] = '='; - } - NSString * rtnStr = [[NSString alloc] initWithBytesNoCopy:characters length:charCount encoding:NSUTF8StringEncoding freeWhenDone:YES]; - return rtnStr; - -} - -+(NSData *)decode:(NSString *)data -{ - if(data == nil || data.length <= 0) { - return nil; - } - NSMutableData *rtnData = [[NSMutableData alloc]init]; - int slen = data.length; - int index = 0; - while (true) { - while (index < slen && [data characterAtIndex:index] <= ' ') { - index++; - } - if (index >= slen || index + 3 >= slen) { - break; - } - - int byte = ([self char2Int:[data characterAtIndex:index]] << 18) + ([self char2Int:[data characterAtIndex:index + 1]] << 12) + ([self char2Int:[data characterAtIndex:index + 2]] << 6) + [self char2Int:[data characterAtIndex:index + 3]]; - Byte temp1 = (byte >> 16) & 255; - [rtnData appendBytes:&temp1 length:1]; - if([data characterAtIndex:index + 2] == '=') { - break; - } - Byte temp2 = (byte >> 8) & 255; - [rtnData appendBytes:&temp2 length:1]; - if([data characterAtIndex:index + 3] == '=') { - break; - } - Byte temp3 = byte & 255; - [rtnData appendBytes:&temp3 length:1]; - index += 4; - - } - return rtnData; -} - -+(int)char2Int:(char)c -{ - if (c >= 'A' && c <= 'Z') { - return c - 65; - } else if (c >= 'a' && c <= 'z') { - return c - 97 + 26; - } else if (c >= '0' && c <= '9') { - return c - 48 + 26 + 26; - } else { - switch(c) { - case '+': - return 62; - case '/': - return 63; - case '=': - return 0; - default: - return -1; - } - } -} - - -@end diff --git a/YuMi/Tools/Security/DESEncrypt.h.backup b/YuMi/Tools/Security/DESEncrypt.h.backup deleted file mode 100644 index 9056a7e..0000000 --- a/YuMi/Tools/Security/DESEncrypt.h.backup +++ /dev/null @@ -1,16 +0,0 @@ -// -// DESEncrypt.h -// YMhatFramework -// -// Created by chenran on 2017/5/4. -// Copyright © 2017年 chenran. All rights reserved. -// - -#import - -@interface DESEncrypt : NSObject -//加密方法 -+(NSString *) encryptUseDES:(NSString *)plainText key:(NSString *)key; -//解密方法 -+(NSString *) decryptUseDES:(NSString *)cipherText key:(NSString *)key; -@end diff --git a/YuMi/Tools/Security/DESEncrypt.m.backup b/YuMi/Tools/Security/DESEncrypt.m.backup deleted file mode 100644 index 18a3a3b..0000000 --- a/YuMi/Tools/Security/DESEncrypt.m.backup +++ /dev/null @@ -1,63 +0,0 @@ -// -// DESEncrypt.m -// YMhatFramework -// -// Created by chenran on 2017/5/4. -// Copyright © 2017年 chenran. All rights reserved. -// - -#import "DESEncrypt.h" -#import -#import "Base64.h" - -@implementation DESEncrypt : NSObject - -const Byte iv[] = {1,2,3,4,5,6,7,8}; - -#pragma mark- 加密算法 -+(NSString *) encryptUseDES:(NSString *)plainText key:(NSString *)key -{ - NSString *ciphertext = nil; - NSData *textData = [plainText dataUsingEncoding:NSUTF8StringEncoding]; - NSUInteger dataLength = [textData length]; - unsigned char buffer[200000]; - memset(buffer, 0, sizeof(char)); - size_t numBytesEncrypted = 0; - CCCryptorStatus cryptStatus = CCCrypt(kCCEncrypt, kCCAlgorithmDES, - kCCOptionPKCS7Padding|kCCOptionECBMode, - [key UTF8String], kCCKeySizeDES, - iv, - [textData bytes], dataLength, - buffer, 200000, - &numBytesEncrypted); - if (cryptStatus == kCCSuccess) { - NSData *data = [NSData dataWithBytes:buffer length:(NSUInteger)numBytesEncrypted]; - ciphertext = [Base64 encode:data]; - } - return ciphertext; -} - -#pragma mark- 解密算法 -+(NSString *)decryptUseDES:(NSString *)cipherText key:(NSString *)key -{ - NSString *plaintext = nil; - NSData *cipherdata = [Base64 decode:cipherText]; - unsigned char buffer[200000]; - memset(buffer, 0, sizeof(char)); - size_t numBytesDecrypted = 0; - // kCCOptionPKCS7Padding|kCCOptionECBMode 最主要在这步 - CCCryptorStatus cryptStatus = CCCrypt(kCCDecrypt, kCCAlgorithmDES, - kCCOptionPKCS7Padding|kCCOptionECBMode, - [key UTF8String], kCCKeySizeDES, - iv, - [cipherdata bytes], [cipherdata length], - buffer, 200000, - &numBytesDecrypted); - if(cryptStatus == kCCSuccess) { - NSData *plaindata = [NSData dataWithBytes:buffer length:(NSUInteger)numBytesDecrypted]; - plaintext = [[NSString alloc]initWithData:plaindata encoding:NSUTF8StringEncoding]; - } - return plaintext; -} -@end - diff --git a/YuMi/Tools/Timer/XPWeakTimer.h.backup b/YuMi/Tools/Timer/XPWeakTimer.h.backup deleted file mode 100644 index 37ded9c..0000000 --- a/YuMi/Tools/Timer/XPWeakTimer.h.backup +++ /dev/null @@ -1,24 +0,0 @@ -// -// YMWeakTimer.h -// YUMI -// -// Created by YUMI on 2022/3/3. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -typedef void(^XPWeakTimerHandler) (id userInfo); -@interface XPWeakTimerTarget : NSObject - -@end - -@interface XPWeakTimer : NSObject - -+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)interval block:(XPWeakTimerHandler)block userInfo:(nullable id)userInfo repeats:(BOOL)repeats; - -+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)interval target:(id)aTarget selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)repeats; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Tools/Timer/XPWeakTimer.m.backup b/YuMi/Tools/Timer/XPWeakTimer.m.backup deleted file mode 100644 index a173e7a..0000000 --- a/YuMi/Tools/Timer/XPWeakTimer.m.backup +++ /dev/null @@ -1,63 +0,0 @@ -// -// YMWeakTimer.m -// YUMI -// -// Created by YUMI on 2022/3/3. -// - -#import "XPWeakTimer.h" - - -@interface XPWeakTimerTarget () -@property (nonatomic, weak) id target; -@property (nonatomic, weak) NSTimer* timer; -@property (nonatomic, assign) SEL selector; -@end - -@implementation XPWeakTimerTarget - -- (void) fire:(NSTimer *)timer { - if(self.target) { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Warc-performSelector-leaks" - [self.target performSelector:self.selector withObject:timer.userInfo afterDelay:0.0f]; -#pragma clang diagnostic pop - } else { - [self.timer invalidate]; - } -} - -@end - - -@implementation XPWeakTimer - -+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)interval target:(id)aTarget selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)repeats{ - XPWeakTimerTarget* timerTarget = [[XPWeakTimerTarget alloc] init]; - timerTarget.target = aTarget; - timerTarget.selector = aSelector; - timerTarget.timer = [NSTimer scheduledTimerWithTimeInterval:interval target:timerTarget selector:@selector(fire:) userInfo:userInfo repeats:repeats]; - return timerTarget.timer; -} - -+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)interval block:(XPWeakTimerHandler)block userInfo:(id)userInfo repeats:(BOOL)repeats{ - NSMutableArray *userInfoArray = [NSMutableArray arrayWithObject:[block copy]]; - if (userInfo != nil) { - [userInfoArray addObject:userInfo]; - } - return [self scheduledTimerWithTimeInterval:interval target:self selector:@selector(timerBlockInvoke:) userInfo:[userInfoArray copy] repeats:repeats]; -} - -+ (void)timerBlockInvoke:(NSArray*)userInfo { - XPWeakTimerHandler block = userInfo[0]; - id info = nil; - if (userInfo.count == 2) { - info = userInfo[1]; - } - if (block) { - block(info); - } -} - - -@end diff --git a/YuMi/Tools/Timestamp/Timestamp.h.backup b/YuMi/Tools/Timestamp/Timestamp.h.backup deleted file mode 100644 index e44400e..0000000 --- a/YuMi/Tools/Timestamp/Timestamp.h.backup +++ /dev/null @@ -1,20 +0,0 @@ -// -// Timestamp.h -// YUMI -// -// Created by YUMI on 2022/1/12. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface Timestamp : NSObject -/// 获取当前的时间戳 -/// @param succes 成功 -/// @param failure 失败 -+ (void)getInternetDateWithSuccess:(void(^)(NSTimeInterval timeInterval))succes - failure:(void(^)(NSError *error))failure; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Tools/Timestamp/Timestamp.m.backup b/YuMi/Tools/Timestamp/Timestamp.m.backup deleted file mode 100644 index 860fd4b..0000000 --- a/YuMi/Tools/Timestamp/Timestamp.m.backup +++ /dev/null @@ -1,68 +0,0 @@ -// -// Timestamp.m -// YUMI -// -// Created by YUMI on 2022/1/12. -// - -#import "Timestamp.h" -#import "YUMIMacroUitls.h" - -@implementation Timestamp -/// 获取当前的时间戳 -/// @param succes 成功 -/// @param failure 失败 -+ (void)getInternetDateWithSuccess:(void(^)(NSTimeInterval timeInterval))succes - failure:(void(^)(NSError *error))failure{ - //1.创建URL - NSString *urlString = [HttpRequestHelper getHostUrl]; - urlString = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; - //2.创建request请求对象 - NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; - [request setURL:[NSURL URLWithString: urlString]]; - [request setCachePolicy:NSURLRequestReloadIgnoringCacheData]; - [request setTimeoutInterval:5]; - [request setHTTPShouldHandleCookies:FALSE]; - [request setHTTPMethod:@"GET"]; - //3.创建URLSession对象 - NSURLSession *session = [NSURLSession sharedSession]; - //4.设置数据返回回调的block - NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { - if (error == nil && response != nil) { - //这么做的原因是简体中文下的手机不能识别“MMM”,只能识别“MM” - NSArray *monthEnglishArray = @[@"Jan",@"Feb",@"Mar",@"Apr",@"May",@"Jun",@"Jul",@"Aug",@"Sept",@"Sep",@"Oct",@"Nov",@"Dec"]; - NSArray *monthNumArray = @[@"01",@"02",@"03",@"04",@"05",@"06",@"07",@"08",@"09",@"09",@"10",@"11",@"12"]; - NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response; - NSDictionary *allHeaderFields = [httpResponse allHeaderFields]; - NSString *dateStr = [allHeaderFields objectForKey:@"Date"]; - dateStr = [dateStr substringFromIndex:5]; - dateStr = [dateStr substringToIndex:[dateStr length]-4]; - dateStr = [dateStr stringByAppendingString:@" +0000"]; - //当前语言是中文的话,识别不了英文缩写 - for (NSInteger i = 0 ; i < monthEnglishArray.count ; i++) { - NSString *monthEngStr = monthEnglishArray[i]; - NSString *monthNumStr = monthNumArray[i]; - dateStr = [dateStr stringByReplacingOccurrencesOfString:monthEngStr withString:monthNumStr]; - - } - NSDateFormatter *dMatter = [[NSDateFormatter alloc] init]; - [dMatter setDateFormat:@"dd MM yyyy HH:mm:ss Z"]; - NSDate *netDate = [dMatter dateFromString:dateStr]; - NSTimeInterval timeInterval = [netDate timeIntervalSince1970]; - dispatch_async(dispatch_get_main_queue(), ^{ - succes(timeInterval); - }); - - }else{ - dispatch_async(dispatch_get_main_queue(), ^{ - failure(error); - }); - - } - - }]; - //5、执行网络请求 - [task resume]; - -} -@end diff --git a/YuMi/Tools/UILabel/UILabel+Utils.h.backup b/YuMi/Tools/UILabel/UILabel+Utils.h.backup deleted file mode 100644 index 6ac1e0a..0000000 --- a/YuMi/Tools/UILabel/UILabel+Utils.h.backup +++ /dev/null @@ -1,20 +0,0 @@ -// -// UILabel+Utils.h -// YuMi -// -// Created by duoban on 2023/7/14. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface UILabel (Utils) -+(UILabel *)labelInitWithText:(NSString *)text font:(UIFont *)font textColor:(UIColor *)textColor; -+ (CGFloat)getLabelHeightWithText:(NSString *)text width:(CGFloat)width font:(UIFont *)font; -+ (CGFloat)getWidthWithText:(NSString *)text height:(CGFloat)height font:(UIFont *)font; - - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Tools/UILabel/UILabel+Utils.m.backup b/YuMi/Tools/UILabel/UILabel+Utils.m.backup deleted file mode 100644 index 7f471a5..0000000 --- a/YuMi/Tools/UILabel/UILabel+Utils.m.backup +++ /dev/null @@ -1,70 +0,0 @@ -// -// UILabel+Utils.m -// YuMi -// -// Created by duoban on 2023/7/14. -// - -#import "UILabel+Utils.h" - -@implementation UILabel (Utils) -+(UILabel *)labelInitWithText:(NSString *)text font:(UIFont *)font textColor:(UIColor *)textColor{ - UILabel *label = [[UILabel alloc]initWithFrame:CGRectZero]; - if(text.length > 0){ - label.text = text; - } - if(font != nil){ - label.font = font; - } - if(textColor != nil){ - label.textColor = textColor; - } - return label; -} -/** - 根据宽度求高度 - @param text 计算的内容 - @param width 计算的宽度 - @param font font字体大小 - @return 放回label的高度 - */ - -+ (CGFloat)getLabelHeightWithText:(NSString *)text width:(CGFloat)width font: (UIFont *)font - -{ - - CGRect rect = [text boundingRectWithSize:CGSizeMake(width, MAXFLOAT) - - options:NSStringDrawingUsesLineFragmentOrigin - - attributes:@{NSFontAttributeName:font} context:nil]; - - - - return rect.size.height; - -} -/** - 根据高度求宽度 - @param text 计算的内容 - @param height 计算的高度 - @param font font字体大小 - @return 返回Label的宽度 - */ - -+ (CGFloat)getWidthWithText:(NSString *)text height:(CGFloat)height font:(UIFont *)font{ - - - - CGRect rect = [text boundingRectWithSize:CGSizeMake(MAXFLOAT, height) - - options:NSStringDrawingUsesLineFragmentOrigin - - attributes:@{NSFontAttributeName:font} - - context:nil]; - - return rect.size.width; - -} -@end diff --git a/YuMi/Tools/sdkContent/catagory/3Party/fmdb/BSSDLayoutUtil.h.backup b/YuMi/Tools/sdkContent/catagory/3Party/fmdb/BSSDLayoutUtil.h.backup deleted file mode 100644 index 2e795b2..0000000 --- a/YuMi/Tools/sdkContent/catagory/3Party/fmdb/BSSDLayoutUtil.h.backup +++ /dev/null @@ -1,31 +0,0 @@ -// -// GWSDLayoutUtil.h -// GWTestSDK -// -// Created by xiaowen.chen on 16/8/31. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import -#import "Masonry.h" - -//位置固定宽度跟高度 -#define SDLAYOUT_wh1(A,B,C,D,E,F,G) [A mas_makeConstraints:^(MASConstraintMaker *make) {make.leading.equalTo(B).offset(C);make.top.equalTo(D).offset(E);make.width.mas_equalTo(F);make.height.mas_equalTo(G);}];//左上 - -#define SDLAYOUT_wh2(A,B,C,D,E,F,G) [A mas_makeConstraints:^(MASConstraintMaker *make) {make.trailing.equalTo(B).offset(C);make.top.equalTo(D).offset(E);make.width.mas_equalTo(F);make.height.mas_equalTo(G);}];//右上 - -#define SDLAYOUT_wh3(A,B,C,D,E,F,G) [A mas_makeConstraints:^(MASConstraintMaker *make) {make.leading.equalTo(B).offset(C);make.bottom.equalTo(D).offset(E);make.width.mas_equalTo(F);make.height.mas_equalTo(G);}];//左下 - -#define SDLAYOUT_wh4(A,B,C,D,E,F,G) [A mas_makeConstraints:^(MASConstraintMaker *make) {make.trailing.equalTo(B).offset(C);make.bottom.equalTo(D).offset(E);make.width.mas_equalTo(F);make.height.mas_equalTo(G);}];//右下 - - -//固定高度 -#define SDLAYOUT_h(A,B,C,D,E,F,G,H) [A mas_makeConstraints:^(MASConstraintMaker *make) {make.top.equalTo(B).offset(C);make.leading.equalTo(D).offset(E);make.trailing.equalTo(F).offset(G);make.height.mas_equalTo(H);}]; - - -//原始的 -#define SDLAYOUT(A,B,C,D,E,F,G,H,I) [A mas_makeConstraints:^(MASConstraintMaker *make) {make.top.equalTo(B).offset(C);make.leading.equalTo(D).offset(E);make.trailing.equalTo(F).offset(G);make.bottom.equalTo(H).offset(I);}]; - -@interface BSSDLayoutUtil : PIBaseModel - -@end diff --git a/YuMi/Tools/sdkContent/catagory/3Party/fmdb/BSSDLayoutUtil.m.backup b/YuMi/Tools/sdkContent/catagory/3Party/fmdb/BSSDLayoutUtil.m.backup deleted file mode 100644 index e60ba2c..0000000 --- a/YuMi/Tools/sdkContent/catagory/3Party/fmdb/BSSDLayoutUtil.m.backup +++ /dev/null @@ -1,17 +0,0 @@ -// -// GWSDLayoutUtil.m -// GWTestSDK -// -// Created by xiaowen.chen on 16/8/31. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import "BSSDLayoutUtil.h" - -@implementation BSSDLayoutUtil - - -// - - -@end diff --git a/YuMi/Tools/sdkContent/catagory/Util/BSNSDictionary.h.backup b/YuMi/Tools/sdkContent/catagory/Util/BSNSDictionary.h.backup deleted file mode 100644 index e57db98..0000000 --- a/YuMi/Tools/sdkContent/catagory/Util/BSNSDictionary.h.backup +++ /dev/null @@ -1,39 +0,0 @@ -// -// GWNSDictionary.h -// GWTestSDK -// -// Created by xiaowen.chen on 16/11/8. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import - -@interface BSNSDictionary : NSObject - -/*! - - * @brief 把格式化的JSON格式的字符串转换成字典 - - * @param jsonString JSON格式的字符串 - - * @return 返回字典 - - */ - -+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString; - - -/*! - - * @brief 把字典转json字符串 - - * @param dic 字典 - - * @return 字符串 - - */ -+ (NSString*)dictionaryToJson:(NSDictionary *)dic; - - - -@end diff --git a/YuMi/Tools/sdkContent/catagory/Util/BSNSDictionary.m.backup b/YuMi/Tools/sdkContent/catagory/Util/BSNSDictionary.m.backup deleted file mode 100644 index 5ca96f5..0000000 --- a/YuMi/Tools/sdkContent/catagory/Util/BSNSDictionary.m.backup +++ /dev/null @@ -1,47 +0,0 @@ -// -// GWNSDictionary.m -// GWTestSDK -// -// Created by xiaowen.chen on 16/11/8. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import "BSNSDictionary.h" - -@implementation BSNSDictionary - - -#pragma mark - 把格式化的JSON格式的字符串转换成字典 -+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString { - - if (jsonString == nil) { - return nil; - } - - NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding]; - NSError *err; - NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData - options:NSJSONReadingMutableContainers - error:&err]; - if(err) { -// NSLog(@"json解析失败:%@",err); - return nil; - } - return dic; -} - - -#pragma mark - 把字典转json字符串 -+ (NSString*)dictionaryToJson:(NSDictionary *)dic - -{ - - NSError *parseError = nil; - - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:&parseError]; - - return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; - -} - -@end diff --git a/YuMi/Tools/sdkContent/catagory/Util/BSNSStringUtil.h.backup b/YuMi/Tools/sdkContent/catagory/Util/BSNSStringUtil.h.backup deleted file mode 100644 index 428e453..0000000 --- a/YuMi/Tools/sdkContent/catagory/Util/BSNSStringUtil.h.backup +++ /dev/null @@ -1,71 +0,0 @@ -// -// NSStringUtil.h -// GWTestSDK -// -// Created by xiaowen.chen on 16/8/30. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import -#import - -@interface BSNSStringUtil : PIBaseModel - - -/** - 格式换字典,数组,转字符串(格式化) - - @param object 数据对象 - @return 格式化的字符串 - */ -+(NSString *)getStringFromObj:(id)object; - - -/** - 去掉所有的空格和回车,\t - - @param str 原始的字符串 - @return 去掉所有的空格和回车后的字符串 - */ -+(NSString *)clearStr:(NSString *)str; - - -/** - URLEncode url编码 - - @param unencodedString 原始字符串 - @return 编码后的字符串 - */ -+(NSString*)encodeString:(NSString*)unencodedString; - - -/** - URLDEcode url解码 - - @param encodedString 原始字符串 - @return 解码后的字符串 - */ -+(NSString *)decodeString:(NSString*)encodedString; - -/** - 判断字符串是否是纯数字 - - @param BOOL 字符串 - @return 是否纯数字 - */ -+ (BOOL)isPureInt:(NSString *)string; - -#pragma mark - 富文本相关 - -/** - 根据字体,颜色,返回富文本,行距 - - @param str 字符串 - @param color 颜色 - @param font 字体 - @param lineSpac 行距 - @return 富文本 - */ -+(NSAttributedString *)getAttributedString:(NSString *)str color:(UIColor *)color font:(CGFloat)font lineSpa:(CGFloat)lineSpac; - -@end diff --git a/YuMi/Tools/sdkContent/catagory/Util/BSNSStringUtil.m.backup b/YuMi/Tools/sdkContent/catagory/Util/BSNSStringUtil.m.backup deleted file mode 100644 index 4f73c15..0000000 --- a/YuMi/Tools/sdkContent/catagory/Util/BSNSStringUtil.m.backup +++ /dev/null @@ -1,168 +0,0 @@ -// -// NSStringUtil.m -// GWTestSDK -// -// Created by xiaowen.chen on 16/8/30. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import "BSNSStringUtil.h" - -@implementation BSNSStringUtil - -#pragma mark - 格式换字典,数组,转字符串(格式化) -+(NSString *)getStringFromObj:(id)object{ - return [self getStringFromObj:object withTimes:0]; -} - - - -+(NSString *)getStringFromObj:(id)object withTimes:(int)times{ - - if (!object) { - return @""; - } - - times++; - NSMutableString *intervalStr = [NSMutableString string]; - for (int i = 1; i < times; i++) { - [intervalStr appendString:@"\t"]; - } - - if ([object isKindOfClass:[NSDictionary class]]) { - NSMutableString *string = [NSMutableString string]; - [string appendString:@"{\n"]; - - // 遍历所有的键值对 - [object enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - - [string appendFormat:@"\t%@%@",intervalStr,key]; - [string appendString:@" : "]; - [string appendFormat:@"%@,\n", [self getStringFromObj:obj withTimes:times]]; - }]; - - // 结尾有个} - [string appendFormat:@"%@}",intervalStr]; - - // 查找最后一个逗号 - NSRange range = [string rangeOfString:@"," options:NSBackwardsSearch]; - if (range.location != NSNotFound){ - [string deleteCharactersInRange:range]; - } - return string; - - }else if([object isKindOfClass:[NSArray class]]){ - - NSMutableString *string = [NSMutableString string]; - - // 开头有个[ - [string appendString:@"[\n"]; - - // 遍历所有的元素 - [object enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - // [string appendFormat:@"\t%@,\n", [self getStringFromObj:obj withTimes:times]]; - [string appendFormat:@"\t%@%@,\n",intervalStr, [self getStringFromObj:obj withTimes:times]]; - }]; - - // 结尾有个] - // [string appendString:@"]"]; - [string appendFormat:@"%@]",intervalStr]; - - // 查找最后一个逗号 - NSRange range = [string rangeOfString:@"," options:NSBackwardsSearch]; - if (range.location != NSNotFound){ - [string deleteCharactersInRange:range]; - } - return string; - - - }else if([object isKindOfClass:[NSString class]]){ - return (NSString *)object; - } - return [object description]; -} - - -#pragma mark - 去掉所有的空格和回车,\t -+(NSString *)clearStr:(NSString *)str{ - str = [str stringByReplacingOccurrencesOfString: @" " withString: @""]; - str = [str stringByReplacingOccurrencesOfString: @"\n" withString: @""]; - str = [str stringByReplacingOccurrencesOfString: @"\t" withString: @""]; - return str; -} - -#pragma mark - URLEncode -+(NSString*)encodeString:(NSString*)unencodedString{ - - #pragma clang diagnostic push - #pragma clang diagnostic ignored"-Wdeprecated-declarations" - NSString *encodedString = (NSString *) - CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, - (CFStringRef)unencodedString, - NULL, - (CFStringRef)@"!*'();:@&=+$,/?%#[]", - kCFStringEncodingUTF8)); - - #pragma clang diagnostic pop - return encodedString; -} - -#pragma mark - URLDEcode -+(NSString *)decodeString:(NSString*)encodedString - -{ - #pragma clang diagnostic push - #pragma clang diagnostic ignored"-Wdeprecated-declarations" - NSString *decodedString = (__bridge_transfer NSString *)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(NULL, - (__bridge CFStringRef)encodedString, - CFSTR(""), - CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding)); - #pragma clang diagnostic pop - return decodedString; -} - -#pragma mark -- 判断字符串是否是纯数字 -+ (BOOL)isPureInt:(NSString *)string{ - - NSScanner* scan = [NSScanner scannerWithString:string]; - - int val; - - return [scan scanInt:&val] && [scan isAtEnd]; - -} - -#pragma mark - 富文本相关 -#pragma mark - 根据字体,颜色,返回富文本,行距 -+(NSAttributedString *)getAttributedString:(NSString *)str color:(UIColor *)color font:(CGFloat)font lineSpa:(CGFloat)lineSpac{ - - if (lineSpac == 0) { - lineSpac = 5; - } - if (str == nil){ - str = @""; - } - if (font <= 0) { - font = 15; - } - if (color == nil) { - color = [UIColor blackColor]; - } - - NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; - paragraphStyle.lineSpacing = lineSpac;// 字体的行间距 - NSDictionary *attributes = @{ - NSFontAttributeName:[UIFont systemFontOfSize:font], - NSParagraphStyleAttributeName:paragraphStyle, - NSForegroundColorAttributeName:color - }; - - return [[NSAttributedString alloc] initWithString:str attributes:attributes]; -} - - -//返回拼接的富文本 - - - -@end diff --git a/YuMi/Tools/sdkContent/catagory/Util/BSUIDemoUtil.h.backup b/YuMi/Tools/sdkContent/catagory/Util/BSUIDemoUtil.h.backup deleted file mode 100644 index bac555a..0000000 --- a/YuMi/Tools/sdkContent/catagory/Util/BSUIDemoUtil.h.backup +++ /dev/null @@ -1,17 +0,0 @@ -// -// GWUIDemoUtil.h -// GWTestSDK -// -// Created by xiaowen.chen on 16/10/28. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import -#import - -@interface BSUIDemoUtil : PIBaseModel - -//测试的button -+(UIButton *)addBtn:(NSString *)btnName withView:(UIView *)subViewn frame:(CGRect)frame andtarget:(id)target action:(SEL)action; - -@end diff --git a/YuMi/Tools/sdkContent/catagory/Util/BSUIDemoUtil.m.backup b/YuMi/Tools/sdkContent/catagory/Util/BSUIDemoUtil.m.backup deleted file mode 100644 index 199af9c..0000000 --- a/YuMi/Tools/sdkContent/catagory/Util/BSUIDemoUtil.m.backup +++ /dev/null @@ -1,33 +0,0 @@ -// -// GWUIDemoUtil.m -// GWTestSDK -// -// Created by xiaowen.chen on 16/10/28. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import "BSUIDemoUtil.h" - -@implementation BSUIDemoUtil - - -//测试的button -+(UIButton *)addBtn:(NSString *)btnName withView:(UIView *)subViewn frame:(CGRect)frame andtarget:(id)target action:(SEL)action{ - - UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; - [btn setTitle:btnName forState:UIControlStateNormal]; - [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - btn.backgroundColor = [UIColor grayColor]; - btn.frame = frame; - [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside]; - - return btn; -} - -//测试的textFILE - - -//测试的lable - - -@end diff --git a/YuMi/Tools/sdkContent/catagory/Util/BSXWDateUtil.h.backup b/YuMi/Tools/sdkContent/catagory/Util/BSXWDateUtil.h.backup deleted file mode 100644 index aa49437..0000000 --- a/YuMi/Tools/sdkContent/catagory/Util/BSXWDateUtil.h.backup +++ /dev/null @@ -1,106 +0,0 @@ -// -// XWDateUtil.h -// FrameObject -// -// Created by shenba on 16/4/12. -// Copyright © 2016年 xiaowen. All rights reserved. -// - -#import - -@interface BSXWDateUtil : PIBaseModel - - -/** - 获取多少天,多少小时,多少分钟,多少秒之后的时间 - - @param day 天 - @param hours 小时 - @param min 分数 - @param ss 秒数 - @param date 当前时间 - @param forMet 格式化 - @return 结果字符串 - */ -+(NSString *)getTimeAfterDay:(int)day hours:(int)hours min:(int)min ss:(int)ss fromDate:(NSDate *)date withForMet:(NSString *)forMet; - - - -/** - 时间转字符串 - - @param date 时间 - @param forMet 格式 - @return 结果字符串 - */ -+(NSString *)strWithDate:(NSDate *)date withForMet:(NSString *)forMet; - - - -/** - 字符串转时间 - - @param dateStr 时间格式的字符串 - @param dateFormatterStr 格式 - @return 时间 - */ -+(NSDate *)DateInitWithString:(NSString *)dateStr dateFormatterStr:(NSString *)dateFormatterStr; - - - -/** - 判断是否超过某个时间段 timeInterval:单位秒,记录到硬盘 - - @param timeInterval 时间(秒) - @param tag 标记 - @return 结果是否超过某个时间 - */ -+(Boolean)isTimeOver:(int)timeInterval withTag:(NSString *)tag; - -/** - 清除记录标记的时间 - - @param tag 标记 - */ -+(void)removeTimeOverTag:(NSString *)tag; - - - -/** - 判断是否超过某个时间段 timeInterval:单位秒 分组处理 - - @param timeInterval 时间(秒) - @param tag 标记 - @param group 分组 - @return 结果是否超过某个时间 - */ -+(Boolean)isTimeOver:(int)timeInterval withTag:(NSString *)tag withGroup:(NSString *)group; - -/** - 按照分组清除记录标记的时间 - - @param group 分组 - */ -+(void)removeTimeOverGroup:(NSString *)group; - - -/** - 计算事件差,需要同格式的字符串 - - @param time1 时间1 - @param time2 时间2 - @param formet 时间格式 - @return 时间差 - */ -+(NSTimeInterval)TimeDifferenceWithTime1:(NSString *)time1 AndTime2:(NSString *)time2 formet:(NSString *)formet; - - -/** - 根据日期返回是否今天,明天,昨天 - - @param date 日期 - @return 今天,昨天,明天,... - */ -+(NSString *)compareDate:(NSDate *)date; - -@end diff --git a/YuMi/Tools/sdkContent/catagory/Util/BSXWDateUtil.m.backup b/YuMi/Tools/sdkContent/catagory/Util/BSXWDateUtil.m.backup deleted file mode 100644 index 8d8fd38..0000000 --- a/YuMi/Tools/sdkContent/catagory/Util/BSXWDateUtil.m.backup +++ /dev/null @@ -1,222 +0,0 @@ -// -// XWDateUtil.m -// FrameObject -// -// Created by shenba on 16/4/12. -// Copyright © 2016年 xiaowen. All rights reserved. -// - -#import "BSXWDateUtil.h" - -@implementation BSXWDateUtil - -static NSDateFormatter *simgle_df; - -#pragma mark - 获取多少天,多少小时,多少分钟,多少秒之后的时间 -+(NSString *)getTimeAfterDay:(int)day hours:(int)hours min:(int)min ss:(int)ss fromDate:(NSDate *)date withForMet:(NSString *)forMet{ - - if (date==nil) { - date = [NSDate date]; - } - - NSDate *resultDate = [[NSDate alloc]initWithTimeInterval:(24 * 60 * 60)*day+(60*60)*hours+min*60+ss sinceDate:date]; - - return [self strWithDate:resultDate withForMet:forMet]; - -} - - -#pragma mark - 时间转字符串 -+(NSString *)strWithDate:(NSDate *)date withForMet:(NSString *)forMet{ - - if (date == nil) { - date = [NSDate date]; - } - if (forMet==nil) { - if (!simgle_df) { - simgle_df = [[NSDateFormatter alloc]init];//格式化 - [simgle_df setDateFormat:@"yyyy-MM-dd HH:mm:ss"];//simgle_df保持这个格式,避免多线程调用的时候变化dateFormat造成其他的影响 - } - return [simgle_df stringFromDate:date]; - } - - NSDateFormatter*df = [[NSDateFormatter alloc]init];//格式化 - [df setDateFormat:forMet]; - return [df stringFromDate:date]; - -} - -#pragma mark - 字符串转时间 -+(NSDate *)DateInitWithString:(NSString *)dateStr dateFormatterStr:(NSString *)dateFormatterStr -{ - if (!dateStr) { - return [NSDate date]; - } - - if (dateFormatterStr == nil) { - if (!simgle_df) { - simgle_df = [[NSDateFormatter alloc]init];//格式化 - [simgle_df setDateFormat:@"yyyy-MM-dd HH:mm:ss"];//simgle_df保持这个格式,避免多线程调用的时候变化dateFormat造成其他的影响 - } - return [simgle_df dateFromString:dateStr]; - } - - - NSDate *reslutDate = nil; - NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; - [formatter setDateFormat:dateFormatterStr]; - reslutDate = [formatter dateFromString:dateStr];//得到时间 - return reslutDate; -} - - -#pragma mark - 判断是否超过某个时间段 timeInterval:单位秒 -+(Boolean)isTimeOver:(int)timeInterval withTag:(NSString *)tag{ - - - NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults]; - NSString *tempStrTag = [NSString stringWithFormat:@"bs_timesover_%@",tag]; - NSString *str = [defaults valueForKey:tempStrTag]; - NSDate *nowDate = [NSDate date]; -// NSLog(@"比较之前存放的时间:%@",tempStrTag); - if (timeInterval == 0) { - [defaults setValue:[self strWithDate:nowDate withForMet:nil] forKey:tempStrTag]; - return YES;//时间设置为0,表示刷新标志时间,返回成功 - } - if (!str) { - [defaults setValue:[self strWithDate:nowDate withForMet:nil] forKey:tempStrTag]; - return YES;//第一次调用 - } - - - NSTimeInterval time = [nowDate timeIntervalSinceDate:[self DateInitWithString:str dateFormatterStr:nil]]; -// NSLog(@"比较相差的时间:%f",time); - if (time > timeInterval) { - [defaults setValue:[self strWithDate:nowDate withForMet:nil] forKey:tempStrTag]; - return YES; - } - return NO; -} - - -#pragma mark - 判断是否超过某个时间段 timeInterval:单位秒 分组处理 -+(Boolean)isTimeOver:(int)timeInterval withTag:(NSString *)tag withGroup:(NSString *)group{ - - if (group == nil || tag == nil) { - return YES; - } - - NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults]; - - - //记录分组 - NSArray *temp = [defaults valueForKey:@"bs_timesGroup"]; - NSMutableArray *resultArr = [NSMutableArray arrayWithArray:temp]; - NSString *keyStr = [NSString stringWithFormat:@"bs_timeGroup_%@_%@",group,tag]; - if (![resultArr containsObject:keyStr]) { - [resultArr addObject:keyStr]; - [defaults setValue:resultArr forKey:@"bs_timesGroup"]; - } - - - - NSString *str = [defaults valueForKey:keyStr]; - NSDate *nowDate = [NSDate date]; - // NSLog(@"比较之前存放的时间:%@",tempStrTag); - if (timeInterval == 0) { - [defaults setValue:[self strWithDate:nowDate withForMet:nil] forKey:keyStr]; - return YES;//时间设置为0,表示刷新标志时间,返回成功 - } - if (!str) { - [defaults setValue:[self strWithDate:nowDate withForMet:nil] forKey:keyStr]; - return YES;//第一次调用 - } - - - NSTimeInterval time = [nowDate timeIntervalSinceDate:[self DateInitWithString:str dateFormatterStr:nil]]; - // NSLog(@"比较相差的时间:%f",time); - if (time > timeInterval) { - [defaults setValue:[self strWithDate:nowDate withForMet:nil] forKey:keyStr]; - return YES; - } - return NO; -} - -#pragma mark - 清除记录标记的时间 -+(void)removeTimeOverTag:(NSString *)tag{ - - if (tag == nil) { - return; - } - - NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults]; - NSString *tempStrTag = [NSString stringWithFormat:@"bs_timesover_%@",tag]; - [defaults removeObjectForKey:tempStrTag]; -} -#pragma mark - 按照分组清除记录标记的时间 -+(void)removeTimeOverGroup:(NSString *)group{ - - if (group == nil) { - return; - } - - NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults]; - - NSMutableArray *resultArr = [NSMutableArray array]; - NSArray *temp = [defaults valueForKey:@"bs_timesGroup"]; - Boolean isChange = NO; - for (NSString *str in temp) { - if ([str hasPrefix:[NSString stringWithFormat:@"bs_timeGroup_%@_",group]]) { - [defaults removeObjectForKey:str]; - isChange = YES; - }else{ - [resultArr addObject:str]; - } - } - if (isChange) { - [defaults setValue:resultArr forKey:@"bs_timesGroup"]; - } -} - - - -#pragma mark - 计算事件差,需要同格式的字符串 -+(NSTimeInterval)TimeDifferenceWithTime1:(NSString *)time1 AndTime2:(NSString *)time2 formet:(NSString *)formet{ - - return [[self DateInitWithString:time1 dateFormatterStr:formet] timeIntervalSinceDate:[self DateInitWithString:time2 dateFormatterStr:formet]]; -} - - -#pragma mark - ios判断是昨天,今天,还是明天 -+(NSString *)compareDate:(NSDate *)date{ - - NSTimeInterval secondsPerDay = 24 * 60 * 60; - NSDate *today = [[NSDate alloc] init]; - NSDate *tomorrow, *yesterday; - - tomorrow = [today dateByAddingTimeInterval: secondsPerDay]; - yesterday = [today dateByAddingTimeInterval: -secondsPerDay]; - // 10 first characters of description is the calendar date: - NSString * todayString = [[today description] substringToIndex:10]; - NSString * yesterdayString = [[yesterday description] substringToIndex:10]; - NSString * tomorrowString = [[tomorrow description] substringToIndex:10]; - - NSString * dateString = [[date description] substringToIndex:10]; - - if ([dateString isEqualToString:todayString]) - { - return @"今天"; - } else if ([dateString isEqualToString:yesterdayString]) - { - return @"昨天"; - }else if ([dateString isEqualToString:tomorrowString]) - { - return @"明天"; - } - else - { - return dateString; - } -} - -@end diff --git a/YuMi/Tools/sdkContent/catagory/Util/BS_UIColor.h.backup b/YuMi/Tools/sdkContent/catagory/Util/BS_UIColor.h.backup deleted file mode 100644 index 5f2d3ce..0000000 --- a/YuMi/Tools/sdkContent/catagory/Util/BS_UIColor.h.backup +++ /dev/null @@ -1,16 +0,0 @@ -// -// BS_UIColor.h -// TextSdk -// -// Created by xiaowen on 2017/9/22. -// Copyright © 2017年 gatawang.com. All rights reserved. -// - -#import -#import - -@interface BS_UIColor : NSObject - -+ (UIColor *) stringTOColor:(NSString *)str; - -@end diff --git a/YuMi/Tools/sdkContent/catagory/Util/BS_UIColor.m.backup b/YuMi/Tools/sdkContent/catagory/Util/BS_UIColor.m.backup deleted file mode 100644 index a24c749..0000000 --- a/YuMi/Tools/sdkContent/catagory/Util/BS_UIColor.m.backup +++ /dev/null @@ -1,31 +0,0 @@ -// -// BS_UIColor.m -// TextSdk -// -// Created by xiaowen on 2017/9/22. -// Copyright © 2017年 gatawang.com. All rights reserved. -// - -#import "BS_UIColor.h" - -@implementation BS_UIColor - -+ (UIColor *) stringTOColor:(NSString *)str -{ - if (!str || [str isEqualToString:@""]) { - return nil; - } - unsigned red,green,blue; - NSRange range; - range.length = 2; - range.location = 1; - [[NSScanner scannerWithString:[str substringWithRange:range]] scanHexInt:&red]; - range.location = 3; - [[NSScanner scannerWithString:[str substringWithRange:range]] scanHexInt:&green]; - range.location = 5; - [[NSScanner scannerWithString:[str substringWithRange:range]] scanHexInt:&blue]; - UIColor *color= [UIColor colorWithRed:red/255.0f green:green/255.0f blue:blue/255.0f alpha:1]; - return color; -} - -@end diff --git a/YuMi/Tools/sdkContent/catagory/system/BS_Define.h.backup b/YuMi/Tools/sdkContent/catagory/system/BS_Define.h.backup deleted file mode 100644 index f3e2b78..0000000 --- a/YuMi/Tools/sdkContent/catagory/system/BS_Define.h.backup +++ /dev/null @@ -1,32 +0,0 @@ -// -// BS_Define.h -// GWTestSDK -// -// Created by xiaowen.chen on 16/8/16. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#define GET_X(view) view.frame.origin.x -#define GET_Y(view) view.frame.origin.y -#define GET_W(view) view.frame.size.width -#define GET_H(view) view.frame.size.height - -#define GET_X_Max(view) view.frame.origin.x + view.frame.size.width -#define GET_Y_Max(view) view.frame.origin.y + view.frame.size.height - -#define Set_frame(tempView,a,b) CGRect bs_tempRect = tempView.frame;bs_tempRect.origin.x = a;bs_tempRect.origin.y = b;tempView.frame = bs_tempRect; - -#define Set_frame2(tempView,a,b,c,d) CGRect bs_tempRect = tempView.frame;bs_tempRect.origin.x = a;bs_tempRect.origin.y = b;bs_tempRect.size.width = c;bs_tempRect.size.height = d;tempView.frame = bs_tempRect; - - - -#define USER_LANGUAGE @"user_language" - - - - -//判断ios系统版本 -#define IOS7 ([[UIDevice currentDevice] systemVersion] floatValue] >= 7.0 ? YES:NO) -#define IOS8 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0 ? YES:NO) -#define IOS9 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0 ? YES:NO) -#define IOS10 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0 ? YES:NO) diff --git a/YuMi/Tools/sdkContent/catagory/system/SystemUtil.h.backup b/YuMi/Tools/sdkContent/catagory/system/SystemUtil.h.backup deleted file mode 100644 index a389567..0000000 --- a/YuMi/Tools/sdkContent/catagory/system/SystemUtil.h.backup +++ /dev/null @@ -1,18 +0,0 @@ -// -// SystemUtil.h -// GWTestSDK -// -// Created by xiaowen.chen on 16/11/10. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import - -@interface SystemUtil : PIBaseModel - -/* - * 获取项目名 - */ -+(NSString *)getProjectName; - -@end diff --git a/YuMi/Tools/sdkContent/catagory/system/SystemUtil.m.backup b/YuMi/Tools/sdkContent/catagory/system/SystemUtil.m.backup deleted file mode 100644 index 6672fee..0000000 --- a/YuMi/Tools/sdkContent/catagory/system/SystemUtil.m.backup +++ /dev/null @@ -1,35 +0,0 @@ -// -// SystemUtil.m -// GWTestSDK -// -// Created by xiaowen.chen on 16/11/10. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import "SystemUtil.h" - -@implementation SystemUtil - - -+(NSString *)getProjectName{ - - NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; - - return [infoDictionary objectForKey:(NSString *)kCFBundleExecutableKey]; //获取项目名称 - -} - -@end - - - -// -// -// -// -// -// -// -// - -// diff --git a/YuMi/Tools/sdkContent/catagory/system/UILabel+YBAttributeTextTapAction.h.backup b/YuMi/Tools/sdkContent/catagory/system/UILabel+YBAttributeTextTapAction.h.backup deleted file mode 100755 index d1e9c18..0000000 --- a/YuMi/Tools/sdkContent/catagory/system/UILabel+YBAttributeTextTapAction.h.backup +++ /dev/null @@ -1,62 +0,0 @@ -// -// UILabel+YBAttributeTextTapAction.h -// -// Created by LYB on 16/7/1. -// Copyright © 2016年 LYB. All rights reserved. -// - -#import - -@protocol YBAttributeTapActionDelegate -@optional -/** - * YBAttributeTapActionDelegate - * - * @param string 点击的字符串 - * @param range 点击的字符串range - * @param index 点击的字符在数组中的index - */ -- (void)yb_attributeTapReturnString:(NSString *)string - range:(NSRange)range - index:(NSInteger)index; -@end - -@interface YBAttributeModel : PIBaseModel - -@property (nonatomic, copy) NSString *str; - -@property (nonatomic, assign) NSRange range; - -@end - - - - - -@interface UILabel (YBAttributeTextTapAction) - -/** - * 是否打开点击效果,默认是打开 - */ -@property (nonatomic, assign) BOOL enabledTapEffect; - -/** - * 给文本添加点击事件Block回调 - * - * @param strings 需要添加的字符串数组 - * @param tapClick 点击事件回调 - */ -- (void)yb_addAttributeTapActionWithStrings:(NSArray *)strings - tapClicked:(void (^) (NSString *string , NSRange range , NSInteger index))tapClick; - -/** - * 给文本添加点击事件delegate回调 - * - * @param strings 需要添加的字符串数组 - * @param delegate delegate - */ -- (void)yb_addAttributeTapActionWithStrings:(NSArray *)strings - delegate:(id )delegate; - -@end - diff --git a/YuMi/Tools/sdkContent/catagory/system/UILabel+YBAttributeTextTapAction.m.backup b/YuMi/Tools/sdkContent/catagory/system/UILabel+YBAttributeTextTapAction.m.backup deleted file mode 100755 index fa502e6..0000000 --- a/YuMi/Tools/sdkContent/catagory/system/UILabel+YBAttributeTextTapAction.m.backup +++ /dev/null @@ -1,396 +0,0 @@ -// -// UILabel+YBAttributeTextTapAction.m -// -// Created by LYB on 16/7/1. -// Copyright © 2016年 LYB. All rights reserved. -// - -#import "UILabel+YBAttributeTextTapAction.h" -#import -#import -#import - -@implementation YBAttributeModel - -@end - -@implementation UILabel (YBAttributeTextTapAction) - -#pragma mark - AssociatedObjects - -- (NSMutableArray *)siefnsufwhf -{ - return objc_getAssociatedObject(self, _cmd); -} - -- (void)setSiefnsufwhf:(NSMutableArray *)siefnsufwhf -{ - objc_setAssociatedObject(self, @selector(siefnsufwhf), siefnsufwhf, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -- (NSMutableDictionary *)siefidshfiwhi -{ - return objc_getAssociatedObject(self, _cmd); -} - -- (void)setSiefidshfiwhi:(NSMutableDictionary *)siefidshfiwhi -{ - objc_setAssociatedObject(self, @selector(siefidshfiwhi), siefidshfiwhi, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -- (BOOL)isTapAction -{ - return [objc_getAssociatedObject(self, _cmd) boolValue]; -} - -- (void)setIsTapAction:(BOOL)isTapAction -{ - objc_setAssociatedObject(self, @selector(isTapAction), @(isTapAction), OBJC_ASSOCIATION_ASSIGN); -} - -- (void (^)(NSString *, NSRange, NSInteger))tapBlock -{ - return objc_getAssociatedObject(self, _cmd); -} - -- (void)setTapBlock:(void (^)(NSString *, NSRange, NSInteger))tapBlock -{ - objc_setAssociatedObject(self, @selector(tapBlock), tapBlock, OBJC_ASSOCIATION_COPY_NONATOMIC); -} - -- (id)delegate -{ - return objc_getAssociatedObject(self, _cmd); -} - -- (BOOL)enabledTapEffect -{ - return [objc_getAssociatedObject(self, _cmd) boolValue]; -} - -- (void)setEnabledTapEffect:(BOOL)enabledTapEffect -{ - objc_setAssociatedObject(self, @selector(enabledTapEffect), @(enabledTapEffect), OBJC_ASSOCIATION_ASSIGN); - self.isTapEffect = enabledTapEffect; -} - -- (BOOL)isTapEffect -{ - return [objc_getAssociatedObject(self, _cmd) boolValue]; -} - -- (void)setIsTapEffect:(BOOL)isTapEffect -{ - objc_setAssociatedObject(self, @selector(isTapEffect), @(isTapEffect), OBJC_ASSOCIATION_ASSIGN); -} - -- (void)setDelegate:(id)delegate -{ - objc_setAssociatedObject(self, @selector(delegate), delegate, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -#pragma mark - mainFunction -- (void)yb_addAttributeTapActionWithStrings:(NSArray *)strings tapClicked:(void (^) (NSString *string , NSRange range , NSInteger index))tapClick -{ - [self yb_getRangesWithStrings:strings]; - - if (self.tapBlock != tapClick) { - self.tapBlock = tapClick; - } -} - -- (void)yb_addAttributeTapActionWithStrings:(NSArray *)strings - delegate:(id )delegate -{ - [self yb_getRangesWithStrings:strings]; - - if (self.delegate != delegate) { - self.delegate = delegate; - } -} - -#pragma mark - touchAction -- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event -{ - if (!self.isTapAction) { - return; - } - - if (objc_getAssociatedObject(self, @selector(enabledTapEffect))) { - self.isTapEffect = self.enabledTapEffect; - } - - UITouch *touch = [touches anyObject]; - - CGPoint point = [touch locationInView:self]; - - __weak typeof(self) weakSelf = self; - - [self yb_getTapFrameWithTouchPoint:point result:^(NSString *string, NSRange range, NSInteger index) { - - if (weakSelf.tapBlock) { - weakSelf.tapBlock (string , range , index); - } - - if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(yb_attributeTapReturnString:range:index:)]) { - [weakSelf.delegate yb_attributeTapReturnString:string range:range index:index]; - } - - if (self.isTapEffect) { - - [self yb_saveEffectDicWithRange:range]; - - [self yb_tapEffectWithStatus:NO]; - } - - }]; -} - -- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { - - if (self.isTapAction) { - if ([self yb_getTapFrameWithTouchPoint:point result:nil]) { - return self; - } - } - return [super hitTest:point withEvent:event]; -} - -#pragma mark - getTapFrame -- (BOOL)yb_getTapFrameWithTouchPoint:(CGPoint)point result:(void (^) (NSString *string , NSRange range , NSInteger index))resultBlock -{ - CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString((CFAttributedStringRef)self.attributedText); - - CGMutablePathRef Path = CGPathCreateMutable(); - - CGPathAddRect(Path, NULL, CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height)); - - CTFrameRef frame = CTFramesetterCreateFrame(framesetter, CFRangeMake(0, 0), Path, NULL); - - CFRange range = CTFrameGetVisibleStringRange(frame); - - if (self.attributedText.length > range.length) { - - UIFont *font ; - - if ([self.attributedText attribute:NSFontAttributeName atIndex:0 effectiveRange:nil]) { - - font = [self.attributedText attribute:NSFontAttributeName atIndex:0 effectiveRange:nil]; - - }else if (self.font){ - font = self.font; - - }else { - font = [UIFont systemFontOfSize:17]; - } - - CGPathRelease(Path); - - Path = CGPathCreateMutable(); - - CGPathAddRect(Path, NULL, CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height + font.lineHeight)); - - frame = CTFramesetterCreateFrame(framesetter, CFRangeMake(0, 0), Path, NULL); - } - - CFArrayRef lines = CTFrameGetLines(frame); - - if (!lines) { - CFRelease(frame); - CFRelease(framesetter); - CGPathRelease(Path); - return NO; - } - - CFIndex count = CFArrayGetCount(lines); - - CGPoint origins[count]; - - CTFrameGetLineOrigins(frame, CFRangeMake(0, 0), origins); - - CGAffineTransform transform = [self yb_transformForCoreText]; - - CGFloat verticalOffset = 0; - - for (CFIndex i = 0; i < count; i++) { - CGPoint linePoint = origins[i]; - - CTLineRef line = CFArrayGetValueAtIndex(lines, i); - - CGRect flippedRect = [self yb_getLineBounds:line point:linePoint]; - - CGRect rect = CGRectApplyAffineTransform(flippedRect, transform); - - rect = CGRectInset(rect, 0, 0); - - rect = CGRectOffset(rect, 0, verticalOffset); - - NSParagraphStyle *style = [self.attributedText attribute:NSParagraphStyleAttributeName atIndex:0 effectiveRange:nil]; - - CGFloat lineSpace; - - if (style) { - lineSpace = style.lineSpacing; - }else { - lineSpace = 0; - } - - CGFloat lineOutSpace = (self.bounds.size.height - lineSpace * (count - 1) -rect.size.height * count) / 2; - - rect.origin.y = lineOutSpace + rect.size.height * i + lineSpace * i; - - if (CGRectContainsPoint(rect, point)) { - - CGPoint relativePoint = CGPointMake(point.x - CGRectGetMinX(rect), point.y - CGRectGetMinY(rect)); - - CFIndex index = CTLineGetStringIndexForPosition(line, relativePoint); - - CGFloat offset; - - CTLineGetOffsetForStringIndex(line, index, &offset); - - if (offset > relativePoint.x) { - index = index - 1; - } - - NSInteger link_count = self.siefnsufwhf.count; - - for (int j = 0; j < link_count; j++) { - - YBAttributeModel *model = self.siefnsufwhf[j]; - - NSRange link_range = model.range; - if (NSLocationInRange(index, link_range)) { - if (resultBlock) { - resultBlock (model.str , model.range , (NSInteger)j); - } - CFRelease(frame); - CFRelease(framesetter); - CGPathRelease(Path); - return YES; - } - } - } - } - CFRelease(frame); - CFRelease(framesetter); - CGPathRelease(Path); - return NO; -} - -- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event -{ - if (self.isTapEffect) { - - [self performSelectorOnMainThread:@selector(yb_tapEffectWithStatus:) withObject:nil waitUntilDone:NO]; - - } -} - -- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event -{ - if (self.isTapEffect) { - - [self performSelectorOnMainThread:@selector(yb_tapEffectWithStatus:) withObject:nil waitUntilDone:NO]; - - } -} - -- (CGAffineTransform)yb_transformForCoreText -{ - return CGAffineTransformScale(CGAffineTransformMakeTranslation(0, self.bounds.size.height), 1.f, -1.f); -} - -- (CGRect)yb_getLineBounds:(CTLineRef)line point:(CGPoint)point -{ - CGFloat ascent = 0.0f; - CGFloat descent = 0.0f; - CGFloat leading = 0.0f; - CGFloat width = (CGFloat)CTLineGetTypographicBounds(line, &ascent, &descent, &leading); - CGFloat height = ascent + fabs(descent) + leading; - - return CGRectMake(point.x, point.y , width, height); -} - -#pragma mark - tapEffect -- (void)yb_tapEffectWithStatus:(BOOL)status -{ - if (self.isTapEffect) { - NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc] initWithAttributedString:self.attributedText]; - - NSMutableAttributedString *subAtt = [[NSMutableAttributedString alloc] initWithAttributedString:[[self.siefidshfiwhi allValues] firstObject]]; - - NSRange range = NSRangeFromString([[self.siefidshfiwhi allKeys] firstObject]); - - if (status) { - [subAtt addAttribute:NSBackgroundColorAttributeName value:[UIColor lightGrayColor] range:NSMakeRange(0, subAtt.string.length)]; - - [attStr replaceCharactersInRange:range withAttributedString:subAtt]; - }else { - - [attStr replaceCharactersInRange:range withAttributedString:subAtt]; - } - self.attributedText = attStr; - } -} - -- (void)yb_saveEffectDicWithRange:(NSRange)range -{ - self.siefidshfiwhi = [NSMutableDictionary dictionary]; - - NSAttributedString *subAttribute = [self.attributedText attributedSubstringFromRange:range]; - - [self.siefidshfiwhi setObject:subAttribute forKey:NSStringFromRange(range)]; -} - -#pragma mark - getRange -- (void)yb_getRangesWithStrings:(NSArray *)strings -{ - if (self.attributedText == nil) { - self.isTapAction = NO; - return; - } - - self.isTapAction = YES; - - self.isTapEffect = YES; - - __block NSString *totalStr = self.attributedText.string; - - self.siefnsufwhf = [NSMutableArray array]; - - __weak typeof(self) weakSelf = self; - - [strings enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - - NSRange range = [totalStr rangeOfString:obj]; - - if (range.length != 0) { - - totalStr = [totalStr stringByReplacingCharactersInRange:range withString:[weakSelf yb_getStringWithRange:range]]; - - YBAttributeModel *model = [YBAttributeModel new]; - - model.range = range; - - model.str = obj; - - [weakSelf.siefnsufwhf addObject:model]; - - } - - }]; -} - -- (NSString *)yb_getStringWithRange:(NSRange)range -{ - NSMutableString *string = [NSMutableString string]; - - for (int i = 0; i < range.length ; i++) { - - [string appendString:@" "]; - } - return string; -} - -@end diff --git a/YuMi/Tools/sdkContent/content/FileOption(文件操作)/BSFileOptionModel.h.backup b/YuMi/Tools/sdkContent/content/FileOption(文件操作)/BSFileOptionModel.h.backup deleted file mode 100644 index b77c4c3..0000000 --- a/YuMi/Tools/sdkContent/content/FileOption(文件操作)/BSFileOptionModel.h.backup +++ /dev/null @@ -1,32 +0,0 @@ -// -// GWFileOptionModel.h -// GWTestSDK -// -// Created by xiaowen.chen on 16/8/29. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import - -@interface BSFileOptionModel : PIBaseModel - - - -//写入数据 -+(void)writeToFile_RecordModel:(NSArray *)logArray stringForMatBlock:( NSString*(^)( NSString *forMatString) )forMatblock withCompletion:( NSString*(^)( NSString *logString) )block class:(Class)class1; - -/* - * 压缩当天产生的日志文件zip文件: - * 1:如果当天没有日志文件,返回空; - * 2:如果没有实现压缩zip的方法,返回日志的位置路径; - * 3:如果实现了压缩文件的方法,返回日志压缩后的位置路径. - * - */ -+(NSString *)compression:(void(^)( NSString *logPath))block; - - - -//删除所有日志数据 -+(void)deleteFilePathLog; - -@end diff --git a/YuMi/Tools/sdkContent/content/FileOption(文件操作)/BSFileOptionModel.m.backup b/YuMi/Tools/sdkContent/content/FileOption(文件操作)/BSFileOptionModel.m.backup deleted file mode 100644 index 800b94a..0000000 --- a/YuMi/Tools/sdkContent/content/FileOption(文件操作)/BSFileOptionModel.m.backup +++ /dev/null @@ -1,206 +0,0 @@ -// -// FileOptionModel.m -// GWTestSDK -// -// Created by xiaowen.chen on 16/8/29. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import "BSFileOptionModel.h" -#import "BSRecordModel.h" -#import // 导入运行时文件 - -#define BS_DocumentPath [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] - -#define BS_LogFilePath [NSString stringWithFormat:@"%@/%@", [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0],@"GWLogFile"] - -#define BS_LogZipFilePath [NSString stringWithFormat:@"%@/%@", [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0],@"GWLogFileZip"] - -@implementation BSFileOptionModel - - - - - -+(void)writeToFile_RecordModel:(NSArray *)logArray stringForMatBlock:( NSString*(^)( NSString *forMatString) )forMatblock withCompletion:( NSString*(^)( NSString *logString) )block class:(Class)class1{ - //日志文件夹 - NSString *logFile = BS_LogFilePath; - if (![[NSFileManager defaultManager] fileExistsAtPath:logFile]) { - [[NSFileManager defaultManager] createDirectoryAtPath:logFile withIntermediateDirectories:YES attributes:nil error:nil]; - } else { - - NSLog(@"FileDir is exists."); - } - - - //日志txt文件 - NSString *logTxtPath = [NSString stringWithFormat:@"%@/%@.txt", logFile,[self currentTime]]; - if (![[NSFileManager defaultManager] fileExistsAtPath:logTxtPath]) { - [[NSFileManager defaultManager] createFileAtPath:logTxtPath contents:nil attributes:nil]; - } -// NSLog(@"logTxtPath = %@",logTxtPath); - //写入日志头 - NSError *error; - NSString *logHead = [NSString stringWithFormat:@"日志协议类型:1,写入时间:%@\n",[self currentTime2]]; - BOOL flag = [logHead writeToFile:logTxtPath atomically:YES encoding:NSUTF8StringEncoding error:&error];//一般error都设置为nil,保证写入成功 - if (flag) { - NSLog(@"写入文件头成功"); - } - else{ - NSLog(@"写入文件头失败"); - } - - - - @autoreleasepool { - NSString *str = @"类型编码:[coding] 类型:ddd 描述:[describe] 关键字:[keyword] 结果:[result] 操作编码:[optionCoding]\n"; - if (forMatblock) { - str = forMatblock(str); - } - id log; - NSFileHandle *fileHandle = [NSFileHandle fileHandleForUpdatingAtPath:logTxtPath]; - for (int i = 0 ; i -#import - -@interface BSDrawLine : NSObject - - -/* - * 设置坐标系数据 - */ --(void)initSettingXuint:(CGFloat)xunit xBegin:(CGFloat)xBegin yUint:(CGFloat)yUint yBegain:(CGFloat)yBegain; -/* - * 设置坐标原点 - */ --(void)initPoint:(CGPoint)point; - -/** - 设置阴线阳线的颜色,是否实心 - - @param color 阳线颜色 - @param color2 阴线颜色 - @param isYangLineSolid 阳线是否实心 - @param isYinLineSolid 阴线是否实心 - . - */ --(void)initYangLineColor:(UIColor *)color YinLineColor:(UIColor *)color2 isYangLineSolid:(Boolean)isYangLineSolid isYinLineSolid:(Boolean)isYinLineSolid; - - - -/** - 画k图 - - @param arr arr数组长度要>=5 [最大值,最小值,开盘值,收盘值,x坐标,...] - @param ctx CGContextRef画笔对象 - @param scan 放大比例 - */ --(void)drawKline:(NSArray *)arr withContext:(CGContextRef)contex scan:(CGFloat)scan; - -#pragma mark - 类方法 - -/** - 画直线 - [self.myDraw drawLinePoint:@[@[lineWidthStr,@"185",@"185",@"15",@"1"],@[temp5,temp6]] withContext:UIGraphicsGetCurrentContext()]; - - @param arr2 [[粗细,颜色r,颜色g,颜色b,透明度],[第一条线[第一个点],[第二个点]...],[第二条线]......] - @param ctx CGContextRef画笔对象 - @param scan 放大比例 - */ -+(void)drawLinePoint:(NSArray *)arr2 withContext:(CGContextRef)context scan:(CGFloat)scan; - -/** - 画曲线 - @param lineArr [[线宽,点size,颜色],[第一条线[第一个点],[第二个点]...],[第二条线]...] - @param ctx CGContextRef画笔对象 - @param scan 放大比例 - */ -+(void)drawCurves:(NSArray *)lineArr withContext:(CGContextRef)ctx scan:(CGFloat)scan; - -/** - 画多个多边形 - - @param lineArr [[线宽,线颜色,填充颜色],[第一个多边形[第一个点],[第二个点]...],[第二个多边形]...] - @param ctx CGContextRef画笔对象 - @param scan 放大比例 - */ -+(void)drawMoreRects:(NSArray *)lineArr withContext:(CGContextRef)ctx scan:(CGFloat)scan; - -#pragma mark - 字体类相关 - -/** - 富文本字体 - - @param str 字符串 - @param size 字体范围 - @param point 中心点位置 - @param font 字体大小 - @param color 字体颜色 - */ -+(void)drawWord:(NSString *)str size:(CGSize)size centerPoint:(CGPoint)point font:(CGFloat)font color:(UIColor *)color; - - - -@end diff --git a/YuMi/Tools/sdkContent/content/K/BSDrawLine.m.backup b/YuMi/Tools/sdkContent/content/K/BSDrawLine.m.backup deleted file mode 100644 index c094322..0000000 --- a/YuMi/Tools/sdkContent/content/K/BSDrawLine.m.backup +++ /dev/null @@ -1,530 +0,0 @@ -// -// GWDrawLine.m -// GWTestSDK -// -// Created by xiaowen.chen on 16/9/26. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import "BSDrawLine.h" - -@interface BSDrawLine() - -@property(nonatomic,assign)CGPoint point; //原点坐标 - -@property(nonatomic,assign)CGFloat xUint; //x轴比例 -@property(nonatomic,assign)CGFloat xbegin; //x轴初始值 -@property(nonatomic,assign)CGFloat yUint; //y轴比例 -@property(nonatomic,assign)CGFloat ybegin; //y轴初始值 - -@property(nonatomic,assign)NSString *isSolidYangLine; //阳线是否实心 0(空心),1 -@property(nonatomic,assign)NSString *isSolidYinLine; //阴线是否实心 0(实心),1 - -@property(nonatomic,strong)UIColor *YangLineColor; //阳线颜色 -@property(nonatomic,strong)UIColor *YinLineColor; //阴线颜色 - -@end - - -@implementation BSDrawLine - -//设置坐标系数据 --(void)initSettingXuint:(CGFloat)xunit xBegin:(CGFloat)xBegin yUint:(CGFloat)yUint yBegain:(CGFloat)yBegain{ - - //检查配置参数 - if (xunit <= 0 || yBegain < 0 || yUint <= 0 || xBegin < 0) { - NSLog(@"参数配置有误...,%.2f,%.2f,%.2f,%.2f",xunit,xBegin,yUint,yBegain); - return; - } - - _xbegin = xBegin; - _ybegin = yBegain; - _xUint = xunit; - _yUint = yUint; - -} -//设置坐标原点 --(void)initPoint:(CGPoint)point{ - _point = point; -} - -//设置阴线阳线的颜色,是否实心 --(void)initYangLineColor:(UIColor *)color YinLineColor:(UIColor *)color2 isYangLineSolid:(Boolean)isYangLineSolid isYinLineSolid:(Boolean)isYinLineSolid{ - _YangLineColor = color; - _YinLineColor = color2; - if (isYangLineSolid) { - _isSolidYangLine = @"1"; - }else{ - _isSolidYangLine = @"0"; - } - - if (isYinLineSolid) { - _isSolidYinLine = @"0"; - }else{ - _isSolidYinLine = @"1"; - } -} - - --(void)drawKline:(NSArray *)arr withContext:(CGContextRef)context scan:(CGFloat)scan{ - - //检查配置参数 - if (_xUint <= 0 ) { - NSLog(@"参数配置未设置..."); - return; - } - if (scan == 0) { - scan = 1; - } - - if ([arr isKindOfClass:[NSArray class]]) { - for (NSArray *tempArr in arr) { - if ([tempArr isKindOfClass:[NSArray class]]) { - if ([tempArr count] >= 5) { - - CGFloat maxTemp = [tempArr[0] floatValue]; - CGFloat minTemp = [tempArr[1] floatValue]; - CGFloat openTemp = [tempArr[2] floatValue]; - CGFloat closeTemp = [tempArr[3] floatValue]; - CGFloat xTemp = [tempArr[4] floatValue]; - - [self drawKLine:maxTemp min:minTemp open:openTemp close:closeTemp x:xTemp lineWidth:1/scan lineWidth2:5/scan context:context]; - - }else{ - NSLog(@"单条数组长度<4"); - } - }else{ - NSLog(@"单条数组数据异常"); - } - } - }else{ - NSLog(@"数组有误"); - } - - - //画坐标系 - - -} - - --(void)drawKLine:(CGFloat)max min:(CGFloat)min open:(CGFloat)open close:(CGFloat)close x:(CGFloat)x lineWidth:(CGFloat)lineWidth lineWidth2:(CGFloat)lineWidth2 context:(CGContextRef)context{ - - //检查格式是否规范 - if (max < min || max < open || max < close) { - NSLog(@"最大值不正确"); - NSLog(@"最大值:%.2f,最小值:%.2f,开盘:%.2f,收盘:%.2f",max,min,open,close); - } - if (min > max || min > open || min > close) { - NSLog(@"最小值不正确"); - NSLog(@"最大值:%.2f,最小值:%.2f,开盘:%.2f,收盘:%.2f",max,min,open,close); - } - - [self drawKLine:max min:min open:open close:close x:x lineWidth:lineWidth lineWidth2:lineWidth2 withPoint:_point xUnit:_xUint yUnit:_yUint xbegin:_xbegin ybegin:_ybegin context:context]; -} - - -/** - * 画k线 - */ --(void)drawKLine:(CGFloat)max min:(CGFloat)min open:(CGFloat)open close:(CGFloat)close x:(CGFloat)x lineWidth:(CGFloat)lineWidth lineWidth2:(CGFloat)lineWidth2 withPoint:(CGPoint)point xUnit:(CGFloat)xUnit yUnit:(CGFloat)yUnit xbegin:(CGFloat)xbegin ybegin:(CGFloat)ybegin context:(CGContextRef)context{ - - - //阳线or阴线 - Boolean isYangLine; - CGFloat top = 0; - CGFloat bottom = 0; - if (close > open) { - isYangLine = true; - top = close; - bottom = open; - }else{ - isYangLine = false; - top = open; - bottom = close; - } - - //根据point计算目标点在view中的位置 - max = point.y - (max - ybegin)*yUnit; - min = point.y - (min - ybegin)*yUnit; - top = point.y - (top - ybegin)*yUnit; - bottom = point.y - (bottom - ybegin)*yUnit; - x = (x - xbegin)*xUnit + point.x; - - // NSLog(@"\nmax:%.2f\ntop:%.2f\nbottom:%.2f\nmin:%.2f",max,top,bottom,min); - - UIColor *lineColor = [self getLineColor:isYangLine]; - [lineColor setStroke]; - //画上面的线 - - CGContextSetLineCap(context,kCGLineCapSquare); //指定直线样式 - CGContextSetLineWidth(context,lineWidth); //线宽 - CGContextBeginPath(context); //开始绘制 - CGContextMoveToPoint(context,x, max); //画笔移动到点 - CGContextAddLineToPoint(context,x, top); //下一点 - CGContextStrokePath(context); //绘制完成 - - //画中间的柱体 - CGFloat height = top - bottom == 0 ? 1 : top - bottom; - if (height < 0) { - height = - height; - } - UIColor *solidColor = lineColor; - if (![self getSolid:isYangLine]) { - solidColor = [UIColor clearColor]; //实心的颜色 - } - - CGContextBeginPath(context); //开始绘制 - CGContextMoveToPoint(context,x, top); //画笔移动到点 - [self draw4Rect:CGRectMake(x - lineWidth2/2 , top, lineWidth2,height) withColor:lineColor color2:solidColor withContex:context]; - - //画下面的线 - [lineColor setStroke]; - CGContextSetLineCap(context,kCGLineCapSquare); //指定直线样式 - CGContextSetLineWidth(context,lineWidth); //线宽 - CGContextBeginPath(context); //开始绘制 - CGContextMoveToPoint(context,x, bottom); //画笔移动到点 - CGContextAddLineToPoint(context,x, min); //下一点 - CGContextStrokePath(context); //绘制完成 - - -} -//获取k线的颜色 --(UIColor *)getLineColor:(Boolean)isYangLine{ - - if (isYangLine) { - if (_YangLineColor == nil) { - return [UIColor redColor]; - } - return _YangLineColor; - } - if (_YinLineColor == nil) { - return [UIColor greenColor]; - } - return _YinLineColor; -} -//获取柱体是否实心 --(Boolean)getSolid:(Boolean)isYangLine{ - if (isYangLine) { - if ([_isSolidYangLine isEqualToString:@"0"]) { - return false; - } - }else{ - if (![_isSolidYinLine isEqualToString:@"0"]) { - return false; - } - } - return true; -} - -//[[粗细,颜色r,颜色g,颜色b,透明度],[第一个点],[第二个点]......] -+(void)drawLinePoint:(NSArray *)arr2 withContext:(CGContextRef)context scan:(CGFloat)scan{ - - if (arr2.count < 2) { - NSLog(@"数据不全..."); - return; - } - if (scan == 0) { - scan = 1; - } - - @autoreleasepool { - NSArray *arr = arr2[0]; - if (![arr isKindOfClass:[NSArray class]] || arr.count < 5) { - NSLog(@"设置参数不正确..."); - return; - } - - //kCGLineCapButt, - //kCGLineCapRound, - //kCGLineCapSquare - //设置线段头尾部的样式 - CGContextSetLineCap(context,kCGLineCapSquare); - - // kCGLineJoinMiter, - // kCGLineJoinRound, - // kCGLineJoinBevel - //设置线段转折点的样式 - CGContextSetLineJoin(context, kCGLineJoinRound); - - //直线宽度 - CGContextSetLineWidth(context,[arr[0] floatValue]/scan); - //设置颜色 - CGContextSetRGBStrokeColor(context,[arr[1] floatValue]/255.0, [arr[2] floatValue]/255.0, [arr[3] floatValue]/255.0, [arr[4] floatValue]); - //开始绘制 - CGContextBeginPath(context); - //画笔移动到点(31,170) - - for (int i = 1; i < arr2.count; i++) { - NSArray *temp = arr2[i]; - if ([temp isKindOfClass:[NSArray class]]) { - for (int j = 0; j < temp.count; ++j) { - NSString *tempStr = temp[j]; - NSArray *tempArr = [tempStr componentsSeparatedByString:@","]; - if (j == 0) { - if (tempArr.count != 2) { - NSLog(@"初始点异常"); - //绘制完成 - CGContextStrokePath(context); - return; - } - CGContextMoveToPoint(context, - [tempArr[0] floatValue], [tempArr[1] floatValue]); - }else{ - // NSLog(@"画下一个点(%.2f,%.2f);",[tempArr[0] floatValue],[tempArr[1] floatValue]); - //下一点 - CGContextAddLineToPoint(context, - [tempArr[0] floatValue], [tempArr[1] floatValue]); - } - } - - }else{ - NSLog(@"抛弃不规范的数据..."); - } - } - //绘制完成 - CGContextStrokePath(context); - } -} - -//[[线宽,点size,颜色],[第一条线[第一个点],[第二个点]...],[第二条线]...] -+(void)drawCurves:(NSArray *)lineArr withContext:(CGContextRef)ctx scan:(CGFloat)scan{ - - if (lineArr.count < 2) { - return; - } - - if (scan == 0) { - scan = 1; - } - - - NSArray *peizhiArr = lineArr[0]; - CGFloat lineWidth = 0.0; - CGSize pointSize1; - UIColor *lineColor; - - if ([peizhiArr isKindOfClass:[NSArray class]]) { - //线宽 - if (peizhiArr.count > 0) { - lineWidth = [peizhiArr[0] floatValue]; - }else{ - lineWidth = 1; - } - //点大小 - if (peizhiArr.count > 1) { - pointSize1 = [peizhiArr[1] CGSizeValue]; - }else{ - pointSize1 = CGSizeMake(1, 1); - } - //线颜色 - if (peizhiArr.count > 2) { - lineColor = peizhiArr[2]; - }else{ - lineColor = [UIColor blackColor]; - } - - - }else{ - lineWidth = 1; - pointSize1 = CGSizeMake(1, 1); - lineColor = [UIColor blackColor]; - } - - lineWidth = lineWidth/scan; - pointSize1 = CGSizeMake(pointSize1.width/scan, pointSize1.height/scan); - - for (int i = 1; i < lineArr.count; ++i) { - NSArray *tempLineArr = lineArr[i]; - if ([tempLineArr isKindOfClass:[NSArray class]]) { - - [self drawCurve:tempLineArr context:ctx color:lineColor pointSize:pointSize1 lineWidth:lineWidth]; - - } - } - -} - - - -//画曲线 -+(void)drawCurve:(NSArray *)lineArr2_1 context:(CGContextRef)ctx color:(UIColor *)color pointSize:(CGSize)pointSize lineWidth:(CGFloat)lineWidth{ - //bezier 贝赛尔曲线 - if([lineArr2_1 count]){ - //画线 - UIBezierPath* path = [UIBezierPath bezierPath]; - [path setLineWidth:lineWidth]; - for(int i=0; i<[lineArr2_1 count]-1; i++){ - if([lineArr2_1 xpSafeObjectAtIndex:i] != nil && [lineArr2_1 xpSafeObjectAtIndex:i+1] != nil){ - CGPoint firstPoint = [[lineArr2_1 xpSafeObjectAtIndex:i] CGPointValue]; - CGPoint secondPoint = [[lineArr2_1 xpSafeObjectAtIndex:i+1] CGPointValue]; - [path moveToPoint:firstPoint]; - - // 核心方法ios 如何根据坐标点画曲线 - [path addCurveToPoint:secondPoint controlPoint1:CGPointMake((secondPoint.x-firstPoint.x)/2+firstPoint.x, firstPoint.y) controlPoint2:CGPointMake((secondPoint.x-firstPoint.x)/2+firstPoint.x, secondPoint.y)]; - [color set]; - } - } - path.lineCapStyle = kCGLineCapRound; - [path strokeWithBlendMode:kCGBlendModeNormal alpha:1]; - - //画点 - // for(int i=0; i<[lineArr2_1 count]; i++){ - // CGPoint point = [[lineArr2_1 safeObjectAtIndex1:i] CGPointValue]; - // CGContextFillEllipseInRect(ctx, CGRectMake(point.x-(pointSize.width/2.0), point.y-(pointSize.height/2.0), pointSize.width, pointSize.height)); - // CGContextSetFillColorWithColor(ctx, color.CGColor); - // CGContextFillPath(ctx); - // } - - - } -} - - -/** - * 画折线 - */ --(void)drawlineWithPointsArray:(CGPoint *)points count:(int)count lineWeight:(CGFloat)lineWeight lineColor:(UIColor *)lineColor withPointWeight1:(CGFloat)width pointWeight2:(CGFloat)width2 pointColor1:(UIColor *)color1 pointColor2:(UIColor *)color2{ - - CGContextRef context = UIGraphicsGetCurrentContext(); - [lineColor setStroke]; - CGContextSetLineWidth(context, lineWeight); - - - CGContextAddLines(context, points, count); - CGContextStrokePath(context); - - for (int i = 0; i < count; i ++) { - CGRect ellipseRect = CGRectMake(points[i].x - (width+width2), points[i].y - (width+width2), (width+width2)*2, (width+width2)*2); - CGContextAddEllipseInRect(context, ellipseRect); - CGContextSetLineWidth(context, width); - [color1 setStroke]; - [color2 setFill]; - CGContextFillEllipseInRect(context, ellipseRect); - CGContextStrokeEllipseInRect(context, ellipseRect); - } -} - - -/** - * 画四边形 - */ --(void)draw4Rect:(CGRect)rect withColor:(UIColor *)color1 color2:(UIColor *)color2 withContex:(CGContextRef)ctx{ - // 2.画矩形 - CGContextAddRect(ctx,rect); - CGContextSetLineWidth(ctx,0.5f);//边框宽度 - CGContextSetFillColorWithColor(ctx, color2.CGColor);//填充颜色 - CGContextSetStrokeColorWithColor(ctx, color1.CGColor);//线框颜色 - CGContextAddRect(ctx,rect);//画方框 - CGContextDrawPath(ctx, kCGPathFillStroke);//绘画路径 - CGContextFillPath(ctx);// -} - - - -//[[线宽,线颜色,填充颜色],[第一个多边形[第一个点],[第二个点]...],[第二个多边形]...] -+(void)drawMoreRects:(NSArray *)lineArr withContext:(CGContextRef)ctx scan:(CGFloat)scan{ - - if (lineArr.count < 2) { - return; - } - - if (scan == 0) { - scan = 1; - } - - - NSArray *peizhiArr = lineArr[0]; - CGFloat lineWidth = 0.0; - UIColor *lineColor; - UIColor *fileColor; - - if ([peizhiArr isKindOfClass:[NSArray class]]) { - //线宽 - if (peizhiArr.count > 0) { - lineWidth = [peizhiArr[0] floatValue]; - }else{ - lineWidth = 1; - } - //线颜色 - if (peizhiArr.count > 1) { - lineColor = peizhiArr[1]; - }else{ - lineColor = [UIColor blackColor]; - } - - //填充颜色 - if (peizhiArr.count > 2) { - fileColor = peizhiArr[2]; - }else{ - fileColor = [UIColor redColor]; - } - - - }else{ - lineWidth = 1; - lineColor = [UIColor blackColor]; - fileColor = [UIColor redColor]; - } - - lineWidth = lineWidth/scan; - - for (int i = 1; i < lineArr.count; ++i) { - NSArray *tempLineArr = lineArr[i]; - if ([tempLineArr isKindOfClass:[NSArray class]]) { - [self drawMoreRect:tempLineArr withColor:lineColor color2:fileColor width:lineWidth withContex:ctx]; - - } - } - -} - - -/** - * 画多边形 color1线框颜色 color2填充颜色 width线框宽度 pointArr点数组,里面的格式是cgpoint - */ -+(void)drawMoreRect:(NSArray *)pointArr withColor:(UIColor *)color1 color2:(UIColor *)color2 width:(CGFloat)width withContex:(CGContextRef)context{ - - if (pointArr.count < 3) { - NSLog(@"不规范的多边形图"); - return; - } - - //画一个菱形 - CGContextSetLineWidth(context, width); - CGContextSetFillColorWithColor(context, color2.CGColor);//填充颜色 - CGContextSetStrokeColorWithColor(context, color1.CGColor);//线框颜色 - - CGPoint begainPoint = [pointArr[0] CGPointValue]; - CGContextMoveToPoint(context, begainPoint.x, begainPoint.y); - - for (int i = 1; i < pointArr.count; ++i) { - CGPoint tempPoint = [pointArr[i] CGPointValue]; - CGContextAddLineToPoint(context, tempPoint.x, tempPoint.y); - - } - - CGContextFillPath(context); - -} - - -#pragma mark - 字体类相关 -+(void)drawWord:(NSString *)str size:(CGSize)size centerPoint:(CGPoint)point font:(CGFloat)font color:(UIColor *)color{ - - if (color == nil) { - color = [UIColor blueColor]; - } - - NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; - style.alignment=NSTextAlignmentCenter; - style.lineSpacing=0.1; - - NSMutableDictionary *attr = [NSMutableDictionary dictionaryWithObject:style forKey:NSParagraphStyleAttributeName]; - [attr setValue:color forKey:NSForegroundColorAttributeName]; - [attr setValue:[UIFont systemFontOfSize:font] forKey:NSFontAttributeName];//[UIFont fontWithName:@"Zapfino"size:5.0] - - [str drawInRect:CGRectMake(point.x - size.width/2.0, point.y - size.height/2.0, size.width, size.height) withAttributes:attr]; -} - -@end diff --git a/YuMi/Tools/sdkContent/content/K/BSkObject.h.backup b/YuMi/Tools/sdkContent/content/K/BSkObject.h.backup deleted file mode 100644 index 75d2a32..0000000 --- a/YuMi/Tools/sdkContent/content/K/BSkObject.h.backup +++ /dev/null @@ -1,45 +0,0 @@ -// -// GWkObject.h -// GWTestSDK -// -// Created by xiaowen.chen on 16/9/26. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import -#import -/* - * 阳线:收盘价高于开盘价(红色/空心),阴线:收盘价低于开盘价(黑色/实心) - */ -@interface BSkObject : NSObject - -//开盘价 -@property(nonatomic,assign)CGFloat opening; -//收盘价 -@property(nonatomic,assign)CGFloat closing; -//最高价 -@property(nonatomic,assign)CGFloat highest; -//最低价 -@property(nonatomic,assign)CGFloat lowest; - - - -#pragma mark - 时间类 -@property(nonatomic,assign)NSDate *openingTime; //开盘时间 -@property(nonatomic,assign)NSDate *closingTime; //收盘时间 -@property(nonatomic,assign)NSDate *kTime; //k线时间差 - - -#pragma mark - 获取方法 - -/** - 获取当前是否为阳线 - - @return 是否为阳线 - */ -//-(Boolean)isYangLine; - -// - - -@end diff --git a/YuMi/Tools/sdkContent/content/K/BSkObject.m.backup b/YuMi/Tools/sdkContent/content/K/BSkObject.m.backup deleted file mode 100644 index d6ec8f7..0000000 --- a/YuMi/Tools/sdkContent/content/K/BSkObject.m.backup +++ /dev/null @@ -1,14 +0,0 @@ -// -// GWkObject.m -// GWTestSDK -// -// Created by xiaowen.chen on 16/9/26. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import "BSkObject.h" - - -@implementation BSkObject - -@end diff --git a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/BSNetListenModel.h.backup b/YuMi/Tools/sdkContent/content/NetListen(网络监听)/BSNetListenModel.h.backup deleted file mode 100644 index 1fd9b62..0000000 --- a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/BSNetListenModel.h.backup +++ /dev/null @@ -1,60 +0,0 @@ -// -// NetListenModel.h -// BaseProject -// -// Created by xiaowen.chen on 16/8/12. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import -#import - -@interface BSNetListenModel : NSObject -@property(nonatomic,assign)BOOL isShow; - -+ (instancetype)sharedInstance:(UIWindow *)window; - -//初始化实时监听的view -+(void)initRealTimeView:(UIView *)view; -+(void)initRealTimeView; -//隐藏view -+(void)hideView; - - -//实时打印事件 -+(void)GWPrint:(id)object; - -+(void)GWPrint:(id)object color:(UIColor *)color; - -+(void)GWPrint:(id)object color:(UIColor *)color font:(CGFloat)font; - - - -#pragma mark - 网络类的监听处理 -/* - * url:请求的链接 - * headDic:请求的头文件 - * param:请求的参数 - */ -+(void)addHttpReq:(NSString *)url param:(NSDictionary *)param time:(NSString *)time; -+(void)addHttpReq:(NSString *)url header:(NSDictionary *)headDic param:(NSDictionary *)param time:(NSString *)time; - -+(void)addHttpRsp:(NSString *)url result:(id)result isSuccess:(Boolean)isSuccess time:(NSString *)time; -+(void)addHttpRsp:(NSString *)url header:(NSDictionary *)headDic result:(id)result isSuccess:(Boolean)isSuccess time:(NSString *)time; - - -#pragma mark - 操作记录存储 -/* - * coding:类型编码 - * keyword:关键字,(比如:按钮名) - * describe:描述语,(比如:打开) - * option:操作编码 - */ -+(void)addOptionRecord:(int)coding keyword:(NSString *)keyword describe:(NSString *)describe option:(int)option; - - -#pragma mark - 页面分析 -+(void)pushToLogViewWithNavigationController:(UINavigationController *)na; - - -@end diff --git a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/BSNetListenModel.m.backup b/YuMi/Tools/sdkContent/content/NetListen(网络监听)/BSNetListenModel.m.backup deleted file mode 100644 index 63a7a21..0000000 --- a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/BSNetListenModel.m.backup +++ /dev/null @@ -1,263 +0,0 @@ -// -// NetListenModel.m -// BaseProject -// -// Created by xiaowen.chen on 16/8/12. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import "BSNetListenModel.h" -#import "BSRealTimeView.h" -#import "BSRecordModel.h" - - -#import "BSLogTableViewController.h" - -#import "BSNotification.h" - -static NSString * const gwTeskSdk_version = @"gwTeskSdk_version"; - - - -@interface BSNetListenModel() - -@property (nonatomic, strong) UIWindow *window; -@property (nonatomic, strong) BSRealTimeView *timeView;//监听的view - - - - - -@end - -@implementation BSNetListenModel - - - -+ (instancetype)sharedInstance:(UIWindow *)window { - static BSNetListenModel *instance; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - instance = [[self alloc] init]; - - instance.window = window; - - [self instance]; - - //关闭监听的view; - [BSNotification addHandler:^(NFMessageType type,NSString *key,NSObject *value) { - [instance.timeView setHidden:YES]; - instance.isShow = NO; - } withName:@"netlisten_viewhide"]; - }); - - return instance; -} - -#pragma mark - 初始化相关的数据 - -+(void)instance{ - - - NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; - NSString *result = [userDefaults valueForKey:@"bs_isFirstRunDataBase_gwtestsdk"]; - - - -} - -static NSMutableDictionary *dataDic;//数据 - -+(void)initRealTimeView:(UIView *)view{ - - UIWindow * window = [UIApplication sharedApplication].keyWindow; - BSNetListenModel *netModel = [BSNetListenModel sharedInstance:window]; - if (!netModel.timeView) { - BSRealTimeView *timeView = [[BSRealTimeView alloc] initWithFrame:CGRectMake(20, 300, 200, 160)]; - netModel.timeView = timeView; - }else{ - if (netModel.timeView.subviews) { - [netModel.timeView removeFromSuperview];//父类移除 - } - } - [view addSubview:netModel.timeView]; - [netModel.timeView setHidden:NO]; - -} -+(void)initRealTimeView{ - - UIWindow * window = [UIApplication sharedApplication].keyWindow; - BSNetListenModel *netModel = [BSNetListenModel sharedInstance:window]; - if (!netModel.timeView) { - BSRealTimeView *timeView = [[BSRealTimeView alloc] initWithFrame:CGRectMake(20, 300, 200, 160)]; - netModel.timeView = timeView; - }else{ - if (netModel.timeView.subviews) { - [netModel.timeView removeFromSuperview];//父类移除 - } - } - [netModel.window addSubview:netModel.timeView]; - [netModel.timeView setHidden:NO]; - -} - - -+(void)hideView{ - [BSNotification pushHandle:nil withName:@"netlisten_viewhide"]; - UIWindow * window = [UIApplication sharedApplication].keyWindow; - BSNetListenModel *netModel = [BSNetListenModel sharedInstance:window]; - netModel.isShow = NO; - -} - -#pragma mark - 网络类监听处理 -+(void)addHttpReq:(NSString *)url param:(NSDictionary *)param time:(NSString *)time{ - return [self addHttpReq:url header:nil param:param time:time]; -} -+(void)addHttpReq:(NSString *)url header:(NSDictionary *)headDic param:(NSDictionary *)param time:(NSString *)time{ - - if (time == nil) {//要求有唯一产生规则 - return; - } - - NSMutableDictionary *dic; - if (url == nil) { - url = @"---"; - } - dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:url,@"url",@"netReq",@"handle",time,@"time", nil]; - if (headDic != nil) { - [dic setValue:headDic forKey:@"header"]; - } - if (param != nil) { - [dic setValue:param forKey:@"param"]; - } - - - [BSNotification pushHandle:dic withName:@"gwsdk_print"]; -} -+(void)addHttpRsp:(NSString *)url result:(id)result isSuccess:(Boolean)isSuccess time:(NSString *)time{ - return [self addHttpRsp:url header:nil result:result isSuccess:isSuccess time:time]; -} -+(void)addHttpRsp:(NSString *)url header:(NSDictionary *)headDic result:(id)result isSuccess:(Boolean)isSuccess time:(NSString *)time{ - - if (time == nil) {//要求有唯一产生规则 - return; - } - - NSMutableDictionary *dic; - if (url == nil) { - url = @"---"; - } - dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:url,@"url",@"netRsp",@"handle",time,@"time", nil]; - if (headDic != nil) { - [dic setValue:headDic forKey:@"header"]; - } - if (result != nil) { - [dic setValue:result forKey:@"result"]; - } - if (isSuccess) { - [dic setValue:@"1" forKey:@"isSuccess"]; - }else{ - [dic setValue:@"0" forKey:@"isSuccess"]; - } - [BSNotification pushHandle:dic withName:@"gwsdk_print"]; -} - - - -//实时打印事件 -+(void)GWPrint:(id)object{ - return [self GWPrint:object color:nil font:0]; -} - -+(void)GWPrint:(id)object color:(UIColor *)color{ - return [self GWPrint:object color:color font:0]; -} - -+(void)GWPrint:(id)object color:(UIColor *)color font:(CGFloat)font{ - - NSMutableDictionary *dic; - //字符串 - if ([object isKindOfClass:[NSDictionary class]]||[object isKindOfClass:[NSArray class]]) { - dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"yes",@"isChangeLine",object,@"printData", nil]; - - - }else if([object isKindOfClass:[NSString class]]){ - dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"no",@"isChangeLine",object,@"printData", nil]; - - }else{ - dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"yes",@"isChangeLine",@"不支持该打印模式...",@"printData",@"15",@"font",[UIColor redColor],@"color", nil]; - - } - - if (!dic[@"color"] && color != nil) { - [dic setValue:color forKey:@"color"]; - } - if (!dic[@"font"] && font != 0) { - [dic setValue:[NSString stringWithFormat:@"%.2f",font] forKey:@"font"]; - } - - [BSNotification pushHandle:dic withName:@"gwsdk_print"]; -} - - -static NSMutableArray *recordArr;//内存 -#pragma mark - 操作记录存储 - -+(void)addOptionRecord:(int)coding keyword:(NSString *)keyword describe:(NSString *)describe option:(int)option{ - - - - - BSRecordModel *tempModel = [BSRecordModel recordModelWith:coding keyword:keyword describe:describe option:option]; - [self GWPrint:[tempModel description] color:[UIColor orangeColor] font:7]; - - if (tempModel) { - //记录到内存 - [self writeRecordToCache:tempModel]; - - } - -} - - - -//写入内存 -+(void)writeRecordToCache:(BSRecordModel *)record{ - if (!recordArr) { - recordArr = [NSMutableArray array]; - } - - [recordArr addObject:record]; -} - - - -//内存中获取 -+(NSMutableArray *)getRecordFromCache{ - - if (!recordArr) { - recordArr = [NSMutableArray array]; - } - return recordArr; -} - - - - -#pragma mark - 页面分析 -+(void)pushToLogViewWithNavigationController:(UINavigationController *)na{ - - UIWindow * window = [[UIApplication sharedApplication].windows lastObject]; - BSNetListenModel *netModel = [BSNetListenModel sharedInstance:window]; - if (netModel.timeView != nil) { - [netModel.timeView cancleINtime];//暂停实时监听 - } - BSLogTableViewController *gw = [[BSLogTableViewController alloc] init]; - [na pushViewController:gw animated:YES]; -} - - - - -@end diff --git a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSLogNetDetailViewController.h.backup b/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSLogNetDetailViewController.h.backup deleted file mode 100644 index b5f3e45..0000000 --- a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSLogNetDetailViewController.h.backup +++ /dev/null @@ -1,18 +0,0 @@ -// -// GWLogNetDetailViewController.h -// GWTestSDK -// -// Created by xiaowen.chen on 16/8/31. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import -#import "BSRecordModel.h" - -//网络详情 - -@interface BSLogNetDetailViewController : UIViewController - -@property (nonatomic, strong) BSRecordModel *model; - -@end diff --git a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSLogNetDetailViewController.m.backup b/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSLogNetDetailViewController.m.backup deleted file mode 100644 index 8f54248..0000000 --- a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSLogNetDetailViewController.m.backup +++ /dev/null @@ -1,90 +0,0 @@ -// -// GWLogNetDetailViewController.m -// GWTestSDK -// -// Created by xiaowen.chen on 16/8/31. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import "BSLogNetDetailViewController.h" -#import "BSSDLayoutUtil.h" - -@interface BSLogNetDetailViewController () - -@property (nonatomic, strong) UILabel *urlLabel; - -@property (nonatomic, strong) UILabel *reqTimeLable; -@property (nonatomic, strong) UILabel *rspTimeLable; - -@property (nonatomic, strong) UITextView *reqLabel; -@property (nonatomic, strong) UITextView *rspLabel; - -@end - -@implementation BSLogNetDetailViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - self.view.backgroundColor = [UIColor whiteColor]; - //url - _urlLabel = [[UILabel alloc] init]; - _urlLabel.numberOfLines = 2; - [self.view addSubview:_urlLabel]; - SDLAYOUT_h(_urlLabel, self.view, 20, self.view, -5, self.view, -5, 40); - - //请求时间 - _reqTimeLable = [[UILabel alloc] init]; - [self.view addSubview:_reqTimeLable]; - SDLAYOUT_h(_reqTimeLable, _urlLabel, 42, self.view, -5, self.view, -5, 22); - - //返回时间 - _rspTimeLable = [[UILabel alloc] init]; - [self.view addSubview:_rspTimeLable]; - SDLAYOUT_h(_rspTimeLable, _reqTimeLable, 25, self.view, -5, self.view, -5, 22); - - - //请求 - _reqLabel = [[UITextView alloc] init]; - _reqLabel.editable = NO; - _reqLabel.textColor = [UIColor grayColor]; - [self.view addSubview:_reqLabel]; - SDLAYOUT_h(_reqLabel, _rspTimeLable, 25, self.view, -5, self.view, -5, 150); - - - //返回 - _rspLabel = [[UITextView alloc] init]; - _rspLabel.editable = NO; - [self.view addSubview:_rspLabel]; - SDLAYOUT(_rspLabel, _reqLabel, 152, self.view, 5, self.view, -5, self.view,-5); - - - - - [self initData]; -} - --(void)initData{ - - _urlLabel.text = _model.keyword; - _reqTimeLable.text = [NSString stringWithFormat:@"请求时间:%@",_model.time]; - _rspTimeLable.text = [NSString stringWithFormat:@"响应时间:%@",_model.time2]; - _reqLabel.text = [NSString stringWithFormat:@"请求头:%@\n请求参数:%@",_model.describe,_model.result]; - _rspLabel.text = [NSString stringWithFormat:@"结果头:%@\n结果:%@",_model.describe2,_model.result2]; -} - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - -/* -#pragma mark - Navigation - -// In a storyboard-based application, you will often want to do a little preparation before navigation -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - // Get the new view controller using [segue destinationViewController]. - // Pass the selected object to the new view controller. -} -*/ - -@end diff --git a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSLogTableViewController.h.backup b/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSLogTableViewController.h.backup deleted file mode 100644 index b8de915..0000000 --- a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSLogTableViewController.h.backup +++ /dev/null @@ -1,13 +0,0 @@ -// -// LogTableViewController.h -// BaseProject -// -// Created by xiaowen.chen on 16/8/24. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import - -@interface BSLogTableViewController : UIViewController - -@end diff --git a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSLogTableViewController.m.backup b/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSLogTableViewController.m.backup deleted file mode 100644 index f9eb8bb..0000000 --- a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSLogTableViewController.m.backup +++ /dev/null @@ -1,260 +0,0 @@ -// -// LogTableViewController.m -// BaseProject -// -// Created by xiaowen.chen on 16/8/24. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import "BSLogTableViewController.h" -#import "BSRecordModel.h" -#import "BSLogNetDetailViewController.h" - -#import "Masonry.h" -#import "BSNSStringUtil.h" -#import "BS_UIColor.h" -#import "BSXWDateUtil.h" - -@interface BSLogTableViewController () - -@property (nonatomic, strong) UITableView *tableView; - -@property (nonatomic, strong) NSMutableArray *arr; - -@end - -@implementation BSLogTableViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - [self createMyView]; -} - --(void)createMyView{ - self.title = @"历史记录30条"; - self.view.backgroundColor = [UIColor whiteColor]; - _tableView = [[UITableView alloc] init]; - [self.view addSubview:_tableView]; - _tableView.dataSource = self; - _tableView.delegate = self; - - - [_tableView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.view); - make.leading.equalTo(self.view); - make.trailing.equalTo(self.view); - make.bottom.equalTo(self.view); - }]; - - - -// NSLog(@"获取数据1"); - //模拟数据 - _arr = [NSMutableArray array]; - - - - - //右上角菜单 - UIBarButtonItem *rightBarButton = [[UIBarButtonItem alloc] initWithTitle:@"清空" style:UIBarButtonItemStylePlain target:self action:@selector(rightBarButtonItem:) ] ; - [rightBarButton setTintColor:[UIColor blueColor]]; - self.navigationItem.rightBarButtonItem = rightBarButton; - - -} - -//保存txt --(void)rightBarButtonItem:(UIBarButtonItem *)btnItem{ - - //保存 -// btnItem.enabled = NO; -// [GWFileOptionModel writeToFile_RecordModel:_arr stringForMatBlock:^NSString *(NSString *forMatString) { -// return @"类型编码:[coding] 链接:[keyword] 请求时间:[time] 返回时间:[time2] 关键字:[keyword] 请求:[result] 结果:[result2] 操作编码:[optionCoding]\n\n "; -// } withCompletion:nil class:[BSRecordModel class]]; - -#pragma clang diagnostic push -#pragma clang diagnostic ignored"-Wdeprecated-declarations" - //写在这个中间的代码,都不会被编译器提示-Wdeprecated-declarations类型的警告 - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"是否清空历史记录?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil]; - [alert show]; - -#pragma clang diagnostic pop - -} - -#pragma mark - alertView的代理方法 -#pragma clang diagnostic push -#pragma clang diagnostic ignored"-Wdeprecated-declarations" --(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ - if (buttonIndex == 1) { - //删除所有 - self.navigationItem.rightBarButtonItem.enabled = NO; - BSRecordModel *tempModel = [[BSRecordModel alloc] init]; - - - [_arr removeAllObjects]; - [_tableView reloadData]; - } -} -#pragma clang diagnostic pop - -#pragma mark - 数据源方法 -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - BSRecordModel *model = _arr[section]; - if (model.coding == 200) { - return 1; - }else{ - return 1; - } - -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - - static NSString *indentifiner = @"gwlog_table_cell"; - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:indentifiner]; - if(cell == nil) - { - NSLog(@"创建cell1~~"); - cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:indentifiner] ; - cell.textLabel.numberOfLines = 2; - } - - // 设置 Cell... - BSRecordModel *model = _arr[indexPath.section]; - if (model.coding == 200) { - if (indexPath.row == 0) { - cell.textLabel.lineBreakMode = NSLineBreakByTruncatingMiddle; - cell.textLabel.text = model.keyword; - - }else if (indexPath.row == 1){ - cell.textLabel.lineBreakMode = NSLineBreakByTruncatingTail; - cell.textLabel.text = [BSNSStringUtil clearStr:model.result]; - }else{ - cell.textLabel.lineBreakMode = NSLineBreakByTruncatingTail; - cell.textLabel.text = [BSNSStringUtil clearStr:model.result2]; - } - - }else{ - cell.textLabel.lineBreakMode = NSLineBreakByTruncatingTail; - cell.textLabel.text = model.result; - } - - return cell; -} --(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ - if (indexPath == 0) { - return 45; - }else{ - return 40; - } -} - - - - -#pragma mark - tableView分区设定 --(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ - //分区数 - return _arr.count; -} --(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ - //分区高度 - return 30; -} - - --(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ - - BSRecordModel *model = _arr[section]; - - static NSString *identy = @"headhead"; - UITableViewHeaderFooterView * hf = [tableView dequeueReusableHeaderFooterViewWithIdentifier:identy]; - if (!hf) { - - NSLog(@"创建分区头~~"); - hf = [[UITableViewHeaderFooterView alloc]initWithReuseIdentifier:identy]; - UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 40)]; - view.backgroundColor = [BS_UIColor stringTOColor:@"#ecffff"]; - - UILabel *la = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, view.frame.size.width-40, 40)]; - [view addSubview:la]; - - - NSString *option = @"未知"; - if (model.optionCoding == -1) { - option = @"正在请求"; - }else if (model.optionCoding == 0) { - option = @"请求失败"; - }else if (model.optionCoding == 1) { - option = @"请求成功"; - } - NSMutableAttributedString *att = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"[%@],S:%d,R:%@",model.onlySign,model.coding,option]]; - - if (model.time2.length > 8 && model.time.length > 8) { - NSTimeInterval time = [BSXWDateUtil TimeDifferenceWithTime1:model.time2 AndTime2:model.time formet:nil]; - - UIColor *color = [UIColor blackColor]; - if (time > 30) { - color = [UIColor redColor]; - }else if(time > 15){ - color = [UIColor yellowColor]; - } - - [att appendAttributedString:[BSNSStringUtil getAttributedString:[NSString stringWithFormat:@",T:%.1fS",time] color:color font:14 lineSpa:5]]; - } - la.attributedText = att; - - la.font = [UIFont systemFontOfSize:10]; - - - UIButton *detailBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - detailBtn.tag = section; - [view addSubview:detailBtn]; - - [detailBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(40); - make.height.mas_equalTo(30); - make.bottom.equalTo(view).offset(-2); - make.trailing.equalTo(view).offset(-8); - }]; - - - [detailBtn setTitle:@"详细" forState:UIControlStateNormal]; - [detailBtn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal]; - [detailBtn addTarget:self action:@selector(onclicBtn:) forControlEvents:UIControlEventTouchUpInside]; - - - - [hf addSubview:view]; - } - return hf; - -} - - --(void)onclicBtn:(UIButton *)btn{ - BSRecordModel *model = _arr[btn.tag]; - BSLogNetDetailViewController *tempView = [[BSLogNetDetailViewController alloc] init]; - tempView.model = model; - [self.navigationController pushViewController:tempView animated:YES]; - -} - - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - -/* -#pragma mark - Navigation - -// In a storyboard-based application, you will often want to do a little preparation before navigation -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - // Get the new view controller using [segue destinationViewController]. - // Pass the selected object to the new view controller. -} -*/ - -@end diff --git a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSRealTextView.h.backup b/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSRealTextView.h.backup deleted file mode 100644 index 003ec0d..0000000 --- a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSRealTextView.h.backup +++ /dev/null @@ -1,19 +0,0 @@ -// -// BSRealTextView.h -// TextSdk -// -// Created by xiaowen on 2017/9/22. -// Copyright © 2017年 gatawang.com. All rights reserved. -// - -#import -#import "RealViewCellModel.h" - -@interface BSRealTextView : UIView -@property (nonatomic,strong)RealViewCellModel *tempModel; -@property(nonatomic,strong)NSString *guid; -@property(nonatomic,strong)NSString *number; - -//初始化数据 --(void)initData; -@end diff --git a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSRealTextView.m.backup b/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSRealTextView.m.backup deleted file mode 100644 index 1e91c11..0000000 --- a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSRealTextView.m.backup +++ /dev/null @@ -1,154 +0,0 @@ -// -// BSRealTextView.m -// TextSdk -// -// Created by xiaowen on 2017/9/22. -// Copyright © 2017年 gatawang.com. All rights reserved. -// - -#import "BSRealTextView.h" -#import "BSRecordModel.h" -#import "Masonry.h" -#import "BSSDLayoutUtil.h" -#import "BSNSStringUtil.h" - -@interface BSRealTextView() - -@property (nonatomic, strong) UITextView *dataLabel;//显示的内容 -@property (nonatomic, strong) NSMutableAttributedString *resultAttiText; -@property (nonatomic, strong) UIButton *option_close;//关闭 -@property (nonatomic, strong) UIButton *option_copy;//拷贝 -@property (nonatomic, strong) UILabel *numbLable;//数字 -@end - -@implementation BSRealTextView - - --(instancetype)init{ - - self = [super init]; - if (self) { - [self initView]; - } - - return self; -} - --(void)initView{ - - - _option_close = [UIButton buttonWithType:UIButtonTypeCustom]; - [_option_close setTitle:@" x " forState:UIControlStateNormal]; - [_option_close addTarget:self action:@selector(onclick:) forControlEvents:UIControlEventTouchUpInside]; - [self addSubview:_option_close]; - _option_close.backgroundColor = [UIColor greenColor]; - SDLAYOUT_wh2(_option_close, self, 0, self, 0, 40, 30) - - _option_copy = [UIButton buttonWithType:UIButtonTypeCustom]; - [_option_copy setTitle:@"copy" forState:UIControlStateNormal]; - [_option_copy addTarget:self action:@selector(onclickCopy:) forControlEvents:UIControlEventTouchUpInside]; - [_option_copy setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; - [self addSubview:_option_copy]; - [_option_copy mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_offset(0); - make.width.mas_offset(40); - make.height.mas_offset(30); - make.trailing.mas_offset(-55); - }]; - - _numbLable = [[UILabel alloc] init]; - [self addSubview:_numbLable]; - [_numbLable mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_offset(0); - make.width.mas_offset(50); - make.height.mas_offset(30); - make.leading.mas_offset(10); - }]; - _numbLable.textColor = [UIColor blackColor]; - _numbLable.textAlignment = NSTextAlignmentCenter; - - _dataLabel = [[UITextView alloc] init]; - _dataLabel.editable = NO; - [self addSubview:_dataLabel]; - [_dataLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_offset(30); - make.leading.mas_offset(4); - make.bottom.mas_offset(-4); - make.trailing.mas_offset(-4); - }]; - _dataLabel.backgroundColor = [UIColor whiteColor]; - - - -} - -#pragma mark - 关闭的方法 --(void)onclick:(UIButton *)btn{ - if (self.subviews) { - [self removeFromSuperview]; - } -} - -#pragma mark - 拷贝的方法 --(void)onclickCopy:(UIButton *)btn{ - - UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; - pasteboard.string = _dataLabel.attributedText.string; - [_option_copy setTitleColor:[UIColor blueColor] forState:UIControlStateNormal]; - -} - - --(void)initData{ - - _resultAttiText = [[NSMutableAttributedString alloc] init]; - _resultAttiText = [[NSMutableAttributedString alloc] init]; - - [_resultAttiText appendAttributedString:[self getAttributedString:[NSString stringWithFormat:@"请求时间:%@",self.tempModel.time1]]]; - [_resultAttiText appendAttributedString:[self getAttributedString:[NSString stringWithFormat:@"\n响应时间:%@",self.tempModel.time2]]]; - [_resultAttiText appendAttributedString:[self getAttributedString:@"\n请求链接:"]]; - [_resultAttiText appendAttributedString:[self getAttributedString:self.tempModel.url color:[UIColor blueColor]]]; - - [_resultAttiText appendAttributedString:[self getAttributedString:@"\n请求header:\n"]]; - NSString *headStr = [NSString stringWithFormat:@"%@\n",[BSNSStringUtil getStringFromObj:self.tempModel.header]]; - [_resultAttiText appendAttributedString:[self getAttributedString:headStr color:[UIColor grayColor] font:12 lineSpa:3]]; - - [_resultAttiText appendAttributedString:[self getAttributedString:@"请求参数:\n"]]; - NSString *paramStr = [NSString stringWithFormat:@"%@\n",[BSNSStringUtil getStringFromObj:self.tempModel.param]]; - [_resultAttiText appendAttributedString:[self getAttributedString:paramStr color:[UIColor redColor] font:12 lineSpa:3]]; - - - [_resultAttiText appendAttributedString:[self getAttributedString:@"返回header:\n"]]; - NSString *headStr2 = [NSString stringWithFormat:@"%@\n",[BSNSStringUtil getStringFromObj:self.tempModel.backHeader]]; - [_resultAttiText appendAttributedString:[self getAttributedString:headStr2 color:[UIColor grayColor] font:12 lineSpa:3]]; - [_resultAttiText appendAttributedString:[self getAttributedString:@"结果:\n"]]; - UIColor *color = [UIColor redColor]; - NSString *resultStr = [NSString stringWithFormat:@"%@\n",[BSNSStringUtil getStringFromObj:self.tempModel.result]]; - [_resultAttiText appendAttributedString:[self getAttributedString:resultStr color:color font:12 lineSpa:3]]; - - _dataLabel.attributedText = _resultAttiText; - _numbLable.text = _number; -} - --(NSAttributedString *)getAttributedString:(NSString *)str{ - return [self getAttributedString:str color:nil font:0 lineSpa:0]; -} - --(NSAttributedString *)getAttributedString:(NSString *)str color:(UIColor *)color{ - return [self getAttributedString:str color:color font:0 lineSpa:0]; -} - -//根据字体,颜色,返回富文本 --(NSAttributedString *)getAttributedString:(NSString *)str color:(UIColor *)color font:(CGFloat)font lineSpa:(CGFloat)lineSpac{ - return [BSNSStringUtil getAttributedString:str color:color font:font lineSpa:lineSpac]; -} - -/* -// Only override drawRect: if you perform custom drawing. -// An empty implementation adversely affects performance during animation. -- (void)drawRect:(CGRect)rect { - // Drawing code -} -*/ - -@end diff --git a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSRealTimeView.h.backup b/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSRealTimeView.h.backup deleted file mode 100644 index 4eddabf..0000000 --- a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSRealTimeView.h.backup +++ /dev/null @@ -1,20 +0,0 @@ -// -// RealTimeView.h -// BaseProject -// -// Created by xiaowen.chen on 16/8/12. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import - - -@interface BSRealTimeView : UIView - - -//取消实时监听 --(void)cancleINtime; - - - -@end diff --git a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSRealTimeView.m.backup b/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSRealTimeView.m.backup deleted file mode 100644 index 6099bac..0000000 --- a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/BSRealTimeView.m.backup +++ /dev/null @@ -1,613 +0,0 @@ -// -// RealTimeView.m -// BaseProject -// -// Created by xiaowen.chen on 16/8/12. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import "BSRealTimeView.h" -#import "BSSelectView.h" -#import "BSRecordModel.h" -#import "BSDrawLine.h" -#import -#import "RealViewNetWorkCell_0.h" -#import "BSRealTextView.h" -#import "BSNotification.h" -#import "BS_UIColor.h" -#import "BSSDLayoutUtil.h" - -@interface BSRealTimeView() - -@property (nonatomic, assign) Boolean isCanMove; -@property (nonatomic, strong) UIView *topView; -@property (nonatomic, strong) UITableView *tableView; -@property(nonatomic,strong)NSMutableArray *dataArr; - -@property (nonatomic, assign) int model; -@property (nonatomic, assign) CGFloat sc_width; -@property (nonatomic, assign) CGFloat sc_height; -@property (nonatomic, assign) CGRect self_rect; - - -//@property (nonatomic, strong) UITextView *dataLabel; -//@property (nonatomic, strong) NSMutableAttributedString *resultAttiText; - - -//窗口操作按钮' -@property (nonatomic, strong) UIButton *option; -@property (nonatomic, strong) UIButton *option_clear; -@property (nonatomic, strong) BSSelectView *option_intime; - - -@property (nonatomic, strong) UILabel *opLable; -@property (nonatomic, assign) Boolean isMin; - -@end - -@implementation BSRealTimeView - --(instancetype)initWithFrame:(CGRect)frame{ - self = [super initWithFrame:frame]; - - [self createMyView]; - - //添加监听 todo - [BSNotification addHandler:^(NFMessageType type,NSString *key,NSObject *value) { - - NSDictionary *handleDic = (NSDictionary *)value; - dispatch_async(dispatch_get_main_queue(), ^{ - - NSString *stateStr = handleDic[@"handle"]; - if (stateStr) { - if ([stateStr isEqualToString:@"netReq"]) { - //网络请求类的监听-请求 - [self printReq:handleDic[@"url"] header:handleDic[@"header"] param:handleDic[@"param"] time:handleDic[@"time"]];//发出网络请求 - - }else if([stateStr isEqualToString:@"netRsp"]){ - //网络请求类的监听-返回 - [self printRsp:handleDic[@"url"] header:handleDic[@"header"] result:handleDic[@"result"] isSuccess:handleDic[@"isSuccess"] time:handleDic[@"time"]]; - - }else{ - [self print:@"不支持该打印模式..." isChangeLine:YES colors:[UIColor yellowColor] font:0]; - } - return; - } - [self printDictionary:handleDic]; - - }); - - - } withName:@"gwsdk_print"]; - - - return self; -} - --(void)createMyView{ - - _isMin = NO; - _model = 0;//移动模式 - _sc_width = [[UIScreen mainScreen] bounds].size.width; - _sc_height = [[UIScreen mainScreen] bounds].size.height; -// _resultAttiText = [[NSMutableAttributedString alloc] init]; - self.clipsToBounds = YES; - self.backgroundColor = [UIColor grayColor]; - - - - - _option = [UIButton buttonWithType:UIButtonTypeCustom]; - [_option setTitle:@" x " forState:UIControlStateNormal]; - [_option addTarget:self action:@selector(onclick:) forControlEvents:UIControlEventTouchUpInside]; - [self addSubview:_option]; - _option.backgroundColor = [UIColor greenColor]; - SDLAYOUT_wh1(_option, self, 0, self, 0, 40, 30) - - //双击事件 - UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(clickClose:)]; - //设置点击次数 - tap.numberOfTapsRequired = 2;//主要 - //将这个手势添加到图片上 - [_option addGestureRecognizer:tap]; - - - - - - _dataArr = [NSMutableArray array]; -// for (int i = 0; i < 5; i++) { -// RealViewCellModel *modle = [[RealViewCellModel alloc] init]; -// [_dataArr addObject:modle]; -// } - -// _dataLabel = [[UITextView alloc] init]; -// _dataLabel.editable = NO; -// [self addSubview:_dataLabel]; -// SDLAYOUT(_dataLabel, self, 30, self, 2, self, -2, self, -30) - - _tableView = [[UITableView alloc] init]; - [self addSubview:_tableView]; - _tableView.dataSource = self; - _tableView.delegate = self; - [_tableView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_offset(30); - make.leading.mas_offset(1); - make.bottom.mas_offset(-30); - make.trailing.mas_offset(-1); - }]; - self.tableView.separatorStyle = NO; - self.tableView.backgroundColor = [BS_UIColor stringTOColor:@"#f4f4f4"]; - - - - - - _opLable = [[UILabel alloc] init]; - _opLable.text = @""; - [self addSubview:_opLable]; - SDLAYOUT_wh1(_opLable, _option, 5, self, 5, 50, 20) - - - - _option_intime = [[BSSelectView alloc]init]; - _option_intime.button.tag = 1001; - _option_intime.label.textColor = [UIColor whiteColor]; - [self addSubview:_option_intime]; - [_option_intime setTitle:@"实时" detail:@"" sender:self selector:@selector(buttonDidSelect:)]; - [_option_intime.button setSelected:YES]; - - SDLAYOUT_wh1(_option_intime, _option, 55, self, 10, 50, 20) - - - - _option_clear = [UIButton buttonWithType:UIButtonTypeCustom]; - [_option_clear setTitle:@"清空" forState:UIControlStateNormal]; - [_option_clear addTarget:self action:@selector(onclick:) forControlEvents:UIControlEventTouchUpInside]; - [self addSubview:_option_clear]; - - SDLAYOUT_wh3(_option_clear, self, 5, self, -5, 50, 20) - - - //把view放在最上面 - [self bringSubviewToFront:_option]; -} - - -#pragma mark - 输出数据 --(void)print:(NSString *)str isChangeLine:(Boolean)isChange colors:(UIColor*)color font:(CGFloat)font{ - - - if (![self isNeedToPrintWithType:@"print"]) { - return; - } - - if (isChange) { - str = [NSString stringWithFormat:@"%@\n",str]; - } - if (font == 0) { - font = 15; - } - if (color == nil) { - color = [UIColor blackColor]; - } - - NSLog(@"暂无实现"); - -// [_resultAttiText appendAttributedString:[self getAttributedString:str color:color font:font lineSpa:8]]; -// [self printToLable:[_resultAttiText copy]]; - - -} - - - -#pragma mark - 特定格式的数据 - --(void)printReq:(NSString *)url header:(NSDictionary *)headDic param:(NSDictionary *)param time:(NSString *)time{ - - if (![self isNeedToPrintWithType:@"req"]) { - return; - } - - if (!url) { - url = @"---"; - } - - RealViewCellModel *modle = [[RealViewCellModel alloc] init]; - modle.UI_centerStr = @"请求..."; - modle.guid = time; - modle.header = headDic; - modle.time1 = time; - modle.param = param; - modle.UI_rightStr = url; - [_dataArr addObject:modle]; - [_tableView reloadData]; - -} - --(void)printRsp:(NSString *)url header:(NSDictionary *)headDic result:(id)result isSuccess:(NSString *)isSuccess time:(NSString *)time{ - -// if (![self isNeedToPrintWithType:@"rsp"]) { -// return; -// } - - for (RealViewCellModel *tempModel in _dataArr) { - if ([tempModel.UI_rightStr isEqualToString:url]) { - tempModel.result = result; - tempModel.url = url; - tempModel.backHeader = headDic; - tempModel.time2 = time; - tempModel.isSuccess = [isSuccess isEqualToString:@"1"]; - tempModel.UI_centerStr = isSuccess; - [_tableView reloadData]; - break; - } - } - - -} - - -//判断是否需要打印 --(Boolean)isNeedToPrintWithType:(NSString *)type{ - - if (!_option_intime.button.isSelected) { - return NO; - } - - //print,req,rsp//根据配置决定是否打印 - - return YES; -} - -#pragma mark - 外部调用的方法 - --(void)cancleINtime{ - [_option_intime.button setSelected:NO]; -} - - - -#pragma mark - 富文本处理 - -+(void)printRsp:(NSString *)url header:(NSDictionary *)headDic result:(NSDictionary *)result{ - -} - - - --(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ - if (!_isCanMove) { - return; - } - - if (_model == 0 || _model == 1) { - } -} - - - -#pragma mark - 外部启用事件 --(void)printDictionary:(NSDictionary *)dic{ - if ([dic isKindOfClass:[NSDictionary class]]) { - - id object = dic[@"printData"]; - Boolean isChange = [dic[@"isChangeLine"] isEqualToString:@"yes"] ? YES : NO; - CGFloat font = 0; - UIColor *color = nil; - if (!dic[@"font"]) { - font = [dic[@"font"] floatValue]; - } - - if ([dic[@"color"] isKindOfClass:[UIColor class]]) { - color = dic[@"color"]; - } - - if (object) { - if ([object isKindOfClass:[NSDictionary class]]) { - NSString *tempStr = [NSString stringWithFormat:@"%@",object]; - [self print:tempStr isChangeLine:isChange colors:color font:font]; - }else if([object isKindOfClass:[NSString class]]){ - [self print:object isChangeLine:isChange colors:color font:font]; - }else if([object isKindOfClass:[NSArray class]]){ - NSString *tempStr = [NSString stringWithFormat:@"%@",object]; - [self print:tempStr isChangeLine:isChange colors:color font:font]; - } - - } - } -} - - -#pragma mark - 点击事件 --(void)buttonDidSelect:(UIButton *)btn{ - if(btn.tag == 1001){ - if (_option_intime.button.selected) { - [_option_intime.button setSelected:NO]; - }else{ - [_option_intime.button setSelected:YES]; - } - } -} - - -//点击事件 --(void)onclick:(UIButton *)btn{ - - if (btn == _option_clear) { - -// _resultAttiText = [[NSMutableAttributedString alloc] init]; -// _dataLabel.attributedText = [_resultAttiText copy]; - [_dataArr removeAllObjects]; - [_tableView reloadData]; - - return; - } - - - if (_isMin) { - _isMin = NO; - [self onclick_min_end:btn]; - }else{ - _isMin = YES; - [self onclick_min:btn]; - } - -} - -//关闭事件 --(void)clickClose:(UITapGestureRecognizer *)tap{ - [BSNotification pushHandle:nil withName:@"netlisten_viewhide"]; - [[NSNotificationCenter defaultCenter]postNotificationName:@"netlisten_viewhide1" object:nil userInfo:nil]; - - //退出实时模式 - [_option_intime.button setSelected:NO]; -} - - - - --(void)onclick_min:(UIButton *)btn{ - - - _self_rect = self.frame;//记录最小化前的坐标 - [_option_clear setHidden:YES]; - - CGRect endRect = CGRectMake(_self_rect.origin.x, _self_rect.origin.y, _option.frame.size.width, _option.frame.size.height); - - [UIView animateWithDuration:0.2 animations:^{ - self.frame = endRect; - } completion:^(BOOL finished) { - self.frame = endRect; - - [_option_clear setHidden:NO]; - - - }]; - - -} - --(void)onclick_min_end:(UIButton *)btn{ - - [UIView animateWithDuration:0.2 animations:^{ - self.frame = _self_rect; - } completion:^(BOOL finished) { - self.frame = _self_rect; - - }]; - -} - - - - - -#pragma clang diagnostic push -#pragma clang diagnostic ignored"-Wdeprecated-declarations" - --(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ - - if (buttonIndex == 1) { - [BSNotification pushHandle:nil withName:@"netlisten_viewhide"]; - [[NSNotificationCenter defaultCenter]postNotificationName:@"netlisten_viewhide1" object:nil userInfo:nil]; - //退出实时模式 - [_option_intime.button setSelected:NO]; - - } - -} -#pragma clang diagnostic pop - --(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ - - UITouch *touch = [touches anyObject]; - CGPoint currentP = [touch locationInView:self]; -// NSLog(@"当前点击的位置:(%.2f,%.2f)",currentP.x,currentP.y); - - if (currentP.x > self.frame.size.width - 40 && currentP.y > self.frame.size.height - 40) { - _model = 1; -// NSLog(@"进入缩放状态"); - }else{ - _model = 0; -// NSLog(@"进入移动状态"); - } - -} - - -//(2)触摸移动 -- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { -// if (!_isCanMove) { -// return; -// } - - if (_model == 0) { -// NSLog(@"改变位置"); - //获取终点 - self.userInteractionEnabled = NO; - - UITouch *touch = [touches anyObject]; - - //当前的point - CGPoint currentP = [touch locationInView:self]; - - //以前的point - CGPoint preP = [touch previousLocationInView:self]; - - //x轴偏移的量 - CGFloat offsetX = currentP.x - preP.x; - - //Y轴偏移的量 - CGFloat offsetY = currentP.y - preP.y; - - self.transform = CGAffineTransformTranslate(self.transform, offsetX, offsetY); - - self.userInteractionEnabled = YES; - - }else if(_model == 1){ - - //最大的情况下不给缩放 -// if ([_option_max.titleLabel.text isEqualToString:@"还原"]) { -// return; -// } - - //获取终点 - self.userInteractionEnabled = NO; - - UITouch *touch = [touches anyObject]; - - //当前的point - CGPoint currentP = [touch locationInView:self]; - - //以前的point - CGPoint preP = [touch previousLocationInView:self]; - - //x轴偏移的量 - CGFloat offsetX = currentP.x - preP.x; - - //Y轴偏移的量 - CGFloat offsetY = currentP.y - preP.y; - - //限制条件 - CGFloat tempWidth = self.frame.size.width + offsetX; - CGFloat tempHeight = self.frame.size.height +offsetY; - if (tempWidth < 165 || tempWidth > KScreenWidth || tempHeight < 150 || tempHeight > _sc_height) { - - self.userInteractionEnabled = YES; - return; - } - - - - self.frame = CGRectMake(self.frame.origin.x,self.frame.origin.y,self.frame.size.width + offsetX, self.frame.size.height +offsetY); - - - self.userInteractionEnabled = YES; - - } - - -} - --(void)dealloc{ - - [BSNotification removeHandler:@"gwsdk_print"]; - -} - -#pragma mark - tableView代理方法 --(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ - return _dataArr.count; -} - --(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ - - RealViewCellModel *tempModel = _dataArr[indexPath.row]; - if (tempModel.type == 0) { - return tempModel.rightCellHeight; - } - return 190; -} - --(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ - - RealViewCellModel *tempModel = _dataArr[indexPath.row]; - tempModel.UI_leftStr = [NSString stringWithFormat:@"%d",(int)indexPath.row]; - if (tempModel.type == 0) { - static NSString *identifier = @"RealViewNetWorkCell_0"; - RealViewNetWorkCell_0 *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; - if (!cell) - { - cell = [[RealViewNetWorkCell_0 alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]; - } - cell.model = tempModel; - return cell; - } - - return nil; - -} - --(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath{ - return YES; -} -- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath { - @kWeakify(self) - UITableViewRowAction * deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"置頂" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) { - @kStrongify(self) - if (indexPath.row < self.dataArr.count) { - [self.dataArr xpSafeRemoveObjectAtIndex:indexPath.row]; - [self.tableView reloadData]; - } - }]; - deleteAction.title = @"刪除"; - deleteAction.backgroundColor = [UIColor redColor]; - return @[deleteAction]; -} --(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ - - - RealViewCellModel *tempModel = _dataArr[indexPath.row]; - if (tempModel.type == 0) { - BSRealTextView *textView = [[BSRealTextView alloc] init]; - textView.tempModel = tempModel; - textView.guid = tempModel.guid; - textView.number = tempModel.UI_leftStr; - [textView initData]; - [self addSubview:textView]; - [textView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_offset(30); - make.leading.mas_offset(0); - make.bottom.mas_offset(-30); - make.trailing.mas_offset(0); - }]; - textView.backgroundColor = [BS_UIColor stringTOColor:@"#f4f4f4"]; - } - -} - - - - - - -#pragma mark - 画图部分 --(void)drawRect:(CGRect)rect{ - [super drawRect:rect]; - - if (_isCanMove) { - NSString *point1 = [NSString stringWithFormat:@"%.2f,%.2f",self.frame.size.width - 15,self.frame.size.height]; - NSString *point2 = [NSString stringWithFormat:@"%.2f,%.2f",self.frame.size.width ,self.frame.size.height - 15]; - NSString *point3 = [NSString stringWithFormat:@"%.2f,%.2f",self.frame.size.width - 10,self.frame.size.height]; - NSString *point4 = [NSString stringWithFormat:@"%.2f,%.2f",self.frame.size.width ,self.frame.size.height - 10]; - NSString *point5 = [NSString stringWithFormat:@"%.2f,%.2f",self.frame.size.width - 5,self.frame.size.height]; - NSString *point6 = [NSString stringWithFormat:@"%.2f,%.2f",self.frame.size.width ,self.frame.size.height - 5]; - //放大缩小的线 - [BSDrawLine drawLinePoint:@[@[@"1",@"255",@"255",@"255",@"1"],@[point1,point2],@[point3,point4],@[point5,point6]] withContext:UIGraphicsGetCurrentContext() scan:1]; - } - -} - -@end diff --git a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/model/RealViewCellModel.h.backup b/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/model/RealViewCellModel.h.backup deleted file mode 100644 index 861d22e..0000000 --- a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/model/RealViewCellModel.h.backup +++ /dev/null @@ -1,45 +0,0 @@ -// -// RealViewCellModel.h -// TextSdk -// -// Created by xiaowen on 2017/9/22. -// Copyright © 2017年 gatawang.com. All rights reserved. -// - -#import -#import - -@interface RealViewCellModel : PIBaseModel -@property (nonatomic,assign) BOOL isSuccess; -@property (nonatomic,copy) id result; -@property (nonatomic,copy) NSString *url; -@property (nonatomic,copy) NSDictionary * header; -@property (nonatomic,copy) NSDictionary * backHeader; -@property (nonatomic,copy) NSDictionary * param; - -@property (nonatomic,copy) NSString *time1; -@property (nonatomic,copy) NSString *time2; - - - - - -@property(nonatomic,assign)int type;//0 -@property(nonatomic,strong)NSString *guid; - -@property(nonatomic,strong)NSString *UI_leftStr; -@property(nonatomic,assign)CGFloat leftFont; -@property(nonatomic,strong)UIColor *leftColor; - -@property(nonatomic,strong)NSString *UI_centerStr; -@property(nonatomic,assign)CGFloat centerFont; -@property(nonatomic,strong)UIColor *centerColor; - - -@property(nonatomic,strong)NSString *UI_rightStr; -@property(nonatomic,assign)CGFloat rightFont; -@property(nonatomic,strong)UIColor *rightColor; -@property(nonatomic,assign)CGFloat rightCellHeight;//实际的高度 - - -@end diff --git a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/model/RealViewCellModel.m.backup b/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/model/RealViewCellModel.m.backup deleted file mode 100644 index eb19e5f..0000000 --- a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/model/RealViewCellModel.m.backup +++ /dev/null @@ -1,13 +0,0 @@ -// -// RealViewCellModel.m -// TextSdk -// -// Created by xiaowen on 2017/9/22. -// Copyright © 2017年 gatawang.com. All rights reserved. -// - -#import "RealViewCellModel.h" - -@implementation RealViewCellModel - -@end diff --git a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/view/RealViewNetWorkCell_0.h.backup b/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/view/RealViewNetWorkCell_0.h.backup deleted file mode 100644 index 668f24d..0000000 --- a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/view/RealViewNetWorkCell_0.h.backup +++ /dev/null @@ -1,21 +0,0 @@ -// -// RealViewNetWorkCell_0.h -// TextSdk -// -// Created by xiaowen on 2017/9/22. -// Copyright © 2017年 gatawang.com. All rights reserved. -// - -#import -#import "RealViewCellModel.h" - -@interface RealViewNetWorkCell_0 : UITableViewCell - -@property(nonatomic,strong)RealViewCellModel *model; - -@property(nonatomic,strong)UILabel *leftLable; -@property(nonatomic,strong)UILabel *centerLable; -@property(nonatomic,strong)UILabel *rightLable; - - -@end diff --git a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/view/RealViewNetWorkCell_0.m.backup b/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/view/RealViewNetWorkCell_0.m.backup deleted file mode 100644 index 93bb088..0000000 --- a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/RealTime(实时)/view/RealViewNetWorkCell_0.m.backup +++ /dev/null @@ -1,154 +0,0 @@ -// -// RealViewNetWorkCell_0.m -// TextSdk -// -// Created by xiaowen on 2017/9/22. -// Copyright © 2017年 gatawang.com. All rights reserved. -// - -#import "RealViewNetWorkCell_0.h" -#import "Masonry.h" -#import "BS_UIColor.h" - -@implementation RealViewNetWorkCell_0 - - --(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ - if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { - self.contentView.userInteractionEnabled = YES; - self.selectionStyle = UITableViewCellSelectionStyleNone; - [self initUI]; - } - return self; -} - --(void)initUI{ - - - - - _rightLable = [[UILabel alloc] init]; - [self addSubview:_rightLable]; - [_rightLable mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.equalTo(self); - make.leading.mas_offset(35); - make.trailing.mas_offset(-10); - make.height.mas_offset(35); - }]; - _rightLable.textAlignment = NSTextAlignmentRight; - _rightLable.text = @"openapi/jfidnfdinfdnfd/fdinfidfndf/nfidjfidjfdijf"; - _rightLable.lineBreakMode = NSLineBreakByTruncatingHead; - - _leftLable = [[UILabel alloc] init]; - [self addSubview:_leftLable]; - [_leftLable mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.equalTo(self.contentView); - make.leading.mas_offset(5); - make.width.mas_offset(20); - make.height.mas_offset(20); - }]; - _leftLable.textAlignment = NSTextAlignmentCenter; - _leftLable.layer.cornerRadius = 10; - _leftLable.layer.masksToBounds = YES; - _leftLable.layer.borderWidth = 0.5; - _leftLable.backgroundColor = [UIColor redColor]; -// _leftLable.text = @"100"; - - - _centerLable = [[UILabel alloc] init]; - [self addSubview:_centerLable]; - [_centerLable mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(_rightLable); - make.leading.equalTo(_leftLable.mas_trailing).mas_offset(5); - make.width.mas_offset(0); - make.height.mas_offset(35); - }]; - _centerLable.textAlignment = NSTextAlignmentCenter; -// _centerLable.text = @"请求..."; - - - -} - --(void)setModel:(RealViewCellModel *)model{ - - _model = model; - _leftLable.text = model.UI_leftStr; - if (model.leftFont != 0) { - _leftLable.font = [UIFont systemFontOfSize:model.leftFont] ; - }else{ - _leftLable.font = [UIFont systemFontOfSize:12]; - } - if (model.leftColor != nil) { - _leftLable.textColor = model.leftColor; - _leftLable.layer.borderColor = model.leftColor.CGColor; - }else{ - _leftLable.textColor = [BS_UIColor stringTOColor:@"#181818"]; - _leftLable.layer.borderColor = [BS_UIColor stringTOColor:@"#181818"].CGColor; - } - -// _centerLable.text = model.UI_centerStr; -// //中间的描述 -// if (model.centerFont != 0) { -// _centerLable.font = AUTOADAPFont(model.centerFont]; -// }else{ -// _centerLable.font = AUTOADAPFont(12]; -// } -// if (model.centerColor != nil) { -// _centerLable.textColor = model.centerColor; -// }else{ -// _centerLable.textColor = [BS_UIColor stringTOColor:@"#181818"]; -// } - - //右边的描述 - if ([model.UI_rightStr isKindOfClass:[NSNull class]]) { - model.UI_rightStr = @""; - } - _rightLable.text = model.UI_rightStr; - if (model.rightFont != 0) { - _rightLable.font = [UIFont systemFontOfSize:model.rightFont] ; - }else{ - _rightLable.font = [UIFont systemFontOfSize:12]; - } - if (model.leftColor != nil) { - _rightLable.textColor = model.rightColor; - }else{ - _rightLable.textColor = [BS_UIColor stringTOColor:@"#676767"]; - } - - if ([model.UI_centerStr isEqualToString:@"0"]) { - - UIColor *redCor = [BS_UIColor stringTOColor:@"#ff2d2d"];; - _rightLable.textColor = redCor; - _leftLable.textColor = redCor; - _leftLable.layer.borderColor = redCor.CGColor; - } - - model.rightCellHeight = 40; - - UIView *view = [[UIView alloc] init]; - [self.contentView addSubview:view]; - [view mas_makeConstraints:^(MASConstraintMaker *make) { - make.bottom.mas_offset(-1); - make.leading.mas_offset(5); - make.trailing.mas_offset(-5); - make.height.mas_offset(0.5); - }]; - view.backgroundColor = [BS_UIColor stringTOColor:@"#f0f0f0"]; - -} - - - -- (void)awakeFromNib { - [super awakeFromNib]; - // Initialization code -} - -- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - [super setSelected:selected animated:animated]; - - // Configure the view for the selected state -} - -@end diff --git a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/component(组件)/BSSelectView.h.backup b/YuMi/Tools/sdkContent/content/NetListen(网络监听)/component(组件)/BSSelectView.h.backup deleted file mode 100644 index 6d47d3c..0000000 --- a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/component(组件)/BSSelectView.h.backup +++ /dev/null @@ -1,29 +0,0 @@ -// -// SelectView.h -// lianxi -// -// Created by 陈奕智 on 16/7/7. -// Copyright © 2016年 chenyizhi. All rights reserved. -// - -#import - -@interface BSSelectView : UIView -/** - * 按钮 - */ -@property (nonatomic, strong) UIButton *button; -/** - * 标签 - */ -@property (nonatomic, strong) UILabel *label; - - -/** - * title,detail 显示文字 - * sender,selector 按钮添加点击方法参数 - */ --(void)setTitle:(NSString*)title detail:(NSString*)detail sender:(id)sender selector:(SEL)selector; - - -@end diff --git a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/component(组件)/BSSelectView.m.backup b/YuMi/Tools/sdkContent/content/NetListen(网络监听)/component(组件)/BSSelectView.m.backup deleted file mode 100644 index 1695044..0000000 --- a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/component(组件)/BSSelectView.m.backup +++ /dev/null @@ -1,71 +0,0 @@ -// -// SelectView.m -// lianxi -// -// Created by 陈奕智 on 16/7/7. -// Copyright © 2016年 chenyizhi. All rights reserved. -// - -#import "BSSelectView.h" -#import "Masonry.h" - -static int const FONTSIZE = 14; - - -@implementation BSSelectView - - --(instancetype)init{ - self = [super init]; - if (self) { - - self.button = [[UIButton alloc]init]; - [self addSubview:self.button]; - [self.button setImage:[UIImage imageNamed:@"pay_off"] forState:UIControlStateNormal]; - [self.button setImage:[UIImage imageNamed:@"pay_on"] forState:UIControlStateSelected]; - - - [self.button mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.equalTo(self).offset(0); - make.top.equalTo(self).offset(0); - make.width.mas_equalTo(12); - make.height.mas_equalTo(12); - }]; - - self.label = [[UILabel alloc]init]; - [self addSubview:self.label]; - - [self.label mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.equalTo(self).offset(12); - make.bottom.equalTo(self).offset(-4); - make.width.mas_equalTo(40); - }]; - - - - } - return self; -} - - --(void)setTitle:(NSString *)title detail:(NSString *)detail sender:(id)sender selector:(SEL)selector { - NSInteger len1 = title.length; - NSInteger len2 = detail.length; - NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@%@", title, detail]]; - [attStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:FONTSIZE weight:UIFontWeightBold] range:NSMakeRange(0, len1)]; - [attStr addAttribute:NSFontAttributeName value:[UIFont italicSystemFontOfSize:FONTSIZE-2] range:NSMakeRange(len1, len2)]; - [attStr addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(0, len1)]; - [attStr addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(len1, len2)]; - self.label.attributedText = attStr; - - - [self.button addTarget:sender action:selector forControlEvents:UIControlEventTouchUpInside]; -} - - --(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ - [self.button sendActionsForControlEvents:UIControlEventTouchUpInside]; -} - - -@end diff --git a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/model/BSRecordModel.h.backup b/YuMi/Tools/sdkContent/content/NetListen(网络监听)/model/BSRecordModel.h.backup deleted file mode 100644 index 9117a11..0000000 --- a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/model/BSRecordModel.h.backup +++ /dev/null @@ -1,50 +0,0 @@ -// -// BSRecordModel.h -// GWTestSDK -// -// Created by xiaowen.chen on 16/8/18. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import - - -@interface BSRecordModel : PIBaseModel - -//类型编码 -@property (nonatomic, assign) int coding; - -//关键字 -@property (nonatomic, strong) NSString *keyword; - -//描述 -@property (nonatomic, strong) NSString *describe; - -//描述2 -@property (nonatomic, strong) NSString *describe2; - -//操作编码 -@property (nonatomic, assign) int optionCoding; - -//唯一标示 -@property (nonatomic, strong) NSString *onlySign; - - -//时间 -@property (nonatomic, strong) NSString *time; - -//详细时间 -@property (nonatomic, strong) NSString *time2; - -//结果 -@property (nonatomic, strong) NSString *result; -//结果2 -@property (nonatomic, strong) NSString *result2; - - - -+(BSRecordModel *)recordModelWith:(int)coding keyword:(NSString *)keyword describe:(NSString *)describe option:(int)option; - -+(NSString *)getStringWithDate:(NSDate *)date format:(NSString *)format; - -@end diff --git a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/model/BSRecordModel.m.backup b/YuMi/Tools/sdkContent/content/NetListen(网络监听)/model/BSRecordModel.m.backup deleted file mode 100644 index 3193918..0000000 --- a/YuMi/Tools/sdkContent/content/NetListen(网络监听)/model/BSRecordModel.m.backup +++ /dev/null @@ -1,89 +0,0 @@ -// -// RecordModel.m -// GWTestSDK -// -// Created by xiaowen.chen on 16/8/18. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import "BSRecordModel.h" - -@implementation BSRecordModel -// --(NSDictionary *)getAttribute{ - - return @{ - @"coding":@"INTEGER", - @"keyword":@"TEXT", - @"describe":@"TEXT", - @"describe2":@"TEXT", - @"optionCoding":@"INTEGER", - @"time":@"DATETIME", - @"time2":@"DATETIME", - @"onlySign":@"TEXT", - @"result":@"TEXT", - @"result2":@"TEXT" - }; - -} - - -+(BSRecordModel *)recordModelWith:(int)coding keyword:(NSString *)keyword describe:(NSString *)describe option:(int)option{ - if([keyword rangeOfString:@","].location !=NSNotFound) - { - keyword = @"不合法的keyword"; - } - if([describe rangeOfString:@","].location !=NSNotFound) - { - describe = @"不合法的describe"; - } - - BSRecordModel *recordModel = [[BSRecordModel alloc] init]; - recordModel.coding = coding; - recordModel.keyword = keyword; - recordModel.describe = describe; - recordModel.optionCoding = option; - recordModel.time = [self getStringWithDate:nil format:nil]; - - return recordModel; -} - -+(NSString *)getStringWithDate:(NSDate *)date format:(NSString *)format -{ - if (date == nil) { - date = [NSDate date]; - } - if (format == nil) { - format = @"yyyyMMdd HH:mm:ss.SSS"; - } - NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; - [formatter setDateFormat:format]; - return [formatter stringFromDate:date]; -} - --(NSString *)description{ - return [NSString stringWithFormat:@"%d,[%@],%@,%@,%d\n",_coding,[_time substringWithRange:NSMakeRange(9, 8)],_keyword,_describe,_optionCoding]; -} - - --(id)copy{ - BSRecordModel *resultId = [[BSRecordModel alloc] init]; - resultId.coding = _coding; - resultId.keyword = _keyword; - resultId.describe = _describe; - resultId.describe2 = _describe2; - resultId.optionCoding = _optionCoding; - resultId.onlySign = _onlySign; - resultId.time = _time; - resultId.time2 = _time2; - resultId.result = _result; - resultId.result2 = _result2; - - return resultId; -} - --(void)setValue:(id)value forUndefinedKey:(NSString *)key{ - -} - -@end diff --git a/YuMi/Tools/sdkContent/content/XWNotification(通知)/BSNotification.h.backup b/YuMi/Tools/sdkContent/content/XWNotification(通知)/BSNotification.h.backup deleted file mode 100644 index e5830ed..0000000 --- a/YuMi/Tools/sdkContent/content/XWNotification(通知)/BSNotification.h.backup +++ /dev/null @@ -1,132 +0,0 @@ -// -// XWNotification.h -// BaseProject -// -// Created by xiaowen.chen on 16/7/19. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import - - -enum{ - //简单的消息 - NFMessageType_Simple, - //api消息 - NFMessageType_API, - //主题消息 - NFMessageType_Theme, - //自定义消息 - NFMessageType_Custom - -}typedef NFMessageType; - - -typedef void(^GWHandleOption)(NFMessageType type,NSString *key,NSObject *value); -typedef NSDictionary *(^GWSingleHandleOption)(NSDictionary *handleDic); - -@interface BSNotification : NSObject - - -/** - 添加处理方法,在viewdeload或者viewwillAppear里面添加,object对象的地址h加key确定唯一性 - - @param block 回调方法块 - @param handleName 处理标识名 - @param object 对象实例 - */ -+(void)addHandler:(GWHandleOption)block withName:(NSString *)handleName andObject:(NSObject *)object; - -/** - 移除处理方法,在dealloc或者viewwillDisAppear里面移除,object对象的地址加key确定唯一性 - - @param handleName 处理标识名 - @param object 对象实例 - */ -+(void)removeHandler:(NSString *)handleName andObject:(NSObject *)object; - -/** - 添加处理方法,在viewdeload或者viewwillAppear里面添加,添加重复的name无效 - - @param block 回调方法块 - @param handleName 处理标识名 - */ -+(void)addHandler:(GWHandleOption)block withName:(NSString *)handleName; - - -/** - 移除处理方法,在dealloc或者viewwillDisAppear里面移除 - - @param name 处理标识名 - */ -+(void)removeHandler:(NSString *)name; - - -/** - 推送消息-简化版本 - - @param handleDic 参数字典 - @param handleName 处理标识名 - */ -+(void)pushHandle:(NSDictionary *)handleDic withName:(NSString *)handleName; - -/** - 推送消息-简化版本 - - @param type 消息类型 - @param key key - @param value 结果对象 - @param handleName 处理标识名 - */ -+(void)pushHandle:(NFMessageType)type withKey:(NSString *)key value:(NSObject *)value withName:(NSString *)handleName; - -/** - 获取所有的注册信息,调试的时候用 - - @return 处理标识名数组 - */ -+(NSMutableDictionary *)getHandleDic; - - -#pragma mark - 有返回值的做法,可以用在一个页面向另外一个页面取值,要求是1对1,不然会出异常 -/** - 添加一个唯一的处理方法 - - @param block 回调方法块 - @param handleName 处理标识名 - */ -+(void)addSingleHandler:(GWSingleHandleOption)block withName:(NSString *)handleName; - -/** - 触发唯一的处理方法,并且从唯一的处理方法中获取结果 - - @param handleDic 参数字典 - @param handleName 处理标识名 - @return 结果字典 - */ -+(NSDictionary *)getResultFromSingleHandle:(NSDictionary *)handleDic withName:(NSString *)handleName; - - -#pragma mark - 批量移除的方法 - - -/** - 移除所有 - */ -+(void)removeAllHandle; - -/** - 移除所有不是指定字符串开头的 - - @param str 指定字符串 - */ -+(void)removeHandleNotInclude:(NSString *)str; - -/** - 移除所有指定字符串开头的 - - @param str 指定字符串 - */ -+(void)removeHandleInclude:(NSString *)str; - -@end diff --git a/YuMi/Tools/sdkContent/content/XWNotification(通知)/BSNotification.m.backup b/YuMi/Tools/sdkContent/content/XWNotification(通知)/BSNotification.m.backup deleted file mode 100644 index 0e138f9..0000000 --- a/YuMi/Tools/sdkContent/content/XWNotification(通知)/BSNotification.m.backup +++ /dev/null @@ -1,193 +0,0 @@ - // -// XWNotification.m -// BaseProject -// -// Created by xiaowen.chen on 16/7/19. -// Copyright © 2016年 xw.com. All rights reserved. -// - -#import "BSNotification.h" - -@implementation BSNotification - - -static NSMutableDictionary *bs_handlerDic = nil; -static NSObject *bs_lock_obj = nil; - -static NSString *objectSplit = @"_obj_"; -#pragma mark - 添加处理方法(根据key进行分组,object地址区分不同的实例) -+(void)addHandler:(GWHandleOption)block withName:(NSString *)handleName andObject:(NSObject *)object{ - handleName = [NSString stringWithFormat:@"%@%@%p",handleName,objectSplit,object]; - [self addHandler:block withName:handleName]; -} -#pragma mark - 移除处理方法(根据key进行分组,object地址区分不同的实例) -+(void)removeHandler:(NSString *)handleName andObject:(NSObject *)object{ - handleName = [NSString stringWithFormat:@"%@%@%p",handleName,objectSplit,object]; - [self removeHandler: handleName]; -} - - -#pragma mark - 添加处理方法 -+(void)addHandler:(GWHandleOption)block withName:(NSString *)handleName{ - - [self checkClass]; - @synchronized (bs_lock_obj) { - Boolean ishave = NO; - for (NSString *tempStr in [bs_handlerDic allKeys]) { - if ([tempStr isEqualToString:handleName]) { - ishave = YES; - break; - } - } - if (ishave) { - [bs_handlerDic removeObjectForKey:handleName]; - } - [bs_handlerDic setObject:block forKey:handleName]; - } -} - - - -#pragma mark - 移除处理方法 -+(void)removeHandler:(NSString *)name{ - - [self checkClass]; - @synchronized (bs_lock_obj) { - for (NSString *key in [bs_handlerDic allKeys]) { - if ([key isEqualToString:name]) { - [bs_handlerDic removeObjectForKey:key]; - } - } - } -} - - - -#pragma mark - 推送处理-简化版本 -+(void)pushHandle:(NSDictionary *)handleDic withName:(NSString *)handleName{ - - return [self pushHandle:NFMessageType_Simple withKey:@"BSdefaultKey" value:handleDic withName:handleName]; -} - -#pragma mark - 推送处理 -+(void)pushHandle:(NFMessageType)type withKey:(NSString *)key value:(NSObject *)value withName:(NSString *)handleName{ - [self checkClass]; - - @synchronized (bs_lock_obj) { - for (NSString *temp in [bs_handlerDic allKeys]) { - if ([temp hasPrefix:handleName]) { - GWHandleOption option = (GWHandleOption)[bs_handlerDic objectForKey:temp]; - if (option) { - option(type,key,value); - } - } - } - } -} - -+(NSMutableDictionary *)getHandleDic{ - return bs_handlerDic; -} - -#pragma mark - 有返回值的做法,可以用在一个页面向另外一个页面取值,要求是1对1,不然会出异常 - -/* - * 添加一个唯一的处理方法 - */ -+(void)addSingleHandler:(GWSingleHandleOption)block withName:(NSString *)handleName{ - - [self checkClass]; - - @synchronized (bs_lock_obj) { - Boolean ishave = NO; - for (NSString *tempStr in [bs_handlerDic allKeys]) { - if ([tempStr isEqualToString:handleName]) { - ishave = YES; - break; - } - } - if (ishave) { - [bs_handlerDic removeObjectForKey:handleName]; - } - - [bs_handlerDic setObject:block forKey:handleName]; - } -} -/* - * 触发唯一的处理方法,并且从唯一的处理方法中获取结果 - */ -+(NSDictionary *)getResultFromSingleHandle:(NSDictionary *)handleDic withName:(NSString *)handleName{ - - [self checkClass]; - - @synchronized (bs_lock_obj) { - for (NSString *temp in [bs_handlerDic allKeys]) { - if ([temp isEqualToString:handleName]) { - GWSingleHandleOption option = (GWSingleHandleOption)[bs_handlerDic objectForKey:temp]; - if (option) { - return option(handleDic); - } - } - } - } - return nil; -} - -#pragma mark - 批量移除的方法 -/* - * 移除所有 - */ -+(void)removeAllHandle{ - [self checkClass]; - @synchronized (bs_lock_obj) { - - [bs_handlerDic removeAllObjects]; - } -} -/* - * 移除所有不是指定字符串开头的 - */ -+(void)removeHandleNotInclude:(NSString *)str{ - [self checkClass]; - @synchronized (bs_lock_obj) { - NSMutableArray *resultArr = [NSMutableArray array]; - for (NSString *temp in [bs_handlerDic allKeys]) { - if ([temp hasPrefix:str]) { - [resultArr addObject:temp]; - } - } - for(NSString *temp in resultArr){ - [bs_handlerDic removeObjectForKey:temp]; - } - } -} -/* - * 移除所有指定字符串开头的 - */ -+(void)removeHandleInclude:(NSString *)str{ - [self checkClass]; - @synchronized (bs_lock_obj) { - - NSMutableArray *resultArr = [NSMutableArray array]; - for (NSString *temp in [bs_handlerDic allKeys]) { - if (![temp hasPrefix:str]) { - [resultArr addObject:temp]; - } - } - for(NSString *temp in resultArr){ - [bs_handlerDic removeObjectForKey:temp]; - } - } -} - -+(void)checkClass{ - if (bs_lock_obj == nil) { - bs_lock_obj = [[NSObject alloc] init]; - } - if (bs_handlerDic == nil) { - bs_handlerDic = [NSMutableDictionary dictionary]; - } -} - - -@end diff --git a/YuMi/YuMi-Bridging-Header.h.backup b/YuMi/YuMi-Bridging-Header.h.backup deleted file mode 100644 index c3f114d..0000000 --- a/YuMi/YuMi-Bridging-Header.h.backup +++ /dev/null @@ -1,90 +0,0 @@ -// -// YuMi-Bridging-Header.h -// YuMi -// -// Created by AI on 2025-10-09. -// Copyright © 2025 YuMi. All rights reserved. -// -// Swift/OC 混编桥接头文件 - -#ifndef YuMi_Bridging_Header_h -#define YuMi_Bridging_Header_h - -// MARK: - Minimal Bridging Header -// 只引入 Swift 中真正需要用到的 OC 类 - -// MARK: - Foundation -#import - - - -// MARK: - New Modules (White Label) - -#import "EPMomentViewController.h" -#import "EPMineViewController.h" -#import "EPMomentCell.h" -#import "EPMineHeaderView.h" - - -// MARK: - Emotion Color System -#import "EPEmotionColorStorage.h" -#import "EPSignatureColorGuideView.h" - -// MARK: - QCloud SDK -#import - -// MARK: - Image Upload & Progress HUD -#import "MBProgressHUD.h" - -// MARK: - Base Model & Types -#import "PIBaseModel.h" -#import "YUMINNNN.h" - -// MARK: - API & Models -#import "Api+Moments.h" -#import "Api+Mine.h" -#import "AccountInfoStorage.h" -#import "MomentsInfoModel.h" -#import "MomentsListInfoModel.h" -#import "UserInfoModel.h" -#import "UploadFile.h" -#import "YYUtility.h" -#import "SDWebImage.h" - -// MARK: - API Helpers -#import "EPMineAPIHelper.h" - -// MARK: - Utilities -#import "UIImage+Utils.h" -#import "NSString+Utils.h" -#import "UIView+GradientLayer.h" -#import - -// MARK: - Login - Navigation & Web -#import "BaseNavigationController.h" -#import "BaseViewController.h" - -// MARK: - Login - Utilities -#import "YUMIMacroUitls.h" // YMLocalizedString -#import "YUMIHtmlUrl.h" // URLWithType -#import "YUMIConstant.h" // KeyWithType, KeyType_Sign -#import "DESEncrypt.h" // DES加密工具 -#import "HttpRequestHelper.h" // getHostUrl - -// MARK: - Login - Models (Phase 2 使用,先添加) -#import "AccountInfoStorage.h" -#import "AccountModel.h" - -// MARK: - Login - APIs (Phase 2) -#import "Api+Login.h" -#import "Api+Main.h" - -// MARK: - Login - Captcha & Config -#import "TTPopup.h" - -// 注意: -// 1. EPMomentViewController 和 EPMineViewController 直接继承 UIViewController -// 2. 不继承 BaseViewController(避免 ClientConfig → PIBaseModel 依赖链) -// 3. 其他依赖在各自的 .m 文件中 import - -#endif /* YuMi_Bridging_Header_h */ diff --git a/YuMi/en.lproj/Localizable.strings b/YuMi/en.lproj/Localizable.strings index 04b04c0..4ddfab1 100644 --- a/YuMi/en.lproj/Localizable.strings +++ b/YuMi/en.lproj/Localizable.strings @@ -92,6 +92,26 @@ /* EP Module Keys - Added for English localization */ /* EP Module Keys - Added for English localization */ +"1.0.37_text_26" = "ID Login"; +"XPLoginViewController0" = "One-click login failed. Please check your mobile network status"; +"XPLoginViewController1" = "One-click login"; +"XPLoginViewController2" = "Login with Current Phone Number"; +"XPLoginViewController3" = "Agree to the default and authorize %@ to access the current phone number"; +"XPLoginViewController4" = "Login successful"; +"XPLoginViewController5" = "Phone Number Login"; +"XPLoginViewController6" = "Agree User Service Agreement and Privacy Policy"; +"XPLoginViewController7" = "User Service Agreement"; +"XPLoginViewController8" = " and "; +"XPLoginViewController9" = "Privacy Policy"; +"XPLoginViewController10" = "Other Login Methods"; +"XPLoginViewController11" = "Agree to the Privacy Policy and User Agreement before registering or logging in"; +"XPLoginViewController12" = "Apple Login"; +"XPLoginViewController13" = "Google Login"; +"XPLoginViewController14" = "Facebook Login"; +"XPLoginViewController15" = "Line Login"; +"XPLoginViewController16" = "other login methods"; +"XPLoginViewController17" = "Last Login"; + /* * EP Module - English Localization Keys * 用于替换 EP 模块中所有硬编码中文 diff --git a/YuMi/en.lproj/Localizable.strings.backup b/YuMi/en.lproj/Localizable.strings.backup deleted file mode 100644 index b1305f1..0000000 --- a/YuMi/en.lproj/Localizable.strings.backup +++ /dev/null @@ -1,4200 +0,0 @@ - -"XPWishGiftEmptyTableViewCell0" = "No data"; - -"XPWishGiftTableViewCell0" = "Edit"; -"XPWishGiftTableViewCell1" = "Delete"; - -"XPWishGiftInfoView0" = "%ld Coins"; -"XPWishGiftInfoView1" = "Gift"; - -"XPWishGiftCreateItemViewController0" = "Ordinary Gift"; -"XPWishGiftCreateItemViewController1" = "Intermediate Gift"; -"XPWishGiftCreateItemViewController2" = "Ordinary Gift"; -"XPWishGiftCreateItemViewController3" = "Intermediate Gift"; -"XPWishGiftCreateItemViewController4" = "Ordinary Gift"; -"XPWishGiftCreateItemViewController5" = "Intermediate Gift"; -"XPWishGiftCreateItemViewController6" = "Ordinary Gift"; -"XPWishGiftCreateItemViewController7" = "Intermediate Gift"; -"XPWishGiftCreateItemViewController8" = "The range of gift quantity needs to be %d~%d"; -"XPWishGiftCreateItemViewController9" = "The range of gift quantity needs to be"; - -"XPWishGiftCreateItemViewController11" = "Ordinary Gift"; -"XPWishGiftCreateItemViewController12" = "Intermediate Gift"; -"XPWishGiftCreateItemViewController13" = "Advanced Gift"; - -"XPTaskCompleteTipView0" = "Task Completed"; -"XPTaskCompleteTipView1" = "View Rewards"; - -"XPSessionSayHelloTableViewCell0" = "Chat with TA"; - -"XPSessionSayHelloEmptyTableViewCell0" = "No data"; - -"XPSessionSayHelloHeaderView0" = "Current host rating"; -"XPSessionSayHelloHeaderView1" = "%@ times"; -"XPSessionSayHelloHeaderView2" = "Current greeting traffic"; -"XPSessionSayHelloHeaderView3" = "Say Hello"; - -"NIMMessageMaker0" = "Sent a voice message"; -"NIMMessageMaker1" = "Video sent at"; -"NIMMessageMaker2" = "Sent a video message"; -"NIMMessageMaker3" = "Image sent at"; -"NIMMessageMaker4" = "Sent an image"; -"NIMMessageMaker5" = "You received a quick comment"; - -"NIMMessageUtils0" = "[Voice]"; -"NIMMessageUtils1" = "[Image]"; -"NIMMessageUtils2" = "[Video]"; -"NIMMessageUtils3" = "[Location]"; -"NIMMessageUtils4" = "[File]"; -"NIMMessageUtils5" = "[Gift]"; -"NIMMessageUtils6" = "[You received a guild message]"; -"NIMMessageUtils7" = "[Your follow is online, check it out]"; -"NIMMessageUtils8" = "[Share room]"; -"NIMMessageUtils9" = "[Upgrade message]"; -"NIMMessageUtils10" = "[Tweet message]"; -"NIMMessageUtils11" = "[Message]"; -"NIMMessageUtils12" = "[Shared a post]"; -"NIMMessageUtils13" = "[You received a server-wide red packet]"; -"NIMMessageUtils14" = "[Message]"; -"NIMMessageUtils15" = "[Unknown message]"; - -"XPSessionFindNewTableViewCell0" = "Say Hello"; -"XPSessionFindNewTableViewCell1" = "Say Hello"; - -"XPSessionFindNewEmptyTableViewCell0" = "No data"; - -"XPSessionFindNewFiltrateView0" = "Filter"; -"XPSessionFindNewFiltrateView1" = "User gender"; -"XPSessionFindNewFiltrateView2" = "Male"; -"XPSessionFindNewFiltrateView3" = "Female"; -"XPSessionFindNewFiltrateView4" = "All"; -"XPSessionFindNewFiltrateView5" = "Already greeted?"; -"XPSessionFindNewFiltrateView6" = "Greeted"; -"XPSessionFindNewFiltrateView7" = "Not greeted"; -"XPSessionFindNewFiltrateView8" = "All"; -"XPSessionFindNewFiltrateView9" = "Confirm changes"; - -"XPSessionFindNewGreetListView0" = "Sent successfully"; -"XPSessionFindNewGreetListView1" = "Please select"; -"XPSessionFindNewGreetListView2" = "Change batch"; -"XPSessionFindNewGreetListView3" = "Send"; - -"XPSessionFindNewAlertView0" = "Ignore"; -"XPSessionFindNewAlertView1" = "Go find"; -"XPSessionFindNewAlertView2" = "Go find TA"; - -"XPSessionFindNewViewController0" = "This user has received too many greetings, try another one"; -"XPSessionFindNewViewController1" = "Discover newbies"; -"XPSessionFindNewViewController2" = "Updated daily recommendations"; - -"XPSessionHelloEnterView0" = "%@ people want to get to know you"; -"XPSessionHelloEnterView1" = "Say Hello"; - -"XPSessionListHeadFriendCell0" = "Live"; - - - -"NIMTimeUtils1" = "Yesterday"; -"NIMTimeUtils3" = "The day before yesterday"; -"NIMTimeUtils4" = "Dawn"; -"NIMTimeUtils5" = "Morning"; -"NIMTimeUtils6" = "Afternoon"; -"NIMTimeUtils7" = "Evening"; -"NIMTimeUtils8" = "Sunday"; -"NIMTimeUtils9" = "Monday"; -"NIMTimeUtils10" = "Tuesday"; -"NIMTimeUtils11" = "Wednesday"; -"NIMTimeUtils12" = "Thursday"; -"NIMTimeUtils13" = "Friday"; -"NIMTimeUtils14" = "Saturday"; - -"SessionListViewController0" = "Delete"; -"SessionListViewController1" = "Delete"; -"SessionListViewController2" = "No unread messages to clean up"; -"SessionListViewController3" = "Clear"; -"SessionListViewController4" = "Clear current unread message reminder?"; -"SessionListViewController5" = "Message"; -"SessionListViewController6" = "Pin to top"; -"SessionListViewController7" = "Unpin from top"; - -"SessionInfoViewController0" = "Chat settings"; -"SessionInfoViewController1" = "We have received your request and will process it as soon as possible"; -"SessionInfoViewController2" = "Add to blacklist"; -"SessionInfoViewController3" = "Add to blacklist, you will no longer receive messages from this person"; -"SessionInfoViewController4" = "Remove from blacklist"; -"SessionInfoViewController5" = "Remove from blacklist, you will receive messages from this person normally"; -"SessionInfoViewController6" = "Successfully removed the person from the blacklist"; -"SessionInfoViewController7" = "Successfully added the person to the blacklist"; -"SessionInfoViewController8" = "Pin chat"; -"SessionInfoViewController9" = "Add to blacklist"; -"SessionInfoViewController10" = "Report"; - -"SessionViewController0" = "Loading"; -"SessionViewController1" = "Private chat temporarily unavailable"; -"SessionViewController2" = "Please enter a message"; -"SessionViewController4" = "Kind reminder: The other party is not your friend, please pay attention to privacy and security"; -"SessionViewController6" = "Kind reminder: The other party is not your friend, please pay attention to privacy and security"; -"SessionViewController7" = "Followed successfully"; -"SessionViewController8" = "You have retracted a message"; -"SessionViewController10" = "Camera access restricted, click confirm to go to system settings"; -"SessionViewController12" = "Album access restricted, click confirm to go to system settings"; -"SessionViewController14" = "Album access restricted, click confirm to go to system settings"; -"SessionViewController16" = "Album access restricted, click confirm to go to system settings"; -"SessionViewController17"=" Kind reminder: The current account of the other party is abnormal, please be cautious in dealings!"; -"SessionViewController18"="Kind reminder: The other party is not your friend, please pay attention to privacy and security!"; -"SessionViewController19"="Camera unavailable"; -"SessionViewController20"="Unable to access the album"; -"SessionViewController21"="Album unavailable"; - -"MessageContentApplicationShareView0" = "Enter now"; - -"MessageRevokeModel0" = "You have retracted a message"; - -"MessageMonentsModel0" = "Posted a dynamic"; - -"MessageUnSupportModel0" = "This type of message is not supported at the moment"; - -"MessageRiskAlertModel0" = "《Regulating Online Live Streaming Chaos》"; - -"MessageOpenLiveModel0" = "%@ is online now"; - -"PKIDLoginViewController2" = "Please contact customer service"; -"PKIDLoginViewController3" = "LINE:pekoyuyin"; -"PKIDLoginViewController4" = "I understand"; -"MessageLevelUpgradeModel0" = "Congratulations! Your charm level has reached %@"; -"MessageLevelUpgradeModel1" = "Congratulations! Your level has reached %@"; - -"MessageTweetModel0" = "This is to calculate the height of a line"; - -"MessageContentTweetView0" = "This is to calculate the height of a line"; -"MessageContentTweetView1" = "View now"; - -"MessageContentGuildView0" = "Agreed"; -"MessageContentGuildView1" = "Refused"; -"MessageContentGuildView2" = "Message expired"; -"MessageContentGuildView3" = "Message processed"; -"MessageContentGuildView4" = "Refuse"; -"MessageContentGuildView5" = "Agree"; - -"MessageContentLevelUpgradeView0" = "View now"; - -"MessageContentTextClickable0" = "Please bind your phone number first!"; - -"MessageContentOpenLiveView0" = "%@ is online now"; - -"MessageContentRedPacketView0" = "Red packet has expired"; -"MessageContentRedPacketView1" = "Be quicker next time~"; -"MessageContentRedPacketView2" = "Red packet has been claimed"; -"MessageContentRedPacketView3" = "Can go to the bill to view details"; -"MessageContentRedPacketView4" = "Click to enter the room to claim>"; -"MessageContentRedPacketView5" = "Sent a server-wide red packet"; - -"MessageContentUnSupportView0" = "This type of message is not supported at the moment"; - -"MessageContentText0" = "Unknown message type"; - -"SessionUserInfoTableViewCell0" = "Capricorn Aquarius Pisces Aries Taurus Gemini Cancer Leo Virgo Libra Scorpio Sagittarius Capricorn"; -"SessionUserInfoTableViewCell1" = "Incorrect date format!"; -"SessionUserInfoTableViewCell2" = "Incorrect date format!"; -"SessionUserInfoTableViewCell3" = "Incorrect date format!"; -"SessionUserInfoTableViewCell4" = "%@ sign"; -"SessionUserInfoTableViewCell5" = "This person has not set a signature yet"; - -"MessageCell0" = "Copy"; -"MessageCell1" = "Delete"; -"MessageCell2" = "Retract"; - -"SessionNavView0" = "Follow"; -"SessionNavView1" = "Already added to blacklist"; - -"SessionChatLimitView0" = "Only users with a wealth level ≥%zd or charm level ≥%zd can initiate a chat"; -"SessionChatLimitView1" = "Wealth level"; -"SessionChatLimitView2" = "Charm level"; - -"SessionRiskView0" = "Kind reminder: The other party is not your friend, please pay attention to privacy and security!"; - -"SessionNavLiveView0" = "Live streaming"; - -"XPMomentsRecommendViewController0" = "No more data"; -"XPMomentsRecommendViewController1" = "Once deleted, it cannot be recovered\nAre you sure you want to delete this dynamic?"; -"XPMomentsRecommendViewController2" = "Deleted successfully"; - -"XPMonentsDetailViewController0" = "Please enter the content you want to comment on"; -"XPMonentsDetailViewController1" = "Details"; -"XPMonentsDetailViewController2" = "All comments"; -"XPMonentsDetailViewController3" = "Reply"; -"XPMonentsDetailViewController4" = "Reply"; -"XPMonentsDetailViewController5" = "Once deleted, it cannot be recovered\nAre you sure you want to delete this dynamic?"; -"XPMonentsDetailViewController6" = "Post a comment"; -"XPMonentsDetailViewController7" = "Post a comment"; -"XPMonentsDetailViewController8" = "Deleted successfully"; - -"XPMomentsSimpleDetailViewController0" = "Share your thoughts"; -"XPMomentsSimpleDetailViewController1" = "Please enter the content you want to comment on"; -"XPMomentsSimpleDetailViewController2" = "Comment"; -"XPMomentsSimpleDetailViewController3" = "Reply"; -"XPMomentsSimpleDetailViewController4" = "Delete"; -"XPMomentsSimpleDetailViewController5" = "Once deleted, it cannot be recovered\nAre you sure you want to delete this dynamic?"; -"XPMomentsSimpleDetailViewController6" = "Report"; -"XPMomentsSimpleDetailViewController7" = "We have received your request and will process it as soon as possible"; -"XPMomentsSimpleDetailViewController8" = "Reply"; -"XPMomentsSimpleDetailViewController9" = "Once deleted, it cannot be recovered\nAre you sure you want to delete this dynamic?"; -"XPMomentsSimpleDetailViewController10" = "Post a comment"; -"XPMomentsSimpleDetailViewController11" = "Post a comment"; -"XPMomentsSimpleDetailViewController12" = "Deleted successfully"; -"XPMomentsSimpleDetailViewController12" = "Haven't posted anything yet~ Are you sure you want to return?"; - -"XPMonentsLatestViewController0" = "No more data"; -"XPMonentsLatestViewController1" = "Once deleted, it cannot be recovered\nAre you sure you want to delete this dynamic?"; -"XPMonentsLatestViewController2" = "Deleted successfully"; - -"XPMonentsTopicRecommondViewController0" = "No more data"; -"XPMonentsTopicRecommondViewController1" = "Once deleted, it cannot be recovered\nAre you sure you want to delete this dynamic?"; -"XPMonentsTopicRecommondViewController2" = "Deleted successfully"; - -"XPMonentsAttentionViewController0" = "No more data"; -"XPMonentsAttentionViewController1" = "Once deleted, it cannot be recovered\nAre you sure you want to delete this dynamic?"; -"XPMonentsAttentionViewController2" = "Deleted successfully"; - -///XPMonentsMineViewController.m -"XPMonentsMineViewController0" = "Once deleted, it cannot be recovered\nAre you sure you want to delete this dynamic?"; -"XPMomentsMineViewController1" = "Deleted successfully"; -"XPMomentsMineViewController2" = "Blocked successfully"; - - -"XPMonentsViewController1" = "Following"; -"XPMonentsViewController2" = "Recommend"; -"XPMonentsViewController3" = "Latest"; - -"XPMonentsRecommendHeaderView0" = "Recommended topics"; - -///XPMonentsContentView.m -"XPMonentsContentView0" = "Pin "; -"XPMonentsContentView1" = "Expand"; -"XPMonentsContentView2" = "Collapse"; - -"XPMoentsTopicListView0" = "No more data"; - -"XPMonentsPublishTopicView0" = "Add topic"; -"XPMonentsPublishTopicView1" = "Re-select"; - -///XPMonentsUserInfoView.m -"XPMonentsUserInfoView0" = "Delete"; -"XPMonentsUserInfoView1" = "Report"; -"XPMonentsUserInfoView2" = "Live streaming"; - -///XPMonentsTooBarView.m -"XPMonentsTooBarView0" = "Delete"; -"XPMonentsTooBarView1" = "Report dynamic or user"; -"XPMonentsTooBarView2" = "Friends"; -"XPMonentsTooBarView3" = "Friend circle"; -"XPMonentsTooBarView4" = "WeChat friends"; -"XPMonentsTooBarView5" = "QQ friends"; -"XPMonentsTooBarView6" = "QZone"; -"XPMonentsTooBarView7" = "%@ posted a dynamic"; -"XPMonentsTooBarView8" = "Block dynamic"; - -"XPMonentPublishSuccessView0" = "Under review"; -"XPMonentPublishSuccessView1" = "Whew, received your cute dynamic~\nOnce approved, the secretary will help you send and notify you"; - -"XPMonentsInteractiveTableViewCell0" = "Commented on you"; -"XPMonentsInteractiveTableViewCell1" = "Invite"; - -"XPMonentsEmptyTableViewCell0" = "No data"; - -"XPMonentsReplyMoreTableViewCell0" = "Expand %ld replies"; - -"XPMonentsTopicLatestViewController0" = "No more data"; -"XPMonentsTopicLatestViewController1" = "Once deleted, it cannot be recovered\nAre you sure you want to delete this dynamic?"; -"XPMonentsTopicLatestViewController2" = "Deleted successfully"; - -"XPMomentListViewController0" = "No more data"; -"XPMomentListViewController1" = "Post dynamic"; -"XPMomentListViewController2" = "Square"; - -"XPMonentsPublishViewController0" = "You can only enter up to 500 characters"; -"XPMonentsPublishViewController1" = "Are you sure to delete?"; -"XPMonentsPublishViewController2" = "Prompt"; -"XPMonentsPublishViewController3" = "Haven't posted anything yet~ Are you sure you want to return?"; -"XPMonentsPublishViewController4" = "Slipped"; -"XPMonentsPublishViewController5" = "Confirm to return"; -"XPMonentsPublishViewController6" = "Please enter the content to be posted"; -"XPMonentsPublishViewController7" = "Post dynamic"; -"XPMonentsPublishViewController8" = "Post"; -"XPMonentsPublishViewController9" = "Record your moment now, share it with interesting people"; -"XPMonentsPublishViewController10" = "Commercial advertisements, phone numbers, as well as vulgar, pornographic, terrifying, violent, and insulting language are prohibited. Violators will be banned"; - -"XPMonentsInteractiveViewController0" = "All messages"; -"XPMonentsInteractiveViewController1" = "No more data"; -"XPMonentsInteractiveViewController2" = "Clearing will delete all interactive notifications, are you sure you want to clear?"; - -"XPMonentTopicContainerViewController1" = "Latest"; -"XPMonentTopicContainerViewController2" = "Participate in the topic"; - -"XPMoentsTopicListViewController0" = "More topics"; -"XPMoentsTopicListViewController1" = "No more data"; - -"XPUpgradeView0" = "Update now"; -"XPUpgradeView1" = "Later"; - -"XPAnchorCardView0" = "Remaining"; -"XPAnchorCardView1" = "Enter room"; - -"TabbarViewController0" = "You have been logged out, if this was not done by you, please change your password immediately"; -"TabbarViewController1" = "The other party has retracted a message"; -"TabbarViewController2" = "Home"; -"TabbarViewController3" = "Forum"; -"TabbarViewController4" = "Messages"; -"TabbarViewController5" = "Mine"; - -"XPLoginPhoneViewController0" = "Please enter a correct phone number"; -"XPLoginPhoneViewController1" = "Login successful"; -"XPLoginPhoneViewController2" = "Verification code sent successfully"; -"XPLoginPhoneViewController3" = "Phone number login"; -"XPLoginPhoneViewController4" = "Unregistered phone numbers will automatically create an account upon login"; -"XPLoginPhoneViewController5" = "Please enter a phone number"; - -"XPLoginPhoneViewController7" = "Password login"; -"XPLoginPhoneViewController8" = "Login"; - - -"XPLoginInputView0" = "Get verification code"; -"XPLoginInputView1" = "Resend"; - -"XPLoginViewController0" = "One-click login failed, please check your mobile network status"; -"XPLoginViewController1" = "One-click login"; -"XPLoginViewController2" = "One-click login with your mobile number"; -"XPLoginViewController3" = "Agree to《Default》and authorize %@ to obtain your mobile number"; -"XPLoginViewController4" = "Login successful"; -"XPLoginViewController5" = "Mobile number login"; - -"XPLoginViewController7" = "《User Service Agreement》"; -"XPLoginViewController8" = "and"; -"XPLoginViewController9" = "《Privacy Policy》"; -"XPLoginViewController10" = "Other login methods"; -"XPLoginViewController11" = "You can only register or login after agreeing to the privacy policy and user agreement"; -"XPLoginViewController12" = "Apple login"; -"XPLoginViewController13" = "Google login"; -"XPLoginViewController14" = "Facebook login"; -"XPLoginViewController15" = "Line login"; -"XPLoginViewController17" = "Last login"; - -"XPForgetPwdViewController0" = "Please enter a correct phone number"; -"XPForgetPwdViewController1" = "Verification code sent successfully"; -"XPForgetPwdViewController2" = "Password reset successful"; -"XPForgetPwdViewController3" = "Forgot password"; -"XPForgetPwdViewController4" = "Please enter a phone number"; - -"XPForgetPwdViewController6" = "Please enter a password (6-16 characters)"; - -"XPLoginPwdViewController0" = "Login successful"; -"XPLoginPwdViewController1" = "Password login"; -"XPLoginPwdViewController2" = "Please enter a phone number/ID"; - -"XPLoginPwdViewController4" = "Phone number login"; -"XPLoginPwdViewController5" = "Forgot password"; -"XPLoginPwdViewController6" = "Please enter a E-Party account"; - -"XPLoginBindPhoneResultViewController0" = "Bind phone"; -"XPLoginBindPhoneResultViewController1" = "Your current bound phone number is"; -"XPLoginBindPhoneResultViewController2" = "Change phone number"; - -"XPLoginVerifBindPhoneViewController0" = "Change bound phone"; -"XPLoginVerifBindPhoneViewController1" = "Bind phone number"; -"XPLoginVerifBindPhoneViewController2" = "Verify the bound phone number"; -"XPLoginVerifBindPhoneViewController3" = "Verify"; -"XPLoginVerifBindPhoneViewController4" = "Phone number cannot be empty"; -"XPLoginVerifBindPhoneViewController5" = "Please enter the correct phone number"; -"XPLoginVerifBindPhoneViewController6" = "Phone number cannot be empty"; -"XPLoginVerifBindPhoneViewController7" = "Verification code cannot be empty"; -"XPLoginVerifBindPhoneViewController8" = "Verification code sent successfully"; -"XPLoginVerifBindPhoneViewController9" = "Verification successful"; -"XPLoginVerifBindPhoneViewController10" = "%ds later retry"; -"XPLoginVerifBindPhoneViewController11" = "Resend"; -"XPLoginVerifBindPhoneViewController12" = "Country and region"; -"XPLoginVerifBindPhoneViewController13" = "China"; -"XPLoginVerifBindPhoneViewController14" = "Bind"; -"XPLoginVerifBindPhoneViewController15" = "Get verification code"; -"XPLoginVerifBindPhoneViewController16" = "Enter phone number"; -"XPLoginVerifBindPhoneViewController17" = "Enter verification code"; -"XPLoginVerifBindPhoneViewController18" = "If you have lost your phone number\nPlease contact customer service"; - -"XPCandyTreeRankView0" = "No more data"; -"XPCandyTreeMoreView0" = "More"; -"XPCandyTreeMoreView2" = "Prize Records"; -"XPCandyTreeMoreView3" = "Game Rules"; -"XPCandyTreeMoreView4" = "Allow prize messages to be displayed externally"; -"XPCandyTreeEmptyableViewCell0" = "No data available"; -"XPCandyTreeMoreRuleCell0" = "Fortune value reaches level %ld to use, hurry up and upgrade~"; - -"XPCandyTreeViewController2" = "The number of hammers purchased cannot be zero!"; -"XPCandyTreeViewController4" = "Join now"; -"XPCandyTreeViewController5" = "Only 99999 times can be selected at a time"; -"XPCandyTreeViewController7" = "Leaderboard"; -"XPCandyRankContainerView0" = "Today"; -"XPCandyRankContainerView1" = "Yesterday"; -"XPCandyTreeInsufficientBalanceView0" = "Reminder"; -"XPCandyTreeInsufficientBalanceView1" = "Insufficient Coins balance, please recharge first~"; -"XPCandyTreeInsufficientBalanceView2" = "Recharge now"; -"XPRoomActivityContainerView0" = "First Recharge Gift"; -"XPRoomActivityContainerView1" = "Token"; -"XPRoomActivityContainerView2" = "PK has started, queueing is temporarily unavailable"; -"XPRoomActivityContainerView3" = "This red envelope has expired"; -"XPWebViewNavView0" = "Recharge"; -"XPWebViewNavView1" = "Copy Link"; -"LoginPresenter0" = "Login canceled"; -"LoginPresenter1" = "Login failed, please try again"; - -"XPRoomMessageParser1033333" = "Congratulations %@ on drawing %@ times the reward in Star Kitchen and obtaining %@ Coins!"; - -"XPShareView0" = "Copy success"; -"XPShareView1" = "Play O"; -"XPShareView2" = "Please install the app"; -"XPShareView3" = "This is the title"; -"XPShareView4" = "Content"; -"XPShareView5" = "Share failed"; -"XPShareView6" = "Cancel sharing"; -"XPShareView7" = "Cancel"; -"XPShareView8" = "Come to E-Party and meet your exclusive voice"; -"XPShareView9" = "Failed to share due to the absence of related apps"; -"XPFirstRechargeViewController0" = "1. Each person can only receive the first recharge benefit once\n2. Each ID and device can only participate once."; -"XPFirstRechargeViewController1" = "Recharge now"; -"XPFirstRechargeSuccessView0" = "Costume items can be used in 'My Dressing Room'"; -"XPFirstRechargeSuccessView1" = "Got it"; -"StatisticsServiceHelper0" = "Application launched"; -"StatisticsServiceHelper1" = "One-click login successful"; -"StatisticsServiceHelper2" = "Mobile login"; -"StatisticsServiceHelper3" = "QQ login"; -"StatisticsServiceHelper4" = "WeChat login"; -"StatisticsServiceHelper5" = "Personal information saved successfully during registration"; -"StatisticsServiceHelper6" = "Click to open the VIP"; -"StatisticsServiceHelper7" = "VIP room entrance clicked"; -"StatisticsServiceHelper8" = "VIP gift panel entrance clicked"; -"StatisticsServiceHelper9" = "VIP expression panel entrance clicked"; -"StatisticsServiceHelper10" = "VIP 'My' page entrance clicked"; -"SDPhotoBrowser0" = "Save"; -"SDBrowserImageView0" = "Image loading failed"; -"NSDate_DateUtils0" = "MM/dd"; -"NSDate_DateUtils1" = "yyyy/MM/dd"; -"PLTimeUtil0" = "yyyy/MM/dd"; -"PLTimeUtil1" = "YYYY/MM"; -"PLTimeUtil2" = "YYYY/MM/dd"; -"PLTimeUtil3" = "yyyy/MM"; -"PLTimeUtil4" = "MM/dd"; -"NSString_Utils0" = "MM/dd"; -"NSString_Utils1" = "YYYY/MM/dd"; -"NSString_Utils2" = "Just now"; -"NSString_Utils3" = "%ld minutes ago"; -"NSString_Utils4" = "%@0K"; -"QEmotionBoardView0" = "Send"; -"QInputBarView0" = "Hold to talk"; -"QInputBarView1" = "Release to end"; -"QInputBarView2" = "Swipe up to cancel sending"; -"QInputBarView3" = "Swipe up to cancel sending"; -"QInputBarView4" = "Release finger to cancel sending"; - -"QinputPhotoView0" = "Up to 9 images can be selected"; -"QinputPhotoView1" = "Album"; -"QinputPhotoView2" = "Original"; -"QinputPhotoView3" = "Send"; - -"XPAdvertiseView0" = "Skip"; -"XPAdvertiseView1" = "Skip"; - - - -"TTAlertConfig0" = "OK"; - -"TTActionSheetView0" = "Cancel"; - -"HttpRequestHelper0" = "Please check network connection"; -"HttpRequestHelper1" = "Please check network connection"; -"HttpRequestHelper2" = "Please check network connection"; -"HttpRequestHelper3" = "Login session has expired"; -"HttpRequestHelper4" = "E-Party is taking a break Please try again later"; -"HttpRequestHelper5" = "Unknown error from server"; -"HttpRequestHelper6" = "Please check network connection"; -"HttpRequestHelper7" = "Login session has expired."; - -"AppDelegate_ThirdConfig0" = "E-Party"; - -"XPMineNotificaPresenter0" = "System Notifications"; -"XPMineNotificaPresenter1" = "When turned off, system messages and official assistants will no longer prompt"; -"XPMineNotificaPresenter2" = "Live Notifications"; -"XPMineNotificaPresenter3" = "When turned off, the official assistant will no longer notify you of the live broadcasts of the anchors"; - -"XPMineSettingPresent0" = "Settings"; -"XPMineSettingPresent2" = "Settings"; -"XPMineSettingPresent3" = "Phone Number"; -"XPMineSettingPresent4" = "Settings"; -"XPMineSettingPresent6" = "Set Password"; -"XPMineSettingPresent7" = "Settings"; -"XPMineSettingPresent8" = "Blacklist Management"; -"XPMineSettingPresent9" = "Payment Password"; -"XPMineSettingPresent11" = "Settings"; -"XPMineSettingPresent12" = "Notification Reminder Settings"; -"XPMineSettingPresent13" = "Settings"; -"XPMineSettingPresent14" = "Personal Information and Permissions"; -"XPMineSettingPresent15" = "Help"; -"XPMineSettingPresent16" = "Feedback"; -"XPMineSettingPresent17" = "Clear Cache"; -"XPMineSettingPresent18" = "Check for Updates"; -"XPMineSettingPresent19" = "About "; -"XPMineSettingPresent20" = "Blacklist"; -"XPMineSettingPresent21" = "Bind Phone Number"; -"XPMineSettingPresent23" = "Set Password"; -"XPMineSettingPresent24" = "Clear Cache"; -"XPMineSettingPresent25" = "Cancel Account"; -"XPMineSettingPresent26" = "Modify"; -"XPMineSettingPresent27" = "Block Management"; -"XPMineSettingPresent28" = "Language"; -///XPMineUserInfoEditPresenter.m -"XPMineUserInfoEditPresenter0" = "Upload Failed"; -"XPMineUserInfoEditPresenter1" = "Nickname"; -"XPMineUserInfoEditPresenter2" = "Avatar"; -"XPMineUserInfoEditPresenter3" = "Birthday"; -"XPMineUserInfoEditPresenter4" = "Album"; -"XPMineUserInfoEditPresenter5" = "About Me"; -"XPMineUserInfoEditPresenter6" = "Voice Signature"; -"XPMineUserInfoEditPresenter7" = "Record your exclusive voice now~"; -"XPMineUserInfoEditPresenter8" = "Tags"; -"XPMineUserInfoEditPresenter9" = "Setting personal tags will make you more popular~"; -"XPMineUserInfoEditPresenter10" = "Region"; - -"XPMineUserInfolbumPresenter0" = "Upload Failed"; - -"XPMineAttentionViewController0" = "No more data"; -"XPMineAttentionViewController1" = "My Following"; -"XPMineAttentionViewController2" = "You haven't followed anyone yet"; -"XPIncomeRecordGoldDetailsView0"="No Data Available"; -"XPIncomeRecordGoldDetailsView1"="Total Gold Coin Flow in Current Room: %@ Coins"; - -"XPIncomeRecordGoldDetailsVC0"="Diamond Details"; -"XPIncomeRecordGoldDetailsVC1"="to"; - -"XPGoldDetailsChooseRoomView0"="All"; - -"XPIncomeRecordGoldDetailsPickViewView0"="Cancel"; - -"XPIncomeRecordGoldDetailsPickViewView2"="to"; -"XPIncomeRecordGoldDetailsPickViewView3"=""; -"XPIncomeRecordGoldDetailsPickViewView4"=""; -"XPIncomeRecordGoldDetailsPickViewView5"=""; - -"XPMineFriendViewController0" = "You don't have any friends yet"; - -"XPMineShareViewController0" = "Select Friends"; -"XPMineShareViewController1" = "Are you sure you want to share with %@?"; -"XPMineShareViewController4" = "Follow"; - -"XPMineContactViewController3" = "Follow"; - -"XPMineFansViewController0" = "No more rooms"; -"XPMineFansViewController1" = "My Fans"; -"XPMineFansViewController2" = "Followed successfully"; -"XPMineFansViewController3" = "You don't have any fans yet"; - -"XPDressSearchViewController0" = "Gifted successfully"; -"XPDressSearchViewController1" = "Please enter the content to search for"; -"XPDressSearchViewController2" = "Please enter the content to search for"; - -"XPDressUpShopListViewController0" = "Purchased successfully"; -"XPDressUpShopListViewController2" = "Headwear used successfully"; -"XPDressUpShopListViewController4" = "Vehicle used successfully"; -"XPDressUpShopListViewController6" = "Nameplate used successfully"; -"XPDressUpShopListViewController8" = "Information card used successfully"; -"XPDressUpShopListViewController12" = "No chat bubbles temporarily"; - -"XPMineCarTableViewCell0" = "%ld Days Remaining"; -"XPMineCarTableViewCell1" = "Expired"; -"XPMineCarTableViewCell2" = "Cancel Use"; -"XPMineCarTableViewCell3" = "Use"; -"XPMineCarTableViewCell4" = "Use"; - -"XPMineHeadwearTableViewCell0" = "%@ Days Remaining"; -"XPMineHeadwearTableViewCell1" = "Expired"; -"XPMineHeadwearTableViewCell2" = "Cancel Use"; -"XPMineHeadwearTableViewCell3" = "Use"; -"XPMineHeadwearTableViewCell4" = "Use"; - -"XPMineNobleCardTableViewCell0" = "%zd days remaining"; -"XPMineNobleCardTableViewCell1" = "Expired"; -"XPMineNobleCardTableViewCell2" = "Cancel Use"; -"XPMineNobleCardTableViewCell3" = "Use"; -"XPMineNobleCardTableViewCell4" = "Use"; - -"XPMineNameplateTableViewCell0" = "%@ days remaining"; -"XPMineNameplateTableViewCell1" = "Expired"; -"XPMineNameplateTableViewCell2" = "Cancel Use"; -"XPMineNameplateTableViewCell3" = "Use"; -"XPMineNameplateTableViewCell4" = "Use"; - - -"XPDressShopSearchTableViewCell1" = "Gift"; - - -"XPDressUpShopCardTableViewCell1" = "Gift"; -"XPDressUpShopCardTableViewCell2" = "Buy"; -"XPDressUpShopCardTableViewCell3" = "Limited time"; - -"XPMineDressBubbleCollectionViewCell0" = "%zd days remaining"; -"XPMineDressBubbleCollectionViewCell1" = "Expired"; -"XPMineDressBubbleCollectionViewCell2" = "Cancel Use"; -"XPMineDressBubbleCollectionViewCell3" = "Use"; -"XPMineDressBubbleCollectionViewCell4" = "Use"; - -"XPDressUpShopCollectionViewCell0" = "%@ (%zd days"; -"XPDressUpShopCollectionViewCell1" = "Gift"; -"XPDressUpShopCollectionViewCell2" = "Buy"; -"XPDressUpShopCollectionViewCell3" = "Limited time"; - -"XPMineDressEmptyTableViewCell0" = "No data"; - -"XPMineDressEmptyCollectionViewCell0" = "No data"; - -"XPMineDressUpBubbleViewController1" = "Bubble used successfully"; -"XPMineDressUpBubbleViewController2" = "Dear user, you don't have any chat bubbles yet!"; -"XPMineDressUpBubbleViewController3" = "Cancel using bubble successfully"; - -"XPDressUpShopCardViewController0" = "Purchase successful"; -"XPDressUpShopCardViewController2" = "Headwear used successfully"; -"XPDressUpShopCardViewController4" = "Vehicle used successfully"; -"XPDressUpShopCardViewController6" = "Nameplate used successfully"; -"XPDressUpShopCardViewController8" = "Information card used successfully"; -"XPDressUpShopCardViewController9" = "No information cards temporarily"; -"XPDressUpShopCardViewController10" = "No headwear temporarily"; -"XPDressUpShopCardViewController11" = "No nameplates temporarily"; -"XPDressUpShopCardViewController12" = "No vehicles temporarily"; - -"XPMineDressUpViewController0" = "My Item"; -"XPMineDressUpViewController1" = "Avatar Frame"; -"XPMineDressUpViewController2" = "Vehicle"; -"XPMineDressUpViewController3" = "Nameplate"; -"XPMineDressUpViewController4" = "Profile Card"; -"XPMineDressUpViewController5" = "Chat Bubble"; -"XPMineDressUpViewController6" = "Cancel using headwear successfully"; -"XPMineDressUpViewController7" = "Cancel using vehicle successfully"; -"XPMineDressUpViewController8" = "Cancel using nameplate successfully"; -"XPMineDressUpViewController9" = "Cancel using information card successfully"; - -"XPMineDressUpListViewController1" = "Headwear used successfully"; -"XPMineDressUpListViewController3" = "Vehicle used successfully"; -"XPMineDressUpListViewController5" = "Nameplate used successfully"; -"XPMineDressUpListViewController7" = "Information card used successfully"; -"XPMineDressUpListViewController10" = "Dear user, you don't have any nameplates yet!"; -"XPMineDressUpListViewController11" = "Dear user, you don't have any avatar frame yet!"; -"XPMineDressUpListViewController12" = "Dear user, you don't have any mount yet!"; - -"XPDressUpShopViewController0" = "Mine"; -"XPDressUpShopViewController1" = "Mall"; -"XPDressUpShopViewController6" = "Chat Bubbles"; -"XPDressUpShopViewController7" = "My Coins"; -"XPDressUpShopViewController8" = "Recharge"; - -"XPMineFansTeamViewController0" = "Fans Teams I've Joined"; -"XPMineFansTeamViewController1" = "No fans teams yet"; - -"XPMineCollectPartyRoomViewController0" = "No more collected records"; -"XPMineCollectPartyRoomViewController1" = "Collected Rooms"; -"XPMineCollectPartyRoomViewController2" = "No collected rooms yet"; - -"XPMinePayPwdInputView0" = "%ld retry after"; -"XPMinePayPwdInputView1" = "Resend"; -"XPMinePayPwdInputView2" = "Set Payment Password"; -"XPMinePayPwdInputView3" = "Enter payment password again"; -"XPMinePayPwdInputView4" = "Enter verification code"; -"XPMinePayPwdInputView5" = "Get verification code"; - -"XPMineNewUserRechargeView0" = "%zd days %zd hours %zd minutes"; -"XPMineNewUserRechargeView1" = "%zd days %zd minutes"; -"XPMineNewUserRechargeView2" = "%zd hours %zd minutes"; -"XPMineNewUserRechargeView3" = "%zd minutes"; - -"XPMineAccountView0" = "Coins Balance"; - -"XPMineVerifIdentityView0" = "Send Verification Code"; - -"AnchorLevelTimeView0" = "hour(s)"; -"AnchorLevelTimeView1" = "minute(s)"; -"AnchorLevelTimeView2" = "second(s)"; - -"AnchorLevelProgressView0" = "Coins Received"; -"AnchorLevelProgressView1" = "Completed"; -"AnchorLevelProgressView2" = "Remaining %ld Coins to complete"; -"AnchorLevelProgressView3" = "New user private chat reply rate"; -"AnchorLevelProgressView4" = "Completed"; -"AnchorLevelProgressView5" = "Remaining %.0f%@ to complete"; - -"AnchorLevelView0" = "Current Rating"; - -///XPMineHeadView.m -"XPMineHeadView0" = "Capricorn Aquarius Pisces Aries Taurus Gemini Cancer Leo Virgo Libra Scorpio Sagittarius"; -"XPMineHeadView1" = "Error date format!"; -"XPMineHeadView2" = "Error date format!!"; -"XPMineHeadView3" = "Error date format!!!"; -"XPMineHeadView4" = "Following"; -"XPMineHeadView5" = "Fans"; -"XPMineHeadView6" = "%@ Sign"; -"XPMineHeadView7" = "Under review"; -"XPMineHeadView8" = "Copy Success"; - -"XPMineHeadView9" = "Capricorn"; -"XPMineHeadView10" = "Aquarius"; -"XPMineHeadView11" = "Pisces"; -"XPMineHeadView12" = "Aries"; -"XPMineHeadView13" = "Taurus"; -"XPMineHeadView14" = "Gemini"; -"XPMineHeadView15" = "Cancer"; -"XPMineHeadView16" = "Leo"; -"XPMineHeadView17" = "Virgo"; -"XPMineHeadView18" = "Libra"; -"XPMineHeadView19" = "Scorpio"; -"XPMineHeadView20" = "Sagittarius"; - -"XPMineUserInfoHeaderView0" = "Copy Success"; -"XPMineUserInfoHeaderView1" = "I am a default signature"; -"XPMineUserInfoHeaderView2" = "%ld followers"; -"XPMineUserInfoHeaderView3" = "Live"; -"XPMineUserInfoHeaderView4" = "Record Voice Card"; -"XPMineUserInfoHeaderView5" = "I am a default signature"; -"XPMineUserInfoHeaderView6" = "This person left nothing behind~"; -///XPMineUserInfoIndividualTagView -"XPMineUserInfoIndividualTagView0"="TA's Tags"; -"XPMineUserInfoIndividualTagView1"="My Tags"; -"XPMineUserInfoIndividualTagView2"="Edit Tags"; -///XPMineUserInfoHeaderTagView -"XPMineUserInfoHeaderTagView0"="Set your personal tags"; -///XPMineDataSkillCardTableViewCell.m -"XPMineDataSkillCardTableViewCell0" = "Skill Card"; -"XPMineDataSkillCardTableViewCell1" = "No skill card added yet"; -///XPMonentsLayoutConfig.m -"XPMonentsLayoutConfig0" = "Top "; -"XPMineUserInfoDateView0" = "Cancel"; - -"XPMineUserInfoDateView2" = "Done"; -"XPMineUserInfoDateView3" = " years old"; -"XPMineUserInfoDateView4" = "Sign"; -"XPMineRechageHeadView0" = "My Coins"; - -"XPMineRechargeNavView0" = "Account"; - -"XPFootPrintNavView0" = "Clear All"; -"XPFootPrintNavView1" = "Footprints"; - -"XPMineAnchorFansTeamTableViewCell0" = "User Nickname"; - -"XPMineFriendTableViewCell0" = "This person hasn't set a signature yet"; - -"XPMineFansTableViewCell0" = "This person hasn't set a signature yet"; -"XPMineFansTableViewCell1" = "+Follow"; -"XPMineFansTableViewCell2" = "Mutual Follow"; - -"XPMineAttentionTableViewCell0" = "This person hasn't set a signature yet"; -"XPMineAttentionTableViewCell1" = "Find"; - -"XPMineFriendEmptyTableViewCell0" = "No data"; - -"XPMineDataGiftTableViewCell0" = "Normal Gifts"; -"XPMineDataGiftTableViewCell1" = "Lucky Gifts"; -"XPMineDataGiftTableViewCell2" = "Medal"; - -"XPMineUserInfoEmptyCollectionViewCell0" = "No gifts received yet"; - -"XPMineDataClanTableViewCell0" = "Guild·Room"; -"XPMineDataClanTableViewCell1" = "Guild"; -"XPMineDataClanTableViewCell2" = "Guild"; -"XPMineDataClanTableViewCell3" = "Guild·Room"; -"XPMineDataClanTableViewCell4" = "Apply to join"; -"XPMineDataClanTableViewCell5" = "Not joined any guild yet"; -"XPMineDataClanTableViewCell6" = "Profile"; -"XPMineDataClanTableViewCell7" = "Constellation:"; -"XPMineDataClanTableViewCell8" = "Birthday:"; -"XPMineDataClanTableViewCell9" = "Room:"; -"XPMineDataClanTableViewCell10" = "Guild:"; -"XPMineDataClanTableViewCell11" = "This user has not joined any room yet"; -"XPMineDataClanTableViewCell12" = "Not joined any room yet"; -"XPMineDataClanTableViewCell13" = "Region:"; -"XPMineDataClanTableViewCell14" = "More"; - -"XPMineUserInfoGiftWallViewController0" = "Gifts"; -"XPMineUserInfoGiftWallViewController1" = "Normal gifts"; -"XPMineUserInfoGiftWallViewController2" = "Lucky gifts"; -"XPMineUserInfoGiftWallViewController3" = "No photos yet"; -"XPMineUserInfoGiftWallViewController4" = "No gifts yet"; - -"XPMineUserInfoTableViewCell1" = "I am a default signature"; -"XPMineUserInfoTableViewCell2" = "Live"; - - -"XPMineVisitorEmptyTableViewCell0" = "No data"; - -"XPMineVisitorTableViewCell0" = "User nickname"; - -"XPMineRechargeTableViewCell0" = "Coins"; - -"XPMineUserInfoViewController0" = "Report"; -"XPMineUserInfoViewController1" = "Block User"; -"XPMineUserInfoViewController2" = "Remove from Blacklist"; -"XPMineUserInfoViewController3" = "By removing from blacklist, you will receive messages from this user as usual"; -"XPMineUserInfoViewController4" = "Add to Blacklist"; -"XPMineUserInfoViewController5" = "By adding to blacklist, you will no longer receive messages from this user"; -"XPMineUserInfoViewController6" = "Removed from blacklist successfully"; -"XPMineUserInfoViewController7" = "Added to blacklist successfully"; -"XPMineUserInfoViewController8" = "Chat"; -"XPMineUserInfoViewController9" = "Follow"; -"XPMineUserInfoViewController10" = "Following"; -"XPMineUserInfoViewController11" = "Profile"; -"XPMineUserInfoViewController12" = "Posts"; -"XPMineUserInfoViewController13" = "Gift Wall"; - -"XPMineUserInfoAlbumViewController0" = "My Albums"; -"XPMineUserInfoAlbumViewController1" = "Upload from Camera"; -"XPMineUserInfoAlbumViewController3" = "Camera access restricted. Tap OK to go to system settings"; -"XPMineUserInfoAlbumViewController5" = "Photo library access restricted. Tap OK to go to system settings"; -"XPMineUserInfoAlbumViewController6" = "Local Album"; -"XPMineUserInfoAlbumViewController8" = "Photo library access restricted. Tap OK to go to system settings"; -"XPMineUserInfoAlbumViewController10" = "Photo library access restricted. Tap OK to go to system settings"; -"XPMineUserInfoAlbumViewController11" = "You can only upload up to 8 photos"; -"XPMineUserInfoAlbumViewController12" = "Deletion is irreversible"; -"XPMineUserInfoAlbumViewController13" = "Do you want to delete?"; -"XPMineUserInfoAlbumViewController14" = "Photo under review, will be uploaded automatically after approval"; -"XPMineUserInfoAlbumViewController15" = "Deleted successfully"; -"XPMineUserInfoAlbumViewController16" = "Edit"; -"XPMineUserInfoAlbumViewController17" = "Done"; - -"XPMineUserDataViewController0" = "Application submitted, waiting for admin approval"; -"XPMineUserDataViewController1" = "Posts"; -"XPMineUserDataViewController2" = "Default posts cannot be liked"; -"XPMineUserDataViewController3" = "Default posts cannot be commented"; - -"XPMineSimpleUserInfoViewController0" = "Report"; -"XPMineSimpleUserInfoViewController1" = "We have received your request and will process it as soon as possible"; -"XPMineSimpleUserInfoViewController2" = "Block"; -"XPMineSimpleUserInfoViewController3" = "Remove from Blacklist"; -"XPMineSimpleUserInfoViewController4" = "By removing from blacklist, you will receive messages from this user as usual"; -"XPMineSimpleUserInfoViewController5" = "Add to Blacklist"; -"XPMineSimpleUserInfoViewController6" = "By adding to blacklist, you will no longer receive messages from this user"; -"XPMineSimpleUserInfoViewController7" = "Removed from blacklist successfully"; -"XPMineSimpleUserInfoViewController8" = "Added to blacklist successfully"; -"XPMineSimpleUserInfoViewController9" = "Chat with them"; -"XPMineSimpleUserInfoViewController10" = "Follow"; -"XPMineSimpleUserInfoViewController11" = "Following"; - -"XPMineUserInfoDesViewController0" = "Edit Personal Introduction"; -"XPMineUserInfoDesViewController1" = "Maximum %ld characters"; -"XPMineUserInfoDesViewController2" = "Write a self-introduction to let others know more about you~"; -"XPMineUserInfoDesViewController3" = "Done"; - -"XPMineUserInfoEditViewController0" = "Edit Profile"; -"XPMineUserInfoEditViewController1" = "Upload from Camera"; -"XPMineUserInfoEditViewController2" = "Camera unavailable"; -"XPMineUserInfoEditViewController3" = "Camera access restricted. Tap OK to go to system settings"; -"XPMineUserInfoEditViewController4" = "Camera unavailable"; -"XPMineUserInfoEditViewController5" = "Photo library access restricted. Tap OK to go to system settings"; -"XPMineUserInfoEditViewController6" = "Local Album"; -"XPMineUserInfoEditViewController7" = "Photo library access restricted. Tap OK to go to system settings"; -"XPMineUserInfoEditViewController8" = "Photo library access restricted. Tap OK to go to system settings"; -"XPMineUserInfoEditViewController9" = "Profile under review"; -"XPMineUserInfoEditViewController10" = "Profile under review, will be applied automatically after approval"; -"XPMineUserInfoEditViewController11" = "Updated successfully"; -"XPMineUserInfoEditViewController12" = "Avatar has been submitted for review, it will be automatically applied upon approval"; -"XPMineUserInfoEditViewController13" = "Update successful"; - - -"XPMineUserInfoNickViewController0" = "Edit Nickname"; -"XPMineUserInfoNickViewController1" = "Maximum character limit reached"; -"XPMineUserInfoNickViewController2" = "Maximum character limit reached"; -"XPMineUserInfoNickViewController3" = "Done"; - -"XPMineUserInfoGiftWallViewController0" = "Gifts"; - - -"XPMineVisitorViewController0" = "No more visitor records"; -"XPMineVisitorViewController1" = "Visitor records"; -"XPMineVisitorViewController2" = "No visitor records yet"; - -"XPMineViewController0" = "To create a safer online environment and protect your and others' property security, please complete real-name authentication first."; - -"XPMineViewController2" = "Real-name Authentication"; - -"XPSimpleMineViewController0" = "You don't have any guild yet"; -"XPSimpleMineViewController1" = "My Guild"; -"XPSimpleMineViewController2" = "Personalize"; -"XPSimpleMineViewController3" = "Fan Clubs"; -"XPSimpleMineViewController4" = "Teen Mode"; -"XPSimpleMineViewController5" = "Feedback"; -"XPSimpleMineViewController6" = "Settings"; - -"XPIAPRechargeHeaderView0" = "My Coins"; - -"XPIAPRechargeViewController0" = "Purchase Failed"; -"XPIAPRechargeViewController1" = "Unknown error occurred, please try again"; -"XPIAPRechargeViewController2" = "Confirm Recharge"; -"XPIAPRechargeViewController3" = "《User Recharge Agreement》"; -"XPIAPRechargeViewController4" = "I have read and agree"; -"XPIAPRechargeViewController5" = "For any questions, please contact customer service, E-Party ID"; -"XPIAPRechargeViewController6" = "My Account"; -"XPIAPRechargeViewController7" = "Reminder"; -"XPIAPRechargeViewController8" = "Recharge failed. Please contact customer service for assistance."; -"XPIAPRechargeViewController9" = "Contact Customer Service"; -"XPIAPRechargeViewController10" = "Recharge failed. Currently only devices running iOS 15 and above can recharge. Please upgrade your system and try again."; -"XPIAPRechargeViewController11" = "Please select the number of Coins to be recharged"; - - -"XPMineRechargeViewController0" = "Purchase Failed"; -"XPMineRechargeViewController1" = "Unknown error occurred, please try again"; -"XPMineRechargeViewController2" = "《User Recharge Agreement"; -"XPMineRechargeViewController3" = "I have read and agree"; - -"XPMinePayPwdViewController0" = "Set Payment Password"; -"XPMinePayPwdViewController1" = "Failed to get phone number"; -"XPMinePayPwdViewController2" = "Verification code sent successfully"; -"XPMinePayPwdViewController3" = "Payment password set successfully"; -"XPMinePayPwdViewController4" = "Payment password must be 6-digit number"; -"XPMinePayPwdViewController5" = "Payment password must be numeric"; -"XPMinePayPwdViewController6" = "Passwords entered do not match"; -"XPMinePayPwdViewController7" = "Enter verification code"; - -"XPMinePayPwdViewController9" = "Verification code sent to your bound phone %@****%@"; -"XPMinePayPwdViewController10" = "Enter payment password"; -"XPMinePayPwdViewController11" = "Confirm payment password"; - -"XPMineBlackListViewController0" = "Blacklist"; -"XPMineBlackListViewController1" = "Remove"; - -"XPMineResetPayPwdViewController0" = "Reset Payment Password"; -"XPMineResetPayPwdViewController1" = "Payment password reset successfully"; -"XPMineResetPayPwdViewController2" = "Passwords entered do not match"; -"XPMineResetPayPwdViewController3" = "Enter payment password"; -"XPMineResetPayPwdViewController4" = "Confirm payment password"; - - -"XPMineSettingViewController0" = "Settings"; -"XPMineSettingViewController1" = "Please bind your phone number first"; -"XPMineSettingViewController2" = "Clear Cache"; -"XPMineSettingViewController3" = "Do you want to clear cache?"; -"XPMineSettingViewController4" = "Cache cleared"; -"XPMineSettingViewController5" = "Currently updated to the latest version"; -"XPMineSettingViewController6" = "Currently updated to the latest version"; -"XPMineSettingViewController7" = "Log out of current account"; -"XPMineSettingViewController8" = "Log out"; -"XPMineSettingViewController9" = "Set Login Password"; -"XPMineSettingViewController10" = "To facilitate your next login, please set a login password first"; - -"XPMineModifPayPwdViewController0" = "Modify Payment Password"; -"XPMineModifPayPwdViewController1" = "Payment password modified successfully"; -"XPMineModifPayPwdViewController2" = "Passwords entered do not match"; -"XPMineModifPayPwdViewController3" = "New payment password must be numeric"; -"XPMineModifPayPwdViewController4" = "Enter current payment password"; -"XPMineModifPayPwdViewController5" = "Enter payment password"; -"XPMineModifPayPwdViewController6" = "Confirm payment password"; - -"XPMineModifPayPwdViewController8" = "Forgot Password"; - -"XPMineFeedbackViewController0" = "Feedback"; -"XPMineFeedbackViewController1" = "Thank you for your valuable feedback, let's work together to create a better"; -"XPMineFeedbackViewController2" = "Problem Description"; -"XPMineFeedbackViewController3" = "Please describe in detail the problems and situations you encountered. Thank you for your valuable feedback."; -"XPMineFeedbackViewController4" = "Please enter your contact information"; -"XPMineFeedbackViewController5" = "Submit Feedback"; - -"XPMineAboutUsViewController0" = "About "; -"XPMineNotificaViewController0" = "Notification Settings"; -"XPMineResetLoginPwdViewController0" = "Forgot Password"; -"XPMineResetLoginPwdViewController1" = "Please enter your phone number"; -"XPMineResetLoginPwdViewController2" = "Verification code sent successfully"; -"XPMineResetLoginPwdViewController3" = "Password reset successful, please log in again"; -"XPMineResetLoginPwdViewController4" = "Retry after %ds"; -"XPMineResetLoginPwdViewController5" = "Resend"; -"XPMineResetLoginPwdViewController6" = "Next"; -"XPMineResetLoginPwdViewController7" = "Please enter your phone number"; -"XPMineResetLoginPwdViewController8" = "Please enter the verification code you received"; -"XPMineResetLoginPwdViewController9" = "Please enter a password (6-16 characters, combination of numbers and letters)"; - -"XPMineLoginPasswordViewController0" = "Set successfully"; -"XPMineLoginPasswordViewController1" = "Changed successfully"; -"XPMineLoginPasswordViewController2" = "The new passwords entered do not match"; -"XPMineLoginPasswordViewController3" = "Enter the original password"; -"XPMineLoginPasswordViewController4" = "Enter the new password"; -"XPMineLoginPasswordViewController5" = "Confirm new password"; -"XPMineLoginPasswordViewController6" = "Reset Password"; -"XPMineLoginPasswordViewController7" = "Enter password"; -"XPMineLoginPasswordViewController8" = "Confirm password again"; -"XPMineLoginPasswordViewController9" = "Set password"; - -"XPMineLoginPasswordViewController11" = "Forgot Password"; -"XPMineLoginPasswordViewController12" = "Passwords must be 6-16 characters long with a combination of numbers and letters"; - -"XPMineVerifIdentityViewController0" = "Verify Identity"; -"XPMineVerifIdentityViewController1" = "Please enter your phone number"; -"XPMineVerifIdentityViewController2" = "Verification code sent successfully"; -"XPMineVerifIdentityViewController3" = "Verification successful"; -"XPMineVerifIdentityViewController4" = "Retry after %ds"; -"XPMineVerifIdentityViewController5" = "Resend"; -"XPMineVerifIdentityViewController6" = "Next"; -"XPMineVerifIdentityViewController7" = "Please enter your phone number"; -"XPMineVerifIdentityViewController8" = "Please enter the verification code you received"; - -"XPMineCollectRoomListViewController0" = "Unfavorited successfully"; -"XPMineCollectRoomListViewController1" = "Favorite Rooms"; -"XPMineCollectRoomListViewController1" = "Favorite Rooms"; -"XPMineCollectRoomListViewController2" = "Please select a room"; -"XPMineCollectRoomListViewController3" = "Please select a room"; -"XPMineCollectRoomListViewController4" = "Select All"; -"XPMineCollectRoomListViewController5" = "Manage"; -"XPMineCollectRoomListViewController6" = "Done"; -"XPMineCollectRoomListViewController7" = "Delete"; -"XPMineCollectRoomListViewController8" = "Party Room"; -"XPMineCollectRoomListViewController9" = "Live Room"; - -"XPSimpleMineHeaderView0" = "Following"; -"XPSimpleMineHeaderView1" = "Followers"; -"XPSimpleMineHeaderView2" = "Visitors"; -"XPSimpleMineHeaderView3" = "Browsing"; -"XPSimpleMineHeaderView4" = "My Wallet"; -"XPSimpleMineHeaderView5" = "My Rooms"; -"XPSimpleMineHeaderView6" = "My Favorites"; -"XPSimpleMineHeaderView7" = "My Level"; - -"XPMineFootPrintViewController0" = "No more entry records"; -"XPMineFootPrintViewController1" = "Deleted successfully"; -"XPMineFootPrintViewController2" = "Favorited successfully"; -"XPMineFootPrintViewController3" = "No entry records"; -"XPMineFootPrintViewController4" = "Delete"; -"XPMineFootPrintViewController5" = "Favorite"; - -"XPPrivacyViewController0" = "Personal Information and Permissions"; -"XPPrivacyViewController1" = "System Permissions Management"; -"XPPrivacyViewController2" = "Privacy Protection Guide"; -"XPPrivacyViewController3" = "Third-party SDK Directory"; -"XPPrivacyViewController4" = "Personal Information Collection Checklist"; -"XPPrivacyViewController5" = "Device Permission List"; -"XPPrivacyViewController6" = "User Recharge Agreement"; -"XPPrivacyViewController7" = "User Registration Service Agreement"; -"XPPrivacyViewController8" = "Live Service Agreement"; -"XPPrivacyViewController9" = "Community Guidelines"; -"XPPrivacyViewController10" = "Account Cancellation Agreement"; - -"XPPermissionsViewController0" = "System Permissions Management"; -"XPPermissionsViewController1" = "Photos"; -"XPPermissionsViewController2" = "Read photos from album or save photos to album"; -"XPPermissionsViewController3" = "Microphone"; -"XPPermissionsViewController4" = "Record audio"; -"XPPermissionsViewController5" = "Camera"; -"XPPermissionsViewController6" = "Take photos or record videos"; -"XPPermissionsViewController7" = "No authorized system permissions"; -"XPPermissionsViewController8" = "—— Only show authorized system permissions ——"; -"XPPermissionsViewController9" = "Go to system settings>"; - -"XPRoomSearchContainerViewController0" = "Please enter what you want to search for"; -"XPRoomSearchContainerViewController1" = "Please enter what you want to search for"; -"XPRoomSearchContainerViewController2" = "Please enter what you want to search for"; -"XPRoomSearchContainerViewController4" = "User"; - -"XPRoomSearchRecordViewController0" = "Clear"; -"XPRoomSearchRecordViewController1" = "Oops"; -"XPRoomSearchRecordViewController2" = "Are you sure you want to clear the search history?"; -"XPRoomSearchRecordViewController3" = "Clear"; -"XPRoomSearchRecordViewController4" = "Oops"; -"XPRoomSearchRecordViewController5" = "Are you sure you want to clear the entry records?"; -"XPRoomSearchRecordViewController6" = "Everyone is searching"; -"XPRoomSearchRecordViewController7" = "Search history"; -"XPRoomSearchRecordViewController8" = "Entry records"; -"XPRoomSearchRecordViewController9" = "%zds remaining"; - -"XPHomeRedommendCollectionViewCell0" = "PK In Progress"; -"XPHomeRedommendCollectionViewCell1" = "Waiting for Participants"; - -"XPHomeCollectRoomTableViewCell0" = "PK In Progress"; - -"XPSearchListTableViewCell0" = "Room %@"; -"XPSearchListTableViewCell1" = "Live"; -"XPSearchListTableViewCell2" = "Room %@"; -"XPSearchListTableViewCell3" = "Messages"; -"XPSearchListTableViewCell4" = "Live"; - -"XPHomeAttentionCollectionViewCell0" = "Live"; - -"XPHomeSearchRelateView0" = "Related Rooms"; - -"XPHomeSearchNavView0" = "Search Nickname/ID/Room Name"; -"XPHomeSearchNavView1" = "Search"; - -"XPRoomSearchRecommendHeadView0" = "No live rooms yet"; -"XPRoomSearchRecommendHeadView1" = "Recommended for You"; - -"XPNewHomePlayEmptyTableViewCell0" = "Create a room and make friends together"; - -"XPNewHomeViewController2" = "Recommendations"; -"XPNewHomeViewController3" = "Recommendations"; -"XPHomeMineViewController1" = "Recent"; -"XPHomeMineViewController2" = "%@'s room"; -"XPHomeMineViewController3" = "Welcome to my room"; - -"XPNewHomeNavView0" = "Search Nickname/ID/Room"; - -"XPHomeRecommendViewController0" = "Expand Chat"; -"XPHomeRecommendViewController1" = "Room Parties"; - -"XPHomePartyViewController0" = "No more rooms"; - -"XPRoomNewUserGreetView0" = "They sent you a message~"; -"XPRoomNewUserGreetView1" = "They sent you multiple messages~"; -"XPRoomNewUserGreetView2" = "They sent multiple messages~"; -"XPRoomNewUserGreetView3" = "Click to view"; - -"XPAnchorPKRuleView0" = "PK Rules"; - -"XPAnchorRandomPKRuleView0" = "PK Rules"; -"XPAnchorRandomPKRuleView1" = "Random PK"; -"XPAnchorRandomPKRuleView2" = "Participate in matching and randomly PK with a host, start PK after successful matching. PK duration is fixed"; -"XPAnchorRandomPKRuleView3" = "Invitation PK"; -"XPAnchorRandomPKRuleView4" = "Specify a host to invite for PK, start PK after the other party accepts"; - -"XPAnchorPKResultView0" = "PK Value"; -"XPAnchorPKResultView1" = "PK Value"; -"XPAnchorPKResultView2" = "Close"; -"XPAnchorPKResultView3" = "Close"; -"XPAnchorPKResultView4" = "Top 3 contributions in this PK"; -"XPAnchorPKResultView5" = "No gifts sent yet, play another round~"; -"XPAnchorPKResultView6" = "PK Value: %@"; -"XPAnchorPKResultView7" = "Close (%ld)"; -"XPAnchorPKResultView8" = "Close (5)"; - -"XPAnchorPKInviteView0" = "PK Duration"; -"XPAnchorPKInviteView1" = "%@ minutes"; -"XPAnchorPKInviteView2" = "PK Invitation"; -"XPAnchorPKInviteView3" = "Inviter:"; -"XPAnchorPKInviteView4" = "PK Duration:"; -"XPAnchorPKInviteView5" = "PK Gameplay:"; -"XPAnchorPKInviteView6" = "Reject"; -"XPAnchorPKInviteView7" = "Accept"; - -"XPAnchorPKFinishView0" = "PK Ended"; - -"XPAnchorPkPanelView0" = "The host has muted the sound of the other room"; -"XPAnchorPkPanelView1" = "Calculating results"; -"XPAnchorPkPanelView2" = "Followed successfully"; -"XPAnchorPkPanelView3" = "Penalty Time"; - -"XPAnchorPKViewController0" = "PK initiated, please wait for the other party to accept"; -"XPAnchorPKViewController1" = "Got it"; -"XPAnchorPKViewController2" = "PK duration can be up to 30 minutes"; -"XPAnchorPKViewController3" = "PK duration can be at least 5 minutes"; -"XPAnchorPKViewController4" = "Host PK"; -"XPAnchorPKViewController5" = "Select PK target"; -"XPAnchorPKViewController6" = "Select PK duration"; -"XPAnchorPKViewController7" = "10 minutes"; -"XPAnchorPKViewController8" = "20 minutes"; -"XPAnchorPKViewController9" = "30 minutes"; -"XPAnchorPKViewController10" = "Custom (5-30) minutes"; -"XPAnchorPKViewController11" = "PK Gameplay"; -"XPAnchorPKViewController12" = "Optional, within 10 characters"; -"XPAnchorPKViewController13" = "Challenge"; -"XPAnchorPKSelectTypeController0" = "Select PK Mode"; - -"XPAnchorPKTableViewCell0" = "In PK"; -"XPAnchorPKTableViewCell1" = "Offline"; -"XPAnchorPKTableViewCell2" = "Select"; - -"XPAnchorPKSelectRoomView0" = "No more rooms"; -"XPAnchorPKSelectRoomView1" = "Please enter the room ID to search"; -"XPAnchorPKSelectRoomView2" = "Please enter the room ID"; - -"XPRoomPKResultView0" = "· Blue Team Performance ·"; -"XPRoomPKResultView1" = "View My Performance>"; -"XPRoomPKResultView2" = "None"; -"XPRoomPKResultView3" = "· Red Team Performance ·"; -"XPRoomPKResultView4" = "View Opponent Performance>"; -"XPRoomPKResultView5" = "None"; -"XPRoomPKResultView6" = "· Red Team Performance ·"; -"XPRoomPKResultView7" = "View My Performance>"; -"XPRoomPKResultView8" = "None"; -"XPRoomPKResultView9" = "· Blue Team Performance ·"; -"XPRoomPKResultView10" = "View Red Team Performance>"; -"XPRoomPKResultView11" = "None"; -"XPRoomPKResultView12" = "· Red Team Performance"; -"XPRoomPKResultView13" = "View Blue Team Performance>"; -"XPRoomPKResultView14" = "None"; -"XPRoomPKResultView15" = "· Blue Team Performance"; -"XPRoomPKResultView16" = "View Red Team Performance"; -"XPRoomPKResultView17" = "None"; -"XPRoomPKResultView18" = "· Blue Team Victory ·"; -"XPRoomPKResultView19" = "View Red Team Performance"; -"XPRoomPKResultView20" = "None"; -"XPRoomPKResultView21" = "· Red Team Victory ·"; -"XPRoomPKResultView22" = "View Blue Team Performance"; -"XPRoomPKResultView23" = "None"; -"XPRoomPKResultView24" = "· Balanced ·"; -"XPRoomPKResultView25" = "This Round Draws Combat Value"; -"XPRoomPKResultView26" = "PK Players:"; -"XPRoomPKResultView27" = "Combat Value:"; -"XPRoomPKResultView28" = "Guardian:"; -"XPRoomPKResultView29" = "Guardian Value:"; -"XPRoomPKResultView30" = "View Opponent Performance"; -"XPRoomPKResultView31" = "Don't be discouraged, %@ always supports you"; - -"XPRoomPKRecordViewController0" = "PK Records"; -"XPRoomPKRecordViewController1" = "No more records"; - -"XPRoomPKTimePickerView0" = "%d minutes"; -"XPRoomPKTimePickerView1" = "0 minutes"; -"XPRoomPKTimePickerView2" = "30 minutes"; -"XPRoomPKTimePickerView3" = "%d minutes %d seconds"; -"XPRoomPKTimePickerView4" = "%d seconds"; -"XPRoomPKTimePickerView5" = "Cancel"; - -"XPRoomPKTimePickerView7" = "0 seconds"; -"XPRoomPKTimePickerView8" = "30 seconds"; - -"XPRoomPKSelectUserView0" = "NO.0"; - -"XPRoomPKSelectUserView2" = "NO.%d"; - -"XPRoomPKUserView0" = "Waiting to Get on Mic"; -"XPRoomPKUserView1" = "Waiting to Get on Mic"; - -"XPRoomPKTimeTableViewCell0" = "PK Time"; -"XPRoomPKTimeTableViewCell1" = "30 seconds"; - -"XPRoomPKTypeTableViewCell0" = "PK Mode"; -"XPRoomPKTypeTableViewCell1" = "Team PK"; - -"XPRoomPKVoteTableViewCell0" = "Voting Type"; -"XPRoomPKVoteTableViewCell1" = "By Gift Value"; -"XPRoomPKVoteTableViewCell2" = "By Number of Gift Senders"; - -"XPRoomPKRecordTableViewCell0" = "Draw"; -"XPRoomPKRecordTableViewCell1" = "Draw"; -"XPRoomPKRecordTableViewCell2" = "Victory"; -"XPRoomPKRecordTableViewCell3" = "Defeat"; -"XPRoomPKRecordTableViewCell4" = "Defeat"; -"XPRoomPKRecordTableViewCell5" = "Victory"; -"XPRoomPKRecordTableViewCell6" = "By Gift Value"; -"XPRoomPKRecordTableViewCell7" = "By Number of Gift Senders"; - -"XPRoomPKEmptyTableViewCell0" = "No data"; - -"XPRoomPKProgressView0" = "Start PK Successfully"; -"XPRoomPKProgressView1" = "Close PK Mode Successfully"; -"XPRoomPKProgressView2" = "Not Started"; -"XPRoomPKProgressView3" = "Restarting will end the current PK prematurely. Are you sure you want to restart?"; -"XPRoomPKProgressView4" = "Restart PK?"; -"XPRoomPKProgressView5" = "The current stage is in preparation. Are you sure you want to prepare for PK?"; -"XPRoomPKProgressView6" = "At least one person per team"; -"XPRoomPKProgressView7" = "Failed to get PK information"; -"XPRoomPKProgressView8" = "Not Started"; -"XPRoomPKProgressView9" = "Start PK"; -"XPRoomPKProgressView10" = "Restart PK?"; -"XPRoomPKProgressView11" = "Countdown"; - - -"XPRoomPKViewController0" = "Create PK"; -"XPRoomPKViewController1" = "PK Records"; -"XPRoomPKViewController2" = "Created Successfully"; -"XPRoomPKViewController3" = "Ending the PK will close the ongoing PK and restore normal room mode. Are you sure you want to close the current PK?"; -"XPRoomPKViewController4" = "Creating this PK will override the ongoing PK. Are you sure you want to override the current PK?"; - -"XPRoomPKViewController6" = "Create Again"; -"XPRoomPKViewController7" = "Close PK Mode"; - -"XPRoomPKPlayingView1" = "By Number of Gift Senders"; -"XPRoomPKPlayingView2" = "Restart"; - -"XPAcrossRoomPKViewController0" = "PK initiated, please wait for the opponent to accept"; -"XPAcrossRoomPKViewController1" = "Got it"; -"XPAcrossRoomPKViewController2" = "The maximum PK duration is 180 minutes"; -"XPAcrossRoomPKViewController3" = "The minimum PK duration is 5 minutes"; -"XPAcrossRoomPKViewController4" = "Cross-room"; -"XPAcrossRoomPKViewController5" = "Select PK Target"; -"XPAcrossRoomPKViewController6" = "Select PK Duration"; -"XPAcrossRoomPKViewController7" = "10 minutes"; -"XPAcrossRoomPKViewController8" = "20 minutes"; -"XPAcrossRoomPKViewController9" = "30 minutes"; -"XPAcrossRoomPKViewController10" = "Custom (5-180) minutes"; -"XPAcrossRoomPKViewController11" = "PK Gameplay"; -"XPAcrossRoomPKViewController12" = "Optional, within 10 characters"; -"XPAcrossRoomPKViewController13" = "Challenge"; - -"XPAcrossRoomPKInviteResultView0" = "The opponent accepted your PK request, preparing for PK"; -"XPAcrossRoomPKInviteResultView1" = "The opponent rejected your PK request"; - -"XPAcrossRoomPKPanelView0" = "Calculating PK Results"; -"XPAcrossRoomPKPanelView1" = "1) Points are awarded based on the value of gifts received (1 Coins = 1 point). The side with higher gift value wins.\n2) After the PK, if the score difference is ≥1314 or the total score of both sides is ≥15000 (excluding draws), the PK results will be displayed in rooms of the same type as the winning side; if the score difference is ≥5200 or the total score of both sides is ≥30000 (excluding draws), the PK results will be displayed in all rooms across the platform."; -"XPAcrossRoomPKPanelView2" = "Assist"; -"XPAcrossRoomPKPanelView3" = "Watch"; -"XPAcrossRoomPKPanelView4" = "Big Spender"; -"XPAcrossRoomPKPanelView5" = "Charm"; - -"XPAcrossRoomPKForceEndResultView0" = "PK Ended"; - -"XPAcrossRoomPKCountDownView0" = "Next PK"; - -"XPAcrossRoomPKPrizeView0" = "Watch"; -"XPAcrossRoomPKPrizeView1" = "Come Watch"; - -"XPAcrossRoomPKResultView0" = "Big Spender Value"; -"XPAcrossRoomPKResultView1" = "Charm Value"; - -"XPAnchorPKMatchView0" = "Cancel Matching?"; -"XPAnchorPKMatchView1" = "No suitable PK target found. Continue?"; -"XPAnchorPKMatchView2" = "Matching for PK"; - -"XPAcrossRoomPKInviteView0" = "PK Duration"; -"XPAcrossRoomPKInviteView1" = "%@ minutes"; -"XPAcrossRoomPKInviteView2" = "PK Invitation"; -"XPAcrossRoomPKInviteView3" = "Inviter"; -"XPAcrossRoomPKInviteView4" = "PK Duration"; -"XPAcrossRoomPKInviteView5" = "PK Gameplay"; -"XPAcrossRoomPKInviteView6" = "Reject"; -"XPAcrossRoomPKInviteView7" = "Accept"; -"XPAcrossRoomPKInviteView8" = "Cross-room PK"; - - -"XPAcrossRoomPKRuleView0" = "How to Start Cross-room PK"; -"XPAcrossRoomPKRuleView1" = "1) Only the room owner and super admin of the licensed room can initiate cross-room PK, and only one licensed room can be selected for initiation at a time;\n2) Only the room owner and super admin can accept or reject cross-room PK requests. If no action is taken on the PK invitation popup within 10 seconds, it will disappear, and it will be considered as an automatic rejection;\n3) When initiating PK, you need to select the PK time and PK target. The custom time range is from 5 to 180, and only integers can be entered;\n4) After PK initiation, it cannot be ended before the PK time. If there are special circumstances requiring early termination, please contact customer service, but the result of this PK will not be counted."; - -"XPAcrossRoomPKEmptyTableViewCell0" = "No search results"; - -"XPAcrossRoomPKSelectRoomView0" = "No more rooms"; -"XPAcrossRoomPKSelectRoomView1" = "Please enter the room ID to search"; -"XPAcrossRoomPKSelectRoomView2" = "Please enter the room ID"; -"XPAcrossRoomPKSelectRoomView3" = "Confirm Selection"; - -"XPMiniRoomView0" = "You have been kicked out of the live room by the administrator"; -"XPMiniRoomView1" = "You have been kicked out of the live room by the administrator"; -"XPMiniRoomView2" = "The host or administrator has pulled you onto the stage"; -"XPMiniRoomView3" = "You have been pulled onto the stage by the host or administrator, but your microphone is off. If you need to speak, please turn on your microphone."; - -"XPUserCardPresenter1" = "Host"; -"XPUserCardPresenter2" = "Male God Slot %d"; -"XPUserCardPresenter3" = "Female God Slot %d"; -"XPUserCardPresenter4" = "NO.%d"; -"XPUserCardPresenter5" = "Close mic"; -"XPUserCardPresenter6" = "Turn on Mic"; -"XPUserCardPresenter7" = "Hold he on the mic"; -"XPUserCardPresenter8" = "Listen in on the mic"; -"XPUserCardPresenter9" = "Take Off Mic"; -"XPUserCardPresenter11" = "Unlock"; -"XPUserCardPresenter10" = "Lock mic"; -"XPUserCardPresenter12" = "Clear Gift Value"; -"XPUserCardPresenter13" = "Send Gift"; -"XPUserCardPresenter14" = "Private Chat"; -"XPUserCardPresenter15" = "Follow"; -"XPUserCardPresenter16" = "Followed"; -"XPUserCardPresenter17" = "Kick Out"; -"XPUserCardPresenter18" = "Set Admin"; -"XPUserCardPresenter19" = "Cancel Admin"; -"XPUserCardPresenter20" = "Add to Blacklist"; - -"XPUserCardPresenter21" = "Host"; -"XPUserCardPresenter22" = "@them"; -"XPUserCardViewController0" = "ID:%ld"; -"XPUserCardViewController1" = "User is not in the room"; -"XPUserCardViewController2" = "The user has been blacklisted"; -"XPUserCardViewController3" = "Clear successful"; -"XPUserCardViewController4" = "Operation successful"; -"XPUserCardViewController5" = "The user is %@ VIP, only the host can kick out"; -"XPUserCardViewController6" = "The user is %@ VIP. Confirm to kick them out of the room?"; -"XPUserCardViewController7" = "In game mode, if this player quits the game, do you want to kick them out of the room?"; -"XPUserCardViewController8" = "In game mode, if this player quits the game, do you want to kick them out of the room?"; -"XPUserCardViewController9" = "Do you want to kick %@ out of the room?"; -"XPUserCardViewController10" = "Operation reminder"; -"XPUserCardViewController11" = "The user is %@ VIP, only the host can kick them out"; -"XPUserCardViewController12" = "The user is %@ VIP. Confirm to blacklist them?"; -"XPUserCardViewController13" = "In game mode, if this player quits the game, do you want to kick them out of the room?"; -"XPUserCardViewController14" = "Do you want to add %@ to the blacklist? After adding, they will not be able to enter this room. In game mode, if this player quits the game"; -"XPUserCardViewController15" = "You are blacklisting %@"; -"XPUserCardViewController16" = "After blacklisting, they will not be able to join this room"; -"XPUserCardViewController17" = "Room chat is closed"; -"XPUserCardViewController18" = "Cannot actively go off mic during the game!"; -"XPUserCardViewController19" = "After taking them off mic, the player will quit the game. Do you want to continue?"; -"XPUserCardViewController20" = "Confirm selection of guest %d?"; -"XPUserCardViewController21" = "This selection cannot be canceled or modified"; - -"XPUserCardViewController22" = "Report"; -"XPUserCardViewController23" = "Select heartthrob"; -"XPUserCardViewController24" = "Copy successful"; -"XPRoomInsideRecommendEmptyCell0" = "Trying to find suitable rooms"; - -"XPRoomRecommendView0" = "Hide & Report"; -"XPRoomRecommendView1" = "Hide Room"; -"XPRoomRecommendView2" = "Exit Room"; -"XPRoomRecommendView3" = "Recommended for you"; - -"XPAnchorFansTeamEntranceView0" = "Fans Team (%ld)"; -"XPAnchorFansTeamEntranceView1" = "Open Fans Team"; -"XPAnchorFansTeamEntranceView2" = "Fans LV.%zd "; -"XPAnchorFansTeamEntranceView3" = "Join Fans Team"; -"XPAnchorFansTeamEntranceView4" = "Not open yet"; - -"XPAnchorFansTaskTableViewCell0" = "Completed"; - -"XPAnchorFansTeamViewController0" = "·%ld people"; -"XPAnchorFansTeamViewController1" = "Joined fans team successfully"; - -"XPAnchorFansTaskViewController0" = "·%ld people"; -"XPAnchorFansTaskViewController1" = "Intimacy LV%ld"; -"XPAnchorFansTaskViewController2" = "Cannot join again within 24 hours after quitting the fans team, are you sure you want to quit?"; -"XPAnchorFansTaskViewController3" = "View fans team instructions"; -"XPAnchorFansTaskViewController4" = "Quit fans team"; - -"XPAnchorAudienceUpMicView0" = "TA quietly clicked on the guest position\nDo you want to invite them to come up and interact?"; -"XPAnchorAudienceUpMicView1" = "Cancel"; -"XPAnchorAudienceUpMicView2" = "Confirm"; - -"XPRoomAnchorInfoCardView0" = "Followed"; -"XPRoomAnchorInfoCardView1" = "Click to follow, don't get lost next time you go live~"; -"XPRoomAnchorInfoCardView2" = "Follow"; - -"XPRoomAnchorRankEnterView0" = "Hourly"; - -"XPRoomFunctionContainerView0" = "Start Selection>"; -"XPRoomFunctionContainerView1" = "Announce Crush>"; -"XPRoomFunctionContainerView2" = "End This Round>"; -"XPRoomFunctionContainerView3" = "Guest Interaction>"; -"XPRoomFunctionContainerView4" = "Host Ranking"; -"XPRoomFunctionContainerView5" = "Room"; -"XPRoomFunctionContainerView6" = "Host Ranking"; -"XPRoomFunctionContainerView7" = "Room"; -"XPRoomFunctionContainerView8" = "Enter heartthrob selection?"; -"XPRoomFunctionContainerView9" = "Enter heartthrob announcement?"; -"XPRoomFunctionContainerView10" = "End this round and clear charm value?"; -"XPRoomFunctionContainerView11" = "Enter guest interaction?"; -"XPRoomFunctionContainerView12" = "Topic not set"; -"XPRoomFunctionContainerView13" = "Start Selection>"; -"XPRoomFunctionContainerView18" = "Cannot switch games or gameplay during the game!"; -"XPRoomFunctionContainerView19" = "The game is in progress and cannot be stopped!"; -"XPRoomFunctionContainerView20" = "Are you sure you want to switch to a normal room?"; - -"XPRoomBackContainerView0" = "Exclusive background image for VIP failed to load"; -"XPRoomBackContainerView1" = "Personal broadcast background image failed to load"; - -"XPRoomRankEntranceView0" = "Room"; - -"XPRoomDatingVipUpMicView0" = "1. Each round of dating, the user with the highest gift value accumulatively sent in the “Guest Interaction” stage to a minimum of 999 Coins will automatically occupy the VIP seat;\n\n2. If there are multiple users who meet the requirements for occupying the VIP seat, the VIP seat will be finally obtained by the user with the highest cumulative gift value. If the gift values are the same, the user who reaches the value first will be the winner;\n\n3. Users occupying the VIP seat can choose whether to go off the mic. Other users cannot take their seats by proxy;\n\n4. Users can only snatch the VIP seat during the “Guest Interaction” stage. After the “Guest Interaction” stage, even if they send gifts exceeding the total VIP gift value, they cannot change the occupant;\n\n5. After each round of dating ends, the VIP seat will be cleared, and a new round will start to grab the seat again."; - -"XPNewUserRoomGiftView0" = "Received newcomer gift "; -"XPNewUserRoomGiftView1" = "Has been placed in your backpack, please use it as soon as possible~"; - -"XPMoreMenuPresenter1" = "PK Mode"; -"XPMoreMenuPresenter3" = "Open Gift Value"; -"XPMoreMenuPresenter5" = "Open My Effects"; -"XPMoreMenuPresenter6" = "Wish Gift"; -"XPMoreMenuPresenter8" = "Dating Room"; -"XPMoreMenuPresenter10" = "Cross-room"; -"XPMoreMenuPresenter12" = "Host"; -"XPMoreMenuPresenter13" = "End"; -"XPMoreMenuPresenter14" = "Host PK in progress"; -"XPMoreMenuPresenter15" = "End PK"; -"XPMoreMenuPresenter16" = "End"; -"XPMoreMenuPresenter17" = "PK Matching"; -"XPMoreMenuPresenter19" = "Close Public Screen"; -"XPMoreMenuPresenter20" = "Clear Public Screen"; -"XPMoreMenuPresenter21" = "Room Settings"; -"XPMoreMenuPresenter22" = "Invite Fans"; -"XPMoreMenuPresenter23" = "Publish Broadcast"; -"XPMoreMenuPresenter24" = "Red Packet"; -"XPMoreMenuPresenter25" = "Room type"; - -"XPMoreMenuPresenter26" = "PK in progress..."; -"XPMoreMenuPresenter27" = "Close Gift Value"; -"XPMoreMenuPresenter28" = "Close My Effects"; -"XPMoreMenuPresenter29" = "Dating in progress.."; -"XPMoreMenuPresenter30" = "Cross-room PK in progress"; -"XPMoreMenuPresenter31" = "Cross-room PK"; -"XPMoreMenuPresenter32" = "Host PK in progress"; -"XPMoreMenuPresenter33" = "Host PK"; -"XPMoreMenuPresenter34" = "Open Public Screen"; -"XPMoreMenuPresenter35" = "Room Loudspeaker"; -"XPMoreMenuPresenter36" = "Report Block"; -"XPMoreMenuPresenter37" = "Room Album"; - -"XPRoomMoreMenuViewController0" = "Open Gift Value successfully"; -"XPRoomMoreMenuViewController1" = "Close Gift Value successfully"; -"XPRoomMoreMenuViewController2" = "Cannot close room gift value in dating mode"; -"XPRoomMoreMenuViewController3" = "Closing gift value will clear all current mic gift value data. Are you sure you want to close it?"; -"XPRoomMoreMenuViewController4" = "Gift effect enabled"; -"XPRoomMoreMenuViewController5" = "Gift effect disabled"; -"XPRoomMoreMenuViewController6" = "Cannot enable dating mode in cross-room PK!"; -"XPRoomMoreMenuViewController7" = "Cannot enable dating mode in room PK!"; -"XPRoomMoreMenuViewController8" = "Enable dating mode? Enabling will clear the existing gift values"; -"XPRoomMoreMenuViewController9" = "Enable"; -"XPRoomMoreMenuViewController10" = "Prompt"; -"XPRoomMoreMenuViewController11" = "Disable dating mode?"; -"XPRoomMoreMenuViewController12" = "Disable"; -"XPRoomMoreMenuViewController13" = "Cannot enable cross-room PK in dating!"; -"XPRoomMoreMenuViewController14" = "Cannot enable PK mode during PK!"; -"XPRoomMoreMenuViewController15" = "Currently in cross-room PK!"; -"XPRoomMoreMenuViewController16" = "Cancel Matching?"; -"XPRoomMoreMenuViewController17" = "Prompt"; -"XPRoomMoreMenuViewController18" = "Are you sure you want to clear all public screen messages? (Cannot be undone)"; - -"XPRoomMoreMenuViewController20" = "Cannot enable PK mode during dating!"; -"XPRoomMoreMenuViewController21" = "Cannot enable PK mode during cross-room PK!"; - -"XPRoomInviteFansView0" = "Remaining %d times today"; -"XPRoomInviteFansView1" = "No more times left today"; -"XPRoomInviteFansView2" = "After confirming the invitation, reminders will be sent to %ld users who have favorited this room"; -"XPRoomInviteFansView3" = "Confirm invitation"; -"XPRoomInviteFansView4" = "%02d min %02d sec until you can invite"; -"XPRoomInviteFansView5" = "Invite room fans"; -"XPRoomInviteFansView6" = "Daily invites cannot exceed 5 times"; -"XPRoomInviteFansView7" = "One invitation per hour"; -"XPRoomInviteFansView8" = "Confirm invitation"; - -"XPRoomMenuContainerView0" = "Room chat is closed"; -"XPRoomMenuContainerView1" = "PK has started, temporarily unable to queue"; -"XPRoomMenuContainerView2" = "Say something..."; -"XPRoomMenuContainerView3" = "Say hello to everyone"; - -"XPRoomSendTextView0" = "Enter message..."; -"XPRoomSendTextView1" = "Send"; - -"DatingStageView0" = "You are already on the mic"; -"DatingStageView1" = "You need to queue to go on the mic"; -"DatingStageView3" = "Open Mic"; -"DatingStageView4" = "Go on Mic"; - -"StageView0" = "Host or admin pulled you onto the stage"; -"StageView1" = "You have been pulled onto the stage by the host or admin, but your microphone is off. If you need to speak, please turn on your microphone."; -"StageView2" = "Remove from stage"; -"StageView3" = "Please turn off exit mode first"; -"StageView4" = "This mic slot is already taken~"; -"StageView5" = "Go on mic"; -"StageView6" = "Settle in slot"; -"StageView8" = "Switch to free mic"; -"StageView10" = "Unlock"; -"StageView12" = "Unlock slot"; -"StageView14" = "Open Mic"; -"StageView16" = "Turn on mic for slot"; -"StageView18" = "Pull them onto the mic"; -"StageView19" = "You are already on the mic"; -"StageView20" = "You need to queue to go on mic~"; -"StageView21" = "Going on mic"; -"StageView22" = "Switch to queue"; -"StageView23" = "Lock Mic"; -"StageView24" = "Lock slot"; -"StageView25" = "Mute"; -"StageView26" = "Mute slot"; -"StageView27" = "Pull them onto the mic as host"; -"StageView28" = "Go off mic and listen"; -"StageView29" = "Follow"; - -"AnchorStageView1" = "Unlock"; -"AnchorStageView3" = "Open Mic"; -"AnchorStageView4" = "Pull them onto the mic"; -"AnchorStageView5" = "You are already on the mic"; -"AnchorStageView6" = "Let the host pull you onto the mic for more interaction~"; - - - -"LittleGameMicroView0" = "Host"; -"LittleGameMicroView1" = "Not ready"; -"LittleGameMicroView2" = "Ready"; -"LittleGameMicroView3" = "In game"; -"LittleGameMicroView4" = "Not ready"; - -"MicroGiftValueView0" = "99.99M+"; -"MicroGiftValueView1" = "%lldM"; - -"MicroView0" = "NO."; -"MicroView1" = "Slot"; -"MicroView2" = "Red Team"; -"MicroView3" = "Blue Team"; -"MicroView4" = "Leave"; - -"MicroDatingProgressView0" = "Guest Interaction"; -"MicroDatingProgressView1" = "Guest Interaction"; -"MicroDatingProgressView2" = "Heartthrob Selection"; -"MicroDatingProgressView3" = "Announce Heartthrob"; -"MicroDatingProgressView4" = "Guest Interaction"; - -"DatingMicroView0" = "Host"; -"DatingMicroView1" = "Goddess Slot"; -"DatingMicroView2" = "God Slot"; -"DatingMicroView3" = "Select No. %d"; -"DatingMicroView4" = "Not Selected"; -"DatingMicroView5" = "Select VIP"; -"DatingMicroView6" = "Select No. %d"; -"DatingMicroView7" = "Not Selected"; -"DatingMicroView8" = "Select No. %d"; -"DatingMicroView9" = "Selected"; -"DatingMicroView10" = "Not Selected"; -"DatingMicroView11" = "Select"; -"DatingMicroView12" = "Select No. %d"; -"DatingMicroView13" = "Selected"; -"DatingMicroView14" = "Selected"; -"DatingMicroView15" = "Not Selected"; -"DatingMicroView16" = "Select No. %d"; -"DatingMicroView17" = "Not Selected"; -"DatingMicroView18" = "Select"; -"DatingMicroView19" = "Select No. %d"; -"DatingMicroView20" = "Not Selected"; -"DatingMicroView21" = "Not Selected"; - -"AnchorPKStageView0" = "Rules"; - -///RoomHeaderView.m -"RoomHeaderView0" = "Online: %ld   ID: %ld"; -"RoomHeaderView1" = "Online: %ld   ID: %ld"; -"RoomHeaderView2" = "Online: %ld   ID: %ld"; -"RoomHeaderView3" = "Copy Link"; -"RoomHeaderView4" = "Come to E-Party, play games and make friends"; -"RoomHeaderView5" = "Beautiful people with sweet voices win points, let's play together~"; -"RoomHeaderView6" = "Bookmark Successful"; -"RoomHeaderView7" = "Share Successful"; -"RoomHeaderView8" = "Bookmark"; -"RoomHeaderView9" = "Bookmarked"; -"RoomHeaderView10" = "Block Room"; -"RoomHeaderView11" = "Room Blocked"; -"RoomHeaderView12" = "Report Room or User"; - -"XPRoomMorePlayPresenter0" = "Voyage"; - -"XPReleaseRadioViewController0" = "Broadcast Successful"; -"XPReleaseRadioViewController1" = "You can't broadcast again within %zd minutes after broadcasting"; -"XPReleaseRadioViewController2" = "Content cannot be less than %zd characters, please speak civilized~"; -"XPReleaseRadioViewController3" = "Broadcast"; -"XPReleaseRadioViewController4" = "You will release a broadcast on the homepage to invite other users to enter the current room!"; -"XPReleaseRadioViewController5" = "Broadcast Content"; -"XPReleaseRadioViewController6" = "Remaining broadcast times today"; -"XPReleaseRadioViewController7" = "Content cannot be less than 5 characters, please speak civilized~"; -"XPReleaseRadioViewController8" = "Release"; -"XPReleaseRadioViewController9" = "You can't broadcast again within 5 minutes after broadcasting"; -"XPReleaseRadioViewController10" = "Can broadcast again after"; - -"XPRoomTransferMusicViewController0" = "Music Transfer"; -"XPRoomTransferMusicViewController1" = "(You are currently using 4G/3G/2G network, unable to use)"; -"XPRoomTransferMusicViewController2" = "Please connect to WIFI"; -"XPRoomTransferMusicViewController3" = "No network available"; -"XPRoomTransferMusicViewController4" = "Please connect"; -"XPRoomTransferMusicViewController5" = "Connected to WIFI"; -"XPRoomTransferMusicViewController6" = "No network available"; -"XPRoomTransferMusicViewController7" = "Please connect"; -"XPRoomTransferMusicViewController8" = "Unable to use under 4G/3G/2G network"; -"XPRoomTransferMusicViewController9" = "Please connect"; -"XPRoomTransferMusicViewController10" = "Connected"; -"XPRoomTransferMusicViewController11" = "Unknown Artist"; -"XPRoomTransferMusicViewController12" = "Unknown"; -"XPRoomTransferMusicViewController13" = "%ld songs imported"; -"XPRoomTransferMusicViewController14" = "Connected"; -"XPRoomTransferMusicViewController15" = "As shown: Please enter in the browser on your computer while connected to the same WiFi"; -"XPRoomTransferMusicViewController16" = -"You can import and delete songs on the opened webpage. \nPlease do not leave the current page until the song import is complete."; -"XPRoomTransferMusicViewController17" = "0 songs imported"; -"XPRoomTransferMusicViewController18" = "Imported 0 songs"; -"XPRoomTransferMusicViewController19" = "Copy Link"; -"XPRoomTransferMusicViewController20" = "Copied successfully"; - -"XPRoomBackMusicPlayerView1" = "Loop Playlist"; -"XPRoomBackMusicPlayerView2" = "No Music Playing"; -"XPRoomBackMusicPlayerView3" = "No Music Playing"; -"XPRoomBackMusicPlayerView4" = "No Music Playing"; -"XPRoomBackMusicPlayerView5" = "Repeat Single Track"; - -"XPMusicLibraryPlayView0" = "No Songs"; -"XPMusicLibraryPlayView1" = "No Songs"; - -"XPRoomMusicVoiceSettingView0" = "Voice"; -"XPRoomMusicVoiceSettingView1" = "Music"; - -"XPRoomMusicLibraryEmptyTableViewCell0" = "No Data"; -"XPRoomMusicLibraryEmptyTableViewCell1" = "Transfer More Songs"; - -"XPRoomMusicLibraryViewController0" = "My Music Library"; -"XPRoomMusicLibraryViewController1" = "Total %ld Songs"; -"XPRoomMusicLibraryViewController2" = "Delete"; - -"XPRoomMessageContainerView0" = "%lu People Mentioned You"; -"XPRoomMessageContainerView1" = "%lu People Mentioned You"; -"XPRoomMessageContainerView2" = "%zd People Mentioned You"; -"XPRoomMessageContainerView3" = "[Room Notice] \n %@"; -"XPRoomMessageContainerView4" = "[Room Notice"; -"XPRoomMessageContainerView5" = "Tap to view this room's notice"; -"XPRoomMessageContainerView6" = "New Messages at Bottom"; -"XPRoomMessageContainerView7" = "Someone Mentioned You"; - -"XPRoomMessageHeaderView0" = "The platform promotes friendly interactions and prohibits the promotion and dissemination of illegal content. Fraudulent activities against users are strictly prohibited. Any violations will result in account suspension. Please report any violations promptly."; - -"XPRoomMessageParser0" = "Me:"; -"XPRoomMessageParser1" = " is driving "; -"XPRoomMessageParser2" = "According to the homepage recommendation"; -"XPRoomMessageParser3" = "Following"; -"XPRoomMessageParser4" = "Accepting"; -"XPRoomMessageParser5" = "'s invitation"; -"XPRoomMessageParser6" = " Entered the room"; -"XPRoomMessageParser7" = "Welcome, everyone"; -"XPRoomMessageParser8" = "The dating gameplay has started, please click on the host mic slot to select the host"; -"XPRoomMessageParser9" = "Open"; -"XPRoomMessageParser10" = "'s red packet received"; -"XPRoomMessageParser11" = "%@ Coins"; -"XPRoomMessageParser12" = "Awesome! "; -"XPRoomMessageParser13" = "Obtained in voyage adventure "; -"XPRoomMessageParser14" = "Congratulations "; -"XPRoomMessageParser15" = "Congratulations to %@ for in %@'s room passing %@ , resulting in %@"; -"XPRoomMessageParser19" = "Room owner/administrator invited"; -"XPRoomMessageParser20" = "to join"; -"XPRoomMessageParser21" = "Red Team"; -"XPRoomMessageParser22" = "Blue Team"; -"XPRoomMessageParser23" = "PK mode disabled by administrator"; -"XPRoomMessageParser24" = "Closed"; -"XPRoomMessageParser25" = "Tie"; -"XPRoomMessageParser26" = "PK result this round: %@!\nPK value: %@"; -"XPRoomMessageParser27" = "Tie"; -"XPRoomMessageParser28" = "PK result this round: %@!\nPK value: %@"; -"XPRoomMessageParser29" = "Tie"; -"XPRoomMessageParser30" = "PK result this round: %@!\nPK value"; -"XPRoomMessageParser31" = "Blue Team Guardian: %@ \n Blue Team Guardian Value: %@ \n Red Team Guardian: %@ \n Red Team Guardian Value: %@"; -"XPRoomMessageParser32" = "Red Team"; -"XPRoomMessageParser33" = "Blue Team"; -"XPRoomMessageParser34" = "PK result this round: %@ wins!\nPK value: %@ \n Winner's battle value: %@"; -"XPRoomMessageParser35" = "PK result this round: %@ wins! \nPK value: %@ \n %@ Guardian: %@ \n %@ Guardian Value: %@"; -"XPRoomMessageParser36" = "PK result this round: %@ wins! \nPK value: %@ \n %@ Guardian Value: %@"; -"XPRoomMessageParser37" = "The team with more received gifts wins"; -"XPRoomMessageParser38" = "The team with more senders wins"; -"XPRoomMessageParser39" = "Administrator initiated room PK, this PK lasts for %.0f seconds"; -"XPRoomMessageParser40" = "PK started, this PK lasts for %.0f seconds, quickly vote for your favorite contestant"; -"XPRoomMessageParser41" = "The team with more received gifts wins"; -"XPRoomMessageParser42" = "The team with more senders wins"; -"XPRoomMessageParser43" = "Administrator restarts PK, this PK lasts for %.0f seconds, %@"; -"XPRoomMessageParser44" = "Bookmarked the room"; -"XPRoomMessageParser45" = "Message:"; -"XPRoomMessageParser46" = "Chat public screen closed by administrator"; -"XPRoomMessageParser47" = "Chat public screen opened by administrator"; -"XPRoomMessageParser48" = "Message"; -"XPRoomMessageParser49" = "Gift effects inside room enabled by administrator"; -"XPRoomMessageParser50" = "Gift effects inside room disabled by administrator, click the bottom"; -"XPRoomMessageParser51" = "icon to enable"; -"XPRoomMessageParser52" = "Message"; -"XPRoomMessageParser53" = "Room Owner"; -"XPRoomMessageParser54" = "Administrator"; -"XPRoomMessageParser55" = "Cleared room public screen messages"; -"XPRoomMessageParser57" = "Female"; -"XPRoomMessageParser58" = "Guest No. %d %@:"; -"XPRoomMessageParser59" = "You selected"; -"XPRoomMessageParser60" = "as your heartthrob"; -"XPRoomMessageParser61" = "Congratulations"; -"XPRoomMessageParser62" = "and"; -"XPRoomMessageParser63" = "successfully held hands, let us witness the beginning of their happiness"; -"XPRoomMessageParser64" = "'s heartthrob is"; -"XPRoomMessageParser65" = "Not selected heartthrob"; -"XPRoomMessageParser66" = "Administrator"; -"XPRoomMessageParser67" = "Opened"; -"XPRoomMessageParser68" = "Mic Queue Mode"; -"XPRoomMessageParser69" = "Closed"; -"XPRoomMessageParser70" = "Mic Queue Mode"; -"XPRoomMessageParser71" = "Settings"; -"XPRoomMessageParser72" = "Mic %d"; -"XPRoomMessageParser73" = "as Free Mic"; -"XPRoomMessageParser74" = "Closed"; -"XPRoomMessageParser75" = "Mic %d"; -"XPRoomMessageParser76" = "as Free Mic"; -"XPRoomMessageParser77" = "Awesome! %@ obtained %@ %@ via joyful egg smash"; -"XPRoomMessageParser79" = "(Visible only to yourself)"; -"XPRoomMessageParser80" = "VIP has arrived! Congratulations"; -"XPRoomMessageParser81" = "on opening the VIPe system, obtaining"; -"XPRoomMessageParser82" = "VIP status!"; -"XPRoomMessageParser83" = "The whole audience cheers!! Congratulations"; -"XPRoomMessageParser84" = "'s VIP status successfully upgraded to"; -"XPRoomMessageParser85" = "Congratulations"; -"XPRoomMessageParser86" = "You"; -"XPRoomMessageParser87" = "Congratulations"; -"XPRoomMessageParser88" = "Successfully opened fan club"; -"XPRoomMessageParser89" = "Congratulations"; -"XPRoomMessageParser90" = "Joined fan club"; -"XPRoomMessageParser91" = "Left fan club"; -"XPRoomMessageParser93" = "%@ was removed from the room by %@"; -"XPRoomMessageParser94" = "%@ was put into the black room by %@"; -"XPRoomMessageParser95" = "%@ was asked to step down from the mic by %@"; -"XPRoomMessageParser96" = "Shared the room"; -"XPRoomMessageParser97" = "Followed the room owner"; -"XPRoomMessageParser98" = "  Reward  "; -"XPRoomMessageParser99" = "  Reward All  "; -"XPRoomMessageParser100" = "  Sent  "; -"XPRoomMessageParser101" = "  Sent All  "; -"XPRoomMessageParser102" = " to "; -"XPRoomMessageParser103" = " and received "; -"XPRoomMessageParser104" = "worth"; -"XPRoomMessageParser105" = " Coins"; -"XPRoomMessageParser106" = "Sent"; -"XPRoomMessageParser107" = "to"; -"XPRoomMessageParser108" = "and received"; -"XPRoomMessageParser109" = "worth"; -"XPRoomMessageParser110" = "Coins"; -"XPRoomMessageParser111" = "  Reward  "; - - - -"XPRoomMessageParser114" = "Management initiates room PK, this PK lasts %.0f seconds, %@"; - -"XPRoomMessageParser115" = "Impressive! "; -"XPRoomMessageParser116" = "Treasure spirit obtained "; -"XPRoomMessageParser117" = "Good luck overflowing! "; -"XPRoomMessageParser118" = "Good luck overflowing! "; -"XPRoomMessageParser119" = "Legend"; -"XPRoomMessageParser120" = "Epic"; -"XPRoomMessageParser121" = "Primary"; -"XPRoomMessageParser122" = "Summon"; -"XPRoomMessageParser123" = "Coins"; -"XPRoomMessageParser124" = "【Join】"; -"XPRoomMessageParser125" = "Lucky Tarot brings fortune Bursting with luck in Tarot, obtaining"; - -"XPGiftBarView0" = "Balance: %@"; -"XPGiftBarView1" = "Recharge"; -"XPGiftBarView2" = "Send"; -"XPGiftBarView3" = "Sending..."; -"XPGiftBarView4" = "Send"; -"XPGiftBarView5" = "Please enter gift amount"; - - -"XPGiftUsersView0" = "Send All"; -"XPGiftUsersView1" = "Send All"; - -"XPGiftHeadTypeView0" = "First Recharge Bonus"; -"XPGiftHeadTypeView1" = "First Recharge Bonus"; -"XPGiftHeadTypeView2" = "Gift"; -"XPGiftHeadTypeView3" = "Interactive"; -"XPGiftHeadTypeView4" = "VIP Center"; - -"XPGiftLuckyGiftBroadcastCell0" = "Congratulations "; -"XPGiftLuckyGiftBroadcastCell1" = "Opened %@, obtained "; -"XPGiftLuckyGiftBroadcastView0" = "Game Rules"; - -"XPSendGiftView0" = "Can only send all to one person"; -"XPSendGiftView1" = "Can only send all to one person"; -"XPSendGiftView2" = "Please select at least one person"; -"XPSendGiftView3" = "Sent graffiti gift: %@ successfully"; -"XPSendGiftView4" = "Not yet reached the VIP level required to send %@\nRequired VIP level: %@"; - -"XPGraffitiGiftView0" = "Maximum of 300 drawings allowed"; -"XPGraffitiGiftView1" = "At least 10 drawings required to send"; -"XPGraffitiGiftView2" = "Drawn %@, cost %@ Coins"; -"XPGraffitiGiftView3" = "Slide finger to draw shapes"; -"XPGraffitiGiftView4" = "At least 10 drawings required to send"; - -"XPGiftEmptyCollectionViewCell0" = "Backpack currently empty~"; - -"XPGiftUserCollectionViewCell0" = "Host"; - -"XPGiftTwelveStarBroadcastView0" = "Previous zodiac month %@ host"; -"XPGiftTwelveStarBroadcastView1" = "Previous zodiac month Scorpio host"; -"XPGiftTwelveStarBroadcastView2" = "Nickname"; -"XPGiftTwelveStarBroadcastView3" = "Event Details"; -"XPGiftTwelveStarBroadcastView4" = "Zodiac Story, limited to opening zodiac month"; - -"XPGiftInfoView0" = "Total:"; -"XPGiftInfoView1" = "No gifts available at the moment~"; -"XPGiftInfoView2" = "Popular"; -"XPGiftInfoView3" = "Luck"; -"XPGiftInfoView4" = "WeekStar"; -"XPGiftInfoView5" = "Pack"; -"XPGiftInfoView6" = "Graffiti Gifts"; -"XPGiftInfoView7" = "Penalty Gifts"; -"XPGiftInfoView8" = "FM"; -"XPGiftInfoView9" = "VIP"; -"XPGiftCountView0" = "Other amounts"; -"XPGiftCountView1" = "All"; - - -"XPGiftWeekStarBroadcastView0" = "Vacant"; -"XPGiftWeekStarBroadcastView1" = "Vacant"; -"XPGiftWeekStarBroadcastView2" = "This week's gift champion"; -"XPGiftWeekStarBroadcastView3" = "Vacant"; -"XPGiftWeekStarBroadcastView4" = "This week's gift star tycoon"; -"XPGiftWeekStarBroadcastView5" = "Vacant"; - -"XPRoomFaceViewController0" = "Failed to load, please try again"; -"XPRoomFaceViewController1" = "Not yet reached the VIP level required to send %@,\n Required VIP level: %@"; -"XPRoomFaceViewController2" = "Expression"; -"XPRoomFaceViewController3" = "VIP Expression"; - -"XPSailingAnimationView0" = "Impressive"; -"XPSailingAnimationView1" = "Obtained in sailing adventure"; - -"XPSailingViewController0" = "Consumes %@ fuel for continuous exploration"; -"XPSailingViewController1" = "Consumes 1 fuel for continuous exploration"; -"XPSailingViewController2" = "Do not display result dialog"; - -"XPSailingRankSubView0" = "No more rooms available"; - -"XPSailingEmptyTableViewCell0" = "No data available"; - -"XPSailingRankView1" = "Yesterday's rankings"; -"XPSailingRankView2" = "Today's rankings"; - -"XPSailingBuyFuelView0" = "Current fuel insufficient \n Participate in activities to obtain fuel~"; - -"XPArrangeMicViewController0" = "No more data available"; -"XPArrangeMicViewController1" = "Invite Now"; -"XPArrangeMicViewController2" = "Click to sign up"; -"XPArrangeMicViewController3" = "Sign up for Blue Team"; -"XPArrangeMicViewController4" = "Sign up for Red Team"; -"XPArrangeMicViewController5" = "No one currently in line"; -"XPArrangeMicViewController6" = "Must sign up to get in line~"; -"XPArrangeMicViewController7" = "Current number of people in line:%@"; -"XPArrangeMicViewController8" = "My position in the queue:%ld"; -"XPArrangeMicViewController9" = "Must sign up to get in line~"; -"XPArrangeMicViewController10" = "Sign-up"; -"XPArrangeMicViewController11" = "Cancel Sign-up"; -"XPArrangeMicViewController12" = "No more slots available on the mic"; -"XPArrangeMicViewController14" = "Sign up now and you'll be the first in line"; -"XPArrangeMicViewController15" = "Moments"; -"XPArrangeMicViewController16" = "WeChat Friends"; -"XPArrangeMicViewController17" = "QQ Friends"; -"XPArrangeMicViewController18" = "QQ Space"; -"XPArrangeMicViewController19" = "You'll need to requeue if you cancel your sign-up! Confirm canceling?"; -"XPArrangeMicViewController20" = "No need to sign up, already on the mic"; -"XPArrangeMicViewController21" = "No need to sign up, already on the mic"; -"XPArrangeMicViewController22" = "No need to sign up, already on the mic"; -"XPArrangeMicViewController23" = "Sign up as Male God"; -"XPArrangeMicViewController24" = "Sign up as Female God"; -"XPArrangeMicViewController25" = "Click to sign up"; -"XPArrangeMicViewController26" = "The mic is currently empty~\nShare room invite with friends to join the fun together"; -"XPArrangeMicViewController27" = "Sign up now, and you'll be the first in line on the mic!"; - -"XPArrangeMicTableViewCell1" = "Hug Female God"; -"XPArrangeMicTableViewCell3" = "Hug Red Team"; -"XPArrangeMicTableViewCell4" = "Hug Mic"; -"XPArrangeMicTableViewCell6" = "Selected Female God"; -"XPArrangeMicTableViewCell8" = "Selected Red Team"; -"XPArrangeMicTableViewCell9" = "In line for the mic"; -"XPArrangeMicTableViewCell10" = "Hug Male God"; -"XPArrangeMicTableViewCell11" = "Hug Blue Team"; -"XPArrangeMicTableViewCell12" = "Selected Male God"; -"XPArrangeMicTableViewCell13" = "Selected Blue Team"; - -"XPArrangeMicEmptyTableViewCell0" = "No data available"; - -"XPFirstRechargeSuccessView0" = "Cosmetic items can be used in 'My Dressing' section"; -"XPFirstRechargeSuccessView1" = "Got it"; - -"XPRoomGiftCompoundView0" = "Congratulations"; - -"XPRoomNobleLevelUpView0" = "Set the stage on fire! Congratulations "; -"XPRoomNobleLevelUpView1" = "VIP status upgraded to %@!"; - -"XPRoomCandyGiftView0" = "Awesome! %@ obtained %@ %@ via joyful egg smash"; - - -"XPRoomEnterHideTipView0" = "You entered the room invisibly~"; - -"XPRoomAnimationView0" = "%@ entered the room"; - -"XPRoomYearActivityView0" = "Sent to"; - -"XPRoomAnchorRankBannerView0" = "Congratulations %@ on becoming the TOP1 of the hour on the leaderboard"; -"XPRoomAnchorRankBannerView1" = "TOP1 of the hour"; - -"XPRoomLuckyBigPrizeView0" = "%@ Amazing Luck! Opened a %@ worth %@ Coins in %@"; - -"XPRoomQuickMessageContainView0" = "You are sending too frequently, please try again later"; - -"AnchorRoomSrollTipView0" = "Swipe up to discover more exciting rooms"; - -"XPRoomRedPacketPwdView0" = "Please enter payment password"; -"XPRoomRedPacketPwdView1" = "Forgot Password? "; - -"XPRoomSendRedPacketViewController0" = "Number of red packets cannot be less than 1 or more than"; -"XPRoomSendRedPacketViewController1" = "Coins cannot be less than 100 or more than"; -"XPRoomSendRedPacketViewController2" = "Coins must be a multiple of 10"; -"XPRoomSendRedPacketViewController3" = "Sent successfully"; -"XPRoomSendRedPacketViewController4" = "Congratulations, wish you good luck!"; -"XPRoomSendRedPacketViewController5" = "The total amount of red packets must not be less than 100 Coins, and must be a multiple of 10"; -"XPRoomSendRedPacketViewController6" = "The total amount of red packets must not be less than 1000 Coins, and must be a multiple of 100"; -"XPRoomSendRedPacketViewController7" = "Hall Red Packet"; -"XPRoomSendRedPacketViewController8" = "Global Red Packet"; -"XPRoomSendRedPacketViewController9" = "Number of red packets"; -"XPRoomSendRedPacketViewController10" = "pieces"; -"XPRoomSendRedPacketViewController11" = "Total Coins"; -"XPRoomSendRedPacketViewController12" = "Coins"; -"XPRoomSendRedPacketViewController13" = "The total amount of red packets must not be less than 100 Coins, and must be a multiple of 10"; -"XPRoomSendRedPacketViewController14" = "Unclaimed red packets will be returned to your wallet after 30 minutes"; -"XPRoomSendRedPacketViewController15" = "Congratulations, wish you good luck"; -"XPRoomSendRedPacketViewController16" = "Recharge Coins"; -"XPRoomSendRedPacketViewController17" = "Red packet amount cannot be less than 0"; -"XPRoomSendRedPacketViewController18" = "Coins Coins cannot be less than 0"; - -"XPRoomSendRedPacketViewController19" = "Coins Coins must be in multiples of 10!"; - - -"XPOpenRedPacketCell0" = "Me"; -"XPOpenRedPacketCell1" = "Red Packet Sender"; - - -"XPReceiveRedPacketView0" = "In-room"; -"XPReceiveRedPacketView1" = "has been deposited into your wallet, please confirm in My Earnings"; -"XPReceiveRedPacketView2" = "All taken, come earlier next time~"; -"XPReceiveRedPacketView3" = "'s red packet"; -"XPReceiveRedPacketView4" = "Claimed %@/%@"; -"XPReceiveRedPacketView5" = "All taken, come earlier next time"; -"XPReceiveRedPacketView6" = "Opens in"; -"XPReceiveRedPacketView7" = "Send Danmaku\nGrab Red Packet"; -"XPReceiveRedPacketView8" = "'s red packet"; -"XPReceiveRedPacketView9" = "Come quickly to grab the red packet, first come first served!"; -"XPReceiveRedPacketView10" = "Follow the anchor to grab red packets!"; -"XPReceiveRedPacketView11" = "Share the room to grab red packets!"; -"XPReceiveRedPacketView12" = "Send Danmaku %@ to grab red packets!"; -"XPReceiveRedPacketView13" = "Follow the anchor\nGrab Red Packet"; -"XPReceiveRedPacketView14" = "Share room\nGrab Red Packet"; -"XPReceiveRedPacketView15" = "Send Danmaku\nGrab Red Packet"; -"XPReceiveRedPacketView16" = "Not participating\nin the event"; -"XPReceiveRedPacketView17" = "Conditions met, grab red packets now"; -"XPReceiveRedPacketView18" = "Not participating in the event, cannot grab this red packet"; - -"XPRoomViewController0" = "Sorry, you are temporarily unable to enter this room"; -"XPRoomViewController1" = "%@'s Room"; -"XPRoomViewController2" = "The host has gone offline"; -"XPRoomViewController3" = "You have been blacklisted by the administrator"; -"XPRoomViewController4" = "Reached the bottom~ Automatically return to the current room"; -"XPRoomViewController5" = "Reached the top~ Automatically return to the current room"; -"XPRoomViewController6" = "%@'s Room"; -"XPRoomViewController7" = "The host has gone offline"; -"XPRoomViewController8" = "You have been kicked out of the live room by the administrator"; -"XPRoomViewController9" = "You have been blacklisted by the administrator"; -"XPRoomViewController10" = "The message may contain illegal information, please stop sending similar information like that!"; -"XPRoomViewController11" = "Exiting the room will also exit the current queue. You need to queue again when re-entering. Are you sure you want to exit the room?"; -"XPRoomViewController12" = "Exiting the room will also exit the current queue. You need to queue again when re-entering. Are you sure you want to exit the room?"; -"XPRoomViewController13" = "Reached the top~ Automatically return to the current room"; -"XPRoomViewController14" = "Exiting the room will be considered as giving up the game. Confirm exit?"; -"XPRoomViewController15" = "Cancel"; -"XPRoomViewController16" = "Confirm"; -"XPRoomViewController17" = "Exiting the room will be considered as giving up the game. Confirm exit?"; -"XPRoomViewController18" = "Reached the top~ Automatically return to the current room"; -"XPRoomViewController19" = "You have blocked this room. You can unblock it in [Settings] - [Block Management]. Exciting moments await you~"; -"XPRoomViewController20" = "Sorry, you are temporarily unable to enter this room"; -"XPRoomViewController21" = "Sorry, you are temporarily unable to enter this room"; - -"XPRoomSettingPresenter0" = "Room Name"; -"XPRoomSettingPresenter1" = "Room Locked"; -"XPRoomSettingPresenter2" = "Room Category"; -"XPRoomSettingPresenter3" = "Room Introduction"; -"XPRoomSettingPresenter4" = "Administrators"; -"XPRoomSettingPresenter5" = "Blacklist"; -"XPRoomSettingPresenter6" = "Room Gift Effects"; -"XPRoomSettingPresenter7" = "Room Public Screen"; -"XPRoomSettingPresenter8" = "Queue Mic Mode"; -"XPRoomSettingPresenter9" = "Please enter room introduction"; -"XPRoomSettingPresenter10" = "Please enter room password"; -"XPRoomSettingPresenter11" = "Room locked, please enter room password"; -"XPRoomSettingPresenter12" = "Room Background"; - -"XPFollowAnchorDialogView0" = "Follow"; -"XPFollowAnchorDialogView1" = "Unfollow"; -"XPFollowAnchorDialogView2" = "Follow"; - -"XPRoomExpDisplayView0" = "+%@ Exp"; -"XPRoomExpDisplayView1" = "Received Exp %@"; - -"XPRoomLotteryPrizeView0" = "%@ is very lucky!"; -"XPRoomLotteryPrizeView1" = "%@ drew a prize and got %@ diamonds"; -"XPRoomLotteryPrizeView2" = "Congratulations %@ on drawing the grand prize!"; -"XPRoomLotteryPrizeView3" = "Congratulations %@ on winning the first prize!"; -"XPRoomLotteryPrizeView4" = "Congratulations %@ on winning the second prize!"; -"XPRoomLotteryPrizeView5" = "Congratulations %@ on winning the third prize!"; -"XPRoomLotteryPrizeView6" = "Congratulations %@ on winning the %@ prize!"; -"XPRoomLotteryPrizeView7" = "%@ drew a prize and got %@ Coins"; -"XPRoomLotteryPrizeView8" = "Congratulations %@ on winning the grand prize!"; -"XPRoomLotteryPrizeView9" = "Congratulations %@ on winning the first prize!"; -"XPRoomLotteryPrizeView10" = "Congratulations %@ on winning the second prize!"; -"XPRoomLotteryPrizeView11" = "Congratulations %@ on winning the third prize!"; -"XPRoomLotteryPrizeView12" = "Congratulations %@ on winning the %@ prize!"; -"XPRoomLotteryPrizeView13" = "Congratulations %@ on winning the prize!"; -"XPRoomLotteryPrizeView14" = "Sorry, the prize pool is empty!"; -"XPRoomLotteryPrizeView15" = "Sorry, the prize pool is empty!"; -"XPRoomLotteryPrizeView16" = "Congratulations on winning the prize!"; -"XPRoomLotteryPrizeView17" = "Sorry, the prize pool is empty!"; - -"XPRoomSendGiftViewController0" = "Send %@"; -"XPRoomSendGiftViewController1" = "Received %@ from %@"; -"XPRoomSendGiftViewController2" = "Received %@ from %@"; -"XPRoomSendGiftViewController3" = "Received a red packet"; -"XPRoomSendGiftViewController4" = "Send"; - -"XPRoomMessageView0" = "The room has been turned on and is ready to receive messages"; -"XPRoomMessageView1" = "Please enter text to send"; -"XPRoomMessageView2" = "The room has been muted and cannot send messages"; -"XPRoomMessageView3" = "The room has been banned and cannot send messages"; -"XPRoomMessageView4" = "You have been banned from sending messages in this room"; -"XPRoomMessageView5" = "You have been muted and cannot send messages"; -"XPRoomMessageView6" = "No gifts received yet"; - -"XPRoomEnterTimeView0" = "Enter Room"; - -"XPRoomReceiveGiftView0" = "Received a red packet"; -"XPRoomReceiveGiftView1" = "Received %@ from"; -"XPRoomReceiveGiftView2" = "Received a red packet from"; - -"XPRoomSendRedPacketView0" = "Open Red Packet"; -"XPRoomSendRedPacketView1" = "Send Red Packet"; -"XPRoomSendRedPacketView2" = "Red Packet Note"; -"XPRoomSendRedPacketView3" = "Number of red packets"; -"XPRoomSendRedPacketView4" = "Total diamonds"; -"XPRoomSendRedPacketView5" = "Total diamonds"; -"XPRoomSendRedPacketView6" = "Diamonds"; -"XPRoomSendRedPacketView7" = "piece"; -"XPRoomSendRedPacketView8" = "Please enter number of red packets"; -"XPRoomSendRedPacketView9" = "Please enter total diamonds"; - -"XPRoomExpDisplayView0" = "+%@ Exp"; -"XPRoomExpDisplayView1" = "Received Exp %@"; - -"MessageCell0" = "Copy"; -"MessageCell1" = "Delete"; -"MessageCell2" = "Withdraw"; - -"SessionNavView0" = "Follow"; -"SessionNavView1" = "Already in blacklist"; - -"SessionChatLimitView0" = "Only users with wealth level ≥ %zd or charm level ≥ %zd can initiate chat"; -"SessionChatLimitView1" = "Wealth level"; -"SessionChatLimitView2" = "Charm level"; - -"SessionRiskView0" = "Reminder: The other party is not your friend. Please pay attention to privacy and security!"; - -"SessionNavLiveView0" = "Live"; - -"XPMomentsRecommendViewController0" = "No more data available"; -"XPMomentsRecommendViewController1" = "Deletion is irreversible. Are you sure you want to delete this post?"; -"XPMomentsRecommendViewController2" = "Deleted successfully"; - -"XPMonentsDetailViewController0" = "Please enter your comment"; -"XPMonentsDetailViewController1" = "Details"; -"XPMonentsDetailViewController2" = "All comments"; -"XPMonentsDetailViewController3" = "Reply"; -"XPMonentsDetailViewController4" = "Reply"; -"XPMonentsDetailViewController5" = "Deletion is irreversible. Are you sure you want to delete this post?"; -"XPMonentsDetailViewController6" = "Post Comment"; -"XPMonentsDetailViewController7" = "Post Comment"; -"XPMonentsDetailViewController8" = "Deleted successfully"; - -"XPMomentsSimpleDetailViewController0" = "Share your thoughts"; -"XPMomentsSimpleDetailViewController1" = "Please enter your comment"; -"XPMomentsSimpleDetailViewController2" = "Comment"; -"XPMomentsSimpleDetailViewController3" = "Reply"; -"XPMomentsSimpleDetailViewController4" = "Delete"; -"XPMomentsSimpleDetailViewController5" = "Deletion is irreversible. Are you sure you want to delete this post?"; -"XPMomentsSimpleDetailViewController6" = "Report"; -"XPMomentsSimpleDetailViewController7" = "We have received your request and will process it as soon as possible"; -"XPMomentsSimpleDetailViewController8" = "Reply"; -"XPMomentsSimpleDetailViewController9" = "Deletion is irreversible. Are you sure you want to delete this post?"; -"XPMomentsSimpleDetailViewController10" = "Post Comment"; -"XPMomentsSimpleDetailViewController11" = "Post Comment"; -"XPMomentsSimpleDetailViewController12" = "Deleted successfully"; -"XPMomentsSimpleDetailViewController12" = "No posts yet. Are you sure you want to go back?"; - -"XPMonentsLatestViewController0" = "No more data available"; -"XPMonentsLatestViewController1" = "Deletion is irreversible. Are you sure you want to delete this post?"; -"XPMonentsLatestViewController2" = "Deleted successfully"; - -"XPMonentsTopicRecommondViewController0" = "No more data available"; -"XPMonentsTopicRecommondViewController1" = "Deletion is irreversible. Are you sure you want to delete this post?"; -"XPMonentsTopicRecommondViewController2" = "Deleted successfully"; - -"XPMonentsAttentionViewController0" = "No more data available"; -"XPMonentsAttentionViewController1" = "Deletion is irreversible. Are you sure you want to delete this post?"; -"XPMonentsAttentionViewController2" = "Deleted successfully"; - -///XPMonentsMineViewController.m -"XPMonentsMineViewController0" = "Deletion is irreversible. Are you sure you want to delete this post?"; -"XPMomentsMineViewController1" = "Deleted successfully"; -"XPMomentsMineViewController2" = "Blocked successfully"; - - -"XPMonentsRecommendHeaderView0" = "Recommended Topics"; - -///XPMonentsContentView.m -"XPMonentsContentView0" = "Sticky "; -"XPMonentsContentView1" = "Expand"; -"XPMonentsContentView2" = "Collapse"; - -"XPMoentsTopicListView0" = "No more data available"; - -"XPMonentsPublishTopicView0" = "Add Topic"; -"XPMonentsPublishTopicView1" = "Re-select"; - -///XPMonentsUserInfoView.m -"XPMonentsUserInfoView0" = "Delete"; -"XPMonentsUserInfoView1" = "Report"; -"XPMonentsUserInfoView2" = "Live"; - -///XPMonentsTooBarView.m -"XPMonentsTooBarView0" = "Delete"; -"XPMonentsTooBarView1" = "Report Post or User"; -"XPMonentsTooBarView2" = "Friend"; -"XPMonentsTooBarView3" = "Moments"; -"XPMonentsTooBarView4" = "WeChat"; -"XPMonentsTooBarView5" = "QQ"; -"XPMonentsTooBarView6" = "Qzone"; -"XPMonentsTooBarView7" = "%@ posted a new moment"; -"XPMonentsTooBarView8" = "Block Post"; - -"XPMonentPublishSuccessView0" = "Under review"; -"XPMonentPublishSuccessView1" = "Yay! Your post has been received~\nOnce approved, the secretary will help you publish it and notify you"; - -"XPMonentsInteractiveTableViewCell0" = "Commented on your post"; -"XPMonentsInteractiveTableViewCell1" = "Invited"; - -"XPMonentsEmptyTableViewCell0" = "No data available"; - -"XPMonentsReplyMoreTableViewCell0" = "View %ld more replies"; - -"XPMonentsTopicLatestViewController0" = "No more data available"; -"XPMonentsTopicLatestViewController1" = "Deletion is irreversible. Are you sure you want to delete this post?"; -"XPMonentsTopicLatestViewController2" = "Deleted successfully"; - -"XPMomentListViewController0" = "No more data available"; -"XPMomentListViewController1" = "Post Moment"; -"XPMomentListViewController2" = "Square"; - -"XPMonentsPublishViewController0" = "Maximum of 500 characters allowed"; -"XPMonentsPublishViewController1" = "Confirm deletion?"; -"XPMonentsPublishViewController2" = "Prompt"; -"XPMonentsPublishViewController3" = "No posts yet. Are you sure you want to go back?"; -"XPMonentsPublishViewController4" = "Oops!"; -"XPMonentsPublishViewController5" = "Confirm Return"; -"XPMonentsPublishViewController6" = "Please enter your post content"; -"XPMonentsPublishViewController7" = "Post Moment"; -"XPMonentsPublishViewController8" = "Post"; -"XPMonentsPublishViewController9" = "Record your current life and share it with interesting people"; -"XPMonentsPublishViewController10" = "Commercial advertisements, phone numbers, as well as vulgar, pornographic, violent, and insulting language are not allowed. Offenders will be banned"; - -"XPMonentsInteractiveViewController0" = "All Messages"; -"XPMonentsInteractiveViewController1" = "No more data available"; -"XPMonentsInteractiveViewController2" = "All interaction notifications will be deleted after clearing. Are you sure you want to clear them?"; - -"XPMonentTopicContainerViewController1" = "Latest"; -"XPMonentTopicContainerViewController2" = "Participated Topics"; - -"XPMoentsTopicListViewController0" = "More Topics"; -"XPMoentsTopicListViewController1" = "No more data available"; - -"XPUpgradeView0" = "Upgrade Now"; -"XPUpgradeView1" = "Remind Me Later"; - -"XPAnchorCardView0" = "Left: "; -"XPAnchorCardView1" = "Enter Room"; - - - - - -"XPLoginInputView0" = "Get Verification Code"; -"XPLoginInputView1" = "Resend"; - -"XPLoginViewController0" = "One-click login failed. Please check your mobile network status"; -"XPLoginViewController1" = "One-click login"; -"XPLoginViewController2" = "Login with Current Phone Number"; -"XPLoginViewController3" = "Agree to the default and authorize %@ to access the current phone number"; -"XPLoginViewController4" = "Login successful"; -"XPLoginViewController5" = "Phone Number Login"; -"XPLoginViewController6" = "Agree User Service Agreement and Privacy Policy"; -"XPLoginViewController7" = "User Service Agreement"; -"XPLoginViewController8" = " and "; -"XPLoginViewController9" = "Privacy Policy"; -"XPLoginViewController10" = "Other Login Methods"; -"XPLoginViewController11" = "Agree to the Privacy Policy and User Agreement before registering or logging in"; -"XPLoginViewController12" = "Apple Login"; -"XPLoginViewController13" = "Google Login"; -"XPLoginViewController14" = "Facebook Login"; -"XPLoginViewController15" = "Line Login"; -"XPLoginViewController16" = "other login methods"; -"XPLoginViewController17" = "Last Login"; - -"XPForgetPwdViewController0" = "Please enter a valid phone number"; -"XPForgetPwdViewController1" = "Verification code sent successfully"; -"XPForgetPwdViewController2" = "Password reset successfully"; -"XPForgetPwdViewController3" = "Forget Password"; -"XPForgetPwdViewController4" = "Please enter phone number"; -"XPForgetPwdViewController5" = "Verification code"; -"XPForgetPwdViewController6" = "Please enter password (6-16 characters)"; - -"XPLoginPwdViewController0" = "Login successful"; -"XPLoginPwdViewController1" = "Password Login"; -"XPLoginPwdViewController2" = "Please enter phone number/ID"; -"XPLoginPwdViewController3" = "Please enter password"; -"XPLoginPwdViewController4" = "Phone Number Login"; -"XPLoginPwdViewController5" = "Forget Password"; -"XPLoginPwdViewController6" = "Please enter your E-Party account"; - -"XPLoginBindPhoneResultViewController0" = "Bind Phone"; -"XPLoginBindPhoneResultViewController1" = "The current bound phone number is"; -"XPLoginBindPhoneResultViewController2" = "Change Phone Number"; - -"XPLoginVerifBindPhoneViewController0" = "Change Bound Phone Number"; -"XPLoginVerifBindPhoneViewController1" = "Bind Phone Number"; -"XPLoginVerifBindPhoneViewController2" = "Verify the currently bound phone number"; -"XPLoginVerifBindPhoneViewController3" = "Verify"; -"XPLoginVerifBindPhoneViewController4" = "Phone number cannot be empty"; -"XPLoginVerifBindPhoneViewController5" = "Please enter a valid phone number"; -"XPLoginVerifBindPhoneViewController6" = "Phone number cannot be empty"; -"XPLoginVerifBindPhoneViewController7" = "Verification code cannot be empty"; -"XPLoginVerifBindPhoneViewController8" = "Please enter a valid verification code"; - -"XPLoginRegisterViewController0" = "Registration successful"; -"XPLoginRegisterViewController1" = "The entered mobile phone number is already registered. You can directly log in"; -"XPLoginRegisterViewController2" = "Verification code sent successfully"; -"XPLoginRegisterViewController3" = "Phone Number Registration"; -"XPLoginRegisterViewController4" = "Please enter phone number"; - -"XPLoginRegisterViewController6" = "Please enter password"; -"XPLoginRegisterViewController7" = "Get Verification Code"; - -"XPLoginVerificationView0" = "Get Verification Code"; - -"XPLoginPrivacyView0" = "By registering, you agree to"; -"XPLoginPrivacyView1" = "User Service Agreement"; -"XPLoginPrivacyView2" = "and"; -"XPLoginPrivacyView3" = "Privacy Policy"; - -"XPCompleteUserInfoViewController0" = "Complete Information"; -"XPCompleteUserInfoViewController1" = "Please enter your nickname"; -"XPCompleteUserInfoViewController2" = "Please select gender"; -"XPCompleteUserInfoViewController3" = "Please select birthday"; - -"XPLogoutAlertView0" = "Logout"; -"XPLogoutAlertView1" = "Are you sure you want to log out?"; -"XPLogoutAlertView2" = "Cancel"; -"XPLogoutAlertView3" = "Confirm"; - -"XPCheckVCTitleView0" = "Data review in progress"; -"XPCheckVCTitleView1" = "Review failed"; -"XPCheckVCTitleView2" = "Review successful"; -"XPCheckVCTitleView3" = "Audit results will be notified to you via SMS, email, or push notifications"; - -"XPCheckUserResultView0" = "Submission Successful"; -"XPCheckUserResultView1" = "We have received your application and will review it as soon as possible. The results will be sent to you via SMS, email, or push notifications"; - -"XPModifyPhoneViewController0" = "The verification code has been sent to the new phone number. Please enter the verification code to complete the modification"; -"XPModifyPhoneViewController1" = "Please enter phone number"; - -"XPModifyPhoneViewController3" = "Please enter valid phone number"; -"XPModifyPhoneViewController4" = "Verification code sent successfully"; - -"XPModifyPwdViewController0" = "Password change successful"; -"XPModifyPwdViewController1" = "Please enter new password"; -"XPModifyPwdViewController2" = "Please enter current password"; -"XPModifyPwdViewController3" = "Please enter password (6-16 characters)"; -"XPModifyPwdViewController4" = "Please enter password (6-16 characters)"; - -"XPBindPhoneViewController0" = "Phone Binding"; -"XPBindPhoneViewController1" = "The verification code has been sent to the new phone number. Please enter the verification code to complete the binding"; -"XPBindPhoneViewController2" = "Please enter phone number"; - -"XPBindPhoneViewController4" = "Please enter valid phone number"; -"XPBindPhoneViewController5" = "Verification code sent successfully"; - -"XPMineInfoViewController0" = "Nickname"; -"XPMineInfoViewController1" = "Gender"; -"XPMineInfoViewController2" = "Birthday"; -"XPMineInfoViewController3" = "Male"; -"XPMineInfoViewController4" = "Female"; -"XPMineInfoViewController5" = "Secret"; -"XPMineInfoViewController6" = "Modify Information"; - -"XPSystemSettingViewController0" = "Clear Chat History"; -"XPSystemSettingViewController1" = "Cache"; -"XPSystemSettingViewController2" = "Logout"; - -"XPMineEditViewController0" = "Please enter your nickname"; -"XPMineEditViewController1" = "Save"; -"XPMineEditViewController2" = "Nickname cannot be empty"; - -"XPAboutViewController0" = "Feedback"; -"XPAboutViewController1" = "Privacy Policy"; -"XPAboutViewController2" = "User Service Agreement"; - -"XPForumViewController0" = "Discover"; -"XPForumViewController1" = "Interest"; -"XPForumViewController2" = "Friend"; -"XPForumViewController3" = "Square"; - -"XPSystemNotiListViewController0" = "All Notifications"; -"XPSystemNotiListViewController1" = "No more data available"; - -"XPBlackListViewController0" = "Chat Blocked List"; -"XPBlackListViewController1" = "No more data available"; - -"XPFeedBackViewController0" = "Feedback Type"; -"XPFeedBackViewController1" = "Feedback Content"; -"XPFeedBackViewController2" = "Please enter feedback content"; -"XPFeedBackViewController3" = "Contact Information"; -"XPFeedBackViewController4" = "Please enter your contact information"; -"XPFeedBackViewController5" = "Submit"; -"XPFeedBackViewController6" = "Please enter feedback type"; - - - -"XPRoomTopicPresenter0" = "Failed to update room information"; - -"XPRoomTopicAlertView0" = "No topic set"; -"XPRoomTopicAlertView1" = "No topic content set"; -"XPRoomTopicAlertView2" = "Close"; - -"XPRoomTagListViewController0" = "Quickly pick a category for your room!"; -"XPRoomTagListViewController1" = "Quickly pick a tag for your room!"; -"XPRoomTagListViewController2" = "Done"; - -"XPRoomTagListView0" = "Room Category"; -"XPRoomTagListView1" = "Room Tag"; -"XPRoomTagListView2" = "Done"; - -"XPRoomSettingInputView0" = "Room Password"; -"XPRoomSettingInputView1" = "Room Name"; -"XPRoomSettingInputView2" = "Enter Password"; -"XPRoomSettingInputView3" = "Please Enter"; -"XPRoomSettingInputView4" = "Cancel"; - -"XPRoomSettingInputView6" = "Password incorrect, please re-enter"; - -"XPRoomOnLineViewController0" = "No room members online"; -"XPRoomOnLineViewController1" = "Online List"; - -"XPRoomSettingViewController0" = "Room Settings"; -"XPRoomSettingViewController1" = "Turning on the mic queue mode requires lining up to speak, are you sure you want to enable it?"; -"XPRoomSettingViewController2" = "Turning off the mic queue mode will clear the mic queue list, are you sure you want to disable it?"; -"XPRoomSettingViewController3" = "Prompt"; -"XPRoomSettingViewController4" = "Turning on leave mode will fix the host's display at the host's spot, confirm to turn it on?"; -"XPRoomSettingViewController5" = "Kind Reminder"; -"XPRoomSettingViewController6" = "Turning off will no longer show gift effects, making operation smoother. Confirm to turn off gift effects?"; -"XPRoomSettingViewController7" = "Kind Reminder"; -"XPRoomSettingViewController8" = "Turning off will no longer show chat messages, making operation smoother. Confirm to turn off the public screen?"; - -"XPRoomSettingTableViewCell0" = "Set leave mode, the host can earn offline"; - -"XPRoomRoleTableViewCell0" = "Remove"; - -"XPRoomRoleEmptyTableViewCell0" = "No data"; - -"XPRoomOnlineTableViewCell0" = "Room Owner"; -"XPRoomOnlineTableViewCell1" = "Administrator"; -"XPRoomOnlineTableViewCell2" = "Mystery Person"; -"XPRoomOnlineTableViewCell3" = "On Mic"; - -"XPRoomTopicViewController0" = "Room Announcement"; -"XPRoomTopicViewController1" = "The topic cannot be empty"; -"XPRoomTopicViewController2" = "Please set an announcement title"; -"XPRoomTopicViewController3" = "Please enter announcement content"; - - -"XPRoomInviteUserViewController1" = "Online Audience"; -"XPRoomInviteUserViewController2" = "No users available to hug"; -"XPRoomInviteUserViewController3" = "Online Room Owner/Administrator"; - -"XPRoomRoleViewController0" = "No blacklist set"; -"XPRoomRoleViewController1" = "No administrators set"; -"XPRoomRoleViewController2" = "Blacklist"; -"XPRoomRoleViewController3" = "Administrators"; - -"XPRoomRankUserInfoView0" = "%.1f ten thousand"; -"XPRoomRankUserInfoView1" = "Waiting for someone"; - -"XPRoomRankTableViewCell0" = "%.1f ten thousand"; - -"XPRoomRankViewController1" = "Charm Ranking"; - -"XPWishGiftHistoryViewController0" = "Historical Wishlist"; - -"XPWishGiftViewController0" = "No one has assisted yet"; -"XPWishGiftViewController1" = "People have assisted"; -"XPWishGiftViewController2" = "Today's wish gift %d/%ld"; -"XPWishGiftViewController3" = "-The wish set for the day will expire at 0 o'clock the next day-"; - -"XPWishGiftCreateViewController0" = "Wishlist created"; -"XPWishGiftCreateViewController1" = "Create Wishlist"; -"XPWishGiftCreateViewController2" = "Historical Wish"; -"XPWishGiftCreateViewController3" = "Confirm to delete this data?"; -"XPWishGiftCreateViewController4" = "Confirm to clear current data?"; -"XPWishGiftCreateViewController5" = "Currently no wish"; -"XPWishGiftCreateViewController6" = "Can add up to three wishes~"; -"XPWishGiftCreateViewController7" = "Confirm to create current wish? \nCannot edit or delete after creation for the day"; -"XPWishGiftCreateViewController8" = "Need to add at least one wish gift"; -"XPWishGiftCreateViewController9" = "Set Wish"; -"XPWishGiftCreateViewController10" = "Clear Data"; -"XPWishGiftCreateViewController11" = "Add Wish"; -"XPWishGiftCreateViewController12" = "Confirm to create"; - - - -"LoginVerifCodeViewController0" = "Get the verification code again later"; -"LoginVerifCodeViewController1" = "Login successful"; -"LoginVerifCodeViewController2" = "Verification code has been sent to"; -"LoginVerifCodeViewController3" = "Enter verification code"; -"LoginVerifCodeViewController4" = "Resend verification code"; - -"UserPrivacyView0" = "Privacy Policy of “%@”"; -"UserPrivacyView1" = "Welcome to %@. We will help you understand the collection, use, storage, and sharing of personal information through the “Privacy Policy” and “User Agreement,” especially the correspondence between the types and purposes of personal information we collect.\n\nTo ensure the normal operation of the product, we may collect some necessary information from you. We may collect personal sensitive information such as contact information, and you have the right to refuse to provide us with this information. We will not share, provide, transfer, or obtain your personal information from third parties unless you consent."; -"UserPrivacyView2" = "You can view the complete “Privacy Policy” and “User Agreement”. If you agree, please click the agree button below to start using our services."; -"UserPrivacyView3" = "Agree"; -"UserPrivacyView4" = "Disagree and exit"; - -"XPLoginBindSuccessView0" = "Congratulations! Binding successful"; -"XPLoginBindSuccessView1" = "Close"; - -"LoginFullInfoViewController0" = "Confirm to proceed to the next step?"; -"LoginFullInfoViewController1" = "Complete Information"; -"LoginFullInfoViewController2" = "Gender cannot be changed later"; -"LoginFullInfoViewController3" = "Nickname"; -"LoginFullInfoViewController4" = "Invitation Code"; -"LoginFullInfoViewController5" = "Please enter invitation code (optional)"; -"LoginFullInfoViewController6" = "Complete"; -"LoginFullInfoViewController7" = "This software is only for users aged 18 or above"; -"LoginFullInfoViewController8" = "Please select your gender"; -"LoginFullInfoViewController9" = "Random"; -"LoginFullInfoViewController10" = "Invitation code not provided"; - -"LoginBindPhoneViewController0" = "Third-party login requires binding mobile number"; -"LoginBindPhoneViewController1" = "Incorrect phone format"; -"LoginBindPhoneViewController2" = "Bind Mobile Number"; - -"MvpViewController0" = "Logoff time: %@"; -"MvpViewController1" = "%@\n\nPlease contact customer service for inquiries."; -"MvpViewController1.1" = "%@\n\nPlease contact customer service for inquiries."; -"MvpViewController1.2" = "Please contact customer service for inquiries."; -"MvpViewController2" = "This account has been logged off"; -"MvpViewController3" = "In order to create a safer online environment\nand protect the property safety of you and others,\nplease complete real-name authentication first"; - -"MvpViewController5" = "Real-name Authentication"; -"MvpViewController6" = "You have been banned"; -"MvpViewController7" = "%@\nUnban time: %@"; - -"XPRoomInsidekfjdskfjks" = "Efforts are being made to find a suitable room~"; - -"XPChooseRreaCodeVC0" = "Select Country or Region"; - -"PKIDLoginViewController11" = "SMS sent successfully"; -"LoginVerifCodeViewController3" = "Verification Code"; -"LoginVerifCodeViewController4" = "Resend"; - -"XPLoginViewController11" = "You need to agree to the privacy policy and user agreement before registering and logging in~"; - -"PKLoginViewController1" = "You need to agree to the privacy policy and user agreement before registering and logging in~"; - -"XPMinePromptWindow0" = "Close Exchange"; -"XPMinePromptWindow1" = "Are you sure you want to close %@'s Diamonds coin exchange permission?"; -"XPMinePromptWindow2" = "Cancel"; - - -"XPMineExchangeAuthorityFooderView0" = "No more members who cannot exchange diamonds Coins temporarily~"; -"XPMineExchangeAuthorityFooderView1" = "No more members who can exchange diamonds Coins temporarily~"; - -///XPMineGuildListCell -"XPMineGuildListCell0" = "Apply to join"; -"XPMineGuildListCell1" = "Applied"; -"XPMineGuildListCell2" = "Cannot resend application within 3 days"; -"XPMineGuildListCell3" = "Room ID: %ld"; -"XPMineGuildListCell4" = "Cannot resend application within 7 days"; -"XPMineGuildListCell5" = "Under Review"; -"XPMineGuildListCell6" = "Invited"; - -"XPMineMainGuildListVC0" = "Guild"; -"XPMineMainGuildListVC1" = "Room"; - -///XPMineHallAnchorIncomeStatisViewController.m -"XPMineHallAnchorIncomeStatisViewController0" = "Anchor Income"; -"XPMineHallAnchorIncomeStatisViewController1" = "Daily Statistics"; -"XPMineHallAnchorIncomeStatisViewController2" = "Weekly Statistics"; - -///XPMineClanIncomeStatisViewController.m -"XPMineClanIncomeStatisViewController0" = "Income Statistics"; -"XPMineClanIncomeStatisViewController1" = "Daily Statistics"; -"XPMineClanIncomeStatisViewController2" = "Weekly Statistics"; -"XPMineClanIncomeStatisViewController3" = "Monthly Statistics"; - -///XPMineGuildIncomeStatisViewController.m -"XPMineGuildIncomeStatisViewController0" = "Income Statistics"; -"XPMineGuildIncomeStatisViewController1" = "Daily Statistics"; -"XPMineGuildIncomeStatisViewController2" = "Weekly Statistics"; -"XPMineGuildIncomeStatisViewController3" = "Diamonds Details"; -"XPMineGoldIncomeRecordVC0"="No more data available~"; -"XPGoldIncomeSectionView0" = "Ranking"; -"XPIncomeRecordGoldDetailsHeadView1" = "Member"; -"XPIncomeRecordGoldDetailsHeadView3" = "Diamond Earnings"; -"XPIncomeRecordGoldDetailsHeadView4" = "Settleable Diamonds"; -"XPIncomeRecordGoldDetailsHeadView5" = "Total Income (Gold Coins)"; - -///XPMineGuildIncomeDetailViewController.m -"XPMineGuildIncomeDetailViewController0" = "Income Details"; -"XPMineGuildIncomeDetailViewController1" = "Message"; - -///XPMineClanViewController.m -"XPMineClanViewController0" = "No more data available"; -"XPMineClanViewController1" = "Guild Members (%ld)"; -"XPMineClanViewController2" = "Join Room"; -///XPMineGuildSuperAdminSetViewController.m -"XPMineGuildSuperAdminSetViewController0" = "Guild Super Admin Settings"; -"XPMineGuildSuperAdminSetViewController1" = "Are you sure you want to remove %@'s guild super admin status?"; -"XPMineGuildSuperAdminSetViewController2" = "Add Guild Super Admin"; -///XPMineMainIncomeStatisViewController -"XPMineMainIncomeStatisViewController0" = "Hall Income"; -"XPMineMainIncomeStatisViewController1" = "Anchor Income"; -///XPMineGuildChooseManagerViewController.m -"XPMineGuildChooseManagerViewController0" = "Select Managed Rooms"; -"XPMineGuildChooseManagerViewController1" = "Set successfully"; -"XPMineGuildChooseManagerViewController2" = "Closing now may result in unsuccessful super admin settings. Are you sure you want to close?"; -"XPMineGuildChooseManagerViewController3" = "Finish"; - -///XPMineGuildViewController.m -"XPMineGuildViewController0" = "Failed to retrieve information"; -"XPMineGuildViewController1" = "Failed to retrieve information"; -"XPMineGuildViewController2" = "No more data available"; -"XPMineGuildViewController3" = "Confirm inviting %@ to join %@?"; -"XPMineGuildViewController4" = "Hint"; -"XPMineGuildViewController5" = "Member List (%ld people)"; -"XPMineGuildViewController6" = "Room ID: %@"; -"XPMineGuildViewController7" = "Invitation sent successfully"; -"XPMineGuildViewController8" = "Application submitted, waiting for the room owner's approval"; -"XPMineGuildViewController9" = "Requires room owner approval"; -"XPMineGuildViewController10" = "Exiting will dissolve the relationship, this operation is %@, are you sure you want to exit?"; -"XPMineGuildViewController11" = "Exit Room"; -"XPMineGuildViewController12" = "Join Agency"; - -///XPGuildSuperAdminMenuView.m -"XPGuildSuperAdminMenuView0" = "Set Managed Rooms"; -"XPGuildSuperAdminMenuView1" = "Remove Super Admin Status"; - -///XPGuildTimePickView.m -"XPGuildTimePickView0" = "Start date cannot be later than current date"; -"XPGuildTimePickView1" = "End date cannot be earlier than start date"; -"XPGuildTimePickView2" = "The difference between start date and end date cannot exceed 6 months"; -"XPGuildTimePickView3" = "End date cannot be earlier than start date"; -"XPGuildTimePickView4" = "Cancel"; - -"XPGuildTimePickView6" = "You can only view settlement statistics for the past 3 months"; -///XPGuildTimeMonthPickerView.m - - -"XPGuildTimeMonthPickerView2" = "Cancel"; - - -///XPGuildHeaderView.m -"XPGuildHeaderView0" = "ID: %@"; -"XPGuildHeaderView1" = "Guild Rooms: %ld"; -"XPGuildHeaderView2" = "Guild Rooms: 0"; -"XPGuildHeaderView3" = "Guild Rooms (%ld)"; -"XPGuildHeaderView4" = "View Flow"; -"XPGuildHeaderView5" = "Exchange Permission Settings"; -"XPGuildHeaderView6" = "Guild Super Admin Settings"; -"XPGuildHeaderView7" = "Guild Rooms (0)"; -///PIUserSexView.m -"PIUserSexView0"="Male"; -"PIUserSexView1"="Female"; -///XPGuildSearchNavView.m -"XPGuildSearchNavView0" = "Search Nickname/%@ID"; -"XPGuildSearchNavView1" = "Search"; - -///XPGuildIncomeHeaderView.m -"XPGuildIncomeHeaderView0" = "MM-dd"; -"XPGuildIncomeHeaderView1" = "MM-dd"; -"XPGuildIncomeHeaderView2" = "%@ Coins"; -"XPGuildIncomeHeaderView3" = "Coins"; -"XPGuildIncomeHeaderView4" = "Total Income"; -"XPGuildIncomeHeaderView5" = "MM Month"; - -///XPGuildAnchorIncomeSectionView.m -"XPGuildAnchorIncomeSectionView0" = "Ranking"; -"XPGuildAnchorIncomeSectionView1" = "Avatar"; -"XPGuildAnchorIncomeSectionView2" = "Contract Revenue"; -"XPGuildAnchorIncomeSectionView3" = "Nickname"; -"XPGuildAnchorIncomeSectionView4" = "Room (Coins)"; -"XPGuildAnchorIncomeSectionView6" = "Affiliated Hall"; - -///XPGuildIncomeSectionView.m -"XPGuildIncomeSectionView0" = "Room"; -"XPGuildIncomeSectionView1" = "Avatar"; -"XPGuildIncomeSectionView2" = "Ranking"; -"XPGuildIncomeSectionView3" = "Room"; -"XPGuildIncomeSectionView4" = "Nickname"; -"XPGuildIncomeSectionView5" = "Contract Revenue"; - -///XPClanMemberTableViewCell.m -"XPClanMemberTableViewCell0" = "Leader"; -"XPClanMemberTableViewCell1" = "President"; -"XPClanMemberTableViewCell2" = "Owner"; -"XPClanMemberTableViewCell3" = "Manager"; -"XPClanMemberTableViewCell4" = "Supervisor"; - -///XPMineGuildSearchMemberTableViewCell.m -"XPMineGuildSearchMemberTableViewCell0" = "ID: %@"; -"XPMineGuildSearchMemberTableViewCell1" = "Invite"; -"XPMineGuildSearchMemberTableViewCell2" = "Go to Review"; -"XPMineGuildSearchMemberTableViewCell3" = "Pending"; - -///XPGuildSuperAdminSetTableViewCell.m -"XPGuildSuperAdminSetTableViewCell0" = "ID: %@"; -"XPGuildSuperAdminSetTableViewCell1" = "Managed Rooms"; - -///XPGuildSearchSuperAdminTableViewCell.m -"XPGuildSearchSuperAdminTableViewCell0" = "Set Super Admin"; -"XPGuildSearchSuperAdminTableViewCell1" = "Made Super Admin"; - -///XPGuildIncomeDetailCollectionViewCell.m -"XPGuildIncomeDetailCollectionViewCell0" = "Coins"; - -///XPGuildIncomeRecordTableViewCell.m -"XPGuildIncomeRecordTableViewCell0" = "Room Revenue"; -"XPGuildIncomeRecordTableViewCell1" = "Normal Gift Revenue"; -"XPGuildIncomeRecordTableViewCell2" = "Backpack Gift Revenue"; -"XPGuildIncomeRecordTableViewCell3" = "Number of Gift Senders"; -"XPGuildIncomeRecordTableViewCell4" = "Number of New Gift Senders"; - -///XPMineGuildEmptyTableViewCell.m -"XPMineGuildEmptyTableViewCell0" = "No Data Available"; - -///XPGuildEmptyCollectionViewCell.m -"XPGuildEmptyCollectionViewCell0" = "No Data Available"; - -///XPMineGuildSearchViewController.m -"XPMineGuildSearchViewController0" = "No relevant content found"; -"XPMineGuildSearchViewController1" = "Please enter the content you need to search"; -"XPMineGuildSearchViewController2" = "Are you sure you want to add user %@ (ID: %@) as a Guild Super Admin?"; -"XPMineGuildSearchViewController3" = "Please enter the guild member ID"; - -///XPMineMangerListViewController.m -"XPMineMangerListViewController0" = "Failed to retrieve information"; -"XPMineMangerListViewController1" = "Failed to retrieve information"; -"XPMineMangerListViewController2" = "No more data available"; -"XPMineMangerListViewController3" = "Room Managers"; -"XPMineMangerListViewController4" = "No Room Managers Yet"; - -///XPMineGuildManagerSetViewController.m -"XPMineGuildManagerSetViewController0" = "Failed to retrieve information"; -"XPMineGuildManagerSetViewController1" = "Failed to retrieve information"; -"XPMineGuildManagerSetViewController2" = "No more data available"; -"XPMineGuildManagerSetViewController3" = "Add/Remove Managers"; -"XPMineGuildManagerSetViewController4" = "Are you sure you want to remove %@'s manager status?"; -"XPMineGuildManagerSetViewController5" = "Confirm to set %@ as manager?"; -"XPMineGuildManagerSetViewController6" = "Prompt"; -"XPMineGuildManagerSetViewController7" = "Number of selected people: %d"; - -///XPMineGuildManagerPerViewController.m -"XPMineGuildManagerPerViewController0" = "Permission Settings"; -"XPMineGuildManagerPerViewController1" = "Set Successfully"; -"XPMineGuildManagerPerViewController2" = "You have unsaved settings, are you sure you want to return directly?"; -"XPMineGuildManagerPerViewController3" = "Done"; - -///XPMineGuildRemoveMemberViewController.m -"XPMineGuildRemoveMemberViewController0" = "Confirm"; -"XPMineGuildRemoveMemberViewController1" = "Remove from Guild"; -"XPMineGuildRemoveMemberViewController2" = "Are you sure you want to remove %@ from the guild?"; - -///XPGuildAnchorIncomeViewController.m -"XPGuildAnchorIncomeViewController0" = "Guild Income"; -"XPGuildAnchorIncomeViewController1" = "Yesterday's Guild Income"; - -///XPApplyForAnchorViewController.m -"XPApplyForAnchorViewController0" = "Application for Guild Anchor"; -"XPApplyForAnchorViewController1" = "Anchor's Avatar"; -"XPApplyForAnchorViewController2" = "Nickname"; -"XPApplyForAnchorViewController3" = "The nickname is automatically retrieved from the room."; -"XPApplyForAnchorViewController4" = "Room Owner's Room"; -"XPApplyForAnchorViewController5" = "The room ID is automatically retrieved from the room."; -"XPApplyForAnchorViewController6" = "Contact Information"; -"XPApplyForAnchorViewController7" = "WeChat ID"; -"XPApplyForAnchorViewController8" = "Please fill in the anchor's WeChat ID"; -"XPApplyForAnchorViewController9" = "Other Contact Information"; -"XPApplyForAnchorViewController10" = "Please fill in other contact information"; -"XPApplyForAnchorViewController11" = "Submission"; -"XPApplyForAnchorViewController12" = "Please upload your ID card"; -"XPApplyForAnchorViewController13" = "Please upload your ID card with photo and name clearly visible"; -"XPApplyForAnchorViewController14" = "Please upload photos of you holding your ID card and a piece of paper with the current date handwritten"; -"XPApplyForAnchorViewController15" = "Please hold the ID card in front of your chest with your face and the ID card clearly visible, and make sure the handwritten date is clearly visible"; -"XPApplyForAnchorViewController16" = "Please submit your application after filling in the information and uploading the images."; -"XPApplyForAnchorViewController17" = "Please agree to the terms of service before submitting"; -"XPApplyForAnchorViewController18" = "I have read and agreed to the"; -"XPApplyForAnchorViewController19" = "《Terms of Service》"; - -///XPGuildAdminsViewViewController.m -"XPGuildAdminsViewViewController0" = "Set Managers"; -"XPGuildAdminsViewViewController1" = "No More Data Available"; - -///XPMineGuildTableViewCell.m -"XPMineGuildTableViewCell0" = "Room ID: %@"; -"XPMineGuildTableViewCell1" = "Number of Members: %d"; -"XPMineGuildTableViewCell2" = "Room Manager: %@"; -"XPMineGuildTableViewCell3" = "Guild Super Admin: %@"; - -///XPGuildAdminsDetailTableViewCell.m -"XPGuildAdminsDetailTableViewCell0" = "Super Admin"; -"XPGuildAdminsDetailTableViewCell1" = "Ordinary Admin"; -"XPGuildAdminsDetailTableViewCell2" = "Room Admin"; -"XPGuildAdminsDetailTableViewCell3" = "Set"; -"XPGuildAdminsDetailTableViewCell4" = "Remove"; -"XPGuildAdminsDetailTableViewCell5" = "Set Successfully"; - -///XPGuildDetailTableViewCell.m -"XPGuildDetailTableViewCell0" = "Guild ID: %@"; -"XPGuildDetailTableViewCell1" = "Guild Name: %@"; -"XPGuildDetailTableViewCell2" = "Guild Introduction"; -"XPGuildDetailTableViewCell3" = "Number of Members: %d"; -"XPGuildDetailTableViewCell4" = "Guild Announcement"; - -///XPMineGuildAnchorSuperAdminTableViewCell.m -"XPMineGuildAnchorSuperAdminTableViewCell0" = "Guild Super Admin"; -"XPMineGuildAnchorSuperAdminTableViewCell1" = "Guild Anchor"; - -///XPMineGuildIncomeTableViewCell.m -"XPMineGuildIncomeTableViewCell0" = "Yesterday's Room Income"; -"XPMineGuildIncomeTableViewCell1" = "Total Room Income"; -"XPMineGuildIncomeTableViewCell2" = "Total Diamond Gifts"; - -///XPMineGuildMemberTableViewCell.m -"XPMineGuildMemberTableViewCell0" = "ID: %@"; -"XPMineGuildMemberTableViewCell1" = "Kick"; -"XPMineGuildMemberTableViewCell2" = "Guild Admin"; -"XPMineGuildMemberTableViewCell3" = "No"; - -///XPGuildSuperAdminTableViewCell.m -"XPGuildSuperAdminTableViewCell0" = "Guild Super Admin"; -"XPGuildSuperAdminTableViewCell1" = "Guild Admin"; - -///MessageContentGuildDialogView -"MessageContentGuildDialogView0"="Agree to Apply"; -"MessageContentGuildDialogView1"="Refuse to Apply"; -"MessageContentGuildDialogView2"="Do not accept applications from this user within 7 days"; -"MessageContentGuildDialogView3"="Cancel"; - -"MessageContentGuildDialogView5"="Are you sure you want to approve this user's application to join the room?"; -"MessageContentGuildDialogView6"="Are you sure you want to reject this user's application to join the room?"; -"MessageContentGuildDialogView7"="Approve"; -"MessageContentGuildDialogView8"="Reject"; -"MessageContentGuildDialogView9"="Are you sure you want to approve this room's invitation to join?"; -"MessageContentGuildDialogView10"="Are you sure you want to reject this room's invitation to join?"; -"MessageContentGuildDialogView11"="Agree"; -"MessageContentGuildDialogView12"="Reject"; -"MessageContentGuildDialogView13"="Are you sure you want to approve this room's exit request?"; -"MessageContentGuildDialogView14"="Are you sure you want to reject this room's exit request?"; -"MessageContentGuildDialogView15"="Agree"; -"MessageContentGuildDialogView16"="Reject"; - -///XPMineGuildListVC.m -"XPMineGuildListVC0" = "Guild Weekly Rankings"; -"XPMineGuildListVC1" = "No guilds available"; -"XPMineGuildListVC2"="Sent successfully, please wait patiently"; -"XPMineGuildListVC3" = "No relevant rooms found"; -"XPMineGuildListVC4" = "Application submitted successfully, you will be able to join the room after approval"; -"XPMineGuildListVC5"="Prompt"; -"XPMineGuildListVC6"="Confirm to join agency\n%@"; - -///XPMineTheGuildCell.m -"XPMineTheGuildCell0" = "Agnecy · Room"; -"XPMineTheGuildCell1" = "Join Agency"; -"XPMineTheGuildCell2" = "Join VIP"; -"XPMineTheGuildCell3" = "My agency"; - -///XPMineGiveDiamondVC -"XPMineGiveDiamondVC0" = "Coins Gifting"; -"XPMineGiveDiamondVC1"="Gifting Records"; -"XPMineGiveDiamondVC2"="Only displaying records for the last three months"; -"XPMineGiveDiamondVC3"="No gifting records available"; - -///XPMineGiveDiamondSearchView -"XPMineGiveDiamondSearchView0"="Search"; -"XPMineGiveDiamondSearchView1"="Please enter user ID"; -"XPMineGiveDiamondSearchView2"="User does not exist"; -"XPMineGiveDiamondSearchView3"="Search room name or ID"; - -///XPMineChooseGiveDiamondView -"XPMineChooseGiveDiamondView0"="My Coins:"; - -"XPMineChooseGiveDiamondView2"="Gift Coins"; -"XPMineChooseGiveDiamondView3"="Gift Gifts"; - -///XPMineChooseGiveDiamondVC -"XPMineChooseGiveDiamondVC0"="Gift to"; -"XPMineChooseGiveDiamondVC1"="Please set payment password first"; -"XPMineChooseGiveDiamondVC2"="Set Now"; -"XPMineChooseGiveDiamondVC3"="Today's gifting limit exceeded"; -"XPMineChooseGiveDiamondVC4"="You can only gift up to %@ Coins at a time"; -"XPMineChooseGiveDiamondVC5"="Insufficient Coins balance, please re-enter"; -"XPMineChooseGiveDiamondVC6"="Gift Sent"; - -///XPMineConfirmGiveDiamondView -"XPMineConfirmGiveDiamondView0"="Confirm Payment"; -"XPMineConfirmGiveDiamondView1"="Gift to %@"; -"XPMineConfirmGiveDiamondView2"="Service Fee"; -"XPMineConfirmGiveDiamondView3"="Total Coins Consumed"; -"XPMineConfirmGiveDiamondView4"="Coins"; -"XPMineConfirmGiveDiamondView5"="Exchange Diamonds for Coins"; -"XPMineConfirmGiveDiamondView6"="%ld Diamonds"; -"XPMineConfirmGiveDiamondView7"="Diamonds Consumed"; -"XPMineConfirmGiveDiamondView8"="Confirm Exchange"; - -///XPMineGiveDiamondDetailsVC -"XPMineGiveDiamondDetailsVC0"="Gifting Details"; -"XPMineGiveDiamondDetailsVC1"="Coins"; -"XPMineGiveDiamondDetailsVC2"="Gifts"; - -///XPMineGiveDiamondDetailsCell -"XPMineGiveDiamondDetailsCell0"="Total Spend %@ Coins"; -///XPMineChooseGiveGiftView -"XPMineChooseGiveGiftView0"="Quantity: "; -"XPMineChooseGiveGiftView1"="All"; -"XPMineChooseGiveGiftView2"="Please select a gift first"; -"XPMineChooseGiveGiftView3"="Invalid gift quantity, please re-enter"; -"XPMineChooseGiveGiftView3"="Invalid gift quantity, please re-enter"; -"XPMineChooseGiveGiftView4"="Please enter the gift quantity"; -"XPMineChooseGiveGiftView5"="No gifts available for now"; -"XPMineCoinsIncomeRecordVC0"="No more data available~"; -"XPIncomeRecordCoinsDetailsCell0"="Redeemed:%@"; -///XPIncomeRecordCoinsDetailsHeadView -"XPIncomeRecordCoinsDetailsHeadView0"="Earnings This Week"; -"XPIncomeRecordCoinsDetailsHeadView1"="Member"; -"XPIncomeRecordCoinsDetailsHeadView2"="Room"; -"XPIncomeRecordCoinsDetailsHeadView3"="Diamonds Earnings"; -"XPIncomeRecordCoinsDetailsHeadView4"="Settleable Diamonds"; -"XPIncomeRecordCoinsDetailsHeadView5"="Total Income (Coins)"; -"XPIncomeRecordCoinsDetailsHeadView6"="Total Basic Settlement Coins"; -"XPIncomeRecordCoinsDetailsHeadView7"="Guild Earnings"; -"XPIncomeRecordCoinsDetailsHeadView8"="Total Diamonds of Members"; -"XPIncomeRecordCoinsDetailsHeadView9"="Total Redemption of Members"; -////todo -"XPMinePersonalCenterCell0" = "Personal Center"; -"XPMinePersonalCenterCell1" = "My Room"; -"XPMinePersonalCenterCell2" = "Income Records"; -"XPMinePersonalCenterCell3" = "My Gifting"; -"XPMineGuildSetNameViewController0" = "Set Room Name"; - -"XPMineGuildSetNameViewController2" = "Character limit reached"; -"XPMineGuildSetNameViewController3" = "Character limit reached"; -"XPMineGuildSetNameViewController4" = "Room name cannot be empty"; -"XPMineGuildSetNameViewController5" = "Enter up to 15 characters in Chinese/letters"; -"XPMineGuildRemoveMemberViewController0" = "Failed to retrieve information"; -"XPMineGuildRemoveMemberViewController1" = "Failed to retrieve information"; -"XPMineGuildRemoveMemberViewController2" = "No more data available"; -"XPMineGuildRemoveMemberViewController3" = "Remove Room Member"; -"XPMineGuildRemoveMemberViewController4" = "%@ is an executive, removing will clear data and permissions, confirm removal?"; -"XPMineGuildRemoveMemberViewController5" = "Removing %@ will clear data, confirm removal?"; - -"XPIncomeRecordView0"="Details"; -"XPIncomeRecordView1"="Recharge"; -"XPIncomeRecordView2"="Coins Exchange"; -"XPIncomeRecordView3"="Withdrawal"; -"XPIncomeRecordView4"="Coins"; -"XPIncomeRecordView5"="Diamonds"; - -"XPIncomeRecordVC0"="Earnings Record"; -"XPIncomeRecordVC1"="Wallet"; -"XPExchangeDiamondsItemView0"="My Coins: %@"; -"XPExchangeDiamondsItemView1"="My Diamonds: %.2f"; -"XPExchangeDiamondsItemView2"="My Diamonds"; -"XPExchangeDiamondsView0"="Exchange Coins"; -"XPExchangeDiamondsView1"="Confirm Exchange"; -"XPExchangeDiamondsView2"="Insufficient Diamonds"; -"XPExchangeDiamondsView3"="At least %ld Coins are required for exchange"; -"XPExchangeDiamondsView4"="The number of Coins for exchange cannot exceed %ld"; -"XPExchangeDiamondsView5"="Exchange successful"; -"XPExchangeDiamondsView6"="Please enter..."; -"XPExchangeDiamondsView7"="Number of Coins Exchange"; -"XPIncomeRecordCoinsDetailsView0"="No data available"; -"XPIncomeRecordCoinsDetailsView1"="Total Coins flow in the current room: %@ diamonds"; - -"XPIncomeRecordCoinsDetailsVC0"="Diamonds Details"; -"XPIncomeRecordCoinsDetailsVC1"="To"; - -"XPCoinsDetailsChooseRoomView0"="All"; - -"XPIncomeRecordCoinsDetailsPickViewView0"="Cancel"; -"XPIncomeRecordCoinsDetailsPickViewView1"="Confirm"; -"XPIncomeRecordCoinsDetailsPickViewView2"="To"; -"XPIncomeRecordCoinsDetailsPickViewView3"="Year"; -"XPIncomeRecordCoinsDetailsPickViewView4"="Month"; -"XPIncomeRecordCoinsDetailsPickViewView5"="Day"; - -"XPNobleSettingViewController0" = "VIP Setting"; -"XPNobleSettingViewController1" = "Enter Room Anonymously"; - -"XPNobleCenterViewController0" = "%.2f Immediately Open VIP Privileges"; -"XPNobleCenterViewController1" = "Purchase Failed"; -"XPNobleCenterViewController2" = "Unknown error occurred, please try again"; -"XPNobleCenterViewController3" = "Insufficient Coins Balance, Do you want to recharge"; - -"XPNobleCenterMyNobleView0" = "Current Level"; -"XPNobleCenterMyNobleView1" = " has reached the highest usable VIP level"; -"XPNobleCenterMyNobleView2" = " still needs:"; -"XPNobleCenterMyNobleView3" = "Power values can be upgraded to"; -"XPNobleCenterMyNobleView4" = " Remaining time:"; -"XPNobleCenterMyNobleView5" = "%lld hours"; -"XPNobleCenterMyNobleView6" = "%lld hours"; -"XPNobleCenterMyNobleView7" = "1 hour"; -"XPNobleCenterMyNobleView8" = "Maintain Level %zd"; -"XPNobleCenterMyNobleView9" = "Upgrade Level %zd"; -"XPNobleCenterMyNobleView10" = "Current %zd"; -"XPNobleCenterMyNobleView11" = "%.2f Purchase %@ Level Privileges"; - -"XPNobleCenterEmptyView0" = "Coming soon, stay tuned"; - -"XPNobleCenterWindow0"="Recharge"; -"XPNobleCenterWindow1"="You are currently at %@ level, confirm to purchase a higher %@ level"; - -"XPNobleSettingNavView0" = "VIP Setting"; - -"XPNobleCenterNavView0" = "VIP Center"; - -"XPNobleCenterTableHeadView0" = "Current Power Value: %zd"; -"XPNobleCenterTableHeadView1" = "VIP Not Activated Yet"; -"XPNobleCenterTableHeadView2" = "Current Power Value:"; - -"XPNobleCenterResidueView0" = "Remaining Time Explanation"; -"XPNobleCenterResidueView1" = "The remaining time is calculated based on a 30-day cycle. The next day after obtaining a new VIP level, it starts counting 30 days from noon 12:00 on the next day as the deadline. If the VIP level changes within the cycle, the remaining time will automatically reset to 30 days."; - -"XPNobleUpgradeLevelView0" = "Level Up!"; -"XPNobleUpgradeLevelView1" = "Keep Original Outfit"; -"XPNobleUpgradeLevelView2" = "Wear Higher Level Outfit"; -"XPNobleUpgradeLevelView3" = "Go to VIP Center"; -"XPNobleUpgradeLevelView4" = "Congratulations on becoming '%@'! The current level outfit has been automatically worn. Do you want to keep the original outfit?"; - -"XPNobleCenterEntranceView0" = "%@ Points to Upgrade"; -"XPNobleCenterEntranceView1" = "VIP Center"; -"XPNobleCenterEntranceView2" = "Open to enjoy various privileges"; -"XPNobleCenterEntranceView3" = "Currently max level"; -"XPNobleCenterPayView0" = "Payment"; -"XPNobleCenterPayView1" = "Coins"; -"XPNobleCenterPayView2" = "Coins Payment"; -"XPNobleCenterPayView3" = "Confirm Payment"; - -"XPNoblePrivilegeContentCell0"="Privilege"; -"XPNoblePrivilegeContentCell1"="Rebate"; - -"PINobleCenterListCell0"="Receive"; -"PINobleCenterListCell1"="Not Eligible"; -"PINobleCenterListCell2"="Level Name"; -"PINobleCenterListCell3"="Rebate Date"; -"PINobleCenterListCell4"="Rebate Amount"; -"PINobleCenterListCell5"="Action"; -"PINobleCenterListCell6"="Day %@"; -"PINobleCenterListCell7"="Received"; -"PINobleCenterListCell8"="Receive Now"; - -"PINoblePrivilegeEmptyCell0"="Current level does not enjoy this privilege~"; - -"PINobleCenterListView0"="Users directly purchase %@ level, in addition to directly enjoying all corresponding privileges, they can also receive additional rebates.\n\nSpecific rebate dates and rebate Coins quantities are as follows:"; - -"PINobleCenterListView1"="Note:\nThe rebate Coins must be collected within 30 days after the VIP is opened, otherwise it will be invalid.\nThe collected rebate Coins can be viewed in [My-Earnings Record-Coins Details-Income Record]."; - -"LoginForgetEditView0" = "Get Verification Code"; - -"LoginForgetPasswordViewController0" = "Forgot Password"; -"LoginForgetPasswordViewController1" = "Verification Code Sent Successfully"; -"LoginForgetPasswordViewController2" = "Reset Password Successful"; -"LoginForgetPasswordViewController3" = "%ds to Retry"; -"LoginForgetPasswordViewController4" = "Resend"; -"LoginForgetPasswordViewController5" = "Please enter a correct phone number"; -"LoginForgetPasswordViewController6" = "Submit"; -"LoginForgetPasswordViewController7" = "Please enter phone number"; -"LoginForgetPasswordViewController8" = "verification code"; -"LoginForgetPasswordViewController9" = "Please enter password (6-16 characters)"; - -"XPGiftLuckyGiftBroadcastCell6"="Weekly Star List"; - -"XNDJTDDLoadingTool0"="Loading..."; - -"DateUtils0"="MM-dd HH:mm"; -"DateUtils1"="yyyy-MM-dd HH:mm"; - -"XPMineGuildPersonalBillStatisVC0"="Income Statistics"; -"XPMineGuildPersonalBillStatisVC1"="Daily Statistics"; -"XPMineGuildPersonalBillStatisVC2"="Weekly Statistics"; -"XPMineGuildPersonalBillStatisVC3"="Monthly Statistics"; - -"XPMineGuildPersonalBillRecordHeadView0"="%@ Coins"; -"XPMineGuildPersonalBillRecordHeadView1"="Coins"; - -"XPMineGuildPersonalBillRecordHeadView2"="Total Income"; -"XPMineGuildPersonalBillRecordHeadView3"="Income (Coins)"; -"XPMineGuildPersonalBillRecordHeadView4"="(Coins)"; - -"XPMineGuildPersonalBillRecordContentView0"="Room Flow"; -"XPMineGuildPersonalBillRecordContentView1"="Ordinary Gift Flow"; -"XPMineGuildPersonalBillRecordContentView2"="Backpack Gift Flow"; -"XPMineGuildPersonalBillRecordContentView3"="Number of Gift Senders"; -"XPMineGuildPersonalBillRecordContentView4"="Number of New User Gift Senders"; -"XPMineGuildPersonalBillRecordContentView5"="Income (Coins)"; -"XPMineGuildPersonalBillRecordContentView6"="(Coins)"; - -"MessageContentTreasureFairyView0"="Click to view>>"; - -"XPTreasureFairyFriendCell0"="This person hasn't set a signature yet~"; - -"XPTreasureFairyPrizeRecordCell0"="Primary Mammoth Forest"; -"XPTreasureFairyPrizeRecordCell1"="Epic Mammoth Forest"; -"XPTreasureFairyPrizeRecordCell2"="Legendary Mammoth Forest"; - -"XPTreasureFairySendRecordCell0"="yyyy-MM-dd HH:mm:ss"; -"XPTreasureFairySendRecordCell1"="You gave %@ a '%@' fairy card"; -"XPTreasureFairySendRecordCell2"="%@ gave you a '%@' fairy card"; - -"XPTreasureFairyShopingExchangeCell0"="Coins"; -"XPTreasureFairyShopingExchangeCell1"="Exchange"; - -"XPTreasureFairyShopingRecordCell0"="Primary Summon"; -"XPTreasureFairyShopingRecordCell1"="Epic Summon"; -"XPTreasureFairyShopingRecordCell2"="Legendary Summon"; -"XPTreasureFairyShopingRecordCell3"="%@ Coins"; - -"XPTreasureFairyTrialsRecordCell0"="Legendary Trial"; -"XPTreasureFairyTrialsRecordCell1"="Fairy Decomposition"; - -"XPTreasureFairyDrawSubView0"="Sky City"; - -"XPTreasureFairyDrawView0"="Still need %@ Lucky Points, and receive a legendary fairy as a bonus"; -"XPTreasureFairyDrawView1"="Current Lucky Points: %@"; - -"XPTreasureFairyExchangeView0"="Coins"; -"XPTreasureFairyExchangeView1"="Tip"; -"XPTreasureFairyExchangeView2"="Exchange"; -"XPTreasureFairyExchangeView3"="You are about to exchange \"%@(%@)\""; -"XPTreasureFairyExchangeView4"="Exchange successful~"; -"XPTreasureFairyExchangeView5"="Nickname"; -"XPTreasureFairyExchangeView6"="My Fragments:"; - -"XPTreasureFairyFriendView0"="Friends"; -"XPTreasureFairyFriendView1"="Search Friends"; - -"XPTreasureFairyMessageSendView0"="Sent Successfully"; -"XPTreasureFairyMessageSendView1"="Are you sure you want to send 1 '%@' fairy card to \"%@\"?"; -"XPTreasureFairyMessageSendView2"="Close"; -"XPTreasureFairyMessageSendView3"="Send"; - -"XPTreasureFairyMoreView0"="Rule Explanation"; -"XPTreasureFairyMoreView1"="Treasure Master"; -"XPTreasureFairyMoreView2"="Reward Record"; - -"XPTreasureFairyPrizePoolView0"="Primary Forest"; -"XPTreasureFairyPrizePoolView1"="Epic Forest"; -"XPTreasureFairyPrizePoolView2"="Legendary Forest"; - -"XPTreasureFairyPrizeRecordView0"="Trial Time"; -"XPTreasureFairyPrizeRecordView1"="Type"; -"XPTreasureFairyPrizeRecordView2"="Rewards Obtained"; - -"XPTreasureFairySendRecordView0"="Record"; - -"XPTreasureFairySendView0"="Sent Successfully"; -"XPTreasureFairySendView1"="Sent a request to the friend"; -"XPTreasureFairySendView2"="Are you sure you want to send 1 '%@' fairy card to \"%@\"?"; -"XPTreasureFairySendView3"="Are you sure you want to request 1 '%@' fairy card from \"%@\"?"; -"XPTreasureFairySendView4"="Send"; -"XPTreasureFairySendView5"="Request"; -"XPTreasureFairySendView6"="Close"; - -"XPTreasureFairyShopingRecordSubView0"="Summon Time"; -"XPTreasureFairyShopingRecordSubView1"="Type"; -"XPTreasureFairyShopingRecordSubView2"="Rewards Obtained"; -"XPTreasureFairyShopingRecordSubView3"="Exchange Time"; -"XPTreasureFairyShopingRecordSubView4"="Rewards Obtained"; - -"XPTreasureFairyShopingView0"="Exchange\nRecords"; - -"XPTreasureFairyStoreResultSmallView0"="Obtained Fairy"; -"XPTreasureFairyStoreResultSmallView1"="Unexpected Discovery"; -"XPTreasureFairyStoreResultSmallView2"="Obtained Fairy"; -"XPTreasureFairyStoreResultSmallView3"="Obtained Fairy"; -"XPTreasureFairyStoreResultSmallView4"="Close"; -"XPTreasureFairyStoreResultSmallView5"="Obtained Fairy Fragments"; - -"XPTreasureFairyStoreResultView0"="Unexpected Discovery"; -"XPTreasureFairyStoreResultView1"="Obtained Fairy"; -"XPTreasureFairyStoreResultView2"="Close"; - -"XPTreasureFairyStoreView0"="Capture %@ times"; -"XPTreasureFairyStoreView1"="Primary Ball"; -"XPTreasureFairyStoreView2"="Using the primary ball has a certain chance to capture a primary fairy"; -"XPTreasureFairyStoreView3"="Super Ball"; -"XPTreasureFairyStoreView4"="Using the super ball has a certain chance to capture an epic fairy"; -"XPTreasureFairyStoreView5"="Master Ball"; -"XPTreasureFairyStoreView6"="Using the master ball will definitely capture a legendary fairy"; -"XPTreasureFairyStoreView7"="Nickname"; -"XPTreasureFairyStoreView8"="One"; -"XPTreasureFairyStoreView9"="Ten"; - -"XPTreasureFairySummonGiftView0"="%ld Coins"; - -"XPTreasureFairySummonView0"="Congratulations on obtaining"; - -"XPTreasureFairyTrialsContentView0"="Insufficient number of fairies"; -"XPTreasureFairyTrialsContentView1"="The trial furnace is full"; -"XPTreasureFairyTrialsContentView2"="You have not captured this fairy yet"; -"XPTreasureFairyTrialsContentView3"="Click to enter the trial legendary fairy"; -"XPTreasureFairyTrialsContentView4"="Click to enter the fairy that needs to be decomposed"; -"XPTreasureFairyTrialsContentView5"="One-click Input"; -"XPTreasureFairyTrialsContentView6"="Re-enter"; -"XPTreasureFairyTrialsContentView7"="Decomposing ordinary fairies will randomly obtain 80-100 fragments"; -"XPTreasureFairyTrialsContentView8"="Decomposition furnace is full"; -"XPTreasureFairyTrialsContentView9"="Decomposing legendary fairies will randomly obtain 400-500 fragments"; - -"XPTreasureFairyTrialsRecordView0"="Trial Time"; -"XPTreasureFairyTrialsRecordView1"="Type"; -"XPTreasureFairyTrialsRecordView2"="Input Fairies"; -"XPTreasureFairyTrialsRecordView3"="Rewards Obtained"; - -"XPClanSectionView0"="Management"; - -///XPTreasureFairyTrialsView -"XPTreasureFairyTrialsView0"="Trial\nRecord"; -///XPTreasureFairyViewController -"XPTreasureFairyViewController0"="Insufficient fairy fragments, please purchase"; -"XPTreasureFairyViewController1"="Participate"; -"XPTreasureFairyViewController2"="100 times"; -"XPTreasureFairyViewController3"="10 times"; -"XPTreasureFairyViewController4"="1 time"; - -"XPTreasureFairyViewController5"="Insufficient Coins balance, please recharge"; -"XPTreasureFairyViewController6"="Recharge"; -"XPTreasureFairyViewController7"="No more data available~"; -"XPTreasureFairyViewController8"="Do not display winning results"; -"XPTreasureFairyViewController9"="Fragment purchase successful"; -"XPTreasureFairyViewController10"="Fragment purchase failed"; -///XPTreasureFairyGiftView -"XPTreasureFairyGiftView0"="Good luck! "; -"XPTreasureFairyGiftView1"="Obtained in the treasure fairy "; -"XPTreasureFairyGiftView2"="Amazing! "; -"XPTreasureFairyGiftView3"="In the treasure fairy "; -"XPTreasureFairyGiftView4"="Basic"; -"XPTreasureFairyGiftView5"="Epic"; -"XPTreasureFairyGiftView6"="Legendary"; -"XPTreasureFairyGiftView7"="Summon"; -"XPMineUserInfoRecordedSoundView8"="Coins"; -//XPMineUserInfoTagVC -"XPMineUserInfoTagVC0"="My Tags"; -"XPMineUserInfoTagVC1"="Done"; -"XPMineUserInfoTagVC2"="Tags saved successfully"; -///XPMineUserInfoTagEmptyViewCell -"XPMineUserInfoTagEmptyViewCell0"="Edit your tags to increase your popularity~"; -///XPMineUserInfoTagItemView -"XPMineUserInfoTagItemView0"="You can only add up to 20 tags~"; -///XPMineUserInfoIndividualTagView -"XPMineUserInfoIndividualTagView0"="Their Tags"; -"XPMineUserInfoIndividualTagView1"="My Tags"; -"XPMineUserInfoIndividualTagView2"="Edit Tags"; -///XPMineUserInfoHeaderTagView -"XPMineUserInfoHeaderTagView0"="Set your personal tags"; -///XPLoginAuthCodeVC -"XPLoginAuthCodeVC0"="Authorization Code"; -"XPLoginAuthCodeVC1"="Please enter authorization code"; -"XPLoginAuthCodeVC2"="Authorization code bound successfully"; -"XPLoginAuthCodeVC3"="Done"; -///XPCoinsIncomeSectionView -"XPCoinsIncomeSectionView0"="Ranking"; - -///XPRoomTrumpetViewController.m -"XPRoomTrumpetViewController0"="Posted successfully"; -"XPRoomTrumpetViewController1"="Please enter content"; -"XPRoomTrumpetViewController2"="Room Trumpet"; -"XPRoomTrumpetViewController3"="Message content"; -"XPRoomTrumpetViewController4"="Remaining times"; -"XPRoomTrumpetViewController5"="Content can have a maximum of 20 characters~"; -"XPRoomTrumpetViewController6"="After posting, you cannot use the trumpet for 1 minute~"; -"XPRoomTrumpetViewController7"="You can use the trumpet to shout again after "; -///SudCommon.m -"SudCommon0"="Common Error"; -"SudCommon1"="http missing code parameter"; -"SudCommon2"="http missing roomID parameter"; -"SudCommon3"="http missing appID parameter"; -"SudCommon4"="http missing openID parameter"; -"SudCommon5"="Code validation failed or expired"; -"SudCommon6"="SDK request error"; -"SudCommon7"="SDK parameter error"; -"SudCommon8"="Database query error"; -"SudCommon9"="Database insertion error"; -"SudCommon10"="Database modification error"; -"SudCommon11"="Login error"; -"SudCommon12"="Room join error"; -"SudCommon13"="Cannot join room during battle"; -"SudCommon14"="Room full"; -"SudCommon15"="Duplicate join"; -"SudCommon16"="Someone is already in the position"; -"SudCommon17"="Exit error"; -"SudCommon18"="Not in game position"; -"SudCommon19"="Cannot exit while in ready or gaming state"; -"SudCommon20"="Ready error"; -"SudCommon21"="Cancel ready error"; -"SudCommon22"="Start game error"; -"SudCommon23"="Game already started"; -"SudCommon24"="Only leader can start game"; -"SudCommon25"="Someone is not ready"; -"SudCommon26"="Insufficient players to start game"; -"SudCommon27"="Kick error"; -"SudCommon28"="Only leader can kick"; -"SudCommon29"="Cannot kick in battle room"; -"SudCommon30"="Change leader error"; -"SudCommon31"="Escape error"; -"SudCommon32"="Cannot escape, game already ended"; -"SudCommon33"="Cannot escape, player not in game"; -"SudCommon34"="Dismiss error"; -"SudCommon35"="Cannot dismiss, game already ended"; -"SudCommon36"="Only leader can dismiss"; -///XPHomeLittleGameViewController.m -"XPHomeLittleGameViewController0"="No more rooms available"; -"XPHomeLittleGameViewController1"="Quick Match"; -///XPHomeLittleGameTableViewCell.m -"XPHomeLittleGameTableViewCell0"="In game"; -"XPHomeLittleGameTableViewCell1"="Waiting"; -"XPHomeLittleGameTableViewCell2"="Join"; -///XPLittleGameRoomListView.m -"XPLittleGameRoomListView0"="Expand Friends"; -"XPLittleGameRoomListView1"="Expand Friends"; -///XPLittleGameRoomOpenView.m -"XPLittleGameRoomOpenView0"="Request room information failed, please try again!"; -"XPLittleGameRoomOpenView1"="Create new room"; -"XPLittleGameRoomOpenView2"="Room gameplay"; -"XPLittleGameRoomOpenView3"="Create room"; -///XPRoomLittleGameContainerView.m -"XPRoomLittleGameContainerView0"="Player: Join state"; -"XPRoomLittleGameContainerView1"="Player: Ready state"; -"XPRoomLittleGameContainerView2"="Player: Leader state"; -"XPRoomLittleGameContainerView3"="Player: Gaming state"; -"XPRoomLittleGameContainerView4"="Draw & Guess Player: Selecting word"; -"XPRoomLittleGameContainerView5"="Draw & Guess Player: Drawing"; -"XPRoomLittleGameContainerView6"="Draw & Guess Player: Incorrect answer"; -"XPRoomLittleGameContainerView7"="Draw & Guess Player: Total score"; -"XPRoomLittleGameContainerView8"="Draw & Guess Player: Current score"; -"XPRoomLittleGameContainerView9"="%@ exited the game"; -//LittleGameStageView.m -"LittleGameStageView0"="Cannot change mic during game!"; -///LittleGameScrollStageView.m -"LittleGameScrollStageView0"="Cannot change mic during game!"; -///XPMineGameTableViewCell.m -"XPMineGameTableViewCell0"="Casual Games"; - -///XPNewHomeHeadView -"XPNewHomeHeadView0"="Heartbeat Love"; -"XPNewHomeHeadView1"="Gathering Place for Beautiful Women"; -"XPNewHomeHeadView2"="Companionship and Friendship"; -"XPNewHomeHeadView3"="Fun People Are Here"; -/// XPNewHomeViewController -"XPNewHomeViewController0"="Recommend"; -"XPNewHomeViewController1"="High-Quality Companionship"; - -//XPHomeRecommendOtherRoomView -"XPHomeRecommendOtherRoomView0"="No suitable rooms for now, recommending other rooms for you~"; -"XPHomeRecommendOtherRoomView1"="Go and check"; -"XPLoginPhoneViewController6" = "Verification code"; -///XPTreasureFairyBottomView -"XPTreasureFairyBottomView0"="Enter qty"; -"XPTreasureFairyBottomView1"="Buy"; -"XPTreasureFairyBottomView2"="Please select or enter the number of fragments to buy"; - - -///PITreasureFairyBuyElfShardSuccessView -"PITreasureFairyBuyElfShardSuccessView0"="Do Not Prompt Today"; -"PITreasureFairyBuyElfShardSuccessView1"="Obtained"; -///PITreasureFairyBuyElfShardView -"PITreasureFairyBuyElfShardView0"="Insufficient available fragments, please purchase"; -"PITreasureFairyBuyElfShardView1"="Buy"; -"PITreasureFairyBuyElfShardView2"="Buy %@ fragments"; -"PITreasureFairyBuyElfShardView3"="Recharge Successful"; - -///XPCandyTreeConfirmBuyView -"XPCandyTreeConfirmBuyView0"="Insufficient hammers available, please purchase"; -"XPCandyTreeConfirmBuyView1"="Purchase %@ hammers"; -///XPCandyTreeBuyView -"XPCandyTreeBuyView0"="Please select or enter the number of hammers to purchase"; - -///PIMessageContentServiceReplyView -"PIMessageContentServiceReplyView0"="How to Top-Up:"; -"PIMessageContentServiceReplyView1"="Copy"; - -"PIMessageContentServiceReplyView2"="1. Go to 【My】-- 【Top-Up Coins】 inside E-Party Voice App to top-up"; -"PIMessageContentServiceReplyView3"="2. Contact customer service"; -"PIMessageContentServiceReplyView4"="Customer Service WeChat: %@ "; -"PIMessageContentServiceReplyView5"="Customer Service Line: %@ "; -"PIMessageContentServiceReplyView6"="3. If you see 'Top-up failed, please contact customer service for assistance~', add customer service for help."; - -///XPHomeGameView -"XPHomeGameView0"="Create Room"; -"XPHomeGameView1"="Create Room"; -///XPSessionMainViewController.m -"XPSessionMainViewController0" = "Messages"; -"XPSessionMainViewController1" = "Friends"; -"XPSessionMainViewController2" = "Following"; -"XPSessionMainViewController3" = "Fans"; -///XPFreeGiftsObtainView -"XPFreeGiftsObtainView0"="Got It"; -"XPFreeGiftsObtainView1"="Watched live for %@ today, giving you a gift"; -"XPFreeGiftsObtainView2"="Every day, watching live for a certain duration will get you a \"%@\", with a daily limit of %@, gift valid for the day"; -"XPFreeGiftsObtainView3"="Seconds"; -"XPFreeGiftsObtainView4"="Minutes"; -"XPFreeGiftsObtainView5"="Hours"; -///XPGiftFreeItemCell -"XPGiftFreeItemCell0"="Free Gift"; -"XPGiftFreeItemCell1"="Gift Name"; -///SessionDiscoverNewTableViewCell.m -"SessionDiscoverNewTableViewCell0" = "Discover Newbies"; -///XPMineSimpleUserInfoHeaderView -"XPMineSimpleUserInfoHeaderView0"="This person hasn't set a signature yet~"; -"XPMineSimpleUserInfoHeaderView1"="This person hasn't set a signature yet~"; -"XPMineSimpleUserInfoHeaderView2"="Live"; -"XPMineSimpleUserInfoHeaderView3"="Gift Wall"; -"XPMineSimpleUserInfoHeaderView4"="Gift Wall"; -"XPMineSimpleUserInfoHeaderView5"="Lucky Gifts"; -"XPMineSimpleUserInfoHeaderView6"="Moments"; -///PIRoomPhotoAlbumVC -"PIRoomPhotoAlbumVC0"="Room Album"; -"PIRoomPhotoAlbumVC1"="My Photos"; -"PIRoomPhotoAlbumVC2"="Ordinary"; -"PIRoomPhotoAlbumVC3"="Unlock"; -///PIRoomPhotoAlbumItemVC -"PIRoomPhotoAlbumItemVC0"="Upload Photo"; -"PIRoomPhotoAlbumItemVC1"="Upload Failed, Please Retry"; -"PIRoomPhotoAlbumItemVC2"="Please select photos of the room to upload"; -"PIRoomPhotoAlbumItemVC3"="Upload Successful"; -"PIRoomPhotoAlbumItemVC4"="Are you sure you want to delete this photo?"; -"PIRoomPhotoAlbumItemVC5"="Are you sure you want to send this photo to the public screen?"; -///PIRoomPhotoAlbumChoosePhotoCell -"PIRoomPhotoAlbumChoosePhotoCell0"="Up to 6 photos per upload"; -///PIRoomPhotoAlbumChoosePhotoTypeView -"PIRoomPhotoAlbumChoosePhotoTypeView0"="Photo Type"; -"PIRoomPhotoAlbumChoosePhotoTypeView1"="Ordinary"; -"PIRoomPhotoAlbumChoosePhotoTypeView2"="Unlock"; -///PIRoomPhotoAlbumChoosePhotoGiftView -"PIRoomPhotoAlbumChoosePhotoGiftView0"="Unlock Gifts"; -"PIRoomPhotoAlbumChoosePhotoGiftView1"="No need to select unlock gifts currently"; -"PIRoomPhotoAlbumChoosePhotoGiftView2"="Select Unlock Gifts"; -///PIRoomPhotoAlbumChoosePhotoView -"PIRoomPhotoAlbumChoosePhotoView0"="Confirm Upload"; -"PIRoomPhotoAlbumChoosePhotoView1"="Please select unlock gifts"; -///PIRoomPhotoAlbumChooseGiftView -"PIRoomPhotoAlbumChooseGiftView0"="Select Unlock Gifts"; -///PIRoomMessagePhotoAlbumView -"PIRoomMessagePhotoAlbumView0"="Unlock"; -"PIRoomMessagePhotoAlbumView1"="Unlocked"; -///PIRoomMessageUnlockPhotoAlbumView -"PIRoomMessageUnlockPhotoAlbumView0"="Gift to Unlock Photo"; -"PIRoomMessageUnlockPhotoAlbumView1"="Unlock Now"; -///PIRoomPhotoAlbumOperateView -"PIRoomPhotoAlbumOperateView0"="Send to Public Screen"; -"PIRoomPhotoAlbumOperateView1"="Delete Photo"; -"PIRoomPhotoAlbumOperateView2"="View Large Image"; -///XPMaskManagerVC -"XPMaskManagerVC0"="Block Manager"; -"XPMaskManagerVC1"="No more data~"; -"XPMaskManagerVC2"="Your block list is empty!"; -"XPMaskManagerVC3"="Unblocked successfully"; -///XPMaskManagerCell -"XPMaskManagerCell0"="Unblock"; -///PIRedPacketChooseTypeView -"PIRedPacketChooseTypeView0"="No Threshold Red Packet"; -"PIRedPacketChooseTypeView1"="Follow Red Packet"; -"PIRedPacketChooseTypeView2"="Share Red Packet"; -"PIRedPacketChooseTypeView3"="Danmaku Red Packet"; -"PIRedPacketChooseTypeView4"="Everyone can participate"; -"PIRedPacketChooseTypeView5"="Follow the host to participate"; -"PIRedPacketChooseTypeView6"="Share room to participate"; -"PIRedPacketChooseTypeView7"="Send specified danmaku content"; -"PIRedPacketChooseTypeView8"="Red Packet Conditions"; -///PIRoomSendRedPacketVC -"PIRoomSendRedPacketVC0"="In-Room Red Packet"; -"PIRoomSendRedPacketVC1"="Server-wide Red Packet"; -///PIRoomSendRedPacketItemVC -"PIRoomSendRedPacketItemVC0"="Red Packet Amount"; -"PIRoomSendRedPacketItemVC1"="Red Packet Quantity"; -"PIRoomSendRedPacketItemVC2"="Coins"; -"PIRoomSendRedPacketItemVC3"="pcs"; -"PIRoomSendRedPacketItemVC4"="Effective Immediately"; -"PIRoomSendRedPacketItemVC5"="Effective for a Limited Time"; -"PIRoomSendRedPacketItemVC6"="Unclaimed red packets will be returned to your wallet after %@ hours"; -"PIRoomSendRedPacketItemVC7"="Please enter danmaku content"; -///PIInputScrollingView -"PIInputScrollingView0"="Enter specified danmaku content (up to 10 characters)"; -///PIInputEntireServerScrollingView -"PIInputEntireServerScrollingView0"="Wishing you prosperity and wealth!"; -///PIRoomEnterRedPacketView -"PIRoomEnterRedPacketView0"="Snatch Red Packet"; -///XPRoomGiftBroadcastWindow -"PIRoomGiftBroadcastWindow0"="Watch"; -"PIRoomGiftBroadcastWindow1"="Leave current room and go to"; -"PIRoomGiftBroadcastWindow2"="Don't show this prompt again next time"; -"PIRoomGiftBroadcastWindow3"="Stay Here"; -"PIRoomGiftBroadcastWindow4"="Go Now"; -///PIGuildAnchorIncomeSectionView -"PIGuildAnchorIncomeSectionView0"="Personal Information"; -"PIGuildAnchorIncomeSectionView1"="Host (Coins)"; -"PIGuildAnchorIncomeSectionView2"="Room (Coins)"; -"PIGuildAnchorIncomeSectionView3"="Live Duration"; -///PIWebViewSavePhotoView -"PIWebViewSavePhotoView0"="Remember to fill in the invitation code when registering~"; -"PIWebViewSavePhotoView1"="Invitation Code:"; -"PIWebViewSavePhotoView2"="Saved photo successfully"; -"PIWebViewSavePhotoView3"="Failed to save photo"; -"PIWebViewSavePhotoView4"="Save Invitation Photo"; - -"App_Common_And" = "And"; -"App_Common_Male" = "Male"; -"App_Common_FeMale" = "Female"; -"App_Common_My" = "My"; -"App_Common_Is" = "Is"; -"App_Common_Not" = "Not"; -"App_Common_No" = "No"; -"App_Commont_Days" = "Days"; -"App_Commont_Week" = "Week"; -"App_Commont_Month" = "Month"; -"App_Commont_Hour" = "Hour"; -"App_Commont_Minute" = "Minute"; -"App_Commont_Day" = "Day"; -"App_Common_To" = "To"; -"App_Common_Number" = "Number"; -"App_Common_Person" = "%ld People"; -"App_Common_Or" = "Or"; -"App_Common_Yuan" = "Yuan"; -"App_Common_Wan" = "Ten Thousand"; -"App_Common_Zero_Second" = "0 Second"; -"App_Common_zai" = "At"; -"App_Common_bei" = "By"; -"App_Common_gei" = "To"; -"App_Common_nin" = "You"; -"App_Common_Year" = "yyyy"; -"App_Common_hao" = "Number"; - - - - - -"XPMineSwitchLanguageVC0"="Language Settings"; -"XPMineSwitchLanguageVC1"="Save"; - -"MJRefreshHeaderIdleText" = "Pull down to refresh"; -"MJRefreshHeaderPullingText" = "Release to refresh now"; -"MJRefreshHeaderRefreshingText" = "Refreshing data..."; - -"MJRefreshTrailerIdleText" = "Swipe to view graphic details"; -"MJRefreshTrailerPullingText" = "Release to view graphic details"; - -"MJRefreshAutoFooterIdleText" = "Click or pull up to load more"; -"MJRefreshAutoFooterRefreshingText" = "Loading more data..."; -"MJRefreshAutoFooterNoMoreDataText" = "All loaded"; - -"MJRefreshBackFooterIdleText" = "Pull up to load more"; -"MJRefreshBackFooterPullingText" = "Release to load more now"; -"MJRefreshBackFooterRefreshingText" = "Loading more data..."; -"MJRefreshBackFooterNoMoreDataText" = "All loaded"; - -"MJRefreshHeaderLastTimeText" = "Latest update:"; -"MJRefreshHeaderDateTodayText" = "Today"; -"MJRefreshHeaderNoneLastDateText" = "No record"; -//MSRoomGameWebVC -"MSRoomGameWebVC0"="Are you sure you want to exit the game?"; -///MSSessionPublicChatHallVC - -///MSRoomSetingBackdropCell -"MSRoomSetingBackdropCell0"="In use"; -"MSRoomSetingBackdropCell1"="Are you sure you want to select this image as the room background?"; - -///MSTabbarBeginGameView -"MSTabbarBeginGameView0"="Start"; -///MSRoomGameVictoryView -"MSRoomGameVictoryView0"="Rematch"; -///MSRoomGameQuitGameView -"MSRoomGameQuitGameView0"="The game has started. Exiting the room will be considered a game failure. Are you sure you want to exit the room?"; -"MSRoomGameQuitGameView1"="Exit"; -"MSRoomGameQuitGameView2"="Continue"; -"MSRoomGameQuitGameView3"="Match failed, do you want to rematch? "; -"MSRoomGameQuitGameView4"="Game in progress, do you want to return to the room? "; -"MSRoomGameQuitGameView5"="During a match, exiting a room will end the match. Do you want to exit?"; -//MSRoomGameHeadView -"MSRoomGameHeadView0"="Matching"; -"MSRoomGameHeadView1"="Match successful"; -"MSRoomGameHeadView2"="Winning reward %@ gold coins"; -"MSRoomGameHeadView3"="%@ gold coins"; -"MSRoomGameHeadView4"="Entry Fee(%@)"; -//MSRoomGameVC -"MSRoomGameVC0"="Match failed"; -"MSRoomGameVC1"="Wallet"; -//XPMineAccountView -"XPMineAccountView1"="Quick access to recharge"; -//MSRoomMenuGameVC -"MSRoomMenuGameVC0"="Confirm to start the game?"; -"MSRoomMenuGameVC1"="You do not have the right to start this game, please contact the room owner or administrator~"; - -"XPRoomTypeSelectionViewController0" = "Classic"; -"XPRoomTypeSelectionViewController1" = "Party"; -"XPRoomTypeSelectionViewController2" = "Carnival"; -"XPRoomTypeSelectionViewController3" = "After the setting is completed, members who are out of the microphone order will be removed. Do you confirm the setting?"; -"XPRoomTypeSelectionViewController4" = "Room type"; -"XPRoomTypeSelectionViewController5" = "Using"; - -"FeedBackViewController0" = "Choose the problem type"; -"FeedBackViewController1" = "Describe the problem"; -"FeedBackViewController2" = "Upload screenshot"; -"FeedBackViewController3" = "Contact information"; -"FeedBackViewController4" = "Please enter..."; -"FeedBackViewController5" = " Mobile phone number or email"; -"FeedBackViewController6" = "Submitted successfully"; - -"GameOrderContent_0" = "Play games as a team"; -"GameOrderContent_1" = "Game name"; -"GameOrderContent_2" = "Proficiency"; -"GameOrderContent_3" = "Order price"; -"GameOrderContent_4" = "Place an order"; -"GameOrderContent_5" = "Team invitation"; -"GameOrderContent_6" = "Number of team rounds:"; -"GameOrderContent_7" = "Total:"; -"GameOrderContent_8" = "Order record"; -"GameOrderContent_9" = "I initiated"; -"GameOrderContent_10" = "I received"; -"GameOrderContent_11" = "Game name:"; -"GameOrderContent_12" = "Amount of consumption:"; -"GameOrderContent_13" = "Order time :"; -"GameOrderContent_14" = "Order number:"; -"GameOrderContent_15" = "Pay again"; -"GameOrderContent_16" = "Come play games with me~"; -"GameOrderContent_17" = "%@rounds"; -"GameOrderContent_18" = "Successfully ordered"; -"GameOrderContent_19" = "Game duration (H):"; -"GameOrderContent_20" = "%ld Hour"; -"GameOrderContent_21" = "Balance"; -"GameOrderContent_22" = "Pay"; - -"VipCenter_0" = "Days"; -"VipCenter_1" = "Expires"; -"VipCenter_2" = "Renew"; -"VipCenter_3" = "Exclusive Privileges"; -"VipCenter_4" = "Identification"; -"VipCenter_5" = "Not obtained VIP%ld"; -"VipCenter_6" = "Due on: %@"; -"VipCenter_7" = "VIP%ld is only through activity"; - -"Combo_0" = "Send"; -"Combo_1" = "All mic"; -"Combo_2" = "Multiplayer"; -"Combo_3" = "Send %@"; -"Combo_4" = "Win"; -"Combo_5" = "Coins"; -"Combo_6" = "Congratulations!"; -"Combo_7" = "sent"; -"Combo_8" = "win coins"; -"Combo_9" = "times"; -"Combo_10" = "Are you sure you want to go to this room?"; - -"UserDetail_0" = "Agency"; -"UserDetail_1" = "Agency Name:"; -"UserDetail_2" = "Agency ID:"; -"UserDetail_3" = "Agent ID:"; -"UserDetail_4" = "CP"; -"UserDetail_5" = "Living"; -"UserDetail_Setting_0" = "Homepage animation display-CP"; -"UserDetail_Setting_1" = "Homepage avatars display-CP"; -"UserDetail_CP_List_0" = "Need %@ to upgrade"; -"UserDetail_CP_List_1" = "Waiting for love"; -"UserDetail_CP_Toast_0" = "Tips"; -"UserDetail_CP_Toast_1" = "Are you sure you want to spend %@ coins to cancel your CP with %@?"; -"UserDetail_CP_Toast_2" = "You have successfully cancelled your CP with %@."; -"RoomEffect_CP_0" = "and"; -"RoomEffect_CP_1" = "have become"; -"RoomEffect_CP_lv_0" = "Sweet Duo"; -"RoomEffect_CP_lv_1" = "Dynamic Duo"; -"RoomEffect_CP_lv_2" = "Ideal Duo"; -"RoomEffect_CP_lv_3" = "Dream Duo"; -"RoomEffect_CP_lv_4" = "Perfect Duo"; -"RoomEffect_CP_lv_5" = "Divine Couple"; - -"RoomBoom_0" = "Unfortunately! You did not receive reward, please keep up the good work!"; -"RoomBoom_1" = "Congratulations on being awarded the following prizes in this round of Boom"; -"RoomBoom_2" = "Give gifts and win super prizes"; -"RoomBoom_3" = ""; -"RoomBoom_4" = "was triggered, go and watch"; -"RoomBoom_5" = "";//"Room name:"; -"RoomBoom_6" = "Reset time: 0:00 (GMT+3) daily"; -"RoomBoom_7" = " Supporter Ranking"; -"RoomBoom_8" = "Super Jackpot"; -"RoomBoom_9" = "Reset time: 0:00 (GMT+8) daily"; -"RoomBoom_10" = "The rewards are for reference only. The specific gifts are determined by your contribution value and luck."; - -"RoomMessageTitle_0" = "All"; -"RoomMessageTitle_1" = "Chat"; -"RoomMessageTitle_2" = "Gift"; -"RoomMessageBoom_0" = "Congratulations! "; -"RoomMessageBoom_1" = " has triggered the super jackpot BOOM, and all users in the room will receive rewards!"; - -"RoomMicState_0" = "You turned on the mic and the music."; -"RoomMicState_1" = "You turned on the music but turned off the mic."; -"RoomMicState_2" = "You turned off the music and the mic."; - -"UserInfoEdit_1.0.17_0" = "Dynamic Avatar"; -"UserInfoEdit_1.0.17_1" = "Static Avatar"; -"RoomSetting_1.0.17_0" = "Room avatar"; -"VipSettin_1.0.17_0" = "VIP Setting"; -"VipSettin_1.0.17_1" = "VIP privilege"; -"VipSettin_1.0.17_2" = "Not being Followed"; -"VipSettin_1.0.17_3" = "Anti-Entering Room"; -"VipSettin_1.0.17_4" = "Invisibility"; -"VipSettin_1.0.17_5" = "Anti-Kick"; -"UserCard_1.0.17_0" = "Setting failed, this user is VIP%@"; -"UserCard_1.0.17_1" = "Follow failed, the user has been set to be unfollowable."; - -"1.0.18_0" = "Background"; -"1.0.18_1" = "Free"; -"1.0.18_2" = "Pay"; -"1.0.18_3" = "Custom"; -"1.0.18_4" = "Create new"; -"1.0.18_5" = "You can customize up to 6 backgrounds."; -"1.0.18_6" = "You can only upload up to 6 images at a time as a custom background. \nOnce the background is created, it cannot be canceled. \nWe will review the uploaded background within 24 hours. \nIf the background is rejected, you will receive a refund of coins."; -"1.0.18_7" = "Expired"; -"1.0.18_8" = "%@Days"; -"1.0.18_9" = "Buy"; -"1.0.18_10" = "Renew"; -"1.0.18_11" = "Purchases Tips"; -"1.0.18_12" = "Are you sure you want to use this image as your background?"; -"1.0.18_13" = "Are you sure you want to buy?"; -"1.0.18_14" = "1000/15Days"; -"1.0.18_15" = "Submit"; -"1.0.18_16" = "Confirm"; -"1.0.18_17" = "Original"; -"1.0.18_18" = "In review"; -"1.0.18_19" = "Rejected"; -"1.0.18_20" = "Tips"; -"1.0.18_21" = "We will review your submitted room background as soon as possible. Once the review is completed, we will notify you of the result through a system message."; -"1.0.18_22" = "Congratulations! Your background has been reviewed. Now you can immediately personalize your room with the new background."; -"1.0.18_23" = "Sorry, your background has not been reviewed. Please upload a new background again."; -"1.0.18_24" = "Buy background"; -"1.0.18_25" = "Do Not Disturb"; -"1.0.18_26" = "You and the other are no friend, so you cannot chat privately."; -"1.0.18_27" = "Be %@ without any relationship, you can chat with users privately for free every day,try it?"; -"1.0.18_28" = "Be %@, you can get %@ quotas every day, chat privately with users for free, try it?"; -"1.0.18_29" = "You have chatted with 1,000 people today, please try again tomorrow."; -"1.0.18_30" = "Be VIP%@"; - -"1.0.30_text_1" = "VIP Enjoy Discounts"; -"1.0.30_text_2" = "Only get by event, cannot buy"; -"1.0.30_text_3" = "Exclusive for VIP%@"; -"1.0.30_text_4" = "Limited"; -"1.0.30_text_5" = "Buy"; -"1.0.30_text_6" = "Give"; -"1.0.30_text_7" = "Mall"; -"1.0.30_text_8" = "My Dress"; -"1.0.30_text_9" = "Homepage"; -"1.0.30_text_10" = "VIP%@-%%@%%"; -"1.0.30_text_11" = "Select Friend"; -"1.0.30_text_12" = "Not used"; -"1.0.30_text_13" = "<1Day"; -"1.0.30_text_14" = "Only Get by Event"; -"1.0.30_text_15" = "VIP Price"; -"1.0.30_text_16" = "Limited dress cannot be bought"; -"1.0.30_text_17" = "Buy success"; -"1.0.30_text_18" = "Gift success"; -"1.0.30_text_20" = "Please enter ID or name to search"; -"1.0.30_text_21" = "Price"; -"1.0.30_text_22" = "Expired"; -"1.0.30_text_23" = "%@Days"; -"1.0.30_text_24" = "Day"; -"1.0.30_text_25" = "APP restricts registration to users under 18 years old."; -"1.0.30_text_26" = "Super Admin Block"; -"1.0.30_text_27" = "Blocked time"; -"1.0.30_text_28" = "%@hours"; -"1.0.30_text_29" = "Blocked reason"; -"1.0.30_text_30" = "Please enter the block reason, which will be visible in the background"; -"1.0.30_text_31" = "Block"; - -"1.0.31_text_0" = "Country/Region"; -"1.0.31_text_1" = "Select your Country/Region"; -"1.0.31_text_2" = "Country/Region List"; -//"1.0.31_text_3" = "Selective cardiography"; -"1.0.31_text_4" = "Mic Position"; -"1.0.33_text_1" = "Room Mode"; -"1.0.33_text_2" = "Room Type"; -"1.0.33_text_3" = "Mic Skin"; -"1.0.33_text_4" = "Mic Effect"; -"1.0.33_text_5" = "Use"; -"1.0.33_text_6" = "Room Value:"; -"1.0.33_text_7" = "Room Admind:%@/%@"; -"1.0.33_text_8" = "Distance to Next Lv:"; -"1.0.33_text_9" = "Lv."; -"1.0.33_text_10" = "Classic"; -"1.0.33_text_11" = "Party"; -"1.0.33_text_12" = "Carnival"; -"1.0.33_text_13" = "Celebration"; -"1.0.33_text_14" = "Unique"; -"1.0.33_text_15" = "Room level is not enough to use this skin."; -"1.0.33_text_16" = "Room Level Description"; -"1.0.33_text_17" = "1. You can contact the official customer service and provide relevant evidence to improve the star rating.\n2. The star rating is divided into 1~5 stars.5 stars is the best recharge agent.\n3. The star rating will be displayed when the user found the recharge agent.\n4. The higher the star rating, the higher the ranking in the transfer list.\n5. All interpretation rights belong to the official and have nothing to do with Google or Apple."; -"1.0.33_text_18" = "Room Lv. >=%@ Can be used"; -"1.0.33_text_19" = "The number of admins corresponding to your current room level is full, please upgrade first and then add!"; - -"1.0.34_text_1" = "Official Management"; -"1.0.34_text_2" = "Hidden Room"; -"1.0.34_text_3" = "Close Room"; -"1.0.34_text_4" = "The room is hidden. Users can only find it by searching or following. Please operate with caution."; -"1.0.34_text_5" = "Close the room and kick out all users in the room. Please operate with caution."; -"1.0.34_text_6" = "You have added %@ as a room admin."; -"1.0.34_text_7" = "You have been removed %@ as a room admin."; - -"1.0.34_text_8" = "System detects suspected violation, %@ Number Mic Be locked from speaking"; -"1.0.34_text_9" = "System detects suspected violation,, %@ Number Mic Be muted"; -"1.0.34_text_10" = "System detects suspected violation,, %@ Number Mic Be asked to step down from the stage"; -"1.0.34_text_11" = "System detects suspected violation,, %@ Be kicked out of the room"; -"1.0.34_text_12" = "System detects suspected violation, %@ Be sent to the black room"; - -"1.0.34_text_13" = "You have been added as an admin by %@ room ID: %@."; -"1.0.34_text_14" = "You have been removed as an admin by %@ room ID: %@."; -"1.0.34_text_15" = "You have been set as a manager by the host"; -"1.0.34_text_16" = "You have been removed as a manager by the host"; - -"1.0.37_text_1" = "Gift Lucky Bag"; -"1.0.37_text_2" = "Coin Lucky Bag"; -"1.0.37_text_3" = "Choose Gift"; -"1.0.37_text_4" = "Lucky Bag Numbers"; -"1.0.37_text_5" = "Waiting time"; -"1.0.37_text_6" = "Send Gift Lucky Bag"; -"1.0.37_text_7" = "%@Mins"; -"1.0.37_text_8" = "Lucky Bag Numbers"; -"1.0.37_text_9" = "Total spend %@ coins"; -"1.0.37_text_10" = "Gift"; -"1.0.37_text_11" = "Send %@ gifts, spend %@ coins"; -"1.0.37_text_12" = "Modify "; -"1.0.37_text_13" = "Waiting time %@ minutes"; -"1.0.37_text_14" = "Received Lucky Bag"; -"1.0.37_text_15" = "Sent Lucky Bag"; -"1.0.37_text_15.1" = "Send Gift Lucky Bag"; -"1.0.37_text_15.2" = "Send Coin Lucky Bag"; -"1.0.37_text_17.1" = "%@'s Gift Lucky Bag!"; -"1.0.37_text_17.2" = "%@'s Coin Lucky Bag!"; -"1.0.37_text_18" = "Coming soon"; -"1.0.37_text_19" = "View Others >"; -"1.0.37_text_20" = "Click Open"; -"1.0.37_text_21" = "All the Lucky Bag ready been claimed."; -"1.0.37_text_22" = "Me"; -"1.0.37_text_23" = "Lucky Bag opened within 24hrs will be refunded"; -"1.0.37_text_24" = "Are sending Gift Lucky Bag! "; -"1.0.37_text_25" = "Are sending Coin Lucky Bag! "; -"1.0.37_text_26" = "ID Login"; -"1.0.37_text_27" = "SMS Login"; -"1.0.37_text_28" = "Current coin balance is insufficient, please recharge!"; -"1.0.37_text_29" = "Please select a gift first"; -"1.0.37_text_30" = "Please enter number"; -"1.0.37_text_31" = "%@'s %@ %@ has entered the room."; -"1.0.37_text_32" = "%@ %@&%@ are both on the mic!"; -"1.0.37_text_33" = "This function is open to users above VIP5. Please upgrade your VIP Level first!"; -"1.0.37_text_34" = "Transfer Coins"; -"1.0.37_text_35" = "View details "; -"1.0.37_text_36" = "Sub Recharge Agent"; -"1.0.37_text_37" = "Recent Transfers"; -"1.0.37_text_38" = "ÜS Settlement"; -"1.0.37_text_39" = "Sub Recharge Agent List"; -"1.0.37_text_40" = "Transfer Past 30 days"; -"1.0.37_text_41" = "Transfer History"; -"1.0.37_text_42" = "This Cycle"; -"1.0.37_text_43" = "Last Cycle"; -"1.0.37_text_44" = "Total Amount of Transfer Coins"; -"1.0.37_text_45" = "Total Amount of ÜS Settlement"; -"1.0.37_text_46" = "Transfer"; -"1.0.37_text_47" = "History"; -"1.0.37_text_48" = "Settlement:%@ÜS"; -"1.0.37_text_49" = "%@ÜS"; -"1.0.37_text_50" = "Coins have been put into the wallet!"; -"1.0.37_text_51" = "Gifts have been put into the bag!"; -"1.0.37_text_52" = "Your cannot use this feature."; - -"20.20.51_text_1" = "Email Login"; -"20.20.51_text_2" = "Welcome to E-Party"; -"20.20.51_text_3" = "Please enter ID"; -"20.20.51_text_4" = "Please enter email"; -"20.20.51_text_7" = "Please enter verification code"; -"20.20.51_text_8" = "Get"; -"20.20.51_text_9" = "%@s"; -"20.20.51_text_11" = "6-16 Digits + English Letters"; -"20.20.51_text_12" = "Please enter a correct email address"; -"20.20.51_text_13" = "Email Binding"; -"20.20.51_text_14" = "Mobile Binding"; -"20.20.51_text_15" = "Account Verification"; -"20.20.51_text_16" = "For the security of your account, you need to enter verification code."; -"20.20.51_text_17" = "Private Browsing"; -"20.20.51_text_18" = "Email Verification"; -"20.20.51_text_19" = "Mobile Verification"; -"20.20.51_text_20" = "Recover Password"; -"20.20.51_text_21" = "Dynamic Avatar"; -"20.20.51_text_22" = "It costs %@ coins to upload a dynamic avatar. "; -"20.20.51_text_23" = "Friends"; -"20.20.51_text_24" = "Visitors"; -"20.20.51_text_25" = "Be VIP%@ to view visitors!"; -"20.20.51_text_26" = "Be VIP%@"; -"20.20.51_text_27" = "1 Each time you upload a dynamic avatar, the system will deduct %@ coins from your account. Please make sure that your account balance is sufficient.\n2 Review process: After the upload is completed, the system will automatically enter the review process. During this period, please do not upload a new avatar again to avoid affecting the review progress.\n3 Review results: \nReview passed: Your new dynamic avatar will take effect immediately and be displayed to other users.\nReview failed: The system will automatically refund the %@ coins you spent after the review is completed. At the same time, you will receive a system notification.\n4 Irreversible operation: Please note that once the dynamic avatar is reviewed and takes effect, you will not be able to restore it to the previous avatar.\n"; -"20.20.51_text_28" = "View Time: %@"; -"20.20.51_text_29" = "Number of diamonds needs to be multiples of %@"; -"20.20.51_text_30" = "Video duration must not exceed %@ seconds."; - -"20.20.56_text_1" = "The current number of matches is not enough, the match failed. Re-match again?"; -"20.20.56_text_2" = "Match failed, the coins you consumed has been returned to your wallet"; -"20.20.56_text_3" = "Change Relationship"; -"20.20.56_text_4" = "Select the Relationship you want to change"; -"20.20.56_text_5" = "After confirming the change, the original CP value and CP level will remain unchanged. Each relationship can only be changed once within 30 days"; -"20.20.56_text_6" = "CP"; -"20.20.56_text_7" = "Brother"; -"20.20.56_text_8" = "Sister"; -"20.20.56_text_9" = "Parner"; -"20.20.56_text_10" = "Application for Relationship Change"; -"20.20.56_text_11" = "You have submitted a relationship change request, please be patient."; -"20.20.56_text_12" = "You need 30 days to change your relationship."; -"20.20.56_text_13" = "The other invites you to change the relationship to %@"; -"20.20.56_text_14" = "Your relationship has been changed to %@"; -"20.20.56_text_15" = "Income Tips"; -"20.20.56_text_16" = "Receive Bravo, you will get 2% of the coin income./nThe coins will be directly distributed to your coin wallet./nNote: This income is not included in diamond income."; -"20.20.56_text_17" = "Income"; -"20.20.56_text_18" = "Accepted"; -"20.20.56_text_19" = "Rejected"; -"20.20.56_text_20" = "The other rejects your invitation to change relationships."; - -"20.20.59_text_1" = "Event Center"; -"20.20.59_text_2" = "Official"; -"20.20.59_text_3" = "Event Square"; -"20.20.59_text_4" = "My Events"; -"20.20.59_text_5" = " Sub"; -"20.20.59_text_6" = " Unsub"; -"20.20.59_text_7" = " Participate"; -"20.20.59_text_8" = "Create Event"; -"20.20.59_text_9" = "Event Title"; -"20.20.59_text_10" = "Event Banner(Best size:690*236) "; -"20.20.59_text_11" = "Upload Banner to Homepage(Costs %@)"; -"20.20.59_text_12" = "YES"; -"20.20.59_text_13" = "NO"; -"20.20.59_text_14" = "Select Room"; -"20.20.59_text_15" = "Start Time"; -"20.20.59_text_16" = "Duration"; -"20.20.59_text_17" = "Event Content"; -"20.20.59_text_18" = "Notify My Fans"; -"20.20.59_text_19" = "No rooms available~"; -"20.20.59_text_20" = "My Rooms"; -"20.20.59_text_21" = "Admin Rooms"; -"20.20.59_text_22" = "My Sub"; -"20.20.59_text_23" = "Only the data of the last 30 days is displayed "; -"20.20.59_text_24" = "Event starting"; -"20.20.59_text_25" = "Event ended"; -"20.20.59_text_26" = "Your Event is about to start! Your fans and subscribers have been notified!"; -"20.20.59_text_27" = "The Event you followed is about to start—click to join now!!!"; -"20.20.59_text_28.1" = "Are you sure you want to delete your Event?"; -"20.20.59_text_28.2" = "Once deleted, the Event cannot be started!\nPlease proceed with caution!!!\nThe Event will be removed from the square.\nCoins spent on the banner will not be refunded!\n"; -"20.20.59_text_29" = "This Event has been canceled"; -"20.20.59_text_30" = "Under Review"; -"20.20.59_text_31" = "Review Failed"; -"20.20.59_text_32" = "Join Now >>>"; -"20.20.59_text_33" = "Uploading the banner to the homepage will cost coins: %@\nAfter clicking confirm, the coins will be deducted directly."; -"20.20.59_text_34" = "Submission Successful"; -"20.20.59_text_35" = "Sub successful"; -"20.20.59_text_36" = "Cancel successful"; - -"20.20.61_text_1" = "My Medals"; -"20.20.61_text_2" = "Medal Wearing"; -"20.20.61_text_3" = "Task Medals"; -"20.20.61_text_4" = "Activity Medals"; -"20.20.61_text_5" = "Glory Medals"; -"20.20.61_text_6" = "You are not wearing any medals"; -"20.20.61_text_7.1" = "You have not received any medals"; -"20.20.61_text_7.2" = "You have not received any medals\nGo to the medal square and check it out!"; -"20.20.61_text_8" = "Expiration time:%@"; -"20.20.61_text_9" = "Forever"; -"20.20.61_text_10" = "Medal Square"; -"20.20.61_text_11" = "Medal Hall of Fame"; -"20.20.61_text_12" = "Powerful Owner"; -"20.20.61_text_13" = "View his medals"; -"20.20.61_text_14" = "%@'s medal"; -"20.20.61_text_15" = "Upgrade VIP to get more medal display slots!"; -"20.20.61_text_16" = "Your medals are full!\nAdjust first and then add more!"; -"20.20.61_text_17" = "Medal Seat Tip"; -"20.20.61_text_18" = "Upgrade now!"; -"20.20.61_text_19" = "Bonus"; - -"20.20.62_text_1" = "Mic Invitation"; -"20.20.62_text_2" = "The host/admin invites you up to mic to join the chat!"; -"20.20.62_text_3" = "You have successfully sent the invitation."; -"20.20.62_text_4" = "The other party has declined your invitation."; -"20.20.62_text_5" = "The user has left, invitation failed."; -"20.20.62_text_6" = "The mic is occupied. Please try again later."; -"20.20.62_text_7" = "You do not have permission to invite the user to the mic."; -"20.20.62_text_8" = "The invitation failed to be sent. Please check the network."; - -"20.20.62_text_9" = "Turn effects on/off"; -"20.20.62_text_9.1" = "Turbo mode"; -"20.20.62_text_9.2" = "Non-turbo mode"; -"20.20.62_text_10" = "Gift effects"; -"20.20.62_text_11" = "Global gift screen"; -"20.20.62_text_12" = "Global game screen"; -"20.20.62_text_13" = "Turbo mode"; -"20.20.62_text_21" = "CP mic"; -"20.20.62_text_22" = "You have enabled CP mic effects."; -"20.20.62_text_23" = "You have disabled CP mic effects. CP mic animations are no longer visible in this room. Tap to re-enable."; -"20.20.62_text_14" = "My effects"; -"20.20.62_text_15.1" = "Enabling Turbo mode can make the app run smoother.\nTurbo mode: Turns off room gift animations, in-room broadcasts, CP displays, and other animated effects."; -"20.20.62_text_15.2" = "To make the app run smoother, it has automatically switched to Turbo mode for you (Turbo mode: Automatically turns off gift animations, headwear effects, and merges gift messages in the public chat). You can turn off this mode in the room settings."; -"20.20.62_text_16" = "Anladım"; -"20.20.62_text_17" = "You have enabled the grobal gift floating screen effect."; -"20.20.62_text_18" = "You have disabled the grobal gift floating screen effect. The grobal gift floating screen is no longer visible in this room. Click to enable it again."; -"20.20.62_text_19" = "You have enabled the grobal game floating screen effect."; -"20.20.62_text_20" = "You have disabled the grobal game floating screen effect. The grobal game floating screen is no longer visible in this room. Click to enable it again."; -"20.20.62_text_21" = "CP Mic Display"; -"20.20.62_text_22" = "You have turn on the CP Mic Display."; -"20.20.62_text_23" = "You have turn off the CP Mic Display. The CP Mic Display is not visible in this room. Click to enable it again."; -"20.20.62_text_24" = "You have turned off Turbo Mode."; - -// EPEditSetting - 设置页面多语言Key -"EPEditSetting.Title" = "Edit"; -"EPEditSetting.Avatar" = "Avatar"; -"EPEditSetting.Nickname" = "Nickname"; -"EPEditSetting.PersonalInfo" = "Personal Information and Permissions"; -"EPEditSetting.Help" = "Help"; -"EPEditSetting.ClearCache" = "Clear Cache"; -"EPEditSetting.CheckUpdate" = "Check for Updates"; -"EPEditSetting.AboutUs" = "About Us"; -"EPEditSetting.Logout" = "Log out of account"; - -// Alert -"EPEditSetting.Camera" = "Take Photo"; -"EPEditSetting.PhotoLibrary" = "Choose from Album"; -"EPEditSetting.EditNickname" = "Edit Nickname"; -"EPEditSetting.EnterNickname" = "Enter new nickname"; -"EPEditSetting.LogoutConfirm" = "Are you sure you want to log out?"; -"EPEditSetting.Cancel" = "Cancel"; -"EPEditSetting.Confirm" = "Confirm"; - -// Policy Options -"EPEditSetting.UserAgreement" = "User Service Agreement"; -"EPEditSetting.PrivacyPolicy" = "Privacy Policy"; - -// Clear Cache -"EPEditSetting.ClearCacheTitle" = "Clear Cache"; -"EPEditSetting.ClearCacheMessage" = "Are you sure you want to clear all cache? This will delete cached images and web data."; -"EPEditSetting.ClearCacheSuccess" = "Cache cleared successfully"; - -/* EP Module Keys - Added for English localization */ - -/* - * EP Module - English Localization Keys - * 用于替换 EP 模块中所有硬编码中文 - */ - -// MARK: - Common 通用 -"common.tips" = "Tips"; -"common.confirm" = "Confirm"; -"common.cancel" = "Cancel"; -"common.ok" = "OK"; -"common.publish" = "Publish"; -"common.save" = "Save"; -"common.delete" = "Delete"; -"common.upload_failed" = "Upload Failed"; -"common.update_failed" = "Update Failed"; -"common.loading" = "Loading..."; -"common.success" = "Success"; -"common.failed" = "Failed"; - -// MARK: - User 用户相关 -"user.anonymous" = "Anonymous"; -"user.nickname_not_set" = "Nickname Not Set"; -"user.not_set" = "Not Set"; - -// MARK: - Time 时间格式化 -"time.just_now" = "Just now"; -"time.minutes_ago" = "%.0f minutes ago"; -"time.hours_ago" = "%.0f hours ago"; -"time.days_ago" = "%.0f days ago"; - -// MARK: - Tab Bar Tab 标题 -"tab.moment" = "Moments"; -"tab.mine" = "Mine"; - -// MARK: - Moment 动态相关 -"moment.title" = "Enjoy your Life Time"; -"moment.item_clicked" = "Clicked item %ld"; -"moment.under_review" = "Moment is under review, cannot like"; -"moment.like" = "Like"; -"moment.unlike" = "Unlike"; -"moment.like_success" = "Like success"; -"moment.unlike_success" = "Unlike success"; -"moment.like_failed" = "Like failed: %@"; -"moment.click_image_index" = "Clicked image index: %ld"; - -// MARK: - Publish 发布相关 -"publish.title" = "Publish"; -"publish.content_or_image_required" = "Please enter content or select image"; -"publish.publish_failed" = "Publish failed: %ld - %@"; -"publish.upload_failed" = "Upload failed: %@"; - -// MARK: - Mine 我的页面 -"mine.settings_clicked" = "Settings button clicked"; -"mine.not_logged_in" = "User not logged in"; -"mine.load_user_info_failed" = "Failed to load user info"; -"mine.load_user_info_failed_msg" = "Failed to load user info: %@"; -"mine.item_clicked" = "Clicked item %ld (Mine)"; -"mine.open_settings" = "Open settings page with user info"; -"mine.avatar_updated" = "Avatar updated: %@"; - -// MARK: - Settings 设置页面 -"setting.nickname_update_success" = "Nickname updated: %@"; -"setting.nickname_update_failed" = "Nickname update failed, please try again later"; -"setting.nickname_update_failed_msg" = "Nickname update failed: %ld - %@"; -"setting.avatar_update_failed" = "Avatar update failed, please try again later"; -"setting.avatar_upload_success" = "Avatar uploaded: %@"; -"setting.avatar_upload_failed" = "Avatar upload failed: %@"; -"setting.avatar_upload_no_url" = "Avatar uploaded but no URL returned"; -"setting.avatar_update_success" = "Avatar updated"; -"setting.avatar_update_failed_msg" = "Avatar update failed: %ld - %@"; -"setting.image_not_selected" = "Image not selected"; -"setting.account_not_found" = "Account info not found"; -"setting.redirected_to_login" = "Redirected to login page"; -"setting.feature_reserved" = "[%@] - Feature reserved for future implementation"; -"setting.user_info_updated" = "User info updated: %@"; - -// MARK: - Login 登录相关 -"login.debug_mode_active" = "✅ DEBUG mode active"; -"login.release_mode" = "⚠️ Currently in Release mode"; -"login.switch_env" = "Switch Environment"; -"login.feedback_placeholder" = "Feedback - Placeholder, Phase 2 implementation"; -"login.debug_placeholder" = "Debug - Placeholder, Phase 2 implementation"; -"login.area_selection_placeholder" = "Area selection - Placeholder, Phase 2 implementation"; -"login.id_login_success" = "ID login success: %@"; -"login.email_login_success" = "Email login success: %@"; -"login.phone_login_success" = "Phone login success: %@"; - -// MARK: - Login Manager 登录管理 -"login_manager.account_incomplete" = "Account info incomplete, cannot continue"; -"login_manager.access_token_empty" = "access_token is empty, cannot continue"; -"login_manager.login_success" = "Login success, switched to EPTabBarController"; -"login_manager.request_ticket_failed" = "Request Ticket failed: %ld - %@"; -"login_manager.request_ticket_failed_redirect" = "Ticket request failed, still redirect to home page"; -"login_manager.apple_login_placeholder" = "Apple Login - Placeholder, Phase 2 implementation"; -"login_manager.debug_show_color_guide" = "Debug mode: Show signature color guide (has color: %d)"; -"login_manager.user_selected_color" = "User selected signature color: %@"; -"login_manager.user_skipped_color" = "User skipped signature color selection"; - -// MARK: - API Errors API 错误 -"error.not_logged_in" = "Not logged in"; -"error.request_failed" = "Request failed"; -"error.publish_failed" = "Publish failed"; -"error.like_failed" = "Like operation failed"; -"error.account_parse_failed" = "Account info parse failed"; -"error.operation_failed" = "Operation failed"; -"error.ticket_parse_failed" = "Ticket parse failed"; -"error.request_ticket_failed" = "Request Ticket failed"; -"error.send_email_code_failed" = "Send email verification code failed"; -"error.send_phone_code_failed" = "Send phone verification code failed"; -"error.login_failed" = "Login failed"; -"error.reset_password_failed" = "Reset password failed"; -"error.quick_login_failed" = "Quick login failed"; -"error.image_compress_failed" = "Image compress failed"; -"error.qcloud_init_failed" = "QCloud initialization failed"; -"error.qcloud_config_failed" = "Get QCloud config failed"; -"error.qcloud_config_not_initialized" = "QCloud config not initialized"; - -// MARK: - Upload 上传相关 -"upload.progress_format" = "Uploading %ld/%ld"; - -// MARK: - Color Storage 颜色存储 -"color_storage.save_signature_color" = "Save user signature color: %@"; -"color_storage.clear_signature_color" = "Clear user signature color"; - -// MARK: - Tab Bar Controller TabBar 控制器 -"tabbar.init_complete" = "Floating TabBar initialization complete"; -"tabbar.released" = "Released"; -"tabbar.setup_complete" = "Floating TabBar setup complete"; -"tabbar.selected_tab" = "Selected Tab: %@"; -"tabbar.global_manager_setup" = "Global manager setup complete (v0.2 - No MiniRoom)"; -"tabbar.initial_vcs_setup" = "Initial ViewControllers setup complete"; -"tabbar.refresh_login_status" = "TabBar refreshed, login status: %d"; -"tabbar.login_vcs_created" = "Post-login ViewControllers created - Moment & Mine"; -"tabbar.show_tabbar_root" = "Show TabBar - Root page"; -"tabbar.hide_tabbar_child" = "Hide TabBar - Child page (level: %ld)"; - -// MARK: - Debug Logs 调试日志(建议直接用英文重写,这里仅供参考) -"debug.apply_signature_color" = "Apply signature color: %@"; -"debug.start_breathing_glow" = "Start breathing glow animation"; -"debug.warning_emotion_color_nil" = "Warning: emotionColorHex is nil"; -"debug.assign_random_color" = "Assign random color for moment %@: %@"; - -/* End EP Module Keys */ diff --git a/YuMi/main.m.backup b/YuMi/main.m.backup deleted file mode 100644 index dc98f87..0000000 --- a/YuMi/main.m.backup +++ /dev/null @@ -1,13 +0,0 @@ -#import -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - NSString * appDelegateClassName; - @autoreleasepool { - // Setup code that might create autoreleased objects goes here. - appDelegateClassName = NSStringFromClass([AppDelegate class]); - } - - return UIApplicationMain(argc, argv, nil, appDelegateClassName); -} -