Commit 9b21aec0796d8003bde9b7b2ce149fd990a6f756
0 parents
0.0.1
Showing
100 changed files
with
3941 additions
and
0 deletions
Too many changes to show.
To preserve performance only 100 of 154 files are displayed.
.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 | ... | ... |