Commit 9b21aec0796d8003bde9b7b2ce149fd990a6f756
0 parents
0.0.1
Showing
154 changed files
with
9732 additions
and
0 deletions
.gitignore
0 → 100644
| 1 | +++ a/.gitignore | ||
| 1 | +# macOS | ||
| 2 | +.DS_Store | ||
| 3 | + | ||
| 4 | +# Xcode | ||
| 5 | +build/ | ||
| 6 | +Product/ | ||
| 7 | +*.pbxuser | ||
| 8 | +!default.pbxuser | ||
| 9 | +*.mode1v3 | ||
| 10 | +!default.mode1v3 | ||
| 11 | +*.mode2v3 | ||
| 12 | +!default.mode2v3 | ||
| 13 | +*.perspectivev3 | ||
| 14 | +!default.perspectivev3 | ||
| 15 | +xcuserdata/ | ||
| 16 | +*.xccheckout | ||
| 17 | +profile | ||
| 18 | +*.moved-aside | ||
| 19 | +DerivedData | ||
| 20 | +*.hmap | ||
| 21 | +*.ipa | ||
| 22 | + | ||
| 23 | +# Bundler | ||
| 24 | +.bundle | ||
| 25 | + | ||
| 26 | +# Add this line if you want to avoid checking in source code from Carthage dependencies. | ||
| 27 | +# Carthage/Checkouts | ||
| 28 | + | ||
| 29 | +Carthage/Build | ||
| 30 | + | ||
| 31 | +# We recommend against adding the Pods directory to your .gitignore. However | ||
| 32 | +# you should judge for yourself, the pros and cons are mentioned at: | ||
| 33 | +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control | ||
| 34 | +# | ||
| 35 | +# Note: if you ignore the Pods directory, make sure to uncomment | ||
| 36 | +# `pod install` in .travis.yml | ||
| 37 | +# | ||
| 38 | +# Pods/ |
.travis.yml
0 → 100644
| 1 | +++ a/.travis.yml | ||
| 1 | +# references: | ||
| 2 | +# * https://www.objc.io/issues/6-build-tools/travis-ci/ | ||
| 3 | +# * https://github.com/supermarin/xcpretty#usage | ||
| 4 | + | ||
| 5 | +osx_image: xcode7.3 | ||
| 6 | +language: objective-c | ||
| 7 | +# cache: cocoapods | ||
| 8 | +# podfile: Example/Podfile | ||
| 9 | +# before_install: | ||
| 10 | +# - gem install cocoapods # Since Travis is not always on latest version | ||
| 11 | +# - pod install --project-directory=Example | ||
| 12 | +script: | ||
| 13 | +- set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/CNLiveCommunitModule.xcworkspace -scheme CNLiveCommunitModule-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty | ||
| 14 | +- pod lib lint |
CNLiveCommunitModule.podspec
0 → 100644
| 1 | +++ a/CNLiveCommunitModule.podspec | ||
| 1 | +# | ||
| 2 | +# Be sure to run `pod lib lint CNLiveCommunitModule.podspec' to ensure this is a | ||
| 3 | +# valid spec before submitting. | ||
| 4 | +# | ||
| 5 | +# Any lines starting with a # are optional, but their use is encouraged | ||
| 6 | +# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html | ||
| 7 | + | ||
| 8 | + | ||
| 9 | +Pod::Spec.new do |s| | ||
| 10 | + s.name = 'CNLiveCommunitModule' | ||
| 11 | + s.version = '0.0.1' | ||
| 12 | + s.summary = 'A short description of CNLiveCommunitModule.' | ||
| 13 | + | ||
| 14 | +# This description is used to generate tags and improve search results. | ||
| 15 | +# * Think: What does it do? Why did you write it? What is the focus? | ||
| 16 | +# * Try to keep it short, snappy and to the point. | ||
| 17 | +# * Write the description between the DESC delimiters below. | ||
| 18 | +# * Finally, don't worry about the indent, CocoaPods strips it! | ||
| 19 | + | ||
| 20 | + s.description = <<-DESC | ||
| 21 | +TODO: Add long description of the pod here. | ||
| 22 | + DESC | ||
| 23 | + | ||
| 24 | + s.homepage = 'http://bj.gitlab.cnlive.com/ios-team/CNLiveCommunitModule' | ||
| 25 | + # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' | ||
| 26 | + s.license = { :type => 'MIT', :file => 'LICENSE' } | ||
| 27 | + s.author = { 'woshiliushiyu' => '1010530278@qq.com' } | ||
| 28 | + s.source = { :git => 'http://bj.gitlab.cnlive.com/ios-team/CNLiveCommunitModule.git', :tag => s.version.to_s } | ||
| 29 | + # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>' | ||
| 30 | + | ||
| 31 | + s.ios.deployment_target = '10.0' | ||
| 32 | + | ||
| 33 | +# s.source_files = 'CNLiveCommunitModule/Classes/ViewController/*.{h,m}' | ||
| 34 | + s.static_framework = true | ||
| 35 | + | ||
| 36 | + s.subspec 'ViewController' do |ss| | ||
| 37 | + ss.source_files = 'CNLiveCommunitModule/Classes/ViewController/*.{h,m}' | ||
| 38 | + end | ||
| 39 | + s.subspec 'ViewModel' do |ss| | ||
| 40 | + ss.source_files = 'CNLiveCommunitModule/Classes/ViewModel/*.{h,m}' | ||
| 41 | + end | ||
| 42 | + s.subspec 'Core' do |ss| | ||
| 43 | + ss.source_files = 'CNLiveCommunitModule/Classes/Core/*.{h,m}' | ||
| 44 | + end | ||
| 45 | + s.subspec 'View' do |ss| | ||
| 46 | + ss.source_files = 'CNLiveCommunitModule/Classes/View/*.{h,m}' | ||
| 47 | + end | ||
| 48 | + s.subspec 'Model' do |ss| | ||
| 49 | + ss.source_files = 'CNLiveCommunitModule/Classes/Model/*.{h,m}' | ||
| 50 | + end | ||
| 51 | + | ||
| 52 | + s.resource_bundles = { | ||
| 53 | + 'CNLiveCommunitModule' => ['CNLiveCommunitModule/Assets/*.bundle'] | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + s.prefix_header_contents = '#import "CNLiveCommunitHeader.h"' | ||
| 57 | + # s.public_header_files = 'Pod/Classes/**/*.h' | ||
| 58 | + s.frameworks = 'UIKit', 'MapKit' | ||
| 59 | + #CNLive组件 | ||
| 60 | + s.dependency 'CNLiveBeeHive' #核心路由架构 | ||
| 61 | + #基础请求组件库 | ||
| 62 | + s.dependency 'CNLiveRequestBastKit' | ||
| 63 | + #基类 | ||
| 64 | + s.dependency 'CNLiveBusinessBaseModule' | ||
| 65 | + #图片预览库 | ||
| 66 | +# s.dependency 'CNLivePhotoBrowser' | ||
| 67 | + #上传 | ||
| 68 | +# s.dependency 'CNLiveUploadManager' | ||
| 69 | + #相册 | ||
| 70 | + s.dependency 'CNLiveImagePickerController' | ||
| 71 | + #拍照 | ||
| 72 | + s.dependency 'CNLiveAVCamera' | ||
| 73 | + #分页加载库 | ||
| 74 | + s.dependency 'JXPagingView/Pager' | ||
| 75 | + #空白视图 | ||
| 76 | + s.dependency 'CNLiveNewTripartiteManagement/DZNEmptyDataSet' | ||
| 77 | + #页数显示 | ||
| 78 | + s.dependency 'JXCategoryView' | ||
| 79 | + #布局文件 | ||
| 80 | + s.dependency 'CNLiveNewTripartiteManagement/Masonry' | ||
| 81 | + #拍照 | ||
| 82 | + s.dependency 'CNLiveAVCamera' | ||
| 83 | + #电商基类 | ||
| 84 | + s.dependency 'DSBaseModule' | ||
| 85 | + # 自定义 UI | ||
| 86 | + s.dependency 'CNLiveCustomUI' | ||
| 87 | +# #输入控制器 | ||
| 88 | + s.dependency 'CNLiveNewTripartiteManagement/IQKeyboardManager' | ||
| 89 | + | ||
| 90 | +end |
CNLiveCommunitModule/Assets/.gitkeep
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Assets/.gitkeep |
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/Root.plist
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/Root.plist | ||
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| 3 | +<plist version="1.0"> | ||
| 4 | +<dict> | ||
| 5 | + <key>StringsTable</key> | ||
| 6 | + <string>Root</string> | ||
| 7 | + <key>PreferenceSpecifiers</key> | ||
| 8 | + <array> | ||
| 9 | + <dict> | ||
| 10 | + <key>Type</key> | ||
| 11 | + <string>PSGroupSpecifier</string> | ||
| 12 | + <key>Title</key> | ||
| 13 | + <string>Group</string> | ||
| 14 | + </dict> | ||
| 15 | + <dict> | ||
| 16 | + <key>Type</key> | ||
| 17 | + <string>PSTextFieldSpecifier</string> | ||
| 18 | + <key>Title</key> | ||
| 19 | + <string>Name</string> | ||
| 20 | + <key>Key</key> | ||
| 21 | + <string>name_preference</string> | ||
| 22 | + <key>DefaultValue</key> | ||
| 23 | + <string></string> | ||
| 24 | + <key>IsSecure</key> | ||
| 25 | + <false/> | ||
| 26 | + <key>KeyboardType</key> | ||
| 27 | + <string>Alphabet</string> | ||
| 28 | + <key>AutocapitalizationType</key> | ||
| 29 | + <string>None</string> | ||
| 30 | + <key>AutocorrectionType</key> | ||
| 31 | + <string>No</string> | ||
| 32 | + </dict> | ||
| 33 | + <dict> | ||
| 34 | + <key>Type</key> | ||
| 35 | + <string>PSToggleSwitchSpecifier</string> | ||
| 36 | + <key>Title</key> | ||
| 37 | + <string>Enabled</string> | ||
| 38 | + <key>Key</key> | ||
| 39 | + <string>enabled_preference</string> | ||
| 40 | + <key>DefaultValue</key> | ||
| 41 | + <true/> | ||
| 42 | + </dict> | ||
| 43 | + <dict> | ||
| 44 | + <key>Type</key> | ||
| 45 | + <string>PSSliderSpecifier</string> | ||
| 46 | + <key>Key</key> | ||
| 47 | + <string>slider_preference</string> | ||
| 48 | + <key>DefaultValue</key> | ||
| 49 | + <real>0.5</real> | ||
| 50 | + <key>MinimumValue</key> | ||
| 51 | + <integer>0</integer> | ||
| 52 | + <key>MaximumValue</key> | ||
| 53 | + <integer>1</integer> | ||
| 54 | + <key>MinimumValueImage</key> | ||
| 55 | + <string></string> | ||
| 56 | + <key>MaximumValueImage</key> | ||
| 57 | + <string></string> | ||
| 58 | + </dict> | ||
| 59 | + </array> | ||
| 60 | +</dict> | ||
| 61 | +</plist> |
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communit_back.png
0 → 100644
267 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communit_back@2x.png
0 → 100644
393 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communit_back@3x.png
0 → 100644
732 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_consu_nomal.png
0 → 100644
634 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_consu_nomal@2x.png
0 → 100644
1.13 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_consu_nomal@3x.png
0 → 100644
1.91 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_consu_select.png
0 → 100644
570 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_consu_select@2x.png
0 → 100644
962 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_consu_select@3x.png
0 → 100644
1.52 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_content_close.png
0 → 100644
454 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_content_close@2x.png
0 → 100644
480 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_content_close@3x.png
0 → 100644
1.34 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_content_empty.png
0 → 100644
16.4 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_content_empty@2x.png
0 → 100644
47.8 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_content_empty@3x.png
0 → 100644
93.5 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_party_nomal.png
0 → 100644
1.08 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_party_nomal@2x.png
0 → 100644
2.35 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_party_nomal@3x.png
0 → 100644
4.19 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_party_select.png
0 → 100644
854 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_party_select@2x.png
0 → 100644
1.78 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_party_select@3x.png
0 → 100644
3.3 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_public_nomal.png
0 → 100644
825 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_public_nomal@2x.png
0 → 100644
1.62 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_public_nomal@3x.png
0 → 100644
2.82 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_public_select.png
0 → 100644
683 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_public_select@2x.png
0 → 100644
1.27 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_public_select@3x.png
0 → 100644
2.28 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_service_nomal.png
0 → 100644
913 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_service_nomal@2x.png
0 → 100644
1.88 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_service_nomal@3x.png
0 → 100644
3.36 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_service_select.png
0 → 100644
895 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_service_select@2x.png
0 → 100644
1.29 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_community_service_select@3x.png
0 → 100644
2.6 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communt_edit_add_image.png
0 → 100644
1.03 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communt_edit_add_image@2x.png
0 → 100644
2.86 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communt_edit_add_image@3x.png
0 → 100644
5.6 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communt_edit_delect_image.png
0 → 100644
577 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communt_edit_delect_image@2x.png
0 → 100644
1.04 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communt_edit_delect_image@3x.png
0 → 100644
1.87 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communt_list_more.png
0 → 100644
159 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communt_list_more@2x.png
0 → 100644
223 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communt_list_more@3x.png
0 → 100644
346 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_add_persion.png
0 → 100644
367 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_add_persion@2x.png
0 → 100644
727 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_add_persion@3x.png
0 → 100644
1.33 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_add_user_nomal.png
0 → 100644
395 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_add_user_nomal@2x.png
0 → 100644
881 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_add_user_nomal@3x.png
0 → 100644
1.5 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_add_user_select.png
0 → 100644
460 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_add_user_select@2x.png
0 → 100644
886 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_add_user_select@3x.png
0 → 100644
1.58 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_evalua_add_image.png
0 → 100644
3 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_evalua_add_image@2x.png
0 → 100644
7.02 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_evalua_add_image@3x.png
0 → 100644
14.5 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_list_delect_user.png
0 → 100644
430 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_list_delect_user@2x.png
0 → 100644
933 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_list_delect_user@3x.png
0 → 100644
1.64 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_list_edit_user.png
0 → 100644
318 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_list_edit_user@2x.png
0 → 100644
561 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_list_edit_user@3x.png
0 → 100644
1006 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_order_phone.png
0 → 100644
595 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_order_phone@2x.png
0 → 100644
1.23 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_order_phone@3x.png
0 → 100644
2.37 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_order_status.png
0 → 100644
366 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_order_status@2x.png
0 → 100644
685 Bytes
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_order_status@3x.png
0 → 100644
1.22 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_result_failer.png
0 → 100644
7.85 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_result_failer@2x.png
0 → 100644
16.2 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_result_failer@3x.png
0 → 100644
32 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_result_success.png
0 → 100644
9.67 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_result_success@2x.png
0 → 100644
21 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/c_communty_result_success@3x.png
0 → 100644
48.4 KB
CNLiveCommunitModule/Assets/CNLiveCommunitModule.bundle/en.lproj/Root.strings
0 → 100644
CNLiveCommunitModule/Classes/.gitkeep
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/.gitkeep |
CNLiveCommunitModule/Classes/Core/CNLiveCommunitHeader.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/Core/CNLiveCommunitHeader.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommunitHeader.h | ||
| 3 | +// Pods | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/1. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#ifndef CNLiveCommunitHeader_h | ||
| 9 | +#define CNLiveCommunitHeader_h | ||
| 10 | + | ||
| 11 | + | ||
| 12 | + | ||
| 13 | +#import "CNLiveCommuntViewController.h" | ||
| 14 | +#import <YYCategories/YYCategories.h> | ||
| 15 | +#import <JXCategoryView/JXCategoryView.h> | ||
| 16 | +#import <JXPagingView/JXPagerView.h> | ||
| 17 | +#import <Masonry/Masonry.h> | ||
| 18 | +#import <YYText/YYText.h> | ||
| 19 | +#import <CNLiveUploadManager/CNLiveUploadManager.h> | ||
| 20 | +#import <CNLiveBusinessTools/CNLiveBusinessTools.h> | ||
| 21 | +#import <CNLiveBusinessTools/CNLiveRespCacheManager.h> | ||
| 22 | +#import <SDWebImage/SDWebImage.h> | ||
| 23 | +#import <MJExtension/MJExtension.h> | ||
| 24 | +#import <CNLiveBusinessTools/CNLiveEscpTools.h> | ||
| 25 | +#import <CNLiveCustomUI/CNLiveRefreshHeader.h> | ||
| 26 | +#import <CNLiveCustomUI/CNLiveRefreshFooter.h> | ||
| 27 | +#import <CNLiveUserManagement/CNUserInfoManager.h> | ||
| 28 | +#import <CNLiveRequestBastKit/CNLiveNetworking.h> | ||
| 29 | +#import <CNLiveEnvironment/CNLiveEnvironment.h> | ||
| 30 | +#import <CNLiveAVCamera/XFPhotoLibraryManager.h> | ||
| 31 | +#import <CNLiveAVCamera/XFCameraController.h> | ||
| 32 | +#import <IQKeyboardManager/IQKeyboardManager.h> | ||
| 33 | +#import <YYKeyboardManager/YYKeyboardManager.h> | ||
| 34 | +#import <CNLiveBaseKit/CNLiveDefinesHeader.h> | ||
| 35 | +#import <DZNEmptyDataSet/UIScrollView+EmptyDataSet.h> | ||
| 36 | +#import "CNLiveCommuntTools.h" | ||
| 37 | +#import "CNLiveCommuntViewModel.h" | ||
| 38 | +#import "CNLiveCommuntyHomeModel.h" | ||
| 39 | +#import "CNImagePickerController.h" | ||
| 40 | +#import "TZImagePickerController.h" | ||
| 41 | + | ||
| 42 | +#import "CNLiveCommuntListViewController.h" | ||
| 43 | +#import "CNLiveCommuntInformViewController.h" | ||
| 44 | +#import "CNLiveCommuntActiviRecordViewController.h" | ||
| 45 | +#import "CNLiveCommuntActiviRepairViewController.h" | ||
| 46 | +#import "CNLiveCommuntyUserListViewController.h" | ||
| 47 | +#import "CNLiveCommuntEvaluaViewController.h" | ||
| 48 | +#import "CNLiveCommuntActiviViewController.h" | ||
| 49 | +#import "CNLiveCommuntyUserEditViewController.h" | ||
| 50 | +#import "CNLiveCommuntyResultViewController.h" | ||
| 51 | +#import "CNLiveCommuntyOrderViewController.h" | ||
| 52 | +#import "CNLiveCommuntyResultListViewController.h" | ||
| 53 | +#import "CNLiveCommuntyHomeListViewController.h" | ||
| 54 | +#import "CNLiveCommuntSignUpView.h" | ||
| 55 | +#import "CNLiveCommuntSubView.h" | ||
| 56 | + | ||
| 57 | +#import "CNLiveCommuntyModule.h" | ||
| 58 | + | ||
| 59 | + | ||
| 60 | +static NSString *const kCNLiveCommuntyNBhdIdIdentifier = @"kCNLiveCommuntyNBhdIdIdentifier"; | ||
| 61 | + | ||
| 62 | + | ||
| 63 | +#endif /* CNLiveCommunitHeader_h */ |
CNLiveCommunitModule/Classes/Core/CNLiveCommunitModuleProtocol.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/Core/CNLiveCommunitModuleProtocol.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommunitModuleProtocol.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/10. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <Foundation/Foundation.h> | ||
| 9 | + | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +@protocol CNLiveCommunitModuleProtocol <NSObject> | ||
| 13 | + | ||
| 14 | +/// 获取主工程的WebView | ||
| 15 | +/// @param webUrl url | ||
| 16 | +-(UIViewController *)pushWebViewWithMainProjectWithWebUrl:(NSString *)webUrl; | ||
| 17 | + | ||
| 18 | +/// 调用工程中支付功能 | ||
| 19 | +/// @param orderId 订单id | ||
| 20 | +/// @param price 价格 | ||
| 21 | +/// @param body 支付名 | ||
| 22 | +-(void)pushMainProjectWithPayManagerWithOrderId:(NSString *)orderId price:(NSString *)price body:(NSString *)body; | ||
| 23 | + | ||
| 24 | + | ||
| 25 | +/// 获取主工程的视讯相关界面逻辑 | ||
| 26 | +/// @param pageId 界面id | ||
| 27 | +/// @param channelName 频道名 | ||
| 28 | +/// @param channelId 频道id | ||
| 29 | +/// @param webUrl url | ||
| 30 | +-(UIViewController *)pushLiveViewWithMainProjectWithPageId:(NSString *)pageId ChannelName:(NSString *)channelName ChannelId:(NSString *)channelId WebUrl:(NSString *)webUrl; | ||
| 31 | + | ||
| 32 | +@end | ||
| 33 | + | ||
| 34 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/Core/CNLiveCommuntyModule.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/Core/CNLiveCommuntyModule.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntyModule.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/10. | ||
| 6 | +// 主入口 | ||
| 7 | + | ||
| 8 | +#import <Foundation/Foundation.h> | ||
| 9 | +#import "CNLiveCommunitModuleProtocol.h" | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +@interface CNLiveCommuntyModule : NSObject | ||
| 13 | + | ||
| 14 | +@property (nonatomic, strong) id<CNLiveCommunitModuleProtocol> protocol; | ||
| 15 | + | ||
| 16 | ++ (instancetype)shareInstance; | ||
| 17 | + | ||
| 18 | +/// 跳转社区组件的主界面(如果已经选择过了就会直接进去,没有则需要进行重新选择) | ||
| 19 | +-(void)pushCommuntyHomeViewMethod; | ||
| 20 | + | ||
| 21 | +/// 获取支付回调 | ||
| 22 | +/// @param paramDict 支付参数 | ||
| 23 | +-(void)pushCommuntyPayResultWithParamDict:(NSDictionary *)paramDict; | ||
| 24 | + | ||
| 25 | +@end | ||
| 26 | + | ||
| 27 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/Core/CNLiveCommuntyModule.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/Core/CNLiveCommuntyModule.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntyModule.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/10. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntyModule.h" | ||
| 9 | + | ||
| 10 | +@implementation CNLiveCommuntyModule | ||
| 11 | + | ||
| 12 | ++(instancetype)shareInstance | ||
| 13 | +{ | ||
| 14 | + static dispatch_once_t onceToken; | ||
| 15 | + static CNLiveCommuntyModule *bridge = nil; | ||
| 16 | + dispatch_once(&onceToken, ^{ | ||
| 17 | + bridge = [[CNLiveCommuntyModule alloc] init]; | ||
| 18 | + }); | ||
| 19 | + return bridge; | ||
| 20 | +} | ||
| 21 | + | ||
| 22 | +- (instancetype)init | ||
| 23 | +{ | ||
| 24 | + self = [super init]; | ||
| 25 | + if (self) { | ||
| 26 | + self.protocol = [NSClassFromString(@"CNLiveCommunitModuleImpl") new]; | ||
| 27 | + } | ||
| 28 | + return self; | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +/// 跳转社区组件的主界面(如果已经选择过了就会直接进去,没有则需要进行重新选择) | ||
| 32 | +-(void)pushCommuntyHomeViewMethod | ||
| 33 | +{ | ||
| 34 | + NSString * nbhdId = (NSString *)[[NSUserDefaults standardUserDefaults] objectForKey:kCNLiveCommuntyNBhdIdIdentifier]; | ||
| 35 | + if ([nbhdId isNotBlank]) { | ||
| 36 | + CNLiveCommuntViewController * homeVC = [[CNLiveCommuntViewController alloc] initWithNBhdId:nbhdId]; | ||
| 37 | + [[CNLiveCommuntTools cCommunt_currentViewController].navigationController pushViewController:homeVC animated:YES]; | ||
| 38 | + }else{ | ||
| 39 | + CNLiveCommuntyHomeListViewController * homeListVC = [[CNLiveCommuntyHomeListViewController alloc] init]; | ||
| 40 | + [[CNLiveCommuntTools cCommunt_currentViewController].navigationController pushViewController:homeListVC animated:YES]; | ||
| 41 | + } | ||
| 42 | +} | ||
| 43 | +/// 获取支付回调 | ||
| 44 | +/// @param paramDict 支付参数 | ||
| 45 | +-(void)pushCommuntyPayResultWithParamDict:(NSDictionary *)paramDict | ||
| 46 | +{ | ||
| 47 | + | ||
| 48 | +} | ||
| 49 | +@end |
CNLiveCommunitModule/Classes/Model/CNLiveCommuntyHomeModel.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/Model/CNLiveCommuntyHomeModel.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntyHomeModel.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/9. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <Foundation/Foundation.h> | ||
| 9 | +@class CNLiveCommuntySubHomeModel; | ||
| 10 | +@class CNLiveCommuntyActivityHomeListModel; | ||
| 11 | +NS_ASSUME_NONNULL_BEGIN | ||
| 12 | + | ||
| 13 | +@interface CNLiveCommuntyHomeModel : NSObject | ||
| 14 | +@property (nonatomic, strong) NSArray<CNLiveCommuntySubHomeModel *> *contentColumnList; | ||
| 15 | +@property (nonatomic, strong) NSMutableArray<NSString *> *titles; | ||
| 16 | +@property (nonatomic, copy) NSString *cmsColumnId; | ||
| 17 | +@property (nonatomic, copy) NSString *columnImg; | ||
| 18 | +@property (nonatomic, copy) NSString *idStr; | ||
| 19 | +@property (nonatomic, copy) NSString *cmsPageId; | ||
| 20 | +@property (nonatomic, copy) NSString *cmsPageType; | ||
| 21 | +@property (nonatomic, copy) NSString *type; | ||
| 22 | +@property (nonatomic, copy) NSString *columnName; | ||
| 23 | +@property (nonatomic, copy) NSString *columnImgUncheck; | ||
| 24 | +@property (nonatomic, copy) NSString *columnColour; | ||
| 25 | +@property (nonatomic, copy) NSString *columnColourUncheck; | ||
| 26 | +@property (nonatomic, copy) NSString *cmsColumnName; | ||
| 27 | +@property (nonatomic, copy) NSString *parentColumnId; | ||
| 28 | + | ||
| 29 | +@end | ||
| 30 | + | ||
| 31 | +@interface CNLiveCommuntySubHomeModel : NSObject | ||
| 32 | +@property (nonatomic, copy) NSString *cmsColumnId; | ||
| 33 | +@property (nonatomic, copy) NSString *columnImg; | ||
| 34 | +@property (nonatomic, copy) NSString *idStr; | ||
| 35 | +@property (nonatomic, copy) NSString *type; | ||
| 36 | +@property (nonatomic, copy) NSString *cmsPageId; | ||
| 37 | +@property (nonatomic, copy) NSString *cmsPageType; | ||
| 38 | +@property (nonatomic, copy) NSString *columnName; | ||
| 39 | +@property (nonatomic, copy) NSString *columnImgUncheck; | ||
| 40 | +@property (nonatomic, copy) NSString *columnColour; | ||
| 41 | +@property (nonatomic, copy) NSString *columnColourUncheck; | ||
| 42 | +@property (nonatomic, copy) NSString *cmsColumnName; | ||
| 43 | +@property (nonatomic, copy) NSString *parentColumnId; | ||
| 44 | +@end | ||
| 45 | + | ||
| 46 | +@interface CNLiveCommuntyHomeListModel : NSObject | ||
| 47 | +@property (nonatomic, copy) NSString *idStr; | ||
| 48 | +@property (nonatomic, copy) NSString *propertyId; | ||
| 49 | +@property (nonatomic, copy) NSString *name; | ||
| 50 | +@property (nonatomic, copy) NSString *locality; | ||
| 51 | +@property (nonatomic, copy) NSString *address; | ||
| 52 | +@end | ||
| 53 | + | ||
| 54 | +@interface CNLiveCommuntyActivityHomeListModel : NSObject | ||
| 55 | +@property (nonatomic, copy) NSString *idStr; | ||
| 56 | +@property (nonatomic, copy) NSString *name; | ||
| 57 | +@property (nonatomic, copy) NSString *publicityPic; | ||
| 58 | +@property (nonatomic, copy) NSString *imgUrl; | ||
| 59 | +@property (nonatomic, copy) NSString *endTime; | ||
| 60 | +@property (nonatomic, copy) NSString *startTime; | ||
| 61 | +@property (nonatomic, copy) NSString *status; | ||
| 62 | +@property (nonatomic, copy) NSString *statusString; | ||
| 63 | +@end | ||
| 64 | + | ||
| 65 | +@interface CNLiveCommuntyActivityRecordListModel : NSObject | ||
| 66 | +@property (nonatomic, copy) NSString *name; | ||
| 67 | +@property (nonatomic, copy) NSString *handworkId; | ||
| 68 | +@property (nonatomic, copy) NSString *refundStatus; | ||
| 69 | +@property (nonatomic, copy) NSString *refundApplyTime; | ||
| 70 | +@property (nonatomic, copy) NSString *mobile; | ||
| 71 | +@property (nonatomic, copy) NSString *isFeedback; | ||
| 72 | +@property (nonatomic, copy) NSString *orderId; | ||
| 73 | +@property (nonatomic, copy) NSString *oid; | ||
| 74 | +@property (nonatomic, copy) NSString *gender; | ||
| 75 | +@property (nonatomic, copy) NSString *amount; | ||
| 76 | +@property (nonatomic, copy) NSString *age; | ||
| 77 | +@property (nonatomic, copy) NSString *paymentStatus; | ||
| 78 | +@property (nonatomic, copy) NSString *createUser; | ||
| 79 | +@property (nonatomic, copy) NSString *handworkName; | ||
| 80 | +@property (nonatomic, copy) NSString *refundAmount; | ||
| 81 | +@property (nonatomic, copy) NSString *idStr; | ||
| 82 | +@property (nonatomic, copy) NSString *refundUser; | ||
| 83 | +@property (nonatomic, copy) NSString *publicityPic; | ||
| 84 | +@property (nonatomic, copy) NSString *imgUrl; | ||
| 85 | +@property (nonatomic, copy) NSString *sid; | ||
| 86 | +@property (nonatomic, strong) NSNumber *createTime; | ||
| 87 | +@property (nonatomic, copy) NSString *createTimeString; | ||
| 88 | +@property (nonatomic, copy) NSString *refundMsg; | ||
| 89 | +@end | ||
| 90 | + | ||
| 91 | +@interface CNLiveCommuntyActivityRepairListModel : NSObject | ||
| 92 | +@property (nonatomic, copy) NSString *repairTime; | ||
| 93 | +@property (nonatomic, copy) NSString *payTime; | ||
| 94 | +@property (nonatomic, copy) NSString *address; | ||
| 95 | +@property (nonatomic, copy) NSString *userName; | ||
| 96 | +@property (nonatomic, copy) NSString *repairId; | ||
| 97 | +@property (nonatomic, copy) NSString *userId; | ||
| 98 | +@property (nonatomic, copy) NSString *payType; | ||
| 99 | +@property (nonatomic, copy) NSString *intentEndTime; | ||
| 100 | +@property (nonatomic, copy) NSString *status; | ||
| 101 | +@property (nonatomic, copy) NSString *statusString; | ||
| 102 | +@property (nonatomic, copy) NSString *repairProject; | ||
| 103 | +@property (nonatomic, copy) NSString *idStr; | ||
| 104 | +@property (nonatomic, copy) NSString *neighboorHoodId; | ||
| 105 | +@property (nonatomic, copy) NSString *transId; | ||
| 106 | +@property (nonatomic, copy) NSString *cancleTime; | ||
| 107 | +@property (nonatomic, copy) NSString *phone; | ||
| 108 | +@property (nonatomic, copy) NSString *totalFee; | ||
| 109 | +@property (nonatomic, copy) NSString *intentBeginTime; | ||
| 110 | +@property (nonatomic, copy) NSString *remark; | ||
| 111 | +@property (nonatomic, strong) NSNumber *createTime; | ||
| 112 | +@property (nonatomic, copy) NSString *createTimeString; | ||
| 113 | +@property (nonatomic, copy) NSString *repairName; | ||
| 114 | +@property (nonatomic, copy) NSString *createId; | ||
| 115 | +@end | ||
| 116 | + | ||
| 117 | +@interface CNLiveCommuntyActivityMaintainsListModel : NSObject | ||
| 118 | +@property (nonatomic, copy) NSString *idStr; | ||
| 119 | +@property (nonatomic, copy) NSString *name; | ||
| 120 | +@property (nonatomic, strong) NSNumber *createTime; | ||
| 121 | +@property (nonatomic, copy) NSString *status; | ||
| 122 | +@property (nonatomic, copy) NSString *deleteFlag; | ||
| 123 | +@property (nonatomic, copy) NSString *oid; | ||
| 124 | +@property (nonatomic, copy) NSString *createTimeString; | ||
| 125 | +@end | ||
| 126 | + | ||
| 127 | +@interface CNLiveCommuntyActivityMaintainsTimeModel : NSObject | ||
| 128 | +@property (nonatomic, copy) NSString *day; | ||
| 129 | +@property (nonatomic, strong) NSArray<NSString *> *time; | ||
| 130 | +@end | ||
| 131 | + | ||
| 132 | +@interface CNLiveCommuntyActivityMaintainsCreateModel : NSObject | ||
| 133 | +@property (nonatomic, strong) NSNumber *repairTime; | ||
| 134 | +@property (nonatomic, copy) NSString *repairTimeString; | ||
| 135 | +@property (nonatomic, strong) NSNumber *payTime; | ||
| 136 | +@property (nonatomic, copy) NSString *payTimeString; | ||
| 137 | +@property (nonatomic, copy) NSString *address; | ||
| 138 | +@property (nonatomic, copy) NSString *userName; | ||
| 139 | +@property (nonatomic, copy) NSString *userId; | ||
| 140 | +@property (nonatomic, copy) NSString *repairId; | ||
| 141 | +@property (nonatomic, copy) NSString *payType; | ||
| 142 | +@property (nonatomic, strong) NSNumber *intentEndTime; | ||
| 143 | +@property (nonatomic, copy) NSString *intentEndTimeString; | ||
| 144 | +@property (nonatomic, copy) NSString *status; | ||
| 145 | +@property (nonatomic, copy) NSString *repairProject; | ||
| 146 | +@property (nonatomic, copy) NSString *idStr; | ||
| 147 | +@property (nonatomic, copy) NSString *neighboorHoodId; | ||
| 148 | +@property (nonatomic, copy) NSString *transId; | ||
| 149 | +@property (nonatomic, copy) NSString *phone; | ||
| 150 | +@property (nonatomic, copy) NSString *totalFee; | ||
| 151 | +@property (nonatomic, copy) NSString *remark; | ||
| 152 | +@property (nonatomic, copy) NSString *name; | ||
| 153 | +@property (nonatomic, copy) NSString *mobile; | ||
| 154 | +@property (nonatomic, strong) NSNumber *intentBeginTime; | ||
| 155 | +@property (nonatomic, copy) NSString *intentBeginTimeString; | ||
| 156 | +@property (nonatomic, strong) NSNumber *cancleTime; | ||
| 157 | +@property (nonatomic, copy) NSString *cancleTimeString; | ||
| 158 | +@property (nonatomic, strong) NSNumber *createTime; | ||
| 159 | +@property (nonatomic, copy) NSString *createTimeString; | ||
| 160 | +@property (nonatomic, copy) NSString *repairName; | ||
| 161 | +@property (nonatomic, copy) NSString *createId; | ||
| 162 | +//订单信息 | ||
| 163 | +@property (nonatomic, strong) NSMutableArray * infoArray; | ||
| 164 | +//流程信息 | ||
| 165 | +@property (nonatomic, strong) NSMutableArray * processArray; | ||
| 166 | +//对应 CNLiveCommuntyOrderShowType | ||
| 167 | +@property (nonatomic, assign) NSInteger showType; | ||
| 168 | +@end | ||
| 169 | + | ||
| 170 | + | ||
| 171 | +@interface CNLiveCommuntyActivityDetailModel : NSObject | ||
| 172 | +@property (nonatomic, copy) NSString *craftId; | ||
| 173 | +@property (nonatomic, copy) NSString *signupVoList; | ||
| 174 | +@property (nonatomic, copy) NSString *neighborhoodId; | ||
| 175 | +@property (nonatomic, copy) NSString *summaryPic; | ||
| 176 | +@property (nonatomic, copy) NSString *idStr; | ||
| 177 | +@property (nonatomic, copy) NSString *processDesc; | ||
| 178 | +@property (nonatomic, copy) NSString *unitPrice; | ||
| 179 | +@property (nonatomic, copy) NSString *publicityPic; | ||
| 180 | +@property (nonatomic, copy) NSString *duration; | ||
| 181 | +@property (nonatomic, copy) NSString *name; | ||
| 182 | +@property (nonatomic, copy) NSString *mobile; | ||
| 183 | +@property (nonatomic, copy) NSString *desc; | ||
| 184 | +@property (nonatomic, copy) NSString *oid; | ||
| 185 | +@property (nonatomic, copy) NSString *craftName; | ||
| 186 | +@property (nonatomic, copy) NSString *updatorId; | ||
| 187 | +@property (nonatomic, copy) NSString *creatorId; | ||
| 188 | +@property (nonatomic, copy) NSString *signupStartTime; | ||
| 189 | +@property (nonatomic, copy) NSString *signupNum; | ||
| 190 | +@property (nonatomic, copy) NSString *summary; | ||
| 191 | +@property (nonatomic, copy) NSString *status; | ||
| 192 | +@property (nonatomic, copy) NSString *location; | ||
| 193 | +@property (nonatomic, copy) NSString *organizer; | ||
| 194 | +@property (nonatomic, copy) NSString *personLimit; | ||
| 195 | + | ||
| 196 | +@property (nonatomic, strong) NSNumber *endTime; | ||
| 197 | +@property (nonatomic, strong) NSNumber *startTime; | ||
| 198 | +@property (nonatomic, strong) NSNumber *createTime; | ||
| 199 | +@property (nonatomic, strong) NSNumber *updateTime; | ||
| 200 | +@property (nonatomic, strong) NSNumber *signupEndTime; | ||
| 201 | + | ||
| 202 | +@property (nonatomic, copy) NSString *endTimeString; | ||
| 203 | +@property (nonatomic, copy) NSString *startTimeString; | ||
| 204 | +@property (nonatomic, copy) NSString *createTimeString; | ||
| 205 | +@property (nonatomic, copy) NSString *updateTimeString; | ||
| 206 | +@property (nonatomic, copy) NSString *signupEndTimeString; | ||
| 207 | +@end | ||
| 208 | + | ||
| 209 | +@interface CNLiveCommuntyActivitySignUpModel : NSObject | ||
| 210 | +@property (nonatomic, copy) NSString *status; | ||
| 211 | +@property (nonatomic, copy) NSString *refundableBalance; | ||
| 212 | +@property (nonatomic, copy) NSString *idStr; | ||
| 213 | +@property (nonatomic, copy) NSString *transId; | ||
| 214 | +@property (nonatomic, strong) NSNumber *updateTime; | ||
| 215 | +@property (nonatomic, copy) NSString *updateTimeString; | ||
| 216 | +@property (nonatomic, copy) NSString *totalFee; | ||
| 217 | +@property (nonatomic, copy) NSString *updatorId; | ||
| 218 | +@property (nonatomic, copy) NSString *type; | ||
| 219 | +@property (nonatomic, copy) NSString *payType; | ||
| 220 | +@property (nonatomic, strong) NSNumber *createTime; | ||
| 221 | +@property (nonatomic, copy) NSString *createTimeString; | ||
| 222 | +@end | ||
| 223 | + | ||
| 224 | + | ||
| 225 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/Model/CNLiveCommuntyHomeModel.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/Model/CNLiveCommuntyHomeModel.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntyHomeModel.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/9. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntyHomeModel.h" | ||
| 9 | + | ||
| 10 | +@implementation CNLiveCommuntyHomeModel | ||
| 11 | + | ||
| 12 | +MJCodingImplementation | ||
| 13 | + | ||
| 14 | ++ (NSDictionary *)mj_replacedKeyFromPropertyName | ||
| 15 | +{ | ||
| 16 | + return @{@"idStr":@"id"}; | ||
| 17 | +} | ||
| 18 | ++ (NSDictionary *)mj_objectClassInArray | ||
| 19 | +{ | ||
| 20 | + return @{@"contentColumnList":@"CNLiveCommuntySubHomeModel"}; | ||
| 21 | +} | ||
| 22 | +- (id)mj_newValueFromOldValue:(id)oldValue property:(MJProperty *)property | ||
| 23 | +{ | ||
| 24 | + if ([property.name isEqualToString:@"contentColumnList"]) { | ||
| 25 | + NSArray * columList = (NSArray *)oldValue; | ||
| 26 | + self.titles = [[NSMutableArray alloc] init]; | ||
| 27 | + for (NSDictionary * subDict in columList) { | ||
| 28 | + [self.titles addObject:[subDict stringValueForKey:@"columnName" default:@""]]; | ||
| 29 | + } | ||
| 30 | + } | ||
| 31 | + return oldValue; | ||
| 32 | +} | ||
| 33 | +@end | ||
| 34 | + | ||
| 35 | +@implementation CNLiveCommuntySubHomeModel | ||
| 36 | + | ||
| 37 | +MJCodingImplementation | ||
| 38 | + | ||
| 39 | ++ (NSDictionary *)mj_replacedKeyFromPropertyName | ||
| 40 | +{ | ||
| 41 | + return @{@"idStr":@"id"}; | ||
| 42 | +} | ||
| 43 | + | ||
| 44 | +@end | ||
| 45 | + | ||
| 46 | + | ||
| 47 | +@implementation CNLiveCommuntyHomeListModel | ||
| 48 | + | ||
| 49 | +MJCodingImplementation | ||
| 50 | + | ||
| 51 | ++ (NSDictionary *)mj_replacedKeyFromPropertyName | ||
| 52 | +{ | ||
| 53 | + return @{@"idStr":@"id"}; | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +@end | ||
| 57 | + | ||
| 58 | + | ||
| 59 | +@implementation CNLiveCommuntyActivityHomeListModel | ||
| 60 | + | ||
| 61 | +MJCodingImplementation | ||
| 62 | + | ||
| 63 | ++ (NSDictionary *)mj_replacedKeyFromPropertyName | ||
| 64 | +{ | ||
| 65 | + return @{@"idStr":@"id",@"desc":@"description"}; | ||
| 66 | +} | ||
| 67 | + | ||
| 68 | +- (id)mj_newValueFromOldValue:(id)oldValue property:(MJProperty *)property | ||
| 69 | +{ | ||
| 70 | + if ([property.name isEqualToString:@"publicityPic"]) { | ||
| 71 | + if ([oldValue cn_containsString:@","]) { | ||
| 72 | + self.imgUrl = [(NSString *)oldValue componentsSeparatedByString:@","].firstObject; | ||
| 73 | + }else{ | ||
| 74 | + self.imgUrl = oldValue; | ||
| 75 | + } | ||
| 76 | + } | ||
| 77 | + if ([property.name isEqualToString:@"status"]) { | ||
| 78 | + NSString * s = [NSString stringWithFormat:@"%@",oldValue]; | ||
| 79 | + if ([s isEqualToString:@"1"]) self.statusString = @"未开始"; | ||
| 80 | + if ([s isEqualToString:@"2"]) self.statusString = @"进行中"; | ||
| 81 | + if ([s isEqualToString:@"3"]) self.statusString = @"已结束"; | ||
| 82 | + } | ||
| 83 | + return oldValue; | ||
| 84 | +} | ||
| 85 | + | ||
| 86 | +@end | ||
| 87 | + | ||
| 88 | +@implementation CNLiveCommuntyActivityRecordListModel | ||
| 89 | +MJCodingImplementation | ||
| 90 | + | ||
| 91 | ++ (NSDictionary *)mj_replacedKeyFromPropertyName | ||
| 92 | +{ | ||
| 93 | + return @{@"idStr":@"id"}; | ||
| 94 | +} | ||
| 95 | +- (id)mj_newValueFromOldValue:(id)oldValue property:(MJProperty *)property | ||
| 96 | +{ | ||
| 97 | + if ([property.name isEqualToString:@"createTime"]) { | ||
| 98 | + NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:([oldValue doubleValue]/1000)]; | ||
| 99 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | ||
| 100 | + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; | ||
| 101 | + self.createTimeString = [dateFormatter stringFromDate:detaildate]; | ||
| 102 | + } | ||
| 103 | + if ([property.name isEqualToString:@"publicityPic"]) { | ||
| 104 | + if ([oldValue cn_containsString:@","]) { | ||
| 105 | + self.imgUrl = [(NSString *)oldValue componentsSeparatedByString:@","].firstObject; | ||
| 106 | + }else{ | ||
| 107 | + self.imgUrl = oldValue; | ||
| 108 | + } | ||
| 109 | + } | ||
| 110 | + return oldValue; | ||
| 111 | +} | ||
| 112 | + | ||
| 113 | +@end | ||
| 114 | + | ||
| 115 | +@implementation CNLiveCommuntyActivityRepairListModel | ||
| 116 | + | ||
| 117 | +MJCodingImplementation | ||
| 118 | + | ||
| 119 | ++ (NSDictionary *)mj_replacedKeyFromPropertyName | ||
| 120 | +{ | ||
| 121 | + return @{@"idStr":@"id"}; | ||
| 122 | +} | ||
| 123 | +- (id)mj_newValueFromOldValue:(id)oldValue property:(MJProperty *)property | ||
| 124 | +{ | ||
| 125 | + if ([property.name isEqualToString:@"status"]) { | ||
| 126 | + NSString * s = [NSString stringWithFormat:@"%@",oldValue]; | ||
| 127 | + if ([s isEqualToString:@"0"]) self.statusString = @"待受理"; | ||
| 128 | + if ([s isEqualToString:@"1"]) self.statusString = @"处理中"; | ||
| 129 | + if ([s isEqualToString:@"2"]) self.statusString = @"已失效"; | ||
| 130 | + if ([s isEqualToString:@"3"]) self.statusString = @"已完成"; | ||
| 131 | + } | ||
| 132 | + if ([property.name isEqualToString:@"createTime"]) { | ||
| 133 | + NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:([oldValue doubleValue]/1000)]; | ||
| 134 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | ||
| 135 | + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; | ||
| 136 | + self.createTimeString = [dateFormatter stringFromDate:detaildate]; | ||
| 137 | + } | ||
| 138 | + return oldValue; | ||
| 139 | +} | ||
| 140 | + | ||
| 141 | +@end | ||
| 142 | + | ||
| 143 | +@implementation CNLiveCommuntyActivityMaintainsListModel | ||
| 144 | +MJCodingImplementation | ||
| 145 | + | ||
| 146 | ++ (NSDictionary *)mj_replacedKeyFromPropertyName | ||
| 147 | +{ | ||
| 148 | + return @{@"idStr":@"id"}; | ||
| 149 | +} | ||
| 150 | +- (id)mj_newValueFromOldValue:(id)oldValue property:(MJProperty *)property | ||
| 151 | +{ | ||
| 152 | + if ([property.name isEqualToString:@"createTime"]) { | ||
| 153 | + NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:([oldValue doubleValue]/1000)]; | ||
| 154 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | ||
| 155 | + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; | ||
| 156 | + self.createTimeString = [dateFormatter stringFromDate:detaildate]; | ||
| 157 | + } | ||
| 158 | + return oldValue; | ||
| 159 | +} | ||
| 160 | + | ||
| 161 | +@end | ||
| 162 | + | ||
| 163 | +@implementation CNLiveCommuntyActivityMaintainsTimeModel | ||
| 164 | + | ||
| 165 | + | ||
| 166 | +@end | ||
| 167 | + | ||
| 168 | +@implementation CNLiveCommuntyActivityMaintainsCreateModel | ||
| 169 | + | ||
| 170 | +MJCodingImplementation | ||
| 171 | +- (instancetype)init | ||
| 172 | +{ | ||
| 173 | + self = [super init]; | ||
| 174 | + if (self) { | ||
| 175 | + self.infoArray = [[NSMutableArray alloc] init]; | ||
| 176 | + self.processArray = [[NSMutableArray alloc] init]; | ||
| 177 | + } | ||
| 178 | + return self; | ||
| 179 | +} | ||
| 180 | ++ (NSDictionary *)mj_replacedKeyFromPropertyName | ||
| 181 | +{ | ||
| 182 | + return @{@"idStr":@"id"}; | ||
| 183 | +} | ||
| 184 | +- (void)mj_didConvertToObjectWithKeyValues:(NSDictionary *)keyValues | ||
| 185 | +{ | ||
| 186 | + self.infoArray = [[NSMutableArray alloc] init]; | ||
| 187 | + self.processArray = [[NSMutableArray alloc] initWithArray:@[@"",@"",@"",@""]]; | ||
| 188 | + [keyValues enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) { | ||
| 189 | + key = [NSString stringWithFormat:@"%@",key]; | ||
| 190 | + obj = [NSString stringWithFormat:@"%@",obj]; | ||
| 191 | + NSMutableDictionary * tempDict = [[NSMutableDictionary alloc] init]; | ||
| 192 | + if (![obj isKindOfClass:NSNull.class] && [obj isNotBlank] && [key isEqualToString:@"userName"]) {//联系人 | ||
| 193 | + [tempDict addString:@"联 系 人" forKey:@"key"]; | ||
| 194 | + [tempDict addString:obj forKey:@"value"]; | ||
| 195 | + [self.infoArray addObject:tempDict]; | ||
| 196 | + } | ||
| 197 | + if (![obj isKindOfClass:NSNull.class] && [obj isNotBlank] && [key isEqualToString:@"address"]) {//联系地址 | ||
| 198 | + [tempDict addString:@"联系地址" forKey:@"key"]; | ||
| 199 | + [tempDict addString:obj forKey:@"value"]; | ||
| 200 | + [self.infoArray addObject:tempDict]; | ||
| 201 | + } | ||
| 202 | + if (![obj isKindOfClass:NSNull.class] && [obj isNotBlank] && [key isEqualToString:@"phone"]) {//联系电话 | ||
| 203 | + [tempDict addString:@"联系电话" forKey:@"key"]; | ||
| 204 | + [tempDict addString:obj forKey:@"value"]; | ||
| 205 | + [self.infoArray addObject:tempDict]; | ||
| 206 | + } | ||
| 207 | + if (![obj isKindOfClass:NSNull.class] && [obj isNotBlank] && [key isEqualToString:@"repairName"]) {//选择项目 | ||
| 208 | + [tempDict addString:@"选择项目" forKey:@"key"]; | ||
| 209 | + [tempDict addString:obj forKey:@"value"]; | ||
| 210 | + [self.infoArray addObject:tempDict]; | ||
| 211 | + } | ||
| 212 | + if (![obj isKindOfClass:NSNull.class] && [obj isNotBlank] && [key isEqualToString:@"intentBeginTime"]) {//联系地址 | ||
| 213 | + NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:([obj doubleValue]/1000)]; | ||
| 214 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | ||
| 215 | + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; | ||
| 216 | + [tempDict addString:@"预约时间" forKey:@"key"]; | ||
| 217 | + [tempDict addString:[dateFormatter stringFromDate:detaildate] forKey:@"value"]; | ||
| 218 | + [self.infoArray addObject:tempDict]; | ||
| 219 | + } | ||
| 220 | + if (![obj isEqualToString:@"<null>"] && [obj isNotBlank] && [key isEqualToString:@"createTime"]) { | ||
| 221 | + NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:([obj doubleValue]/1000)]; | ||
| 222 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | ||
| 223 | + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; | ||
| 224 | + [tempDict addString:@"用户提交报修订单" forKey:@"key"]; | ||
| 225 | + [tempDict addString:[dateFormatter stringFromDate:detaildate] forKey:@"value"]; | ||
| 226 | + [self.processArray replaceObjectAtIndex:0 withObject:tempDict]; | ||
| 227 | + } | ||
| 228 | + if (![obj isEqualToString:@"<null>"] && [obj isNotBlank] && [key isEqualToString:@"repairTime"]) { | ||
| 229 | + NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:([obj doubleValue]/1000)]; | ||
| 230 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | ||
| 231 | + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; | ||
| 232 | + [tempDict addString:@"维修人员已接单" forKey:@"key"]; | ||
| 233 | + [tempDict addString:[dateFormatter stringFromDate:detaildate] forKey:@"value"]; | ||
| 234 | + [self.processArray replaceObjectAtIndex:1 withObject:tempDict]; | ||
| 235 | + } | ||
| 236 | + if (![obj isEqualToString:@"<null>"] && [obj isNotBlank] && [key isEqualToString:@"payTime"]) { | ||
| 237 | + NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:([obj doubleValue]/1000)]; | ||
| 238 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | ||
| 239 | + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; | ||
| 240 | + [tempDict addString:@"完成维修并支付" forKey:@"key"]; | ||
| 241 | + [tempDict addString:[dateFormatter stringFromDate:detaildate] forKey:@"value"]; | ||
| 242 | + [self.processArray replaceObjectAtIndex:2 withObject:tempDict]; | ||
| 243 | + } | ||
| 244 | + if (![obj isEqualToString:@"<null>"] && [obj isNotBlank] && [key isEqualToString:@"cancleTime"]) { | ||
| 245 | + NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:([obj doubleValue]/1000)]; | ||
| 246 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | ||
| 247 | + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; | ||
| 248 | + [tempDict addString:@"用户取消报修订单" forKey:@"key"]; | ||
| 249 | + [tempDict addString:[dateFormatter stringFromDate:detaildate] forKey:@"value"]; | ||
| 250 | + [self.processArray replaceObjectAtIndex:3 withObject:tempDict]; | ||
| 251 | + } | ||
| 252 | + }]; | ||
| 253 | + [self.processArray removeObject:@""]; | ||
| 254 | + for (NSDictionary * subDict in self.processArray) { | ||
| 255 | + NSString * key = [subDict stringValueForKey:@"key" default:@""]; | ||
| 256 | + if ([key isEqualToString:@"用户提交报修订单"]) self.showType = 0; | ||
| 257 | + if ([key isEqualToString:@"维修人员已接单"]) self.showType = 1; | ||
| 258 | + if ([key isEqualToString:@"完成维修并支付"]) self.showType = 2; | ||
| 259 | + if ([key isEqualToString:@"用户取消报修订单"]) self.showType = 3; | ||
| 260 | + } | ||
| 261 | + self.processArray = [[NSMutableArray alloc] initWithArray:[[self.processArray reverseObjectEnumerator] allObjects]]; | ||
| 262 | +} | ||
| 263 | +- (id)mj_newValueFromOldValue:(id)oldValue property:(MJProperty *)property | ||
| 264 | +{ | ||
| 265 | + oldValue = [NSString stringWithFormat:@"%@",oldValue]; | ||
| 266 | + | ||
| 267 | + if (![oldValue isKindOfClass:NSNull.class] && [property.name isEqualToString:@"createTime"]) { | ||
| 268 | + NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:([oldValue doubleValue]/1000)]; | ||
| 269 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | ||
| 270 | + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; | ||
| 271 | + self.createTimeString = [dateFormatter stringFromDate:detaildate]; | ||
| 272 | + } | ||
| 273 | + if (![oldValue isEqualToString:@"<null>"] && ![oldValue isKindOfClass:NSNull.class] && [property.name isEqualToString:@"repairTime"]) { | ||
| 274 | + NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:([oldValue doubleValue]/1000)]; | ||
| 275 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | ||
| 276 | + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; | ||
| 277 | + self.repairTimeString = [dateFormatter stringFromDate:detaildate]; | ||
| 278 | + } | ||
| 279 | + if (![oldValue isEqualToString:@"<null>"] && ![oldValue isKindOfClass:NSNull.class] && [property.name isEqualToString:@"payTime"]) { | ||
| 280 | + NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:([oldValue doubleValue]/1000)]; | ||
| 281 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | ||
| 282 | + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; | ||
| 283 | + self.payTimeString = [dateFormatter stringFromDate:detaildate]; | ||
| 284 | + } | ||
| 285 | + if (![oldValue isEqualToString:@"<null>"] && ![oldValue isKindOfClass:NSNull.class] && [property.name isEqualToString:@"intentEndTime"]) { | ||
| 286 | + NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:([oldValue doubleValue]/1000)]; | ||
| 287 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | ||
| 288 | + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; | ||
| 289 | + self.intentEndTimeString = [dateFormatter stringFromDate:detaildate]; | ||
| 290 | + } | ||
| 291 | + if (![oldValue isKindOfClass:NSNull.class] && [property.name isEqualToString:@"intentBeginTime"]) { | ||
| 292 | + NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:([oldValue doubleValue]/1000)]; | ||
| 293 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | ||
| 294 | + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; | ||
| 295 | + self.intentBeginTimeString = [dateFormatter stringFromDate:detaildate]; | ||
| 296 | + } | ||
| 297 | + if (![oldValue isEqualToString:@"<null>"] && ![oldValue isKindOfClass:NSNull.class] && [property.name isEqualToString:@"cancleTime"]) { | ||
| 298 | + NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:([oldValue doubleValue]/1000)]; | ||
| 299 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | ||
| 300 | + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; | ||
| 301 | + self.cancleTimeString = [dateFormatter stringFromDate:detaildate]; | ||
| 302 | + } | ||
| 303 | + return oldValue; | ||
| 304 | +} | ||
| 305 | + | ||
| 306 | +@end | ||
| 307 | + | ||
| 308 | +@implementation CNLiveCommuntyActivityDetailModel | ||
| 309 | + | ||
| 310 | +MJCodingImplementation | ||
| 311 | + | ||
| 312 | ++ (NSDictionary *)mj_replacedKeyFromPropertyName | ||
| 313 | +{ | ||
| 314 | + return @{@"idStr":@"id",@"desc":@"description"}; | ||
| 315 | +} | ||
| 316 | +- (id)mj_newValueFromOldValue:(id)oldValue property:(MJProperty *)property | ||
| 317 | +{ | ||
| 318 | + oldValue = [NSString stringWithFormat:@"%@",oldValue]; | ||
| 319 | + | ||
| 320 | + if (![oldValue isKindOfClass:NSNull.class] && [property.name isEqualToString:@"createTime"]) { | ||
| 321 | + NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:([oldValue doubleValue]/1000)]; | ||
| 322 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | ||
| 323 | + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; | ||
| 324 | + self.createTimeString = [dateFormatter stringFromDate:detaildate]; | ||
| 325 | + } | ||
| 326 | + if (![oldValue isEqualToString:@"<null>"] && ![oldValue isKindOfClass:NSNull.class] && [property.name isEqualToString:@"endTime"]) { | ||
| 327 | + NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:([oldValue doubleValue]/1000)]; | ||
| 328 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | ||
| 329 | + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; | ||
| 330 | + self.endTimeString = [dateFormatter stringFromDate:detaildate]; | ||
| 331 | + } | ||
| 332 | + if (![oldValue isEqualToString:@"<null>"] && ![oldValue isKindOfClass:NSNull.class] && [property.name isEqualToString:@"startTime"]) { | ||
| 333 | + NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:([oldValue doubleValue]/1000)]; | ||
| 334 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | ||
| 335 | + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; | ||
| 336 | + self.startTimeString = [dateFormatter stringFromDate:detaildate]; | ||
| 337 | + } | ||
| 338 | + if (![oldValue isEqualToString:@"<null>"] && ![oldValue isKindOfClass:NSNull.class] && [property.name isEqualToString:@"updateTime"]) { | ||
| 339 | + NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:([oldValue doubleValue]/1000)]; | ||
| 340 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | ||
| 341 | + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; | ||
| 342 | + self.updateTimeString = [dateFormatter stringFromDate:detaildate]; | ||
| 343 | + } | ||
| 344 | + if (![oldValue isKindOfClass:NSNull.class] && [property.name isEqualToString:@"signupEndTime"]) { | ||
| 345 | + NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:([oldValue doubleValue]/1000)]; | ||
| 346 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | ||
| 347 | + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; | ||
| 348 | + self.signupEndTimeString = [dateFormatter stringFromDate:detaildate]; | ||
| 349 | + } | ||
| 350 | + return oldValue; | ||
| 351 | +} | ||
| 352 | + | ||
| 353 | +@end | ||
| 354 | + | ||
| 355 | +@implementation CNLiveCommuntyActivitySignUpModel | ||
| 356 | +MJCodingImplementation | ||
| 357 | + | ||
| 358 | ++ (NSDictionary *)mj_replacedKeyFromPropertyName | ||
| 359 | +{ | ||
| 360 | + return @{@"idStr":@"id"}; | ||
| 361 | +} | ||
| 362 | +- (id)mj_newValueFromOldValue:(id)oldValue property:(MJProperty *)property | ||
| 363 | +{ | ||
| 364 | + oldValue = [NSString stringWithFormat:@"%@",oldValue]; | ||
| 365 | + | ||
| 366 | + if (![oldValue isKindOfClass:NSNull.class] && [property.name isEqualToString:@"createTime"]) { | ||
| 367 | + NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:([oldValue doubleValue]/1000)]; | ||
| 368 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | ||
| 369 | + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; | ||
| 370 | + self.createTimeString = [dateFormatter stringFromDate:detaildate]; | ||
| 371 | + } | ||
| 372 | + if (![oldValue isEqualToString:@"<null>"] && ![oldValue isKindOfClass:NSNull.class] && [property.name isEqualToString:@"updateTime"]) { | ||
| 373 | + NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:([oldValue doubleValue]/1000)]; | ||
| 374 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | ||
| 375 | + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; | ||
| 376 | + self.updateTimeString = [dateFormatter stringFromDate:detaildate]; | ||
| 377 | + } | ||
| 378 | + return oldValue; | ||
| 379 | +} | ||
| 380 | + | ||
| 381 | + | ||
| 382 | +@end |
CNLiveCommunitModule/Classes/View/CNLiveCommuntSignUpView.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/View/CNLiveCommuntSignUpView.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntSignUpView.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/7. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <UIKit/UIKit.h> | ||
| 9 | +#import <WebKit/WebKit.h> | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +@interface CNLiveCommuntSignUpView : UIView | ||
| 13 | + | ||
| 14 | +/// 显示接单成功弹框 | ||
| 15 | ++(void)showHaveTipSuccessViewCompleterBlock:(void(^)(void))completerBlock; | ||
| 16 | + | ||
| 17 | + | ||
| 18 | +/// 显示收款弹框 | ||
| 19 | +/// @param price 价格 | ||
| 20 | ++(void)showQrTipSuccessViewWithPrice:(NSString *)price PayUrl:(NSString *)payUrl; | ||
| 21 | + | ||
| 22 | +/// 显示双选项弹框 | ||
| 23 | +/// @param completerBlock 确认回调 | ||
| 24 | ++(void)showAlertViewWithMessage:(NSString *)message CompleterBlock:(void(^)(void))completerBlock; | ||
| 25 | + | ||
| 26 | +@end | ||
| 27 | + | ||
| 28 | + | ||
| 29 | +@protocol CNLiveCommuntSignUpUserViewDelegate <NSObject> | ||
| 30 | + | ||
| 31 | +/// 跳转到编辑或添加人员界面 | ||
| 32 | +/// @param subDict 显示信息 | ||
| 33 | +-(void)setCommuntPushAddWithEditUserViewController:(NSDictionary *)subDict; | ||
| 34 | + | ||
| 35 | +/// 跳转删除人员 | ||
| 36 | +/// @param subDict 显示信息 | ||
| 37 | +-(void)setCommuntPushAddWithDelectUserViewController:(NSDictionary *)subDict; | ||
| 38 | + | ||
| 39 | +/// 选中相关参与人 | ||
| 40 | +/// @param subDict 显示信息 | ||
| 41 | +-(void)setCommuntSelectAddWithEditUserViewController:(NSDictionary *)subDict isSelect:(BOOL)isSelect; | ||
| 42 | + | ||
| 43 | +@end | ||
| 44 | + | ||
| 45 | +@interface CNLiveCommuntSignUpUserViewCell : UITableViewCell | ||
| 46 | + | ||
| 47 | +@property (nonatomic, strong) UIView * mainView; | ||
| 48 | +@property (nonatomic, strong) UIButton * delectBtn; | ||
| 49 | +@property (nonatomic, strong) UILabel * nameLabel; | ||
| 50 | +@property (nonatomic, strong) UILabel * lineLabel; | ||
| 51 | +@property (nonatomic, strong) UILabel * sexAgeLabel; | ||
| 52 | +@property (nonatomic, strong) UILabel * phoneLabel; | ||
| 53 | +@property (nonatomic, strong) UIButton * editButton; | ||
| 54 | + | ||
| 55 | +@property (nonatomic, strong) NSDictionary * userDict; | ||
| 56 | +@property (nonatomic, strong) NSArray * selectArray; | ||
| 57 | + | ||
| 58 | +@property (nonatomic, weak) id<CNLiveCommuntSignUpUserViewDelegate> delegate; | ||
| 59 | + | ||
| 60 | +@property (nonatomic, assign) BOOL isAddUser; | ||
| 61 | + | ||
| 62 | ++(CNLiveCommuntSignUpUserViewCell *)setTableView:(UITableView *)tableView isAddUser:(BOOL)isAddUser UserDict:(NSDictionary *)userDict; | ||
| 63 | + | ||
| 64 | +@end | ||
| 65 | + | ||
| 66 | +@interface CNLiveCommuntSignUpTextViewCell : UITableViewCell | ||
| 67 | + | ||
| 68 | +@property (nonatomic, strong) UIView * mainView; | ||
| 69 | +@property (nonatomic, strong) UILabel * cententLabel; | ||
| 70 | +@property (nonatomic, strong) WKWebView * webView; | ||
| 71 | + | ||
| 72 | +@property (nonatomic, copy) NSString * desc; | ||
| 73 | + | ||
| 74 | ++(CNLiveCommuntSignUpTextViewCell *)setTableView:(UITableView *)tableView Desc:(NSString *)desc; | ||
| 75 | +@end | ||
| 76 | + | ||
| 77 | +@interface CNLiveCommuntSignUpOrderViewCell : UITableViewCell | ||
| 78 | + | ||
| 79 | +@property (nonatomic, strong) UIView * mainView; | ||
| 80 | +@property (nonatomic, strong) UILabel * nameLabel; | ||
| 81 | +@property (nonatomic, strong) UILabel * cententLabel; | ||
| 82 | + | ||
| 83 | + | ||
| 84 | +@property (nonatomic, strong) NSDictionary * paramDict; | ||
| 85 | + | ||
| 86 | ++(CNLiveCommuntSignUpOrderViewCell *)setTableView:(UITableView *)tableView Dict:(NSDictionary *)dict; | ||
| 87 | +@end | ||
| 88 | + | ||
| 89 | +@interface CNLiveCommuntSignUpAmountViewCell : UITableViewCell<UITextFieldDelegate> | ||
| 90 | + | ||
| 91 | +@property (nonatomic, strong) UIView * mainView; | ||
| 92 | +@property (nonatomic, strong) UITextField * amoutField; | ||
| 93 | +@property (nonatomic, strong) UIButton * qrButton; | ||
| 94 | +@property (nonatomic, strong) UIButton * payButton; | ||
| 95 | + | ||
| 96 | +@property (nonatomic, strong) CNLiveCommuntyActivityMaintainsCreateModel * createModel; | ||
| 97 | +@property (nonatomic, copy) void(^reloadBlock)(void); | ||
| 98 | + | ||
| 99 | ++(CNLiveCommuntSignUpAmountViewCell *)setTableView:(UITableView *)tableView CreateModel:(CNLiveCommuntyActivityMaintainsCreateModel *)createModel ReloadBlock:(void(^)(void))reloadBlock; | ||
| 100 | +@end | ||
| 101 | + | ||
| 102 | +@interface CNLiveCommuntSignUpContactViewCell : UITableViewCell | ||
| 103 | + | ||
| 104 | +@property (nonatomic, strong) UIView * mainView; | ||
| 105 | +@property (nonatomic, strong) UILabel * nameLabel; | ||
| 106 | +@property (nonatomic, strong) QMUIButton * phoneButton; | ||
| 107 | + | ||
| 108 | +@property (nonatomic, strong) CNLiveCommuntyActivityMaintainsCreateModel * createModel; | ||
| 109 | + | ||
| 110 | ++(CNLiveCommuntSignUpContactViewCell *)setTableView:(UITableView *)tableView CreateModel:(CNLiveCommuntyActivityMaintainsCreateModel *)createModel; | ||
| 111 | + | ||
| 112 | +@end | ||
| 113 | + | ||
| 114 | +@interface CNLiveCommuntSignUpDetailViewCell : UITableViewCell | ||
| 115 | + | ||
| 116 | +@property (nonatomic, strong) UIView * mainView; | ||
| 117 | +@property (nonatomic, strong) UILabel * nameLabel; | ||
| 118 | +@property (nonatomic, strong) UILabel * timeLabel; | ||
| 119 | +@property (nonatomic, strong) UILabel * topLabel; | ||
| 120 | +@property (nonatomic, strong) UILabel * lineLabel; | ||
| 121 | +@property (nonatomic, strong) UILabel * bottemLabel; | ||
| 122 | +@property (nonatomic, strong) UIImageView * statusView; | ||
| 123 | + | ||
| 124 | +@property (nonatomic, assign) BOOL isTop; | ||
| 125 | +@property (nonatomic, assign) BOOL isBottom; | ||
| 126 | +@property (nonatomic, strong) NSDictionary * dict; | ||
| 127 | + | ||
| 128 | ++(CNLiveCommuntSignUpDetailViewCell *)setTableView:(UITableView *)tableView isTop:(BOOL)isTop isBottom:(BOOL)isbottom Dict:(NSDictionary *)dict; | ||
| 129 | + | ||
| 130 | +@end | ||
| 131 | + | ||
| 132 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/View/CNLiveCommuntSignUpView.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/View/CNLiveCommuntSignUpView.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntSignUpView.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/7. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntSignUpView.h" | ||
| 9 | + | ||
| 10 | +@implementation CNLiveCommuntSignUpView | ||
| 11 | + | ||
| 12 | +/// 显示接单成功弹框 | ||
| 13 | ++(void)showHaveTipSuccessViewCompleterBlock:(void(^)(void))completerBlock | ||
| 14 | +{ | ||
| 15 | + UIView * tipView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)]; | ||
| 16 | + tipView.backgroundColor = [UIColor whiteColor]; | ||
| 17 | + tipView.layer.masksToBounds = YES; | ||
| 18 | + tipView.layer.cornerRadius = 10; | ||
| 19 | + | ||
| 20 | + QMUIButton * successBtn = [[QMUIButton alloc] initWithFrame:tipView.bounds]; | ||
| 21 | + [successBtn setTitle:@"接单成功!" forState:UIControlStateNormal]; | ||
| 22 | + [successBtn setTitle:@"接单成功!" forState:UIControlStateHighlighted]; | ||
| 23 | + [successBtn setImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_communty_result_success"] forState:UIControlStateNormal]; | ||
| 24 | + successBtn.titleLabel.font = [UIFont systemFontOfSize:16]; | ||
| 25 | + successBtn.titleLabel.font = [UIFont boldSystemFontOfSize:16]; | ||
| 26 | + [successBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; | ||
| 27 | + successBtn.imagePosition = QMUIButtonImagePositionTop; | ||
| 28 | + successBtn.spacingBetweenImageAndTitle = 10; | ||
| 29 | + [tipView addSubview:successBtn]; | ||
| 30 | + | ||
| 31 | + QMUIModalPresentationViewController *modalViewController = [[QMUIModalPresentationViewController alloc] init]; | ||
| 32 | + modalViewController.animationStyle = QMUIModalPresentationAnimationStyleFade; | ||
| 33 | + modalViewController.contentView = tipView; | ||
| 34 | + [modalViewController showWithAnimated:YES completion:nil]; | ||
| 35 | + | ||
| 36 | + __weak typeof(modalViewController) weakModalViewController = modalViewController; | ||
| 37 | + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | ||
| 38 | + [weakModalViewController hideWithAnimated:YES completion:^(BOOL finished) { | ||
| 39 | + if (completerBlock) completerBlock(); | ||
| 40 | + }]; | ||
| 41 | + }); | ||
| 42 | +} | ||
| 43 | + | ||
| 44 | +/// 显示双选项弹框 | ||
| 45 | +/// @param completerBlock 确认回调 | ||
| 46 | ++(void)showAlertViewWithMessage:(NSString *)message CompleterBlock:(void(^)(void))completerBlock | ||
| 47 | +{ | ||
| 48 | + QMUIAlertAction *action1 = [QMUIAlertAction actionWithTitle:@"取消" style:QMUIAlertActionStyleCancel handler:NULL]; | ||
| 49 | + QMUIAlertAction *action2 = [QMUIAlertAction actionWithTitle:@"确定" style:QMUIAlertActionStyleDefault handler:^(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action) { | ||
| 50 | + if (completerBlock) completerBlock(); | ||
| 51 | + }]; | ||
| 52 | + // 弹窗 | ||
| 53 | + QMUIAlertController *alertController = [[QMUIAlertController alloc] initWithTitle:@"提示" message:message preferredStyle:QMUIAlertControllerStyleAlert]; | ||
| 54 | + NSMutableDictionary *titleAttributs = [[NSMutableDictionary alloc] initWithDictionary:alertController.alertTitleAttributes]; | ||
| 55 | + titleAttributs[NSForegroundColorAttributeName] = [UIColor blackColor]; | ||
| 56 | + alertController.alertTitleAttributes = titleAttributs; | ||
| 57 | + | ||
| 58 | + action1.buttonAttributes = titleAttributs; | ||
| 59 | + | ||
| 60 | + NSMutableDictionary *sureTitleAttributs = [[NSMutableDictionary alloc] initWithDictionary:alertController.alertTitleAttributes]; | ||
| 61 | + sureTitleAttributs[NSForegroundColorAttributeName] = UIColorMake(0, 194, 0); | ||
| 62 | + action2.buttonAttributes = sureTitleAttributs; | ||
| 63 | + alertController.alertHeaderBackgroundColor = [UIColor whiteColor]; | ||
| 64 | + alertController.alertSeparatorColor = [UIColor grayColor]; | ||
| 65 | + alertController.alertTitleMessageSpacing = 7; | ||
| 66 | + alertController.alertButtonBackgroundColor = [UIColor whiteColor]; | ||
| 67 | + | ||
| 68 | + [alertController addAction:action1]; | ||
| 69 | + [alertController addAction:action2]; | ||
| 70 | + [alertController showWithAnimated:YES]; | ||
| 71 | +} | ||
| 72 | + | ||
| 73 | +/// 显示收款弹框 | ||
| 74 | +/// @param price 价格 | ||
| 75 | ++(void)showQrTipSuccessViewWithPrice:(NSString *)price PayUrl:(NSString *)payUrl | ||
| 76 | +{ | ||
| 77 | + UIView * tipView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth - 60, 300)]; | ||
| 78 | + tipView.backgroundColor = [UIColor whiteColor]; | ||
| 79 | + tipView.layer.masksToBounds = YES; | ||
| 80 | + tipView.layer.cornerRadius = 10; | ||
| 81 | + | ||
| 82 | + UILabel * priceLabel = [[UILabel alloc] init]; | ||
| 83 | + priceLabel.textColor = [UIColor blackColor]; | ||
| 84 | + priceLabel.font = [UIFont systemFontOfSize:17]; | ||
| 85 | + priceLabel.font = [UIFont boldSystemFontOfSize:17]; | ||
| 86 | + priceLabel.textAlignment = NSTextAlignmentCenter; | ||
| 87 | + priceLabel.text = [NSString stringWithFormat:@"收款金额: %@元",price]; | ||
| 88 | + [tipView addSubview:priceLabel]; | ||
| 89 | + [priceLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 90 | + make.centerX.mas_equalTo(tipView); | ||
| 91 | + make.top.mas_equalTo(tipView).offset(20); | ||
| 92 | + }]; | ||
| 93 | + | ||
| 94 | + UIImageView * qrView = [[UIImageView alloc] init]; | ||
| 95 | + qrView.contentMode = UIViewContentModeScaleAspectFill; | ||
| 96 | + qrView.backgroundColor = [UIColor whiteColor]; | ||
| 97 | + qrView.image = [CNLiveCommuntSignUpView communty_generateWithDefaultQRCodeData:payUrl imageViewWidth:kScreenWidth - 60]; | ||
| 98 | + [tipView addSubview:qrView]; | ||
| 99 | + [qrView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 100 | + make.centerX.mas_equalTo(tipView); | ||
| 101 | + make.top.mas_equalTo(priceLabel.mas_bottom).offset(15); | ||
| 102 | + make.size.mas_equalTo(230); | ||
| 103 | + }]; | ||
| 104 | + | ||
| 105 | + QMUIModalPresentationViewController *modalViewController = [[QMUIModalPresentationViewController alloc] init]; | ||
| 106 | + modalViewController.animationStyle = QMUIModalPresentationAnimationStyleFade; | ||
| 107 | + modalViewController.contentView = tipView; | ||
| 108 | + [modalViewController showWithAnimated:YES completion:nil]; | ||
| 109 | + | ||
| 110 | +// __weak typeof(modalViewController) weakModalViewController = modalViewController; | ||
| 111 | +// [payButton addBlockForControlEvents:UIControlEventTouchUpInside block:^(id _Nonnull sender) { | ||
| 112 | +// [weakModalViewController hideWithAnimated:YES completion:NULL]; | ||
| 113 | +// }]; | ||
| 114 | +} | ||
| 115 | + | ||
| 116 | ++ (UIImage *)communty_generateWithDefaultQRCodeData:(NSString *)data imageViewWidth:(CGFloat)imageViewWidth { | ||
| 117 | + | ||
| 118 | + CIFilter *filter = [CIFilter filterWithName:@"CIQRCodeGenerator"]; | ||
| 119 | + [filter setDefaults]; | ||
| 120 | + NSString *info = data; | ||
| 121 | + NSData *infoData = [info dataUsingEncoding:NSUTF8StringEncoding]; | ||
| 122 | + [filter setValue:infoData forKeyPath:@"inputMessage"]; | ||
| 123 | + CIImage *outputImage = [filter outputImage]; | ||
| 124 | + | ||
| 125 | + return [CNLiveCommuntSignUpView communty_createNonInterpolatedUIImageFormCIImage:outputImage withSize:imageViewWidth]; | ||
| 126 | +} | ||
| 127 | + | ||
| 128 | +/** 根据CIImage生成指定大小的UIImage */ | ||
| 129 | ++ (UIImage *)communty_createNonInterpolatedUIImageFormCIImage:(CIImage *)image withSize:(CGFloat)size { | ||
| 130 | + CGRect extent = CGRectIntegral(image.extent); | ||
| 131 | + CGFloat scale = MIN(size/CGRectGetWidth(extent), size/CGRectGetHeight(extent)); | ||
| 132 | + | ||
| 133 | + // 1.创建bitmap; | ||
| 134 | + size_t width = CGRectGetWidth(extent) * scale; | ||
| 135 | + size_t height = CGRectGetHeight(extent) * scale; | ||
| 136 | + CGColorSpaceRef cs = CGColorSpaceCreateDeviceGray(); | ||
| 137 | + CGContextRef bitmapRef = CGBitmapContextCreate(nil, width, height, 8, 0, cs, (CGBitmapInfo)kCGImageAlphaNone); | ||
| 138 | + CIContext *context = [CIContext contextWithOptions:nil]; | ||
| 139 | + CGImageRef bitmapImage = [context createCGImage:image fromRect:extent]; | ||
| 140 | + CGContextSetInterpolationQuality(bitmapRef, kCGInterpolationNone); | ||
| 141 | + CGContextScaleCTM(bitmapRef, scale, scale); | ||
| 142 | + CGContextDrawImage(bitmapRef, extent, bitmapImage); | ||
| 143 | + | ||
| 144 | + // 2.保存bitmap到图片 | ||
| 145 | + CGImageRef scaledImage = CGBitmapContextCreateImage(bitmapRef); | ||
| 146 | + CGContextRelease(bitmapRef); | ||
| 147 | + CGImageRelease(bitmapImage); | ||
| 148 | + return [UIImage imageWithCGImage:scaledImage]; | ||
| 149 | +} | ||
| 150 | + | ||
| 151 | +@end | ||
| 152 | + | ||
| 153 | +@implementation CNLiveCommuntSignUpUserViewCell | ||
| 154 | + | ||
| 155 | ++(CNLiveCommuntSignUpUserViewCell *)setTableView:(UITableView *)tableView isAddUser:(BOOL)isAddUser UserDict:(nonnull NSDictionary *)userDict | ||
| 156 | +{ | ||
| 157 | + CNLiveCommuntSignUpUserViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"CNLiveCommuntSignUpViewCell"]; | ||
| 158 | + if (!cell) { | ||
| 159 | + cell = [[CNLiveCommuntSignUpUserViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CNLiveCommuntSignUpViewCell"]; | ||
| 160 | + } | ||
| 161 | + cell.userDict = userDict; | ||
| 162 | + cell.isAddUser = isAddUser; | ||
| 163 | + return cell; | ||
| 164 | +} | ||
| 165 | +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | ||
| 166 | +{ | ||
| 167 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | ||
| 168 | + if (self) { | ||
| 169 | + self.selectionStyle = UITableViewCellSelectionStyleNone; | ||
| 170 | + self.contentView.backgroundColor = [UIColor clearColor]; | ||
| 171 | + self.backgroundColor = [UIColor clearColor]; | ||
| 172 | + [self.contentView addSubview:self.mainView]; | ||
| 173 | + [self.mainView addSubview:self.nameLabel]; | ||
| 174 | + [self.mainView addSubview:self.lineLabel]; | ||
| 175 | + [self.mainView addSubview:self.sexAgeLabel]; | ||
| 176 | + [self.mainView addSubview:self.phoneLabel]; | ||
| 177 | + [self.mainView addSubview:self.delectBtn]; | ||
| 178 | + [self.mainView addSubview:self.editButton]; | ||
| 179 | + } | ||
| 180 | + return self; | ||
| 181 | +} | ||
| 182 | +-(void)setSelectArray:(NSArray *)selectArray | ||
| 183 | +{ | ||
| 184 | + _selectArray = selectArray; | ||
| 185 | + | ||
| 186 | +} | ||
| 187 | +-(void)setUserDict:(NSDictionary *)userDict | ||
| 188 | +{ | ||
| 189 | + _userDict = userDict; | ||
| 190 | + _nameLabel.text = [userDict stringValueForKey:@"name" default:@""]; | ||
| 191 | + _sexAgeLabel.text = [NSString stringWithFormat:@"%@ %@岁",[[userDict stringValueForKey:@"gender" default:@""] isEqualToString:@"0"]?@"女":@"男",[userDict stringValueForKey:@"age" default:@""]]; | ||
| 192 | + _phoneLabel.text = [NSString stringWithFormat:@"联系电话:%@",[userDict stringValueForKey:@"mobile" default:@""]]; | ||
| 193 | +} | ||
| 194 | +-(void)setIsAddUser:(BOOL)isAddUser | ||
| 195 | +{ | ||
| 196 | + _isAddUser = isAddUser; | ||
| 197 | + self.editButton.hidden = !isAddUser; | ||
| 198 | + if (isAddUser) { | ||
| 199 | + [self.delectBtn setImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_communty_add_user_nomal"] forState:UIControlStateNormal]; | ||
| 200 | + [self.delectBtn setImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_communty_add_user_nomal"] forState:UIControlStateHighlighted]; | ||
| 201 | + [self.delectBtn setImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_communty_add_user_select"] forState:UIControlStateSelected]; | ||
| 202 | + }else{ | ||
| 203 | + [self.delectBtn setImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_communty_list_delect_user"] forState:UIControlStateNormal]; | ||
| 204 | + [self.delectBtn setImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_communty_list_delect_user"] forState:UIControlStateHighlighted]; | ||
| 205 | + } | ||
| 206 | +} | ||
| 207 | +-(void)selectUserAction:(UIButton *)button | ||
| 208 | +{ | ||
| 209 | + button.selected = !button.selected; | ||
| 210 | + if (!self.isAddUser) { | ||
| 211 | + if ([self.delegate respondsToSelector:@selector(setCommuntPushAddWithDelectUserViewController:)]) { | ||
| 212 | + [self.delegate setCommuntPushAddWithDelectUserViewController:self.userDict]; | ||
| 213 | + } | ||
| 214 | + }else{ | ||
| 215 | + if ([self.delegate respondsToSelector:@selector(setCommuntSelectAddWithEditUserViewController:isSelect:)]) { | ||
| 216 | + [self.delegate setCommuntSelectAddWithEditUserViewController:self.userDict isSelect:button.selected]; | ||
| 217 | + } | ||
| 218 | + } | ||
| 219 | +} | ||
| 220 | +-(void)editUserAction:(UIButton *)button | ||
| 221 | +{ | ||
| 222 | + if ([self.delegate respondsToSelector:@selector(setCommuntPushAddWithEditUserViewController:)]) { | ||
| 223 | + [self.delegate setCommuntPushAddWithEditUserViewController:self.userDict]; | ||
| 224 | + } | ||
| 225 | +} | ||
| 226 | +-(void)layoutSubviews | ||
| 227 | +{ | ||
| 228 | + [super layoutSubviews]; | ||
| 229 | + __weak typeof(self) weakSelf = self; | ||
| 230 | + [self.mainView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 231 | + make.left.mas_equalTo(weakSelf.contentView).offset(10); | ||
| 232 | + make.right.mas_equalTo(weakSelf.contentView).offset(-10); | ||
| 233 | + make.top.bottom.mas_equalTo(weakSelf.contentView); | ||
| 234 | + }]; | ||
| 235 | + [self.delectBtn mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 236 | + make.centerY.mas_equalTo(weakSelf.mainView); | ||
| 237 | + make.left.mas_equalTo(weakSelf.mainView).offset(10); | ||
| 238 | + make.size.mas_equalTo(20); | ||
| 239 | + }]; | ||
| 240 | + [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 241 | + make.top.mas_equalTo(weakSelf.mainView).offset(5); | ||
| 242 | + make.left.mas_equalTo(weakSelf.delectBtn.mas_right).offset(10); | ||
| 243 | + }]; | ||
| 244 | + [self.lineLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 245 | + make.centerY.mas_equalTo(weakSelf.nameLabel); | ||
| 246 | + make.left.mas_equalTo(weakSelf.nameLabel.mas_right).offset(5); | ||
| 247 | + make.height.mas_equalTo(15); | ||
| 248 | + make.width.mas_equalTo(0.5); | ||
| 249 | + }]; | ||
| 250 | + [self.sexAgeLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 251 | + make.centerY.mas_equalTo(weakSelf.nameLabel); | ||
| 252 | + make.left.mas_equalTo(weakSelf.lineLabel.mas_right).offset(5); | ||
| 253 | + }]; | ||
| 254 | + [self.phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 255 | + make.left.mas_equalTo(weakSelf.delectBtn.mas_right).offset(10); | ||
| 256 | + make.top.mas_equalTo(weakSelf.nameLabel.mas_bottom).offset(5); | ||
| 257 | + }]; | ||
| 258 | + [self.editButton mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 259 | + make.centerY.mas_equalTo(weakSelf.mainView); | ||
| 260 | + make.right.mas_equalTo(weakSelf.mainView.mas_right).offset(-10); | ||
| 261 | + make.size.mas_equalTo(20); | ||
| 262 | + }]; | ||
| 263 | +} | ||
| 264 | +#pragma mark = | ||
| 265 | +-(UIView *)mainView | ||
| 266 | +{ | ||
| 267 | + if (!_mainView) { | ||
| 268 | + _mainView = [[UIView alloc] init]; | ||
| 269 | + _mainView.backgroundColor = [UIColor whiteColor]; | ||
| 270 | + } | ||
| 271 | + return _mainView; | ||
| 272 | +} | ||
| 273 | +-(UILabel *)nameLabel | ||
| 274 | +{ | ||
| 275 | + if (!_nameLabel) { | ||
| 276 | + _nameLabel = [[UILabel alloc] init]; | ||
| 277 | + _nameLabel.textColor = UIColorHex(#333333); | ||
| 278 | + _nameLabel.lineBreakMode = NSLineBreakByTruncatingTail; | ||
| 279 | + _nameLabel.numberOfLines = 1; | ||
| 280 | + _nameLabel.font = [UIFont systemFontOfSize:15]; | ||
| 281 | + _nameLabel.font = [UIFont boldSystemFontOfSize:15]; | ||
| 282 | + } | ||
| 283 | + return _nameLabel; | ||
| 284 | +} | ||
| 285 | +-(UILabel *)lineLabel | ||
| 286 | +{ | ||
| 287 | + if (!_lineLabel) { | ||
| 288 | + _lineLabel = [[UILabel alloc] init]; | ||
| 289 | + _lineLabel.backgroundColor = UIColorHex(#C8C8C8); | ||
| 290 | + _lineLabel.hidden = YES; | ||
| 291 | + } | ||
| 292 | + return _lineLabel; | ||
| 293 | +} | ||
| 294 | +-(UILabel *)sexAgeLabel | ||
| 295 | +{ | ||
| 296 | + if (!_sexAgeLabel) { | ||
| 297 | + _sexAgeLabel = [[UILabel alloc] init]; | ||
| 298 | + _sexAgeLabel.textColor = UIColorHex(#8A8A8A); | ||
| 299 | + _sexAgeLabel.lineBreakMode = NSLineBreakByTruncatingTail; | ||
| 300 | + _sexAgeLabel.numberOfLines = 1; | ||
| 301 | + _sexAgeLabel.font = [UIFont systemFontOfSize:11]; | ||
| 302 | + _sexAgeLabel.font = [UIFont boldSystemFontOfSize:11]; | ||
| 303 | + } | ||
| 304 | + return _sexAgeLabel; | ||
| 305 | +} | ||
| 306 | +-(UILabel *)phoneLabel | ||
| 307 | +{ | ||
| 308 | + if (!_phoneLabel) { | ||
| 309 | + _phoneLabel = [[UILabel alloc] init]; | ||
| 310 | + _phoneLabel.textColor = UIColorHex(#8A8A8A); | ||
| 311 | + _phoneLabel.lineBreakMode = NSLineBreakByTruncatingTail; | ||
| 312 | + _phoneLabel.numberOfLines = 1; | ||
| 313 | + _phoneLabel.font = [UIFont systemFontOfSize:11]; | ||
| 314 | + _phoneLabel.font = [UIFont boldSystemFontOfSize:11]; | ||
| 315 | + } | ||
| 316 | + return _phoneLabel; | ||
| 317 | +} | ||
| 318 | +-(UIButton *)delectBtn | ||
| 319 | +{ | ||
| 320 | + if (!_delectBtn) { | ||
| 321 | + _delectBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 322 | + _delectBtn.backgroundColor = [UIColor whiteColor]; | ||
| 323 | + [_delectBtn addTarget:self action:@selector(selectUserAction:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 324 | + } | ||
| 325 | + return _delectBtn; | ||
| 326 | +} | ||
| 327 | +-(UIButton *)editButton | ||
| 328 | +{ | ||
| 329 | + if (!_editButton) { | ||
| 330 | + _editButton = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 331 | + [_editButton setImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_communty_list_edit_user"] forState:UIControlStateNormal]; | ||
| 332 | + _editButton.backgroundColor = [UIColor whiteColor]; | ||
| 333 | + [_editButton addTarget:self action:@selector(editUserAction:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 334 | + } | ||
| 335 | + return _editButton; | ||
| 336 | +} | ||
| 337 | +@end | ||
| 338 | + | ||
| 339 | + | ||
| 340 | +@implementation CNLiveCommuntSignUpTextViewCell | ||
| 341 | + | ||
| 342 | ++(CNLiveCommuntSignUpTextViewCell *)setTableView:(UITableView *)tableView Desc:(nonnull NSString *)desc | ||
| 343 | +{ | ||
| 344 | + CNLiveCommuntSignUpTextViewCell * textCell = [tableView dequeueReusableCellWithIdentifier:@"CNLiveCommuntSignUpTextViewCell"]; | ||
| 345 | + if (!textCell) { | ||
| 346 | + textCell = [[CNLiveCommuntSignUpTextViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CNLiveCommuntSignUpTextViewCell"]; | ||
| 347 | + } | ||
| 348 | + textCell.desc = desc; | ||
| 349 | + return textCell; | ||
| 350 | +} | ||
| 351 | +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | ||
| 352 | +{ | ||
| 353 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | ||
| 354 | + if (self) { | ||
| 355 | + self.contentView.backgroundColor = [UIColor clearColor]; | ||
| 356 | + self.selectionStyle = UITableViewCellSelectionStyleNone; | ||
| 357 | + self.backgroundColor = [UIColor clearColor]; | ||
| 358 | + [self.contentView addSubview:self.mainView]; | ||
| 359 | + [self.mainView addSubview:self.webView]; | ||
| 360 | + } | ||
| 361 | + return self; | ||
| 362 | +} | ||
| 363 | +-(void)setDesc:(NSString *)desc | ||
| 364 | +{ | ||
| 365 | + [self.webView loadHTMLString:[NSString stringWithFormat:[self loadDocumentHTML],desc] baseURL:nil]; | ||
| 366 | +} | ||
| 367 | + | ||
| 368 | +-(void)layoutSubviews | ||
| 369 | +{ | ||
| 370 | + [super layoutSubviews]; | ||
| 371 | + __weak typeof(self) weakSelf = self; | ||
| 372 | + [self.mainView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 373 | + make.left.top.mas_equalTo(weakSelf.contentView).offset(10); | ||
| 374 | + make.bottom.right.mas_equalTo(weakSelf.contentView).offset(-10); | ||
| 375 | + }]; | ||
| 376 | + [self.webView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 377 | +// make.left.top.mas_equalTo(weakSelf.mainView).offset(10); | ||
| 378 | +// make.right.bottom.mas_equalTo(weakSelf.mainView).offset(-10); | ||
| 379 | + make.edges.mas_equalTo(weakSelf.mainView); | ||
| 380 | + }]; | ||
| 381 | +} | ||
| 382 | +-(UIView *)mainView | ||
| 383 | +{ | ||
| 384 | + if (!_mainView) { | ||
| 385 | + _mainView = [[UIView alloc] init]; | ||
| 386 | + _mainView.backgroundColor = [UIColor whiteColor]; | ||
| 387 | + _mainView.layer.masksToBounds = YES; | ||
| 388 | + _mainView.layer.cornerRadius = 8; | ||
| 389 | + } | ||
| 390 | + return _mainView; | ||
| 391 | +} | ||
| 392 | +-(WKWebView *)webView | ||
| 393 | +{ | ||
| 394 | + if (!_webView) { | ||
| 395 | + WKWebViewConfiguration * configuration = [[WKWebViewConfiguration alloc] init]; | ||
| 396 | + configuration.preferences.javaScriptEnabled = NO;//打开js交互 | ||
| 397 | + _webView = [[WKWebView alloc] initWithFrame:CGRectZero configuration:configuration]; | ||
| 398 | + _webView.backgroundColor = [UIColor whiteColor]; | ||
| 399 | + _webView.allowsBackForwardNavigationGestures = NO;//打开网页间的 滑动返回 | ||
| 400 | + _webView.scrollView.decelerationRate = UIScrollViewDecelerationRateNormal; | ||
| 401 | + if (@available(iOS 9.0, *)) _webView.allowsLinkPreview = NO; | ||
| 402 | + | ||
| 403 | + } | ||
| 404 | + return _webView; | ||
| 405 | +} | ||
| 406 | + | ||
| 407 | +-(UILabel *)cententLabel | ||
| 408 | +{ | ||
| 409 | + if (!_cententLabel) { | ||
| 410 | + _cententLabel = [[UILabel alloc] init]; | ||
| 411 | + _cententLabel.textColor = UIColorHex(#333333); | ||
| 412 | + _cententLabel.backgroundColor = [UIColor whiteColor]; | ||
| 413 | + _cententLabel.lineBreakMode = NSLineBreakByCharWrapping; | ||
| 414 | + _cententLabel.numberOfLines = 0; | ||
| 415 | + _cententLabel.layer.masksToBounds = YES; | ||
| 416 | + _cententLabel.layer.cornerRadius = 12; | ||
| 417 | + _cententLabel.font = [UIFont systemFontOfSize:15]; | ||
| 418 | + _cententLabel.font = [UIFont boldSystemFontOfSize:15]; | ||
| 419 | + _cententLabel.text = @"1. 现场签到 2. 工作人员介绍本次活动内容 3. 老师讲解衍纸制作流程并现场制作 4. 合影留念"; | ||
| 420 | + } | ||
| 421 | + return _cententLabel; | ||
| 422 | +} | ||
| 423 | +-(NSString *)loadDocumentHTML | ||
| 424 | +{ | ||
| 425 | + return @"<!DOCTYPE html>\n" | ||
| 426 | + "<html> \n" | ||
| 427 | + "<head> \n" | ||
| 428 | + "<meta charset=\"utf-8\" name=\"viewport\" content=\"initial-scale=1.0, maximum-scale=1.0, user-scalable=no\"> \n" | ||
| 429 | + "<style type=\"text/css\"> \n" | ||
| 430 | + "body {font-weight: normal;line-height: 0 auto-pos;text-align: left;} \n" | ||
| 431 | + "</style> \n" | ||
| 432 | + "</head> \n" | ||
| 433 | + "<body> \n" | ||
| 434 | + "%@" | ||
| 435 | + "</body> \n" | ||
| 436 | + "</html> \n"; | ||
| 437 | +} | ||
| 438 | +@end | ||
| 439 | + | ||
| 440 | +@implementation CNLiveCommuntSignUpOrderViewCell | ||
| 441 | + | ||
| 442 | ++(CNLiveCommuntSignUpOrderViewCell *)setTableView:(UITableView *)tableView Dict:(NSDictionary *)dict | ||
| 443 | +{ | ||
| 444 | + CNLiveCommuntSignUpOrderViewCell * textCell = [tableView dequeueReusableCellWithIdentifier:@"CNLiveCommuntSignUpOrderView"]; | ||
| 445 | + if (!textCell) { | ||
| 446 | + textCell = [[CNLiveCommuntSignUpOrderViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CNLiveCommuntSignUpTextViewCell"]; | ||
| 447 | + } | ||
| 448 | + textCell.paramDict = dict; | ||
| 449 | + return textCell; | ||
| 450 | +} | ||
| 451 | +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | ||
| 452 | +{ | ||
| 453 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | ||
| 454 | + if (self) { | ||
| 455 | + self.contentView.backgroundColor = [UIColor clearColor]; | ||
| 456 | + self.selectionStyle = UITableViewCellSelectionStyleNone; | ||
| 457 | + self.backgroundColor = [UIColor clearColor]; | ||
| 458 | + [self.contentView addSubview:self.mainView]; | ||
| 459 | + [self.mainView addSubview:self.nameLabel]; | ||
| 460 | + [self.mainView addSubview:self.cententLabel]; | ||
| 461 | + } | ||
| 462 | + return self; | ||
| 463 | +} | ||
| 464 | +-(void)layoutSubviews | ||
| 465 | +{ | ||
| 466 | + [super layoutSubviews]; | ||
| 467 | + __weak typeof(self) weakSelf = self; | ||
| 468 | + [self.mainView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 469 | + make.left.mas_equalTo(weakSelf.contentView.mas_left).offset(10); | ||
| 470 | + make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-10); | ||
| 471 | + make.bottom.top.mas_equalTo(weakSelf.contentView); | ||
| 472 | + }]; | ||
| 473 | + | ||
| 474 | + [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 475 | + make.left.mas_equalTo(weakSelf.mainView.mas_left).offset(10); | ||
| 476 | + make.width.mas_equalTo(65); | ||
| 477 | + make.top.bottom.mas_equalTo(weakSelf.mainView); | ||
| 478 | + }]; | ||
| 479 | + [self.cententLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 480 | + make.left.mas_equalTo(weakSelf.nameLabel.mas_right); | ||
| 481 | + make.right.mas_equalTo(weakSelf.mainView.mas_right).offset(-10); | ||
| 482 | + make.top.bottom.mas_equalTo(weakSelf.mainView); | ||
| 483 | + }]; | ||
| 484 | +} | ||
| 485 | +-(void)setParamDict:(NSDictionary *)paramDict | ||
| 486 | +{ | ||
| 487 | + _paramDict = paramDict; | ||
| 488 | + _nameLabel.text = [paramDict stringValueForKey:@"key" default:@""]; | ||
| 489 | + _cententLabel.text = [paramDict stringValueForKey:@"value" default:@""]; | ||
| 490 | +} | ||
| 491 | +-(UIView *)mainView | ||
| 492 | +{ | ||
| 493 | + if (!_mainView) { | ||
| 494 | + _mainView = [[UIView alloc] init]; | ||
| 495 | + _mainView.backgroundColor = [UIColor whiteColor]; | ||
| 496 | + } | ||
| 497 | + return _mainView; | ||
| 498 | +} | ||
| 499 | +-(UILabel *)nameLabel | ||
| 500 | +{ | ||
| 501 | + if (!_nameLabel) { | ||
| 502 | + _nameLabel = [[UILabel alloc] init]; | ||
| 503 | + _nameLabel.textColor = UIColorHex(#999999); | ||
| 504 | + _nameLabel.lineBreakMode = NSLineBreakByTruncatingTail; | ||
| 505 | + _nameLabel.numberOfLines = 1; | ||
| 506 | + _nameLabel.backgroundColor = UIColorHex(#F9F9F9); | ||
| 507 | + _nameLabel.textAlignment = NSTextAlignmentCenter; | ||
| 508 | + _nameLabel.font = [UIFont systemFontOfSize:14]; | ||
| 509 | + _nameLabel.font = [UIFont boldSystemFontOfSize:14]; | ||
| 510 | + | ||
| 511 | + } | ||
| 512 | + return _nameLabel; | ||
| 513 | +} | ||
| 514 | +-(UILabel *)cententLabel | ||
| 515 | +{ | ||
| 516 | + if (!_cententLabel) { | ||
| 517 | + _cententLabel = [[UILabel alloc] init]; | ||
| 518 | + _cententLabel.textColor = UIColorHex(#333333); | ||
| 519 | + _cententLabel.backgroundColor = UIColorHex(#F9F9F9); | ||
| 520 | + _cententLabel.lineBreakMode = NSLineBreakByCharWrapping; | ||
| 521 | + _cententLabel.numberOfLines = 1; | ||
| 522 | + _cententLabel.font = [UIFont systemFontOfSize:15]; | ||
| 523 | + _cententLabel.font = [UIFont boldSystemFontOfSize:15]; | ||
| 524 | + | ||
| 525 | + } | ||
| 526 | + return _cententLabel; | ||
| 527 | +} | ||
| 528 | +@end | ||
| 529 | + | ||
| 530 | + | ||
| 531 | +@implementation CNLiveCommuntSignUpAmountViewCell | ||
| 532 | + | ||
| 533 | ++(CNLiveCommuntSignUpAmountViewCell *)setTableView:(UITableView *)tableView CreateModel:(CNLiveCommuntyActivityMaintainsCreateModel *)createModel ReloadBlock:(nonnull void (^)(void))reloadBlock | ||
| 534 | +{ | ||
| 535 | + CNLiveCommuntSignUpAmountViewCell * textCell = [tableView dequeueReusableCellWithIdentifier:@"CNLiveCommuntSignUpAmountViewCell"]; | ||
| 536 | + if (!textCell) { | ||
| 537 | + textCell = [[CNLiveCommuntSignUpAmountViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CNLiveCommuntSignUpAmountViewCell"]; | ||
| 538 | + } | ||
| 539 | + textCell.reloadBlock = reloadBlock; | ||
| 540 | + textCell.createModel = createModel; | ||
| 541 | + return textCell; | ||
| 542 | +} | ||
| 543 | +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | ||
| 544 | +{ | ||
| 545 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | ||
| 546 | + if (self) { | ||
| 547 | + self.contentView.backgroundColor = [UIColor clearColor]; | ||
| 548 | + self.selectionStyle = UITableViewCellSelectionStyleNone; | ||
| 549 | + self.backgroundColor = [UIColor clearColor]; | ||
| 550 | + [self.contentView addSubview:self.mainView]; | ||
| 551 | + [self.mainView addSubview:self.amoutField]; | ||
| 552 | + [self.mainView addSubview:self.qrButton]; | ||
| 553 | + [self.mainView addSubview:self.payButton]; | ||
| 554 | + } | ||
| 555 | + return self; | ||
| 556 | +} | ||
| 557 | +-(void)setCreateModel:(CNLiveCommuntyActivityMaintainsCreateModel *)createModel | ||
| 558 | +{ | ||
| 559 | + _createModel = createModel; | ||
| 560 | + if ([createModel.totalFee isNotBlank] | ||
| 561 | + && [createModel.totalFee integerValue] > 0) { | ||
| 562 | + NSString * p = [NSString stringWithFormat:@"%.2f",([createModel.totalFee floatValue]/100)]; | ||
| 563 | + self.amoutField.text = p; | ||
| 564 | + self.amoutField.enabled = NO; | ||
| 565 | + self.amoutField.textColor = UIColorHex(#c8c8c8); | ||
| 566 | + } | ||
| 567 | +} | ||
| 568 | +-(void)layoutSubviews | ||
| 569 | +{ | ||
| 570 | + [super layoutSubviews]; | ||
| 571 | + __weak typeof(self) weakSelf = self; | ||
| 572 | + [self.mainView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 573 | + make.left.mas_equalTo(weakSelf.contentView.mas_left).offset(10); | ||
| 574 | + make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-10); | ||
| 575 | + make.bottom.mas_equalTo(weakSelf.contentView).offset(-10); | ||
| 576 | + make.top.mas_equalTo(weakSelf.contentView).offset(10); | ||
| 577 | + }]; | ||
| 578 | + [self.amoutField mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 579 | + make.top.mas_equalTo(weakSelf.mainView.mas_top).offset(10); | ||
| 580 | + make.left.mas_equalTo(weakSelf.mainView.mas_left).offset(10); | ||
| 581 | + make.right.mas_equalTo(weakSelf.mainView.mas_right).offset(-10); | ||
| 582 | + make.height.mas_equalTo(40); | ||
| 583 | + }]; | ||
| 584 | + [self.qrButton mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 585 | + make.top.mas_equalTo(weakSelf.amoutField.mas_bottom).offset(10); | ||
| 586 | + make.left.mas_equalTo(weakSelf.mainView.mas_left).offset(10); | ||
| 587 | + make.width.mas_equalTo((kScreenWidth - 50)/2); | ||
| 588 | + make.height.mas_equalTo(40); | ||
| 589 | + }]; | ||
| 590 | + [self.payButton mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 591 | + make.top.mas_equalTo(weakSelf.amoutField.mas_bottom).offset(10); | ||
| 592 | + make.right.mas_equalTo(weakSelf.mainView.mas_right).offset(-10); | ||
| 593 | + make.width.mas_equalTo((kScreenWidth - 50)/2); | ||
| 594 | + make.height.mas_equalTo(40); | ||
| 595 | + }]; | ||
| 596 | +} | ||
| 597 | +-(void)qrCreateAction | ||
| 598 | +{ | ||
| 599 | + if ([self.amoutField.text floatValue] == 0 || ([self.amoutField.text floatValue] < 0.01 && ![self.amoutField.text isEqualToString:@"0.01"])) { | ||
| 600 | + [QMUITips showError:@"数字输入错误" inView:[CNLiveCommuntTools cCommunt_currentViewController].view hideAfterDelay:2]; | ||
| 601 | + return; | ||
| 602 | + } | ||
| 603 | + if (![self isPurerFloat:self.amoutField.text]) { | ||
| 604 | + [QMUITips showError:@"数字输入错误" inView:[CNLiveCommuntTools cCommunt_currentViewController].view hideAfterDelay:2]; | ||
| 605 | + return; | ||
| 606 | + } | ||
| 607 | + | ||
| 608 | + if ([self.amoutField.text floatValue] >= 999999.99) { | ||
| 609 | + if (![self.amoutField.text isEqualToString:@"1000000.0"] | ||
| 610 | + && ![self.amoutField.text isEqualToString:@"1000000"] | ||
| 611 | + && ![self.amoutField.text isEqualToString:@"1000000.00"]) { | ||
| 612 | + [QMUITips showWithText:@"最高限额1000000元" inView:[CNLiveCommuntTools cCommunt_currentViewController].view hideAfterDelay:2]; | ||
| 613 | + return; | ||
| 614 | + } | ||
| 615 | + } | ||
| 616 | + if (![CNLiveNetworking isNetworking]) { | ||
| 617 | + [QMUITips showError:@"似乎与互联网断开连接" inView:[CNLiveCommuntTools cCommunt_currentViewController].view hideAfterDelay:2]; | ||
| 618 | + return; | ||
| 619 | + } | ||
| 620 | + __weak typeof(self) weakSelf = self; | ||
| 621 | + if ([self.createModel.totalFee isNotBlank] | ||
| 622 | + && [self.createModel.totalFee integerValue] > 0) { | ||
| 623 | + [CNLiveCommuntViewModel requestWithCommuntyTotalFeeOrderMentOrderId:self.createModel.idStr totalFee:self.amoutField.text CompleterBlock:^(NSString * _Nonnull payUrl) { | ||
| 624 | + NSString * p = [NSString stringWithFormat:@"%.2f",[self.amoutField.text floatValue]]; | ||
| 625 | + [CNLiveCommuntSignUpView showQrTipSuccessViewWithPrice:p PayUrl:payUrl]; | ||
| 626 | + }]; | ||
| 627 | + }else{ | ||
| 628 | + [CNLiveCommuntSignUpView showAlertViewWithMessage:@"请仔细核对金额,确认后将不可修改" CompleterBlock:^{ | ||
| 629 | + NSString * p = [NSString stringWithFormat:@"%.2f",([weakSelf.createModel.totalFee floatValue]/100)]; | ||
| 630 | + weakSelf.amoutField.text = p; | ||
| 631 | + weakSelf.amoutField.enabled = NO; | ||
| 632 | + weakSelf.amoutField.textColor = UIColorHex(#c8c8c8); | ||
| 633 | + [CNLiveCommuntViewModel requestWithCommuntyTotalFeeOrderMentOrderId:weakSelf.createModel.idStr totalFee:weakSelf.amoutField.text CompleterBlock:^(NSString * _Nonnull payUrl) { | ||
| 634 | + NSString * p = [NSString stringWithFormat:@"%.2f",[self.amoutField.text floatValue]]; | ||
| 635 | + [CNLiveCommuntSignUpView showQrTipSuccessViewWithPrice:p PayUrl:payUrl]; | ||
| 636 | + }]; | ||
| 637 | + }]; | ||
| 638 | + } | ||
| 639 | +} | ||
| 640 | +-(void)payCreateAction | ||
| 641 | +{ | ||
| 642 | + if ([self.amoutField.text floatValue] == 0 || ([self.amoutField.text floatValue] < 0.01 && ![self.amoutField.text isEqualToString:@"0.01"])) { | ||
| 643 | + [QMUITips showError:@"数字输入错误" inView:[CNLiveCommuntTools cCommunt_currentViewController].view hideAfterDelay:2]; | ||
| 644 | + return; | ||
| 645 | + } | ||
| 646 | + if (![self isPurerFloat:self.amoutField.text]) { | ||
| 647 | + [QMUITips showError:@"数字输入错误" inView:[CNLiveCommuntTools cCommunt_currentViewController].view hideAfterDelay:2]; | ||
| 648 | + return; | ||
| 649 | + } | ||
| 650 | + | ||
| 651 | + if ([self.amoutField.text floatValue] >= 999999.99) { | ||
| 652 | + if (![self.amoutField.text isEqualToString:@"1000000.0"] | ||
| 653 | + && ![self.amoutField.text isEqualToString:@"1000000"] | ||
| 654 | + && ![self.amoutField.text isEqualToString:@"1000000.00"]) { | ||
| 655 | + [QMUITips showWithText:@"最高限额1000000元" inView:[CNLiveCommuntTools cCommunt_currentViewController].view hideAfterDelay:2]; | ||
| 656 | + return; | ||
| 657 | + } | ||
| 658 | + } | ||
| 659 | + if (![CNLiveNetworking isNetworking]) { | ||
| 660 | + [QMUITips showError:@"似乎与互联网断开连接" inView:[CNLiveCommuntTools cCommunt_currentViewController].view hideAfterDelay:2]; | ||
| 661 | + return; | ||
| 662 | + } | ||
| 663 | + [CNLiveCommuntViewModel requestWithCommuntyMaintenPayMentOrderId:self.createModel.idStr CompleterBlock:self.reloadBlock]; | ||
| 664 | +} | ||
| 665 | +#pragma mark = | ||
| 666 | +- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string | ||
| 667 | +{ | ||
| 668 | + if (![self checkDecimal:[textField.text stringByAppendingString:string]]) { | ||
| 669 | + if (textField.text.length > 0 | ||
| 670 | + && ([string isEqualToString:@"."]) | ||
| 671 | + && ![textField.text containsString:@"."]) { | ||
| 672 | + return YES; | ||
| 673 | + } | ||
| 674 | + return [string isEqualToString:@""] ? YES : NO; | ||
| 675 | + } | ||
| 676 | + return YES; | ||
| 677 | +} | ||
| 678 | +- (BOOL)textFieldShouldEndEditing:(UITextField *)textField | ||
| 679 | +{ | ||
| 680 | + if ([textField.text isNotBlank] && textField.text.length > 10) { | ||
| 681 | + [QMUITips showWithText:@"最长10位!超出部分会在输入完成时自动删除" inView:[CNLiveCommuntTools cCommunt_currentViewController].view hideAfterDelay:2]; | ||
| 682 | + //如果是表情的话 这里容易截断显示 | ||
| 683 | + textField.text = [textField.text substringToIndex:10]; | ||
| 684 | + } | ||
| 685 | + return YES; | ||
| 686 | +} | ||
| 687 | +/// 判断是否是两位小数 | ||
| 688 | +- (BOOL)checkDecimal:(NSString *)str | ||
| 689 | +{ | ||
| 690 | + NSString *regex = @"^[0-9]+(\\.[0-9]{1,2})?$"; | ||
| 691 | + NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex]; | ||
| 692 | + return [pred evaluateWithObject:str]; | ||
| 693 | +} | ||
| 694 | +- (BOOL)isPureFloat:(NSString *)string{ | ||
| 695 | + NSScanner* scan = [NSScanner scannerWithString:string]; | ||
| 696 | + float val; | ||
| 697 | + return [scan scanFloat:&val] && [scan isAtEnd]; | ||
| 698 | +} | ||
| 699 | +- (BOOL)isPurerFloat:(NSString*)string{ | ||
| 700 | + | ||
| 701 | + if ([self isPureFloat:string]) { | ||
| 702 | + float f = [string floatValue]; | ||
| 703 | + if (f >= 0) { | ||
| 704 | + return YES; | ||
| 705 | + }else{ | ||
| 706 | + return NO; | ||
| 707 | + } | ||
| 708 | + } | ||
| 709 | + return NO; | ||
| 710 | +} | ||
| 711 | +#pragma mark = | ||
| 712 | +-(UIView *)mainView | ||
| 713 | +{ | ||
| 714 | + if (!_mainView) { | ||
| 715 | + _mainView = [[UIView alloc] init]; | ||
| 716 | + _mainView.backgroundColor = [UIColor whiteColor]; | ||
| 717 | + _mainView.layer.masksToBounds = YES; | ||
| 718 | + _mainView.layer.cornerRadius = 8; | ||
| 719 | + } | ||
| 720 | + return _mainView; | ||
| 721 | +} | ||
| 722 | +-(UITextField *)amoutField | ||
| 723 | +{ | ||
| 724 | + if (!_amoutField) { | ||
| 725 | + _amoutField = [[UITextField alloc] init]; | ||
| 726 | + _amoutField.backgroundColor = UIColorHex(#F9F9F9); | ||
| 727 | + _amoutField.font = [UIFont systemFontOfSize:14.0f]; | ||
| 728 | + _amoutField.textColor = UIColorHex(#333333); | ||
| 729 | + _amoutField.clearButtonMode = UITextFieldViewModeWhileEditing; | ||
| 730 | + _amoutField.clearsOnBeginEditing = YES; | ||
| 731 | + _amoutField.keyboardType = UIKeyboardTypeDefault; | ||
| 732 | + _amoutField.textAlignment = NSTextAlignmentLeft; | ||
| 733 | + _amoutField.keyboardType = UIKeyboardTypeDecimalPad; | ||
| 734 | + _amoutField.minimumFontSize = 8; | ||
| 735 | + _amoutField.placeholder = @"请输入金额"; | ||
| 736 | + _amoutField.returnKeyType = UIReturnKeyDone; | ||
| 737 | + _amoutField.layer.masksToBounds = YES; | ||
| 738 | + _amoutField.layer.cornerRadius = 5; | ||
| 739 | + _amoutField.delegate = self; | ||
| 740 | + } | ||
| 741 | + return _amoutField; | ||
| 742 | +} | ||
| 743 | +-(UIButton *)qrButton | ||
| 744 | +{ | ||
| 745 | + if (!_qrButton) { | ||
| 746 | + _qrButton = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 747 | + [_qrButton setTitle:@"生成二维码" forState:UIControlStateNormal]; | ||
| 748 | + [_qrButton setTitleColor:UIColorHex(#FD862E) forState:UIControlStateNormal]; | ||
| 749 | + _qrButton.titleLabel.font = [UIFont systemFontOfSize:13]; | ||
| 750 | + _qrButton.titleLabel.font = [UIFont boldSystemFontOfSize:13]; | ||
| 751 | + _qrButton.layer.cornerRadius = 5; | ||
| 752 | + _qrButton.layer.masksToBounds = YES; | ||
| 753 | +// _qrButton.enabled = NO; | ||
| 754 | + [_qrButton setBackgroundImage:[UIImage imageWithColor:UIColorHex(#FD862E1A)] forState:UIControlStateNormal]; | ||
| 755 | + [_qrButton addTarget:self action:@selector(qrCreateAction) forControlEvents:UIControlEventTouchUpInside]; | ||
| 756 | + } | ||
| 757 | + return _qrButton; | ||
| 758 | +} | ||
| 759 | +-(UIButton *)payButton | ||
| 760 | +{ | ||
| 761 | + if (!_payButton) { | ||
| 762 | + _payButton = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 763 | + [_payButton setTitle:@"已线下支付" forState:UIControlStateNormal]; | ||
| 764 | + [_payButton setTitleColor:UIColorHex(#0091FF) forState:UIControlStateNormal]; | ||
| 765 | + _payButton.titleLabel.font = [UIFont systemFontOfSize:13]; | ||
| 766 | + _payButton.titleLabel.font = [UIFont boldSystemFontOfSize:13]; | ||
| 767 | + _payButton.layer.cornerRadius = 5; | ||
| 768 | + _payButton.layer.masksToBounds = YES; | ||
| 769 | +// _payButton.enabled = NO; | ||
| 770 | + [_payButton setBackgroundImage:[UIImage imageWithColor:UIColorHex(#0091FF1A)] forState:UIControlStateNormal]; | ||
| 771 | + [_payButton addTarget:self action:@selector(payCreateAction) forControlEvents:UIControlEventTouchUpInside]; | ||
| 772 | + } | ||
| 773 | + return _payButton; | ||
| 774 | +} | ||
| 775 | +@end | ||
| 776 | + | ||
| 777 | +@implementation CNLiveCommuntSignUpContactViewCell | ||
| 778 | + | ||
| 779 | ++(CNLiveCommuntSignUpContactViewCell *)setTableView:(UITableView *)tableView CreateModel:(CNLiveCommuntyActivityMaintainsCreateModel *)createModel | ||
| 780 | +{ | ||
| 781 | + CNLiveCommuntSignUpContactViewCell * textCell = [tableView dequeueReusableCellWithIdentifier:@"CNLiveCommuntSignUpContactViewCell"]; | ||
| 782 | + if (!textCell) { | ||
| 783 | + textCell = [[CNLiveCommuntSignUpContactViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CNLiveCommuntSignUpContactViewCell"]; | ||
| 784 | + } | ||
| 785 | + textCell.createModel = createModel; | ||
| 786 | + return textCell; | ||
| 787 | +} | ||
| 788 | +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | ||
| 789 | +{ | ||
| 790 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | ||
| 791 | + if (self) { | ||
| 792 | + self.contentView.backgroundColor = [UIColor clearColor]; | ||
| 793 | + self.selectionStyle = UITableViewCellSelectionStyleNone; | ||
| 794 | + self.backgroundColor = [UIColor clearColor]; | ||
| 795 | + [self.contentView addSubview:self.mainView]; | ||
| 796 | + [self.mainView addSubview:self.nameLabel]; | ||
| 797 | + [self.mainView addSubview:self.phoneButton]; | ||
| 798 | + } | ||
| 799 | + return self; | ||
| 800 | +} | ||
| 801 | +-(void)setCreateModel:(CNLiveCommuntyActivityMaintainsCreateModel *)createModel | ||
| 802 | +{ | ||
| 803 | + _createModel = createModel; | ||
| 804 | + _nameLabel.text = [createModel.name isNotBlank]?[NSString stringWithFormat:@"维修人:%@",createModel.name]:@""; | ||
| 805 | + if ([createModel.mobile isNotBlank]) { | ||
| 806 | + [_phoneButton setTitle:createModel.mobile forState:UIControlStateNormal]; | ||
| 807 | + [_phoneButton setTitle:createModel.mobile forState:UIControlStateHighlighted]; | ||
| 808 | + [_phoneButton setImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_communty_order_phone"] forState:UIControlStateNormal]; | ||
| 809 | + [_phoneButton setImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_communty_order_phone"] forState:UIControlStateHighlighted]; | ||
| 810 | + } | ||
| 811 | + | ||
| 812 | +} | ||
| 813 | +-(void)layoutSubviews | ||
| 814 | +{ | ||
| 815 | + [super layoutSubviews]; | ||
| 816 | + __weak typeof(self) weakSelf = self; | ||
| 817 | + [self.mainView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 818 | + make.left.mas_equalTo(weakSelf.contentView.mas_left).offset(10); | ||
| 819 | + make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-10); | ||
| 820 | + make.bottom.mas_equalTo(weakSelf.contentView); | ||
| 821 | +// make.bottom.mas_equalTo(weakSelf.contentView).offset(-10); | ||
| 822 | + make.top.mas_equalTo(weakSelf.contentView).offset(10); | ||
| 823 | + }]; | ||
| 824 | + [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 825 | + make.centerY.mas_equalTo(weakSelf.mainView); | ||
| 826 | + make.left.mas_equalTo(weakSelf.mainView.mas_left).offset(10); | ||
| 827 | + }]; | ||
| 828 | + [self.phoneButton mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 829 | + make.centerY.mas_equalTo(weakSelf.mainView); | ||
| 830 | + make.right.mas_equalTo(weakSelf.mainView.mas_right).offset(-10); | ||
| 831 | + }]; | ||
| 832 | +} | ||
| 833 | +-(UIView *)mainView | ||
| 834 | +{ | ||
| 835 | + if (!_mainView) { | ||
| 836 | + _mainView = [[UIView alloc] init]; | ||
| 837 | + _mainView.backgroundColor = [UIColor whiteColor]; | ||
| 838 | + _mainView.layer.masksToBounds = YES; | ||
| 839 | + _mainView.layer.cornerRadius = 8; | ||
| 840 | + } | ||
| 841 | + return _mainView; | ||
| 842 | +} | ||
| 843 | +-(UILabel *)nameLabel | ||
| 844 | +{ | ||
| 845 | + if (!_nameLabel) { | ||
| 846 | + _nameLabel = [[UILabel alloc] init]; | ||
| 847 | + _nameLabel.textColor = UIColorHex(#333333); | ||
| 848 | + _nameLabel.numberOfLines = 1; | ||
| 849 | + _nameLabel.backgroundColor = [UIColor whiteColor]; | ||
| 850 | + _nameLabel.textAlignment = NSTextAlignmentLeft; | ||
| 851 | + _nameLabel.font = [UIFont systemFontOfSize:14]; | ||
| 852 | + _nameLabel.font = [UIFont boldSystemFontOfSize:14]; | ||
| 853 | + } | ||
| 854 | + return _nameLabel; | ||
| 855 | +} | ||
| 856 | +-(QMUIButton *)phoneButton | ||
| 857 | +{ | ||
| 858 | + if (!_phoneButton) { | ||
| 859 | + _phoneButton = [[QMUIButton alloc] init]; | ||
| 860 | + [_phoneButton setTitleColor:UIColorHex(#0091FF) forState:UIControlStateNormal]; | ||
| 861 | + _phoneButton.titleLabel.font = [UIFont systemFontOfSize:12]; | ||
| 862 | + _phoneButton.titleLabel.font = [UIFont boldSystemFontOfSize:12]; | ||
| 863 | + _phoneButton.imagePosition = QMUIButtonImagePositionLeft; | ||
| 864 | + _phoneButton.spacingBetweenImageAndTitle = 3; | ||
| 865 | + } | ||
| 866 | + return _phoneButton; | ||
| 867 | +} | ||
| 868 | +@end | ||
| 869 | + | ||
| 870 | +@implementation CNLiveCommuntSignUpDetailViewCell | ||
| 871 | + | ||
| 872 | ++(CNLiveCommuntSignUpDetailViewCell *)setTableView:(UITableView *)tableView isTop:(BOOL)isTop isBottom:(BOOL)isbottom Dict:(NSDictionary *)dict | ||
| 873 | +{ | ||
| 874 | + CNLiveCommuntSignUpDetailViewCell * textCell = [tableView dequeueReusableCellWithIdentifier:@"CNLiveCommuntSignUpDetailViewCell"]; | ||
| 875 | + if (!textCell) { | ||
| 876 | + textCell = [[CNLiveCommuntSignUpDetailViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CNLiveCommuntSignUpDetailViewCell"]; | ||
| 877 | + } | ||
| 878 | + textCell.dict = dict; | ||
| 879 | + textCell.isTop = isTop; | ||
| 880 | + textCell.isBottom = isbottom; | ||
| 881 | + | ||
| 882 | + return textCell; | ||
| 883 | +} | ||
| 884 | +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | ||
| 885 | +{ | ||
| 886 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | ||
| 887 | + if (self) { | ||
| 888 | + self.contentView.backgroundColor = [UIColor clearColor]; | ||
| 889 | + self.selectionStyle = UITableViewCellSelectionStyleNone; | ||
| 890 | + self.backgroundColor = [UIColor clearColor]; | ||
| 891 | + [self.contentView addSubview:self.mainView]; | ||
| 892 | + [self.mainView addSubview:self.nameLabel]; | ||
| 893 | + [self.mainView addSubview:self.timeLabel]; | ||
| 894 | + | ||
| 895 | + [self.mainView addSubview:self.lineLabel]; | ||
| 896 | + [self.mainView addSubview:self.topLabel]; | ||
| 897 | + [self.mainView addSubview:self.bottemLabel]; | ||
| 898 | + | ||
| 899 | + [self.mainView addSubview:self.statusView]; | ||
| 900 | + } | ||
| 901 | + return self; | ||
| 902 | +} | ||
| 903 | +-(void)setDict:(NSDictionary *)dict | ||
| 904 | +{ | ||
| 905 | + _dict = dict; | ||
| 906 | + _nameLabel.text = [dict stringValueForKey:@"key" default:@""]; | ||
| 907 | + _timeLabel.text = [dict stringValueForKey:@"value" default:@""]; | ||
| 908 | +} | ||
| 909 | +-(void)layoutSubviews | ||
| 910 | +{ | ||
| 911 | + [super layoutSubviews]; | ||
| 912 | + __weak typeof(self) weakSelf = self; | ||
| 913 | + [self.mainView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 914 | + make.left.mas_equalTo(weakSelf.contentView.mas_left).offset(10); | ||
| 915 | + make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-10); | ||
| 916 | + make.top.bottom.mas_equalTo(weakSelf.contentView); | ||
| 917 | + }]; | ||
| 918 | + [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 919 | + make.top.mas_equalTo(weakSelf.mainView.mas_top).offset(10); | ||
| 920 | + make.left.mas_equalTo(weakSelf.mainView.mas_left).offset(30); | ||
| 921 | + }]; | ||
| 922 | + [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 923 | + make.top.mas_equalTo(weakSelf.nameLabel.mas_bottom).offset(10); | ||
| 924 | + make.left.mas_equalTo(weakSelf.mainView.mas_left).offset(30); | ||
| 925 | + }]; | ||
| 926 | + | ||
| 927 | + [self.topLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 928 | + make.top.mas_equalTo(weakSelf.mainView.mas_top); | ||
| 929 | + make.bottom.mas_equalTo(weakSelf.statusView.mas_top).offset(2); | ||
| 930 | + make.left.mas_equalTo(weakSelf.mainView.mas_left).offset(16); | ||
| 931 | + make.width.mas_equalTo(1); | ||
| 932 | + }]; | ||
| 933 | + [self.bottemLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 934 | + make.top.mas_equalTo(weakSelf.statusView.mas_bottom); | ||
| 935 | + make.bottom.mas_equalTo(weakSelf.mainView.mas_bottom); | ||
| 936 | + make.left.mas_equalTo(weakSelf.mainView.mas_left).offset(16); | ||
| 937 | + make.width.mas_equalTo(1); | ||
| 938 | + }]; | ||
| 939 | + | ||
| 940 | + [self.statusView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 941 | + make.centerY.mas_equalTo(weakSelf.nameLabel); | ||
| 942 | + make.centerX.mas_equalTo(weakSelf.topLabel); | ||
| 943 | + }]; | ||
| 944 | + | ||
| 945 | + [self.lineLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 946 | + make.bottom.mas_equalTo(weakSelf.mainView.mas_bottom).offset(-0.5); | ||
| 947 | + make.left.mas_equalTo(weakSelf.mainView.mas_left).offset(30); | ||
| 948 | + make.right.mas_equalTo(weakSelf.mainView.mas_right).offset(-10); | ||
| 949 | + make.height.mas_equalTo(0.5); | ||
| 950 | + }]; | ||
| 951 | + | ||
| 952 | + self.topLabel.hidden = self.isTop; | ||
| 953 | + self.bottemLabel.hidden = self.isBottom; | ||
| 954 | + self.lineLabel.hidden = self.isBottom; | ||
| 955 | + | ||
| 956 | + if (self.isTop) { | ||
| 957 | + self.statusView.image = [CNLiveCommuntTools cCommunt_setImageWithName:@"c_communty_order_status"]; | ||
| 958 | + self.nameLabel.textColor = UIColorHex(#CD0302); | ||
| 959 | + }else{ | ||
| 960 | + self.statusView.image = [UIImage imageWithColor:UIColorHex(#D2D2D2) size:CGSizeMake(10, 10)]; | ||
| 961 | + self.nameLabel.textColor = UIColorHex(#999999); | ||
| 962 | + } | ||
| 963 | +} | ||
| 964 | + | ||
| 965 | +-(UIView *)mainView | ||
| 966 | +{ | ||
| 967 | + if (!_mainView) { | ||
| 968 | + _mainView = [[UIView alloc] init]; | ||
| 969 | + _mainView.backgroundColor = [UIColor whiteColor]; | ||
| 970 | + } | ||
| 971 | + return _mainView; | ||
| 972 | +} | ||
| 973 | +-(UILabel *)nameLabel | ||
| 974 | +{ | ||
| 975 | + if (!_nameLabel) { | ||
| 976 | + _nameLabel = [[UILabel alloc] init]; | ||
| 977 | + _nameLabel.textColor = UIColorHex(#CD0302); | ||
| 978 | + _nameLabel.numberOfLines = 1; | ||
| 979 | + _nameLabel.backgroundColor = [UIColor whiteColor]; | ||
| 980 | + _nameLabel.textAlignment = NSTextAlignmentLeft; | ||
| 981 | + _nameLabel.font = [UIFont systemFontOfSize:15]; | ||
| 982 | + _nameLabel.font = [UIFont boldSystemFontOfSize:15]; | ||
| 983 | + } | ||
| 984 | + return _nameLabel; | ||
| 985 | +} | ||
| 986 | +-(UILabel *)timeLabel | ||
| 987 | +{ | ||
| 988 | + if (!_timeLabel) { | ||
| 989 | + _timeLabel = [[UILabel alloc] init]; | ||
| 990 | + _timeLabel.textColor = UIColorHex(#B4B4B4); | ||
| 991 | + _timeLabel.numberOfLines = 1; | ||
| 992 | + _timeLabel.backgroundColor = [UIColor whiteColor]; | ||
| 993 | + _timeLabel.textAlignment = NSTextAlignmentLeft; | ||
| 994 | + _timeLabel.font = [UIFont systemFontOfSize:12]; | ||
| 995 | + } | ||
| 996 | + return _timeLabel; | ||
| 997 | +} | ||
| 998 | +-(UIImageView *)statusView | ||
| 999 | +{ | ||
| 1000 | + if (!_statusView) { | ||
| 1001 | + _statusView = [[UIImageView alloc] init]; | ||
| 1002 | + _statusView.contentMode = UIViewContentModeScaleAspectFill; | ||
| 1003 | + _statusView.image = [CNLiveCommuntTools cCommunt_setImageWithName:@"c_communty_order_status"]; | ||
| 1004 | + _statusView.backgroundColor = [UIColor clearColor]; | ||
| 1005 | + _statusView.layer.masksToBounds = YES; | ||
| 1006 | + _statusView.layer.cornerRadius = 5; | ||
| 1007 | + } | ||
| 1008 | + return _statusView; | ||
| 1009 | +} | ||
| 1010 | +-(UILabel *)lineLabel | ||
| 1011 | +{ | ||
| 1012 | + if (!_lineLabel) { | ||
| 1013 | + _lineLabel = [[UILabel alloc] init]; | ||
| 1014 | + _lineLabel.backgroundColor = UIColorHex(#E4E4E4); | ||
| 1015 | + } | ||
| 1016 | + return _lineLabel; | ||
| 1017 | +} | ||
| 1018 | +-(UILabel *)topLabel | ||
| 1019 | +{ | ||
| 1020 | + if (!_topLabel) { | ||
| 1021 | + _topLabel = [[UILabel alloc] init]; | ||
| 1022 | + _topLabel.backgroundColor = UIColorHex(#E4E4E4); | ||
| 1023 | + } | ||
| 1024 | + return _topLabel; | ||
| 1025 | +} | ||
| 1026 | +-(UILabel *)bottemLabel | ||
| 1027 | +{ | ||
| 1028 | + if (!_bottemLabel) { | ||
| 1029 | + _bottemLabel = [[UILabel alloc] init]; | ||
| 1030 | + _bottemLabel.backgroundColor = UIColorHex(#E4E4E4); | ||
| 1031 | + } | ||
| 1032 | + return _bottemLabel; | ||
| 1033 | +} | ||
| 1034 | +@end |
CNLiveCommunitModule/Classes/View/CNLiveCommuntSubView.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/View/CNLiveCommuntSubView.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntSubView.h | ||
| 3 | +// CNLiveCommunitModule-CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/2. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <UIKit/UIKit.h> | ||
| 9 | + | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +@interface CNLiveCommuntSubView : UIView | ||
| 13 | + | ||
| 14 | +@end | ||
| 15 | + | ||
| 16 | +@interface CNLiveCommuntCheckView : UIView | ||
| 17 | + | ||
| 18 | +@property (nonatomic, strong) UIButton * selectBtn; | ||
| 19 | +@property (nonatomic, strong) UIView * selectView; | ||
| 20 | +@property (nonatomic, strong) UIView * selectCenterView; | ||
| 21 | +@property (nonatomic, strong) UILabel * evaluaDescLabel; | ||
| 22 | + | ||
| 23 | +@end | ||
| 24 | + | ||
| 25 | +@interface CNLiveCommuntSubHomeTableView : UITableViewCell | ||
| 26 | + | ||
| 27 | +@property (nonatomic, strong) UIImageView * imgView; | ||
| 28 | +@property (nonatomic, strong) UILabel * statusLabel; | ||
| 29 | + | ||
| 30 | +@property (nonatomic, strong) CNLiveCommuntyActivityHomeListModel * listModel; | ||
| 31 | + | ||
| 32 | ++(CNLiveCommuntSubHomeTableView *)setTableView:(UITableView *)tableView ListModel:(CNLiveCommuntyActivityHomeListModel *)listModel; | ||
| 33 | +@end | ||
| 34 | + | ||
| 35 | +@interface CNLiveCommuntSubRecordTableView : UITableViewCell | ||
| 36 | + | ||
| 37 | +@property (nonatomic, strong) UIView * mainView; | ||
| 38 | +@property (nonatomic, strong) UIImageView * imgView; | ||
| 39 | +@property (nonatomic, strong) UILabel * nameLabel; | ||
| 40 | +@property (nonatomic, strong) UILabel * descLabel; | ||
| 41 | +@property (nonatomic, strong) UILabel * priceLabel; | ||
| 42 | +@property (nonatomic, strong) UILabel * dateLabel; | ||
| 43 | +@property (nonatomic, strong) UIButton * evalButton; | ||
| 44 | + | ||
| 45 | +@property (nonatomic, strong) CNLiveCommuntyActivityRecordListModel * recoredModel; | ||
| 46 | + | ||
| 47 | ++(CNLiveCommuntSubRecordTableView *)setTableView:(UITableView *)tableView RecordModel:(CNLiveCommuntyActivityRecordListModel *)recordModel; | ||
| 48 | + | ||
| 49 | +@end | ||
| 50 | + | ||
| 51 | +@interface CNLiveCommuntSubRepairTableView : UITableViewCell | ||
| 52 | + | ||
| 53 | +@property (nonatomic, strong) UIView * mainView; | ||
| 54 | +@property (nonatomic, strong) UILabel * nameLabel; | ||
| 55 | +@property (nonatomic, strong) UILabel * dateLabel; | ||
| 56 | +@property (nonatomic, strong) QMUIButton * statueButton; | ||
| 57 | +@property (nonatomic, strong) UILabel * lineLabel; | ||
| 58 | +@property (nonatomic, strong) UILabel * priceLabel; | ||
| 59 | + | ||
| 60 | +@property (nonatomic, strong) CNLiveCommuntyActivityRepairListModel * repairModel; | ||
| 61 | + | ||
| 62 | ++(CNLiveCommuntSubRepairTableView *)setTableView:(UITableView *)tableView RepairModel:(CNLiveCommuntyActivityRepairListModel *)repairModel; | ||
| 63 | + | ||
| 64 | +@end | ||
| 65 | + | ||
| 66 | +@protocol CNLiveCommuntSubInputTableViewDelegate <NSObject> | ||
| 67 | + | ||
| 68 | +/// 点击选择图片视频 | ||
| 69 | +/// @param index 点击的位置 | ||
| 70 | +-(void)setCommuntSubInputTableViewWithSelectForIndex:(NSInteger)index; | ||
| 71 | + | ||
| 72 | +/// 点击删除图片视频 | ||
| 73 | +/// @param image 点击的位置 | ||
| 74 | +-(void)setCommuntSubInputTableViewWithDelectForImage:(UIImage *)image; | ||
| 75 | + | ||
| 76 | +@end | ||
| 77 | + | ||
| 78 | +@interface CNLiveCommuntSubInputTableView : UITableViewCell<QMUITextViewDelegate,UITextFieldDelegate> | ||
| 79 | + | ||
| 80 | +@property (nonatomic, weak) id<CNLiveCommuntSubInputTableViewDelegate> delegate; | ||
| 81 | +@property (nonatomic, strong) UILabel * nameLabel; | ||
| 82 | +@property (nonatomic, strong) UITextField * contentField; | ||
| 83 | +@property (nonatomic, strong) UILabel * lineLabel; | ||
| 84 | +@property (nonatomic, strong) QMUIButton * moreButton; | ||
| 85 | +@property (nonatomic, strong) QMUITextView * descTextView; | ||
| 86 | + | ||
| 87 | +@property (nonatomic, strong) UIView * contentImageView; | ||
| 88 | +@property (nonatomic, strong) UIImageView * imageView01; | ||
| 89 | +@property (nonatomic, strong) UIImageView * imageView02; | ||
| 90 | +@property (nonatomic, strong) UIImageView * imageView03; | ||
| 91 | + | ||
| 92 | +@property (nonatomic, strong) UIButton * delectBtn01; | ||
| 93 | +@property (nonatomic, strong) UIButton * delectBtn02; | ||
| 94 | +@property (nonatomic, strong) UIButton * delectBtn03; | ||
| 95 | + | ||
| 96 | +@property (nonatomic, strong) CNLiveCommuntCheckView * checkView_m; | ||
| 97 | +@property (nonatomic, strong) CNLiveCommuntCheckView * checkView_w; | ||
| 98 | + | ||
| 99 | +@property (nonatomic, strong) NSDictionary * userInfo; | ||
| 100 | + | ||
| 101 | +@property (nonatomic, strong) NSMutableArray * imageArray; | ||
| 102 | +@property (nonatomic, strong) NSDictionary * subDict; | ||
| 103 | +@property (nonatomic, assign) NSInteger index; | ||
| 104 | +@property (nonatomic, copy) NSString * sex;//男 女 | ||
| 105 | + | ||
| 106 | ++(CNLiveCommuntSubInputTableView *)setTableView:(UITableView *)tableView SubDict:(NSDictionary *)subDict indexs:(NSInteger)indexs UserInfo:(NSDictionary *)userInfo; | ||
| 107 | + | ||
| 108 | +@end | ||
| 109 | + | ||
| 110 | +@interface CNLiveCommuntSubAlertTableView : UIView<UIPickerViewDelegate,UIPickerViewDataSource> | ||
| 111 | + | ||
| 112 | +@property (nonatomic, strong) UIPickerView *pickerView; | ||
| 113 | +@property (nonatomic, strong) UIButton * closeBtn; | ||
| 114 | +@property (nonatomic, strong) UIButton * doneBtn; | ||
| 115 | +@property (nonatomic, strong) UILabel * lineLabel; | ||
| 116 | + | ||
| 117 | +@property (nonatomic, strong) NSArray *oneSource; | ||
| 118 | +@property (nonatomic, strong) NSArray *twoSource; | ||
| 119 | + | ||
| 120 | +@property (nonatomic, copy) NSString * dayString; | ||
| 121 | +@property (nonatomic, copy) NSString * timeString; | ||
| 122 | + | ||
| 123 | +@property (nonatomic, strong) CNLiveCommuntyActivityMaintainsListModel * listModel; | ||
| 124 | + | ||
| 125 | +@property (nonatomic, assign) BOOL isTime; | ||
| 126 | + | ||
| 127 | +/// 初始化选择器的界面 | ||
| 128 | +/// @param dataSource 数据源 | ||
| 129 | +- (instancetype)initWithDataSource:(NSArray *)dataSource isTime:(BOOL)isTime; | ||
| 130 | + | ||
| 131 | +/// 弹出显示框 | ||
| 132 | +/// @param completerBlock 选择器 | ||
| 133 | ++(void)showAlertViewDataSource:(NSArray *)dataSource isTime:(BOOL)isTime CompleterBlock:(void(^)(NSString * idStr,NSString * content))completerBlock; | ||
| 134 | + | ||
| 135 | +@end | ||
| 136 | + | ||
| 137 | + | ||
| 138 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/View/CNLiveCommuntSubView.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/View/CNLiveCommuntSubView.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntSubView.m | ||
| 3 | +// CNLiveCommunitModule-CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/2. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntSubView.h" | ||
| 9 | + | ||
| 10 | +@implementation CNLiveCommuntSubView | ||
| 11 | + | ||
| 12 | + | ||
| 13 | +@end | ||
| 14 | + | ||
| 15 | +@implementation CNLiveCommuntCheckView | ||
| 16 | + | ||
| 17 | +- (instancetype)init | ||
| 18 | +{ | ||
| 19 | + self = [super init]; | ||
| 20 | + if (self) { | ||
| 21 | + [self addSubview:self.evaluaDescLabel]; | ||
| 22 | + [self addSubview:self.selectView]; | ||
| 23 | + [self addSubview:self.selectCenterView]; | ||
| 24 | + [self addSubview:self.selectBtn]; | ||
| 25 | + } | ||
| 26 | + return self; | ||
| 27 | +} | ||
| 28 | +-(void)layoutSubviews | ||
| 29 | +{ | ||
| 30 | + [super layoutSubviews]; | ||
| 31 | + __weak typeof(self) weakSelf = self; | ||
| 32 | + [self.selectView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 33 | + make.centerY.mas_equalTo(weakSelf); | ||
| 34 | + make.left.mas_equalTo(weakSelf); | ||
| 35 | + make.size.mas_equalTo(14); | ||
| 36 | + }]; | ||
| 37 | + [self.selectCenterView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 38 | + make.top.mas_equalTo(weakSelf.selectView).offset(2); | ||
| 39 | + make.left.mas_equalTo(weakSelf.selectView).offset(2); | ||
| 40 | + make.right.mas_equalTo(weakSelf.selectView).offset(-2); | ||
| 41 | + make.bottom.mas_equalTo(weakSelf.selectView).offset(-2); | ||
| 42 | + }]; | ||
| 43 | + [self.evaluaDescLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 44 | + make.centerY.mas_equalTo(weakSelf.selectView); | ||
| 45 | + make.left.mas_equalTo(weakSelf.selectView.mas_right).offset(5); | ||
| 46 | + }]; | ||
| 47 | + [self.selectBtn mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 48 | + make.edges.mas_equalTo(weakSelf); | ||
| 49 | + }]; | ||
| 50 | +} | ||
| 51 | +-(UILabel *)evaluaDescLabel | ||
| 52 | +{ | ||
| 53 | + if (!_evaluaDescLabel) { | ||
| 54 | + _evaluaDescLabel = [[UILabel alloc] init]; | ||
| 55 | + _evaluaDescLabel.backgroundColor = [UIColor whiteColor]; | ||
| 56 | + _evaluaDescLabel.font = [UIFont systemFontOfSize:11]; | ||
| 57 | + _evaluaDescLabel.numberOfLines = 1; | ||
| 58 | + _evaluaDescLabel.lineBreakMode = NSLineBreakByTruncatingTail; | ||
| 59 | + } | ||
| 60 | + return _evaluaDescLabel; | ||
| 61 | +} | ||
| 62 | +-(UIView *)selectView | ||
| 63 | +{ | ||
| 64 | + if (!_selectView) { | ||
| 65 | + _selectView = [[UIView alloc] init]; | ||
| 66 | + _selectView.backgroundColor = [UIColor whiteColor]; | ||
| 67 | + _selectView.layer.cornerRadius = 7; | ||
| 68 | + _selectView.layer.masksToBounds = YES; | ||
| 69 | + _selectView.layer.borderColor = UIColorHex(#979797).CGColor; | ||
| 70 | + _selectView.layer.borderWidth = 0.5; | ||
| 71 | + } | ||
| 72 | + return _selectView; | ||
| 73 | +} | ||
| 74 | +-(UIView *)selectCenterView | ||
| 75 | +{ | ||
| 76 | + if (!_selectCenterView) { | ||
| 77 | + _selectCenterView = [[UIView alloc] init]; | ||
| 78 | + _selectCenterView.backgroundColor = UIColorHex(#F5A623); | ||
| 79 | + _selectCenterView.layer.masksToBounds = YES; | ||
| 80 | + _selectCenterView.layer.cornerRadius = 5; | ||
| 81 | + _selectCenterView.hidden = YES; | ||
| 82 | + } | ||
| 83 | + return _selectCenterView; | ||
| 84 | +} | ||
| 85 | +-(UIButton *)selectBtn | ||
| 86 | +{ | ||
| 87 | + if (!_selectBtn) { | ||
| 88 | + _selectBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 89 | + _selectBtn.backgroundColor = [UIColor clearColor]; | ||
| 90 | + [_selectBtn addTarget:self action:@selector(selectMothodAction:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 91 | + } | ||
| 92 | + return _selectBtn; | ||
| 93 | +} | ||
| 94 | +-(void)selectMothodAction:(UIButton *)button | ||
| 95 | +{ | ||
| 96 | + NSLog(@"选择按钮"); | ||
| 97 | +} | ||
| 98 | +@end | ||
| 99 | + | ||
| 100 | +@implementation CNLiveCommuntSubHomeTableView | ||
| 101 | + | ||
| 102 | ++(CNLiveCommuntSubHomeTableView *)setTableView:(UITableView *)tableView ListModel:(nonnull CNLiveCommuntyActivityHomeListModel *)listModel | ||
| 103 | +{ | ||
| 104 | + CNLiveCommuntSubHomeTableView * homeView = [tableView dequeueReusableCellWithIdentifier:@"CNLiveCommuntSubHomeTableView"]; | ||
| 105 | + if (!homeView) { | ||
| 106 | + homeView = [[CNLiveCommuntSubHomeTableView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CNLiveCommuntSubHomeTableView"]; | ||
| 107 | + } | ||
| 108 | + homeView.listModel = listModel; | ||
| 109 | + return homeView; | ||
| 110 | +} | ||
| 111 | + | ||
| 112 | +-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | ||
| 113 | +{ | ||
| 114 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | ||
| 115 | + if (self) { | ||
| 116 | + self.selectionStyle = UITableViewCellSelectionStyleNone; | ||
| 117 | + self.contentView.backgroundColor = UIColorHex(#f9f9f9); | ||
| 118 | + [self.contentView addSubview:self.imgView]; | ||
| 119 | + [self.imgView addSubview:self.statusLabel]; | ||
| 120 | + } | ||
| 121 | + return self; | ||
| 122 | +} | ||
| 123 | +-(void)layoutSubviews | ||
| 124 | +{ | ||
| 125 | + [super layoutSubviews]; | ||
| 126 | + __weak typeof(self) weakSelf = self; | ||
| 127 | + [self.imgView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 128 | + make.top.left.mas_equalTo(weakSelf.contentView).offset(10); | ||
| 129 | + make.bottom.right.mas_equalTo(weakSelf.contentView).offset(-10); | ||
| 130 | + }]; | ||
| 131 | + [self.statusLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 132 | + make.left.top.mas_equalTo(weakSelf.imgView).offset(10); | ||
| 133 | + make.width.mas_equalTo(60); | ||
| 134 | + make.height.mas_equalTo(30); | ||
| 135 | + }]; | ||
| 136 | +} | ||
| 137 | +-(void)setListModel:(CNLiveCommuntyActivityHomeListModel *)listModel | ||
| 138 | +{ | ||
| 139 | + _listModel = listModel; | ||
| 140 | + | ||
| 141 | + [self.imgView sd_setImageWithURL:[NSURL URLWithString:listModel.imgUrl] placeholderImage:[UIImage imageWithColor:UIColorHex(#f6f6f6)]]; | ||
| 142 | + self.statusLabel.text = listModel.statusString; | ||
| 143 | + if ([listModel.status isEqualToString:@"1"] || [listModel.status isEqualToString:@"2"] || [listModel.status isEqualToString:@"3"]) { | ||
| 144 | + self.statusLabel.hidden = NO; | ||
| 145 | + if ([listModel.status isEqualToString:@"1"]) self.statusLabel.backgroundColor = UIColorHex(#6DD400); | ||
| 146 | + if ([listModel.status isEqualToString:@"2"]) self.statusLabel.backgroundColor = UIColorHex(#FD862E); | ||
| 147 | + if ([listModel.status isEqualToString:@"3"]) self.statusLabel.backgroundColor = UIColorHex(#858585); | ||
| 148 | + }else{ | ||
| 149 | + self.statusLabel.hidden = YES; | ||
| 150 | + } | ||
| 151 | +} | ||
| 152 | +#pragma mark - | ||
| 153 | +-(UIImageView *)imgView | ||
| 154 | +{ | ||
| 155 | + if (!_imgView) { | ||
| 156 | + _imgView = [[UIImageView alloc] init]; | ||
| 157 | + _imgView.contentMode = UIViewContentModeScaleAspectFill; | ||
| 158 | + _imgView.image = [UIImage imageWithColor:UIColorHex(#f9f9f9)]; | ||
| 159 | + _imgView.layer.masksToBounds = YES; | ||
| 160 | + _imgView.layer.cornerRadius = 10; | ||
| 161 | + } | ||
| 162 | + return _imgView; | ||
| 163 | +} | ||
| 164 | +-(UILabel *)statusLabel | ||
| 165 | +{ | ||
| 166 | + if (!_statusLabel) { | ||
| 167 | + _statusLabel = [[UILabel alloc] init]; | ||
| 168 | + _statusLabel.textColor = [UIColor whiteColor]; | ||
| 169 | + _statusLabel.textAlignment = NSTextAlignmentCenter; | ||
| 170 | + _statusLabel.layer.cornerRadius = 5; | ||
| 171 | + _statusLabel.layer.masksToBounds = YES; | ||
| 172 | + _statusLabel.font = [UIFont systemFontOfSize:14]; | ||
| 173 | + _statusLabel.font = [UIFont boldSystemFontOfSize:14]; | ||
| 174 | + | ||
| 175 | + } | ||
| 176 | + return _statusLabel; | ||
| 177 | +} | ||
| 178 | +@end | ||
| 179 | + | ||
| 180 | +@implementation CNLiveCommuntSubRecordTableView | ||
| 181 | + | ||
| 182 | ++(CNLiveCommuntSubRecordTableView *)setTableView:(UITableView *)tableView RecordModel:(nonnull CNLiveCommuntyActivityRecordListModel *)recordModel | ||
| 183 | +{ | ||
| 184 | + CNLiveCommuntSubRecordTableView * recordView = [tableView dequeueReusableCellWithIdentifier:@"CNLiveCommuntSubRecordTableView"]; | ||
| 185 | + if (!recordView) { | ||
| 186 | + recordView = [[CNLiveCommuntSubRecordTableView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CNLiveCommuntSubRecordTableView"]; | ||
| 187 | + } | ||
| 188 | + recordView.recoredModel = recordModel; | ||
| 189 | + return recordView; | ||
| 190 | +} | ||
| 191 | + | ||
| 192 | +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | ||
| 193 | +{ | ||
| 194 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | ||
| 195 | + if (self) { | ||
| 196 | + self.selectionStyle = UITableViewCellSelectionStyleNone; | ||
| 197 | + self.contentView.backgroundColor = UIColorHex(#f9f9f9); | ||
| 198 | + [self.contentView addSubview:self.mainView]; | ||
| 199 | + [self.mainView addSubview:self.imgView]; | ||
| 200 | + [self.mainView addSubview:self.nameLabel]; | ||
| 201 | + [self.mainView addSubview:self.descLabel]; | ||
| 202 | + [self.mainView addSubview:self.priceLabel]; | ||
| 203 | + [self.mainView addSubview:self.dateLabel]; | ||
| 204 | + [self.mainView addSubview:self.evalButton]; | ||
| 205 | + } | ||
| 206 | + return self; | ||
| 207 | +} | ||
| 208 | +-(void)setRecoredModel:(CNLiveCommuntyActivityRecordListModel *)recoredModel | ||
| 209 | +{ | ||
| 210 | + _recoredModel = recoredModel; | ||
| 211 | + [self.imgView sd_setImageWithURL:[NSURL URLWithString:recoredModel.imgUrl] placeholderImage:[UIImage imageWithColor:UIColorHex(#f9f9f9)]]; | ||
| 212 | + self.dateLabel.text = recoredModel.createTimeString; | ||
| 213 | + self.nameLabel.text = recoredModel.handworkName; | ||
| 214 | + self.descLabel.text = [NSString stringWithFormat:@"%@ %@",recoredModel.name,recoredModel.mobile]; | ||
| 215 | + self.priceLabel.text = [recoredModel.amount isNotBlank]?[NSString stringWithFormat:@"%@.00",recoredModel.amount]:@"0.00"; | ||
| 216 | +} | ||
| 217 | +-(void)layoutSubviews | ||
| 218 | +{ | ||
| 219 | + [super layoutSubviews]; | ||
| 220 | + __weak typeof(self) weakSelf = self; | ||
| 221 | + [self.mainView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 222 | + make.top.left.mas_equalTo(weakSelf.contentView).offset(10); | ||
| 223 | + make.right.mas_equalTo(weakSelf.contentView).offset(-10); | ||
| 224 | + make.bottom.mas_equalTo(weakSelf.contentView); | ||
| 225 | + }]; | ||
| 226 | + [self.imgView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 227 | + make.top.left.mas_equalTo(weakSelf.mainView).offset(10); | ||
| 228 | + make.size.mas_equalTo(80); | ||
| 229 | + }]; | ||
| 230 | + [self.dateLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 231 | + make.right.mas_equalTo(weakSelf.mainView.mas_right).offset(-10); | ||
| 232 | + make.top.mas_equalTo(weakSelf.mainView).offset(12); | ||
| 233 | + }]; | ||
| 234 | + [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 235 | + make.top.mas_equalTo(weakSelf.mainView).offset(10); | ||
| 236 | + make.left.mas_equalTo(weakSelf.imgView.mas_right).offset(10); | ||
| 237 | + make.right.mas_equalTo(weakSelf.dateLabel.mas_left); | ||
| 238 | + }]; | ||
| 239 | + [self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 240 | + make.top.mas_equalTo(weakSelf.nameLabel.mas_bottom).offset(10); | ||
| 241 | + make.left.mas_equalTo(weakSelf.imgView.mas_right).offset(10); | ||
| 242 | + make.right.mas_equalTo(weakSelf.mainView.mas_right).offset(-10); | ||
| 243 | + }]; | ||
| 244 | + [self.evalButton mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 245 | + make.bottom.right.mas_equalTo(weakSelf.mainView).offset(-10); | ||
| 246 | + make.height.mas_equalTo(20); | ||
| 247 | + make.width.mas_equalTo(50); | ||
| 248 | + }]; | ||
| 249 | + [self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 250 | + make.bottom.mas_equalTo(weakSelf.mainView.mas_bottom).offset(-10); | ||
| 251 | + make.left.mas_equalTo(weakSelf.imgView.mas_right).offset(10); | ||
| 252 | + make.right.mas_equalTo(weakSelf.evalButton.mas_right).offset(-10); | ||
| 253 | + }]; | ||
| 254 | +} | ||
| 255 | +#pragma mark - | ||
| 256 | +-(UIView *)mainView | ||
| 257 | +{ | ||
| 258 | + if (!_mainView) { | ||
| 259 | + _mainView = [[UIView alloc] init]; | ||
| 260 | + _mainView.backgroundColor = [UIColor whiteColor]; | ||
| 261 | + } | ||
| 262 | + return _mainView; | ||
| 263 | +} | ||
| 264 | +-(UIImageView *)imgView | ||
| 265 | +{ | ||
| 266 | + if (!_imgView) { | ||
| 267 | + _imgView = [[UIImageView alloc] init]; | ||
| 268 | + _imgView.contentMode = UIViewContentModeScaleAspectFill; | ||
| 269 | + _imgView.image = [UIImage imageWithColor:[UIColor cyanColor]]; | ||
| 270 | + _imgView.layer.cornerRadius = 8; | ||
| 271 | + _imgView.layer.masksToBounds = YES; | ||
| 272 | + } | ||
| 273 | + return _imgView; | ||
| 274 | +} | ||
| 275 | +-(UILabel *)nameLabel | ||
| 276 | +{ | ||
| 277 | + if (!_nameLabel) { | ||
| 278 | + _nameLabel = [[UILabel alloc] init]; | ||
| 279 | + _nameLabel.textColor = UIColorHex(#333333); | ||
| 280 | + _nameLabel.lineBreakMode = NSLineBreakByTruncatingTail; | ||
| 281 | + _nameLabel.numberOfLines = 1; | ||
| 282 | + _nameLabel.font = [UIFont systemFontOfSize:15]; | ||
| 283 | + _nameLabel.font = [UIFont boldSystemFontOfSize:15]; | ||
| 284 | + | ||
| 285 | + } | ||
| 286 | + return _nameLabel; | ||
| 287 | +} | ||
| 288 | +-(UILabel *)descLabel | ||
| 289 | +{ | ||
| 290 | + if (!_descLabel) { | ||
| 291 | + _descLabel = [[UILabel alloc] init]; | ||
| 292 | + _descLabel.textColor = UIColorHex(#8A8A8A); | ||
| 293 | + _descLabel.lineBreakMode = NSLineBreakByTruncatingTail; | ||
| 294 | + _descLabel.numberOfLines = 1; | ||
| 295 | + _descLabel.font = [UIFont systemFontOfSize:10]; | ||
| 296 | + _descLabel.font = [UIFont boldSystemFontOfSize:10]; | ||
| 297 | + | ||
| 298 | + } | ||
| 299 | + return _descLabel; | ||
| 300 | +} | ||
| 301 | +-(UILabel *)priceLabel | ||
| 302 | +{ | ||
| 303 | + if (!_priceLabel) { | ||
| 304 | + _priceLabel = [[UILabel alloc] init]; | ||
| 305 | + _priceLabel.textColor = UIColorHex(#DF0D23); | ||
| 306 | + _priceLabel.lineBreakMode = NSLineBreakByTruncatingTail; | ||
| 307 | + _priceLabel.numberOfLines = 1; | ||
| 308 | + _priceLabel.font = [UIFont systemFontOfSize:18]; | ||
| 309 | + _priceLabel.font = [UIFont boldSystemFontOfSize:18]; | ||
| 310 | + | ||
| 311 | + } | ||
| 312 | + return _priceLabel; | ||
| 313 | +} | ||
| 314 | +-(UILabel *)dateLabel | ||
| 315 | +{ | ||
| 316 | + if (!_dateLabel) { | ||
| 317 | + _dateLabel = [[UILabel alloc] init]; | ||
| 318 | + _dateLabel.textColor = UIColorHex(#8A8A8A); | ||
| 319 | + _dateLabel.lineBreakMode = NSLineBreakByTruncatingTail; | ||
| 320 | + _dateLabel.numberOfLines = 1; | ||
| 321 | + _dateLabel.textAlignment = NSTextAlignmentRight; | ||
| 322 | + _dateLabel.font = [UIFont systemFontOfSize:11]; | ||
| 323 | + _dateLabel.font = [UIFont boldSystemFontOfSize:11]; | ||
| 324 | + } | ||
| 325 | + return _dateLabel; | ||
| 326 | +} | ||
| 327 | +-(UIButton *)evalButton | ||
| 328 | +{ | ||
| 329 | + if (!_evalButton) { | ||
| 330 | + _evalButton = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 331 | + [_evalButton setTitle:@"评价" forState:UIControlStateNormal]; | ||
| 332 | + [_evalButton setTitleColor:UIColorHex(#FD862E) forState:UIControlStateNormal]; | ||
| 333 | + _evalButton.titleLabel.font = [UIFont systemFontOfSize:13]; | ||
| 334 | + _evalButton.titleLabel.font = [UIFont boldSystemFontOfSize:13]; | ||
| 335 | + _evalButton.layer.cornerRadius = 10; | ||
| 336 | + _evalButton.layer.masksToBounds = YES; | ||
| 337 | + _evalButton.layer.borderWidth = 1; | ||
| 338 | + _evalButton.layer.borderColor = UIColorHex(#FD862E).CGColor; | ||
| 339 | + [_evalButton setBackgroundImage:[UIImage imageWithColor:UIColorHex(#FFFD862E)] forState:UIControlStateNormal]; | ||
| 340 | + } | ||
| 341 | + return _evalButton; | ||
| 342 | +} | ||
| 343 | +@end | ||
| 344 | + | ||
| 345 | +@implementation CNLiveCommuntSubRepairTableView | ||
| 346 | + | ||
| 347 | ++(CNLiveCommuntSubRepairTableView *)setTableView:(UITableView *)tableView RepairModel:(CNLiveCommuntyActivityRepairListModel *)repairModel | ||
| 348 | +{ | ||
| 349 | + CNLiveCommuntSubRepairTableView * repairView = [tableView dequeueReusableCellWithIdentifier:@"CNLiveCommuntSubRepairTableView"]; | ||
| 350 | + if (!repairView) { | ||
| 351 | + repairView = [[CNLiveCommuntSubRepairTableView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CNLiveCommuntSubRepairTableView"]; | ||
| 352 | + } | ||
| 353 | + repairView.repairModel = repairModel; | ||
| 354 | + | ||
| 355 | + return repairView; | ||
| 356 | +} | ||
| 357 | +-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | ||
| 358 | +{ | ||
| 359 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | ||
| 360 | + if (self) { | ||
| 361 | + self.selectionStyle = UITableViewCellSelectionStyleNone; | ||
| 362 | + self.contentView.backgroundColor = UIColorHex(#f9f9f9); | ||
| 363 | + [self.contentView addSubview:self.mainView]; | ||
| 364 | + [self.mainView addSubview:self.nameLabel]; | ||
| 365 | + [self.mainView addSubview:self.dateLabel]; | ||
| 366 | + [self.mainView addSubview:self.statueButton]; | ||
| 367 | + [self.mainView addSubview:self.lineLabel]; | ||
| 368 | + [self.mainView addSubview:self.priceLabel]; | ||
| 369 | + } | ||
| 370 | + return self; | ||
| 371 | +} | ||
| 372 | +-(void)layoutSubviews | ||
| 373 | +{ | ||
| 374 | + [super layoutSubviews]; | ||
| 375 | + __weak typeof(self) weakSelf = self; | ||
| 376 | + [self.mainView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 377 | + make.top.left.mas_equalTo(weakSelf.contentView).offset(10); | ||
| 378 | + make.right.mas_equalTo(weakSelf.contentView).offset(-10); | ||
| 379 | + make.bottom.mas_equalTo(weakSelf.contentView); | ||
| 380 | + }]; | ||
| 381 | + [self.statueButton mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 382 | + make.top.mas_equalTo(weakSelf.mainView).offset(10); | ||
| 383 | + make.right.mas_equalTo(weakSelf.mainView.mas_right).offset(-5); | ||
| 384 | + make.width.mas_equalTo(60); | ||
| 385 | + make.height.mas_equalTo(15); | ||
| 386 | + }]; | ||
| 387 | + [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 388 | + make.top.left.mas_equalTo(weakSelf.mainView).offset(10); | ||
| 389 | + make.right.mas_equalTo(weakSelf.statueButton.mas_left).offset(-5); | ||
| 390 | + }]; | ||
| 391 | + [self.dateLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 392 | + make.top.mas_equalTo(weakSelf.nameLabel.mas_bottom).offset(10); | ||
| 393 | + make.left.mas_equalTo(weakSelf.mainView).offset(10); | ||
| 394 | + make.right.mas_equalTo(weakSelf.statueButton.mas_left).offset(-10); | ||
| 395 | + }]; | ||
| 396 | + [self.lineLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 397 | + make.left.mas_equalTo(weakSelf.mainView.mas_left).offset(10); | ||
| 398 | + make.right.mas_equalTo(weakSelf.mainView.mas_right).offset(-10); | ||
| 399 | + make.top.mas_equalTo(weakSelf.dateLabel.mas_bottom).offset(10); | ||
| 400 | + make.height.mas_equalTo(0.5); | ||
| 401 | + }]; | ||
| 402 | + [self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 403 | + make.top.mas_equalTo(weakSelf.lineLabel.mas_bottom).offset(10); | ||
| 404 | + make.left.mas_equalTo(weakSelf.mainView.mas_left).offset(10); | ||
| 405 | + make.right.mas_equalTo(weakSelf.mainView.mas_right).offset(-10); | ||
| 406 | + }]; | ||
| 407 | +} | ||
| 408 | +-(void)setRepairModel:(CNLiveCommuntyActivityRepairListModel *)repairModel | ||
| 409 | +{ | ||
| 410 | + _repairModel = repairModel; | ||
| 411 | + self.lineLabel.hidden = ![repairModel.totalFee isNotBlank] || [repairModel.totalFee isEqualToString:@"0"]; | ||
| 412 | + self.priceLabel.hidden = ![repairModel.totalFee isNotBlank] || [repairModel.totalFee isEqualToString:@"0"]; | ||
| 413 | + self.nameLabel.text = [repairModel.repairName isNotBlank]?repairModel.repairName:@""; | ||
| 414 | + self.priceLabel.text = [NSString stringWithFormat:@"合计:¥%.2f",[repairModel.totalFee floatValue]/100]; | ||
| 415 | + self.dateLabel.text = [NSString stringWithFormat:@"下单时间:%@",repairModel.createTimeString]; | ||
| 416 | + [_statueButton setTitle:repairModel.statusString forState:UIControlStateNormal]; | ||
| 417 | + [_statueButton setTitleColor:![repairModel.status isEqualToString:@"3"]?UIColorHex(#FD862E):UIColorHex(#797979) forState:UIControlStateNormal]; | ||
| 418 | +} | ||
| 419 | + | ||
| 420 | +#pragma mark - | ||
| 421 | +-(UIView *)mainView | ||
| 422 | +{ | ||
| 423 | + if (!_mainView) { | ||
| 424 | + _mainView = [[UIView alloc] init]; | ||
| 425 | + _mainView.backgroundColor = [UIColor whiteColor]; | ||
| 426 | + _mainView.layer.masksToBounds = YES; | ||
| 427 | + _mainView.layer.cornerRadius = 8; | ||
| 428 | + } | ||
| 429 | + return _mainView; | ||
| 430 | +} | ||
| 431 | +-(UILabel *)nameLabel | ||
| 432 | +{ | ||
| 433 | + if (!_nameLabel) { | ||
| 434 | + _nameLabel = [[UILabel alloc] init]; | ||
| 435 | + _nameLabel.textColor = UIColorHex(#333333); | ||
| 436 | + _nameLabel.lineBreakMode = NSLineBreakByTruncatingTail; | ||
| 437 | + _nameLabel.numberOfLines = 1; | ||
| 438 | + _nameLabel.font = [UIFont systemFontOfSize:15]; | ||
| 439 | + _nameLabel.font = [UIFont boldSystemFontOfSize:15]; | ||
| 440 | + } | ||
| 441 | + return _nameLabel; | ||
| 442 | +} | ||
| 443 | +-(UILabel *)priceLabel | ||
| 444 | +{ | ||
| 445 | + if (!_priceLabel) { | ||
| 446 | + _priceLabel = [[UILabel alloc] init]; | ||
| 447 | + _priceLabel.textColor = UIColorHex(#333333); | ||
| 448 | + _priceLabel.lineBreakMode = NSLineBreakByTruncatingTail; | ||
| 449 | + _priceLabel.numberOfLines = 1; | ||
| 450 | + _priceLabel.font = [UIFont systemFontOfSize:18]; | ||
| 451 | + _priceLabel.font = [UIFont boldSystemFontOfSize:18]; | ||
| 452 | + _priceLabel.hidden = YES; | ||
| 453 | + } | ||
| 454 | + return _priceLabel; | ||
| 455 | +} | ||
| 456 | +-(UILabel *)dateLabel | ||
| 457 | +{ | ||
| 458 | + if (!_dateLabel) { | ||
| 459 | + _dateLabel = [[UILabel alloc] init]; | ||
| 460 | + _dateLabel.textColor = UIColorHex(#8A8A8A); | ||
| 461 | + _dateLabel.lineBreakMode = NSLineBreakByTruncatingTail; | ||
| 462 | + _dateLabel.numberOfLines = 1; | ||
| 463 | + _dateLabel.font = [UIFont systemFontOfSize:11]; | ||
| 464 | + _dateLabel.font = [UIFont boldSystemFontOfSize:11]; | ||
| 465 | + } | ||
| 466 | + return _dateLabel; | ||
| 467 | +} | ||
| 468 | +-(UILabel *)lineLabel | ||
| 469 | +{ | ||
| 470 | + if (!_lineLabel) { | ||
| 471 | + _lineLabel = [[UILabel alloc] init]; | ||
| 472 | + _lineLabel.backgroundColor = UIColorHex(#E6E6E6); | ||
| 473 | + _lineLabel.hidden = YES; | ||
| 474 | + } | ||
| 475 | + return _lineLabel; | ||
| 476 | +} | ||
| 477 | +-(QMUIButton *)statueButton | ||
| 478 | +{ | ||
| 479 | + if (!_statueButton) { | ||
| 480 | + _statueButton = [[QMUIButton alloc] init]; | ||
| 481 | + [_statueButton setImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_communt_list_more"] forState:UIControlStateNormal]; | ||
| 482 | + _statueButton.imagePosition = QMUIButtonImagePositionRight; | ||
| 483 | + _statueButton.spacingBetweenImageAndTitle = 2.5; | ||
| 484 | + _statueButton.titleLabel.font = [UIFont systemFontOfSize:12]; | ||
| 485 | + [_statueButton setTitleColor:UIColorHex(#FD862E) forState:UIControlStateNormal]; | ||
| 486 | + } | ||
| 487 | + return _statueButton; | ||
| 488 | +} | ||
| 489 | +@end | ||
| 490 | + | ||
| 491 | +@implementation CNLiveCommuntSubInputTableView | ||
| 492 | + | ||
| 493 | ++(CNLiveCommuntSubInputTableView *)setTableView:(UITableView *)tableView SubDict:(NSDictionary *)subDict indexs:(NSInteger)indexs UserInfo:(nonnull NSDictionary *)userInfo | ||
| 494 | +{ | ||
| 495 | + CNLiveCommuntSubInputTableView * inputView = [tableView dequeueReusableCellWithIdentifier:[NSString stringWithFormat:@"CNLiveCommuntSubInputTableView_%ld",(long)indexs]]; | ||
| 496 | + if (!inputView) { | ||
| 497 | + inputView = [[CNLiveCommuntSubInputTableView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:[NSString stringWithFormat:@"CNLiveCommuntSubInputTableView_%ld",(long)indexs]]; | ||
| 498 | + } | ||
| 499 | + inputView.subDict = subDict; | ||
| 500 | + if ([userInfo allValues].count > 0) inputView.userInfo = userInfo; | ||
| 501 | + return inputView; | ||
| 502 | +} | ||
| 503 | +-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | ||
| 504 | +{ | ||
| 505 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | ||
| 506 | + if (self) { | ||
| 507 | + self.selectionStyle = UITableViewCellSelectionStyleNone; | ||
| 508 | + self.contentView.backgroundColor = [UIColor whiteColor]; | ||
| 509 | + [self.contentView addSubview:self.nameLabel]; | ||
| 510 | + [self.contentView addSubview:self.contentField]; | ||
| 511 | + [self.contentView addSubview:self.lineLabel]; | ||
| 512 | + [self.contentView addSubview:self.moreButton]; | ||
| 513 | + [self.contentView addSubview:self.descTextView]; | ||
| 514 | + | ||
| 515 | + [self.contentView addSubview:self.contentImageView]; | ||
| 516 | + [self.contentImageView addSubview:self.imageView01]; | ||
| 517 | + [self.contentImageView addSubview:self.imageView02]; | ||
| 518 | + [self.contentImageView addSubview:self.imageView03]; | ||
| 519 | + | ||
| 520 | + self.delectBtn01 = [self setDelectBtn:0]; | ||
| 521 | + self.delectBtn02 = [self setDelectBtn:1]; | ||
| 522 | + self.delectBtn03 = [self setDelectBtn:2]; | ||
| 523 | + [self.imageView01 addSubview:self.delectBtn01]; | ||
| 524 | + [self.imageView02 addSubview:self.delectBtn02]; | ||
| 525 | + [self.imageView03 addSubview:self.delectBtn03]; | ||
| 526 | + | ||
| 527 | + [self.contentView addSubview:self.checkView_m]; | ||
| 528 | + [self.contentView addSubview:self.checkView_w]; | ||
| 529 | + | ||
| 530 | + self.sex = @"男"; | ||
| 531 | + } | ||
| 532 | + return self; | ||
| 533 | +} | ||
| 534 | +-(void)setUserInfo:(NSDictionary *)userInfo | ||
| 535 | +{ | ||
| 536 | + _userInfo = userInfo; | ||
| 537 | + self.sex = [[userInfo stringValueForKey:@"gender" default:@""] isEqualToString:@"0"]?@"女":@"男"; | ||
| 538 | + if ([self.nameLabel.text isEqualToString:@"姓名"]) self.contentField.text = [userInfo stringValueForKey:@"name" default:@""]; | ||
| 539 | + if ([self.nameLabel.text isEqualToString:@"年龄"]) self.contentField.text = [userInfo stringValueForKey:@"age" default:@""]; | ||
| 540 | + if ([self.nameLabel.text isEqualToString:@"联系方式"]) self.contentField.text = [userInfo stringValueForKey:@"mobile" default:@""]; | ||
| 541 | + | ||
| 542 | + self.checkView_m.selectCenterView.hidden = [[userInfo stringValueForKey:@"gender" default:@""] isEqualToString:@"0"]; | ||
| 543 | + self.checkView_w.selectCenterView.hidden = [[userInfo stringValueForKey:@"gender" default:@""] isEqualToString:@"1"]; | ||
| 544 | +} | ||
| 545 | +-(void)setSubDict:(NSDictionary *)subDict | ||
| 546 | +{ | ||
| 547 | + _subDict = subDict; | ||
| 548 | + self.nameLabel.text = [subDict stringValueForKey:@"name" default:@""]; | ||
| 549 | + self.contentField.keyboardType = [self.nameLabel.text isEqualToString:@"联系电话"]?UIKeyboardTypeNumberPad:UIKeyboardTypeDefault; | ||
| 550 | + self.contentField.keyboardType = [self.nameLabel.text isEqualToString:@"年龄"]?UIKeyboardTypeNumberPad:UIKeyboardTypeDefault; | ||
| 551 | + self.contentField.keyboardType = [self.nameLabel.text isEqualToString:@"联系方式"]?UIKeyboardTypeNumberPad:UIKeyboardTypeDefault; | ||
| 552 | + self.contentField.placeholder = [subDict stringValueForKey:@"placeholder" default:@""]; | ||
| 553 | + self.contentField.hidden = ![subDict boolValueForKey:@"isTextField" default:YES]; | ||
| 554 | + self.descTextView.placeholder = [subDict stringValueForKey:@"placeholder" default:@""]; | ||
| 555 | + self.descTextView.hidden = ![subDict boolValueForKey:@"isTextView" default:YES]; | ||
| 556 | + self.moreButton.hidden = ![subDict boolValueForKey:@"isClick" default:YES]; | ||
| 557 | + if ([subDict boolValueForKey:@"isClick" default:YES]) [self.moreButton setTitle:[subDict stringValueForKey:@"placeholder" default:@""] forState:UIControlStateNormal]; | ||
| 558 | + self.lineLabel.hidden = [subDict boolValueForKey:@"isImage" default:YES]; | ||
| 559 | + self.lineLabel.hidden = [subDict boolValueForKey:@"isTextView" default:YES]; | ||
| 560 | + | ||
| 561 | + self.checkView_m.hidden = ![subDict boolValueForKey:@"isChick" default:YES]; | ||
| 562 | + self.checkView_w.hidden = ![subDict boolValueForKey:@"isChick" default:YES]; | ||
| 563 | + self.contentImageView.hidden = ![subDict boolValueForKey:@"isImage" default:YES]; | ||
| 564 | +} | ||
| 565 | +-(void)setImageArray:(NSMutableArray *)imageArray | ||
| 566 | +{ | ||
| 567 | + _imageArray = imageArray; | ||
| 568 | + if (imageArray.count == 0) { | ||
| 569 | + self.imageView01.hidden = NO; | ||
| 570 | + self.delectBtn01.hidden = YES; | ||
| 571 | + self.imageView01.image = [CNLiveCommuntTools cCommunt_setImageWithName:@"c_communt_edit_add_image"]; | ||
| 572 | + self.imageView02.hidden = YES; | ||
| 573 | + self.delectBtn02.hidden = YES; | ||
| 574 | + } | ||
| 575 | + if (imageArray.count == 1) { | ||
| 576 | + self.imageView01.hidden = NO; | ||
| 577 | + self.imageView01.image = imageArray.firstObject; | ||
| 578 | + self.imageView02.hidden = NO; | ||
| 579 | + self.delectBtn01.hidden = NO; | ||
| 580 | + self.delectBtn02.hidden = YES; | ||
| 581 | + self.imageView02.image = [CNLiveCommuntTools cCommunt_setImageWithName:@"c_communt_edit_add_image"]; | ||
| 582 | + self.imageView03.hidden = YES; | ||
| 583 | + self.delectBtn03.hidden = YES; | ||
| 584 | + } | ||
| 585 | + if (imageArray.count == 2) { | ||
| 586 | + self.imageView01.hidden = NO; | ||
| 587 | + self.imageView01.image = imageArray.firstObject; | ||
| 588 | + self.imageView02.hidden = NO; | ||
| 589 | + self.imageView02.image = imageArray.lastObject; | ||
| 590 | + self.delectBtn01.hidden = NO; | ||
| 591 | + self.delectBtn02.hidden = NO; | ||
| 592 | + self.imageView03.hidden = NO; | ||
| 593 | + self.delectBtn03.hidden = YES; | ||
| 594 | + self.imageView03.image = [CNLiveCommuntTools cCommunt_setImageWithName:@"c_communt_edit_add_image"]; | ||
| 595 | + } | ||
| 596 | + if (imageArray.count == 3) { | ||
| 597 | + self.delectBtn01.hidden = NO; | ||
| 598 | + self.imageView01.hidden = NO; | ||
| 599 | + self.imageView01.image = imageArray.firstObject; | ||
| 600 | + self.delectBtn02.hidden = NO; | ||
| 601 | + self.imageView02.hidden = NO; | ||
| 602 | + self.imageView02.image = [imageArray objectAtIndex:1]; | ||
| 603 | + self.delectBtn03.hidden = NO; | ||
| 604 | + self.imageView03.hidden = NO; | ||
| 605 | + self.imageView03.image = imageArray.lastObject; | ||
| 606 | + } | ||
| 607 | +} | ||
| 608 | +-(void)layoutSubviews | ||
| 609 | +{ | ||
| 610 | + [super layoutSubviews]; | ||
| 611 | + __weak typeof(self) weakSelf = self; | ||
| 612 | + [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 613 | + make.top.left.mas_equalTo(weakSelf.contentView).offset(15); | ||
| 614 | + make.width.mas_equalTo(70); | ||
| 615 | + }]; | ||
| 616 | + [self.contentField mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 617 | + make.centerY.mas_equalTo(weakSelf.contentView); | ||
| 618 | + make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-10); | ||
| 619 | + make.left.mas_equalTo(weakSelf.nameLabel.mas_right).offset(10); | ||
| 620 | + }]; | ||
| 621 | + [self.moreButton mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 622 | + make.centerY.mas_equalTo(weakSelf.contentView); | ||
| 623 | + make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-10); | ||
| 624 | + make.left.mas_equalTo(weakSelf.nameLabel.mas_right).offset(20); | ||
| 625 | + make.height.mas_equalTo(30); | ||
| 626 | + }]; | ||
| 627 | + [self.descTextView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 628 | + make.left.mas_equalTo(weakSelf.contentView.mas_left).offset(15); | ||
| 629 | + make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-15); | ||
| 630 | + make.top.mas_equalTo(weakSelf.nameLabel.mas_bottom).offset(5); | ||
| 631 | + make.bottom.mas_equalTo(weakSelf.contentView.mas_bottom).offset(-5); | ||
| 632 | + }]; | ||
| 633 | + [self.lineLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 634 | + make.bottom.mas_equalTo(weakSelf.contentView.mas_bottom); | ||
| 635 | + make.left.mas_equalTo(weakSelf.contentView.mas_left).offset(10); | ||
| 636 | + make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-10); | ||
| 637 | + make.height.mas_equalTo(0.5); | ||
| 638 | + }]; | ||
| 639 | + [self.contentImageView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 640 | + make.edges.mas_equalTo(weakSelf.contentView); | ||
| 641 | + }]; | ||
| 642 | + [self.imageView01 mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 643 | + make.left.top.mas_equalTo(weakSelf.contentImageView).offset(10); | ||
| 644 | + make.size.mas_equalTo((kScreenWidth-40)/3); | ||
| 645 | + }]; | ||
| 646 | + [self.imageView02 mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 647 | + make.top.mas_equalTo(weakSelf.contentImageView).offset(10); | ||
| 648 | + make.left.mas_equalTo(weakSelf.imageView01.mas_right).offset(10); | ||
| 649 | + make.size.mas_equalTo((kScreenWidth-40)/3); | ||
| 650 | + }]; | ||
| 651 | + [self.imageView03 mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 652 | + make.top.mas_equalTo(weakSelf.contentImageView).offset(10); | ||
| 653 | + make.left.mas_equalTo(weakSelf.imageView02.mas_right).offset(10); | ||
| 654 | + make.size.mas_equalTo((kScreenWidth-40)/3); | ||
| 655 | + }]; | ||
| 656 | + [self.delectBtn01 mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 657 | + make.top.mas_equalTo(weakSelf.imageView01.mas_top).offset(5); | ||
| 658 | + make.right.mas_equalTo(weakSelf.imageView01.mas_right).offset(-5); | ||
| 659 | + make.size.mas_equalTo(20); | ||
| 660 | + }]; | ||
| 661 | + [self.delectBtn02 mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 662 | + make.top.mas_equalTo(weakSelf.imageView02.mas_top).offset(5); | ||
| 663 | + make.right.mas_equalTo(weakSelf.imageView02.mas_right).offset(-5); | ||
| 664 | + make.size.mas_equalTo(20); | ||
| 665 | + }]; | ||
| 666 | + [self.delectBtn03 mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 667 | + make.top.mas_equalTo(weakSelf.imageView03.mas_top).offset(5); | ||
| 668 | + make.right.mas_equalTo(weakSelf.imageView03.mas_right).offset(-5); | ||
| 669 | + make.size.mas_equalTo(20); | ||
| 670 | + }]; | ||
| 671 | + [self.checkView_w mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 672 | + make.centerY.mas_equalTo(weakSelf.contentView); | ||
| 673 | + make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-10); | ||
| 674 | + make.width.mas_equalTo(35); | ||
| 675 | + make.height.mas_equalTo(20); | ||
| 676 | + }]; | ||
| 677 | + [self.checkView_m mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 678 | + make.centerY.mas_equalTo(weakSelf.contentView); | ||
| 679 | + make.right.mas_equalTo(weakSelf.checkView_w.mas_left).offset(-10); | ||
| 680 | + make.width.mas_equalTo(35); | ||
| 681 | + make.height.mas_equalTo(20); | ||
| 682 | + }]; | ||
| 683 | +} | ||
| 684 | +- (BOOL)textFieldShouldEndEditing:(UITextField *)textField | ||
| 685 | +{ | ||
| 686 | + NSString * name = [self.subDict stringValueForKey:@"name" default:@""]; | ||
| 687 | + if ([name isEqualToString:@"联系人"] && textField.text.length > 15) { | ||
| 688 | + [QMUITips showWithText:@"联系人限制20个以内,超出将进行截取" inView:([UIApplication sharedApplication].delegate).window hideAfterDelay:1.5]; | ||
| 689 | + textField.text = [textField.text substringAtRange:NSMakeRange(0, 15)]; | ||
| 690 | + } | ||
| 691 | + if ([name isEqualToString:@"联系地址"] && textField.text.length > 50) { | ||
| 692 | + [QMUITips showWithText:@"联系地址限制50个以内,超出将进行截取" inView:([UIApplication sharedApplication].delegate).window hideAfterDelay:1.5]; | ||
| 693 | + textField.text = [textField.text substringAtRange:NSMakeRange(0, 50)]; | ||
| 694 | + } | ||
| 695 | + return YES; | ||
| 696 | +} | ||
| 697 | +#pragma mark = QMUITextViewDelegate = | ||
| 698 | +-(BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text | ||
| 699 | +{ | ||
| 700 | + if ([text isEqualToString:@"\n"]) return NO; | ||
| 701 | + NSInteger textTotalLength = textView.text.length + text.length; | ||
| 702 | + if (textTotalLength > _descTextView.maximumTextLength) { | ||
| 703 | + textTotalLength = _descTextView.maximumTextLength; | ||
| 704 | + } | ||
| 705 | + return YES; | ||
| 706 | +} | ||
| 707 | +- (void)textView:(QMUITextView *)textView didPreventTextChangeInRange:(NSRange)range replacementText:(NSString *)replacementText { | ||
| 708 | + | ||
| 709 | + [QMUITips showWithText:[NSString stringWithFormat:@"问题描述限制%@字以内", @(textView.maximumTextLength)] inView:([UIApplication sharedApplication].delegate).window hideAfterDelay:1.5]; | ||
| 710 | +} | ||
| 711 | +- (BOOL)textViewShouldReturn:(QMUITextView *)textView | ||
| 712 | +{ | ||
| 713 | + [textView resignFirstResponder]; | ||
| 714 | + return YES; | ||
| 715 | +} | ||
| 716 | +-(UIButton *)setDelectBtn:(NSInteger)index | ||
| 717 | +{ | ||
| 718 | + UIButton * delectBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 719 | + delectBtn.backgroundColor = [UIColor clearColor]; | ||
| 720 | + [delectBtn setImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_communt_edit_delect_image"] forState:UIControlStateNormal]; | ||
| 721 | + delectBtn.imageView.contentMode = UIViewContentModeScaleAspectFit; | ||
| 722 | + delectBtn.hidden = YES; | ||
| 723 | + delectBtn.tag = index + 100; | ||
| 724 | + [delectBtn addTarget:self action:@selector(delectImageViewAction:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 725 | + return delectBtn; | ||
| 726 | +} | ||
| 727 | +-(void)delectImageViewAction:(UIButton *)delectBtn | ||
| 728 | +{ | ||
| 729 | + if ([self.delegate respondsToSelector:@selector(setCommuntSubInputTableViewWithDelectForImage:)]) { | ||
| 730 | + UIImage * image = self.imageArray[delectBtn.tag - 100]; | ||
| 731 | + [self.delegate setCommuntSubInputTableViewWithDelectForImage:image]; | ||
| 732 | + } | ||
| 733 | +} | ||
| 734 | +-(void)selectWithImageViewForIndex:(NSInteger)index | ||
| 735 | +{ | ||
| 736 | + if (self.imageArray.count >= index + 1) return; | ||
| 737 | + if ([self.delegate respondsToSelector:@selector(setCommuntSubInputTableViewWithSelectForIndex:)]) { | ||
| 738 | + [self.delegate setCommuntSubInputTableViewWithSelectForIndex:index]; | ||
| 739 | + } | ||
| 740 | +} | ||
| 741 | +-(void)checkMAction:(UIButton *)button | ||
| 742 | +{ | ||
| 743 | + self.checkView_m.selectCenterView.hidden = NO; | ||
| 744 | + self.checkView_w.selectCenterView.hidden = YES; | ||
| 745 | + self.sex = @"男"; | ||
| 746 | +} | ||
| 747 | +-(void)checkWAction:(UIButton *)button | ||
| 748 | +{ | ||
| 749 | + self.checkView_m.selectCenterView.hidden = YES; | ||
| 750 | + self.checkView_w.selectCenterView.hidden = NO; | ||
| 751 | + self.sex = @"女"; | ||
| 752 | +} | ||
| 753 | +#pragma mark = | ||
| 754 | +-(UILabel *)nameLabel | ||
| 755 | +{ | ||
| 756 | + if (!_nameLabel) { | ||
| 757 | + _nameLabel = [[UILabel alloc] init]; | ||
| 758 | + _nameLabel.textColor = UIColorHex(#333333); | ||
| 759 | + _nameLabel.lineBreakMode = NSLineBreakByTruncatingTail; | ||
| 760 | + _nameLabel.numberOfLines = 1; | ||
| 761 | + _nameLabel.font = [UIFont systemFontOfSize:16]; | ||
| 762 | + _nameLabel.text = @"联系人"; | ||
| 763 | + } | ||
| 764 | + return _nameLabel; | ||
| 765 | +} | ||
| 766 | +-(UITextField *)contentField | ||
| 767 | +{ | ||
| 768 | + if (!_contentField) { | ||
| 769 | + _contentField = [[UITextField alloc] init]; | ||
| 770 | + _contentField.backgroundColor = [UIColor whiteColor]; | ||
| 771 | + _contentField.font = [UIFont systemFontOfSize:14.0f]; | ||
| 772 | + _contentField.textColor = UIColorHex(#333333); | ||
| 773 | + _contentField.clearButtonMode = UITextFieldViewModeWhileEditing; | ||
| 774 | + _contentField.textAlignment = NSTextAlignmentRight; | ||
| 775 | + _contentField.adjustsFontSizeToFitWidth = YES; | ||
| 776 | + _contentField.minimumFontSize = 12; | ||
| 777 | + _contentField.returnKeyType = UIReturnKeyNext; | ||
| 778 | + _contentField.hidden = YES; | ||
| 779 | + _contentField.delegate = self; | ||
| 780 | + } | ||
| 781 | + return _contentField; | ||
| 782 | +} | ||
| 783 | +-(QMUITextView *)descTextView | ||
| 784 | +{ | ||
| 785 | + if (!_descTextView) { | ||
| 786 | + _descTextView = [[QMUITextView alloc] init]; | ||
| 787 | + _descTextView.backgroundColor = UIColorHex(#F9F9F9); | ||
| 788 | + _descTextView.layer.masksToBounds = YES; | ||
| 789 | + _descTextView.layer.cornerRadius = 7; | ||
| 790 | + _descTextView.placeholderColor = UIColorHex(#C8C8C8); | ||
| 791 | + _descTextView.placeholder = @"您遇到什么问题,请留言"; | ||
| 792 | + _descTextView.textColor = UIColorHex(#333333); | ||
| 793 | + _descTextView.font = [UIFont systemFontOfSize:14.0f]; | ||
| 794 | + _descTextView.returnKeyType = UIReturnKeyDone; | ||
| 795 | + _descTextView.maximumTextLength = 100; | ||
| 796 | + _descTextView.textContainerInset = UIEdgeInsetsMake(2.5, 2.5, 2.5, 2.5); | ||
| 797 | + _descTextView.contentInset = UIEdgeInsetsMake(2.5, 2.5, 2.5, 2.5); | ||
| 798 | + _descTextView.delegate = self; | ||
| 799 | + _descTextView.hidden = YES; | ||
| 800 | + } | ||
| 801 | + return _descTextView; | ||
| 802 | +} | ||
| 803 | +-(UILabel *)lineLabel | ||
| 804 | +{ | ||
| 805 | + if (!_lineLabel) { | ||
| 806 | + _lineLabel = [[UILabel alloc] init]; | ||
| 807 | + _lineLabel.backgroundColor = UIColorHex(#E6E6E6); | ||
| 808 | + } | ||
| 809 | + return _lineLabel; | ||
| 810 | +} | ||
| 811 | +-(QMUIButton *)moreButton | ||
| 812 | +{ | ||
| 813 | + if (!_moreButton) { | ||
| 814 | + _moreButton = [[QMUIButton alloc] init]; | ||
| 815 | + [_moreButton setTitleColor:UIColorHex(#C8C8C8) forState:UIControlStateNormal]; | ||
| 816 | + [_moreButton setImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_communt_list_more"] forState:UIControlStateNormal]; | ||
| 817 | + _moreButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight; | ||
| 818 | + _moreButton.titleLabel.font = [UIFont systemFontOfSize:14.0f]; | ||
| 819 | + _moreButton.imagePosition = QMUIButtonImagePositionRight; | ||
| 820 | + _moreButton.spacingBetweenImageAndTitle = 2.5; | ||
| 821 | + _moreButton.userInteractionEnabled = NO; | ||
| 822 | + _moreButton.hidden = YES; | ||
| 823 | + } | ||
| 824 | + return _moreButton; | ||
| 825 | +} | ||
| 826 | +-(UIView *)contentImageView | ||
| 827 | +{ | ||
| 828 | + if (!_contentImageView) { | ||
| 829 | + _contentImageView = [[UIView alloc] init]; | ||
| 830 | + _contentImageView.backgroundColor = [UIColor whiteColor]; | ||
| 831 | + _contentImageView.hidden = YES; | ||
| 832 | + } | ||
| 833 | + return _contentImageView; | ||
| 834 | +} | ||
| 835 | +-(CNLiveCommuntCheckView *)checkView_m | ||
| 836 | +{ | ||
| 837 | + if (!_checkView_m) { | ||
| 838 | + _checkView_m = [[CNLiveCommuntCheckView alloc] init]; | ||
| 839 | + _checkView_m.backgroundColor = [UIColor whiteColor]; | ||
| 840 | + _checkView_m.selectCenterView.hidden = NO; | ||
| 841 | + _checkView_m.evaluaDescLabel.text = @"男"; | ||
| 842 | + [_checkView_m.selectBtn addTarget:self action:@selector(checkMAction:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 843 | + } | ||
| 844 | + return _checkView_m; | ||
| 845 | +} | ||
| 846 | +-(CNLiveCommuntCheckView *)checkView_w | ||
| 847 | +{ | ||
| 848 | + if (!_checkView_w) { | ||
| 849 | + _checkView_w = [[CNLiveCommuntCheckView alloc] init]; | ||
| 850 | + _checkView_w.backgroundColor = [UIColor whiteColor]; | ||
| 851 | + _checkView_w.selectCenterView.hidden = YES; | ||
| 852 | + _checkView_w.evaluaDescLabel.text = @"女"; | ||
| 853 | + [_checkView_w.selectBtn addTarget:self action:@selector(checkWAction:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 854 | + } | ||
| 855 | + return _checkView_w; | ||
| 856 | +} | ||
| 857 | +-(UIImageView *)imageView01 | ||
| 858 | +{ | ||
| 859 | + if (!_imageView01) { | ||
| 860 | + _imageView01 = [[UIImageView alloc] init]; | ||
| 861 | + _imageView01.backgroundColor = [UIColor whiteColor]; | ||
| 862 | + _imageView01.contentMode = UIViewContentModeScaleAspectFill; | ||
| 863 | + _imageView01.image = [CNLiveCommuntTools cCommunt_setImageWithName:@"c_communt_edit_add_image"]; | ||
| 864 | + _imageView01.layer.cornerRadius = 6; | ||
| 865 | + _imageView01.layer.masksToBounds = YES; | ||
| 866 | + _imageView01.userInteractionEnabled = YES; | ||
| 867 | + __weak typeof(self) weakSelf = self; | ||
| 868 | + [_imageView01 addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithActionBlock:^(id _Nonnull sender) { | ||
| 869 | + [weakSelf selectWithImageViewForIndex:0]; | ||
| 870 | + }]]; | ||
| 871 | + } | ||
| 872 | + return _imageView01; | ||
| 873 | +} | ||
| 874 | +-(UIImageView *)imageView02 | ||
| 875 | +{ | ||
| 876 | + if (!_imageView02) { | ||
| 877 | + _imageView02 = [[UIImageView alloc] init]; | ||
| 878 | + _imageView02.backgroundColor = [UIColor whiteColor]; | ||
| 879 | + _imageView02.contentMode = UIViewContentModeScaleAspectFill; | ||
| 880 | + _imageView02.image = [CNLiveCommuntTools cCommunt_setImageWithName:@"c_communt_edit_add_image"]; | ||
| 881 | + _imageView02.layer.cornerRadius = 6; | ||
| 882 | + _imageView02.layer.masksToBounds = YES; | ||
| 883 | + _imageView02.hidden = YES; | ||
| 884 | + _imageView02.userInteractionEnabled = YES; | ||
| 885 | + __weak typeof(self) weakSelf = self; | ||
| 886 | + [_imageView02 addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithActionBlock:^(id _Nonnull sender) { | ||
| 887 | + [weakSelf selectWithImageViewForIndex:1]; | ||
| 888 | + }]]; | ||
| 889 | + } | ||
| 890 | + return _imageView02; | ||
| 891 | +} | ||
| 892 | +-(UIImageView *)imageView03 | ||
| 893 | +{ | ||
| 894 | + if (!_imageView03) { | ||
| 895 | + _imageView03 = [[UIImageView alloc] init]; | ||
| 896 | + _imageView03.backgroundColor = [UIColor whiteColor]; | ||
| 897 | + _imageView03.contentMode = UIViewContentModeScaleAspectFill; | ||
| 898 | + _imageView03.image = [CNLiveCommuntTools cCommunt_setImageWithName:@"c_communt_edit_add_image"]; | ||
| 899 | + _imageView03.layer.cornerRadius = 6; | ||
| 900 | + _imageView03.layer.masksToBounds = YES; | ||
| 901 | + _imageView03.hidden = YES; | ||
| 902 | + _imageView03.userInteractionEnabled = YES; | ||
| 903 | + __weak typeof(self) weakSelf = self; | ||
| 904 | + [_imageView03 addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithActionBlock:^(id _Nonnull sender) { | ||
| 905 | + [weakSelf selectWithImageViewForIndex:2]; | ||
| 906 | + }]]; | ||
| 907 | + } | ||
| 908 | + return _imageView03; | ||
| 909 | +} | ||
| 910 | + | ||
| 911 | +@end | ||
| 912 | + | ||
| 913 | +@implementation CNLiveCommuntSubAlertTableView | ||
| 914 | + | ||
| 915 | +- (instancetype)initWithDataSource:(NSArray *)dataSource isTime:(BOOL)isTime | ||
| 916 | +{ | ||
| 917 | + self = [super init]; | ||
| 918 | + if (self) { | ||
| 919 | + self.frame = CGRectMake(0, 0, kScreenWidth, 280); | ||
| 920 | + self.backgroundColor = [UIColor whiteColor]; | ||
| 921 | + _isTime = isTime; | ||
| 922 | + | ||
| 923 | + _oneSource = dataSource; | ||
| 924 | + if (isTime) { | ||
| 925 | + CNLiveCommuntyActivityMaintainsTimeModel * timeModel = dataSource.firstObject; | ||
| 926 | + _twoSource = timeModel.time; | ||
| 927 | + self.dayString = timeModel.day; | ||
| 928 | + self.timeString = self.twoSource.firstObject; | ||
| 929 | + }else{ | ||
| 930 | + self.listModel = dataSource.firstObject; | ||
| 931 | + } | ||
| 932 | + | ||
| 933 | + self.pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 50, kScreenWidth, 230)]; | ||
| 934 | + self.pickerView.delegate = self; | ||
| 935 | + self.pickerView.dataSource = self; | ||
| 936 | + [self addSubview:self.pickerView]; | ||
| 937 | + | ||
| 938 | + self.closeBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 939 | + self.closeBtn.frame = CGRectMake(10, 15, 20, 20); | ||
| 940 | + [self.closeBtn setImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_community_content_close"] forState:UIControlStateNormal]; | ||
| 941 | + [self.closeBtn setBackgroundColor:[UIColor whiteColor]]; | ||
| 942 | + [self addSubview:self.closeBtn]; | ||
| 943 | + | ||
| 944 | + self.doneBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 945 | + self.doneBtn.frame = CGRectMake(kScreenWidth - 40, 15, 30, 20); | ||
| 946 | + [self.doneBtn setTitle:@"完成" forState:UIControlStateNormal]; | ||
| 947 | + [self.doneBtn setTitleColor:UIColorHex(#CD0302) forState:UIControlStateNormal]; | ||
| 948 | + [self.doneBtn setBackgroundColor:[UIColor whiteColor]]; | ||
| 949 | + self.doneBtn.titleLabel.font = [UIFont systemFontOfSize:13]; | ||
| 950 | + [self addSubview:self.doneBtn]; | ||
| 951 | + | ||
| 952 | + self.lineLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 49, kScreenWidth, 0.5)]; | ||
| 953 | + self.lineLabel.backgroundColor = UIColorHex(#E4E4E4); | ||
| 954 | + [self addSubview:self.lineLabel]; | ||
| 955 | + } | ||
| 956 | + return self; | ||
| 957 | +} | ||
| 958 | + | ||
| 959 | +-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView | ||
| 960 | +{ | ||
| 961 | + return self.isTime ? 2 : 1; | ||
| 962 | +} | ||
| 963 | +-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component | ||
| 964 | +{ | ||
| 965 | + if (self.isTime) { | ||
| 966 | + if (component == 0) { | ||
| 967 | + return self.oneSource.count; | ||
| 968 | + }else{ | ||
| 969 | + return self.twoSource.count; | ||
| 970 | + } | ||
| 971 | + }else{ | ||
| 972 | + return self.oneSource.count; | ||
| 973 | + } | ||
| 974 | + | ||
| 975 | +} | ||
| 976 | +-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component | ||
| 977 | +{ | ||
| 978 | + if (self.isTime) { | ||
| 979 | + if (component == 0) { | ||
| 980 | + CNLiveCommuntyActivityMaintainsTimeModel * timeModel = self.oneSource[row]; | ||
| 981 | + return timeModel.day; | ||
| 982 | + }else{ | ||
| 983 | + return self.twoSource[row]; | ||
| 984 | + } | ||
| 985 | + }else{ | ||
| 986 | + CNLiveCommuntyActivityMaintainsListModel * listModel = self.oneSource[row]; | ||
| 987 | + return listModel.name; | ||
| 988 | + } | ||
| 989 | +} | ||
| 990 | +- (CGFloat)pickerView:(UIPickerView *)pickerView rowHeightForComponent:(NSInteger)component | ||
| 991 | +{ | ||
| 992 | + return 40.0f; | ||
| 993 | +} | ||
| 994 | +-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component | ||
| 995 | +{ | ||
| 996 | + if (self.isTime) { | ||
| 997 | + if (component == 0) { | ||
| 998 | + CNLiveCommuntyActivityMaintainsTimeModel * timeModel = self.oneSource[row]; | ||
| 999 | + self.twoSource = timeModel.time; | ||
| 1000 | + [pickerView selectedRowInComponent:1]; | ||
| 1001 | + [pickerView reloadComponent:1]; | ||
| 1002 | + | ||
| 1003 | + self.dayString = timeModel.day; | ||
| 1004 | + } | ||
| 1005 | + if (component == 1) self.timeString = self.twoSource[row]; | ||
| 1006 | + }else{ | ||
| 1007 | + self.listModel = self.oneSource[row]; | ||
| 1008 | + } | ||
| 1009 | +} | ||
| 1010 | + | ||
| 1011 | ++(void)showAlertViewDataSource:(NSArray *)dataSource isTime:(BOOL)isTime CompleterBlock:(void(^)(NSString * idStr,NSString * content))completerBlock | ||
| 1012 | +{ | ||
| 1013 | + CNLiveCommuntSubAlertTableView * alertView = [[CNLiveCommuntSubAlertTableView alloc] initWithDataSource:dataSource isTime:isTime]; | ||
| 1014 | + | ||
| 1015 | + QMUIModalPresentationViewController *modalViewController = [[QMUIModalPresentationViewController alloc] init]; | ||
| 1016 | + modalViewController.animationStyle = QMUIModalPresentationAnimationStyleSlide; | ||
| 1017 | + modalViewController.contentView = alertView; | ||
| 1018 | + modalViewController.contentViewMargins = UIEdgeInsetsMake(kScreenHeight - 280, 0, 0, 0); | ||
| 1019 | + [modalViewController showWithAnimated:YES completion:nil]; | ||
| 1020 | + | ||
| 1021 | + __weak typeof(alertView) weakAlertView = alertView; | ||
| 1022 | + __weak typeof(modalViewController) weakModalViewController = modalViewController; | ||
| 1023 | + [alertView.closeBtn addBlockForControlEvents:UIControlEventTouchUpInside block:^(id _Nonnull sender) { | ||
| 1024 | + [weakModalViewController hideWithAnimated:YES completion:^(BOOL finished) { | ||
| 1025 | + | ||
| 1026 | + }]; | ||
| 1027 | + }]; | ||
| 1028 | + [alertView.doneBtn addBlockForControlEvents:UIControlEventTouchUpInside block:^(id _Nonnull sender) { | ||
| 1029 | + [weakModalViewController hideWithAnimated:YES completion:^(BOOL finished) { | ||
| 1030 | + NSString * tempString = @""; | ||
| 1031 | + if ([weakAlertView.timeString isNotBlank]) tempString = [NSString stringWithFormat:@"%@ %@",weakAlertView.dayString,weakAlertView.timeString]; | ||
| 1032 | + if (![weakAlertView.timeString isNotBlank]) tempString = weakAlertView.listModel.name; | ||
| 1033 | + if (completerBlock) completerBlock([weakAlertView.listModel.idStr isNotBlank]?weakAlertView.listModel.idStr:@"",tempString); | ||
| 1034 | + }]; | ||
| 1035 | + }]; | ||
| 1036 | +} | ||
| 1037 | + | ||
| 1038 | + | ||
| 1039 | +@end |
CNLiveCommunitModule/Classes/View/CNLiveCommuntyColGridViewLayout.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/View/CNLiveCommuntyColGridViewLayout.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntyColGridViewLayout.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/9. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <UIKit/UIKit.h> | ||
| 9 | + | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +@protocol CNLiveCommuntyColGridViewLayoutDelegate <NSObject> | ||
| 13 | + | ||
| 14 | +- (NSInteger)numberOfColums; | ||
| 15 | +- (NSInteger)totolNumber; | ||
| 16 | +- (CGFloat)height; | ||
| 17 | + | ||
| 18 | +@end | ||
| 19 | + | ||
| 20 | +@interface CNLiveCommuntyColGridViewLayout : UICollectionViewFlowLayout | ||
| 21 | +@property (nonatomic, weak) id<CNLiveCommuntyColGridViewLayoutDelegate> delegate; | ||
| 22 | +@property (nonatomic, assign) NSInteger col; | ||
| 23 | +@property (nonatomic, assign) NSInteger sum; | ||
| 24 | +@property (nonatomic, assign) CGFloat height; //每行高度 | ||
| 25 | +@end | ||
| 26 | + | ||
| 27 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/View/CNLiveCommuntyColGridViewLayout.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/View/CNLiveCommuntyColGridViewLayout.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntyColGridViewLayout.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/9. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntyColGridViewLayout.h" | ||
| 9 | + | ||
| 10 | +@interface CNLiveCommuntyColGridViewLayout () | ||
| 11 | + | ||
| 12 | +@end | ||
| 13 | + | ||
| 14 | +@implementation CNLiveCommuntyColGridViewLayout | ||
| 15 | + | ||
| 16 | +- (NSInteger)col { | ||
| 17 | + if (_delegate && [_delegate respondsToSelector:@selector(numberOfColums)]) { | ||
| 18 | + return [_delegate numberOfColums]; | ||
| 19 | +} | ||
| 20 | + return 0; | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | +- (NSInteger)sum { | ||
| 24 | + if (_delegate && [_delegate respondsToSelector:@selector(totolNumber)]) { | ||
| 25 | + return [_delegate totolNumber]; | ||
| 26 | + } | ||
| 27 | +return 0; | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | +- (CGFloat)height { | ||
| 31 | + if (_delegate && [_delegate respondsToSelector:@selector(height)]) { | ||
| 32 | + return [_delegate height]; | ||
| 33 | + } | ||
| 34 | + return 0; | ||
| 35 | +} | ||
| 36 | + | ||
| 37 | +- (CGSize)collectionViewContentSize { | ||
| 38 | + if (self.col <= 0) { | ||
| 39 | + return CGSizeZero; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + NSInteger row = self.sum / self.col + ((self.sum % self.col) > 0 ? 1: 0); | ||
| 43 | + CGFloat width = SCREEN_WIDTH; | ||
| 44 | + CGFloat height = self.height * row; | ||
| 45 | + return CGSizeMake(width, height); | ||
| 46 | +} | ||
| 47 | + | ||
| 48 | +- (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds { | ||
| 49 | + return YES; | ||
| 50 | +} | ||
| 51 | +- (void)prepareLayout | ||
| 52 | +{ | ||
| 53 | + [super prepareLayout]; | ||
| 54 | + | ||
| 55 | +} | ||
| 56 | + | ||
| 57 | +- (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath { | ||
| 58 | + UICollectionViewLayoutAttributes *attributes = [super layoutAttributesForItemAtIndexPath:indexPath]; | ||
| 59 | + if (self.col <= 0) { | ||
| 60 | + return attributes; | ||
| 61 | + } | ||
| 62 | + CGFloat itemWidth = SCREEN_WIDTH / self.col; | ||
| 63 | + attributes.center = CGPointMake((indexPath.row % self.col + 0.5) * itemWidth, self.height * (indexPath.row / self.col + 0.5)); | ||
| 64 | + attributes.size = CGSizeMake(itemWidth, self.height); | ||
| 65 | + attributes.indexPath = indexPath; | ||
| 66 | + return attributes; | ||
| 67 | +} | ||
| 68 | + | ||
| 69 | +- (NSArray<UICollectionViewLayoutAttributes *> *)layoutAttributesForElementsInRect:(CGRect)rect { | ||
| 70 | + NSArray *array = [super layoutAttributesForElementsInRect:rect]; | ||
| 71 | + NSMutableArray *attributes = [NSMutableArray arrayWithCapacity:5]; | ||
| 72 | + for (int i = 0; i < [array count]; i ++) { | ||
| 73 | + NSIndexPath *indexPath = [NSIndexPath indexPathForRow:i inSection:0]; | ||
| 74 | + [attributes addObject:[self layoutAttributesForItemAtIndexPath:indexPath]]; | ||
| 75 | + } | ||
| 76 | + return attributes; | ||
| 77 | +} | ||
| 78 | + | ||
| 79 | +@end |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntActiviRecordViewController.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntActiviRecordViewController.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntActiviRecordViewController.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/2. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <CNLiveBusinessBaseModule/CNCommonViewController.h> | ||
| 9 | + | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +@interface CNLiveCommuntActiviRecordViewController : CNCommonViewController | ||
| 13 | + | ||
| 14 | +/// 初始化活动界面 | ||
| 15 | +/// @param nbhdId 小区id | ||
| 16 | +- (instancetype)initWithNBhdId:(NSString *)nbhdId; | ||
| 17 | +@end | ||
| 18 | + | ||
| 19 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntActiviRecordViewController.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntActiviRecordViewController.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntActiviRecordViewController.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/2. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntActiviRecordViewController.h" | ||
| 9 | + | ||
| 10 | +static NSInteger const kCNLiveSectionTitleHeight = 44;//标题显示 | ||
| 11 | + | ||
| 12 | +@interface CNLiveCommuntActiviRecordViewController ()<JXCategoryViewDelegate,JXCategoryListContainerViewDelegate> | ||
| 13 | +@property (nonatomic, strong) NSMutableArray<CNLiveCommuntListViewController *>* viewControllers; | ||
| 14 | +@property (nonatomic, strong) JXCategoryTitleView *categoryView; | ||
| 15 | +@property (nonatomic, strong) JXCategoryListContainerView *listContainerView; | ||
| 16 | +@property (nonatomic, strong) NSMutableArray <NSString *>* titleArray; | ||
| 17 | + | ||
| 18 | +@property (nonatomic, copy) NSString * nbhdId; | ||
| 19 | + | ||
| 20 | +@end | ||
| 21 | + | ||
| 22 | +@implementation CNLiveCommuntActiviRecordViewController | ||
| 23 | + | ||
| 24 | +- (instancetype)initWithNBhdId:(NSString *)nbhdId | ||
| 25 | +{ | ||
| 26 | + self = [super init]; | ||
| 27 | + if (self) { | ||
| 28 | + _nbhdId = nbhdId; | ||
| 29 | + } | ||
| 30 | + return self; | ||
| 31 | +} | ||
| 32 | + | ||
| 33 | +- (BOOL)preferredNavigationBarHidden | ||
| 34 | +{ | ||
| 35 | + return NO; | ||
| 36 | +} | ||
| 37 | +- (void)viewDidLoad { | ||
| 38 | + [super viewDidLoad]; | ||
| 39 | + // Do any additional setup after loading the view. | ||
| 40 | + self.view.backgroundColor = [UIColor whiteColor]; | ||
| 41 | + self.title = @"活动记录"; | ||
| 42 | + | ||
| 43 | + self.listContainerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self]; | ||
| 44 | + [self.view addSubview:self.listContainerView]; | ||
| 45 | + | ||
| 46 | + self.categoryView = [[JXCategoryTitleView alloc] init]; | ||
| 47 | + //优化关联listContainer,以后后续比如defaultSelectedIndex等属性,才能同步给listContainer | ||
| 48 | + self.categoryView.listContainer = self.listContainerView; | ||
| 49 | + self.categoryView.titleFont = [UIFont systemFontOfSize:15.0f]; | ||
| 50 | + self.categoryView.titleSelectedFont = [UIFont systemFontOfSize:16.0f]; | ||
| 51 | + self.categoryView.titleSelectedFont = [UIFont boldSystemFontOfSize:16.0f]; | ||
| 52 | + self.categoryView.titleColor = UIColorHex(#999999); | ||
| 53 | + self.categoryView.titleSelectedColor = UIColorHex(#CD0302); | ||
| 54 | + self.categoryView.delegate = self; | ||
| 55 | + self.categoryView.titles = self.titleArray; | ||
| 56 | + self.categoryView.defaultSelectedIndex = 0; | ||
| 57 | + JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init]; | ||
| 58 | + lineView.indicatorColor = UIColorHex(#CD0302); | ||
| 59 | + lineView.verticalMargin = 5; | ||
| 60 | + lineView.indicatorWidth = 10; | ||
| 61 | + self.categoryView.indicators = @[lineView]; | ||
| 62 | + [self.view addSubview:self.categoryView]; | ||
| 63 | +} | ||
| 64 | + | ||
| 65 | +- (void)viewDidLayoutSubviews { | ||
| 66 | + [super viewDidLayoutSubviews]; | ||
| 67 | + | ||
| 68 | + self.categoryView.frame = CGRectMake(0, kNavigationBarHeight, KScreenWidth, kCNLiveSectionTitleHeight); | ||
| 69 | + self.listContainerView.frame = CGRectMake(0, kNavigationBarHeight + kCNLiveSectionTitleHeight, KScreenWidth, KScreenHeight - kCNLiveSectionTitleHeight - kNavigationBarHeight); | ||
| 70 | +} | ||
| 71 | +#pragma mark - JXCategoryListContainerViewDelegate | ||
| 72 | + | ||
| 73 | +- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView { | ||
| 74 | + return self.titleArray.count; | ||
| 75 | +} | ||
| 76 | + | ||
| 77 | +- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index { | ||
| 78 | + return self.viewControllers[index]; | ||
| 79 | +} | ||
| 80 | + | ||
| 81 | +#pragma mark - JXCategoryViewDelegate | ||
| 82 | + | ||
| 83 | +- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index { | ||
| 84 | + //侧滑手势处理 | ||
| 85 | + self.navigationController.interactivePopGestureRecognizer.enabled = (index == 0); | ||
| 86 | +} | ||
| 87 | + | ||
| 88 | +#pragma mark = | ||
| 89 | +-(NSMutableArray<NSString *> *)titleArray | ||
| 90 | +{ | ||
| 91 | + if (!_titleArray) { | ||
| 92 | + _titleArray = @[@"未开始",@"进行中",@"已结束",@"待评价",@"退款"].mutableCopy; | ||
| 93 | + } | ||
| 94 | + return _titleArray; | ||
| 95 | +} | ||
| 96 | +-(NSMutableArray<CNLiveCommuntListViewController *> *)viewControllers | ||
| 97 | +{ | ||
| 98 | + if (!_viewControllers) { | ||
| 99 | + _viewControllers = [[NSMutableArray alloc] initWithArray:@[ | ||
| 100 | + [[CNLiveCommuntListViewController alloc] initWithShowType:CNLiveCommuntListShowTypeRecord Index:0 NBhdId:self.nbhdId], | ||
| 101 | + [[CNLiveCommuntListViewController alloc] initWithShowType:CNLiveCommuntListShowTypeRecord Index:1 NBhdId:self.nbhdId], | ||
| 102 | + [[CNLiveCommuntListViewController alloc] initWithShowType:CNLiveCommuntListShowTypeRecord Index:2 NBhdId:self.nbhdId], | ||
| 103 | + [[CNLiveCommuntListViewController alloc] initWithShowType:CNLiveCommuntListShowTypeRecord Index:3 NBhdId:self.nbhdId], | ||
| 104 | + [[CNLiveCommuntListViewController alloc] initWithShowType:CNLiveCommuntListShowTypeRecord Index:4 NBhdId:self.nbhdId] | ||
| 105 | + ]]; | ||
| 106 | + } | ||
| 107 | + return _viewControllers; | ||
| 108 | +} | ||
| 109 | + | ||
| 110 | +@end |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntActiviRepairViewController.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntActiviRepairViewController.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntActiviRepairViewController.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/3. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.h> | ||
| 9 | + | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +@interface CNLiveCommuntActiviRepairViewController : CNCommonViewController | ||
| 13 | + | ||
| 14 | +@end | ||
| 15 | + | ||
| 16 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntActiviRepairViewController.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntActiviRepairViewController.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntActiviRepairViewController.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/3. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntActiviRepairViewController.h" | ||
| 9 | + | ||
| 10 | + | ||
| 11 | +static NSInteger const kCNLiveSectionTitleHeight = 44;//标题显示 | ||
| 12 | + | ||
| 13 | +@interface CNLiveCommuntActiviRepairViewController ()<JXCategoryViewDelegate,JXCategoryListContainerViewDelegate> | ||
| 14 | +@property (nonatomic, strong) NSMutableArray<CNLiveCommuntListViewController *>* viewControllers; | ||
| 15 | +@property (nonatomic, strong) JXCategoryTitleView *categoryView; | ||
| 16 | +@property (nonatomic, strong) JXCategoryListContainerView *listContainerView; | ||
| 17 | +@property (nonatomic, strong) NSMutableArray <NSString *>* titleArray; | ||
| 18 | + | ||
| 19 | +@end | ||
| 20 | + | ||
| 21 | +@implementation CNLiveCommuntActiviRepairViewController | ||
| 22 | + | ||
| 23 | +- (BOOL)preferredNavigationBarHidden | ||
| 24 | +{ | ||
| 25 | + return NO; | ||
| 26 | +} | ||
| 27 | +- (void)viewDidLoad { | ||
| 28 | + [super viewDidLoad]; | ||
| 29 | + // Do any additional setup after loading the view. | ||
| 30 | + self.view.backgroundColor = [UIColor whiteColor]; | ||
| 31 | + self.title = @"报修记录"; | ||
| 32 | + | ||
| 33 | + self.listContainerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self]; | ||
| 34 | + [self.view addSubview:self.listContainerView]; | ||
| 35 | + | ||
| 36 | + self.categoryView = [[JXCategoryTitleView alloc] init]; | ||
| 37 | + //优化关联listContainer,以后后续比如defaultSelectedIndex等属性,才能同步给listContainer | ||
| 38 | + self.categoryView.listContainer = self.listContainerView; | ||
| 39 | + self.categoryView.titleFont = [UIFont systemFontOfSize:15.0f]; | ||
| 40 | + self.categoryView.titleSelectedFont = [UIFont systemFontOfSize:16.0f]; | ||
| 41 | + self.categoryView.titleSelectedFont = [UIFont boldSystemFontOfSize:16.0f]; | ||
| 42 | + self.categoryView.titleColor = UIColorHex(#999999); | ||
| 43 | + self.categoryView.titleSelectedColor = UIColorHex(#CD0302); | ||
| 44 | + self.categoryView.delegate = self; | ||
| 45 | + self.categoryView.titles = self.titleArray; | ||
| 46 | + self.categoryView.defaultSelectedIndex = 0; | ||
| 47 | + JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init]; | ||
| 48 | + lineView.indicatorColor = UIColorHex(#CD0302); | ||
| 49 | + lineView.verticalMargin = 5; | ||
| 50 | + lineView.indicatorWidth = 10; | ||
| 51 | + self.categoryView.indicators = @[lineView]; | ||
| 52 | + [self.view addSubview:self.categoryView]; | ||
| 53 | +} | ||
| 54 | + | ||
| 55 | +- (void)viewDidLayoutSubviews { | ||
| 56 | + [super viewDidLayoutSubviews]; | ||
| 57 | + | ||
| 58 | + self.categoryView.frame = CGRectMake(0, kNavigationBarHeight, KScreenWidth, kCNLiveSectionTitleHeight); | ||
| 59 | + self.listContainerView.frame = CGRectMake(0, kNavigationBarHeight + kCNLiveSectionTitleHeight, KScreenWidth, KScreenHeight - kCNLiveSectionTitleHeight - kNavigationBarHeight); | ||
| 60 | +} | ||
| 61 | +#pragma mark - JXCategoryListContainerViewDelegate | ||
| 62 | + | ||
| 63 | +- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView { | ||
| 64 | + return self.titleArray.count; | ||
| 65 | +} | ||
| 66 | + | ||
| 67 | +- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index { | ||
| 68 | + return self.viewControllers[index]; | ||
| 69 | +} | ||
| 70 | + | ||
| 71 | +#pragma mark - JXCategoryViewDelegate | ||
| 72 | + | ||
| 73 | +- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index { | ||
| 74 | + //侧滑手势处理 | ||
| 75 | + self.navigationController.interactivePopGestureRecognizer.enabled = (index == 0); | ||
| 76 | +} | ||
| 77 | + | ||
| 78 | +#pragma mark = | ||
| 79 | +-(NSMutableArray<NSString *> *)titleArray | ||
| 80 | +{ | ||
| 81 | + if (!_titleArray) { | ||
| 82 | + _titleArray = @[@"已发起",@"处理中",@"已失效",@"已完成"].mutableCopy; | ||
| 83 | + } | ||
| 84 | + return _titleArray; | ||
| 85 | +} | ||
| 86 | +-(NSMutableArray<CNLiveCommuntListViewController *> *)viewControllers | ||
| 87 | +{ | ||
| 88 | + if (!_viewControllers) { | ||
| 89 | + _viewControllers = [[NSMutableArray alloc] initWithArray:@[ | ||
| 90 | + [[CNLiveCommuntListViewController alloc] initWithShowType:CNLiveCommuntListShowTypeRepair Index:0 NBhdId:@""], | ||
| 91 | + [[CNLiveCommuntListViewController alloc] initWithShowType:CNLiveCommuntListShowTypeRepair Index:1 NBhdId:@""], | ||
| 92 | + [[CNLiveCommuntListViewController alloc] initWithShowType:CNLiveCommuntListShowTypeRepair Index:2 NBhdId:@""], | ||
| 93 | + [[CNLiveCommuntListViewController alloc] initWithShowType:CNLiveCommuntListShowTypeRepair Index:3 NBhdId:@""] | ||
| 94 | + ]]; | ||
| 95 | + } | ||
| 96 | + return _viewControllers; | ||
| 97 | +} | ||
| 98 | + | ||
| 99 | +@end |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntActiviViewController.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntActiviViewController.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntActiviViewController.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/1. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <DSBaseModule/DSBaseModule.h> | ||
| 9 | + | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +typedef enum : NSUInteger { | ||
| 13 | + CNLiveCommuntActiviShowTypeLive,//显示视讯列表界面内容 | ||
| 14 | + CNLiveCommuntActiviShowTypeWeb//使用内置网页 | ||
| 15 | +} CNLiveCommuntActiviShowType; | ||
| 16 | + | ||
| 17 | +@interface CNLiveCommuntActiviViewController : DSBaseViewController<JXCategoryListContentViewDelegate> | ||
| 18 | + | ||
| 19 | + | ||
| 20 | +@end | ||
| 21 | + | ||
| 22 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntActiviViewController.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntActiviViewController.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntActiviViewController.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/1. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntActiviViewController.h" | ||
| 9 | + | ||
| 10 | +@interface CNLiveCommuntActiviViewController () | ||
| 11 | +@property (nonatomic, assign) CNLiveCommuntActiviShowType showType; | ||
| 12 | +@end | ||
| 13 | + | ||
| 14 | +@implementation CNLiveCommuntActiviViewController | ||
| 15 | + | ||
| 16 | +- (instancetype)initWithShowType:(CNLiveCommuntActiviShowType)showType | ||
| 17 | +{ | ||
| 18 | + self = [super init]; | ||
| 19 | + if (self) { | ||
| 20 | + _showType = showType; | ||
| 21 | + } | ||
| 22 | + return self; | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | + | ||
| 26 | +- (void)viewDidLoad { | ||
| 27 | + [super viewDidLoad]; | ||
| 28 | + // Do any additional setup after loading the view. | ||
| 29 | + UIViewController *subVC = [UIViewController new]; | ||
| 30 | + if (self.showType == CNLiveCommuntActiviShowTypeLive) { | ||
| 31 | + subVC = [[CNLiveCommuntyModule shareInstance].protocol pushWebViewWithMainProjectWithWebUrl:@"https://www.baidu.com"]; | ||
| 32 | + } | ||
| 33 | + if (self.showType == CNLiveCommuntActiviShowTypeWeb) { | ||
| 34 | + subVC = [[CNLiveCommuntyModule shareInstance].protocol pushWebViewWithMainProjectWithWebUrl:@"https://gitee.com"]; | ||
| 35 | + } | ||
| 36 | + [self.view addSubview:subVC.view]; | ||
| 37 | + [self addChildViewController:subVC]; | ||
| 38 | + [subVC didMoveToParentViewController:self]; | ||
| 39 | + | ||
| 40 | +} | ||
| 41 | + | ||
| 42 | +- (UIView *)listView { | ||
| 43 | + return self.view; | ||
| 44 | +} | ||
| 45 | + | ||
| 46 | +@end |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntConsuViewController.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntConsuViewController.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntConsuViewController.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/1. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <DSBaseModule/DSBaseModule.h> | ||
| 9 | + | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +@interface CNLiveCommuntConsuViewController : DSBaseViewController | ||
| 13 | + | ||
| 14 | +/// 初始化界面显示 | ||
| 15 | +/// @param homeArray 数据源 | ||
| 16 | +/// @param titles 标题 | ||
| 17 | +/// @param nbhdId 小区id | ||
| 18 | +- (instancetype)initWithHomeArray:(NSArray<CNLiveCommuntySubHomeModel *> *)homeArray titles:(NSArray<NSString *>*)titles NBhdId:(NSString *)nbhdId; | ||
| 19 | +@end | ||
| 20 | + | ||
| 21 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntConsuViewController.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntConsuViewController.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntConsuViewController.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/1. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntConsuViewController.h" | ||
| 9 | + | ||
| 10 | +static NSInteger const kCNLiveSectionTitleHeight = 44;//标题显示 | ||
| 11 | + | ||
| 12 | +@interface CNLiveCommuntConsuViewController ()<JXCategoryViewDelegate,JXCategoryListContainerViewDelegate> | ||
| 13 | +@property (nonatomic, strong) NSMutableArray* viewControllers; | ||
| 14 | +@property (nonatomic, strong) JXCategoryTitleView *categoryView; | ||
| 15 | +@property (nonatomic, strong) JXCategoryListContainerView *listContainerView; | ||
| 16 | +@property (nonatomic, strong) NSArray * homeArray; | ||
| 17 | +@property (nonatomic, strong) NSArray * titles; | ||
| 18 | +@property (nonatomic, copy) NSString *nbhdId; | ||
| 19 | +@end | ||
| 20 | + | ||
| 21 | +@implementation CNLiveCommuntConsuViewController | ||
| 22 | + | ||
| 23 | +- (instancetype)initWithHomeArray:(NSArray<CNLiveCommuntySubHomeModel *> *)homeArray titles:(NSArray<NSString *>*)titles NBhdId:(NSString *)nbhdId | ||
| 24 | +{ | ||
| 25 | + self = [super init]; | ||
| 26 | + if (self) { | ||
| 27 | + _nbhdId = nbhdId; | ||
| 28 | + _titles = titles; | ||
| 29 | + _homeArray = homeArray; | ||
| 30 | + } | ||
| 31 | + return self; | ||
| 32 | +} | ||
| 33 | + | ||
| 34 | +- (void)viewDidLoad { | ||
| 35 | + [super viewDidLoad]; | ||
| 36 | + // Do any additional setup after loading the view. | ||
| 37 | + [self initNav]; | ||
| 38 | + | ||
| 39 | + self.listContainerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self]; | ||
| 40 | + [self.view addSubview:self.listContainerView]; | ||
| 41 | + | ||
| 42 | + self.categoryView = [[JXCategoryTitleView alloc] init]; | ||
| 43 | + //优化关联listContainer,以后后续比如defaultSelectedIndex等属性,才能同步给listContainer | ||
| 44 | + self.categoryView.listContainer = self.listContainerView; | ||
| 45 | + self.categoryView.titleFont = [UIFont systemFontOfSize:15.0f]; | ||
| 46 | + self.categoryView.titleSelectedFont = [UIFont systemFontOfSize:16.0f]; | ||
| 47 | + self.categoryView.titleSelectedFont = [UIFont boldSystemFontOfSize:16.0f]; | ||
| 48 | + self.categoryView.titleColor = UIColorHex(#999999); | ||
| 49 | + self.categoryView.titleSelectedColor = UIColorHex(#333333); | ||
| 50 | + self.categoryView.delegate = self; | ||
| 51 | + self.categoryView.titles = self.titles; | ||
| 52 | + self.categoryView.defaultSelectedIndex = 0; | ||
| 53 | + JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init]; | ||
| 54 | + lineView.indicatorColor = UIColorHex(#CD0302); | ||
| 55 | + lineView.verticalMargin = 5; | ||
| 56 | + lineView.indicatorWidth = 10; | ||
| 57 | + self.categoryView.indicators = @[lineView]; | ||
| 58 | + [self.view addSubview:self.categoryView]; | ||
| 59 | +} | ||
| 60 | +-(void)initNav | ||
| 61 | +{ | ||
| 62 | + self.topNavView.backgroundColor = [UIColor whiteColor]; | ||
| 63 | + self.topLine.backgroundColor = [UIColor whiteColor]; | ||
| 64 | + | ||
| 65 | + DSNavButton * searchBtn = [[DSNavButton alloc] initWithImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_communit_back"]]; | ||
| 66 | + [searchBtn addTarget:self action:@selector(leftNavBtnAction) forControlEvents:UIControlEventTouchUpInside]; | ||
| 67 | + self.leftNavBtns = @[searchBtn]; | ||
| 68 | +} | ||
| 69 | + | ||
| 70 | +-(void)leftNavBtnAction | ||
| 71 | +{ | ||
| 72 | + [self.navigationController popViewControllerAnimated:YES]; | ||
| 73 | +} | ||
| 74 | + | ||
| 75 | +- (void)viewDidLayoutSubviews { | ||
| 76 | + [super viewDidLayoutSubviews]; | ||
| 77 | + | ||
| 78 | + self.categoryView.frame = CGRectMake(0, kNavigationBarHeight, KScreenWidth, kCNLiveSectionTitleHeight); | ||
| 79 | + self.listContainerView.frame = CGRectMake(0, kNavigationBarHeight + kCNLiveSectionTitleHeight, KScreenWidth, KScreenHeight - kCNLiveSectionTitleHeight - kNavigationBarHeight - kVerticalTabBarTotalHeight); | ||
| 80 | +} | ||
| 81 | + | ||
| 82 | + | ||
| 83 | +#pragma mark - JXCategoryListContainerViewDelegate | ||
| 84 | + | ||
| 85 | +- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView { | ||
| 86 | + return self.titles.count; | ||
| 87 | +} | ||
| 88 | + | ||
| 89 | +- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index { | ||
| 90 | + return self.viewControllers[index]; | ||
| 91 | +} | ||
| 92 | + | ||
| 93 | +#pragma mark - JXCategoryViewDelegate | ||
| 94 | + | ||
| 95 | +- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index { | ||
| 96 | + //侧滑手势处理 | ||
| 97 | + self.navigationController.interactivePopGestureRecognizer.enabled = (index == 0); | ||
| 98 | +} | ||
| 99 | + | ||
| 100 | +#pragma mark = | ||
| 101 | +-(NSMutableArray *)viewControllers | ||
| 102 | +{ | ||
| 103 | + if (!_viewControllers) { | ||
| 104 | + _viewControllers = [[NSMutableArray alloc] init]; | ||
| 105 | + for (CNLiveCommuntySubHomeModel * homeModel in self.homeArray) { | ||
| 106 | + if ([homeModel.type isEqualToString:@"2"]) {//公益活动 | ||
| 107 | + [_viewControllers addObject:[[CNLiveCommuntListViewController alloc] initWithShowType:CNLiveCommuntListShowTypeHome NBhdId:self.nbhdId]]; | ||
| 108 | + }else{ | ||
| 109 | + if ([homeModel.cmsPageType isEqualToString:@"1"]) {//调用H5 | ||
| 110 | + [_viewControllers addObject:[[CNLiveCommuntActiviViewController alloc] init]]; | ||
| 111 | + } | ||
| 112 | + if ([homeModel.cmsPageType isEqualToString:@"4"]) {//调用视讯 | ||
| 113 | + [_viewControllers addObject:[[CNLiveCommuntActiviViewController alloc] init]]; | ||
| 114 | + } | ||
| 115 | +#ifdef DEBUG | ||
| 116 | + if (![homeModel.cmsPageType isNotBlank]) { | ||
| 117 | + [_viewControllers addObject:[[CNLiveCommuntActiviViewController alloc] init]]; | ||
| 118 | + } | ||
| 119 | +#else | ||
| 120 | +#endif | ||
| 121 | + } | ||
| 122 | + } | ||
| 123 | + } | ||
| 124 | + return _viewControllers; | ||
| 125 | +} | ||
| 126 | + | ||
| 127 | + | ||
| 128 | +@end |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntEvaluaViewController.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntEvaluaViewController.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntEvaluaViewController.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/6. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.h> | ||
| 9 | +#import "CNLiveCommuntyHomeModel.h" | ||
| 10 | + | ||
| 11 | +NS_ASSUME_NONNULL_BEGIN | ||
| 12 | + | ||
| 13 | +@interface CNLiveCommuntEvaluaViewController : CNCommonViewController | ||
| 14 | + | ||
| 15 | +/// 初始化评论界面 | ||
| 16 | +/// @param recordModel 评论model | ||
| 17 | +- (instancetype)initWithRecord:(CNLiveCommuntyActivityRecordListModel *)recordModel; | ||
| 18 | + | ||
| 19 | +@end | ||
| 20 | + | ||
| 21 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntEvaluaViewController.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntEvaluaViewController.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntEvaluaViewController.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/6. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntEvaluaViewController.h" | ||
| 9 | + | ||
| 10 | +@interface CNLiveCommuntEvaluaViewController ()<QMUITextViewDelegate,TZImagePickerControllerDelegate,UINavigationControllerDelegate,UIImagePickerControllerDelegate> | ||
| 11 | +@property (nonatomic, strong) UIScrollView * mianScrollView; | ||
| 12 | + | ||
| 13 | +@property (nonatomic, strong) UIImageView * imageView; | ||
| 14 | +@property (nonatomic, strong) UILabel * nameLabel; | ||
| 15 | +@property (nonatomic, strong) UILabel * dateLabel; | ||
| 16 | +@property (nonatomic, strong) UILabel * lineLabel; | ||
| 17 | +@property (nonatomic, strong) QMUITextView * evaluaView; | ||
| 18 | +@property (nonatomic, strong) MBProgressHUD * progressHud; | ||
| 19 | +@property (nonatomic, strong) UIImageView * imageView01; | ||
| 20 | +@property (nonatomic, strong) UIImageView * imageView02; | ||
| 21 | +@property (nonatomic, strong) UIImageView * imageView03; | ||
| 22 | + | ||
| 23 | +@property (nonatomic, strong) UIButton * delectBtn01; | ||
| 24 | +@property (nonatomic, strong) UIButton * delectBtn02; | ||
| 25 | +@property (nonatomic, strong) UIButton * delectBtn03; | ||
| 26 | + | ||
| 27 | +@property (nonatomic, strong) UIButton * selectBtn; | ||
| 28 | +@property (nonatomic, strong) UIView * selectView; | ||
| 29 | +@property (nonatomic, strong) UIView * selectCenterView; | ||
| 30 | +@property (nonatomic, strong) UILabel * evaluaDescLabel; | ||
| 31 | +@property (nonatomic, strong) UIButton * submiteBtn; | ||
| 32 | + | ||
| 33 | +@property (nonatomic, strong) NSMutableArray *cameraArray; | ||
| 34 | +@property (nonatomic, strong) NSMutableArray *photosArray; | ||
| 35 | +@property (nonatomic, strong) NSMutableArray *assetsPhotoArray; | ||
| 36 | +@property (nonatomic, strong) NSMutableArray *assetsCameraArray; | ||
| 37 | +@property (nonatomic, strong) NSMutableArray * imageArray; | ||
| 38 | +@property (nonatomic, strong) NSMutableArray * assetsArray; | ||
| 39 | + | ||
| 40 | +@property (nonatomic, assign) BOOL isAnonymity; | ||
| 41 | + | ||
| 42 | +@property (nonatomic, strong) CNLiveCommuntyActivityRecordListModel * recordModel; | ||
| 43 | +@end | ||
| 44 | + | ||
| 45 | +@implementation CNLiveCommuntEvaluaViewController | ||
| 46 | + | ||
| 47 | +- (instancetype)initWithRecord:(CNLiveCommuntyActivityRecordListModel *)recordModel | ||
| 48 | +{ | ||
| 49 | + self = [super init]; | ||
| 50 | + if (self) { | ||
| 51 | + _recordModel = recordModel; | ||
| 52 | + } | ||
| 53 | + return self; | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +- (void)viewDidLoad { | ||
| 57 | + [super viewDidLoad]; | ||
| 58 | + // Do any additional setup after loading the view. | ||
| 59 | + self.view.backgroundColor = [UIColor whiteColor]; | ||
| 60 | + self.title = @"活动评价"; | ||
| 61 | + [self.view addSubview:self.mianScrollView]; | ||
| 62 | + [self.mianScrollView addSubview:self.imageView]; | ||
| 63 | + [self.mianScrollView addSubview:self.nameLabel]; | ||
| 64 | + [self.mianScrollView addSubview:self.dateLabel]; | ||
| 65 | + [self.mianScrollView addSubview:self.lineLabel]; | ||
| 66 | + [self.mianScrollView addSubview:self.evaluaView]; | ||
| 67 | + [self.mianScrollView addSubview:self.imageView01]; | ||
| 68 | + [self.mianScrollView addSubview:self.imageView02]; | ||
| 69 | + [self.mianScrollView addSubview:self.imageView03]; | ||
| 70 | + [self.mianScrollView addSubview:self.selectView]; | ||
| 71 | + [self.mianScrollView addSubview:self.evaluaDescLabel]; | ||
| 72 | + [self.mianScrollView addSubview:self.selectBtn]; | ||
| 73 | + [self.selectView addSubview:self.selectCenterView]; | ||
| 74 | + | ||
| 75 | + self.delectBtn01 = [self setDelectBtn:0]; | ||
| 76 | + self.delectBtn02 = [self setDelectBtn:1]; | ||
| 77 | + self.delectBtn03 = [self setDelectBtn:2]; | ||
| 78 | + [self.imageView01 addSubview:self.delectBtn01]; | ||
| 79 | + [self.imageView02 addSubview:self.delectBtn02]; | ||
| 80 | + [self.imageView03 addSubview:self.delectBtn03]; | ||
| 81 | + | ||
| 82 | + self.assetsPhotoArray = [[NSMutableArray alloc] init]; | ||
| 83 | + self.assetsCameraArray = [[NSMutableArray alloc] init]; | ||
| 84 | + self.cameraArray = [[NSMutableArray alloc] init]; | ||
| 85 | + self.photosArray = [[NSMutableArray alloc] init]; | ||
| 86 | + self.imageArray = [[NSMutableArray alloc] init]; | ||
| 87 | + self.assetsArray = [[NSMutableArray alloc] init]; | ||
| 88 | + | ||
| 89 | + [self viewWillLayoutSubview]; | ||
| 90 | + | ||
| 91 | + UIButton * submiteBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 92 | + submiteBtn.frame = CGRectMake(0, 0, 50, 14); | ||
| 93 | + [submiteBtn setTitle:@"提交" forState:UIControlStateNormal]; | ||
| 94 | + [submiteBtn setTitleColor:UIColorHex(#999999) forState:UIControlStateNormal]; | ||
| 95 | + submiteBtn.backgroundColor = UIColorHex(#F2F2F2); | ||
| 96 | + submiteBtn.titleLabel.font = [UIFont systemFontOfSize:12]; | ||
| 97 | + submiteBtn.layer.cornerRadius = 3; | ||
| 98 | + submiteBtn.layer.masksToBounds = YES; | ||
| 99 | + [submiteBtn addTarget:self action:@selector(submiteAction:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 100 | + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:submiteBtn]; | ||
| 101 | + self.submiteBtn = submiteBtn; | ||
| 102 | +} | ||
| 103 | +-(void)viewWillLayoutSubview | ||
| 104 | +{ | ||
| 105 | + __weak typeof(self) weakSelf = self; | ||
| 106 | + [self.mianScrollView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 107 | + make.top.mas_equalTo(weakSelf.view).offset(kNavigationBarHeight); | ||
| 108 | + make.left.right.bottom.mas_equalTo(weakSelf.view); | ||
| 109 | + }]; | ||
| 110 | + [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 111 | + make.top.left.mas_equalTo(weakSelf.mianScrollView).offset(10); | ||
| 112 | + make.size.mas_equalTo(50); | ||
| 113 | + }]; | ||
| 114 | + [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 115 | + make.top.mas_equalTo(weakSelf.imageView).offset(3); | ||
| 116 | + make.left.mas_equalTo(weakSelf.imageView.mas_right).offset(10); | ||
| 117 | + }]; | ||
| 118 | + [self.dateLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 119 | + make.bottom.mas_equalTo(weakSelf.imageView.mas_bottom).offset(-3); | ||
| 120 | + make.left.mas_equalTo(weakSelf.imageView.mas_right).offset(10); | ||
| 121 | + }]; | ||
| 122 | + [self.lineLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 123 | + make.left.mas_equalTo(weakSelf.mianScrollView).offset(10); | ||
| 124 | + make.right.mas_equalTo(weakSelf.mianScrollView).offset(-10); | ||
| 125 | + make.centerX.mas_equalTo(weakSelf.mianScrollView); | ||
| 126 | + make.top.mas_equalTo(weakSelf.imageView.mas_bottom).offset(10); | ||
| 127 | + make.height.mas_equalTo(0.5); | ||
| 128 | + }]; | ||
| 129 | + [self.evaluaView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 130 | + make.left.mas_equalTo(weakSelf.mianScrollView).offset(10); | ||
| 131 | + make.right.mas_equalTo(weakSelf.mianScrollView).offset(-10); | ||
| 132 | + make.centerX.mas_equalTo(weakSelf.mianScrollView); | ||
| 133 | + make.top.mas_equalTo(weakSelf.lineLabel.mas_bottom).offset(10); | ||
| 134 | + make.height.mas_equalTo(150); | ||
| 135 | + }]; | ||
| 136 | + [self.imageView01 mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 137 | + make.left.mas_equalTo(weakSelf.mianScrollView).offset(10); | ||
| 138 | + make.top.mas_equalTo(weakSelf.evaluaView.mas_bottom).offset(10); | ||
| 139 | + make.size.mas_equalTo((kScreenWidth-40)/3); | ||
| 140 | + }]; | ||
| 141 | + [self.imageView02 mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 142 | + make.top.mas_equalTo(weakSelf.evaluaView.mas_bottom).offset(10); | ||
| 143 | + make.left.mas_equalTo(weakSelf.imageView01.mas_right).offset(10); | ||
| 144 | + make.size.mas_equalTo((kScreenWidth-40)/3); | ||
| 145 | + }]; | ||
| 146 | + [self.imageView03 mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 147 | + make.top.mas_equalTo(weakSelf.evaluaView.mas_bottom).offset(10); | ||
| 148 | + make.left.mas_equalTo(weakSelf.imageView02.mas_right).offset(10); | ||
| 149 | + make.size.mas_equalTo((kScreenWidth-40)/3); | ||
| 150 | + }]; | ||
| 151 | + [self.selectView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 152 | + make.top.mas_equalTo(weakSelf.imageView01.mas_bottom).offset(10); | ||
| 153 | + make.left.mas_equalTo(weakSelf.mianScrollView).offset(10); | ||
| 154 | + make.size.mas_equalTo(14); | ||
| 155 | + }]; | ||
| 156 | + [self.selectCenterView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 157 | + make.top.mas_equalTo(weakSelf.selectView).offset(2); | ||
| 158 | + make.left.mas_equalTo(weakSelf.selectView).offset(2); | ||
| 159 | + make.right.mas_equalTo(weakSelf.selectView).offset(-2); | ||
| 160 | + make.bottom.mas_equalTo(weakSelf.selectView).offset(-2); | ||
| 161 | + }]; | ||
| 162 | + [self.evaluaDescLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 163 | + make.centerY.mas_equalTo(weakSelf.selectView); | ||
| 164 | + make.left.mas_equalTo(weakSelf.selectView.mas_right).offset(5); | ||
| 165 | + }]; | ||
| 166 | + [self.selectBtn mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 167 | + make.top.mas_equalTo(weakSelf.imageView01.mas_bottom).offset(10); | ||
| 168 | + make.left.mas_equalTo(weakSelf.mianScrollView).offset(10); | ||
| 169 | + make.right.mas_equalTo(weakSelf.mianScrollView).offset(-10); | ||
| 170 | + make.height.mas_equalTo(30); | ||
| 171 | + }]; | ||
| 172 | + [self.delectBtn01 mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 173 | + make.top.mas_equalTo(weakSelf.imageView01.mas_top).offset(5); | ||
| 174 | + make.right.mas_equalTo(weakSelf.imageView01.mas_right).offset(-5); | ||
| 175 | + make.size.mas_equalTo(20); | ||
| 176 | + }]; | ||
| 177 | + [self.delectBtn02 mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 178 | + make.top.mas_equalTo(weakSelf.imageView02.mas_top).offset(5); | ||
| 179 | + make.right.mas_equalTo(weakSelf.imageView02.mas_right).offset(-5); | ||
| 180 | + make.size.mas_equalTo(20); | ||
| 181 | + }]; | ||
| 182 | + [self.delectBtn03 mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 183 | + make.top.mas_equalTo(weakSelf.imageView03.mas_top).offset(5); | ||
| 184 | + make.right.mas_equalTo(weakSelf.imageView03.mas_right).offset(-5); | ||
| 185 | + make.size.mas_equalTo(20); | ||
| 186 | + }]; | ||
| 187 | +} | ||
| 188 | +-(void)submiteAction:(UIButton *)button | ||
| 189 | +{ | ||
| 190 | + if (self.imageArray.count == 0) { | ||
| 191 | + //self.recordModel.idStr self.recordModel.handworkId | ||
| 192 | + [CNLiveCommuntViewModel requestWithCommuntyCommentsInfoWithContentId:@"52" handworkId:@"71" comment:self.evaluaView.text imgs:@"" isAnonymity:self.isAnonymity CompleterBlock:^{ | ||
| 193 | + | ||
| 194 | + }]; | ||
| 195 | + }else{ | ||
| 196 | + __weak typeof(self) weakSelf = self; | ||
| 197 | + [self uploadImageWithCompleterBlock:^(NSString *imageUrl) { | ||
| 198 | + [CNLiveCommuntViewModel requestWithCommuntyCommentsInfoWithContentId:weakSelf.recordModel.idStr handworkId:weakSelf.recordModel.handworkId comment:weakSelf.evaluaView.text imgs:imageUrl isAnonymity:weakSelf.isAnonymity CompleterBlock:^{ | ||
| 199 | + | ||
| 200 | + }]; | ||
| 201 | + }]; | ||
| 202 | + } | ||
| 203 | +} | ||
| 204 | +-(void)selectMothodAction:(UIButton *)button | ||
| 205 | +{ | ||
| 206 | + self.selectCenterView.hidden = button.selected; | ||
| 207 | + self.isAnonymity = !button.selected; | ||
| 208 | + NSLog(@"%@",self.isAnonymity?@"匿名":@"实名"); | ||
| 209 | + button.selected = !button.selected; | ||
| 210 | +} | ||
| 211 | +-(void)delectImageViewAction:(UIButton *)button | ||
| 212 | +{ | ||
| 213 | + UIImage * image = ((UIImageView *)button.superview).image; | ||
| 214 | + if ([self.imageArray containsObject:image]) { | ||
| 215 | + [self.assetsArray removeObjectAtIndex:[self.imageArray indexOfObject:image]]; | ||
| 216 | + [self.imageArray removeObject:image]; | ||
| 217 | + } | ||
| 218 | + [self setReloadFinishPickingPhotos]; | ||
| 219 | +} | ||
| 220 | +-(void)selectWithImageViewForIndex:(NSInteger)index | ||
| 221 | +{ | ||
| 222 | + if (self.imageArray.count >= index + 1) return; | ||
| 223 | + __weak typeof(self) weakSelf = self; | ||
| 224 | + [self.view createAlertViewTitleArray:@[@"拍摄",@"从手机相册选择"] subTitleArr:@[@"",@""] textColor:UIColorMake(40, 40, 40) subTitleColor:UIColorMake(152, 152, 152) font:UIFontMake(15) subFont:UIFontMake(12) actionBlock:^(UIButton *button, NSInteger didRow) { | ||
| 225 | + switch (didRow) { | ||
| 226 | + case 0: | ||
| 227 | + { | ||
| 228 | + if (IOS14_SDK_ALLOWED) { | ||
| 229 | + [weakSelf requestCNLiveALAssetsLibraryAuthorizationWithCompletion:^(BOOL isAuth) { | ||
| 230 | + if (isAuth) { | ||
| 231 | + dispatch_async_on_main_queue(^{ | ||
| 232 | + [weakSelf takeToXFPhoto:index]; | ||
| 233 | + }); | ||
| 234 | + } | ||
| 235 | + }]; | ||
| 236 | + }else{ | ||
| 237 | + [weakSelf takeToXFPhoto:index]; | ||
| 238 | + } | ||
| 239 | + } | ||
| 240 | + break; | ||
| 241 | + case 1: | ||
| 242 | + { | ||
| 243 | + [self pushTZImagePickerController:index]; | ||
| 244 | + } | ||
| 245 | + break; | ||
| 246 | + default: | ||
| 247 | + break; | ||
| 248 | + } | ||
| 249 | + }]; | ||
| 250 | +} | ||
| 251 | +-(void)requestCNLiveALAssetsLibraryAuthorizationWithCompletion:(void(^)(BOOL isAuth))requestAssetsLibraryAuthCompletion | ||
| 252 | +{ | ||
| 253 | + PHAuthorizationStatus authStatus = [PHPhotoLibrary authorizationStatus]; | ||
| 254 | + if (authStatus != PHAuthorizationStatusAuthorized) {//未授权 | ||
| 255 | + [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) { | ||
| 256 | + if (status != PHAuthorizationStatusAuthorized) {//已授权 | ||
| 257 | + if (requestAssetsLibraryAuthCompletion) { | ||
| 258 | + requestAssetsLibraryAuthCompletion(NO); | ||
| 259 | + } | ||
| 260 | + } else { | ||
| 261 | + if (requestAssetsLibraryAuthCompletion) { | ||
| 262 | + requestAssetsLibraryAuthCompletion(YES); | ||
| 263 | + } | ||
| 264 | + } | ||
| 265 | + }]; | ||
| 266 | + } else { | ||
| 267 | + if (requestAssetsLibraryAuthCompletion) { | ||
| 268 | + requestAssetsLibraryAuthCompletion(YES); | ||
| 269 | + } | ||
| 270 | + } | ||
| 271 | +} | ||
| 272 | +- (void)takeToXFPhoto:(NSInteger)index | ||
| 273 | +{ | ||
| 274 | + __weak typeof(self) weakSelf = self; | ||
| 275 | + XFCameraController *cameraController = [[XFCameraController alloc] init]; | ||
| 276 | + cameraController.isCanShootVideo = NO; | ||
| 277 | + cameraController.modalPresentationStyle = UIModalPresentationFullScreen; | ||
| 278 | + __weak XFCameraController *weakCameraController = cameraController; | ||
| 279 | + cameraController.takePhotosCompletionBlock = ^(UIImage *image, NSError *error) { | ||
| 280 | + if (!error) { | ||
| 281 | + NSMutableArray *imageIds = [NSMutableArray array]; | ||
| 282 | + [weakCameraController dismissViewControllerAnimated:YES completion:^{ | ||
| 283 | + [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{ | ||
| 284 | + //写入图片到相册 | ||
| 285 | + PHAssetChangeRequest *req = [PHAssetChangeRequest creationRequestForAssetFromImage:image]; | ||
| 286 | + //记录本地标识,等待完成后取到相册中的图片对象 | ||
| 287 | + [imageIds addObject:req.placeholderForCreatedAsset.localIdentifier]; | ||
| 288 | + | ||
| 289 | + } completionHandler:^(BOOL success, NSError * _Nullable error) { | ||
| 290 | + if (success) { | ||
| 291 | + PHFetchResult *result = [PHAsset fetchAssetsWithLocalIdentifiers:imageIds options:nil]; | ||
| 292 | + [result enumerateObjectsUsingBlock:^(PHAsset * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { | ||
| 293 | + dispatch_async_on_main_queue(^{ | ||
| 294 | + [weakSelf.imageArray removeObject:weakSelf.cameraArray.firstObject]; | ||
| 295 | + [weakSelf.assetsArray removeObject:weakSelf.assetsCameraArray.firstObject]; | ||
| 296 | + [weakSelf.assetsCameraArray removeAllObjects]; | ||
| 297 | + [weakSelf.cameraArray removeAllObjects]; | ||
| 298 | + [weakSelf.assetsCameraArray addObject:obj]; | ||
| 299 | + [weakSelf.cameraArray addObject:image]; | ||
| 300 | + [weakSelf.imageArray addObjectsFromArray:weakSelf.cameraArray]; | ||
| 301 | + [weakSelf.assetsArray addObjectsFromArray:weakSelf.assetsCameraArray]; | ||
| 302 | + [weakSelf setReloadFinishPickingPhotos]; | ||
| 303 | + }); | ||
| 304 | + }]; | ||
| 305 | + } | ||
| 306 | + }]; | ||
| 307 | + }]; | ||
| 308 | + } | ||
| 309 | + }; | ||
| 310 | + [self presentViewController:cameraController animated:YES completion:NULL]; | ||
| 311 | +} | ||
| 312 | +- (void)pushTZImagePickerController:(NSInteger)index | ||
| 313 | +{ | ||
| 314 | + CNImagePickerController *imagePickerVc = [[CNImagePickerController alloc] initWithMaxImagesCount:3 columnNumber:3 delegate:self pushPhotoPickerVc:YES]; | ||
| 315 | + imagePickerVc.modalPresentationStyle = UIModalPresentationFullScreen; | ||
| 316 | + [imagePickerVc configTZImagePicker];//配置 | ||
| 317 | + imagePickerVc.isSelectOriginalPhoto = NO;//是否选择原图 | ||
| 318 | + // 1.设置目前已经选中的图片数组 | ||
| 319 | + imagePickerVc.selectedAssets = self.assetsArray; | ||
| 320 | + imagePickerVc.maxEditVideoTime = 60;//编辑长度 | ||
| 321 | + imagePickerVc.maxVideoDuration = 120;//编辑视频最大长度 | ||
| 322 | + // 3. Set allow picking video & photo & originalPhoto or not | ||
| 323 | + // 3. 设置是否可以选择视频/图片/原图 | ||
| 324 | + imagePickerVc.allowPickingMultipleVideo = NO; | ||
| 325 | + imagePickerVc.allowPickingVideo = NO; | ||
| 326 | + /// 5. Single selection mode, valid when maxImagesCount = 1 | ||
| 327 | + /// 5. 单选模式,maxImagesCount为1时才生效 | ||
| 328 | + // 设置竖屏下的裁剪尺寸 | ||
| 329 | + NSInteger left = 30; | ||
| 330 | + NSInteger widthHeight = KScreenWidth - 2 * left; | ||
| 331 | + NSInteger top = (KScreenHeight - widthHeight) / 2; | ||
| 332 | + imagePickerVc.cropRect = CGRectMake(left, top, widthHeight, widthHeight); | ||
| 333 | + [self presentViewController:imagePickerVc animated:YES completion:NULL]; | ||
| 334 | +} | ||
| 335 | +- (void)imagePickerController:(TZImagePickerController *)picker didFinishPickingPhotos:(NSArray<UIImage *> *)photos sourceAssets:(NSArray *)assets isSelectOriginalPhoto:(BOOL)isSelectOriginalPhoto | ||
| 336 | +{ | ||
| 337 | + [self.imageArray removeAllObjects]; | ||
| 338 | + [self.assetsArray removeAllObjects]; | ||
| 339 | + [self.imageArray addObjectsFromArray:photos]; | ||
| 340 | + [self.assetsArray addObjectsFromArray:assets]; | ||
| 341 | + [self setReloadFinishPickingPhotos]; | ||
| 342 | +} | ||
| 343 | +- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text | ||
| 344 | +{ | ||
| 345 | + if (text.length > 0) { | ||
| 346 | + [self.submiteBtn setTitleColor:UIColorWhite forState:UIControlStateNormal]; | ||
| 347 | + self.submiteBtn.backgroundColor = UIColorHex(#CD0302); | ||
| 348 | + }else{ | ||
| 349 | + [self.submiteBtn setTitleColor:UIColorHex(#999999) forState:UIControlStateNormal]; | ||
| 350 | + self.submiteBtn.backgroundColor = UIColorHex(#F2F2F2); | ||
| 351 | + } | ||
| 352 | + return YES; | ||
| 353 | +} | ||
| 354 | +-(void)setReloadFinishPickingPhotos | ||
| 355 | +{ | ||
| 356 | + if (self.imageArray.count == 0) { | ||
| 357 | + self.imageView01.hidden = NO; | ||
| 358 | + self.delectBtn01.hidden = YES; | ||
| 359 | + self.imageView01.image = [CNLiveCommuntTools cCommunt_setImageWithName:@"c_communt_edit_add_image"]; | ||
| 360 | + self.imageView02.hidden = YES; | ||
| 361 | + self.delectBtn02.hidden = YES; | ||
| 362 | + } | ||
| 363 | + if (self.imageArray.count == 1) { | ||
| 364 | + self.imageView01.hidden = NO; | ||
| 365 | + self.imageView01.image = self.imageArray.firstObject; | ||
| 366 | + self.imageView02.hidden = NO; | ||
| 367 | + self.delectBtn01.hidden = NO; | ||
| 368 | + self.delectBtn02.hidden = YES; | ||
| 369 | + self.imageView02.image = [CNLiveCommuntTools cCommunt_setImageWithName:@"c_communt_edit_add_image"]; | ||
| 370 | + self.imageView03.hidden = YES; | ||
| 371 | + self.delectBtn03.hidden = YES; | ||
| 372 | + } | ||
| 373 | + if (self.imageArray.count == 2) { | ||
| 374 | + self.imageView01.hidden = NO; | ||
| 375 | + self.imageView01.image = self.imageArray.firstObject; | ||
| 376 | + self.imageView02.hidden = NO; | ||
| 377 | + self.imageView02.image = self.imageArray.lastObject; | ||
| 378 | + self.delectBtn01.hidden = NO; | ||
| 379 | + self.delectBtn02.hidden = NO; | ||
| 380 | + self.imageView03.hidden = NO; | ||
| 381 | + self.delectBtn03.hidden = YES; | ||
| 382 | + self.imageView03.image = [CNLiveCommuntTools cCommunt_setImageWithName:@"c_communt_edit_add_image"]; | ||
| 383 | + } | ||
| 384 | + if (self.imageArray.count == 3) { | ||
| 385 | + self.delectBtn01.hidden = NO; | ||
| 386 | + self.imageView01.hidden = NO; | ||
| 387 | + self.imageView01.image = self.imageArray.firstObject; | ||
| 388 | + self.delectBtn02.hidden = NO; | ||
| 389 | + self.imageView02.hidden = NO; | ||
| 390 | + self.imageView02.image = [self.imageArray objectAtIndex:1]; | ||
| 391 | + self.delectBtn03.hidden = NO; | ||
| 392 | + self.imageView03.hidden = NO; | ||
| 393 | + self.imageView03.image = self.imageArray.lastObject; | ||
| 394 | + } | ||
| 395 | + | ||
| 396 | +} | ||
| 397 | +-(UIButton *)setDelectBtn:(NSInteger)index | ||
| 398 | +{ | ||
| 399 | + UIButton * delectBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 400 | + delectBtn.backgroundColor = [UIColor clearColor]; | ||
| 401 | + [delectBtn setImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_communt_edit_delect_image"] forState:UIControlStateNormal]; | ||
| 402 | + delectBtn.imageView.contentMode = UIViewContentModeScaleAspectFit; | ||
| 403 | + delectBtn.hidden = YES; | ||
| 404 | + delectBtn.tag = index + 100; | ||
| 405 | + [delectBtn addTarget:self action:@selector(delectImageViewAction:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 406 | + return delectBtn; | ||
| 407 | +} | ||
| 408 | +-(void)uploadImageWithCompleterBlock:(void(^)(NSString * imageUrl))completerBlock | ||
| 409 | +{ | ||
| 410 | + __weak typeof(self) weakSelf = self; | ||
| 411 | + NSDictionary *param = @{@"appId":AppId, | ||
| 412 | + @"verb":@"POST", | ||
| 413 | + @"storageType":@"2", | ||
| 414 | + @"bucket":API_BucketName | ||
| 415 | + }; | ||
| 416 | + self.progressHud.hidden = NO; | ||
| 417 | + self.progressHud.mode = MBProgressHUDModeIndeterminate; | ||
| 418 | + self.progressHud.bezelView.backgroundColor = [UIColor blackColor]; | ||
| 419 | + [CNLiveUploadManager uploadRequestType:CNLiveUploadTypeQN url:CNUploadAuthForApp dic:param imageArray:self.imageArray assetArray:self.assetsArray isOriginal:NO limitType:AppPhototLimitTypeFriendsCircle progress:^(float progress) { | ||
| 420 | + NSLog(@"上传进度测试:%.2f",progress); | ||
| 421 | + weakSelf.progressHud.mode = MBProgressHUDModeDeterminate; | ||
| 422 | + weakSelf.progressHud.label.text = @"上传图片中..."; | ||
| 423 | + weakSelf.progressHud.bezelView.color = [UIColor colorWithWhite:0.95f alpha:0.6f]; | ||
| 424 | + weakSelf.progressHud.detailsLabel.text = [NSString stringWithFormat:@"%.2f %%",(progress * 100)]; | ||
| 425 | + } success:^(NSMutableArray *fileArray) { | ||
| 426 | + NSLog(@"输出结果测试:%@",fileArray); | ||
| 427 | + __block NSMutableString *picString = [[NSMutableString alloc] init]; | ||
| 428 | + [fileArray enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { | ||
| 429 | + CNLiveUploadModel *model = fileArray[idx]; | ||
| 430 | + if ([model.code isEqualToString:@"200"]) { | ||
| 431 | + [picString appendString:@","]; | ||
| 432 | + [picString appendString:model.imageUrl]; | ||
| 433 | + }else { | ||
| 434 | + weakSelf.progressHud.hidden = YES; | ||
| 435 | + weakSelf.progressHud = nil; | ||
| 436 | + [QMUITips showError:model.info.error.localizedDescription inView:weakSelf.view hideAfterDelay:1.5f]; | ||
| 437 | + } | ||
| 438 | + }]; | ||
| 439 | + if (completerBlock) completerBlock(picString); | ||
| 440 | + } failure:^(NSMutableArray *errorArray, NSError *error) { | ||
| 441 | + weakSelf.progressHud.hidden = YES; | ||
| 442 | + weakSelf.progressHud = nil; | ||
| 443 | + NSLog(@"输出结果测试:%@,错误:%@---%ld",errorArray,error,error.code); | ||
| 444 | + if (error.code == 0) { | ||
| 445 | + [QMUITips showError:@"上传失败" inView:[CNLiveCommuntTools cCommunt_currentViewController].view hideAfterDelay:1.5f]; | ||
| 446 | + }else { | ||
| 447 | + [QMUITips showWithText:error.localizedDescription inView:[CNLiveCommuntTools cCommunt_currentViewController].view hideAfterDelay:1.5]; | ||
| 448 | + } | ||
| 449 | + }]; | ||
| 450 | +} | ||
| 451 | +#pragma mark = | ||
| 452 | +-(UIScrollView *)mianScrollView | ||
| 453 | +{ | ||
| 454 | + if (!_mianScrollView) { | ||
| 455 | + _mianScrollView = [[UIScrollView alloc] init]; | ||
| 456 | + _mianScrollView.backgroundColor = [UIColor whiteColor]; | ||
| 457 | + _mianScrollView.contentSize = CGSizeMake(kScreenWidth, kScreenHeight); | ||
| 458 | + } | ||
| 459 | + return _mianScrollView; | ||
| 460 | +} | ||
| 461 | +-(UIImageView *)imageView | ||
| 462 | +{ | ||
| 463 | + if (!_imageView) { | ||
| 464 | + _imageView = [[UIImageView alloc] init]; | ||
| 465 | + _imageView.backgroundColor = [UIColor whiteColor]; | ||
| 466 | + _imageView.contentMode = UIViewContentModeScaleToFill; | ||
| 467 | + _imageView.layer.masksToBounds = YES; | ||
| 468 | + _imageView.layer.cornerRadius = 5; | ||
| 469 | + _imageView.image = [UIImage imageWithColor:[UIColor cyanColor]]; | ||
| 470 | + } | ||
| 471 | + return _imageView; | ||
| 472 | +} | ||
| 473 | +-(UILabel *)nameLabel | ||
| 474 | +{ | ||
| 475 | + if (!_nameLabel) { | ||
| 476 | + _nameLabel = [[UILabel alloc] init]; | ||
| 477 | + _nameLabel.backgroundColor = [UIColor whiteColor]; | ||
| 478 | + _nameLabel.font = [UIFont systemFontOfSize:15]; | ||
| 479 | + _nameLabel.textColor = UIColorHex(#333333); | ||
| 480 | + _nameLabel.numberOfLines = 1; | ||
| 481 | + _nameLabel.lineBreakMode = NSLineBreakByTruncatingTail; | ||
| 482 | + _nameLabel.text = self.recordModel.handworkName; | ||
| 483 | + } | ||
| 484 | + return _nameLabel; | ||
| 485 | +} | ||
| 486 | +-(UILabel *)dateLabel | ||
| 487 | +{ | ||
| 488 | + if (!_dateLabel) { | ||
| 489 | + _dateLabel = [[UILabel alloc] init]; | ||
| 490 | + _dateLabel.backgroundColor = [UIColor whiteColor]; | ||
| 491 | + _dateLabel.font = [UIFont systemFontOfSize:11]; | ||
| 492 | + _dateLabel.textColor = UIColorHex(#999999); | ||
| 493 | + _dateLabel.numberOfLines = 1; | ||
| 494 | + _dateLabel.lineBreakMode = NSLineBreakByTruncatingTail; | ||
| 495 | + | ||
| 496 | + _dateLabel.text = self.recordModel.createTimeString; | ||
| 497 | + } | ||
| 498 | + return _dateLabel; | ||
| 499 | +} | ||
| 500 | +-(UILabel *)lineLabel | ||
| 501 | +{ | ||
| 502 | + if (!_lineLabel) { | ||
| 503 | + _lineLabel = [[UILabel alloc] init]; | ||
| 504 | + _lineLabel.backgroundColor = UIColorHex(#E6E6E6); | ||
| 505 | + } | ||
| 506 | + return _lineLabel; | ||
| 507 | +} | ||
| 508 | +-(QMUITextView *)evaluaView | ||
| 509 | +{ | ||
| 510 | + if (!_evaluaView) { | ||
| 511 | + _evaluaView = [[QMUITextView alloc] init]; | ||
| 512 | + _evaluaView.backgroundColor = UIColorHex(#F9F9F9); | ||
| 513 | + _evaluaView.layer.masksToBounds = YES; | ||
| 514 | + _evaluaView.layer.cornerRadius = 7; | ||
| 515 | + _evaluaView.placeholderColor = UIColorHex(#C8C8C8); | ||
| 516 | + _evaluaView.placeholder = @"说说活动的特色和感受"; | ||
| 517 | + _evaluaView.textColor = UIColorHex(#333333); | ||
| 518 | + _evaluaView.font = [UIFont systemFontOfSize:14.0f]; | ||
| 519 | + _evaluaView.returnKeyType = UIReturnKeyDone; | ||
| 520 | + _evaluaView.maximumTextLength = 100; | ||
| 521 | + _evaluaView.textContainerInset = UIEdgeInsetsMake(2.5, 2.5, 2.5, 2.5); | ||
| 522 | + _evaluaView.contentInset = UIEdgeInsetsMake(2.5, 2.5, 2.5, 2.5); | ||
| 523 | + _evaluaView.delegate = self; | ||
| 524 | + | ||
| 525 | + } | ||
| 526 | + return _evaluaView; | ||
| 527 | +} | ||
| 528 | + | ||
| 529 | +-(UIImageView *)imageView01 | ||
| 530 | +{ | ||
| 531 | + if (!_imageView01) { | ||
| 532 | + _imageView01 = [[UIImageView alloc] init]; | ||
| 533 | + _imageView01.backgroundColor = [UIColor whiteColor]; | ||
| 534 | + _imageView01.contentMode = UIViewContentModeScaleAspectFill; | ||
| 535 | + _imageView01.image = [CNLiveCommuntTools cCommunt_setImageWithName:@"c_communty_evalua_add_image"]; | ||
| 536 | + _imageView01.layer.cornerRadius = 6; | ||
| 537 | + _imageView01.layer.masksToBounds = YES; | ||
| 538 | + _imageView01.userInteractionEnabled = YES; | ||
| 539 | + __weak typeof(self) weakSelf = self; | ||
| 540 | + [_imageView01 addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithActionBlock:^(id _Nonnull sender) { | ||
| 541 | + [weakSelf selectWithImageViewForIndex:0]; | ||
| 542 | + }]]; | ||
| 543 | + } | ||
| 544 | + return _imageView01; | ||
| 545 | +} | ||
| 546 | +-(UIImageView *)imageView02 | ||
| 547 | +{ | ||
| 548 | + if (!_imageView02) { | ||
| 549 | + _imageView02 = [[UIImageView alloc] init]; | ||
| 550 | + _imageView02.backgroundColor = [UIColor whiteColor]; | ||
| 551 | + _imageView02.contentMode = UIViewContentModeScaleAspectFill; | ||
| 552 | + _imageView02.image = [CNLiveCommuntTools cCommunt_setImageWithName:@"c_communty_evalua_add_image"]; | ||
| 553 | + _imageView02.layer.cornerRadius = 6; | ||
| 554 | + _imageView02.layer.masksToBounds = YES; | ||
| 555 | + _imageView02.hidden = YES; | ||
| 556 | + _imageView02.userInteractionEnabled = YES; | ||
| 557 | + __weak typeof(self) weakSelf = self; | ||
| 558 | + [_imageView02 addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithActionBlock:^(id _Nonnull sender) { | ||
| 559 | + [weakSelf selectWithImageViewForIndex:1]; | ||
| 560 | + }]]; | ||
| 561 | + } | ||
| 562 | + return _imageView02; | ||
| 563 | +} | ||
| 564 | +-(UIImageView *)imageView03 | ||
| 565 | +{ | ||
| 566 | + if (!_imageView03) { | ||
| 567 | + _imageView03 = [[UIImageView alloc] init]; | ||
| 568 | + _imageView03.backgroundColor = [UIColor whiteColor]; | ||
| 569 | + _imageView03.contentMode = UIViewContentModeScaleAspectFill; | ||
| 570 | + _imageView03.image = [CNLiveCommuntTools cCommunt_setImageWithName:@"c_communty_evalua_add_image"]; | ||
| 571 | + _imageView03.layer.cornerRadius = 6; | ||
| 572 | + _imageView03.layer.masksToBounds = YES; | ||
| 573 | + _imageView03.hidden = YES; | ||
| 574 | + _imageView03.userInteractionEnabled = YES; | ||
| 575 | + __weak typeof(self) weakSelf = self; | ||
| 576 | + [_imageView03 addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithActionBlock:^(id _Nonnull sender) { | ||
| 577 | + [weakSelf selectWithImageViewForIndex:2]; | ||
| 578 | + }]]; | ||
| 579 | + } | ||
| 580 | + return _imageView03; | ||
| 581 | +} | ||
| 582 | +-(UILabel *)evaluaDescLabel | ||
| 583 | +{ | ||
| 584 | + if (!_evaluaDescLabel) { | ||
| 585 | + _evaluaDescLabel = [[UILabel alloc] init]; | ||
| 586 | + _evaluaDescLabel.backgroundColor = [UIColor whiteColor]; | ||
| 587 | + _evaluaDescLabel.font = [UIFont systemFontOfSize:11]; | ||
| 588 | + _evaluaDescLabel.numberOfLines = 1; | ||
| 589 | + _evaluaDescLabel.lineBreakMode = NSLineBreakByTruncatingTail; | ||
| 590 | + | ||
| 591 | + NSMutableAttributedString * text01 = [[NSMutableAttributedString alloc] initWithString:@"匿名评价" attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:13],NSForegroundColorAttributeName:UIColorHex(#333333)}]; | ||
| 592 | + NSMutableAttributedString * text02 = [[NSMutableAttributedString alloc] initWithString:@" 您写的评价会以匿名的形式展现" attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:11],NSForegroundColorAttributeName:UIColorHex(#999999)}]; | ||
| 593 | + [text01 appendAttributedString:text02]; | ||
| 594 | + _evaluaDescLabel.attributedText = text01; | ||
| 595 | + } | ||
| 596 | + return _evaluaDescLabel; | ||
| 597 | +} | ||
| 598 | +-(UIView *)selectView | ||
| 599 | +{ | ||
| 600 | + if (!_selectView) { | ||
| 601 | + _selectView = [[UIView alloc] init]; | ||
| 602 | + _selectView.backgroundColor = [UIColor whiteColor]; | ||
| 603 | + _selectView.layer.cornerRadius = 7; | ||
| 604 | + _selectView.layer.masksToBounds = YES; | ||
| 605 | + _selectView.layer.borderColor = UIColorHex(#979797).CGColor; | ||
| 606 | + _selectView.layer.borderWidth = 0.5; | ||
| 607 | + } | ||
| 608 | + return _selectView; | ||
| 609 | +} | ||
| 610 | +-(UIView *)selectCenterView | ||
| 611 | +{ | ||
| 612 | + if (!_selectCenterView) { | ||
| 613 | + _selectCenterView = [[UIView alloc] init]; | ||
| 614 | + _selectCenterView.backgroundColor = UIColorHex(#CD0302); | ||
| 615 | + _selectCenterView.layer.masksToBounds = YES; | ||
| 616 | + _selectCenterView.layer.cornerRadius = 5; | ||
| 617 | + _selectCenterView.hidden = YES; | ||
| 618 | + } | ||
| 619 | + return _selectCenterView; | ||
| 620 | +} | ||
| 621 | +-(UIButton *)selectBtn | ||
| 622 | +{ | ||
| 623 | + if (!_selectBtn) { | ||
| 624 | + _selectBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 625 | + _selectBtn.backgroundColor = [UIColor clearColor]; | ||
| 626 | + [_selectBtn addTarget:self action:@selector(selectMothodAction:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 627 | + | ||
| 628 | + } | ||
| 629 | + return _selectBtn; | ||
| 630 | +} | ||
| 631 | +- (MBProgressHUD *)progressHud { | ||
| 632 | + if (!_progressHud) { | ||
| 633 | + _progressHud= [MBProgressHUD showHUDAddedTo:[UIApplication sharedApplication].keyWindow animated:YES]; | ||
| 634 | + _progressHud.mode = MBProgressHUDModeDeterminate; | ||
| 635 | + _progressHud.animationType = MBProgressHUDAnimationZoomIn; | ||
| 636 | + _progressHud.bezelView.backgroundColor = [UIColor blackColor]; | ||
| 637 | + } | ||
| 638 | + return _progressHud; | ||
| 639 | +} | ||
| 640 | +@end |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntInformViewController.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntInformViewController.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntInformViewController.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/3. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.h> | ||
| 9 | + | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +@interface CNLiveCommuntInformViewController : CNCommonTableViewController | ||
| 13 | + | ||
| 14 | +/// 初始化报修界面 | ||
| 15 | +/// @param nbhdId 小区id | ||
| 16 | +- (instancetype)initWithNBhdId:(NSString *)nbhdId; | ||
| 17 | +@end | ||
| 18 | + | ||
| 19 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntInformViewController.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntInformViewController.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntInformViewController.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/3. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntInformViewController.h" | ||
| 9 | + | ||
| 10 | +@interface CNLiveCommuntInformViewController ()<UITableViewDelegate,UITableViewDataSource,CNLiveCommuntSubInputTableViewDelegate,TZImagePickerControllerDelegate,UINavigationControllerDelegate,UIImagePickerControllerDelegate> | ||
| 11 | +@property (nonatomic, strong) NSMutableArray * dataSource; | ||
| 12 | +@property (nonatomic, strong) NSMutableArray * dataArray; | ||
| 13 | +@property (nonatomic, strong) NSMutableArray * imageArray; | ||
| 14 | +@property (nonatomic, strong) NSMutableArray * assetArray; | ||
| 15 | + | ||
| 16 | +@property (nonatomic, strong) NSMutableArray * cameraArray; | ||
| 17 | +@property (nonatomic, strong) NSMutableArray * cameraAssetArray; | ||
| 18 | +@property (nonatomic, strong) NSMutableArray * photoArray; | ||
| 19 | +@property (nonatomic, strong) NSMutableArray * photoAssetArray; | ||
| 20 | +@property (nonatomic, strong) NSMutableArray * videoArray; | ||
| 21 | +@property (nonatomic, strong) NSMutableArray * videoAssetArray; | ||
| 22 | + | ||
| 23 | +@property (nonatomic, strong) CNLiveCommuntSubAlertTableView * typeView; | ||
| 24 | +@property (nonatomic, strong) CNLiveCommuntSubAlertTableView * dateView; | ||
| 25 | +@property (nonatomic, copy) NSString *project; | ||
| 26 | +@property (nonatomic, copy) NSString *timeString; | ||
| 27 | +@property (nonatomic, copy) NSString *nbhdId; | ||
| 28 | +@end | ||
| 29 | + | ||
| 30 | +@implementation CNLiveCommuntInformViewController | ||
| 31 | +- (instancetype)initWithNBhdId:(NSString *)nbhdId | ||
| 32 | +{ | ||
| 33 | + self = [super init]; | ||
| 34 | + if (self) { | ||
| 35 | + _nbhdId = nbhdId; | ||
| 36 | + } | ||
| 37 | + return self; | ||
| 38 | +} | ||
| 39 | +- (void)viewDidLoad { | ||
| 40 | + [super viewDidLoad]; | ||
| 41 | + // Do any additional setup after loading the view. | ||
| 42 | + self.view.backgroundColor = [UIColor whiteColor]; | ||
| 43 | + self.title = @"填写信息"; | ||
| 44 | + | ||
| 45 | + self.imageArray = [[NSMutableArray alloc] init]; | ||
| 46 | + self.assetArray = [[NSMutableArray alloc] init]; | ||
| 47 | + | ||
| 48 | + self.cameraArray = [[NSMutableArray alloc] init]; | ||
| 49 | + self.photoArray = [[NSMutableArray alloc] init]; | ||
| 50 | + self.videoArray = [[NSMutableArray alloc] init]; | ||
| 51 | + self.cameraAssetArray = [[NSMutableArray alloc] init]; | ||
| 52 | + self.photoAssetArray = [[NSMutableArray alloc] init]; | ||
| 53 | + self.videoAssetArray = [[NSMutableArray alloc] init]; | ||
| 54 | + UIButton * rightBtn = [UIButton buttonWithType:UIButtonTypeSystem]; | ||
| 55 | + [rightBtn setTitle:@"报修记录" forState:UIControlStateNormal]; | ||
| 56 | + [rightBtn setTitleColor:UIColorHex(#F97723) forState:UIControlStateNormal]; | ||
| 57 | + rightBtn.titleLabel.font = [UIFont systemFontOfSize:12]; | ||
| 58 | + [rightBtn addTarget:self action:@selector(rightMothodAction) forControlEvents:UIControlEventTouchUpInside]; | ||
| 59 | + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn]; | ||
| 60 | + | ||
| 61 | + weakself | ||
| 62 | + [QMUITips showLoadingInView:self.view]; | ||
| 63 | + self.dataArray = [[NSMutableArray alloc] init]; | ||
| 64 | + [CNLiveCommuntViewModel requestWithCommuntyHomeMaintenForNBHdId:@"0" CompleterBlock:^(NSArray * _Nonnull dataArray) { | ||
| 65 | + [QMUITips hideAllTipsInView:weakSelf.view]; | ||
| 66 | + [weakSelf.dataArray addObjectsFromArray:dataArray]; | ||
| 67 | + }]; | ||
| 68 | +} | ||
| 69 | +-(void)initTableView | ||
| 70 | +{ | ||
| 71 | + [super initTableView]; | ||
| 72 | + self.tableView.delegate = self; | ||
| 73 | + self.tableView.dataSource = self; | ||
| 74 | + self.tableView.tableFooterView = [[UIView alloc] init]; | ||
| 75 | + self.tableView.backgroundColor = [UIColor whiteColor]; | ||
| 76 | + self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; | ||
| 77 | + self.tableView.tableFooterView = [self setTableViewFooterView]; | ||
| 78 | +} | ||
| 79 | +-(void)layoutTableView | ||
| 80 | +{ | ||
| 81 | + [super layoutTableView]; | ||
| 82 | + self.tableView.frame = CGRectMake(0, kNavigationBarHeight, kScreenWidth, kScreenHeight - kNavigationBarHeight - kVerticalTopHeight); | ||
| 83 | +} | ||
| 84 | +-(void)rightMothodAction | ||
| 85 | +{ | ||
| 86 | + NSLog(@"报修记录"); | ||
| 87 | +} | ||
| 88 | +-(NSMutableArray *)dataSource | ||
| 89 | +{ | ||
| 90 | + if (!_dataSource) { | ||
| 91 | + _dataSource = [[NSMutableArray alloc] initWithArray:@[ | ||
| 92 | + @{@"name":@"联系人",@"placeholder":@"请输入姓名",@"isClick":@NO,@"isTextField":@YES,@"isTextView":@NO,@"isImage":@NO,@"isChick":@NO}, | ||
| 93 | + @{@"name":@"联系地址",@"placeholder":@"请输入联系地址",@"isClick":@NO,@"isTextField":@YES,@"isTextView":@NO,@"isImage":@NO,@"isChick":@NO}, | ||
| 94 | + @{@"name":@"联系电话",@"placeholder":@"请输入联系电话",@"isClick":@NO,@"isTextField":@YES,@"isTextView":@NO,@"isImage":@NO,@"isChick":@NO}, | ||
| 95 | + @{@"name":@"报修项目",@"placeholder":@"请输入报修项目",@"isClick":@YES,@"isTextField":@NO,@"isTextView":@NO,@"isImage":@NO,@"isChick":@NO}, | ||
| 96 | + @{@"name":@"上门时间",@"placeholder":@"请输入上门时间",@"isClick":@YES,@"isTextField":@NO,@"isTextView":@NO,@"isImage":@NO,@"isChick":@NO}, | ||
| 97 | + @{@"name":@"问题描述",@"placeholder":@"您遇到什么问题,请留言",@"isClick":@NO,@"isTextField":@NO,@"isTextView":@YES,@"isImage":@NO,@"isChick":@NO}, | ||
| 98 | +// @{@"name":@"",@"placeholder":@"",@"isClick":@NO,@"isTextField":@NO,@"isTextView":@NO,@"isImage":@YES,@"isChick":@NO}, | ||
| 99 | + ]]; | ||
| 100 | + } | ||
| 101 | + return _dataSource; | ||
| 102 | +} | ||
| 103 | +-(UIView *)setTableViewFooterView | ||
| 104 | +{ | ||
| 105 | + UIView * footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 90)]; | ||
| 106 | + footerView.backgroundColor = [UIColor whiteColor]; | ||
| 107 | + | ||
| 108 | + YYLabel * phoneLabel = [[YYLabel alloc] initWithFrame:CGRectMake(0, 5, kScreenWidth, 20)]; | ||
| 109 | + phoneLabel.textColor = UIColorHex(#B4B4B4); | ||
| 110 | + phoneLabel.textAlignment = NSTextAlignmentCenter; | ||
| 111 | + phoneLabel.textVerticalAlignment = YYTextVerticalAlignmentCenter; | ||
| 112 | + phoneLabel.numberOfLines = 0; | ||
| 113 | + phoneLabel.backgroundColor = [UIColor whiteColor]; | ||
| 114 | + | ||
| 115 | + NSString * string = @"您也可以拨打物业电话 400-9001933"; | ||
| 116 | + NSMutableAttributedString *textAttributedString = [[NSMutableAttributedString alloc] initWithString:string]; | ||
| 117 | + textAttributedString.yy_font = [UIFont systemFontOfSize:10]; | ||
| 118 | + textAttributedString.yy_color = UIColorHex(#B4B4B4); | ||
| 119 | + textAttributedString.yy_alignment = NSTextAlignmentCenter; | ||
| 120 | + [textAttributedString yy_setTextHighlightRange:[string rangeOfString:@"400-9001933"] | ||
| 121 | + color:[UIColor qmui_colorWithHexString:@"0091FF"] | ||
| 122 | + backgroundColor:[UIColor qmui_colorWithHexString:@"0091FF"] | ||
| 123 | + tapAction:^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect){ | ||
| 124 | + NSLog(@"点击电话了"); | ||
| 125 | + }]; | ||
| 126 | + phoneLabel.attributedText = textAttributedString; | ||
| 127 | + [footerView addSubview:phoneLabel]; | ||
| 128 | + | ||
| 129 | + UILabel * lineLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 30, kScreenWidth - 20, 0.5)]; | ||
| 130 | + lineLabel.backgroundColor = UIColorHex(#E6E6E6); | ||
| 131 | + [footerView addSubview:lineLabel]; | ||
| 132 | + | ||
| 133 | + UIButton * submitBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 134 | + submitBtn.backgroundColor = UIColorHex(#CD0302); | ||
| 135 | + submitBtn.frame = CGRectMake(10, 40, kScreenWidth - 20, 40); | ||
| 136 | + submitBtn.layer.cornerRadius = 20; | ||
| 137 | + submitBtn.layer.masksToBounds = YES; | ||
| 138 | + [submitBtn setTitle:@"提交" forState:UIControlStateNormal]; | ||
| 139 | + submitBtn.titleLabel.font = [UIFont systemFontOfSize:16]; | ||
| 140 | + submitBtn.titleLabel.font = [UIFont boldSystemFontOfSize:16]; | ||
| 141 | + [submitBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | ||
| 142 | + [submitBtn addTarget:self action:@selector(submitRequestAction:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 143 | + [footerView addSubview:submitBtn]; | ||
| 144 | + return footerView; | ||
| 145 | +} | ||
| 146 | +-(void)submitRequestAction:(UIButton *)button | ||
| 147 | +{ | ||
| 148 | + NSMutableDictionary * paramDict = [[NSMutableDictionary alloc] init]; | ||
| 149 | + for (int i = 0; i < 6; i ++) { | ||
| 150 | + CNLiveCommuntSubInputTableView * userCell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:i inSection:0]]; | ||
| 151 | + if (i == 0) [paramDict addString:[userCell.contentField.text isNotBlank]?userCell.contentField.text:@"" forKey:@"userName"]; | ||
| 152 | + if (i == 1) [paramDict addString:[userCell.contentField.text isNotBlank]?userCell.contentField.text:@"" forKey:@"address"]; | ||
| 153 | + if (i == 2) { | ||
| 154 | + NSString * phone = [userCell.contentField.text isNotBlank]?userCell.contentField.text:@""; | ||
| 155 | + if ([phone isNotBlank]) { | ||
| 156 | + [paramDict addString:phone forKey:@"phone"]; | ||
| 157 | + }else{ | ||
| 158 | + [QMUITips showWithText:@"联系电话填写错误"]; | ||
| 159 | + return; | ||
| 160 | + } | ||
| 161 | + } | ||
| 162 | + if (i == 3) [paramDict addString:[self.project isNotBlank]?self.project:@"" forKey:@"repairProject"]; | ||
| 163 | + if (i == 4) { | ||
| 164 | + NSString * timeString = [self.timeString isNotBlank]?self.timeString:@""; | ||
| 165 | + NSString * dayString = [timeString componentsSeparatedByString:@" "].firstObject; | ||
| 166 | + NSString * startString = [[timeString componentsSeparatedByString:@" "].lastObject componentsSeparatedByString:@"~"].firstObject; | ||
| 167 | + NSString * endString = [[timeString componentsSeparatedByString:@" "].lastObject componentsSeparatedByString:@"~"].lastObject; | ||
| 168 | + NSString * temp_start_time = [NSString stringWithFormat:@"%@ %@:00:00",dayString,startString]; | ||
| 169 | + NSString * temp_end_time = [NSString stringWithFormat:@"%@ %@:00:00",dayString,endString]; | ||
| 170 | + [paramDict addString:[temp_start_time isNotBlank]?temp_start_time:@"" forKey:@"beginTime"]; | ||
| 171 | + [paramDict addString:[temp_end_time isNotBlank]?temp_end_time:@"" forKey:@"endTime"]; | ||
| 172 | + } | ||
| 173 | + if (i == 5) [paramDict addString:[userCell.descTextView.text isNotBlank]?userCell.descTextView.text:@"" forKey:@"remark"]; | ||
| 174 | + } | ||
| 175 | + if ([[paramDict allValues] containsObject:@""]) { | ||
| 176 | + NSInteger index = [[paramDict allValues] indexOfObject:@""]; | ||
| 177 | + NSString * key = [[paramDict allKeys] objectAtIndex:index]; | ||
| 178 | + if ([key isEqualToString:@"userName"]) [QMUITips showWithText:@"联系人不能为空"]; | ||
| 179 | + if ([key isEqualToString:@"address"]) [QMUITips showWithText:@"联系地址不能为空"]; | ||
| 180 | + if ([key isEqualToString:@"phone"]) [QMUITips showWithText:@"联系电话不能为空"]; | ||
| 181 | + if ([key isEqualToString:@"repairProject"]) [QMUITips showWithText:@"报修项目不能为空"]; | ||
| 182 | + if ([key isEqualToString:@"beginTime"]) [QMUITips showWithText:@"上门时间不能为空"]; | ||
| 183 | + if ([key isEqualToString:@"endTime"]) [QMUITips showWithText:@"上门时间不能为空"]; | ||
| 184 | + if ([key isEqualToString:@"remark"]) [QMUITips showWithText:@"问题描述不能为空"]; | ||
| 185 | + return; | ||
| 186 | + } | ||
| 187 | + __weak typeof(self) weakSelf = self; | ||
| 188 | + [CNLiveCommuntViewModel requestWithCommuntyHomeMaintenPushWithParamDict:paramDict nbhdId:self.nbhdId CompleterBlock:^(CNLiveCommuntyActivityMaintainsCreateModel * _Nonnull createModel) { | ||
| 189 | + if (createModel) { | ||
| 190 | + CNLiveCommuntyOrderViewController * vc = [[CNLiveCommuntyOrderViewController alloc] initWithShowType:CNLiveCommuntyOrderShowTypeListYetOrder CreateModel:createModel]; | ||
| 191 | + [weakSelf.navigationController pushViewController:vc animated:YES]; | ||
| 192 | + } | ||
| 193 | + }]; | ||
| 194 | +} | ||
| 195 | +#pragma mark = | ||
| 196 | +-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView | ||
| 197 | +{ | ||
| 198 | + return 1; | ||
| 199 | +} | ||
| 200 | +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | ||
| 201 | +{ | ||
| 202 | + return self.dataSource.count; | ||
| 203 | +} | ||
| 204 | +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 205 | +{ | ||
| 206 | + CNLiveCommuntSubInputTableView * inpView = [CNLiveCommuntSubInputTableView setTableView:tableView SubDict:self.dataSource[indexPath.row] indexs:indexPath.row UserInfo:@{}]; | ||
| 207 | + inpView.delegate = self; | ||
| 208 | + inpView.imageArray = self.imageArray; | ||
| 209 | + return inpView; | ||
| 210 | +} | ||
| 211 | +-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 212 | +{ | ||
| 213 | + if (indexPath.row < 5) return 50.0f; | ||
| 214 | + if (indexPath.row == 5) return 150.0f; | ||
| 215 | + if (indexPath.row == 6) return 140.0f; | ||
| 216 | + return 0.001f; | ||
| 217 | +} | ||
| 218 | +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 219 | +{ | ||
| 220 | + MJWeakSelf | ||
| 221 | + if (indexPath.row == 3) { | ||
| 222 | + [CNLiveCommuntSubAlertTableView showAlertViewDataSource:self.dataArray isTime:NO CompleterBlock:^(NSString * _Nonnull idStr, NSString * _Nonnull content) { | ||
| 223 | + CNLiveCommuntSubInputTableView * inpView = [tableView cellForRowAtIndexPath:indexPath]; | ||
| 224 | + inpView.moreButton.titleLabel.font = [UIFont systemFontOfSize:15]; | ||
| 225 | + inpView.moreButton.titleLabel.font = [UIFont boldSystemFontOfSize:15]; | ||
| 226 | + [inpView.moreButton setTitle:content forState:UIControlStateNormal]; | ||
| 227 | + [inpView.moreButton setTitleColor:UIColorHex(#333333) forState:UIControlStateNormal]; | ||
| 228 | + weakSelf.project = idStr; | ||
| 229 | + }]; | ||
| 230 | + } | ||
| 231 | + if (indexPath.row == 4) { | ||
| 232 | + [CNLiveCommuntViewModel requestWithCommuntyHomeMaintenForTimeInterval:7 CompleterBlock:^(NSArray * _Nonnull dataArray) { | ||
| 233 | + [CNLiveCommuntSubAlertTableView showAlertViewDataSource:dataArray isTime:YES CompleterBlock:^(NSString * _Nonnull idStr, NSString * _Nonnull content) { | ||
| 234 | + CNLiveCommuntSubInputTableView * inpView = [tableView cellForRowAtIndexPath:indexPath]; | ||
| 235 | + inpView.moreButton.titleLabel.font = [UIFont systemFontOfSize:15]; | ||
| 236 | + inpView.moreButton.titleLabel.font = [UIFont boldSystemFontOfSize:15]; | ||
| 237 | + [inpView.moreButton setTitle:content forState:UIControlStateNormal]; | ||
| 238 | + [inpView.moreButton setTitleColor:UIColorHex(#333333) forState:UIControlStateNormal]; | ||
| 239 | + weakSelf.timeString = content; | ||
| 240 | + }]; | ||
| 241 | + }]; | ||
| 242 | + } | ||
| 243 | +} | ||
| 244 | + | ||
| 245 | +#pragma mark = CNLiveCommuntSubInputTableViewDelegate 下面是选择图片视频逻辑 | ||
| 246 | +-(void)setCommuntSubInputTableViewWithDelectForImage:(UIImage *)image | ||
| 247 | +{ | ||
| 248 | + if ([self.imageArray containsObject:image]) { | ||
| 249 | + [self.assetArray removeObjectAtIndex:[self.imageArray indexOfObject:image]]; | ||
| 250 | + [self.imageArray removeObject:image]; | ||
| 251 | + [self.tableView reloadData]; | ||
| 252 | + } | ||
| 253 | +} | ||
| 254 | +/// 点击选择图片视频 | ||
| 255 | +/// @param index 点击的位置 | ||
| 256 | +-(void)setCommuntSubInputTableViewWithSelectForIndex:(NSInteger)index | ||
| 257 | +{ | ||
| 258 | + __weak typeof(self) weakSelf = self; | ||
| 259 | + [self.view createAlertViewTitleArray:@[@"拍摄",@"从手机相册选择"] subTitleArr:@[@"",@""] textColor:UIColorMake(40, 40, 40) subTitleColor:UIColorMake(152, 152, 152) font:UIFontMake(15) subFont:UIFontMake(12) actionBlock:^(UIButton *button, NSInteger didRow) { | ||
| 260 | + switch (didRow) { | ||
| 261 | + case 0: | ||
| 262 | + { | ||
| 263 | + if (IOS14_SDK_ALLOWED) { | ||
| 264 | + [weakSelf requestCNLiveALAssetsLibraryAuthorizationWithCompletion:^(BOOL isAuth) { | ||
| 265 | + if (isAuth) { | ||
| 266 | + dispatch_async_on_main_queue(^{ | ||
| 267 | + [weakSelf takeToXFPhoto:index]; | ||
| 268 | + }); | ||
| 269 | + } | ||
| 270 | + }]; | ||
| 271 | + }else{ | ||
| 272 | + [weakSelf takeToXFPhoto:index]; | ||
| 273 | + } | ||
| 274 | + } | ||
| 275 | + break; | ||
| 276 | + case 1: | ||
| 277 | + { | ||
| 278 | + [self pushTZImagePickerController:index]; | ||
| 279 | + } | ||
| 280 | + break; | ||
| 281 | + default: | ||
| 282 | + break; | ||
| 283 | + } | ||
| 284 | + }]; | ||
| 285 | +} | ||
| 286 | +-(void)requestCNLiveALAssetsLibraryAuthorizationWithCompletion:(void(^)(BOOL isAuth))requestAssetsLibraryAuthCompletion | ||
| 287 | +{ | ||
| 288 | + PHAuthorizationStatus authStatus = [PHPhotoLibrary authorizationStatus]; | ||
| 289 | + if (authStatus != PHAuthorizationStatusAuthorized) {//未授权 | ||
| 290 | + [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) { | ||
| 291 | + if (status != PHAuthorizationStatusAuthorized) {//已授权 | ||
| 292 | + if (requestAssetsLibraryAuthCompletion) { | ||
| 293 | + requestAssetsLibraryAuthCompletion(NO); | ||
| 294 | + } | ||
| 295 | + } else { | ||
| 296 | + if (requestAssetsLibraryAuthCompletion) { | ||
| 297 | + requestAssetsLibraryAuthCompletion(YES); | ||
| 298 | + } | ||
| 299 | + } | ||
| 300 | + }]; | ||
| 301 | + } else { | ||
| 302 | + if (requestAssetsLibraryAuthCompletion) { | ||
| 303 | + requestAssetsLibraryAuthCompletion(YES); | ||
| 304 | + } | ||
| 305 | + } | ||
| 306 | +} | ||
| 307 | +- (void)takeToXFPhoto:(NSInteger)index | ||
| 308 | +{ | ||
| 309 | + __weak typeof(self) weakSelf = self; | ||
| 310 | + XFCameraController *cameraController = [[XFCameraController alloc] init]; | ||
| 311 | + cameraController.isCanShootVideo = YES; | ||
| 312 | +// cameraController.outPutPath = [CNLiveBusinessTools chatFilePathByUserId:[IMAPlatform sharedInstance].host.userId]; | ||
| 313 | + cameraController.modalPresentationStyle = UIModalPresentationFullScreen; | ||
| 314 | + __weak XFCameraController *weakCameraController = cameraController; | ||
| 315 | + cameraController.zxshootCompletionBlock = ^(PHAsset *asset, NSURL *videoUrl, CGFloat videoTimeLength, UIImage *thumbnailImage, NSError *error) { | ||
| 316 | + if (!error) { | ||
| 317 | + dispatch_async_on_main_queue(^{ | ||
| 318 | + [weakCameraController dismissViewControllerAnimated:YES completion:^{ | ||
| 319 | + [weakSelf.videoArray removeAllObjects]; | ||
| 320 | + [weakSelf.videoAssetArray removeAllObjects]; | ||
| 321 | + [weakSelf.videoArray addObject:thumbnailImage]; | ||
| 322 | + [weakSelf.videoAssetArray addObject:asset]; | ||
| 323 | + [weakSelf.tableView reloadData]; | ||
| 324 | + }]; | ||
| 325 | + }); | ||
| 326 | + } | ||
| 327 | + }; | ||
| 328 | + cameraController.takePhotosCompletionBlock = ^(UIImage *image, NSError *error) { | ||
| 329 | + if (!error) { | ||
| 330 | + NSMutableArray *imageIds = [NSMutableArray array]; | ||
| 331 | + [weakCameraController dismissViewControllerAnimated:YES completion:^{ | ||
| 332 | + [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{ | ||
| 333 | + //写入图片到相册 | ||
| 334 | + PHAssetChangeRequest *req = [PHAssetChangeRequest creationRequestForAssetFromImage:image]; | ||
| 335 | + //记录本地标识,等待完成后取到相册中的图片对象 | ||
| 336 | + [imageIds addObject:req.placeholderForCreatedAsset.localIdentifier]; | ||
| 337 | + | ||
| 338 | + } completionHandler:^(BOOL success, NSError * _Nullable error) { | ||
| 339 | + if (success) { | ||
| 340 | + PHFetchResult *result = [PHAsset fetchAssetsWithLocalIdentifiers:imageIds options:nil]; | ||
| 341 | + [result enumerateObjectsUsingBlock:^(PHAsset * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { | ||
| 342 | + dispatch_async_on_main_queue(^{ | ||
| 343 | + [weakCameraController dismissViewControllerAnimated:YES completion:^{ | ||
| 344 | + [weakSelf.imageArray removeObject:weakSelf.cameraArray.firstObject]; | ||
| 345 | + [weakSelf.assetArray removeObject:weakSelf.cameraAssetArray.firstObject]; | ||
| 346 | + | ||
| 347 | + [weakSelf.cameraAssetArray removeAllObjects]; | ||
| 348 | + [weakSelf.cameraArray removeAllObjects]; | ||
| 349 | + [weakSelf.cameraAssetArray addObject:obj]; | ||
| 350 | + [weakSelf.cameraArray addObject:image]; | ||
| 351 | + | ||
| 352 | + [weakSelf.imageArray addObject:image]; | ||
| 353 | + [weakSelf.assetArray addObject:obj]; | ||
| 354 | + [weakSelf.tableView reloadData]; | ||
| 355 | + }]; | ||
| 356 | + }); | ||
| 357 | + }]; | ||
| 358 | + } | ||
| 359 | + }]; | ||
| 360 | + }]; | ||
| 361 | + } | ||
| 362 | + }; | ||
| 363 | + [self presentViewController:cameraController animated:YES completion:NULL]; | ||
| 364 | +} | ||
| 365 | +- (void)pushTZImagePickerController:(NSInteger)index | ||
| 366 | +{ | ||
| 367 | + CNImagePickerController *imagePickerVc = [[CNImagePickerController alloc] initWithMaxImagesCount:3 columnNumber:3 delegate:self pushPhotoPickerVc:YES]; | ||
| 368 | + imagePickerVc.modalPresentationStyle = UIModalPresentationFullScreen; | ||
| 369 | + [imagePickerVc configTZImagePicker];//配置 | ||
| 370 | + imagePickerVc.isSelectOriginalPhoto = NO;//是否选择原图 | ||
| 371 | + // 1.设置目前已经选中的图片数组 | ||
| 372 | + imagePickerVc.selectedAssets = self.assetArray; | ||
| 373 | + imagePickerVc.maxEditVideoTime = 60;//编辑长度 | ||
| 374 | + imagePickerVc.maxVideoDuration = 120;//编辑视频最大长度 | ||
| 375 | + // 3. Set allow picking video & photo & originalPhoto or not | ||
| 376 | + // 3. 设置是否可以选择视频/图片/原图 | ||
| 377 | + imagePickerVc.allowPickingMultipleVideo = NO; | ||
| 378 | + /// 5. Single selection mode, valid when maxImagesCount = 1 | ||
| 379 | + /// 5. 单选模式,maxImagesCount为1时才生效 | ||
| 380 | + // 设置竖屏下的裁剪尺寸 | ||
| 381 | + NSInteger left = 30; | ||
| 382 | + NSInteger widthHeight = KScreenWidth - 2 * left; | ||
| 383 | + NSInteger top = (KScreenHeight - widthHeight) / 2; | ||
| 384 | + imagePickerVc.cropRect = CGRectMake(left, top, widthHeight, widthHeight); | ||
| 385 | + [self presentViewController:imagePickerVc animated:YES completion:NULL]; | ||
| 386 | +} | ||
| 387 | +- (void)imagePickerController:(TZImagePickerController *)picker didFinishPickingPhotos:(NSArray<UIImage *> *)photos sourceAssets:(NSArray *)assets isSelectOriginalPhoto:(BOOL)isSelectOriginalPhoto | ||
| 388 | +{ | ||
| 389 | + [self.imageArray removeAllObjects]; | ||
| 390 | + [self.assetArray removeAllObjects]; | ||
| 391 | + [self.imageArray addObjectsFromArray:photos]; | ||
| 392 | + [self.assetArray addObjectsFromArray:assets]; | ||
| 393 | + | ||
| 394 | + [self.tableView reloadData]; | ||
| 395 | +} | ||
| 396 | +@end |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntListViewController.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntListViewController.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntListViewController.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/1. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.h> | ||
| 9 | + | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | + | ||
| 13 | + | ||
| 14 | +@interface CNLiveCommuntListViewController : CNCommonTableViewController<JXCategoryListContentViewDelegate> | ||
| 15 | + | ||
| 16 | +/// 初始化界面显示 | ||
| 17 | +/// @param showType 显示类型 | ||
| 18 | +/// @param nbhdId 小区id | ||
| 19 | +- (instancetype)initWithShowType:(CNLiveCommuntListShowType)showType Index:(NSInteger)index NBhdId:(NSString *)nbhdId; | ||
| 20 | + | ||
| 21 | +/// 初始化界面显示 | ||
| 22 | +/// @param nbhdId 小区id | ||
| 23 | +- (instancetype)initWithShowType:(CNLiveCommuntListShowType)showType NBhdId:(NSString *)nbhdId; | ||
| 24 | +@end | ||
| 25 | + | ||
| 26 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntListViewController.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntListViewController.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntListViewController.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/1. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntListViewController.h" | ||
| 9 | + | ||
| 10 | +#import "CNLiveCommuntSignUpViewController.h" | ||
| 11 | +@interface CNLiveCommuntListViewController ()<DZNEmptyDataSetSource,DZNEmptyDataSetDelegate> | ||
| 12 | +@property (nonatomic, assign) CNLiveCommuntListShowType showType; | ||
| 13 | +@property (nonatomic, strong) CNLiveRefreshFooter * footerView; | ||
| 14 | +@property (nonatomic, strong) NSMutableArray * dataArray; | ||
| 15 | +@property (nonatomic, copy) NSString * nbhdId; | ||
| 16 | +@property (nonatomic, assign) NSInteger index; | ||
| 17 | +@property (nonatomic, assign) NSInteger page; | ||
| 18 | +@end | ||
| 19 | + | ||
| 20 | +@implementation CNLiveCommuntListViewController | ||
| 21 | + | ||
| 22 | +- (instancetype)initWithShowType:(CNLiveCommuntListShowType)showType Index:(NSInteger)index NBhdId:(NSString *)nbhdId | ||
| 23 | +{ | ||
| 24 | + self = [super init]; | ||
| 25 | + if (self) { | ||
| 26 | + _nbhdId = nbhdId; | ||
| 27 | + _index = index; | ||
| 28 | + _showType = showType; | ||
| 29 | + } | ||
| 30 | + return self; | ||
| 31 | +} | ||
| 32 | +/// 初始化界面显示 | ||
| 33 | +/// @param nbhdId 小区id | ||
| 34 | +- (instancetype)initWithShowType:(CNLiveCommuntListShowType)showType NBhdId:(NSString *)nbhdId | ||
| 35 | +{ | ||
| 36 | + self = [super init]; | ||
| 37 | + if (self) { | ||
| 38 | + _nbhdId = nbhdId; | ||
| 39 | + _page = 1; | ||
| 40 | + _showType = showType; | ||
| 41 | + } | ||
| 42 | + return self; | ||
| 43 | +} | ||
| 44 | +- (void)viewDidLoad { | ||
| 45 | + [super viewDidLoad]; | ||
| 46 | + // Do any additional setup after loading the view. | ||
| 47 | + self.view.backgroundColor = UIColorHex(#F9F9F9); | ||
| 48 | + self.dataArray = [[NSMutableArray alloc] init]; | ||
| 49 | + [self loadDataSourceWithPage:1 nbhdId:self.nbhdId index:self.index CompleterBlock:NULL]; | ||
| 50 | + [self addRefreshMainView]; | ||
| 51 | +} | ||
| 52 | + | ||
| 53 | +-(void)addRefreshMainView | ||
| 54 | +{ | ||
| 55 | + __weak typeof(self) weakSelf = self; | ||
| 56 | + self.tableView.mj_header = [CNLiveRefreshHeader headerWithRefreshingBlock:^{ | ||
| 57 | + weakSelf.page = 1; | ||
| 58 | + [weakSelf loadDataSourceWithPage:1 nbhdId:weakSelf.nbhdId index:weakSelf.index CompleterBlock:NULL]; | ||
| 59 | + }]; | ||
| 60 | + self.footerView = [CNLiveRefreshFooter footerWithRefreshingBlock:^{ | ||
| 61 | + weakSelf.page ++; | ||
| 62 | + [weakSelf loadDataSourceWithPage:weakSelf.page nbhdId:weakSelf.nbhdId index:weakSelf.index CompleterBlock:NULL]; | ||
| 63 | + }]; | ||
| 64 | +} | ||
| 65 | + | ||
| 66 | +-(void)loadDataSourceWithPage:(NSInteger)page nbhdId:(NSString *)nbhdId index:(NSInteger)index CompleterBlock:(void(^)(void))completerBlock | ||
| 67 | +{ | ||
| 68 | + __weak typeof(self) weakSelf = self; | ||
| 69 | + [CNLiveCommuntViewModel requestWithCommuntyHomeActivityForNBHdId:nbhdId ShowType:self.showType Index:index Page:page completerBlock:^(NSArray * _Nonnull dataArray, BOOL isLastPage) { | ||
| 70 | + if (dataArray.count > 0 && page == 1 && !weakSelf.tableView.mj_footer) weakSelf.tableView.mj_footer = weakSelf.footerView; | ||
| 71 | + if (page == 1) [weakSelf.dataArray removeAllObjects]; | ||
| 72 | + [weakSelf.dataArray addObjectsFromArray:dataArray]; | ||
| 73 | + [weakSelf.tableView reloadData]; | ||
| 74 | + [weakSelf.tableView.mj_header endRefreshing]; | ||
| 75 | + [weakSelf.tableView.mj_footer endRefreshing]; | ||
| 76 | + if (isLastPage) [weakSelf.tableView.mj_footer endRefreshingWithNoMoreData]; | ||
| 77 | + }]; | ||
| 78 | +} | ||
| 79 | + | ||
| 80 | +- (void)initTableView | ||
| 81 | +{ | ||
| 82 | + [super initTableView]; | ||
| 83 | + self.tableView.delegate = self; | ||
| 84 | + self.tableView.dataSource = self; | ||
| 85 | + self.tableView.emptyDataSetSource = self; | ||
| 86 | + self.tableView.emptyDataSetDelegate = self; | ||
| 87 | + self.tableView.tableFooterView = [[UIView alloc] init]; | ||
| 88 | + self.tableView.backgroundColor = UIColorHex(#f9f9f9); | ||
| 89 | + self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; | ||
| 90 | +} | ||
| 91 | +-(void)layoutTableView | ||
| 92 | +{ | ||
| 93 | + [super layoutTableView]; | ||
| 94 | + __weak typeof(self) weakSelf = self; | ||
| 95 | + [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 96 | + make.top.mas_equalTo(weakSelf.view).offset(kNavigationBarHeight+44); | ||
| 97 | + make.left.right.bottom.mas_equalTo(weakSelf.view); | ||
| 98 | + }]; | ||
| 99 | +} | ||
| 100 | +#pragma mark - DZNEmptyDataSetSource Methods | ||
| 101 | +- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView | ||
| 102 | +{ | ||
| 103 | + NSString * string = @""; | ||
| 104 | + if (self.showType == CNLiveCommuntListShowTypeHome) string = @"暂无内容"; | ||
| 105 | + if (self.showType == CNLiveCommuntListShowTypeRecord) string = @"亲,您还没有活动记录哦~"; | ||
| 106 | + if (self.showType == CNLiveCommuntListShowTypeRepair) string = @"亲,您还没有报修记录哦~"; | ||
| 107 | + return [[NSAttributedString alloc] initWithString:string attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16]}]; | ||
| 108 | +} | ||
| 109 | +-(UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView | ||
| 110 | +{ | ||
| 111 | + return [CNLiveCommuntTools cCommunt_setImageWithName:@"c_community_content_empty"]; | ||
| 112 | +} | ||
| 113 | +- (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView | ||
| 114 | +{ | ||
| 115 | + return [UIColor whiteColor]; | ||
| 116 | +} | ||
| 117 | +- (NSAttributedString *)buttonTitleForEmptyDataSet:(UIScrollView *)scrollView forState:(UIControlState)state | ||
| 118 | +{ | ||
| 119 | + if (self.showType == CNLiveCommuntListShowTypeRepair) { | ||
| 120 | + return [[NSAttributedString alloc] initWithString:@"我要报修" attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16],NSForegroundColorAttributeName:UIColorHex(#CD0302)}]; | ||
| 121 | + }else{ | ||
| 122 | + return nil; | ||
| 123 | + } | ||
| 124 | +} | ||
| 125 | +- (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView | ||
| 126 | +{ | ||
| 127 | + return 0; | ||
| 128 | +} | ||
| 129 | + | ||
| 130 | +- (BOOL)emptyDataSetShouldDisplay:(UIScrollView *)scrollView | ||
| 131 | +{ | ||
| 132 | + return YES; | ||
| 133 | +} | ||
| 134 | + | ||
| 135 | +- (BOOL)emptyDataSetShouldAllowTouch:(UIScrollView *)scrollView | ||
| 136 | +{ | ||
| 137 | + return YES; | ||
| 138 | +} | ||
| 139 | + | ||
| 140 | +- (BOOL)emptyDataSetShouldAllowScroll:(UIScrollView *)scrollView | ||
| 141 | +{ | ||
| 142 | + return NO; | ||
| 143 | +} | ||
| 144 | +#pragma mark = | ||
| 145 | + | ||
| 146 | +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView | ||
| 147 | +{ | ||
| 148 | + return 1; | ||
| 149 | +} | ||
| 150 | + | ||
| 151 | +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | ||
| 152 | +{ | ||
| 153 | + return self.dataArray.count; | ||
| 154 | +} | ||
| 155 | + | ||
| 156 | +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 157 | +{ | ||
| 158 | + if (self.showType == CNLiveCommuntListShowTypeRecord) { | ||
| 159 | + CNLiveCommuntyActivityRecordListModel * recordModel = self.dataArray[indexPath.row]; | ||
| 160 | + return [CNLiveCommuntSubRecordTableView setTableView:tableView RecordModel:recordModel]; | ||
| 161 | + } | ||
| 162 | + if (self.showType == CNLiveCommuntListShowTypeHome) { | ||
| 163 | + CNLiveCommuntyActivityHomeListModel * listModel = self.dataArray[indexPath.row]; | ||
| 164 | + return [CNLiveCommuntSubHomeTableView setTableView:tableView ListModel:listModel]; | ||
| 165 | + } | ||
| 166 | + if (self.showType == CNLiveCommuntListShowTypeRepair) { | ||
| 167 | + CNLiveCommuntyActivityRepairListModel * repairModel = self.dataArray[indexPath.row]; | ||
| 168 | + return [CNLiveCommuntSubRepairTableView setTableView:tableView RepairModel:repairModel]; | ||
| 169 | + } | ||
| 170 | + return nil; | ||
| 171 | +} | ||
| 172 | + | ||
| 173 | +-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 174 | +{ | ||
| 175 | + if (self.showType == CNLiveCommuntListShowTypeRecord) { | ||
| 176 | + return 110.0; | ||
| 177 | + } | ||
| 178 | + if (self.showType == CNLiveCommuntListShowTypeHome) { | ||
| 179 | + return 190.0; | ||
| 180 | + } | ||
| 181 | + if (self.showType == CNLiveCommuntListShowTypeRepair) { | ||
| 182 | + CNLiveCommuntyActivityRepairListModel * repairModel = self.dataArray[indexPath.row]; | ||
| 183 | + return [repairModel.status isEqualToString:@"3"]?110.0:70.0; | ||
| 184 | + } | ||
| 185 | + return 0.001; | ||
| 186 | +} | ||
| 187 | + | ||
| 188 | +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 189 | +{ | ||
| 190 | + if (self.showType == CNLiveCommuntListShowTypeRepair) { | ||
| 191 | + CNLiveCommuntyActivityRepairListModel * repairModel = self.dataArray[indexPath.row]; | ||
| 192 | + if (self.index == 3) { | ||
| 193 | + CNLiveCommuntyOrderViewController * orderView = [[CNLiveCommuntyOrderViewController alloc] initWithShowType:CNLiveCommuntyOrderShowTypeListCompletOrder MaintenId:repairModel.idStr]; | ||
| 194 | + [self.navigationController pushViewController:orderView animated:YES]; | ||
| 195 | + }else if (self.index == 2) { | ||
| 196 | + CNLiveCommuntyOrderViewController * orderView = [[CNLiveCommuntyOrderViewController alloc] initWithShowType:CNLiveCommuntyOrderShowTypeListFailureOrder MaintenId:repairModel.idStr]; | ||
| 197 | + [self.navigationController pushViewController:orderView animated:YES]; | ||
| 198 | + }else { | ||
| 199 | + CNLiveCommuntyOrderViewController * orderView = [[CNLiveCommuntyOrderViewController alloc] initWithShowType:self.index MaintenId:repairModel.idStr]; | ||
| 200 | + [self.navigationController pushViewController:orderView animated:YES]; | ||
| 201 | + } | ||
| 202 | + } | ||
| 203 | + if (self.showType == CNLiveCommuntListShowTypeRepair) { | ||
| 204 | + NSLog(@"去活动详情"); | ||
| 205 | + } | ||
| 206 | + if (self.showType == CNLiveCommuntListShowTypeHome) { | ||
| 207 | + NSLog(@"去详情页Web页"); | ||
| 208 | + MJWeakSelf | ||
| 209 | + CNLiveCommuntyActivityHomeListModel * listModel = self.dataArray[indexPath.row]; | ||
| 210 | + [CNLiveCommuntViewModel requestWithCommuntyActivityDetailMentActivityId:listModel.idStr CompleterBlock:^(CNLiveCommuntyActivityDetailModel * _Nonnull detailModel) { | ||
| 211 | + NSDictionary * paramDict = @{@"id":detailModel.idStr,@"mobile":detailModel.mobile,@"unitPrice":detailModel.unitPrice,@"processDesc":detailModel.processDesc,@"name":detailModel.name}; | ||
| 212 | + CNLiveCommuntSignUpViewController * signUpView = [[CNLiveCommuntSignUpViewController alloc] initWithStyle:UITableViewStyleGrouped InfoDict:paramDict]; | ||
| 213 | + [weakSelf.navigationController pushViewController:signUpView animated:YES]; | ||
| 214 | + }]; | ||
| 215 | + } | ||
| 216 | +} | ||
| 217 | + | ||
| 218 | +- (UIView *)listView { | ||
| 219 | + return self.view; | ||
| 220 | +} | ||
| 221 | + | ||
| 222 | +@end |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntPartyViewController.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntPartyViewController.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntPartyViewController.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/1. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <DSBaseModule/DSBaseModule.h> | ||
| 9 | + | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +@interface CNLiveCommuntPartyViewController : DSBaseViewController | ||
| 13 | + | ||
| 14 | +@end | ||
| 15 | + | ||
| 16 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntPartyViewController.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntPartyViewController.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntPartyViewController.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/1. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntPartyViewController.h" | ||
| 9 | + | ||
| 10 | +@interface CNLiveCommuntPartyViewController () | ||
| 11 | + | ||
| 12 | +@end | ||
| 13 | + | ||
| 14 | +@implementation CNLiveCommuntPartyViewController | ||
| 15 | + | ||
| 16 | +- (void)viewDidLoad { | ||
| 17 | + [super viewDidLoad]; | ||
| 18 | + // Do any additional setup after loading the view. | ||
| 19 | +} | ||
| 20 | + | ||
| 21 | + | ||
| 22 | +@end |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntServiceViewController.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntServiceViewController.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntServiceViewController.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/1. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <DSBaseModule/DSBaseModule.h> | ||
| 9 | + | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +@interface CNLiveCommuntServiceViewController : DSBaseViewController | ||
| 13 | + | ||
| 14 | +@end | ||
| 15 | + | ||
| 16 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntServiceViewController.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntServiceViewController.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntServiceViewController.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/1. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntServiceViewController.h" | ||
| 9 | +#import "CNLiveCommuntyColGridViewLayout.h" | ||
| 10 | + | ||
| 11 | +#define kGNCOLGRIDVIEWID @"GNCOLGRIDVIEWID" | ||
| 12 | + | ||
| 13 | +@interface CNLiveCommuntServiceViewController ()<UICollectionViewDataSource, UICollectionViewDelegate> | ||
| 14 | +@property (nonatomic, strong) UICollectionView * collectionView; | ||
| 15 | + | ||
| 16 | +@end | ||
| 17 | + | ||
| 18 | +@implementation CNLiveCommuntServiceViewController | ||
| 19 | + | ||
| 20 | +- (void)viewDidLoad { | ||
| 21 | + [super viewDidLoad]; | ||
| 22 | + // Do any additional setup after loading the view. | ||
| 23 | + self.view.backgroundColor = [UIColor whiteColor]; | ||
| 24 | + [self initNav]; | ||
| 25 | + | ||
| 26 | +// [self.view addSubview:self.collectionView]; | ||
| 27 | +} | ||
| 28 | +-(void)initNav | ||
| 29 | +{ | ||
| 30 | + self.topNavView.backgroundColor = [UIColor whiteColor]; | ||
| 31 | + self.topLine.backgroundColor = [UIColor whiteColor]; | ||
| 32 | + | ||
| 33 | + DSNavButton * searchBtn = [[DSNavButton alloc] initWithImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_communit_back"]]; | ||
| 34 | + [searchBtn addTarget:self action:@selector(leftNavBtnAction) forControlEvents:UIControlEventTouchUpInside]; | ||
| 35 | + self.leftNavBtns = @[searchBtn]; | ||
| 36 | +} | ||
| 37 | +-(void)leftNavBtnAction | ||
| 38 | +{ | ||
| 39 | + [self.navigationController popViewControllerAnimated:YES]; | ||
| 40 | +} | ||
| 41 | +#pragma mark = | ||
| 42 | +//- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section | ||
| 43 | +//{ | ||
| 44 | +// | ||
| 45 | +//} | ||
| 46 | +#pragma mark = | ||
| 47 | +-(UICollectionView *)collectionView | ||
| 48 | +{ | ||
| 49 | + if (!_collectionView) { | ||
| 50 | + UICollectionViewFlowLayout * layout = [[UICollectionViewFlowLayout alloc] init]; | ||
| 51 | + layout.itemSize = CGSizeMake(SCREEN_WIDTH/4, SCREEN_WIDTH/4); | ||
| 52 | + _collectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:layout]; | ||
| 53 | + _collectionView.delegate = self; | ||
| 54 | + _collectionView.dataSource = self; | ||
| 55 | + _collectionView.showsVerticalScrollIndicator = NO; | ||
| 56 | + [_collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:kGNCOLGRIDVIEWID]; | ||
| 57 | + } | ||
| 58 | + return _collectionView; | ||
| 59 | +} | ||
| 60 | +@end |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntSignUpViewController.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntSignUpViewController.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntSignUpViewController.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/7. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.h> | ||
| 9 | + | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +@interface CNLiveCommuntSignUpViewController : CNCommonTableViewController | ||
| 13 | + | ||
| 14 | + | ||
| 15 | +/// 打开该界面需要的参数 | ||
| 16 | +/// @param infoDict 字典 | ||
| 17 | +- (instancetype)initWithStyle:(UITableViewStyle)style InfoDict:(NSDictionary *)infoDict; | ||
| 18 | + | ||
| 19 | +@end | ||
| 20 | + | ||
| 21 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntSignUpViewController.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntSignUpViewController.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntSignUpViewController.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/7. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntSignUpViewController.h" | ||
| 9 | + | ||
| 10 | +@interface CNLiveCommuntSignUpViewController ()<CNLiveCommuntSignUpUserViewDelegate> | ||
| 11 | +@property (nonatomic, strong) NSMutableArray * userArray; | ||
| 12 | +@property (nonatomic, strong) NSDictionary * infoDict; | ||
| 13 | +@end | ||
| 14 | + | ||
| 15 | +@implementation CNLiveCommuntSignUpViewController | ||
| 16 | + | ||
| 17 | +- (instancetype)initWithStyle:(UITableViewStyle)style InfoDict:(NSDictionary *)infoDict | ||
| 18 | +{ | ||
| 19 | + self = [super initWithStyle:style]; | ||
| 20 | + if (self) { | ||
| 21 | + _infoDict = infoDict; | ||
| 22 | + } | ||
| 23 | + return self; | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +- (void)viewDidLoad { | ||
| 27 | + [super viewDidLoad]; | ||
| 28 | + // Do any additional setup after loading the view. | ||
| 29 | + self.view.backgroundColor = UIColorHex(#F9F9F9); | ||
| 30 | + self.title = @"报名"; | ||
| 31 | + | ||
| 32 | + self.userArray = [[NSMutableArray alloc] init]; | ||
| 33 | + | ||
| 34 | + NSString * mobile = [self.infoDict stringValueForKey:@"mobile" default:@""]; | ||
| 35 | + if ([mobile isNotBlank]) { | ||
| 36 | + UIButton * submiteBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 37 | + submiteBtn.frame = CGRectMake(0, 0, 50, 14); | ||
| 38 | + [submiteBtn setTitle:@"咨询电话" forState:UIControlStateNormal]; | ||
| 39 | + [submiteBtn setTitleColor:UIColorHex(#0091FF) forState:UIControlStateNormal]; | ||
| 40 | + submiteBtn.backgroundColor = [UIColor whiteColor]; | ||
| 41 | + submiteBtn.titleLabel.font = [UIFont systemFontOfSize:14]; | ||
| 42 | + [submiteBtn addTarget:self action:@selector(rightBarButtonAction:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 43 | + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:submiteBtn]; | ||
| 44 | + } | ||
| 45 | +} | ||
| 46 | +-(void)rightBarButtonAction:(UIButton *)button | ||
| 47 | +{ | ||
| 48 | + NSString * mobile = [self.infoDict stringValueForKey:@"mobile" default:@""]; | ||
| 49 | + UIAlertController * alert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet]; | ||
| 50 | + [alert addAction:[UIAlertAction actionWithTitle:mobile style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { | ||
| 51 | + NSMutableString* str = [[NSMutableString alloc] initWithFormat:@"tel:%@",mobile]; | ||
| 52 | + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str] options:@{} completionHandler:NULL]; | ||
| 53 | + }]]; | ||
| 54 | + [alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:NULL]]; | ||
| 55 | + [[self displayViewController] presentViewController:alert animated:YES completion:nil]; | ||
| 56 | +} | ||
| 57 | +-(void)addUserAction:(UIButton *)button | ||
| 58 | +{ | ||
| 59 | + __weak typeof(self) weakSelf = self; | ||
| 60 | + CNLiveCommuntyUserListViewController * userVC = [[CNLiveCommuntyUserListViewController alloc] initWithStyle:UITableViewStyleGrouped CompleterBlock:^(NSArray * _Nonnull userArray) { | ||
| 61 | + [weakSelf.userArray addObjectsFromArray:userArray]; | ||
| 62 | + [weakSelf.tableView reloadData]; | ||
| 63 | + [weakSelf setupWithBottemView:weakSelf.userArray.count]; | ||
| 64 | + }]; | ||
| 65 | + [self.navigationController pushViewController:userVC animated:YES]; | ||
| 66 | +} | ||
| 67 | +- (void)initTableView | ||
| 68 | +{ | ||
| 69 | + [super initTableView]; | ||
| 70 | + self.tableView.delegate = self; | ||
| 71 | + self.tableView.dataSource = self; | ||
| 72 | + self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; | ||
| 73 | + self.tableView.tableFooterView = [[UIView alloc] init]; | ||
| 74 | +} | ||
| 75 | +-(void)layoutTableView | ||
| 76 | +{ | ||
| 77 | + [super layoutTableView]; | ||
| 78 | + self.tableView.frame = CGRectMake(0, kNavigationBarHeight, kScreenWidth, kScreenHeight - kNavigationBarHeight); | ||
| 79 | + self.tableView.contentInset = UIEdgeInsetsMake(10, 0, 60, 0); | ||
| 80 | +} | ||
| 81 | +-(void)setupWithBottemView:(NSInteger)totalPrice | ||
| 82 | +{ | ||
| 83 | + __weak typeof(self) weakSelf = self; | ||
| 84 | + UIView * bottemView = [[UIView alloc] initWithFrame:CGRectZero]; | ||
| 85 | + bottemView.backgroundColor = [UIColor whiteColor]; | ||
| 86 | + [self.view addSubview:bottemView]; | ||
| 87 | + [bottemView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 88 | + make.left.right.bottom.mas_equalTo(weakSelf.view); | ||
| 89 | + make.height.mas_equalTo(50); | ||
| 90 | + }]; | ||
| 91 | + | ||
| 92 | + float unitPrice = [[self.infoDict stringValueForKey:@"unitPrice" default:@"0"] floatValue]; | ||
| 93 | + NSMutableAttributedString * str = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"合计: ¥%.2f",(totalPrice * unitPrice)]]; | ||
| 94 | + [str addAttribute:NSForegroundColorAttributeName value:UIColorHex(#222833) range:[str.string rangeOfString:@"合计: "]]; | ||
| 95 | + [str addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:14] range:[str.string rangeOfString:@"合计: "]]; | ||
| 96 | + [str addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:14] range:[str.string rangeOfString:@"合计: "]]; | ||
| 97 | + [str addAttribute:NSForegroundColorAttributeName value:UIColorHex(#DF0D23) range:[str.string rangeOfString:@"¥"]]; | ||
| 98 | + [str addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:9] range:[str.string rangeOfString:@"¥"]]; | ||
| 99 | + | ||
| 100 | + UILabel * priceLabel = [[UILabel alloc] init]; | ||
| 101 | + priceLabel.textColor = UIColorHex(#DF0D23); | ||
| 102 | + priceLabel.font = [UIFont boldSystemFontOfSize:16]; | ||
| 103 | + priceLabel.attributedText = str; | ||
| 104 | + priceLabel.hidden = unitPrice == 0.00; | ||
| 105 | + [bottemView addSubview:priceLabel]; | ||
| 106 | + [priceLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 107 | + make.centerY.mas_equalTo(bottemView); | ||
| 108 | + make.left.mas_equalTo(bottemView).offset(10); | ||
| 109 | + }]; | ||
| 110 | + | ||
| 111 | + UIButton * payButton = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 112 | + [payButton setTitle:unitPrice == 0.00?@"立即报名":@"立即支付" forState:UIControlStateNormal]; | ||
| 113 | + [payButton setTitle:unitPrice == 0.00?@"立即报名":@"立即支付" forState:UIControlStateHighlighted]; | ||
| 114 | + [payButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | ||
| 115 | + [payButton setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted]; | ||
| 116 | + payButton.backgroundColor = totalPrice > 0 ? UIColorHex(#CD0302) : UIColorHex(#f3f3f3); | ||
| 117 | + payButton.layer.masksToBounds = YES; | ||
| 118 | + payButton.layer.cornerRadius = 18; | ||
| 119 | + payButton.enabled = totalPrice > 0; | ||
| 120 | + payButton.titleLabel.font = [UIFont systemFontOfSize:16]; | ||
| 121 | + payButton.titleLabel.font = [UIFont boldSystemFontOfSize:16]; | ||
| 122 | + [payButton addTarget:self action:@selector(payResultAction) forControlEvents:UIControlEventTouchUpInside]; | ||
| 123 | + [bottemView addSubview:payButton]; | ||
| 124 | + [payButton mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 125 | + make.centerY.mas_equalTo(bottemView); | ||
| 126 | + make.right.mas_equalTo(bottemView.mas_right).offset(-10); | ||
| 127 | + make.height.mas_equalTo(36); | ||
| 128 | + if (unitPrice == 0.00) { | ||
| 129 | + make.left.mas_equalTo(bottemView).offset(10); | ||
| 130 | + }else{ | ||
| 131 | + make.width.mas_equalTo(180); | ||
| 132 | + } | ||
| 133 | + }]; | ||
| 134 | +} | ||
| 135 | +-(void)payResultAction | ||
| 136 | +{ | ||
| 137 | + __weak typeof(self) weakSelf = self; | ||
| 138 | + [CNLiveCommuntViewModel requestWithCommuntySingUpOrderMentHandworkId:[self.infoDict stringValueForKey:@"id" default:@""] Ussers:self.userArray CompleterBlock:^(CNLiveCommuntyActivitySignUpModel * _Nonnull signUpModel) { | ||
| 139 | + float unitPrice = [[weakSelf.infoDict stringValueForKey:@"unitPrice" default:@"0"] floatValue]; | ||
| 140 | + if (unitPrice == 0.00) { | ||
| 141 | + CNLiveCommuntyResultViewController * resultVC = [[CNLiveCommuntyResultViewController alloc] initWithSignUpModel:signUpModel]; | ||
| 142 | + [weakSelf.navigationController pushViewController:resultVC animated:YES]; | ||
| 143 | + }else{ | ||
| 144 | + NSString * body = [weakSelf.infoDict stringValueForKey:@"name" default:@""]; | ||
| 145 | + [[CNLiveCommuntyModule shareInstance].protocol pushMainProjectWithPayManagerWithOrderId:signUpModel.idStr price:signUpModel.totalFee body:body]; | ||
| 146 | + } | ||
| 147 | + }]; | ||
| 148 | +} | ||
| 149 | + | ||
| 150 | +/// 跳转删除人员 | ||
| 151 | +/// @param subDict 显示信息 | ||
| 152 | +-(void)setCommuntPushAddWithDelectUserViewController:(NSDictionary *)subDict | ||
| 153 | +{ | ||
| 154 | + if ([self.userArray containsObject:subDict]) { | ||
| 155 | + [self.userArray removeObject:subDict]; | ||
| 156 | + [self.tableView reloadData]; | ||
| 157 | + [self setupWithBottemView:self.userArray.count]; | ||
| 158 | + } | ||
| 159 | +} | ||
| 160 | + | ||
| 161 | +- (void)setCommuntPushAddWithEditUserViewController:(nonnull NSDictionary *)subDict { | ||
| 162 | +} | ||
| 163 | + | ||
| 164 | + | ||
| 165 | +- (void)setCommuntSelectAddWithEditUserViewController:(nonnull NSDictionary *)subDict isSelect:(BOOL)isSelect { | ||
| 166 | +} | ||
| 167 | + | ||
| 168 | +#pragma mark = | ||
| 169 | +-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView | ||
| 170 | +{ | ||
| 171 | + NSString * desc = [self.infoDict stringValueForKey:@"processDesc" default:@""]; | ||
| 172 | + return [desc isNotBlank]?2:1; | ||
| 173 | +} | ||
| 174 | +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | ||
| 175 | +{ | ||
| 176 | + | ||
| 177 | + return section == 0?self.userArray.count:1; | ||
| 178 | +} | ||
| 179 | +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 180 | +{ | ||
| 181 | + if (indexPath.section == 0) { | ||
| 182 | + CNLiveCommuntSignUpUserViewCell * userView = [CNLiveCommuntSignUpUserViewCell setTableView:tableView isAddUser:NO UserDict:self.userArray[indexPath.row]]; | ||
| 183 | + userView.delegate = self; | ||
| 184 | + return userView; | ||
| 185 | + }else{ | ||
| 186 | + NSString * desc = [self.infoDict stringValueForKey:@"processDesc" default:@""]; | ||
| 187 | + return [CNLiveCommuntSignUpTextViewCell setTableView:tableView Desc:desc]; | ||
| 188 | + } | ||
| 189 | +} | ||
| 190 | +-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 191 | +{ | ||
| 192 | + return indexPath.section == 0?50:300.0f; | ||
| 193 | +} | ||
| 194 | +-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section | ||
| 195 | +{ | ||
| 196 | + return section == 0?40:0.001f; | ||
| 197 | +} | ||
| 198 | +-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section | ||
| 199 | +{ | ||
| 200 | + if (section == 0) { | ||
| 201 | + UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 40)]; | ||
| 202 | + view.backgroundColor = [UIColor clearColor]; | ||
| 203 | + | ||
| 204 | + UIView * radiusView = [[UIView alloc] initWithFrame:CGRectMake(10, 0, kScreenWidth - 20, 40)]; | ||
| 205 | + radiusView.backgroundColor = [UIColor whiteColor]; | ||
| 206 | + radiusView.layer.shadowColor = [UIColor blackColor].CGColor; | ||
| 207 | + radiusView.layer.shadowOffset = CGSizeMake(0, 0); | ||
| 208 | + radiusView.layer.shadowOpacity = 0.3; | ||
| 209 | + radiusView.layer.shadowRadius = 8; | ||
| 210 | + UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_WIDTH - 20, 40) byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(12, 12)]; | ||
| 211 | + CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; | ||
| 212 | + maskLayer.path = maskPath.CGPath; | ||
| 213 | + radiusView.layer.mask = maskLayer; | ||
| 214 | + [view insertSubview:radiusView belowSubview:view]; | ||
| 215 | + | ||
| 216 | + UILabel * nameLabel = [[UILabel alloc] init]; | ||
| 217 | + nameLabel.textColor = UIColorHex(#333333); | ||
| 218 | + nameLabel.lineBreakMode = NSLineBreakByTruncatingTail; | ||
| 219 | + nameLabel.numberOfLines = 1; | ||
| 220 | + nameLabel.font = [UIFont systemFontOfSize:15]; | ||
| 221 | + nameLabel.font = [UIFont boldSystemFontOfSize:15]; | ||
| 222 | + nameLabel.text = @"参与人"; | ||
| 223 | + [view addSubview:nameLabel]; | ||
| 224 | + [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 225 | + make.centerY.mas_equalTo(view); | ||
| 226 | + make.left.mas_equalTo(view.mas_left).offset(20); | ||
| 227 | + }]; | ||
| 228 | + | ||
| 229 | + UILabel * numberLabel = [[UILabel alloc] init]; | ||
| 230 | + numberLabel.textColor = UIColorHex(#999999); | ||
| 231 | + numberLabel.lineBreakMode = NSLineBreakByTruncatingTail; | ||
| 232 | + numberLabel.numberOfLines = 1; | ||
| 233 | + numberLabel.font = [UIFont systemFontOfSize:12]; | ||
| 234 | + numberLabel.text = [NSString stringWithFormat:@"已选%lu人",(unsigned long)self.userArray.count]; | ||
| 235 | + [view addSubview:numberLabel]; | ||
| 236 | + [numberLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 237 | + make.centerY.mas_equalTo(view); | ||
| 238 | + make.right.mas_equalTo(view.mas_right).offset(-20); | ||
| 239 | + }]; | ||
| 240 | + | ||
| 241 | + return view; | ||
| 242 | + }else{ | ||
| 243 | + return [UIView new]; | ||
| 244 | + } | ||
| 245 | +} | ||
| 246 | + | ||
| 247 | +-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section | ||
| 248 | +{ | ||
| 249 | + return section == 0?60:0.001f; | ||
| 250 | +} | ||
| 251 | +-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section | ||
| 252 | +{ | ||
| 253 | + if (section == 0) { | ||
| 254 | + UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 60)]; | ||
| 255 | + view.backgroundColor = [UIColor clearColor]; | ||
| 256 | + | ||
| 257 | + UIView * radiusView = [[UIView alloc] initWithFrame:CGRectMake(10, 0, kScreenWidth - 20, 60)]; | ||
| 258 | + radiusView.backgroundColor = [UIColor whiteColor]; | ||
| 259 | + radiusView.layer.shadowColor = [UIColor blackColor].CGColor; | ||
| 260 | + radiusView.layer.shadowOffset = CGSizeMake(0, 0); | ||
| 261 | + radiusView.layer.shadowOpacity = 0.3; | ||
| 262 | + radiusView.layer.shadowRadius = 8; | ||
| 263 | + UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_WIDTH - 20, 60) byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(12, 12)]; | ||
| 264 | + CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; | ||
| 265 | + maskLayer.path = maskPath.CGPath; | ||
| 266 | + radiusView.layer.mask = maskLayer; | ||
| 267 | + [view insertSubview:radiusView belowSubview:view]; | ||
| 268 | + | ||
| 269 | + QMUIButton * addBtn = [[QMUIButton alloc] init]; | ||
| 270 | + [addBtn setImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_communty_add_persion"] forState:UIControlStateNormal]; | ||
| 271 | + [addBtn setImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_communty_add_persion"] forState:UIControlStateHighlighted]; | ||
| 272 | + [addBtn setTitle:@"添加" forState:UIControlStateNormal]; | ||
| 273 | + [addBtn setTitle:@"添加" forState:UIControlStateHighlighted]; | ||
| 274 | + [addBtn setTitleColor:UIColorHex(#FD862E) forState:UIControlStateNormal]; | ||
| 275 | + [addBtn setTitleColor:UIColorHex(#FD862E) forState:UIControlStateHighlighted]; | ||
| 276 | + [addBtn setBackgroundColor:UIColorHex(#FD862E14)]; | ||
| 277 | + addBtn.layer.cornerRadius = 5; | ||
| 278 | + addBtn.layer.masksToBounds = YES; | ||
| 279 | + addBtn.spacingBetweenImageAndTitle = 3; | ||
| 280 | + [addBtn addTarget:self action:@selector(addUserAction:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 281 | + [view addSubview:addBtn]; | ||
| 282 | + [addBtn mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 283 | + make.center.mas_equalTo(view); | ||
| 284 | + make.width.mas_equalTo(kScreenWidth - 50); | ||
| 285 | + make.height.mas_equalTo(35); | ||
| 286 | + }]; | ||
| 287 | + | ||
| 288 | + return view; | ||
| 289 | + }else{ | ||
| 290 | + return [UIView new]; | ||
| 291 | + } | ||
| 292 | +} | ||
| 293 | +@end |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntViewController.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntViewController.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntViewController.h | ||
| 3 | +// AFNetworking | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/1. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "DSTabBarViewController.h" | ||
| 9 | + | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +@interface CNLiveCommuntViewController : DSTabBarViewController | ||
| 13 | + | ||
| 14 | +/// 初始化首页界面 | ||
| 15 | +/// @param nbhdId 小区id | ||
| 16 | +- (instancetype)initWithNBhdId:(NSString *)nbhdId; | ||
| 17 | + | ||
| 18 | +@end | ||
| 19 | + | ||
| 20 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntViewController.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntViewController.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntViewController.m | ||
| 3 | +// AFNetworking | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/1. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntViewController.h" | ||
| 9 | + | ||
| 10 | +#import "CNLiveCommuntPartyViewController.h" | ||
| 11 | +#import "CNLiveCommuntConsuViewController.h" | ||
| 12 | +#import "CNLiveCommuntActiviViewController.h" | ||
| 13 | +#import "CNLiveCommuntServiceViewController.h" | ||
| 14 | +@interface CNLiveCommuntViewController () | ||
| 15 | +@property (nonatomic, copy) NSString *nbhdId; | ||
| 16 | +@end | ||
| 17 | + | ||
| 18 | +@implementation CNLiveCommuntViewController | ||
| 19 | + | ||
| 20 | +- (instancetype)initWithNBhdId:(NSString *)nbhdId | ||
| 21 | +{ | ||
| 22 | + self = [super init]; | ||
| 23 | + if (self) { | ||
| 24 | + _nbhdId = nbhdId; | ||
| 25 | + } | ||
| 26 | + return self; | ||
| 27 | +} | ||
| 28 | +-(void)viewDidAppear:(BOOL)animated | ||
| 29 | +{ | ||
| 30 | + [super viewDidAppear:animated]; | ||
| 31 | + NSMutableArray * tempArray = [[NSMutableArray alloc] initWithArray:self.navigationController.viewControllers]; | ||
| 32 | + for (UIViewController * vc in self.navigationController.viewControllers) { | ||
| 33 | + if ([vc isKindOfClass:CNLiveCommuntyHomeListViewController.class]) { | ||
| 34 | + [tempArray removeObject:vc]; | ||
| 35 | + break; | ||
| 36 | + } | ||
| 37 | + } | ||
| 38 | + self.navigationController.viewControllers = tempArray; | ||
| 39 | +} | ||
| 40 | +- (void)viewDidLoad { | ||
| 41 | + [super viewDidLoad]; | ||
| 42 | + // Do any additional setup after loading the view. | ||
| 43 | + self.selectColor = [UIColor colorWithHexString:@"0xCD0302"]; | ||
| 44 | + self.normalColor = [UIColor colorWithHexString:@"0x979797"]; | ||
| 45 | + | ||
| 46 | + self.tabBar.backgroundColor = UIColorHex(#f9f9f9); | ||
| 47 | + | ||
| 48 | + __weak typeof(self) weakSelf = self; | ||
| 49 | + [QMUITips showLoadingInView:self.view]; | ||
| 50 | + [CNLiveCommuntViewModel requestWithCommuntyHomeNBhdAppIndexWithNBhdId:self.nbhdId CompleterBlock:^(NSArray * _Nonnull homeArray) { | ||
| 51 | + if (homeArray) { | ||
| 52 | + __block NSMutableArray * array = [[NSMutableArray alloc] init]; | ||
| 53 | + for (CNLiveCommuntyHomeModel * homeModel in homeArray) { | ||
| 54 | + if ([homeModel.columnColour isNotBlank]) weakSelf.selectColor = [UIColor colorWithHexString:homeModel.columnColour]; | ||
| 55 | + if ([homeModel.columnColourUncheck isNotBlank]) weakSelf.normalColor = [UIColor colorWithHexString:homeModel.columnColourUncheck]; | ||
| 56 | + [weakSelf settingTabberWithImages:@[homeModel.columnImg,homeModel.columnImgUncheck] CompleterBlock:^(NSDictionary *tempDict) { | ||
| 57 | + NSMutableDictionary * dict = [[NSMutableDictionary alloc] init]; | ||
| 58 | + [dict addEntriesFromDictionary:tempDict]; | ||
| 59 | + [dict setObject:homeModel forKey:@"model"]; | ||
| 60 | + [array addObject:dict]; | ||
| 61 | + if (array.count == homeArray.count) { | ||
| 62 | + [QMUITips hideAllTipsInView:weakSelf.view]; | ||
| 63 | + weakSelf.tabBar.backgroundColor = [UIColor whiteColor]; | ||
| 64 | + for (NSDictionary * subDict in array) { | ||
| 65 | + CNLiveCommuntyHomeModel * homeModel = [subDict objectForKey:@"model"]; | ||
| 66 | + if (homeModel.contentColumnList.count > 0) { | ||
| 67 | + CNLiveCommuntConsuViewController * vc = [[CNLiveCommuntConsuViewController alloc] initWithHomeArray:homeModel.contentColumnList titles:homeModel.titles NBhdId:weakSelf.nbhdId]; | ||
| 68 | + vc.title = homeModel.columnName; | ||
| 69 | + vc.view.backgroundColor = [UIColor whiteColor]; | ||
| 70 | + [weakSelf addChildViewController:vc noralImage:[subDict objectForKey:@"nomal"] selectImage:[subDict objectForKey:@"select"]]; | ||
| 71 | + }else{ | ||
| 72 | + if ([homeModel.type isEqualToString:@"3"]) {//生活服务界面 原生 | ||
| 73 | + CNLiveCommuntServiceViewController * vc = [[CNLiveCommuntServiceViewController alloc] init]; | ||
| 74 | + vc.title = homeModel.columnName; | ||
| 75 | + vc.view.backgroundColor = [UIColor cyanColor]; | ||
| 76 | + [weakSelf addChildViewController:vc noralImage:[subDict objectForKey:@"nomal"] selectImage:[subDict objectForKey:@"select"]]; | ||
| 77 | + } | ||
| 78 | + if ([homeModel.type isEqualToString:@"2"] && [homeModel.cmsPageType isEqualToString:@"1"]) {//调用主工程H5界面 | ||
| 79 | + CNLiveCommuntActiviViewController * vc = [[CNLiveCommuntActiviViewController alloc] init]; | ||
| 80 | + vc.title = @"调用主工程H5界面"; | ||
| 81 | + vc.view.backgroundColor = [UIColor whiteColor]; | ||
| 82 | + [weakSelf addChildViewController:vc noralImage:[subDict objectForKey:@"nomal"] selectImage:[subDict objectForKey:@"select"]]; | ||
| 83 | + } | ||
| 84 | + if ([homeModel.type isEqualToString:@"2"] && [homeModel.cmsPageType isEqualToString:@"4"]) {//调用主工程中的视讯界面 并进行传参 | ||
| 85 | + CNLiveCommuntActiviViewController * vc = [[CNLiveCommuntActiviViewController alloc] init]; | ||
| 86 | + vc.title = @"调用主工程中的视讯界面 并进行传参"; | ||
| 87 | + vc.view.backgroundColor = [UIColor whiteColor]; | ||
| 88 | + [weakSelf addChildViewController:vc noralImage:[subDict objectForKey:@"nomal"] selectImage:[subDict objectForKey:@"select"]]; | ||
| 89 | + } | ||
| 90 | + } | ||
| 91 | + } | ||
| 92 | + } | ||
| 93 | + }]; | ||
| 94 | + } | ||
| 95 | + }else{ | ||
| 96 | + [QMUITips hideAllTipsInView:weakSelf.view]; | ||
| 97 | + [weakSelf.navigationController popViewControllerAnimated:YES]; | ||
| 98 | + } | ||
| 99 | + }]; | ||
| 100 | +} | ||
| 101 | + | ||
| 102 | +-(void)settingTabberWithImages:(NSArray *)images CompleterBlock:(void(^)(NSDictionary * tempDict))completerBlock | ||
| 103 | +{ | ||
| 104 | + __block NSMutableDictionary * tempDict = [[NSMutableDictionary alloc] init]; | ||
| 105 | + for (int i = 0; i < images.count; i++) { | ||
| 106 | + NSString * imageUrl = images[i]; | ||
| 107 | + if ([imageUrl isNotBlank]) { | ||
| 108 | + [SDWebImageManager.sharedManager loadImageWithURL:[NSURL URLWithString:imageUrl] options:SDWebImageRetryFailed progress:NULL completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) { | ||
| 109 | + [tempDict setObject:image forKey:i == 1 ? @"nomal" : @"select"]; | ||
| 110 | + if (tempDict.count == images.count && completerBlock) completerBlock(tempDict); | ||
| 111 | + }]; | ||
| 112 | + } | ||
| 113 | + } | ||
| 114 | +} | ||
| 115 | + | ||
| 116 | +-(void)settingTabBar | ||
| 117 | +{ | ||
| 118 | + //带分页的显示界面的 | ||
| 119 | + CNLiveCommuntConsuViewController * vc02 = [[CNLiveCommuntConsuViewController alloc] init]; | ||
| 120 | + vc02.title = @"权威资讯"; | ||
| 121 | + vc02.view.backgroundColor = [UIColor whiteColor]; | ||
| 122 | + [self addChildViewController:vc02 noralImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_community_consu_nomal"] selectImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_community_consu_select"]]; | ||
| 123 | + | ||
| 124 | + //准备放WebView的 | ||
| 125 | + CNLiveCommuntPartyViewController * vc01 = [[CNLiveCommuntPartyViewController alloc] init]; | ||
| 126 | + vc01.title = @"数字党建"; | ||
| 127 | + vc01.view.backgroundColor = [UIColor whiteColor]; | ||
| 128 | + [self addChildViewController:vc01 noralImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_community_party_nomal"] selectImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_community_party_select"]]; | ||
| 129 | + | ||
| 130 | + CNLiveCommuntActiviViewController * vc03 = [[CNLiveCommuntActiviViewController alloc] init]; | ||
| 131 | + vc03.title = @"公益活动"; | ||
| 132 | + vc03.view.backgroundColor = [UIColor whiteColor]; | ||
| 133 | + [self addChildViewController:vc03 noralImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_community_public_nomal"] selectImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_community_public_select"]]; | ||
| 134 | + | ||
| 135 | + //块状结构的 | ||
| 136 | + CNLiveCommuntServiceViewController * vc04 = [[CNLiveCommuntServiceViewController alloc] init]; | ||
| 137 | + vc04.title = @"生活服务"; | ||
| 138 | + vc04.view.backgroundColor = [UIColor whiteColor]; | ||
| 139 | + [self addChildViewController:vc04 noralImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_community_service_nomal"] selectImage:[CNLiveCommuntTools cCommunt_setImageWithName:@"c_community_service_select"]]; | ||
| 140 | +} | ||
| 141 | + | ||
| 142 | + | ||
| 143 | +@end |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyHomeListViewController.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyHomeListViewController.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntyHomeListViewController.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/10. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.h> | ||
| 9 | + | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +@interface CNLiveCommuntyHomeListViewController : CNCommonTableViewController | ||
| 13 | + | ||
| 14 | +@end | ||
| 15 | + | ||
| 16 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyHomeListViewController.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyHomeListViewController.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntyHomeListViewController.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/10. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntyHomeListViewController.h" | ||
| 9 | + | ||
| 10 | +@interface CNLiveCommuntyHomeListViewController ()<DZNEmptyDataSetSource,DZNEmptyDataSetDelegate> | ||
| 11 | +@property (nonatomic, strong) NSMutableArray * dataSource; | ||
| 12 | +@end | ||
| 13 | + | ||
| 14 | +@implementation CNLiveCommuntyHomeListViewController | ||
| 15 | + | ||
| 16 | +-(void)viewWillAppear:(BOOL)animated | ||
| 17 | +{ | ||
| 18 | + [super viewWillAppear:animated]; | ||
| 19 | + [self.tableView.mj_header beginRefreshing]; | ||
| 20 | +} | ||
| 21 | + | ||
| 22 | +- (void)viewDidLoad { | ||
| 23 | + [super viewDidLoad]; | ||
| 24 | + // Do any additional setup after loading the view. | ||
| 25 | + self.view.backgroundColor = [UIColor whiteColor]; | ||
| 26 | + self.title = @"选择小区"; | ||
| 27 | + self.dataSource = [[NSMutableArray alloc] init]; | ||
| 28 | + | ||
| 29 | + __weak typeof(self) weakSelf = self; | ||
| 30 | + self.tableView.mj_header = [CNLiveRefreshHeader headerWithRefreshingBlock:^{ | ||
| 31 | + [weakSelf loadNetworkingMedthod]; | ||
| 32 | + }]; | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +-(void)loadNetworkingMedthod | ||
| 36 | +{ | ||
| 37 | + __weak typeof(self) weakSelf = self; | ||
| 38 | + [CNLiveCommuntViewModel requestWithCommuntyHomeListIndexWithCompleterBlock:^(NSArray * _Nonnull listArray) { | ||
| 39 | + [weakSelf.dataSource removeAllObjects]; | ||
| 40 | + [weakSelf.dataSource addObjectsFromArray:listArray]; | ||
| 41 | + [weakSelf.tableView reloadData]; | ||
| 42 | + [weakSelf.tableView.mj_header endRefreshing]; | ||
| 43 | + }]; | ||
| 44 | +} | ||
| 45 | + | ||
| 46 | +- (void)initTableView | ||
| 47 | +{ | ||
| 48 | + [super initTableView]; | ||
| 49 | + self.tableView.delegate = self; | ||
| 50 | + self.tableView.dataSource = self; | ||
| 51 | + self.tableView.emptyDataSetSource = self; | ||
| 52 | + self.tableView.emptyDataSetDelegate = self; | ||
| 53 | + self.tableView.tableFooterView = [[UIView alloc] init]; | ||
| 54 | + self.tableView.backgroundColor = [UIColor whiteColor]; | ||
| 55 | + self.tableView.separatorInset = UIEdgeInsetsMake(0, 10, 0, 10); | ||
| 56 | +} | ||
| 57 | +-(void)layoutTableView | ||
| 58 | +{ | ||
| 59 | + [super layoutTableView]; | ||
| 60 | + self.tableView.frame = CGRectMake(0, kNavigationBarHeight, kScreenWidth, kScreenHeight - kNavigationBarHeight); | ||
| 61 | +} | ||
| 62 | +#pragma mark - DZNEmptyDataSetSource Methods | ||
| 63 | +- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView | ||
| 64 | +{ | ||
| 65 | + return [[NSAttributedString alloc] initWithString:@"暂无小区列表" attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16]}]; | ||
| 66 | +} | ||
| 67 | +-(UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView | ||
| 68 | +{ | ||
| 69 | + return [CNLiveCommuntTools cCommunt_setImageWithName:@"c_community_content_empty"]; | ||
| 70 | +} | ||
| 71 | +- (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView | ||
| 72 | +{ | ||
| 73 | + return [UIColor whiteColor]; | ||
| 74 | +} | ||
| 75 | +- (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView | ||
| 76 | +{ | ||
| 77 | + return 0; | ||
| 78 | +} | ||
| 79 | + | ||
| 80 | +- (BOOL)emptyDataSetShouldDisplay:(UIScrollView *)scrollView | ||
| 81 | +{ | ||
| 82 | + return YES; | ||
| 83 | +} | ||
| 84 | + | ||
| 85 | +- (BOOL)emptyDataSetShouldAllowTouch:(UIScrollView *)scrollView | ||
| 86 | +{ | ||
| 87 | + return YES; | ||
| 88 | +} | ||
| 89 | + | ||
| 90 | +- (BOOL)emptyDataSetShouldAllowScroll:(UIScrollView *)scrollView | ||
| 91 | +{ | ||
| 92 | + return NO; | ||
| 93 | +} | ||
| 94 | +#pragma mark = | ||
| 95 | + | ||
| 96 | +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView | ||
| 97 | +{ | ||
| 98 | + return 1; | ||
| 99 | +} | ||
| 100 | + | ||
| 101 | +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | ||
| 102 | +{ | ||
| 103 | + return self.dataSource.count; | ||
| 104 | +} | ||
| 105 | + | ||
| 106 | +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 107 | +{ | ||
| 108 | + UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"kTableViewCellIdentifier"]; | ||
| 109 | + if (!cell) { | ||
| 110 | + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"kTableViewCellIdentifier"]; | ||
| 111 | + } | ||
| 112 | + CNLiveCommuntyHomeListModel * listModel = self.dataSource[indexPath.row]; | ||
| 113 | + cell.textLabel.text = listModel.name; | ||
| 114 | + cell.textLabel.textColor = UIColorHex(#333333); | ||
| 115 | + cell.textLabel.font = [UIFont systemFontOfSize:20]; | ||
| 116 | + cell.textLabel.font = [UIFont boldSystemFontOfSize:20]; | ||
| 117 | + cell.selectionStyle = UITableViewCellSelectionStyleNone; | ||
| 118 | + return cell; | ||
| 119 | +} | ||
| 120 | + | ||
| 121 | +-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 122 | +{ | ||
| 123 | + return 70.0f; | ||
| 124 | +} | ||
| 125 | + | ||
| 126 | +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 127 | +{ | ||
| 128 | + CNLiveCommuntyHomeListModel * listModel = self.dataSource[indexPath.row]; | ||
| 129 | + [[NSUserDefaults standardUserDefaults] setObject:listModel.idStr forKey:kCNLiveCommuntyNBhdIdIdentifier]; | ||
| 130 | + [[NSUserDefaults standardUserDefaults] synchronize]; | ||
| 131 | + CNLiveCommuntViewController * homeView = [[CNLiveCommuntViewController alloc] initWithNBhdId:listModel.idStr]; | ||
| 132 | + [self.navigationController pushViewController:homeView animated:YES]; | ||
| 133 | + | ||
| 134 | + | ||
| 135 | +} | ||
| 136 | +@end |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyOrderViewController.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyOrderViewController.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntyOrderViewController.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/8. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.h> | ||
| 9 | +#import "CNLiveCommuntyHomeModel.h" | ||
| 10 | + | ||
| 11 | +typedef enum : NSUInteger { | ||
| 12 | + CNLiveCommuntyOrderShowTypeListYetOrder = 0,//////列表已发起 | ||
| 13 | + CNLiveCommuntyOrderShowTypeListReadyOrder,////列表处理中 | ||
| 14 | + CNLiveCommuntyOrderShowTypeListCompletOrder,//列表已完成 | ||
| 15 | + CNLiveCommuntyOrderShowTypeListFailureOrder,//列表已失效 | ||
| 16 | + | ||
| 17 | + CNLiveCommuntyOrderShowTypeChatYetOrder,//聊天里面的未接单状态 | ||
| 18 | + CNLiveCommuntyOrderShowTypeChatReadyOrder,//聊天里面的已接单状态 | ||
| 19 | + CNLiveCommuntyOrderShowTypeChatCompletOrder,//聊天里面的已经完成状态 | ||
| 20 | +} CNLiveCommuntyOrderShowType; | ||
| 21 | +NS_ASSUME_NONNULL_BEGIN | ||
| 22 | + | ||
| 23 | + | ||
| 24 | +@interface CNLiveCommuntyOrderViewController : CNCommonTableViewController | ||
| 25 | + | ||
| 26 | +/// 初始化界面显示 | ||
| 27 | +/// @param showType 显示类型 | ||
| 28 | +- (instancetype)initWithShowType:(CNLiveCommuntyOrderShowType)showType CreateModel:(CNLiveCommuntyActivityMaintainsCreateModel *)createModel; | ||
| 29 | + | ||
| 30 | +/// 初始化报修详情界面 | ||
| 31 | +/// @param showType 显示类型 | ||
| 32 | +/// @param maintenId 报修id | ||
| 33 | +- (instancetype)initWithShowType:(CNLiveCommuntyOrderShowType)showType MaintenId:(NSString *)maintenId; | ||
| 34 | + | ||
| 35 | +/// 从聊天进来的时候调用 | ||
| 36 | +/// @param maintenId 报修id | ||
| 37 | +- (instancetype)initWithMaintenId:(NSString *)maintenId; | ||
| 38 | +@end | ||
| 39 | + | ||
| 40 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyOrderViewController.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyOrderViewController.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntyOrderViewController.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/8. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntyOrderViewController.h" | ||
| 9 | + | ||
| 10 | +@interface CNLiveCommuntyOrderViewController ()<DZNEmptyDataSetSource,DZNEmptyDataSetDelegate> | ||
| 11 | +@property (nonatomic, strong) CNLiveCommuntyActivityMaintainsCreateModel * createMdoel; | ||
| 12 | +@property (nonatomic, assign) CNLiveCommuntyOrderShowType showType; | ||
| 13 | +@property (nonatomic, assign) BOOL isShowTopAndBottem; | ||
| 14 | +@property (nonatomic, copy) NSString *maintenId; | ||
| 15 | +@property (nonatomic, assign) BOOL isChat; | ||
| 16 | +@end | ||
| 17 | + | ||
| 18 | +@implementation CNLiveCommuntyOrderViewController | ||
| 19 | + | ||
| 20 | +- (instancetype)initWithShowType:(CNLiveCommuntyOrderShowType)showType CreateModel:(nonnull CNLiveCommuntyActivityMaintainsCreateModel *)createModel | ||
| 21 | +{ | ||
| 22 | + self = [super initWithStyle:UITableViewStyleGrouped]; | ||
| 23 | + if (self) { | ||
| 24 | + _createMdoel = createModel; | ||
| 25 | + _showType = showType; | ||
| 26 | + } | ||
| 27 | + return self; | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | +- (instancetype)initWithShowType:(CNLiveCommuntyOrderShowType)showType MaintenId:(NSString *)maintenId | ||
| 31 | +{ | ||
| 32 | + self = [super initWithStyle:UITableViewStyleGrouped]; | ||
| 33 | + if (self) { | ||
| 34 | + _maintenId = maintenId; | ||
| 35 | + _showType = showType; | ||
| 36 | + } | ||
| 37 | + return self; | ||
| 38 | +} | ||
| 39 | +- (instancetype)initWithMaintenId:(NSString *)maintenId | ||
| 40 | +{ | ||
| 41 | + self = [super initWithStyle:UITableViewStyleGrouped]; | ||
| 42 | + if (self) { | ||
| 43 | + _isChat = YES; | ||
| 44 | + _maintenId = maintenId; | ||
| 45 | + } | ||
| 46 | + return self; | ||
| 47 | +} | ||
| 48 | + | ||
| 49 | +- (void)viewDidLoad { | ||
| 50 | + [super viewDidLoad]; | ||
| 51 | + // Do any additional setup after loading the view. | ||
| 52 | + self.view.backgroundColor = UIColorHex(#F9F9F9); | ||
| 53 | + self.title = @"订单详情"; | ||
| 54 | + | ||
| 55 | + [self reloadDataWithDataSource]; | ||
| 56 | +} | ||
| 57 | +-(void)reloadDataWithDataSource | ||
| 58 | +{ | ||
| 59 | + if ([self.maintenId isNotBlank]) { | ||
| 60 | + __weak typeof(self) weakSelf = self; | ||
| 61 | + [CNLiveCommuntViewModel requestWithCommuntyMaintenDetailForMaintenId:self.maintenId isChat:self.isChat CompleterBlock:^(CNLiveCommuntyActivityMaintainsCreateModel * _Nonnull createModel) { | ||
| 62 | + if (createModel) { | ||
| 63 | + weakSelf.createMdoel = createModel; | ||
| 64 | + if (weakSelf.isChat) weakSelf.showType = weakSelf.createMdoel.showType; | ||
| 65 | + [weakSelf setupWithBottemView]; | ||
| 66 | + [weakSelf setupWithNaviView]; | ||
| 67 | + [weakSelf.tableView reloadData]; | ||
| 68 | + } | ||
| 69 | + }]; | ||
| 70 | + } | ||
| 71 | +} | ||
| 72 | +-(void)setupWithNaviView | ||
| 73 | +{ | ||
| 74 | + if ((self.showType == CNLiveCommuntyOrderShowTypeListYetOrder | ||
| 75 | + || self.showType == CNLiveCommuntyOrderShowTypeChatReadyOrder) | ||
| 76 | + && ![self.createMdoel.repairId isEqualToString:[CNUserInfoManager manager].userInfoModel.uid]) { | ||
| 77 | + NSString * name = @""; | ||
| 78 | + UIColor * titleColor = [UIColor whiteColor]; | ||
| 79 | + if (self.showType == CNLiveCommuntyOrderShowTypeListYetOrder) { | ||
| 80 | + name = @"咨询电话"; | ||
| 81 | + titleColor = UIColorHex(#0091FF); | ||
| 82 | + } | ||
| 83 | + if (self.showType == CNLiveCommuntyOrderShowTypeChatReadyOrder) { | ||
| 84 | + name = @"取消订单"; | ||
| 85 | + titleColor = UIColorHex(#F5A623FF); | ||
| 86 | + } | ||
| 87 | + UIButton * submiteBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 88 | + submiteBtn.frame = CGRectMake(0, 0, 50, 14); | ||
| 89 | + [submiteBtn setTitle:name forState:UIControlStateNormal]; | ||
| 90 | + [submiteBtn setTitleColor:titleColor forState:UIControlStateNormal]; | ||
| 91 | + submiteBtn.backgroundColor = [UIColor whiteColor]; | ||
| 92 | + submiteBtn.titleLabel.font = [UIFont systemFontOfSize:14]; | ||
| 93 | + [submiteBtn addTarget:self action:@selector(rightBarButtonAction:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 94 | + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:submiteBtn]; | ||
| 95 | + } | ||
| 96 | +} | ||
| 97 | +-(void)setupWithBottemView | ||
| 98 | +{ | ||
| 99 | + if (self.showType == CNLiveCommuntyOrderShowTypeChatYetOrder | ||
| 100 | + || self.showType == CNLiveCommuntyOrderShowTypeChatReadyOrder | ||
| 101 | + || self.showType == CNLiveCommuntyOrderShowTypeListFailureOrder) { | ||
| 102 | + __weak typeof(self) weakSelf = self; | ||
| 103 | + UIView * bottemView = [[UIView alloc] init]; | ||
| 104 | + bottemView.backgroundColor = [UIColor whiteColor]; | ||
| 105 | + bottemView.hidden = self.showType == CNLiveCommuntyOrderShowTypeListFailureOrder; | ||
| 106 | + [self.view addSubview:bottemView]; | ||
| 107 | + [bottemView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 108 | + make.left.right.bottom.mas_equalTo(weakSelf.view); | ||
| 109 | + make.height.mas_equalTo(50); | ||
| 110 | + }]; | ||
| 111 | + | ||
| 112 | + NSString * payString = @""; | ||
| 113 | + if (self.showType == CNLiveCommuntyOrderShowTypeChatYetOrder) payString = @"立即接单"; | ||
| 114 | + if (self.showType == CNLiveCommuntyOrderShowTypeChatReadyOrder) payString = @"取消接单"; | ||
| 115 | + | ||
| 116 | + UIButton * payButton = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 117 | + [payButton setTitle:payString forState:UIControlStateNormal]; | ||
| 118 | + [payButton setTitle:payString forState:UIControlStateHighlighted]; | ||
| 119 | + [payButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | ||
| 120 | + [payButton setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted]; | ||
| 121 | + payButton.backgroundColor = UIColorHex(#CD0302); | ||
| 122 | + payButton.layer.masksToBounds = YES; | ||
| 123 | + payButton.layer.cornerRadius = 18; | ||
| 124 | + payButton.titleLabel.font = [UIFont systemFontOfSize:16]; | ||
| 125 | + payButton.titleLabel.font = [UIFont boldSystemFontOfSize:16]; | ||
| 126 | + [payButton addTarget:self action:@selector(payResultAction:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 127 | + [bottemView addSubview:payButton]; | ||
| 128 | + [payButton mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 129 | + make.centerY.mas_equalTo(bottemView); | ||
| 130 | + make.right.mas_equalTo(bottemView.mas_right).offset(-10); | ||
| 131 | + make.left.mas_equalTo(bottemView.mas_left).offset(10); | ||
| 132 | + make.height.mas_equalTo(36); | ||
| 133 | + }]; | ||
| 134 | + } | ||
| 135 | +} | ||
| 136 | +-(void)rightBarButtonAction:(UIButton *)button | ||
| 137 | +{ | ||
| 138 | + MJWeakSelf | ||
| 139 | + if ([button.titleLabel.text isEqualToString:@"咨询电话"]) { | ||
| 140 | + | ||
| 141 | + } | ||
| 142 | + if ([button.titleLabel.text isEqualToString:@"取消订单"]) { | ||
| 143 | + [CNLiveCommuntSignUpView showAlertViewWithMessage:@"确定取消订单后,此订单将失效" CompleterBlock:^{ | ||
| 144 | + [CNLiveCommuntViewModel requestWithCommuntyCancleOrderMentOrderId:weakSelf.createMdoel.idStr CompleterBlock:^{ | ||
| 145 | + weakSelf.showType = CNLiveCommuntyOrderShowTypeListFailureOrder; | ||
| 146 | + [weakSelf setupWithBottemView]; | ||
| 147 | + [weakSelf setupWithNaviView]; | ||
| 148 | + [weakSelf.tableView reloadData]; | ||
| 149 | + }]; | ||
| 150 | + }]; | ||
| 151 | + } | ||
| 152 | +} | ||
| 153 | +-(void)payResultAction:(UIButton *)button | ||
| 154 | +{ | ||
| 155 | + MJWeakSelf | ||
| 156 | + if ([button.titleLabel.text isEqualToString:@"立即接单"]) { | ||
| 157 | + [QMUITips showLoadingInView:self.view]; | ||
| 158 | + [CNLiveCommuntViewModel requestWithCommuntyGrabOrderMentOrderId:self.createMdoel.idStr type:YES CompleterBlock:^{ | ||
| 159 | + [CNLiveCommuntSignUpView showHaveTipSuccessViewCompleterBlock:^{ | ||
| 160 | + weakSelf.showType = CNLiveCommuntyOrderShowTypeChatReadyOrder; | ||
| 161 | + [button setTitle:@"取消接单" forState:UIControlStateNormal]; | ||
| 162 | + [button setTitle:@"取消接单" forState:UIControlStateHighlighted]; | ||
| 163 | + [weakSelf setupWithBottemView]; | ||
| 164 | + [weakSelf setupWithNaviView]; | ||
| 165 | + [weakSelf.tableView reloadData]; | ||
| 166 | + }]; | ||
| 167 | + }]; | ||
| 168 | + } | ||
| 169 | + if ([button.titleLabel.text isEqualToString:@"取消接单"]) { | ||
| 170 | + [CNLiveCommuntSignUpView showAlertViewWithMessage:@"确定取消接单后,此订单将重新转至群" CompleterBlock:^{ | ||
| 171 | + [CNLiveCommuntViewModel requestWithCommuntyGrabOrderMentOrderId:weakSelf.createMdoel.idStr type:NO CompleterBlock:^{ | ||
| 172 | + weakSelf.showType = CNLiveCommuntyOrderShowTypeChatYetOrder; | ||
| 173 | + [button setTitle:@"立即接单" forState:UIControlStateNormal]; | ||
| 174 | + [button setTitle:@"立即接单" forState:UIControlStateHighlighted]; | ||
| 175 | + [weakSelf setupWithBottemView]; | ||
| 176 | + [weakSelf setupWithNaviView]; | ||
| 177 | + [weakSelf.tableView reloadData]; | ||
| 178 | + }]; | ||
| 179 | + }]; | ||
| 180 | + } | ||
| 181 | +} | ||
| 182 | +- (void)initTableView | ||
| 183 | +{ | ||
| 184 | + [super initTableView]; | ||
| 185 | + self.tableView.delegate = self; | ||
| 186 | + self.tableView.dataSource = self; | ||
| 187 | + self.tableView.emptyDataSetSource = self; | ||
| 188 | + self.tableView.emptyDataSetDelegate = self; | ||
| 189 | + self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; | ||
| 190 | + self.tableView.tableFooterView = [[UIView alloc] init]; | ||
| 191 | + self.tableView.backgroundColor = UIColorHex(#f9f9f9); | ||
| 192 | +} | ||
| 193 | +-(void)layoutTableView | ||
| 194 | +{ | ||
| 195 | + [super layoutTableView]; | ||
| 196 | + self.tableView.frame = CGRectMake(0, kNavigationBarHeight, kScreenWidth, kScreenHeight - kNavigationBarHeight); | ||
| 197 | + if (self.showType == CNLiveCommuntyOrderShowTypeChatYetOrder | ||
| 198 | + || self.showType == CNLiveCommuntyOrderShowTypeChatReadyOrder) { | ||
| 199 | + self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 60, 0); | ||
| 200 | + } | ||
| 201 | +} | ||
| 202 | +#pragma mark = | ||
| 203 | +#pragma mark - DZNEmptyDataSetSource Methods | ||
| 204 | +- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView | ||
| 205 | +{ | ||
| 206 | + return [[NSAttributedString alloc] initWithString:@"暂无订单详情" attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16]}]; | ||
| 207 | +} | ||
| 208 | +-(UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView | ||
| 209 | +{ | ||
| 210 | + return [CNLiveCommuntTools cCommunt_setImageWithName:@"c_community_content_empty"]; | ||
| 211 | +} | ||
| 212 | +- (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView | ||
| 213 | +{ | ||
| 214 | + return [UIColor whiteColor]; | ||
| 215 | +} | ||
| 216 | + | ||
| 217 | +- (BOOL)emptyDataSetShouldDisplay:(UIScrollView *)scrollView | ||
| 218 | +{ | ||
| 219 | + return YES; | ||
| 220 | +} | ||
| 221 | + | ||
| 222 | +- (BOOL)emptyDataSetShouldAllowTouch:(UIScrollView *)scrollView | ||
| 223 | +{ | ||
| 224 | + return YES; | ||
| 225 | +} | ||
| 226 | + | ||
| 227 | +- (BOOL)emptyDataSetShouldAllowScroll:(UIScrollView *)scrollView | ||
| 228 | +{ | ||
| 229 | + return NO; | ||
| 230 | +} | ||
| 231 | +#pragma mark = | ||
| 232 | +-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView | ||
| 233 | +{ | ||
| 234 | + if (self.createMdoel) { | ||
| 235 | + if (self.showType == CNLiveCommuntyOrderShowTypeListYetOrder) return 2; | ||
| 236 | + if (self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder) return 2; | ||
| 237 | + if (self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder) return 3; | ||
| 238 | + if (self.showType == CNLiveCommuntyOrderShowTypeListFailureOrder) return 1; | ||
| 239 | + if (self.showType == CNLiveCommuntyOrderShowTypeChatYetOrder) return 1; | ||
| 240 | + if (self.showType == CNLiveCommuntyOrderShowTypeChatReadyOrder) return 2; | ||
| 241 | + if (self.showType == CNLiveCommuntyOrderShowTypeChatCompletOrder) return 1; | ||
| 242 | + } | ||
| 243 | + return 0; | ||
| 244 | +} | ||
| 245 | +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | ||
| 246 | +{ | ||
| 247 | + if (self.createMdoel) { | ||
| 248 | + if (self.showType == CNLiveCommuntyOrderShowTypeChatYetOrder | ||
| 249 | + || self.showType == CNLiveCommuntyOrderShowTypeChatCompletOrder | ||
| 250 | + || self.showType == CNLiveCommuntyOrderShowTypeListFailureOrder) { | ||
| 251 | + if (section == 0) return self.createMdoel.infoArray.count; | ||
| 252 | + } | ||
| 253 | + if (self.showType == CNLiveCommuntyOrderShowTypeListYetOrder | ||
| 254 | + || self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder) { | ||
| 255 | + if (section == 0) return self.createMdoel.infoArray.count; | ||
| 256 | + if (section == 1) return self.createMdoel.processArray.count; | ||
| 257 | + } | ||
| 258 | + if (self.showType == CNLiveCommuntyOrderShowTypeChatReadyOrder) { | ||
| 259 | + if (section == 0) return self.createMdoel.infoArray.count; | ||
| 260 | + if (section == 1) return 1; | ||
| 261 | + } | ||
| 262 | + if (self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder) { | ||
| 263 | + if (section == 0) return self.createMdoel.infoArray.count; | ||
| 264 | + if (section == 1) return 1; | ||
| 265 | + if (section == 2) return self.createMdoel.processArray.count; | ||
| 266 | + } | ||
| 267 | + } | ||
| 268 | + return 0; | ||
| 269 | +} | ||
| 270 | +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 271 | +{ | ||
| 272 | + if (self.showType == CNLiveCommuntyOrderShowTypeChatYetOrder | ||
| 273 | + || self.showType == CNLiveCommuntyOrderShowTypeChatCompletOrder | ||
| 274 | + || self.showType == CNLiveCommuntyOrderShowTypeListFailureOrder) { | ||
| 275 | + return [CNLiveCommuntSignUpOrderViewCell setTableView:tableView Dict:self.createMdoel.infoArray[indexPath.row]]; | ||
| 276 | + } | ||
| 277 | + if (self.showType == CNLiveCommuntyOrderShowTypeListYetOrder | ||
| 278 | + || self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder) { | ||
| 279 | + if (indexPath.section == 0) return [CNLiveCommuntSignUpOrderViewCell setTableView:tableView Dict:self.createMdoel.infoArray[indexPath.row]]; | ||
| 280 | + if (indexPath.section == 1) return [CNLiveCommuntSignUpDetailViewCell setTableView:tableView isTop:indexPath.row == 0 isBottom:indexPath.row == (self.createMdoel.processArray.count - 1) Dict:self.createMdoel.processArray[indexPath.row]]; | ||
| 281 | + } | ||
| 282 | + if (self.showType == CNLiveCommuntyOrderShowTypeChatReadyOrder) { | ||
| 283 | + __weak typeof(self) weakSelf = self; | ||
| 284 | + if (indexPath.section == 0) return [CNLiveCommuntSignUpOrderViewCell setTableView:tableView Dict:self.createMdoel.infoArray[indexPath.row]]; | ||
| 285 | + if (indexPath.section == 1) return [CNLiveCommuntSignUpAmountViewCell setTableView:tableView CreateModel:self.createMdoel ReloadBlock:^{ | ||
| 286 | + [weakSelf reloadDataWithDataSource]; | ||
| 287 | + }]; | ||
| 288 | + } | ||
| 289 | + if (self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder) { | ||
| 290 | + if (indexPath.section == 0) return [CNLiveCommuntSignUpOrderViewCell setTableView:tableView Dict:self.createMdoel.infoArray[indexPath.row]]; | ||
| 291 | + if (indexPath.section == 1) return [CNLiveCommuntSignUpContactViewCell setTableView:tableView CreateModel:self.createMdoel]; | ||
| 292 | + if (indexPath.section == 2) return [CNLiveCommuntSignUpDetailViewCell setTableView:tableView isTop:indexPath.row == 0 isBottom:indexPath.row == (self.createMdoel.processArray.count - 1) Dict:self.createMdoel.processArray[indexPath.row]]; | ||
| 293 | + } | ||
| 294 | + return nil; | ||
| 295 | +} | ||
| 296 | +-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 297 | +{ | ||
| 298 | + if (self.showType == CNLiveCommuntyOrderShowTypeChatYetOrder | ||
| 299 | + || self.showType == CNLiveCommuntyOrderShowTypeChatCompletOrder | ||
| 300 | + || self.showType == CNLiveCommuntyOrderShowTypeListFailureOrder) { | ||
| 301 | + return 30; | ||
| 302 | + } | ||
| 303 | + if (self.showType == CNLiveCommuntyOrderShowTypeListYetOrder | ||
| 304 | + || self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder) { | ||
| 305 | + if (indexPath.section == 0) return 30; | ||
| 306 | + if (indexPath.section == 1) return 70; | ||
| 307 | + } | ||
| 308 | + if (self.showType == CNLiveCommuntyOrderShowTypeChatReadyOrder) { | ||
| 309 | + if (indexPath.section == 0) return 30; | ||
| 310 | + if (indexPath.section == 1) return 130; | ||
| 311 | + } | ||
| 312 | + if (self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder) { | ||
| 313 | + if (indexPath.section == 0) return 30; | ||
| 314 | + if (indexPath.section == 1) return 60; | ||
| 315 | + if (indexPath.section == 2) return 70; | ||
| 316 | + } | ||
| 317 | + return 0.001f; | ||
| 318 | +} | ||
| 319 | +-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section | ||
| 320 | +{ | ||
| 321 | + return section == 0 || ((self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder || self.showType == CNLiveCommuntyOrderShowTypeListYetOrder) && section == 1) || (self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder && section == 2) ? 50 : 0; | ||
| 322 | +} | ||
| 323 | +-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section | ||
| 324 | +{ | ||
| 325 | + if (section == 0 || ((self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder || self.showType == CNLiveCommuntyOrderShowTypeListYetOrder) && section == 1) || (self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder && section == 2)) { | ||
| 326 | + UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 50)]; | ||
| 327 | + view.backgroundColor = [UIColor clearColor]; | ||
| 328 | + | ||
| 329 | + UIView * radiusView = [[UIView alloc] initWithFrame:CGRectMake(10, 10, kScreenWidth - 20, 40)]; | ||
| 330 | + radiusView.backgroundColor = [UIColor whiteColor]; | ||
| 331 | + radiusView.layer.shadowColor = [UIColor blackColor].CGColor; | ||
| 332 | + radiusView.layer.shadowOffset = CGSizeMake(0, 0); | ||
| 333 | + radiusView.layer.shadowOpacity = 0.3; | ||
| 334 | + radiusView.layer.shadowRadius = 8; | ||
| 335 | + UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_WIDTH - 20, 40) byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(12, 12)]; | ||
| 336 | + CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; | ||
| 337 | + maskLayer.path = maskPath.CGPath; | ||
| 338 | + radiusView.layer.mask = maskLayer; | ||
| 339 | + [view insertSubview:radiusView belowSubview:view]; | ||
| 340 | + | ||
| 341 | + UILabel * nameLabel = [[UILabel alloc] init]; | ||
| 342 | + nameLabel.textColor = UIColorHex(#333333); | ||
| 343 | + nameLabel.lineBreakMode = NSLineBreakByTruncatingTail; | ||
| 344 | + nameLabel.numberOfLines = 1; | ||
| 345 | + nameLabel.font = [UIFont systemFontOfSize:15]; | ||
| 346 | + nameLabel.font = [UIFont boldSystemFontOfSize:15]; | ||
| 347 | + nameLabel.text = section == 0 ? [NSString stringWithFormat:@"订单编号:%@",self.createMdoel.idStr]:@"进度详情"; | ||
| 348 | + [view addSubview:nameLabel]; | ||
| 349 | + [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 350 | + make.centerY.mas_equalTo(view); | ||
| 351 | + make.left.mas_equalTo(view.mas_left).offset(20); | ||
| 352 | + }]; | ||
| 353 | + return view; | ||
| 354 | + }else{ | ||
| 355 | + return nil; | ||
| 356 | + } | ||
| 357 | +} | ||
| 358 | +-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section | ||
| 359 | +{ | ||
| 360 | + return section == 0 || ((self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder || self.showType == CNLiveCommuntyOrderShowTypeListYetOrder) && section == 1) || (self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder && section == 2) ? 10 : 0; | ||
| 361 | +} | ||
| 362 | +-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section | ||
| 363 | +{ | ||
| 364 | + if (section == 0 || ((self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder || self.showType == CNLiveCommuntyOrderShowTypeListYetOrder) && section == 1) || (self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder && section == 2)) { | ||
| 365 | + UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 10)]; | ||
| 366 | + view.backgroundColor = [UIColor clearColor]; | ||
| 367 | + | ||
| 368 | + UIView * radiusView = [[UIView alloc] initWithFrame:CGRectMake(10, 0, kScreenWidth - 20, 10)]; | ||
| 369 | + radiusView.backgroundColor = [UIColor whiteColor]; | ||
| 370 | + radiusView.layer.shadowColor = [UIColor blackColor].CGColor; | ||
| 371 | + radiusView.layer.shadowOffset = CGSizeMake(0, 0); | ||
| 372 | + radiusView.layer.shadowOpacity = 0.3; | ||
| 373 | + radiusView.layer.shadowRadius = 10; | ||
| 374 | + UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_WIDTH - 20, 10) byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(5, 5)]; | ||
| 375 | + CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; | ||
| 376 | + maskLayer.path = maskPath.CGPath; | ||
| 377 | + radiusView.layer.mask = maskLayer; | ||
| 378 | + [view insertSubview:radiusView belowSubview:view]; | ||
| 379 | + | ||
| 380 | + return view; | ||
| 381 | + }else{ | ||
| 382 | + return nil; | ||
| 383 | + } | ||
| 384 | +} | ||
| 385 | +@end |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyResultListViewController.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyResultListViewController.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntyResultListViewController.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/16. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.h> | ||
| 9 | + | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +@interface CNLiveCommuntyResultListViewController : CNCommonTableViewController | ||
| 13 | + | ||
| 14 | +/// 初始化查看详情界面 | ||
| 15 | +/// @param style 显示样式 | ||
| 16 | +/// @param signId id | ||
| 17 | +- (instancetype)initWithStyle:(UITableViewStyle)style SignId:(NSString *)signId; | ||
| 18 | + | ||
| 19 | +@end | ||
| 20 | + | ||
| 21 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyResultListViewController.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyResultListViewController.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntyResultListViewController.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/16. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntyResultListViewController.h" | ||
| 9 | + | ||
| 10 | +@interface CNLiveCommuntyResultListViewController ()<DZNEmptyDataSetSource,DZNEmptyDataSetDelegate> | ||
| 11 | + | ||
| 12 | +@property (nonatomic, copy) NSString * signId; | ||
| 13 | + | ||
| 14 | +@end | ||
| 15 | + | ||
| 16 | +@implementation CNLiveCommuntyResultListViewController | ||
| 17 | + | ||
| 18 | +- (instancetype)initWithStyle:(UITableViewStyle)style SignId:(NSString *)signId | ||
| 19 | +{ | ||
| 20 | + self = [super initWithStyle:style]; | ||
| 21 | + if (self) { | ||
| 22 | + _signId = signId; | ||
| 23 | + } | ||
| 24 | + return self; | ||
| 25 | +} | ||
| 26 | + | ||
| 27 | +- (void)viewDidLoad { | ||
| 28 | + [super viewDidLoad]; | ||
| 29 | + // Do any additional setup after loading the view. | ||
| 30 | + self.view.backgroundColor = [UIColor whiteColor]; | ||
| 31 | + self.title = @"报名成功"; | ||
| 32 | + | ||
| 33 | + [self setupWithBottemView]; | ||
| 34 | +} | ||
| 35 | +-(void)setupWithBottemView | ||
| 36 | +{ | ||
| 37 | + __weak typeof(self) weakSelf = self; | ||
| 38 | + UIView * bottemView = [[UIView alloc] init]; | ||
| 39 | + bottemView.backgroundColor = [UIColor whiteColor]; | ||
| 40 | + [self.view addSubview:bottemView]; | ||
| 41 | + [bottemView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 42 | + make.left.right.bottom.mas_equalTo(weakSelf.view); | ||
| 43 | + make.height.mas_equalTo(50); | ||
| 44 | + }]; | ||
| 45 | + | ||
| 46 | + NSMutableAttributedString * str = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"合计: 400元"]]; | ||
| 47 | + [str addAttribute:NSForegroundColorAttributeName value:UIColorHex(#222833) range:[str.string rangeOfString:@"合计: "]]; | ||
| 48 | + [str addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:14] range:[str.string rangeOfString:@"合计: "]]; | ||
| 49 | + [str addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:14] range:[str.string rangeOfString:@"合计: "]]; | ||
| 50 | + [str addAttribute:NSForegroundColorAttributeName value:UIColorHex(#DF0D23) range:[str.string rangeOfString:@"¥"]]; | ||
| 51 | + [str addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:9] range:[str.string rangeOfString:@"¥"]]; | ||
| 52 | + | ||
| 53 | + UILabel * priceLabel = [[UILabel alloc] init]; | ||
| 54 | + priceLabel.textColor = UIColorHex(#DF0D23); | ||
| 55 | + priceLabel.font = [UIFont boldSystemFontOfSize:16]; | ||
| 56 | + priceLabel.attributedText = str; | ||
| 57 | + [bottemView addSubview:priceLabel]; | ||
| 58 | + [priceLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 59 | + make.centerY.mas_equalTo(bottemView); | ||
| 60 | + make.right.mas_equalTo(bottemView.mas_right).offset(-10); | ||
| 61 | + }]; | ||
| 62 | + | ||
| 63 | +} | ||
| 64 | +- (void)initTableView | ||
| 65 | +{ | ||
| 66 | + [super initTableView]; | ||
| 67 | + self.tableView.delegate = self; | ||
| 68 | + self.tableView.dataSource = self; | ||
| 69 | + self.tableView.emptyDataSetSource = self; | ||
| 70 | + self.tableView.emptyDataSetDelegate = self; | ||
| 71 | + self.tableView.tableFooterView = [[UIView alloc] init]; | ||
| 72 | + self.tableView.backgroundColor = UIColorHex(#f9f9f9); | ||
| 73 | + self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; | ||
| 74 | +} | ||
| 75 | +-(void)layoutTableView | ||
| 76 | +{ | ||
| 77 | + [super layoutTableView]; | ||
| 78 | + self.tableView.frame = CGRectMake(0, kNavigationBarHeight, kScreenWidth, kScreenHeight - kNavigationBarHeight); | ||
| 79 | + self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 60, 0); | ||
| 80 | +} | ||
| 81 | +#pragma mark - DZNEmptyDataSetSource Methods | ||
| 82 | +- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView | ||
| 83 | +{ | ||
| 84 | + return [[NSAttributedString alloc] initWithString:@"暂无报名人员信息" attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16]}]; | ||
| 85 | +} | ||
| 86 | +-(UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView | ||
| 87 | +{ | ||
| 88 | + return [CNLiveCommuntTools cCommunt_setImageWithName:@"c_community_content_empty"]; | ||
| 89 | +} | ||
| 90 | +- (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView | ||
| 91 | +{ | ||
| 92 | + return [UIColor whiteColor]; | ||
| 93 | +} | ||
| 94 | + | ||
| 95 | +- (BOOL)emptyDataSetShouldDisplay:(UIScrollView *)scrollView | ||
| 96 | +{ | ||
| 97 | + return YES; | ||
| 98 | +} | ||
| 99 | + | ||
| 100 | +- (BOOL)emptyDataSetShouldAllowTouch:(UIScrollView *)scrollView | ||
| 101 | +{ | ||
| 102 | + return YES; | ||
| 103 | +} | ||
| 104 | + | ||
| 105 | +- (BOOL)emptyDataSetShouldAllowScroll:(UIScrollView *)scrollView | ||
| 106 | +{ | ||
| 107 | + return NO; | ||
| 108 | +} | ||
| 109 | +#pragma mark = | ||
| 110 | + | ||
| 111 | +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView | ||
| 112 | +{ | ||
| 113 | + return 1; | ||
| 114 | +} | ||
| 115 | + | ||
| 116 | +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | ||
| 117 | +{ | ||
| 118 | + return 3; | ||
| 119 | +} | ||
| 120 | + | ||
| 121 | +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 122 | +{ | ||
| 123 | + return [CNLiveCommuntSignUpOrderViewCell setTableView:tableView Dict:@{}]; | ||
| 124 | +} | ||
| 125 | + | ||
| 126 | +-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 127 | +{ | ||
| 128 | + return 30; | ||
| 129 | +} | ||
| 130 | +-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section | ||
| 131 | +{ | ||
| 132 | + return 50; | ||
| 133 | +} | ||
| 134 | +-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section | ||
| 135 | +{ | ||
| 136 | + UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 50)]; | ||
| 137 | + view.backgroundColor = [UIColor clearColor]; | ||
| 138 | + | ||
| 139 | + UIView * radiusView = [[UIView alloc] initWithFrame:CGRectMake(10, 10, kScreenWidth - 20, 40)]; | ||
| 140 | + radiusView.backgroundColor = [UIColor whiteColor]; | ||
| 141 | + radiusView.layer.shadowColor = [UIColor blackColor].CGColor; | ||
| 142 | + radiusView.layer.shadowOffset = CGSizeMake(0, 0); | ||
| 143 | + radiusView.layer.shadowOpacity = 0.3; | ||
| 144 | + radiusView.layer.shadowRadius = 8; | ||
| 145 | + UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_WIDTH - 20, 40) byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(12, 12)]; | ||
| 146 | + CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; | ||
| 147 | + maskLayer.path = maskPath.CGPath; | ||
| 148 | + radiusView.layer.mask = maskLayer; | ||
| 149 | + [view insertSubview:radiusView belowSubview:view]; | ||
| 150 | + | ||
| 151 | + UILabel * nameLabel = [[UILabel alloc] init]; | ||
| 152 | + nameLabel.textColor = UIColorHex(#333333); | ||
| 153 | + nameLabel.lineBreakMode = NSLineBreakByTruncatingTail; | ||
| 154 | + nameLabel.numberOfLines = 1; | ||
| 155 | + nameLabel.font = [UIFont systemFontOfSize:15]; | ||
| 156 | + nameLabel.font = [UIFont boldSystemFontOfSize:15]; | ||
| 157 | + nameLabel.text = [NSString stringWithFormat:@"参与人%ld",section+1]; | ||
| 158 | + [view addSubview:nameLabel]; | ||
| 159 | + [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 160 | + make.centerY.mas_equalTo(view); | ||
| 161 | + make.left.mas_equalTo(view.mas_left).offset(20); | ||
| 162 | + }]; | ||
| 163 | + | ||
| 164 | + UILabel * priceLabel = [[UILabel alloc] init]; | ||
| 165 | + priceLabel.textColor = UIColorHex(#DF0D23); | ||
| 166 | + priceLabel.font = [UIFont boldSystemFontOfSize:16]; | ||
| 167 | + priceLabel.text = @"200元"; | ||
| 168 | + [view addSubview:priceLabel]; | ||
| 169 | + [priceLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 170 | + make.centerY.mas_equalTo(view); | ||
| 171 | + make.right.mas_equalTo(view.mas_right).offset(-20); | ||
| 172 | + }]; | ||
| 173 | + | ||
| 174 | + | ||
| 175 | + return view; | ||
| 176 | +} | ||
| 177 | +-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section | ||
| 178 | +{ | ||
| 179 | + return 10; | ||
| 180 | +} | ||
| 181 | +-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section | ||
| 182 | +{ | ||
| 183 | + UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 10)]; | ||
| 184 | + view.backgroundColor = [UIColor clearColor]; | ||
| 185 | + | ||
| 186 | + UIView * radiusView = [[UIView alloc] initWithFrame:CGRectMake(10, 0, kScreenWidth - 20, 10)]; | ||
| 187 | + radiusView.backgroundColor = [UIColor whiteColor]; | ||
| 188 | + radiusView.layer.shadowColor = [UIColor blackColor].CGColor; | ||
| 189 | + radiusView.layer.shadowOffset = CGSizeMake(0, 0); | ||
| 190 | + radiusView.layer.shadowOpacity = 0.3; | ||
| 191 | + radiusView.layer.shadowRadius = 10; | ||
| 192 | + UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_WIDTH - 20, 10) byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(5, 5)]; | ||
| 193 | + CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; | ||
| 194 | + maskLayer.path = maskPath.CGPath; | ||
| 195 | + radiusView.layer.mask = maskLayer; | ||
| 196 | + [view insertSubview:radiusView belowSubview:view]; | ||
| 197 | + | ||
| 198 | + return view; | ||
| 199 | +} | ||
| 200 | +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 201 | +{ | ||
| 202 | + | ||
| 203 | +} | ||
| 204 | + | ||
| 205 | +@end |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyResultViewController.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyResultViewController.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntyResultViewController.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/8. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.h> | ||
| 9 | + | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +@interface CNLiveCommuntyResultViewController : CNCommonViewController | ||
| 13 | + | ||
| 14 | +/// 初始化界面显示 | ||
| 15 | +/// @param signUpModel 报名model | ||
| 16 | +- (instancetype)initWithSignUpModel:(CNLiveCommuntyActivitySignUpModel *)signUpModel; | ||
| 17 | +@end | ||
| 18 | + | ||
| 19 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyResultViewController.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyResultViewController.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntyResultViewController.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/8. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntyResultViewController.h" | ||
| 9 | + | ||
| 10 | +@interface CNLiveCommuntyResultViewController () | ||
| 11 | +@property (nonatomic, strong) QMUIButton * statusButton; | ||
| 12 | +@property (nonatomic, strong) QMUIFillButton * descButton; | ||
| 13 | + | ||
| 14 | +@property (nonatomic, strong) CNLiveCommuntyActivitySignUpModel *signUpModel; | ||
| 15 | + | ||
| 16 | +@property (nonatomic, assign) BOOL isSuccess; | ||
| 17 | +@end | ||
| 18 | + | ||
| 19 | +@implementation CNLiveCommuntyResultViewController | ||
| 20 | + | ||
| 21 | +/// 初始化界面显示 | ||
| 22 | +/// @param signUpModel 报名model | ||
| 23 | +- (instancetype)initWithSignUpModel:(CNLiveCommuntyActivitySignUpModel *)signUpModel | ||
| 24 | +{ | ||
| 25 | + self = [super init]; | ||
| 26 | + if (self) { | ||
| 27 | + _isSuccess = signUpModel != nil; | ||
| 28 | + _signUpModel = signUpModel; | ||
| 29 | + } | ||
| 30 | + return self; | ||
| 31 | +} | ||
| 32 | + | ||
| 33 | +- (void)viewDidLoad { | ||
| 34 | + [super viewDidLoad]; | ||
| 35 | + // Do any additional setup after loading the view. | ||
| 36 | + self.view.backgroundColor = [UIColor whiteColor]; | ||
| 37 | + self.title = self.isSuccess?@"支付成功":@"支付失败"; | ||
| 38 | + | ||
| 39 | + [self.view addSubview:self.statusButton]; | ||
| 40 | + [self.view addSubview:self.descButton]; | ||
| 41 | + __weak typeof(self) weakSelf = self; | ||
| 42 | + [self.statusButton mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 43 | + make.centerX.mas_equalTo(weakSelf.view); | ||
| 44 | + make.top.mas_equalTo(weakSelf.view).offset(150); | ||
| 45 | + }]; | ||
| 46 | + [self.descButton mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 47 | + make.centerX.mas_equalTo(weakSelf.view); | ||
| 48 | + make.top.mas_equalTo(weakSelf.statusButton.mas_bottom).offset(30); | ||
| 49 | + make.width.mas_equalTo(200); | ||
| 50 | + make.height.mas_equalTo(40); | ||
| 51 | + }]; | ||
| 52 | +} | ||
| 53 | +-(void)descAction:(UIButton *)button | ||
| 54 | +{ | ||
| 55 | + if (self.isSuccess) { | ||
| 56 | + CNLiveCommuntyResultListViewController * resultVC = [[CNLiveCommuntyResultListViewController alloc] initWithStyle:UITableViewStyleGrouped SignId:@""]; | ||
| 57 | + [self.navigationController pushViewController:resultVC animated:YES]; | ||
| 58 | + }else{ | ||
| 59 | + [self.navigationController popViewControllerAnimated:YES]; | ||
| 60 | + } | ||
| 61 | +} | ||
| 62 | + | ||
| 63 | +-(QMUIButton *)statusButton | ||
| 64 | +{ | ||
| 65 | + if (!_statusButton) { | ||
| 66 | + _statusButton = [[QMUIButton alloc] init]; | ||
| 67 | + [_statusButton setTitle:self.isSuccess?@"支付成功":@"支付失败" forState:UIControlStateNormal]; | ||
| 68 | + [_statusButton setTitle:self.isSuccess?@"支付成功":@"支付失败" forState:UIControlStateHighlighted]; | ||
| 69 | + [_statusButton setImage:[CNLiveCommuntTools cCommunt_setImageWithName:self.isSuccess?@"c_communty_result_success":@"c_communty_result_failer"] forState:UIControlStateNormal]; | ||
| 70 | + [_statusButton setImage:[CNLiveCommuntTools cCommunt_setImageWithName:self.isSuccess?@"c_communty_result_success":@"c_communty_result_failer"] forState:UIControlStateHighlighted]; | ||
| 71 | + [_statusButton setTitleColor:UIColorBlack forState:UIControlStateNormal]; | ||
| 72 | + _statusButton.titleLabel.font = [UIFont systemFontOfSize:20]; | ||
| 73 | + _statusButton.titleLabel.font = [UIFont boldSystemFontOfSize:20]; | ||
| 74 | + _statusButton.imagePosition = QMUIButtonImagePositionTop; | ||
| 75 | + _statusButton.userInteractionEnabled = NO; | ||
| 76 | + } | ||
| 77 | + return _statusButton; | ||
| 78 | +} | ||
| 79 | +-(QMUIFillButton *)descButton | ||
| 80 | +{ | ||
| 81 | + if (!_descButton) { | ||
| 82 | + _descButton = [[QMUIFillButton alloc] initWithFillColor:self.isSuccess?UIColorHex(#64C367):UIColorWhite titleTextColor:self.isSuccess?UIColorWhite:UIColorHex(#FF8585)]; | ||
| 83 | + [_descButton setTitle:self.isSuccess?@"查看详情":@"返回" forState:UIControlStateNormal]; | ||
| 84 | + [_descButton setTitle:self.isSuccess?@"查看详情":@"返回" forState:UIControlStateHighlighted]; | ||
| 85 | + _descButton.titleLabel.font = [UIFont systemFontOfSize:20]; | ||
| 86 | + _descButton.titleLabel.font = [UIFont boldSystemFontOfSize:20]; | ||
| 87 | + [_descButton addTarget:self action:@selector(descAction:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 88 | + if (!self.isSuccess) { | ||
| 89 | + _descButton.layer.cornerRadius = 20; | ||
| 90 | + _descButton.layer.masksToBounds = YES; | ||
| 91 | + _descButton.layer.borderColor = UIColorHex(#FF8585).CGColor; | ||
| 92 | + _descButton.layer.borderWidth = 1; | ||
| 93 | + } | ||
| 94 | + } | ||
| 95 | + return _descButton; | ||
| 96 | +} | ||
| 97 | +@end |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyUserEditViewController.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyUserEditViewController.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntyUserEditViewController.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/8. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.h> | ||
| 9 | + | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +@interface CNLiveCommuntyUserEditViewController : CNCommonTableViewController | ||
| 13 | + | ||
| 14 | +/// 添加人员 | ||
| 15 | +/// @param userDict 用户信息 | ||
| 16 | +- (instancetype)initWithUser:(NSDictionary *)userDict; | ||
| 17 | + | ||
| 18 | +@end | ||
| 19 | + | ||
| 20 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyUserEditViewController.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyUserEditViewController.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntyUserEditViewController.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/8. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntyUserEditViewController.h" | ||
| 9 | + | ||
| 10 | +@interface CNLiveCommuntyUserEditViewController () | ||
| 11 | +@property (nonatomic, strong) NSMutableArray * dataSource; | ||
| 12 | + | ||
| 13 | +@property (nonatomic, strong) NSDictionary * userDict; | ||
| 14 | +@end | ||
| 15 | + | ||
| 16 | +@implementation CNLiveCommuntyUserEditViewController | ||
| 17 | + | ||
| 18 | +- (instancetype)initWithUser:(NSDictionary *)userDict | ||
| 19 | +{ | ||
| 20 | + self = [super init]; | ||
| 21 | + if (self) { | ||
| 22 | + _userDict = userDict; | ||
| 23 | + } | ||
| 24 | + return self; | ||
| 25 | +} | ||
| 26 | + | ||
| 27 | +- (void)viewDidLoad { | ||
| 28 | + [super viewDidLoad]; | ||
| 29 | + // Do any additional setup after loading the view. | ||
| 30 | + self.view.backgroundColor = [UIColor whiteColor]; | ||
| 31 | + self.title = @"添加人员"; | ||
| 32 | + | ||
| 33 | + [self setupWithBottemView]; | ||
| 34 | +} | ||
| 35 | +-(void)initTableView | ||
| 36 | +{ | ||
| 37 | + [super initTableView]; | ||
| 38 | + self.tableView.delegate = self; | ||
| 39 | + self.tableView.dataSource = self; | ||
| 40 | + self.tableView.tableFooterView = [[UIView alloc] init]; | ||
| 41 | + self.tableView.backgroundColor = [UIColor whiteColor]; | ||
| 42 | + self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; | ||
| 43 | +} | ||
| 44 | +-(void)layoutTableView | ||
| 45 | +{ | ||
| 46 | + [super layoutTableView]; | ||
| 47 | + self.tableView.frame = CGRectMake(0, kNavigationBarHeight, kScreenWidth, kScreenHeight - kNavigationBarHeight - kVerticalTopHeight); | ||
| 48 | +} | ||
| 49 | +-(NSMutableArray *)dataSource | ||
| 50 | +{ | ||
| 51 | + if (!_dataSource) { | ||
| 52 | + _dataSource = [[NSMutableArray alloc] initWithArray:@[ | ||
| 53 | + @{@"name":@"姓名",@"placeholder":@"请输入姓名",@"isClick":@NO,@"isTextField":@YES,@"isTextView":@NO,@"isImage":@NO,@"isChick":@NO}, | ||
| 54 | + @{@"name":@"性别",@"placeholder":@"请输入联系地址",@"isClick":@NO,@"isTextField":@NO,@"isTextView":@NO,@"isImage":@NO,@"isChick":@YES}, | ||
| 55 | + @{@"name":@"年龄",@"placeholder":@"请输入年龄",@"isClick":@NO,@"isTextField":@YES,@"isTextView":@NO,@"isImage":@NO,@"isChick":@NO}, | ||
| 56 | + @{@"name":@"联系方式",@"placeholder":@"请输入联系方式",@"isClick":@NO,@"isTextField":@YES,@"isTextView":@NO,@"isImage":@NO,@"isChick":@NO}, | ||
| 57 | + ]]; | ||
| 58 | + } | ||
| 59 | + return _dataSource; | ||
| 60 | +} | ||
| 61 | +-(void)setupWithBottemView | ||
| 62 | +{ | ||
| 63 | + __weak typeof(self) weakSelf = self; | ||
| 64 | + UIView * bottemView = [[UIView alloc] init]; | ||
| 65 | + bottemView.backgroundColor = [UIColor whiteColor]; | ||
| 66 | + [self.view addSubview:bottemView]; | ||
| 67 | + [bottemView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 68 | + make.left.right.bottom.mas_equalTo(weakSelf.view); | ||
| 69 | + make.height.mas_equalTo(50); | ||
| 70 | + }]; | ||
| 71 | + | ||
| 72 | + UIButton * payButton = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 73 | + [payButton setTitle:@"完成" forState:UIControlStateNormal]; | ||
| 74 | + [payButton setTitle:@"完成" forState:UIControlStateHighlighted]; | ||
| 75 | + [payButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | ||
| 76 | + [payButton setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted]; | ||
| 77 | + payButton.backgroundColor = UIColorHex(#CD0302); | ||
| 78 | + payButton.layer.masksToBounds = YES; | ||
| 79 | + payButton.layer.cornerRadius = 18; | ||
| 80 | + payButton.titleLabel.font = [UIFont systemFontOfSize:16]; | ||
| 81 | + payButton.titleLabel.font = [UIFont boldSystemFontOfSize:16]; | ||
| 82 | + [payButton addTarget:self action:@selector(saveAction:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 83 | + [bottemView addSubview:payButton]; | ||
| 84 | + [payButton mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 85 | + make.centerY.mas_equalTo(bottemView); | ||
| 86 | + make.right.mas_equalTo(bottemView.mas_right).offset(-10); | ||
| 87 | + make.height.mas_equalTo(36); | ||
| 88 | + make.width.mas_equalTo(kScreenWidth - 30); | ||
| 89 | + }]; | ||
| 90 | +} | ||
| 91 | +-(void)saveAction:(UIButton *)saveButton | ||
| 92 | +{ | ||
| 93 | + NSMutableDictionary * paramDict = [[NSMutableDictionary alloc] initWithDictionary:self.userDict]; | ||
| 94 | + for (int i = 0; i < self.dataSource.count; i ++) { | ||
| 95 | + CNLiveCommuntSubInputTableView * userCell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:i inSection:0]]; | ||
| 96 | + if (i == 0) [paramDict addString:[userCell.contentField.text isNotBlank]?userCell.contentField.text:@"" forKey:@"name"]; | ||
| 97 | + if (i == 1) [paramDict addString:[userCell.sex isEqualToString:@"女"]?@"0":@"1" forKey:@"gender"]; | ||
| 98 | + if (i == 2) { | ||
| 99 | + NSString * age = [userCell.contentField.text isNotBlank]?userCell.contentField.text:@""; | ||
| 100 | + if (![age isNotBlank] || ![self isInt:age] || [age integerValue] > 120 || [age integerValue] < 1) { | ||
| 101 | + [QMUITips showWithText:@"年龄填写错误"]; | ||
| 102 | + return; | ||
| 103 | + }else{ | ||
| 104 | + [paramDict addString:age forKey:@"age"]; | ||
| 105 | + } | ||
| 106 | + } | ||
| 107 | + if (i == 3) { | ||
| 108 | + NSString * phone = [userCell.contentField.text isNotBlank]?userCell.contentField.text:@""; | ||
| 109 | + if (![phone isNotBlank] || phone.length < 6) { | ||
| 110 | + [QMUITips showWithText:@"联系电话填写错误"]; | ||
| 111 | + return; | ||
| 112 | + }else{ | ||
| 113 | + [paramDict addString:phone forKey:@"mobile"]; | ||
| 114 | + } | ||
| 115 | + } | ||
| 116 | + } | ||
| 117 | + if ([[paramDict allValues] containsObject:@""]) { | ||
| 118 | + NSInteger index = [[paramDict allValues] indexOfObject:@""]; | ||
| 119 | + NSString * key = [[paramDict allKeys] objectAtIndex:index]; | ||
| 120 | + if ([key isEqualToString:@"name"]) [QMUITips showWithText:@"联系人不能为空"]; | ||
| 121 | + if ([key isEqualToString:@"age"]) [QMUITips showWithText:@"年龄不能为空"]; | ||
| 122 | + if ([key isEqualToString:@"mobile"]) [QMUITips showWithText:@"联系方式不能为空"]; | ||
| 123 | + return; | ||
| 124 | + } | ||
| 125 | + __weak typeof(self) weakSelf = self; | ||
| 126 | + [CNLiveCommuntViewModel requestWithCommuntySaveInfoUsersMentUserDict:paramDict isSave:YES CompleterBlock:^(NSArray * _Nonnull userArray, BOOL isSave) { | ||
| 127 | + [weakSelf.navigationController popViewControllerAnimated:YES]; | ||
| 128 | + }]; | ||
| 129 | +} | ||
| 130 | +- (BOOL)isInt:(NSString*)string{ | ||
| 131 | + NSScanner* scan = [NSScanner scannerWithString:string]; | ||
| 132 | + int val; | ||
| 133 | + return[scan scanInt:&val] && [scan isAtEnd]; | ||
| 134 | +} | ||
| 135 | + | ||
| 136 | +#pragma mark = | ||
| 137 | +-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView | ||
| 138 | +{ | ||
| 139 | + return 1; | ||
| 140 | +} | ||
| 141 | +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | ||
| 142 | +{ | ||
| 143 | + return self.dataSource.count; | ||
| 144 | +} | ||
| 145 | +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 146 | +{ | ||
| 147 | + CNLiveCommuntSubInputTableView * inpView = [CNLiveCommuntSubInputTableView setTableView:tableView SubDict:self.dataSource[indexPath.row] indexs:indexPath.row UserInfo:self.userDict]; | ||
| 148 | + return inpView; | ||
| 149 | +} | ||
| 150 | +-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 151 | +{ | ||
| 152 | + return 50.0f; | ||
| 153 | +} | ||
| 154 | +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 155 | +{ | ||
| 156 | + | ||
| 157 | +} | ||
| 158 | +@end |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyUserListViewController.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyUserListViewController.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntyUserListViewController.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/7. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.h> | ||
| 9 | + | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +@interface CNLiveCommuntyUserListViewController : CNCommonTableViewController | ||
| 13 | + | ||
| 14 | +/// 初始化报名界面 | ||
| 15 | +/// @param completerBlock 返回 | ||
| 16 | +- (instancetype)initWithStyle:(UITableViewStyle)style CompleterBlock:(void(^)(NSArray * userArray))completerBlock; | ||
| 17 | + | ||
| 18 | +@end | ||
| 19 | + | ||
| 20 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyUserListViewController.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewController/CNLiveCommuntyUserListViewController.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntyUserListViewController.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/7. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntyUserListViewController.h" | ||
| 9 | + | ||
| 10 | +@interface CNLiveCommuntyUserListViewController ()<CNLiveCommuntSignUpUserViewDelegate,DZNEmptyDataSetSource,DZNEmptyDataSetDelegate> | ||
| 11 | +@property (nonatomic, strong) NSMutableArray *userArray; | ||
| 12 | +@property (nonatomic, strong) NSMutableArray *selectArray; | ||
| 13 | +@property (nonatomic, copy) void(^completerBlock)(NSArray * userArray); | ||
| 14 | +@end | ||
| 15 | + | ||
| 16 | +@implementation CNLiveCommuntyUserListViewController | ||
| 17 | + | ||
| 18 | +- (void)viewDidAppear:(BOOL)animated | ||
| 19 | +{ | ||
| 20 | + [super viewDidAppear:animated]; | ||
| 21 | + __weak typeof(self) weakSelf = self; | ||
| 22 | + [CNLiveCommuntViewModel requestWithCommuntySaveInfoUsersMentUserDict:@{} isSave:NO CompleterBlock:^(NSArray * _Nonnull userArray, BOOL isSave) { | ||
| 23 | + weakSelf.userArray = [[NSMutableArray alloc] initWithArray:userArray]; | ||
| 24 | + [weakSelf.tableView reloadData]; | ||
| 25 | + [weakSelf setupWithBottemView:weakSelf.userArray.count > 0]; | ||
| 26 | + }]; | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +- (instancetype)initWithStyle:(UITableViewStyle)style CompleterBlock:(void(^)(NSArray * userArray))completerBlock | ||
| 30 | +{ | ||
| 31 | + self = [super initWithStyle:style]; | ||
| 32 | + if (self) { | ||
| 33 | + _completerBlock = completerBlock; | ||
| 34 | + } | ||
| 35 | + return self; | ||
| 36 | +} | ||
| 37 | + | ||
| 38 | +- (void)viewDidLoad { | ||
| 39 | + [super viewDidLoad]; | ||
| 40 | + // Do any additional setup after loading the view. | ||
| 41 | + self.view.backgroundColor = UIColorHex(#F9F9F9); | ||
| 42 | + self.title = @"添加参与人"; | ||
| 43 | + | ||
| 44 | + self.selectArray = [[NSMutableArray alloc] init]; | ||
| 45 | + | ||
| 46 | + UIButton * submiteBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 47 | + submiteBtn.frame = CGRectMake(0, 0, 50, 14); | ||
| 48 | + [submiteBtn setTitle:@"新增参与人" forState:UIControlStateNormal]; | ||
| 49 | + [submiteBtn setTitleColor:UIColorHex(#FD862E) forState:UIControlStateNormal]; | ||
| 50 | + submiteBtn.backgroundColor = [UIColor whiteColor]; | ||
| 51 | + submiteBtn.titleLabel.font = [UIFont systemFontOfSize:14]; | ||
| 52 | + [submiteBtn addTarget:self action:@selector(rightBarButtonAction:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 53 | + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:submiteBtn]; | ||
| 54 | +} | ||
| 55 | +-(void)rightBarButtonAction:(UIButton *)button | ||
| 56 | +{ | ||
| 57 | + CNLiveCommuntyUserEditViewController * editVC = [[CNLiveCommuntyUserEditViewController alloc] initWithUser:@{}]; | ||
| 58 | + [self.navigationController pushViewController:editVC animated:YES]; | ||
| 59 | +} | ||
| 60 | +-(void)setupWithBottemView:(BOOL)isShow | ||
| 61 | +{ | ||
| 62 | + if (isShow) { | ||
| 63 | + __weak typeof(self) weakSelf = self; | ||
| 64 | + UIView * bottemView = [[UIView alloc] init]; | ||
| 65 | + bottemView.backgroundColor = [UIColor whiteColor]; | ||
| 66 | + [self.view addSubview:bottemView]; | ||
| 67 | + [bottemView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 68 | + make.left.right.bottom.mas_equalTo(weakSelf.view); | ||
| 69 | + make.height.mas_equalTo(50); | ||
| 70 | + }]; | ||
| 71 | + | ||
| 72 | + UIButton * payButton = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 73 | + [payButton setTitle:@"确定" forState:UIControlStateNormal]; | ||
| 74 | + [payButton setTitle:@"确定" forState:UIControlStateHighlighted]; | ||
| 75 | + [payButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | ||
| 76 | + [payButton setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted]; | ||
| 77 | + payButton.backgroundColor = UIColorHex(#CD0302); | ||
| 78 | + payButton.layer.masksToBounds = YES; | ||
| 79 | + payButton.layer.cornerRadius = 18; | ||
| 80 | + payButton.titleLabel.font = [UIFont systemFontOfSize:16]; | ||
| 81 | + payButton.titleLabel.font = [UIFont boldSystemFontOfSize:16]; | ||
| 82 | + [payButton addTarget:self action:@selector(doneAction:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 83 | + [bottemView addSubview:payButton]; | ||
| 84 | + [payButton mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 85 | + make.centerY.mas_equalTo(bottemView); | ||
| 86 | + make.right.mas_equalTo(bottemView.mas_right).offset(-10); | ||
| 87 | + make.height.mas_equalTo(36); | ||
| 88 | + make.width.mas_equalTo(kScreenWidth - 30); | ||
| 89 | + }]; | ||
| 90 | + }else{ | ||
| 91 | + UIView * bottemView = [[UIView alloc] initWithFrame:CGRectZero]; | ||
| 92 | + bottemView.backgroundColor = [UIColor whiteColor]; | ||
| 93 | + [self.view addSubview:bottemView]; | ||
| 94 | + } | ||
| 95 | +} | ||
| 96 | +-(void)doneAction:(UIButton *)button | ||
| 97 | +{ | ||
| 98 | + if (self.completerBlock) self.completerBlock(self.selectArray); | ||
| 99 | + [self.navigationController popViewControllerAnimated:YES]; | ||
| 100 | +} | ||
| 101 | +- (void)initTableView | ||
| 102 | +{ | ||
| 103 | + [super initTableView]; | ||
| 104 | + self.tableView.delegate = self; | ||
| 105 | + self.tableView.dataSource = self; | ||
| 106 | + self.tableView.emptyDataSetSource = self; | ||
| 107 | + self.tableView.emptyDataSetDelegate = self; | ||
| 108 | + self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; | ||
| 109 | + self.tableView.tableFooterView = [[UIView alloc] init]; | ||
| 110 | + self.tableView.backgroundColor = UIColorHex(#F9F9F9); | ||
| 111 | +} | ||
| 112 | +-(void)layoutTableView | ||
| 113 | +{ | ||
| 114 | + [super layoutTableView]; | ||
| 115 | + self.tableView.frame = CGRectMake(0, kNavigationBarHeight, kScreenWidth, kScreenHeight - kNavigationBarHeight); | ||
| 116 | + self.tableView.contentInset = UIEdgeInsetsMake(10, 0, 60, 0); | ||
| 117 | +} | ||
| 118 | +/// 跳转到编辑或添加人员界面 | ||
| 119 | +/// @param subDict 显示信息 | ||
| 120 | +-(void)setCommuntPushAddWithEditUserViewController:(NSDictionary *)subDict | ||
| 121 | +{ | ||
| 122 | + CNLiveCommuntyUserEditViewController * editVC = [[CNLiveCommuntyUserEditViewController alloc] initWithUser:subDict]; | ||
| 123 | + [self.navigationController pushViewController:editVC animated:YES]; | ||
| 124 | +} | ||
| 125 | +/// 选中相关参与人 | ||
| 126 | +/// @param subDict 显示信息 | ||
| 127 | +-(void)setCommuntSelectAddWithEditUserViewController:(NSDictionary *)subDict isSelect:(BOOL)isSelect | ||
| 128 | +{ | ||
| 129 | + if (isSelect) { | ||
| 130 | + [self.selectArray addObject:subDict]; | ||
| 131 | + }else{ | ||
| 132 | + if ([self.selectArray containsObject:subDict]) [self.selectArray removeObject:subDict]; | ||
| 133 | + } | ||
| 134 | +} | ||
| 135 | +#pragma mark - DZNEmptyDataSetSource Methods | ||
| 136 | +- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView | ||
| 137 | +{ | ||
| 138 | + return [[NSAttributedString alloc] initWithString:@"暂无参与人" attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16]}]; | ||
| 139 | +} | ||
| 140 | +-(UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView | ||
| 141 | +{ | ||
| 142 | + return [CNLiveCommuntTools cCommunt_setImageWithName:@"c_community_content_empty"]; | ||
| 143 | +} | ||
| 144 | +- (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView | ||
| 145 | +{ | ||
| 146 | + return [UIColor whiteColor]; | ||
| 147 | +} | ||
| 148 | + | ||
| 149 | +- (BOOL)emptyDataSetShouldDisplay:(UIScrollView *)scrollView | ||
| 150 | +{ | ||
| 151 | + return YES; | ||
| 152 | +} | ||
| 153 | + | ||
| 154 | +- (BOOL)emptyDataSetShouldAllowTouch:(UIScrollView *)scrollView | ||
| 155 | +{ | ||
| 156 | + return YES; | ||
| 157 | +} | ||
| 158 | + | ||
| 159 | +- (BOOL)emptyDataSetShouldAllowScroll:(UIScrollView *)scrollView | ||
| 160 | +{ | ||
| 161 | + return NO; | ||
| 162 | +} | ||
| 163 | +#pragma mark = | ||
| 164 | +-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView | ||
| 165 | +{ | ||
| 166 | + return 1; | ||
| 167 | +} | ||
| 168 | +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | ||
| 169 | +{ | ||
| 170 | + return self.userArray.count; | ||
| 171 | +} | ||
| 172 | +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 173 | +{ | ||
| 174 | + CNLiveCommuntSignUpUserViewCell * userView = [CNLiveCommuntSignUpUserViewCell setTableView:tableView isAddUser:YES UserDict:self.userArray[indexPath.row]]; | ||
| 175 | + userView.delegate = self; | ||
| 176 | + return userView; | ||
| 177 | +} | ||
| 178 | +-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 179 | +{ | ||
| 180 | + return 50; | ||
| 181 | +} | ||
| 182 | +-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section | ||
| 183 | +{ | ||
| 184 | + return self.userArray.count == 0 ? 0 : 10; | ||
| 185 | +} | ||
| 186 | +-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section | ||
| 187 | +{ | ||
| 188 | + if (self.userArray.count > 0) { | ||
| 189 | + UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 10)]; | ||
| 190 | + view.backgroundColor = [UIColor clearColor]; | ||
| 191 | + | ||
| 192 | + UIView * radiusView = [[UIView alloc] initWithFrame:CGRectMake(10, 0, kScreenWidth - 20, 10)]; | ||
| 193 | + radiusView.backgroundColor = [UIColor whiteColor]; | ||
| 194 | + radiusView.layer.shadowColor = [UIColor blackColor].CGColor; | ||
| 195 | + radiusView.layer.shadowOffset = CGSizeMake(0, 0); | ||
| 196 | + radiusView.layer.shadowOpacity = 0.3; | ||
| 197 | + radiusView.layer.shadowRadius = 10; | ||
| 198 | + UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_WIDTH - 20, 10) byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(5, 5)]; | ||
| 199 | + CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; | ||
| 200 | + maskLayer.path = maskPath.CGPath; | ||
| 201 | + radiusView.layer.mask = maskLayer; | ||
| 202 | + [view insertSubview:radiusView belowSubview:view]; | ||
| 203 | + | ||
| 204 | + return view; | ||
| 205 | + }else{ | ||
| 206 | + return nil; | ||
| 207 | + } | ||
| 208 | + | ||
| 209 | +} | ||
| 210 | +-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section | ||
| 211 | +{ | ||
| 212 | + return self.userArray.count == 0 ? 0 : 10; | ||
| 213 | +} | ||
| 214 | +-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section | ||
| 215 | +{ | ||
| 216 | + if (self.userArray.count > 0) { | ||
| 217 | + UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 10)]; | ||
| 218 | + view.backgroundColor = [UIColor clearColor]; | ||
| 219 | + | ||
| 220 | + UIView * radiusView = [[UIView alloc] initWithFrame:CGRectMake(10, 0, kScreenWidth - 20, 10)]; | ||
| 221 | + radiusView.backgroundColor = [UIColor whiteColor]; | ||
| 222 | + radiusView.layer.shadowColor = [UIColor blackColor].CGColor; | ||
| 223 | + radiusView.layer.shadowOffset = CGSizeMake(0, 0); | ||
| 224 | + radiusView.layer.shadowOpacity = 0.3; | ||
| 225 | + radiusView.layer.shadowRadius = 10; | ||
| 226 | + UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_WIDTH - 20, 10) byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(5, 5)]; | ||
| 227 | + CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; | ||
| 228 | + maskLayer.path = maskPath.CGPath; | ||
| 229 | + radiusView.layer.mask = maskLayer; | ||
| 230 | + [view insertSubview:radiusView belowSubview:view]; | ||
| 231 | + | ||
| 232 | + return view; | ||
| 233 | + }else{ | ||
| 234 | + return [UIView new]; | ||
| 235 | + } | ||
| 236 | +} | ||
| 237 | +@end |
CNLiveCommunitModule/Classes/ViewModel/CNLiveCommuntTools.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewModel/CNLiveCommuntTools.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntTools.h | ||
| 3 | +// CNLiveCommunitModule-CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/1. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <Foundation/Foundation.h> | ||
| 9 | + | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +@interface CNLiveCommuntTools : NSObject | ||
| 13 | + | ||
| 14 | +/// 获取组件中的图片资源 | ||
| 15 | +/// @param imageName 图片名称 | ||
| 16 | ++(UIImage *)cCommunt_setImageWithName:(NSString *)imageName; | ||
| 17 | + | ||
| 18 | +/// 获取当前控制器 | ||
| 19 | ++(UIViewController *)cCommunt_currentViewController; | ||
| 20 | + | ||
| 21 | +@end | ||
| 22 | + | ||
| 23 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/ViewModel/CNLiveCommuntTools.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewModel/CNLiveCommuntTools.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntTools.m | ||
| 3 | +// CNLiveCommunitModule-CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/1. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntTools.h" | ||
| 9 | + | ||
| 10 | +@implementation CNLiveCommuntTools | ||
| 11 | +/// 获取组件中的图片资源 | ||
| 12 | +/// @param imageName 图片名称 | ||
| 13 | ++(UIImage *)cCommunt_setImageWithName:(NSString *)imageName | ||
| 14 | +{ | ||
| 15 | + return [CNLiveCommuntTools cnlive_cCommuntGetImageName:imageName bundle:@"CNLiveCommunitModule.bundle/CNLiveCommunitModule" targetClass:[CNLiveCommuntTools class]]; | ||
| 16 | +} | ||
| 17 | + | ||
| 18 | +/// 获取当前控制器 | ||
| 19 | ++(UIViewController *)cCommunt_currentViewController | ||
| 20 | +{ | ||
| 21 | + UIViewController *viewController = [UIApplication sharedApplication].keyWindow.rootViewController; | ||
| 22 | + | ||
| 23 | + while (viewController) { | ||
| 24 | + if ([viewController isKindOfClass:[UITabBarController class]]) { | ||
| 25 | + UITabBarController *tbvc = (UITabBarController*)viewController; | ||
| 26 | + viewController = tbvc.selectedViewController; | ||
| 27 | + } else if ([viewController isKindOfClass:[UINavigationController class]]) { | ||
| 28 | + UINavigationController *nvc = (UINavigationController*)viewController; | ||
| 29 | + viewController = nvc.topViewController; | ||
| 30 | + } else if (viewController.presentedViewController) { | ||
| 31 | + viewController = viewController.presentedViewController; | ||
| 32 | + } else if ([viewController isKindOfClass:[UISplitViewController class]] && | ||
| 33 | + ((UISplitViewController *)viewController).viewControllers.count > 0) { | ||
| 34 | + UISplitViewController *svc = (UISplitViewController *)viewController; | ||
| 35 | + viewController = svc.viewControllers.lastObject; | ||
| 36 | + } else { | ||
| 37 | + return viewController; | ||
| 38 | + } | ||
| 39 | + } | ||
| 40 | + return viewController; | ||
| 41 | +} | ||
| 42 | + | ||
| 43 | +/// 私有获取图片方法 | ||
| 44 | +/// @param imageName 图片名称 | ||
| 45 | +/// @param bundlePath 路径 | ||
| 46 | +/// @param targetClass targetClass | ||
| 47 | ++ (UIImage *)cnlive_cCommuntGetImageName:(NSString *)imageName bundle:(NSString *)bundlePath targetClass:(Class)targetClass { | ||
| 48 | + NSBundle *bundle = [NSBundle bundleForClass:targetClass]; | ||
| 49 | + NSURL *url = [bundle URLForResource:bundlePath withExtension:@"bundle"]; | ||
| 50 | + if (!url) { | ||
| 51 | + return [UIImage new]; | ||
| 52 | + } | ||
| 53 | + NSBundle *targetBundle = [NSBundle bundleWithURL:url]; | ||
| 54 | + if (!targetBundle) { | ||
| 55 | + return [UIImage new]; | ||
| 56 | + } | ||
| 57 | + UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil]; | ||
| 58 | + if (image) { | ||
| 59 | + return image; | ||
| 60 | + }else { | ||
| 61 | + if ([UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil]) { | ||
| 62 | + return [UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil]; | ||
| 63 | + }else{ | ||
| 64 | + return [UIImage new]; | ||
| 65 | + } | ||
| 66 | + } | ||
| 67 | +} | ||
| 68 | +@end |
CNLiveCommunitModule/Classes/ViewModel/CNLiveCommuntViewModel.h
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewModel/CNLiveCommuntViewModel.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntViewModel.h | ||
| 3 | +// CNLiveCommunitModule-CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/1. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <Foundation/Foundation.h> | ||
| 9 | +#import "CNLiveCommuntyHomeModel.h" | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +typedef enum : NSUInteger { | ||
| 13 | + CNLiveCommuntListShowTypeHome,//公益活动显示类型 | ||
| 14 | + CNLiveCommuntListShowTypeRecord,//活动记录 | ||
| 15 | + CNLiveCommuntListShowTypeRepair,//报修记录 | ||
| 16 | +} CNLiveCommuntListShowType; | ||
| 17 | + | ||
| 18 | + | ||
| 19 | + | ||
| 20 | +@interface CNLiveCommuntViewModel : NSObject | ||
| 21 | + | ||
| 22 | +/// 读取小区APP首页 | ||
| 23 | +/// @param nbhdId 小区id | ||
| 24 | +/// @param completerBlock 返回数据 | ||
| 25 | ++(void)requestWithCommuntyHomeNBhdAppIndexWithNBhdId:(NSString *)nbhdId CompleterBlock:(void(^)(NSArray * homeArray))completerBlock; | ||
| 26 | + | ||
| 27 | +/// 获取小区列表 | ||
| 28 | +/// @param completerBlock 返回数据 | ||
| 29 | ++(void)requestWithCommuntyHomeListIndexWithCompleterBlock:(void(^)(NSArray * listArray))completerBlock; | ||
| 30 | + | ||
| 31 | +/// 请求获取活动列表数据 | ||
| 32 | +/// @param nbhdId 小区id | ||
| 33 | +/// @param showType 请求列表界面类型 | ||
| 34 | +/// @param index 索引 对于报修记录及报名记录有效 | ||
| 35 | +/// @param page 页数 | ||
| 36 | +/// @param completerBlock 返回数据 | ||
| 37 | ++(void)requestWithCommuntyHomeActivityForNBHdId:(NSString *)nbhdId ShowType:(CNLiveCommuntListShowType)showType Index:(NSInteger)index Page:(NSInteger)page completerBlock:(void(^)(NSArray * dataArray,BOOL isLastPage))completerBlock; | ||
| 38 | + | ||
| 39 | +/// 获取维修项目 | ||
| 40 | +/// @param nbhdId 小区id | ||
| 41 | +/// @param completerBlock 返回数据 | ||
| 42 | ++(void)requestWithCommuntyHomeMaintenForNBHdId:(NSString *)nbhdId | ||
| 43 | + CompleterBlock:(void(^)(NSArray * dataArray))completerBlock; | ||
| 44 | + | ||
| 45 | +/// 获取维修上面时间 | ||
| 46 | +/// @param interval 当前时间之后的时间 | ||
| 47 | +/// @param completerBlock 返回数据 | ||
| 48 | ++(void)requestWithCommuntyHomeMaintenForTimeInterval:(NSInteger)interval CompleterBlock:(void(^)(NSArray * dataArray))completerBlock; | ||
| 49 | + | ||
| 50 | +/// 提交报修 | ||
| 51 | +/// @param param 参数 | ||
| 52 | +/// @param nbhdId 小区id | ||
| 53 | +/// @param completerBlock 返回数据 | ||
| 54 | ++(void)requestWithCommuntyHomeMaintenPushWithParamDict:(NSDictionary *)param nbhdId:(NSString *)nbhdId CompleterBlock:(void(^)(CNLiveCommuntyActivityMaintainsCreateModel * createModel))completerBlock; | ||
| 55 | + | ||
| 56 | +/// 获取维修订单详情 | ||
| 57 | +/// @param maintenId 报修id | ||
| 58 | +/// @param completerBlock 返回数据 | ||
| 59 | ++(void)requestWithCommuntyMaintenDetailForMaintenId:(NSString *)maintenId isChat:(BOOL)isChat CompleterBlock:(void(^)(CNLiveCommuntyActivityMaintainsCreateModel * createModel))completerBlock; | ||
| 60 | + | ||
| 61 | +/// 抢单 | ||
| 62 | +/// @param orderId 订单id | ||
| 63 | +/// @param type 类型 1:接单 0:取消接单 | ||
| 64 | +/// @param completerBlock 结果返回 | ||
| 65 | ++(void)requestWithCommuntyGrabOrderMentOrderId:(NSString *)orderId type:(BOOL)type CompleterBlock:(void(^)(void))completerBlock; | ||
| 66 | + | ||
| 67 | +/// 设置线下已经支付 | ||
| 68 | +/// @param orderId 订单id | ||
| 69 | +/// @param completerBlock 回去结果 | ||
| 70 | ++(void)requestWithCommuntyMaintenPayMentOrderId:(NSString *)orderId CompleterBlock:(void(^)(void))completerBlock; | ||
| 71 | + | ||
| 72 | +/// 用户取消订单 | ||
| 73 | +/// @param orderId 订单id | ||
| 74 | +/// @param completerBlock 结果返回 | ||
| 75 | ++(void)requestWithCommuntyCancleOrderMentOrderId:(NSString *)orderId CompleterBlock:(void(^)(void))completerBlock; | ||
| 76 | + | ||
| 77 | +/// 设置维修费用 | ||
| 78 | +/// @param orderId 订单id | ||
| 79 | +/// @param totalFee 价格,以分为单位 | ||
| 80 | +/// @param completerBlock 结果返回 | ||
| 81 | ++(void)requestWithCommuntyTotalFeeOrderMentOrderId:(NSString *)orderId totalFee:(NSString *)totalFee CompleterBlock:(void(^)(NSString * payUrl))completerBlock; | ||
| 82 | + | ||
| 83 | +/// 活动报名 | ||
| 84 | +/// @param handworkId 手工活动id | ||
| 85 | +/// @param users 参与人 | ||
| 86 | +/// @param completerBlock 结果返回 | ||
| 87 | ++(void)requestWithCommuntySingUpOrderMentHandworkId:(NSString *)handworkId Ussers:(NSArray *)users CompleterBlock:(void(^)(CNLiveCommuntyActivitySignUpModel * signUpModel))completerBlock; | ||
| 88 | + | ||
| 89 | +/// 对用户信息进行存读取操作 | ||
| 90 | +/// @param userDict 用户信息 | ||
| 91 | +/// @param isSave 读&存 | ||
| 92 | +/// @param completerBlock 返回结果 | ||
| 93 | ++(void)requestWithCommuntySaveInfoUsersMentUserDict:(NSDictionary *)userDict isSave:(BOOL)isSave CompleterBlock:(void(^)(NSArray * userArray, BOOL isSave))completerBlock; | ||
| 94 | + | ||
| 95 | +/// 对活动进行评论id | ||
| 96 | +/// @param contentId 订单Id | ||
| 97 | +/// @param handworkId 活动Id | ||
| 98 | +/// @param comment 用户id | ||
| 99 | +/// @param imgs 评价内容 | ||
| 100 | +/// @param isAnonymity 评价图片 | ||
| 101 | +/// @param completerBlock 是否匿名 true:匿名 | ||
| 102 | ++(void)requestWithCommuntyCommentsInfoWithContentId:(NSString *)contentId handworkId:(NSString *)handworkId comment:(NSString *)comment imgs:(NSString *)imgs isAnonymity:(BOOL)isAnonymity CompleterBlock:(void(^)(void))completerBlock; | ||
| 103 | + | ||
| 104 | +/// 获取活动详情界面接口 | ||
| 105 | +/// @param activityId 活动id | ||
| 106 | +/// @param completerBlock 返回结果 | ||
| 107 | ++(void)requestWithCommuntyActivityDetailMentActivityId:(NSString *)activityId CompleterBlock:(void(^)(CNLiveCommuntyActivityDetailModel * detailModel))completerBlock; | ||
| 108 | + | ||
| 109 | +@end | ||
| 110 | + | ||
| 111 | +NS_ASSUME_NONNULL_END |
CNLiveCommunitModule/Classes/ViewModel/CNLiveCommuntViewModel.m
0 → 100644
| 1 | +++ a/CNLiveCommunitModule/Classes/ViewModel/CNLiveCommuntViewModel.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommuntViewModel.m | ||
| 3 | +// CNLiveCommunitModule-CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/1. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveCommuntViewModel.h" | ||
| 9 | +#import <CommonCrypto/CommonDigest.h> | ||
| 10 | + | ||
| 11 | +//自动选择微信OR支付宝 | ||
| 12 | +#define CNCCommuntHomePayApiContentURL cn_API_OpenApi2(@"/unifypay/pay") | ||
| 13 | + | ||
| 14 | +//获取首页数据 | ||
| 15 | +#define CNCCommuntHomeListContentURL cn_API_CommuntyApi(@"/user/nbhdAppIndex") | ||
| 16 | +//获取小区列表数据 | ||
| 17 | +#define CNCCommuntNBhdListContentURL cn_API_CommuntyApi(@"/user/nbhdList") | ||
| 18 | +//提交报修 | ||
| 19 | +#define CNCCommuntAddMaintainContentURL cn_API_CommuntyApi(@"/repairApi/add") | ||
| 20 | +//活动报名 | ||
| 21 | +#define CNCCommuntPayMentSignUpOrderContentURL cn_API_CommuntyApi(@"/signupApi/signup") | ||
| 22 | +//获取活动列表数据 | ||
| 23 | +#define CNCCommuntListHandContentURL cn_API_CommuntyApi(@"/handworkApi/listHandwork") | ||
| 24 | +//获取活动记录列表数据 | ||
| 25 | +#define CNCCommuntListOrderContentURL cn_API_CommuntyApi(@"/signupApi/userOrders") | ||
| 26 | +//获取保修记录列表数据 | ||
| 27 | +#define CNCCommuntListRepairContentURL cn_API_CommuntyApi(@"/repairApi/getUserOrders") | ||
| 28 | +//获取获取维修项目数据 | ||
| 29 | +#define CNCCommuntListMaintainContentURL cn_API_CommuntyApi(@"/repairApi/getMaintains") | ||
| 30 | +//获取报修详情 | ||
| 31 | +#define CNCCommuntMaintainDetailContentURL cn_API_CommuntyApi(@"/repairApi/getOrder") | ||
| 32 | +//获取现金线下交费 | ||
| 33 | +#define CNCCommuntPayMentDetailContentURL cn_API_CommuntyApi(@"/repairApi/cashPayment") | ||
| 34 | +//抢单 | ||
| 35 | +#define CNCCommuntPayMentGrabOrderContentURL cn_API_CommuntyApi(@"/repairApi/grabOrder") | ||
| 36 | +//用户取消订单 | ||
| 37 | +#define CNCCommuntPayMentCancleOrderContentURL cn_API_CommuntyApi(@"/repairApi/cancleOrder") | ||
| 38 | +//设置维修金额 | ||
| 39 | +#define CNCCommuntPayMentTotalFeeOrderContentURL cn_API_CommuntyApi(@"/repairApi/setTotalFee") | ||
| 40 | +//报修缴费 | ||
| 41 | +#define CNCCommuntPayMentRepairOrderContentURL cn_API_CommuntyApi(@"/repairApi/repairOrderNotify") | ||
| 42 | +//用户评价 | ||
| 43 | +#define CNCCommuntPayMentActivityCommentsOrderContentURL cn_API_CommuntyApi(@"/feedbackApi/add") | ||
| 44 | +//活动详情 | ||
| 45 | +#define CNCCommuntPayMentActivityDetailOrderContentURL cn_API_CommuntyApi(@"/handworkApi/handworkById") | ||
| 46 | +@implementation CNLiveCommuntViewModel | ||
| 47 | + | ||
| 48 | +/// 读取小区APP首页 | ||
| 49 | +/// @param nbhdId 小区id | ||
| 50 | +/// @param completerBlock 返回数据 | ||
| 51 | ++(void)requestWithCommuntyHomeNBhdAppIndexWithNBhdId:(NSString *)nbhdId CompleterBlock:(void(^)(NSArray *))completerBlock | ||
| 52 | +{ | ||
| 53 | + if ([CNLiveNetworking isNetworking]) { | ||
| 54 | + [QMUITips showLoadingInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 55 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | ||
| 56 | + [CNLiveNetworking setupShowDataResult:NO]; | ||
| 57 | + [CNLiveNetworking setupShowResult:YES]; | ||
| 58 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:CNCCommuntHomeListContentURL Param:@{@"nbhdId":[nbhdId isNotBlank]?nbhdId:@""} CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | ||
| 59 | + [QMUITips hideAllTipsInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 60 | + [CNLiveCommuntViewModel communty_chooseRequestWithResponseObject:responseObject Error:error isData:YES CompleterBlock:^(id responseObject) { | ||
| 61 | + if (responseObject) { | ||
| 62 | + NSMutableArray * tempArray = [CNLiveCommuntyHomeModel mj_objectArrayWithKeyValuesArray:responseObject]; | ||
| 63 | + [CNLiveRespCacheManager cachePathWithObject:responseObject FileName:CNCCommuntHomeListContentURL]; | ||
| 64 | + if (tempArray.count > 0 && completerBlock) completerBlock(tempArray); | ||
| 65 | + }else{ | ||
| 66 | + id resp = [CNLiveRespCacheManager objectCacheWithFileName:CNCCommuntHomeListContentURL]; | ||
| 67 | + NSMutableArray * tempArray = [CNLiveCommuntyHomeModel mj_objectArrayWithKeyValuesArray:resp]; | ||
| 68 | + if (tempArray.count > 0) { | ||
| 69 | + if (completerBlock) completerBlock(tempArray); | ||
| 70 | + }else{ | ||
| 71 | + if (completerBlock) completerBlock(nil); | ||
| 72 | + } | ||
| 73 | + } | ||
| 74 | + }]; | ||
| 75 | + }]; | ||
| 76 | + }else{ | ||
| 77 | + id resp = [CNLiveRespCacheManager objectCacheWithFileName:CNCCommuntHomeListContentURL]; | ||
| 78 | + NSMutableArray * tempArray = [CNLiveCommuntyHomeModel mj_objectArrayWithKeyValuesArray:resp]; | ||
| 79 | + if (tempArray.count > 0) { | ||
| 80 | + if (completerBlock) completerBlock(tempArray); | ||
| 81 | + }else{ | ||
| 82 | + [QMUITips showError:@"您似乎与互联网断开连接" inView:[CNLiveCommuntTools cCommunt_currentViewController].view hideAfterDelay:1.5]; | ||
| 83 | + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | ||
| 84 | + if (completerBlock) completerBlock(nil); | ||
| 85 | + }); | ||
| 86 | + } | ||
| 87 | + } | ||
| 88 | +} | ||
| 89 | +/// 获取小区列表 | ||
| 90 | +/// @param completerBlock 返回数据 | ||
| 91 | ++(void)requestWithCommuntyHomeListIndexWithCompleterBlock:(void(^)(NSArray * listArray))completerBlock | ||
| 92 | +{ | ||
| 93 | + [QMUITips showLoadingInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 94 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | ||
| 95 | + [CNLiveNetworking setupShowDataResult:NO]; | ||
| 96 | + [CNLiveNetworking setupShowResult:YES]; | ||
| 97 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:CNCCommuntNBhdListContentURL Param:@{} CacheType:CNLiveNetworkCacheTypeCacheNetwork CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | ||
| 98 | + [QMUITips hideAllTipsInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 99 | + [CNLiveCommuntViewModel communty_chooseRequestWithResponseObject:responseObject Error:error isData:YES CompleterBlock:^(id responseObject) { | ||
| 100 | + if (responseObject) { | ||
| 101 | + NSMutableArray * tempArray = [CNLiveCommuntyHomeListModel mj_objectArrayWithKeyValuesArray:responseObject]; | ||
| 102 | + if (completerBlock) completerBlock(tempArray); | ||
| 103 | + }else{ | ||
| 104 | + if (completerBlock) completerBlock(@[]); | ||
| 105 | + } | ||
| 106 | + }]; | ||
| 107 | + }]; | ||
| 108 | +} | ||
| 109 | +/// 请求获取活动列表数据 | ||
| 110 | +/// @param nbhdId 小区id | ||
| 111 | +/// @param page 页数 | ||
| 112 | +/// @param completerBlock 返回数据 | ||
| 113 | ++(void)requestWithCommuntyHomeActivityForNBHdId:(NSString *)nbhdId ShowType:(CNLiveCommuntListShowType)showType Index:(NSInteger)index Page:(NSInteger)page completerBlock:(void (^)(NSArray * _Nonnull, BOOL))completerBlock | ||
| 114 | +{ | ||
| 115 | + [QMUITips showLoadingInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 116 | + if (showType == CNLiveCommuntListShowTypeHome) { | ||
| 117 | + NSDictionary * paramDict = @{ | ||
| 118 | + @"neighborhoodId":nbhdId, | ||
| 119 | + @"page":[NSString stringWithFormat:@"%ld",page], | ||
| 120 | + @"pageSize":@"10" | ||
| 121 | + }; | ||
| 122 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | ||
| 123 | + [CNLiveNetworking setupShowDataResult:NO]; | ||
| 124 | + [CNLiveNetworking setupShowResult:YES]; | ||
| 125 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:CNCCommuntListHandContentURL Param:paramDict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | ||
| 126 | + [QMUITips hideAllTipsInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 127 | + [CNLiveCommuntViewModel communty_chooseRequestWithResponseObject:responseObject Error:error isData:YES CompleterBlock:^(id responseObject) { | ||
| 128 | + if (responseObject && [[responseObject allKeys] containsObject:@"list"]) { | ||
| 129 | + NSMutableArray * tempArray = [CNLiveCommuntyActivityHomeListModel mj_objectArrayWithKeyValuesArray:[responseObject arrayForKey:@"list"]]; | ||
| 130 | + if (completerBlock) completerBlock(tempArray,[responseObject boolValueForKey:@"isLastPage" default:YES]); | ||
| 131 | + }else{ | ||
| 132 | + if (completerBlock) completerBlock(@[],YES); | ||
| 133 | + } | ||
| 134 | + }]; | ||
| 135 | + }]; | ||
| 136 | + } | ||
| 137 | + if (showType == CNLiveCommuntListShowTypeRecord) { | ||
| 138 | + NSDictionary * paramDict = @{ | ||
| 139 | + @"neighborhoodId":nbhdId, | ||
| 140 | + @"userId":[CNUserInfoManager manager].userInfoModel.uid, | ||
| 141 | + @"status":[NSString stringWithFormat:@"%ld",index], | ||
| 142 | + @"page":[NSString stringWithFormat:@"%ld",page], | ||
| 143 | + @"pageSize":@"10" | ||
| 144 | + }; | ||
| 145 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | ||
| 146 | + [CNLiveNetworking setupShowDataResult:NO]; | ||
| 147 | + [CNLiveNetworking setupShowResult:YES]; | ||
| 148 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:CNCCommuntListOrderContentURL Param:paramDict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | ||
| 149 | + [QMUITips hideAllTipsInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 150 | + [CNLiveCommuntViewModel communty_chooseRequestWithResponseObject:responseObject Error:error isData:YES CompleterBlock:^(id responseObject) { | ||
| 151 | + if (responseObject && [[responseObject allKeys] containsObject:@"list"]) { | ||
| 152 | + NSMutableArray * tempArray = [CNLiveCommuntyActivityRecordListModel mj_objectArrayWithKeyValuesArray:[responseObject arrayForKey:@"list"]]; | ||
| 153 | + if (completerBlock) completerBlock(tempArray,[responseObject boolValueForKey:@"isLastPage" default:YES]); | ||
| 154 | + }else{ | ||
| 155 | + if (completerBlock) completerBlock(@[],YES); | ||
| 156 | + } | ||
| 157 | + }]; | ||
| 158 | + }]; | ||
| 159 | + } | ||
| 160 | + if (showType == CNLiveCommuntListShowTypeRepair) { | ||
| 161 | + NSDictionary * paramDict = @{ | ||
| 162 | + @"userId":[CNUserInfoManager manager].userInfoModel.uid, | ||
| 163 | + @"status":[NSString stringWithFormat:@"%ld",index], | ||
| 164 | + @"page":[NSString stringWithFormat:@"%ld",page], | ||
| 165 | + @"pageSize":@"10" | ||
| 166 | + }; | ||
| 167 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | ||
| 168 | + [CNLiveNetworking setupShowDataResult:NO]; | ||
| 169 | + [CNLiveNetworking setupShowResult:YES]; | ||
| 170 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNCCommuntListRepairContentURL Param:paramDict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | ||
| 171 | + [QMUITips hideAllTipsInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 172 | + [CNLiveCommuntViewModel communty_chooseRequestWithResponseObject:responseObject Error:error isData:YES CompleterBlock:^(id responseObject) { | ||
| 173 | + if (responseObject && [[responseObject allKeys] containsObject:@"list"]) { | ||
| 174 | + NSMutableArray * tempArray = [CNLiveCommuntyActivityRepairListModel mj_objectArrayWithKeyValuesArray:[responseObject arrayForKey:@"list"]]; | ||
| 175 | + if (completerBlock) completerBlock(tempArray,[responseObject boolValueForKey:@"isLastPage" default:YES]); | ||
| 176 | + }else{ | ||
| 177 | + if (completerBlock) completerBlock(@[],YES); | ||
| 178 | + } | ||
| 179 | + }]; | ||
| 180 | + }]; | ||
| 181 | + } | ||
| 182 | +} | ||
| 183 | +/// 获取维修项目 | ||
| 184 | +/// @param nbhdId 小区id | ||
| 185 | +/// @param completerBlock 返回数据 | ||
| 186 | ++(void)requestWithCommuntyHomeMaintenForNBHdId:(NSString *)nbhdId | ||
| 187 | + CompleterBlock:(void(^)(NSArray * dataArray))completerBlock | ||
| 188 | +{ | ||
| 189 | + NSDictionary * paramDict = @{ | ||
| 190 | + @"oId":nbhdId, | ||
| 191 | + @"page":@"1", | ||
| 192 | + @"pageSize":@"100" | ||
| 193 | + }; | ||
| 194 | + [QMUITips showLoadingInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 195 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | ||
| 196 | + [CNLiveNetworking setupShowDataResult:NO]; | ||
| 197 | + [CNLiveNetworking setupShowResult:YES]; | ||
| 198 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:CNCCommuntListMaintainContentURL Param:paramDict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | ||
| 199 | + [QMUITips hideAllTipsInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 200 | + [CNLiveCommuntViewModel communty_chooseRequestWithResponseObject:responseObject Error:error isData:YES CompleterBlock:^(id responseObject) { | ||
| 201 | + if (responseObject) { | ||
| 202 | + NSMutableArray * tempArray = [CNLiveCommuntyActivityMaintainsListModel mj_objectArrayWithKeyValuesArray:responseObject]; | ||
| 203 | + if (completerBlock) completerBlock(tempArray); | ||
| 204 | + }else{ | ||
| 205 | + if (completerBlock) completerBlock(@[]); | ||
| 206 | + } | ||
| 207 | + }]; | ||
| 208 | + }]; | ||
| 209 | +} | ||
| 210 | +/// 提交报修 | ||
| 211 | +/// @param param 参数 | ||
| 212 | +/// @param nbhdId 小区id | ||
| 213 | +/// @param completerBlock 返回数据 | ||
| 214 | ++(void)requestWithCommuntyHomeMaintenPushWithParamDict:(NSDictionary *)param nbhdId:(NSString *)nbhdId CompleterBlock:(nonnull void (^)(CNLiveCommuntyActivityMaintainsCreateModel *))completerBlock | ||
| 215 | +{ | ||
| 216 | + [QMUITips showLoadingInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 217 | + NSMutableDictionary * paramDict = [[NSMutableDictionary alloc] initWithDictionary:param]; | ||
| 218 | + [paramDict addString:nbhdId forKey:@"neighboorHoodId"]; | ||
| 219 | + [paramDict addString:[CNUserInfoManager manager].userInfoModel.uid forKey:@"userId"]; | ||
| 220 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | ||
| 221 | + [CNLiveNetworking setupShowDataResult:NO]; | ||
| 222 | + [CNLiveNetworking setupShowResult:YES]; | ||
| 223 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNCCommuntAddMaintainContentURL Param:paramDict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | ||
| 224 | + [QMUITips hideAllTipsInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 225 | + [CNLiveCommuntViewModel communty_chooseRequestWithResponseObject:responseObject Error:error isData:YES CompleterBlock:^(id responseObject) { | ||
| 226 | + if (responseObject) { | ||
| 227 | + CNLiveCommuntyActivityMaintainsCreateModel * createModel = [CNLiveCommuntyActivityMaintainsCreateModel mj_objectWithKeyValues:responseObject]; | ||
| 228 | + if (completerBlock) completerBlock(createModel); | ||
| 229 | + }else{ | ||
| 230 | + if (completerBlock) completerBlock(nil); | ||
| 231 | + } | ||
| 232 | + }]; | ||
| 233 | + }]; | ||
| 234 | +} | ||
| 235 | +/// 获取维修上面时间 | ||
| 236 | +/// @param interval 当前时间之后的时间 | ||
| 237 | +/// @param completerBlock 返回数据 | ||
| 238 | ++(void)requestWithCommuntyHomeMaintenForTimeInterval:(NSInteger)interval CompleterBlock:(void(^)(NSArray * dataArray))completerBlock | ||
| 239 | +{ | ||
| 240 | + NSMutableArray *dayArray = [[NSMutableArray alloc] init]; | ||
| 241 | + //计算从当前日期开始的七天日期 | ||
| 242 | + for (int i = 0; i < interval; i ++) { | ||
| 243 | + CNLiveCommuntyActivityMaintainsTimeModel * timeModel = [[CNLiveCommuntyActivityMaintainsTimeModel alloc] init]; | ||
| 244 | + NSDateComponents *components_h = [[NSCalendar currentCalendar] components:NSCalendarUnitHour fromDate:[NSDate date]]; | ||
| 245 | + NSMutableArray * tArray = [[NSMutableArray alloc] init]; | ||
| 246 | + NSInteger start = i == 0 ? (components_h.hour-(components_h.hour%2)) : 0; | ||
| 247 | + for (int i = 0; i < 12; i++) { | ||
| 248 | + [tArray addObject:[NSString stringWithFormat:@"%02ld~%02ld",start,start+2]]; | ||
| 249 | + start += 2; | ||
| 250 | + } | ||
| 251 | + if (i == 0) [tArray removeObjectsInRange:NSMakeRange([tArray indexOfObject:@"22~24"]+1, tArray.count - [tArray indexOfObject:@"22~24"] - 1)]; | ||
| 252 | + | ||
| 253 | + NSTimeInterval secondsPerDay = i * 24*60*60; | ||
| 254 | + NSDate *curDate = [NSDate dateWithTimeInterval:secondsPerDay sinceDate:[NSDate date]]; | ||
| 255 | + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | ||
| 256 | + [dateFormatter setDateFormat:@"yyyy-MM-dd"]; | ||
| 257 | + NSString *dateStr = [dateFormatter stringFromDate:curDate]; | ||
| 258 | + timeModel.time = tArray; | ||
| 259 | + timeModel.day = dateStr; | ||
| 260 | + [dayArray addObject:timeModel]; | ||
| 261 | + } | ||
| 262 | + if (completerBlock) completerBlock(dayArray); | ||
| 263 | +} | ||
| 264 | + | ||
| 265 | +/// 获取维修订单详情 | ||
| 266 | +/// @param maintenId 报修id | ||
| 267 | +/// @param isChat 是不是聊天进来的 | ||
| 268 | +/// @param completerBlock 返回数据 | ||
| 269 | ++(void)requestWithCommuntyMaintenDetailForMaintenId:(NSString *)maintenId isChat:(BOOL)isChat CompleterBlock:(nonnull void (^)(CNLiveCommuntyActivityMaintainsCreateModel *))completerBlock | ||
| 270 | +{ | ||
| 271 | + [QMUITips showLoadingInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 272 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | ||
| 273 | + [CNLiveNetworking setupShowDataResult:NO]; | ||
| 274 | + [CNLiveNetworking setupShowResult:YES]; | ||
| 275 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNCCommuntMaintainDetailContentURL Param:@{@"id":maintenId} CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | ||
| 276 | + [QMUITips hideAllTipsInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 277 | + [CNLiveCommuntViewModel communty_chooseRequestWithResponseObject:responseObject Error:error isData:YES CompleterBlock:^(id responseObject) { | ||
| 278 | + if (responseObject) { | ||
| 279 | + CNLiveCommuntyActivityMaintainsCreateModel * createModel = [CNLiveCommuntyActivityMaintainsCreateModel mj_objectWithKeyValues:responseObject]; | ||
| 280 | + if (isChat && createModel.showType == 0) createModel.showType = 4; | ||
| 281 | + if (isChat && createModel.showType == 1) createModel.showType = 5; | ||
| 282 | + if (isChat && createModel.showType == 2) createModel.showType = 6; | ||
| 283 | + if (isChat && createModel.showType == 3) createModel.showType = 6; | ||
| 284 | + if (completerBlock) completerBlock(createModel); | ||
| 285 | + }else{ | ||
| 286 | + if (completerBlock) completerBlock(nil); | ||
| 287 | + } | ||
| 288 | + }]; | ||
| 289 | + }]; | ||
| 290 | +} | ||
| 291 | + | ||
| 292 | +/// 设置线下已经支付 | ||
| 293 | +/// @param orderId 订单id | ||
| 294 | +/// @param completerBlock 回去结果 | ||
| 295 | ++(void)requestWithCommuntyMaintenPayMentOrderId:(NSString *)orderId CompleterBlock:(void(^)(void))completerBlock | ||
| 296 | +{ | ||
| 297 | + NSDictionary * paramDict = @{ | ||
| 298 | + @"id":orderId, | ||
| 299 | + @"repairId":[CNUserInfoManager manager].userInfoModel.uid | ||
| 300 | + }; | ||
| 301 | + [QMUITips showLoadingInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 302 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | ||
| 303 | + [CNLiveNetworking setupShowDataResult:NO]; | ||
| 304 | + [CNLiveNetworking setupShowResult:YES]; | ||
| 305 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNCCommuntPayMentDetailContentURL Param:paramDict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | ||
| 306 | + [QMUITips hideAllTipsInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 307 | + [CNLiveCommuntViewModel communty_chooseRequestWithResponseObject:responseObject Error:error isData:YES CompleterBlock:^(id responseObject) { | ||
| 308 | + if (responseObject && completerBlock) completerBlock(); | ||
| 309 | + }]; | ||
| 310 | + }]; | ||
| 311 | +} | ||
| 312 | + | ||
| 313 | +/// 抢单 | ||
| 314 | +/// @param orderId 订单id | ||
| 315 | +/// @param type 类型 1:接单 0:取消接单 | ||
| 316 | +/// @param completerBlock 结果返回 | ||
| 317 | ++(void)requestWithCommuntyGrabOrderMentOrderId:(NSString *)orderId type:(BOOL)type CompleterBlock:(void(^)(void))completerBlock | ||
| 318 | +{ | ||
| 319 | + NSDictionary * paramDict = @{ | ||
| 320 | + @"id":orderId, | ||
| 321 | + @"repairId":[CNUserInfoManager manager].userInfoModel.uid, | ||
| 322 | + @"type": type?@"1":@"0" | ||
| 323 | + }; | ||
| 324 | + [QMUITips showLoadingInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 325 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | ||
| 326 | + [CNLiveNetworking setupShowDataResult:NO]; | ||
| 327 | + [CNLiveNetworking setupShowResult:YES]; | ||
| 328 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNCCommuntPayMentGrabOrderContentURL Param:paramDict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | ||
| 329 | + [QMUITips hideAllTipsInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 330 | + [CNLiveCommuntViewModel communty_chooseRequestWithResponseObject:responseObject Error:error isData:NO CompleterBlock:^(id responseObject) { | ||
| 331 | + if (responseObject && completerBlock) completerBlock(); | ||
| 332 | + }]; | ||
| 333 | + }]; | ||
| 334 | +} | ||
| 335 | +/// 用户取消订单 | ||
| 336 | +/// @param orderId 订单id | ||
| 337 | +/// @param completerBlock 结果返回 | ||
| 338 | ++(void)requestWithCommuntyCancleOrderMentOrderId:(NSString *)orderId CompleterBlock:(void(^)(void))completerBlock | ||
| 339 | +{ | ||
| 340 | + NSDictionary * paramDict = @{ | ||
| 341 | + @"id":orderId, | ||
| 342 | + @"userId":[CNUserInfoManager manager].userInfoModel.uid, | ||
| 343 | + }; | ||
| 344 | + [QMUITips showLoadingInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 345 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | ||
| 346 | + [CNLiveNetworking setupShowDataResult:NO]; | ||
| 347 | + [CNLiveNetworking setupShowResult:YES]; | ||
| 348 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNCCommuntPayMentCancleOrderContentURL Param:paramDict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | ||
| 349 | + [QMUITips hideAllTipsInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 350 | + [CNLiveCommuntViewModel communty_chooseRequestWithResponseObject:responseObject Error:error isData:NO CompleterBlock:^(id responseObject) { | ||
| 351 | + if (responseObject && completerBlock) completerBlock(); | ||
| 352 | + }]; | ||
| 353 | + }]; | ||
| 354 | +} | ||
| 355 | + | ||
| 356 | +/// 设置维修费用 | ||
| 357 | +/// @param orderId 订单id | ||
| 358 | +/// @param totalFee 价格,以分为单位 | ||
| 359 | +/// @param completerBlock 结果返回 | ||
| 360 | ++(void)requestWithCommuntyTotalFeeOrderMentOrderId:(NSString *)orderId totalFee:(NSString *)totalFee CompleterBlock:(void(^)(NSString * payUrl))completerBlock | ||
| 361 | +{ | ||
| 362 | + NSDictionary * paramDict = @{ | ||
| 363 | + @"id":orderId, | ||
| 364 | + @"totalFee":[NSString stringWithFormat:@"%.0f",[totalFee floatValue] * 100], | ||
| 365 | + }; | ||
| 366 | + [QMUITips showLoadingInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 367 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | ||
| 368 | + [CNLiveNetworking setupShowDataResult:NO]; | ||
| 369 | + [CNLiveNetworking setupShowResult:YES]; | ||
| 370 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNCCommuntPayMentTotalFeeOrderContentURL Param:paramDict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | ||
| 371 | + [QMUITips hideAllTipsInView:[CNLiveCommuntTools cCommunt_currentViewController].view.viewController.view]; | ||
| 372 | + [CNLiveCommuntViewModel communty_chooseRequestWithResponseObject:responseObject Error:error isData:YES CompleterBlock:^(id responseObject) { | ||
| 373 | + if (responseObject) { | ||
| 374 | + NSString * timestamp = [CNLiveCommuntViewModel getNowTimestamp]; | ||
| 375 | + NSDictionary * param = [[NSMutableDictionary alloc] initWithDictionary:@{ | ||
| 376 | + @"appId":AppId, | ||
| 377 | + @"sp_id":AppId, | ||
| 378 | + @"out_trade_no":orderId, | ||
| 379 | + @"body":[responseObject stringValueForKey:@"repairName" default:@"服务"], | ||
| 380 | + @"total_fee":[NSString stringWithFormat:@"%.0f",[totalFee floatValue] * 100], | ||
| 381 | + @"user_id":[CNUserInfoManager manager].userInfoModel.uid, | ||
| 382 | + @"notify_url":CNCCommuntPayMentRepairOrderContentURL, | ||
| 383 | + @"ver":[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"], | ||
| 384 | + @"timestamp":timestamp, | ||
| 385 | + }]; | ||
| 386 | + NSString *string = [NSString stringWithFormat:@"%@&key=%@",[CNLiveCommuntViewModel signvalue:param URLString:nil],APPKey]; | ||
| 387 | + NSString *signString = [[CNLiveCommuntViewModel sha1:string] uppercaseString]; | ||
| 388 | + NSString * url = [NSString stringWithFormat:@"%@?%@&sign=%@",CNCCommuntHomePayApiContentURL,[CNLiveCommuntViewModel signvalue:param URLString:nil],signString]; | ||
| 389 | + if (completerBlock) completerBlock(url); | ||
| 390 | + } | ||
| 391 | + }]; | ||
| 392 | + }]; | ||
| 393 | +} | ||
| 394 | + | ||
| 395 | +/// 活动报名 | ||
| 396 | +/// @param handworkId 手工活动id | ||
| 397 | +/// @param users 参与人 | ||
| 398 | +/// @param completerBlock 结果返回 | ||
| 399 | ++(void)requestWithCommuntySingUpOrderMentHandworkId:(NSString *)handworkId Ussers:(NSArray *)users CompleterBlock:(nonnull void (^)(CNLiveCommuntyActivitySignUpModel * ))completerBlock | ||
| 400 | +{ | ||
| 401 | + NSDictionary * paramDict = @{ | ||
| 402 | + @"handworkId":handworkId, | ||
| 403 | + @"signupVosJson":[users mj_JSONString], | ||
| 404 | + @"createUserId":[CNUserInfoManager manager].userInfoModel.uid, | ||
| 405 | + @"type":@"1" | ||
| 406 | + }; | ||
| 407 | + [QMUITips showLoadingInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 408 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | ||
| 409 | + [CNLiveNetworking setupShowDataResult:NO]; | ||
| 410 | + [CNLiveNetworking setupShowResult:YES]; | ||
| 411 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNCCommuntPayMentSignUpOrderContentURL Param:paramDict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | ||
| 412 | + [QMUITips hideAllTipsInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 413 | + [CNLiveCommuntViewModel communty_chooseRequestWithResponseObject:responseObject Error:error isData:YES CompleterBlock:^(id responseObject) { | ||
| 414 | + if (responseObject) { | ||
| 415 | + NSLog(@"%@",[responseObject mj_JSONString]); | ||
| 416 | + CNLiveCommuntyActivitySignUpModel * signUpModel = [CNLiveCommuntyActivitySignUpModel mj_objectWithKeyValues:responseObject]; | ||
| 417 | + if (completerBlock) completerBlock(signUpModel); | ||
| 418 | + }else{ | ||
| 419 | + if (completerBlock) completerBlock(nil); | ||
| 420 | + } | ||
| 421 | + }]; | ||
| 422 | + }]; | ||
| 423 | +} | ||
| 424 | + | ||
| 425 | +/// 对用户信息进行存读取操作 | ||
| 426 | +/// @param userDict 用户信息 | ||
| 427 | +/// @param isSave 读&存 | ||
| 428 | +/// @param completerBlock 返回结果 | ||
| 429 | ++(void)requestWithCommuntySaveInfoUsersMentUserDict:(NSDictionary *)userDict isSave:(BOOL)isSave CompleterBlock:(void(^)(NSArray * userArray, BOOL isSave))completerBlock | ||
| 430 | +{ | ||
| 431 | + NSString * cacheKey = [NSString stringWithFormat:@"%@/kCNLiveCommuntySaveInfoUsersMentKey04",[CNUserInfoManager manager].userInfoModel.uid]; | ||
| 432 | + if (isSave) { | ||
| 433 | + if ([userDict allKeys].count > 0 && [userDict allValues].count > 0) { | ||
| 434 | + NSString * save_string = [NSString stringWithFormat:@"%@",[CNLiveRespCacheManager objectCacheWithFileName:cacheKey]]; | ||
| 435 | + NSMutableArray * tempArray = [[NSMutableArray alloc] initWithArray:[save_string mj_JSONObject]]; | ||
| 436 | + BOOL isReplace = YES; | ||
| 437 | + NSString * i_nameString = [userDict stringValueForKey:@"name" default:@""]; | ||
| 438 | + NSString * i_sexString = [userDict stringValueForKey:@"gender" default:@""]; | ||
| 439 | + NSString * i_ageString = [userDict stringValueForKey:@"age" default:@""]; | ||
| 440 | + NSString * i_mobileString = [userDict stringValueForKey:@"mobile" default:@""]; | ||
| 441 | + for (NSDictionary * subDict in tempArray) { | ||
| 442 | + NSString * o_nameString = [subDict stringValueForKey:@"name" default:@""]; | ||
| 443 | + NSString * o_sexString = [subDict stringValueForKey:@"gender" default:@""]; | ||
| 444 | + NSString * o_ageString = [subDict stringValueForKey:@"age" default:@""]; | ||
| 445 | + NSString * o_mobileString = [subDict stringValueForKey:@"mobile" default:@""]; | ||
| 446 | + if (![i_nameString isEqualToString:o_nameString] | ||
| 447 | + || ![i_sexString isEqualToString:o_sexString] | ||
| 448 | + || ![i_ageString isEqualToString:o_ageString] | ||
| 449 | + || ![i_mobileString isEqualToString:o_mobileString]) { | ||
| 450 | + [tempArray replaceObjectAtIndex:[tempArray indexOfObject:subDict] withObject:userDict]; | ||
| 451 | + isReplace = NO; | ||
| 452 | + break; | ||
| 453 | + } | ||
| 454 | + } | ||
| 455 | + if (isReplace) [tempArray addObject:userDict]; | ||
| 456 | + NSString * user_info = [tempArray mj_JSONString]; | ||
| 457 | + [CNLiveRespCacheManager cachePathWithObject:user_info FileName:cacheKey]; | ||
| 458 | + if (completerBlock) completerBlock(@[],isSave); | ||
| 459 | + } | ||
| 460 | + }else{ | ||
| 461 | + NSString * save_string = [NSString stringWithFormat:@"%@",[CNLiveRespCacheManager objectCacheWithFileName:cacheKey]]; | ||
| 462 | + NSMutableArray * tempArray = [[NSMutableArray alloc] initWithArray:[save_string mj_JSONObject]]; | ||
| 463 | + if (completerBlock) completerBlock(tempArray,isSave); | ||
| 464 | + } | ||
| 465 | +} | ||
| 466 | + | ||
| 467 | + | ||
| 468 | +/// 对活动进行评论id | ||
| 469 | +/// @param contentId 订单Id | ||
| 470 | +/// @param handworkId 活动Id | ||
| 471 | +/// @param comment 用户id | ||
| 472 | +/// @param imgs 评价内容 | ||
| 473 | +/// @param isAnonymity 评价图片 | ||
| 474 | +/// @param completerBlock 是否匿名 true:匿名 | ||
| 475 | ++(void)requestWithCommuntyCommentsInfoWithContentId:(NSString *)contentId handworkId:(NSString *)handworkId comment:(NSString *)comment imgs:(NSString *)imgs isAnonymity:(BOOL)isAnonymity CompleterBlock:(void(^)(void))completerBlock | ||
| 476 | +{ | ||
| 477 | + NSDictionary * paramDict = @{ | ||
| 478 | + @"signupId":contentId, | ||
| 479 | + @"handworkId":handworkId, | ||
| 480 | + @"userId":[CNUserInfoManager manager].userInfoModel.uid, | ||
| 481 | + @"comment":comment, | ||
| 482 | + @"imgs":imgs, | ||
| 483 | + @"isAnonymity":isAnonymity?@"true":@"false", | ||
| 484 | + }; | ||
| 485 | + [QMUITips showLoadingInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 486 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | ||
| 487 | + [CNLiveNetworking setupShowDataResult:NO]; | ||
| 488 | + [CNLiveNetworking setupShowResult:YES]; | ||
| 489 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNCCommuntPayMentActivityCommentsOrderContentURL Param:paramDict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | ||
| 490 | + [QMUITips hideAllTipsInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 491 | + [CNLiveCommuntViewModel communty_chooseRequestWithResponseObject:responseObject Error:error isData:YES CompleterBlock:^(id responseObject) { | ||
| 492 | + if (responseObject) { | ||
| 493 | + | ||
| 494 | + }else{ | ||
| 495 | + | ||
| 496 | + } | ||
| 497 | + }]; | ||
| 498 | + }]; | ||
| 499 | +} | ||
| 500 | +/// 获取活动详情界面接口 | ||
| 501 | +/// @param activityId 活动id | ||
| 502 | +/// @param completerBlock 返回结果 | ||
| 503 | ++(void)requestWithCommuntyActivityDetailMentActivityId:(NSString *)activityId CompleterBlock:(void(^)(CNLiveCommuntyActivityDetailModel * detailModel))completerBlock | ||
| 504 | +{ | ||
| 505 | + NSDictionary * paramDict = @{ | ||
| 506 | + @"orderId":@"", | ||
| 507 | + @"handworkId":activityId, | ||
| 508 | + }; | ||
| 509 | + [QMUITips showLoadingInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 510 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | ||
| 511 | + [CNLiveNetworking setupShowDataResult:NO]; | ||
| 512 | + [CNLiveNetworking setupShowResult:YES]; | ||
| 513 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:CNCCommuntPayMentActivityDetailOrderContentURL Param:paramDict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | ||
| 514 | + [QMUITips hideAllTipsInView:[CNLiveCommuntTools cCommunt_currentViewController].view]; | ||
| 515 | + [CNLiveCommuntViewModel communty_chooseRequestWithResponseObject:responseObject Error:error isData:YES CompleterBlock:^(id responseObject) { | ||
| 516 | + if (responseObject) { | ||
| 517 | + CNLiveCommuntyActivityDetailModel * detailModel = [CNLiveCommuntyActivityDetailModel mj_objectWithKeyValues:responseObject]; | ||
| 518 | + if (completerBlock) completerBlock(detailModel); | ||
| 519 | + }else{ | ||
| 520 | + if (completerBlock) completerBlock(nil); | ||
| 521 | + } | ||
| 522 | + }]; | ||
| 523 | + }]; | ||
| 524 | +} | ||
| 525 | +#pragma mark =========== 对放回的结果进行提醒判断 =========== | ||
| 526 | + | ||
| 527 | +/// 获取时间戳 | ||
| 528 | ++ (NSString *)getNowTimestamp | ||
| 529 | +{ | ||
| 530 | + NSDateFormatter * formatter = [[NSDateFormatter alloc] init]; | ||
| 531 | + [formatter setDateStyle:NSDateFormatterMediumStyle]; | ||
| 532 | + [formatter setTimeStyle:NSDateFormatterShortStyle]; | ||
| 533 | + [formatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"]; | ||
| 534 | + NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Beijing"]; | ||
| 535 | + [formatter setTimeZone:timeZone]; | ||
| 536 | + NSDate *datenow = [NSDate date];//现在时间 | ||
| 537 | + NSInteger timeSp = [[NSNumber numberWithDouble:[datenow timeIntervalSince1970]] integerValue]; | ||
| 538 | + return [NSString stringWithFormat:@"%ld",(long)timeSp]; | ||
| 539 | +} | ||
| 540 | ++ (NSString *)signvalue:(NSDictionary*)parameter URLString:(NSString *)urlString | ||
| 541 | +{ | ||
| 542 | + //对所有传入参数按照字段名的 ASCII 码从小到大排序 | ||
| 543 | + NSArray *keyArr=[parameter allKeys]; | ||
| 544 | + NSArray *arr = [keyArr sortedArrayUsingSelector:@selector(compare:)]; | ||
| 545 | + NSMutableString *string1 = [[NSMutableString alloc]init]; | ||
| 546 | + if (urlString != nil) [string1 appendFormat:@"%@?",urlString]; | ||
| 547 | + for (int i=0; i<arr.count; i++) { | ||
| 548 | + NSString *parameterString = [NSString stringWithFormat:@"%@",parameter[[arr objectAtIndex:i]]]; | ||
| 549 | + if (parameterString.length > 0) { | ||
| 550 | + [string1 appendString:[NSString stringWithFormat:@"%@=%@&",[arr objectAtIndex:i],parameter[[arr objectAtIndex:i]]]]; | ||
| 551 | + } | ||
| 552 | + } | ||
| 553 | + if (string1.length > 0) [string1 deleteCharactersInRange:NSMakeRange(string1.length-1, 1)]; | ||
| 554 | + return string1; | ||
| 555 | +} | ||
| 556 | ++ (NSString*)sha1:(NSString *)string | ||
| 557 | +{ | ||
| 558 | + NSData *data = [string dataUsingEncoding:NSUTF8StringEncoding]; | ||
| 559 | + uint8_t digest[CC_SHA1_DIGEST_LENGTH]; | ||
| 560 | + CC_SHA1(data.bytes, (unsigned int)data.length, digest); | ||
| 561 | + NSMutableString* output = [NSMutableString stringWithCapacity:CC_SHA1_DIGEST_LENGTH * 2]; | ||
| 562 | + for(int i = 0; i < CC_SHA1_DIGEST_LENGTH; i++) | ||
| 563 | + [output appendFormat:@"%02x", digest[i]]; | ||
| 564 | + | ||
| 565 | + while ([[output substringToIndex:1] isEqualToString:@"0"]) { | ||
| 566 | + output = [[NSMutableString alloc] initWithString:[output substringFromIndex:1]]; | ||
| 567 | + } | ||
| 568 | + return output; | ||
| 569 | +} | ||
| 570 | +/// 对放回的结果进行提醒判断 | ||
| 571 | +/// @param responseObject 返回数据 | ||
| 572 | +/// @param error 错误 | ||
| 573 | +/// @param isData 是否取data | ||
| 574 | +/// @param completerBlock 成功 | ||
| 575 | ++(void)communty_chooseRequestWithResponseObject:(id)responseObject Error:(NSError *)error isData:(BOOL)isData CompleterBlock:(void(^)(id responseObject))completerBlock | ||
| 576 | +{ | ||
| 577 | + if (error) { | ||
| 578 | + | ||
| 579 | + if (error.code == -1009) { | ||
| 580 | + [QMUITips showError:@"您似乎与互联网断开连接" inView:[CNLiveCommuntTools cCommunt_currentViewController].view hideAfterDelay:1.5]; | ||
| 581 | + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | ||
| 582 | + if (completerBlock) completerBlock(nil); | ||
| 583 | + }); | ||
| 584 | + }else if (error.code == 500 || error.code == 404) { | ||
| 585 | + [QMUITips showError:@"服务器异常" inView:[CNLiveCommuntTools cCommunt_currentViewController].view hideAfterDelay:1.5]; | ||
| 586 | + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | ||
| 587 | + if (completerBlock) completerBlock(nil); | ||
| 588 | + }); | ||
| 589 | + }else{ | ||
| 590 | + [QMUITips showError:@"请求失败" inView:[CNLiveCommuntTools cCommunt_currentViewController].view hideAfterDelay:1.5]; | ||
| 591 | + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | ||
| 592 | + if (completerBlock) completerBlock(nil); | ||
| 593 | + }); | ||
| 594 | + } | ||
| 595 | + }else{ | ||
| 596 | + if (responseObject == nil) { | ||
| 597 | + [QMUITips showError:@"请求失败" inView:[CNLiveCommuntTools cCommunt_currentViewController].view hideAfterDelay:1.5]; | ||
| 598 | + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | ||
| 599 | + if (completerBlock) completerBlock(nil); | ||
| 600 | + }); | ||
| 601 | + }else if ([responseObject isKindOfClass:[NSDictionary class]] && ((NSDictionary *)responseObject).allKeys.count == 0) { | ||
| 602 | + [QMUITips showError:@"请求失败" inView:[CNLiveCommuntTools cCommunt_currentViewController].view hideAfterDelay:1.5]; | ||
| 603 | + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | ||
| 604 | + if (completerBlock) completerBlock(nil); | ||
| 605 | + }); | ||
| 606 | + }else if ([responseObject isKindOfClass:[NSDictionary class]] && ((NSDictionary *)responseObject).allKeys.count > 0 && [responseObject[@"errorCode"] integerValue] != 0) { | ||
| 607 | + [QMUITips showError:responseObject[@"errorMessage"] inView:[CNLiveCommuntTools cCommunt_currentViewController].view hideAfterDelay:1.5]; | ||
| 608 | + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | ||
| 609 | + if (completerBlock) completerBlock(nil); | ||
| 610 | + }); | ||
| 611 | + }else{ | ||
| 612 | + if (isData) { | ||
| 613 | + if ([[responseObject allKeys] containsObject:@"data"] | ||
| 614 | + && responseObject[@"data"] | ||
| 615 | + && responseObject[@"data"] != NULL | ||
| 616 | + && ![responseObject[@"data"] isKindOfClass:[NSNull class]]) { | ||
| 617 | + if (completerBlock) completerBlock(responseObject[@"data"]); | ||
| 618 | + }else{ | ||
| 619 | + [QMUITips showError:@"请求失败" inView:[CNLiveCommuntTools cCommunt_currentViewController].view hideAfterDelay:1.5]; | ||
| 620 | + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | ||
| 621 | + if (completerBlock) completerBlock(nil); | ||
| 622 | + }); | ||
| 623 | + } | ||
| 624 | + }else{ | ||
| 625 | + if (completerBlock) completerBlock(responseObject); | ||
| 626 | + } | ||
| 627 | + } | ||
| 628 | + } | ||
| 629 | +} | ||
| 630 | +@end |
Example/CNLiveCommunitModule.xcodeproj/project.pbxproj
0 → 100644
| 1 | +++ a/Example/CNLiveCommunitModule.xcodeproj/project.pbxproj | ||
| 1 | +// !$*UTF8*$! | ||
| 2 | +{ | ||
| 3 | + archiveVersion = 1; | ||
| 4 | + classes = { | ||
| 5 | + }; | ||
| 6 | + objectVersion = 46; | ||
| 7 | + objects = { | ||
| 8 | + | ||
| 9 | +/* Begin PBXBuildFile section */ | ||
| 10 | + 2D9568334C30F71D68CE38E5 /* Pods_CNLiveCommunitModule_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F96CB85649BAFAFCE5D8C8D2 /* Pods_CNLiveCommunitModule_Tests.framework */; }; | ||
| 11 | + 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; | ||
| 12 | + 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; | ||
| 13 | + 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; | ||
| 14 | + 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; | ||
| 15 | + 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; | ||
| 16 | + 6003F59E195388D20070C39A /* CNLIVEAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* CNLIVEAppDelegate.m */; }; | ||
| 17 | + 6003F5A7195388D20070C39A /* CNLIVEViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* CNLIVEViewController.m */; }; | ||
| 18 | + 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; }; | ||
| 19 | + 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; | ||
| 20 | + 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; | ||
| 21 | + 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; | ||
| 22 | + 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; | ||
| 23 | + 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; | ||
| 24 | + 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */; }; | ||
| 25 | + 79774D0427B4D70100C19417 /* CNLIVEMainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 79774D0327B4D70100C19417 /* CNLIVEMainViewController.m */; }; | ||
| 26 | + 79774D0927B4DB5700C19417 /* CNLiveCommunitModuleImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 79774D0827B4DB5700C19417 /* CNLiveCommunitModuleImpl.m */; }; | ||
| 27 | + 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; }; | ||
| 28 | + B336D5F1EE51497C378FC1AE /* Pods_CNLiveCommunitModule_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FEBFB3EC666EC58228348C8D /* Pods_CNLiveCommunitModule_Example.framework */; }; | ||
| 29 | +/* End PBXBuildFile section */ | ||
| 30 | + | ||
| 31 | +/* Begin PBXContainerItemProxy section */ | ||
| 32 | + 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = { | ||
| 33 | + isa = PBXContainerItemProxy; | ||
| 34 | + containerPortal = 6003F582195388D10070C39A /* Project object */; | ||
| 35 | + proxyType = 1; | ||
| 36 | + remoteGlobalIDString = 6003F589195388D20070C39A; | ||
| 37 | + remoteInfo = CNLiveCommunitModule; | ||
| 38 | + }; | ||
| 39 | +/* End PBXContainerItemProxy section */ | ||
| 40 | + | ||
| 41 | +/* Begin PBXFileReference section */ | ||
| 42 | + 1CB5CDB74584B3B4E0DF016D /* Pods-CNLiveCommunitModule_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveCommunitModule_Example.debug.xcconfig"; path = "Target Support Files/Pods-CNLiveCommunitModule_Example/Pods-CNLiveCommunitModule_Example.debug.xcconfig"; sourceTree = "<group>"; }; | ||
| 43 | + 2A5F54F844696F1A4B71CADD /* CNLiveCommunitModule.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = CNLiveCommunitModule.podspec; path = ../CNLiveCommunitModule.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; | ||
| 44 | + 418FD8888E86D9435CE0E919 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; }; | ||
| 45 | + 6003F58A195388D20070C39A /* CNLiveCommunitModule_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CNLiveCommunitModule_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
| 46 | + 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; | ||
| 47 | + 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; | ||
| 48 | + 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; | ||
| 49 | + 6003F595195388D20070C39A /* CNLiveCommunitModule-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CNLiveCommunitModule-Info.plist"; sourceTree = "<group>"; }; | ||
| 50 | + 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; }; | ||
| 51 | + 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; | ||
| 52 | + 6003F59B195388D20070C39A /* CNLiveCommunitModule-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CNLiveCommunitModule-Prefix.pch"; sourceTree = "<group>"; }; | ||
| 53 | + 6003F59C195388D20070C39A /* CNLIVEAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLIVEAppDelegate.h; sourceTree = "<group>"; }; | ||
| 54 | + 6003F59D195388D20070C39A /* CNLIVEAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLIVEAppDelegate.m; sourceTree = "<group>"; }; | ||
| 55 | + 6003F5A5195388D20070C39A /* CNLIVEViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLIVEViewController.h; sourceTree = "<group>"; }; | ||
| 56 | + 6003F5A6195388D20070C39A /* CNLIVEViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLIVEViewController.m; sourceTree = "<group>"; }; | ||
| 57 | + 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; }; | ||
| 58 | + 6003F5AE195388D20070C39A /* CNLiveCommunitModule_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CNLiveCommunitModule_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
| 59 | + 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; | ||
| 60 | + 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = "<group>"; }; | ||
| 61 | + 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; }; | ||
| 62 | + 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = "<group>"; }; | ||
| 63 | + 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = "<group>"; }; | ||
| 64 | + 71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; | ||
| 65 | + 79774D0227B4D70100C19417 /* CNLIVEMainViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLIVEMainViewController.h; sourceTree = "<group>"; }; | ||
| 66 | + 79774D0327B4D70100C19417 /* CNLIVEMainViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLIVEMainViewController.m; sourceTree = "<group>"; }; | ||
| 67 | + 79774D0727B4DB5700C19417 /* CNLiveCommunitModuleImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveCommunitModuleImpl.h; sourceTree = "<group>"; }; | ||
| 68 | + 79774D0827B4DB5700C19417 /* CNLiveCommunitModuleImpl.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLiveCommunitModuleImpl.m; sourceTree = "<group>"; }; | ||
| 69 | + 804FCC16BB325573E6B0DB9B /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; }; | ||
| 70 | + 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; | ||
| 71 | + B5BEFA16E330C9372604D9F7 /* Pods-CNLiveCommunitModule_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveCommunitModule_Example.release.xcconfig"; path = "Target Support Files/Pods-CNLiveCommunitModule_Example/Pods-CNLiveCommunitModule_Example.release.xcconfig"; sourceTree = "<group>"; }; | ||
| 72 | + CF06BB501A468F9E729DA9CB /* Pods-CNLiveCommunitModule_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveCommunitModule_Tests.debug.xcconfig"; path = "Target Support Files/Pods-CNLiveCommunitModule_Tests/Pods-CNLiveCommunitModule_Tests.debug.xcconfig"; sourceTree = "<group>"; }; | ||
| 73 | + F96CB85649BAFAFCE5D8C8D2 /* Pods_CNLiveCommunitModule_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CNLiveCommunitModule_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
| 74 | + FAAE03D98BA182B731CCBD77 /* Pods-CNLiveCommunitModule_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveCommunitModule_Tests.release.xcconfig"; path = "Target Support Files/Pods-CNLiveCommunitModule_Tests/Pods-CNLiveCommunitModule_Tests.release.xcconfig"; sourceTree = "<group>"; }; | ||
| 75 | + FEBFB3EC666EC58228348C8D /* Pods_CNLiveCommunitModule_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CNLiveCommunitModule_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
| 76 | +/* End PBXFileReference section */ | ||
| 77 | + | ||
| 78 | +/* Begin PBXFrameworksBuildPhase section */ | ||
| 79 | + 6003F587195388D20070C39A /* Frameworks */ = { | ||
| 80 | + isa = PBXFrameworksBuildPhase; | ||
| 81 | + buildActionMask = 2147483647; | ||
| 82 | + files = ( | ||
| 83 | + 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, | ||
| 84 | + 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, | ||
| 85 | + 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, | ||
| 86 | + B336D5F1EE51497C378FC1AE /* Pods_CNLiveCommunitModule_Example.framework in Frameworks */, | ||
| 87 | + ); | ||
| 88 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 89 | + }; | ||
| 90 | + 6003F5AB195388D20070C39A /* Frameworks */ = { | ||
| 91 | + isa = PBXFrameworksBuildPhase; | ||
| 92 | + buildActionMask = 2147483647; | ||
| 93 | + files = ( | ||
| 94 | + 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, | ||
| 95 | + 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, | ||
| 96 | + 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, | ||
| 97 | + 2D9568334C30F71D68CE38E5 /* Pods_CNLiveCommunitModule_Tests.framework in Frameworks */, | ||
| 98 | + ); | ||
| 99 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 100 | + }; | ||
| 101 | +/* End PBXFrameworksBuildPhase section */ | ||
| 102 | + | ||
| 103 | +/* Begin PBXGroup section */ | ||
| 104 | + 6003F581195388D10070C39A = { | ||
| 105 | + isa = PBXGroup; | ||
| 106 | + children = ( | ||
| 107 | + 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, | ||
| 108 | + 6003F593195388D20070C39A /* Example for CNLiveCommunitModule */, | ||
| 109 | + 6003F5B5195388D20070C39A /* Tests */, | ||
| 110 | + 6003F58C195388D20070C39A /* Frameworks */, | ||
| 111 | + 6003F58B195388D20070C39A /* Products */, | ||
| 112 | + D6CC0A37B8E2D696C51E4A82 /* Pods */, | ||
| 113 | + ); | ||
| 114 | + sourceTree = "<group>"; | ||
| 115 | + }; | ||
| 116 | + 6003F58B195388D20070C39A /* Products */ = { | ||
| 117 | + isa = PBXGroup; | ||
| 118 | + children = ( | ||
| 119 | + 6003F58A195388D20070C39A /* CNLiveCommunitModule_Example.app */, | ||
| 120 | + 6003F5AE195388D20070C39A /* CNLiveCommunitModule_Tests.xctest */, | ||
| 121 | + ); | ||
| 122 | + name = Products; | ||
| 123 | + sourceTree = "<group>"; | ||
| 124 | + }; | ||
| 125 | + 6003F58C195388D20070C39A /* Frameworks */ = { | ||
| 126 | + isa = PBXGroup; | ||
| 127 | + children = ( | ||
| 128 | + 6003F58D195388D20070C39A /* Foundation.framework */, | ||
| 129 | + 6003F58F195388D20070C39A /* CoreGraphics.framework */, | ||
| 130 | + 6003F591195388D20070C39A /* UIKit.framework */, | ||
| 131 | + 6003F5AF195388D20070C39A /* XCTest.framework */, | ||
| 132 | + FEBFB3EC666EC58228348C8D /* Pods_CNLiveCommunitModule_Example.framework */, | ||
| 133 | + F96CB85649BAFAFCE5D8C8D2 /* Pods_CNLiveCommunitModule_Tests.framework */, | ||
| 134 | + ); | ||
| 135 | + name = Frameworks; | ||
| 136 | + sourceTree = "<group>"; | ||
| 137 | + }; | ||
| 138 | + 6003F593195388D20070C39A /* Example for CNLiveCommunitModule */ = { | ||
| 139 | + isa = PBXGroup; | ||
| 140 | + children = ( | ||
| 141 | + 6003F59C195388D20070C39A /* CNLIVEAppDelegate.h */, | ||
| 142 | + 6003F59D195388D20070C39A /* CNLIVEAppDelegate.m */, | ||
| 143 | + 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */, | ||
| 144 | + 6003F5A5195388D20070C39A /* CNLIVEViewController.h */, | ||
| 145 | + 6003F5A6195388D20070C39A /* CNLIVEViewController.m */, | ||
| 146 | + 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */, | ||
| 147 | + 6003F5A8195388D20070C39A /* Images.xcassets */, | ||
| 148 | + 6003F594195388D20070C39A /* Supporting Files */, | ||
| 149 | + 79774D0227B4D70100C19417 /* CNLIVEMainViewController.h */, | ||
| 150 | + 79774D0327B4D70100C19417 /* CNLIVEMainViewController.m */, | ||
| 151 | + 79774D0727B4DB5700C19417 /* CNLiveCommunitModuleImpl.h */, | ||
| 152 | + 79774D0827B4DB5700C19417 /* CNLiveCommunitModuleImpl.m */, | ||
| 153 | + ); | ||
| 154 | + name = "Example for CNLiveCommunitModule"; | ||
| 155 | + path = CNLiveCommunitModule; | ||
| 156 | + sourceTree = "<group>"; | ||
| 157 | + }; | ||
| 158 | + 6003F594195388D20070C39A /* Supporting Files */ = { | ||
| 159 | + isa = PBXGroup; | ||
| 160 | + children = ( | ||
| 161 | + 6003F595195388D20070C39A /* CNLiveCommunitModule-Info.plist */, | ||
| 162 | + 6003F596195388D20070C39A /* InfoPlist.strings */, | ||
| 163 | + 6003F599195388D20070C39A /* main.m */, | ||
| 164 | + 6003F59B195388D20070C39A /* CNLiveCommunitModule-Prefix.pch */, | ||
| 165 | + ); | ||
| 166 | + name = "Supporting Files"; | ||
| 167 | + sourceTree = "<group>"; | ||
| 168 | + }; | ||
| 169 | + 6003F5B5195388D20070C39A /* Tests */ = { | ||
| 170 | + isa = PBXGroup; | ||
| 171 | + children = ( | ||
| 172 | + 6003F5BB195388D20070C39A /* Tests.m */, | ||
| 173 | + 6003F5B6195388D20070C39A /* Supporting Files */, | ||
| 174 | + ); | ||
| 175 | + path = Tests; | ||
| 176 | + sourceTree = "<group>"; | ||
| 177 | + }; | ||
| 178 | + 6003F5B6195388D20070C39A /* Supporting Files */ = { | ||
| 179 | + isa = PBXGroup; | ||
| 180 | + children = ( | ||
| 181 | + 6003F5B7195388D20070C39A /* Tests-Info.plist */, | ||
| 182 | + 6003F5B8195388D20070C39A /* InfoPlist.strings */, | ||
| 183 | + 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, | ||
| 184 | + ); | ||
| 185 | + name = "Supporting Files"; | ||
| 186 | + sourceTree = "<group>"; | ||
| 187 | + }; | ||
| 188 | + 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { | ||
| 189 | + isa = PBXGroup; | ||
| 190 | + children = ( | ||
| 191 | + 2A5F54F844696F1A4B71CADD /* CNLiveCommunitModule.podspec */, | ||
| 192 | + 804FCC16BB325573E6B0DB9B /* README.md */, | ||
| 193 | + 418FD8888E86D9435CE0E919 /* LICENSE */, | ||
| 194 | + ); | ||
| 195 | + name = "Podspec Metadata"; | ||
| 196 | + sourceTree = "<group>"; | ||
| 197 | + }; | ||
| 198 | + D6CC0A37B8E2D696C51E4A82 /* Pods */ = { | ||
| 199 | + isa = PBXGroup; | ||
| 200 | + children = ( | ||
| 201 | + 1CB5CDB74584B3B4E0DF016D /* Pods-CNLiveCommunitModule_Example.debug.xcconfig */, | ||
| 202 | + B5BEFA16E330C9372604D9F7 /* Pods-CNLiveCommunitModule_Example.release.xcconfig */, | ||
| 203 | + CF06BB501A468F9E729DA9CB /* Pods-CNLiveCommunitModule_Tests.debug.xcconfig */, | ||
| 204 | + FAAE03D98BA182B731CCBD77 /* Pods-CNLiveCommunitModule_Tests.release.xcconfig */, | ||
| 205 | + ); | ||
| 206 | + path = Pods; | ||
| 207 | + sourceTree = "<group>"; | ||
| 208 | + }; | ||
| 209 | +/* End PBXGroup section */ | ||
| 210 | + | ||
| 211 | +/* Begin PBXNativeTarget section */ | ||
| 212 | + 6003F589195388D20070C39A /* CNLiveCommunitModule_Example */ = { | ||
| 213 | + isa = PBXNativeTarget; | ||
| 214 | + buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "CNLiveCommunitModule_Example" */; | ||
| 215 | + buildPhases = ( | ||
| 216 | + 0B4CF17B62BE14E77E856AF2 /* [CP] Check Pods Manifest.lock */, | ||
| 217 | + 6003F586195388D20070C39A /* Sources */, | ||
| 218 | + 6003F587195388D20070C39A /* Frameworks */, | ||
| 219 | + 6003F588195388D20070C39A /* Resources */, | ||
| 220 | + 0C9D45F0A61670FF2C406E89 /* [CP] Embed Pods Frameworks */, | ||
| 221 | + 6697F8C9EAED81802B14EBA5 /* [CP] Copy Pods Resources */, | ||
| 222 | + ); | ||
| 223 | + buildRules = ( | ||
| 224 | + ); | ||
| 225 | + dependencies = ( | ||
| 226 | + ); | ||
| 227 | + name = CNLiveCommunitModule_Example; | ||
| 228 | + productName = CNLiveCommunitModule; | ||
| 229 | + productReference = 6003F58A195388D20070C39A /* CNLiveCommunitModule_Example.app */; | ||
| 230 | + productType = "com.apple.product-type.application"; | ||
| 231 | + }; | ||
| 232 | + 6003F5AD195388D20070C39A /* CNLiveCommunitModule_Tests */ = { | ||
| 233 | + isa = PBXNativeTarget; | ||
| 234 | + buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "CNLiveCommunitModule_Tests" */; | ||
| 235 | + buildPhases = ( | ||
| 236 | + D25982AC22D42B23EAFE7AC2 /* [CP] Check Pods Manifest.lock */, | ||
| 237 | + 6003F5AA195388D20070C39A /* Sources */, | ||
| 238 | + 6003F5AB195388D20070C39A /* Frameworks */, | ||
| 239 | + 6003F5AC195388D20070C39A /* Resources */, | ||
| 240 | + ); | ||
| 241 | + buildRules = ( | ||
| 242 | + ); | ||
| 243 | + dependencies = ( | ||
| 244 | + 6003F5B4195388D20070C39A /* PBXTargetDependency */, | ||
| 245 | + ); | ||
| 246 | + name = CNLiveCommunitModule_Tests; | ||
| 247 | + productName = CNLiveCommunitModuleTests; | ||
| 248 | + productReference = 6003F5AE195388D20070C39A /* CNLiveCommunitModule_Tests.xctest */; | ||
| 249 | + productType = "com.apple.product-type.bundle.unit-test"; | ||
| 250 | + }; | ||
| 251 | +/* End PBXNativeTarget section */ | ||
| 252 | + | ||
| 253 | +/* Begin PBXProject section */ | ||
| 254 | + 6003F582195388D10070C39A /* Project object */ = { | ||
| 255 | + isa = PBXProject; | ||
| 256 | + attributes = { | ||
| 257 | + CLASSPREFIX = CNLIVE; | ||
| 258 | + LastUpgradeCheck = 0720; | ||
| 259 | + ORGANIZATIONNAME = woshiliushiyu; | ||
| 260 | + TargetAttributes = { | ||
| 261 | + 6003F589195388D20070C39A = { | ||
| 262 | + DevelopmentTeam = 94X49GG3ZW; | ||
| 263 | + }; | ||
| 264 | + 6003F5AD195388D20070C39A = { | ||
| 265 | + TestTargetID = 6003F589195388D20070C39A; | ||
| 266 | + }; | ||
| 267 | + }; | ||
| 268 | + }; | ||
| 269 | + buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "CNLiveCommunitModule" */; | ||
| 270 | + compatibilityVersion = "Xcode 3.2"; | ||
| 271 | + developmentRegion = English; | ||
| 272 | + hasScannedForEncodings = 0; | ||
| 273 | + knownRegions = ( | ||
| 274 | + English, | ||
| 275 | + en, | ||
| 276 | + Base, | ||
| 277 | + ); | ||
| 278 | + mainGroup = 6003F581195388D10070C39A; | ||
| 279 | + productRefGroup = 6003F58B195388D20070C39A /* Products */; | ||
| 280 | + projectDirPath = ""; | ||
| 281 | + projectRoot = ""; | ||
| 282 | + targets = ( | ||
| 283 | + 6003F589195388D20070C39A /* CNLiveCommunitModule_Example */, | ||
| 284 | + 6003F5AD195388D20070C39A /* CNLiveCommunitModule_Tests */, | ||
| 285 | + ); | ||
| 286 | + }; | ||
| 287 | +/* End PBXProject section */ | ||
| 288 | + | ||
| 289 | +/* Begin PBXResourcesBuildPhase section */ | ||
| 290 | + 6003F588195388D20070C39A /* Resources */ = { | ||
| 291 | + isa = PBXResourcesBuildPhase; | ||
| 292 | + buildActionMask = 2147483647; | ||
| 293 | + files = ( | ||
| 294 | + 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */, | ||
| 295 | + 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */, | ||
| 296 | + 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, | ||
| 297 | + 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, | ||
| 298 | + ); | ||
| 299 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 300 | + }; | ||
| 301 | + 6003F5AC195388D20070C39A /* Resources */ = { | ||
| 302 | + isa = PBXResourcesBuildPhase; | ||
| 303 | + buildActionMask = 2147483647; | ||
| 304 | + files = ( | ||
| 305 | + 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, | ||
| 306 | + ); | ||
| 307 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 308 | + }; | ||
| 309 | +/* End PBXResourcesBuildPhase section */ | ||
| 310 | + | ||
| 311 | +/* Begin PBXShellScriptBuildPhase section */ | ||
| 312 | + 0B4CF17B62BE14E77E856AF2 /* [CP] Check Pods Manifest.lock */ = { | ||
| 313 | + isa = PBXShellScriptBuildPhase; | ||
| 314 | + buildActionMask = 2147483647; | ||
| 315 | + files = ( | ||
| 316 | + ); | ||
| 317 | + inputFileListPaths = ( | ||
| 318 | + ); | ||
| 319 | + inputPaths = ( | ||
| 320 | + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", | ||
| 321 | + "${PODS_ROOT}/Manifest.lock", | ||
| 322 | + ); | ||
| 323 | + name = "[CP] Check Pods Manifest.lock"; | ||
| 324 | + outputFileListPaths = ( | ||
| 325 | + ); | ||
| 326 | + outputPaths = ( | ||
| 327 | + "$(DERIVED_FILE_DIR)/Pods-CNLiveCommunitModule_Example-checkManifestLockResult.txt", | ||
| 328 | + ); | ||
| 329 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 330 | + shellPath = /bin/sh; | ||
| 331 | + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; | ||
| 332 | + showEnvVarsInLog = 0; | ||
| 333 | + }; | ||
| 334 | + 0C9D45F0A61670FF2C406E89 /* [CP] Embed Pods Frameworks */ = { | ||
| 335 | + isa = PBXShellScriptBuildPhase; | ||
| 336 | + buildActionMask = 2147483647; | ||
| 337 | + files = ( | ||
| 338 | + ); | ||
| 339 | + inputPaths = ( | ||
| 340 | + "${PODS_ROOT}/Target Support Files/Pods-CNLiveCommunitModule_Example/Pods-CNLiveCommunitModule_Example-frameworks.sh", | ||
| 341 | + "${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework", | ||
| 342 | + "${BUILT_PRODUCTS_DIR}/CNLiveAVCamera/CNLiveAVCamera.framework", | ||
| 343 | + "${BUILT_PRODUCTS_DIR}/CNLiveBaseKit/CNLiveBaseKit.framework", | ||
| 344 | + "${BUILT_PRODUCTS_DIR}/CNLiveBaseTools/CNLiveBaseTools.framework", | ||
| 345 | + "${BUILT_PRODUCTS_DIR}/CNLiveBeeHive/CNLiveBeeHive.framework", | ||
| 346 | + "${BUILT_PRODUCTS_DIR}/CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.framework", | ||
| 347 | + "${BUILT_PRODUCTS_DIR}/CNLiveBusinessTools/CNLiveBusinessTools.framework", | ||
| 348 | + "${BUILT_PRODUCTS_DIR}/CNLiveCommonCategory/CNLiveCommonCategory.framework", | ||
| 349 | + "${BUILT_PRODUCTS_DIR}/CNLiveCustomUI/CNLiveCustomUI.framework", | ||
| 350 | + "${BUILT_PRODUCTS_DIR}/CNLiveEnvironment/CNLiveEnvironment.framework", | ||
| 351 | + "${BUILT_PRODUCTS_DIR}/CNLiveImagePickerController/CNLiveImagePickerController.framework", | ||
| 352 | + "${BUILT_PRODUCTS_DIR}/CNLiveNewTripartiteManagement/CNLiveNewTripartiteManagement.framework", | ||
| 353 | + "${BUILT_PRODUCTS_DIR}/CNLiveRequestBastKit/CNLiveRequestBastKit.framework", | ||
| 354 | + "${BUILT_PRODUCTS_DIR}/CNLiveUploadManager/CNLiveUploadManager.framework", | ||
| 355 | + "${BUILT_PRODUCTS_DIR}/CNLiveUserManagement/CNLiveUserManagement.framework", | ||
| 356 | + "${BUILT_PRODUCTS_DIR}/DSBaseModule/DSBaseModule.framework", | ||
| 357 | + "${BUILT_PRODUCTS_DIR}/DSGTMBase64/DSGTMBase64.framework", | ||
| 358 | + "${BUILT_PRODUCTS_DIR}/DZNEmptyDataSet/DZNEmptyDataSet.framework", | ||
| 359 | + "${BUILT_PRODUCTS_DIR}/HappyDNS/HappyDNS.framework", | ||
| 360 | + "${BUILT_PRODUCTS_DIR}/IQKeyboardManager/IQKeyboardManager.framework", | ||
| 361 | + "${BUILT_PRODUCTS_DIR}/JXCategoryView/JXCategoryView.framework", | ||
| 362 | + "${BUILT_PRODUCTS_DIR}/JXPagingView/JXPagingView.framework", | ||
| 363 | + "${BUILT_PRODUCTS_DIR}/MBProgressHUD/MBProgressHUD.framework", | ||
| 364 | + "${BUILT_PRODUCTS_DIR}/MJExtension/MJExtension.framework", | ||
| 365 | + "${BUILT_PRODUCTS_DIR}/MJRefresh/MJRefresh.framework", | ||
| 366 | + "${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework", | ||
| 367 | + "${BUILT_PRODUCTS_DIR}/QMUIKit/QMUIKit.framework", | ||
| 368 | + "${BUILT_PRODUCTS_DIR}/Qiniu/Qiniu.framework", | ||
| 369 | + "${BUILT_PRODUCTS_DIR}/SAMKeychain/SAMKeychain.framework", | ||
| 370 | + "${BUILT_PRODUCTS_DIR}/SDAutoLayout/SDAutoLayout.framework", | ||
| 371 | + "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", | ||
| 372 | + "${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework", | ||
| 373 | + "${BUILT_PRODUCTS_DIR}/YYAsyncLayer/YYAsyncLayer.framework", | ||
| 374 | + "${BUILT_PRODUCTS_DIR}/YYCache/YYCache.framework", | ||
| 375 | + "${BUILT_PRODUCTS_DIR}/YYCategories/YYCategories.framework", | ||
| 376 | + "${BUILT_PRODUCTS_DIR}/YYDispatchQueuePool/YYDispatchQueuePool.framework", | ||
| 377 | + "${BUILT_PRODUCTS_DIR}/YYImage/YYImage.framework", | ||
| 378 | + "${BUILT_PRODUCTS_DIR}/YYKeyboardManager/YYKeyboardManager.framework", | ||
| 379 | + "${BUILT_PRODUCTS_DIR}/YYModel/YYModel.framework", | ||
| 380 | + "${BUILT_PRODUCTS_DIR}/YYText/YYText.framework", | ||
| 381 | + "${BUILT_PRODUCTS_DIR}/YYWebImage/YYWebImage.framework", | ||
| 382 | + ); | ||
| 383 | + name = "[CP] Embed Pods Frameworks"; | ||
| 384 | + outputPaths = ( | ||
| 385 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AFNetworking.framework", | ||
| 386 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveAVCamera.framework", | ||
| 387 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseKit.framework", | ||
| 388 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseTools.framework", | ||
| 389 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBeeHive.framework", | ||
| 390 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBusinessBaseModule.framework", | ||
| 391 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBusinessTools.framework", | ||
| 392 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCommonCategory.framework", | ||
| 393 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCustomUI.framework", | ||
| 394 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveEnvironment.framework", | ||
| 395 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveImagePickerController.framework", | ||
| 396 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveNewTripartiteManagement.framework", | ||
| 397 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveRequestBastKit.framework", | ||
| 398 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveUploadManager.framework", | ||
| 399 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveUserManagement.framework", | ||
| 400 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DSBaseModule.framework", | ||
| 401 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DSGTMBase64.framework", | ||
| 402 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DZNEmptyDataSet.framework", | ||
| 403 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/HappyDNS.framework", | ||
| 404 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/IQKeyboardManager.framework", | ||
| 405 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/JXCategoryView.framework", | ||
| 406 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/JXPagingView.framework", | ||
| 407 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MBProgressHUD.framework", | ||
| 408 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJExtension.framework", | ||
| 409 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJRefresh.framework", | ||
| 410 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework", | ||
| 411 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/QMUIKit.framework", | ||
| 412 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Qiniu.framework", | ||
| 413 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SAMKeychain.framework", | ||
| 414 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDAutoLayout.framework", | ||
| 415 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", | ||
| 416 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SSZipArchive.framework", | ||
| 417 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYAsyncLayer.framework", | ||
| 418 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYCache.framework", | ||
| 419 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYCategories.framework", | ||
| 420 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYDispatchQueuePool.framework", | ||
| 421 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYImage.framework", | ||
| 422 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYKeyboardManager.framework", | ||
| 423 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYModel.framework", | ||
| 424 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYText.framework", | ||
| 425 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYWebImage.framework", | ||
| 426 | + ); | ||
| 427 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 428 | + shellPath = /bin/sh; | ||
| 429 | + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveCommunitModule_Example/Pods-CNLiveCommunitModule_Example-frameworks.sh\"\n"; | ||
| 430 | + showEnvVarsInLog = 0; | ||
| 431 | + }; | ||
| 432 | + 6697F8C9EAED81802B14EBA5 /* [CP] Copy Pods Resources */ = { | ||
| 433 | + isa = PBXShellScriptBuildPhase; | ||
| 434 | + buildActionMask = 2147483647; | ||
| 435 | + files = ( | ||
| 436 | + ); | ||
| 437 | + inputPaths = ( | ||
| 438 | + "${PODS_ROOT}/Target Support Files/Pods-CNLiveCommunitModule_Example/Pods-CNLiveCommunitModule_Example-resources.sh", | ||
| 439 | + "${PODS_CONFIGURATION_BUILD_DIR}/CNLiveCommunitModule/CNLiveCommunitModule.bundle", | ||
| 440 | + ); | ||
| 441 | + name = "[CP] Copy Pods Resources"; | ||
| 442 | + outputPaths = ( | ||
| 443 | + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CNLiveCommunitModule.bundle", | ||
| 444 | + ); | ||
| 445 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 446 | + shellPath = /bin/sh; | ||
| 447 | + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveCommunitModule_Example/Pods-CNLiveCommunitModule_Example-resources.sh\"\n"; | ||
| 448 | + showEnvVarsInLog = 0; | ||
| 449 | + }; | ||
| 450 | + D25982AC22D42B23EAFE7AC2 /* [CP] Check Pods Manifest.lock */ = { | ||
| 451 | + isa = PBXShellScriptBuildPhase; | ||
| 452 | + buildActionMask = 2147483647; | ||
| 453 | + files = ( | ||
| 454 | + ); | ||
| 455 | + inputFileListPaths = ( | ||
| 456 | + ); | ||
| 457 | + inputPaths = ( | ||
| 458 | + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", | ||
| 459 | + "${PODS_ROOT}/Manifest.lock", | ||
| 460 | + ); | ||
| 461 | + name = "[CP] Check Pods Manifest.lock"; | ||
| 462 | + outputFileListPaths = ( | ||
| 463 | + ); | ||
| 464 | + outputPaths = ( | ||
| 465 | + "$(DERIVED_FILE_DIR)/Pods-CNLiveCommunitModule_Tests-checkManifestLockResult.txt", | ||
| 466 | + ); | ||
| 467 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 468 | + shellPath = /bin/sh; | ||
| 469 | + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; | ||
| 470 | + showEnvVarsInLog = 0; | ||
| 471 | + }; | ||
| 472 | +/* End PBXShellScriptBuildPhase section */ | ||
| 473 | + | ||
| 474 | +/* Begin PBXSourcesBuildPhase section */ | ||
| 475 | + 6003F586195388D20070C39A /* Sources */ = { | ||
| 476 | + isa = PBXSourcesBuildPhase; | ||
| 477 | + buildActionMask = 2147483647; | ||
| 478 | + files = ( | ||
| 479 | + 6003F59E195388D20070C39A /* CNLIVEAppDelegate.m in Sources */, | ||
| 480 | + 6003F5A7195388D20070C39A /* CNLIVEViewController.m in Sources */, | ||
| 481 | + 79774D0427B4D70100C19417 /* CNLIVEMainViewController.m in Sources */, | ||
| 482 | + 6003F59A195388D20070C39A /* main.m in Sources */, | ||
| 483 | + 79774D0927B4DB5700C19417 /* CNLiveCommunitModuleImpl.m in Sources */, | ||
| 484 | + ); | ||
| 485 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 486 | + }; | ||
| 487 | + 6003F5AA195388D20070C39A /* Sources */ = { | ||
| 488 | + isa = PBXSourcesBuildPhase; | ||
| 489 | + buildActionMask = 2147483647; | ||
| 490 | + files = ( | ||
| 491 | + 6003F5BC195388D20070C39A /* Tests.m in Sources */, | ||
| 492 | + ); | ||
| 493 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 494 | + }; | ||
| 495 | +/* End PBXSourcesBuildPhase section */ | ||
| 496 | + | ||
| 497 | +/* Begin PBXTargetDependency section */ | ||
| 498 | + 6003F5B4195388D20070C39A /* PBXTargetDependency */ = { | ||
| 499 | + isa = PBXTargetDependency; | ||
| 500 | + target = 6003F589195388D20070C39A /* CNLiveCommunitModule_Example */; | ||
| 501 | + targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; | ||
| 502 | + }; | ||
| 503 | +/* End PBXTargetDependency section */ | ||
| 504 | + | ||
| 505 | +/* Begin PBXVariantGroup section */ | ||
| 506 | + 6003F596195388D20070C39A /* InfoPlist.strings */ = { | ||
| 507 | + isa = PBXVariantGroup; | ||
| 508 | + children = ( | ||
| 509 | + 6003F597195388D20070C39A /* en */, | ||
| 510 | + ); | ||
| 511 | + name = InfoPlist.strings; | ||
| 512 | + sourceTree = "<group>"; | ||
| 513 | + }; | ||
| 514 | + 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { | ||
| 515 | + isa = PBXVariantGroup; | ||
| 516 | + children = ( | ||
| 517 | + 6003F5B9195388D20070C39A /* en */, | ||
| 518 | + ); | ||
| 519 | + name = InfoPlist.strings; | ||
| 520 | + sourceTree = "<group>"; | ||
| 521 | + }; | ||
| 522 | + 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */ = { | ||
| 523 | + isa = PBXVariantGroup; | ||
| 524 | + children = ( | ||
| 525 | + 71719F9E1E33DC2100824A3D /* Base */, | ||
| 526 | + ); | ||
| 527 | + name = LaunchScreen.storyboard; | ||
| 528 | + sourceTree = "<group>"; | ||
| 529 | + }; | ||
| 530 | +/* End PBXVariantGroup section */ | ||
| 531 | + | ||
| 532 | +/* Begin XCBuildConfiguration section */ | ||
| 533 | + 6003F5BD195388D20070C39A /* Debug */ = { | ||
| 534 | + isa = XCBuildConfiguration; | ||
| 535 | + buildSettings = { | ||
| 536 | + ALWAYS_SEARCH_USER_PATHS = NO; | ||
| 537 | + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; | ||
| 538 | + CLANG_CXX_LIBRARY = "libc++"; | ||
| 539 | + CLANG_ENABLE_MODULES = YES; | ||
| 540 | + CLANG_ENABLE_OBJC_ARC = YES; | ||
| 541 | + CLANG_WARN_BOOL_CONVERSION = YES; | ||
| 542 | + CLANG_WARN_CONSTANT_CONVERSION = YES; | ||
| 543 | + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | ||
| 544 | + CLANG_WARN_EMPTY_BODY = YES; | ||
| 545 | + CLANG_WARN_ENUM_CONVERSION = YES; | ||
| 546 | + CLANG_WARN_INT_CONVERSION = YES; | ||
| 547 | + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | ||
| 548 | + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | ||
| 549 | + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | ||
| 550 | + COPY_PHASE_STRIP = NO; | ||
| 551 | + ENABLE_TESTABILITY = YES; | ||
| 552 | + GCC_C_LANGUAGE_STANDARD = gnu99; | ||
| 553 | + GCC_DYNAMIC_NO_PIC = NO; | ||
| 554 | + GCC_OPTIMIZATION_LEVEL = 0; | ||
| 555 | + GCC_PREPROCESSOR_DEFINITIONS = ( | ||
| 556 | + "DEBUG=1", | ||
| 557 | + "$(inherited)", | ||
| 558 | + ); | ||
| 559 | + GCC_SYMBOLS_PRIVATE_EXTERN = NO; | ||
| 560 | + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | ||
| 561 | + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; | ||
| 562 | + GCC_WARN_UNDECLARED_SELECTOR = YES; | ||
| 563 | + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | ||
| 564 | + GCC_WARN_UNUSED_FUNCTION = YES; | ||
| 565 | + GCC_WARN_UNUSED_VARIABLE = YES; | ||
| 566 | + IPHONEOS_DEPLOYMENT_TARGET = 9.3; | ||
| 567 | + ONLY_ACTIVE_ARCH = YES; | ||
| 568 | + SDKROOT = iphoneos; | ||
| 569 | + TARGETED_DEVICE_FAMILY = "1,2"; | ||
| 570 | + }; | ||
| 571 | + name = Debug; | ||
| 572 | + }; | ||
| 573 | + 6003F5BE195388D20070C39A /* Release */ = { | ||
| 574 | + isa = XCBuildConfiguration; | ||
| 575 | + buildSettings = { | ||
| 576 | + ALWAYS_SEARCH_USER_PATHS = NO; | ||
| 577 | + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; | ||
| 578 | + CLANG_CXX_LIBRARY = "libc++"; | ||
| 579 | + CLANG_ENABLE_MODULES = YES; | ||
| 580 | + CLANG_ENABLE_OBJC_ARC = YES; | ||
| 581 | + CLANG_WARN_BOOL_CONVERSION = YES; | ||
| 582 | + CLANG_WARN_CONSTANT_CONVERSION = YES; | ||
| 583 | + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | ||
| 584 | + CLANG_WARN_EMPTY_BODY = YES; | ||
| 585 | + CLANG_WARN_ENUM_CONVERSION = YES; | ||
| 586 | + CLANG_WARN_INT_CONVERSION = YES; | ||
| 587 | + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | ||
| 588 | + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | ||
| 589 | + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | ||
| 590 | + COPY_PHASE_STRIP = YES; | ||
| 591 | + ENABLE_NS_ASSERTIONS = NO; | ||
| 592 | + GCC_C_LANGUAGE_STANDARD = gnu99; | ||
| 593 | + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | ||
| 594 | + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; | ||
| 595 | + GCC_WARN_UNDECLARED_SELECTOR = YES; | ||
| 596 | + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | ||
| 597 | + GCC_WARN_UNUSED_FUNCTION = YES; | ||
| 598 | + GCC_WARN_UNUSED_VARIABLE = YES; | ||
| 599 | + IPHONEOS_DEPLOYMENT_TARGET = 9.3; | ||
| 600 | + SDKROOT = iphoneos; | ||
| 601 | + TARGETED_DEVICE_FAMILY = "1,2"; | ||
| 602 | + VALIDATE_PRODUCT = YES; | ||
| 603 | + }; | ||
| 604 | + name = Release; | ||
| 605 | + }; | ||
| 606 | + 6003F5C0195388D20070C39A /* Debug */ = { | ||
| 607 | + isa = XCBuildConfiguration; | ||
| 608 | + baseConfigurationReference = 1CB5CDB74584B3B4E0DF016D /* Pods-CNLiveCommunitModule_Example.debug.xcconfig */; | ||
| 609 | + buildSettings = { | ||
| 610 | + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | ||
| 611 | + DEVELOPMENT_TEAM = 94X49GG3ZW; | ||
| 612 | + GCC_PRECOMPILE_PREFIX_HEADER = YES; | ||
| 613 | + GCC_PREFIX_HEADER = "CNLiveCommunitModule/CNLiveCommunitModule-Prefix.pch"; | ||
| 614 | + INFOPLIST_FILE = "CNLiveCommunitModule/CNLiveCommunitModule-Info.plist"; | ||
| 615 | + MODULE_NAME = ExampleApp; | ||
| 616 | + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; | ||
| 617 | + PRODUCT_NAME = "$(TARGET_NAME)"; | ||
| 618 | + SWIFT_VERSION = 4.0; | ||
| 619 | + WRAPPER_EXTENSION = app; | ||
| 620 | + }; | ||
| 621 | + name = Debug; | ||
| 622 | + }; | ||
| 623 | + 6003F5C1195388D20070C39A /* Release */ = { | ||
| 624 | + isa = XCBuildConfiguration; | ||
| 625 | + baseConfigurationReference = B5BEFA16E330C9372604D9F7 /* Pods-CNLiveCommunitModule_Example.release.xcconfig */; | ||
| 626 | + buildSettings = { | ||
| 627 | + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | ||
| 628 | + DEVELOPMENT_TEAM = 94X49GG3ZW; | ||
| 629 | + GCC_PRECOMPILE_PREFIX_HEADER = YES; | ||
| 630 | + GCC_PREFIX_HEADER = "CNLiveCommunitModule/CNLiveCommunitModule-Prefix.pch"; | ||
| 631 | + INFOPLIST_FILE = "CNLiveCommunitModule/CNLiveCommunitModule-Info.plist"; | ||
| 632 | + MODULE_NAME = ExampleApp; | ||
| 633 | + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; | ||
| 634 | + PRODUCT_NAME = "$(TARGET_NAME)"; | ||
| 635 | + SWIFT_VERSION = 4.0; | ||
| 636 | + WRAPPER_EXTENSION = app; | ||
| 637 | + }; | ||
| 638 | + name = Release; | ||
| 639 | + }; | ||
| 640 | + 6003F5C3195388D20070C39A /* Debug */ = { | ||
| 641 | + isa = XCBuildConfiguration; | ||
| 642 | + baseConfigurationReference = CF06BB501A468F9E729DA9CB /* Pods-CNLiveCommunitModule_Tests.debug.xcconfig */; | ||
| 643 | + buildSettings = { | ||
| 644 | + BUNDLE_LOADER = "$(TEST_HOST)"; | ||
| 645 | + FRAMEWORK_SEARCH_PATHS = ( | ||
| 646 | + "$(PLATFORM_DIR)/Developer/Library/Frameworks", | ||
| 647 | + "$(inherited)", | ||
| 648 | + "$(DEVELOPER_FRAMEWORKS_DIR)", | ||
| 649 | + ); | ||
| 650 | + GCC_PRECOMPILE_PREFIX_HEADER = YES; | ||
| 651 | + GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; | ||
| 652 | + GCC_PREPROCESSOR_DEFINITIONS = ( | ||
| 653 | + "DEBUG=1", | ||
| 654 | + "$(inherited)", | ||
| 655 | + ); | ||
| 656 | + INFOPLIST_FILE = "Tests/Tests-Info.plist"; | ||
| 657 | + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; | ||
| 658 | + PRODUCT_NAME = "$(TARGET_NAME)"; | ||
| 659 | + SWIFT_VERSION = 4.0; | ||
| 660 | + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CNLiveCommunitModule_Example.app/CNLiveCommunitModule_Example"; | ||
| 661 | + WRAPPER_EXTENSION = xctest; | ||
| 662 | + }; | ||
| 663 | + name = Debug; | ||
| 664 | + }; | ||
| 665 | + 6003F5C4195388D20070C39A /* Release */ = { | ||
| 666 | + isa = XCBuildConfiguration; | ||
| 667 | + baseConfigurationReference = FAAE03D98BA182B731CCBD77 /* Pods-CNLiveCommunitModule_Tests.release.xcconfig */; | ||
| 668 | + buildSettings = { | ||
| 669 | + BUNDLE_LOADER = "$(TEST_HOST)"; | ||
| 670 | + FRAMEWORK_SEARCH_PATHS = ( | ||
| 671 | + "$(PLATFORM_DIR)/Developer/Library/Frameworks", | ||
| 672 | + "$(inherited)", | ||
| 673 | + "$(DEVELOPER_FRAMEWORKS_DIR)", | ||
| 674 | + ); | ||
| 675 | + GCC_PRECOMPILE_PREFIX_HEADER = YES; | ||
| 676 | + GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; | ||
| 677 | + INFOPLIST_FILE = "Tests/Tests-Info.plist"; | ||
| 678 | + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; | ||
| 679 | + PRODUCT_NAME = "$(TARGET_NAME)"; | ||
| 680 | + SWIFT_VERSION = 4.0; | ||
| 681 | + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CNLiveCommunitModule_Example.app/CNLiveCommunitModule_Example"; | ||
| 682 | + WRAPPER_EXTENSION = xctest; | ||
| 683 | + }; | ||
| 684 | + name = Release; | ||
| 685 | + }; | ||
| 686 | +/* End XCBuildConfiguration section */ | ||
| 687 | + | ||
| 688 | +/* Begin XCConfigurationList section */ | ||
| 689 | + 6003F585195388D10070C39A /* Build configuration list for PBXProject "CNLiveCommunitModule" */ = { | ||
| 690 | + isa = XCConfigurationList; | ||
| 691 | + buildConfigurations = ( | ||
| 692 | + 6003F5BD195388D20070C39A /* Debug */, | ||
| 693 | + 6003F5BE195388D20070C39A /* Release */, | ||
| 694 | + ); | ||
| 695 | + defaultConfigurationIsVisible = 0; | ||
| 696 | + defaultConfigurationName = Release; | ||
| 697 | + }; | ||
| 698 | + 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "CNLiveCommunitModule_Example" */ = { | ||
| 699 | + isa = XCConfigurationList; | ||
| 700 | + buildConfigurations = ( | ||
| 701 | + 6003F5C0195388D20070C39A /* Debug */, | ||
| 702 | + 6003F5C1195388D20070C39A /* Release */, | ||
| 703 | + ); | ||
| 704 | + defaultConfigurationIsVisible = 0; | ||
| 705 | + defaultConfigurationName = Release; | ||
| 706 | + }; | ||
| 707 | + 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "CNLiveCommunitModule_Tests" */ = { | ||
| 708 | + isa = XCConfigurationList; | ||
| 709 | + buildConfigurations = ( | ||
| 710 | + 6003F5C3195388D20070C39A /* Debug */, | ||
| 711 | + 6003F5C4195388D20070C39A /* Release */, | ||
| 712 | + ); | ||
| 713 | + defaultConfigurationIsVisible = 0; | ||
| 714 | + defaultConfigurationName = Release; | ||
| 715 | + }; | ||
| 716 | +/* End XCConfigurationList section */ | ||
| 717 | + }; | ||
| 718 | + rootObject = 6003F582195388D10070C39A /* Project object */; | ||
| 719 | +} |
Example/CNLiveCommunitModule.xcodeproj/xcshareddata/xcschemes/CNLiveCommunitModule-Example.xcscheme
0 → 100644
| 1 | +++ a/Example/CNLiveCommunitModule.xcodeproj/xcshareddata/xcschemes/CNLiveCommunitModule-Example.xcscheme | ||
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<Scheme | ||
| 3 | + LastUpgradeVersion = "0720" | ||
| 4 | + version = "1.3"> | ||
| 5 | + <BuildAction | ||
| 6 | + parallelizeBuildables = "YES" | ||
| 7 | + buildImplicitDependencies = "YES"> | ||
| 8 | + <BuildActionEntries> | ||
| 9 | + <BuildActionEntry | ||
| 10 | + buildForTesting = "YES" | ||
| 11 | + buildForRunning = "YES" | ||
| 12 | + buildForProfiling = "YES" | ||
| 13 | + buildForArchiving = "YES" | ||
| 14 | + buildForAnalyzing = "YES"> | ||
| 15 | + <BuildableReference | ||
| 16 | + BuildableIdentifier = "primary" | ||
| 17 | + BlueprintIdentifier = "6003F589195388D20070C39A" | ||
| 18 | + BuildableName = "CNLiveCommunitModule_Example.app" | ||
| 19 | + BlueprintName = "CNLiveCommunitModule_Example" | ||
| 20 | + ReferencedContainer = "container:CNLiveCommunitModule.xcodeproj"> | ||
| 21 | + </BuildableReference> | ||
| 22 | + </BuildActionEntry> | ||
| 23 | + </BuildActionEntries> | ||
| 24 | + </BuildAction> | ||
| 25 | + <TestAction | ||
| 26 | + buildConfiguration = "Debug" | ||
| 27 | + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
| 28 | + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
| 29 | + shouldUseLaunchSchemeArgsEnv = "YES"> | ||
| 30 | + <Testables> | ||
| 31 | + <TestableReference | ||
| 32 | + skipped = "NO"> | ||
| 33 | + <BuildableReference | ||
| 34 | + BuildableIdentifier = "primary" | ||
| 35 | + BlueprintIdentifier = "6003F5AD195388D20070C39A" | ||
| 36 | + BuildableName = "CNLiveCommunitModule_Tests.xctest" | ||
| 37 | + BlueprintName = "CNLiveCommunitModule_Tests" | ||
| 38 | + ReferencedContainer = "container:CNLiveCommunitModule.xcodeproj"> | ||
| 39 | + </BuildableReference> | ||
| 40 | + </TestableReference> | ||
| 41 | + </Testables> | ||
| 42 | + <MacroExpansion> | ||
| 43 | + <BuildableReference | ||
| 44 | + BuildableIdentifier = "primary" | ||
| 45 | + BlueprintIdentifier = "6003F589195388D20070C39A" | ||
| 46 | + BuildableName = "CNLiveCommunitModule_Example.app" | ||
| 47 | + BlueprintName = "CNLiveCommunitModule_Example" | ||
| 48 | + ReferencedContainer = "container:CNLiveCommunitModule.xcodeproj"> | ||
| 49 | + </BuildableReference> | ||
| 50 | + </MacroExpansion> | ||
| 51 | + <AdditionalOptions> | ||
| 52 | + </AdditionalOptions> | ||
| 53 | + </TestAction> | ||
| 54 | + <LaunchAction | ||
| 55 | + buildConfiguration = "Debug" | ||
| 56 | + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
| 57 | + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
| 58 | + launchStyle = "0" | ||
| 59 | + useCustomWorkingDirectory = "NO" | ||
| 60 | + ignoresPersistentStateOnLaunch = "NO" | ||
| 61 | + debugDocumentVersioning = "YES" | ||
| 62 | + debugServiceExtension = "internal" | ||
| 63 | + allowLocationSimulation = "YES"> | ||
| 64 | + <BuildableProductRunnable | ||
| 65 | + runnableDebuggingMode = "0"> | ||
| 66 | + <BuildableReference | ||
| 67 | + BuildableIdentifier = "primary" | ||
| 68 | + BlueprintIdentifier = "6003F589195388D20070C39A" | ||
| 69 | + BuildableName = "CNLiveCommunitModule_Example.app" | ||
| 70 | + BlueprintName = "CNLiveCommunitModule_Example" | ||
| 71 | + ReferencedContainer = "container:CNLiveCommunitModule.xcodeproj"> | ||
| 72 | + </BuildableReference> | ||
| 73 | + </BuildableProductRunnable> | ||
| 74 | + <AdditionalOptions> | ||
| 75 | + </AdditionalOptions> | ||
| 76 | + </LaunchAction> | ||
| 77 | + <ProfileAction | ||
| 78 | + buildConfiguration = "Release" | ||
| 79 | + shouldUseLaunchSchemeArgsEnv = "YES" | ||
| 80 | + savedToolIdentifier = "" | ||
| 81 | + useCustomWorkingDirectory = "NO" | ||
| 82 | + debugDocumentVersioning = "YES"> | ||
| 83 | + <BuildableProductRunnable | ||
| 84 | + runnableDebuggingMode = "0"> | ||
| 85 | + <BuildableReference | ||
| 86 | + BuildableIdentifier = "primary" | ||
| 87 | + BlueprintIdentifier = "6003F589195388D20070C39A" | ||
| 88 | + BuildableName = "CNLiveCommunitModule_Example.app" | ||
| 89 | + BlueprintName = "CNLiveCommunitModule_Example" | ||
| 90 | + ReferencedContainer = "container:CNLiveCommunitModule.xcodeproj"> | ||
| 91 | + </BuildableReference> | ||
| 92 | + </BuildableProductRunnable> | ||
| 93 | + </ProfileAction> | ||
| 94 | + <AnalyzeAction | ||
| 95 | + buildConfiguration = "Debug"> | ||
| 96 | + </AnalyzeAction> | ||
| 97 | + <ArchiveAction | ||
| 98 | + buildConfiguration = "Release" | ||
| 99 | + revealArchiveInOrganizer = "YES"> | ||
| 100 | + </ArchiveAction> | ||
| 101 | +</Scheme> |
Example/CNLiveCommunitModule/Base.lproj/LaunchScreen.storyboard
0 → 100644
| 1 | +++ a/Example/CNLiveCommunitModule/Base.lproj/LaunchScreen.storyboard | ||
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> | ||
| 3 | + <device id="retina4_7" orientation="portrait"> | ||
| 4 | + <adaptation id="fullscreen"/> | ||
| 5 | + </device> | ||
| 6 | + <dependencies> | ||
| 7 | + <deployment identifier="iOS"/> | ||
| 8 | + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/> | ||
| 9 | + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
| 10 | + </dependencies> | ||
| 11 | + <scenes> | ||
| 12 | + <!--View Controller--> | ||
| 13 | + <scene sceneID="EHf-IW-A2E"> | ||
| 14 | + <objects> | ||
| 15 | + <viewController id="01J-lp-oVM" sceneMemberID="viewController"> | ||
| 16 | + <layoutGuides> | ||
| 17 | + <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/> | ||
| 18 | + <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/> | ||
| 19 | + </layoutGuides> | ||
| 20 | + <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> | ||
| 21 | + <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> | ||
| 22 | + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
| 23 | + <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | ||
| 24 | + </view> | ||
| 25 | + </viewController> | ||
| 26 | + <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
| 27 | + </objects> | ||
| 28 | + <point key="canvasLocation" x="53" y="375"/> | ||
| 29 | + </scene> | ||
| 30 | + </scenes> | ||
| 31 | +</document> |
Example/CNLiveCommunitModule/Base.lproj/Main.storyboard
0 → 100644
| 1 | +++ a/Example/CNLiveCommunitModule/Base.lproj/Main.storyboard | ||
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="whP-gf-Uak"> | ||
| 3 | + <device id="retina4_7" orientation="portrait"> | ||
| 4 | + <adaptation id="fullscreen"/> | ||
| 5 | + </device> | ||
| 6 | + <dependencies> | ||
| 7 | + <deployment identifier="iOS"/> | ||
| 8 | + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/> | ||
| 9 | + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
| 10 | + </dependencies> | ||
| 11 | + <scenes> | ||
| 12 | + <!--View Controller--> | ||
| 13 | + <scene sceneID="wQg-tq-qST"> | ||
| 14 | + <objects> | ||
| 15 | + <viewController id="whP-gf-Uak" customClass="CNLIVEViewController" sceneMemberID="viewController"> | ||
| 16 | + <layoutGuides> | ||
| 17 | + <viewControllerLayoutGuide type="top" id="uEw-UM-LJ8"/> | ||
| 18 | + <viewControllerLayoutGuide type="bottom" id="Mvr-aV-6Um"/> | ||
| 19 | + </layoutGuides> | ||
| 20 | + <view key="view" contentMode="scaleToFill" id="TpU-gO-2f1"> | ||
| 21 | + <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> | ||
| 22 | + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
| 23 | + <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | ||
| 24 | + </view> | ||
| 25 | + </viewController> | ||
| 26 | + <placeholder placeholderIdentifier="IBFirstResponder" id="tc2-Qw-aMS" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
| 27 | + </objects> | ||
| 28 | + <point key="canvasLocation" x="305" y="433"/> | ||
| 29 | + </scene> | ||
| 30 | + </scenes> | ||
| 31 | +</document> |
Example/CNLiveCommunitModule/CNLIVEAppDelegate.h
0 → 100644
| 1 | +++ a/Example/CNLiveCommunitModule/CNLIVEAppDelegate.h | ||
| 1 | +// | ||
| 2 | +// CNLIVEAppDelegate.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by woshiliushiyu on 01/30/2022. | ||
| 6 | +// Copyright (c) 2022 woshiliushiyu. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +@import UIKit; | ||
| 10 | + | ||
| 11 | +@interface CNLIVEAppDelegate : UIResponder <UIApplicationDelegate> | ||
| 12 | + | ||
| 13 | +@property (strong, nonatomic) UIWindow *window; | ||
| 14 | + | ||
| 15 | +-(void)setParamNet; | ||
| 16 | + | ||
| 17 | +@end |
Example/CNLiveCommunitModule/CNLIVEAppDelegate.m
0 → 100644
| 1 | +++ a/Example/CNLiveCommunitModule/CNLIVEAppDelegate.m | ||
| 1 | +// | ||
| 2 | +// CNLIVEAppDelegate.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by woshiliushiyu on 01/30/2022. | ||
| 6 | +// Copyright (c) 2022 woshiliushiyu. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "CNLIVEAppDelegate.h" | ||
| 10 | +#import <QMUIKit/QMUIKit.h> | ||
| 11 | +#import <CNLiveUserManagement/CNUserInfoManager.h> | ||
| 12 | +#import <CNLiveRequestBastKit/CNLiveNetworking.h> | ||
| 13 | +#import <CNLiveEnvironment/CNLiveEnvironment.h> | ||
| 14 | +#import "CNLIVEViewController.h" | ||
| 15 | +#import <IQKeyboardManager/IQKeyboardManager.h> | ||
| 16 | +#import "CNLiveCommuntViewController.h" | ||
| 17 | +@implementation CNLIVEAppDelegate | ||
| 18 | + | ||
| 19 | +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | ||
| 20 | +{ | ||
| 21 | + // Override point for customization after application launch. | ||
| 22 | + | ||
| 23 | + [IQKeyboardManager sharedManager].enable = YES; | ||
| 24 | + [IQKeyboardManager sharedManager].enableAutoToolbar = YES; | ||
| 25 | + | ||
| 26 | + [CNUserInfoManager manager].userInfoModel.uid = @"145680";//@"10545988";//@"353001";//@"353417";//@"10511059";//@"10458139";//@"10537318";//@"10499533";// | ||
| 27 | + | ||
| 28 | +// [[NSUserDefaults standardUserDefaults] setObject:@"38" forKey:@"kCNLiveCommuntyNBhdIdIdentifier"]; | ||
| 29 | +// [[NSUserDefaults standardUserDefaults] synchronize]; | ||
| 30 | + | ||
| 31 | + [self setParamNet]; | ||
| 32 | + UINavigationController *navCtrl = [[QMUINavigationController alloc] initWithRootViewController:[[CNLIVEViewController alloc] init]]; | ||
| 33 | + | ||
| 34 | + self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; | ||
| 35 | + self.window.rootViewController = navCtrl; | ||
| 36 | + | ||
| 37 | + [self.window makeKeyAndVisible]; | ||
| 38 | + | ||
| 39 | + return YES; | ||
| 40 | +} | ||
| 41 | +-(void)setParamNet | ||
| 42 | +{ | ||
| 43 | + NSMutableDictionary * mDict = [[NSMutableDictionary alloc] init]; | ||
| 44 | + [mDict setValue:[CNUserInfoManager manager].userInfoModel.uid forKey:@"loginSid"]; | ||
| 45 | + [mDict setValue:@"com.cnlive.CNLiveNetAdd.debug" forKey:@"platform_id"]; | ||
| 46 | + [mDict setValue:[[[[UIDevice currentDevice] identifierForVendor] UUIDString] stringByReplacingOccurrencesOfString:@"-" withString:@""] forKey:@"uuid"]; | ||
| 47 | + [mDict setValue:@"i" forKey:@"plat"]; | ||
| 48 | + [mDict setValue:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] forKey:@"ver"]; | ||
| 49 | + [mDict setObject:AppId forKey:@"appId"]; | ||
| 50 | + [mDict setObject:[CNUserInfoManager manager].userInfoModel.uid forKey:@"sid"]; | ||
| 51 | + [CNLiveNetworking setupDefaultParam:mDict]; | ||
| 52 | + [CNLiveNetworking setupShowResult:NO]; | ||
| 53 | + [CNLiveNetworking setupSignKey:APPKey]; | ||
| 54 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | ||
| 55 | + [CNLiveNetworking setResponseSerializerType:CNLiveResponseSerializerJSON]; | ||
| 56 | +} | ||
| 57 | +- (void)applicationWillResignActive:(UIApplication *)application | ||
| 58 | +{ | ||
| 59 | + // 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. | ||
| 60 | + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. | ||
| 61 | +} | ||
| 62 | + | ||
| 63 | +- (void)applicationDidEnterBackground:(UIApplication *)application | ||
| 64 | +{ | ||
| 65 | + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. | ||
| 66 | + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. | ||
| 67 | +} | ||
| 68 | + | ||
| 69 | +- (void)applicationWillEnterForeground:(UIApplication *)application | ||
| 70 | +{ | ||
| 71 | + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. | ||
| 72 | +} | ||
| 73 | + | ||
| 74 | +- (void)applicationDidBecomeActive:(UIApplication *)application | ||
| 75 | +{ | ||
| 76 | + // 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. | ||
| 77 | +} | ||
| 78 | + | ||
| 79 | +- (void)applicationWillTerminate:(UIApplication *)application | ||
| 80 | +{ | ||
| 81 | + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. | ||
| 82 | +} | ||
| 83 | + | ||
| 84 | +@end |
Example/CNLiveCommunitModule/CNLIVEMainViewController.h
0 → 100644
| 1 | +++ a/Example/CNLiveCommunitModule/CNLIVEMainViewController.h | ||
| 1 | +// | ||
| 2 | +// CNLIVEMainViewController.h | ||
| 3 | +// CNLiveCommunitModule_Example | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/10. | ||
| 6 | +// Copyright © 2022 woshiliushiyu. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <UIKit/UIKit.h> | ||
| 10 | + | ||
| 11 | +NS_ASSUME_NONNULL_BEGIN | ||
| 12 | + | ||
| 13 | +@interface CNLIVEMainViewController : UIViewController | ||
| 14 | +- (instancetype)initWithUrl:(NSString *)webUrl; | ||
| 15 | +@end | ||
| 16 | + | ||
| 17 | +NS_ASSUME_NONNULL_END |
Example/CNLiveCommunitModule/CNLIVEMainViewController.m
0 → 100644
| 1 | +++ a/Example/CNLiveCommunitModule/CNLIVEMainViewController.m | ||
| 1 | +// | ||
| 2 | +// CNLIVEMainViewController.m | ||
| 3 | +// CNLiveCommunitModule_Example | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/10. | ||
| 6 | +// Copyright © 2022 woshiliushiyu. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "CNLIVEMainViewController.h" | ||
| 10 | +#import <WebKit/WebKit.h> | ||
| 11 | +@interface CNLIVEMainViewController ()<WKUIDelegate,WKNavigationDelegate> | ||
| 12 | +@property (nonatomic, strong) WKWebView * webView; | ||
| 13 | +@property (nonatomic, copy) NSString * webUrl; | ||
| 14 | +@end | ||
| 15 | + | ||
| 16 | +@implementation CNLIVEMainViewController | ||
| 17 | + | ||
| 18 | +- (instancetype)initWithUrl:(NSString *)webUrl | ||
| 19 | +{ | ||
| 20 | + self = [super init]; | ||
| 21 | + if (self) { | ||
| 22 | + _webUrl = webUrl; | ||
| 23 | + } | ||
| 24 | + return self; | ||
| 25 | +} | ||
| 26 | + | ||
| 27 | +- (void)viewDidLoad { | ||
| 28 | + [super viewDidLoad]; | ||
| 29 | + // Do any additional setup after loading the view. | ||
| 30 | + self.view.backgroundColor = [UIColor whiteColor]; | ||
| 31 | + | ||
| 32 | + [self.view addSubview:self.webView]; | ||
| 33 | + [self.webView loadRequest:[NSMutableURLRequest requestWithURL:[NSURL URLWithString:self.webUrl]]]; | ||
| 34 | + | ||
| 35 | +} | ||
| 36 | + | ||
| 37 | +-(WKWebView *)webView | ||
| 38 | +{ | ||
| 39 | + if (!_webView) { | ||
| 40 | + _webView = [[WKWebView alloc] initWithFrame:self.view.bounds]; | ||
| 41 | + _webView.backgroundColor = [UIColor whiteColor]; | ||
| 42 | + _webView.UIDelegate = self; | ||
| 43 | + _webView.navigationDelegate = self; | ||
| 44 | + } | ||
| 45 | + return _webView; | ||
| 46 | +} | ||
| 47 | + | ||
| 48 | +@end |
Example/CNLiveCommunitModule/CNLIVEViewController.h
0 → 100644
| 1 | +++ a/Example/CNLiveCommunitModule/CNLIVEViewController.h | ||
| 1 | +// | ||
| 2 | +// CNLIVEViewController.h | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by woshiliushiyu on 01/30/2022. | ||
| 6 | +// Copyright (c) 2022 woshiliushiyu. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +@import UIKit; | ||
| 10 | + | ||
| 11 | +@interface CNLIVEViewController : UIViewController | ||
| 12 | + | ||
| 13 | +@end |
Example/CNLiveCommunitModule/CNLIVEViewController.m
0 → 100644
| 1 | +++ a/Example/CNLiveCommunitModule/CNLIVEViewController.m | ||
| 1 | +// | ||
| 2 | +// CNLIVEViewController.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by woshiliushiyu on 01/30/2022. | ||
| 6 | +// Copyright (c) 2022 woshiliushiyu. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "CNLIVEViewController.h" | ||
| 10 | +#import "CNLiveCommuntActiviRecordViewController.h" | ||
| 11 | +#import "CNLiveCommuntActiviRepairViewController.h" | ||
| 12 | +#import "CNLiveCommuntInformViewController.h" | ||
| 13 | +#import "CNLiveCommuntEvaluaViewController.h" | ||
| 14 | +#import "CNLiveCommuntSignUpViewController.h" | ||
| 15 | +#import "CNLiveCommuntyOrderViewController.h" | ||
| 16 | +#import "CNLiveCommuntyHomeListViewController.h" | ||
| 17 | +#import "CNLiveCommuntViewController.h" | ||
| 18 | +#import <Masonry/Masonry.h> | ||
| 19 | +#import "CNLiveCommuntyModule.h" | ||
| 20 | +#import "CNLIVEAppDelegate.h" | ||
| 21 | +#import "CNLiveCommuntyResultListViewController.h" | ||
| 22 | +#import <CNLiveEnvironment/CNLiveEnvironment.h> | ||
| 23 | +#import <CNLiveUserManagement/CNUserInfoManager.h> | ||
| 24 | +#import <CNLiveRequestBastKit/CNLiveNetworking.h> | ||
| 25 | +@interface CNLIVEViewController ()<UITableViewDelegate,UITableViewDataSource> | ||
| 26 | +@property (nonatomic, strong) UITableView * tableView; | ||
| 27 | +@property (nonatomic, strong) NSMutableArray * dataArray; | ||
| 28 | +@property (nonatomic, assign) BOOL isChange; | ||
| 29 | +@end | ||
| 30 | + | ||
| 31 | +@implementation CNLIVEViewController | ||
| 32 | +-(NSMutableArray *)dataArray | ||
| 33 | +{ | ||
| 34 | + if (!_dataArray) { | ||
| 35 | + _dataArray = [[NSMutableArray alloc] initWithArray:@[ | ||
| 36 | + @"有底部导航栏的界面",@"活动记录",@"报修记录",@"填写记录",@"活动评价",@"报名",@"订单详情-未接单",@"订单详情-已接单",@"145680",@"暂时点击无效",@"选择小区",@"主界面跳转" | ||
| 37 | + ]]; | ||
| 38 | + } | ||
| 39 | + return _dataArray; | ||
| 40 | +} | ||
| 41 | +-(void)viewDidAppear:(BOOL)animated | ||
| 42 | +{ | ||
| 43 | + [super viewDidAppear:animated]; | ||
| 44 | + | ||
| 45 | +} | ||
| 46 | +-(void)viewWillAppear:(BOOL)animated | ||
| 47 | +{ | ||
| 48 | + [super viewWillAppear:animated]; | ||
| 49 | + self.navigationController.navigationBarHidden = NO; | ||
| 50 | +// if (@available(iOS 11.0, *)) { | ||
| 51 | +// self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; | ||
| 52 | +// } else { | ||
| 53 | +// // Fallback on earlier versions | ||
| 54 | +// self.automaticallyAdjustsScrollViewInsets = NO; | ||
| 55 | +// } | ||
| 56 | +} | ||
| 57 | +- (void)viewDidLoad | ||
| 58 | +{ | ||
| 59 | + [super viewDidLoad]; | ||
| 60 | + // Do any additional setup after loading the view, typically from a nib. | ||
| 61 | + self.view.backgroundColor = [UIColor whiteColor]; | ||
| 62 | + [self.view addSubview:self.tableView]; | ||
| 63 | + [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 64 | + make.edges.mas_equalTo(self.view); | ||
| 65 | + }]; | ||
| 66 | +} | ||
| 67 | + | ||
| 68 | +-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView | ||
| 69 | +{ | ||
| 70 | + return 1;; | ||
| 71 | +} | ||
| 72 | +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | ||
| 73 | +{ | ||
| 74 | + return self.dataArray.count; | ||
| 75 | +} | ||
| 76 | +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 77 | +{ | ||
| 78 | + UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass(UITableViewCell.class)]; | ||
| 79 | + if (!cell) { | ||
| 80 | + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass(UITableViewCell.class)]; | ||
| 81 | + } | ||
| 82 | + cell.selectionStyle = UITableViewCellSelectionStyleNone; | ||
| 83 | + cell.textLabel.text = self.dataArray[indexPath.row]; | ||
| 84 | + | ||
| 85 | + return cell; | ||
| 86 | +} | ||
| 87 | +-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 88 | +{ | ||
| 89 | + return 40.0f; | ||
| 90 | +} | ||
| 91 | +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath | ||
| 92 | +{ | ||
| 93 | + if (indexPath.row == 0) { | ||
| 94 | + [[CNLiveCommuntyModule shareInstance] pushCommuntyHomeViewMethod]; | ||
| 95 | + } | ||
| 96 | + if (indexPath.row == 1) { | ||
| 97 | + NSString * nbhdId = (NSString *)[[NSUserDefaults standardUserDefaults] objectForKey:@"kCNLiveCommuntyNBhdIdIdentifier"]; | ||
| 98 | + CNLiveCommuntActiviRecordViewController * recordVC = [[CNLiveCommuntActiviRecordViewController alloc] initWithNBhdId:nbhdId]; | ||
| 99 | + [self.navigationController pushViewController:recordVC animated:YES]; | ||
| 100 | + } | ||
| 101 | + if (indexPath.row == 2) { | ||
| 102 | + CNLiveCommuntActiviRepairViewController * repairView = [[CNLiveCommuntActiviRepairViewController alloc] init]; | ||
| 103 | + [self.navigationController pushViewController:repairView animated:YES]; | ||
| 104 | + } | ||
| 105 | + if (indexPath.row == 3) { | ||
| 106 | + NSString * nbhdId = (NSString *)[[NSUserDefaults standardUserDefaults] objectForKey:@"kCNLiveCommuntyNBhdIdIdentifier"]; | ||
| 107 | + CNLiveCommuntInformViewController * informView = [[CNLiveCommuntInformViewController alloc] initWithNBhdId:nbhdId]; | ||
| 108 | + [self.navigationController pushViewController:informView animated:YES]; | ||
| 109 | + } | ||
| 110 | + if (indexPath.row == 4) { | ||
| 111 | + CNLiveCommuntEvaluaViewController * evaluaView = [[CNLiveCommuntEvaluaViewController alloc] init]; | ||
| 112 | + [self.navigationController pushViewController:evaluaView animated:YES]; | ||
| 113 | + } | ||
| 114 | + if (indexPath.row == 5) { | ||
| 115 | + /* | ||
| 116 | + "id" : 37, | ||
| 117 | + "mobile" : null, | ||
| 118 | + "unitPrice" : 10, | ||
| 119 | + "processDesc" : "阿斯达大1" | ||
| 120 | + */ | ||
| 121 | + NSDictionary * paramDict = @{@"id":@"37",@"mobile":@"",@"unitPrice":@"0",@"processDesc":@"阿斯达大1"}; | ||
| 122 | + CNLiveCommuntSignUpViewController * signUpView = [[CNLiveCommuntSignUpViewController alloc] initWithStyle:UITableViewStyleGrouped InfoDict:paramDict]; | ||
| 123 | + [self.navigationController pushViewController:signUpView animated:YES]; | ||
| 124 | + } | ||
| 125 | + if (indexPath.row == 6) { | ||
| 126 | + CNLiveCommuntyOrderViewController * orderVC = [[CNLiveCommuntyOrderViewController alloc] initWithMaintenId:@"cmnt2022021613328658203"]; | ||
| 127 | + [self.navigationController pushViewController:orderVC animated:YES]; | ||
| 128 | + } | ||
| 129 | + if (indexPath.row == 7) { | ||
| 130 | + CNLiveCommuntyResultListViewController * orderVC = [[CNLiveCommuntyResultListViewController alloc] initWithStyle:UITableViewStyleGrouped SignId:@""]; | ||
| 131 | + [self.navigationController pushViewController:orderVC animated:YES]; | ||
| 132 | + } | ||
| 133 | +// if (indexPath.row == 8) { | ||
| 134 | +// CNLiveCommuntyOrderViewController * orderVC = [[CNLiveCommuntyOrderViewController alloc] initWithShowType:CNLiveCommuntyOrderShowTypeChatCompletOrder MaintenId:@"cmnt2022021166936098185"]; | ||
| 135 | +// [self.navigationController pushViewController:orderVC animated:YES]; | ||
| 136 | +// } | ||
| 137 | + if (indexPath.row == 8) { | ||
| 138 | + [CNUserInfoManager manager].userInfoModel.uid = self.isChange ? @"353001" : @"145680"; | ||
| 139 | + [self.dataArray replaceObjectAtIndex:8 withObject:self.isChange ? @"353001" : @"145680"]; | ||
| 140 | + self.isChange = !self.isChange; | ||
| 141 | + NSMutableDictionary * mDict = [[NSMutableDictionary alloc] init]; | ||
| 142 | + [mDict setValue:[CNUserInfoManager manager].userInfoModel.uid forKey:@"loginSid"]; | ||
| 143 | + [mDict setValue:@"com.cnlive.CNLiveNetAdd.debug" forKey:@"platform_id"]; | ||
| 144 | + [mDict setValue:[[[[UIDevice currentDevice] identifierForVendor] UUIDString] stringByReplacingOccurrencesOfString:@"-" withString:@""] forKey:@"uuid"]; | ||
| 145 | + [mDict setValue:@"i" forKey:@"plat"]; | ||
| 146 | + [mDict setValue:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] forKey:@"ver"]; | ||
| 147 | + [mDict setObject:AppId forKey:@"appId"]; | ||
| 148 | + [mDict setObject:[CNUserInfoManager manager].userInfoModel.uid forKey:@"sid"]; | ||
| 149 | + [CNLiveNetworking setupDefaultParam:mDict]; | ||
| 150 | + [CNLiveNetworking setupShowResult:NO]; | ||
| 151 | + [CNLiveNetworking setupSignKey:APPKey]; | ||
| 152 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | ||
| 153 | + [CNLiveNetworking setResponseSerializerType:CNLiveResponseSerializerJSON]; | ||
| 154 | + [self.tableView reloadData]; | ||
| 155 | +// CNLiveCommuntyOrderViewController * orderVC = [[CNLiveCommuntyOrderViewController alloc] initWithShowType:CNLiveCommuntyOrderShowTypeHave MaintenId:@"cmnt2022021166936098185"]; | ||
| 156 | +// [self.navigationController pushViewController:orderVC animated:YES]; | ||
| 157 | + } | ||
| 158 | + if (indexPath.row == 10) { | ||
| 159 | + CNLiveCommuntyHomeListViewController * listVC = [[CNLiveCommuntyHomeListViewController alloc] init]; | ||
| 160 | + [self.navigationController pushViewController:listVC animated:YES]; | ||
| 161 | + } | ||
| 162 | + if (indexPath.row == 11) { | ||
| 163 | + [[CNLiveCommuntyModule shareInstance] pushCommuntyHomeViewMethod]; | ||
| 164 | + } | ||
| 165 | +} | ||
| 166 | + | ||
| 167 | +-(UITableView *)tableView | ||
| 168 | +{ | ||
| 169 | + if (!_tableView) { | ||
| 170 | + _tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain]; | ||
| 171 | + _tableView.backgroundColor = [UIColor whiteColor]; | ||
| 172 | + _tableView.delegate = self; | ||
| 173 | + _tableView.dataSource = self; | ||
| 174 | + _tableView.backgroundColor = [UIColor whiteColor]; | ||
| 175 | + _tableView.tableFooterView =[[UIView alloc] init]; | ||
| 176 | + _tableView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0); | ||
| 177 | + [_tableView registerClass:UITableViewCell.class forCellReuseIdentifier:NSStringFromClass(UITableViewCell.class)]; | ||
| 178 | + } | ||
| 179 | + return _tableView; | ||
| 180 | +} | ||
| 181 | + | ||
| 182 | +- (void)didReceiveMemoryWarning | ||
| 183 | +{ | ||
| 184 | + [super didReceiveMemoryWarning]; | ||
| 185 | + // Dispose of any resources that can be recreated. | ||
| 186 | +} | ||
| 187 | + | ||
| 188 | +@end |
Example/CNLiveCommunitModule/CNLiveCommunitModule-Info.plist
0 → 100644
| 1 | +++ a/Example/CNLiveCommunitModule/CNLiveCommunitModule-Info.plist | ||
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| 3 | +<plist version="1.0"> | ||
| 4 | +<dict> | ||
| 5 | + <key>CFBundleDevelopmentRegion</key> | ||
| 6 | + <string>en</string> | ||
| 7 | + <key>CFBundleDisplayName</key> | ||
| 8 | + <string>${PRODUCT_NAME}</string> | ||
| 9 | + <key>CFBundleExecutable</key> | ||
| 10 | + <string>${EXECUTABLE_NAME}</string> | ||
| 11 | + <key>CFBundleIdentifier</key> | ||
| 12 | + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
| 13 | + <key>CFBundleInfoDictionaryVersion</key> | ||
| 14 | + <string>6.0</string> | ||
| 15 | + <key>CFBundleName</key> | ||
| 16 | + <string>${PRODUCT_NAME}</string> | ||
| 17 | + <key>CFBundlePackageType</key> | ||
| 18 | + <string>APPL</string> | ||
| 19 | + <key>CFBundleShortVersionString</key> | ||
| 20 | + <string>1.0</string> | ||
| 21 | + <key>CFBundleSignature</key> | ||
| 22 | + <string>????</string> | ||
| 23 | + <key>CFBundleVersion</key> | ||
| 24 | + <string>1.0</string> | ||
| 25 | + <key>LSRequiresIPhoneOS</key> | ||
| 26 | + <true/> | ||
| 27 | + <key>UILaunchStoryboardName</key> | ||
| 28 | + <string>LaunchScreen</string> | ||
| 29 | + <key>UIMainStoryboardFile</key> | ||
| 30 | + <string>Main</string> | ||
| 31 | + <key>UIRequiredDeviceCapabilities</key> | ||
| 32 | + <array> | ||
| 33 | + <string>armv7</string> | ||
| 34 | + </array> | ||
| 35 | + <key>NSAppTransportSecurity</key> | ||
| 36 | + <dict> | ||
| 37 | + <key>NSAllowsArbitraryLoads</key> | ||
| 38 | + <true/> | ||
| 39 | + </dict> | ||
| 40 | + <key>NSBluetoothAlwaysUsageDescription</key> | ||
| 41 | + <string>需要允许开启蓝牙才能对音箱使用配对及配网功能</string> | ||
| 42 | + <key>NSBluetoothPeripheralUsageDescription</key> | ||
| 43 | + <string>需要允许开启蓝牙才能对音箱使用配对及配网功能</string> | ||
| 44 | + <key>NSCalendarsUsageDescription</key> | ||
| 45 | + <string>需要允许访问日历才能使用服务号功能</string> | ||
| 46 | + <key>NSCameraUsageDescription</key> | ||
| 47 | + <string>需要允许开启相机才能在发布生活圈或聊天时使用录制视频和拍照功能</string> | ||
| 48 | + <key>NSContactsUsageDescription</key> | ||
| 49 | + <string>需要允许访问通讯录才能获取手机联系人中的网家家用户</string> | ||
| 50 | + <key>NSLocationAlwaysAndWhenInUseUsageDescription</key> | ||
| 51 | + <string>需要允许使用您的位置信息才能在发布生活圈、发布目击者、聊天发送位置、线上徒步赛事等功能获取您所在的城市</string> | ||
| 52 | + <key>NSLocationAlwaysUsageDescription</key> | ||
| 53 | + <string>需要允许使用您的位置信息才能在发布生活圈、发布目击者、聊天发送位置、线上徒步赛事等功能获取您所在的城市</string> | ||
| 54 | + <key>NSLocationWhenInUseUsageDescription</key> | ||
| 55 | + <string>需要允许使用您的位置信息才能在发布生活圈、发布目击者、聊天发送位置、线上徒步赛事等功能获取您所在的城市</string> | ||
| 56 | + <key>NSMicrophoneUsageDescription</key> | ||
| 57 | + <string>需要允许开启麦克风才能使用录制视频和语音等服务</string> | ||
| 58 | + <key>NSMotionUsageDescription</key> | ||
| 59 | + <string>需要允许访问运动与健身才能在亲情群健康步数、走路活动或者参加线上跑步赛事时记录您的步数信息</string> | ||
| 60 | + <key>NSPhotoLibraryAddUsageDescription</key> | ||
| 61 | + <string>需要允许打开相册才能访问相册照片和保存照片</string> | ||
| 62 | + <key>NSPhotoLibraryUsageDescription</key> | ||
| 63 | + <string>需要允许打开相册才能访问相册照片和保存照片</string> | ||
| 64 | + <key>UISupportedInterfaceOrientations</key> | ||
| 65 | + <array> | ||
| 66 | + <string>UIInterfaceOrientationPortrait</string> | ||
| 67 | + <string>UIInterfaceOrientationLandscapeLeft</string> | ||
| 68 | + <string>UIInterfaceOrientationLandscapeRight</string> | ||
| 69 | + </array> | ||
| 70 | + <key>UISupportedInterfaceOrientations~ipad</key> | ||
| 71 | + <array> | ||
| 72 | + <string>UIInterfaceOrientationPortrait</string> | ||
| 73 | + <string>UIInterfaceOrientationPortraitUpsideDown</string> | ||
| 74 | + <string>UIInterfaceOrientationLandscapeLeft</string> | ||
| 75 | + <string>UIInterfaceOrientationLandscapeRight</string> | ||
| 76 | + </array> | ||
| 77 | +</dict> | ||
| 78 | +</plist> |
Example/CNLiveCommunitModule/CNLiveCommunitModule-Prefix.pch
0 → 100644
| 1 | +++ a/Example/CNLiveCommunitModule/CNLiveCommunitModule-Prefix.pch | ||
| 1 | +// | ||
| 2 | +// Prefix header | ||
| 3 | +// | ||
| 4 | +// The contents of this file are implicitly included at the beginning of every source file. | ||
| 5 | +// | ||
| 6 | + | ||
| 7 | +#import <Availability.h> | ||
| 8 | + | ||
| 9 | +#ifndef __IPHONE_5_0 | ||
| 10 | +#warning "This project uses features only available in iOS SDK 5.0 and later." | ||
| 11 | +#endif | ||
| 12 | + | ||
| 13 | +#ifdef __OBJC__ | ||
| 14 | + @import UIKit; | ||
| 15 | + @import Foundation; | ||
| 16 | +#endif |
Example/CNLiveCommunitModule/CNLiveCommunitModuleImpl.h
0 → 100644
| 1 | +++ a/Example/CNLiveCommunitModule/CNLiveCommunitModuleImpl.h | ||
| 1 | +// | ||
| 2 | +// CNLiveCommunitModuleImpl.h | ||
| 3 | +// CNLiveCommunitModule_Example | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/10. | ||
| 6 | +// Copyright © 2022 woshiliushiyu. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <Foundation/Foundation.h> | ||
| 10 | +#import "CNLiveCommunitModuleProtocol.h" | ||
| 11 | +NS_ASSUME_NONNULL_BEGIN | ||
| 12 | + | ||
| 13 | +@interface CNLiveCommunitModuleImpl : NSObject<CNLiveCommunitModuleProtocol> | ||
| 14 | + | ||
| 15 | +@end | ||
| 16 | + | ||
| 17 | +NS_ASSUME_NONNULL_END |
Example/CNLiveCommunitModule/CNLiveCommunitModuleImpl.m
0 → 100644
| 1 | +++ a/Example/CNLiveCommunitModule/CNLiveCommunitModuleImpl.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommunitModuleImpl.m | ||
| 3 | +// CNLiveCommunitModule_Example | ||
| 4 | +// | ||
| 5 | +// Created by open on 2022/2/10. | ||
| 6 | +// Copyright © 2022 woshiliushiyu. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "CNLiveCommunitModuleImpl.h" | ||
| 10 | +#import "CNLIVEMainViewController.h" | ||
| 11 | +@implementation CNLiveCommunitModuleImpl | ||
| 12 | +/// 获取主工程的WebView | ||
| 13 | +/// @param webUrl url | ||
| 14 | +-(UIViewController *)pushWebViewWithMainProjectWithWebUrl:(NSString *)webUrl | ||
| 15 | +{ | ||
| 16 | + CNLIVEMainViewController * VC = [[CNLIVEMainViewController alloc] initWithUrl:webUrl]; | ||
| 17 | + return VC; | ||
| 18 | +} | ||
| 19 | + | ||
| 20 | +/// 调用工程中支付功能 | ||
| 21 | +/// @param orderId 订单id | ||
| 22 | +/// @param price 价格 | ||
| 23 | +/// @param body 支付名 | ||
| 24 | +-(void)pushMainProjectWithPayManagerWithOrderId:(NSString *)orderId price:(NSString *)price body:(NSString *)body | ||
| 25 | +{ | ||
| 26 | + NSLog(@"调用支付相关参数 orderId=>%@ price=>%@ body=>%@",orderId,price,body); | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +/// 获取主工程的视讯相关界面逻辑 | ||
| 30 | +/// @param pageId 界面id | ||
| 31 | +/// @param channelName 频道名 | ||
| 32 | +/// @param channelId 频道id | ||
| 33 | +/// @param webUrl url | ||
| 34 | +-(UIViewController *)pushLiveViewWithMainProjectWithPageId:(NSString *)pageId ChannelName:(NSString *)channelName ChannelId:(NSString *)channelId WebUrl:(NSString *)webUrl | ||
| 35 | +{ | ||
| 36 | + CNLIVEMainViewController * VC = [[CNLIVEMainViewController alloc] initWithUrl:webUrl]; | ||
| 37 | + return VC; | ||
| 38 | +} | ||
| 39 | +@end |
Example/CNLiveCommunitModule/Images.xcassets/AppIcon.appiconset/Contents.json
0 → 100644
| 1 | +++ a/Example/CNLiveCommunitModule/Images.xcassets/AppIcon.appiconset/Contents.json | ||
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "iphone", | ||
| 5 | + "size" : "20x20", | ||
| 6 | + "scale" : "2x" | ||
| 7 | + }, | ||
| 8 | + { | ||
| 9 | + "idiom" : "iphone", | ||
| 10 | + "size" : "20x20", | ||
| 11 | + "scale" : "3x" | ||
| 12 | + }, | ||
| 13 | + { | ||
| 14 | + "idiom" : "iphone", | ||
| 15 | + "size" : "29x29", | ||
| 16 | + "scale" : "2x" | ||
| 17 | + }, | ||
| 18 | + { | ||
| 19 | + "idiom" : "iphone", | ||
| 20 | + "size" : "29x29", | ||
| 21 | + "scale" : "3x" | ||
| 22 | + }, | ||
| 23 | + { | ||
| 24 | + "idiom" : "iphone", | ||
| 25 | + "size" : "40x40", | ||
| 26 | + "scale" : "2x" | ||
| 27 | + }, | ||
| 28 | + { | ||
| 29 | + "idiom" : "iphone", | ||
| 30 | + "size" : "40x40", | ||
| 31 | + "scale" : "3x" | ||
| 32 | + }, | ||
| 33 | + { | ||
| 34 | + "idiom" : "iphone", | ||
| 35 | + "size" : "60x60", | ||
| 36 | + "scale" : "2x" | ||
| 37 | + }, | ||
| 38 | + { | ||
| 39 | + "idiom" : "iphone", | ||
| 40 | + "size" : "60x60", | ||
| 41 | + "scale" : "3x" | ||
| 42 | + }, | ||
| 43 | + { | ||
| 44 | + "idiom" : "ipad", | ||
| 45 | + "size" : "20x20", | ||
| 46 | + "scale" : "1x" | ||
| 47 | + }, | ||
| 48 | + { | ||
| 49 | + "idiom" : "ipad", | ||
| 50 | + "size" : "20x20", | ||
| 51 | + "scale" : "2x" | ||
| 52 | + }, | ||
| 53 | + { | ||
| 54 | + "idiom" : "ipad", | ||
| 55 | + "size" : "29x29", | ||
| 56 | + "scale" : "1x" | ||
| 57 | + }, | ||
| 58 | + { | ||
| 59 | + "idiom" : "ipad", | ||
| 60 | + "size" : "29x29", | ||
| 61 | + "scale" : "2x" | ||
| 62 | + }, | ||
| 63 | + { | ||
| 64 | + "idiom" : "ipad", | ||
| 65 | + "size" : "40x40", | ||
| 66 | + "scale" : "1x" | ||
| 67 | + }, | ||
| 68 | + { | ||
| 69 | + "idiom" : "ipad", | ||
| 70 | + "size" : "40x40", | ||
| 71 | + "scale" : "2x" | ||
| 72 | + }, | ||
| 73 | + { | ||
| 74 | + "idiom" : "ipad", | ||
| 75 | + "size" : "76x76", | ||
| 76 | + "scale" : "1x" | ||
| 77 | + }, | ||
| 78 | + { | ||
| 79 | + "idiom" : "ipad", | ||
| 80 | + "size" : "76x76", | ||
| 81 | + "scale" : "2x" | ||
| 82 | + }, | ||
| 83 | + { | ||
| 84 | + "idiom" : "ipad", | ||
| 85 | + "size" : "83.5x83.5", | ||
| 86 | + "scale" : "2x" | ||
| 87 | + }, | ||
| 88 | + { | ||
| 89 | + "idiom" : "ios-marketing", | ||
| 90 | + "size" : "1024x1024", | ||
| 91 | + "scale" : "1x" | ||
| 92 | + } | ||
| 93 | + ], | ||
| 94 | + "info" : { | ||
| 95 | + "version" : 1, | ||
| 96 | + "author" : "xcode" | ||
| 97 | + } | ||
| 98 | +} |
Example/CNLiveCommunitModule/en.lproj/InfoPlist.strings
0 → 100644
Example/CNLiveCommunitModule/main.m
0 → 100644
| 1 | +++ a/Example/CNLiveCommunitModule/main.m | ||
| 1 | +// | ||
| 2 | +// main.m | ||
| 3 | +// CNLiveCommunitModule | ||
| 4 | +// | ||
| 5 | +// Created by woshiliushiyu on 01/30/2022. | ||
| 6 | +// Copyright (c) 2022 woshiliushiyu. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +@import UIKit; | ||
| 10 | +#import "CNLIVEAppDelegate.h" | ||
| 11 | +#import <CNLiveEnvironment/CNLiveEnvironmentManager.h> | ||
| 12 | +int main(int argc, char * argv[]) | ||
| 13 | +{ | ||
| 14 | + @autoreleasepool { | ||
| 15 | + [CNLiveEnvironmentManager setAppType:CNLiveAppTypeUser environmentType:CNLiveDebugAppStore]; | ||
| 16 | + return UIApplicationMain(argc, argv, nil, NSStringFromClass([CNLIVEAppDelegate class])); | ||
| 17 | + } | ||
| 18 | +} |
Example/Podfile
0 → 100644
| 1 | +++ a/Example/Podfile | ||
| 1 | + | ||
| 2 | +platform :ios, '10.0' | ||
| 3 | + | ||
| 4 | +use_frameworks! | ||
| 5 | + | ||
| 6 | +source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git' | ||
| 7 | +#source 'https://github.com/CocoaPods/Specs.git' | ||
| 8 | +#source 'https://cdn.cocoapods.org' | ||
| 9 | + | ||
| 10 | +source 'http://bj.gitlab.cnlive.com/ios-team/CNLiveRepos.git' | ||
| 11 | +source 'http://bj.gitlab.cnlive.com/DSIOSTeam/DSSpecRepos.git' | ||
| 12 | + | ||
| 13 | +target 'CNLiveCommunitModule_Example' do | ||
| 14 | + pod 'CNLiveCommunitModule', :path => '../' | ||
| 15 | + | ||
| 16 | + target 'CNLiveCommunitModule_Tests' do | ||
| 17 | + inherit! :search_paths | ||
| 18 | + | ||
| 19 | + end | ||
| 20 | + | ||
| 21 | + pre_install do |installer| | ||
| 22 | + Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {} | ||
| 23 | + end | ||
| 24 | + | ||
| 25 | +end |
Example/Tests/Tests-Info.plist
0 → 100644
| 1 | +++ a/Example/Tests/Tests-Info.plist | ||
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| 3 | +<plist version="1.0"> | ||
| 4 | +<dict> | ||
| 5 | + <key>CFBundleDevelopmentRegion</key> | ||
| 6 | + <string>en</string> | ||
| 7 | + <key>CFBundleExecutable</key> | ||
| 8 | + <string>${EXECUTABLE_NAME}</string> | ||
| 9 | + <key>CFBundleIdentifier</key> | ||
| 10 | + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
| 11 | + <key>CFBundleInfoDictionaryVersion</key> | ||
| 12 | + <string>6.0</string> | ||
| 13 | + <key>CFBundlePackageType</key> | ||
| 14 | + <string>BNDL</string> | ||
| 15 | + <key>CFBundleShortVersionString</key> | ||
| 16 | + <string>1.0</string> | ||
| 17 | + <key>CFBundleSignature</key> | ||
| 18 | + <string>????</string> | ||
| 19 | + <key>CFBundleVersion</key> | ||
| 20 | + <string>1</string> | ||
| 21 | +</dict> | ||
| 22 | +</plist> |
Example/Tests/Tests-Prefix.pch
0 → 100644
Example/Tests/Tests.m
0 → 100644
| 1 | +++ a/Example/Tests/Tests.m | ||
| 1 | +// | ||
| 2 | +// CNLiveCommunitModuleTests.m | ||
| 3 | +// CNLiveCommunitModuleTests | ||
| 4 | +// | ||
| 5 | +// Created by woshiliushiyu on 01/30/2022. | ||
| 6 | +// Copyright (c) 2022 woshiliushiyu. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +@import XCTest; | ||
| 10 | + | ||
| 11 | +@interface Tests : XCTestCase | ||
| 12 | + | ||
| 13 | +@end | ||
| 14 | + | ||
| 15 | +@implementation Tests | ||
| 16 | + | ||
| 17 | +- (void)setUp | ||
| 18 | +{ | ||
| 19 | + [super setUp]; | ||
| 20 | + // Put setup code here. This method is called before the invocation of each test method in the class. | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | +- (void)tearDown | ||
| 24 | +{ | ||
| 25 | + // Put teardown code here. This method is called after the invocation of each test method in the class. | ||
| 26 | + [super tearDown]; | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +- (void)testExample | ||
| 30 | +{ | ||
| 31 | + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); | ||
| 32 | +} | ||
| 33 | + | ||
| 34 | +@end | ||
| 35 | + |
Example/Tests/en.lproj/InfoPlist.strings
0 → 100644
LICENSE
0 → 100644
| 1 | +++ a/LICENSE | ||
| 1 | +Copyright (c) 2022 woshiliushiyu <1010530278@qq.com> | ||
| 2 | + | ||
| 3 | +Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 4 | +of this software and associated documentation files (the "Software"), to deal | ||
| 5 | +in the Software without restriction, including without limitation the rights | ||
| 6 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| 7 | +copies of the Software, and to permit persons to whom the Software is | ||
| 8 | +furnished to do so, subject to the following conditions: | ||
| 9 | + | ||
| 10 | +The above copyright notice and this permission notice shall be included in | ||
| 11 | +all copies or substantial portions of the Software. | ||
| 12 | + | ||
| 13 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 14 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 15 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 16 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 17 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| 18 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| 19 | +THE SOFTWARE. |
README.md
0 → 100644
| 1 | +++ a/README.md | ||
| 1 | +# CNLiveCommunitModule | ||
| 2 | + | ||
| 3 | +[](https://travis-ci.org/woshiliushiyu/CNLiveCommunitModule) | ||
| 4 | +[](https://cocoapods.org/pods/CNLiveCommunitModule) | ||
| 5 | +[](https://cocoapods.org/pods/CNLiveCommunitModule) | ||
| 6 | +[](https://cocoapods.org/pods/CNLiveCommunitModule) | ||
| 7 | + | ||
| 8 | +## Example | ||
| 9 | + | ||
| 10 | +To run the example project, clone the repo, and run `pod install` from the Example directory first. | ||
| 11 | + | ||
| 12 | +## Requirements | ||
| 13 | + | ||
| 14 | +## Installation | ||
| 15 | + | ||
| 16 | +CNLiveCommunitModule is available through [CocoaPods](https://cocoapods.org). To install | ||
| 17 | +it, simply add the following line to your Podfile: | ||
| 18 | + | ||
| 19 | +```ruby | ||
| 20 | +pod 'CNLiveCommunitModule' | ||
| 21 | +``` | ||
| 22 | + | ||
| 23 | +## Author | ||
| 24 | + | ||
| 25 | +woshiliushiyu, 1010530278@qq.com | ||
| 26 | + | ||
| 27 | +## License | ||
| 28 | + | ||
| 29 | +CNLiveCommunitModule is available under the MIT license. See the LICENSE file for more info. |
_Pods.xcodeproj
0 → 120000