├── Podfile ├── Podfile.lock ├── README.md ├── 智慧校园.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── doushuyao.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── doushuyao.xcuserdatad │ └── xcschemes │ ├── xcschememanagement.plist │ ├── 智慧校园.xcscheme │ ├── 智慧校园Watch (Notification).xcscheme │ └── 智慧校园Watch.xcscheme ├── 智慧校园.xcworkspace ├── contents.xcworkspacedata └── xcuserdata │ └── doushuyao.xcuserdatad │ ├── UserInterfaceState.xcuserstate │ └── xcdebugger │ └── Breakpoints_v2.xcbkptlist ├── 智慧校园 ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ └── LaunchScreen.storyboard ├── Images-2.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── oooooo120.png │ │ ├── oooooo24@2x.png │ │ ├── oooooo27.5@2x.png │ │ ├── oooooo29.png │ │ ├── oooooo29@2x.png │ │ ├── oooooo29@3x.png │ │ ├── oooooo40.png │ │ ├── oooooo40@2x.png │ │ ├── oooooo44@2x.png │ │ ├── oooooo57.png │ │ ├── oooooo57@2x.png │ │ ├── oooooo60.png │ │ ├── oooooo60@2x.png │ │ ├── oooooo60@3x.png │ │ ├── oooooo86@2x.png │ │ └── oooooo98@2x.png ├── Images.xcassets │ ├── Contents.json │ ├── LaunchImage.launchimage │ │ ├── Contents.json │ │ └── wh.png │ ├── cet.imageset │ │ ├── Contents.json │ │ └── cet.png │ ├── pm25.imageset │ │ ├── Contents.json │ │ └── pm25.png │ ├── qianlogo.imageset │ │ ├── Contents.json │ │ └── qianlogo.png │ ├── qiqiu.imageset │ │ ├── Contents.json │ │ └── qiqiu.png │ ├── saoyisao.imageset │ │ ├── Contents.json │ │ └── saoyisao.png │ ├── saoyisao1.imageset │ │ ├── Contents.json │ │ └── saoyisao1.png │ ├── saoyisao2.imageset │ │ ├── Contents.json │ │ └── saoyisao2.png │ ├── shu.imageset │ │ ├── Contents.json │ │ └── shu.png │ ├── taobao.imageset │ │ ├── Contents.json │ │ └── taobao.png │ ├── wangyiyun.imageset │ │ ├── Contents.json │ │ └── wangyiyun.png │ ├── wh.imageset │ │ ├── Contents.json │ │ └── wh.png │ └── xiao.imageset │ │ ├── Contents.json │ │ └── xiao.png ├── Info.plist ├── Login(登录) │ ├── DJRegisterView │ │ ├── DJRegisterView.h │ │ ├── DJRegisterView.m │ │ └── images │ │ │ ├── UpdataController.h │ │ │ ├── UpdataController.m │ │ │ ├── dvq.png │ │ │ ├── irn.png │ │ │ ├── irv.png │ │ │ ├── label_phone.png │ │ │ ├── textfield_activated_holo_light.9.png │ │ │ └── textfield_default_holo_light.9.png │ ├── Info.h │ ├── Info.m │ ├── LoginController.h │ ├── LoginController.m │ ├── RegisterController.h │ ├── RegisterController.m │ ├── SearchController.h │ ├── SearchController.m │ ├── SetpwdController.h │ └── SetpwdController.m ├── Main(首页) │ ├── Controller │ │ ├── MainController.h │ │ ├── MainController.m │ │ ├── PMController.h │ │ ├── PMController.m │ │ ├── WeatherViewController.h │ │ ├── WeatherViewController.m │ │ ├── rebotController.h │ │ └── rebotController.m │ ├── Model │ │ ├── ToolData.plist │ │ ├── ToolModel.h │ │ └── ToolModel.m │ └── VIew │ │ ├── MainHeadScrollView.h │ │ ├── MainHeadScrollView.m │ │ ├── ToolButtonView.h │ │ └── ToolButtonView.m ├── Me(我) │ ├── Controller │ │ ├── MeController.h │ │ └── MeController.m │ └── View │ │ ├── DSYPhotoHelper.h │ │ ├── DSYPhotoHelper.m │ │ ├── headBtn.h │ │ ├── headBtn.m │ │ ├── meTableHeadView.h │ │ ├── meTableHeadView.m │ │ ├── meTableViewCell.h │ │ ├── meTableViewCell.m │ │ └── meTableViewCell.xib ├── Other │ ├── Image │ │ ├── cet.png │ │ ├── icon-calendar.png │ │ ├── robot.png │ │ └── weather.png │ ├── LPDQuoteImagesView │ │ ├── Assets │ │ │ ├── .gitkeep │ │ │ └── LPDImagePickerController.bundle │ │ │ │ ├── AlbumAddBtn.png │ │ │ │ ├── AlbumAddBtn@1.5x.png │ │ │ │ ├── AlbumAddBtn@1x.png │ │ │ │ ├── LPDVideoPreviewPlay@2x.png │ │ │ │ ├── LPDVideoPreviewPlayHL@2x.png │ │ │ │ ├── Root.plist │ │ │ │ ├── TableViewArrow@2x.png │ │ │ │ ├── VideoSendIcon@2x.png │ │ │ │ ├── en.lproj │ │ │ │ └── Localizable.strings │ │ │ │ ├── navi_back@2x.png │ │ │ │ ├── nookDeleteBtn.png │ │ │ │ ├── nookDeleteBtn@2x.png │ │ │ │ ├── nookDeleteBtn@3x.png │ │ │ │ ├── photo_def_photoPickerVc@2x.png │ │ │ │ ├── photo_number_icon@2x.png │ │ │ │ ├── photo_original_def@2x.png │ │ │ │ ├── photo_original_sel@2x.png │ │ │ │ ├── photo_sel_photoPickerVc@2x.png │ │ │ │ ├── preview_original_def@2x.png │ │ │ │ ├── takePicture@2x.png │ │ │ │ └── zh-Hans.lproj │ │ │ │ └── Localizable.strings │ │ └── Classes │ │ │ ├── .gitkeep │ │ │ ├── LPDAssetCell.h │ │ │ ├── LPDAssetCell.m │ │ │ ├── LPDAssetModel.h │ │ │ ├── LPDAssetModel.m │ │ │ ├── LPDImageManager.h │ │ │ ├── LPDImageManager.m │ │ │ ├── LPDImagePickerController.h │ │ │ ├── LPDImagePickerController.m │ │ │ ├── LPDPhotoArrangeCVlLayout.h │ │ │ ├── LPDPhotoArrangeCVlLayout.m │ │ │ ├── LPDPhotoArrangeCell.h │ │ │ ├── LPDPhotoArrangeCell.m │ │ │ ├── LPDPhotoPickerController.h │ │ │ ├── LPDPhotoPickerController.m │ │ │ ├── LPDPhotoPreviewCell.h │ │ │ ├── LPDPhotoPreviewCell.m │ │ │ ├── LPDPhotoPreviewController.h │ │ │ ├── LPDPhotoPreviewController.m │ │ │ ├── LPDProgressView.h │ │ │ ├── LPDProgressView.m │ │ │ ├── LPDQuoteImagesView.h │ │ │ ├── LPDQuoteImagesView.m │ │ │ ├── LPDVideoPlayerController.h │ │ │ ├── LPDVideoPlayerController.m │ │ │ ├── NSBundle+LPDImagePicker.h │ │ │ ├── NSBundle+LPDImagePicker.m │ │ │ ├── UIImage+MyBundle.h │ │ │ ├── UIImage+MyBundle.m │ │ │ ├── UIView+HandyValue.h │ │ │ └── UIView+HandyValue.m │ ├── OHMySQL │ │ ├── Categories │ │ │ ├── NSNumber+OHSerialization.h │ │ │ ├── NSNumber+OHSerialization.m │ │ │ ├── NSObject+Mapping.h │ │ │ ├── NSObject+Mapping.m │ │ │ ├── NSString+Escaping.h │ │ │ ├── NSString+Escaping.m │ │ │ ├── NSString+OHSerialization.h │ │ │ ├── NSString+OHSerialization.m │ │ │ ├── NSString+Utility.h │ │ │ └── NSString+Utility.m │ │ ├── Constants │ │ │ ├── OHCharsetEncoding.h │ │ │ ├── OHCharsetEncoding.m │ │ │ ├── OHConstants.h │ │ │ ├── OHJoinConstants.h │ │ │ ├── OHJoinConstants.m │ │ │ ├── OHLogging.h │ │ │ ├── OHProtocolType.h │ │ │ ├── OHRefreshOptions.h │ │ │ └── OHResultErrorType.h │ │ ├── Models │ │ │ ├── OHMySQLQueryRequest.h │ │ │ ├── OHMySQLQueryRequest.m │ │ │ ├── OHMySQLStore.h │ │ │ ├── OHMySQLStore.m │ │ │ ├── OHMySQLTimeline.h │ │ │ ├── OHMySQLTimeline.m │ │ │ ├── OHMySQLUser.h │ │ │ ├── OHMySQLUser.m │ │ │ ├── OHSSLConfig.h │ │ │ └── OHSSLConfig.m │ │ ├── OHMappingProtocol.h │ │ ├── OHMySQL.h │ │ ├── OHMySQLContainer.h │ │ ├── OHMySQLContainer.m │ │ ├── OHMySQLQueryContext.h │ │ ├── OHMySQLQueryContext.m │ │ ├── OHMySQLQueryRequestFactory.h │ │ ├── OHMySQLQueryRequestFactory.m │ │ ├── OHMySQLSerialization.h │ │ ├── OHMySQLSerialization.m │ │ ├── OHMySQLStoreCoordinator.h │ │ ├── OHMySQLStoreCoordinator.m │ │ ├── OHSerializationProtocol.h │ │ └── lib │ │ │ ├── include │ │ │ ├── big_endian.h │ │ │ ├── binary_log_types.h │ │ │ ├── byte_order_generic.h │ │ │ ├── byte_order_generic_x86.h │ │ │ ├── decimal.h │ │ │ ├── errmsg.h │ │ │ ├── keycache.h │ │ │ ├── little_endian.h │ │ │ ├── m_ctype.h │ │ │ ├── m_string.h │ │ │ ├── my_alloc.h │ │ │ ├── my_byteorder.h │ │ │ ├── my_command.h │ │ │ ├── my_compiler.h │ │ │ ├── my_config.h │ │ │ ├── my_dbug.h │ │ │ ├── my_dir.h │ │ │ ├── my_getopt.h │ │ │ ├── my_global.h │ │ │ ├── my_list.h │ │ │ ├── my_sys.h │ │ │ ├── my_thread.h │ │ │ ├── my_thread_local.h │ │ │ ├── my_xml.h │ │ │ ├── mysql.h │ │ │ ├── mysql │ │ │ │ ├── client_authentication.h │ │ │ │ ├── client_plugin.h │ │ │ │ ├── client_plugin.h.pp │ │ │ │ ├── get_password.h │ │ │ │ ├── mysql_lex_string.h │ │ │ │ ├── plugin_auth_common.h │ │ │ │ ├── plugin_trace.h │ │ │ │ ├── psi │ │ │ │ │ ├── mysql_file.h │ │ │ │ │ ├── mysql_idle.h │ │ │ │ │ ├── mysql_mdl.h │ │ │ │ │ ├── mysql_memory.h │ │ │ │ │ ├── mysql_ps.h │ │ │ │ │ ├── mysql_socket.h │ │ │ │ │ ├── mysql_sp.h │ │ │ │ │ ├── mysql_stage.h │ │ │ │ │ ├── mysql_statement.h │ │ │ │ │ ├── mysql_table.h │ │ │ │ │ ├── mysql_thread.h │ │ │ │ │ ├── mysql_transaction.h │ │ │ │ │ ├── psi.h │ │ │ │ │ ├── psi_base.h │ │ │ │ │ └── psi_memory.h │ │ │ │ ├── service_my_snprintf.h │ │ │ │ └── service_mysql_alloc.h │ │ │ ├── mysql_com.h │ │ │ ├── mysql_com_server.h │ │ │ ├── mysql_embed.h │ │ │ ├── mysql_time.h │ │ │ ├── mysql_version.h │ │ │ ├── mysqld_ername.h │ │ │ ├── mysqld_error.h │ │ │ ├── sql_common.h │ │ │ ├── sql_state.h │ │ │ ├── sslopt-case.h │ │ │ ├── sslopt-longopts.h │ │ │ ├── sslopt-vars.h │ │ │ ├── thr_cond.h │ │ │ ├── thr_mutex.h │ │ │ ├── thr_rwlock.h │ │ │ └── typelib.h │ │ │ ├── ios │ │ │ └── libmysqlclient.a │ │ │ └── mac │ │ │ └── libmysqlclient.a │ ├── QRCode │ │ ├── HMScanerCardViewController.h │ │ ├── HMScanerCardViewController.m │ │ ├── HMScanner.bundle │ │ │ ├── QRCodeScanLine@2x.png │ │ │ ├── ScanQR1@2x.png │ │ │ ├── ScanQR2@2x.png │ │ │ ├── ScanQR3@2x.png │ │ │ └── ScanQR4@2x.png │ │ ├── HMScanner.h │ │ ├── HMScanner.m │ │ ├── HMScannerBorder.h │ │ ├── HMScannerBorder.m │ │ ├── HMScannerController.h │ │ ├── HMScannerController.m │ │ ├── HMScannerMaskView.h │ │ ├── HMScannerMaskView.m │ │ ├── HMScannerViewController.h │ │ └── HMScannerViewController.m │ ├── STPickerView │ │ ├── FramewordInfo │ │ │ └── Info.plist │ │ ├── Resource │ │ │ └── area.plist │ │ └── STPickerView │ │ │ ├── NSCalendar+STPicker.h │ │ │ ├── NSCalendar+STPicker.m │ │ │ ├── STPickerArea.h │ │ │ ├── STPickerArea.m │ │ │ ├── STPickerDate.h │ │ │ ├── STPickerDate.m │ │ │ ├── STPickerSingle.h │ │ │ ├── STPickerSingle.m │ │ │ ├── STPickerView.h │ │ │ ├── STPickerView.m │ │ │ ├── STPickerViewUI.h │ │ │ ├── STPickerViewUI.m │ │ │ ├── UIView+STPicker.h │ │ │ └── UIView+STPicker.m │ ├── UIImage+Image.h │ ├── UIImage+Image.m │ └── 网页封装 │ │ ├── CFNavaigationViewWeb.h │ │ ├── CFNavaigationViewWeb.m │ │ ├── CFWebViewController.h │ │ ├── CFWebViewController.m │ │ ├── NJKWebViewProgress │ │ ├── NJKWebViewProgress.h │ │ ├── NJKWebViewProgress.m │ │ ├── NJKWebViewProgressView.h │ │ └── NJKWebViewProgressView.m │ │ ├── UIColor+FlatColors.h │ │ └── UIColor+FlatColors.m ├── PrefixHeader.pch ├── Setting(维修中) │ └── Controller │ │ ├── SettingController.h │ │ └── SettingController.m ├── Tab(导航) │ └── Controller │ │ ├── TabBarController.h │ │ └── TabBarController.m ├── TableViewCell.h ├── TableViewCell.m ├── TableViewCell.xib ├── image │ ├── Main │ │ └── Head │ │ │ ├── qf1.jpg │ │ │ ├── qf2.jpg │ │ │ ├── qf3.jpg │ │ │ ├── qf4.jpg │ │ │ └── qf5.jpg │ ├── TabBar │ │ ├── main.png │ │ ├── mine.png │ │ ├── service.png │ │ ├── setting.png │ │ ├── smain.png │ │ ├── smine.png │ │ ├── sservice.png │ │ ├── ssetting.png │ │ ├── swait.png │ │ └── wait.png │ ├── back │ │ ├── Clock@2x.png │ │ ├── Clock@3x.png │ │ ├── Portrait.png │ │ ├── Share@2x.png │ │ ├── Share@3x.png │ │ └── backImage.png │ ├── snow.png │ └── unshow.jpg ├── main.m └── wait(待维修) │ └── Controller │ ├── AchieveController.h │ ├── AchieveController.m │ ├── WaitController.h │ └── WaitController.m ├── 智慧校园Tests ├── Info.plist └── ____Tests.m ├── 智慧校园UITests ├── Info.plist └── ____UITests.m ├── 智慧校园Watch Extension ├── Assets.xcassets │ ├── Complication.complicationset │ │ ├── Circular.imageset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── Extra Large.imageset │ │ │ └── Contents.json │ │ ├── Modular.imageset │ │ │ └── Contents.json │ │ └── Utilitarian.imageset │ │ │ └── Contents.json │ └── Contents.json ├── ExtensionDelegate.h ├── ExtensionDelegate.m ├── Info.plist ├── InterfaceController.h ├── InterfaceController.m ├── NotificationController.h ├── NotificationController.m └── PushNotificationPayload.apns └── 智慧校园Watch ├── Base.lproj └── Interface.storyboard └── Info.plist /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target '智慧校园' do 5 | # Uncomment the next line if you're using Swift or would like to use dynamic frameworks 6 | # use_frameworks! 7 | pod 'MBProgressHUD' 8 | 9 | pod 'BmobSDK' 10 | pod ‘UMengUShare/UI’ 11 | pod ‘UMengUShare/Social/ReducedWeChat' 12 | pod ‘UMengUShare/Social/ReducedQQ' 13 | pod ‘UMengUShare/Social/ReducedSina' 14 | pod 'AFNetworking' 15 | 16 | pod 'SDWebImage', '~> 4.0' 17 | 18 | # Pods for 智慧校园 19 | 20 | target '智慧校园Tests' do 21 | inherit! :search_paths 22 | # Pods for testing 23 | end 24 | 25 | target '智慧校园UITests' do 26 | inherit! :search_paths 27 | # Pods for testing 28 | end 29 | 30 | 31 | end 32 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (3.1.0): 3 | - AFNetworking/NSURLSession (= 3.1.0) 4 | - AFNetworking/Reachability (= 3.1.0) 5 | - AFNetworking/Security (= 3.1.0) 6 | - AFNetworking/Serialization (= 3.1.0) 7 | - AFNetworking/UIKit (= 3.1.0) 8 | - AFNetworking/NSURLSession (3.1.0): 9 | - AFNetworking/Reachability 10 | - AFNetworking/Security 11 | - AFNetworking/Serialization 12 | - AFNetworking/Reachability (3.1.0) 13 | - AFNetworking/Security (3.1.0) 14 | - AFNetworking/Serialization (3.1.0) 15 | - AFNetworking/UIKit (3.1.0): 16 | - AFNetworking/NSURLSession 17 | - BmobSDK (2.1.7) 18 | - MBProgressHUD (1.0.0) 19 | - SDWebImage (4.0.0): 20 | - SDWebImage/Core (= 4.0.0) 21 | - SDWebImage/Core (4.0.0) 22 | - UMengUShare/Core (6.4.1): 23 | - UMengUShare/Network 24 | - UMengUShare/Network (6.4.1) 25 | - UMengUShare/Social/ReducedQQ (6.4.1): 26 | - UMengUShare/Core 27 | - UMengUShare/Social/ReducedSina (6.4.1): 28 | - UMengUShare/Core 29 | - UMengUShare/Social/ReducedWeChat (6.4.1): 30 | - UMengUShare/Core 31 | - UMengUShare/UI (6.4.1): 32 | - UMengUShare/Core 33 | 34 | DEPENDENCIES: 35 | - AFNetworking 36 | - BmobSDK 37 | - MBProgressHUD 38 | - SDWebImage (~> 4.0) 39 | - UMengUShare/Social/ReducedQQ 40 | - UMengUShare/Social/ReducedSina 41 | - UMengUShare/Social/ReducedWeChat 42 | - UMengUShare/UI 43 | 44 | SPEC CHECKSUMS: 45 | AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 46 | BmobSDK: 23cbfbde2a7cfaeb0c8a946953a266fe5211e7f6 47 | MBProgressHUD: 4890f671c94e8a0f3cf959aa731e9de2f036d71a 48 | SDWebImage: 76a6348bdc74eb5a55dd08a091ef298e56b55e41 49 | UMengUShare: 7756e2e46ceba04e3000fb2c9b1d3f61784ca2ff 50 | 51 | PODFILE CHECKSUM: 02fd16bb0bd11af644ac77af56b9399e3f921fd2 52 | 53 | COCOAPODS: 1.2.0 54 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SmartCampus -智慧校园 2 | [![Support](https://img.shields.io/badge/support-iOS%208%2B%20-blue.svg?style=flat)](https://www.apple.com/nl/ios/) 3 | ![](https://img.shields.io/badge/lanuage-Objective--C-brightgreen.svg) 4 | ![](https://img.shields.io/badge/license-apache-green.svg) 5 | ![](https://img.shields.io/badge/SQL-mysql-blue.svg) 6 | ![](https://img.shields.io/badge/system-watchOS-yellowgreen.svg) 7 | ![](https://img.shields.io/badge/system-iOS-yellowgreen.svg) 8 | 9 | 10 | > 智慧校园App是由追梦人团队开发,iOS,watchOS 由opooc开发,志于帮助同学们更加便捷的提交报修信息,查询报修,以及督促学生认真到课堂学习。 11 | 12 | ## 设计功能: 13 | ### 首页 14 | - 展示图 15 | - 每日一言 16 | - 校历 17 | - 智能问答 18 | - 天气查询 19 | - 四六级查询 20 | - PM2.5查询 21 | - 校园支付 22 | - 手机淘宝网页 23 | - 网易云音乐网页 24 | 25 | 26 | ### 提交维修 27 | - 提交报修(类型,地点,图片) 28 | - watchOS端获取提交信息 29 | 30 | 31 | ### 二维码点名 32 | - 学号绑定 33 | - 二维码绑定 34 | - 指纹绑定 35 | 36 | 37 | ### 维修情况 38 | - 维修情况(拿到数据并展示) 39 | 40 | 41 | ### 个人中心 42 | - 退出 43 | - 分享 44 | - 个性签名 45 | - 头像 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /智慧校园.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /智慧校园.xcodeproj/project.xcworkspace/xcuserdata/doushuyao.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园.xcodeproj/project.xcworkspace/xcuserdata/doushuyao.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /智慧校园.xcodeproj/xcuserdata/doushuyao.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | 智慧校园.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 智慧校园Watch (Notification).xcscheme 13 | 14 | orderHint 15 | 6 16 | 17 | 智慧校园Watch.xcscheme 18 | 19 | orderHint 20 | 5 21 | 22 | 23 | SuppressBuildableAutocreation 24 | 25 | CB2485DE1F6A30A20034C09B 26 | 27 | primary 28 | 29 | 30 | CB7A84FD1ECA7E3200955407 31 | 32 | primary 33 | 34 | 35 | CB7A85161ECA7E3300955407 36 | 37 | primary 38 | 39 | 40 | CB7A85211ECA7E3300955407 41 | 42 | primary 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /智慧校园.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /智慧校园.xcworkspace/xcuserdata/doushuyao.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园.xcworkspace/xcuserdata/doushuyao.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /智慧校园/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // 智慧校园 4 | // 5 | // Created by doushuyao on 17/5/16. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo120.png -------------------------------------------------------------------------------- /智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo24@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo24@2x.png -------------------------------------------------------------------------------- /智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo27.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo27.5@2x.png -------------------------------------------------------------------------------- /智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo29.png -------------------------------------------------------------------------------- /智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo29@2x.png -------------------------------------------------------------------------------- /智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo29@3x.png -------------------------------------------------------------------------------- /智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo40.png -------------------------------------------------------------------------------- /智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo40@2x.png -------------------------------------------------------------------------------- /智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo44@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo44@2x.png -------------------------------------------------------------------------------- /智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo57.png -------------------------------------------------------------------------------- /智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo57@2x.png -------------------------------------------------------------------------------- /智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo60.png -------------------------------------------------------------------------------- /智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo60@2x.png -------------------------------------------------------------------------------- /智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo60@3x.png -------------------------------------------------------------------------------- /智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo86@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo86@2x.png -------------------------------------------------------------------------------- /智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo98@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images-2.xcassets/AppIcon.appiconset/oooooo98@2x.png -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "filename" : "wh.png", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "minimum-system-version" : "7.0", 14 | "subtype" : "retina4", 15 | "scale" : "2x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/LaunchImage.launchimage/wh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images.xcassets/LaunchImage.launchimage/wh.png -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/cet.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "cet.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/cet.imageset/cet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images.xcassets/cet.imageset/cet.png -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/pm25.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "pm25.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/pm25.imageset/pm25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images.xcassets/pm25.imageset/pm25.png -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/qianlogo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "qianlogo.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/qianlogo.imageset/qianlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images.xcassets/qianlogo.imageset/qianlogo.png -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/qiqiu.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "qiqiu.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/qiqiu.imageset/qiqiu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images.xcassets/qiqiu.imageset/qiqiu.png -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/saoyisao.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "saoyisao.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/saoyisao.imageset/saoyisao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images.xcassets/saoyisao.imageset/saoyisao.png -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/saoyisao1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "saoyisao1.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/saoyisao1.imageset/saoyisao1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images.xcassets/saoyisao1.imageset/saoyisao1.png -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/saoyisao2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "saoyisao2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/saoyisao2.imageset/saoyisao2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images.xcassets/saoyisao2.imageset/saoyisao2.png -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/shu.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "shu.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/shu.imageset/shu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images.xcassets/shu.imageset/shu.png -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/taobao.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "taobao.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/taobao.imageset/taobao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images.xcassets/taobao.imageset/taobao.png -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/wangyiyun.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "wangyiyun.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/wangyiyun.imageset/wangyiyun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images.xcassets/wangyiyun.imageset/wangyiyun.png -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/wh.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "wh.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/wh.imageset/wh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images.xcassets/wh.imageset/wh.png -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/xiao.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "xiao.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /智慧校园/Images.xcassets/xiao.imageset/xiao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Images.xcassets/xiao.imageset/xiao.png -------------------------------------------------------------------------------- /智慧校园/Login(登录)/DJRegisterView/DJRegisterView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DJRegisterView.h 3 | // DJRegisterView 4 | // 5 | // Created by asios on 15/8/14. 6 | // Copyright (c) 2015年 LiangDaHong. All rights reserved. 7 | // 8 | // 9 | // 第一次写 '库' 多多包涵 10 | // 邮箱: asiosldh@163.com 11 | // 12 | 13 | #import 14 | 15 | 16 | typedef enum : NSUInteger { 17 | DJRegisterViewTypeNoNav, // 登录界面(没导航条) 18 | DJRegisterViewTypeNav, // 登录界面(有导航条) 19 | } DJRegisterViewType; 20 | 21 | typedef enum : NSUInteger { 22 | DJRegisterViewTypeScanfPhoneSMS, // 输入手机号 获取验证码 23 | DJRegisterViewTypeNoScanfSMS, // 找回密码 () 24 | } DJRegisterViewTypeSMS; 25 | 26 | 27 | 28 | @interface DJRegisterView : UIView 29 | 30 | // 登录界面 31 | - (instancetype )initwithFrame:(CGRect)frame 32 | djRegisterViewType:(DJRegisterViewType)djRegisterViewType //类型 33 | action:(void (^)(NSString *acc,NSString *key))action // 点击登录的回调block 34 | zcAction:(void (^)(void))zcAction // 点击注册的回调block 35 | wjAction:(void (^)(void))wjAction; // 点击忘记的回调block 36 | 37 | 38 | // 1.找回密码 (界面) 2.输入手机号获取验证码界面 39 | - (instancetype )initwithFrame:(CGRect)frame 40 | djRegisterViewTypeSMS:(DJRegisterViewTypeSMS)djRegisterViewTypeSMS //类型 41 | plTitle:(NSString *)plTitle // 填写验证码 的提示文字 42 | title:(NSString *)title // 填写验证码 的提示文字 43 | phoneholder:(NSString *)phoneholder 44 | hq:(BOOL (^)(NSString *phoneStr))hqAction // 获取验证码的 回调block(返回是否获取成功,phoneStr:输入的手机号) 45 | tjAction:(void (^)(NSString *phoneStr,NSString *yzmStr))tjAction; // 点击提交的回调block 46 | 47 | // (设置密码界面) 48 | - (instancetype )initwithFrame:(CGRect)frame 49 | action:(void (^)(NSString *key1,NSString *key2,NSString* phoneStr))action; 50 | 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /智慧校园/Login(登录)/DJRegisterView/images/UpdataController.h: -------------------------------------------------------------------------------- 1 | // 2 | // UpdataController.h 3 | // 智慧校园 4 | // 5 | // Created by doushuyao on 17/5/26. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UpdataController : UIViewController 12 | @property(nonatomic,copy)NSString* UPhoneNum; 13 | @property(nonatomic,copy)NSString* UyzmNum; 14 | @end 15 | -------------------------------------------------------------------------------- /智慧校园/Login(登录)/DJRegisterView/images/dvq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Login(登录)/DJRegisterView/images/dvq.png -------------------------------------------------------------------------------- /智慧校园/Login(登录)/DJRegisterView/images/irn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Login(登录)/DJRegisterView/images/irn.png -------------------------------------------------------------------------------- /智慧校园/Login(登录)/DJRegisterView/images/irv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Login(登录)/DJRegisterView/images/irv.png -------------------------------------------------------------------------------- /智慧校园/Login(登录)/DJRegisterView/images/label_phone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Login(登录)/DJRegisterView/images/label_phone.png -------------------------------------------------------------------------------- /智慧校园/Login(登录)/DJRegisterView/images/textfield_activated_holo_light.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Login(登录)/DJRegisterView/images/textfield_activated_holo_light.9.png -------------------------------------------------------------------------------- /智慧校园/Login(登录)/DJRegisterView/images/textfield_default_holo_light.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Login(登录)/DJRegisterView/images/textfield_default_holo_light.9.png -------------------------------------------------------------------------------- /智慧校园/Login(登录)/Info.h: -------------------------------------------------------------------------------- 1 | // 2 | // Info.h 3 | // 智慧校园 4 | // 5 | // Created by doushuyao on 2017/9/11. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Info : NSObject 12 | 13 | @property (nonatomic, copy) NSString *Username; //用户名 14 | + (Info *)sharedInstance;//单例方法 15 | -(void)save:(NSString *)user; 16 | -(NSString *)getUser; 17 | 18 | -(void)savenum:(NSString *)num; 19 | -(NSString *)getnum; 20 | 21 | -(void)savexue:(NSString *)xue; 22 | -(NSString *)getxue; 23 | @end 24 | -------------------------------------------------------------------------------- /智慧校园/Login(登录)/Info.m: -------------------------------------------------------------------------------- 1 | // 2 | // Info.m 3 | // 智慧校园 4 | // 5 | // Created by doushuyao on 2017/9/11. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import "Info.h" 10 | 11 | @implementation Info 12 | 13 | + (Info *)sharedInstance 14 | { 15 | static Info *sharedManagerInstance = nil; 16 | static dispatch_once_t predicate; 17 | dispatch_once(&predicate, ^{ 18 | sharedManagerInstance = [[self alloc] init]; 19 | }); 20 | return sharedManagerInstance; 21 | } 22 | 23 | - (void)save:(NSString *)user{ 24 | NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; 25 | 26 | [ud setObject:user forKey:@"username"]; 27 | [ud synchronize]; 28 | } 29 | 30 | -(NSString *)getUser{ 31 | NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; 32 | NSString *us=@""; 33 | if([ud objectForKey:@"username"]){ 34 | us=[ud objectForKey:@"username"]; 35 | } 36 | return us; 37 | } 38 | 39 | - (void)savenum:(NSString *)num{ 40 | NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; 41 | 42 | [ud setObject:num forKey:@"num"]; 43 | [ud synchronize]; 44 | } 45 | 46 | -(NSString *)getnum{ 47 | NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; 48 | NSString *us=@""; 49 | if([ud objectForKey:@"num"]){ 50 | us=[ud objectForKey:@"num"]; 51 | } 52 | return us; 53 | } 54 | 55 | -(void)savexue:(NSString *)xue{ 56 | NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; 57 | 58 | [ud setObject:xue forKey:@"xue"]; 59 | [ud synchronize]; 60 | 61 | } 62 | -(NSString *)getxue{ 63 | 64 | NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; 65 | NSString *us=@""; 66 | if([ud objectForKey:@"xue"]){ 67 | us=[ud objectForKey:@"xue"]; 68 | } 69 | return us; 70 | } 71 | @end 72 | -------------------------------------------------------------------------------- /智慧校园/Login(登录)/LoginController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoginController.h 3 | // 智慧校园 4 | // 5 | // Created by doushuyao on 17/5/23. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LoginController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /智慧校园/Login(登录)/RegisterController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RegisterController.h 3 | // 智慧校园 4 | // 5 | // Created by doushuyao on 17/5/25. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RegisterController : UIViewController 12 | 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /智慧校园/Login(登录)/SearchController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SearchController.h 3 | // 智慧校园 4 | // 5 | // Created by doushuyao on 17/5/25. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SearchController : UIViewController 12 | @property(nonatomic,copy)NSString* SPhoneNum; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /智慧校园/Login(登录)/SetpwdController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SetpwdController.h 3 | // 智慧校园 4 | // 5 | // Created by doushuyao on 17/5/25. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SetpwdController : UIViewController 12 | @property(nonatomic,copy)NSString* PhoneNum; 13 | @end 14 | -------------------------------------------------------------------------------- /智慧校园/Main(首页)/Controller/MainController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainController.h 3 | // 智慧校园 4 | // 5 | // Created by doushuyao on 2017/9/7. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MainController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /智慧校园/Main(首页)/Controller/PMController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PMController.h 3 | // 智慧校园 4 | // 5 | // Created by doushuyao on 2017/9/15. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PMController : UIViewController 12 | 13 | @property(nonatomic,strong)UITextField* area; 14 | @property(nonatomic,strong)UILabel* week; 15 | @property(nonatomic,strong)UILabel* weather; 16 | @property(nonatomic,strong)UILabel* winddirect; 17 | @property(nonatomic,strong)UILabel* temphigh; 18 | @property(nonatomic,strong)UILabel* templow; 19 | @property(nonatomic,strong)UILabel* temp; 20 | @property(nonatomic,strong)UILabel* sport; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /智慧校园/Main(首页)/Controller/WeatherViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // weatherViewController.h 3 | // iOSClientOfQFNU 4 | // 5 | // Created by doushuyao on 2017/8/23. 6 | // Copyright © 2017年 iOSClientOfQFNU. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface WeatherViewController : UIViewController 13 | 14 | @property(nonatomic,strong)UITextField* area; 15 | @property(nonatomic,strong)UILabel* week; 16 | @property(nonatomic,strong)UILabel* weather; 17 | @property(nonatomic,strong)UILabel* winddirect; 18 | @property(nonatomic,strong)UILabel* temphigh; 19 | @property(nonatomic,strong)UILabel* templow; 20 | @property(nonatomic,strong)UILabel* temp; 21 | @property(nonatomic,strong)UILabel* sport; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /智慧校园/Main(首页)/Controller/rebotController.h: -------------------------------------------------------------------------------- 1 | // 2 | // rebotController.h 3 | // iOSClientOfQFNU 4 | // 5 | // Created by doushuyao on 2017/8/27. 6 | // Copyright © 2017年 iOSClientOfQFNU. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface rebotController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /智慧校园/Main(首页)/Model/ToolData.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | icon 7 | cet.png 8 | name 9 | 四六级 10 | 11 | 12 | icon 13 | icon-calendar.png 14 | name 15 | 校历 16 | 17 | 18 | icon 19 | weather.png 20 | name 21 | 天气 22 | 23 | 24 | icon 25 | robot.png 26 | name 27 | 智能回答 28 | 29 | 30 | icon 31 | pm25.png 32 | name 33 | PM2.5 34 | 35 | 36 | icon 37 | xiao.png 38 | name 39 | 校园支付 40 | 41 | 42 | icon 43 | taobao.png 44 | name 45 | 手机淘宝 46 | 47 | 48 | icon 49 | wangyiyun.png 50 | name 51 | 网易云音乐 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /智慧校园/Main(首页)/Model/ToolModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // ToolModel.h 3 | // iOSClientOfQFNU 4 | // 5 | // Created by doushuyao on 2017/8/22. 6 | // Copyright © 2017年 iOSClientOfQFNU. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ToolModel : NSObject 12 | 13 | @property(nonatomic,copy)NSString* name; 14 | @property(nonatomic,copy)NSString* icon; 15 | 16 | -(instancetype)initWithDict:(NSDictionary*)dic; 17 | +(instancetype)btnWihtDict:(NSDictionary*)dic; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /智慧校园/Main(首页)/Model/ToolModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // ToolModel.m 3 | // iOSClientOfQFNU 4 | // 5 | // Created by doushuyao on 2017/8/22. 6 | // Copyright © 2017年 iOSClientOfQFNU. All rights reserved. 7 | // 8 | 9 | #import "ToolModel.h" 10 | 11 | @implementation ToolModel 12 | 13 | -(instancetype)initWithDict:(NSDictionary*)dic{ 14 | if (self = [super init]) { 15 | 16 | self.icon = dic[@"icon"]; 17 | self.name = dic[@"name"]; 18 | 19 | } 20 | return self; 21 | 22 | } 23 | 24 | +(instancetype)btnWihtDict:(NSDictionary*)dic{ 25 | 26 | return [[self alloc]initWithDict:dic]; 27 | } 28 | 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /智慧校园/Main(首页)/VIew/MainHeadScrollView.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainHeadScrollView.h 3 | // iOSClientOfQFNU 4 | // 5 | // Created by doushuyao on 17/6/10. 6 | // Copyright © 2017年 iOSClientOfQFNU. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void (^TapImageViewBlock)(NSInteger tag); 12 | 13 | @interface MainHeadScrollView : UIView 14 | 15 | @property (strong, nonatomic) UIScrollView *scrollView; 16 | /** 17 | 分页指示器 18 | */ 19 | @property (strong, nonatomic) UIPageControl *pageControl; 20 | 21 | @property (nonatomic,strong) UIImageView *imageView; 22 | 23 | //定时器 24 | @property (nonatomic, strong) NSTimer *timer; 25 | 26 | @property (nonatomic,strong) TapImageViewBlock tapImageBlock; 27 | 28 | -(void) tapImageViewBlock:(TapImageViewBlock)tapImageBlock; 29 | 30 | -(instancetype)initWithFrame:(CGRect)frame ImagesCount:(NSInteger )ImageCount; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /智慧校园/Main(首页)/VIew/ToolButtonView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ToolButtonView.h 3 | // iOSClientOfQFNU 4 | // 5 | // Created by doushuyao on 2017/8/22. 6 | // Copyright © 2017年 iOSClientOfQFNU. All rights reserved. 7 | // 8 | 9 | #import 10 | @class ToolModel; 11 | 12 | @interface ToolButtonView : UIView 13 | 14 | @property(nonatomic,strong)ToolModel* btnmodel; 15 | @property(nonatomic,weak)UIButton* btn; 16 | @property(nonatomic,weak)UILabel* label; 17 | 18 | 19 | -(instancetype)initWithModel:(ToolModel*)btnmodel; 20 | +(instancetype)modelWithModel:(ToolModel*)btnmodel; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /智慧校园/Main(首页)/VIew/ToolButtonView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ToolButtonView.m 3 | // iOSClientOfQFNU 4 | // 5 | // Created by doushuyao on 2017/8/22. 6 | // Copyright © 2017年 iOSClientOfQFNU. All rights reserved. 7 | // 8 | 9 | #import "ToolButtonView.h" 10 | #import "ToolModel.h" 11 | 12 | @interface ToolButtonView() 13 | 14 | @end 15 | 16 | 17 | @implementation ToolButtonView 18 | 19 | 20 | - (instancetype)init{ 21 | if (self = [super init]) { 22 | [self setUp]; 23 | } 24 | return self; 25 | } 26 | 27 | 28 | - (instancetype)initWithFrame:(CGRect)frame{ 29 | if (self =[super initWithFrame:frame]) { 30 | [self setUp]; 31 | } 32 | return self; 33 | } 34 | 35 | 36 | -(instancetype)initWithModel:(ToolModel*)btnmodel{ 37 | 38 | if (self = [super init]) { 39 | 40 | [self setUp]; 41 | self.btnmodel = btnmodel; 42 | 43 | } 44 | return self; 45 | } 46 | +(instancetype)modelWithModel:(ToolModel *)btnmodel{ 47 | 48 | return [[self alloc]initWithModel:btnmodel]; 49 | } 50 | 51 | -(void)setUp{ 52 | UIButton* btn = [UIButton buttonWithType:UIButtonTypeCustom]; 53 | 54 | 55 | btn.layer.cornerRadius =30; 56 | //btn.layer.masksToBounds = true; 57 | 58 | 59 | [self addSubview:btn]; 60 | _btn = btn; 61 | 62 | UILabel* lable = [[UILabel alloc]initWithFrame:CGRectMake(20, 20, 20, 20)]; 63 | // lable.backgroundColor = [UIColor yellowColor]; 64 | // lable.textColor = [UIColor greenColor]; 65 | [self addSubview:lable]; 66 | _label = lable; 67 | 68 | 69 | } 70 | 71 | 72 | -(void)layoutSubviews{ 73 | [super layoutSubviews]; 74 | 75 | CGFloat width = self.frame.size.width; 76 | //CGFloat height = self.frame.size.height; 77 | 78 | self.btn.frame = CGRectMake(10, 10, width-20, width-20); 79 | self.btn.imageView.frame = self.btn.frame; 80 | 81 | 82 | self.label.frame = CGRectMake(0, width, width, 20); 83 | self.label.textAlignment = NSTextAlignmentCenter; 84 | 85 | 86 | } 87 | 88 | -(void)setBtnmodel:(ToolModel *)btnmodel{ 89 | 90 | _btnmodel = btnmodel; 91 | // NSLog(@"%@-------",_btnmodel.icon); 92 | 93 | [self.btn setImage:[UIImage imageNamed:_btnmodel.icon] forState:UIControlStateNormal]; 94 | _label.text = _btnmodel.name; 95 | 96 | } 97 | 98 | 99 | 100 | 101 | @end 102 | -------------------------------------------------------------------------------- /智慧校园/Me(我)/Controller/MeController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MeController.h 3 | // iOSClientOfQFNU 4 | // 5 | // Created by doushuyao on 17/6/12. 6 | // Copyright © 2017年 iOSClientOfQFNU. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MeController : UIViewController 12 | 13 | 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /智慧校园/Me(我)/View/DSYPhotoHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // tableHeadView.m 3 | // iOSClientOfQFNU 4 | // 5 | // Created by doushuyao on 17/6/21. 6 | // Copyright © 2017年 iOSClientOfQFNU. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void (^DSYPhotoHelperBlock) (id data); 12 | 13 | @interface DSYPhotoHelper : UIImagePickerController 14 | 15 | 16 | + (instancetype)shareHelper; 17 | 18 | - (void)showImageViewSelcteWithResultBlock:(DSYPhotoHelperBlock)selectImageBlock; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /智慧校园/Me(我)/View/headBtn.h: -------------------------------------------------------------------------------- 1 | // 2 | // headBtn.h 3 | // iOSClientOfQFNU 4 | // 5 | // Created by doushuyao on 17/6/12. 6 | // Copyright © 2017年 iOSClientOfQFNU. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface headBtn : UIButton 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /智慧校园/Me(我)/View/headBtn.m: -------------------------------------------------------------------------------- 1 | // 2 | // headBtn.m 3 | // iOSClientOfQFNU 4 | // 5 | // Created by doushuyao on 17/6/12. 6 | // Copyright © 2017年 iOSClientOfQFNU. All rights reserved. 7 | // 8 | 9 | #import "headBtn.h" 10 | 11 | @implementation headBtn 12 | 13 | 14 | -(id)initWithFrame:(CGRect)frame{ 15 | self = [super initWithFrame:frame]; 16 | 17 | [self initUI]; 18 | 19 | return self; 20 | } 21 | /** 22 | * 初始化UI 23 | */ 24 | -(void)initUI{ 25 | self.layer.borderColor = [[UIColor whiteColor] CGColor]; 26 | self.layer.borderWidth = 1; 27 | self.layer.cornerRadius = 5; 28 | self.layer.masksToBounds = true; 29 | 30 | self.imageEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0); 31 | self.titleLabel.font = [UIFont systemFontOfSize:14]; 32 | 33 | 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /智慧校园/Me(我)/View/meTableHeadView.h: -------------------------------------------------------------------------------- 1 | // 2 | // tableHeadView.h 3 | // iOSClientOfQFNU 4 | // 5 | // Created by doushuyao on 17/6/12. 6 | // Copyright © 2017年 iOSClientOfQFNU. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface meTableHeadView : UIView 12 | @property(nonatomic,strong)UIImageView* portrait; 13 | @property(nonatomic,strong)UIImageView* bg; 14 | @property(nonatomic,strong)UIImage* ava; 15 | @property(nonatomic,strong)UIButton* remindBtn; 16 | @property(nonatomic,strong)UIButton* share; 17 | @property(nonatomic,strong)UILabel* name; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /智慧校园/Me(我)/View/meTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // meTableViewCell.h 3 | // iOSClientOfQFNU 4 | // 5 | // Created by doushuyao on 17/6/12. 6 | // Copyright © 2017年 iOSClientOfQFNU. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface meTableViewCell : UITableViewCell 12 | 13 | @property (nonatomic, strong) UILabel *contenLabel; 14 | 15 | //@property (nonatomic, strong) UILabel *dateLabel; 16 | 17 | 18 | @property (nonatomic, strong) NSDictionary *dataSource; 19 | @property (weak, nonatomic) IBOutlet UILabel *DataLable; 20 | @property (weak, nonatomic) IBOutlet UILabel *TimeLable; 21 | 22 | @end 23 | 24 | 25 | -------------------------------------------------------------------------------- /智慧校园/Me(我)/View/meTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // meTableViewCell.m 3 | // iOSClientOfQFNU 4 | // 5 | // Created by doushuyao on 17/6/12. 6 | // Copyright © 2017年 iOSClientOfQFNU. All rights reserved. 7 | // 8 | 9 | #import "meTableViewCell.h" 10 | 11 | @implementation meTableViewCell 12 | 13 | -(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ 14 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 15 | 16 | 17 | // [self initUI]; 18 | 19 | return self; 20 | } 21 | /** 22 | * 初始化UI 23 | */ 24 | //-(void)initUI{ 25 | // _contenLabel = [[UILabel alloc]initWithFrame:CGRectMake(20, 0, SCREEN_WIDTH-40, 20)]; 26 | // _contenLabel.textColor = [UIColor blackColor]; 27 | // _contenLabel.font = [UIFont systemFontOfSize:15]; 28 | // [self.contentView addSubview:_contenLabel]; 29 | // 30 | // 31 | // _dateLabel = [[UILabel alloc]initWithFrame:CGRectMake(20, CGRectGetMaxY(_contenLabel.frame)+5, SCREEN_WIDTH-40, 20)]; 32 | // _dateLabel.textColor = [UIColor lightGrayColor]; 33 | // _dateLabel.font = [UIFont systemFontOfSize:14]; 34 | // [self.contentView addSubview:_dateLabel]; 35 | // 36 | //} 37 | // 38 | 39 | 40 | -(void)setDataSource:(NSDictionary *)dataSource{ 41 | _dataSource = dataSource; 42 | // _contenLabel.text = dataSource[@"title"]; 43 | // _dateLabel.text = dataSource[@"date"]; 44 | 45 | _DataLable.text = dataSource[@"title"]; 46 | _TimeLable.text = dataSource[@"date"]; 47 | 48 | 49 | 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /智慧校园/Other/Image/cet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/Image/cet.png -------------------------------------------------------------------------------- /智慧校园/Other/Image/icon-calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/Image/icon-calendar.png -------------------------------------------------------------------------------- /智慧校园/Other/Image/robot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/Image/robot.png -------------------------------------------------------------------------------- /智慧校园/Other/Image/weather.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/Image/weather.png -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/LPDQuoteImagesView/Assets/.gitkeep -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/AlbumAddBtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/AlbumAddBtn.png -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/AlbumAddBtn@1.5x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/AlbumAddBtn@1.5x.png -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/AlbumAddBtn@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/AlbumAddBtn@1x.png -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/LPDVideoPreviewPlay@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/LPDVideoPreviewPlay@2x.png -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/LPDVideoPreviewPlayHL@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/LPDVideoPreviewPlayHL@2x.png -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/Root.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | StringsTable 6 | Root 7 | PreferenceSpecifiers 8 | 9 | 10 | Type 11 | PSGroupSpecifier 12 | Title 13 | Group 14 | 15 | 16 | Type 17 | PSTextFieldSpecifier 18 | Title 19 | Name 20 | Key 21 | name_preference 22 | DefaultValue 23 | 24 | IsSecure 25 | 26 | KeyboardType 27 | Alphabet 28 | AutocapitalizationType 29 | None 30 | AutocorrectionType 31 | No 32 | 33 | 34 | Type 35 | PSToggleSwitchSpecifier 36 | Title 37 | Enabled 38 | Key 39 | enabled_preference 40 | DefaultValue 41 | 42 | 43 | 44 | Type 45 | PSSliderSpecifier 46 | Key 47 | slider_preference 48 | DefaultValue 49 | 0.5 50 | MinimumValue 51 | 0 52 | MaximumValue 53 | 1 54 | MinimumValueImage 55 | 56 | MaximumValueImage 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/TableViewArrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/TableViewArrow@2x.png -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/VideoSendIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/VideoSendIcon@2x.png -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/en.lproj/Localizable.strings -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/navi_back@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/navi_back@2x.png -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/nookDeleteBtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/nookDeleteBtn.png -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/nookDeleteBtn@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/nookDeleteBtn@2x.png -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/nookDeleteBtn@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/nookDeleteBtn@3x.png -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/photo_def_photoPickerVc@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/photo_def_photoPickerVc@2x.png -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/photo_number_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/photo_number_icon@2x.png -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/photo_original_def@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/photo_original_def@2x.png -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/photo_original_sel@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/photo_original_sel@2x.png -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/photo_sel_photoPickerVc@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/photo_sel_photoPickerVc@2x.png -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/preview_original_def@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/preview_original_def@2x.png -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/takePicture@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/takePicture@2x.png -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/zh-Hans.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/LPDQuoteImagesView/Assets/LPDImagePickerController.bundle/zh-Hans.lproj/Localizable.strings -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/LPDQuoteImagesView/Classes/.gitkeep -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Classes/LPDAssetCell.h: -------------------------------------------------------------------------------- 1 | // LPDAssetCell.h 2 | // LPDQuoteSystemImagesController 3 | // 4 | // Created by Assuner on 2016/12/18. 5 | // Copyright © 2016年 Assuner. All rights reserved. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | typedef NS_ENUM(NSUInteger, LPDAssetCellType){ 12 | LPDAssetCellTypePhoto = 0, 13 | LPDAssetCellTypeLivePhoto, 14 | LPDAssetCellTypeVideo, 15 | LPDAssetCellTypeAudio, 16 | }; 17 | @class LPDAssetModel; 18 | @interface LPDAssetCell : UICollectionViewCell 19 | 20 | @property (weak, nonatomic) UIButton *selectPhotoButton; 21 | @property (nonatomic, strong) LPDAssetModel *model; 22 | @property (nonatomic, copy) void (^didSelectPhotoBlock)(BOOL); 23 | @property (nonatomic, assign) LPDAssetCellType type; 24 | @property (nonatomic, copy) NSString *representedAssetIdentifier; 25 | @property (nonatomic, assign) PHImageRequestID imageRequestID; 26 | 27 | @property (nonatomic, copy) NSString *photoSelImageName; 28 | @property (nonatomic, copy) NSString *photoDefImageName; 29 | 30 | @property (nonatomic, assign) BOOL showSelectBtn; 31 | 32 | @end 33 | 34 | 35 | @class LPDAlbumModel; 36 | 37 | @interface LPDAlbumCell : UITableViewCell 38 | 39 | @property (nonatomic, strong) LPDAlbumModel *model; 40 | @property (weak, nonatomic) UIButton *selectedCountButton; 41 | 42 | @end 43 | 44 | 45 | @interface LPDAssetCameraCell : UICollectionViewCell 46 | 47 | @property (nonatomic, strong) UIImageView *imageView; 48 | 49 | @end 50 | 51 | -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Classes/LPDAssetModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // LPDAssetModel.h 3 | // LPDQuoteSystemImagesController 4 | // 5 | // Created by Assuner on 2016/12/18. 6 | // Copyright © 2016年 Assuner. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | typedef NS_ENUM(NSUInteger, LPDAssetModelMediaType){ 13 | LPDAssetModelMediaTypePhoto = 0, 14 | LPDAssetModelMediaTypeLivePhoto, 15 | LPDAssetModelMediaTypeVideo, 16 | LPDAssetModelMediaTypeAudio, 17 | }; 18 | 19 | @class PHAsset; 20 | @interface LPDAssetModel : NSObject 21 | 22 | @property (nonatomic, strong) id asset; // PHAsset or ALAsset 23 | @property (nonatomic, assign) BOOL isSelected; // 选中状态 24 | @property (nonatomic, assign) LPDAssetModelMediaType type; 25 | @property (nonatomic, copy) NSString *timeLength; 26 | 27 | + (instancetype)modelWithAsset:(id)asset type:(LPDAssetModelMediaType)type; 28 | + (instancetype)modelWithAsset:(id)asset type:(LPDAssetModelMediaType)type timeLength:(NSString *)timeLength; 29 | 30 | @end 31 | 32 | @class PHFetchResult; 33 | @interface LPDAlbumModel : NSObject 34 | 35 | @property (nonatomic, strong) NSString *name; //名字 36 | @property (nonatomic, assign) NSInteger count; //相片总量 37 | @property (nonatomic, strong) id result; ///< PHFetchResult or ALAssetsGroup 38 | 39 | @property (nonatomic, strong) NSArray *models; 40 | @property (nonatomic, strong) NSArray *selectedModels; 41 | @property (nonatomic, assign) NSUInteger selectedCount; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Classes/LPDAssetModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // LPDAssetModel.m 3 | // LPDQuoteSystemImagesController 4 | // 5 | // Created by Assuner on 2016/12/18. 6 | // Copyright © 2016年 Assuner. All rights reserved. 7 | // 8 | 9 | #import "LPDAssetModel.h" 10 | #import "LPDImageManager.h" 11 | 12 | @implementation LPDAssetModel 13 | 14 | + (instancetype)modelWithAsset:(id)asset type:(LPDAssetModelMediaType)type{ 15 | LPDAssetModel *model = [[LPDAssetModel alloc] init]; 16 | model.asset = asset; 17 | model.isSelected = NO; 18 | model.type = type; 19 | return model; 20 | } 21 | 22 | + (instancetype)modelWithAsset:(id)asset type:(LPDAssetModelMediaType)type timeLength:(NSString *)timeLength { 23 | LPDAssetModel *model = [self modelWithAsset:asset type:type]; 24 | model.timeLength = timeLength; 25 | return model; 26 | } 27 | 28 | @end 29 | 30 | @implementation LPDAlbumModel 31 | 32 | - (void)setResult:(id)result { 33 | _result = result; 34 | BOOL allowPickingImage = [[[NSUserDefaults standardUserDefaults] objectForKey:@"lpd_allowPickingImage"] isEqualToString:@"1"]; 35 | BOOL allowPickingVideo = [[[NSUserDefaults standardUserDefaults] objectForKey:@"lpd_allowPickingVideo"] isEqualToString:@"1"]; 36 | [[LPDImageManager manager] getAssetsFromFetchResult:result allowPickingVideo:allowPickingVideo allowPickingImage:allowPickingImage completion:^(NSArray *models) { 37 | _models = models; 38 | if (_selectedModels) { 39 | [self checkSelectedModels]; 40 | } 41 | }]; 42 | } 43 | 44 | - (void)setSelectedModels:(NSArray *)selectedModels { 45 | _selectedModels = selectedModels; 46 | if (_models) { 47 | [self checkSelectedModels]; 48 | } 49 | } 50 | 51 | - (void)checkSelectedModels { 52 | self.selectedCount = 0; 53 | NSMutableArray *selectedAssets = [NSMutableArray array]; 54 | for (LPDAssetModel *model in _selectedModels) { 55 | [selectedAssets addObject:model.asset]; 56 | } 57 | for (LPDAssetModel *model in _models) { 58 | if ([[LPDImageManager manager] isAssetsArray:selectedAssets containAsset:model.asset]) { 59 | self.selectedCount ++; 60 | } 61 | } 62 | } 63 | 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Classes/LPDPhotoArrangeCVlLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // LPDPickPhotoCellLayout.h 3 | // LPDQuoteSystemImagesController 4 | // 5 | // Created by Assuner on 2016/12/16. 6 | // Copyright © 2016年 Assuner. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LPDPhotoArrangeCVlLayout : UICollectionViewFlowLayout 12 | 13 | @property (assign, nonatomic) BOOL panGestureRecognizerEnable; 14 | 15 | @end 16 | 17 | @protocol LPDPhotoArrangeCVDataSource 18 | 19 | @optional 20 | 21 | - (void)collectionView:(UICollectionView *)collectionView 22 | itemAtIndexPath:(NSIndexPath *)sourceIndexPath 23 | willMoveToIndexPath:(NSIndexPath *)destinationIndexPath; 24 | - (void)collectionView:(UICollectionView *)collectionView 25 | itemAtIndexPath:(NSIndexPath *)sourceIndexPath 26 | didMoveToIndexPath:(NSIndexPath *)destinationIndexPath; 27 | 28 | - (BOOL)collectionView:(UICollectionView *)collectionView 29 | canMoveItemAtIndexPath:(NSIndexPath *)indexPath; 30 | - (BOOL)collectionView:(UICollectionView *)collectionView 31 | itemAtIndexPath:(NSIndexPath *)sourceIndexPath 32 | canMoveToIndexPath:(NSIndexPath *)destinationIndexPath; 33 | 34 | @end 35 | 36 | @protocol LPDPhotoArrangeCVFlowLayout 37 | 38 | @optional 39 | 40 | - (void)collectionView:(UICollectionView *)collectionView 41 | layout:(UICollectionViewLayout *)collectionViewLayout 42 | willBeginDraggingItemAtIndexPath:(NSIndexPath *)indexPath; 43 | - (void)collectionView:(UICollectionView *)collectionView 44 | layout:(UICollectionViewLayout *)collectionViewLayout 45 | didBeginDraggingItemAtIndexPath:(NSIndexPath *)indexPath; 46 | - (void)collectionView:(UICollectionView *)collectionView 47 | layout:(UICollectionViewLayout *)collectionViewLayout 48 | willEndDraggingItemAtIndexPath:(NSIndexPath *)indexPath; 49 | - (void)collectionView:(UICollectionView *)collectionView 50 | layout:(UICollectionViewLayout *)collectionViewLayout 51 | didEndDraggingItemAtIndexPath:(NSIndexPath *)indexPath; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Classes/LPDPhotoArrangeCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // LPDPhotoArrangeCell.h 3 | // LPDQuoteSystemImagesController 4 | // 5 | // Created by Assuner on 2016/12/16. 6 | // Copyright © 2016年 Assuner. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "UIView+HandyValue.h" 11 | #import "UIImage+MyBundle.h" 12 | 13 | @class LPDImagePickerController; 14 | @class LPDQuoteSystemImagesView; 15 | 16 | @interface LPDPhotoArrangeCell : UICollectionViewCell 17 | 18 | @property (strong, nonatomic) UIImageView *imageThumbnail; //图片缩略图 19 | @property (strong, nonatomic) UIImageView *videoThumbnail; //视频缩略图 20 | @property (strong, nonatomic) UIButton *nookDeleteBtn; //角标删除按钮 21 | @property (assign, nonatomic) NSInteger row; //行 22 | @property (strong, nonatomic) id asset; //资源模型 23 | 24 | 25 | - (UIView *)snapshotView; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Classes/LPDPhotoPickerController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LPDPhotoPickerController.h 3 | // LPDQuoteSystemImagesController 4 | // 5 | // Created by Assuner on 2016/12/18. 6 | // Copyright © 2016年 Assuner. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class LPDAlbumModel; 12 | @interface LPDPhotoPickerController : UIViewController 13 | 14 | @property (nonatomic, assign) BOOL isFirstAppear; 15 | @property (nonatomic, assign) NSInteger columnNumber; 16 | @property (nonatomic, strong) LPDAlbumModel *model; 17 | 18 | @property (nonatomic, copy) void (^backButtonClickHandle)(LPDAlbumModel *model); 19 | 20 | @end 21 | 22 | @interface LYGCollectionView : UICollectionView 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Classes/LPDPhotoPreviewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // LPDPhotoPreviewCell.h 3 | // LPDQuoteSystemImagesController 4 | // 5 | // Created by Assuner on 2016/12/18. 6 | // Copyright © 2016年 Assuner. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class LPDAssetModel,LPDProgressView; 12 | @interface LPDPhotoPreviewCell : UICollectionViewCell 13 | @property (nonatomic, strong) LPDAssetModel *model; 14 | @property (nonatomic, copy) void (^singleTapGestureBlock)(); 15 | @property (nonatomic, copy) void (^imageProgressUpdateBlock)(double progress); 16 | 17 | @property (nonatomic, strong) UIImageView *imageView; 18 | @property (nonatomic, strong) UIScrollView *scrollView; 19 | @property (nonatomic, strong) UIView *imageContainerView; 20 | @property (nonatomic, strong) LPDProgressView *progressView; 21 | 22 | 23 | 24 | 25 | - (void)recoverSubviews; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Classes/LPDPhotoPreviewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LPDPhotoPreviewController.h 3 | // LPDQuoteSystemImagesController 4 | // 5 | // Created by Assuner on 2016/12/18. 6 | // Copyright © 2016年 Assuner. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LPDPhotoPreviewController : UIViewController 12 | 13 | @property (nonatomic, strong) NSMutableArray *models; ///< All photo models / 所有图片模型数组 14 | @property (nonatomic, strong) NSMutableArray *photos; ///< All photos / 所有图片数组 15 | @property (nonatomic, assign) NSInteger currentIndex; ///< Index of the photo user click / 用户点击的图片的索引 16 | @property (nonatomic, assign) BOOL isSelectOriginalPhoto; ///< If YES,return original photo / 是否返回原图 17 | 18 | 19 | /// Return the new selected photos / 返回最新的选中图片数组 20 | @property (nonatomic, copy) void (^backButtonClickBlock)(BOOL isSelectOriginalPhoto); 21 | @property (nonatomic, copy) void (^doneButtonClickBlock)(BOOL isSelectOriginalPhoto); 22 | 23 | @property (nonatomic, copy) void (^doneButtonClickBlockWithPreviewType)(NSArray *photos,NSArray *assets,BOOL isSelectOriginalPhoto); 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Classes/LPDProgressView.h: -------------------------------------------------------------------------------- 1 | // 2 | // LPDProgressView.h 3 | // LPDQuoteSystemImagesController 4 | // 5 | // Created by Assuner on 2016/12/18. 6 | // Copyright © 2016年 Assuner. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LPDProgressView : UIView 12 | 13 | @property (nonatomic, assign) double progress; 14 | @property (nonatomic, strong) CAShapeLayer *progressLayer; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Classes/LPDProgressView.m: -------------------------------------------------------------------------------- 1 | // 2 | // LPDProgressView.m 3 | // LPDQuoteSystemImagesController 4 | // 5 | // Created by Assuner on 2016/12/18. 6 | // Copyright © 2016年 Assuner. All rights reserved. 7 | // 8 | 9 | #import "LPDProgressView.h" 10 | 11 | @implementation LPDProgressView 12 | 13 | - (instancetype)init { 14 | self = [super init]; 15 | if (self) { 16 | self.backgroundColor = [UIColor clearColor]; 17 | 18 | _progressLayer = [CAShapeLayer layer]; 19 | _progressLayer.fillColor = [[UIColor clearColor] CGColor]; 20 | _progressLayer.strokeColor = [[UIColor whiteColor] CGColor]; 21 | _progressLayer.opacity = 1; 22 | _progressLayer.lineCap = kCALineCapRound; 23 | _progressLayer.lineWidth = 5; 24 | 25 | [_progressLayer setShadowColor:[UIColor blackColor].CGColor]; 26 | [_progressLayer setShadowOffset:CGSizeMake(1, 1)]; 27 | [_progressLayer setShadowOpacity:0.5]; 28 | [_progressLayer setShadowRadius:2]; 29 | } 30 | return self; 31 | } 32 | 33 | - (void)drawRect:(CGRect)rect { 34 | CGPoint center = CGPointMake(rect.size.width / 2, rect.size.height / 2); 35 | CGFloat radius = rect.size.width / 2; 36 | CGFloat startA = - M_PI_2; 37 | CGFloat endA = - M_PI_2 + M_PI * 2 * _progress; 38 | _progressLayer.frame = self.bounds; 39 | UIBezierPath *path = [UIBezierPath bezierPathWithArcCenter:center radius:radius startAngle:startA endAngle:endA clockwise:YES]; 40 | _progressLayer.path =[path CGPath]; 41 | 42 | [_progressLayer removeFromSuperlayer]; 43 | [self.layer addSublayer:_progressLayer]; 44 | } 45 | 46 | - (void)setProgress:(double)progress { 47 | _progress = progress; 48 | [self setNeedsDisplay]; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Classes/LPDQuoteImagesView.h: -------------------------------------------------------------------------------- 1 | // 2 | // LPDQuoteImagesView.h 3 | // LPDQuoteImagesController 4 | // 5 | // Created by Assuner on 2016/12/16. 6 | // Copyright © 2016年 Assuner. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LPDPhotoArrangeCell.h" 11 | #import "LPDPhotoArrangeCVlLayout.h" 12 | 13 | 14 | #import "LPDImagePickerController.h" 15 | #import "UIView+HandyValue.h" 16 | #import 17 | #import 18 | #import "LPDImageManager.h" 19 | #import "LPDVideoPlayerController.h" 20 | #import "LPDPhotoPreviewController.h" 21 | 22 | @protocol LPDQuoteImagesViewDelegate 23 | @optional 24 | 25 | @end 26 | 27 | @interface LPDQuoteImagesView : UIView 28 | 29 | @property(strong, nonatomic) LPDImagePickerController *lpdImagePickerVc; 30 | 31 | 32 | @property (assign, nonatomic) NSUInteger maxSelectedCount; ///最大可选照片数 33 | @property (assign, nonatomic) NSUInteger countPerRowInAlbum; ///相册每行照片数 34 | 35 | @property (assign, nonatomic) BOOL isShowTakePhotoSheet; ///是否弹出拍照 图库Sheet 36 | 37 | @property (strong, nonatomic) NSMutableArray *selectedPhotos; ///选中的照片 UIImage数组 可copy 38 | @property (strong, nonatomic) NSMutableArray *selectedAssets; ///需要用到的模型数组 39 | 40 | @property (strong, nonatomic) UICollectionView *collectionView; ///选中图片排列集合view 41 | 42 | @property (weak, nonatomic) UIViewController* navcDelegate; 43 | 44 | - (instancetype)initWithFrame:(CGRect)frame withCountPerRowInView:(NSUInteger)ArrangeCount cellMargin:(CGFloat)cellMargin; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Classes/LPDVideoPlayerController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LPDVideoPlayerController.h 3 | // LPDQuoteSystemImagesController 4 | // 5 | // Created by Assuner on 2016/12/18. 6 | // Copyright © 2016年 Assuner. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class LPDAssetModel; 12 | @interface LPDVideoPlayerController : UIViewController 13 | 14 | @property (nonatomic, strong) LPDAssetModel *model; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Classes/NSBundle+LPDImagePicker.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSBundle+LPDImagePicker.h 3 | // LPDQuoteSystemImagesController 4 | // 5 | // Created by Assuner on 2016/12/18. 6 | // Copyright © 2016年 Assuner. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSBundle (LPDImagePicker) 12 | + (NSString *)lpd_localizedStringForKey:(NSString *)key value:(NSString *)value; 13 | + (NSString *)lpd_localizedStringForKey:(NSString *)key; 14 | @end 15 | -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Classes/NSBundle+LPDImagePicker.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSBundle+LPDImagePicker.m 3 | // LPDQuoteSystemImagesController 4 | // 5 | // Created by Assuner on 2016/12/18. 6 | // Copyright © 2016年 Assuner. All rights reserved. 7 | // 8 | 9 | #import "NSBundle+LPDImagePicker.h" 10 | #import "LPDImagePickerController.h" 11 | 12 | @implementation NSBundle (LPDImagePicker) 13 | + (instancetype)lpd_imagePickerBundle { 14 | static NSBundle *lpd_Bundle = nil; 15 | if (lpd_Bundle == nil) { 16 | NSBundle *bundle = [NSBundle bundleForClass:[LPDImagePickerController class]]; 17 | lpd_Bundle = [NSBundle bundleWithPath:[NSString stringWithFormat:@"%@/LPDImagePickerController.bundle", bundle.bundlePath]]; 18 | } 19 | 20 | return lpd_Bundle; 21 | } 22 | 23 | + (NSString *)lpd_localizedStringForKey:(NSString *)key { 24 | return [self lpd_localizedStringForKey:key value:@""]; 25 | } 26 | 27 | + (NSString *)lpd_localizedStringForKey:(NSString *)key value:(NSString *)value { 28 | static NSBundle *bundle = nil; 29 | if (bundle == nil) { 30 | NSString *language = [NSLocale preferredLanguages].firstObject; 31 | if ([language rangeOfString:@"zh-Hans"].location != NSNotFound) { 32 | language = @"zh-Hans"; 33 | } else { 34 | language = @"en"; 35 | } 36 | bundle = [NSBundle bundleWithPath:[[NSBundle lpd_imagePickerBundle] pathForResource:language ofType:@"lproj"]]; 37 | } 38 | NSString *value1 = [bundle localizedStringForKey:key value:value table:nil]; 39 | return value1; 40 | } 41 | @end 42 | -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Classes/UIImage+MyBundle.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+MyBundle.h 3 | // LPDQuoteSystemImagesController 4 | // 5 | // Created by 李永光-饿了么-iOS开发 on 2016/12/19. 6 | // Copyright © 2016年 李永光-饿了么-iOS开发. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (MyBundle) 12 | + (UIImage *)imageNamedFromMyBundle:(NSString *)name; 13 | @end 14 | -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Classes/UIImage+MyBundle.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+MyBundle.m 3 | // LPDQuoteSystemImagesController 4 | // 5 | // Created by assuner on 2016/12/19. 6 | // Copyright © assuner 2016年 . All rights reserved. 7 | // 8 | 9 | #import "UIImage+MyBundle.h" 10 | #import "LPDQuoteImagesView.h" 11 | 12 | @implementation UIImage (MyBundle) 13 | 14 | + (UIImage *)imageNamedFromMyBundle:(NSString *)name { 15 | NSBundle *bundle = [NSBundle bundleForClass:[LPDQuoteImagesView class]]; 16 | return [UIImage imageNamed:name inBundle:[NSBundle bundleWithPath:[NSString stringWithFormat:@"%@/LPDImagePickerController.bundle", bundle.bundlePath]] compatibleWithTraitCollection:nil]; 17 | 18 | } 19 | @end 20 | -------------------------------------------------------------------------------- /智慧校园/Other/LPDQuoteImagesView/Classes/UIView+HandyValue.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+HandyValue.h 3 | // LPDQuoteSystemImagesController 4 | // 5 | // Created by Assuner on 2016/12/18. 6 | // Copyright © 2016年 Assuner. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM(NSUInteger, LPDOscillatoryAnimationType){ 12 | LPDOscillatoryAnimationToBigger, 13 | LPDOscillatoryAnimationToSmaller, 14 | }; 15 | 16 | #define RELATIVE_VALUE(x) (x*[[UIScreen mainScreen] bounds].size.width/375) 17 | @interface UIView (HandyValue) 18 | 19 | @property (nonatomic) CGFloat lpd_left; ///< Shortcut for frame.origin.x. 20 | @property (nonatomic) CGFloat lpd_top; ///< Shortcut for frame.origin.y 21 | @property (nonatomic) CGFloat lpd_right; ///< Shortcut for frame.origin.x + frame.size.width 22 | @property (nonatomic) CGFloat lpd_bottom; ///< Shortcut for frame.origin.y + frame.size.height 23 | @property (nonatomic) CGFloat lpd_width; ///< Shortcut for frame.size.width. 24 | @property (nonatomic) CGFloat lpd_height; ///< Shortcut for frame.size.height. 25 | @property (nonatomic) CGFloat lpd_centerX; ///< Shortcut for center.x 26 | @property (nonatomic) CGFloat lpd_centerY; ///< Shortcut for center.y 27 | @property (nonatomic) CGPoint lpd_origin; ///< Shortcut for frame.origin. 28 | @property (nonatomic) CGSize lpd_size; ///< Shortcut for frame.size. 29 | 30 | + (void)showOscillatoryAnimationWithLayer:(CALayer *)layer type:(LPDOscillatoryAnimationType)type; 31 | 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Categories/NSNumber+OHSerialization.h: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 1/10/17. 2 | // Copyright © 2017 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | @import Foundation; 6 | #import "OHSerializationProtocol.h" 7 | 8 | 9 | @interface NSNumber (OHSerialization) 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Categories/NSNumber+OHSerialization.m: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 1/10/17. 2 | // Copyright © 2017 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | #import "NSNumber+OHSerialization.h" 6 | @import CoreFoundation; 7 | 8 | @implementation NSNumber (OHSerialization) 9 | 10 | + (id)serializeFromCString:(const char *)cString defaultValue:(const char *)defaultValue canBeNull:(BOOL)canBeNull encoding:(CharsetEncoding)encoding { 11 | if (cString) { 12 | return [NSNumber numberFromCString:cString encoding:encoding]; 13 | } else if (!cString && defaultValue) { 14 | return [NSNumber numberFromCString:defaultValue encoding:encoding]; 15 | } else if (!cString && canBeNull == NO) { 16 | return @0; 17 | } 18 | 19 | return [NSNull null]; 20 | } 21 | 22 | + (NSNumber *)numberFromCString:(const char *)cString encoding:(CharsetEncoding)encoding { 23 | NSStringEncoding nsEncoding = NSStringEncodingFromCharsetEncoding(encoding); 24 | 25 | NSString *numberString = [[NSString alloc] initWithCString:cString encoding:nsEncoding]; 26 | NSNumberFormatter *formatter = [NSNumberFormatter new]; 27 | 28 | return [formatter numberFromString:numberString]; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Categories/NSObject+Mapping.h: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 10/31/15. 2 | // Copyright © 2015 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | @import Foundation; 6 | 7 | @interface NSObject (Mapping) 8 | 9 | - (void)mapFromResponse:(nonnull NSDictionary *)response; 10 | - (nullable NSString *)indexKeyCondition; 11 | - (nullable NSDictionary *)mapObject; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Categories/NSObject+Mapping.m: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 10/31/15. 2 | // Copyright © 2015 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | #import "OHMappingProtocol.h" 6 | #import "OHConstants.h" 7 | 8 | #import "NSObject+Mapping.h" 9 | #import "NSString+Utility.h" 10 | 11 | @interface NSDictionary (Mirroring) 12 | 13 | - (NSDictionary *)mirror; 14 | 15 | @end 16 | 17 | @implementation NSDictionary (Mirroring) 18 | 19 | - (NSDictionary *)mirror { 20 | NSMutableDictionary *mirroDictionary = [NSMutableDictionary dictionary]; 21 | [self enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, __unused BOOL * _Nonnull stop) { 22 | mirroDictionary[obj] = key; 23 | }]; 24 | 25 | return mirroDictionary; 26 | } 27 | 28 | @end 29 | 30 | @interface NSObject () 31 | 32 | @end 33 | 34 | @implementation NSObject (Mapping) 35 | 36 | - (void)mapFromResponse:(NSDictionary *)response { 37 | NSParameterAssert(response); 38 | NSDictionary *mirrorMappingDictionary = [self.mappingDictionary mirror]; 39 | for (NSString *key in mirrorMappingDictionary.allKeys) { 40 | id value = response[key] == [NSNull null] ? nil : response[key]; 41 | [self setValue:value forKey:mirrorMappingDictionary[key]]; 42 | } 43 | } 44 | 45 | #pragma GCC diagnostic ignored "-Wundeclared-selector" 46 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks" 47 | 48 | #pragma GCC diagnostic push 49 | #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 50 | 51 | - (NSString *)indexKeyCondition { 52 | NSString *indexKey = self.primaryKey; 53 | // Get object by calling property. 54 | id object = [self performSelector:NSSelectorFromString(indexKey)]; 55 | 56 | BOOL isNumber = [object isKindOfClass:[NSNumber class]]; 57 | 58 | NSAssert(isNumber || [object isKindOfClass:[NSString class]], @"Current class is not supported. Please, use NSNumber or NSString."); 59 | NSString *conditionValue = isNumber ? [object stringValue] : [object stringWithSingleMarks]; 60 | 61 | if (conditionValue && self.mappingDictionary[indexKey]) { 62 | return [NSString stringWithFormat:@"%@=%@", self.mappingDictionary[indexKey], conditionValue]; 63 | } 64 | 65 | OHLogWarn(@"This object doesn't have index key."); 66 | 67 | return nil; 68 | } 69 | 70 | #pragma GCC diagnostic pop 71 | 72 | - (NSDictionary *)mapObject { 73 | NSMutableDictionary *objectDictionary = [NSMutableDictionary dictionary]; 74 | 75 | NSDictionary *mirrorMappingDictionary = [self.mappingDictionary mirror]; 76 | for (NSString *key in mirrorMappingDictionary.allKeys) { 77 | // Get object by calling property. 78 | id object = [self performSelector:NSSelectorFromString(mirrorMappingDictionary[key])]; 79 | if (object) { 80 | [objectDictionary setObject:object forKey:key]; 81 | } 82 | } 83 | 84 | return objectDictionary; 85 | } 86 | 87 | @end 88 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Categories/NSString+Escaping.h: -------------------------------------------------------------------------------- 1 | // Created by Oleg Gnidets on 2/22/17. 2 | // Copyright © 2017 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | @import Foundation; 6 | #import "OHCharsetEncoding.h" 7 | 8 | @interface NSString (Escaping) 9 | 10 | - (nonnull NSString *)escapedUsingEncoding:(CharsetEncoding)encoding; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Categories/NSString+Escaping.m: -------------------------------------------------------------------------------- 1 | // Created by Oleg Gnidets on 2/22/17. 2 | // Copyright © 2017 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | #import "NSString+Escaping.h" 6 | 7 | static size_t escape(const char *szOrig, char *szEscaped, size_t bufSize); 8 | 9 | @implementation NSString (Escaping) 10 | 11 | - (nonnull NSString *)escapedUsingEncoding:(CharsetEncoding)encoding { 12 | // Get current NSString instance as C string. 13 | NSStringEncoding nsEncoding = NSStringEncodingFromCharsetEncoding(encoding); 14 | const char *chars = [self cStringUsingEncoding:nsEncoding]; 15 | 16 | // Allocate enought memory for escaped C string. 17 | NSUInteger bufferSize = 2 * strlen(chars) + 1; 18 | char *chunk = calloc(bufferSize, sizeof(char)); 19 | 20 | // Escape characters 21 | escape(chars, chunk, bufferSize); 22 | 23 | // Save result 24 | NSString *result = [[NSString alloc] initWithCString:chunk encoding:nsEncoding]; 25 | 26 | // Free memory 27 | free(chunk); 28 | 29 | return result; 30 | } 31 | 32 | @end 33 | 34 | static size_t escape(const char *szOrig, char *szEscaped, size_t bufSize) { 35 | size_t newLen = 0; 36 | size_t origLen = strlen(szOrig); 37 | 38 | for(int i = 0; i < origLen; i++) { 39 | switch(szOrig[i]) { 40 | case '\0': 41 | if (bufSize > newLen + 2) 42 | memcpy(&szEscaped[newLen], "\\0", 2); 43 | newLen += 2; 44 | break; 45 | case '\b': 46 | if (bufSize > newLen + 2) 47 | memcpy(&szEscaped[newLen], "\\b", 2); 48 | newLen += 2; 49 | break; 50 | case '\n': 51 | if (bufSize > newLen + 2) 52 | memcpy(&szEscaped[newLen], "\\n", 2); 53 | newLen += 2; 54 | break; 55 | case '\r': 56 | if (bufSize > newLen + 2) 57 | memcpy(&szEscaped[newLen], "\\r", 2); 58 | newLen += 2; 59 | break; 60 | case '\t': 61 | if (bufSize > newLen + 2) 62 | memcpy(&szEscaped[newLen], "\\t", 2); 63 | newLen += 2; 64 | break; 65 | // case '\%': 66 | // if (bufSize > newLen + 2) 67 | // memcpy(&szEscaped[newLen], "\\%", 2); 68 | // newLen += 2; 69 | // break; 70 | case '\'': 71 | if (bufSize > newLen + 2) 72 | memcpy(&szEscaped[newLen], "\\'", 2); 73 | newLen += 2; 74 | break; 75 | case '\"': 76 | if (bufSize > newLen + 2) 77 | memcpy(&szEscaped[newLen], "\\\"", 2); 78 | newLen += 2; 79 | break; 80 | case '\\': 81 | if (bufSize > newLen + 2) 82 | memcpy(&szEscaped[newLen], "\\\\", 2); 83 | newLen += 2; 84 | break; 85 | default: 86 | if (bufSize > newLen + 1) 87 | szEscaped[newLen] = szOrig[i]; 88 | newLen++; 89 | break; 90 | } 91 | } 92 | 93 | return newLen; 94 | } 95 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Categories/NSString+OHSerialization.h: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 1/10/17. 2 | // Copyright © 2017 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | @import Foundation; 6 | #import "OHSerializationProtocol.h" 7 | 8 | @interface NSString (OHSerialization) 9 | @end 10 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Categories/NSString+OHSerialization.m: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 1/10/17. 2 | // Copyright © 2017 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | #import "NSString+OHSerialization.h" 6 | 7 | 8 | @implementation NSString (OHSerialization) 9 | 10 | + (id)serializeFromCString:(const char *)cString defaultValue:(const char *)defaultValue canBeNull:(BOOL)canBeNull encoding:(CharsetEncoding)encoding { 11 | NSStringEncoding nsEncoding = NSStringEncodingFromCharsetEncoding(encoding); 12 | 13 | if (cString) { 14 | return [[NSString alloc] initWithCString:cString encoding:nsEncoding]; 15 | } else if (!cString && defaultValue) { 16 | return [[NSString alloc] initWithCString:defaultValue encoding:nsEncoding]; 17 | } else if (!cString && canBeNull == NO) { 18 | return @""; 19 | } 20 | 21 | return [NSNull null]; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Constants/OHCharsetEncoding.h: -------------------------------------------------------------------------------- 1 | // Created by Oleg Gnidets on 2/7/17. 2 | // Copyright © 2017 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | @import Foundation; 6 | 7 | /** 8 | Describes available character sets. 9 | 10 | - CharsetEncodingBig5: Big5 Traditional Chinese 11 | - CharsetEncodingCP850: DOS West European 12 | - CharsetEncodingKOI8_R: KOI8-R Relcom Russian 13 | - CharsetEncodingLatin1: cp1252 West European 14 | - CharsetEncodingLatin2: ISO 8859-2 Central European 15 | - CharsetEncodingASCII: US ASCII 16 | - CharsetEncodingUJIS: EUC-JP Japanese 17 | - CharsetEncodingSJIS: Shift-JIS Japanese 18 | - CharsetEncodingHebrew: ISO 8859-8 Hebrew 19 | - CharsetEncodingEUCKR: EUC-KR Korean 20 | - CharsetEncodingKOI8U: KOI8-U Ukrainian 21 | - CharsetEncodingGreek: ISO 8859-7 Greek 22 | - CharsetEncodingLatin5: ISO 8859-9 Turkish 23 | - CharsetEncodingUTF8: UTF-8 Unicode 24 | - CharsetEncodingCP866: DOS Russian 25 | - CharsetEncodingMacRoman: Mac West European 26 | - CharsetEncodingCP852: DOS Central European 27 | - CharsetEncodingLatin7: ISO 8859-13 Baltic 28 | - CharsetEncodingCP1250: Windows Central European 29 | - CharsetEncodingCP1251: Windows Cyrillic 30 | - CharsetEncodingUTF16: UTF-16 Unicode 31 | - CharsetEncodingUTF16LE: UTF-16LE Unicode 32 | - CharsetEncodingCP1256: Windows Arabic 33 | - CharsetEncodingUTF32: UTF-32 Unicode 34 | - CharsetEncodingCP932: SJIS for Windows Japanese 35 | - CharsetEncodingGB2312: GB2312 Simplified Chinese 36 | - CharsetEncodingUTF8MB4: UTF-8 Unicode (support emojies) 37 | */ 38 | typedef NS_ENUM(NSUInteger, CharsetEncoding) { 39 | CharsetEncodingBig5, 40 | CharsetEncodingCP850, 41 | CharsetEncodingKOI8_R, 42 | CharsetEncodingLatin1, 43 | CharsetEncodingLatin2, 44 | CharsetEncodingASCII, 45 | CharsetEncodingUJIS, 46 | CharsetEncodingSJIS, 47 | CharsetEncodingHebrew, 48 | CharsetEncodingEUCKR, 49 | CharsetEncodingKOI8U, 50 | CharsetEncodingGreek, 51 | CharsetEncodingLatin5, 52 | CharsetEncodingUTF8, 53 | CharsetEncodingCP866, 54 | CharsetEncodingMacRoman, 55 | CharsetEncodingCP852, 56 | CharsetEncodingLatin7, 57 | CharsetEncodingCP1250, 58 | CharsetEncodingCP1251, 59 | CharsetEncodingUTF16, 60 | CharsetEncodingUTF16LE, 61 | CharsetEncodingCP1256, 62 | CharsetEncodingUTF32, 63 | CharsetEncodingCP932, 64 | CharsetEncodingGB2312, 65 | CharsetEncodingUTF8MB4, 66 | }; 67 | 68 | 69 | /** 70 | Parses input parameters and returns appropriate character set string. 71 | 72 | @param encoding Defined OHMySQL encoding to use. 73 | @return Name of the encoding. The behavior is undefined if an invalid string encoding is passed. 74 | */ 75 | NSString *_Nullable MySQLCharsetForEncoding(CharsetEncoding encoding); 76 | 77 | 78 | /** 79 | Converts library' encoding to the Cocoa encoding. 80 | 81 | @param encoding Defined OHMySQL encoding to use. 82 | @return The Cocoa encoding (of type NSStringEncoding) that is closest to the Core Foundation encoding encoding. The behavior is undefined if an invalid string encoding is passed. 83 | */ 84 | NSStringEncoding NSStringEncodingFromCharsetEncoding(CharsetEncoding encoding); 85 | 86 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Constants/OHConstants.h: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 2015. 2 | // Copyright (c) 2015 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | @import Foundation; 6 | 7 | #import "OHLogging.h" 8 | #import "OHProtocolType.h" 9 | #import "OHJoinConstants.h" 10 | #import "OHRefreshOptions.h" 11 | #import "OHResultErrorType.h" 12 | #import "OHCharsetEncoding.h" 13 | 14 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Constants/OHJoinConstants.h: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 6/8/16. 2 | // Copyright © 2016 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | @import Foundation; 6 | 7 | extern NSString *_Nonnull const OHJoinInner; 8 | extern NSString *_Nonnull const OHJoinRight; 9 | extern NSString *_Nonnull const OHJoinLeft; 10 | extern NSString *_Nonnull const OHJoinFull; 11 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Constants/OHJoinConstants.m: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 6/8/16. 2 | // Copyright © 2016 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | #import "OHJoinConstants.h" 6 | 7 | NSString *const OHJoinInner = @"INNER JOIN"; 8 | NSString *const OHJoinRight = @"RIGHT OUTER JOIN"; 9 | NSString *const OHJoinLeft = @"LEFT OUTER JOIN"; 10 | NSString *const OHJoinFull = @"FULL OUTER JOIN"; 11 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Constants/OHLogging.h: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 6/16/16. 2 | // Copyright © 2016 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | #ifdef DEBUG 6 | #define OHLog(frmt, ...) NSLog(@"%s -[INFO] %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:(frmt), ##__VA_ARGS__]); 7 | #else 8 | #define OHLog(frmt, ...) ; 9 | #endif 10 | 11 | #ifdef DEBUG 12 | #define OHLogError(frmt, ...) NSLog(@"%s -[ERROR] %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:(frmt), ##__VA_ARGS__]); 13 | #else 14 | #define OHLogError(frmt, ...) ; 15 | #endif 16 | 17 | #ifdef DEBUG 18 | #define OHLogWarn(frmt, ...) NSLog(@"%s -[WARNING] %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:(frmt), ##__VA_ARGS__]); 19 | #else 20 | #define OHLogWarn(frmt, ...) ; 21 | #endif 22 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Constants/OHProtocolType.h: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 6/16/16. 2 | // Copyright © 2016 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | /** 6 | * Represents protocol types that can be used during session. 7 | */ 8 | typedef NS_ENUM(NSUInteger, OHProtocolType) { 9 | /** 10 | * Default connection. 11 | */ 12 | OHProtocolTypeDefault, 13 | /** 14 | * TCP/IP connection to local or remote server. 15 | */ 16 | OHProtocolTypeTCP, 17 | }; 18 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Constants/OHRefreshOptions.h: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 6/16/16. 2 | // Copyright © 2016 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | /** 6 | * Refresh options. 7 | */ 8 | typedef NS_OPTIONS(NSUInteger, OHRefreshOptions){ 9 | /** 10 | * Refresh the grant tables, like FLUSH PRIVILEGES. 11 | */ 12 | OHRefreshOptionGrant = 1, 13 | /** 14 | * Flush the logs, like FLUSH LOGS. 15 | */ 16 | OHRefreshOptionLog = 2, 17 | /** 18 | * Flush the table cache, like FLUSH TABLES. 19 | */ 20 | OHRefreshOptionTables = 4, 21 | /** 22 | * Flush the host cache, like FLUSH HOSTS. 23 | */ 24 | OHRefreshOptionHosts = 8, 25 | /** 26 | * Reset status variables, like FLUSH STATUS. 27 | */ 28 | OHRefreshOptionStatus = 16, 29 | /** 30 | * Flush the thread cache. 31 | */ 32 | OHRefreshOptionThreads = 32, 33 | /** 34 | * On a slave replication server, reset the master server information and restart the slave, like RESET SLAVE. 35 | */ 36 | OHRefreshOptionSlave = 64, 37 | /** 38 | * On a master replication server, remove the binary log files listed in the binary log index and truncate the index file, like RESET MASTER. 39 | */ 40 | OHRefreshOptionMaster = 128, 41 | }; 42 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Constants/OHResultErrorType.h: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 6/16/16. 2 | // Copyright © 2016 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | /** 6 | * Client error codes and messages. 7 | */ 8 | typedef NS_ENUM(NSUInteger, OHResultErrorType){ 9 | /** 10 | * Success. 11 | */ 12 | OHResultErrorTypeNone = 0, 13 | /** 14 | * Commands were executed in an improper order. 15 | */ 16 | OHResultErrorTypeSync = 2014, 17 | /** 18 | * The MySQL server has gone away. 19 | */ 20 | OHResultErrorTypeGone = 2006, 21 | /** 22 | * The connection to the server was lost during the query. 23 | */ 24 | OHResultErrorTypeLost = 2013, 25 | /** 26 | * An unknown error occurred. 27 | */ 28 | OHResultErrorTypeUnknown = 2000, 29 | }; 30 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Models/OHMySQLQueryRequest.h: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 2015. 2 | // Copyright (c) 2015 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | @import Foundation; 6 | #import "OHMySQLTimeline.h" 7 | 8 | /// An instance of OHMySQLQueryRequest describes SQL query used to retrieve data from a MySQL store. 9 | @interface OHMySQLQueryRequest : NSObject 10 | 11 | /// The timeline of lifecycle of query. 12 | @property (strong, nonnull) OHMySQLTimeline *timeline; 13 | 14 | /// SQL query string. 15 | @property (nonatomic, copy, nonnull) NSString *queryString; 16 | 17 | - (nonnull instancetype)initWithQueryString:(nonnull NSString *)query; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Models/OHMySQLQueryRequest.m: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 2015. 2 | // Copyright (c) 2015 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | #import "OHMySQLQueryRequest.h" 6 | 7 | @interface OHMySQLQueryRequest () 8 | @end 9 | 10 | @implementation OHMySQLQueryRequest 11 | 12 | - (nonnull instancetype)initWithQueryString:(nonnull NSString *)query { 13 | NSParameterAssert(query); 14 | if (self = [self init]) { 15 | _queryString = query; 16 | _timeline = [OHMySQLTimeline new]; 17 | } 18 | 19 | return self; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Models/OHMySQLStore.h: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 6/14/16. 2 | // Copyright © 2016 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | @import Foundation; 6 | 7 | /// An object of this class contains details about a store MySQL. 8 | @interface OHMySQLStore : NSObject 9 | 10 | - (nonnull instancetype)initWithMySQL:(nonnull void *const)mysql; 11 | 12 | /// Returns a string that represents the MySQL server version; for example, "5.7.14". 13 | @property (nonatomic, copy, readonly, nonnull) NSString *serverInfo; 14 | 15 | /// Returns a string describing the type of connection in use, including the server host name. 16 | @property (nonatomic, copy, readonly, nonnull) NSString *hostInfo; 17 | 18 | /// An unsigned integer representing the protocol version used by the current connection. 19 | @property (nonatomic, assign, readonly) NSUInteger protocolInfo; 20 | 21 | /// An integer that represents the MySQL server version. For example, "5.7.14" is returned as 50714. 22 | @property (nonatomic, assign, readonly) NSInteger serverVersion; 23 | 24 | /// A character string describing the server status. nil if an error occurred. 25 | @property (nonatomic, copy, readonly, nullable) NSString *status; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Models/OHMySQLStore.m: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 6/14/16. 2 | // Copyright © 2016 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | #import "OHMySQLStore.h" 6 | #import "../lib/include/mysql.h" 7 | 8 | @interface OHMySQLStore () 9 | 10 | @property (nonatomic, assign) MYSQL *mysql; 11 | 12 | @end 13 | 14 | @implementation OHMySQLStore 15 | 16 | - (instancetype)initWithMySQL:(void *)mysql { 17 | NSParameterAssert(mysql); 18 | if (self = [super init]) { 19 | _mysql = mysql; 20 | } 21 | 22 | return self; 23 | } 24 | 25 | - (NSString *)serverInfo { 26 | return [NSString stringWithUTF8String:mysql_get_server_info(_mysql)]; 27 | } 28 | 29 | - (NSString *)hostInfo { 30 | return [NSString stringWithUTF8String:mysql_get_host_info(_mysql)]; 31 | } 32 | 33 | - (NSUInteger)protocolInfo { 34 | return mysql_get_proto_info(_mysql); 35 | } 36 | 37 | - (NSInteger)serverVersion { 38 | return mysql_get_server_version(_mysql); 39 | } 40 | 41 | - (NSString *)status { 42 | return [NSString stringWithUTF8String:mysql_stat(_mysql)]; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Models/OHMySQLTimeline.h: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 6/16/16. 2 | // Copyright © 2016 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | @import Foundation; 6 | @import CoreGraphics.CGBase; 7 | 8 | /// An instance of OHMySQLTimeline represents lifecycle of the query. 9 | @interface OHMySQLTimeline : NSObject 10 | 11 | /// The time when the serialization was completed. 12 | @property (nonatomic, assign) CFAbsoluteTime serializationDuration; 13 | 14 | /// The time interval from the time the request started to the time the request completed. 15 | @property (nonatomic, assign) CFAbsoluteTime queryDuration; 16 | 17 | /// The time interval in seconds from the time the request started to the time response serialization completed. 18 | @property (nonatomic, assign, readonly) CFAbsoluteTime totalTime; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Models/OHMySQLTimeline.m: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 6/16/16. 2 | // Copyright © 2016 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | #import "OHMySQLTimeline.h" 6 | 7 | @interface OHMySQLTimeline () 8 | 9 | @property (nonatomic, assign, readwrite) CFAbsoluteTime totalTime; 10 | 11 | @end 12 | 13 | @implementation OHMySQLTimeline 14 | 15 | - (CFAbsoluteTime)totalTime { 16 | _totalTime = self.queryDuration + self.serializationDuration; 17 | return _totalTime; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Models/OHMySQLUser.h: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 2015. 2 | // Copyright (c) 2015 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | @import Foundation; 6 | #import "OHSSLConfig.h" 7 | 8 | /// The entity that has authority to use a store MySQL. 9 | @interface OHMySQLUser : NSObject 10 | 11 | /// Can be up to 16 characters long. Operating system user names may be of a different maximum length. 12 | @property (nonatomic, copy, nonnull) NSString *userName; 13 | 14 | /// User' password for authentication. https://dev.mysql.com/doc/refman/5.5/en/password-security-user.html 15 | @property (nonatomic, copy, nonnull) NSString *password; 16 | 17 | /// A host name or an IP address. 18 | /// @note Note that the host parameter determines the type of the connection. 19 | @property (nonatomic, copy, nonnull) NSString *serverName; 20 | 21 | /// The string specifies the name of database. 22 | @property (nonatomic, copy, nonnull) NSString *dbName; 23 | 24 | /// If it is not NULL, the string specifies the socket or named pipe to use. 25 | @property (nonatomic, copy, nullable) NSString *socket; 26 | 27 | /// If it is not 0, the value is used as the port number for the TCP/IP connection. 28 | @property (nonatomic, assign) NSUInteger port; 29 | 30 | /// Used for establishing secure connections using SSL. 31 | @property (nonatomic, copy, nullable) OHSSLConfig *sslConfig; 32 | 33 | - (nullable instancetype)initWithUserName:(nonnull NSString *)name 34 | password:(nonnull NSString *)password 35 | serverName:(nonnull NSString *)serverName 36 | dbName:(nonnull NSString *)dbName 37 | port:(NSUInteger)port 38 | socket:(nullable NSString *)socket; 39 | 40 | - (nullable instancetype)initWithUserName:(nonnull NSString *)name 41 | password:(nonnull NSString *)password 42 | sslConfig:(nonnull OHSSLConfig *)sslConfig 43 | serverName:(nonnull NSString *)serverName 44 | dbName:(nonnull NSString *)dbName 45 | port:(NSUInteger)port 46 | socket:(nullable NSString *)socket; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Models/OHMySQLUser.m: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 2015. 2 | // Copyright (c) 2015 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | #import "OHMySQLUser.h" 6 | 7 | @interface OHMySQLUser () 8 | @end 9 | 10 | @implementation OHMySQLUser 11 | 12 | - (instancetype)initWithUserName:(NSString *)name 13 | password:(NSString *)password 14 | serverName:(NSString *)serverName 15 | dbName:(NSString *)dbName 16 | port:(NSUInteger)port 17 | socket:(NSString *)socket { 18 | if (self = [super init]) { 19 | _userName = name; 20 | _password = password; 21 | _serverName = serverName; 22 | _dbName = dbName; 23 | _port = port; 24 | _socket = socket; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | - (instancetype)initWithUserName:(NSString *)name 31 | password:(NSString *)password 32 | sslConfig:(OHSSLConfig *)sslConfig 33 | serverName:(NSString *)serverName 34 | dbName:(NSString *)dbName 35 | port:(NSUInteger)port 36 | socket:(NSString *)socket { 37 | self = [self initWithUserName:name password:password serverName:serverName dbName:dbName port:port socket:socket]; 38 | if (self) { 39 | _sslConfig = sslConfig; 40 | } 41 | 42 | return self; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Models/OHSSLConfig.h: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 10/1/15. 2 | // Copyright © 2015 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | @import Foundation; 6 | 7 | /// This class is used for establishing secure connections using SSL. 8 | /// @note Please, see http://dev.mysql.com/doc/refman/5.7/en/mysql-ssl-set.html for more details. 9 | @interface OHSSLConfig : NSObject 10 | 11 | /// The path name to the key file. 12 | @property (nonatomic, copy, nullable) NSString *key; 13 | 14 | /// The path name to the certificate file. 15 | @property (nonatomic, copy, nullable) NSString *certPath; 16 | 17 | /// The path name to the certificate authority file. 18 | @property (nonatomic, copy, nullable) NSString *certAuthPath; 19 | 20 | /// The path name to a directory that contains trusted SSL CA certificates in PEM format. 21 | @property (nonatomic, copy, nullable) NSString *certAuthPEMPath; 22 | 23 | /// A list of permissible ciphers to use for SSL encryption. 24 | @property (nonatomic, copy, nullable) NSString *cipher; 25 | 26 | - (nullable instancetype)initWithKey:(nullable NSString *)key 27 | certPath:(nullable NSString *)certPath 28 | certAuthPath:(nullable NSString *)certAuthPath 29 | certAuthPEMPath:(nullable NSString *)certAuthPEMPath 30 | cipher:(nullable NSString *)cipher; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/Models/OHSSLConfig.m: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 10/1/15. 2 | // Copyright © 2015 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | #import "OHSSLConfig.h" 6 | 7 | @implementation OHSSLConfig 8 | 9 | - (instancetype)initWithKey:(NSString *)key 10 | certPath:(NSString *)certPath 11 | certAuthPath:(NSString *)certAuthPath 12 | certAuthPEMPath:(NSString *)certAuthPEMPath 13 | cipher:(NSString *)cipher { 14 | if (self = [super init]) { 15 | _key = key; 16 | _certPath = certPath; 17 | _certAuthPath = certAuthPath; 18 | _certAuthPEMPath = certAuthPEMPath; 19 | _cipher = cipher; 20 | } 21 | 22 | return self; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/OHMappingProtocol.h: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 10/31/15. 2 | // Copyright © 2015 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | @import Foundation; 6 | 7 | @protocol OHMappingProtocol 8 | 9 | /// Dictionary that represents class' properties with table' column names. 10 | - (NSDictionary *)mappingDictionary; 11 | 12 | /// Table where current entity can be found. 13 | - (NSString *)mySQLTable; 14 | 15 | /// Returns name of primary property (row). 16 | - (NSString *)primaryKey; 17 | 18 | @end 19 | 20 | #define mysql_key(name) NSStringFromSelector(@selector(name)) 21 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/OHMySQL.h: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 2015. 2 | // Copyright (c) 2015 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | #import "OHMySQLUser.h" 6 | #import "OHMySQLStore.h" 7 | #import "OHMySQLQueryRequest.h" 8 | 9 | #import "OHMySQLContainer.h" 10 | #import "OHMySQLQueryContext.h" 11 | #import "OHMySQLQueryRequestFactory.h" 12 | #import "OHMySQLStoreCoordinator.h" 13 | 14 | #import "NSObject+Mapping.h" 15 | #import "NSString+Escaping.h" 16 | #import "OHMappingProtocol.h" 17 | 18 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/OHMySQLContainer.h: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 6/20/16. 2 | // Copyright © 2016 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | @import Foundation; 6 | @class OHMySQLQueryContext, OHMySQLStoreCoordinator; 7 | 8 | /// Represents a main context and store coordinator. 9 | @interface OHMySQLContainer : NSObject 10 | 11 | /// Shared manager. 12 | /// @warning Will be removed in the future. 13 | + (nonnull OHMySQLContainer *)sharedManager; 14 | 15 | /// Shared container 16 | + (nonnull OHMySQLContainer *)sharedContainer; 17 | 18 | /// Single context that is used in the app. Context should be set by a user of this class. 19 | @property (nonatomic, strong, nullable) OHMySQLQueryContext *mainQueryContext; 20 | 21 | /// Single store coordinator. 22 | @property (nonatomic, strong, readonly, nullable) OHMySQLStoreCoordinator *storeCoordinator; 23 | 24 | @end 25 | 26 | @compatibility_alias OHMySQLManager OHMySQLContainer; 27 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/OHMySQLContainer.m: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 6/20/16. 2 | // Copyright © 2016 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | #import "OHMySQLContainer.h" 6 | #import "OHMySQLQueryContext.h" 7 | 8 | static OHMySQLContainer *_sharedManager = nil; 9 | 10 | @implementation OHMySQLContainer 11 | 12 | + (OHMySQLContainer *)sharedManager { 13 | static dispatch_once_t onceToken; 14 | dispatch_once(&onceToken, ^{ 15 | _sharedManager = [OHMySQLContainer new]; 16 | }); 17 | 18 | return _sharedManager; 19 | } 20 | 21 | + (OHMySQLContainer *)sharedContainer { 22 | return [self sharedManager]; 23 | } 24 | 25 | - (OHMySQLStoreCoordinator *)storeCoordinator { 26 | return self.mainQueryContext.storeCoordinator; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/OHMySQLSerialization.h: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 9/29/15. 2 | // Copyright © 2015 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | @import Foundation; 6 | #import "OHCharsetEncoding.h" 7 | 8 | /// Responsible for seralization of responses. 9 | @interface OHMySQLSerialization : NSObject 10 | 11 | /** 12 | * Serialize C string into an object. Takes into account default value of the fields. 13 | * 14 | * @param cString C array of bytes. 15 | * @param field Representation of one row of data. 16 | * 17 | * @return Object of NSString or NSSNumber classes, or [NSNull null] if the value can be 'NULL'. 18 | */ 19 | + (nonnull id)objectFromCString:(nullable const char *)cString 20 | field:(nonnull const void *)field 21 | encoding:(CharsetEncoding)encoding; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/OHMySQLSerialization.m: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 9/29/15. 2 | // Copyright © 2015 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | #import "OHMySQLSerialization.h" 6 | #import "lib/include/mysql.h" 7 | 8 | #import "NSNumber+OHSerialization.h" 9 | #import "NSString+OHSerialization.h" 10 | 11 | 12 | @implementation OHMySQLSerialization 13 | 14 | + (id)objectFromCString:(const char *)cString field:(const void *)pointer encoding:(CharsetEncoding)encoding { 15 | MYSQL_FIELD *field = (MYSQL_FIELD *)pointer; 16 | // Indicates whether the value can be 'NULL'. 17 | BOOL canBeNull = !IS_NOT_NULL(field->flags); 18 | BOOL isNumber = IS_NUM(field->type); 19 | BOOL hasDefaultValue = (field->def_length > 0 && field->def != nil); 20 | char *defaultaValue = hasDefaultValue ? field->def : nil; 21 | 22 | if (isNumber) { 23 | return [NSNumber serializeFromCString:cString 24 | defaultValue:defaultaValue 25 | canBeNull:canBeNull 26 | encoding:encoding]; 27 | } 28 | 29 | 30 | return [NSString serializeFromCString:cString 31 | defaultValue:defaultaValue 32 | canBeNull:canBeNull 33 | encoding:encoding]; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/OHMySQLStoreCoordinator.h: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 6/14/16. 2 | // Copyright © 2016 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | @import Foundation; 6 | #import "OHConstants.h" 7 | 8 | @class OHMySQLUser, OHMySQLStore; 9 | 10 | @interface OHMySQLStoreCoordinator : NSObject 11 | 12 | /// Nonnull after connection with DB. 13 | @property (nonatomic, strong, readonly, nullable) OHMySQLStore *store; 14 | 15 | /// Nonnull after connection with DB. 16 | @property (nonatomic, strong, readonly, nullable) OHMySQLUser *user; 17 | 18 | /// Nonnull after connection with DB. You don't need to use this property at all. 19 | @property (readonly, nullable) void *mysql; 20 | 21 | /// Pings the server and indicates whether the connection to the server is working. 22 | @property (assign, readonly, getter=isConnected) BOOL connected; 23 | 24 | /// One of the protocols. Needs to be set before calling -connect. 25 | @property (nonatomic, assign) OHProtocolType protocol; 26 | 27 | /// The default character set for the current connection. By default UTF-8. 28 | @property (nonatomic, assign) CharsetEncoding encoding; 29 | 30 | - (nonnull instancetype)initWithUser:(nonnull OHMySQLUser *)user; 31 | 32 | /// Attempts to establish a connection to a MySQL database engine. Also tries establish SSL connection if it is specified. 33 | - (void)connect; 34 | 35 | /** 36 | * @param database Name of the target db. 37 | * 38 | * @return Zero for success. Nonzero if an error occurred (see enum). 39 | */ 40 | - (OHResultErrorType)selectDataBase:(nonnull NSString *)database; 41 | 42 | /// Closes a previously opened connection. 43 | - (void)disconnect; 44 | 45 | /** 46 | * Asks the database server to shut down. The connected user must have the SHUTDOWN privilege. 47 | * 48 | * @return Zero for success. Nonzero if an error occurred. 49 | */ 50 | - (OHResultErrorType)shutdown; 51 | 52 | /** 53 | * Flushes tables or caches, or resets replication server information. The connected user must have the RELOAD privilege. 54 | * 55 | * @param options A bit mask composed from any combination. 56 | * 57 | * @return Zero for success. Nonzero if an error occurred (see enum). 58 | */ 59 | - (OHResultErrorType)refresh:(OHRefreshOptions)options; 60 | 61 | /** 62 | * Checks whether the connection to the server is working. If the connection has gone down and auto-reconnect is enabled an attempt to reconnect is made. 63 | * 64 | * @return Zero if the connection to the server is active. Nonzero if an error occurred. A nonzero return does not indicate whether the MySQL server itself is down; the connection might be broken for other reasons such as network problems. 65 | */ 66 | - (OHResultErrorType)pingMySQL __attribute__((warn_unused_result)); 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/OHSerializationProtocol.h: -------------------------------------------------------------------------------- 1 | // Created by Oleg on 1/10/17. 2 | // Copyright © 2017 Oleg Hnidets. All rights reserved. 3 | // 4 | 5 | @import Foundation; 6 | #import "OHCharsetEncoding.h" 7 | 8 | @protocol OHSerialization 9 | 10 | + (nonnull id)serializeFromCString:(nullable const char *)cString 11 | defaultValue:(nullable const char *)defaultValue 12 | canBeNull:(BOOL)canBeNull 13 | encoding:(CharsetEncoding)encoding; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/lib/include/binary_log_types.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | /** 17 | @file binary_log_types.h 18 | 19 | @brief This file contains the field type. 20 | 21 | 22 | @note This file can be imported both from C and C++ code, so the 23 | definitions have to be constructed to support this. 24 | */ 25 | 26 | #ifndef BINARY_LOG_TYPES_INCLUDED 27 | #define BINARY_LOG_TYPES_INCLUDED 28 | 29 | #ifdef __cplusplus 30 | extern "C" 31 | { 32 | #endif 33 | 34 | /* 35 | * Constants exported from this package. 36 | */ 37 | 38 | typedef enum enum_field_types { 39 | MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY, 40 | MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG, 41 | MYSQL_TYPE_FLOAT, MYSQL_TYPE_DOUBLE, 42 | MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP, 43 | MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24, 44 | MYSQL_TYPE_DATE, MYSQL_TYPE_TIME, 45 | MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR, 46 | MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR, 47 | MYSQL_TYPE_BIT, 48 | MYSQL_TYPE_TIMESTAMP2, 49 | MYSQL_TYPE_DATETIME2, 50 | MYSQL_TYPE_TIME2, 51 | MYSQL_TYPE_JSON=245, 52 | MYSQL_TYPE_NEWDECIMAL=246, 53 | MYSQL_TYPE_ENUM=247, 54 | MYSQL_TYPE_SET=248, 55 | MYSQL_TYPE_TINY_BLOB=249, 56 | MYSQL_TYPE_MEDIUM_BLOB=250, 57 | MYSQL_TYPE_LONG_BLOB=251, 58 | MYSQL_TYPE_BLOB=252, 59 | MYSQL_TYPE_VAR_STRING=253, 60 | MYSQL_TYPE_STRING=254, 61 | MYSQL_TYPE_GEOMETRY=255 62 | } enum_field_types; 63 | 64 | #define DATETIME_MAX_DECIMALS 6 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif // __cplusplus 69 | 70 | #endif /* BINARY_LOG_TYPES_INCLUDED */ 71 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/lib/include/byte_order_generic.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | /* 17 | Endianness-independent definitions for architectures other 18 | than the x86 architecture. 19 | */ 20 | static inline int16 sint2korr(const uchar *A) 21 | { 22 | return 23 | (int16) (((int16) (A[0])) + 24 | ((int16) (A[1]) << 8)) 25 | ; 26 | } 27 | 28 | static inline int32 sint4korr(const uchar *A) 29 | { 30 | return 31 | (int32) (((int32) (A[0])) + 32 | (((int32) (A[1]) << 8)) + 33 | (((int32) (A[2]) << 16)) + 34 | (((int32) (A[3]) << 24))) 35 | ; 36 | } 37 | 38 | static inline uint16 uint2korr(const uchar *A) 39 | { 40 | return 41 | (uint16) (((uint16) (A[0])) + 42 | ((uint16) (A[1]) << 8)) 43 | ; 44 | } 45 | 46 | static inline uint32 uint4korr(const uchar *A) 47 | { 48 | return 49 | (uint32) (((uint32) (A[0])) + 50 | (((uint32) (A[1])) << 8) + 51 | (((uint32) (A[2])) << 16) + 52 | (((uint32) (A[3])) << 24)) 53 | ; 54 | } 55 | 56 | static inline ulonglong uint8korr(const uchar *A) 57 | { 58 | return 59 | ((ulonglong)(((uint32) (A[0])) + 60 | (((uint32) (A[1])) << 8) + 61 | (((uint32) (A[2])) << 16) + 62 | (((uint32) (A[3])) << 24)) + 63 | (((ulonglong) (((uint32) (A[4])) + 64 | (((uint32) (A[5])) << 8) + 65 | (((uint32) (A[6])) << 16) + 66 | (((uint32) (A[7])) << 24))) << 67 | 32)) 68 | ; 69 | } 70 | 71 | static inline longlong sint8korr(const uchar *A) 72 | { 73 | return (longlong) uint8korr(A); 74 | } 75 | 76 | static inline void int2store(uchar *T, uint16 A) 77 | { 78 | uint def_temp= A ; 79 | *(T)= (uchar)(def_temp); 80 | *(T+1)= (uchar)(def_temp >> 8); 81 | } 82 | 83 | static inline void int4store(uchar *T, uint32 A) 84 | { 85 | *(T)= (uchar) (A); 86 | *(T+1)=(uchar) (A >> 8); 87 | *(T+2)=(uchar) (A >> 16); 88 | *(T+3)=(uchar) (A >> 24); 89 | } 90 | 91 | static inline void int8store(uchar *T, ulonglong A) 92 | { 93 | uint def_temp= (uint) A, 94 | def_temp2= (uint) (A >> 32); 95 | int4store(T, def_temp); 96 | int4store(T+4,def_temp2); 97 | } 98 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/lib/include/byte_order_generic_x86.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | /* 17 | Optimized functions for the x86 architecture (_WIN32 included). 18 | 19 | x86 handles misaligned reads and writes just fine, so suppress 20 | UBSAN warnings for these functions. 21 | */ 22 | static inline int16 sint2korr(const uchar *A) SUPPRESS_UBSAN; 23 | static inline int16 sint2korr(const uchar *A) { return *((int16*) A); } 24 | 25 | static inline int32 sint4korr(const uchar *A) SUPPRESS_UBSAN; 26 | static inline int32 sint4korr(const uchar *A) { return *((int32*) A); } 27 | 28 | static inline uint16 uint2korr(const uchar *A) SUPPRESS_UBSAN; 29 | static inline uint16 uint2korr(const uchar *A) { return *((uint16*) A); } 30 | 31 | static inline uint32 uint4korr(const uchar *A) SUPPRESS_UBSAN; 32 | static inline uint32 uint4korr(const uchar *A) { return *((uint32*) A); } 33 | 34 | static inline ulonglong uint8korr(const uchar *A) SUPPRESS_UBSAN; 35 | static inline ulonglong uint8korr(const uchar *A) { return *((ulonglong*) A);} 36 | 37 | static inline longlong sint8korr(const uchar *A) SUPPRESS_UBSAN; 38 | static inline longlong sint8korr(const uchar *A) { return *((longlong*) A); } 39 | 40 | static inline void int2store(uchar *T, uint16 A) SUPPRESS_UBSAN; 41 | static inline void int2store(uchar *T, uint16 A) 42 | { 43 | *((uint16*) T)= A; 44 | } 45 | 46 | static inline void int4store(uchar *T, uint32 A) SUPPRESS_UBSAN; 47 | static inline void int4store(uchar *T, uint32 A) 48 | { 49 | *((uint32*) T)= A; 50 | } 51 | 52 | static inline void int8store(uchar *T, ulonglong A) SUPPRESS_UBSAN; 53 | static inline void int8store(uchar *T, ulonglong A) 54 | { 55 | *((ulonglong*) T)= A; 56 | } 57 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/lib/include/my_alloc.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | /* 17 | Data structures for mysys/my_alloc.c (root memory allocator) 18 | */ 19 | 20 | #ifndef _my_alloc_h 21 | #define _my_alloc_h 22 | 23 | #define ALLOC_MAX_BLOCK_TO_DROP 4096 24 | #define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP 10 25 | 26 | /* PSI_memory_key */ 27 | #include "mysql/psi/psi_memory.h" 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | typedef struct st_used_mem 34 | { /* struct for once_alloc (block) */ 35 | struct st_used_mem *next; /* Next block in use */ 36 | unsigned int left; /* memory left in block */ 37 | unsigned int size; /* size of block */ 38 | } USED_MEM; 39 | 40 | 41 | typedef struct st_mem_root 42 | { 43 | USED_MEM *free; /* blocks with free memory in it */ 44 | USED_MEM *used; /* blocks almost without free memory */ 45 | USED_MEM *pre_alloc; /* preallocated block */ 46 | /* if block have less memory it will be put in 'used' list */ 47 | size_t min_malloc; 48 | size_t block_size; /* initial block size */ 49 | unsigned int block_num; /* allocated blocks counter */ 50 | /* 51 | first free block in queue test counter (if it exceed 52 | MAX_BLOCK_USAGE_BEFORE_DROP block will be dropped in 'used' list) 53 | */ 54 | unsigned int first_block_usage; 55 | 56 | void (*error_handler)(void); 57 | 58 | PSI_memory_key m_psi_key; 59 | } MEM_ROOT; 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/lib/include/my_command.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #ifndef _mysql_command_h 17 | #define _mysql_command_h 18 | 19 | /** 20 | @enum enum_server_command 21 | @brief You should add new commands to the end of this list, otherwise old 22 | servers won't be able to handle them as 'unsupported'. 23 | */ 24 | enum enum_server_command 25 | { 26 | COM_SLEEP, 27 | COM_QUIT, 28 | COM_INIT_DB, 29 | COM_QUERY, 30 | COM_FIELD_LIST, 31 | COM_CREATE_DB, 32 | COM_DROP_DB, 33 | COM_REFRESH, 34 | COM_SHUTDOWN, 35 | COM_STATISTICS, 36 | COM_PROCESS_INFO, 37 | COM_CONNECT, 38 | COM_PROCESS_KILL, 39 | COM_DEBUG, 40 | COM_PING, 41 | COM_TIME, 42 | COM_DELAYED_INSERT, 43 | COM_CHANGE_USER, 44 | COM_BINLOG_DUMP, 45 | COM_TABLE_DUMP, 46 | COM_CONNECT_OUT, 47 | COM_REGISTER_SLAVE, 48 | COM_STMT_PREPARE, 49 | COM_STMT_EXECUTE, 50 | COM_STMT_SEND_LONG_DATA, 51 | COM_STMT_CLOSE, 52 | COM_STMT_RESET, 53 | COM_SET_OPTION, 54 | COM_STMT_FETCH, 55 | COM_DAEMON, 56 | COM_BINLOG_DUMP_GTID, 57 | COM_RESET_CONNECTION, 58 | /* don't forget to update const char *command_name[] in sql_parse.cc */ 59 | 60 | /* Must be last */ 61 | COM_END 62 | }; 63 | 64 | #endif /* _mysql_command_h */ 65 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/lib/include/my_list.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #ifndef _list_h_ 17 | #define _list_h_ 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | typedef struct st_list { 24 | struct st_list *prev,*next; 25 | void *data; 26 | } LIST; 27 | 28 | typedef int (*list_walk_action)(void *,void *); 29 | 30 | extern LIST *list_add(LIST *root,LIST *element); 31 | extern LIST *list_delete(LIST *root,LIST *element); 32 | extern LIST *list_cons(void *data,LIST *root); 33 | extern LIST *list_reverse(LIST *root); 34 | extern void list_free(LIST *root,unsigned int free_data); 35 | extern unsigned int list_length(LIST *); 36 | extern int list_walk(LIST *,list_walk_action action,unsigned char * argument); 37 | 38 | #define list_rest(a) ((a)->next) 39 | #define list_push(a,b) (a)=list_cons((b),(a)) 40 | #define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old); my_free(old); } 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | #endif 46 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/lib/include/mysql/client_authentication.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | #ifndef CLIENT_AUTHENTICATION_H 16 | #define CLIENT_AUTHENTICATION_H 17 | #include 18 | #include "mysql.h" 19 | #include "mysql/client_plugin.h" 20 | 21 | C_MODE_START 22 | int sha256_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql); 23 | int sha256_password_init(char *, size_t, int, va_list); 24 | int sha256_password_deinit(void); 25 | C_MODE_END 26 | 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/lib/include/mysql/client_plugin.h.pp: -------------------------------------------------------------------------------- 1 | struct st_mysql_client_plugin 2 | { 3 | int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; const char *license; void *mysql_api; int (*init)(char *, size_t, int, va_list); int (*deinit)(void); int (*options)(const char *option, const void *); 4 | }; 5 | struct st_mysql; 6 | #include "plugin_auth_common.h" 7 | typedef struct st_plugin_vio_info 8 | { 9 | enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET, 10 | MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol; 11 | int socket; 12 | } MYSQL_PLUGIN_VIO_INFO; 13 | typedef struct st_plugin_vio 14 | { 15 | int (*read_packet)(struct st_plugin_vio *vio, 16 | unsigned char **buf); 17 | int (*write_packet)(struct st_plugin_vio *vio, 18 | const unsigned char *packet, 19 | int packet_len); 20 | void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info); 21 | } MYSQL_PLUGIN_VIO; 22 | struct st_mysql_client_plugin_AUTHENTICATION 23 | { 24 | int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; const char *license; void *mysql_api; int (*init)(char *, size_t, int, va_list); int (*deinit)(void); int (*options)(const char *option, const void *); 25 | int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql); 26 | }; 27 | struct st_mysql_client_plugin * 28 | mysql_load_plugin(struct st_mysql *mysql, const char *name, int type, 29 | int argc, ...); 30 | struct st_mysql_client_plugin * 31 | mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type, 32 | int argc, va_list args); 33 | struct st_mysql_client_plugin * 34 | mysql_client_find_plugin(struct st_mysql *mysql, const char *name, int type); 35 | struct st_mysql_client_plugin * 36 | mysql_client_register_plugin(struct st_mysql *mysql, 37 | struct st_mysql_client_plugin *plugin); 38 | int mysql_plugin_options(struct st_mysql_client_plugin *plugin, 39 | const char *option, const void *value); 40 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/lib/include/mysql/get_password.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | /* 17 | ** Ask for a password from tty 18 | ** This is an own file to avoid conflicts with curses 19 | */ 20 | 21 | #ifndef MYSQL_GET_PASSWORD_H_INCLUDED 22 | #define MYSQL_GET_PASSWORD_H_INCLUDED 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | typedef char *(* strdup_handler_t)(const char *, int); 29 | char *get_tty_password_ext(const char *opt_message, 30 | strdup_handler_t strdup_function); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif /* ! MYSQL_GET_PASSWORD_H_INCLUDED */ 37 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/lib/include/mysql/mysql_lex_string.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #ifndef MYSQL_LEX_STRING_INCLUDED 17 | #define MYSQL_LEX_STRING_INCLUDED 18 | 19 | struct st_mysql_lex_string 20 | { 21 | char *str; 22 | size_t length; 23 | }; 24 | typedef struct st_mysql_lex_string MYSQL_LEX_STRING; 25 | 26 | struct st_mysql_const_lex_string 27 | { 28 | const char *str; 29 | size_t length; 30 | }; 31 | typedef struct st_mysql_const_lex_string MYSQL_LEX_CSTRING; 32 | 33 | #endif // MYSQL_LEX_STRING_INCLUDED 34 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/lib/include/mysql/psi/mysql_idle.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software Foundation, 14 | 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ 15 | 16 | #ifndef MYSQL_IDLE_H 17 | #define MYSQL_IDLE_H 18 | 19 | /** 20 | @file mysql/psi/mysql_idle.h 21 | Instrumentation helpers for idle waits. 22 | */ 23 | 24 | #include "mysql/psi/psi.h" 25 | 26 | #ifndef PSI_IDLE_CALL 27 | #define PSI_IDLE_CALL(M) PSI_DYNAMIC_CALL(M) 28 | #endif 29 | 30 | /** 31 | @defgroup Idle_instrumentation Idle Instrumentation 32 | @ingroup Instrumentation_interface 33 | @{ 34 | */ 35 | 36 | /** 37 | @def MYSQL_START_IDLE_WAIT 38 | Instrumentation helper for table io_waits. 39 | This instrumentation marks the start of a wait event. 40 | @param LOCKER the locker 41 | @param STATE the locker state 42 | @sa MYSQL_END_IDLE_WAIT. 43 | */ 44 | #ifdef HAVE_PSI_IDLE_INTERFACE 45 | #define MYSQL_START_IDLE_WAIT(LOCKER, STATE) \ 46 | LOCKER= inline_mysql_start_idle_wait(STATE, __FILE__, __LINE__) 47 | #else 48 | #define MYSQL_START_IDLE_WAIT(LOCKER, STATE) \ 49 | do {} while (0) 50 | #endif 51 | 52 | /** 53 | @def MYSQL_END_IDLE_WAIT 54 | Instrumentation helper for idle waits. 55 | This instrumentation marks the end of a wait event. 56 | @param LOCKER the locker 57 | @sa MYSQL_START_IDLE_WAIT. 58 | */ 59 | #ifdef HAVE_PSI_IDLE_INTERFACE 60 | #define MYSQL_END_IDLE_WAIT(LOCKER) \ 61 | inline_mysql_end_idle_wait(LOCKER) 62 | #else 63 | #define MYSQL_END_IDLE_WAIT(LOCKER) \ 64 | do {} while (0) 65 | #endif 66 | 67 | #ifdef HAVE_PSI_IDLE_INTERFACE 68 | /** 69 | Instrumentation calls for MYSQL_START_IDLE_WAIT. 70 | @sa MYSQL_END_IDLE_WAIT. 71 | */ 72 | static inline struct PSI_idle_locker * 73 | inline_mysql_start_idle_wait(PSI_idle_locker_state *state, 74 | const char *src_file, int src_line) 75 | { 76 | struct PSI_idle_locker *locker; 77 | locker= PSI_IDLE_CALL(start_idle_wait)(state, src_file, src_line); 78 | return locker; 79 | } 80 | 81 | /** 82 | Instrumentation calls for MYSQL_END_IDLE_WAIT. 83 | @sa MYSQL_START_IDLE_WAIT. 84 | */ 85 | static inline void 86 | inline_mysql_end_idle_wait(struct PSI_idle_locker *locker) 87 | { 88 | if (likely(locker != NULL)) 89 | PSI_IDLE_CALL(end_idle_wait)(locker); 90 | } 91 | #endif 92 | 93 | /** @} (end of group Idle_instrumentation) */ 94 | 95 | #endif 96 | 97 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/lib/include/mysql/psi/mysql_memory.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software Foundation, 14 | 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ 15 | 16 | #ifndef MYSQL_MEMORY_H 17 | #define MYSQL_MEMORY_H 18 | 19 | /** 20 | @file mysql/psi/mysql_memory.h 21 | Instrumentation helpers for memory allocation. 22 | */ 23 | 24 | #include "mysql/psi/psi.h" 25 | 26 | #ifndef PSI_MEMORY_CALL 27 | #define PSI_MEMORY_CALL(M) PSI_DYNAMIC_CALL(M) 28 | #endif 29 | 30 | /** 31 | @defgroup Memory_instrumentation Memory Instrumentation 32 | @ingroup Instrumentation_interface 33 | @{ 34 | */ 35 | 36 | /** 37 | @def mysql_memory_register(P1, P2, P3) 38 | Memory registration. 39 | */ 40 | #define mysql_memory_register(P1, P2, P3) \ 41 | inline_mysql_memory_register(P1, P2, P3) 42 | 43 | static inline void inline_mysql_memory_register( 44 | #ifdef HAVE_PSI_MEMORY_INTERFACE 45 | const char *category, 46 | PSI_memory_info *info, 47 | int count) 48 | #else 49 | const char *category MY_ATTRIBUTE((unused)), 50 | void *info MY_ATTRIBUTE((unused)), 51 | int count MY_ATTRIBUTE((unused))) 52 | #endif 53 | { 54 | #ifdef HAVE_PSI_MEMORY_INTERFACE 55 | PSI_MEMORY_CALL(register_memory)(category, info, count); 56 | #endif 57 | } 58 | 59 | /** @} (end of group Memory_instrumentation) */ 60 | 61 | #endif 62 | 63 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/lib/include/mysql/service_mysql_alloc.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #ifndef MYSQL_SERVICE_MYSQL_ALLOC_INCLUDED 17 | #define MYSQL_SERVICE_MYSQL_ALLOC_INCLUDED 18 | 19 | #ifndef MYSQL_ABI_CHECK 20 | #include 21 | #endif 22 | 23 | /* PSI_memory_key */ 24 | #include "mysql/psi/psi_memory.h" 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* myf */ 31 | typedef int myf_t; 32 | 33 | typedef void * (*mysql_malloc_t)(PSI_memory_key key, size_t size, myf_t flags); 34 | typedef void * (*mysql_realloc_t)(PSI_memory_key key, void *ptr, size_t size, myf_t flags); 35 | typedef void (*mysql_claim_t)(void *ptr); 36 | typedef void (*mysql_free_t)(void *ptr); 37 | typedef void * (*my_memdup_t)(PSI_memory_key key, const void *from, size_t length, myf_t flags); 38 | typedef char * (*my_strdup_t)(PSI_memory_key key, const char *from, myf_t flags); 39 | typedef char * (*my_strndup_t)(PSI_memory_key key, const char *from, size_t length, myf_t flags); 40 | 41 | struct mysql_malloc_service_st 42 | { 43 | mysql_malloc_t mysql_malloc; 44 | mysql_realloc_t mysql_realloc; 45 | mysql_claim_t mysql_claim; 46 | mysql_free_t mysql_free; 47 | my_memdup_t my_memdup; 48 | my_strdup_t my_strdup; 49 | my_strndup_t my_strndup; 50 | }; 51 | 52 | extern struct mysql_malloc_service_st *mysql_malloc_service; 53 | 54 | #ifdef MYSQL_DYNAMIC_PLUGIN 55 | 56 | #define my_malloc mysql_malloc_service->mysql_malloc 57 | #define my_realloc mysql_malloc_service->mysql_realloc 58 | #define my_claim mysql_malloc_service->mysql_claim 59 | #define my_free mysql_malloc_service->mysql_free 60 | #define my_memdup mysql_malloc_service->my_memdup 61 | #define my_strdup mysql_malloc_service->my_strdup 62 | #define my_strndup mysql_malloc_service->my_strndup 63 | 64 | #else 65 | 66 | extern void * my_malloc(PSI_memory_key key, size_t size, myf_t flags); 67 | extern void * my_realloc(PSI_memory_key key, void *ptr, size_t size, myf_t flags); 68 | extern void my_claim(void *ptr); 69 | extern void my_free(void *ptr); 70 | extern void * my_memdup(PSI_memory_key key, const void *from, size_t length, myf_t flags); 71 | extern char * my_strdup(PSI_memory_key key, const char *from, myf_t flags); 72 | extern char * my_strndup(PSI_memory_key key, const char *from, size_t length, myf_t flags); 73 | 74 | #endif 75 | 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | #endif 81 | 82 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/lib/include/mysql_com_server.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | /* 17 | Definitions private to the server, 18 | used in the networking layer to notify specific events. 19 | */ 20 | 21 | #ifndef _mysql_com_server_h 22 | #define _mysql_com_server_h 23 | 24 | struct st_net_server; 25 | 26 | typedef void (*before_header_callback_fn) 27 | (struct st_net *net, void *user_data, size_t count); 28 | 29 | typedef void (*after_header_callback_fn) 30 | (struct st_net *net, void *user_data, size_t count, my_bool rc); 31 | 32 | struct st_net_server 33 | { 34 | before_header_callback_fn m_before_header; 35 | after_header_callback_fn m_after_header; 36 | void *m_user_data; 37 | }; 38 | 39 | typedef struct st_net_server NET_SERVER; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/lib/include/mysql_embed.h: -------------------------------------------------------------------------------- 1 | #ifndef MYSQL_EMBED_INCLUDED 2 | #define MYSQL_EMBED_INCLUDED 3 | 4 | /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; version 2 of the License. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 18 | 19 | /* Defines that are unique to the embedded version of MySQL */ 20 | 21 | #ifdef EMBEDDED_LIBRARY 22 | 23 | /* Things we don't need in the embedded version of MySQL */ 24 | /* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */ 25 | 26 | #undef HAVE_DLOPEN /* No udf functions */ 27 | 28 | #endif /* EMBEDDED_LIBRARY */ 29 | #endif /* MYSQL_EMBED_INCLUDED */ 30 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/lib/include/mysql_time.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ 15 | 16 | #ifndef _mysql_time_h_ 17 | #define _mysql_time_h_ 18 | 19 | /* 20 | Time declarations shared between the server and client API: 21 | you should not add anything to this header unless it's used 22 | (and hence should be visible) in mysql.h. 23 | If you're looking for a place to add new time-related declaration, 24 | it's most likely my_time.h. See also "C API Handling of Date 25 | and Time Values" chapter in documentation. 26 | */ 27 | 28 | enum enum_mysql_timestamp_type 29 | { 30 | MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1, 31 | MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2 32 | }; 33 | 34 | 35 | /* 36 | Structure which is used to represent datetime values inside MySQL. 37 | 38 | We assume that values in this structure are normalized, i.e. year <= 9999, 39 | month <= 12, day <= 31, hour <= 23, hour <= 59, hour <= 59. Many functions 40 | in server such as my_system_gmt_sec() or make_time() family of functions 41 | rely on this (actually now usage of make_*() family relies on a bit weaker 42 | restriction). Also functions that produce MYSQL_TIME as result ensure this. 43 | There is one exception to this rule though if this structure holds time 44 | value (time_type == MYSQL_TIMESTAMP_TIME) days and hour member can hold 45 | bigger values. 46 | */ 47 | typedef struct st_mysql_time 48 | { 49 | unsigned int year, month, day, hour, minute, second; 50 | unsigned long second_part; /**< microseconds */ 51 | my_bool neg; 52 | enum enum_mysql_timestamp_type time_type; 53 | } MYSQL_TIME; 54 | 55 | #endif /* _mysql_time_h_ */ 56 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/lib/include/mysql_version.h: -------------------------------------------------------------------------------- 1 | /* Copyright Abandoned 1996,1999 TCX DataKonsult AB & Monty Program KB 2 | & Detron HB, 1996, 1999-2004, 2007 MySQL AB. 3 | This file is public domain and comes with NO WARRANTY of any kind 4 | */ 5 | 6 | /* Version numbers for protocol & mysqld */ 7 | 8 | #ifndef _mysql_version_h 9 | #define _mysql_version_h 10 | #ifdef _CUSTOMCONFIG_ 11 | #include 12 | #else 13 | #define PROTOCOL_VERSION 10 14 | #define MYSQL_SERVER_VERSION "5.7.16" 15 | #define MYSQL_VERSION_ID 50716 16 | #define MYSQL_PORT 3306 17 | #define MYSQL_PORT_DEFAULT 0 18 | #define MYSQL_UNIX_ADDR "/tmp/mysql.sock" 19 | #define MYSQL_CONFIG_NAME "my" 20 | #define MYSQL_COMPILATION_COMMENT "MySQL Connector/C (GPL)" 21 | #define LIBMYSQL_VERSION "6.1.9" 22 | #define LIBMYSQL_VERSION_ID 60109 23 | 24 | /* mysqld compile time options */ 25 | #endif /* _CUSTOMCONFIG_ */ 26 | 27 | #ifndef LICENSE 28 | #define LICENSE GPL 29 | #endif /* LICENSE */ 30 | 31 | #endif /* _mysql_version_h */ 32 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/lib/include/sslopt-case.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 15 | 16 | #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) 17 | 18 | #ifndef MYSQL_CLIENT 19 | #error This header is supposed to be used only in the client 20 | #endif 21 | 22 | case OPT_SSL_MODE: 23 | opt_ssl_mode= find_type_or_exit(argument, &ssl_mode_typelib, 24 | opt->name); 25 | ssl_mode_set_explicitly= TRUE; 26 | break; 27 | case OPT_SSL_SSL: 28 | CLIENT_WARN_DEPRECATED("--ssl", "--ssl-mode"); 29 | if (!opt_use_ssl_arg) 30 | opt_ssl_mode= SSL_MODE_DISABLED; 31 | else if (opt_ssl_mode < SSL_MODE_REQUIRED) 32 | opt_ssl_mode= SSL_MODE_REQUIRED; 33 | break; 34 | case OPT_SSL_VERIFY_SERVER_CERT: 35 | CLIENT_WARN_DEPRECATED("--ssl-verify-server-cert", 36 | "--ssl-mode=VERIFY_IDENTITY"); 37 | if (!opt_ssl_verify_server_cert_arg) 38 | { 39 | if (opt_ssl_mode >= SSL_MODE_VERIFY_IDENTITY) 40 | opt_ssl_mode= SSL_MODE_VERIFY_CA; 41 | } 42 | else 43 | opt_ssl_mode= SSL_MODE_VERIFY_IDENTITY; 44 | break; 45 | case OPT_SSL_CA: 46 | case OPT_SSL_CAPATH: 47 | /* Don't change ssl-mode if set explicitly. */ 48 | if (!ssl_mode_set_explicitly) 49 | opt_ssl_mode= SSL_MODE_VERIFY_CA; 50 | break; 51 | case OPT_SSL_KEY: 52 | case OPT_SSL_CERT: 53 | case OPT_SSL_CIPHER: 54 | case OPT_SSL_CRL: 55 | case OPT_SSL_CRLPATH: 56 | case OPT_TLS_VERSION: 57 | #ifdef HAVE_YASSL 58 | /* crl has no effect in yaSSL. */ 59 | opt_ssl_crl= NULL; 60 | opt_ssl_crlpath= NULL; 61 | #endif /* HAVE_YASSL */ 62 | break; 63 | #endif /* HAVE_OPENSSL */ 64 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/lib/include/typelib.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ 15 | 16 | 17 | #ifndef _typelib_h 18 | #define _typelib_h 19 | 20 | #include "my_alloc.h" 21 | 22 | typedef struct st_typelib { /* Different types saved here */ 23 | unsigned int count; /* How many types */ 24 | const char *name; /* Name of typelib */ 25 | const char **type_names; 26 | unsigned int *type_lengths; 27 | } TYPELIB; 28 | 29 | extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position); 30 | extern int find_type_or_exit(const char *x, TYPELIB *typelib, 31 | const char *option); 32 | #define FIND_TYPE_BASIC 0 33 | /** makes @c find_type() require the whole name, no prefix */ 34 | #define FIND_TYPE_NO_PREFIX (1 << 0) 35 | /** always implicitely on, so unused, but old code may pass it */ 36 | #define FIND_TYPE_NO_OVERWRITE (1 << 1) 37 | /** makes @c find_type() accept a number */ 38 | #define FIND_TYPE_ALLOW_NUMBER (1 << 2) 39 | /** makes @c find_type() treat ',' as terminator */ 40 | #define FIND_TYPE_COMMA_TERM (1 << 3) 41 | 42 | extern int find_type(const char *x, const TYPELIB *typelib, unsigned int flags); 43 | extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); 44 | extern const char *get_type(TYPELIB *typelib,unsigned int nr); 45 | extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); 46 | 47 | extern TYPELIB sql_protocol_typelib; 48 | 49 | my_ulonglong find_set_from_flags(const TYPELIB *lib, unsigned int default_name, 50 | my_ulonglong cur_set, my_ulonglong default_set, 51 | const char *str, unsigned int length, 52 | char **err_pos, unsigned int *err_len); 53 | 54 | #endif /* _typelib_h */ 55 | -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/lib/ios/libmysqlclient.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/OHMySQL/lib/ios/libmysqlclient.a -------------------------------------------------------------------------------- /智慧校园/Other/OHMySQL/lib/mac/libmysqlclient.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/OHMySQL/lib/mac/libmysqlclient.a -------------------------------------------------------------------------------- /智慧校园/Other/QRCode/HMScanerCardViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HMScanerCardViewController.h 3 | // HMQRCodeScanner 4 | // 5 | // Created by 刘凡 on 16/1/3. 6 | // Copyright © 2016年 itheima. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HMScanerCardViewController : UIViewController 12 | 13 | - (instancetype)initWithCardName:(NSString *)cardName avatar:(UIImage *)avatar; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /智慧校园/Other/QRCode/HMScanerCardViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HMScanerCardViewController.m 3 | // HMQRCodeScanner 4 | // 5 | // Created by 刘凡 on 16/1/3. 6 | // Copyright © 2016年 itheima. All rights reserved. 7 | // 8 | 9 | #import "HMScanerCardViewController.h" 10 | #import "HMScanner.h" 11 | 12 | @interface HMScanerCardViewController() 13 | /// 名片字符串 14 | @property (nonatomic) NSString *cardName; 15 | /// 头像图片 16 | @property (nonatomic) UIImage *avatar; 17 | @end 18 | 19 | @implementation HMScanerCardViewController { 20 | UIImageView *cardImageView; 21 | } 22 | 23 | #pragma mark - 构造函数 24 | - (instancetype)initWithCardName:(NSString *)cardName avatar:(UIImage *)avatar { 25 | self = [super init]; 26 | if (self) { 27 | self.cardName = cardName; 28 | self.avatar = avatar; 29 | } 30 | return self; 31 | } 32 | 33 | #pragma mark - 设置界面 34 | - (void)viewDidLoad { 35 | [super viewDidLoad]; 36 | 37 | self.view.backgroundColor = [UIColor darkGrayColor]; 38 | [self prepareNavigationBar]; 39 | 40 | CGFloat width = self.view.bounds.size.width - 80; 41 | cardImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, width, width)]; 42 | cardImageView.center = self.view.center; 43 | 44 | [self.view addSubview:cardImageView]; 45 | 46 | [HMScanner qrImageWithString:self.cardName avatar:self.avatar completion:^(UIImage *image) { 47 | cardImageView.image = image; 48 | }]; 49 | } 50 | 51 | /// 准备导航栏 52 | - (void)prepareNavigationBar { 53 | // 1> 背景颜色 54 | [self.navigationController.navigationBar setBarTintColor:[UIColor colorWithWhite:0.1 alpha:1.0]]; 55 | self.navigationController.navigationBar.translucent = YES; 56 | self.navigationController.navigationBar.shadowImage = [[UIImage alloc] init]; 57 | 58 | // 2> 标题 59 | //self.title = @"我的名片"; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /智慧校园/Other/QRCode/HMScanner.bundle/QRCodeScanLine@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/QRCode/HMScanner.bundle/QRCodeScanLine@2x.png -------------------------------------------------------------------------------- /智慧校园/Other/QRCode/HMScanner.bundle/ScanQR1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/QRCode/HMScanner.bundle/ScanQR1@2x.png -------------------------------------------------------------------------------- /智慧校园/Other/QRCode/HMScanner.bundle/ScanQR2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/QRCode/HMScanner.bundle/ScanQR2@2x.png -------------------------------------------------------------------------------- /智慧校园/Other/QRCode/HMScanner.bundle/ScanQR3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/QRCode/HMScanner.bundle/ScanQR3@2x.png -------------------------------------------------------------------------------- /智慧校园/Other/QRCode/HMScanner.bundle/ScanQR4@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/Other/QRCode/HMScanner.bundle/ScanQR4@2x.png -------------------------------------------------------------------------------- /智慧校园/Other/QRCode/HMScanner.h: -------------------------------------------------------------------------------- 1 | // 2 | // HMScanner.h 3 | // HMQRCodeScanner 4 | // 5 | // Created by 刘凡 on 16/1/2. 6 | // Copyright © 2016年 itheima. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /// 二维码/条码扫描器 12 | @interface HMScanner : NSObject 13 | 14 | /// 使用视图实例化扫描器,扫描预览窗口会添加到指定视图中 15 | /// 16 | /// @param view 指定的视图 17 | /// @param scanFrame 扫描范围 18 | /// @param completion 完成回调 19 | /// 20 | /// @return 扫描器 21 | + (instancetype)scanerWithView:(UIView *)view scanFrame:(CGRect)scanFrame completion:(void (^)(NSString *stringValue))completion; 22 | 23 | /// 扫描图像 24 | /// 25 | /// @param image 包含二维码的图像 26 | /// @remark 目前只支持 64 位的 iOS 设备 27 | + (void)scaneImage:(UIImage *)image completion:(void (^)(NSArray *values))completion; 28 | 29 | /// 使用 string / 头像 异步生成二维码图像 30 | /// 31 | /// @param string 二维码图像的字符串 32 | /// @param avatar 头像图像,默认比例 0.2 33 | /// @param completion 完成回调 34 | + (void)qrImageWithString:(NSString *)string avatar:(UIImage *)avatar completion:(void (^)(UIImage *image))completion; 35 | 36 | /// 使用 string / 头像 异步生成二维码图像,并且指定头像占二维码图像的比例 37 | /// 38 | /// @param string 二维码图像的字符串 39 | /// @param avatar 头像图像 40 | /// @param scale 头像占二维码图像的比例 41 | /// @param completion 完成回调 42 | + (void)qrImageWithString:(NSString *)string avatar:(UIImage *)avatar scale:(CGFloat)scale completion:(void (^)(UIImage *))completion; 43 | 44 | /// 开始扫描 45 | - (void)startScan; 46 | /// 停止扫描 47 | - (void)stopScan; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /智慧校园/Other/QRCode/HMScannerBorder.h: -------------------------------------------------------------------------------- 1 | // 2 | // HMScannerBorder.h 3 | // HMQRCodeScanner 4 | // 5 | // Created by 刘凡 on 16/1/2. 6 | // Copyright © 2016年 itheima. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /// 扫描框视图 12 | @interface HMScannerBorder : UIView 13 | 14 | /// 开始扫描动画 15 | - (void)startScannerAnimating; 16 | /// 停止扫描动画 17 | - (void)stopScannerAnimating; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /智慧校园/Other/QRCode/HMScannerController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HMScannerController.h 3 | // HMQRCodeScanner 4 | // 5 | // Created by 刘凡 on 16/1/2. 6 | // Copyright © 2016年 itheima. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /*! 12 | 扫描控制器 13 | 14 | 作用: 15 | 16 | * 提供一个导航控制器,扫描 `二维码 / 条形码` 17 | * 能够生成指定 `字符串` + `avatar(可选)` 的二维码名片 18 | * 能够识别相册图片中的二维码(iOS 64 位设备) 19 | 20 | 使用: 21 | 22 | @code 23 | NSString *cardName = @"天涯刀哥 - 傅红雪"; 24 | UIImage *avatar = [UIImage imageNamed:@"avatar"]; 25 | 26 | // 实例化控制器,并指定完成回调 27 | HMScannerController *scanner = [HMScannerController scannerWithCardName:cardName avatar:avatar completion:^(NSString *stringValue) { 28 | 29 | self.scanResultLabel.text = stringValue; 30 | }]; 31 | 32 | // 设置导航标题样式 33 | [scanner setTitleColor:[UIColor whiteColor] tintColor:[UIColor greenColor]]; 34 | 35 | // 展现扫描控制器 36 | [self showDetailViewController:scanner sender:nil]; 37 | 38 | @endcode 39 | */ 40 | @interface HMScannerController : UINavigationController 41 | 42 | /// 使用 `名片字符串` 实例化扫描导航控制器 43 | /// 44 | /// @param cardName 名片字符串 45 | /// @param avatar 头像图像 46 | /// @param completion 完成回调 47 | /// 48 | /// @return 扫描导航控制器 49 | + (instancetype)scannerWithCardName:(NSString *)cardName avatar:(UIImage *)avatar completion:(void (^)(NSString *stringValue))completion; 50 | 51 | /// 使用 名片字符串 / 头像 异步生成二维码图像,并且指定头像占二维码图像的比例 52 | /// 53 | /// @param string 名片字符串 54 | /// @param avatar 头像图像 55 | /// @param scale 头像占二维码图像的比例 56 | /// @param completion 完成回调 57 | + (void)cardImageWithCardName:(NSString *)cardName avatar:(UIImage *)avatar scale:(CGFloat)scale completion:(void (^)(UIImage *image))completion; 58 | 59 | /// 设置导航栏标题颜色和 tintColor 60 | /// 61 | /// @param titleColor 标题颜色 62 | /// @param tintColor tintColor 63 | - (void)setTitleColor:(UIColor *)titleColor tintColor:(UIColor *)tintColor; 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /智慧校园/Other/QRCode/HMScannerController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HMScannerController.m 3 | // HMQRCodeScanner 4 | // 5 | // Created by 刘凡 on 16/1/2. 6 | // Copyright © 2016年 itheima. All rights reserved. 7 | // 8 | 9 | #import "HMScannerController.h" 10 | #import "HMScannerViewController.h" 11 | #import "HMScanner.h" 12 | 13 | @implementation HMScannerController 14 | 15 | + (void)cardImageWithCardName:(NSString *)cardName avatar:(UIImage *)avatar scale:(CGFloat)scale completion:(void (^)(UIImage *))completion { 16 | [HMScanner qrImageWithString:cardName avatar:avatar scale:scale completion:completion]; 17 | } 18 | 19 | + (instancetype)scannerWithCardName:(NSString *)cardName avatar:(UIImage *)avatar completion:(void (^)(NSString *))completion { 20 | NSAssert(completion != nil, @"必须传入完成回调"); 21 | 22 | return [[self alloc] initWithCardName:cardName avatar:avatar completion:completion]; 23 | } 24 | 25 | - (instancetype)initWithCardName:(NSString *)cardName avatar:(UIImage *)avatar completion:(void (^)(NSString *))completion { 26 | self = [super init]; 27 | if (self) { 28 | HMScannerViewController *scanner = [[HMScannerViewController alloc] initWithCardName:cardName avatar:avatar completion:completion]; 29 | 30 | [self setTitleColor:[UIColor whiteColor] tintColor:[UIColor greenColor]]; 31 | 32 | [self pushViewController:scanner animated:NO]; 33 | } 34 | return self; 35 | } 36 | 37 | - (void)setTitleColor:(UIColor *)titleColor tintColor:(UIColor *)tintColor { 38 | [self.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName: titleColor}]; 39 | self.navigationBar.tintColor = tintColor; 40 | } 41 | 42 | - (UIInterfaceOrientationMask)supportedInterfaceOrientations { 43 | return UIInterfaceOrientationMaskPortrait; 44 | } 45 | 46 | - (UIStatusBarStyle)preferredStatusBarStyle { 47 | return UIStatusBarStyleLightContent; 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /智慧校园/Other/QRCode/HMScannerMaskView.h: -------------------------------------------------------------------------------- 1 | // 2 | // HMScannerMaskView.h 3 | // HMQRCodeScanner 4 | // 5 | // Created by 刘凡 on 16/1/3. 6 | // Copyright © 2016年 itheima. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /// 扫描遮罩视图 12 | @interface HMScannerMaskView : UIView 13 | 14 | /// 使用裁切区域实例化遮罩视图 15 | /// 16 | /// @param frame 视图区域 17 | /// @param cropRect 裁切区域 18 | /// 19 | /// @return 遮罩视图 20 | + (instancetype)maskViewWithFrame:(CGRect)frame cropRect:(CGRect)cropRect; 21 | 22 | /// 裁切区域 23 | @property (nonatomic) CGRect cropRect; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /智慧校园/Other/QRCode/HMScannerMaskView.m: -------------------------------------------------------------------------------- 1 | // 2 | // HMScannerMaskView.m 3 | // HMQRCodeScanner 4 | // 5 | // Created by 刘凡 on 16/1/3. 6 | // Copyright © 2016年 itheima. All rights reserved. 7 | // 8 | 9 | #import "HMScannerMaskView.h" 10 | 11 | @implementation HMScannerMaskView 12 | 13 | + (instancetype)maskViewWithFrame:(CGRect)frame cropRect:(CGRect)cropRect { 14 | 15 | HMScannerMaskView *maskView = [[self alloc] initWithFrame:frame]; 16 | 17 | maskView.backgroundColor = [UIColor clearColor]; 18 | maskView.cropRect = cropRect; 19 | 20 | return maskView; 21 | } 22 | 23 | - (void)setCropRect:(CGRect)cropRect { 24 | _cropRect = cropRect; 25 | 26 | [self setNeedsDisplay]; 27 | } 28 | 29 | - (void)drawRect:(CGRect)rect { 30 | 31 | CGContextRef ctx = UIGraphicsGetCurrentContext(); 32 | 33 | [[UIColor colorWithWhite:0.0 alpha:0.4] setFill]; 34 | CGContextFillRect(ctx, rect); 35 | 36 | CGContextClearRect(ctx, self.cropRect); 37 | 38 | [[UIColor colorWithWhite:0.95 alpha:1.0] setStroke]; 39 | CGContextStrokeRectWithWidth(ctx, CGRectInset(_cropRect, 1, 1), 1); 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /智慧校园/Other/QRCode/HMScannerViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HMScannerViewController.h 3 | // HMQRCodeScanner 4 | // 5 | // Created by 刘凡 on 16/1/2. 6 | // Copyright © 2016年 itheima. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /// 扫描控制器 12 | @interface HMScannerViewController : UIViewController 13 | 14 | /// 实例化扫描控制器 15 | /// 16 | /// @param cardName 名片字符串 17 | /// @param avatar 头像图片 18 | /// @param completion 完成回调 19 | /// 20 | /// @return 扫描控制器 21 | - (instancetype)initWithCardName:(NSString *)cardName avatar:(UIImage *)avatar completion:(void (^)(NSString *stringValue))completion; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /智慧校园/Other/STPickerView/FramewordInfo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /智慧校园/Other/STPickerView/STPickerView/NSCalendar+STPicker.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSCalendar+ST.h 3 | // STCalendarDemo 4 | // 5 | // Created by https://github.com/STShenZhaoliang/STCalendar on 15/12/17. 6 | // Copyright © 2015年 ST. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSCalendar (STPicker) 12 | 13 | /** 1.当前的日期数据元件模型 */ 14 | + (NSDateComponents *)currentDateComponents; 15 | 16 | /** 2.当前年 */ 17 | + (NSInteger)currentYear; 18 | 19 | /** 3.当前月 */ 20 | + (NSInteger)currentMonth; 21 | 22 | /** 4.当前天 */ 23 | + (NSInteger)currentDay; 24 | 25 | /** 5.当前周数 */ 26 | + (NSInteger)currnentWeekday; 27 | 28 | /** 6.获取指定年月的天数 */ 29 | + (NSInteger)getDaysWithYear:(NSInteger)year month:(NSInteger)month; 30 | 31 | /** 7.获取指定年月的第一天的周数 */ 32 | + (NSInteger)getFirstWeekdayWithYear:(NSInteger)year month:(NSInteger)month; 33 | 34 | /** 8.比较两个日期元件 */ 35 | + (NSComparisonResult)compareWithComponentsOne:(NSDateComponents *)componentsOne componentsTwo:(NSDateComponents *)componentsTwo; 36 | 37 | /** 9.获取两个日期元件之间的日期元件 */ 38 | + (NSMutableArray *)arrayComponentsWithComponentsOne:(NSDateComponents *)componentsOne componentsTwo:(NSDateComponents *)componentsTwo; 39 | 40 | /** 10.字符串转日期元件 字符串格式为:yy-MM-dd */ 41 | + (NSDateComponents *)dateComponentsWithString:(NSString *)String; 42 | @end 43 | -------------------------------------------------------------------------------- /智慧校园/Other/STPickerView/STPickerView/STPickerArea.h: -------------------------------------------------------------------------------- 1 | // 2 | // STPickerArea.h 3 | // STPickerView 4 | // 5 | // Created by https://github.com/STShenZhaoliang/STPickerView on 16/2/15. 6 | // Copyright © 2016年 shentian. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "STPickerView.h" 11 | NS_ASSUME_NONNULL_BEGIN 12 | @class STPickerArea; 13 | @protocol STPickerAreaDelegate 14 | 15 | - (void)pickerArea:(STPickerArea *)pickerArea province:(NSString *)province city:(NSString *)city area:(NSString *)area; 16 | 17 | @end 18 | @interface STPickerArea : STPickerView 19 | /** 1.中间选择框的高度,default is 32*/ 20 | @property(nonatomic, assign)CGFloat heightPickerComponent; 21 | /** 2.保存之前的选择地址,default is NO */ 22 | @property(nonatomic, assign, getter=isSaveHistory)BOOL saveHistory; 23 | 24 | @property(nonatomic, weak)id delegate; 25 | 26 | @end 27 | NS_ASSUME_NONNULL_END 28 | -------------------------------------------------------------------------------- /智慧校园/Other/STPickerView/STPickerView/STPickerDate.h: -------------------------------------------------------------------------------- 1 | // 2 | // STPickerDate.h 3 | // STPickerView 4 | // 5 | // Created by https://github.com/STShenZhaoliang/STPickerView on 16/2/16. 6 | // Copyright © 2016年 shentian. All rights reserved. 7 | // 8 | 9 | #import "STPickerView.h" 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @class STPickerDate; 13 | @protocol STPickerDateDelegate 14 | - (void)pickerDate:(STPickerDate *)pickerDate year:(NSInteger)year month:(NSInteger)month day:(NSInteger)day; 15 | 16 | @end 17 | @interface STPickerDate : STPickerView 18 | 19 | /** 1.最小的年份,default is 1900 */ 20 | @property (nonatomic, assign)NSInteger yearLeast; 21 | /** 2.显示年份数量,default is 200 */ 22 | @property (nonatomic, assign)NSInteger yearSum; 23 | /** 3.中间选择框的高度,default is 28*/ 24 | @property (nonatomic, assign)CGFloat heightPickerComponent; 25 | 26 | @property(nonatomic, weak)id delegate ; 27 | 28 | @end 29 | NS_ASSUME_NONNULL_END 30 | -------------------------------------------------------------------------------- /智慧校园/Other/STPickerView/STPickerView/STPickerSingle.h: -------------------------------------------------------------------------------- 1 | // 2 | // STPickerSingle.h 3 | // STPickerView 4 | // 5 | // Created by https://github.com/STShenZhaoliang/STPickerView on 16/2/16. 6 | // Copyright © 2016年 shentian. All rights reserved. 7 | // 8 | 9 | #import "STPickerView.h" 10 | NS_ASSUME_NONNULL_BEGIN 11 | @class STPickerSingle; 12 | @protocol STPickerSingleDelegate 13 | - (void)pickerSingle:(STPickerSingle *)pickerSingle selectedTitle:(NSString *)selectedTitle; 14 | @end 15 | 16 | @interface STPickerSingle : STPickerView 17 | 18 | /** 1.设置字符串数据数组 */ 19 | @property (nonatomic, strong)NSMutableArray *arrayData; 20 | /** 2.设置单位标题 */ 21 | @property (nonatomic, strong)NSString *titleUnit; 22 | /** 3.中间选择框的高度,default is 44*/ 23 | @property (nonatomic, assign)CGFloat heightPickerComponent; 24 | /** 4.中间选择框的宽度,default is 32*/ 25 | @property (nonatomic, assign)CGFloat widthPickerComponent; 26 | @property(nonatomic, weak)id delegate; 27 | 28 | @end 29 | NS_ASSUME_NONNULL_END 30 | -------------------------------------------------------------------------------- /智慧校园/Other/STPickerView/STPickerView/STPickerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // STPickerView.h 3 | // STPickerView 4 | // 5 | // Created by https://github.com/STShenZhaoliang/STPickerView on 16/2/17. 6 | // Copyright © 2016年 shentian. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "STPickerViewUI.h" 11 | #import "UIView+STPicker.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | typedef NS_ENUM(NSInteger, STPickerContentMode) { 16 | STPickerContentModeBottom, // 1.选择器在视图的下方 17 | STPickerContentModeCenter // 2.选择器在视图的中间 18 | }; 19 | 20 | @interface STPickerView : UIButton 21 | 22 | /** 1.内部视图 */ 23 | @property (nonatomic, strong) UIView *contentView; 24 | /** 2.边线,选择器和上方tool之间的边线 */ 25 | @property (nonatomic, strong)UIView *lineView; 26 | /** 3.选择器 */ 27 | @property (nonatomic, strong)UIPickerView *pickerView; 28 | /** 4.左边的按钮 */ 29 | @property (nonatomic, strong)UIButton *buttonLeft; 30 | /** 5.右边的按钮 */ 31 | @property (nonatomic, strong)UIButton *buttonRight; 32 | /** 6.标题label */ 33 | @property (nonatomic, strong)UILabel *labelTitle; 34 | /** 7.下边线,在显示模式是STPickerContentModeCenter的时候显示 */ 35 | @property (nonatomic, strong)UIView *lineViewDown; 36 | 37 | /** 1.标题,default is nil */ 38 | @property(nullable, nonatomic,copy) NSString *title; 39 | /** 2.字体,default is nil (system font 17 plain) */ 40 | @property(null_resettable, nonatomic,strong) UIFont *font; 41 | /** 3.字体颜色,default is nil (text draws black) */ 42 | @property(null_resettable, nonatomic,strong) UIColor *titleColor; 43 | /** 4.按钮边框颜色颜色,default is RGB(205, 205, 205) */ 44 | @property(null_resettable, nonatomic,strong) UIColor *borderButtonColor; 45 | /** 5.选择器的高度,default is 240 */ 46 | @property (nonatomic, assign)CGFloat heightPicker; 47 | /** 6.视图的显示模式 */ 48 | @property (nonatomic, assign)STPickerContentMode contentMode; 49 | 50 | 51 | /** 52 | * 5.创建视图,初始化视图时初始数据 53 | */ 54 | - (void)setupUI; 55 | 56 | /** 57 | * 6.确认按钮的点击事件 58 | */ 59 | - (void)selectedOk; 60 | 61 | /** 62 | * 7.显示 63 | */ 64 | - (void)show; 65 | 66 | /** 67 | * 8.移除 68 | */ 69 | - (void)remove; 70 | 71 | @end 72 | NS_ASSUME_NONNULL_END 73 | -------------------------------------------------------------------------------- /智慧校园/Other/STPickerView/STPickerView/STPickerViewUI.h: -------------------------------------------------------------------------------- 1 | // 2 | // STPickerViewUI.h 3 | // STPickerView 4 | // 5 | // Created by https://github.com/STShenZhaoliang/STPickerView on 16/2/16. 6 | // Copyright © 2016年 shentian. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | /** 1.统一的较小间距 5 */ 13 | UIKIT_EXTERN CGFloat const STMarginSmall; 14 | 15 | /** 2.统一的间距 10 */ 16 | UIKIT_EXTERN CGFloat const STMargin; 17 | 18 | /** 3.统一的较大间距 16 */ 19 | UIKIT_EXTERN CGFloat const STMarginBig; 20 | 21 | /** 4.导航栏的最大的Y值 64 */ 22 | UIKIT_EXTERN CGFloat const STNavigationBarY; 23 | 24 | /** 5.控件的系统高度 44 */ 25 | UIKIT_EXTERN CGFloat const STControlSystemHeight; 26 | 27 | /** 6.控件的普通高度 36 */ 28 | UIKIT_EXTERN CGFloat const STControlNormalHeight; 29 | 30 | /** 7.按钮的系统宽度 64*/ 31 | UIKIT_EXTERN CGFloat const STButtonSystemHeight; 32 | -------------------------------------------------------------------------------- /智慧校园/Other/STPickerView/STPickerView/STPickerViewUI.m: -------------------------------------------------------------------------------- 1 | // 2 | // STPickerViewUI.m 3 | // STPickerView 4 | // 5 | // Created by https://github.com/STShenZhaoliang/STPickerView on 16/2/16. 6 | // Copyright © 2016年 shentian. All rights reserved. 7 | // 8 | 9 | #import "STPickerViewUI.h" 10 | 11 | /** 1.统一的较小间距 5*/ 12 | CGFloat const STMarginSmall = 5; 13 | 14 | /** 2.统一的间距 10*/ 15 | CGFloat const STMargin = 10; 16 | 17 | /** 3.统一的较大间距 16*/ 18 | CGFloat const STMarginBig = 16; 19 | 20 | /** 4.导航栏的最大的Y值 64*/ 21 | CGFloat const STNavigationBarY = 64; 22 | 23 | /** 5.控件的系统高度 44*/ 24 | CGFloat const STControlSystemHeight = 44; 25 | 26 | /** 6.控件的普通高度 36*/ 27 | CGFloat const STControlNormalHeight = 36; 28 | 29 | /** 7.按钮的系统宽度 64*/ 30 | CGFloat const STButtonSystemHeight = 64; 31 | 32 | -------------------------------------------------------------------------------- /智慧校园/Other/STPickerView/STPickerView/UIView+STPicker.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+STFrame.h 3 | // STPickerView 4 | // 5 | // Created by ST on 16/10/31. 6 | // Copyright © 2016年 ST. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (STPicker) 12 | 13 | /** 1.间隔X值 */ 14 | @property (nonatomic, assign) CGFloat st_x; 15 | 16 | /** 2.间隔Y值 */ 17 | @property (nonatomic, assign) CGFloat st_y; 18 | 19 | /** 3.宽度 */ 20 | @property (nonatomic, assign) CGFloat st_width; 21 | 22 | /** 4.高度 */ 23 | @property (nonatomic, assign) CGFloat st_height; 24 | 25 | /** 5.中心点X值 */ 26 | @property (nonatomic, assign) CGFloat st_centerX; 27 | 28 | /** 6.中心点Y值 */ 29 | @property (nonatomic, assign) CGFloat st_centerY; 30 | 31 | /** 7.尺寸大小 */ 32 | @property (nonatomic, assign) CGSize st_size; 33 | 34 | /** 8.起始点 */ 35 | @property (nonatomic, assign) CGPoint st_origin; 36 | 37 | /** 9.上 */ 38 | @property (nonatomic) CGFloat st_top; 39 | 40 | /** 10.下 */ 41 | @property (nonatomic) CGFloat st_bottom; 42 | 43 | /** 11.左 */ 44 | @property (nonatomic) CGFloat st_left; 45 | 46 | /** 12.右 */ 47 | @property (nonatomic) CGFloat st_right; 48 | 49 | /** 50 | * 1.添加边框 51 | * 52 | * @param color <#color description#> 53 | */ 54 | - (void)addBorderColor:(UIColor *)color; 55 | 56 | @end 57 | 58 | -------------------------------------------------------------------------------- /智慧校园/Other/UIImage+Image.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Image.h 3 | // BuDeJie 4 | // 5 | // Created by xiaomage on 16/3/11. 6 | // Copyright © 2016年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (Image) 12 | 13 | + (instancetype)imageOriginalWithName:(NSString *)imageName; 14 | 15 | - (instancetype)xmg_circleImage; 16 | 17 | + (instancetype)xmg_circleImageNamed:(NSString *)name; 18 | @end 19 | -------------------------------------------------------------------------------- /智慧校园/Other/UIImage+Image.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Image.m 3 | // BuDeJie 4 | // 5 | // Created by xiaomage on 16/3/11. 6 | // Copyright © 2016年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "UIImage+Image.h" 10 | 11 | @implementation UIImage (Image) 12 | 13 | + (instancetype)imageOriginalWithName:(NSString *)imageName 14 | { 15 | UIImage *image = [UIImage imageNamed:imageName]; 16 | 17 | return [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; 18 | 19 | } 20 | 21 | - (instancetype)xmg_circleImage 22 | { 23 | // 1.开启图形上下文 24 | // 比例因素:当前点与像素比例 25 | UIGraphicsBeginImageContextWithOptions(self.size, NO, 0); 26 | // 2.描述裁剪区域 27 | UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(0, 0, self.size.width, self.size.height)]; 28 | // 3.设置裁剪区域; 29 | [path addClip]; 30 | // 4.画图片 31 | [self drawAtPoint:CGPointZero]; 32 | // 5.取出图片 33 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 34 | // 6.关闭上下文 35 | UIGraphicsEndImageContext(); 36 | 37 | return image; 38 | } 39 | 40 | + (instancetype)xmg_circleImageNamed:(NSString *)name 41 | { 42 | return [[self imageNamed:name] xmg_circleImage]; 43 | } 44 | @end 45 | -------------------------------------------------------------------------------- /智慧校园/Other/网页封装/CFNavaigationViewWeb.h: -------------------------------------------------------------------------------- 1 | // 2 | // CFNavaigationViewWeb.h 3 | // iOSClientOfQFNU 4 | // 5 | // Created by chufeng on 2017/6/22. 6 | // Copyright © 2017年 iOSClientOfQFNU. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CFNavaigationViewWeb : UINavigationController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /智慧校园/Other/网页封装/CFNavaigationViewWeb.m: -------------------------------------------------------------------------------- 1 | // 2 | // CFNavaigationViewWeb.m 3 | // iOSClientOfQFNU 4 | // 5 | // Created by chufeng on 2017/6/22. 6 | // Copyright © 2017年 iOSClientOfQFNU. All rights reserved. 7 | // 8 | 9 | #import "CFNavaigationViewWeb.h" 10 | #import "CFWebViewController.h" 11 | @interface CFNavaigationViewWeb () 12 | /** 13 | * 由于 popViewController 会触发 shouldPopItems,因此用该布尔值记录是否应该正确 popItems 14 | */ 15 | @property BOOL shouldPopItemAfterPopVC; 16 | @end 17 | 18 | @implementation CFNavaigationViewWeb 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | self.view.backgroundColor = [UIColor whiteColor]; 23 | 24 | [self.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav.jpeg"] 25 | forBarPosition:UIBarPositionAny 26 | barMetrics:UIBarMetricsDefault]; 27 | self.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor]}; 28 | self.navigationBar.tintColor = [UIColor whiteColor]; 29 | 30 | 31 | self.shouldPopItemAfterPopVC = NO; 32 | } 33 | 34 | 35 | 36 | -(UIViewController*)popViewControllerAnimated:(BOOL)animated{ 37 | self.shouldPopItemAfterPopVC = YES; 38 | return [super popViewControllerAnimated:animated]; 39 | } 40 | 41 | -(NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated{ 42 | self.shouldPopItemAfterPopVC = YES; 43 | return [super popToViewController:viewController animated:animated]; 44 | } 45 | 46 | -(NSArray *)popToRootViewControllerAnimated:(BOOL)animated{ 47 | self.shouldPopItemAfterPopVC = YES; 48 | return [super popToRootViewControllerAnimated:animated]; 49 | } 50 | -(BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item{ 51 | NSLog(@"------%d",self.shouldPopItemAfterPopVC); 52 | //! 如果应该pop,说明是在 popViewController 之后,应该直接 popItems 53 | if (self.shouldPopItemAfterPopVC) { 54 | self.shouldPopItemAfterPopVC = NO; 55 | return YES; 56 | } 57 | 58 | //! 如果不应该 pop,说明是点击了导航栏的返回,这时候则要做出判断区分是不是在 webview 中 59 | if ([self.topViewController isKindOfClass:[CFWebViewController class]]) { 60 | CFWebViewController* webVC = (CFWebViewController*)self.viewControllers.lastObject; 61 | if (webVC.webView.canGoBack) { 62 | [webVC.webView goBack]; 63 | 64 | self.shouldPopItemAfterPopVC = NO; 65 | [[self.navigationBar subviews] lastObject].alpha = 1; 66 | return NO; 67 | }else{ 68 | [self popViewControllerAnimated:YES]; 69 | return NO; 70 | } 71 | }else{ 72 | [self popViewControllerAnimated:YES]; 73 | return NO; 74 | } 75 | } 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /智慧校园/Other/网页封装/CFWebViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CFWebViewController.h 3 | // iOSClientOfQFNU 4 | // 5 | // Created by chufeng on 2017/6/22. 6 | // Copyright © 2017年 iOSClientOfQFNU. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CFWebViewController : UIViewController 12 | /** 13 | * 你的网址 14 | */ 15 | @property (nonatomic)NSURL* url; 16 | 17 | /** 18 | * 我的网页视图 19 | */ 20 | @property (nonatomic)UIWebView* webView; 21 | 22 | /** 23 | * 进度条颜色 24 | */ 25 | @property (nonatomic)UIColor* progressViewColor; 26 | 27 | /** 28 | * 炫酷的载入方法 29 | */ 30 | -(instancetype)initWithUrl:(NSURL*)url; 31 | 32 | 33 | -(void)reloadWebView; 34 | 35 | //图书馆菜单 36 | -(void)loadLibraryMenu; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /智慧校园/Other/网页封装/NJKWebViewProgress/NJKWebViewProgress.h: -------------------------------------------------------------------------------- 1 | // 2 | // NJKWebViewProgress.h 3 | // 4 | // Created by Satoshi Aasano on 4/20/13. 5 | // Copyright (c) 2013 Satoshi Asano. All rights reserved. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | #undef njk_weak 12 | #if __has_feature(objc_arc_weak) 13 | #define njk_weak weak 14 | #else 15 | #define njk_weak unsafe_unretained 16 | #endif 17 | 18 | extern const float NJKInitialProgressValue; 19 | extern const float NJKInteractiveProgressValue; 20 | extern const float NJKFinalProgressValue; 21 | 22 | typedef void (^NJKWebViewProgressBlock)(float progress); 23 | @protocol NJKWebViewProgressDelegate; 24 | @interface NJKWebViewProgress : NSObject 25 | @property (nonatomic, njk_weak) idprogressDelegate; 26 | @property (nonatomic, njk_weak) idwebViewProxyDelegate; 27 | @property (nonatomic, copy) NJKWebViewProgressBlock progressBlock; 28 | @property (nonatomic, readonly) float progress; // 0.0..1.0 29 | 30 | - (void)reset; 31 | @end 32 | 33 | @protocol NJKWebViewProgressDelegate 34 | - (void)webViewProgress:(NJKWebViewProgress *)webViewProgress updateProgress:(float)progress; 35 | @end 36 | 37 | -------------------------------------------------------------------------------- /智慧校园/Other/网页封装/NJKWebViewProgress/NJKWebViewProgressView.h: -------------------------------------------------------------------------------- 1 | // 2 | // NJKWebViewProgressView.h 3 | // iOS 7 Style WebView Progress Bar 4 | // 5 | // Created by Satoshi Aasano on 11/16/13. 6 | // Copyright (c) 2013 Satoshi Asano. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NJKWebViewProgressView : UIView 12 | @property (nonatomic) float progress; 13 | 14 | @property (nonatomic)UIColor* progressColor; 15 | 16 | @property (nonatomic) UIView *progressBarView; 17 | @property (nonatomic) NSTimeInterval barAnimationDuration; // default 0.1 18 | @property (nonatomic) NSTimeInterval fadeAnimationDuration; // default 0.27 19 | @property (nonatomic) NSTimeInterval fadeOutDelay; // default 0.1 20 | 21 | - (void)setProgress:(float)progress animated:(BOOL)animated; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /智慧校园/Other/网页封装/UIColor+FlatColors.h: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2014 Giovanni Lodi 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | // this software and associated documentation files (the "Software"), to deal in 7 | // the Software without restriction, including without limitation the rights to 8 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | // the Software, and to permit persons to whom the Software is furnished to do so, 10 | // subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in all 13 | // copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | #import 23 | 24 | @interface UIColor (FlatColors) 25 | 26 | + (UIColor *)flatTurquoiseColor; 27 | 28 | + (UIColor *)flatGreenSeaColor; 29 | 30 | + (UIColor *)flatEmeraldColor; 31 | 32 | + (UIColor *)flatNephritisColor; 33 | 34 | + (UIColor *)flatPeterRiverColor; 35 | 36 | + (UIColor *)flatBelizeHoleColor; 37 | 38 | + (UIColor *)flatAmethystColor; 39 | 40 | + (UIColor *)flatWisteriaColor; 41 | 42 | + (UIColor *)flatWetAsphaltColor; 43 | 44 | + (UIColor *)flatMidnightBlueColor; 45 | 46 | + (UIColor *)flatSunFlowerColor; 47 | 48 | + (UIColor *)flatOrangeColor; 49 | 50 | + (UIColor *)flatCarrotColor; 51 | 52 | + (UIColor *)flatPumpkinColor; 53 | 54 | + (UIColor *)flatAlizarinColor; 55 | 56 | + (UIColor *)flatPomegranateColor; 57 | 58 | + (UIColor *)flatCloudsColor; 59 | 60 | + (UIColor *)flatSilverColor; 61 | 62 | + (UIColor *)flatConcreteColor; 63 | 64 | + (UIColor *)flatAsbestosColor; 65 | 66 | @end 67 | 68 | // 版权属于原作者 69 | // http://code4app.com (cn) http://code4app.net (en) 70 | // 发布代码于最专业的源码分享网站: Code4App.com 71 | 72 | // 版权属于原作者 73 | // http://code4app.com (cn) http://code4app.net (en) 74 | // 发布代码于最专业的源码分享网站: Code4App.com 75 | 76 | // 版权属于原作者 77 | // http://code4app.com (cn) http://code4app.net (en) 78 | // 发布代码于最专业的源码分享网站: Code4App.com 79 | -------------------------------------------------------------------------------- /智慧校园/PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PrefixHeader.pch 3 | // 智慧校园 4 | // 5 | // Created by doushuyao on 2017/9/8. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width 10 | #define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height 11 | -------------------------------------------------------------------------------- /智慧校园/Setting(维修中)/Controller/SettingController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SettingController.h 3 | // 智慧校园 4 | // 5 | // Created by doushuyao on 2017/9/13. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SettingController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /智慧校园/Tab(导航)/Controller/TabBarController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TabBarController.h 3 | // 智慧校园 4 | // 5 | // Created by doushuyao on 2017/9/7. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TabBarController : UITabBarController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /智慧校园/TableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // TableViewCell.h 3 | // 智慧校园 4 | // 5 | // Created by doushuyao on 2017/9/8. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TableViewCell : UITableViewCell 12 | @property (weak, nonatomic) IBOutlet UIImageView *imageV; 13 | @property (weak, nonatomic) IBOutlet UILabel *Reason; 14 | @property (weak, nonatomic) IBOutlet UILabel *submiter; 15 | @property (weak, nonatomic) IBOutlet UILabel *place; 16 | @property (weak, nonatomic) IBOutlet UILabel *data; 17 | @property (weak, nonatomic) IBOutlet UILabel *Need; 18 | 19 | @property (nonatomic, strong) NSDictionary *dataSource; 20 | @end 21 | -------------------------------------------------------------------------------- /智慧校园/TableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // TableViewCell.m 3 | // 智慧校园 4 | // 5 | // Created by doushuyao on 2017/9/8. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import "TableViewCell.h" 10 | 11 | 12 | @implementation TableViewCell 13 | 14 | -(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ 15 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 16 | 17 | 18 | // [self initUI]; 19 | 20 | return self; 21 | } 22 | 23 | -(void)setDataSource:(NSDictionary *)dataSource{ 24 | _dataSource = dataSource; 25 | 26 | // NSString*imageStr = dataSource[@"imageV"]; 27 | _imageV.image = dataSource[@"imageV"]; 28 | 29 | _Reason.text = dataSource[@"Reason"]; 30 | _submiter.text = dataSource[@"submiter"]; 31 | _place.text = dataSource[@"place"]; 32 | _data.text = dataSource[@"data"]; 33 | _Need.text = dataSource[@"Need"]; 34 | 35 | 36 | 37 | } 38 | 39 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 40 | [super setSelected:selected animated:animated]; 41 | 42 | // Configure the view for the selected state 43 | } 44 | 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /智慧校园/image/Main/Head/qf1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/Main/Head/qf1.jpg -------------------------------------------------------------------------------- /智慧校园/image/Main/Head/qf2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/Main/Head/qf2.jpg -------------------------------------------------------------------------------- /智慧校园/image/Main/Head/qf3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/Main/Head/qf3.jpg -------------------------------------------------------------------------------- /智慧校园/image/Main/Head/qf4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/Main/Head/qf4.jpg -------------------------------------------------------------------------------- /智慧校园/image/Main/Head/qf5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/Main/Head/qf5.jpg -------------------------------------------------------------------------------- /智慧校园/image/TabBar/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/TabBar/main.png -------------------------------------------------------------------------------- /智慧校园/image/TabBar/mine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/TabBar/mine.png -------------------------------------------------------------------------------- /智慧校园/image/TabBar/service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/TabBar/service.png -------------------------------------------------------------------------------- /智慧校园/image/TabBar/setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/TabBar/setting.png -------------------------------------------------------------------------------- /智慧校园/image/TabBar/smain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/TabBar/smain.png -------------------------------------------------------------------------------- /智慧校园/image/TabBar/smine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/TabBar/smine.png -------------------------------------------------------------------------------- /智慧校园/image/TabBar/sservice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/TabBar/sservice.png -------------------------------------------------------------------------------- /智慧校园/image/TabBar/ssetting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/TabBar/ssetting.png -------------------------------------------------------------------------------- /智慧校园/image/TabBar/swait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/TabBar/swait.png -------------------------------------------------------------------------------- /智慧校园/image/TabBar/wait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/TabBar/wait.png -------------------------------------------------------------------------------- /智慧校园/image/back/Clock@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/back/Clock@2x.png -------------------------------------------------------------------------------- /智慧校园/image/back/Clock@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/back/Clock@3x.png -------------------------------------------------------------------------------- /智慧校园/image/back/Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/back/Portrait.png -------------------------------------------------------------------------------- /智慧校园/image/back/Share@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/back/Share@2x.png -------------------------------------------------------------------------------- /智慧校园/image/back/Share@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/back/Share@3x.png -------------------------------------------------------------------------------- /智慧校园/image/back/backImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/back/backImage.png -------------------------------------------------------------------------------- /智慧校园/image/snow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/snow.png -------------------------------------------------------------------------------- /智慧校园/image/unshow.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opooc/SmartCampus/e62e30406fdc706f8503276cc51978b4d83ae14d/智慧校园/image/unshow.jpg -------------------------------------------------------------------------------- /智慧校园/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // 智慧校园 4 | // 5 | // Created by doushuyao on 17/5/16. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /智慧校园/wait(待维修)/Controller/AchieveController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AchieveController.h 3 | // 智慧校园 4 | // 5 | // Created by doushuyao on 2017/9/7. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AchieveController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /智慧校园/wait(待维修)/Controller/WaitController.h: -------------------------------------------------------------------------------- 1 | // 2 | // WaitController.h 3 | // 智慧校园 4 | // 5 | // Created by doushuyao on 2017/9/7. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WaitController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /智慧校园Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /智慧校园Tests/____Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ____Tests.m 3 | // 智慧校园Tests 4 | // 5 | // Created by doushuyao on 17/5/16. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ____Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ____Tests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /智慧校园UITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /智慧校园UITests/____UITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ____UITests.m 3 | // 智慧校园UITests 4 | // 5 | // Created by doushuyao on 17/5/16. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ____UITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ____UITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /智慧校园Watch Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "screenWidth" : "{130,145}", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "screenWidth" : "{146,165}", 11 | "scale" : "2x" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /智慧校园Watch Extension/Assets.xcassets/Complication.complicationset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "assets" : [ 3 | { 4 | "idiom" : "watch", 5 | "filename" : "Circular.imageset", 6 | "role" : "circular" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "filename" : "Extra Large.imageset", 11 | "role" : "extra-large" 12 | }, 13 | { 14 | "idiom" : "watch", 15 | "filename" : "Modular.imageset", 16 | "role" : "modular" 17 | }, 18 | { 19 | "idiom" : "watch", 20 | "filename" : "Utilitarian.imageset", 21 | "role" : "utilitarian" 22 | } 23 | ], 24 | "info" : { 25 | "version" : 1, 26 | "author" : "xcode" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /智慧校园Watch Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "screenWidth" : "{130,145}", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "screenWidth" : "{146,165}", 11 | "scale" : "2x" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /智慧校园Watch Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "screenWidth" : "{130,145}", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "screenWidth" : "{146,165}", 11 | "scale" : "2x" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /智慧校园Watch Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "screenWidth" : "{130,145}", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "screenWidth" : "{146,165}", 11 | "scale" : "2x" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /智慧校园Watch Extension/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /智慧校园Watch Extension/ExtensionDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // ExtensionDelegate.h 3 | // 智慧校园Watch Extension 4 | // 5 | // Created by doushuyao on 2017/9/14. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ExtensionDelegate : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /智慧校园Watch Extension/ExtensionDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // ExtensionDelegate.m 3 | // 智慧校园Watch Extension 4 | // 5 | // Created by doushuyao on 2017/9/14. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import "ExtensionDelegate.h" 10 | 11 | @implementation ExtensionDelegate 12 | 13 | - (void)applicationDidFinishLaunching { 14 | // Perform any final initialization of your application. 15 | } 16 | 17 | - (void)applicationDidBecomeActive { 18 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 19 | } 20 | 21 | - (void)applicationWillResignActive { 22 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 23 | // Use this method to pause ongoing tasks, disable timers, etc. 24 | } 25 | 26 | - (void)handleBackgroundTasks:(NSSet *)backgroundTasks { 27 | // Sent when the system needs to launch the application in the background to process tasks. Tasks arrive in a set, so loop through and process each one. 28 | for (WKRefreshBackgroundTask * task in backgroundTasks) { 29 | // Check the Class of each task to decide how to process it 30 | if ([task isKindOfClass:[WKApplicationRefreshBackgroundTask class]]) { 31 | // Be sure to complete the background task once you’re done. 32 | WKApplicationRefreshBackgroundTask *backgroundTask = (WKApplicationRefreshBackgroundTask*)task; 33 | [backgroundTask setTaskCompleted]; 34 | } else if ([task isKindOfClass:[WKSnapshotRefreshBackgroundTask class]]) { 35 | // Snapshot tasks have a unique completion call, make sure to set your expiration date 36 | WKSnapshotRefreshBackgroundTask *snapshotTask = (WKSnapshotRefreshBackgroundTask*)task; 37 | [snapshotTask setTaskCompletedWithDefaultStateRestored:YES estimatedSnapshotExpiration:[NSDate distantFuture] userInfo:nil]; 38 | } else if ([task isKindOfClass:[WKWatchConnectivityRefreshBackgroundTask class]]) { 39 | // Be sure to complete the background task once you’re done. 40 | WKWatchConnectivityRefreshBackgroundTask *backgroundTask = (WKWatchConnectivityRefreshBackgroundTask*)task; 41 | [backgroundTask setTaskCompleted]; 42 | } else if ([task isKindOfClass:[WKURLSessionRefreshBackgroundTask class]]) { 43 | // Be sure to complete the background task once you’re done. 44 | WKURLSessionRefreshBackgroundTask *backgroundTask = (WKURLSessionRefreshBackgroundTask*)task; 45 | [backgroundTask setTaskCompleted]; 46 | } else { 47 | // make sure to complete unhandled task types 48 | [task setTaskCompleted]; 49 | } 50 | } 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /智慧校园Watch Extension/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | 智慧校园Watch Extension 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | XPC! 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | NSExtension 24 | 25 | NSExtensionAttributes 26 | 27 | WKAppBundleIdentifier 28 | me.vlove.----.watchkitapp 29 | 30 | NSExtensionPointIdentifier 31 | com.apple.watchkit 32 | 33 | WKExtensionDelegateClassName 34 | ExtensionDelegate 35 | 36 | 37 | -------------------------------------------------------------------------------- /智慧校园Watch Extension/InterfaceController.h: -------------------------------------------------------------------------------- 1 | // 2 | // InterfaceController.h 3 | // 智慧校园Watch Extension 4 | // 5 | // Created by doushuyao on 2017/9/14. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface InterfaceController : WKInterfaceController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /智慧校园Watch Extension/InterfaceController.m: -------------------------------------------------------------------------------- 1 | // 2 | // InterfaceController.m 3 | // 智慧校园Watch Extension 4 | // 5 | // Created by doushuyao on 2017/9/14. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import "InterfaceController.h" 10 | #import 11 | 12 | @interface InterfaceController () 13 | { 14 | WCSession * session; 15 | } 16 | @property (unsafe_unretained, nonatomic) IBOutlet WKInterfaceLabel *Time; 17 | @property (unsafe_unretained, nonatomic) IBOutlet WKInterfaceLabel *Timedate; 18 | @property (unsafe_unretained, nonatomic) IBOutlet WKInterfaceLabel *Thing; 19 | @property (unsafe_unretained, nonatomic) IBOutlet WKInterfaceLabel *Thingdate; 20 | 21 | @end 22 | 23 | 24 | @implementation InterfaceController 25 | 26 | - (void)awakeWithContext:(id)context { 27 | [super awakeWithContext:context]; 28 | 29 | 30 | 31 | 32 | // Configure interface objects here. 33 | } 34 | - (IBAction)look { 35 | 36 | if ([WCSession isSupported]) { 37 | session = [WCSession defaultSession]; 38 | session.delegate = self; 39 | [session activateSession]; 40 | } 41 | /*将接收到的消息展示到刚刚准备好的label上*/ 42 | [self.Timedate setText:session.receivedApplicationContext[@"Timedate"]]; 43 | [self.Thingdate setText:session.receivedApplicationContext[@"Thingdate"]]; 44 | } 45 | 46 | - (void)willActivate { 47 | // This method is called when watch view controller is about to be visible to user 48 | [super willActivate]; 49 | } 50 | 51 | - (void)didDeactivate { 52 | // This method is called when watch view controller is no longer visible 53 | [super didDeactivate]; 54 | } 55 | 56 | @end 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /智慧校园Watch Extension/NotificationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationController.h 3 | // 智慧校园Watch Extension 4 | // 5 | // Created by doushuyao on 2017/9/14. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface NotificationController : WKUserNotificationInterfaceController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /智慧校园Watch Extension/NotificationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationController.m 3 | // 智慧校园Watch Extension 4 | // 5 | // Created by doushuyao on 2017/9/14. 6 | // Copyright © 2017年 opooc. All rights reserved. 7 | // 8 | 9 | #import "NotificationController.h" 10 | 11 | 12 | @interface NotificationController () 13 | 14 | @end 15 | 16 | 17 | @implementation NotificationController 18 | 19 | - (instancetype)init { 20 | self = [super init]; 21 | if (self){ 22 | // Initialize variables here. 23 | // Configure interface objects here. 24 | 25 | } 26 | return self; 27 | } 28 | 29 | - (void)willActivate { 30 | // This method is called when watch view controller is about to be visible to user 31 | [super willActivate]; 32 | } 33 | 34 | - (void)didDeactivate { 35 | // This method is called when watch view controller is no longer visible 36 | [super didDeactivate]; 37 | } 38 | 39 | /* 40 | - (void)didReceiveNotification:(UNNotification *)notification withCompletion:(void(^)(WKUserNotificationInterfaceType interface)) completionHandler { 41 | // This method is called when a notification needs to be presented. 42 | // Implement it if you use a dynamic notification interface. 43 | // Populate your dynamic notification interface as quickly as possible. 44 | // 45 | // After populating your dynamic notification interface call the completion block. 46 | completionHandler(WKUserNotificationInterfaceTypeCustom); 47 | } 48 | */ 49 | 50 | @end 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /智慧校园Watch Extension/PushNotificationPayload.apns: -------------------------------------------------------------------------------- 1 | { 2 | "aps": { 3 | "alert": { 4 | "body": "Test message", 5 | "title": "Optional title" 6 | }, 7 | "category": "myCategory" 8 | }, 9 | 10 | "WatchKit Simulator Actions": [ 11 | { 12 | "title": "First Button", 13 | "identifier": "firstButtonAction" 14 | } 15 | ], 16 | 17 | "customKey": "Use this file to define a testing payload for your notifications. The aps dictionary specifies the category, alert text and title. The WatchKit Simulator Actions array can provide info for one or more action buttons in addition to the standard Dismiss button. Any other top level keys are custom payload. If you have multiple such JSON files in your project, you'll be able to select them when choosing to debug the notification interface of your Watch App." 18 | } 19 | -------------------------------------------------------------------------------- /智慧校园Watch/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | 智慧校园 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | UISupportedInterfaceOrientations 24 | 25 | UIInterfaceOrientationPortrait 26 | UIInterfaceOrientationPortraitUpsideDown 27 | 28 | WKCompanionAppBundleIdentifier 29 | me.vlove.---- 30 | WKWatchKitApp 31 | 32 | 33 | 34 | --------------------------------------------------------------------------------