├── README.md ├── Source ├── BMWeexExtension │ ├── Resources │ │ └── arrowInKeyboard@2x.png │ ├── BMMethods.h │ ├── BMGetEnvironment.h │ ├── WXRecyclerComponent+BMExtend.h │ ├── BMAddRuleManager.h │ ├── WXEditComponent_Private.h │ ├── WXBridgeManager+BMExtend.h │ ├── WXWebComponent+BMExtend.h │ ├── WXSDKEngine+BMExtend.h │ ├── WXSDKInstance+BMExtend.h │ ├── BMInputView.h │ ├── WXTextComponent+BMExtend.h │ ├── WXListComponent+BMExtend.h │ ├── WXRecyclerComponent+BMExtend.m │ ├── WXBridgeManager+BMExtend.m │ ├── WXImageComponent+BMExtend.h │ ├── WXScrollerComponent+BMExtend.h │ ├── WXSDKEngine+BMExtend.m │ ├── WXEditComponent+BMExtend.h │ ├── WXSDKInstance+BMExtend.m │ ├── WXListComponent+BMExtend.m │ └── WXWebComponent+BMExtend.m ├── BMComponent │ ├── Calendar │ │ ├── Resources │ │ │ ├── CalendarLeftArrows@2x.png │ │ │ ├── CalendarLeftArrows@3x.png │ │ │ ├── CalendarReightArrows@2x.png │ │ │ └── CalendarReightArrows@3x.png │ │ ├── BMCalendarComponent.h │ │ └── Views │ │ │ ├── RangePickerCell.h │ │ │ └── RangePickerCell.m │ ├── Pop │ │ ├── BMPopupComponent.h │ │ ├── BMMaskComponent.h │ │ └── BMPopupComponent.m │ ├── Chart │ │ ├── BMChartComponent.h │ │ └── Resources │ │ │ └── bm-chart.html │ ├── Text │ │ └── BMTextComponent.h │ └── RichText │ │ ├── BMRichTextComponent.h │ │ └── BMSpanComponent.h ├── BMModule │ ├── Modal │ │ ├── SVProgressHUD │ │ │ ├── SVProgressHUD.bundle │ │ │ │ ├── info.png │ │ │ │ ├── error.png │ │ │ │ ├── error@2x.png │ │ │ │ ├── error@3x.png │ │ │ │ ├── info@2x.png │ │ │ │ ├── info@3x.png │ │ │ │ ├── success.png │ │ │ │ ├── angle-mask.png │ │ │ │ ├── success@2x.png │ │ │ │ ├── success@3x.png │ │ │ │ ├── angle-mask@2x.png │ │ │ │ └── angle-mask@3x.png │ │ │ ├── SVRadialGradientLayer.h │ │ │ ├── SVIndefiniteAnimatedView.h │ │ │ ├── SVProgressAnimatedView.h │ │ │ └── SVRadialGradientLayer.m │ │ └── BMModalModule.h │ ├── Image │ │ └── BMImageModule.h │ ├── Tabbar │ │ └── BMTabbarModule.h │ ├── Axios │ │ ├── BMAxiosRequestModel.m │ │ ├── BMAxiosNetworkModule.h │ │ ├── BMAxiosRequestModel.h │ │ └── BMAxiosNetworkModule.m │ ├── WebSocket │ │ ├── BMWebSocketModule.h │ │ ├── BMWebSocketDefaultImpl.h │ │ ├── BMWebSocketLoader.h │ │ ├── BMWebSocketHandler.h │ │ └── BMWebSocketLoader.m │ ├── AuthorizedLogin │ │ └── BMAuthorLoginModule.h │ ├── Navigation │ │ └── BMNavigatorModule.h │ ├── Communication │ │ └── BMCommunicationModule.h │ ├── Picker │ │ └── BMPickerModule.h │ ├── BundleUpdate │ │ ├── BMBundleUpdateModule.h │ │ └── BMBundleUpdateModule.m │ ├── Events │ │ ├── BMEventsModule.h │ │ ├── BMNotifactionCenter.h │ │ └── BMEventsModule.m │ ├── Tools │ │ └── BMToolsModule.h │ ├── Camera │ │ ├── BMCameraModule.h │ │ ├── BMUploadImageModel.m │ │ ├── BMUploadImageModel.h │ │ └── BMCameraModule.m │ ├── Storage │ │ └── BMStorageModule.h │ ├── AppConfig │ │ └── BMAppConfigModule.h │ ├── Router │ │ ├── BMRouterModule.h │ │ ├── BMRouterModel.m │ │ └── BMRouterModel.h │ ├── BrowserImg │ │ ├── BMBrowserImgModule.h │ │ └── PhotoBrowser │ │ │ ├── UIView+PBSnapshot.h │ │ │ ├── PBImageScrollView.h │ │ │ ├── PhotoBrowser.h │ │ │ ├── PBImageScrollerViewController.h │ │ │ ├── UIView+PBSnapshot.m │ │ │ ├── PBPresentAnimatedTransitioningController.h │ │ │ └── PBImageScrollView+internal.h │ ├── Geolocation │ │ ├── BMGeolocationModule.h │ │ └── BMGeolocationModule.m │ └── WebView │ │ ├── WXWebViewModule+Private.h │ │ └── WXWebViewModule+Private.m ├── BMController │ ├── WebView │ │ ├── BMNative.h │ │ ├── UIWebView+BMExtend.h │ │ ├── BMWebViewRouterModel.m │ │ ├── BMWebViewController.h │ │ ├── BMWebViewRouterModel.h │ │ ├── UIWebView+BMExtend.m │ │ └── BMNative.m │ ├── BaseVc │ │ ├── BMNavigationController.h │ │ ├── BMLaunchViewController.h │ │ ├── BMTabBarController.h │ │ ├── BMBaseViewController+Extend.h │ │ ├── BMBaseViewController.h │ │ └── BMLaunchViewController.m │ └── ScanQR │ │ ├── QRShaowView.h │ │ └── BMScanQRViewController.h ├── BMCustomUI │ ├── PullRefresh │ │ ├── BMDotGifHeader.h │ │ └── BMDotGifHeader.m │ ├── Label │ │ ├── JYTTitleLabel.h │ │ ├── JYTBigTitleLabel.h │ │ ├── JYTHomeTitleLabel.h │ │ ├── JYTBoldContentLabel.h │ │ ├── JYTLabelFontSize13.h │ │ ├── JYTSmallTitleLabel.h │ │ ├── JYTBoldBigTitleLabel.h │ │ ├── JYTLabelBoldFontSize21.h │ │ ├── JYTContentLabel.h │ │ ├── JYTBoldTitleLabel.h │ │ ├── JYTTitleLabel.m │ │ ├── JYTBigTitleLabel.m │ │ ├── JYTLabelFontSize13.m │ │ ├── JYTSmallTitleLabel.m │ │ ├── JYTHomeTitleLabel.m │ │ ├── JYTBoldContentLabel.m │ │ ├── JYTBoldBigTitleLabel.m │ │ └── JYTLabelBoldFontSize21.m │ ├── Button │ │ ├── JYTLevel1Button.h │ │ ├── JYTLevel2Button.h │ │ └── JYTLevel3Button.h │ ├── HYGuideView │ │ └── HYGuideView.h │ ├── WatermarkView │ │ ├── WatermarkView.h │ │ └── WatermarkView.m │ ├── TabBarBadge │ │ ├── UITabBar+Badge.h │ │ └── UITabBar+Badge.m │ └── HYAlert │ │ ├── HYAlertViewManager.h │ │ ├── HYAlertViewManager.m │ │ ├── HYAlertModel.h │ │ ├── HYAlertModel.m │ │ ├── HYAlertView.h │ │ └── HYPopupView.h ├── BMExtension │ ├── UIWindow+Util.h │ ├── UIColor+Util.h │ ├── NSTimer+Addition.h │ ├── UINavigationBar+NavigationBarExtend.h │ ├── NSData+bsdiff.h │ ├── UIFont+Util.h │ ├── UINavigationBar+NavigationBarExtend.m │ ├── NSDictionary+Util.h │ ├── NSDictionary+Util.m │ ├── NSTimer+Addition.m │ ├── NSObject+BMSwizzle.h │ ├── UIWindow+Util.m │ ├── NSString+Util.h │ ├── UIImage+Util.h │ ├── UIFont+Util.m │ ├── NSObject+BMSwizzle.m │ ├── AESCrypt │ │ └── CryptLib.h │ └── UIView+Util.h ├── BMManager │ ├── Version │ │ ├── BMJSVersionModel.m │ │ ├── BMJSVersionModel.h │ │ ├── BMResourceCheck.h │ │ └── BMResourceManager.h │ ├── Handler │ │ ├── BMCheckUpdateProtocol.h │ │ ├── BMHandlerFactory.h │ │ └── BMHandlerFactory.m │ ├── Mediator │ │ ├── CTMediator+BMShareActions.h │ │ ├── CTMediator+BMPayActions.h │ │ ├── CTMediator+BMPushActions.h │ │ ├── CTMediator+BMShareActions.m │ │ ├── CTMediator+BMPayActions.m │ │ ├── BMMediatorManager.h │ │ └── CTMediator+BMPushActions.m │ ├── StartConfig │ │ ├── BMAppDelegate.h │ │ ├── BMAppResource.h │ │ ├── BMPlatformModel.m │ │ ├── BMAppResource.m │ │ └── BMConfigManager.h │ ├── DB │ │ ├── BMDBBaseModel.m │ │ ├── BMDBBaseModel.h │ │ └── BMDB.h │ ├── BMRouter │ │ └── BMRouterManager.h │ ├── ScreenshotNotification │ │ └── BMScreenshotEventManager.h │ ├── AuthorLogin │ │ └── BMAuthorManager.h │ ├── Location │ │ ├── JYTLocationManager.h │ │ └── TransformCLLocation.h │ ├── Image │ │ ├── BMImageManager.h │ │ ├── BMUploadImageUtils.h │ │ └── BMImageManager.m │ ├── Storage │ │ ├── BMStoreManager.h │ │ └── BMStoreManager.m │ └── GlobalEvent │ │ └── BMGlobalEventManager.h ├── BMDebug │ ├── DebugSettingVC.h │ ├── BMHotRefreshWebScoket.h │ ├── BMDragButton+Debug.h │ ├── BMDragButton.h │ ├── BMDebugManager.h │ ├── Scanner │ │ ├── WXScannerHistoryVC.h │ │ ├── WXScannerVC.h │ │ ├── UIViewController+WXDemoNaviBar.h │ │ ├── WXDemoViewController.h │ │ └── DemoDefine.h │ └── BMHotRefreshWebScoket.m ├── BMHandler │ ├── BMConfigCenterHandler.h │ ├── BMMonitorHandler.h │ ├── WXBMNetworkDefaultlpml.h │ ├── WXImgLoaderDefaultImpl.h │ ├── BMMonitorHandler.m │ └── BMConfigCenterHandler.m ├── BMDevice │ ├── BMDeviceManager.h │ ├── SFHFKeychainUtils.h │ └── BMDeviceManager.m ├── ErosApp │ ├── Network │ │ ├── BMCommonRequest.h │ │ └── BMCommonRequest.m │ ├── ViewControllerExtend │ │ ├── BMBaseViewController+Order.h │ │ └── BMBaseViewController+Order.m │ └── ErosDefine │ │ └── PrefixHeader.pch ├── BMNetwork │ ├── JsResourceRequest │ │ ├── BMUpdateBundlejsRequest.h │ │ ├── BMCheckJsVersionRequest.h │ │ ├── BMCheckJsVersionRequest.m │ │ └── BMUpdateBundlejsRequest.m │ ├── UploadImage │ │ ├── BMUploadImageRequest.h │ │ └── BMUploadImageRequest.m │ └── BaseRequest │ │ └── BMBaseRequest.h ├── BMModel │ ├── BMUserInfoModel.h │ └── BMUserInfoModel.m └── BMTransition │ ├── BMPresentLikeQQTransition.h │ ├── BMPresentTranslationTransition.h │ └── BMInteractiveTransition.h └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | # eros-plugin-ios-baseLibrary 2 | Eros iOS 项目基础依赖库 3 | -------------------------------------------------------------------------------- /Source/BMWeexExtension/Resources/arrowInKeyboard@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/eros-plugin-ios-baseLibrary/HEAD/Source/BMWeexExtension/Resources/arrowInKeyboard@2x.png -------------------------------------------------------------------------------- /Source/BMComponent/Calendar/Resources/CalendarLeftArrows@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/eros-plugin-ios-baseLibrary/HEAD/Source/BMComponent/Calendar/Resources/CalendarLeftArrows@2x.png -------------------------------------------------------------------------------- /Source/BMComponent/Calendar/Resources/CalendarLeftArrows@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/eros-plugin-ios-baseLibrary/HEAD/Source/BMComponent/Calendar/Resources/CalendarLeftArrows@3x.png -------------------------------------------------------------------------------- /Source/BMComponent/Calendar/Resources/CalendarReightArrows@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/eros-plugin-ios-baseLibrary/HEAD/Source/BMComponent/Calendar/Resources/CalendarReightArrows@2x.png -------------------------------------------------------------------------------- /Source/BMComponent/Calendar/Resources/CalendarReightArrows@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/eros-plugin-ios-baseLibrary/HEAD/Source/BMComponent/Calendar/Resources/CalendarReightArrows@3x.png -------------------------------------------------------------------------------- /Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/eros-plugin-ios-baseLibrary/HEAD/Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/info.png -------------------------------------------------------------------------------- /Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/eros-plugin-ios-baseLibrary/HEAD/Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/error.png -------------------------------------------------------------------------------- /Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/error@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/eros-plugin-ios-baseLibrary/HEAD/Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/error@2x.png -------------------------------------------------------------------------------- /Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/error@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/eros-plugin-ios-baseLibrary/HEAD/Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/error@3x.png -------------------------------------------------------------------------------- /Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/info@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/eros-plugin-ios-baseLibrary/HEAD/Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/info@2x.png -------------------------------------------------------------------------------- /Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/info@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/eros-plugin-ios-baseLibrary/HEAD/Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/info@3x.png -------------------------------------------------------------------------------- /Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/eros-plugin-ios-baseLibrary/HEAD/Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/success.png -------------------------------------------------------------------------------- /Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/angle-mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/eros-plugin-ios-baseLibrary/HEAD/Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/angle-mask.png -------------------------------------------------------------------------------- /Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/success@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/eros-plugin-ios-baseLibrary/HEAD/Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/success@2x.png -------------------------------------------------------------------------------- /Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/success@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/eros-plugin-ios-baseLibrary/HEAD/Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/success@3x.png -------------------------------------------------------------------------------- /Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/angle-mask@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/eros-plugin-ios-baseLibrary/HEAD/Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/angle-mask@2x.png -------------------------------------------------------------------------------- /Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/angle-mask@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/eros-plugin-ios-baseLibrary/HEAD/Source/BMModule/Modal/SVProgressHUD/SVProgressHUD.bundle/angle-mask@3x.png -------------------------------------------------------------------------------- /Source/BMController/WebView/BMNative.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMNative.h 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2018/7/2. 6 | // 7 | 8 | #import 9 | 10 | @interface BMNative : NSObject 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Source/BMComponent/Pop/BMPopupComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMPopupComponent.h 3 | // Pods 4 | // 5 | // Created by XHY on 2017/4/26. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface BMPopupComponent : WXComponent 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMComponent/Chart/BMChartComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMChartComponent.h 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2017/10/18. 6 | // 7 | 8 | #import 9 | 10 | @interface BMChartComponent : WXComponent 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Source/BMCustomUI/PullRefresh/BMDotGifHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMDotGifHeader.h 3 | // Pods 4 | // 5 | // Created by XHY on 2017/5/9. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface BMDotGifHeader : MJRefreshGifHeader 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMWeexExtension/BMMethods.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMMethods.h 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/3/8. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BMMethods : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMCustomUI/Label/JYTTitleLabel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JYTTitleLabel.h 3 | // JingYitong 4 | // 5 | // Created by XHY on 15/9/18. 6 | // Copyright © 2015年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JYTTitleLabel : UILabel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMCustomUI/Button/JYTLevel1Button.h: -------------------------------------------------------------------------------- 1 | // 2 | // JYTLevel1Button.h 3 | // JingYitong 4 | // 5 | // Created by XHY on 15/9/21. 6 | // Copyright © 2015年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JYTLevel1Button : UIButton 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMCustomUI/Button/JYTLevel2Button.h: -------------------------------------------------------------------------------- 1 | // 2 | // JYTLevel2Button.h 3 | // JingYitong 4 | // 5 | // Created by XHY on 15/9/21. 6 | // Copyright © 2015年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JYTLevel2Button : UIButton 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMExtension/UIWindow+Util.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIWindow+Util.h 3 | // Pods 4 | // 5 | // Created by XHY on 2017/7/12. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface UIWindow (Util) 12 | 13 | /** 查询当前栈顶 window */ 14 | + (UIWindow *)findVisibleWindow; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Source/BMManager/Version/BMJSVersionModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMJSVersionModel.m 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/2/28. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import "BMJSVersionModel.h" 10 | 11 | @implementation BMJSVersionModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMComponent/Text/BMTextComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMTextComponent.h 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/3/24. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BMTextComponent : WXComponent 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMCustomUI/Label/JYTBigTitleLabel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JYTBigTitleLabel.h 3 | // JingYitong 4 | // 5 | // Created by XHY on 15/9/22. 6 | // Copyright © 2015年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JYTBigTitleLabel : UILabel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMCustomUI/Label/JYTHomeTitleLabel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JYTHomeTitleLabel.h 3 | // JingYitong 4 | // 5 | // Created by XHY on 16/6/13. 6 | // Copyright © 2016年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JYTHomeTitleLabel : UILabel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMModule/Image/BMImageModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMImageModule.h 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2017/12/29. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | @interface BMImageModule : NSObject 12 | 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Source/BMCustomUI/Button/JYTLevel3Button.h: -------------------------------------------------------------------------------- 1 | // 2 | // JYTLevel3Button.h 3 | // JingYitong 4 | // 5 | // Created by saohuobang on 15/9/25. 6 | // Copyright © 2015年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JYTLevel3Button : UIButton 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMCustomUI/Label/JYTBoldContentLabel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JYTBoldContentLabel.h 3 | // JingYitong 4 | // 5 | // Created by XHY on 16/1/11. 6 | // Copyright © 2016年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JYTBoldContentLabel : UILabel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMCustomUI/Label/JYTLabelFontSize13.h: -------------------------------------------------------------------------------- 1 | // 2 | // JYTLabelFontSize13.h 3 | // JingYitong 4 | // 5 | // Created by XHY on 16/5/30. 6 | // Copyright © 2016年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JYTLabelFontSize13 : UILabel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMCustomUI/Label/JYTSmallTitleLabel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JYTSmallTitleLabel.h 3 | // JingYitong 4 | // 5 | // Created by XHY on 15/9/22. 6 | // Copyright © 2015年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JYTSmallTitleLabel : UILabel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMModule/Tabbar/BMTabbarModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMTabbarModule.h 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2018/6/21. 6 | // 7 | 8 | #import 9 | #import "WXModuleProtocol.h" 10 | 11 | @interface BMTabbarModule : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMModule/Axios/BMAxiosRequestModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMAxiosRequestModel.m 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/13. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import "BMAxiosRequestModel.h" 10 | 11 | @implementation BMAxiosRequestModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMModule/WebSocket/BMWebSocketModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMWebSocketModule.h 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2017/10/23. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | @interface BMWebSocketModule : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMComponent/Pop/BMMaskComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMMaskComponent.h 3 | // Pods 4 | // 5 | // Created by XHY on 2017/4/27. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface BMMaskComponent : WXComponent 12 | 13 | - (void)getPopViewRectNeedUpdateFrame:(BOOL)update; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Source/BMCustomUI/Label/JYTBoldBigTitleLabel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JYTBoldBigTitleLabel.h 3 | // JingYitong 4 | // 5 | // Created by saohuobang on 15/9/24. 6 | // Copyright © 2015年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JYTBoldBigTitleLabel : UILabel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMCustomUI/Label/JYTLabelBoldFontSize21.h: -------------------------------------------------------------------------------- 1 | // 2 | // JYTLabelBoldFontSize21.h 3 | // JingYitong 4 | // 5 | // Created by XHY on 16/6/13. 6 | // Copyright © 2016年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JYTLabelBoldFontSize21 : UILabel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMComponent/Calendar/BMCalendarComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMCalendarComponent.h 3 | // BM-Doctor 4 | // 5 | // Created by XHY on 2017/5/12. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BMCalendarComponent : WXComponent 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMModule/AuthorizedLogin/BMAuthorLoginModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMAuthorLoginModule.h 3 | // Pods 4 | // 5 | // Created by XHY on 2017/5/5. 6 | // 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface BMAuthorLoginModule : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Source/BMModule/Navigation/BMNavigatorModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMNavigatorModule.h 3 | // Pods 4 | // 5 | // Created by XHY on 2017/5/16. 6 | // 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface BMNavigatorModule : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Source/BMManager/Handler/BMCheckUpdateProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMCheckUpdateProtocol.h 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2018/6/28. 6 | // 7 | 8 | #import 9 | 10 | @protocol BMCheckUpdateProtocol 11 | 12 | /** 检查更新 */ 13 | - (void)checkUpdate; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Source/BMModule/Communication/BMCommunicationModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMCommunicationModule.h 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2017/12/27. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | @interface BMCommunicationModule : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMModule/Picker/BMPickerModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMPickerModule.h 3 | // Pods 4 | // 5 | // Created by 窦静轩 on 2017/5/5. 6 | // 7 | // 8 | 9 | #import 10 | #import "WXModuleProtocol.h" 11 | 12 | @interface BMPickerModule : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Source/BMCustomUI/HYGuideView/HYGuideView.h: -------------------------------------------------------------------------------- 1 | // 2 | // HYGuideView.h 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/2/23. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HYGuideView : UIView 12 | 13 | + (void)showInView:(UIView *)view; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Source/BMCustomUI/Label/JYTContentLabel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JYTContentLabel.h 3 | // JingYitong 4 | // 5 | // Created by XHY on 15/9/18. 6 | // Copyright © 2015年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JYTContentLabel : UILabel 12 | 13 | + (UIFont *)currentFont; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Source/BMDebug/DebugSettingVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // DebugSettingVC.h 3 | // TicketAnalysis 4 | // 5 | // Created by XHY on 17/3/24. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | 10 | #ifdef DEBUG 11 | #import 12 | 13 | @interface DebugSettingVC : UIViewController 14 | 15 | @end 16 | #endif 17 | -------------------------------------------------------------------------------- /Source/BMManager/Mediator/CTMediator+BMShareActions.h: -------------------------------------------------------------------------------- 1 | // 2 | // CTMediator+BMShareActions.h 3 | // Pods 4 | // 5 | // Created by XHY on 2018/4/25. 6 | // 7 | 8 | #import "CTMediator.h" 9 | 10 | @interface CTMediator (BMShareActions) 11 | 12 | - (BOOL)CTMediator_ShareHandleOpenURL:(NSDictionary *)info; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Source/BMModule/BundleUpdate/BMBundleUpdateModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMBundleUpdateModule.h 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2018/7/17. 6 | // 7 | 8 | #import 9 | #import "WXModuleProtocol.h" 10 | 11 | @interface BMBundleUpdateModule : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMController/BaseVc/BMNavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMNavigationController.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/12. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BMNavigationController : UINavigationController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMCustomUI/Label/JYTBoldTitleLabel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JYTBoldTitleLabel.h 3 | // JingYitong 4 | // 5 | // Created by XHY on 15/9/21. 6 | // Copyright © 2015年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JYTBoldTitleLabel : UILabel 12 | 13 | + (UIFont *)currentFont; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Source/BMCustomUI/WatermarkView/WatermarkView.h: -------------------------------------------------------------------------------- 1 | // 2 | // WatermarkView.h 3 | // Pods 4 | // 5 | // Created by XHY on 2017/8/9. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface WatermarkView : UIView 12 | 13 | /** 添加文字水印的view到 Window上 */ 14 | + (void)addWatermarkWithText:(NSString *)text; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Source/BMHandler/BMConfigCenterHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMConfigCenterHandler.h 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2017/9/22. 6 | // 7 | 8 | #import 9 | #import "WXConfigCenterProtocol.h" 10 | 11 | @interface BMConfigCenterHandler : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMManager/Mediator/CTMediator+BMPayActions.h: -------------------------------------------------------------------------------- 1 | // 2 | // CTMediator+BMPayActions.h 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2018/4/25. 6 | // 7 | 8 | #import "CTMediator.h" 9 | 10 | @interface CTMediator (BMPayActions) 11 | 12 | - (BOOL)CTMediator_PayHandleOpenURL:(NSDictionary *)info; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Source/BMManager/StartConfig/BMAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMAppDelegate.h 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2018/4/26. 6 | // 7 | 8 | #import 9 | 10 | @interface BMAppDelegate : UIResponder 11 | 12 | @property (nonatomic, strong) UIWindow *window; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Source/BMController/BaseVc/BMLaunchViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMLaunchViewController.h 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/2/20. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import "BMBaseViewController.h" 10 | 11 | @interface BMLaunchViewController : BMBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMExtension/UIColor+Util.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Util.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/23. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIColor (Util) 12 | 13 | + (UIColor *)colorWithHexString:(id)hexColorString; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Source/BMModule/Events/BMEventsModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMEvents.h 3 | // BM-JYT 4 | // 5 | // Created by 窦静轩 on 2017/3/28. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface BMEventsModule : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Source/BMModule/Tools/BMToolsModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMToolsModule.h 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/4/17. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface BMToolsModule : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Source/BMModule/WebSocket/BMWebSocketDefaultImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMWebSocketDefaultImpl.h 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2017/10/23. 6 | // 7 | 8 | #import 9 | #import "BMWebSocketHandler.h" 10 | 11 | @interface BMWebSocketDefaultImpl : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMDebug/BMHotRefreshWebScoket.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMHotRefreshWebScoket.h 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2018/3/15. 6 | // 7 | #ifdef DEBUG 8 | #import 9 | 10 | @interface BMHotRefreshWebScoket : NSObject 11 | 12 | - (void)connect; 13 | 14 | - (void)close; 15 | 16 | @end 17 | #endif 18 | -------------------------------------------------------------------------------- /Source/BMModule/Modal/BMModalModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMModalModule.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/23. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface BMModalModule : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Source/BMComponent/RichText/BMRichTextComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMRichTextComponent.h 3 | // Pods 4 | // 5 | // Created by XHY on 2017/4/12. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BMRichTextComponent : WXComponent 12 | 13 | - (void)updateRichText; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Source/BMModule/Camera/BMCameraModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMCameraModule.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/2/4. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface BMCameraModule : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Source/BMModule/Storage/BMStorageModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMStorageModule.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/2/8. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface BMStorageModule : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Source/BMDebug/BMDragButton+Debug.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMDragButton+Debug.h 3 | // BM-JYT 4 | // 5 | // Created by 窦静轩 on 2017/3/10. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #ifdef DEBUG 10 | 11 | #import "BMDragButton.h" 12 | 13 | @interface BMDragButton(Debug) 14 | + (instancetype)debugButton; 15 | @end 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /Source/BMModule/AppConfig/BMAppConfigModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMAppConfigModule.h 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/3/13. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface BMAppConfigModule : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Source/BMModule/Router/BMRouterModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMRouterModule.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/11. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | 13 | @interface BMRouterModule : NSObject 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Source/BMWeexExtension/BMGetEnvironment.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMGetEnvironment.h 3 | // BM-JYT 4 | // 5 | // Created by 窦静轩 on 2017/3/23. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BMGetEnvironment : NSObject 12 | 13 | + (NSDictionary *)bm_getEnvironment; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Source/BMModule/BrowserImg/BMBrowserImgModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMBrowserImgModule.h 3 | // BM-JYT 4 | // 5 | // Created by 窦静轩 on 2017/4/1. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface BMBrowserImgModule : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Source/BMWeexExtension/WXRecyclerComponent+BMExtend.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXRecyclerComponent+BMExtend.h 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2017/9/22. 6 | // 7 | 8 | #import 9 | #import "WXRecyclerComponent.h" 10 | 11 | @interface WXRecyclerComponent (BMExtend) 12 | 13 | - (UIView *)bmRecycler_loadView; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Source/BMModule/Axios/BMAxiosNetworkModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMAxiosNetworkModule.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/13. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface BMAxiosNetworkModule : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Source/BMController/ScanQR/QRShaowView.h: -------------------------------------------------------------------------------- 1 | // 2 | // QRShaowView.h 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2017/10/11. 6 | // 7 | 8 | #import 9 | 10 | @interface QRShaowView : UIView 11 | 12 | @property (nonatomic,assign) CGSize showSize; /**< 有效范围 */ 13 | 14 | - (void)showAnimation; 15 | - (void)stopAnimation; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Source/BMHandler/BMMonitorHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMMonitorHandler.h 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/3/29. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface BMMonitorHandler : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Source/BMModule/Geolocation/BMGeolocationModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMGeolocationModule.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/19. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface BMGeolocationModule : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Source/BMWeexExtension/BMAddRuleManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMAddRuleManager.h 3 | // BM-JYT 4 | // 5 | // Created by 窦静轩 on 2017/3/8. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BMAddRuleManager : NSObject 12 | 13 | +(void)addRule:(NSString*)type rule:(NSDictionary *)rule; 14 | @end 15 | -------------------------------------------------------------------------------- /Source/BMManager/DB/BMDBBaseModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMDBBaseModel.m 3 | // RealmDome 4 | // 5 | // Created by XHY on 2017/3/31. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import "BMDBBaseModel.h" 10 | 11 | @implementation BMDBBaseModel 12 | 13 | /* 设置 主键 */ 14 | + (NSString *)primaryKey 15 | { 16 | return @"key"; 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Source/BMController/WebView/UIWebView+BMExtend.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIWebView+BMExtend.h 3 | // Pods 4 | // 5 | // Created by XHY on 2017/6/30. 6 | // 7 | // 8 | 9 | #import 10 | 11 | #define K_WebView_FontSize @"K_WebView_FontSize" 12 | 13 | @interface UIWebView (BMExtend) 14 | 15 | /** 根据当前字体缩放级别调整字体 */ 16 | - (void)checkCurrentFontSize; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Source/BMDevice/BMDeviceManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMDeviceManager.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/13. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BMDeviceManager : NSObject 12 | /** 13 | * 设备标示 14 | * 15 | * @return string 16 | */ 17 | + (NSString *)deviceID; 18 | @end 19 | -------------------------------------------------------------------------------- /Source/BMManager/StartConfig/BMAppResource.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMAppResource.h 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/3/1. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BMAppResource : NSObject 12 | 13 | /* 根据当前环境拼接完整的js加载路径url */ 14 | + (NSURL *)configJSFullURLWithPath:(NSString *)path; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Source/BMWeexExtension/WXEditComponent_Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXEditComponent_Private.h 3 | // Pods 4 | // 5 | // Created by 窦静轩 on 2017/4/24. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface WXEditComponent () 12 | -(void)setType; 13 | -(void)setKeyboardType:(UIKeyboardType)keyboardType; 14 | -(void)setSecureTextEntry:(BOOL)secureTextEntry; 15 | - (BOOL)isDateType; 16 | @end 17 | -------------------------------------------------------------------------------- /Source/BMHandler/WXBMNetworkDefaultlpml.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXBMNetworkDefaultlpml.h 3 | // BM-JYT 4 | // 5 | // Created by 窦静轩 on 2017/3/6. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface WXBMNetworkDefaultlpml : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Source/ErosApp/Network/BMCommonRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMCommonRequest.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/13. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import "BMBaseRequest.h" 10 | @class BMAxiosRequestModel; 11 | 12 | @interface BMCommonRequest : BMBaseRequest 13 | 14 | - (instancetype)initWithRequestModel:(BMAxiosRequestModel *)model; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Source/BMExtension/NSTimer+Addition.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSTimer+Addition.h 3 | // JingYitong 4 | // 5 | // Created by XHY on 15/8/13. 6 | // Copyright (c) 2015年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSTimer (Addition) 12 | 13 | - (void)pauseTimer; 14 | - (void)resumeTimer; 15 | - (void)resumeTimerAfterTimeInterval:(NSTimeInterval)interval; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Source/BMCustomUI/TabBarBadge/UITabBar+Badge.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITabBar+Badge.h 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2018/5/29. 6 | // 7 | 8 | #import 9 | 10 | @interface UITabBar (Badge) 11 | 12 | - (void)showBadgeOnItenIndex:(int)index value:(NSString *)value backgroundColor:(UIColor *)bgColor textColor:(UIColor *)textColor; 13 | - (void)hideBadgeOnItenIndex:(int)index; 14 | @end 15 | -------------------------------------------------------------------------------- /Source/BMExtension/UINavigationBar+NavigationBarExtend.h: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationBar+NavigationBarExtend.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/13. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UINavigationBar (NavigationBarExtend) 12 | 13 | /** 设置导航栏背景颜色 */ 14 | - (void)ex_setBackgroundColor:(UIColor *)color; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Source/BMModule/Modal/SVProgressHUD/SVRadialGradientLayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // SVRadialGradientLayer.h 3 | // SVProgressHUD, https://github.com/SVProgressHUD/SVProgressHUD 4 | // 5 | // Copyright (c) 2014-2016 Tobias Tiemerding. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface SVRadialGradientLayer : CALayer 11 | 12 | @property (nonatomic) CGPoint gradientCenter; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Source/BMController/BaseVc/BMTabBarController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMTabBarController.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/12. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BMPlatformModel.h" 11 | 12 | @interface BMTabBarController : UITabBarController 13 | 14 | @property (nonatomic, strong) BMPlatformModelTabBar *tabBarInfo; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Source/BMController/ScanQR/BMScanQRViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMScanQRViewController.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/2/4. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface BMScanQRViewController : UIViewController 13 | 14 | @property (nonatomic, copy) WXModuleCallback callback; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Source/BMController/WebView/BMWebViewRouterModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMWebViewRouterModel.m 3 | // Pods 4 | // 5 | // Created by XHY on 2017/7/19. 6 | // 7 | // 8 | 9 | #import "BMWebViewRouterModel.h" 10 | 11 | @implementation BMWebViewRouterModel 12 | 13 | - (instancetype)init 14 | { 15 | if (self = [super init]) { 16 | 17 | _navShow = YES; 18 | } 19 | 20 | return self; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Source/BMExtension/NSData+bsdiff.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+bsdiff.h 3 | // 4 | // Created by 窦静轩 on 16/6/27. 5 | // Copyright © 2016年 微票儿. All rights reserved. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | @interface NSData (bsdiff) 12 | 13 | - (instancetype)initWithData:(NSData *)data andPatch:(NSData *)patch; 14 | 15 | + (NSData *)dataWithData:(NSData *)data andPatch:(NSData *)patch; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Source/BMManager/BMRouter/BMRouterManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMRouterManager.h 3 | // Pods 4 | // 5 | // Created by 窦静轩 on 2017/4/26. 6 | // 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface BMRouterManager : NSObject 13 | 14 | +(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Source/BMManager/Handler/BMHandlerFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMHandlerFactory.h 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2018/6/28. 6 | // 7 | 8 | #import 9 | 10 | @interface BMHandlerFactory : NSObject 11 | 12 | + (void)registerHandler:(id)handler withProtocol:(Protocol *)protocol; 13 | 14 | + (id)handlerForProtocol:(Protocol *)protocol; 15 | 16 | + (NSDictionary *)handlerConfigs; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Source/BMManager/DB/BMDBBaseModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMDBBaseModel.h 3 | // RealmDome 4 | // 5 | // Created by XHY on 2017/3/31. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface BMDBBaseModel : RLMObject 13 | 14 | @property (nonatomic, copy) NSString *key; 15 | @property (nonatomic, copy) NSString *data; // json string 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Source/BMCustomUI/HYAlert/HYAlertViewManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // HYAlertViewManager.h 3 | // JingYitong 4 | // 5 | // Created by XHY on 16/9/29. 6 | // Copyright © 2016年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HYAlertView.h" 11 | 12 | @interface HYAlertViewManager : NSObject 13 | 14 | @property (nonatomic, weak) HYAlertView *currentAlertView; 15 | 16 | + (instancetype)shareInstance; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Source/BMExtension/UIFont+Util.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIFont+Util.h 3 | // Pods 4 | // 5 | // Created by XHY on 2017/5/17. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface UIFont (Util) 12 | 13 | 14 | /** 15 | 获取当前比例的字体字体大小 16 | 17 | @param size 标准字体大小 18 | @return UIFont 19 | */ 20 | + (instancetype)scaleSizeWithSize:(CGFloat)size; 21 | 22 | + (UIFont *)currentTitleFont; 23 | 24 | + (UIFont *)currentContentFont; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Source/BMManager/Version/BMJSVersionModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMJSVersionModel.h 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/2/28. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BMJSVersionModel : NSObject 12 | 13 | @property (nonatomic, copy) NSString *jsPath; // js资源包下载地址 14 | @property (nonatomic, copy) NSString *jsVersion; // js版本号 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Source/BMManager/ScreenshotNotification/BMScreenshotEventManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMScreenshotEventManager.h 3 | // Pods 4 | // 5 | // Created by XHY on 2017/5/12. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface BMScreenshotEventManager : NSObject 12 | 13 | + (instancetype)shareInstance; 14 | 15 | /* 获取截屏的图片 */ 16 | - (UIImage *)snapshotImage; 17 | 18 | /** 19 | 开启监听截屏事件 20 | */ 21 | - (void)monitorScreenshotEvent; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Source/BMWeexExtension/WXBridgeManager+BMExtend.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXBridgeManager+BMExtend.h 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/3/30. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WXBridgeManager (BMExtend) 12 | 13 | - (void)bm_fireEvent:(NSString *)instanceId ref:(NSString *)ref type:(NSString *)type params:(NSDictionary *)params domChanges:(NSDictionary *)domChanges; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Source/BMWeexExtension/WXWebComponent+BMExtend.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXWebComponent+BMExtend.h 3 | // Pods 4 | // 5 | // Created by XHY on 2017/5/5. 6 | // 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface WXWebComponent (BMExtend) 13 | 14 | - (void)bm_webViewDidFinishLoad:(UIWebView *)webView; 15 | 16 | - (void)bm_viewDidLoad; 17 | 18 | - (void)setUrl:(NSString *)url; 19 | - (void)bm_setUrl:(NSString *)url; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Source/BMController/BaseVc/BMBaseViewController+Extend.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMBaseViewController+Extend.h 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/3/16. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import "BMBaseViewController.h" 10 | 11 | @interface BMBaseViewController (Extend) 12 | 13 | /* 添加返回按钮 */ 14 | - (void)addBackBarbuttonItem; 15 | 16 | /* dismiss 页面 */ 17 | - (void)dismissViewController; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Source/BMModule/WebView/WXWebViewModule+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXWebViewModule+Private.h 3 | // Pods 4 | // 5 | // Created by 窦静轩 on 2017/5/3. 6 | // 7 | // 8 | 9 | #import 10 | 11 | #import 12 | #import 13 | @class WXWebComponent; 14 | 15 | @interface WXWebViewModule(BMExtend) 16 | 17 | 18 | - (void)performBlockWithWebView:(NSString *)elemRef block:(void (^)(WXWebComponent *))block; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Source/BMManager/Version/BMResourceCheck.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMResourceCheck.h 3 | // BM-JYT 4 | // 5 | // Created by 窦静轩 on 2017/3/13. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | typedef void (^bmResourceCheckResult)(BOOL check,NSDictionary* info); 13 | 14 | 15 | @interface BMResourceCheck : NSObject 16 | 17 | 18 | +(void)checkLocalResourceByZipPath:(NSString*)zipPath result:(bmResourceCheckResult)result; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Source/BMController/WebView/BMWebViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMWebViewController.h 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/2/28. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BMWebViewRouterModel.h" 11 | 12 | @interface BMWebViewController : UIViewController 13 | 14 | @property (nonatomic, strong) BMWebViewRouterModel *routerInfo; 15 | 16 | - (instancetype)initWithRouterModel:(BMWebViewRouterModel *)model; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Source/BMComponent/Calendar/Views/RangePickerCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // RangePickerCell.h 3 | // FSCalendar 4 | // 5 | // Created by dingwenchao on 02/11/2016. 6 | // Copyright © 2016 Wenchao Ding. All rights reserved. 7 | // 8 | 9 | #import "FSCalendar.h" 10 | 11 | @interface RangePickerCell : FSCalendarCell 12 | 13 | // The start/end of the range 14 | @property (weak, nonatomic) CALayer *selectionLayer; 15 | 16 | // The middle of the range 17 | @property (weak, nonatomic) CALayer *middleLayer; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Source/BMHandler/WXImgLoaderDefaultImpl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | #import 11 | 12 | @interface WXImgLoaderDefaultImpl : NSObject 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BMNetwork/JsResourceRequest/BMUpdateBundlejsRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMUpdateBundlejsRequest.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/10. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import "BMBaseRequest.h" 10 | 11 | @interface BMUpdateBundlejsRequest : BMBaseRequest 12 | 13 | - (instancetype)initWithDownloadJSUrl:(NSString *)downloadUrl; 14 | 15 | 16 | /** 17 | 将当前下载的临时文件信息保存到指定目录 以便下次继续断点续传 18 | */ 19 | - (void)saveIncompleteDownloadTempData; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Source/BMDebug/BMDragButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMDragButton.h 3 | // BM-JYT 4 | // 5 | // Created by 窦静轩 on 2017/3/10. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #ifdef DEBUG 10 | 11 | #import 12 | 13 | @interface BMDragButton : UIView 14 | 15 | @property(nonatomic,assign,getter = isDragEnable) BOOL dragEnable; 16 | @property(nonatomic,assign,getter = isAdsorbEnable) BOOL adsorbEnable; 17 | @property(nonatomic,weak) UIViewController * controller; 18 | 19 | @end 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /Source/BMWeexExtension/WXSDKEngine+BMExtend.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXSDKEngine+BMExtend.h 3 | // Pods 4 | // 5 | // Created by 窦静轩 on 2017/5/5. 6 | // 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface WXSDKEngine (BMExtend) 13 | 14 | +(void)bm_registerDefaultHandlers; 15 | 16 | +(void)bm_registerDefaultModules; 17 | 18 | + (void)registerModule:(NSString *)name withClass:(Class)clazz; 19 | 20 | +(void)_registerDefaultHandlers; 21 | 22 | +(void)_registerDefaultModules; 23 | @end 24 | -------------------------------------------------------------------------------- /Source/ErosApp/ViewControllerExtend/BMBaseViewController+Order.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMBaseViewController+Order.h 3 | // Pods 4 | // 5 | // Created by XHY on 2017/5/22. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface BMBaseViewController (Order) 12 | 13 | /** 判断当前页面路径 */ 14 | - (BOOL)currentVcIs:(NSString *)url; 15 | 16 | /** 判断是否隐藏导航栏 */ 17 | - (BOOL)isHideNavbar; 18 | 19 | /** 设置状态栏样式 */ 20 | - (void)bmSetStatusBarStyle; 21 | 22 | /** 获取weex页面可用高度 */ 23 | - (CGFloat)weexViewHeight; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Source/BMModule/Modal/SVProgressHUD/SVIndefiniteAnimatedView.h: -------------------------------------------------------------------------------- 1 | // 2 | // SVIndefiniteAnimatedView.h 3 | // SVProgressHUD, https://github.com/SVProgressHUD/SVProgressHUD 4 | // 5 | // Copyright (c) 2014-2016 Guillaume Campagna. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface SVIndefiniteAnimatedView : UIView 11 | 12 | @property (nonatomic, assign) CGFloat strokeThickness; 13 | @property (nonatomic, assign) CGFloat radius; 14 | @property (nonatomic, strong) UIColor *strokeColor; 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /Source/BMWeexExtension/WXSDKInstance+BMExtend.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXSDKInstance+BMExtend.h 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/3/29. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface WXSDKInstance (BMExtend) 13 | 14 | -(void)bm_destroyInstance; 15 | 16 | 17 | - (void)_renderWithMainBundleString:(NSString *)mainBundleString; 18 | - (void)bm__renderWithMainBundleString:(NSString *)mainBundleString; 19 | 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Source/BMNetwork/UploadImage/BMUploadImageRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMUploadImageRequest.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/2/10. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import "BMBaseRequest.h" 10 | #import 11 | #import "BMUploadImageModel.h" 12 | 13 | @interface BMUploadImageRequest : BMBaseRequest 14 | 15 | - (instancetype)initWithImage:(UIImage *)image uploadImageModel:(BMUploadImageModel *)imageModel; 16 | 17 | @property (nonatomic,strong)UIImage * image; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Source/BMWeexExtension/BMInputView.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMInputView.h 3 | // BM-JYT 4 | // 5 | // Created by 窦静轩 on 2017/3/11. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class BMInputView; 12 | 13 | typedef NS_ENUM(NSInteger, BMInputTextType) { 14 | BMInputIDCardType, //默认从0开始 15 | BMInputOtherType 16 | }; 17 | 18 | @interface BMInputView : UIView 19 | 20 | -(instancetype)initWithInputType:(BMInputTextType)type; 21 | 22 | @property (nonatomic,assign)UITextField * textFiled; 23 | 24 | @end 25 | 26 | -------------------------------------------------------------------------------- /Source/BMWeexExtension/WXTextComponent+BMExtend.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXTextComponent+BMExtend.h 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/3/20. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface WXTextComponent (BMExtend) 13 | 14 | - (instancetype)bmText_initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Source/BMController/WebView/BMWebViewRouterModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMWebViewRouterModel.h 3 | // Pods 4 | // 5 | // Created by XHY on 2017/7/19. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface BMWebViewRouterModel : NSObject 12 | 13 | @property (nonatomic, copy) NSString *url; /**< url */ 14 | @property (nonatomic, copy) NSString *title; /**< 页面标题 */ 15 | @property (nonatomic, assign) BOOL navShow; /**< 是否隐藏导航栏 */ 16 | @property (nonatomic, copy) NSString *backgroundColor; /**< 页面背景颜色 */ 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Source/BMModule/Camera/BMUploadImageModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMUploadImageModel.m 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/3/8. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import "BMUploadImageModel.h" 10 | 11 | @implementation BMUploadImageModel 12 | 13 | - (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic { 14 | 15 | if (!_imageWidth) { 16 | _imageWidth = 800; 17 | } 18 | 19 | if ([_url isEqualToString:@""]) { 20 | _url = nil; 21 | } 22 | 23 | return YES; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Source/BMModule/Modal/SVProgressHUD/SVProgressAnimatedView.h: -------------------------------------------------------------------------------- 1 | // 2 | // SVProgressAnimatedView.h 3 | // SVProgressHUD, https://github.com/SVProgressHUD/SVProgressHUD 4 | // 5 | // Copyright (c) 2016 Tobias Tiemerding. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface SVProgressAnimatedView : UIView 11 | 12 | @property (nonatomic, assign) CGFloat radius; 13 | @property (nonatomic, assign) CGFloat strokeThickness; 14 | @property (nonatomic, strong) UIColor *strokeColor; 15 | @property (nonatomic, assign) CGFloat strokeEnd; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Source/BMExtension/UINavigationBar+NavigationBarExtend.m: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationBar+NavigationBarExtend.m 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/13. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import "UINavigationBar+NavigationBarExtend.h" 10 | #import 11 | 12 | @implementation UINavigationBar (NavigationBarExtend) 13 | 14 | - (void)ex_setBackgroundColor:(UIColor *)color 15 | { 16 | [self setBackgroundImage:[UIImage imageWithColor:color size:self.size] forBarMetrics:UIBarMetricsDefault]; 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Source/BMExtension/NSDictionary+Util.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+Util.h 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/2/21. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_OPTIONS(NSInteger, BMResCode) { 12 | BMResCodeSuccess = 0, 13 | BMResCodeError = 9, 14 | BMResCodeOther = 3 15 | }; 16 | 17 | @interface NSDictionary (Util) 18 | 19 | /* 统一构建js callback 回调数据方法 */ 20 | + (NSDictionary *)configCallbackDataWithResCode:(NSInteger)resCode msg:(NSString *)msg data:(id)data; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Source/BMManager/AuthorLogin/BMAuthorManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMAuthorManager.h 3 | // Pods 4 | // 5 | // Created by 窦静轩 on 2017/5/5. 6 | // 7 | // 8 | 9 | #import 10 | #import "BMModuleProtocol.h" 11 | #import 12 | 13 | @interface BMAuthorManager : NSObject 14 | 15 | + (instancetype)shareInstance; 16 | 17 | @property (nonatomic,copy)WXModuleCallback wechatLoginCallback; 18 | @property (nonatomic,copy)WXModuleCallback failed; 19 | 20 | /* 从其他app掉起次app时调用 */ 21 | - (BOOL)applicationOpenURL:(NSURL *)url; 22 | @end 23 | -------------------------------------------------------------------------------- /Source/BMModule/Router/BMRouterModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMRouterModel.m 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/16. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import "BMRouterModel.h" 10 | 11 | @implementation BMRouterModel 12 | 13 | - (instancetype)init 14 | { 15 | if (self = [super init]) { 16 | _canBack = YES; 17 | _navShow = YES; 18 | _gesBack = YES; 19 | } 20 | return self; 21 | } 22 | 23 | + (NSDictionary *)modelCustomPropertyMapper 24 | { 25 | return @{@"vLength" : @"length"}; 26 | } 27 | 28 | 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Source/BMHandler/BMMonitorHandler.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMMonitorHandler.m 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/3/29. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import "BMMonitorHandler.h" 10 | 11 | @implementation BMMonitorHandler 12 | 13 | - (void)commitAppMonitorArgs:(NSDictionary *)args 14 | { 15 | /** 这里可以统计页面渲染时间等信息 */ 16 | } 17 | 18 | - (void)commitAppMonitorAlarm:(NSString *)pageName monitorPoint:(NSString *)monitorPoint success:(BOOL)success errorCode:(NSString *)errorCode errorMsg:(NSString *)errorMsg arg:(NSString *)arg 19 | { 20 | /** 这里可以统计 js 报错信息*/ 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Source/BMWeexExtension/WXListComponent+BMExtend.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXListComponent+BMExtend.h 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/3/21. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface WXListComponent (BMExtend) 13 | 14 | //- (instancetype)bmList_initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance; 15 | // 16 | //- (void)bmList_scrollViewDidScroll:(UIScrollView *)scrollView; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Source/BMManager/StartConfig/BMPlatformModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMPlatformModel.m 3 | // Pods 4 | // 5 | // Created by XHY on 2017/8/15. 6 | // 7 | // 8 | 9 | #import "BMPlatformModel.h" 10 | 11 | @implementation BMPlatformModelPage 12 | @end 13 | 14 | @implementation BMPlatformModelUrl 15 | @end 16 | 17 | @implementation BMPlatformModelGetui 18 | @end 19 | 20 | @implementation BMTabBarItem 21 | @end 22 | 23 | @implementation BMPlatformModelTabBar 24 | 25 | + (NSDictionary *)modelContainerPropertyGenericClass { 26 | return @{@"list" : [BMTabBarItem class]}; 27 | } 28 | 29 | @end 30 | 31 | @implementation BMPlatformModel 32 | @end 33 | 34 | -------------------------------------------------------------------------------- /Source/BMWeexExtension/WXRecyclerComponent+BMExtend.m: -------------------------------------------------------------------------------- 1 | // 2 | // WXRecyclerComponent+BMExtend.m 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2017/9/22. 6 | // 7 | 8 | #import "WXRecyclerComponent+BMExtend.h" 9 | 10 | @implementation WXRecyclerComponent (BMExtend) 11 | 12 | - (UIView *)bmRecycler_loadView 13 | { 14 | UIView *view = [self bmRecycler_loadView]; 15 | // UICollectionView *collectionView = (UICollectionView *)view; 16 | // if (@available(iOS 11.0, *)) { 17 | // if (!isIphoneX) collectionView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; 18 | // } 19 | return view; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Source/BMDebug/BMDebugManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMDebugWindow.h 3 | // BM-JYT 4 | // 5 | // Created by 窦静轩 on 2017/3/10. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #ifdef DEBUG 10 | #import 11 | 12 | #define BM_HotRefreshKey @"BM_HotRefreshKey" 13 | 14 | @interface BMDebugManager : NSObject 15 | 16 | //获得单例对象 17 | + (instancetype)shareInstance; 18 | 19 | // 显示 20 | - (void)show; 21 | // 消失 22 | - (void)dismiss; 23 | 24 | // 连接 热刷新WS Server 25 | - (void)hotRefreshWebSocketConnect; 26 | 27 | // 关闭 热刷新WS 28 | - (void)hotRefreshWebSocketClose; 29 | 30 | // 刷新当前 weex 页面 31 | - (void)refreshWeex; 32 | 33 | @end 34 | #endif 35 | -------------------------------------------------------------------------------- /Source/BMManager/Mediator/CTMediator+BMPushActions.h: -------------------------------------------------------------------------------- 1 | // 2 | // CTMediator+BMPushActions.h 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2018/4/24. 6 | // 7 | // BMPush 事件中介者 8 | 9 | #import "CTMediator.h" 10 | 11 | @interface CTMediator (BMPushActions) 12 | 13 | - (void)CTMediator_registerForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken; 14 | - (void)CTMediator_setIsLaunchedByNotification:(BOOL)val; 15 | - (void)CTMediator_addPushNotification:(NSDictionary *)notificationPayload; 16 | - (void)CTMediator_receiveRemoteNotification:(NSDictionary *)info; 17 | - (void)CTMediator_performFetchWithCompletionHandler:(NSDictionary *)info; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Source/BMManager/StartConfig/BMAppResource.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMAppResource.m 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/3/1. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import "BMAppResource.h" 10 | #import "BMConfigManager.h" 11 | 12 | #define K_LOAD_JS_KEY @"load_js_resource" 13 | 14 | @implementation BMAppResource 15 | 16 | + (NSURL *)configJSFullURLWithPath:(NSString *)path 17 | { 18 | /* 拼接完整的路径 */ 19 | NSString *urlPath = [NSString stringWithFormat:@"%@%@",[[BMConfigManager shareInstance].platform.url.jsServer stringByAppendingString:K_JS_ADD_PATH],path]; 20 | return [NSURL URLWithString:urlPath]; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Source/BMNetwork/BaseRequest/BMBaseRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMBaseRequest.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/13. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * 请求完成回调 13 | * 14 | * @param errorStatus 错误代码(服务器规定) 15 | * @param data 数据dic 16 | */ 17 | typedef void(^RequestResultBlock)(id data); 18 | 19 | @interface BMBaseRequest : YTKRequest 20 | 21 | /** 22 | * 调用此方法请求数据 23 | * 24 | * @param resultBlock 返回结果block (先判断errorDescription == nil,说明数据请求出错,!= nil,请求成功,解析data即可) 25 | */ 26 | - (void)startRequestResult:(RequestResultBlock)resultBlock; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Source/BMComponent/RichText/BMSpanComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMSpanComponent.h 3 | // Pods 4 | // 5 | // Created by XHY on 2017/6/14. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface BMSpanComponent : WXComponent 12 | 13 | @property (nonatomic, copy) NSString *text; 14 | @property (nonatomic, strong) UIColor *textColor; 15 | @property (nonatomic, assign) CGFloat fontSize; 16 | @property (nonatomic, copy) NSString *fontFamily; 17 | @property (nonatomic, assign) CGFloat fontWeight; 18 | @property (nonatomic, assign) WXTextStyle fontStyle; 19 | @property (nonatomic, assign) WXTextDecoration textDecoration; 20 | 21 | @property (nonatomic, assign) BOOL clickEvent; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Source/BMManager/Location/JYTLocationManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // JYTLocationManager.h 3 | // JingYitong 4 | // 5 | // Created by XHY on 16/5/26. 6 | // Copyright © 2016年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void(^CurrentLocationBlock)(NSString *lon, NSString *lat); 12 | 13 | @interface JYTLocationManager : NSObject 14 | 15 | + (instancetype)shareInstance; 16 | 17 | /** 18 | * 获取当前坐标 19 | * 20 | * @param block 返回经纬度 21 | */ 22 | - (void)getCurrentLocation:(CurrentLocationBlock)block; 23 | 24 | /** 25 | * 获取上一次定位信息 26 | * 27 | * @param block 返回上一次定位的信息 28 | */ 29 | - (void)getCacheLocation:(CurrentLocationBlock)block; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Source/BMNetwork/JsResourceRequest/BMCheckJsVersionRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMCheckJsVersionRequest.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/10. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import "BMBaseRequest.h" 10 | 11 | @interface BMCheckJsVersionRequest : BMBaseRequest 12 | 13 | - (instancetype)initWithAppName:(NSString *)appName appVersion:(NSString *)appVersion jsVersion:(NSString *)jsVersion isDiff:(BOOL)isDiff; 14 | 15 | @property (nonatomic,readonly)NSString * appName; 16 | 17 | @property (nonatomic,readonly)NSString * appVersion; 18 | 19 | @property (nonatomic,readonly)NSString * jsVersion; 20 | 21 | @property (nonatomic,readonly)BOOL isDiff; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Source/BMManager/Mediator/CTMediator+BMShareActions.m: -------------------------------------------------------------------------------- 1 | // 2 | // CTMediator+BMShareActions.m 3 | // Pods 4 | // 5 | // Created by XHY on 2018/4/25. 6 | // 7 | 8 | #import "CTMediator+BMShareActions.h" 9 | 10 | NSString *const kCTMediatorWXShareTarget = @"BMWXShare"; 11 | 12 | NSString *const kCTMediatorActionHandleOpenURL = @"ShareHandleOpenURL"; 13 | 14 | @implementation CTMediator (BMShareActions) 15 | 16 | - (BOOL)CTMediator_ShareHandleOpenURL:(NSDictionary *)info 17 | { 18 | id result = [self performTarget:kCTMediatorWXShareTarget 19 | action:kCTMediatorActionHandleOpenURL 20 | params:info 21 | shouldCacheTarget:NO]; 22 | return [result boolValue]; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Source/BMModel/BMUserInfoModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMUserInfoModel.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/2/7. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BMUserInfoModel : NSObject 12 | 13 | + (instancetype)shareInstance; 14 | 15 | - (void)clearData; 16 | 17 | @property (nonatomic, copy) NSString *phone; 18 | @property (nonatomic, copy) NSString *name; // 昵称 19 | @property (nonatomic, copy) NSString *image; 20 | @property (nonatomic, copy) NSString *token; 21 | @property (nonatomic, assign) BOOL auth; // 是否已经实名认证 22 | @property (nonatomic, assign) BOOL existPwd; // 是否存在密码 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Source/BMTransition/BMPresentLikeQQTransition.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMPresentLikeQQTransition.h 3 | // Pods 4 | // 5 | // Created by XHY on 2017/5/16. 6 | // 7 | // 8 | 9 | #import 10 | #import 11 | 12 | typedef NS_ENUM(NSUInteger,BMPresentLikeQQTransitionType) { 13 | BMPresentLikeQQTransitionTypePresent = 0, /* present方式 */ 14 | BMPresentLikeQQTransitionTypeDismiss /* dismiss方式 */ 15 | }; 16 | 17 | @interface BMPresentLikeQQTransition : NSObject 18 | 19 | + (instancetype)transitionWithTransitionType:(BMPresentLikeQQTransitionType)type; 20 | - (instancetype)initWithTransitionType:(BMPresentLikeQQTransitionType)type; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Source/BMManager/StartConfig/BMConfigManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMConfigManager.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/10. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "BMPlatformModel.h" 12 | 13 | @interface BMConfigManager : NSObject 14 | 15 | @property (nonatomic, readonly) BMPlatformModel *platform; 16 | 17 | @property (nonatomic,strong) NSDictionary *envInfo; /**< 环境信息 */ 18 | 19 | + (instancetype)shareInstance; 20 | 21 | /** app启动时候配置一些参数 */ 22 | + (void)configDefaultData; 23 | 24 | /** 应用最新js资源文件 */ 25 | + (void)compareVersion; 26 | 27 | /** 其他app掉起app回调方法 */ 28 | - (BOOL)applicationOpenURL:(NSURL *)url; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Source/BMManager/Mediator/CTMediator+BMPayActions.m: -------------------------------------------------------------------------------- 1 | // 2 | // CTMediator+BMPayActions.m 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2018/4/25. 6 | // 7 | 8 | #import "CTMediator+BMPayActions.h" 9 | 10 | NSString *const kCTMediatorWXPayTarget = @"BMWXPay"; 11 | NSString *const kCTMediatorActionPayHandleOpenURL = @"PayHandleOpenURL"; 12 | 13 | @implementation CTMediator (BMPayActions) 14 | 15 | - (BOOL)CTMediator_PayHandleOpenURL:(NSDictionary *)info 16 | { 17 | id result = [self performTarget:kCTMediatorWXPayTarget 18 | action:kCTMediatorActionPayHandleOpenURL 19 | params:info 20 | shouldCacheTarget:NO]; 21 | return [result boolValue]; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Source/BMWeexExtension/WXBridgeManager+BMExtend.m: -------------------------------------------------------------------------------- 1 | // 2 | // WXBridgeManager+BMExtend.m 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/3/30. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import "WXBridgeManager+BMExtend.h" 10 | #import 11 | 12 | @implementation WXBridgeManager (BMExtend) 13 | 14 | - (void)bm_fireEvent:(NSString *)instanceId ref:(NSString *)ref type:(NSString *)type params:(NSDictionary *)params domChanges:(NSDictionary *)domChanges 15 | { 16 | WXSDKInstance *instance = [WXSDKManager instanceForID:instanceId]; 17 | if (!instance) return; 18 | 19 | [self bm_fireEvent:instanceId ref:ref type:type params:params domChanges:domChanges]; 20 | } 21 | 22 | 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Source/BMModule/WebSocket/BMWebSocketLoader.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMWebSocketLoader.h 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2017/10/23. 6 | // 7 | 8 | #import 9 | 10 | @interface BMWebSocketLoader : NSObject 11 | 12 | @property (nonatomic, copy) void (^onOpen)(); 13 | @property (nonatomic, copy) void (^onReceiveMessage)(id); 14 | @property (nonatomic, copy) void (^onClose)(NSInteger,NSString *,BOOL); 15 | @property (nonatomic, copy) void (^onFail)(NSError *); 16 | 17 | - (instancetype)initWithUrl:(NSString *)url protocol:(NSString *)protocol; 18 | - (void)open; 19 | - (void)send:(NSString *)data; 20 | - (void)close; 21 | - (void)close:(NSInteger)code reason:(NSString *)reason; 22 | - (void)clear; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Source/BMWeexExtension/WXImageComponent+BMExtend.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXImageComponent+BMExtend.h 3 | // BM-JYT 4 | // 5 | // Created by 窦静轩 on 2017/3/21. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface WXImageComponent (BMExtend) 13 | 14 | - (void)updatePlaceHolderWithFailedBlock:(void(^)(NSString *, NSError *))downloadFailedBlock; 15 | - (void)bm_updatePlaceHolderWithFailedBlock:(void(^)(NSString *, NSError *))downloadFailedBlock; 16 | 17 | - (void)updateContentImageWithFailedBlock:(void(^)(NSString *, NSError *))downloadFailedBlock; 18 | - (void)bm_updateContentImageWithFailedBlock:(void(^)(NSString *, NSError *))downloadFailedBlock; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Source/BMController/BaseVc/BMBaseViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMBaseViewController.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/12. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BMRouterModel.h" 11 | #import "BMCommonRequest.h" 12 | 13 | @interface BMBaseViewController : UIViewController 14 | 15 | @property (nonatomic, strong) WXSDKInstance *instance; /**< instance */ 16 | @property (nonatomic, strong) NSURL *url; 17 | @property (nonatomic, strong) BMRouterModel *routerModel; /**< 页面导航信息 */ 18 | 19 | /* 刷新weex页面 */ 20 | - (void)refreshWeex; 21 | 22 | /* 属于此页面的请求 请调用此方法来将请求的引用添加给此页面,在页面执行viewDidAppear方法时会cancel掉请求 */ 23 | - (void)addRequest:(BMCommonRequest *)request; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Source/BMTransition/BMPresentTranslationTransition.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMPresentTranslationTransition.h 3 | // Pods 4 | // 5 | // Created by XHY on 2017/5/24. 6 | // 7 | // 8 | 9 | #import 10 | #import 11 | 12 | typedef NS_ENUM(NSUInteger,BMPresentTranslationTransitionType) { 13 | BMPresentTranslationTransitionTypePresent = 0, /* present方式 */ 14 | BMPresentTranslationTransitionTypeDismiss /* dismiss方式 */ 15 | }; 16 | 17 | @interface BMPresentTranslationTransition : NSObject 18 | 19 | + (instancetype)transitionWithTransitionType:(BMPresentTranslationTransitionType)type; 20 | - (instancetype)initWithTransitionType:(BMPresentTranslationTransitionType)type; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Source/BMModule/Camera/BMUploadImageModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMUploadImageModel.h 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/3/8. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BMUploadImageModel : NSObject 12 | 13 | @property (nonatomic, copy) NSString *url; /**< 上传图片的地址 如果没有使用native.js中配置的地址 */ 14 | @property (nonatomic, assign) NSInteger maxCount; /**< 一次最多可选择图片数量 */ 15 | @property (nonatomic, assign) CGFloat imageWidth; /**< 图片宽度(根据宽度按比例裁剪) */ 16 | @property (nonatomic, assign) BOOL allowCrop; /**< 是否允许编辑(只有当 maxCount == 1时 此参数才会生效) */ 17 | @property (nonatomic, strong) NSDictionary *params; /**< 请求参数 */ 18 | @property (nonatomic, strong) NSDictionary *header; /**< 请求头 */ 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Source/BMExtension/NSDictionary+Util.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+Util.m 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/2/21. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import "NSDictionary+Util.h" 10 | 11 | @implementation NSDictionary (Util) 12 | 13 | + (NSDictionary *)configCallbackDataWithResCode:(NSInteger)resCode msg:(NSString *)msg data:(id)data 14 | { 15 | NSMutableDictionary *resultDic = [[NSMutableDictionary alloc] init]; 16 | 17 | msg = msg ?: @""; 18 | data = data ?: @""; 19 | 20 | [resultDic setValue:[NSNumber numberWithInteger:resCode] forKey:@"status"]; 21 | [resultDic setValue:msg forKey:@"errorMsg"]; 22 | [resultDic setValue:data forKey:@"data"]; 23 | 24 | return resultDic; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Source/BMModule/Axios/BMAxiosRequestModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMAxiosRequestModel.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/13. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "YYModel.h" 11 | 12 | @interface BMAxiosRequestModel : NSObject 13 | 14 | @property (nonatomic, copy) NSString *method; // 请求类型 GET or POST 15 | @property (nonatomic, copy) NSString *url; // 请求路径 16 | @property (nonatomic, strong) NSDictionary *header; // 请求头 17 | @property (nonatomic, strong) NSMutableDictionary *data; // 请求参数 18 | @property (nonatomic, strong) NSDictionary *params; // post 请求 url 添加参数 19 | @property (nonatomic, assign) CGFloat timeout; // 请求超时时间 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Source/BMController/WebView/UIWebView+BMExtend.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIWebView+BMExtend.m 3 | // Pods 4 | // 5 | // Created by XHY on 2017/6/30. 6 | // 7 | // 8 | 9 | #import "UIWebView+BMExtend.h" 10 | 11 | @implementation UIWebView (BMExtend) 12 | 13 | - (void)checkCurrentFontSize 14 | { 15 | NSNumber *level = [[NSUserDefaults standardUserDefaults] objectForKey:K_WebView_FontSize]; 16 | if (!level) { 17 | return; 18 | } 19 | 20 | NSUInteger currentLevel = [level unsignedIntegerValue]; 21 | 22 | NSInteger fontSize = 100 + currentLevel * 5 - 5; 23 | NSString *jsStr = [NSString stringWithFormat:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '%ld%%'",(long)fontSize]; 24 | [self stringByEvaluatingJavaScriptFromString:jsStr]; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Source/ErosApp/ErosDefine/PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PrefixHeader.pch 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/2/20. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #ifndef PrefixHeader_pch 10 | #define PrefixHeader_pch 11 | 12 | // Include any system framework and library headers here that should be included in all compilation units. 13 | // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. 14 | 15 | #import "BMDefine.h" 16 | #import "NSString+Util.h" 17 | #import "UIView+Util.h" 18 | #import "UIImage+Util.h" 19 | #import "CommonMacro.h" 20 | #import "UIColor+Util.h" 21 | #import "NSDictionary+Util.h" 22 | #import "BMAppResource.h" 23 | #import 24 | #import "UIFont+Util.h" 25 | 26 | #endif /* PrefixHeader_pch */ 27 | -------------------------------------------------------------------------------- /Source/BMExtension/NSTimer+Addition.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSTimer+Addition.m 3 | // JingYitong 4 | // 5 | // Created by XHY on 15/8/13. 6 | // Copyright (c) 2015年 XHY. All rights reserved. 7 | // 8 | 9 | #import "NSTimer+Addition.h" 10 | 11 | @implementation NSTimer (Addition) 12 | 13 | - (void)pauseTimer 14 | { 15 | if (![self isValid]) { 16 | return; 17 | } 18 | 19 | [self setFireDate:[NSDate distantFuture]]; 20 | } 21 | 22 | - (void)resumeTimer 23 | { 24 | if (![self isValid]) { 25 | return; 26 | } 27 | [self setFireDate:[NSDate date]]; 28 | } 29 | 30 | - (void)resumeTimerAfterTimeInterval:(NSTimeInterval)interval 31 | { 32 | if (![self isValid]) { 33 | return; 34 | } 35 | [self setFireDate:[NSDate dateWithTimeIntervalSinceNow:interval]]; 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Source/BMExtension/NSObject+BMSwizzle.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+BMSwizzle.h 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2018/9/6. 6 | // 7 | 8 | #import 9 | 10 | @interface NSObject (BMSwizzle) 11 | 12 | 13 | /** 14 | 交互实例方法 15 | 注:新方法必须通过类别实现 16 | @param originalClass 类 17 | @param originalSelector 原方法 18 | @param swizzledSelector 交换方法 19 | @return YES/NO 20 | */ 21 | + (BOOL)bm_swizzle:(Class)originalClass Method:(SEL)originalSelector withMethod:(SEL)swizzledSelector; 22 | 23 | 24 | /** 25 | 交互类方法 26 | 注:新方法必须通过类别实现 27 | 28 | @param originalClass 类 29 | @param originalSelector 原方法 30 | @param swizzledSelector 交互方法 31 | @return YES/NO 32 | */ 33 | + (BOOL)bm_swizzleClassMethod:(Class)originalClass Method:(SEL)originalSelector withMethod:(SEL)swizzledSelector; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Source/BMCustomUI/HYAlert/HYAlertViewManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // HYAlertViewManager.m 3 | // JingYitong 4 | // 5 | // Created by XHY on 16/9/29. 6 | // Copyright © 2016年 XHY. All rights reserved. 7 | // 8 | 9 | #import "HYAlertViewManager.h" 10 | @implementation HYAlertViewManager 11 | 12 | - (void)setCurrentAlertView:(HYAlertView *)currentAlertView 13 | { 14 | if (_currentAlertView) { 15 | [_currentAlertView dismiss]; 16 | } 17 | _currentAlertView = currentAlertView; 18 | } 19 | 20 | + (instancetype)shareInstance 21 | { 22 | static HYAlertViewManager *_instance = nil; 23 | static dispatch_once_t onceToken; 24 | dispatch_once(&onceToken, ^{ 25 | if (!_instance) { 26 | _instance = [[HYAlertViewManager alloc] init]; 27 | } 28 | }); 29 | return _instance; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Source/BMWeexExtension/WXScrollerComponent+BMExtend.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXScrollerComponent+BMExtend.h 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/3/20. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface WXScrollerComponent (BMExtend) 13 | 14 | - (instancetype)bmScroller_initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance; 15 | 16 | - (void)bmScroller_scrollViewDidScroll:(UIScrollView *)scrollView; 17 | 18 | - (UIView *)bmScroller_loadView; 19 | 20 | - (UIView *)bmList_loadView; 21 | 22 | - (void)bmScroller_viewDidLoad; 23 | 24 | - (void)bmScroller_updateAttributes:(NSDictionary *)attributes; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Source/BMWeexExtension/WXSDKEngine+BMExtend.m: -------------------------------------------------------------------------------- 1 | // 2 | // WXSDKEngine+BMExtend.m 3 | // Pods 4 | // 5 | // Created by 窦静轩 on 2017/5/5. 6 | // 7 | // 8 | 9 | #import "WXSDKEngine+BMExtend.h" 10 | #import "WXResourceRequestHandlerDefaultImpl.h" 11 | 12 | @implementation WXSDKEngine(BMExtend) 13 | 14 | +(void)bm_registerDefaultHandlers 15 | { 16 | [self bm_registerDefaultHandlers]; 17 | 18 | if (nil == [WXSDKEngine handlerForProtocol:@protocol(WXResourceRequestHandler)]) { 19 | [WXSDKEngine registerHandler:[WXResourceRequestHandlerDefaultImpl new] withProtocol:@protocol(WXResourceRequestHandler)]; 20 | } 21 | 22 | 23 | } 24 | 25 | +(void)bm_registerDefaultModules 26 | { 27 | [self bm_registerDefaultModules]; 28 | 29 | [self registerModule:@"picker" withClass:NSClassFromString(@"BMPickerModule")]; 30 | 31 | } 32 | @end 33 | -------------------------------------------------------------------------------- /Source/BMModule/WebSocket/BMWebSocketHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMWebSocketHandler.h 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2017/10/23. 6 | // 7 | 8 | #ifndef BMWebSocketHandler_h 9 | #define BMWebSocketHandler_h 10 | #import "WXModuleProtocol.h" 11 | 12 | @protocol BMWebSocketDelegate 13 | - (void)didOpen; 14 | - (void)didFailWithError:(NSError *)error; 15 | - (void)didReceiveMessage:(id)message; 16 | - (void)didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean; 17 | @end 18 | 19 | @protocol BMWebSocketHandler 20 | 21 | - (void)open:(NSString *)url protocol:(NSString *)protocol withDelegate:(id)delegate; 22 | - (void)sendData:(NSString *)data; 23 | - (void)close; 24 | - (void)closeWithCode:(NSInteger)code reason:(NSString *)reason; 25 | - (void)clear; 26 | @end 27 | 28 | #endif /* BMWebSocketHandler_h */ 29 | -------------------------------------------------------------------------------- /Source/BMManager/Image/BMImageManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMImageManager.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/2/10. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "BMUploadImageModel.h" 12 | 13 | @interface BMImageManager : NSObject 14 | 15 | + (void)camera:(BMUploadImageModel *)model weexInstance:(WXSDKInstance *)weexInstance callback:(WXModuleCallback)callback; 16 | 17 | + (void)pick:(BMUploadImageModel *)model weexInstance:(WXSDKInstance *)weexInstance callback:(WXModuleCallback)callback; 18 | 19 | + (void)uploadImageWithInfo:(BMUploadImageModel *)model weexInstance:(WXSDKInstance *)weexInstance callback:(WXModuleCallback)callback; 20 | 21 | + (void)uploadImage:(NSArray *)images uploadImageModel:(BMUploadImageModel *)model callback:(WXModuleCallback)callback; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Source/BMCustomUI/PullRefresh/BMDotGifHeader.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMDotGifHeader.m 3 | // Pods 4 | // 5 | // Created by XHY on 2017/5/9. 6 | // 7 | // 8 | 9 | #import "BMDotGifHeader.h" 10 | 11 | @implementation BMDotGifHeader 12 | 13 | - (void)prepare 14 | { 15 | [super prepare]; 16 | 17 | 18 | NSMutableArray *idleImages = [NSMutableArray array]; 19 | for (int i = 1; i<=24; i++) { 20 | UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"loadding00%02d", i]]; 21 | [idleImages addObject:image]; 22 | } 23 | 24 | // 设置普通状态的动画图片 25 | [self setImages:idleImages forState:MJRefreshStateIdle]; 26 | 27 | // 设置即将刷新状态的动画图片(一松开就会刷新的状态) 28 | // [self setImages:idleImages forState:MJRefreshStatePulling]; 29 | 30 | // 设置正在刷新状态的动画图片 31 | [self setImages:idleImages duration:0.8 forState:MJRefreshStateRefreshing]; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Source/BMWeexExtension/WXEditComponent+BMExtend.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXEditComponent+BMExtend.h 3 | // Pods 4 | // 5 | // Created by XHY on 2017/4/24. 6 | // 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface WXEditComponent (BMExtend) 13 | 14 | - (instancetype)bmEdit_initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance; 15 | 16 | - (void)bmEdit_viewDidLoad; 17 | 18 | - (void)setAutofocus:(BOOL)b; 19 | - (void)bmEdit_setAutofocus:(BOOL)b; 20 | 21 | - (BOOL)bmEdit_textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text; 22 | 23 | - (void)setType; 24 | -(void)bmSetType; 25 | 26 | - (void)setViewMovedUp:(BOOL)movedUp; 27 | - (void)keyboardWasShown:(NSNotification*)notification; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Source/BMManager/Version/BMResourceManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMResourceManager.h 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/3/10. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class BMJSVersionModel; 12 | 13 | typedef void(^BMUpdateBundleJsBlock)(BOOL success, NSString *msg); 14 | 15 | @interface BMResourceManager : NSObject 16 | 17 | + (instancetype)sharedInstance; 18 | 19 | @property (nonatomic,strong)BMJSVersionModel * model; 20 | @property (nonatomic,copy) NSString *bmWidgetJs; /**< 前端封装的widgets需要native端拼接到每个js文件之前 */ 21 | 22 | -(void)checkNewVersion:(BOOL)isDiff; 23 | 24 | -(NSDictionary*)loadConfigData:(NSString*)configPath; 25 | 26 | /** 比较工程中、cache、当前加载的js版本,应用最新的资源文件 */ 27 | -(void)compareVersion; 28 | 29 | /** 下载jsbundle 资源 */ 30 | -(void)downloadJsBundle:(NSDictionary *)info completed:(BMUpdateBundleJsBlock)completedBlock; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Source/BMCustomUI/HYAlert/HYAlertModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // HYAlertModel.h 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/3/3. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HYAlertModel : NSObject 12 | 13 | @property (nonatomic, copy) NSString *title; // 标题 14 | @property (nonatomic, copy) NSString *titleColor; // 标题颜色 15 | @property (nonatomic, assign) NSTextAlignment titleAlign; // 标题对齐方式 16 | @property (nonatomic, copy) NSString *message; // 内容 17 | @property (nonatomic, copy) NSString *messageColor; // 内容颜色 18 | @property (nonatomic, assign) NSTextAlignment messageAlign; // 内容对齐方式 19 | @property (nonatomic, copy) NSString *okTitle; // 右边按钮文案 20 | @property (nonatomic, copy) NSString *cancelTitle; // 左边按钮文案 21 | 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Source/BMManager/DB/BMDB.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMDB.h 3 | // RealmDome 4 | // 5 | // Created by XHY on 2017/3/31. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void(^BMDBHandleBlock)(BOOL success); 12 | 13 | @interface BMDB : NSObject 14 | 15 | + (instancetype)DB; 16 | 17 | /* 配置数据库 */ 18 | - (void)configDB; 19 | 20 | /* 根据主键 添加 或者 修改数据 */ 21 | - (void)addOrUpdateData:(NSString *)data primatyKey:(NSString *)key success:(BMDBHandleBlock)result; 22 | - (BOOL)addOrUpdateData:(NSString *)data primatyKey:(NSString *)key; 23 | 24 | /* 根据主键读取 model */ 25 | - (NSString *)queryWithPrimatyKey:(NSString *)key; 26 | 27 | /* 根据 主键 删除一数据 */ 28 | - (void)deleteWithPrimatyKey:(NSString *)key success:(BMDBHandleBlock)result; 29 | - (BOOL)deleteWithPrimatyKey:(NSString *)key; 30 | 31 | /* 删除所有数据 */ 32 | - (void)deleteAllSuccess:(BMDBHandleBlock)result; 33 | - (BOOL)deleteAll; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Source/BMModel/BMUserInfoModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMUserInfoModel.m 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/2/7. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import "BMUserInfoModel.h" 10 | #import "YYModel.h" 11 | 12 | @implementation BMUserInfoModel 13 | 14 | + (instancetype)shareInstance 15 | { 16 | static BMUserInfoModel *_instance = nil; 17 | static dispatch_once_t onceToken; 18 | dispatch_once(&onceToken, ^{ 19 | _instance = [[BMUserInfoModel alloc] init]; 20 | }); 21 | return _instance; 22 | } 23 | 24 | - (void)encodeWithCoder:(NSCoder *)aCoder 25 | { 26 | [self yy_modelEncodeWithCoder:aCoder]; 27 | } 28 | 29 | - (id)initWithCoder:(NSCoder *)aDecoder 30 | { 31 | return [self yy_modelInitWithCoder:aDecoder]; 32 | } 33 | 34 | - (void)clearData 35 | { 36 | _name = nil; 37 | _phone = nil; 38 | _image = nil; 39 | _token = nil; 40 | _auth = NO; 41 | _existPwd = NO; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Source/BMModule/Events/BMNotifactionCenter.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMNotifactionCenter.h 3 | // BM-JYT 4 | // 5 | // Created by 窦静轩 on 2017/3/28. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | //WX_EXPORT_METHOD(@selector(on:callback:)) 10 | //WX_EXPORT_METHOD(@selector(once:callback:)) 11 | //WX_EXPORT_METHOD(@selector(off:callback:)) 12 | //WX_EXPORT_METHOD(@selector(emit:)) 13 | 14 | 15 | #import 16 | #import 17 | 18 | @interface BMNotifactionCenter : NSObject 19 | 20 | +(instancetype)defaultCenter; 21 | 22 | 23 | -(void)on:(NSString*)event callback:(WXModuleKeepAliveCallback)callback instance:(WXSDKInstance*)instance; 24 | 25 | 26 | -(void)once:(NSString*)event callback:(WXModuleKeepAliveCallback)callback instance:(WXSDKInstance*)instance; 27 | 28 | 29 | -(void)off:(NSString*)event callback:(WXModuleCallback)callback; 30 | 31 | -(void)emit:(NSString*)event info:(id)info; 32 | 33 | -(void)offAll; 34 | 35 | -(void) destroyObserver:(NSString*)instanceId; 36 | @end 37 | -------------------------------------------------------------------------------- /Source/BMWeexExtension/WXSDKInstance+BMExtend.m: -------------------------------------------------------------------------------- 1 | // 2 | // WXSDKInstance+BMExtend.m 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/3/29. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import "WXSDKInstance+BMExtend.h" 10 | #import 11 | #import "BMNotifactionCenter.h" 12 | #import "BMResourceManager.h" 13 | 14 | @implementation WXSDKInstance(BMExtend) 15 | 16 | 17 | - (void)bm_destroyInstance 18 | { 19 | //通知消息中心 移除对应实例 20 | [[BMNotifactionCenter defaultCenter] destroyObserver:self.instanceId]; 21 | 22 | [self bm_destroyInstance]; 23 | 24 | } 25 | 26 | 27 | - (void)bm__renderWithMainBundleString:(NSString *)mainBundleString 28 | { 29 | /** 注入本地公共的 base js */ 30 | NSString *baseScript = [BMResourceManager sharedInstance].bmWidgetJs; 31 | 32 | if (baseScript.length) { 33 | mainBundleString = [baseScript stringByAppendingString:mainBundleString]; 34 | } 35 | 36 | [self bm__renderWithMainBundleString:mainBundleString]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Source/BMModule/Modal/SVProgressHUD/SVRadialGradientLayer.m: -------------------------------------------------------------------------------- 1 | // 2 | // SVRadialGradientLayer.m 3 | // SVProgressHUD, https://github.com/SVProgressHUD/SVProgressHUD 4 | // 5 | // Copyright (c) 2014-2016 Tobias Tiemerding. All rights reserved. 6 | // 7 | 8 | #import "SVRadialGradientLayer.h" 9 | 10 | @implementation SVRadialGradientLayer 11 | 12 | - (void)drawInContext:(CGContextRef)context { 13 | size_t locationsCount = 2; 14 | CGFloat locations[2] = {0.0f, 1.0f}; 15 | CGFloat colors[8] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.75f}; 16 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 17 | CGGradientRef gradient = CGGradientCreateWithColorComponents(colorSpace, colors, locations, locationsCount); 18 | CGColorSpaceRelease(colorSpace); 19 | 20 | float radius = MIN(self.bounds.size.width , self.bounds.size.height); 21 | CGContextDrawRadialGradient (context, gradient, self.gradientCenter, 0, self.gradientCenter, radius, kCGGradientDrawsAfterEndLocation); 22 | CGGradientRelease(gradient); 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Source/BMExtension/UIWindow+Util.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIWindow+Util.m 3 | // Pods 4 | // 5 | // Created by XHY on 2017/7/12. 6 | // 7 | // 8 | 9 | #import "UIWindow+Util.h" 10 | 11 | @implementation UIWindow (Util) 12 | 13 | + (UIWindow *)findVisibleWindow { 14 | 15 | UIWindow *visibleWindow = nil; 16 | 17 | // if the rootViewController property (available >= iOS 4.0) of the main window is set, we present the modal view controller on top of the rootViewController 18 | NSArray *windows = [[UIApplication sharedApplication] windows]; 19 | for (UIWindow *window in windows) { 20 | if (!window.hidden && !visibleWindow) { 21 | visibleWindow = window; 22 | } 23 | if ([UIWindow instancesRespondToSelector:@selector(rootViewController)]) { 24 | if ([window rootViewController]) { 25 | visibleWindow = window; 26 | break; 27 | } 28 | } 29 | } 30 | 31 | return visibleWindow ?:[[UIApplication sharedApplication].delegate window]; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Source/BMDebug/Scanner/WXScannerHistoryVC.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | #ifdef DEBUG 20 | #import 21 | 22 | @interface WXScannerHistoryVC : UITableViewController 23 | 24 | @end 25 | #endif 26 | -------------------------------------------------------------------------------- /Source/BMController/WebView/BMNative.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMNative.m 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2018/7/2. 6 | // 7 | 8 | #import "BMNative.h" 9 | #import 10 | #import "BMMediatorManager.h" 11 | #import "BMNotifactionCenter.h" 12 | 13 | @protocol BMJSExport 14 | 15 | - (void)closePage; 16 | - (void)fireEvent:(NSString *)event :(id)info; 17 | 18 | @end 19 | 20 | @interface BMNative () 21 | 22 | @end 23 | 24 | @implementation BMNative 25 | 26 | - (void)dealloc 27 | { 28 | WXLogInfo(@"BMNative dealloc"); 29 | } 30 | 31 | - (void)closePage { 32 | dispatch_async(dispatch_get_main_queue(), ^{ 33 | [[BMMediatorManager shareInstance].currentViewController.navigationController popViewControllerAnimated:YES]; 34 | [[BMMediatorManager shareInstance].currentViewController dismissViewControllerAnimated:YES completion:nil]; 35 | }); 36 | } 37 | 38 | - (void)fireEvent:(NSString *)event :(id)info { 39 | [[BMNotifactionCenter defaultCenter] emit:event info:info]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Source/BMManager/Image/BMUploadImageUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMUploadImageUtils.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/2/10. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "BMUploadImageModel.h" 12 | 13 | @interface BMUploadImageUtils : NSObject 14 | 15 | /** 拍照后返回本地的图片地址 */ 16 | - (void)camera:(BMUploadImageModel *)info weexInstance:(WXSDKInstance *)weexInstance callback:(WXModuleCallback)callback; 17 | 18 | /** 从相册选择照片返回本地的地址 */ 19 | - (void)pick:(BMUploadImageModel *)info weexInstance:(WXSDKInstance *)weexInstance callback:(WXModuleCallback)callback; 20 | 21 | /** 拍照或者从相册选择图片后直接上传服务器后返回 url */ 22 | - (void)uploadImageWithInfo:(BMUploadImageModel *)info weexInstance:(WXSDKInstance *)weexInstance callback:(WXModuleCallback)callback; 23 | 24 | 25 | /** 26 | 上传图片 支持多张 27 | 28 | @param images 图片 29 | @param callback 回调 30 | */ 31 | - (void)uploadImage:(NSArray *)images uploadImageModel:(BMUploadImageModel *)info callback:(WXModuleCallback)callback; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Source/BMCustomUI/HYAlert/HYAlertModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // HYAlertModel.m 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/3/3. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import "HYAlertModel.h" 10 | 11 | @implementation HYAlertModel 12 | 13 | - (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic { 14 | 15 | NSString *titleAlign = dic[@"titleAlign"]; 16 | if ([titleAlign isEqualToString:@"right"]) { 17 | _titleAlign = NSTextAlignmentRight; 18 | } else if ([titleAlign isEqualToString:@"left"]) { 19 | _titleAlign = NSTextAlignmentLeft; 20 | } else { 21 | _titleAlign = NSTextAlignmentCenter; 22 | } 23 | 24 | NSString *messageAlign = dic[@"messageAlign"]; 25 | if ([messageAlign isEqualToString:@"right"]) { 26 | _messageAlign = NSTextAlignmentRight; 27 | } else if ([messageAlign isEqualToString:@"left"]) { 28 | _messageAlign = NSTextAlignmentLeft; 29 | } else { 30 | _messageAlign = NSTextAlignmentCenter; 31 | } 32 | 33 | return YES; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Source/BMDebug/Scanner/WXScannerVC.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | #ifdef DEBUG 20 | #import 21 | #import 22 | 23 | @interface WXScannerVC : UIViewController 24 | 25 | @end 26 | #endif 27 | -------------------------------------------------------------------------------- /Source/BMDevice/SFHFKeychainUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // SFHFKeychainUtils.h 3 | // 4 | // Created by Buzz Andersen on 10/20/08. 5 | // Based partly on code by Jonathan Wight, Jon Crosby, and Mike Malone. 6 | // Copyright 2008 Sci-Fi Hi-Fi. All rights reserved. 7 | // 8 | // UICKeyChainStore.h 9 | // UICKeyChainStore 10 | // 11 | // Created by Kishikawa Katsumi on 11/11/20. 12 | // Copyright (c) 2011 Kishikawa Katsumi. All rights reserved. 13 | // 14 | 15 | #import 16 | 17 | #import 18 | 19 | 20 | @interface SFHFKeychainUtils : NSObject { 21 | 22 | } 23 | 24 | + (NSString *) getPasswordForUsername: (NSString *) username 25 | andServiceName: (NSString *) serviceName 26 | error: (NSError **) error; 27 | 28 | 29 | + (BOOL) storeUsername: (NSString *) username 30 | andPassword: (NSString *) password 31 | forServiceName: (NSString *) serviceName 32 | updateExisting: (BOOL) updateExisting 33 | error: (NSError **) error; 34 | 35 | 36 | + (BOOL) deleteItemForUsername: (NSString *) username 37 | andServiceName: (NSString *) serviceName 38 | error: (NSError **) error; 39 | 40 | @end -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017-2018 https://github.com/xiaohuapunk/eros-plugin-ios-baseLibrary 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /Source/BMHandler/BMConfigCenterHandler.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMConfigCenterHandler.m 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2017/9/22. 6 | // 7 | 8 | #import "BMConfigCenterHandler.h" 9 | 10 | @implementation BMConfigCenterHandler 11 | 12 | - (id)configForKey:(NSString *)key defaultValue:(id)defaultValue isDefault:(BOOL *)isDefault 13 | { 14 | NSArray* keys = [key componentsSeparatedByString:@"."]; 15 | if ([keys[0] isEqualToString:@"iOS_weex_ext_config"] && [keys[1] isEqualToString:@"text_render_useCoreText"]){ 16 | return @YES; 17 | } 18 | if ([keys[0] isEqualToString:@"iOS_weex_ext_config"] && [keys[1] isEqualToString:@"slider_class_name"]){ 19 | return @"WXCycleSliderComponent"; 20 | } 21 | if ([keys[0] isEqualToString:@"weex_prerender_config"] && [keys[1] isEqualToString:@"is_switch_on"]){ 22 | return @YES; 23 | } 24 | if ([keys[0] isEqualToString:@"weex_prerender_config"] && [keys[1] isEqualToString:@"cacheTime"]){ 25 | return @300000; 26 | } 27 | if ([keys[0] isEqualToString:@"weex_prerender_config"] && [keys[1] isEqualToString:@"max_cache_num"]){ 28 | return @2; 29 | } 30 | return nil; 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Source/BMModule/Geolocation/BMGeolocationModule.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMGeolocationModule.m 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/19. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import "BMGeolocationModule.h" 10 | #import "JYTLocationManager.h" 11 | #import "NSDictionary+Util.h" 12 | 13 | @implementation BMGeolocationModule 14 | 15 | @synthesize weexInstance; 16 | 17 | WX_EXPORT_METHOD(@selector(getGeolocation:)) 18 | 19 | - (void)getGeolocation:(WXModuleCallback)callback 20 | { 21 | 22 | [[JYTLocationManager shareInstance] getCurrentLocation:^(NSString *lon, NSString *lat) { 23 | if (callback) { 24 | 25 | NSInteger resCode = BMResCodeError; 26 | NSDictionary *data = nil; 27 | if (lon && lat) { 28 | resCode = BMResCodeSuccess; 29 | data = @{@"locationLat": lat,@"locationLng": lon}; 30 | } 31 | 32 | /* 构建callback数据 */ 33 | NSDictionary *resultData = [NSDictionary configCallbackDataWithResCode:resCode msg:nil data:data]; 34 | 35 | callback(resultData); 36 | 37 | } 38 | }]; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Source/BMManager/Storage/BMStoreManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMStoreManager.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/2/7. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BMDefine.h" 11 | 12 | #define K_STORAGE_PATH [K_DOCUMENT_PATH stringByAppendingPathComponent:@"storage"] 13 | 14 | @interface BMStoreManager : NSObject 15 | 16 | /** 17 | 获取存储目录 18 | 19 | @param key key 20 | @return 存储目录 21 | */ 22 | + (NSString *)getDataPathWithKey:(NSString *)key; 23 | 24 | /** 25 | * 将对象归档 26 | * 27 | * @param obj 对象 注:必须是可归档对象 28 | * @param filePath 路径 29 | * 30 | * @return 是否成功 31 | */ 32 | + (BOOL)archiveObject:(id)obj toFilePath:(NSString *)filePath; 33 | 34 | /** 35 | * 解档 36 | * 37 | * @param filePath 路径 38 | * 39 | * @return 解档对象 40 | */ 41 | + (id)unarchiveObjectWithFilePath:(NSString *)filePath; 42 | 43 | /** 44 | * 判断文件是否存在 45 | * 46 | * @param filePath 路径 47 | * 48 | * @return bool 49 | */ 50 | + (BOOL)fileExistsAtPath:(NSString *)filePath; 51 | 52 | /** 53 | * 删除目录下的文件 54 | * 55 | * @param filePath 路径 56 | * 57 | * @return 是否删除成功 58 | */ 59 | + (BOOL)deleteFileAtPath:(NSString *)filePath; 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Source/BMDebug/Scanner/UIViewController+WXDemoNaviBar.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #ifdef DEBUG 21 | #import 22 | #import "DemoDefine.h" 23 | 24 | @interface UIViewController (WXDemoNaviBar) 25 | 26 | /** 27 | * back button click action 28 | * @param sender responder 29 | */ 30 | - (void)backButtonClicked:(id)sender; 31 | 32 | - (void)setupNaviBar; 33 | 34 | @end 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /Source/BMController/BaseVc/BMLaunchViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMLaunchViewController.m 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/2/20. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import "BMLaunchViewController.h" 10 | 11 | @interface BMLaunchViewController () 12 | 13 | @property (nonatomic, weak) IBOutlet NSLayoutConstraint *topSpace; 14 | 15 | @end 16 | 17 | @implementation BMLaunchViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view. 22 | 23 | if (isIphone4) { 24 | _topSpace.constant = 80.0; 25 | } else if (isIphone5) { 26 | _topSpace.constant = 110.0; 27 | } else { 28 | _topSpace.constant = 130.0; 29 | } 30 | 31 | } 32 | 33 | 34 | - (void)didReceiveMemoryWarning { 35 | [super didReceiveMemoryWarning]; 36 | // Dispose of any resources that can be recreated. 37 | } 38 | 39 | /* 40 | #pragma mark - Navigation 41 | 42 | // In a storyboard-based application, you will often want to do a little preparation before navigation 43 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 44 | // Get the new view controller using [segue destinationViewController]. 45 | // Pass the selected object to the new view controller. 46 | } 47 | */ 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Source/BMExtension/NSString+Util.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Util.h 3 | // JingYitong 4 | // 5 | // Created by XHY on 15/7/14. 6 | // Copyright (c) 2015年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface NSString (Util) 13 | 14 | /* 获取当前设备型号 */ 15 | + (NSString*)deviceModelName; 16 | 17 | - (NSString *)md5; 18 | 19 | /** 去除两端空格和回车 */ 20 | - (NSString *)trimming; 21 | 22 | /** 防止空字符串 */ 23 | - (NSString *)dNull; 24 | 25 | /** 是否是空字符串 */ 26 | - (BOOL)isNull; 27 | 28 | /** 是否联系人输入特殊字符 */ 29 | - (BOOL)isContainsSpecialCharacter; 30 | 31 | /** 是否是手机号 只判断是否是1开头的11位数字 */ 32 | - (BOOL)isMobileNumber; 33 | 34 | /** 判断是否包含中文*/ 35 | - (BOOL)isHasChinese; 36 | 37 | /** 38 | * 判断是否为数字 39 | * 40 | */ 41 | - (BOOL)isDigit; 42 | 43 | 44 | /** 45 | 扩展方法方便生成属性字符串 46 | 47 | @param attrs 样式 48 | @param subString 需要添加样式的string 49 | @return 属性字符串 50 | */ 51 | - (NSMutableAttributedString *)addAttributes:(NSDictionary *)attrs subString:(NSString *)subString; 52 | 53 | /* 判断是否包含子字符串 */ 54 | - (BOOL)isContainsSubString:(NSString *)subString; 55 | 56 | 57 | /* 解析URL时 将a=a&b=b 等字符串转换为字典 */ 58 | - (NSDictionary*)dictionaryFromQuery; 59 | 60 | -(NSString*)encodeString; 61 | 62 | -(NSString *)decodeString; 63 | 64 | + (NSString*)getStatusText:(NSInteger)code; 65 | @end 66 | -------------------------------------------------------------------------------- /Source/BMModule/WebView/WXWebViewModule+Private.m: -------------------------------------------------------------------------------- 1 | // 2 | // WXWebViewModule+Private.m 3 | // Pods 4 | // 5 | // Created by 窦静轩 on 2017/5/3. 6 | // 7 | // 8 | 9 | #import "WXWebViewModule+Private.h" 10 | #import 11 | 12 | const char * webViewKey = "webview"; 13 | 14 | 15 | @implementation WXWebViewModule(BMExtend) 16 | 17 | WX_EXPORT_METHOD(@selector(evaluateScriptEleRef:jsCode:callback:)) 18 | 19 | -(void)evaluateScriptEleRef:(NSString*)elemRef jsCode:(NSString*)jsCode callback:(WXModuleCallback)callback 20 | { 21 | [self performBlockWithWebView:elemRef block:^void (WXWebComponent *webCoponent) { 22 | 23 | objc_property_t webViewProperty = class_getProperty([WXWebComponent class], webViewKey); 24 | 25 | NSString *webViewPName = [[NSString alloc] initWithCString:property_getName(webViewProperty) encoding:NSUTF8StringEncoding]; 26 | 27 | id webViewValue = [webCoponent valueForKey:webViewPName]; 28 | if ([webViewValue isKindOfClass:[UIWebView class]]) { 29 | NSString * callbackString = [(UIWebView*)webViewValue stringByEvaluatingJavaScriptFromString:jsCode]; 30 | if (callbackString) { 31 | if (callback) { 32 | callback(callbackString); 33 | } 34 | } 35 | } 36 | 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Source/BMWeexExtension/WXListComponent+BMExtend.m: -------------------------------------------------------------------------------- 1 | // 2 | // WXListComponent+BMExtend.m 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/3/21. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import "WXListComponent+BMExtend.h" 10 | 11 | @implementation WXListComponent (BMExtend) 12 | 13 | //- (instancetype)bmList_initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance 14 | //{ 15 | // if (attributes[@"bounce"]) { 16 | // objc_setAssociatedObject(self, "bm_bounce", [NSNumber numberWithBool:[WXConvert BOOL:attributes[@"bounce"]]], OBJC_ASSOCIATION_RETAIN_NONATOMIC); 17 | // } 18 | // 19 | // return [self bmList_initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance]; 20 | //} 21 | // 22 | //- (void)bmList_scrollViewDidScroll:(UIScrollView *)scrollView 23 | //{ 24 | // NSNumber *bounce = objc_getAssociatedObject(self, "bm_bounce"); 25 | // if (bounce) { 26 | // CGPoint pt = scrollView.contentOffset; 27 | // if (pt.y <=0 ) { 28 | // pt.y = 0; 29 | // scrollView.contentOffset = pt; 30 | // return; 31 | // } 32 | // } 33 | // 34 | // [self bmList_scrollViewDidScroll:scrollView]; 35 | //} 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Source/BMDebug/Scanner/WXDemoViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #ifdef DEBUG 21 | #import 22 | #import 23 | 24 | @interface WXDemoViewController : UIViewController 25 | 26 | @property (nonatomic, strong) NSString *script; 27 | @property (nonatomic, strong) NSURL *url; 28 | @property (nonatomic, assign) BOOL showNavigationBar; 29 | @property (nonatomic, strong) SRWebSocket *hotReloadSocket; 30 | @property (nonatomic, strong) NSString *source; 31 | 32 | @end 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /Source/BMManager/Storage/BMStoreManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMStoreManager.m 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/2/7. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import "BMStoreManager.h" 10 | 11 | @implementation BMStoreManager 12 | 13 | + (NSString *)getDataPathWithKey:(NSString *)key 14 | { 15 | NSFileManager *fm = [NSFileManager defaultManager]; 16 | if (![fm fileExistsAtPath:K_STORAGE_PATH]) { 17 | [fm createDirectoryAtPath:K_STORAGE_PATH withIntermediateDirectories:YES attributes:nil error:nil]; 18 | } 19 | 20 | return [K_STORAGE_PATH stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.data",key]]; 21 | } 22 | 23 | + (BOOL)archiveObject:(id)obj toFilePath:(NSString *)filePath 24 | { 25 | return [NSKeyedArchiver archiveRootObject:obj toFile:filePath]; 26 | } 27 | 28 | + (id)unarchiveObjectWithFilePath:(NSString *)filePath 29 | { 30 | return [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; 31 | } 32 | 33 | + (BOOL)fileExistsAtPath:(NSString *)filePath 34 | { 35 | NSFileManager *fm = [NSFileManager defaultManager]; 36 | return [fm fileExistsAtPath:filePath]; 37 | } 38 | 39 | + (BOOL)deleteFileAtPath:(NSString *)filePath 40 | { 41 | NSFileManager *fm = [NSFileManager defaultManager]; 42 | return [fm removeItemAtPath:filePath 43 | error:NULL]; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Source/BMModule/Events/BMEventsModule.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMEvents.m 3 | // BM-JYT 4 | // 5 | // Created by 窦静轩 on 2017/3/28. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import "BMEventsModule.h" 10 | #import "BMNotifactionCenter.h" 11 | 12 | 13 | const static NSString * eventParamsKey = @"eventParams"; 14 | 15 | @implementation BMEventsModule 16 | 17 | @synthesize weexInstance; 18 | 19 | WX_EXPORT_METHOD(@selector(on:callback:)) 20 | WX_EXPORT_METHOD(@selector(once:callback:)) 21 | WX_EXPORT_METHOD(@selector(off:callback:)) 22 | WX_EXPORT_METHOD(@selector(emit:info:)) 23 | WX_EXPORT_METHOD(@selector(offall)) 24 | 25 | -(void)on:(NSString*)event callback:(WXModuleKeepAliveCallback)callback 26 | { 27 | [[BMNotifactionCenter defaultCenter] on:event callback:callback instance:weexInstance]; 28 | } 29 | 30 | -(void)once:(NSString*)event callback:(WXModuleKeepAliveCallback)callback 31 | { 32 | [[BMNotifactionCenter defaultCenter] once:event callback:callback instance:weexInstance]; 33 | } 34 | 35 | 36 | -(void)off:(NSString*)event callback:(WXModuleCallback)callback 37 | { 38 | [[BMNotifactionCenter defaultCenter] off:event callback:nil]; 39 | } 40 | 41 | -(void)offall 42 | { 43 | [[BMNotifactionCenter defaultCenter] offAll]; 44 | } 45 | 46 | -(void)emit:(NSString*)event info:(id)info 47 | { 48 | [[BMNotifactionCenter defaultCenter] emit:event info:info]; 49 | } 50 | @end 51 | -------------------------------------------------------------------------------- /Source/BMComponent/Pop/BMPopupComponent.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMPopupComponent.m 3 | // Pods 4 | // 5 | // Created by XHY on 2017/4/26. 6 | // 7 | // 8 | 9 | #import "BMPopupComponent.h" 10 | #import "BMMaskComponent.h" 11 | #import "Masonry.h" 12 | 13 | @interface BMPopupComponent () 14 | 15 | @property (nonatomic) CGFloat rowHeight; 16 | @property (nonatomic) BOOL needUpdateFrame; /**< 兼容一些弹窗问题 */ 17 | 18 | @end 19 | 20 | @implementation BMPopupComponent 21 | 22 | - (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance 23 | { 24 | 25 | if (self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance]) { 26 | if (attributes[@"updatePosition"]) { 27 | _needUpdateFrame = [WXConvert BOOL:attributes[@"updatePosition"]]; 28 | } 29 | } 30 | return self; 31 | } 32 | 33 | - (UIView *)loadView 34 | { 35 | return [[UIView alloc] init]; 36 | } 37 | 38 | - (void)viewDidLoad 39 | { 40 | [super viewDidLoad]; 41 | } 42 | 43 | - (void)layoutDidFinish 44 | { 45 | [super layoutDidFinish]; 46 | 47 | if (_needUpdateFrame && [self.supercomponent isKindOfClass:[BMMaskComponent class]]) { 48 | [(BMMaskComponent *)self.supercomponent getPopViewRectNeedUpdateFrame:YES]; 49 | } 50 | 51 | } 52 | 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Source/BMExtension/UIImage+Util.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Util.h 3 | // JingYitong 4 | // 5 | // Created by XHY on 15/7/14. 6 | // Copyright (c) 2015年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (Util) 12 | 13 | + (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size; 14 | + (UIImage *)imageWithColor:(UIColor *)color triangleSize:(CGSize)size; 15 | 16 | + (UIImage *)imageAutoNamed:(NSString *)imageName; 17 | + (UIImage *)mergerImage1:(UIImage *)image1 image2:(UIImage *)image2 toSize:(CGSize)toSize; 18 | 19 | - (UIImage *)toGrayImage; 20 | 21 | /* size.width */ 22 | - (CGFloat)width; 23 | /* size.height */ 24 | - (CGFloat)height; 25 | 26 | - (UIImage *)imageTo4b3; 27 | - (UIImage *)imageTo4b3AtSize:(CGSize)size; 28 | - (UIImage *)imageAtRect:(CGRect)rect; 29 | - (UIImage *)imageToScale:(float)scale; 30 | - (UIImage *)imageToSize:(CGSize)size; 31 | 32 | - (UIImage *)addImage:(UIImage *)image point:(CGPoint)point; 33 | 34 | - (UIImage *)imageRotatedByRadians:(CGFloat)radians; 35 | - (UIImage *)imageRotatedByDegrees:(CGFloat)degrees; 36 | 37 | /** 38 | * 按比例缩放到最小尺寸 39 | * 40 | * @param targetSize 目标尺寸 41 | * 42 | * @return 切后图片 43 | */ 44 | - (UIImage *)imageByScalingProportionallyToMinimumSize:(CGSize)targetSize; 45 | 46 | /** 将UIView 转换为 UIImage */ 47 | + (UIImage *)converViewToImage:(UIView *)theView; 48 | 49 | + (UIImage *)imageWithWatermark:(NSString *)watermark size:(CGSize)size; 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Source/BMCustomUI/HYAlert/HYAlertView.h: -------------------------------------------------------------------------------- 1 | // 2 | // HYAlertView.h 3 | // JingYitong 4 | // 5 | // Created by XHY on 16/6/21. 6 | // Copyright © 2016年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void(^HYAlertViewClickedButtonAtIndexBlock)(NSInteger index); 12 | 13 | @interface HYAlertView : UIControl 14 | 15 | @property (nonatomic, assign) NSTextAlignment titleTextAlignment; 16 | @property (nonatomic, assign) NSTextAlignment messageTextAlignment; 17 | @property (nonatomic, copy) HYAlertViewClickedButtonAtIndexBlock clickedButtonAtIndexBlock; 18 | 19 | + (instancetype)shareInstance; 20 | 21 | - (void)configWithTitle:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelTitle otherButtonTitle:(NSString *)otherTitle; 22 | 23 | - (void)configWithTitle:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelTitle otherButtonTitle:(NSString *)otherTitle clickedButtonAtIndexBlock:(HYAlertViewClickedButtonAtIndexBlock)block; 24 | 25 | + (HYAlertView *)configWithTitle:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelTitle otherButtonTitle:(NSString *)otherTitle clickedButtonAtIndexBlock:(HYAlertViewClickedButtonAtIndexBlock)block; 26 | 27 | //- (instancetype)initWithTitle:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelTitle otherButtonTitle:(NSString *)otherTitle; 28 | 29 | - (void)show; 30 | - (void)dismiss; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Source/BMNetwork/JsResourceRequest/BMCheckJsVersionRequest.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMCheckJsVersionRequest.m 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/10. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import "BMCheckJsVersionRequest.h" 10 | #import "BMConfigManager.h" 11 | 12 | @interface BMCheckJsVersionRequest() 13 | 14 | @property (nonatomic,readwrite)NSString * appName; 15 | 16 | @property (nonatomic,readwrite)NSString * appVersion; 17 | 18 | @property (nonatomic,readwrite)NSString * jsVersion; 19 | 20 | @property (nonatomic,readwrite)BOOL isDiff; 21 | @end 22 | 23 | 24 | 25 | @implementation BMCheckJsVersionRequest 26 | 27 | - (instancetype)initWithAppName:(NSString *)appName appVersion:(NSString *)appVersion jsVersion:(NSString *)jsVersion isDiff:(BOOL)isDiff 28 | { 29 | if (self = [super init]) { 30 | _appName = appName; 31 | _appVersion = appVersion; 32 | _jsVersion = jsVersion; 33 | _isDiff= isDiff; 34 | } 35 | return self; 36 | } 37 | 38 | - (NSString *)requestURLPath 39 | { 40 | return [self requestUrl]; 41 | } 42 | 43 | - (NSString *)requestUrl 44 | { 45 | return [BMConfigManager shareInstance].platform.url.bundleUpdate; 46 | } 47 | 48 | - (id)requestArgument 49 | { 50 | return @{ 51 | @"appName": _appName, 52 | @"iOS": _appVersion, 53 | @"jsVersion": _jsVersion, 54 | @"isDiff": [NSNumber numberWithBool:_isDiff] 55 | }; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Source/BMModule/BrowserImg/PhotoBrowser/UIView+PBSnapshot.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+PBSnapshot.h 3 | // PhotoBrowser 4 | // 5 | // Created by Moch Xiao on 5/15/16. 6 | // Copyright © 2016 Moch Xiao (http://mochxiao.com). 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | @interface UIView (PBSnapshot) 30 | - (UIImage *)pb_snapshot; 31 | - (UIImage *)pb_snapshotAfterScreenUpdates:(BOOL)afterUpdates; 32 | @end 33 | -------------------------------------------------------------------------------- /Source/BMExtension/UIFont+Util.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIFont+Util.m 3 | // Pods 4 | // 5 | // Created by XHY on 2017/5/17. 6 | // 7 | // 8 | 9 | #import "UIFont+Util.h" 10 | 11 | @implementation UIFont (Util) 12 | 13 | + (instancetype)scaleSizeWithSize:(CGFloat)size 14 | { 15 | NSString *currentFontSize = [[NSUserDefaults standardUserDefaults] valueForKey:K_FONT_SIZE_KEY]; 16 | 17 | if ([currentFontSize isEqualToString:K_FONT_SIZE_BIG]) { 18 | size = size * K_FontSizeBig_Scale; 19 | } else if ([currentFontSize isEqualToString:k_FONT_SIZE_EXTRALARGE]) { 20 | size = size * K_FontSizeExtralarge_Scale; 21 | } 22 | 23 | return [UIFont systemFontOfSize:size]; 24 | } 25 | 26 | + (UIFont *)currentTitleFont 27 | { 28 | NSString *fontSize = [[NSUserDefaults standardUserDefaults] objectForKey:K_FONT_SIZE_KEY]; 29 | // 标准字体 30 | if ([fontSize isEqualToString:K_FONT_SIZE_BIG]) 31 | { 32 | return K_FONT_18; 33 | } 34 | else if ([fontSize isEqualToString:k_FONT_SIZE_EXTRALARGE]) 35 | { 36 | return K_FONT_21; 37 | } 38 | 39 | return K_FONT_15; 40 | } 41 | 42 | + (UIFont *)currentContentFont 43 | { 44 | NSString *fontSize = [[NSUserDefaults standardUserDefaults] objectForKey:K_FONT_SIZE_KEY]; 45 | // 标准字体 46 | if ([fontSize isEqualToString:K_FONT_SIZE_BIG]) 47 | { 48 | return K_FONT_14; 49 | } 50 | else if ([fontSize isEqualToString:k_FONT_SIZE_EXTRALARGE]) 51 | { 52 | return K_FONT_17; 53 | } 54 | return K_FONT_12; 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /Source/BMModule/BrowserImg/PhotoBrowser/PBImageScrollView.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBImageScrollView.h 3 | // PhotoBrowser 4 | // 5 | // Created by Moch Xiao on 5/12/16. 6 | // Copyright © 2016 Moch Xiao (http://mochxiao.com). 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | @interface PBImageScrollView : UIScrollView 30 | 31 | @property (nonatomic, strong, readonly) UIImageView *imageView; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Source/BMComponent/Chart/Resources/bm-chart.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | ECharts 11 | 12 | 13 | 14 | 15 |
16 | 17 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Source/BMDevice/BMDeviceManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMDeviceManager.m 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/13. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import "BMDeviceManager.h" 10 | #import "SFHFKeychainUtils.h" 11 | #import "NSString+Util.h" 12 | 13 | NSString const * kDeviceModelServiceName = @"bitautoDevice"; 14 | NSString const * kDeviceIdKey = @"deviceId"; 15 | 16 | @implementation BMDeviceManager 17 | 18 | + (NSString*)deviceID{ 19 | 20 | // 从keychain中读取id 21 | NSString *deviceIdStr = [SFHFKeychainUtils getPasswordForUsername:(NSString*)kDeviceIdKey 22 | andServiceName:(NSString*)kDeviceModelServiceName 23 | error:nil]; 24 | if (!deviceIdStr.length) { 25 | 26 | if ( [UIDevice currentDevice].systemVersion.floatValue < 7.0) { 27 | // deviceIdStr = [[self macaddress] md5_origin]; 28 | deviceIdStr = @""; 29 | }else{ 30 | deviceIdStr = [[[[UIDevice currentDevice] identifierForVendor] UUIDString] md5]; 31 | } 32 | 33 | // 将id保存到keychain中 34 | [SFHFKeychainUtils storeUsername:(NSString*)kDeviceIdKey 35 | andPassword:deviceIdStr 36 | forServiceName:(NSString*)kDeviceModelServiceName 37 | updateExisting:YES 38 | error:nil]; 39 | } 40 | 41 | 42 | return deviceIdStr; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Source/BMTransition/BMInteractiveTransition.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMInteractiveTransition.h 3 | // Pods 4 | // 5 | // Created by XHY on 2017/5/23. 6 | // 7 | // 8 | 9 | #import 10 | 11 | typedef void(^BMGestureConfig)(); 12 | 13 | /* 手势方向 */ 14 | typedef NS_ENUM(NSUInteger, BMInteractiveTransitionGestureDirection) { 15 | BMInteractiveTransitionGestureDirectionLeft = 0, 16 | BMInteractiveTransitionGestureDirectionRight, 17 | BMInteractiveTransitionGestureDirectionUp, 18 | BMInteractiveTransitionGestureDirectionDown 19 | }; 20 | 21 | /* 手势控制哪种转场 */ 22 | typedef NS_ENUM(NSUInteger, BMInteractiveTransitionType) { 23 | BMInteractiveTransitionTypePresent = 0, 24 | BMInteractiveTransitionTypeDismiss, 25 | BMInteractiveTransitionTypePush, 26 | BMInteractiveTransitionTypePop, 27 | }; 28 | 29 | @interface BMInteractiveTransition : UIPercentDrivenInteractiveTransition 30 | 31 | @property (nonatomic, assign) BOOL interation; 32 | @property (nonatomic, copy) BMGestureConfig presentConfig; 33 | @property (nonatomic, copy) BMGestureConfig pushConfig; 34 | 35 | /** 初始化方法 */ 36 | + (instancetype)interactiveTransitionWithTransitionType:(BMInteractiveTransitionType)type GestureDirection:(BMInteractiveTransitionGestureDirection)direction; 37 | - (instancetype)initWithTransitionType:(BMInteractiveTransitionType)type GestureDirection:(BMInteractiveTransitionGestureDirection)direction; 38 | 39 | /** 给传入的控制器添加手势 */ 40 | - (void)addPanGestureForViewController:(UIViewController *)viewController; 41 | 42 | - (void)addPanGestureForView:(UIView *)view handleViewController:(UIViewController *)viewController; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Source/BMNetwork/UploadImage/BMUploadImageRequest.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMUploadImageRequest.m 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/2/10. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import "BMUploadImageRequest.h" 10 | #import "AFURLRequestSerialization.h" 11 | 12 | @interface BMUploadImageRequest () 13 | 14 | @property (nonatomic, strong) BMUploadImageModel *imageModel; 15 | 16 | @end 17 | 18 | @implementation BMUploadImageRequest 19 | 20 | - (instancetype)initWithImage:(UIImage *)image uploadImageModel:(BMUploadImageModel *)imageModel 21 | { 22 | if (self = [super init]) { 23 | _image = image; 24 | _imageModel = imageModel; 25 | } 26 | return self; 27 | } 28 | 29 | - (YTKRequestMethod)requestMethod 30 | { 31 | return YTKRequestMethodPOST; 32 | } 33 | 34 | - (NSString *)baseUrl 35 | { 36 | return nil; 37 | } 38 | 39 | /** 添加自定义 Headers */ 40 | - (NSDictionary *)requestHeaderFieldValueDictionary 41 | { 42 | if (self.imageModel.header) { 43 | return self.imageModel.header; 44 | } 45 | return nil; 46 | } 47 | 48 | - (NSString *)requestUrl 49 | { 50 | return self.imageModel.url ?: TK_PlatformInfo().url.image; 51 | } 52 | 53 | - (AFConstructingBlock)constructingBodyBlock { 54 | return ^(id formData) { 55 | NSData *data = UIImageJPEGRepresentation(_image, 0.8); 56 | NSString *name = @"picture.jpg"; 57 | NSString *formKey = @"file"; 58 | NSString *type = @"image/jpeg"; 59 | [formData appendPartWithFileData:data name:formKey fileName:name mimeType:type]; 60 | }; 61 | } 62 | 63 | - (id)requestArgument 64 | { 65 | return self.imageModel.params; 66 | } 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /Source/BMComponent/Calendar/Views/RangePickerCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // RangePickerCell.m 3 | // FSCalendar 4 | // 5 | // Created by dingwenchao on 02/11/2016. 6 | // Copyright © 2016 Wenchao Ding. All rights reserved. 7 | // 8 | 9 | #import "RangePickerCell.h" 10 | #import "FSCalendarExtensions.h" 11 | 12 | @implementation RangePickerCell 13 | 14 | - (instancetype)initWithFrame:(CGRect)frame 15 | { 16 | self = [super initWithFrame:frame]; 17 | if (self) { 18 | 19 | CALayer *selectionLayer = [[CALayer alloc] init]; 20 | selectionLayer.backgroundColor = UIColorFromValue(0x07ae9c).CGColor; 21 | selectionLayer.actions = @{@"hidden":[NSNull null]}; // Remove hiding animation 22 | [self.contentView.layer insertSublayer:selectionLayer below:self.titleLabel.layer]; 23 | self.selectionLayer = selectionLayer; 24 | 25 | CALayer *middleLayer = [[CALayer alloc] init]; 26 | middleLayer.backgroundColor = [UIColorFromValue(0x07ae9c) colorWithAlphaComponent:0.3].CGColor; 27 | middleLayer.actions = @{@"hidden":[NSNull null]}; // Remove hiding animation 28 | [self.contentView.layer insertSublayer:middleLayer below:self.titleLabel.layer]; 29 | self.middleLayer = middleLayer; 30 | 31 | // Hide the default selection layer 32 | self.shapeLayer.hidden = YES; 33 | 34 | } 35 | return self; 36 | } 37 | 38 | - (void)layoutSubviews 39 | { 40 | [super layoutSubviews]; 41 | self.titleLabel.frame = self.contentView.bounds; 42 | } 43 | 44 | - (void)layoutSublayersOfLayer:(CALayer *)layer 45 | { 46 | [super layoutSublayersOfLayer:layer]; 47 | self.selectionLayer.frame = self.contentView.bounds; 48 | self.middleLayer.frame = self.contentView.bounds; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Source/BMCustomUI/TabBarBadge/UITabBar+Badge.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITabBar+Badge.m 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2018/5/29. 6 | // 7 | 8 | #import "UITabBar+Badge.h" 9 | 10 | #define K_BadgeViewTag 1200 11 | 12 | @implementation UITabBar (Badge) 13 | 14 | - (void)showBadgeOnItenIndex:(int)index value:(NSString *)value backgroundColor:(UIColor *)bgColor textColor:(UIColor *)textColor 15 | { 16 | [self hideBadgeOnItenIndex:index]; 17 | 18 | UIView *badgeView = [[UIView alloc] init]; 19 | badgeView.userInteractionEnabled = YES; 20 | badgeView.tag = K_BadgeViewTag + index; 21 | badgeView.backgroundColor = bgColor ?: [UIColor redColor]; 22 | 23 | float width = 8; 24 | if (value) { 25 | width = 15; 26 | UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, width, width)]; 27 | label.textAlignment = NSTextAlignmentCenter; 28 | label.textColor = textColor ?: [UIColor whiteColor]; 29 | label.font = [UIFont systemFontOfSize:10]; 30 | label.text = [NSString stringWithFormat:@"%@",value]; 31 | label.userInteractionEnabled = YES; 32 | [badgeView addSubview:label]; 33 | } 34 | 35 | float percentX = (index + 0.55) / self.items.count; 36 | CGFloat x = ceilf(percentX * self.frame.size.width); 37 | CGFloat y = ceilf(0.1 * self.frame.size.height); 38 | badgeView.frame = CGRectMake(x, y, width, width); 39 | badgeView.layer.cornerRadius = width / 2.0; 40 | [self addSubview:badgeView]; 41 | [self bringSubviewToFront:badgeView]; 42 | } 43 | 44 | - (void)hideBadgeOnItenIndex:(int)index 45 | { 46 | for (UIView *subView in self.subviews) { 47 | if (subView.tag == K_BadgeViewTag + index) { 48 | [subView removeFromSuperview]; 49 | } 50 | } 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Source/BMManager/GlobalEvent/BMGlobalEventManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMGlobalEventManager.h 3 | // BM-JYT 4 | // 5 | // Created by XHY on 2017/3/3. 6 | // Copyright © 2017年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | /** 13 | 通知js当前页面的状态 14 | 15 | - BMControllerStateOpen: 首次打开 16 | - BMControllerStateBack: 从其他页面返回 17 | - BMControllerStateRefresh: 页面重新加载(refreshWeex) 18 | */ 19 | typedef NS_OPTIONS(NSUInteger, BMControllerState) { 20 | BMControllerStateOpen = 0, 21 | BMControllerStateBack, 22 | BMControllerStateRefresh 23 | }; 24 | 25 | /* 页面生命周期相关事件 */ 26 | #define BMControllerStateArray @[@"open",@"back",@"refresh"] 27 | static NSString * const BMViewWillAppear = @"viewWillAppear"; 28 | static NSString * const BMViewDidAppear = @"viewDidAppear"; 29 | static NSString * const BMViewWillDisappear = @"viewWillDisappear"; 30 | static NSString * const BMViewDidDisappear = @"viewDidDisappear"; 31 | 32 | /* 截屏意见反馈事件 */ 33 | static NSString * const BMScreenshotFeedbackEvent = @"screenshotFeedback"; 34 | 35 | /** weex 首屏渲染完毕通知 */ 36 | static NSString * const BMFirstScreenDidFinish = @"BMFirstScreenDidFinish"; 37 | 38 | @interface BMGlobalEventManager : NSObject 39 | 40 | 41 | /** 42 | 发送全局时间 43 | 44 | @param event 时间名称 45 | @param params 参数 46 | */ 47 | + (void)sendGlobalEvent:(NSString *)event params:(NSDictionary *)params; 48 | 49 | /** 50 | 发送页面生命周期事件 51 | 52 | @param instance WXSDKInstance实例 53 | @param event 事件名称(对应js方法名) 54 | @param state 页面状态 55 | */ 56 | + (void)sendViewLifeCycleEventWithInstance:(WXSDKInstance *)instance event:(NSString *)event controllerState:(BMControllerState)state; 57 | 58 | /* 收到推送通知后发送事件给js */ 59 | + (void)pushMessage:(NSDictionary *)info appLaunchedByNotification:(BOOL)isLaunchedByNotification; 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Source/BMManager/Mediator/BMMediatorManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMMediatorManager.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/2/3. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | #import 13 | #import "BMRouterModel.h" 14 | 15 | @class BMWebViewRouterModel; 16 | 17 | @interface BMMediatorManager : NSObject 18 | 19 | + (instancetype)shareInstance; 20 | 21 | @property (nonatomic, assign) BOOL isLogin; // 是否已经登录 22 | 23 | @property (nonatomic, weak) WXSDKInstance *currentWXInstance; // 当前栈顶的WXSDKInstance 24 | @property (nonatomic, weak) UIViewController *currentViewController; // 当前栈顶的ViewController 25 | @property (nonatomic, weak) UITabBarController *baseTabBarController; 26 | 27 | /* app启动后加载页面 */ 28 | - (UIViewController *)loadHomeViewController; 29 | 30 | /** 31 | 打开新的控制器方法 32 | 33 | @param routerModel 跳转页面所需参数信息等 34 | @param weexInstance 当前weexInstance实例 35 | */ 36 | - (void)openViewControllerWithRouterModel:(BMRouterModel *)routerModel weexInstance:(WXSDKInstance *)weexInstance; 37 | 38 | /** 39 | 回退页面方法 40 | 41 | @param routerModel 回退页面信息 42 | @param weexInstance weexInstance 43 | */ 44 | - (void)backVcWithRouterModel:(BMRouterModel *)routerModel weexInstance:(WXSDKInstance *)weexInstance; 45 | 46 | /* 返回首页 */ 47 | - (void)backToHomeIndex:(NSUInteger)index; 48 | 49 | /* 打开webview页面 */ 50 | - (void)toWebViewWithRouterInfo:(BMWebViewRouterModel *)routerInfo; 51 | 52 | /* 当业务流程中弹出登录页面,但是用户没有登录点击返回,调用此方法清除之前缓存的router信息 */ 53 | - (void)clearRouterInfo; 54 | 55 | /** js资源更新完毕提示 */ 56 | - (void)showJsResourceUpdatedAlert; 57 | 58 | /** 59 | 加载一个常驻内存的WeexInstance作为js端的中介者 60 | 61 | @param reload 是否重新加载 当reload为 ture 时,强制重新加载一个新的 62 | */ 63 | - (void)loadJSMediator:(BOOL)reload; 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /Source/BMModule/BrowserImg/PhotoBrowser/PhotoBrowser.h: -------------------------------------------------------------------------------- 1 | // 2 | // PhotoBrowser.h 3 | // PhotoBrowser 4 | // 5 | // Created by Moch Xiao on 8/24/15. 6 | // Copyright (c) 2015 Moch Xiao (https://github.com/cuzv). 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | //! Project version number for PhotoBrowser. 30 | FOUNDATION_EXPORT double PhotoBrowserVersionNumber; 31 | 32 | //! Project version string for PhotoBrowser. 33 | FOUNDATION_EXPORT const unsigned char PhotoBrowserVersionString[]; 34 | 35 | // In this header, you should import all the public headers of your framework using statements like #import 36 | 37 | #import 38 | 39 | -------------------------------------------------------------------------------- /Source/BMModule/Router/BMRouterModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMRouterModel.h 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/16. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | #define K_ANIMATE_PRESENT @"PRESENT" 14 | #define K_ANIMATE_PUSH @"PUSH" 15 | #define K_ANIMATE_TRANSLATION @"TRANSLATION" 16 | 17 | @interface BMRouterModel : NSObject 18 | 19 | @property (nonatomic, copy) NSString *url; /**< 下一个页面路径 */ 20 | @property (nonatomic, copy) NSString *type; /**< 页面出现方式:push , present */ 21 | @property (nonatomic, strong) NSDictionary *params; /**< 需要传到下一个页面的数据 */ 22 | @property (nonatomic, assign) BOOL canBack; /**< 是否禁止返回 true 禁止 手势返回 和 按钮返回都会屏蔽 */ 23 | @property (nonatomic, assign) BOOL gesBack; /**< 是否开启手势返回 默认开启 */ 24 | @property (nonatomic, assign) NSInteger vLength; /**< 页面返回多少级 */ 25 | @property (nonatomic, assign) BOOL isRunBackCallback; /**< 点击返回按钮时是否响应 backCallback 回调方法 👇 */ 26 | @property (nonatomic, copy) WXModuleCallback backCallback; /**< 点击返回时的回调方法 */ 27 | @property (nonatomic, assign) BOOL navShow; /**< 是否显示导航栏 */ 28 | @property (nonatomic, copy) NSString *navTitle; /**< 导航栏title */ 29 | @property (nonatomic, copy) NSString *statusBarStyle; /**< Default:黑色 LightContent:白色 */ 30 | @property (nonatomic, copy) NSString *backgroundColor; /**< 原生页面背景颜色 */ 31 | @property (nonatomic, assign) BOOL isNeedRootVC; /**< 是否需要在 RootViewController 上进行 present */ 32 | 33 | @property (nonatomic,copy) NSString * pageName; /**< 页面名 可以用作Router 更易读 */ 34 | @property (nonatomic, assign) BOOL isTabBarItem; /**< 是否是TabBar中的页面 */ 35 | @end 36 | -------------------------------------------------------------------------------- /Source/BMModule/Camera/BMCameraModule.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMCameraModule.m 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/2/4. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import "BMCameraModule.h" 10 | 11 | #import "BMScanQRViewController.h" 12 | 13 | #import "BMImageManager.h" 14 | #import 15 | 16 | #import "BMUploadImageModel.h" 17 | #import 18 | 19 | #import 20 | 21 | 22 | @implementation BMCameraModule 23 | 24 | @synthesize weexInstance; 25 | 26 | WX_EXPORT_METHOD(@selector(scan:)) 27 | WX_EXPORT_METHOD(@selector(uploadImage:callback:)) 28 | WX_EXPORT_METHOD(@selector(uploadScreenshot:)) 29 | 30 | 31 | - (void)scan:(WXModuleCallback)callback 32 | { 33 | BMScanQRViewController *scanQrVc = [[BMScanQRViewController alloc] init]; 34 | scanQrVc.hidesBottomBarWhenPushed = YES; 35 | scanQrVc.callback = callback; 36 | [weexInstance.viewController.navigationController pushViewController:scanQrVc animated:YES]; 37 | } 38 | 39 | - (void)uploadImage:(NSDictionary *)info callback:(WXModuleCallback)callback 40 | { 41 | BMUploadImageModel *model = [BMUploadImageModel yy_modelWithJSON:info]; 42 | [BMImageManager uploadImageWithInfo:model weexInstance:weexInstance callback:callback]; 43 | } 44 | 45 | - (void)uploadScreenshot:(WXModuleCallback)callback 46 | { 47 | if (![[BMScreenshotEventManager shareInstance] snapshotImage]) { 48 | NSDictionary *resDic = [NSDictionary configCallbackDataWithResCode:BMResCodeError msg:@"截屏图片不存在" data:nil]; 49 | if (callback) { 50 | callback(resDic); 51 | } 52 | return; 53 | } 54 | NSArray *images = @[[[BMScreenshotEventManager shareInstance] snapshotImage]]; 55 | [BMImageManager uploadImage:images uploadImageModel:nil callback:callback]; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Source/BMManager/Handler/BMHandlerFactory.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMHandlerFactory.m 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2018/6/28. 6 | // 7 | 8 | #import "BMHandlerFactory.h" 9 | 10 | @interface BMHandlerFactory () 11 | 12 | @property (nonatomic, strong) NSMutableDictionary *handlerMap; 13 | @property (nonatomic, strong) NSLock *handlerLock; 14 | 15 | @end 16 | 17 | @implementation BMHandlerFactory 18 | 19 | #pragma mark - Private Func 20 | + (instancetype)shareInstance 21 | { 22 | static BMHandlerFactory *_instance = nil; 23 | static dispatch_once_t onceToken; 24 | dispatch_once(&onceToken, ^{ 25 | _instance = [[BMHandlerFactory alloc] init]; 26 | }); 27 | 28 | return _instance; 29 | } 30 | 31 | - (instancetype)init 32 | { 33 | @synchronized(self) { 34 | self = [super init]; 35 | if (self) { 36 | _handlerMap = [NSMutableDictionary dictionary]; 37 | _handlerLock = [[NSLock alloc] init]; 38 | } 39 | } 40 | return self; 41 | } 42 | 43 | - (void)_registerHandler:(id)handler withProtocol:(Protocol *)protocol 44 | { 45 | [self.handlerLock lock]; 46 | [self.handlerMap setValue:handler forKey:NSStringFromProtocol(protocol)]; 47 | [self.handlerLock unlock]; 48 | } 49 | 50 | 51 | #pragma mark - Public Func 52 | + (void)registerHandler:(id)handler withProtocol:(Protocol *)protocol 53 | { 54 | [[BMHandlerFactory shareInstance] _registerHandler:handler withProtocol:protocol]; 55 | } 56 | 57 | + (id)handlerForProtocol:(Protocol *)protocol 58 | { 59 | if (!protocol) { 60 | WXLogError(@"Can not find handler for a nil protocol"); 61 | return nil; 62 | } 63 | 64 | return [[BMHandlerFactory shareInstance].handlerMap objectForKey:NSStringFromProtocol(protocol)]; 65 | } 66 | 67 | + (NSDictionary *)handlerConfigs 68 | { 69 | return [BMHandlerFactory shareInstance].handlerMap; 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /Source/BMDebug/Scanner/DemoDefine.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | #ifdef DEBUG 20 | #import 21 | 22 | #define CURRENT_IP [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"localServer-ip" ofType:@".txt"] encoding:NSUTF8StringEncoding error:nil] 23 | 24 | #if TARGET_IPHONE_SIMULATOR 25 | #define DEMO_HOST @"127.0.0.1" 26 | #else 27 | #define DEMO_HOST CURRENT_IP 28 | #endif 29 | 30 | #define DEMO_URL(path) [NSString stringWithFormat:@"http://%@:12580/%s", DEMO_HOST, #path] 31 | 32 | #define HOME_URL [NSString stringWithFormat:@"http://%@:12580/examples/build/vue/index.js", DEMO_HOST] 33 | 34 | #define BUNDLE_URL [NSString stringWithFormat:@"file://%@/bundlejs/landing.weex.js",[NSBundle mainBundle].bundlePath] 35 | 36 | #define UITEST_HOME_URL @"http://test?_wx_tpl=http://localhost:12580/test/build/TC__Home.js" 37 | 38 | #define QRSCAN @"com.taobao.WeexDemo.scan" 39 | #define QRSCAN_HISTORY @"com.taobao.WeexDemo.scan.history" 40 | #define WEEX_COLOR [UIColor colorWithRed:0.27 green:0.71 blue:0.94 alpha:1] 41 | #define WX_SCANNER_HISTORY @"wx_scanner_history" 42 | #endif 43 | -------------------------------------------------------------------------------- /Source/BMManager/Location/TransformCLLocation.h: -------------------------------------------------------------------------------- 1 | // 2 | // TransformCLLocation.h 3 | // JingYitong 4 | // 5 | // Created by XHY on 16/5/26. 6 | // Copyright © 2016年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface TransformCLLocation : NSObject 13 | 14 | /** 15 | * @brief 世界标准地理坐标(WGS-84) 转换成 中国国测局地理坐标(GCJ-02)<火星坐标> 16 | * 17 | * ####只在中国大陆的范围的坐标有效,以外直接返回世界标准坐标 18 | * 19 | * @param location 世界标准地理坐标(WGS-84) 20 | * 21 | * @return 中国国测局地理坐标(GCJ-02)<火星坐标> 22 | */ 23 | + (CLLocationCoordinate2D)wgs84ToGcj02:(CLLocationCoordinate2D)location; 24 | 25 | 26 | /** 27 | * @brief 中国国测局地理坐标(GCJ-02) 转换成 世界标准地理坐标(WGS-84) 28 | * 29 | * ####此接口有1-2米左右的误差,需要精确定位情景慎用 30 | * 31 | * @param location 中国国测局地理坐标(GCJ-02) 32 | * 33 | * @return 世界标准地理坐标(WGS-84) 34 | */ 35 | + (CLLocationCoordinate2D)gcj02ToWgs84:(CLLocationCoordinate2D)location; 36 | 37 | 38 | /** 39 | * @brief 世界标准地理坐标(WGS-84) 转换成 百度地理坐标(BD-09) 40 | * 41 | * @param location 世界标准地理坐标(WGS-84) 42 | * 43 | * @return 百度地理坐标(BD-09) 44 | */ 45 | + (CLLocationCoordinate2D)wgs84ToBd09:(CLLocationCoordinate2D)location; 46 | 47 | 48 | /** 49 | * @brief 中国国测局地理坐标(GCJ-02)<火星坐标> 转换成 百度地理坐标(BD-09) 50 | * 51 | * @param location 中国国测局地理坐标(GCJ-02)<火星坐标> 52 | * 53 | * @return 百度地理坐标(BD-09) 54 | */ 55 | + (CLLocationCoordinate2D)gcj02ToBd09:(CLLocationCoordinate2D)location; 56 | 57 | 58 | /** 59 | * @brief 百度地理坐标(BD-09) 转换成 中国国测局地理坐标(GCJ-02)<火星坐标> 60 | * 61 | * @param location 百度地理坐标(BD-09) 62 | * 63 | * @return 中国国测局地理坐标(GCJ-02)<火星坐标> 64 | */ 65 | + (CLLocationCoordinate2D)bd09ToGcj02:(CLLocationCoordinate2D)location; 66 | 67 | 68 | /** 69 | * @brief 百度地理坐标(BD-09) 转换成 世界标准地理坐标(WGS-84) 70 | * 71 | * ####此接口有1-2米左右的误差,需要精确定位情景慎用 72 | * 73 | * @param location 百度地理坐标(BD-09) 74 | * 75 | * @return 世界标准地理坐标(WGS-84) 76 | */ 77 | + (CLLocationCoordinate2D)bd09ToWgs84:(CLLocationCoordinate2D)location; 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /Source/BMExtension/NSObject+BMSwizzle.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+BMSwizzle.m 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2018/9/6. 6 | // 7 | 8 | #import "NSObject+BMSwizzle.h" 9 | 10 | @implementation NSObject (BMSwizzle) 11 | 12 | + (BOOL)bm_swizzle:(Class)originalClass Method:(SEL)originalSelector withMethod:(SEL)swizzledSelector 13 | { 14 | if (!(originalClass && originalSelector && swizzledSelector)) { 15 | return NO; 16 | } 17 | 18 | Method originalMethod = class_getInstanceMethod(originalClass, originalSelector); 19 | Method swizzledMethod = class_getInstanceMethod(originalClass, swizzledSelector); 20 | 21 | BOOL didAddMethod = class_addMethod(originalClass, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod)); 22 | if (didAddMethod) { 23 | class_replaceMethod(originalClass, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); 24 | } else { 25 | method_exchangeImplementations(originalMethod, swizzledMethod); 26 | } 27 | 28 | return YES; 29 | } 30 | 31 | + (BOOL)bm_swizzleClassMethod:(Class)originalClass Method:(SEL)originalSelector withMethod:(SEL)swizzledSelector 32 | { 33 | if (!(originalClass && originalSelector && swizzledSelector)) { 34 | return NO; 35 | } 36 | 37 | Method originalMethod = class_getClassMethod(originalClass, originalSelector); 38 | Method swizzledMethod = class_getClassMethod(originalClass, swizzledSelector); 39 | 40 | BOOL didAddMethod = class_addMethod(originalClass, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod)); 41 | if (didAddMethod) { 42 | class_replaceMethod(originalClass, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); 43 | } else { 44 | method_exchangeImplementations(originalMethod, swizzledMethod); 45 | } 46 | 47 | return YES; 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Source/BMExtension/AESCrypt/CryptLib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2017 Kavin Varnan 5 | 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #import 26 | #import 27 | #import 28 | 29 | #define AES_KEY @"eros loves you" 30 | #define AES_IV @"RjatRGC4W72PJXTE" 31 | 32 | @interface CryptLib : NSObject 33 | 34 | - (NSData *)encrypt:(NSData *)plainText key:(NSString *)key iv:(NSString *)iv; 35 | - (NSData *)decrypt:(NSData *)encryptedText key:(NSString *)key iv:(NSString *)iv; 36 | - (NSData *)generateRandomIV:(size_t)length; 37 | - (NSString *) md5:(NSString *) input; 38 | - (NSString *) sha256:(NSString *)key length:(NSInteger) length; 39 | - (NSString *) encryptPlainTextWith:(NSString *)plainText key:(NSString *)key iv:(NSString *)iv; 40 | - (NSString *) decryptCipherTextWith:(NSString *)cipherText key:(NSString *)key iv:(NSString *)iv; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Source/BMModule/Axios/BMAxiosNetworkModule.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMAxiosNetworkModule.m 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/13. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import "BMAxiosNetworkModule.h" 10 | #import "BMAxiosRequestModel.h" 11 | #import "BMCommonRequest.h" 12 | #import "BMBaseViewController.h" 13 | #import "BMUserInfoModel.h" 14 | #import "BMImageManager.h" 15 | 16 | @implementation BMAxiosNetworkModule 17 | 18 | @synthesize weexInstance; 19 | 20 | WX_EXPORT_METHOD(@selector(fetch:callback:)) 21 | WX_EXPORT_METHOD(@selector(uploadImage::)) 22 | 23 | 24 | - (void)fetch:(NSDictionary *)info callback:(WXModuleCallback)callback 25 | { 26 | /* 添加判断 */ 27 | if (![info isKindOfClass:[NSDictionary class]]) { 28 | WXLogError(@"js request info Error"); 29 | return; 30 | } 31 | 32 | WXLogInfo(@"js request info: %@",info); 33 | 34 | BMAxiosRequestModel *requestModel = [BMAxiosRequestModel yy_modelWithJSON:info]; 35 | 36 | BMCommonRequest *api = [[BMCommonRequest alloc] initWithRequestModel:requestModel]; 37 | 38 | [((BMBaseViewController *)weexInstance.viewController) addRequest:api]; 39 | 40 | [api startRequestResult:^(id data) { 41 | 42 | WXLogInfo(@"request data: %@",data); 43 | 44 | if (callback) { 45 | callback(data); 46 | } 47 | 48 | }]; 49 | 50 | WXLogInfo(@"%@",api.originalRequest); 51 | } 52 | 53 | - (void)uploadImage:(NSDictionary *)info :(WXModuleCallback)callback 54 | { 55 | BMUploadImageModel *model = [BMUploadImageModel yy_modelWithJSON:info]; 56 | NSArray *images = info[@"images"]; 57 | if (!images || !images.count) { 58 | if (callback) { 59 | NSDictionary *resData = [NSDictionary configCallbackDataWithResCode:BMResCodeError msg:@"上传图片参数错误" data:nil]; 60 | callback(resData); 61 | } 62 | return; 63 | } 64 | [BMImageManager uploadImage:images uploadImageModel:model callback:callback]; 65 | } 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /Source/BMManager/Image/BMImageManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMImageManager.m 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/2/10. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import "BMImageManager.h" 10 | #import "BMUploadImageUtils.h" 11 | 12 | @interface BMImageManager () 13 | 14 | @property (nonatomic, strong) BMUploadImageUtils *uploadImageUtils; 15 | 16 | @end 17 | 18 | @implementation BMImageManager 19 | 20 | #pragma mark - Setter / Getter 21 | 22 | - (BMUploadImageUtils *)uploadImageUtils 23 | { 24 | if (!_uploadImageUtils) { 25 | _uploadImageUtils = [[BMUploadImageUtils alloc] init]; 26 | } 27 | return _uploadImageUtils; 28 | } 29 | 30 | #pragma mark - Private Method 31 | 32 | + (instancetype)shareInstance 33 | { 34 | static BMImageManager *_instance = nil; 35 | static dispatch_once_t onceToken; 36 | dispatch_once(&onceToken, ^{ 37 | _instance = [[BMImageManager alloc] init]; 38 | }); 39 | return _instance; 40 | } 41 | 42 | #pragma mark - Public Method 43 | 44 | + (void)camera:(BMUploadImageModel *)model weexInstance:(WXSDKInstance *)weexInstance callback:(WXModuleCallback)callback 45 | { 46 | [[BMImageManager shareInstance].uploadImageUtils camera:model weexInstance:weexInstance callback:callback]; 47 | } 48 | 49 | + (void)pick:(BMUploadImageModel *)model weexInstance:(WXSDKInstance *)weexInstance callback:(WXModuleCallback)callback 50 | { 51 | [[BMImageManager shareInstance].uploadImageUtils pick:model weexInstance:weexInstance callback:callback]; 52 | } 53 | 54 | + (void)uploadImageWithInfo:(BMUploadImageModel *)model weexInstance:(WXSDKInstance *)weexInstance callback:(WXModuleCallback)callback 55 | { 56 | [[BMImageManager shareInstance].uploadImageUtils uploadImageWithInfo:model weexInstance:weexInstance callback:callback]; 57 | } 58 | 59 | + (void)uploadImage:(NSArray *)images uploadImageModel:(BMUploadImageModel *)model callback:(WXModuleCallback)callback 60 | { 61 | [[BMImageManager shareInstance].uploadImageUtils uploadImage:images uploadImageModel:model callback:callback]; 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /Source/BMCustomUI/WatermarkView/WatermarkView.m: -------------------------------------------------------------------------------- 1 | // 2 | // WatermarkView.m 3 | // Pods 4 | // 5 | // Created by XHY on 2017/8/9. 6 | // 7 | // 8 | 9 | #import "WatermarkView.h" 10 | #import 11 | 12 | #define K_MarkView_Tag 2843 13 | 14 | @implementation WatermarkView 15 | { 16 | NSString *_markText; 17 | } 18 | 19 | #pragma mark - Public Func 20 | 21 | + (void)addWatermarkWithText:(NSString *)text 22 | { 23 | UIWindow *window = [UIWindow findVisibleWindow]; 24 | 25 | UIView *oldMarkView = [window viewWithTag:K_MarkView_Tag]; 26 | if (oldMarkView) { 27 | [oldMarkView removeFromSuperview]; 28 | } 29 | 30 | WatermarkView *markView = [[WatermarkView alloc] initWithFrame:window.bounds]; 31 | markView.tag = K_MarkView_Tag; 32 | markView->_markText = text; 33 | [window addSubview:markView]; 34 | } 35 | 36 | #pragma mark - Private Func 37 | 38 | - (instancetype)initWithFrame:(CGRect)frame 39 | { 40 | if (self = [super initWithFrame:frame]) { 41 | 42 | self.userInteractionEnabled = NO; 43 | self.backgroundColor = [UIColor clearColor]; 44 | } 45 | 46 | return self; 47 | } 48 | 49 | - (void)drawRect:(CGRect)rect { 50 | // Drawing code 51 | 52 | [[UIColor clearColor] set]; 53 | 54 | UIFont * font = [UIFont systemFontOfSize:16.0]; 55 | CGRect rect4Text = [_markText boundingRectWithSize:rect.size options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:font} context:nil]; 56 | 57 | CGFloat x = 0; 58 | CGFloat y = 20; 59 | CGFloat w = rect4Text.size.width; 60 | CGFloat h = rect4Text.size.height; 61 | CGFloat hs = 30; 62 | CGFloat vs = 50; 63 | 64 | while (y < rect.size.height) { 65 | CGRect rect4mark = CGRectMake(x, y, w, h); 66 | [_markText drawInRect:rect4mark withAttributes:@{NSFontAttributeName:font,NSForegroundColorAttributeName:[[UIColor blackColor] colorWithAlphaComponent:0.01]}]; 67 | 68 | x += w + hs; 69 | 70 | if (x + w > rect.size.width) { 71 | y += h + vs; 72 | x = 0; 73 | } 74 | } 75 | } 76 | 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /Source/BMDebug/BMHotRefreshWebScoket.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMHotRefreshWebScoket.m 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2018/3/15. 6 | // 7 | 8 | #ifdef DEBUG 9 | #import "BMHotRefreshWebScoket.h" 10 | #import "BMWebSocketLoader.h" 11 | #import "BMDebugManager.h" 12 | #import "SVProgressHUD.h" 13 | 14 | #define BM_HOT_REFRESH @"SERVER/JS_BUNDLE_CHANGED" 15 | 16 | @implementation BMHotRefreshWebScoket 17 | { 18 | BMWebSocketLoader *loader; 19 | } 20 | 21 | - (void)connect 22 | { 23 | [self webSocket:TK_PlatformInfo().url.socketServer protocol:nil]; 24 | } 25 | 26 | - (void)close 27 | { 28 | if (loader) { 29 | [loader close]; 30 | } 31 | } 32 | 33 | - (void)reConnect 34 | { 35 | if (![[NSUserDefaults standardUserDefaults] boolForKey:BM_HotRefreshKey]) { 36 | return; 37 | } 38 | 39 | static int delay = 2; 40 | delay += 2; 41 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 42 | [self connect]; 43 | }); 44 | } 45 | 46 | - (void)webSocket:(NSString *)url protocol:(NSString *)protocol 47 | { 48 | if (loader) [loader clear]; 49 | loader = [[BMWebSocketLoader alloc] initWithUrl:url protocol:protocol]; 50 | __weak typeof(self) weakSelf = self; 51 | loader.onReceiveMessage = ^(id message) { 52 | WXLogInfo(@"%@",message); 53 | if ([message isEqualToString:BM_HOT_REFRESH]) { 54 | [[BMDebugManager shareInstance] refreshWeex]; 55 | } 56 | }; 57 | loader.onOpen = ^() { 58 | WXLogInfo(@"BMHotRefresh Websocket connected"); 59 | [SVProgressHUD showImage:nil status:@"hot refresh connected."]; 60 | }; 61 | loader.onFail = ^(NSError *error) { 62 | WXLogError(@"BMHotRefresh Websocket Failed With Error %@", error); 63 | if (weakSelf) { 64 | [weakSelf reConnect]; 65 | } 66 | }; 67 | loader.onClose = ^(NSInteger code,NSString *reason,BOOL wasClean) { 68 | WXLogInfo(@"BMHotRefresh Websocket colse: %@", reason); 69 | if (weakSelf) { 70 | [weakSelf reConnect]; 71 | } 72 | }; 73 | 74 | [loader open]; 75 | } 76 | 77 | @end 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /Source/BMManager/Mediator/CTMediator+BMPushActions.m: -------------------------------------------------------------------------------- 1 | // 2 | // CTMediator+BMPushActions.m 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2018/4/24. 6 | // 7 | 8 | #import "CTMediator+BMPushActions.h" 9 | 10 | NSString *const kCTMediatorPushTarget = @"BMPush"; 11 | 12 | NSString *const kCTMediatorActionRegisterDeviceToken = @"registerForRemoteNotificationsWithDeviceToken"; 13 | NSString *const kCTMediatorActionSetIsLaunchedByNotification = @"setIsLaunchedByNotification"; 14 | NSString *const kCTMediatorActionAddPushNotification = @"addPushNotification"; 15 | NSString *const kCTMediatorActionReceiveRemoteNotification = @"receiveRemoteNotification"; 16 | NSString *const kCTMediatorActionPerformFetchWithCompletionHandler = @"performFetchWithCompletionHandler"; 17 | 18 | @implementation CTMediator (BMPushActions) 19 | 20 | - (void)CTMediator_registerForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken 21 | { 22 | [self performTarget:kCTMediatorPushTarget 23 | action:kCTMediatorActionRegisterDeviceToken 24 | params:deviceToken 25 | shouldCacheTarget:NO]; 26 | } 27 | 28 | - (void)CTMediator_setIsLaunchedByNotification:(BOOL)val 29 | { 30 | [self performTarget:kCTMediatorPushTarget 31 | action:kCTMediatorActionSetIsLaunchedByNotification 32 | params:[NSNumber numberWithBool:val] 33 | shouldCacheTarget:NO]; 34 | } 35 | 36 | - (void)CTMediator_addPushNotification:(NSDictionary *)notificationPayload 37 | { 38 | [self performTarget:kCTMediatorPushTarget 39 | action:kCTMediatorActionAddPushNotification 40 | params:notificationPayload 41 | shouldCacheTarget:NO]; 42 | } 43 | 44 | - (void)CTMediator_receiveRemoteNotification:(NSDictionary *)info 45 | { 46 | [self performTarget:kCTMediatorPushTarget 47 | action:kCTMediatorActionReceiveRemoteNotification 48 | params:info 49 | shouldCacheTarget:NO]; 50 | } 51 | 52 | - (void)CTMediator_performFetchWithCompletionHandler:(NSDictionary *)info 53 | { 54 | [self performTarget:kCTMediatorPushTarget 55 | action:kCTMediatorActionPerformFetchWithCompletionHandler 56 | params:info 57 | shouldCacheTarget:NO]; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /Source/ErosApp/ViewControllerExtend/BMBaseViewController+Order.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMBaseViewController+Order.m 3 | // Pods 4 | // 5 | // Created by XHY on 2017/5/22. 6 | // 7 | // 8 | 9 | #import "BMBaseViewController+Order.h" 10 | #import "BMConfigManager.h" 11 | 12 | @implementation BMBaseViewController (Order) 13 | 14 | - (BOOL)currentVcIs:(NSString *)url 15 | { 16 | return ![url isEqualToString:@"tabBar"] && [self.url.absoluteString rangeOfString:url].location != NSNotFound; 17 | } 18 | 19 | /* 判断是否隐藏导航栏 */ 20 | - (BOOL)isHideNavbar 21 | { 22 | if (!self.routerModel.navShow || 23 | [self currentVcIs:[BMConfigManager shareInstance].platform.page.homePage]) { 24 | 25 | return YES; 26 | } 27 | 28 | return NO; 29 | } 30 | 31 | /* 设置状态栏样式 */ 32 | - (void)bmSetStatusBarStyle 33 | { 34 | if (!self.routerModel.statusBarStyle) { 35 | if ([BMConfigManager.shareInstance.platform.page.statusBarStyle isEqualToString:@"LightContent"]) { 36 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:NO]; 37 | } else { 38 | if (@available(iOS 13.0, *)) { 39 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDarkContent animated:NO]; 40 | } else { 41 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault animated:NO]; 42 | } 43 | } 44 | return; 45 | } 46 | 47 | /* 设置状态栏 字体颜色 */ 48 | if ([self.routerModel.statusBarStyle isEqualToString:@"Default"]) { 49 | if (@available(iOS 13.0, *)) { 50 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDarkContent animated:NO]; 51 | }else { 52 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault animated:NO]; 53 | } 54 | 55 | } else { 56 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:NO]; 57 | } 58 | } 59 | 60 | - (CGFloat)weexViewHeight 61 | { 62 | /* 设置weex页面高度 */ 63 | CGFloat height = self.view.height; 64 | if (self.routerModel.isTabBarItem) { 65 | height -= K_TABBAR_HEIGHT; 66 | } 67 | 68 | return height; 69 | } 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /Source/BMModule/BrowserImg/PhotoBrowser/PBImageScrollerViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBImageScrollerViewController.h 3 | // PhotoBrowser 4 | // 5 | // Created by Moch Xiao on 8/24/15. 6 | // Copyright (c) 2015 Moch Xiao (https://github.com/cuzv). 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | @class PBImageScrollView; 30 | typedef void(^PBImageDownloadProgressHandler)(NSInteger receivedSize, NSInteger expectedSize); 31 | 32 | @interface PBImageScrollerViewController : UIViewController 33 | 34 | @property (nonatomic, assign) NSInteger page; 35 | 36 | /// Return the image for current imageView 37 | @property (nonatomic, copy) UIImage *(^fetchImageHandler)(void); 38 | /// Configure image for current imageView 39 | @property (nonatomic, copy) void (^configureImageViewHandler)(UIImageView *imageView); 40 | 41 | /// Configure image for current imageView with progress 42 | @property (nonatomic, copy) void (^configureImageViewWithDownloadProgressHandler)(UIImageView *imageView, PBImageDownloadProgressHandler handler); 43 | 44 | @property (nonatomic, strong, readonly) PBImageScrollView *imageScrollView; 45 | 46 | - (void)reloadData; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Source/BMModule/BundleUpdate/BMBundleUpdateModule.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMBundleUpdateModule.m 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2018/7/17. 6 | // 7 | 8 | #import "BMBundleUpdateModule.h" 9 | #import 10 | #import "BMResourceManager.h" 11 | 12 | WX_PlUGIN_EXPORT_MODULE(bmBundleUpdate, BMBundleUpdateModule) 13 | 14 | @interface BMBundleUpdateModule () 15 | @property (nonatomic, copy) WXModuleKeepAliveCallback callback; 16 | @end 17 | 18 | @implementation BMBundleUpdateModule 19 | 20 | WX_EXPORT_METHOD(@selector(download::)) 21 | WX_EXPORT_METHOD(@selector(update)) 22 | WX_EXPORT_METHOD(@selector(getJsVersion:)) 23 | 24 | @synthesize weexInstance; 25 | 26 | /** 下载jsbundle资源方法 */ 27 | - (void)download:(NSDictionary *)info :(WXModuleKeepAliveCallback)callback 28 | { 29 | if (!info[@"path"] || !info[@"diff"]) { 30 | WXLogError(@"[BM Error] Params error: %@",info); 31 | return; 32 | } 33 | 34 | self.callback = callback; 35 | [[BMResourceManager sharedInstance] downloadJsBundle:info 36 | completed:^(BOOL success, NSString *msg) { 37 | 38 | if (self.callback) { 39 | NSDictionary *resData = [NSDictionary configCallbackDataWithResCode:success ? BMResCodeSuccess : BMResCodeError msg:msg data:nil]; 40 | self.callback(resData, YES); 41 | } 42 | }]; 43 | } 44 | 45 | /** 应用更新 */ 46 | - (void)update 47 | { 48 | [[NSNotificationCenter defaultCenter] postNotificationName:K_BMAppReStartNotification object:nil]; 49 | } 50 | 51 | /** 获取当前jsVersion */ 52 | - (void)getJsVersion:(WXModuleCallback)callback 53 | { 54 | NSDictionary * userInfo = [[BMResourceManager sharedInstance] loadConfigData:K_JS_VERSION_PATH]; 55 | NSString *jsVerson = @""; 56 | if ([userInfo isKindOfClass:[NSDictionary class]]) { 57 | jsVerson = userInfo[@"jsVersion"] ? userInfo[@"jsVersion"]:@""; 58 | } 59 | 60 | if (callback) { 61 | callback(jsVerson); 62 | } 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /Source/BMModule/BrowserImg/PhotoBrowser/UIView+PBSnapshot.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+PBSnapshot.m 3 | // PhotoBrowser 4 | // 5 | // Created by Moch Xiao on 5/15/16. 6 | // Copyright © 2016 Moch Xiao (http://mochxiao.com). 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import "UIView+PBSnapshot.h" 28 | 29 | @implementation UIView (PBSnapshot) 30 | 31 | - (UIImage *)pb_snapshot { 32 | UIGraphicsBeginImageContextWithOptions(self.bounds.size, self.opaque, 0); 33 | [self.layer renderInContext:UIGraphicsGetCurrentContext()]; 34 | UIImage *outpu = UIGraphicsGetImageFromCurrentImageContext(); 35 | UIGraphicsEndImageContext(); 36 | return outpu; 37 | } 38 | 39 | - (UIImage *)pb_snapshotAfterScreenUpdates:(BOOL)afterUpdates { 40 | if (![self respondsToSelector:@selector(drawViewHierarchyInRect:afterScreenUpdates:)]) { 41 | return [self pb_snapshot]; 42 | } 43 | UIGraphicsBeginImageContextWithOptions(self.bounds.size, self.opaque, 0); 44 | [self drawViewHierarchyInRect:self.bounds afterScreenUpdates:afterUpdates]; 45 | UIImage *outpu = UIGraphicsGetImageFromCurrentImageContext(); 46 | UIGraphicsEndImageContext(); 47 | return outpu; 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Source/BMCustomUI/HYAlert/HYPopupView.h: -------------------------------------------------------------------------------- 1 | // 2 | // HYPopupView.h 3 | // HYAlertView 4 | // 5 | // Created by XHY on 16/1/12. 6 | // Copyright © 2016年 XHY. All rights reserved. 7 | // 8 | 9 | #ifndef HYPopupView_H 10 | #define HYPopupView_H 11 | #import 12 | 13 | #define kDefaultCenterPopupViewWidth ([UIScreen mainScreen].bounds.size.width - 30.0) 14 | #define kDefaultPopupViewRowHeight 55.0 15 | #define kDefaultCenterPopupViewHeight 300.0 16 | //#define kDefaultPopupViewHeaderViewHeight 55.0 17 | //#define kDefaultPopupViewFooterViewHeight 40.0 18 | 19 | #define kDefaultPopupViewAnimationDuration 0.25 20 | 21 | /** 22 | * 背景遮罩type 23 | */ 24 | typedef NS_ENUM(NSInteger, HYPopupViewMaskType) { 25 | /** 26 | * 透明遮罩 可点击移除弹框 27 | */ 28 | HYPopupViewMaskClear = 0, 29 | /** 30 | * 半透明黑色遮罩 可点击移除弹窗 31 | */ 32 | HYPopupViewMaskBlack 33 | }; 34 | 35 | @class HYPopupView; 36 | 37 | @protocol HYPopupViewDataSource 38 | 39 | @optional 40 | - (NSInteger)numberOfRowInPopupView:(HYPopupView *)popupView; 41 | - (UITableViewCell *)popupView:(HYPopupView *)popupView dequeueReusableCellInTableView:(UITableView *)tableView cellIdentifier:(NSString *)identifier atRow:(NSInteger)row; 42 | 43 | @end 44 | 45 | @protocol HYPopupViewDelegate 46 | 47 | @optional 48 | - (CGFloat)popupView:(HYPopupView *)popupView heightForRowAtIndex:(NSInteger)index; 49 | - (CGFloat)heightForHeaderViewInPopupView:(HYPopupView *)popupView; 50 | - (CGFloat)heightForFooterViewInPopupView:(HYPopupView *)popupView; 51 | - (UIView *)headerViewForPopupView:(HYPopupView *)popupView; 52 | - (UIView *)footerViewForPopupView:(HYPopupView *)popupView; 53 | - (void)popupView:(HYPopupView *)popupView didSelectedRowAtIndex:(NSInteger)index; 54 | - (HYPopupViewMaskType)maskTypeForPopupView:(HYPopupView *)popupView; 55 | - (BOOL)canClickBackgroundView:(HYPopupView *)popupView; 56 | 57 | @end 58 | 59 | @interface HYPopupView : UIControl 60 | 61 | @property (nonatomic, weak) id dataSource; 62 | @property (nonatomic, weak) id delegate; 63 | 64 | - (instancetype)initWithDataSource:(id)dataSource 65 | delegate:(id)delegate; 66 | 67 | - (void)show; 68 | - (void)showInView:(UIView *)view; 69 | - (void)dismiss; 70 | 71 | @end 72 | 73 | #endif -------------------------------------------------------------------------------- /Source/BMCustomUI/Label/JYTTitleLabel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JYTTitleLabel.m 3 | // JingYitong 4 | // 5 | // Created by XHY on 15/9/18. 6 | // Copyright © 2015年 XHY. All rights reserved. 7 | // 8 | 9 | #import "JYTTitleLabel.h" 10 | #import "BMDefine.h" 11 | 12 | @implementation JYTTitleLabel 13 | 14 | - (id)init 15 | { 16 | if (self = [super init]) { 17 | 18 | [self changeFontSize]; 19 | 20 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 21 | 22 | } 23 | 24 | return self; 25 | } 26 | 27 | - (id)initWithFrame:(CGRect)frame 28 | { 29 | if (self = [super initWithFrame:frame]) { 30 | 31 | [self changeFontSize]; 32 | 33 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 34 | } 35 | return self; 36 | } 37 | 38 | - (id)initWithCoder:(NSCoder *)aDecoder 39 | { 40 | if (self = [super initWithCoder:aDecoder]) { 41 | 42 | [self changeFontSize]; 43 | 44 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 45 | } 46 | return self; 47 | } 48 | 49 | - (void)awakeFromNib 50 | { 51 | [super awakeFromNib]; 52 | 53 | [self changeFontSize]; 54 | 55 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 56 | } 57 | 58 | - (void)changeFontSize 59 | { 60 | NSString *fontSize = [[NSUserDefaults standardUserDefaults] objectForKey:K_FONT_SIZE_KEY]; 61 | // 标准字体 62 | if (!fontSize || [fontSize isEqualToString:K_FONT_SIZE_NORM]) 63 | { 64 | self.font = K_FONT_15; 65 | } 66 | else if ([fontSize isEqualToString:K_FONT_SIZE_BIG]) 67 | { 68 | self.font = K_FONT_18; 69 | } 70 | else if ([fontSize isEqualToString:k_FONT_SIZE_EXTRALARGE]) 71 | { 72 | self.font = K_FONT_21; 73 | } 74 | } 75 | 76 | - (void)dealloc 77 | { 78 | // 销毁时移除通知 79 | [[NSNotificationCenter defaultCenter] removeObserver:self name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /Source/BMCustomUI/Label/JYTBigTitleLabel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JYTBigTitleLabel.m 3 | // JingYitong 4 | // 5 | // Created by XHY on 15/9/22. 6 | // Copyright © 2015年 XHY. All rights reserved. 7 | // 8 | 9 | #import "JYTBigTitleLabel.h" 10 | #import "BMDefine.h" 11 | 12 | @implementation JYTBigTitleLabel 13 | 14 | - (id)init 15 | { 16 | if (self = [super init]) { 17 | 18 | [self changeFontSize]; 19 | 20 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 21 | 22 | } 23 | 24 | return self; 25 | } 26 | 27 | - (id)initWithFrame:(CGRect)frame 28 | { 29 | if (self = [super initWithFrame:frame]) { 30 | 31 | [self changeFontSize]; 32 | 33 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 34 | } 35 | return self; 36 | } 37 | 38 | - (id)initWithCoder:(NSCoder *)aDecoder 39 | { 40 | if (self = [super initWithCoder:aDecoder]) { 41 | 42 | [self changeFontSize]; 43 | 44 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 45 | } 46 | return self; 47 | } 48 | 49 | - (void)awakeFromNib 50 | { 51 | [super awakeFromNib]; 52 | 53 | [self changeFontSize]; 54 | 55 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 56 | } 57 | 58 | - (void)changeFontSize 59 | { 60 | NSString *fontSize = [[NSUserDefaults standardUserDefaults] objectForKey:K_FONT_SIZE_KEY]; 61 | // 标准字体 62 | if (!fontSize || [fontSize isEqualToString:K_FONT_SIZE_NORM]) 63 | { 64 | self.font = K_FONT_18; 65 | } 66 | else if ([fontSize isEqualToString:K_FONT_SIZE_BIG]) 67 | { 68 | self.font = K_FONT_22; 69 | } 70 | else if ([fontSize isEqualToString:k_FONT_SIZE_EXTRALARGE]) 71 | { 72 | self.font = K_FONT_25; 73 | } 74 | } 75 | 76 | - (void)dealloc 77 | { 78 | // 销毁时移除通知 79 | [[NSNotificationCenter defaultCenter] removeObserver:self name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /Source/BMCustomUI/Label/JYTLabelFontSize13.m: -------------------------------------------------------------------------------- 1 | // 2 | // JYTLabelFontSize13.m 3 | // JingYitong 4 | // 5 | // Created by XHY on 16/5/30. 6 | // Copyright © 2016年 XHY. All rights reserved. 7 | // 8 | 9 | #import "JYTLabelFontSize13.h" 10 | #import "BMDefine.h" 11 | 12 | @implementation JYTLabelFontSize13 13 | 14 | - (id)init 15 | { 16 | if (self = [super init]) { 17 | 18 | [self changeFontSize]; 19 | 20 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 21 | 22 | } 23 | 24 | return self; 25 | } 26 | 27 | - (id)initWithFrame:(CGRect)frame 28 | { 29 | if (self = [super initWithFrame:frame]) { 30 | 31 | [self changeFontSize]; 32 | 33 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 34 | } 35 | return self; 36 | } 37 | 38 | - (id)initWithCoder:(NSCoder *)aDecoder 39 | { 40 | if (self = [super initWithCoder:aDecoder]) { 41 | 42 | [self changeFontSize]; 43 | 44 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 45 | } 46 | return self; 47 | } 48 | 49 | - (void)awakeFromNib 50 | { 51 | [super awakeFromNib]; 52 | 53 | [self changeFontSize]; 54 | 55 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 56 | } 57 | 58 | - (void)changeFontSize 59 | { 60 | NSString *fontSize = [[NSUserDefaults standardUserDefaults] objectForKey:K_FONT_SIZE_KEY]; 61 | // 标准字体 62 | if (!fontSize || [fontSize isEqualToString:K_FONT_SIZE_NORM]) 63 | { 64 | self.font = K_FONT_13; 65 | } 66 | else if ([fontSize isEqualToString:K_FONT_SIZE_BIG]) 67 | { 68 | self.font = K_FONT_15; 69 | } 70 | else if ([fontSize isEqualToString:k_FONT_SIZE_EXTRALARGE]) 71 | { 72 | self.font = K_FONT_18; 73 | } 74 | } 75 | 76 | - (void)dealloc 77 | { 78 | // 销毁时移除通知 79 | [[NSNotificationCenter defaultCenter] removeObserver:self name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /Source/BMCustomUI/Label/JYTSmallTitleLabel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JYTSmallTitleLabel.m 3 | // JingYitong 4 | // 5 | // Created by XHY on 15/9/22. 6 | // Copyright © 2015年 XHY. All rights reserved. 7 | // 8 | 9 | #import "JYTSmallTitleLabel.h" 10 | #import "BMDefine.h" 11 | 12 | @implementation JYTSmallTitleLabel 13 | 14 | - (id)init 15 | { 16 | if (self = [super init]) { 17 | 18 | [self changeFontSize]; 19 | 20 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 21 | 22 | } 23 | 24 | return self; 25 | } 26 | 27 | - (id)initWithFrame:(CGRect)frame 28 | { 29 | if (self = [super initWithFrame:frame]) { 30 | 31 | [self changeFontSize]; 32 | 33 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 34 | } 35 | return self; 36 | } 37 | 38 | - (id)initWithCoder:(NSCoder *)aDecoder 39 | { 40 | if (self = [super initWithCoder:aDecoder]) { 41 | 42 | [self changeFontSize]; 43 | 44 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 45 | } 46 | return self; 47 | } 48 | 49 | - (void)awakeFromNib 50 | { 51 | [super awakeFromNib]; 52 | 53 | [self changeFontSize]; 54 | 55 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 56 | } 57 | 58 | - (void)changeFontSize 59 | { 60 | NSString *fontSize = [[NSUserDefaults standardUserDefaults] objectForKey:K_FONT_SIZE_KEY]; 61 | // 标准字体 62 | if (!fontSize || [fontSize isEqualToString:K_FONT_SIZE_NORM]) 63 | { 64 | self.font = K_FONT_10; 65 | } 66 | else if ([fontSize isEqualToString:K_FONT_SIZE_BIG]) 67 | { 68 | self.font = K_FONT_12; 69 | } 70 | else if ([fontSize isEqualToString:k_FONT_SIZE_EXTRALARGE]) 71 | { 72 | self.font = K_FONT_14; 73 | } 74 | } 75 | 76 | - (void)dealloc 77 | { 78 | // 销毁时移除通知 79 | [[NSNotificationCenter defaultCenter] removeObserver:self name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /Source/BMCustomUI/Label/JYTHomeTitleLabel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JYTHomeTitleLabel.m 3 | // JingYitong 4 | // 5 | // Created by XHY on 16/6/13. 6 | // Copyright © 2016年 XHY. All rights reserved. 7 | // 8 | 9 | #import "JYTHomeTitleLabel.h" 10 | #import "BMDefine.h" 11 | 12 | @implementation JYTHomeTitleLabel 13 | 14 | - (id)init 15 | { 16 | if (self = [super init]) { 17 | 18 | [self changeFontSize]; 19 | 20 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 21 | 22 | } 23 | 24 | return self; 25 | } 26 | 27 | - (id)initWithFrame:(CGRect)frame 28 | { 29 | if (self = [super initWithFrame:frame]) { 30 | 31 | [self changeFontSize]; 32 | 33 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 34 | } 35 | return self; 36 | } 37 | 38 | - (id)initWithCoder:(NSCoder *)aDecoder 39 | { 40 | if (self = [super initWithCoder:aDecoder]) { 41 | 42 | [self changeFontSize]; 43 | 44 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 45 | } 46 | return self; 47 | } 48 | 49 | - (void)awakeFromNib 50 | { 51 | 52 | [super awakeFromNib]; 53 | 54 | [self changeFontSize]; 55 | 56 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 57 | } 58 | 59 | - (void)changeFontSize 60 | { 61 | NSString *fontSize = [[NSUserDefaults standardUserDefaults] objectForKey:K_FONT_SIZE_KEY]; 62 | // 标准字体 63 | if (!fontSize || [fontSize isEqualToString:K_FONT_SIZE_NORM]) 64 | { 65 | self.font = K_FONT_15; 66 | } 67 | else if ([fontSize isEqualToString:K_FONT_SIZE_BIG]) 68 | { 69 | self.font = K_FONT_18; 70 | } 71 | else if ([fontSize isEqualToString:k_FONT_SIZE_EXTRALARGE]) 72 | { 73 | self.font = K_FONT_19; 74 | } 75 | } 76 | 77 | - (void)dealloc 78 | { 79 | // 销毁时移除通知 80 | [[NSNotificationCenter defaultCenter] removeObserver:self name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 81 | } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /Source/BMCustomUI/Label/JYTBoldContentLabel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JYTBoldContentLabel.m 3 | // JingYitong 4 | // 5 | // Created by XHY on 16/1/11. 6 | // Copyright © 2016年 XHY. All rights reserved. 7 | // 8 | 9 | #import "JYTBoldContentLabel.h" 10 | #import "BMDefine.h" 11 | 12 | @implementation JYTBoldContentLabel 13 | 14 | - (id)init 15 | { 16 | if (self = [super init]) { 17 | 18 | [self changeFontSize]; 19 | 20 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 21 | 22 | } 23 | 24 | return self; 25 | } 26 | 27 | - (id)initWithFrame:(CGRect)frame 28 | { 29 | if (self = [super initWithFrame:frame]) { 30 | 31 | [self changeFontSize]; 32 | 33 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 34 | } 35 | return self; 36 | } 37 | 38 | - (id)initWithCoder:(NSCoder *)aDecoder 39 | { 40 | if (self = [super initWithCoder:aDecoder]) { 41 | 42 | [self changeFontSize]; 43 | 44 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 45 | } 46 | return self; 47 | } 48 | 49 | - (void)awakeFromNib 50 | { 51 | [super awakeFromNib]; 52 | 53 | [self changeFontSize]; 54 | 55 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 56 | } 57 | 58 | - (void)changeFontSize 59 | { 60 | NSString *fontSize = [[NSUserDefaults standardUserDefaults] objectForKey:K_FONT_SIZE_KEY]; 61 | // 标准字体 62 | if (!fontSize || [fontSize isEqualToString:K_FONT_SIZE_NORM]) 63 | { 64 | self.font = [UIFont boldSystemFontOfSize:12.0]; 65 | } 66 | else if ([fontSize isEqualToString:K_FONT_SIZE_BIG]) 67 | { 68 | self.font = [UIFont boldSystemFontOfSize:14.0]; 69 | } 70 | else if ([fontSize isEqualToString:k_FONT_SIZE_EXTRALARGE]) 71 | { 72 | self.font = [UIFont boldSystemFontOfSize:17.0]; 73 | } 74 | } 75 | 76 | - (void)dealloc 77 | { 78 | // 销毁时移除通知 79 | [[NSNotificationCenter defaultCenter] removeObserver:self name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /Source/BMCustomUI/Label/JYTBoldBigTitleLabel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JYTBoldBigTitleLabel.m 3 | // JingYitong 4 | // 5 | // Created by saohuobang on 15/9/24. 6 | // Copyright © 2015年 XHY. All rights reserved. 7 | // 8 | 9 | #import "JYTBoldBigTitleLabel.h" 10 | #import "BMDefine.h" 11 | 12 | @implementation JYTBoldBigTitleLabel 13 | 14 | - (id)init 15 | { 16 | if (self = [super init]) { 17 | 18 | [self changeFontSize]; 19 | 20 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 21 | 22 | } 23 | 24 | return self; 25 | } 26 | 27 | - (id)initWithFrame:(CGRect)frame 28 | { 29 | if (self = [super initWithFrame:frame]) { 30 | 31 | [self changeFontSize]; 32 | 33 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 34 | } 35 | return self; 36 | } 37 | 38 | - (id)initWithCoder:(NSCoder *)aDecoder 39 | { 40 | if (self = [super initWithCoder:aDecoder]) { 41 | 42 | [self changeFontSize]; 43 | 44 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 45 | } 46 | return self; 47 | } 48 | 49 | - (void)awakeFromNib 50 | { 51 | [super awakeFromNib]; 52 | 53 | [self changeFontSize]; 54 | 55 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 56 | } 57 | 58 | - (void)changeFontSize 59 | { 60 | NSString *fontSize = [[NSUserDefaults standardUserDefaults] objectForKey:K_FONT_SIZE_KEY]; 61 | // 标准字体 62 | if (!fontSize || [fontSize isEqualToString:K_FONT_SIZE_NORM]) 63 | { 64 | self.font = [UIFont boldSystemFontOfSize:18];; 65 | } 66 | else if ([fontSize isEqualToString:K_FONT_SIZE_BIG]) 67 | { 68 | self.font = [UIFont boldSystemFontOfSize:22];; 69 | } 70 | else if ([fontSize isEqualToString:k_FONT_SIZE_EXTRALARGE]) 71 | { 72 | self.font = [UIFont boldSystemFontOfSize:25];; 73 | } 74 | } 75 | 76 | - (void)dealloc 77 | { 78 | // 销毁时移除通知 79 | [[NSNotificationCenter defaultCenter] removeObserver:self name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /Source/BMCustomUI/Label/JYTLabelBoldFontSize21.m: -------------------------------------------------------------------------------- 1 | // 2 | // JYTLabelBoldFontSize21.m 3 | // JingYitong 4 | // 5 | // Created by XHY on 16/6/13. 6 | // Copyright © 2016年 XHY. All rights reserved. 7 | // 8 | 9 | #import "JYTLabelBoldFontSize21.h" 10 | #import "BMDefine.h" 11 | 12 | @implementation JYTLabelBoldFontSize21 13 | 14 | - (id)init 15 | { 16 | if (self = [super init]) { 17 | 18 | [self changeFontSize]; 19 | 20 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 21 | 22 | } 23 | 24 | return self; 25 | } 26 | 27 | - (id)initWithFrame:(CGRect)frame 28 | { 29 | if (self = [super initWithFrame:frame]) { 30 | 31 | [self changeFontSize]; 32 | 33 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 34 | } 35 | return self; 36 | } 37 | 38 | - (id)initWithCoder:(NSCoder *)aDecoder 39 | { 40 | if (self = [super initWithCoder:aDecoder]) { 41 | 42 | [self changeFontSize]; 43 | 44 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 45 | } 46 | return self; 47 | } 48 | 49 | - (void)awakeFromNib 50 | { 51 | [super awakeFromNib]; 52 | 53 | [self changeFontSize]; 54 | 55 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeFontSize) name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 56 | } 57 | 58 | - (void)changeFontSize 59 | { 60 | NSString *fontSize = [[NSUserDefaults standardUserDefaults] objectForKey:K_FONT_SIZE_KEY]; 61 | // 标准字体 62 | if (!fontSize || [fontSize isEqualToString:K_FONT_SIZE_NORM]) 63 | { 64 | self.font = [UIFont boldSystemFontOfSize:21]; 65 | } 66 | else if ([fontSize isEqualToString:K_FONT_SIZE_BIG]) 67 | { 68 | self.font = [UIFont boldSystemFontOfSize:25]; 69 | } 70 | else if ([fontSize isEqualToString:k_FONT_SIZE_EXTRALARGE]) 71 | { 72 | self.font = [UIFont boldSystemFontOfSize:30];; 73 | } 74 | } 75 | 76 | - (void)dealloc 77 | { 78 | // 销毁时移除通知 79 | [[NSNotificationCenter defaultCenter] removeObserver:self name:K_CHANGE_FONT_SIZE_NOTIFICATION object:nil]; 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /Source/ErosApp/Network/BMCommonRequest.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMCommonRequest.m 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/13. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import "BMCommonRequest.h" 10 | #import "BMAxiosRequestModel.h" 11 | #import "BMUserInfoModel.h" 12 | 13 | @implementation BMCommonRequest 14 | { 15 | BMAxiosRequestModel *_model; 16 | } 17 | 18 | - (YTKRequestMethod)requestMethod 19 | { 20 | if (!_model.method || [_model.method isEqualToString:@"GET"]) { 21 | return YTKRequestMethodGET; 22 | } 23 | 24 | if ([_model.method isEqualToString:@"HEAD"]) { 25 | return YTKRequestMethodHEAD; 26 | } 27 | 28 | if ([_model.method isEqualToString:@"PUT"]) { 29 | return YTKRequestMethodPUT; 30 | } 31 | 32 | if ([_model.method isEqualToString:@"DELETE"]) { 33 | return YTKRequestMethodDELETE; 34 | } 35 | 36 | if ([_model.method isEqualToString:@"PATCH"]) { 37 | return YTKRequestMethodPATCH; 38 | } 39 | 40 | return YTKRequestMethodPOST; 41 | } 42 | 43 | - (NSString *)requestURLPath 44 | { 45 | return [NSURL URLWithString:_model.url].path; 46 | } 47 | 48 | - (NSString *)baseUrl 49 | { 50 | return @""; 51 | } 52 | 53 | /** 添加自定义 Headers */ 54 | - (NSDictionary *)requestHeaderFieldValueDictionary 55 | { 56 | /** headers */ 57 | NSMutableDictionary *headers = [NSMutableDictionary dictionary]; 58 | if (_model.header) { 59 | [headers setValuesForKeysWithDictionary:_model.header]; 60 | } 61 | 62 | return headers; 63 | } 64 | 65 | - (YTKRequestSerializerType)requestSerializerType 66 | { 67 | if ([_model.header[@"Content-Type"] isEqualToString:@"application/x-www-form-urlencoded;charset=utf-8"] || 68 | [_model.header[@"Content-Type"] isEqualToString:@"application/x-www-form-urlencoded"]) { 69 | return YTKRequestSerializerTypeHTTP; 70 | } 71 | 72 | return YTKRequestSerializerTypeJSON; 73 | } 74 | 75 | - (NSString *)requestUrl 76 | { 77 | return _model.url ?: @""; 78 | } 79 | 80 | - (instancetype)initWithRequestModel:(BMAxiosRequestModel *)model 81 | { 82 | if (self = [super init]) { 83 | _model = model; 84 | } 85 | return self; 86 | } 87 | 88 | - (id)requestArgument 89 | { 90 | return _model.data; 91 | } 92 | 93 | - (CGFloat)requestTimeoutInterval 94 | { 95 | return _model.timeout > 0 ? _model.timeout / 1000.0 : 30; 96 | } 97 | 98 | @end 99 | -------------------------------------------------------------------------------- /Source/BMWeexExtension/WXWebComponent+BMExtend.m: -------------------------------------------------------------------------------- 1 | // 2 | // WXWebComponent+BMExtend.m 3 | // Pods 4 | // 5 | // Created by XHY on 2017/5/5. 6 | // 7 | // 8 | 9 | #import "WXWebComponent+BMExtend.h" 10 | #import 11 | #import "BMNative.h" 12 | #import 13 | 14 | @class WXWebView; 15 | 16 | @implementation WXWebComponent (BMExtend) 17 | 18 | - (void)bm_webViewDidFinishLoad:(UIWebView *)webView 19 | { 20 | [self bm_webViewDidFinishLoad:webView]; 21 | 22 | CGFloat contentHeight = webView.scrollView.contentSize.height; 23 | 24 | CGFloat pixelScale = [WXUtility defaultPixelScaleFactor]; 25 | 26 | contentHeight = contentHeight/(pixelScale*2); 27 | 28 | [self fireEvent:@"bmPageFinish" params:@{@"contentHeight": @(contentHeight)}]; 29 | } 30 | - (void)bm_viewDidLoad 31 | { 32 | [self bm_viewDidLoad]; 33 | UIWebView * webview = (UIWebView *)self.view; 34 | webview.opaque = NO; 35 | webview.backgroundColor = [UIColor clearColor]; 36 | 37 | JSContext *jsContext = [self valueForKey:@"jsContext"]; 38 | BMNative *bmnative = [[BMNative alloc] init]; 39 | jsContext[@"bmnative"] = bmnative; 40 | 41 | if (self.attributes[@"scrollEnabled"] && NO == [self.attributes[@"scrollEnabled"] boolValue]) { 42 | webview.scrollView.scrollEnabled = NO; 43 | } 44 | 45 | } 46 | 47 | /** 修复如果url为 NSNull、或者nil的时候 崩溃的问题 weex没有做判断 */ 48 | - (void)bm_setUrl:(NSString *)url; 49 | { 50 | if (![url isKindOfClass:[NSString class]]) { 51 | return; 52 | } 53 | 54 | [self bm_setUrl:url]; 55 | } 56 | 57 | /** 58 | 这里主要判断是否是本地html,如果是本地html,则加载本地html 59 | */ 60 | -(void)bm_loadURL:(NSString *)url 61 | { 62 | WXPerformBlockOnMainThread(^{ 63 | UIWebView * webview = (UIWebView *)self.view; 64 | 65 | if(webview){ 66 | NSURL *urlPath = [NSURL URLWithString:url]; 67 | if([urlPath.scheme isEqualToString:BM_LOCAL]){ 68 | if (BM_InterceptorOn()) { 69 | NSURLRequest *request = [NSURLRequest requestWithURL:TK_RewriteBMLocalURL(url)]; 70 | [webview loadRequest:request]; 71 | }else { 72 | NSString *debugUrl = TK_RewriteBMLocalURL(url).absoluteString; 73 | [self bm_loadURL:debugUrl]; 74 | } 75 | } else { 76 | [self bm_loadURL:url]; 77 | } 78 | } 79 | }); 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /Source/BMModule/BrowserImg/PhotoBrowser/PBPresentAnimatedTransitioningController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBPresentAnimatedTransitioningController.h 3 | // PhotoBrowser 4 | // 5 | // Created by Moch Xiao on 5/17/16. 6 | // Copyright © 2016 Moch Xiao (http://mochxiao.com). 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | #import 29 | 30 | typedef void(^PBContextBlock)(UIView * __nonnull fromView, UIView * __nonnull toView); 31 | 32 | @interface PBPresentAnimatedTransitioningController : NSObject 33 | 34 | @property (nonatomic, copy, nullable) PBContextBlock willPresentActionHandler; 35 | @property (nonatomic, copy, nullable) PBContextBlock onPresentActionHandler; 36 | @property (nonatomic, copy, nullable) PBContextBlock didPresentActionHandler; 37 | @property (nonatomic, copy, nullable) PBContextBlock willDismissActionHandler; 38 | @property (nonatomic, copy, nullable) PBContextBlock onDismissActionHandler; 39 | @property (nonatomic, copy, nullable) PBContextBlock didDismissActionHandler; 40 | 41 | 42 | /// Default cover is a dim view, you could override this property to your preferred style view. 43 | @property (nonatomic, strong, nonnull) UIView *coverView; 44 | 45 | - (nonnull PBPresentAnimatedTransitioningController *)prepareForPresent; 46 | - (nonnull PBPresentAnimatedTransitioningController *)prepareForDismiss; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Source/BMExtension/UIView+Util.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Util.h 3 | // JingYitong 4 | // 5 | // Created by XHY on 15/7/14. 6 | // Copyright (c) 2015年 XHY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (Util) 12 | 13 | /* frame.origin.x */ 14 | @property (nonatomic) CGFloat minX; 15 | 16 | /* frame.origin.y */ 17 | @property (nonatomic) CGFloat minY; 18 | 19 | /* frame.origin.x + frame.size.width */ 20 | @property (nonatomic) CGFloat maxX; 21 | 22 | /* frame.origin.y + frame.size.height */ 23 | @property (nonatomic) CGFloat maxY; 24 | 25 | /* frame.size.width */ 26 | @property (nonatomic) CGFloat width; 27 | 28 | /* frame.size.height */ 29 | @property (nonatomic) CGFloat height; 30 | 31 | /* center.x */ 32 | @property (nonatomic) CGFloat centerX; 33 | 34 | /* center.y */ 35 | @property (nonatomic) CGFloat centerY; 36 | 37 | /* Return the x coordinate on the screen */ 38 | @property (nonatomic, readonly) CGFloat ttScreenX; 39 | 40 | /* Return the y coordinate on the screen */ 41 | @property (nonatomic, readonly) CGFloat ttScreenY; 42 | 43 | /* Return the x coordinate on the screen, taking into account scroll views */ 44 | @property (nonatomic, readonly) CGFloat screenViewX; 45 | 46 | /* Return the y coordinate on the screen, taking into account scroll views */ 47 | @property (nonatomic, readonly) CGFloat screenViewY; 48 | 49 | /* Return the view frame on the screen, taking into account scroll views */ 50 | @property (nonatomic, readonly) CGRect screenFrame; 51 | 52 | /* frame.origin */ 53 | @property (nonatomic) CGPoint origin; 54 | 55 | /* frame.size */ 56 | @property (nonatomic) CGSize size; 57 | 58 | /* center for bounds */ 59 | @property (nonatomic) CGPoint centerBounds; 60 | 61 | - (UIView*)subviewWithFirstResponder; 62 | - (UIView*)subviewWithClass:(Class)cls; 63 | - (UIView*)superviewWithClass:(Class)cls; 64 | - (NSArray *)subviewsWtihClass:(Class)cls; 65 | 66 | - (void)removeAllSubviews; 67 | 68 | /** 设置背景图片 */ 69 | - (void)setBackgroundImage:(UIImage *)image; 70 | 71 | /** 设置背景视图 */ 72 | - (void)setBackgroundView:(UIView *)bgView; 73 | 74 | /** 设置圆角*/ 75 | - (void)setCornerRadius:(CGFloat)radius; 76 | 77 | 78 | - (id)initWithClearFrame:(CGRect)frame; 79 | - (id)initLineWithFrame:(CGRect)frame color:(UIColor *)color; 80 | - (id)initBorderWithFrame:(CGRect)frame; 81 | - (id)initHeaderWithFrame:(CGRect)frame title:(NSString *)title; 82 | 83 | /** 添加一个子view*/ 84 | - (UIView *)addSubviewWithFrame:(CGRect)frame color:(UIColor *)color; 85 | 86 | - (UIViewController *)viewController; 87 | 88 | - (NSString *)stringViewStruct; 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /Source/BMModule/WebSocket/BMWebSocketLoader.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMWebSocketLoader.m 3 | // BMBaseLibrary 4 | // 5 | // Created by XHY on 2017/10/23. 6 | // 7 | 8 | #import "BMWebSocketLoader.h" 9 | #import "BMWebSocketHandler.h" 10 | #import "BMWebSocketDefaultImpl.h" 11 | 12 | @interface BMWebSocketLoader() 13 | @property (nonatomic,copy) NSString *url; 14 | @property (nonatomic,copy) NSString *protocol; 15 | @property (nonatomic,strong) BMWebSocketDefaultImpl *webSocketImp; 16 | @end 17 | 18 | @implementation BMWebSocketLoader 19 | 20 | - (BMWebSocketDefaultImpl *)webSocketImp 21 | { 22 | if (!_webSocketImp) { 23 | _webSocketImp = [[BMWebSocketDefaultImpl alloc] init]; 24 | } 25 | return _webSocketImp; 26 | } 27 | 28 | - (instancetype)initWithUrl:(NSString *)url protocol:(NSString *)protocol 29 | { 30 | if (self = [super init]) { 31 | _url = url; 32 | _protocol = protocol; 33 | } 34 | return self; 35 | } 36 | 37 | - (id)copyWithZone:(NSZone *)zone 38 | { 39 | BMWebSocketLoader *newClass = [[BMWebSocketLoader alloc] init]; 40 | newClass.onOpen = self.onOpen; 41 | newClass.onReceiveMessage = self.onReceiveMessage; 42 | newClass.onFail = self.onFail; 43 | newClass.onClose = self.onClose; 44 | newClass.protocol = self.protocol; 45 | newClass.url = self.url; 46 | return newClass; 47 | } 48 | 49 | - (void)open 50 | { 51 | [self.webSocketImp open:self.url protocol:self.protocol withDelegate:self]; 52 | } 53 | 54 | - (void)send:(NSString *)data 55 | { 56 | [self.webSocketImp sendData:data]; 57 | } 58 | 59 | - (void)close 60 | { 61 | [self.webSocketImp close]; 62 | } 63 | 64 | - (void)clear 65 | { 66 | [self.webSocketImp clear]; 67 | } 68 | 69 | - (void)close:(NSInteger)code reason:(NSString *)reason 70 | { 71 | [self.webSocketImp closeWithCode:code reason:reason]; 72 | } 73 | 74 | #pragma mark - BMWebSocketDelegate 75 | - (void)didOpen 76 | { 77 | if (self.onOpen) { 78 | self.onOpen(); 79 | } 80 | } 81 | 82 | - (void)didFailWithError:(NSError *)error 83 | { 84 | if (self.onFail) { 85 | self.onFail(error); 86 | } 87 | } 88 | 89 | - (void)didReceiveMessage:(id)message 90 | { 91 | if (self.onReceiveMessage) { 92 | self.onReceiveMessage(message); 93 | } 94 | } 95 | 96 | - (void)didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean 97 | { 98 | if (self.onClose) { 99 | self.onClose(code, reason, wasClean); 100 | } 101 | } 102 | 103 | @end 104 | -------------------------------------------------------------------------------- /Source/BMModule/BrowserImg/PhotoBrowser/PBImageScrollView+internal.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBImageScrollView+internal.h 3 | // PhotoBrowser 4 | // 5 | // Created by Moch Xiao on 5/13/16. 6 | // Copyright © 2016 Moch Xiao (http://mochxiao.com). 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #ifndef PBImageScrollView_internal_h 28 | #define PBImageScrollView_internal_h 29 | 30 | #ifndef NSLog 31 | #if DEBUG 32 | #define NSLog(FORMAT, ...) \ 33 | do { \ 34 | fprintf(stderr,"<%s> %s %s [%d] %s\n", \ 35 | (NSThread.isMainThread ? "UI" : "BG"), \ 36 | (sel_getName(_cmd)),\ 37 | [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], \ 38 | __LINE__, \ 39 | [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]); \ 40 | } while(0) 41 | #else 42 | #define NSLog(FORMAT, ...) 43 | #endif 44 | #endif 45 | 46 | 47 | #import "PBImageScrollView.h" 48 | 49 | @interface PBImageScrollView() 50 | 51 | - (void)_handleZoomForLocation:(CGPoint)location; 52 | - (void)_scrollToTopAnimated:(BOOL)animated; 53 | 54 | /// Scrolling content offset'y percent. 55 | @property (nonatomic, copy) void(^contentOffSetVerticalPercentHandler)(CGFloat); 56 | 57 | /// loosen hand with decelerate 58 | /// velocity: > 0 up, < 0 dwon, == 0 others(no swipe, e.g. tap). 59 | @property (nonatomic, copy) void(^didEndDraggingInProperpositionHandler)(CGFloat velocity); 60 | 61 | @end 62 | 63 | 64 | #endif /* PBImageScrollView_internal_h */ 65 | -------------------------------------------------------------------------------- /Source/BMNetwork/JsResourceRequest/BMUpdateBundlejsRequest.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMUpdateBundlejsRequest.m 3 | // WeexDemo 4 | // 5 | // Created by XHY on 2017/1/10. 6 | // Copyright © 2017年 taobao. All rights reserved. 7 | // 8 | 9 | #import "BMUpdateBundlejsRequest.h" 10 | #import "BMDefine.h" 11 | #import "YTKNetworkPrivate.h" 12 | 13 | @implementation BMUpdateBundlejsRequest 14 | { 15 | NSString *_downloadUrl; 16 | } 17 | 18 | - (instancetype)initWithDownloadJSUrl:(NSString *)downloadUrl 19 | { 20 | if (self = [super init]) { 21 | _downloadUrl = downloadUrl; 22 | } 23 | 24 | return self; 25 | } 26 | 27 | - (NSString *)requestURLPath 28 | { 29 | return [NSURL URLWithString:_downloadUrl].path; 30 | } 31 | 32 | - (NSString *)baseUrl 33 | { 34 | return nil; 35 | } 36 | 37 | - (NSString *)requestUrl 38 | { 39 | return _downloadUrl; 40 | } 41 | 42 | - (NSString *)resumableDownloadPath 43 | { 44 | WXLogInfo(@"%@",K_JS_CACHE_PATH); 45 | return K_JS_CACHE_PATH; 46 | } 47 | 48 | /** 49 | 将当前下载的临时文件信息保存到指定目录 以便下次继续断点续传 50 | */ 51 | - (void)saveIncompleteDownloadTempData 52 | { 53 | if ([self.requestTask isKindOfClass:[NSURLSessionDownloadTask class]]) { 54 | 55 | NSURLSessionDownloadTask *downloadTask = (NSURLSessionDownloadTask *)self.requestTask; 56 | 57 | // __weak typeof(self) weakSelf = self; 58 | [downloadTask cancelByProducingResumeData:^(NSData * _Nullable resumeData) { 59 | // [resumeData writeToURL:[weakSelf incompleteDownloadTempPath] atomically:YES]; 60 | // 61 | // [downloadTask resume]; 62 | }]; 63 | 64 | } 65 | } 66 | 67 | - (NSURL *)incompleteDownloadTempPath 68 | { 69 | NSString *tempPath = nil; 70 | NSString *md5URLString = [YTKNetworkUtils md5StringFromString:[self resumableDownloadPath]]; 71 | tempPath = [[self incompleteDownloadTempCacheFolder] stringByAppendingPathComponent:md5URLString]; 72 | return [NSURL fileURLWithPath:tempPath]; 73 | } 74 | 75 | - (NSString *)incompleteDownloadTempCacheFolder 76 | { 77 | NSFileManager *fileManager = [NSFileManager new]; 78 | static NSString *cacheFolder; 79 | 80 | if (!cacheFolder) { 81 | NSString *cacheDir = NSTemporaryDirectory(); 82 | cacheFolder = [cacheDir stringByAppendingPathComponent:@"Incomplete"]; 83 | } 84 | 85 | NSError *error = nil; 86 | if(![fileManager createDirectoryAtPath:cacheFolder withIntermediateDirectories:YES attributes:nil error:&error]) { 87 | YTKLog(@"Failed to create cache directory at %@", cacheFolder); 88 | cacheFolder = nil; 89 | } 90 | return cacheFolder; 91 | } 92 | 93 | @end 94 | --------------------------------------------------------------------------------