Commit 8920d92b by 路少雄

1.龙岗水份测试

parents
# OS X
.DS_Store
# Xcode
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
*.xccheckout
profile
*.moved-aside
DerivedData
*.hmap
*.ipa
# Bundler
.bundle
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
#
# Note: if you ignore the Pods directory, make sure to uncomment
# `pod install` in .travis.yml
#
Pods/
Podfile.lock
#
#
\ No newline at end of file
source "https://rubygems.org"
gem "fastlane"
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.3)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
atomos (0.1.3)
aws-eventstream (1.1.0)
aws-partitions (1.414.0)
aws-sdk-core (3.110.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.40.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.87.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.2.2)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
claide (1.0.3)
colored (1.2)
colored2 (3.1.2)
commander-fastlane (4.4.6)
highline (~> 1.7.2)
declarative (0.0.20)
declarative-option (0.1.0)
digest-crc (0.6.3)
rake (>= 12.0.0, < 14.0.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.7.6)
emoji_regex (3.2.1)
excon (0.78.1)
faraday (1.2.0)
multipart-post (>= 1.2, < 3)
ruby2_keywords
faraday-cookie_jar (0.0.7)
faraday (>= 0.8.0)
http-cookie (~> 1.0.0)
faraday_middleware (1.0.0)
faraday (~> 1.0)
fastimage (2.2.1)
fastlane (2.170.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0)
aws-sdk-s3 (~> 1.0)
babosa (>= 1.0.3, < 2.0.0)
bundler (>= 1.12.0, < 3.0.0)
colored
commander-fastlane (>= 4.4.6, < 5.0.0)
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (>= 0.1, < 4.0)
excon (>= 0.71.0, < 1.0.0)
faraday (~> 1.0)
faraday-cookie_jar (~> 0.0.6)
faraday_middleware (~> 1.0)
fastimage (>= 2.1.0, < 3.0.0)
gh_inspector (>= 1.1.2, < 2.0.0)
google-api-client (>= 0.37.0, < 0.39.0)
google-cloud-storage (>= 1.15.0, < 2.0.0)
highline (>= 1.7.2, < 2.0.0)
json (< 3.0.0)
jwt (>= 2.1.0, < 3)
mini_magick (>= 4.9.4, < 5.0.0)
multipart-post (~> 2.0.0)
plist (>= 3.1.0, < 4.0.0)
rubyzip (>= 2.0.0, < 3.0.0)
security (= 0.1.3)
simctl (~> 1.6.3)
slack-notifier (>= 2.0.0, < 3.0.0)
terminal-notifier (>= 2.0.0, < 3.0.0)
terminal-table (>= 1.4.5, < 2.0.0)
tty-screen (>= 0.6.3, < 1.0.0)
tty-spinner (>= 0.8.0, < 1.0.0)
word_wrap (~> 1.0.0)
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
fastlane-plugin-pgyer (0.2.2)
gh_inspector (1.1.3)
google-api-client (0.38.0)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 0.9)
httpclient (>= 2.8.1, < 3.0)
mini_mime (~> 1.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
signet (~> 0.12)
google-cloud-core (1.5.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
google-cloud-env (1.4.0)
faraday (>= 0.17.3, < 2.0)
google-cloud-errors (1.0.1)
google-cloud-storage (1.29.2)
addressable (~> 2.5)
digest-crc (~> 0.4)
google-api-client (~> 0.33)
google-cloud-core (~> 1.2)
googleauth (~> 0.9)
mini_mime (~> 1.0)
googleauth (0.14.0)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (~> 0.14)
highline (1.7.10)
http-cookie (1.0.3)
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.4.0)
json (2.5.1)
jwt (2.2.2)
memoist (0.16.2)
mini_magick (4.11.0)
mini_mime (1.0.2)
multi_json (1.15.0)
multipart-post (2.0.0)
nanaimo (0.3.0)
naturally (2.2.0)
os (1.1.1)
plist (3.6.0)
public_suffix (4.0.6)
rake (13.0.3)
representable (3.0.4)
declarative (< 0.1.0)
declarative-option (< 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rouge (2.0.7)
ruby2_keywords (0.0.2)
rubyzip (2.3.0)
security (0.1.3)
signet (0.14.0)
addressable (~> 2.3)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simctl (1.6.8)
CFPropertyList
naturally
slack-notifier (2.3.2)
terminal-notifier (2.0.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
tty-cursor (0.7.1)
tty-screen (0.8.1)
tty-spinner (0.9.3)
tty-cursor (~> 0.7)
uber (0.1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
unicode-display_width (1.7.0)
word_wrap (1.0.0)
xcodeproj (1.19.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
xcpretty (0.3.0)
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.0)
xcpretty (~> 0.2, >= 0.0.7)
PLATFORMS
ruby
DEPENDENCIES
fastlane
fastlane-plugin-pgyer
BUNDLED WITH
2.1.4
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'SkinMagnifier' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
pod 'AFNetworking'
pod 'IQKeyboardManager'
pod 'Masonry'
pod 'SVProgressHUD'
pod 'MJExtension'
pod 'MJRefresh'
pod 'SDWebImage'
pod 'FMDB'
pod 'Bugly'
pod 'AliyunOSSiOS'
pod 'CocoaAsyncSocket'
pod 'MOFSPickerManager'
pod 'TZImagePickerController'
pod 'NSString+RemoveEmoji'
pod 'OpenCV'
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
end
end
end
end
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objects = {
/* Begin PBXBuildFile section */
3909C1CD259C654300463D9E /* lanch_loin_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3909C1CB259C654300463D9E /* lanch_loin_icon@2x.png */; };
3909C1CE259C654300463D9E /* lanch_loin_icon@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3909C1CC259C654300463D9E /* lanch_loin_icon@3x.png */; };
3916A3A2255243E200C94453 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3916A3A1255243E200C94453 /* AppDelegate.m */; };
3916A3AD255243E300C94453 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3916A3AC255243E300C94453 /* Assets.xcassets */; };
3916A3B0255243E300C94453 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3916A3AE255243E300C94453 /* LaunchScreen.storyboard */; };
3916A3B3255243E300C94453 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3916A3B2255243E300C94453 /* main.m */; };
391E925C25B130FE00D832BE /* weidu.json in Resources */ = {isa = PBXBuildFile; fileRef = 391E925B25B130FE00D832BE /* weidu.json */; };
3933672E260DB343007BCBEA /* SMConfigWIFIView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3933672D260DB343007BCBEA /* SMConfigWIFIView.m */; };
39411ECF2577664C00F43547 /* UIView+Request.m in Sources */ = {isa = PBXBuildFile; fileRef = 39411ECD2577664C00F43547 /* UIView+Request.m */; };
39411ED32577668D00F43547 /* JFResponseModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 39411ED22577668D00F43547 /* JFResponseModel.m */; };
39411ED72577688C00F43547 /* JFBaseModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 39411ED62577688C00F43547 /* JFBaseModel.m */; };
3948C7052578853300CB5AF1 /* SMGlobalModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 3948C7042578853300CB5AF1 /* SMGlobalModel.m */; };
3948C7092578B47200CB5AF1 /* MTRAreaPickView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3948C7082578B47200CB5AF1 /* MTRAreaPickView.m */; };
3948C70D2578B47C00CB5AF1 /* MTRegisterAreaModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 3948C70C2578B47C00CB5AF1 /* MTRegisterAreaModel.m */; };
3948C7112578C3E400CB5AF1 /* SMShopInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 3948C7102578C3E400CB5AF1 /* SMShopInfoModel.m */; };
394933AC25876DDF00EA25EB /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 394933AB25876DDF00EA25EB /* NetworkExtension.framework */; };
3949AB7C256DF73700EA3C45 /* DKSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 3949AB78256DF73700EA3C45 /* DKSocket.m */; };
3949AB7D256DF73700EA3C45 /* DKWIFIVideoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3949AB79256DF73700EA3C45 /* DKWIFIVideoView.m */; };
3949AB8F256E298900EA3C45 /* DKCmdTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 3949AB8D256E298900EA3C45 /* DKCmdTool.m */; };
394C379C2575E5030034317A /* SMReportAddProjectView.m in Sources */ = {isa = PBXBuildFile; fileRef = 394C379B2575E5030034317A /* SMReportAddProjectView.m */; };
394C37AA2576118E0034317A /* SMReportAddSchemeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 394C37A92576118E0034317A /* SMReportAddSchemeView.m */; };
394C37B325763B1D0034317A /* SMReportEditSchemeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 394C37B225763B1D0034317A /* SMReportEditSchemeView.m */; };
394C9AE62579D3CE0034BFAF /* MMLocalDataBManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 394C9AE52579D3CD0034BFAF /* MMLocalDataBManager.m */; };
394C9AEA2579D3EB0034BFAF /* MMAutoUploadTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 394C9AE92579D3EB0034BFAF /* MMAutoUploadTool.m */; };
394C9AF8257A03E50034BFAF /* SMClientListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 394C9AF7257A03E50034BFAF /* SMClientListModel.m */; };
394C9AFC257A0E830034BFAF /* SMClientDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 394C9AFB257A0E830034BFAF /* SMClientDetailViewController.m */; };
394C9B00257A1ACD0034BFAF /* SMClientDetailCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 394C9AFF257A1ACD0034BFAF /* SMClientDetailCell.m */; };
394D6DB42556371600C8BF31 /* SMEditShopInfoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 394D6DB32556371600C8BF31 /* SMEditShopInfoViewController.m */; };
394D6DB82556449300C8BF31 /* SMESPhoneView.m in Sources */ = {isa = PBXBuildFile; fileRef = 394D6DB72556449300C8BF31 /* SMESPhoneView.m */; };
394D6DBC2556496600C8BF31 /* SMESEditView.m in Sources */ = {isa = PBXBuildFile; fileRef = 394D6DBB2556496600C8BF31 /* SMESEditView.m */; };
394EE0092564F2F300BA95C7 /* SMEditPositionNameView.m in Sources */ = {isa = PBXBuildFile; fileRef = 394EE0082564F2F300BA95C7 /* SMEditPositionNameView.m */; };
394EE00D25650AB400BA95C7 /* SMReportViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 394EE00C25650AB400BA95C7 /* SMReportViewController.m */; };
394EE0112565179600BA95C7 /* SMPageControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 394EE00F2565179600BA95C7 /* SMPageControl.m */; };
394F19D5258C554900A0227F /* SMTempCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 394F19D4258C554900A0227F /* SMTempCell.m */; };
39500FD62558E73D000B7157 /* SMDateKeyBoardView.m in Sources */ = {isa = PBXBuildFile; fileRef = 39500FD52558E73D000B7157 /* SMDateKeyBoardView.m */; };
39503D86256B65E50043A9DF /* SMReportHeaderCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 39503D85256B65E50043A9DF /* SMReportHeaderCell.m */; };
39503D8A256B8BC20043A9DF /* SMReportSchemeCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 39503D89256B8BC20043A9DF /* SMReportSchemeCell.m */; };
39503D8E256B97730043A9DF /* SMReportImageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 39503D8D256B97730043A9DF /* SMReportImageCell.m */; };
39503F9C256F835400127A05 /* SMShowTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 39503F9B256F835400127A05 /* SMShowTextView.m */; };
39503FAF256FB2D700127A05 /* SMReportProjectCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 39503FAE256FB2D700127A05 /* SMReportProjectCell.m */; };
39514ACE2582138000A6C5D0 /* SMYZMView.m in Sources */ = {isa = PBXBuildFile; fileRef = 39514ACD2582138000A6C5D0 /* SMYZMView.m */; };
395275802580BF3500CE2569 /* SMAgreementView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3952757F2580BF3500CE2569 /* SMAgreementView.m */; };
395543F32553A55A00327643 /* SMRCompleteView.m in Sources */ = {isa = PBXBuildFile; fileRef = 395543F22553A55A00327643 /* SMRCompleteView.m */; };
395543F72553C89C00327643 /* SMCountDownButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 395543F62553C89C00327643 /* SMCountDownButton.m */; };
3959BD5E256369D300240A36 /* SMTakeImageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3959BD5D256369D300240A36 /* SMTakeImageViewController.m */; };
395E9A20257F29C000F1EB4E /* RippleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 395E9A1E257F29C000F1EB4E /* RippleView.m */; };
395E9A24257F2A8400F1EB4E /* SMCheckOilBGView.m in Sources */ = {isa = PBXBuildFile; fileRef = 395E9A23257F2A8400F1EB4E /* SMCheckOilBGView.m */; };
395E9A28257F4EEE00F1EB4E /* SMShowImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 395E9A27257F4EEE00F1EB4E /* SMShowImageView.m */; };
395E9A2C257F515B00F1EB4E /* SMShowImageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 395E9A2B257F515B00F1EB4E /* SMShowImageCell.m */; };
395E9A33257F9D3F00F1EB4E /* ysfa.json in Resources */ = {isa = PBXBuildFile; fileRef = 395E9A32257F9D3F00F1EB4E /* ysfa.json */; };
39628EF025AD774E00A1A588 /* SMShowOriginalImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 39628EEF25AD774E00A1A588 /* SMShowOriginalImageView.m */; };
3968EA5A2589BB5F00ED3FA0 /* SMClientDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 3968EA592589BB5F00ED3FA0 /* SMClientDetailModel.m */; };
396BB6802554E8B000191430 /* SMClientViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 396BB67F2554E8B000191430 /* SMClientViewController.m */; };
396BB68525551E0400191430 /* SMSearchBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 396BB68425551E0400191430 /* SMSearchBar.m */; };
396BB689255528EE00191430 /* SMClientCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 396BB688255528EE00191430 /* SMClientCell.m */; };
396BB68D2555323300191430 /* SMCreateClientViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 396BB68C2555323300191430 /* SMCreateClientViewController.m */; };
3973AA0025A6A1ED0034589A /* brown.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3973A9F825A6A1ED0034589A /* brown.cpp */; };
3973AA0125A6A1ED0034589A /* BlockedPore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3973A9FA25A6A1ED0034589A /* BlockedPore.cpp */; };
3973AA0225A6A1ED0034589A /* roughPore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3973A9FC25A6A1ED0034589A /* roughPore.cpp */; };
3973AA0325A6A1ED0034589A /* wrinkle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3973A9FF25A6A1ED0034589A /* wrinkle.cpp */; };
3973AC0F25A6D9170034589A /* SMRaderMapCompleteView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3973AC0D25A6D9170034589A /* SMRaderMapCompleteView.m */; };
3973AC1425A6F01D0034589A /* SMReportSymptomCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3973AC1325A6F01D0034589A /* SMReportSymptomCell.m */; };
3973AC1825A711330034589A /* SMAIImageTool.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3973AC1725A711330034589A /* SMAIImageTool.mm */; };
399A69DB255D17EA00F88603 /* SMLinkDeviceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 399A69DA255D17EA00F88603 /* SMLinkDeviceView.m */; };
39A3A9B2255257160072D427 /* SMBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 39A3A9B1255257160072D427 /* SMBase.m */; };
39A3A9C0255290050072D427 /* SMRInputPhoneView.m in Sources */ = {isa = PBXBuildFile; fileRef = 39A3A9BF255290050072D427 /* SMRInputPhoneView.m */; };
39A3A9C5255291210072D427 /* SMRVerificationCodeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 39A3A9C4255291210072D427 /* SMRVerificationCodeView.m */; };
39A3A9CD2552A1370072D427 /* SMRSetPwdView.m in Sources */ = {isa = PBXBuildFile; fileRef = 39A3A9CC2552A1370072D427 /* SMRSetPwdView.m */; };
39A3A9D12552A8EF0072D427 /* SMDownView.m in Sources */ = {isa = PBXBuildFile; fileRef = 39A3A9D02552A8EF0072D427 /* SMDownView.m */; };
39A3A9D52552B7A40072D427 /* SMRegistView.m in Sources */ = {isa = PBXBuildFile; fileRef = 39A3A9D42552B7A40072D427 /* SMRegistView.m */; };
39BBECD2255251110008A569 /* SMNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 39BBECD1255251110008A569 /* SMNavigationController.m */; };
39BBECD6255251970008A569 /* SMHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 39BBECD5255251970008A569 /* SMHomeViewController.m */; };
39BBECDC255253960008A569 /* SMLoginView.m in Sources */ = {isa = PBXBuildFile; fileRef = 39BBECDB255253960008A569 /* SMLoginView.m */; };
39C0AA63257E62A700A3C988 /* SMReportOilCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 39C0AA62257E62A700A3C988 /* SMReportOilCell.m */; };
39C374F4257DC88900782673 /* SMLocalReportBManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 39C374F3257DC88900782673 /* SMLocalReportBManager.m */; };
39C374FF257DC9B000782673 /* SMLocalReportModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 39C374FE257DC9B000782673 /* SMLocalReportModel.m */; };
39E88EA62580A65D00AD5FE0 /* ExternalAccessory.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 39E88EA52580A65D00AD5FE0 /* ExternalAccessory.framework */; };
ED429869551CFD50AF9316C7 /* Pods_SkinMagnifier.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84CEFD4505D84144683BD801 /* Pods_SkinMagnifier.framework */; };
FACEE2682591FB4100B4DBEC /* lanch_login_bg@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = FACEE2662591FB4100B4DBEC /* lanch_login_bg@3x.png */; };
FACEE2692591FB4100B4DBEC /* lanch_login_bg@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FACEE2672591FB4100B4DBEC /* lanch_login_bg@2x.png */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
3909C1CB259C654300463D9E /* lanch_loin_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lanch_loin_icon@2x.png"; sourceTree = "<group>"; };
3909C1CC259C654300463D9E /* lanch_loin_icon@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lanch_loin_icon@3x.png"; sourceTree = "<group>"; };
3916A39D255243E200C94453 /* SkinMagnifier.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SkinMagnifier.app; sourceTree = BUILT_PRODUCTS_DIR; };
3916A3A0255243E200C94453 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
3916A3A1255243E200C94453 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
3916A3AC255243E300C94453 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
3916A3AF255243E300C94453 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
3916A3B1255243E300C94453 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3916A3B2255243E300C94453 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
391E925B25B130FE00D832BE /* weidu.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = weidu.json; sourceTree = "<group>"; };
3933672C260DB343007BCBEA /* SMConfigWIFIView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMConfigWIFIView.h; sourceTree = "<group>"; };
3933672D260DB343007BCBEA /* SMConfigWIFIView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMConfigWIFIView.m; sourceTree = "<group>"; };
3933E82925AFDCCF004A2CE4 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/LaunchScreen.strings"; sourceTree = "<group>"; };
39411ECD2577664C00F43547 /* UIView+Request.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Request.m"; sourceTree = "<group>"; };
39411ECE2577664C00F43547 /* UIView+Request.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Request.h"; sourceTree = "<group>"; };
39411ED12577668D00F43547 /* JFResponseModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JFResponseModel.h; sourceTree = "<group>"; };
39411ED22577668D00F43547 /* JFResponseModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JFResponseModel.m; sourceTree = "<group>"; };
39411ED52577688C00F43547 /* JFBaseModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JFBaseModel.h; sourceTree = "<group>"; };
39411ED62577688C00F43547 /* JFBaseModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JFBaseModel.m; sourceTree = "<group>"; };
3948C7032578853300CB5AF1 /* SMGlobalModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMGlobalModel.h; sourceTree = "<group>"; };
3948C7042578853300CB5AF1 /* SMGlobalModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMGlobalModel.m; sourceTree = "<group>"; };
3948C7072578B47200CB5AF1 /* MTRAreaPickView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRAreaPickView.h; sourceTree = "<group>"; };
3948C7082578B47200CB5AF1 /* MTRAreaPickView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRAreaPickView.m; sourceTree = "<group>"; };
3948C70B2578B47C00CB5AF1 /* MTRegisterAreaModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRegisterAreaModel.h; sourceTree = "<group>"; };
3948C70C2578B47C00CB5AF1 /* MTRegisterAreaModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRegisterAreaModel.m; sourceTree = "<group>"; };
3948C70F2578C3E400CB5AF1 /* SMShopInfoModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMShopInfoModel.h; sourceTree = "<group>"; };
3948C7102578C3E400CB5AF1 /* SMShopInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMShopInfoModel.m; sourceTree = "<group>"; };
394933AB25876DDF00EA25EB /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; };
3949AB78256DF73700EA3C45 /* DKSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DKSocket.m; sourceTree = "<group>"; };
3949AB79256DF73700EA3C45 /* DKWIFIVideoView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DKWIFIVideoView.m; sourceTree = "<group>"; };
3949AB7A256DF73700EA3C45 /* DKSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DKSocket.h; sourceTree = "<group>"; };
3949AB7B256DF73700EA3C45 /* DKWIFIVideoView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DKWIFIVideoView.h; sourceTree = "<group>"; };
3949AB8D256E298900EA3C45 /* DKCmdTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DKCmdTool.m; sourceTree = "<group>"; };
3949AB8E256E298900EA3C45 /* DKCmdTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DKCmdTool.h; sourceTree = "<group>"; };
394C379A2575E5030034317A /* SMReportAddProjectView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMReportAddProjectView.h; sourceTree = "<group>"; };
394C379B2575E5030034317A /* SMReportAddProjectView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMReportAddProjectView.m; sourceTree = "<group>"; };
394C37A82576118E0034317A /* SMReportAddSchemeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMReportAddSchemeView.h; sourceTree = "<group>"; };
394C37A92576118E0034317A /* SMReportAddSchemeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMReportAddSchemeView.m; sourceTree = "<group>"; };
394C37B125763B1D0034317A /* SMReportEditSchemeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMReportEditSchemeView.h; sourceTree = "<group>"; };
394C37B225763B1D0034317A /* SMReportEditSchemeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMReportEditSchemeView.m; sourceTree = "<group>"; };
394C9AE42579D3CD0034BFAF /* MMLocalDataBManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMLocalDataBManager.h; sourceTree = "<group>"; };
394C9AE52579D3CD0034BFAF /* MMLocalDataBManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMLocalDataBManager.m; sourceTree = "<group>"; };
394C9AE82579D3EB0034BFAF /* MMAutoUploadTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMAutoUploadTool.h; sourceTree = "<group>"; };
394C9AE92579D3EB0034BFAF /* MMAutoUploadTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMAutoUploadTool.m; sourceTree = "<group>"; };
394C9AF6257A03E50034BFAF /* SMClientListModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMClientListModel.h; sourceTree = "<group>"; };
394C9AF7257A03E50034BFAF /* SMClientListModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMClientListModel.m; sourceTree = "<group>"; };
394C9AFA257A0E830034BFAF /* SMClientDetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMClientDetailViewController.h; sourceTree = "<group>"; };
394C9AFB257A0E830034BFAF /* SMClientDetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMClientDetailViewController.m; sourceTree = "<group>"; };
394C9AFE257A1ACD0034BFAF /* SMClientDetailCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMClientDetailCell.h; sourceTree = "<group>"; };
394C9AFF257A1ACD0034BFAF /* SMClientDetailCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMClientDetailCell.m; sourceTree = "<group>"; };
394D6DB22556371600C8BF31 /* SMEditShopInfoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMEditShopInfoViewController.h; sourceTree = "<group>"; };
394D6DB32556371600C8BF31 /* SMEditShopInfoViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMEditShopInfoViewController.m; sourceTree = "<group>"; };
394D6DB62556449300C8BF31 /* SMESPhoneView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMESPhoneView.h; sourceTree = "<group>"; };
394D6DB72556449300C8BF31 /* SMESPhoneView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMESPhoneView.m; sourceTree = "<group>"; };
394D6DBA2556496600C8BF31 /* SMESEditView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMESEditView.h; sourceTree = "<group>"; };
394D6DBB2556496600C8BF31 /* SMESEditView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMESEditView.m; sourceTree = "<group>"; };
394EE0072564F2F300BA95C7 /* SMEditPositionNameView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMEditPositionNameView.h; sourceTree = "<group>"; };
394EE0082564F2F300BA95C7 /* SMEditPositionNameView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMEditPositionNameView.m; sourceTree = "<group>"; };
394EE00B25650AB400BA95C7 /* SMReportViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMReportViewController.h; sourceTree = "<group>"; };
394EE00C25650AB400BA95C7 /* SMReportViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMReportViewController.m; sourceTree = "<group>"; };
394EE00F2565179600BA95C7 /* SMPageControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SMPageControl.m; sourceTree = "<group>"; };
394EE0102565179600BA95C7 /* SMPageControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SMPageControl.h; sourceTree = "<group>"; };
394F19D3258C554900A0227F /* SMTempCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMTempCell.h; sourceTree = "<group>"; };
394F19D4258C554900A0227F /* SMTempCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMTempCell.m; sourceTree = "<group>"; };
39500FD42558E73D000B7157 /* SMDateKeyBoardView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMDateKeyBoardView.h; sourceTree = "<group>"; };
39500FD52558E73D000B7157 /* SMDateKeyBoardView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMDateKeyBoardView.m; sourceTree = "<group>"; };
39503D84256B65E50043A9DF /* SMReportHeaderCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMReportHeaderCell.h; sourceTree = "<group>"; };
39503D85256B65E50043A9DF /* SMReportHeaderCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMReportHeaderCell.m; sourceTree = "<group>"; };
39503D88256B8BC20043A9DF /* SMReportSchemeCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMReportSchemeCell.h; sourceTree = "<group>"; };
39503D89256B8BC20043A9DF /* SMReportSchemeCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMReportSchemeCell.m; sourceTree = "<group>"; };
39503D8C256B97730043A9DF /* SMReportImageCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMReportImageCell.h; sourceTree = "<group>"; };
39503D8D256B97730043A9DF /* SMReportImageCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMReportImageCell.m; sourceTree = "<group>"; };
39503F9A256F835400127A05 /* SMShowTextView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMShowTextView.h; sourceTree = "<group>"; };
39503F9B256F835400127A05 /* SMShowTextView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMShowTextView.m; sourceTree = "<group>"; };
39503FAD256FB2D700127A05 /* SMReportProjectCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMReportProjectCell.h; sourceTree = "<group>"; };
39503FAE256FB2D700127A05 /* SMReportProjectCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMReportProjectCell.m; sourceTree = "<group>"; };
39514ACC2582138000A6C5D0 /* SMYZMView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMYZMView.h; sourceTree = "<group>"; };
39514ACD2582138000A6C5D0 /* SMYZMView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMYZMView.m; sourceTree = "<group>"; };
3952757E2580BF3500CE2569 /* SMAgreementView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMAgreementView.h; sourceTree = "<group>"; };
3952757F2580BF3500CE2569 /* SMAgreementView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMAgreementView.m; sourceTree = "<group>"; };
395543F12553A55A00327643 /* SMRCompleteView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMRCompleteView.h; sourceTree = "<group>"; };
395543F22553A55A00327643 /* SMRCompleteView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMRCompleteView.m; sourceTree = "<group>"; };
395543F52553C89C00327643 /* SMCountDownButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMCountDownButton.h; sourceTree = "<group>"; };
395543F62553C89C00327643 /* SMCountDownButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMCountDownButton.m; sourceTree = "<group>"; };
3959BD5C256369D300240A36 /* SMTakeImageViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMTakeImageViewController.h; sourceTree = "<group>"; };
3959BD5D256369D300240A36 /* SMTakeImageViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMTakeImageViewController.m; sourceTree = "<group>"; };
395E9A1E257F29C000F1EB4E /* RippleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RippleView.m; sourceTree = "<group>"; };
395E9A1F257F29C000F1EB4E /* RippleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RippleView.h; sourceTree = "<group>"; };
395E9A22257F2A8400F1EB4E /* SMCheckOilBGView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMCheckOilBGView.h; sourceTree = "<group>"; };
395E9A23257F2A8400F1EB4E /* SMCheckOilBGView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMCheckOilBGView.m; sourceTree = "<group>"; };
395E9A26257F4EEE00F1EB4E /* SMShowImageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMShowImageView.h; sourceTree = "<group>"; };
395E9A27257F4EEE00F1EB4E /* SMShowImageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMShowImageView.m; sourceTree = "<group>"; };
395E9A2A257F515B00F1EB4E /* SMShowImageCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMShowImageCell.h; sourceTree = "<group>"; };
395E9A2B257F515B00F1EB4E /* SMShowImageCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMShowImageCell.m; sourceTree = "<group>"; };
395E9A32257F9D3F00F1EB4E /* ysfa.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = ysfa.json; sourceTree = "<group>"; };
39628EEE25AD774E00A1A588 /* SMShowOriginalImageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMShowOriginalImageView.h; sourceTree = "<group>"; };
39628EEF25AD774E00A1A588 /* SMShowOriginalImageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMShowOriginalImageView.m; sourceTree = "<group>"; };
3968EA582589BB5F00ED3FA0 /* SMClientDetailModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMClientDetailModel.h; sourceTree = "<group>"; };
3968EA592589BB5F00ED3FA0 /* SMClientDetailModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMClientDetailModel.m; sourceTree = "<group>"; };
396BB67E2554E8B000191430 /* SMClientViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMClientViewController.h; sourceTree = "<group>"; };
396BB67F2554E8B000191430 /* SMClientViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMClientViewController.m; sourceTree = "<group>"; };
396BB68325551E0400191430 /* SMSearchBar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMSearchBar.h; sourceTree = "<group>"; };
396BB68425551E0400191430 /* SMSearchBar.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMSearchBar.m; sourceTree = "<group>"; };
396BB687255528EE00191430 /* SMClientCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMClientCell.h; sourceTree = "<group>"; };
396BB688255528EE00191430 /* SMClientCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMClientCell.m; sourceTree = "<group>"; };
396BB68B2555323300191430 /* SMCreateClientViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMCreateClientViewController.h; sourceTree = "<group>"; };
396BB68C2555323300191430 /* SMCreateClientViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMCreateClientViewController.m; sourceTree = "<group>"; };
3973A9F825A6A1ED0034589A /* brown.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = brown.cpp; sourceTree = "<group>"; };
3973A9F925A6A1ED0034589A /* wrinkle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrinkle.h; sourceTree = "<group>"; };
3973A9FA25A6A1ED0034589A /* BlockedPore.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = BlockedPore.cpp; sourceTree = "<group>"; };
3973A9FB25A6A1ED0034589A /* brown.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = brown.h; sourceTree = "<group>"; };
3973A9FC25A6A1ED0034589A /* roughPore.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = roughPore.cpp; sourceTree = "<group>"; };
3973A9FD25A6A1ED0034589A /* roughPore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = roughPore.h; sourceTree = "<group>"; };
3973A9FE25A6A1ED0034589A /* BlockedPore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlockedPore.h; sourceTree = "<group>"; };
3973A9FF25A6A1ED0034589A /* wrinkle.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = wrinkle.cpp; sourceTree = "<group>"; };
3973AC0D25A6D9170034589A /* SMRaderMapCompleteView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SMRaderMapCompleteView.m; sourceTree = "<group>"; };
3973AC0E25A6D9170034589A /* SMRaderMapCompleteView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SMRaderMapCompleteView.h; sourceTree = "<group>"; };
3973AC1225A6F01D0034589A /* SMReportSymptomCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMReportSymptomCell.h; sourceTree = "<group>"; };
3973AC1325A6F01D0034589A /* SMReportSymptomCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMReportSymptomCell.m; sourceTree = "<group>"; };
3973AC1625A711330034589A /* SMAIImageTool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMAIImageTool.h; sourceTree = "<group>"; };
3973AC1725A711330034589A /* SMAIImageTool.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SMAIImageTool.mm; sourceTree = "<group>"; };
399A69D9255D17EA00F88603 /* SMLinkDeviceView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMLinkDeviceView.h; sourceTree = "<group>"; };
399A69DA255D17EA00F88603 /* SMLinkDeviceView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMLinkDeviceView.m; sourceTree = "<group>"; };
39A3A9B0255257160072D427 /* SMBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMBase.h; sourceTree = "<group>"; };
39A3A9B1255257160072D427 /* SMBase.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMBase.m; sourceTree = "<group>"; };
39A3A9BE255290050072D427 /* SMRInputPhoneView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMRInputPhoneView.h; sourceTree = "<group>"; };
39A3A9BF255290050072D427 /* SMRInputPhoneView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMRInputPhoneView.m; sourceTree = "<group>"; };
39A3A9C3255291210072D427 /* SMRVerificationCodeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMRVerificationCodeView.h; sourceTree = "<group>"; };
39A3A9C4255291210072D427 /* SMRVerificationCodeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMRVerificationCodeView.m; sourceTree = "<group>"; };
39A3A9CB2552A1370072D427 /* SMRSetPwdView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMRSetPwdView.h; sourceTree = "<group>"; };
39A3A9CC2552A1370072D427 /* SMRSetPwdView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMRSetPwdView.m; sourceTree = "<group>"; };
39A3A9CF2552A8EF0072D427 /* SMDownView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMDownView.h; sourceTree = "<group>"; };
39A3A9D02552A8EF0072D427 /* SMDownView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMDownView.m; sourceTree = "<group>"; };
39A3A9D32552B7A40072D427 /* SMRegistView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMRegistView.h; sourceTree = "<group>"; };
39A3A9D42552B7A40072D427 /* SMRegistView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMRegistView.m; sourceTree = "<group>"; };
39BBECD0255251110008A569 /* SMNavigationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMNavigationController.h; sourceTree = "<group>"; };
39BBECD1255251110008A569 /* SMNavigationController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMNavigationController.m; sourceTree = "<group>"; };
39BBECD4255251970008A569 /* SMHomeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMHomeViewController.h; sourceTree = "<group>"; };
39BBECD5255251970008A569 /* SMHomeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMHomeViewController.m; sourceTree = "<group>"; };
39BBECDA255253960008A569 /* SMLoginView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMLoginView.h; sourceTree = "<group>"; };
39BBECDB255253960008A569 /* SMLoginView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMLoginView.m; sourceTree = "<group>"; };
39BBECDE255253C50008A569 /* PrefixHeader.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = "<group>"; };
39C0AA61257E62A700A3C988 /* SMReportOilCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMReportOilCell.h; sourceTree = "<group>"; };
39C0AA62257E62A700A3C988 /* SMReportOilCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMReportOilCell.m; sourceTree = "<group>"; };
39C374F2257DC88900782673 /* SMLocalReportBManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMLocalReportBManager.h; sourceTree = "<group>"; };
39C374F3257DC88900782673 /* SMLocalReportBManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMLocalReportBManager.m; sourceTree = "<group>"; };
39C374FD257DC9B000782673 /* SMLocalReportModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMLocalReportModel.h; sourceTree = "<group>"; };
39C374FE257DC9B000782673 /* SMLocalReportModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMLocalReportModel.m; sourceTree = "<group>"; };
39E88EA32580A55D00AD5FE0 /* SkinMagnifier.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SkinMagnifier.entitlements; sourceTree = "<group>"; };
39E88EA52580A65D00AD5FE0 /* ExternalAccessory.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ExternalAccessory.framework; path = System/Library/Frameworks/ExternalAccessory.framework; sourceTree = SDKROOT; };
84CEFD4505D84144683BD801 /* Pods_SkinMagnifier.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SkinMagnifier.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A16643641E608F86629335F1 /* Pods-SkinMagnifier.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SkinMagnifier.release.xcconfig"; path = "Target Support Files/Pods-SkinMagnifier/Pods-SkinMagnifier.release.xcconfig"; sourceTree = "<group>"; };
DB077C55553F1970EBDFFD8B /* Pods-SkinMagnifier.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SkinMagnifier.debug.xcconfig"; path = "Target Support Files/Pods-SkinMagnifier/Pods-SkinMagnifier.debug.xcconfig"; sourceTree = "<group>"; };
FACEE2662591FB4100B4DBEC /* lanch_login_bg@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lanch_login_bg@3x.png"; sourceTree = "<group>"; };
FACEE2672591FB4100B4DBEC /* lanch_login_bg@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lanch_login_bg@2x.png"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
3916A39A255243E200C94453 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
39E88EA62580A65D00AD5FE0 /* ExternalAccessory.framework in Frameworks */,
394933AC25876DDF00EA25EB /* NetworkExtension.framework in Frameworks */,
ED429869551CFD50AF9316C7 /* Pods_SkinMagnifier.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
3916A394255243E200C94453 = {
isa = PBXGroup;
children = (
3916A39F255243E200C94453 /* SkinMagnifier */,
3916A39E255243E200C94453 /* Products */,
74F6E452E947B9A8645B0751 /* Pods */,
C31BE4820A0C2A1CC5275062 /* Frameworks */,
);
sourceTree = "<group>";
};
3916A39E255243E200C94453 /* Products */ = {
isa = PBXGroup;
children = (
3916A39D255243E200C94453 /* SkinMagnifier.app */,
);
name = Products;
sourceTree = "<group>";
};
3916A39F255243E200C94453 /* SkinMagnifier */ = {
isa = PBXGroup;
children = (
3973A9F725A6A1ED0034589A /* aiclass */,
39E88EA32580A55D00AD5FE0 /* SkinMagnifier.entitlements */,
396BB67D2554E85900191430 /* Client */,
39648D512553E54E002B043F /* Other */,
395544072553E07D00327643 /* Home */,
39BBECE3255255340008A569 /* Account */,
3916A3A0255243E200C94453 /* AppDelegate.h */,
3916A3A1255243E200C94453 /* AppDelegate.m */,
39BBECD0255251110008A569 /* SMNavigationController.h */,
39BBECD1255251110008A569 /* SMNavigationController.m */,
39BBECDE255253C50008A569 /* PrefixHeader.pch */,
3916A3AC255243E300C94453 /* Assets.xcassets */,
3916A3AE255243E300C94453 /* LaunchScreen.storyboard */,
3916A3B1255243E300C94453 /* Info.plist */,
3916A3B2255243E300C94453 /* main.m */,
FACEE2672591FB4100B4DBEC /* lanch_login_bg@2x.png */,
FACEE2662591FB4100B4DBEC /* lanch_login_bg@3x.png */,
3909C1CB259C654300463D9E /* lanch_loin_icon@2x.png */,
3909C1CC259C654300463D9E /* lanch_loin_icon@3x.png */,
);
path = SkinMagnifier;
sourceTree = "<group>";
};
395544072553E07D00327643 /* Home */ = {
isa = PBXGroup;
children = (
39BBECD4255251970008A569 /* SMHomeViewController.h */,
39BBECD5255251970008A569 /* SMHomeViewController.m */,
3933672C260DB343007BCBEA /* SMConfigWIFIView.h */,
3933672D260DB343007BCBEA /* SMConfigWIFIView.m */,
);
path = Home;
sourceTree = "<group>";
};
39648D512553E54E002B043F /* Other */ = {
isa = PBXGroup;
children = (
3973AC0E25A6D9170034589A /* SMRaderMapCompleteView.h */,
3973AC0D25A6D9170034589A /* SMRaderMapCompleteView.m */,
395E9A1F257F29C000F1EB4E /* RippleView.h */,
395E9A1E257F29C000F1EB4E /* RippleView.m */,
394C9AE42579D3CD0034BFAF /* MMLocalDataBManager.h */,
394C9AE52579D3CD0034BFAF /* MMLocalDataBManager.m */,
394C9AE82579D3EB0034BFAF /* MMAutoUploadTool.h */,
394C9AE92579D3EB0034BFAF /* MMAutoUploadTool.m */,
3948C7072578B47200CB5AF1 /* MTRAreaPickView.h */,
3948C7082578B47200CB5AF1 /* MTRAreaPickView.m */,
3948C70B2578B47C00CB5AF1 /* MTRegisterAreaModel.h */,
3948C70C2578B47C00CB5AF1 /* MTRegisterAreaModel.m */,
39411ECE2577664C00F43547 /* UIView+Request.h */,
39411ECD2577664C00F43547 /* UIView+Request.m */,
39411ED12577668D00F43547 /* JFResponseModel.h */,
39411ED22577668D00F43547 /* JFResponseModel.m */,
39411ED52577688C00F43547 /* JFBaseModel.h */,
39411ED62577688C00F43547 /* JFBaseModel.m */,
3949AB8E256E298900EA3C45 /* DKCmdTool.h */,
3949AB8D256E298900EA3C45 /* DKCmdTool.m */,
3949AB7A256DF73700EA3C45 /* DKSocket.h */,
3949AB78256DF73700EA3C45 /* DKSocket.m */,
3949AB7B256DF73700EA3C45 /* DKWIFIVideoView.h */,
3949AB79256DF73700EA3C45 /* DKWIFIVideoView.m */,
39A3A9B0255257160072D427 /* SMBase.h */,
39A3A9B1255257160072D427 /* SMBase.m */,
395543F52553C89C00327643 /* SMCountDownButton.h */,
395543F62553C89C00327643 /* SMCountDownButton.m */,
39A3A9CF2552A8EF0072D427 /* SMDownView.h */,
39A3A9D02552A8EF0072D427 /* SMDownView.m */,
396BB68325551E0400191430 /* SMSearchBar.h */,
396BB68425551E0400191430 /* SMSearchBar.m */,
39500FD42558E73D000B7157 /* SMDateKeyBoardView.h */,
39500FD52558E73D000B7157 /* SMDateKeyBoardView.m */,
39503F9A256F835400127A05 /* SMShowTextView.h */,
39503F9B256F835400127A05 /* SMShowTextView.m */,
3948C7032578853300CB5AF1 /* SMGlobalModel.h */,
3948C7042578853300CB5AF1 /* SMGlobalModel.m */,
39C374F2257DC88900782673 /* SMLocalReportBManager.h */,
39C374F3257DC88900782673 /* SMLocalReportBManager.m */,
39C374FD257DC9B000782673 /* SMLocalReportModel.h */,
39C374FE257DC9B000782673 /* SMLocalReportModel.m */,
3952757E2580BF3500CE2569 /* SMAgreementView.h */,
3952757F2580BF3500CE2569 /* SMAgreementView.m */,
39514ACC2582138000A6C5D0 /* SMYZMView.h */,
39514ACD2582138000A6C5D0 /* SMYZMView.m */,
395E9A32257F9D3F00F1EB4E /* ysfa.json */,
391E925B25B130FE00D832BE /* weidu.json */,
);
path = Other;
sourceTree = "<group>";
};
396BB67D2554E85900191430 /* Client */ = {
isa = PBXGroup;
children = (
396BB67E2554E8B000191430 /* SMClientViewController.h */,
396BB67F2554E8B000191430 /* SMClientViewController.m */,
396BB687255528EE00191430 /* SMClientCell.h */,
396BB688255528EE00191430 /* SMClientCell.m */,
396BB68B2555323300191430 /* SMCreateClientViewController.h */,
396BB68C2555323300191430 /* SMCreateClientViewController.m */,
399A69D9255D17EA00F88603 /* SMLinkDeviceView.h */,
399A69DA255D17EA00F88603 /* SMLinkDeviceView.m */,
3959BD5C256369D300240A36 /* SMTakeImageViewController.h */,
3959BD5D256369D300240A36 /* SMTakeImageViewController.m */,
394EE0072564F2F300BA95C7 /* SMEditPositionNameView.h */,
394EE0082564F2F300BA95C7 /* SMEditPositionNameView.m */,
394EE00B25650AB400BA95C7 /* SMReportViewController.h */,
394EE00C25650AB400BA95C7 /* SMReportViewController.m */,
39503D84256B65E50043A9DF /* SMReportHeaderCell.h */,
39503D85256B65E50043A9DF /* SMReportHeaderCell.m */,
39503D88256B8BC20043A9DF /* SMReportSchemeCell.h */,
39503D89256B8BC20043A9DF /* SMReportSchemeCell.m */,
3973AC1225A6F01D0034589A /* SMReportSymptomCell.h */,
3973AC1325A6F01D0034589A /* SMReportSymptomCell.m */,
39C0AA61257E62A700A3C988 /* SMReportOilCell.h */,
39C0AA62257E62A700A3C988 /* SMReportOilCell.m */,
39503D8C256B97730043A9DF /* SMReportImageCell.h */,
39503D8D256B97730043A9DF /* SMReportImageCell.m */,
39503FAD256FB2D700127A05 /* SMReportProjectCell.h */,
39503FAE256FB2D700127A05 /* SMReportProjectCell.m */,
394C379A2575E5030034317A /* SMReportAddProjectView.h */,
394C379B2575E5030034317A /* SMReportAddProjectView.m */,
394C37A82576118E0034317A /* SMReportAddSchemeView.h */,
394C37A92576118E0034317A /* SMReportAddSchemeView.m */,
394C37B125763B1D0034317A /* SMReportEditSchemeView.h */,
394C37B225763B1D0034317A /* SMReportEditSchemeView.m */,
394EE0102565179600BA95C7 /* SMPageControl.h */,
394EE00F2565179600BA95C7 /* SMPageControl.m */,
394C9AF6257A03E50034BFAF /* SMClientListModel.h */,
394C9AF7257A03E50034BFAF /* SMClientListModel.m */,
394C9AFA257A0E830034BFAF /* SMClientDetailViewController.h */,
394C9AFB257A0E830034BFAF /* SMClientDetailViewController.m */,
394C9AFE257A1ACD0034BFAF /* SMClientDetailCell.h */,
394C9AFF257A1ACD0034BFAF /* SMClientDetailCell.m */,
395E9A22257F2A8400F1EB4E /* SMCheckOilBGView.h */,
395E9A23257F2A8400F1EB4E /* SMCheckOilBGView.m */,
395E9A26257F4EEE00F1EB4E /* SMShowImageView.h */,
395E9A27257F4EEE00F1EB4E /* SMShowImageView.m */,
395E9A2A257F515B00F1EB4E /* SMShowImageCell.h */,
395E9A2B257F515B00F1EB4E /* SMShowImageCell.m */,
394F19D3258C554900A0227F /* SMTempCell.h */,
394F19D4258C554900A0227F /* SMTempCell.m */,
3968EA582589BB5F00ED3FA0 /* SMClientDetailModel.h */,
3968EA592589BB5F00ED3FA0 /* SMClientDetailModel.m */,
39628EEE25AD774E00A1A588 /* SMShowOriginalImageView.h */,
39628EEF25AD774E00A1A588 /* SMShowOriginalImageView.m */,
);
path = Client;
sourceTree = "<group>";
};
3973A9F725A6A1ED0034589A /* aiclass */ = {
isa = PBXGroup;
children = (
3973A9FA25A6A1ED0034589A /* BlockedPore.cpp */,
3973A9FE25A6A1ED0034589A /* BlockedPore.h */,
3973A9F825A6A1ED0034589A /* brown.cpp */,
3973A9FB25A6A1ED0034589A /* brown.h */,
3973A9FC25A6A1ED0034589A /* roughPore.cpp */,
3973A9FD25A6A1ED0034589A /* roughPore.h */,
3973A9FF25A6A1ED0034589A /* wrinkle.cpp */,
3973A9F925A6A1ED0034589A /* wrinkle.h */,
3973AC1625A711330034589A /* SMAIImageTool.h */,
3973AC1725A711330034589A /* SMAIImageTool.mm */,
);
path = aiclass;
sourceTree = "<group>";
};
39BBECE3255255340008A569 /* Account */ = {
isa = PBXGroup;
children = (
39BBECDA255253960008A569 /* SMLoginView.h */,
39BBECDB255253960008A569 /* SMLoginView.m */,
39A3A9D32552B7A40072D427 /* SMRegistView.h */,
39A3A9D42552B7A40072D427 /* SMRegistView.m */,
39A3A9BE255290050072D427 /* SMRInputPhoneView.h */,
39A3A9BF255290050072D427 /* SMRInputPhoneView.m */,
39A3A9C3255291210072D427 /* SMRVerificationCodeView.h */,
39A3A9C4255291210072D427 /* SMRVerificationCodeView.m */,
39A3A9CB2552A1370072D427 /* SMRSetPwdView.h */,
39A3A9CC2552A1370072D427 /* SMRSetPwdView.m */,
395543F12553A55A00327643 /* SMRCompleteView.h */,
395543F22553A55A00327643 /* SMRCompleteView.m */,
394D6DB22556371600C8BF31 /* SMEditShopInfoViewController.h */,
394D6DB32556371600C8BF31 /* SMEditShopInfoViewController.m */,
3948C70F2578C3E400CB5AF1 /* SMShopInfoModel.h */,
3948C7102578C3E400CB5AF1 /* SMShopInfoModel.m */,
394D6DB62556449300C8BF31 /* SMESPhoneView.h */,
394D6DB72556449300C8BF31 /* SMESPhoneView.m */,
394D6DBA2556496600C8BF31 /* SMESEditView.h */,
394D6DBB2556496600C8BF31 /* SMESEditView.m */,
);
path = Account;
sourceTree = "<group>";
};
74F6E452E947B9A8645B0751 /* Pods */ = {
isa = PBXGroup;
children = (
DB077C55553F1970EBDFFD8B /* Pods-SkinMagnifier.debug.xcconfig */,
A16643641E608F86629335F1 /* Pods-SkinMagnifier.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
C31BE4820A0C2A1CC5275062 /* Frameworks */ = {
isa = PBXGroup;
children = (
394933AB25876DDF00EA25EB /* NetworkExtension.framework */,
39E88EA52580A65D00AD5FE0 /* ExternalAccessory.framework */,
84CEFD4505D84144683BD801 /* Pods_SkinMagnifier.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
3916A39C255243E200C94453 /* SkinMagnifier */ = {
isa = PBXNativeTarget;
buildConfigurationList = 3916A3B6255243E300C94453 /* Build configuration list for PBXNativeTarget "SkinMagnifier" */;
buildPhases = (
D000784EB8E6D93F511A4C94 /* [CP] Check Pods Manifest.lock */,
3916A399255243E200C94453 /* Sources */,
3916A39A255243E200C94453 /* Frameworks */,
3916A39B255243E200C94453 /* Resources */,
ECADA2C4BDF20D1971364A35 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = SkinMagnifier;
productName = SkinMagnifier;
productReference = 3916A39D255243E200C94453 /* SkinMagnifier.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
3916A395255243E200C94453 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1200;
TargetAttributes = {
3916A39C255243E200C94453 = {
CreatedOnToolsVersion = 12.0.1;
};
};
};
buildConfigurationList = 3916A398255243E200C94453 /* Build configuration list for PBXProject "SkinMagnifier" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
"zh-Hans",
);
mainGroup = 3916A394255243E200C94453;
productRefGroup = 3916A39E255243E200C94453 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
3916A39C255243E200C94453 /* SkinMagnifier */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
3916A39B255243E200C94453 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3909C1CE259C654300463D9E /* lanch_loin_icon@3x.png in Resources */,
391E925C25B130FE00D832BE /* weidu.json in Resources */,
FACEE2692591FB4100B4DBEC /* lanch_login_bg@2x.png in Resources */,
395E9A33257F9D3F00F1EB4E /* ysfa.json in Resources */,
3909C1CD259C654300463D9E /* lanch_loin_icon@2x.png in Resources */,
FACEE2682591FB4100B4DBEC /* lanch_login_bg@3x.png in Resources */,
3916A3B0255243E300C94453 /* LaunchScreen.storyboard in Resources */,
3916A3AD255243E300C94453 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
D000784EB8E6D93F511A4C94 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-SkinMagnifier-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
ECADA2C4BDF20D1971364A35 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-SkinMagnifier/Pods-SkinMagnifier-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-SkinMagnifier/Pods-SkinMagnifier-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SkinMagnifier/Pods-SkinMagnifier-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
3916A399255243E200C94453 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
39503D86256B65E50043A9DF /* SMReportHeaderCell.m in Sources */,
396BB6802554E8B000191430 /* SMClientViewController.m in Sources */,
3948C7112578C3E400CB5AF1 /* SMShopInfoModel.m in Sources */,
3973AC1825A711330034589A /* SMAIImageTool.mm in Sources */,
39BBECDC255253960008A569 /* SMLoginView.m in Sources */,
3916A3A2255243E200C94453 /* AppDelegate.m in Sources */,
396BB68525551E0400191430 /* SMSearchBar.m in Sources */,
39A3A9D52552B7A40072D427 /* SMRegistView.m in Sources */,
395275802580BF3500CE2569 /* SMAgreementView.m in Sources */,
395543F32553A55A00327643 /* SMRCompleteView.m in Sources */,
3916A3B3255243E300C94453 /* main.m in Sources */,
396BB68D2555323300191430 /* SMCreateClientViewController.m in Sources */,
3973AC1425A6F01D0034589A /* SMReportSymptomCell.m in Sources */,
395E9A24257F2A8400F1EB4E /* SMCheckOilBGView.m in Sources */,
394C9AF8257A03E50034BFAF /* SMClientListModel.m in Sources */,
39BBECD6255251970008A569 /* SMHomeViewController.m in Sources */,
394C379C2575E5030034317A /* SMReportAddProjectView.m in Sources */,
394C9AE62579D3CE0034BFAF /* MMLocalDataBManager.m in Sources */,
39503D8A256B8BC20043A9DF /* SMReportSchemeCell.m in Sources */,
394C9B00257A1ACD0034BFAF /* SMClientDetailCell.m in Sources */,
39411ED72577688C00F43547 /* JFBaseModel.m in Sources */,
39411ED32577668D00F43547 /* JFResponseModel.m in Sources */,
39A3A9D12552A8EF0072D427 /* SMDownView.m in Sources */,
39A3A9C0255290050072D427 /* SMRInputPhoneView.m in Sources */,
396BB689255528EE00191430 /* SMClientCell.m in Sources */,
394D6DB42556371600C8BF31 /* SMEditShopInfoViewController.m in Sources */,
399A69DB255D17EA00F88603 /* SMLinkDeviceView.m in Sources */,
394F19D5258C554900A0227F /* SMTempCell.m in Sources */,
39A3A9B2255257160072D427 /* SMBase.m in Sources */,
3948C70D2578B47C00CB5AF1 /* MTRegisterAreaModel.m in Sources */,
3948C7052578853300CB5AF1 /* SMGlobalModel.m in Sources */,
39C0AA63257E62A700A3C988 /* SMReportOilCell.m in Sources */,
3973AA0125A6A1ED0034589A /* BlockedPore.cpp in Sources */,
395E9A2C257F515B00F1EB4E /* SMShowImageCell.m in Sources */,
39503D8E256B97730043A9DF /* SMReportImageCell.m in Sources */,
39514ACE2582138000A6C5D0 /* SMYZMView.m in Sources */,
3933672E260DB343007BCBEA /* SMConfigWIFIView.m in Sources */,
39A3A9CD2552A1370072D427 /* SMRSetPwdView.m in Sources */,
394D6DB82556449300C8BF31 /* SMESPhoneView.m in Sources */,
394C9AFC257A0E830034BFAF /* SMClientDetailViewController.m in Sources */,
394D6DBC2556496600C8BF31 /* SMESEditView.m in Sources */,
394C9AEA2579D3EB0034BFAF /* MMAutoUploadTool.m in Sources */,
394EE00D25650AB400BA95C7 /* SMReportViewController.m in Sources */,
395E9A28257F4EEE00F1EB4E /* SMShowImageView.m in Sources */,
394C37B325763B1D0034317A /* SMReportEditSchemeView.m in Sources */,
39628EF025AD774E00A1A588 /* SMShowOriginalImageView.m in Sources */,
3949AB7C256DF73700EA3C45 /* DKSocket.m in Sources */,
395E9A20257F29C000F1EB4E /* RippleView.m in Sources */,
3973AA0225A6A1ED0034589A /* roughPore.cpp in Sources */,
39BBECD2255251110008A569 /* SMNavigationController.m in Sources */,
39503F9C256F835400127A05 /* SMShowTextView.m in Sources */,
3948C7092578B47200CB5AF1 /* MTRAreaPickView.m in Sources */,
3973AC0F25A6D9170034589A /* SMRaderMapCompleteView.m in Sources */,
3973AA0025A6A1ED0034589A /* brown.cpp in Sources */,
39411ECF2577664C00F43547 /* UIView+Request.m in Sources */,
395543F72553C89C00327643 /* SMCountDownButton.m in Sources */,
39C374F4257DC88900782673 /* SMLocalReportBManager.m in Sources */,
3959BD5E256369D300240A36 /* SMTakeImageViewController.m in Sources */,
39A3A9C5255291210072D427 /* SMRVerificationCodeView.m in Sources */,
3949AB8F256E298900EA3C45 /* DKCmdTool.m in Sources */,
39503FAF256FB2D700127A05 /* SMReportProjectCell.m in Sources */,
3973AA0325A6A1ED0034589A /* wrinkle.cpp in Sources */,
3949AB7D256DF73700EA3C45 /* DKWIFIVideoView.m in Sources */,
394EE0112565179600BA95C7 /* SMPageControl.m in Sources */,
3968EA5A2589BB5F00ED3FA0 /* SMClientDetailModel.m in Sources */,
394C37AA2576118E0034317A /* SMReportAddSchemeView.m in Sources */,
394EE0092564F2F300BA95C7 /* SMEditPositionNameView.m in Sources */,
39500FD62558E73D000B7157 /* SMDateKeyBoardView.m in Sources */,
39C374FF257DC9B000782673 /* SMLocalReportModel.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
3916A3AE255243E300C94453 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
3916A3AF255243E300C94453 /* Base */,
3933E82925AFDCCF004A2CE4 /* zh-Hans */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
3916A3B4255243E300C94453 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
EXCLUDED_ARCHS = "";
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
3916A3B5255243E300C94453 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
3916A3B7255243E300C94453 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = DB077C55553F1970EBDFFD8B /* Pods-SkinMagnifier.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = SkinMagnifier/SkinMagnifier.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 7;
DEVELOPMENT_TEAM = 8Z4G7AGK6D;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SRCROOT)/SkinMagnifier/PrefixHeader.pch";
INFOPLIST_FILE = SkinMagnifier/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.2;
PRODUCT_BUNDLE_IDENTIFIER = com.hoyar.moremesfj;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
};
3916A3B8255243E300C94453 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = A16643641E608F86629335F1 /* Pods-SkinMagnifier.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = SkinMagnifier/SkinMagnifier.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 7;
DEVELOPMENT_TEAM = 8Z4G7AGK6D;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SRCROOT)/SkinMagnifier/PrefixHeader.pch";
INFOPLIST_FILE = SkinMagnifier/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.2;
PRODUCT_BUNDLE_IDENTIFIER = com.hoyar.moremesfj;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
TARGETED_DEVICE_FAMILY = 1;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
3916A398255243E200C94453 /* Build configuration list for PBXProject "SkinMagnifier" */ = {
isa = XCConfigurationList;
buildConfigurations = (
3916A3B4255243E300C94453 /* Debug */,
3916A3B5255243E300C94453 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
3916A3B6255243E300C94453 /* Build configuration list for PBXNativeTarget "SkinMagnifier" */ = {
isa = XCConfigurationList;
buildConfigurations = (
3916A3B7255243E300C94453 /* Debug */,
3916A3B8255243E300C94453 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 3916A395255243E200C94453 /* Project object */;
}
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3916A39C255243E200C94453"
BuildableName = "SkinMagnifier.app"
BlueprintName = "SkinMagnifier"
ReferencedContainer = "container:SkinMagnifier.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3916A39C255243E200C94453"
BuildableName = "SkinMagnifier.app"
BlueprintName = "SkinMagnifier"
ReferencedContainer = "container:SkinMagnifier.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3916A39C255243E200C94453"
BuildableName = "SkinMagnifier.app"
BlueprintName = "SkinMagnifier"
ReferencedContainer = "container:SkinMagnifier.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:SkinMagnifier.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
//
// SMESEditView.h
// SkinMagnifier
//
// Created by nana on 2020/11/7.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMESEditView : UIView
@property(nonatomic, strong)void (^Nextblock)(NSString *phone);
@end
NS_ASSUME_NONNULL_END
//
// SMESEditView.m
// SkinMagnifier
//
// Created by nana on 2020/11/7.
//
#import "SMESEditView.h"
@interface SMESEditView()
@property(nonatomic, weak)UITextField *telTF ;
@property(nonatomic, weak)UIButton *nextBtn;
@end
@implementation SMESEditView
- (instancetype)init
{
self = [super init];
if (self) {
[self setupUI];
}
return self;
}
- (void)setupUI {
UIView *contView = [[UIView alloc] init];
contView.backgroundColor = rgba(255, 255, 255, 1);
contView.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.17].CGColor;
contView.layer.shadowOffset = CGSizeMake(0,4);
contView.layer.shadowOpacity = 1;
contView.layer.shadowRadius = 30;
[self addSubview:contView];
[contView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(safaTop(64.5) );
make.left.bottom.right.mas_equalTo(0);
}];
UIView *hLineView = [[UIView alloc] init];
hLineView.backgroundColor = rgba(239, 239, 239, 1);
hLineView.layer.cornerRadius = 1;
[contView addSubview:hLineView];
[hLineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.top.mas_equalTo(17);
make.size.mas_equalTo(CGSizeMake(39.5, 2));
}];
UILabel *XinTipsLabel = [[UILabel alloc] init];
XinTipsLabel.attributedText = createAttString(@"设置新手机号", 25, rgba(76, 74, 66, 1));
[contView addSubview:XinTipsLabel];
[XinTipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(45);
make.top.mas_equalTo(53);
}];
UILabel *xinInputTipsLabel = [[UILabel alloc] init];
xinInputTipsLabel.attributedText = createAttString(@"请输入您当前门店要绑定的手机号", 14, rgba(153, 153, 153, 1));
[contView addSubview:xinInputTipsLabel];
[xinInputTipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(45);
make.top.mas_equalTo(94.5);
}];
UITextField *telHeaderTF = [[UITextField alloc] init];
telHeaderTF.userInteractionEnabled = NO;
telHeaderTF.attributedText = createAttString(@"+86", 14, rgba(185, 185, 185, 1));
[contView addSubview:telHeaderTF];
[telHeaderTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(45);
make.top.mas_equalTo(164.5);
}];
UIView *telSlineView = [[UIView alloc] init];
telSlineView.backgroundColor = rgba(255, 124, 78, 1);
telSlineView.layer.cornerRadius = 0.5;
[contView addSubview:telSlineView];
[telSlineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(87);
make.centerY.equalTo(telHeaderTF);
make.height.mas_equalTo(26);
make.width.mas_equalTo(1);
}];
UITextField *telTF = [[UITextField alloc] init];
[telTF addTarget:self action:@selector(txtChnage:) forControlEvents:UIControlEventEditingChanged];
_telTF = telTF;
telTF.attributedPlaceholder = createAttString(@"请输入手机号", 18, rgba(185, 185, 185, 1));
[contView addSubview:telTF];
[telTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(89);
make.centerY.equalTo(telHeaderTF);
make.right.mas_equalTo(-45);
make.height.mas_equalTo(26);
}];
UIView *telLineView = [[UIView alloc] init];
telLineView.backgroundColor = rgba(229, 229, 229, 1);
telLineView.layer.cornerRadius = 0.5;
[contView addSubview:telLineView];
[telLineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(45);
make.right.mas_equalTo(-45);
make.height.mas_equalTo(1);
make.top.equalTo(telHeaderTF.mas_bottom).offset(14);
}];
UIButton *nextBtn = [[UIButton alloc] init];
_nextBtn = nextBtn;
[nextBtn addTarget:self action:@selector(nextBtnClick:) forControlEvents:UIControlEventTouchUpInside];
nextBtn.userInteractionEnabled = NO;
nextBtn.selected = YES;
[nextBtn setAttributedTitle: createAttString(@"下一步", 15, rgba(255, 255, 255, 1)) forState:UIControlStateNormal];
[nextBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 124, 78, 1) size:CGSizeMake(225.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] forState:UIControlStateNormal];
[nextBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 200, 180, 1) size:CGSizeMake(225.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] forState:UIControlStateSelected];
[contView addSubview:nextBtn];
[nextBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(telLineView.mas_bottom).offset(30);
make.centerX.mas_equalTo(0);
}];
}
- (void)txtChnage:(UITextField *)tf {
if (tf.text.length != 11) {
self.nextBtn.selected = YES;
self.nextBtn.userInteractionEnabled = NO;
}else {
self.nextBtn.selected = NO;
self.nextBtn.userInteractionEnabled = YES;
}
}
- (void)nextBtnClick:(UIButton *)btn {
if (self.Nextblock) {
self.Nextblock(self.telTF.text);
}
}
@end
//
// SMESPhoneView.h
// SkinMagnifier
//
// Created by nana on 2020/11/7.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMESPhoneView : UIView
@property(nonatomic, strong)void (^saveBlock)(NSString *phone);
- (void)checkCodeWithPhone:(NSString *)phone;
@end
NS_ASSUME_NONNULL_END
//
// SMESPhoneView.m
// SkinMagnifier
//
// Created by nana on 2020/11/7.
//
#import "SMESPhoneView.h"
#import "SMRVerificationCodeView.h"
#import "SMDownView.h"
#import "SMESEditView.h"
@interface SMESPhoneView()
@property(nonatomic, strong)SMRVerificationCodeView *vcView;
@property(nonatomic, strong)SMESEditView *eView;
@property(nonatomic, strong)NSString *phone;
@end
@implementation SMESPhoneView
- (instancetype)init
{
self = [super init];
if (self) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.backgroundColor = rgba(0, 0, 0, 0.3);
CGSize sSize = [UIScreen mainScreen].bounds.size;
self.eView = [[SMESEditView alloc] init];
self.eView.frame = CGRectMake(0,0,sSize.width,sSize.height);
[self addSubview:self.eView];
self.vcView = [[SMRVerificationCodeView alloc] init];
self.vcView.hidden = YES;
self.vcView.frame = CGRectMake(0,0,sSize.width,sSize.height);
[self addSubview:self.vcView];
SMDownView *downView = [[SMDownView alloc] init];
downView.frame = CGRectMake(0, 0,sSize.width, 104.5);
[self addSubview:downView];
@weakify(self);
self.vcView.endInputCodeBlock = ^(NSString * _Nonnull code) {
@strongify(self);
self.saveBlock(self.phone);
[self wb_disMiss];
};
self.eView.Nextblock = ^(NSString * _Nonnull phone) {
@strongify(self);
self.phone = phone;
self.vcView.hidden = NO;
[self.vcView checkCodeWithPhone:phone];
};
}
- (void)checkCodeWithPhone:(NSString *)phone {
}
@end
//
// SMEditShopInfoViewController.h
// SkinMagnifier
//
// Created by nana on 2020/11/7.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMEditShopInfoViewController : UIViewController
@property(nonatomic, strong)void (^saveBlock)(NSString *dname);
@end
NS_ASSUME_NONNULL_END
//
// SMEditShopInfoViewController.m
// SkinMagnifier
//
// Created by nana on 2020/11/7.
//
#import "SMEditShopInfoViewController.h"
#import "SMESPhoneView.h"
#import "MTRAreaPickView.h"
#import "SMShopInfoModel.h"
@interface SMEditShopInfoViewController ()
@property(nonatomic, strong)NSMutableArray *labelArray;
@property(nonatomic, strong)UIButton *areaBtn;
@property(nonatomic, strong)UITextField *addressTF;
@property(nonatomic, strong)UITextField *shopNameTF;
@property(nonatomic, strong)UITextField *shopUserTF;
@property(nonatomic, strong)UIButton *editPhoneBtn;
@property(nonatomic, strong)UILabel *phoneLabel;
@property(nonatomic, strong)UIButton *saveBtn;
@property(nonatomic, strong)MTRAreaPickView *addressPickView;
//@property(nonatomic, assign)NSInteger province;
//@property(nonatomic, assign)NSInteger city;
//@property(nonatomic, assign)NSInteger district;
@property(nonatomic, strong)SMShopInfoModel *shopInfoModel;
@end
@implementation SMEditShopInfoViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.addressPickView = [[MTRAreaPickView alloc] init];
self.view.backgroundColor =[UIColor whiteColor];
self.wb_titleLabel.text = @"编辑门店信息";
NSArray *tipsArray = [@"所属地区,门店地址,门店名称,门店联系人,绑定手机号" componentsSeparatedByString:@","];
self.labelArray = [[NSMutableArray alloc] init];
[self createViewWithNameArray:tipsArray firstTop:safaTop(93)];
for (int i = 0; i < self.labelArray.count; i++) {
UILabel *label = self.labelArray[i];
if (i == 0) {
UIButton *areaBtn = [[UIButton alloc] init];
_areaBtn = areaBtn;
[areaBtn setAttributedTitle:createAttString(@"未填写", 14, rgba(185, 185, 185, 1)) forState:UIControlStateNormal];
[areaBtn addTarget:self.addressPickView action:@selector(show) forControlEvents:UIControlEventTouchUpInside];
[areaBtn wb_setImageName:@"customer_icon_xyb"];
areaBtn.imageEdgeInsets = UIEdgeInsetsMake(0, -4.5, 0, 4.5);
[areaBtn wb_setRightImage];
[self.view addSubview:areaBtn];
[areaBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(label);
make.right.mas_equalTo(-22);
}];
}else if (i == 1) {
// UIButton *addressBtn = [[UIButton alloc] init];
// [addressBtn setAttributedTitle:createAttString(@"未填写", 14, rgba(185, 185, 185, 1)) forState:UIControlStateNormal];
// [addressBtn wb_setImageName:@"customer_icon_xyb"];
// addressBtn.imageEdgeInsets = UIEdgeInsetsMake(0, -4.5, 0, 4.5);
// [addressBtn wb_setRightImage];
// [self.view addSubview:addressBtn];
// [addressBtn mas_makeConstraints:^(MASConstraintMaker *make) {
// make.centerY.equalTo(label);
// make.right.mas_equalTo(-22);
// }];
UITextField *addressTF = [[UITextField alloc] init];
addressTF.textColor = rgba(76, 74, 66, 1);
addressTF.font = [UIFont systemFontOfSize:14];
addressTF.textAlignment = NSTextAlignmentRight;
_addressTF = addressTF;
addressTF.attributedPlaceholder = createAttString(@"未填写", 14, rgba(185, 185, 185, 1));
[self.view addSubview:addressTF];
[addressTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(label);
make.left.mas_equalTo(100);
make.right.mas_equalTo(-22);
}];
}else if (i == 2) {
UITextField *shopNameTF = [[UITextField alloc] init];
shopNameTF.textColor = rgba(76, 74, 66, 1);
shopNameTF.font = [UIFont systemFontOfSize:14];
shopNameTF.textAlignment = NSTextAlignmentRight;
_shopNameTF = shopNameTF;
shopNameTF.attributedPlaceholder = createAttString(@"未填写", 14, rgba(185, 185, 185, 1));
[self.view addSubview:shopNameTF];
[shopNameTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(label);
make.left.mas_equalTo(100);
make.right.mas_equalTo(-22);
}];
}else if (i == 3) {
UITextField *shopUserTF = [[UITextField alloc] init];
shopUserTF.textColor = rgba(76, 74, 66, 1);
shopUserTF.font = [UIFont systemFontOfSize:14];
shopUserTF.textAlignment = NSTextAlignmentRight;
_shopUserTF = shopUserTF;
shopUserTF.attributedPlaceholder = createAttString(@"未填写", 14, rgba(185, 185, 185, 1));
[self.view addSubview:shopUserTF];
[shopUserTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(label);
make.right.mas_equalTo(100);
make.right.mas_equalTo(-22);
}];
}else if (i == 4) {
// UIImage *norImage = [[UIImage wb_imageWithColor:[UIColor whiteColor] size:CGSizeMake(48, 26)] sd_roundedCornerImageWithRadius:13 corners:0xff borderWidth:0.5 borderColor:rgba(255, 124, 78, 1)];
//// UIImage *selImage = [[UIImage wb_imageWithColor:rgba(255, 124, 78, 1) size:CGSizeMake(75.5, 26)] sd_roundedCornerImageWithRadius:13 corners:0xff borderWidth:0.5 borderColor:rgba(255, 124, 78, 1)];
//
// UIButton *editPhoneBtn = [[UIButton alloc] init];
// _editPhoneBtn = editPhoneBtn;
// [editPhoneBtn setAttributedTitle:createAttString(@"修改", 14, rgba(255, 124, 78, 1)) forState:UIControlStateNormal];
// [editPhoneBtn setAttributedTitle:createAttString(@"修改", 14, [UIColor whiteColor]) forState:UIControlStateSelected];
// [editPhoneBtn addTarget:self action:@selector(editPhoneBtnClick:) forControlEvents:UIControlEventTouchUpInside];
// [editPhoneBtn setBackgroundImage:norImage forState:UIControlStateNormal];
//// [boyBtn setBackgroundImage:selImage forState:UIControlStateSelected];
// [self.view addSubview:editPhoneBtn];
// [editPhoneBtn mas_makeConstraints:^(MASConstraintMaker *make) {
// make.centerY.equalTo(label);
// make.right.mas_equalTo(-22);
// }];
UILabel *phoneLabel = [[UILabel alloc] init];
_phoneLabel = phoneLabel;
// phoneLabel.attributedText = createAttString(@"131555555", 13, rgba(76, 74, 66, 1));
[self.view addSubview:phoneLabel];
[phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(label);
// make.right.equalTo(editPhoneBtn.mas_left).offset(-10);
make.right.mas_equalTo(-22);
}];
}
}
UIButton *saveBtn = [[UIButton alloc] init];
_saveBtn = saveBtn;
[saveBtn setAttributedTitle:createAttString(@"保存", 15, rgba(255, 255, 255, 1)) forState:UIControlStateNormal];
[saveBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 124, 78, 1) size:CGSizeMake(225.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] forState:UIControlStateNormal];
[saveBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 200, 180, 1) size:CGSizeMake(225.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] forState:UIControlStateSelected];
[saveBtn addTarget:self action:@selector(saveBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:saveBtn];
[saveBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(safaBottom(-50));
make.centerX.mas_equalTo(0);
}];
[self requestData];
@weakify(self);
self.addressPickView.selectCityBlock = ^(NSInteger province, NSInteger city, NSInteger district, NSString * _Nonnull resultStr) {
@strongify(self);
self.shopInfoModel.arearegion = [NSString stringWithFormat:@"%ld",district];
self.shopInfoModel.areaprovince = [NSString stringWithFormat:@"%ld",province];
self.shopInfoModel.areacity = [NSString stringWithFormat:@"%ld",district];
self.shopInfoModel.areatxt = resultStr;
[self.areaBtn setAttributedTitle:createAttString(resultStr, 14, rgba(76, 74, 66, 1)) forState:UIControlStateNormal];
};
}
- (void)requestData {
NSMutableDictionary *pdict = [[NSMutableDictionary alloc] init];
pdict[@"mid"] = [SMGlobalModel share].mid;
@weakify(self);
[self.view postFormDataWithUrl:@"/magnifier/member/findMemberInfoById" params:pdict success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
NSLog(@"%@",JsonData);
@strongify(self);
if ([JsonData.code isEqualToString:@"200"] && [JsonData.data isKindOfClass:[NSDictionary class]]) {
NSDictionary *dataDict = (NSDictionary *)JsonData.data;
self.shopInfoModel = [SMShopInfoModel mj_objectWithKeyValues:dataDict];
if (![dataDict[@"areatxt"] isKindOfClass:[NSNull class]]) {
[self.areaBtn setAttributedTitle:createAttString(dataDict[@"areatxt"], 14, rgba(76, 74, 66, 1)) forState:UIControlStateNormal];
}
if (![dataDict[@"address"] isKindOfClass:[NSNull class]]) {
self.addressTF.attributedText = createAttString(dataDict[@"address"], 14, rgba(76, 74, 66, 1));
}
if (![dataDict[@"dmname"] isKindOfClass:[NSNull class]]) {
self.shopNameTF.attributedText = createAttString(dataDict[@"dmname"], 14, rgba(76, 74, 66, 1));
}
if (![dataDict[@"lxname"] isKindOfClass:[NSNull class]]) {
self.shopUserTF.attributedText = createAttString(dataDict[@"lxname"], 14, rgba(76, 74, 66, 1));
}
if (![dataDict[@"phone"] isKindOfClass:[NSNull class]]) {
NSString *phone = dataDict[@"phone"];
phone = privacyString(phone, 3, 4, @"*");
self.phoneLabel.attributedText = createAttString(phone, 14, rgba(76, 74, 66, 1));
}
}
}];
}
- (void)createViewWithNameArray:(NSArray *)nameArray firstTop:(CGFloat)firstTop{
UIView *lastView = nil;
for (int i = 0; i < nameArray.count; i++) {
UILabel *nameLabel = [[UILabel alloc] init];
nameLabel.attributedText = createAttString(nameArray[i], 15, rgba(76, 74, 66, 1));
[self.view addSubview:nameLabel];
[nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
if (i == 0) {
make.top.mas_equalTo(firstTop);
}else {
make.top.equalTo(lastView.mas_bottom).offset(18);
};
make.left.mas_equalTo(20);
}];
[self.labelArray addObject:nameLabel];
UIView *lineView = [[UIView alloc] init];
lineView.backgroundColor = rgba(229, 229, 229, 1);
[self.view addSubview:lineView];
[lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(20.5);
make.right.mas_equalTo(-22);
make.top.equalTo(nameLabel.mas_bottom).offset(17.5);
make.height.mas_equalTo(0.5);
}];
lastView =lineView;
}
}
- (void)saveBtnClick:(UIButton *)btn {
self.shopInfoModel.address = self.addressTF.text;
self.shopInfoModel.dmname = self.shopNameTF.text;
self.shopInfoModel.lxname = self.shopUserTF.text;
if (!self.shopInfoModel.areatxt.length) {
[SVProgressHUD showErrorWithStatus:@"地区不能为空"];
return;
}
if (self.shopInfoModel.address.length > 40) {
[SVProgressHUD showErrorWithStatus:@"地址不能超过40个字"];
return;
}
if ([self.shopInfoModel.address containsEmoji]) {
[SVProgressHUD showErrorWithStatus:@"地址不能输入表情"];
return;
}
if (!self.shopInfoModel.address.length) {
[SVProgressHUD showErrorWithStatus:@"地址不能为空"];
return;
}
if (self.shopInfoModel.dmname.length > 50) {
[SVProgressHUD showErrorWithStatus:@"门店名称不能超过50个字"];
return;
}
if ([self.shopInfoModel.dmname containsEmoji]) {
[SVProgressHUD showErrorWithStatus:@"门店名称不能输入表情"];
return;
}
if (!self.shopInfoModel.dmname.length) {
[SVProgressHUD showErrorWithStatus:@"门店名称不能为空"];
return;
}
if (self.shopInfoModel.lxname.length > 20) {
[SVProgressHUD showErrorWithStatus:@"门店联系人不能超过20个字"];
return;
}
if ([self.shopInfoModel.lxname containsEmoji]) {
[SVProgressHUD showErrorWithStatus:@"门店联系人不能输入表情"];
return;
}
if (!self.shopInfoModel.lxname.length) {
[SVProgressHUD showErrorWithStatus:@"门店联系人不能为空"];
return;
}
NSMutableDictionary *pDict = [[NSMutableDictionary alloc] init];
pDict[@"id"] = [SMGlobalModel share].mid; //门店id
pDict[@"areacity"] = self.shopInfoModel.areacity; //市的id
pDict[@"areaprovince"] = self.shopInfoModel.areaprovince; //省的id
pDict[@"arearegion"] = self.shopInfoModel.arearegion; //区的id
pDict[@"areatxt"] = self.shopInfoModel.areatxt; //省市区连起来的文字
pDict[@"address"] = self.shopInfoModel.address; //详细地址(门店地址)
pDict[@"dmname"] = self.shopInfoModel.dmname; //店面名称
pDict[@"lxname"] = self.shopInfoModel.lxname; //联系人
pDict[@"phone"] = self.shopInfoModel.phone; //手机号
@weakify(self);
[self.view postFormDataWithUrl:@"/magnifier/member/updateMember" params:pDict success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
@strongify(self);
if ([JsonData.code isEqualToString:@"200"]) {
if (self.saveBlock) {
self.saveBlock( self.shopInfoModel.dmname);
}
[self.navigationController popViewControllerAnimated:YES];
}
}];
}
- (void)editPhoneBtnClick:(UIButton *)btn {
SMESPhoneView *rView = [[SMESPhoneView alloc] init];
@weakify(self);
rView.saveBlock = ^(NSString * _Nonnull phone) {
@strongify(self);
self.shopInfoModel.phone = phone;
self.phoneLabel.attributedText = createAttString( privacyString(phone, 3, 4, @"*"),13, rgba(76, 74, 66, 1)) ;
};
[rView checkCodeWithPhone:self.phoneLabel.text];
[rView wb_showFromSuperView:self.view];
}
@end
//
// SMLoginView.h
// SkinMagnifier
//
// Created by nana on 2020/11/4.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMLoginView : UIView
@property(nonatomic, copy)void (^loginBlock)(NSString *account ,NSString *dmname);
@end
NS_ASSUME_NONNULL_END
//
// SMLoginView.m
// SkinMagnifier
//
// Created by nana on 2020/11/4.
//
#import "SMLoginView.h"
//#import "SMRInputPhoneView.h"
//#import "SMRVerificationCodeView.h"
#import "SMRegistView.h"
#import "SMYZMView.h"
@interface SMLoginView()
@property(nonatomic, weak)UITextField *accountTF;
@property(nonatomic, weak)UITextField *pwdTF;
@property(nonatomic, weak)SMRegistView *rView;
@property(nonatomic, weak)UIButton *registBtn;
@property(nonatomic, weak)UIButton *loginBtn;
@property(nonatomic, weak)UIButton *rememberBtn;
@end
@implementation SMLoginView
- (instancetype)init {
if (self = [super init]) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.backgroundColor = rgba(254, 254, 254, 1);
UILabel *tipsLabel = [[UILabel alloc] init];
NSDictionary *sdict = [[NSUserDefaults standardUserDefaults] objectForKey:@"saveAccountKey"];
tipsLabel.attributedText = createAttString(@"商家登录", 25,rgba(76, 74, 66, 1));;
[self addSubview:tipsLabel];
[tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(46.5);
make.top.mas_equalTo(safaTop(91) );
}];
UITextField *accountTF = [[UITextField alloc] init];
[accountTF addTarget:self action:@selector(tfTextChange:) forControlEvents:UIControlEventEditingChanged];
accountTF.attributedPlaceholder = createAttString(@"账号/手机号", 15,rgba(185, 185, 185, 1));;
_accountTF = accountTF;
[self addSubview:accountTF];
[accountTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(tipsLabel);
make.top.equalTo(tipsLabel.mas_bottom).offset(37);
make.right.mas_equalTo(-45.5);
}];
if (sdict) {
accountTF.text = sdict[@"account"];
}
UIView *accountTFLine = [[UIView alloc] init];
accountTFLine.backgroundColor = rgba(229, 229, 229, 1);
[self addSubview:accountTFLine];
[accountTFLine mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(accountTF).offset(-10);
make.top.equalTo(accountTF.mas_bottom).offset(8.5);
make.right.equalTo(accountTF).offset(8.5);
make.height.mas_equalTo(0.5);
}];
UITextField *pwdTF = [[UITextField alloc] init];
pwdTF.secureTextEntry = YES;
[pwdTF addTarget:self action:@selector(tfTextChange:) forControlEvents:UIControlEventEditingChanged];
pwdTF.attributedPlaceholder = createAttString(@"密码", 15,rgba(185, 185, 185, 1));;
[self addSubview:pwdTF];
_pwdTF = pwdTF;
[pwdTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(tipsLabel);
make.top.equalTo(accountTFLine.mas_bottom).offset(45);
make.right.mas_equalTo(-45.5);
}];
if (sdict) {
NSString *key = sdict[@"pwd"];
pwdTF.text = decryptAES128(key, @"jinhaoyang201905");
}
UIView *pwdTFLine = [[UIView alloc] init];
pwdTFLine.backgroundColor = rgba(229, 229, 229, 1);
[self addSubview:pwdTFLine];
[pwdTFLine mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(pwdTF).offset(-10);
make.top.equalTo(pwdTF.mas_bottom).offset(8.5);
make.right.equalTo(pwdTF).offset(8.5);
make.height.mas_equalTo(0.5);
}];
UIButton *showPWdBtn = [[UIButton alloc] init];
[showPWdBtn setBackgroundImage:[UIImage imageNamed:@"login_icon_yc"] forState:UIControlStateNormal];
[showPWdBtn setBackgroundImage:[UIImage imageNamed:@"login_icon_xs"] forState:UIControlStateSelected];
[showPWdBtn addTarget:self action:@selector(showPWdBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:showPWdBtn];
[showPWdBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(pwdTF);
make.right.equalTo(pwdTFLine);
}];
UIButton *rememberBtn = [[UIButton alloc] init];
_rememberBtn = rememberBtn;
[rememberBtn addTarget:self action:@selector(rememberBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[rememberBtn setAttributedTitle:createAttString(@"记住密码", 12,rgba(153, 153, 153, 1)) forState:UIControlStateNormal];
[rememberBtn setImageEdgeInsets:UIEdgeInsetsMake(0, -4.5, 0, 4.5)];
[rememberBtn wb_setImageName:@"login_jz"];
rememberBtn.selected = [sdict allKeys];
[self addSubview:rememberBtn];
[rememberBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(pwdTFLine.mas_bottom).offset(13.5);
make.right.equalTo(pwdTFLine);
}];
UIButton *loginBtn = [[UIButton alloc] init];
if (!sdict) {
loginBtn.userInteractionEnabled = NO;
loginBtn.selected = YES;
}
[loginBtn addTarget:self action:@selector(loginClick:) forControlEvents:UIControlEventTouchUpInside];
[loginBtn setAttributedTitle: createAttString(@"登录", 15,rgba(255, 255, 255, 1)) forState:UIControlStateNormal];
[loginBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 124, 78, 1) size:CGSizeMake(225.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] forState:UIControlStateNormal];
[loginBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 200, 180, 1) size:CGSizeMake(225.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] forState:UIControlStateSelected];
[self addSubview:loginBtn];
_loginBtn = loginBtn;
[loginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(pwdTFLine.mas_bottom).offset(55);
make.centerX.mas_equalTo(0);
}];
// SMYZMView *fr = [[SMYZMView alloc] init];
// fr.backgroundColor = [UIColor redColor];
// [self addSubview:fr];
// [fr mas_makeConstraints:^(MASConstraintMaker *make) {
// make.top.equalTo(loginBtn.mas_bottom).offset(10);
// make.centerX.mas_equalTo(0);
// make.size.mas_equalTo(CGSizeMake(100, 40));
// }];
UIView *bgView = [[UIView alloc] init];
bgView.backgroundColor = rgba(255, 255, 255, 1);
bgView.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.17].CGColor;
bgView.layer.shadowOffset = CGSizeMake(0,15);
bgView.layer.shadowOpacity = 1;
bgView.layer.shadowRadius = 84;
bgView.layer.cornerRadius = 6.7;
[self addSubview:bgView];
[bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.bottom.right.mas_equalTo(0);
make.height.mas_equalTo(-(safaBottom(-118.5)));
}];
UIView *gView = [[UIView alloc] init];
gView.layer.cornerRadius = 1;
gView.backgroundColor = rgba(239, 239, 239, 1);
[bgView addSubview:gView];
[gView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(2);
make.width.mas_equalTo(39);
make.centerX.mas_equalTo(0);
make.top.mas_equalTo(16.5);
}];
UILabel *xinTipsLabel = [[UILabel alloc] init];
xinTipsLabel.attributedText = createAttString(@"新用户?", 14,rgba(255, 124, 78, 1));
[bgView addSubview:xinTipsLabel];
[xinTipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(38.5);
make.left.mas_equalTo(45);
}];
UILabel *registTisLabel = [[UILabel alloc] init];
registTisLabel.attributedText = createAttString(@"注册", 25, rgba(76, 74, 66, 1));;
[bgView addSubview:registTisLabel];
[registTisLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(65.5);
make.left.mas_equalTo(45);
}];
UILongPressGestureRecognizer *longTap = [[UILongPressGestureRecognizer alloc] initWithTarget:self action: @selector(longTapClick:)];
longTap.minimumPressDuration = 0;
[bgView addGestureRecognizer:longTap];
UIButton *registBtn = [[UIButton alloc] init];
[registBtn setBackgroundImage:[UIImage imageNamed:@"login_icon_xyb"] forState:UIControlStateNormal];
[registBtn addTarget:self action:@selector(registBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:registBtn];
_registBtn = registBtn;
[registBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-45);
make.centerY.equalTo(bgView);
}];
SMRegistView *rView = [[SMRegistView alloc] init];
@weakify(self);
rView.registBlock = ^(NSString * _Nonnull account, NSString * _Nonnull dname) {
@strongify(self);
if (self.loginBlock) {
self.loginBlock(account,dname);
}
CGSize sSize = [UIScreen mainScreen].bounds.size;
self.rView.frame = CGRectMake(0,sSize.height,sSize.width, sSize.height);
};
_rView = rView;
CGSize sSize = [UIScreen mainScreen].bounds.size;
rView.frame = CGRectMake(0,sSize.height,sSize.width, sSize.height);
[self addSubview:rView];
}
- (void)tfTextChange:(UITextField *)tf {
if (self.pwdTF.text.length && self.accountTF.text.length) {
self.loginBtn.userInteractionEnabled =YES;
self.loginBtn.selected = NO;
}else {
self.loginBtn.userInteractionEnabled = NO;
self.loginBtn.selected = YES;
}
}
- (void)rememberBtnClick:(UIButton *)btn {
btn.selected = !btn.selected;
}
- (void)loginClick:(UIButton *)btn {
[self.accountTF endEditing:YES];
[self.pwdTF endEditing:YES];
NSString *account = self.accountTF.text;
NSString *pwd = self.pwdTF.text;
NSMutableDictionary *pDict = [[NSMutableDictionary alloc] init];
pDict[@"loginSign"] = md5String([NSString stringWithFormat:@"%@%@",account,pwd]);
pDict[@"account"] = account;
pDict[@"pwd"] = encryptAES128(pwd, @"jinhaoyang201905");
pDict[@"flagPwd"] =md5String([NSString stringWithFormat:@"%@jinhaoyang",md5String(pwd)]);
pDict[@"ipadVersion"] = @"1.0";
pDict[@"softVersion"] = @"1.0";
@weakify(self);
[self postFormDataWithUrl:@"/magnifier/public/login" params:pDict success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
NSLog(@"%@",JsonData );
@strongify(self);
if ([JsonData.code isEqualToString:@"200"]) {
NSDictionary *dataDict = ((NSArray *)JsonData.data).firstObject;
[SMGlobalModel share].mid = [NSString stringWithFormat:@"%@", dataDict[@"id"]];
NSMutableDictionary *sDict = [[NSMutableDictionary alloc] init];
sDict[@"account"] = account;
sDict[@"pwd"] = encryptAES128(pwd, @"jinhaoyang201905");
if (self.rememberBtn.selected) {
[[NSUserDefaults standardUserDefaults] setObject:sDict forKey:@"saveAccountKey"];
}else {
self.pwdTF.text = @"";
self.accountTF.text = @"";
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"saveAccountKey"];
}
if (self.loginBlock) {
self.loginBlock(dataDict[@"account"],dataDict[@"dmname"]);
}
}else if([JsonData.code isEqualToString:@"-46"]) {
[SVProgressHUD showErrorWithStatus:@"账号或密码错误"];
}
}];
}
- (void)longTapClick:(UILongPressGestureRecognizer *)tap {
UIWindow *window = [[[UIApplication sharedApplication] delegate] window];
CGPoint p = [tap locationInView:window];
CGRect sFrame = self.superview.frame;
switch (tap.state) {
case UIGestureRecognizerStateBegan:
break;
case UIGestureRecognizerStateEnded:
{
[UIView animateWithDuration:0.25 animations:^{
CGFloat y = 0;
if (p.y > ([UIScreen mainScreen].bounds.size.height - 300)) {
y = window.bounds.size.height;
}
self.rView.frame = CGRectMake(sFrame.origin.x, y, sFrame.size.width, sFrame.size.height);
}];
break;
}
default:
self.rView.frame = CGRectMake(0, p.y, sFrame.size.width, sFrame.size.height);
break;
}
}
- (void)showPWdBtnClick:(UIButton *)btn {
btn.selected = !btn.selected;
self.pwdTF.secureTextEntry = !btn.selected;
}
- (void)registBtnClick:(UIButton *)btn {
[UIView animateWithDuration:0.25 animations:^{
self.rView.frame = CGRectMake(0,0, self.bounds.size.width, self.bounds.size.height);
}];
}
@end
//
// SMRCompleteView.h
// SkinMagnifier
//
// Created by nana on 2020/11/5.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMRCompleteView : UIView
@property(nonatomic, copy)void (^compBlock)(void);
@end
NS_ASSUME_NONNULL_END
//
// SMRCompleteView.m
// SkinMagnifier
//
// Created by nana on 2020/11/5.
//
#import "SMRCompleteView.h"
#import "SMCountDownButton.h"
@interface SMRCompleteView ()
@property(nonatomic, weak)SMCountDownButton *cdBtn;
@end
@implementation SMRCompleteView
- (instancetype)init
{
self = [super init];
if (self) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.backgroundColor = [UIColor whiteColor];
UIView *hLineView = [[UIView alloc] init];
hLineView.backgroundColor = rgba(239, 239, 239, 1);
hLineView.layer.cornerRadius = 1;
[self addSubview:hLineView];
[hLineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.top.mas_equalTo(safaTop(17));
make.size.mas_equalTo(CGSizeMake(39.5, 2));
}];
UIImageView *tipsImageView = [UIImageView new];
tipsImageView.image = [UIImage imageNamed:@"login_icon_wc"];
[self addSubview:tipsImageView];
[tipsImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.top.mas_equalTo(safaTop(220));
}];
UILabel *tipsLabel = [[UILabel alloc] init];
tipsLabel.attributedText = createAttString(@"注册成功", 20, rgba(76, 74, 66, 1));
[self addSubview:tipsLabel];
[tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.top.equalTo(tipsImageView.mas_bottom).offset(18.5);
}];
SMCountDownButton *cdbtn = [[SMCountDownButton alloc] init];
_cdBtn = cdbtn;
@weakify(self);
__block int maxCount = 6;
cdbtn.timeBlock = ^{
@strongify(self);
maxCount--;
if (maxCount == 0) {
[self.cdBtn stopTime];
if (self.compBlock) {
self.compBlock();
}
}
NSAttributedString *btnAtt= [[NSAttributedString alloc] wb_initWithString:[NSString stringWithFormat:@"%ds进入首页",maxCount] FontSize:12 TextColor:rgba(153, 153, 153, 1)];
[self.cdBtn setAttributedTitle:btnAtt forState:UIControlStateNormal];
};
[self addSubview:cdbtn];
[cdbtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.bottom.mas_equalTo(-108);
}];
;
UIButton *homeBtn = [[UIButton alloc] init];
[homeBtn addTarget:self action:@selector(homeClick:) forControlEvents:UIControlEventTouchUpInside];
[homeBtn setAttributedTitle:createAttString(@"前往首页", 15, rgba(255, 255, 255, 1)) forState:UIControlStateNormal];
[homeBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 124, 78, 1) size:CGSizeMake(225.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] forState:UIControlStateNormal];
[homeBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 200, 180, 1) size:CGSizeMake(225.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] forState:UIControlStateSelected];
[self addSubview:homeBtn];
[homeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(-50);
make.centerX.mas_equalTo(0);
}];
[self.cdBtn startTime];
}
- (void)homeClick:(UIButton *)btn {
if (self.compBlock) {
self.compBlock();
}
}
@end
//
// SMRInputPhoneView.h
// SkinMagnifier
//
// Created by nana on 2020/11/4.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMRInputPhoneView : UIView
@property(nonatomic, copy)void (^nextBlock)(NSString *phone);
@end
NS_ASSUME_NONNULL_END
//
// SMRInputPhoneView.m
// SkinMagnifier
//
// Created by nana on 2020/11/4.
//
#import "SMRInputPhoneView.h"
#import "SMAgreementView.h"
@interface SMRInputPhoneView()
@property(nonatomic, weak)UIButton *nextBtn;
@property(nonatomic, weak)UIButton *agreenBtn;
@property(nonatomic, weak)UITextField *telTF;
@end
@implementation SMRInputPhoneView
- (instancetype)init {
if (self = [super init]) {
[self setupUI];
}
return self;
}
- (void)setupUI {
UIView *contView = [[UIView alloc] init];
contView.backgroundColor = rgba(255, 255, 255, 1);
contView.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.17].CGColor;
contView.layer.shadowOffset = CGSizeMake(0,4);
contView.layer.shadowOpacity = 1;
contView.layer.shadowRadius = 30;
[self addSubview:contView];
[contView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(safaTop(64.5) );
make.left.bottom.right.mas_equalTo(0);
}];
UIView *hLineView = [[UIView alloc] init];
hLineView.backgroundColor = rgba(239, 239, 239, 1);
hLineView.layer.cornerRadius = 1;
[contView addSubview:hLineView];
[hLineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.top.mas_equalTo(17);
make.size.mas_equalTo(CGSizeMake(39.5, 2));
}];
UILabel *sjTipsLabel = [[UILabel alloc] init];
sjTipsLabel.attributedText = createAttString(@"商家注册", 25, rgba(76, 74, 66, 1));;
[contView addSubview:sjTipsLabel];
[sjTipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(52.5);
make.left.mas_equalTo(45);
}];
UILabel *telTipsLabel = [[UILabel alloc] init];
telTipsLabel.attributedText = createAttString(@"请输入您当前门店绑定的手机号", 14, rgba(153, 153, 153, 1));
[contView addSubview:telTipsLabel];
[telTipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(94.5);
make.left.mas_equalTo(45);
}];
UITextField *telHeaderTF = [[UITextField alloc] init];
telHeaderTF.userInteractionEnabled = NO;
telHeaderTF.attributedText = createAttString(@"+86", 14, rgba(185, 185, 185, 1));
[contView addSubview:telHeaderTF];
[telHeaderTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(45);
make.top.mas_equalTo(164.5);
}];
// UIView *telSlineView = [[UIView alloc] init];
// telSlineView.backgroundColor = rgba(255, 124, 78, 1);
// telSlineView.layer.cornerRadius = 0.5;
// [contView addSubview:telSlineView];
// [telSlineView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.mas_equalTo(87);
// make.centerY.equalTo(telHeaderTF);
// make.height.mas_equalTo(26);
// make.width.mas_equalTo(1);
// }];
UITextField *telTF = [[UITextField alloc] init];
telTF.tintColor = rgba(255, 124, 78, 1);
telTF.keyboardType = UIKeyboardTypePhonePad;
[telTF addTarget:self action:@selector(textChange:) forControlEvents:UIControlEventEditingChanged];
telTF.attributedPlaceholder = createAttString(@"请输入手机号", 18, rgba(185, 185, 185, 1));
[contView addSubview:telTF];
_telTF = telTF;
[telTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(89);
make.centerY.equalTo(telHeaderTF);
make.right.mas_equalTo(-45);
make.height.mas_equalTo(26);
}];
UIView *telLineView = [[UIView alloc] init];
telLineView.backgroundColor = rgba(229, 229, 229, 1);
telLineView.layer.cornerRadius = 0.5;
[contView addSubview:telLineView];
[telLineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(45);
make.right.mas_equalTo(-45);
make.height.mas_equalTo(1);
make.top.equalTo(telHeaderTF.mas_bottom).offset(14);
}];
UIButton *agreenBtn = [[UIButton alloc] init];
[agreenBtn addTarget:self action:@selector(agreenClick:) forControlEvents:UIControlEventTouchUpInside];
// NSMutableAttributedString *aAttString = [[NSMutableAttributedString alloc] init];
// [aAttString appendAttributedString:
// ];
// [aAttString appendAttributedString:
// createAttString(@"《用户服务协议》", 12,rgba(255, 124, 78, 1))];
[agreenBtn setAttributedTitle:createAttString(@"我已阅读并同意", 12,rgba(185, 185, 185, 1)) forState:UIControlStateNormal];
[agreenBtn wb_setImageName:@"login_jz"];
[agreenBtn setImageEdgeInsets:UIEdgeInsetsMake(0, -4.5, 0, 4.5)];
[contView addSubview:agreenBtn];
_agreenBtn = agreenBtn;
[agreenBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(45);
make.top.equalTo(telLineView.mas_bottom).offset(13.5);
}];
UIButton *xieyiBtn = [[UIButton alloc] init];
[xieyiBtn addTarget:self action:@selector(xieyiClick:) forControlEvents:UIControlEventTouchUpInside];
[xieyiBtn setAttributedTitle: createAttString(@"《用户服务协议》", 12,rgba(255, 124, 78, 1)) forState:UIControlStateNormal];
[xieyiBtn setImageEdgeInsets:UIEdgeInsetsMake(0, -4.5, 0, 4.5)];
[contView addSubview:xieyiBtn];
[xieyiBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(agreenBtn.mas_right).offset(1);
make.centerY.equalTo(agreenBtn);
}];
UIButton *nextBtn = [[UIButton alloc] init];
[nextBtn addTarget:self action:@selector(nextBtnClick:) forControlEvents:UIControlEventTouchUpInside];
nextBtn.userInteractionEnabled = NO;
nextBtn.selected = YES;
[nextBtn setAttributedTitle:createAttString(@"下一步", 15,rgba(255, 255, 255, 1)) forState:UIControlStateNormal];
[nextBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 124, 78, 1) size:CGSizeMake(225.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] forState:UIControlStateNormal];
[nextBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 200, 180, 1) size:CGSizeMake(225.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] forState:UIControlStateSelected];
[self addSubview:nextBtn];
_nextBtn = nextBtn;
[nextBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(agreenBtn.mas_bottom).offset(30);
make.centerX.mas_equalTo(0);
}];
}
- (void)textChange:(UITextField *)tf {
[self userAgreen];
}
- (void)xieyiClick:(UIButton *)btn {
SMAgreementView *view = [[SMAgreementView alloc ] init];
[view wb_showRTLFromSuperView:self.superview];
}
- (void)agreenClick:(UIButton *)btn{
btn.selected = !btn.selected;
[self userAgreen];
}
- (void)nextBtnClick:(UIButton *)btn {
if (self.nextBlock) {
self.nextBlock(self.telTF.text);
}
self.telTF.text = @"";
}
- (void)userAgreen {
if (self.agreenBtn.selected && self.telTF.text.length == 11) {
self.nextBtn.selected = NO;
self.nextBtn.userInteractionEnabled = YES;
}else {
self.nextBtn.selected = YES;
self.nextBtn.userInteractionEnabled = NO;
}
}
@end
//
// SMRSetPwdView.h
// SkinMagnifier
//
// Created by nana on 2020/11/4.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMRSetPwdView : UIView
@property(nonatomic, strong)UIButton *registBtn;
- (void)saveAccount:(NSString *)account;
@property(nonatomic, strong)void (^registBlock)(NSString *pwd);
@end
NS_ASSUME_NONNULL_END
//
// SMRSetPwdView.m
// SkinMagnifier
//
// Created by nana on 2020/11/4.
//
#import "SMRSetPwdView.h"
@interface SMRSetPwdView ()
@property(nonatomic, weak)UITextField *onePwdTF;
@property(nonatomic, weak)UITextField *twoPwdTF;
@property(nonatomic, weak)UILabel *smallTipsLabel;
@property(nonatomic, strong)NSString *accountString;
@end
@implementation SMRSetPwdView
- (instancetype)init
{
self = [super init];
if (self) {
[self setupUI];
}
return self;
}
- (void)setupUI {
UIView *contView = [[UIView alloc] init];
contView.backgroundColor = rgba(255, 255, 255, 1);
contView.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.17].CGColor;
contView.layer.shadowOffset = CGSizeMake(0,4);
contView.layer.shadowOpacity = 1;
contView.layer.shadowRadius = 30;
[self addSubview:contView];
[contView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(safaTop(64.5));
make.left.bottom.right.mas_equalTo(0);
}];
UIView *hLineView = [[UIView alloc] init];
hLineView.backgroundColor = rgba(239, 239, 239, 1);
hLineView.layer.cornerRadius = 1;
[contView addSubview:hLineView];
[hLineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.top.mas_equalTo(17);
make.size.mas_equalTo(CGSizeMake(39.5, 2));
}];
UILabel *setTipsLabel = [[UILabel alloc] init];
setTipsLabel.attributedText = createAttString(@"设置密码", 25,rgba(76, 74, 66, 1));
[contView addSubview:setTipsLabel];
[setTipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(44);
make.top.mas_equalTo(53);
}];
UILabel *smallTipsLabel = [[UILabel alloc] init];
_smallTipsLabel = smallTipsLabel;
smallTipsLabel.attributedText = createAttString(@" ",14,rgba(153, 153, 153, 1));
[contView addSubview:smallTipsLabel];
[smallTipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(44);
make.top.mas_equalTo(94.5);
}];
UITextField *onePwdTF = [[UITextField alloc] init];
_onePwdTF = onePwdTF;
onePwdTF.secureTextEntry = YES;
onePwdTF.attributedPlaceholder = createAttString(@"请输入不少于6位数的密码", 14,rgba(185, 185, 185, 1));
[contView addSubview:onePwdTF];
[onePwdTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(167.5);
make.left.mas_equalTo(45);
make.right.mas_equalTo(-45);
}];
UIView *oneLineView = [[UIView alloc] init];
oneLineView.layer.cornerRadius = 0.5;
oneLineView.backgroundColor = rgba(229, 229, 229, 1);
[contView addSubview:oneLineView];
[oneLineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(onePwdTF.mas_bottom).offset(10);
make.left.right.equalTo(onePwdTF);
make.height.mas_equalTo(1);
}];
UITextField *twoPwdTF = [[UITextField alloc] init];
_twoPwdTF = twoPwdTF;
twoPwdTF.secureTextEntry = YES;
twoPwdTF.attributedPlaceholder = createAttString(@"重复密码", 14,rgba(185, 185, 185, 1));
[contView addSubview:twoPwdTF];
[twoPwdTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(221.5);
make.left.mas_equalTo(45);
make.right.mas_equalTo(-45);
}];
UIView *twoLineView = [[UIView alloc] init];
twoLineView.layer.cornerRadius = 0.5;
twoLineView.backgroundColor = rgba(229, 229, 229, 1);
[contView addSubview:twoLineView];
[twoLineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(twoPwdTF.mas_bottom).offset(10);
make.left.right.equalTo(twoPwdTF);
make.height.mas_equalTo(1);
}];
UIButton *registBtn = [[UIButton alloc] init];
registBtn.selected = YES;
registBtn.userInteractionEnabled = NO;
[registBtn setAttributedTitle:createAttString(@"注册", 15, rgba(255, 255, 255, 1)) forState:UIControlStateNormal];
[registBtn addTarget:self action:@selector(registBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[registBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 124, 78, 1) size:CGSizeMake(225.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] forState:UIControlStateNormal];
[registBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 200, 180, 1) size:CGSizeMake(225.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] forState:UIControlStateSelected];
[self addSubview:registBtn];
_registBtn =registBtn;
[registBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(twoLineView.mas_bottom).offset(30);
make.centerX.mas_equalTo(0);
}];
[self.onePwdTF addTarget:self action:@selector(textFiledChange:) forControlEvents:UIControlEventEditingChanged];
[self.twoPwdTF addTarget:self action:@selector(textFiledChange:) forControlEvents:UIControlEventEditingChanged];
}
- (void)registBtnClick:(UIButton *)btn {
if (self.registBlock) {
self.registBlock(self.onePwdTF.text);
}
self.onePwdTF.text = @"";
self.twoPwdTF.text = @"";
}
- (void)saveAccount:(NSString *)account {
self.accountString = account;
NSMutableAttributedString *sAttString = [[NSMutableAttributedString alloc] init];
[sAttString appendAttributedString:createAttString(@"账号", 14,rgba(153, 153, 153, 1))];
NSMutableDictionary *pDict = [[NSMutableDictionary alloc] init];
pDict[NSFontAttributeName] = [UIFont systemFontOfSize:14];
pDict[NSForegroundColorAttributeName] = rgba(100, 98, 92, 1);
pDict[NSUnderlineStyleAttributeName] = @(1);
[sAttString appendAttributedString:
[[NSAttributedString alloc] initWithString:account attributes:pDict]];
[sAttString appendAttributedString:createAttString(@"由系统自动分配,请谨记", 14,rgba(153, 153, 153, 1))];
self.smallTipsLabel.attributedText = sAttString;
[self.onePwdTF becomeFirstResponder];
}
- (void)textFiledChange:(UITextField *)tf {
if ([tf isEqual:self.onePwdTF] ||
[tf isEqual:self.twoPwdTF] ) {
NSString *onePWd =self.onePwdTF.text;
NSString *twoPWd =self.twoPwdTF.text;
if ([onePWd isEqualToString:twoPWd] && onePWd.length >= 6) {
self.registBtn.selected = NO;
self.registBtn.userInteractionEnabled = YES;
}else {
self.registBtn.selected = YES;
self.registBtn.userInteractionEnabled = NO;
}
}
}
@end
//
// SMRVerificationCodeView.h
// SkinMagnifier
//
// Created by nana on 2020/11/4.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMRVerificationCodeView : UIView
@property(nonatomic, copy)void (^endInputCodeBlock)(NSString *code);
- (void)checkCodeWithPhone:(NSString *)phone;
@end
NS_ASSUME_NONNULL_END
//
// SMRVerificationCodeView.m
// SkinMagnifier
//
// Created by nana on 2020/11/4.
//
#import "SMRVerificationCodeView.h"
#import "SMCountDownButton.h"
#import "SMYZMView.h"
@interface SMRVerificationCodeView()
@property(nonatomic,strong)NSMutableArray *inputArray;
@property(nonatomic,strong)NSString *phoneString;
@property(nonatomic,weak)SMCountDownButton *cdBtn;
@property(nonatomic,strong)NSString *codeString;
@property(nonatomic,weak)UILabel *phoneLabel;
@end
@implementation SMRVerificationCodeView
- (instancetype)init
{
self = [super init];
if (self) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.inputArray = [[NSMutableArray alloc] init];
UIView *contView = [[UIView alloc] init];
contView.backgroundColor = rgba(255, 255, 255, 1);
contView.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.17].CGColor;
contView.layer.shadowOffset = CGSizeMake(0,4);
contView.layer.shadowOpacity = 1;
contView.layer.shadowRadius = 30;
[self addSubview:contView];
[contView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(safaTop(64.5) );
make.left.bottom.right.mas_equalTo(0);
}];
UIView *hLineView = [[UIView alloc] init];
hLineView.backgroundColor = rgba(239, 239, 239, 1);
hLineView.layer.cornerRadius = 1;
[contView addSubview:hLineView];
[hLineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.top.mas_equalTo(17);
make.size.mas_equalTo(CGSizeMake(39.5, 2));
}];
UILabel *bigTipsLabel = [[UILabel alloc] init];
bigTipsLabel.attributedText = createAttString(@"请您输入手机号验证码", 25,rgba(76, 74, 66, 1));
[contView addSubview:bigTipsLabel];
[bigTipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(45);
make.top.mas_equalTo(53);
}];
UILabel *smallTipsLabel = [[UILabel alloc] init];
smallTipsLabel.attributedText = createAttString(@"验证码已经发送到您的手机", 14,rgba(153, 153, 153, 1));
[contView addSubview:smallTipsLabel];
[smallTipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(45);
make.top.equalTo(bigTipsLabel.mas_bottom).offset(18);
}];
UILabel *phoneLabel = [[UILabel alloc] init];
_phoneLabel = phoneLabel;
// phoneLabel.attributedText = createAttString(@"+86 13145806096", 14,rgba(153, 153, 153, 1));
[contView addSubview:phoneLabel];
[phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(45);
make.top.equalTo(smallTipsLabel.mas_bottom).offset(10);
}];
UIImage *norImage = [[UIImage wb_imageWithColor:rgba(241, 241, 241, 1) size:CGSizeMake(57, 57)] sd_roundedCornerImageWithRadius:5 corners:0xff borderWidth:0 borderColor:[UIColor clearColor]];
// UIView *inputBGView = [[UIView alloc] init];
// [contView addSubview:inputBGView];
// [inputBGView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.centerX.mas_equalTo(0);
// make.top.mas_equalTo(171);
// make.height.mas_equalTo(57);
// }];
SMYZMView *mView = [[SMYZMView alloc ] init];
@weakify(self);
mView.editBlock = ^(NSString * _Nonnull str) {
@strongify(self);
if ([str isEqualToString:self.codeString]) {
if (self.endInputCodeBlock) {
self.endInputCodeBlock(self.codeString);
}
}else {
[SVProgressHUD showErrorWithStatus:@"请输入正确的验证码"];
}
};
[contView addSubview:mView];
[mView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(200);
make.centerX.mas_equalTo(0);
make.width.mas_equalTo((57+19)*4);
make.height.mas_equalTo(57);
}];
SMCountDownButton *cdbtn = [[SMCountDownButton alloc] init];
[cdbtn setAttributedTitle:createAttString(@"获取验证码", 12, rgba(153, 153, 153, 1)) forState:UIControlStateNormal];
[cdbtn addTarget:self action:@selector(cdBtnClick:) forControlEvents:UIControlEventTouchUpInside];
_cdBtn = cdbtn;
// @weakify(self);
__block int maxCount = 60;
cdbtn.timeBlock = ^{
@strongify(self);
maxCount--;
NSAttributedString *btnAtt = nil;
if (maxCount == 0) {
btnAtt = createAttString(@"获取验证码", 12, rgba(153, 153, 153, 1));
[self.cdBtn stopTime];
maxCount = 60;
}else {
btnAtt= [[NSAttributedString alloc] wb_initWithString:[NSString stringWithFormat:@"%ds",maxCount] FontSize:12 TextColor:rgba(153, 153, 153, 1)];
}
[self.cdBtn setAttributedTitle:btnAtt forState:UIControlStateNormal];
};
[self addSubview:cdbtn];
[cdbtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(mView).offset(-15);
make.bottom.equalTo(mView.mas_top).offset(-15);
}];
}
- (void)cdBtnClick:(UIButton *)btn {
[self checkCode];
}
- (void)checkCodeWithPhone:(NSString *)phone {
self.phoneString = phone;
_phoneLabel.attributedText = createAttString([NSString stringWithFormat:@"+86 %@",phone], 14,rgba(153, 153, 153, 1));
[self checkCode];
}
- (void)checkCode {
NSMutableDictionary *pDict = [[NSMutableDictionary alloc] init];
pDict[@"phone"] = self.phoneString;
@weakify(self);
[self postFormDataWithUrl:@"/magnifier/public/sendVerifiyCode" params:pDict success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
@strongify(self);
if ([JsonData.code isEqualToString:@"200"]) {
self.codeString = [NSString stringWithFormat:@"%@",JsonData.data];
[self.cdBtn startTime];
}
}];
}
@end
//
// SMRegistView.h
// SkinMagnifier
//
// Created by nana on 2020/11/4.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMRegistView : UIView
@property(nonatomic,copy)void(^registBlock)(NSString *account, NSString *dname);
@end
NS_ASSUME_NONNULL_END
//
// SMRegistView.m
// SkinMagnifier
//
// Created by nana on 2020/11/4.
//
#import "SMRegistView.h"
#import "SMDownView.h"
#import "SMRInputPhoneView.h"
#import "SMRVerificationCodeView.h"
#import "SMRSetPwdView.h"
#import "SMRCompleteView.h"
@interface SMRegistView()
@property(nonatomic, strong)SMRInputPhoneView *inputPhoneView;
@property(nonatomic, strong)SMRVerificationCodeView *vcodeView;
@property(nonatomic, strong)SMRSetPwdView *spView;
@property(nonatomic, strong)NSString *phone;
@property(nonatomic, strong)NSString *code;
@property(nonatomic, strong)NSString *account;
@end
@implementation SMRegistView
- (instancetype)init
{
self = [super init];
if (self) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.backgroundColor = rgba(0, 0, 0, 0.34);
CGSize sSize = [UIScreen mainScreen].bounds.size;
self.inputPhoneView = [[SMRInputPhoneView alloc] init];
self.inputPhoneView.frame = CGRectMake(0,0,sSize.width,sSize.height);
[self addSubview:self.inputPhoneView];
self.vcodeView = [[SMRVerificationCodeView alloc] init];
self.vcodeView.hidden = YES;
self.vcodeView.frame = CGRectMake(0,0,sSize.width,sSize.height);
[self addSubview:self.vcodeView];
self.spView = [[SMRSetPwdView alloc] init];
// [self.spView.registBtn addTarget:self action:@selector(spRegistClick:) forControlEvents:UIControlEventTouchUpInside];
self.spView.hidden = YES;
self.spView.frame = CGRectMake(0,0,sSize.width,sSize.height);
[self addSubview:self.spView];
SMDownView *downView = [[SMDownView alloc] init];
downView.frame = CGRectMake(0, 0,sSize.width, 104.5);
[self addSubview:downView];
@weakify(self);
self.inputPhoneView.nextBlock = ^(NSString * _Nonnull phone) {
@strongify(self);
self.phone = phone;
self.vcodeView.hidden = NO;
[self.inputPhoneView endEditing:YES];
[self.vcodeView checkCodeWithPhone:phone];
};
self.vcodeView.endInputCodeBlock = ^(NSString * _Nonnull code) {
@strongify(self);
self.code = code;
NSMutableDictionary *pDict = [[NSMutableDictionary alloc ] init];
pDict[@"code"] = code;
[self postFormDataWithUrl:@"/magnifier/public/generateAccount" params:pDict success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
@strongify(self);
if ([JsonData.code isEqualToString:@"200"]) {
NSString *account = (NSString *)JsonData.data;
self.account = account;
self.spView.hidden = NO;
[self.vcodeView endEditing:YES];
[self.spView saveAccount:account];
}else {
[SVProgressHUD showErrorWithStatus:@"验证失败"];
}
}];
};
self.spView.registBlock = ^(NSString * _Nonnull pwd) {
@strongify(self);
NSMutableDictionary *pDict = [[NSMutableDictionary alloc] init];
pDict[@"account"] = self.account;
pDict[@"phone"] = self.phone;
pDict[@"pwd"] = encryptAES128(pwd, @"jinhaoyang201905");
pDict[@"verifycode"] = self.code;
[self postFormDataWithUrl:@"/magnifier/public/registeredMember" params:pDict success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
@strongify(self);
self.inputPhoneView.hidden = NO;
self.vcodeView.hidden = YES;
self.spView.hidden = YES;
if ([JsonData.code isEqualToString:@"200"]) {
NSDictionary *rDict = ( NSDictionary *)JsonData.data;
NSMutableDictionary *sDict = [[NSMutableDictionary alloc] init];
[SMGlobalModel share].mid = [NSString stringWithFormat:@"%@", rDict[@"id"]];
[SMGlobalModel share].account = rDict[@"account"];
[SMGlobalModel share].dmname = rDict[@"dmname"];
sDict[@"account"] = self.account;
sDict[@"pwd"] = encryptAES128(pwd, @"jinhaoyang201905");
[[NSUserDefaults standardUserDefaults] setObject:sDict forKey:@"saveAccountKey"];
SMRCompleteView *cView = [[SMRCompleteView alloc] init];
cView.frame = CGRectMake(0,safaTop(64.5) ,self.bounds.size.width,self.bounds.size.height-safaTop(64.5));
[self addSubview:cView];
@weakify(cView);
cView.compBlock = ^{
@strongify(self);
@strongify(cView);
if (self.registBlock) {
self.registBlock([SMGlobalModel share].account, [SMGlobalModel share].dmname);
}
[cView removeFromSuperview];
};
}else if([JsonData.code isEqualToString:@"-53"]){
[SVProgressHUD showErrorWithStatus:@"手机号码已存在"];
}else {
[SVProgressHUD showErrorWithStatus:@"注册失败"];
}
}];
};
}
- (void)spRegistClick:(UIButton *)btn {
}
@end
//
// SMShopInfoModel.h
// SkinMagnifier
//
// Created by nana on 2020/12/3.
//
#import "JFBaseModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface SMShopInfoModel : JFBaseModel
@property(nonatomic, strong)NSString *areatxt;
@property(nonatomic, strong)NSString *address;
@property(nonatomic, strong)NSString *dmname;
@property(nonatomic, strong)NSString *lxname;
@property(nonatomic, strong)NSString *phone;
@property(nonatomic, strong)NSString *areacity;
@property(nonatomic, strong)NSString *areaprovince;
@property(nonatomic, strong)NSString *arearegion;
@end
NS_ASSUME_NONNULL_END
//
// SMShopInfoModel.m
// SkinMagnifier
//
// Created by nana on 2020/12/3.
//
#import "SMShopInfoModel.h"
@implementation SMShopInfoModel
@end
//
// AppDelegate.h
// SkinMagnifier
//
// Created by nana on 2020/11/4.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property(nonatomic, strong)UIWindow *window;
@end
//
// AppDelegate.m
// SkinMagnifier
//
// Created by nana on 2020/11/4.
//
#import "AppDelegate.h"
#import "SMNavigationController.h"
#import "SMHomeViewController.h"
#import <IQKeyboardManager.h>
#import "MMAutoUploadTool.h"
#import "MMLocalDataBManager.h"
#import <CoreLocation/CoreLocation.h>
#import <Bugly/Bugly.h>
#import <CoreLocation/CoreLocation.h>
@interface AppDelegate ()<CLLocationManagerDelegate>{
CLLocationManager*locationmanager;//定位服务
NSString*strlatitude;//经度
NSString*strlongitude;//纬度
}
@property(nonatomic,strong)CLLocationManager *locationManager;
@property(nonatomic,strong)dispatch_source_t uploadLocalRpoertTimer;
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.window.rootViewController = [[SMNavigationController alloc] initWithRootViewController:[SMHomeViewController new]];
[self.window makeKeyAndVisible];
[self setKeyboard];
[self getToken];
[self startLocation];
[self setupAutoUploadImage];
[self setupWifi];
[self setupBugly];
return YES;
}
- (void)setupBugly {
[Bugly startWithAppId:@"e2e071b8fe"];
}
- (void)setKeyboard {
IQKeyboardManager *manager = [IQKeyboardManager sharedManager];
manager.enable = YES;
manager.shouldResignOnTouchOutside = YES;
manager.shouldToolbarUsesTextFieldTintColor = YES;
manager.enableAutoToolbar = YES;
manager.toolbarDoneBarButtonItemText = @"完成";
[SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeClear];
[SVProgressHUD setMinimumDismissTimeInterval:1.0];
}
- (void) setupWifi {
// NSString* phoneVersion = [[UIDevice currentDevice] systemVersion];
// CGFloat version = [phoneVersion floatValue];
// // 如果是iOS13 未开启地理位置权限 需要提示一下
// if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined && version >= 13) {
// self.locationManager = [[CLLocationManager alloc] init];
// [ self.locationManager requestWhenInUseAuthorization];
// }
}
- (void)setupAutoUploadData {
[SMLocalReportBManager sharedManager];
@weakify(self);
dispatch_queue_t queue = dispatch_queue_create("com.idankee.DKAutoUpdate5Data", DISPATCH_QUEUE_SERIAL);
dispatch_source_t timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue);
dispatch_source_set_timer(timer, DISPATCH_TIME_NOW, 5 * NSEC_PER_SEC, 0 * NSEC_PER_SEC);
dispatch_source_set_event_handler(timer, ^{
@strongify(self);
[self startTask1];
});
dispatch_resume(timer);
_uploadLocalRpoertTimer = timer;
}
- (void)startTask1{
if ([SMGlobalModel share].mid.length == 0) {
return;
}
if (islinkDeviceWifi()) {
NSString *macString = WIFIMacAddress();
NSArray *macSArray = [macString componentsSeparatedByString:@":"];
NSMutableString *mac = [[NSMutableString alloc] init];
for (NSString * str in macSArray) {
if (str.length == 1) {
[mac appendFormat:@"0%@",[str uppercaseString]];
}else {
[mac appendFormat:@"%@",[str uppercaseString]];
}
}
[SMGlobalModel share].deviceMac = mac;
[NSThread sleepForTimeInterval:20.0];
return;
}
// 设备绑定到机构
if ([SMGlobalModel share].shopInfoComplete && [SMGlobalModel share].deviceMac.length) {
NSString *macS = [[NSUserDefaults standardUserDefaults] objectForKey:@"saveDeviceMacKey"];
if (![macS containsString:[SMGlobalModel share].deviceMac]) {
NSMutableDictionary *pDict = [[NSMutableDictionary alloc] init];
pDict[@"mid"] = [SMGlobalModel share].mid;
pDict[@"hardcode"] = [SMGlobalModel share].deviceMac;
[self.window postFormDataWithUrl:@"/magnifier/member/verifyMemberDevice" params:pDict showHUD:NO success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
if ([JsonData.code isEqualToString:@"200"]) {
NSString *string = [NSString stringWithFormat:@"%@%@",macS,[SMGlobalModel share].deviceMac];
[[NSUserDefaults standardUserDefaults] setObject:string forKey:@"saveDeviceMacKey"];
}
}];
}
}
NSArray *modelArray = [[SMLocalReportBManager sharedManager] selectFristWithMid:[SMGlobalModel share].mid];
if ( modelArray.count == 0) {
[NSThread sleepForTimeInterval:20.0];
return;
}
SMLocalReportModel *model = modelArray.firstObject;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self performSelector:@selector(resetData:) withObject:model afterDelay:2.5];
});
if ([model.uploadLock isEqualToString:@"1"]) {
[NSThread sleepForTimeInterval:20.0];
return;
}
[[SMLocalReportBManager sharedManager] updateWithSetKey:@"uploadLock" setValue:@"1" whereKey:@"cgid" whereValue:model.cgid];
NSMutableDictionary *pDict = [[NSMutableDictionary alloc] init];
pDict[@"iposition"] = model.iposition;
MMAutoUploadTool *uploadTool = [MMAutoUploadTool sharedManager];
pDict[@"lonlat"] = uploadTool.lonlat;
if (model.createTime.length > 11) {
pDict[@"createtime"] = model.createTime;
}else {
pDict[@"createtime"] = [NSString stringWithFormat:@"%@000",model.createTime];
}
pDict[@"clientid"] = model.cid;
NSMutableArray *images = [[NSMutableArray alloc] init];
for (int i = 0; i < model.imageArray.count; i++) {
SMLocalReportImageModel *imgModel = model.imageArray[i];
NSMutableDictionary *imgDict = [[NSMutableDictionary alloc] init];
imgDict[@"lighttype"] = imgModel.iType;
imgDict[@"imgUrl"] = imgModel.iURL;
[images addObject:imgDict];
}
pDict[@"images"] =images;
NSMutableArray *analysisReportAitagnameLinkGoods = [[NSMutableArray alloc] init];
for (int i = 0; i < model.productArray.count; i++) {
SMLocalReportProductModel *proModel = model.productArray[i];
NSMutableDictionary *proDict = [[NSMutableDictionary alloc] init];
proDict[@"goodsname"] = proModel.pName;
proDict[@"goodstype"] = proModel.pType;
[analysisReportAitagnameLinkGoods addObject:proDict];
}
pDict[@"analysisReportAitagnameLinkGoods"] =analysisReportAitagnameLinkGoods;
NSMutableArray *magnifierReports = [[NSMutableArray alloc] init];
if (model.AISymptomArray.count < 5 ) {
NSMutableDictionary *symDict = [[NSMutableDictionary alloc] init];
symDict[@"tagFlag"] = @"magn_water";
if (model.moisture.ofen.intValue == 0) {
symDict[@"tagValue"] = @"0";
}else {
symDict[@"tagValue"] = model.moisture.ofen;
}
symDict[@"aiImageUrl"] = @"";
symDict[@"tagname"] = @"水份";
symDict[@"tagNum"] = @"0";
symDict[@"dermalogicatext"] =model.moisture.oMethod;
[magnifierReports addObject:symDict];
}else {
for (int i = 0; i < model.AISymptomArray.count; i++) {
SMLocalReportAIModel *symModel = model.AISymptomArray[i];
NSMutableDictionary *symDict = [[NSMutableDictionary alloc] init];
symDict[@"tagFlag"] = symModel.tagFlag;
symDict[@"tagValue"] = symModel.tagValue;
symDict[@"aiImageUrl"] = symModel.aiImageUrl;
symDict[@"tagname"] = symModel.tagname;
symDict[@"tagNum"] = symModel.tagNum;
symDict[@"dermalogicatext"] = symModel.dermalogicatext;
[magnifierReports addObject:symDict];
}
}
pDict[@"magnifierReports"] = magnifierReports;
NSMutableArray *magnifierCustomReports = [[NSMutableArray alloc] init];
for (int i = 0; i < model.symptomArray.count; i++) {
SMLocalReportSymptomModel *symModel = model.symptomArray[i];
NSMutableDictionary *symDict = [[NSMutableDictionary alloc] init];
symDict[@"tagname"] = symModel.sName;
symDict[@"dermalogicatext"] = symModel.sMethod;
[magnifierCustomReports addObject:symDict];
}
pDict[@"magnifierCustomReports"] = magnifierCustomReports;
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
[self.window postJsonWithUrl:@"/magnifierCaseGroup/saveMagnifierInfo" params:pDict showHUD:NO success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(resetData:) object:model];
if ([JsonData.code isEqualToString:@"200"]) {
[[SMLocalReportBManager sharedManager] deleteWitCgid:model.cgid];
}else {
[[SMLocalReportBManager sharedManager] updateWithSetKey:@"uploadLock" setValue:@"0" whereKey:@"cgid" whereValue:model.cgid];
}
dispatch_semaphore_signal(sema);
}];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
}
//- (void)startTask {
//
//
// if ([SMGlobalModel share].mid.length == 0) {
// return;
// }
// if (islinkDeviceWifi()) {
// NSString *macString = WIFIMacAddress();
// NSArray *macSArray = [macString componentsSeparatedByString:@":"];
// NSMutableString *mac = [[NSMutableString alloc] init];
// for (NSString * str in macSArray) {
// if (str.length == 1) {
// [mac appendFormat:@"0%@",[str uppercaseString]];
// }else {
// [mac appendFormat:@"%@",[str uppercaseString]];
// }
// }
// [SMGlobalModel share].deviceMac = mac;
//
// [NSThread sleepForTimeInterval:20.0];
// return;
// }
//
//
// /// 设备绑定到机构
// if ([SMGlobalModel share].shopInfoComplete && [SMGlobalModel share].deviceMac.length) {
// NSString *macS = [[NSUserDefaults standardUserDefaults] objectForKey:@"saveDeviceMacKey"];
// if (![macS containsString:[SMGlobalModel share].deviceMac]) {
// NSMutableDictionary *pDict = [[NSMutableDictionary alloc] init];
// pDict[@"mid"] = [SMGlobalModel share].mid;
// pDict[@"hardcode"] = [SMGlobalModel share].deviceMac;
// [self.window postFormDataWithUrl:@"/magnifier/member/verifyMemberDevice" params:pDict showHUD:NO success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
// if ([JsonData.code isEqualToString:@"200"]) {
// NSString *string = [NSString stringWithFormat:@"%@%@",macS,[SMGlobalModel share].deviceMac];
// [[NSUserDefaults standardUserDefaults] setObject:string forKey:@"saveDeviceMacKey"];
// }
// }];
// }
// }
//
//
// NSArray *modelArray = [[SMLocalReportBManager sharedManager] selectFristWithMid:[SMGlobalModel share].mid];
// if ( modelArray.count == 0) {
// [NSThread sleepForTimeInterval:20.0];
// return;
// }
//
//
// SMLocalReportModel *model = modelArray.firstObject;
// [self performSelector:@selector(resetData:) withObject:model afterDelay:3];
// if ([model.uploadLock isEqualToString:@"1"]) {
// [NSThread sleepForTimeInterval:20.0];
// return;
// }
//
//
// [[SMLocalReportBManager sharedManager] updateWithSetKey:@"uploadLock" setValue:@"1" whereKey:@"cgid" whereValue:model.cgid];
// NSMutableDictionary *pDict = [[NSMutableDictionary alloc] init];
// pDict[@"iposition"] = model.iposition;
// if (model.createTime.length > 11) {
// pDict[@"createtime"] = model.createTime;
// }else {
// pDict[@"createtime"] = [NSString stringWithFormat:@"%@000",model.createTime];
// }
//
// pDict[@"clientid"] = model.cid;
// pDict[@"moisture"] = model.moisture.ofen;
// NSMutableArray *images = [[NSMutableArray alloc] init];
// for (int i = 0; i < model.imageArray.count; i++) {
// SMLocalReportImageModel *imgModel = model.imageArray[i];
// NSMutableDictionary *imgDict = [[NSMutableDictionary alloc] init];
// imgDict[@"lighttype"] = imgModel.iType;
// imgDict[@"imgUrl"] = imgModel.iURL;
// [images addObject:imgDict];
// }
// pDict[@"images"] =images;
//
//
// NSMutableArray *analysisReportAitagnameLinkGoods = [[NSMutableArray alloc] init];
// for (int i = 0; i < model.productArray.count; i++) {
// SMLocalReportProductModel *proModel = model.productArray[i];
// NSMutableDictionary *proDict = [[NSMutableDictionary alloc] init];
// proDict[@"goodsname"] = proModel.pName;
// proDict[@"goodstype"] = proModel.pType;
// [analysisReportAitagnameLinkGoods addObject:proDict];
// }
// pDict[@"analysisReportAitagnameLinkGoods"] =analysisReportAitagnameLinkGoods;
//
// NSMutableArray *analysisReportLinkAitagnameVOs = [[NSMutableArray alloc] init];
// /// 水份
// NSMutableDictionary *oilDict = [[NSMutableDictionary alloc] init];
// oilDict[@"tagname"] = model.moisture.oName;
// if (model.moisture.ofen.intValue == 0) {
// oilDict[@"areasonList"] = @[@{@"reasontext":@""}];
// oilDict[@"adermalogicaList"] = @[@{@"dermalogicatext":@""}];
// }else {
// oilDict[@"areasonList"] = @[@{@"reasontext":model.moisture.oDescribe}];
// oilDict[@"adermalogicaList"] = @[@{@"dermalogicatext":model.moisture.oMethod}];
// }
//
// oilDict[@"systSign"] = @"1";
// [analysisReportLinkAitagnameVOs addObject:oilDict];
// for (int i = 0; i < model.symptomArray.count; i++) {
// SMLocalReportSymptomModel *symModel = model.symptomArray[i];
// NSMutableDictionary *symDict = [[NSMutableDictionary alloc] init];
// symDict[@"tagname"] = symModel.sName;
// symDict[@"areasonList"] = @[@{@"reasontext":symModel.sDescribe}];
// symDict[@"adermalogicaList"] = @[@{@"dermalogicatext":symModel.sMethod}];
// symDict[@"systSign"] = @"0";
// [analysisReportLinkAitagnameVOs addObject:symDict];
// }
//
// pDict[@"analysisReportLinkAitagnameVOs"] = analysisReportLinkAitagnameVOs;
//
// dispatch_semaphore_t sema = dispatch_semaphore_create(0);
// [self.window postJsonWithUrl:@"/magnifierCaseGroup/saveData" params:pDict showHUD:NO success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
// [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(resetData:) object:model];
// if ([JsonData.code isEqualToString:@"200"]) {
// [[SMLocalReportBManager sharedManager] deleteWitCgid:model.cgid];
// }else {
// [[SMLocalReportBManager sharedManager] updateWithSetKey:@"uploadLock" setValue:@"0" whereKey:@"cgid" whereValue:model.cgid];
// }
// dispatch_semaphore_signal(sema);
// }];
// dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
//
//
//
//}
- (void)resetData:(SMLocalReportModel *)model {
[[SMLocalReportBManager sharedManager] updateWithSetKey:@"uploadLock" setValue:@"0" whereKey:@"cgid" whereValue:model.cgid];
}
- (void)setupAutoUploadImage {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
MMAutoUploadTool *uploadTool = [MMAutoUploadTool sharedManager];
uploadTool.endPoint = @"https://oss-cn-shenzhen.aliyuncs.com";
// uploadTool.BucketName = @"djm-skin";
// uploadTool.SecretKey = @"YErRX4C9igPUENphQLD107XgrAIYeI";
// uploadTool.AccessKey = @"LTAIFNybYwi2WuWK";
uploadTool.BucketName = @"imoreme";
uploadTool.SecretKey = @"rTC1hmCKmmCoLzdxc7pw8FAzbjWG7H";
uploadTool.AccessKey = @"LTAI4G35R8m8wsP5hQNrjm8i";
[uploadTool setupDKEnvironmen];
uploadTool.timeblock = ^(void (^ cBlock)(NSString *i, NSData* bufData,void (^ c2block)(NSString *i2))) {
if (islinkDeviceWifi()) {
return;
}
NSArray *array = [[MMLocalDataBManager sharedManager] seleteWithGreaterThanOrEqualTo:0 limit:1];
if (!array.count) {
return ;
}
NSDictionary *dict = array.firstObject;
cBlock( dict[@"objectKey"], dict[@"updateData"],^(NSString *i2){
if (i2) {
[[MMLocalDataBManager sharedManager] deleteWithID:[dict[@"ID"]intValue]];
}
});
};
});
}
- (void)getToken {
// [UIView setDefaultHost:@"http://192.168.1.164:8083"];//测试
// [UIView setDefaultHost:@"http://waterapi.test.hoyar.com.cn"];//正式
[UIView setDefaultHost:@"http://waterapi.imoreme.com"];//正式
[UIView setAuthorizationDefaultRequestValue:@"jinhaoyang_metis" key:@"appid"];
[UIView setAuthorizationDefaultRequestValue:@"0FFC183F4BF9BB4737BA8B5B83D1039023F18C60D0636C34F4EF8C7AEEDCBD31" key:@"appsecret"];
[UIView setAuthorizationDefaultRequestValue:@"zh" key:@"language"];
@weakify(self);
[self.window postFormDataWithUrl:@"/token/createToken" params:nil showHUD:NO success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
@strongify(self);
if ([JsonData.code isEqualToString:@"200"] && [JsonData.data isKindOfClass:[NSArray class]]) {
NSArray *dataArray = (NSArray *)JsonData.data;
[UIView setAuthorizationDefaultRequestValue:dataArray.firstObject key:@"token"];
}else {
[self performSelector:@selector(getToken) withObject:nil afterDelay:5];
}
}];
}
#pragma mark - 定位
//开始定位
-(void) startLocation
{
//判断定位功能是否打开
if ([CLLocationManager locationServicesEnabled]) {
locationmanager = [[CLLocationManager alloc]init];
locationmanager.delegate = self;
[locationmanager requestAlwaysAuthorization];
[locationmanager requestWhenInUseAuthorization];
//设置寻址精度
locationmanager.distanceFilter=kCLDistanceFilterNone;//实时更新定位位置
locationmanager.pausesLocationUpdatesAutomatically=NO;
locationmanager.desiredAccuracy = kCLLocationAccuracyBest;
locationmanager.distanceFilter = 5.0;
[locationmanager startUpdatingLocation];
}else{
[self checkAuth:kMultiLangString(@"定位服务已关闭 您需要打开定位权限,以便提升数据的获取速度。请到设置->隐私->定位服务中开启【MoreMe水肤镜】的定位服务")];
}
}
- (void)checkAuth:(NSString *)tipString {
UIAlertController *alert;
if ([tipString isEqualToString:@"定位服务已关闭 您需要打开定位权限,以便提升数据的获取速度。请到设置->隐私->定位服务中开启【MoreMe水肤镜】的定位服务"]) {
alert = [UIAlertController alertControllerWithTitle:kMultiLangString(@"定位服务已关闭") message:@"您需要打开定位权限,以便提升数据的获取速度。请到设置->隐私->定位服务中开启【MoreMe水肤镜】的定位服务" preferredStyle:UIAlertControllerStyleAlert];
}else{
alert = [UIAlertController alertControllerWithTitle:kMultiLangString(@"") message:tipString preferredStyle:UIAlertControllerStyleAlert];
}
// alert = [UIAlertController alertControllerWithTitle:kMultiLangString(@"定位服务已关闭") message:tipString preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:kMultiLangString(@"确定") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
[alert dismissViewControllerAnimated:YES completion:nil];
}]];
// [alert addAction:[UIAlertAction actionWithTitle:kMultiLangString(@"取消") style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
// [alert dismissViewControllerAnimated:YES completion:nil];
// }]];
[self.window.rootViewController presentViewController:alert animated:YES completion:nil];
}
#pragma mark CoreLocation delegate (定位失败)
//定位失败后调用此代理方法
-(void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
{
[self checkAuth:kMultiLangString(@"您需要打开定位权限,以便提升数据的获取速度。请到设置->隐私->定位服务中开启【MoreMe水肤镜】的定位服务")];
return;
}
#pragma mark 定位成功后则执行此代理方法
-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray<CLLocation *> *)locations
{
[locationmanager stopUpdatingHeading];
//旧址
CLLocation *currentLocation = [locations lastObject];
CLGeocoder *geoCoder = [[CLGeocoder alloc]init];
//打印当前的经度与纬度
NSLog(@"%f,%f",currentLocation.coordinate.latitude,currentLocation.coordinate.longitude);
MMAutoUploadTool *uploadTool = [MMAutoUploadTool sharedManager];
uploadTool.lonlat = [NSString stringWithFormat:@"%f,%f",currentLocation.coordinate.longitude,currentLocation.coordinate.latitude];
if (uploadTool.lonlat == nil) {
uploadTool.lonlat = @"113.9212390000,22.5188880000";
}
[self setupAutoUploadData];
UIAlertController *alert;
[alert dismissViewControllerAnimated:YES completion:nil];
//反地理编码
[geoCoder reverseGeocodeLocation:currentLocation completionHandler:^(NSArray<CLPlacemark *> * _Nullable placemarks, NSError * _Nullable error)
{
// NSLog(@"反地理编码");
// NSLog(@"反地理编码%ld",placemarks.count);
if (placemarks.count > 0) {
CLPlacemark *placeMark = placemarks[0];
/*看需求定义一个全局变量来接收赋值*/
// NSLog(@"城市----%@",placeMark.country);//当前国家
// // NSLog(@"城市%@",self.label_city.text);//当前的城市
// NSLog(@"%@",placeMark.subLocality);//当前的位置
// NSLog(@"%@",placeMark.thoroughfare);//当前街道
// NSLog(@"%@",placeMark.name);//具体地址
}
}];
[alert dismissViewControllerAnimated:YES completion:nil];
}
@end
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "icon_40@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "icon_60@2x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "icon_58@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "icon_87@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "icon_80@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "icon_120@2x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "icon_120@2x-1.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "icon_180@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "icon_20.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"filename" : "icon_40@2x-1.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "icon_29.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "icon_58@2x-1.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "icon_40@2x-2.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"filename" : "icon_80@2x-1.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "icon_76.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"filename" : "icon_152@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "icon_167@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"filename" : "icon_1024png.png",
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "login_icon_wc@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_icon_wc@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "login_icon_xs@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_icon_xs@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "login_icon_xyb@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_icon_xyb@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "login_icon_yc@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_icon_yc@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "login_jz_nor@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_jz_nor@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "login_jz_sel@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_jz_sel@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Program_icon_delete@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Program_icon_delete@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "client_list_button_ch_delete@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "client_list_button_ch_delete@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "client_time_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "client_time_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "customer_edit@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "customer_edit@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "customer_icon_xyb@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "customer_icon_xyb@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "customer_image_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "customer_image_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "customer_logo@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "customer_logo@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "customer_xj@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "customer_xj@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "dh_check_Oil_bg_1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "dh_check_Oil_bg_1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "dh_check_Oil_bg_2@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "dh_check_Oil_bg_2@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "dh_check_Oil_bg_3@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "dh_check_Oil_bg_3@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "link_tips_pop_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "link_tips_pop_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "list_button_add@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "list_button_add@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "list_icon_back@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "list_icon_back@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "list_icon_search@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "list_icon_search@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "list_icon_xj@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "list_icon_xj@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "pop_icon_Shut@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "pop_icon_Shut@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "pz_button_xj@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "pz_button_xj@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "pz_icon_jh_nor@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "pz_icon_jh_nor@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "pz_icon_jh_sel@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "pz_icon_jh_sel@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "pz_icon_light@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "pz_icon_light@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "pz_icon_return_bs@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "pz_icon_return_bs@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "pz_icon_rig_nor@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "pz_icon_rig_nor@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "pz_icon_rig_sel@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "pz_icon_rig_sel@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "pz_icon_uv_nor@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "pz_icon_uv_nor@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "pz_icon_uv_sel@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "pz_icon_uv_sel@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "pz_icon_wl_nor@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "pz_icon_wl_nor@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "pz_icon_wl_sel@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "pz_icon_wl_sel@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "re_Mild_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "re_Mild_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "re_Placeholder_img1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "re_Placeholder_img1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "re_Severe_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "re_Severe_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "re_moderate_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "re_moderate_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "re_no_ai_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "re_no_ai_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "re_normal_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "re_normal_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "report_Placeholder_img@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "report_Placeholder_img@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "report_bg_lh_nor@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "report_bg_lh_nor@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "report_bg_lh_sel@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "report_bg_lh_sel@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "report_bg_qdqs_nor@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "report_bg_qdqs_nor@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "report_bg_qdqs_sel@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "report_bg_qdqs_sel@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "report_bg_qs_nor@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "report_bg_qs_nor@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "report_bg_qs_sel@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "report_bg_qs_sel@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : " report_button_add@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : " report_button_add@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "report_header_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "report_header_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "report_icon_add@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "report_icon_add@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "report_icon_add_cp@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "report_icon_add_cp@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "report_icon_add_cp_nor@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "report_icon_add_cp_nor@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "report_icon_add_cp_sel@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "report_icon_add_cp_sel@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "report_icon_add_yq@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "report_icon_add_yq@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "report_icon_add_yq_nor@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "report_icon_add_yq_nor@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "report_icon_add_yq_sel@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "report_icon_add_yq_sel@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "report_icon_ai_amplification1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "report_icon_ai_amplification1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "report_icon_amplification@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "report_icon_amplification@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "report_icon_check_nor@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "report_icon_check_nor@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "report_icon_check_sel@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "report_icon_check_sel@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "report_icon_detected@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "report_icon_detected@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "report_icon_fa_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "report_icon_fa_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "report_icon_tips_nor@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "report_icon_tips_nor@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sex_nan_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sex_nan_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sex_nv_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sex_nv_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sf_icon_failure@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sf_icon_failure@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "alert_pop_tk@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "alert_pop_tk@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "home_bg_16@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "home_bg_16@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "home_bg_19@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "home_bg_19@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "home_icon_personal@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "home_icon_personal@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "home_icon_xyp@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "home_icon_xyp@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "home_pop_bj@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "home_pop_bj@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "home_pop_esc@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "home_pop_esc@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "home_tool_icon_clas@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "home_tool_icon_clas@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : " nav_black_back@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : " nav_black_back@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "nav_white_back@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "nav_white_back@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="lanch_loin_icon" translatesAutoresizingMaskIntoConstraints="NO" id="9BC-O0-zBT">
<rect key="frame" x="125.5" y="182" width="163.5" height="164"/>
<constraints>
<constraint firstAttribute="width" constant="163.5" id="Bb1-Zn-biS"/>
<constraint firstAttribute="height" constant="164" id="D0U-T9-voD"/>
</constraints>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="lanch_login_bg" translatesAutoresizingMaskIntoConstraints="NO" id="7pH-ay-Fxi">
<rect key="frame" x="158" y="782.5" width="98" height="39.5"/>
<constraints>
<constraint firstAttribute="width" constant="98" id="ppu-mJ-XpR"/>
</constraints>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="9BC-O0-zBT" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" constant="138" id="7Jh-Rh-Vbu"/>
<constraint firstItem="7pH-ay-Fxi" firstAttribute="centerX" secondItem="6Tk-OE-BBY" secondAttribute="centerX" id="AaS-o2-UmM"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="bottom" secondItem="7pH-ay-Fxi" secondAttribute="bottom" constant="40" id="drO-Se-JOO"/>
<constraint firstItem="9BC-O0-zBT" firstAttribute="centerX" secondItem="6Tk-OE-BBY" secondAttribute="centerX" id="tgZ-Ml-Dla"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="52.173913043478265" y="375"/>
</scene>
</scenes>
<resources>
<image name="lanch_login_bg" width="122" height="39.5"/>
<image name="lanch_loin_icon" width="163.5" height="164"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
//
// SMCheckOilBGView.h
// SkinMagnifier
//
// Created by nana on 2020/12/8.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMCheckOilBGView : UIView
@property(nonatomic, strong)void (^BtnSendBlock)(bool send);
- (void)faildViewHidden:(BOOL)hidden;
- (void)startAnimation;
- (void)stopAnimation;
@end
NS_ASSUME_NONNULL_END
//
// SMCheckOilBGView.m
// SkinMagnifier
//
// Created by nana on 2020/12/8.
//
#import "SMCheckOilBGView.h"
#import "RippleView.h"
@interface SMCheckOilBGView()
@property(nonatomic, strong)RippleView *rView;
@property(nonatomic, weak)UIImageView *tipsImageView;
@property(nonatomic, strong)UIView *faildView;
@property(nonatomic, strong)UIView *okView;
@end
@implementation SMCheckOilBGView
- (instancetype)init
{
self = [super init];
if (self) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.backgroundColor = rgba(0, 0, 0, 0.34);
UILabel *titleLabel = [[UILabel alloc] init];
titleLabel.attributedText = createAttString(@"水份检测", 17, rgba(255, 255, 255, 1));
[self addSubview:titleLabel];
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.top.mas_equalTo(safaTop(35.5));
}];
self.okView = [[UIView alloc] init];
self.okView.backgroundColor = [UIColor clearColor];
[self addSubview:self.okView];
[self.okView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.bottom.right.mas_equalTo(0);
}];
//请轻压放大镜保持3秒以上
UILabel *tipsLabel = [[UILabel alloc]init];
tipsLabel.attributedText = createAttString(@"请轻压放大镜保持3秒以上", 18, rgba(255, 255, 255, 1));
[self.okView addSubview:tipsLabel];
[tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.top.equalTo(titleLabel.mas_bottom).offset(78);
}];
UIImageView *tipsImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"dh_check_Oil_bg_1"]];
tipsImageView.animationImages = @[
[UIImage imageNamed:@"dh_check_Oil_bg_1"],
[UIImage imageNamed:@"dh_check_Oil_bg_1"],
[UIImage imageNamed:@"dh_check_Oil_bg_1"],
[UIImage imageNamed:@"dh_check_Oil_bg_1"],
[UIImage imageNamed:@"dh_check_Oil_bg_1"],
[UIImage imageNamed:@"dh_check_Oil_bg_1"],
[UIImage imageNamed:@"dh_check_Oil_bg_1"],
[UIImage imageNamed:@"dh_check_Oil_bg_1"],
[UIImage imageNamed:@"dh_check_Oil_bg_2"],
[UIImage imageNamed:@"dh_check_Oil_bg_2"],
[UIImage imageNamed:@"dh_check_Oil_bg_2"],
[UIImage imageNamed:@"dh_check_Oil_bg_2"],
[UIImage imageNamed:@"dh_check_Oil_bg_2"],
[UIImage imageNamed:@"dh_check_Oil_bg_2"],
[UIImage imageNamed:@"dh_check_Oil_bg_2"],
[UIImage imageNamed:@"dh_check_Oil_bg_2"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"],
[UIImage imageNamed:@"dh_check_Oil_bg_3"]];
[self.okView addSubview:tipsImageView];
_tipsImageView = tipsImageView;
[tipsImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(0);
// make.top.mas_equalTo(355);
}];
self.rView = [[RippleView alloc] init];
self.rView.rippleColor = rgba(60, 60, 60, 1);
[self.okView addSubview:self.rView];
[self.rView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.equalTo(tipsImageView);
make.size.mas_equalTo(CGSizeMake(200,200 ));
}];
[self startAnimation];
self.faildView = [[UIView alloc] init];
self.faildView.hidden = YES;
self.faildView.backgroundColor = [UIColor clearColor];
[self addSubview:self.faildView];
[self.faildView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.bottom.right.mas_equalTo(0);
}];
UIImageView *faildImageView = [[UIImageView alloc] init];
faildImageView.image = [UIImage imageNamed:@"sf_icon_failure"];
[self.faildView addSubview:faildImageView];
[faildImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.top.mas_equalTo(safaTop(186));
}];
UILabel *faildBigTips = [[UILabel alloc] init];
faildBigTips.attributedText = createAttString(@"检测失败", 20, [UIColor whiteColor]);
[self.faildView addSubview:faildBigTips];
[faildBigTips mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.top.equalTo(faildImageView.mas_bottom).offset(22);
}];
UILabel *faildlittleTips = [[UILabel alloc] init];
faildlittleTips.attributedText = createAttString(@"请检查设备是否使用正确", 15, [UIColor whiteColor]);
[self.faildView addSubview:faildlittleTips];
[faildlittleTips mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.top.equalTo(faildBigTips.mas_bottom).offset(14);
}];
UIButton *checkBtn = [[UIButton alloc] init];
[checkBtn addTarget:self action:@selector(checkBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[checkBtn setAttributedTitle:createAttString(@"重新检测", 15, [UIColor whiteColor]) forState:UIControlStateNormal];
[checkBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 124, 78, 1) size:CGSizeMake(255.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xf borderWidth:0 borderColor:[UIColor clearColor]] forState:UIControlStateNormal];
[self.faildView addSubview:checkBtn];
[checkBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.bottom.mas_equalTo(safaBottom(-108));
}];
UIButton *faildkBtn = [[UIButton alloc] init];
[faildkBtn addTarget:self action:@selector(faildkBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[faildkBtn setAttributedTitle:createAttString(@"取消检测", 15, [UIColor whiteColor]) forState:UIControlStateNormal];
[faildkBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(94, 69, 60, 1) size:CGSizeMake(255.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xf borderWidth:0 borderColor:[UIColor clearColor]] forState:UIControlStateNormal];
[self.faildView addSubview:faildkBtn];
[faildkBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.bottom.mas_equalTo(safaBottom(-48));
}];
}
- (void)checkBtnClick:(UIButton *)btn {
if (self.BtnSendBlock) {
self.BtnSendBlock(YES);
}
}
- (void)faildkBtnClick:(UIButton *)btn {
if (self.BtnSendBlock) {
self.BtnSendBlock(NO);
}
}
- (void)startAnimation {
[self.tipsImageView startAnimating];
[self.rView startAnimation];
}
- (void)stopAnimation {
[self.tipsImageView stopAnimating];
[self.rView stopAnimation];
}
- (void)faildViewHidden:(BOOL)hidden {
self.faildView.hidden = hidden;
self.okView.hidden = !hidden;
}
@end
//
// SMClientCell.h
// SkinMagnifier
//
// Created by nana on 2020/11/6.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMClientCell : UITableViewCell
@property(nonatomic, strong)UIImageView *iconImageView;
@property(nonatomic, strong)UILabel *nameLabel;
@property(nonatomic, strong)UILabel *timeLabel;
@property(nonatomic, strong)UIButton *cameraBtn;
@property(nonatomic, copy)void (^cameraBlock)(void);
@end
NS_ASSUME_NONNULL_END
//
// SMClientCell.m
// SkinMagnifier
//
// Created by nana on 2020/11/6.
//
#import "SMClientCell.h"
@implementation SMClientCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.iconImageView = [[UIImageView alloc] init];
self.iconImageView.contentMode = UIViewContentModeScaleAspectFill;
self.iconImageView.layer.cornerRadius = 22;
self.iconImageView.layer.masksToBounds = YES;
self.iconImageView.image = [UIImage imageNamed:@"customer_logo"];
[self.contentView addSubview:self.iconImageView];
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.mas_equalTo(20);
make.bottom.mas_equalTo(-20);
make.size.mas_equalTo(CGSizeMake(44, 44));
}];
UIView *contLabelView = [[UIView alloc] init];
[self.contentView addSubview:contLabelView];
[contLabelView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.iconImageView.mas_right).offset(4.5);
make.right.mas_equalTo(0);
make.centerY.mas_equalTo(0);
}];
self.nameLabel = [[UILabel alloc] init];
self.nameLabel.attributedText = createAttString(@"xxxx", 18, rgba(76, 74, 66, 1));
[contLabelView addSubview:self.nameLabel];
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.mas_equalTo(0);
make.right.mas_equalTo(-60);
}];
self.timeLabel = [[UILabel alloc] init];
self.timeLabel.attributedText = createAttString(@"建档:2018", 12,rgba(153, 153, 153, 1));
[contLabelView addSubview:self.timeLabel];
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.left.mas_equalTo(0);
make.top.equalTo(self.nameLabel.mas_bottom).offset(10);
}];
self.cameraBtn = [[UIButton alloc] init];
[self.cameraBtn addTarget:self action:@selector(cameraClick:) forControlEvents:UIControlEventTouchUpInside];
[self.cameraBtn wb_setImageName:@"list_icon_xj"];
[self.contentView addSubview:self.cameraBtn];
[self.cameraBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self.iconImageView);
make.right.mas_equalTo(-8.5);
make.size.mas_equalTo(CGSizeMake(40, 40));
}];
UIView *lineView = [[UIView alloc] init];
lineView.backgroundColor = rgba(229, 229, 229, 1);
lineView.layer.cornerRadius = 0.25;
[self.contentView addSubview:lineView];
[lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(23);
make.right.mas_equalTo(-20);
make.bottom.mas_equalTo(0);
make.height.mas_equalTo(0.5);
}];
}
- (void)cameraClick:(UIButton *)btn {
if (self.cameraBlock) {
self.cameraBlock();
}
}
@end
//
// SMClientDetailCell.h
// SkinMagnifier
//
// Created by nana on 2020/12/4.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMClientDetailCell : UITableViewCell
@property(nonatomic, strong)UILabel *timeLabel;
@property(nonatomic, strong)UILabel *typeLabel;
@end
NS_ASSUME_NONNULL_END
//
// SMClientDetailCell.m
// SkinMagnifier
//
// Created by nana on 2020/12/4.
//
#import "SMClientDetailCell.h"
@interface SMClientDetailCell()
@end
@implementation SMClientDetailCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self setupUI];
}
return self;
}
- (void)setupUI {
UIImageView *timeIconImageView = [[UIImageView alloc] init];
timeIconImageView.image = [UIImage imageNamed:@"client_time_bg"];
[self.contentView addSubview:timeIconImageView];
[timeIconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(14.5);
make.top.mas_equalTo(21);
make.bottom.mas_equalTo(-21);
make.size.mas_equalTo(CGSizeMake(34, 34));
}];
self.timeLabel = [[UILabel alloc] init];
self.timeLabel.attributedText = createAttString(@"2020/05/20 15:23:03 ", 14, rgba(76, 74, 66, 1));
[self.contentView addSubview:self.timeLabel];
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(timeIconImageView.mas_right).offset(14.5);
make.centerY.equalTo(timeIconImageView);
}];
self.typeLabel = [[UILabel alloc] init];
self.typeLabel.attributedText = createAttString(@"鼻子", 14, rgba(76, 74, 66, 1));
[self.contentView addSubview:self.typeLabel];
[self.typeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-69.5);
make.centerY.equalTo(timeIconImageView);
}];
UIImageView *moreImageView = [[UIImageView alloc] init];
moreImageView.image = [UIImage imageNamed:@"customer_icon_xyb"];
[self.contentView addSubview:moreImageView];
[moreImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-16.5);
make.centerY.equalTo(timeIconImageView);
}];
UIView *lineView = [[UIView alloc] init];
lineView.backgroundColor = rgba(229, 229, 229, 1);
[self.contentView addSubview:lineView];
[lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.right.mas_equalTo(-16);
make.bottom.mas_equalTo(0);
make.height.mas_equalTo(1);
}];
}
@end
//
// SMClientDetailModel.h
// SkinMagnifier
//
// Created by nana on 2020/12/16.
//
#import "JFBaseModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface SMClientDetailModel : JFBaseModel
//顾客案例组ID
@property(nonatomic, strong)NSString *ID;
// 创建时间
@property(nonatomic, strong)NSString *createtime;
// 名字
@property(nonatomic, strong)NSString *iposition;
@end
NS_ASSUME_NONNULL_END
//
// SMClientDetailModel.m
// SkinMagnifier
//
// Created by nana on 2020/12/16.
//
#import "SMClientDetailModel.h"
@implementation SMClientDetailModel
@end
//
// SMClientDetailViewController.h
// SkinMagnifier
//
// Created by nana on 2020/12/4.
//
#import <UIKit/UIKit.h>
#import "SMClientListModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface SMClientDetailViewController : UIViewController
@property(nonatomic, strong)SMClientListModel *clinetModel;
@end
NS_ASSUME_NONNULL_END
//
// SMClientDetailViewController.m
// SkinMagnifier
//
// Created by nana on 2020/12/4.
//
#import "SMClientDetailViewController.h"
#import "SMClientDetailCell.h"
#import "SMCreateClientViewController.h"
#import "SMTakeImageViewController.h"
#import "SMLocalReportModel.h"
#import "SMEditPositionNameView.h"
#import "SMReportViewController.h"
#import "SMLinkDeviceView.h"
#import "SDImageCache.h"
#import "SMClientDetailModel.h"
@interface SMClientDetailViewController ()<UITableViewDataSource,UITableViewDelegate>
@property(nonatomic, strong)UIImageView *iconImageView;
@property(nonatomic, strong)UIImageView *editImageView;
@property(nonatomic, strong)UIImageView *sexImageView;
@property(nonatomic, strong)UILabel *namaLabel;
@property(nonatomic, strong)UILabel *timeLabel;
/// 本地数据
@property(nonatomic, strong)NSMutableArray *dataArray;
/// 网络数据
@property(nonatomic, strong)NSMutableArray *netWorkdataArray;
@property(nonatomic, weak)UITableView *mainTableView;
@end
@implementation SMClientDetailViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.dataArray = [[NSMutableArray alloc] init];
self.netWorkdataArray = [[NSMutableArray alloc] init];
self.view.backgroundColor = rgba(243, 243, 243, 1);
UIImageView *bgImageView = [[UIImageView alloc] init];
bgImageView.image = [UIImage imageNamed:@"report_header_bg"];
[self.view addSubview:bgImageView];
[bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.mas_equalTo(0);
}];
UIButton *iconbgBtn = [[UIButton alloc] init];
[iconbgBtn addTarget:self action:@selector(iconbgBtnClick:) forControlEvents:UIControlEventTouchUpInside];
iconbgBtn.backgroundColor = [UIColor clearColor];
iconbgBtn.layer.borderColor = [UIColor whiteColor].CGColor;
iconbgBtn.layer.borderWidth = 2;
iconbgBtn.layer.masksToBounds = YES;
iconbgBtn.layer.cornerRadius = 68/2;
[self.view addSubview:iconbgBtn];
[iconbgBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(28.5);
make.top.mas_equalTo(safaTop(62));
make.size.mas_equalTo(CGSizeMake(68, 68));
}];
self.iconImageView = [[UIImageView alloc] init];
self.iconImageView.contentMode = UIViewContentModeScaleAspectFill;
self.iconImageView.layer.masksToBounds = YES;
self.iconImageView.layer.cornerRadius = 24;
[self.view addSubview:self.iconImageView];
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(iconbgBtn);
make.size.mas_equalTo(CGSizeMake(48, 48));
}];
UIButton *editBtn = [[UIButton alloc] init];
editBtn.userInteractionEnabled = NO;
[editBtn setBackgroundImage:[UIImage imageNamed:@"customer_image_bg"] forState:UIControlStateNormal];
[self.view addSubview:editBtn];
[editBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.iconImageView);
make.bottom.equalTo(self.iconImageView).offset(10);
make.size.mas_equalTo(CGSizeMake(16, 16));
}];
self.namaLabel = [[UILabel alloc] init];
[self.view addSubview: self.namaLabel];
[self.namaLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(iconbgBtn.mas_right).offset(15);
make.top.mas_equalTo(safaTop(72));
make.right.mas_lessThanOrEqualTo(-100);
}];
self.sexImageView = [[UIImageView alloc] init];
[self.view addSubview:self.sexImageView];
[self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.namaLabel);
make.left.equalTo(self.namaLabel.mas_right).offset(4);
}];
self.timeLabel = [[UILabel alloc] init];
[self.view addSubview: self.timeLabel];
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(iconbgBtn.mas_right).offset(15);
make.bottom.equalTo(iconbgBtn).offset(-10);
}];
UIButton *takebtn = [[UIButton alloc] init];
[takebtn addTarget:self action:@selector(takeImageClick:) forControlEvents:UIControlEventTouchUpInside];
[takebtn wb_setImageName:@"customer_xj"];
[self.view addSubview:takebtn];
[takebtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(39.5, 39.5));
make.right.mas_equalTo(-15.5);
make.centerY.equalTo(iconbgBtn);
}];
UITableView *mainTableView = [[UITableView alloc] init];
_mainTableView = mainTableView;
@weakify(self);
self.mainTableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
@strongify(self);
[self requestDataWithCurrerisHeader:YES];
}];
self.mainTableView.mj_footer = [MJRefreshBackFooter footerWithRefreshingBlock:^{
@strongify(self);
[self requestDataWithCurrerisHeader:NO];
}];
mainTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
UIView *headerView = [[UIView alloc] init];
headerView.backgroundColor = [UIColor whiteColor];
headerView.frame = CGRectMake(0, 0, 50, 30);
mainTableView.tableHeaderView = headerView;
mainTableView.dataSource = self;
mainTableView.delegate = self;
mainTableView.layer.masksToBounds = YES;
mainTableView.layer.cornerRadius = 10;
// mainTableView.backgroundColor = [UIColor wb_randColor];
[mainTableView registerClass:[SMClientDetailCell class] forCellReuseIdentifier:NSStringFromClass([SMClientDetailCell class])];
[self.view addSubview: mainTableView];
[mainTableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(15);
make.right.mas_equalTo(-15);
make.bottom.mas_equalTo(0);
make.top.mas_equalTo(safaTop(174));
}];
UIButton *checkBtn = [[UIButton alloc] init];
checkBtn.userInteractionEnabled = NO;
[checkBtn setAttributedTitle: createAttString(@"单点检测", 14, rgba(255, 126, 65, 1)) forState:UIControlStateNormal];
UIImage *cImage = [[UIImage wb_imageWithColor:rgba(255, 239, 228, 1) size:CGSizeMake(100, 32)] sd_roundedCornerImageWithRadius:16 corners:0xf borderWidth:2 borderColor:[UIColor whiteColor]];
[checkBtn setBackgroundImage:cImage forState:UIControlStateNormal];
[self.view addSubview:checkBtn];
[checkBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(mainTableView.mas_top);
make.left.mas_equalTo(mainTableView).offset(13);
}];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self requestDataWithCurrerisHeader:YES];
[self.iconImageView sd_setImageWithURL:[NSURL URLWithString:self.clinetModel.clientimg] placeholderImage:[UIImage imageNamed:@"customer_logo"]];
self.namaLabel.attributedText = createAttString(self.clinetModel.cname, 25, rgba(68, 57, 53, 1));
if ([self.clinetModel.sex isEqualToString:@"0"]) {
self.sexImageView.image = [UIImage imageNamed:@"sex_nv_icon"];
}else {
self.sexImageView.image = [UIImage imageNamed:@"sex_nan_icon"];
}
NSString *dateString = timestampString(self.clinetModel.createtime.longLongValue/1000,@"YYYY/MM/dd hh:mm:ss");
self.timeLabel.attributedText = createAttString([NSString stringWithFormat:@"建档: %@",dateString], 12, rgba(68, 57, 53, 1));
}
- (void)takeImageClick:(UIButton *)btn {
@weakify(self);
if (islinkDeviceWifi()) {
SMTakeImageViewController *vc = [[SMTakeImageViewController alloc] init];
vc.clinetModel = self.clinetModel;
[self.navigationController pushViewController:vc animated:YES];
}else {
SMLinkDeviceView *linkView = [[SMLinkDeviceView alloc] init];
linkView.flishBlock = ^{
@strongify(self);
SMTakeImageViewController *vc = [[SMTakeImageViewController alloc] init];
vc.clinetModel = self.clinetModel;
[self.navigationController pushViewController:vc animated:YES];
};
[linkView wb_showFromSuperView: self.view];
}
}
- (void)requestDataWithCurrerisHeader:(BOOL)isHeader{
int from = (int)self.dataArray.count ;
if (isHeader) {
from = 0;
}
NSMutableArray *dataArray = [[SMLocalReportBManager sharedManager] selectWithCid:self.clinetModel.ID from:from];
for (SMLocalReportModel *model in dataArray) {
if (model.moisture.oMethod && model.AISymptomArray.count == 0) {
SMLocalReportAIModel *shuifenModel = [[SMLocalReportAIModel alloc] init];
shuifenModel.tagFlag = @"magn_water";
shuifenModel.tagValue = model.moisture.ofen;
shuifenModel.aiImageUrl = @"";
shuifenModel.dermalogicatext = model.moisture.oMethod;
shuifenModel.tagname = @"水份";
[model.AISymptomArray addObject:shuifenModel];
}
}
if (isHeader) {
[self.dataArray removeAllObjects];
}
if (dataArray.count) {
[self.dataArray addObjectsFromArray:dataArray];
if (dataArray.count == KPageSize) {
[self.mainTableView.mj_footer endRefreshing];
[self.mainTableView.mj_header endRefreshing];
[self.mainTableView reloadData];
return;
}
}
[self.mainTableView.mj_footer endRefreshing];
[self.mainTableView.mj_header endRefreshing];
[self.mainTableView reloadData];
if (TARGET_IPHONE_SIMULATOR == 1 && TARGET_OS_IPHONE == 1) {
}else {
if (islinkDeviceWifi()) {
return;
}
}
NSMutableDictionary *pDict = [[NSMutableDictionary alloc] init];
pDict[@"pageSize"] = [NSString stringWithFormat:@"%d",KPageSize];
pDict[@"clientid"] = self.clinetModel.ID;
if (isHeader) {
pDict[@"currentPage"] = @"1";
}else {
pDict[@"currentPage"] = [NSString stringWithFormat:@"%ld" ,(self.netWorkdataArray.count /KPageSize)+(self.netWorkdataArray.count % KPageSize ? 1:0)+1];
}
@weakify(self);
[self.view postFormDataWithUrl:@"/magnifier/client/findClientMagnifierCgList" params:pDict success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
@strongify(self);
[self.mainTableView.mj_header endRefreshing];
[self.mainTableView.mj_footer endRefreshing];
if ([JsonData.code isEqualToString:@"200"]) {
NSArray *netWorkdataArray = [SMClientDetailModel mj_objectArrayWithKeyValuesArray:((NSDictionary *)JsonData.data)[@"magnifierCaseGroups"]];
if (netWorkdataArray.count) {
if (isHeader) {
[self.netWorkdataArray removeAllObjects];
}
[self.netWorkdataArray addObjectsFromArray:netWorkdataArray];
}
[self.mainTableView reloadData];
}
}];
}
- (void)iconbgBtnClick:(UIButton *)btn {
SMCreateClientViewController *vc = [[SMCreateClientViewController alloc] init];
vc.clientModel = self.clinetModel;
[self.navigationController pushViewController:vc animated:YES];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (section == 0) {
return self.dataArray.count;
}
return self.netWorkdataArray.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
SMClientDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([SMClientDetailCell class])];
if (indexPath.section == 0) {
SMLocalReportModel *localmodel = self.dataArray[indexPath.row];
cell.timeLabel.attributedText = createAttString(timestampString(localmodel.createTime.longLongValue, @"YYYY-MM-dd HH:mm:ss"), 14, rgba(76, 74, 66, 1));
cell.typeLabel.attributedText = createAttString(localmodel.iposition, 14, rgba(76, 74, 66, 1));
}else if (indexPath.section ==1) {
SMClientDetailModel *netmodel = self.netWorkdataArray[indexPath.row];
cell.timeLabel.attributedText = createAttString(timestampString(netmodel.createtime.longLongValue, @"YYYY-MM-dd HH:mm:ss"), 14, rgba(76, 74, 66, 1));
cell.typeLabel.attributedText = createAttString(netmodel.iposition, 14, rgba(76, 74, 66, 1));
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
@weakify(self);
if (indexPath.section == 0) {
SMReportViewController *vc = [[SMReportViewController alloc] init];
vc.clinetModel = self.clinetModel;
vc.lrModel = self.dataArray[indexPath.row];
[self.navigationController pushViewController:vc animated:YES];
}else {
NSLog(@"网络跳转");
SMClientDetailModel *dModel = self.netWorkdataArray[indexPath.row];
[self.view postFormDataWithUrl:@"/magnifier/report/findAiAnalysisReportByCgid" params:@{@"id":dModel.ID} success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
@strongify(self);
if ([JsonData.code isEqualToString:@"200"]) {
NSDictionary *resDict = (NSDictionary *)JsonData.data;
SMLocalReportModel *lrModel = [SMLocalReportModel new];
lrModel.mid = [SMGlobalModel share].mid;
lrModel.cid = self.clinetModel.ID;
lrModel.cgid =dModel.ID;
lrModel.iposition = resDict[@"iposition"];
lrModel.moisture.ofen = [NSString stringWithFormat:@"%@",resDict[@"magnifierCgroup"][@"moisture"]] ;
lrModel.createTime = resDict[@"createtime"];
NSArray *imageNameArray = [@"日光图,极化图,纹理图,UV图,日光图" componentsSeparatedByString:@","];
for (NSDictionary *dict in resDict[@"images"]) {
SMLocalReportImageModel *imgModel = [SMLocalReportImageModel new];
imgModel.iType = dict[@"lighttype"];
imgModel.iURL = dict[@"imgUrl"];
imgModel.iname = imageNameArray[imgModel.iType.intValue];
[lrModel.imageArray addObject:imgModel];
}
for (NSDictionary *dict in resDict[@"analysisReportAitagnameLinkGoods"]) {
SMLocalReportProductModel *proModel = [SMLocalReportProductModel new];
proModel.pType = [NSString stringWithFormat:@"%@", dict[@"goodstype"]];
proModel.pName = dict[@"goodsname"];
proModel.pId = dict[@"id"];
[lrModel.productArray addObject:proModel];
}
NSArray *magnifierCustomReports = resDict[@"magnifierCustomReports"];
for (NSDictionary *dict in magnifierCustomReports) {
SMLocalReportSymptomModel *symModel = [SMLocalReportSymptomModel new];
symModel.sID = dict[@"areportLinkAitagnameId"];
symModel.sName = dict[@"tagname"];
symModel.sMethod = dict[@"dermalogicatext"];
[lrModel.symptomArray addObject:symModel];
}
lrModel.AISymptomArray = [SMLocalReportAIModel mj_objectArrayWithKeyValuesArray: resDict[@"magnifierReports"]];
NSMutableArray *reImgeArray = [[NSMutableArray alloc] init];
[reImgeArray addObjectsFromArray:[lrModel.imageArray valueForKey:@"iURL"]];
[reImgeArray addObjectsFromArray:[lrModel.AISymptomArray valueForKey:@"aiImageUrl"]];;
for (int i = 0; i <reImgeArray.count; i++) {
NSString *xinImgUrl = reImgeArray[i];
if (xinImgUrl.length < 5 ||
[xinImgUrl containsString:@"djm-skin.oss-cn-shenzhen.aliyuncs.com"]) {
continue;
}
NSString *jiuImgUrl = [xinImgUrl stringByReplacingOccurrencesOfString:@"imoreme.oss-cn-shenzhen.aliyuncs.com" withString:@"djm-skin.oss-cn-shenzhen.aliyuncs.com"];
if (![self localImgCunZaiWithString:xinImgUrl] &&
[self localImgCunZaiWithString:jiuImgUrl] ) {
NSString *cacheKey = [[SDWebImageManager sharedManager] cacheKeyForURL:[NSURL URLWithString:jiuImgUrl]];
UIImage *img = [[SDImageCache sharedImageCache] imageFromDiskCacheForKey:cacheKey];
[[SDImageCache sharedImageCache] storeImage:img forKey: xinImgUrl completion:^{
}];
}
}
SMReportViewController *vc = [[SMReportViewController alloc] init];
vc.clinetModel = self.clinetModel;
vc.lrModel = lrModel;
vc.netWorkData = YES;
[self.navigationController pushViewController:vc animated:YES];
}
}];
}
}
- (BOOL)localImgCunZaiWithString:(NSString *)imgString {
NSString *xincacheKey = [[SDWebImageManager sharedManager] cacheKeyForURL:[NSURL URLWithString:imgString]];
BOOL xinCZ = [[SDImageCache sharedImageCache] diskImageDataExistsWithKey:xincacheKey];
return xinCZ;
}
- (UISwipeActionsConfiguration *)tableView:(UITableView *)tableView trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath {
@weakify(self);
UIContextualAction *deleteRowAction = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:@"delete" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
//左滑删除之后数据处理操作
@strongify(self);
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"确定删除当前案例组吗?" message:@"" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *conform = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
if (indexPath.section == 0) {
SMLocalReportModel *model = self.dataArray[indexPath.row];
NSArray *localDataArray = [[SMLocalReportBManager sharedManager] selectWithCgid:model.cgid];
if (localDataArray.count == 0) {
[SVProgressHUD showErrorWithStatus:@"本地数据变成网络数据,有网的时候再删除"];
return ;
}
SMLocalReportModel *localModel = localDataArray.firstObject;
if ([localModel.uploadLock isEqualToString:@"1"]) {
[SVProgressHUD showErrorWithStatus:@"本地数据变成网络数据,有网的时候再删除"];
return ;
}
[[SMLocalReportBManager sharedManager] deleteWitCgid:model.cgid];
[self.dataArray removeObjectAtIndex:indexPath.row];
[self.mainTableView reloadData];
}else {
NSLog(@"网络删除");
SMClientDetailModel *dModel = self.netWorkdataArray[indexPath.row];
NSMutableDictionary *pDict = [[NSMutableDictionary alloc] init];
pDict[@"id"] = dModel.ID;
[self.view postFormDataWithUrl:@"/magnifierCaseGroup/delCaseGroupBycgid" params:pDict success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
@strongify(self);
if ([JsonData.code isEqualToString:@"200"]) {
[self.netWorkdataArray removeObjectAtIndex:indexPath.row];
[self.mainTableView reloadData];
}else {
[SVProgressHUD showErrorWithStatus:@"删除失败"];
}
}];
}
}];
UIAlertAction *cancleAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
}];
[alert addAction:cancleAction];
[alert addAction:conform];
[self presentViewController:alert animated:YES completion:nil];
}];
deleteRowAction.image = [UIImage imageNamed:@"client_list_button_ch_delete"];//给删除赋值图片
deleteRowAction.backgroundColor = rgba(233, 147, 117, 1);//删除背景颜色
UIContextualAction *editRowAction = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:@"delete" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
//左滑删除之后数据处理操作
@strongify(self);
SMEditPositionNameView *nameView = [[SMEditPositionNameView alloc] init];
[nameView wb_showFromSuperView:self.view];
if (indexPath.section == 0) {
SMLocalReportModel *model = self.dataArray[indexPath.row];
[nameView configInputValue:model.iposition];
}else {
SMClientDetailModel *dModel = self.netWorkdataArray[indexPath.row];
[nameView configInputValue:dModel.iposition];
}
@weakify(nameView);
nameView.saveBlock = ^(NSString * _Nonnull str) {
@strongify(self);
@strongify(nameView);
[nameView wb_disMiss];
if (indexPath.section == 0) {
SMLocalReportModel *model = self.dataArray[indexPath.row];
NSArray *localDataArray = [[SMLocalReportBManager sharedManager] selectWithCgid:model.cgid];
if (localDataArray.count == 0) {
[SVProgressHUD showErrorWithStatus:@"本地数据变成网络数据,有网的时候再编辑"];
return ;
}
SMLocalReportModel *localModel = localDataArray.firstObject;
if ([localModel.uploadLock isEqualToString:@"1"]) {
[SVProgressHUD showErrorWithStatus:@"本地数据变成网络数据,有网的时候再编辑"];
return ;
}
model.iposition = str;
[[SMLocalReportBManager sharedManager] updateWithModel:model cgid:model.cgid];
[self.mainTableView reloadData];
}else {
NSLog(@"网络编辑");
SMClientDetailModel *dModel = self.netWorkdataArray[indexPath.row];
NSMutableDictionary *pDict = [[NSMutableDictionary alloc] init];
pDict[@"id"] = dModel.ID;
pDict[@"iposition"] =str;
[self.view postJsonWithUrl:@"/magnifierCaseGroup/updateMagnifierCaseGroup" params:pDict success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
@strongify(self);
if ([JsonData.code isEqualToString:@"200"]) {
dModel.iposition = str;
[self.mainTableView reloadData];
}else {
[SVProgressHUD showErrorWithStatus:@"编辑失败"];
}
}];
}
};
}];
editRowAction.image = [UIImage imageNamed:@"customer_edit"];//给删除赋值图片
editRowAction.backgroundColor =rgba(218, 120, 86, 1);//删除背景颜色
UISwipeActionsConfiguration *Configuration = [UISwipeActionsConfiguration configurationWithActions:@[deleteRowAction,editRowAction]];
return Configuration;
}
@end
//
// SMClientListModel.h
// SkinMagnifier
//
// Created by nana on 2020/12/4.
//
#import "JFBaseModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface SMClientListModel : JFBaseModel
/// 顾客ID
@property(nonatomic, strong)NSString *ID;
/// 创建时间
@property(nonatomic, strong)NSString *createtime;
/// 头像
@property(nonatomic, strong)NSString *clientimg;
/// 名字
@property(nonatomic, strong)NSString *cname;
/// 名字
@property(nonatomic, strong)NSString *sex;
/// 手机
@property(nonatomic, strong)NSString *telphone;
/// 生日
@property(nonatomic, strong)NSString *birthday;
/// 地区
@property(nonatomic, strong)NSString *areatxt;
/// 地址
@property(nonatomic, strong)NSString *address;
@property(nonatomic, strong)NSString *areacity;
@property(nonatomic, strong)NSString *arearegion;
@property(nonatomic, strong)NSString *areaprovince;
@end
NS_ASSUME_NONNULL_END
//
// SMClientListModel.m
// SkinMagnifier
//
// Created by nana on 2020/12/4.
//
#import "SMClientListModel.h"
@implementation SMClientListModel
@end
//
// SMClientViewController.h
// SkinMagnifier
//
// Created by nana on 2020/11/6.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMClientViewController : UIViewController
@end
NS_ASSUME_NONNULL_END
//
// SMClientViewController.m
// SkinMagnifier
//
// Created by nana on 2020/11/6.
//
#import "SMClientViewController.h"
#import "SMSearchBar.h"
#import "SMClientCell.h"
#import "SMCreateClientViewController.h"
#import "SMTakeImageViewController.h"
#import "SMClientListModel.h"
#import "SMClientDetailViewController.h"
#import "SMLinkDeviceView.h"
@interface SMClientViewController ()<UITableViewDataSource,UITableViewDelegate>
@property(nonatomic, strong)UITableView *mainTableView;
@property(nonatomic, strong)NSMutableArray *dataArray;
@property(nonatomic, assign)bool isRequest;
@property(nonatomic, strong)NSString *searchString;
@end
@implementation SMClientViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.dataArray = [[NSMutableArray alloc] init];
self.view.backgroundColor = [UIColor whiteColor];
self.wb_titleLabel.text = @"档案列表";
SMSearchBar *searchBar = [[SMSearchBar alloc] init];
@weakify(searchBar);
searchBar.valueChangeBlock = ^(NSString * _Nonnull value, bool endEdit) {
@strongify(searchBar);
[self tfValueChange:searchBar.inputTF];
};
[self.view addSubview:searchBar];
[searchBar mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(safaTop(77.5));
make.height.mas_equalTo(35);
make.left.mas_equalTo(10);
make.right.mas_equalTo(-10);
}];
self.mainTableView = [[UITableView alloc] init];
@weakify(self);
self.mainTableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
@strongify(self);
[self requestDataWithCurrerPage:@"1"];
}];
self.mainTableView.mj_footer = [MJRefreshBackFooter footerWithRefreshingBlock:^{
@strongify(self);
int page = (int)self.dataArray.count / KPageSize ;
page += self.dataArray.count % KPageSize?1:0;;
NSString *pageString = [NSString stringWithFormat:@"%d",page+1];
[self requestDataWithCurrerPage:pageString];
}];
self.mainTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.mainTableView.dataSource = self;
self.mainTableView.delegate = self;
[self.mainTableView registerClass:[SMClientCell class] forCellReuseIdentifier:NSStringFromClass([SMClientCell class])];
[self.view addSubview:self.mainTableView];
[self.mainTableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(@150);
make.bottom.mas_equalTo(0);
make.left.mas_equalTo(0);
make.right.mas_equalTo(0);
}];
UIButton *createBtn = [[UIButton alloc] init];
[createBtn wb_setImageName:@"list_button_add"];
[createBtn addTarget:self action:@selector(createBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:createBtn];
[createBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(-100);
make.right.mas_equalTo(-15);
}];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.mainTableView reloadData];
if (!islinkDeviceWifi()) {
[self requestDataWithCurrerPage:@"1"];
}
}
- (void)requestDataWithCurrerPage:(NSString *)page {
self.isRequest = YES;
NSMutableDictionary *pDict = [[NSMutableDictionary alloc] init];
pDict[@"pageSize"] = [NSString stringWithFormat:@"%d",KPageSize];
pDict[@"mid"] = [SMGlobalModel share].mid;
pDict[@"currentPage"] = page;
pDict[@"searchtxt"] = self.searchString;
@weakify(self);
[self.view postFormDataWithUrl:@"/magnifier/client/findClientList" params:pDict success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
@strongify(self);
self.isRequest = NO;
[self.mainTableView.mj_header endRefreshing];
[self.mainTableView.mj_footer endRefreshing];
if ([JsonData.code isEqualToString:@"200"]) {
NSArray *dataArray = [SMClientListModel mj_objectArrayWithKeyValuesArray:JsonData.data];
if ([page isEqualToString:@"1"]) {
[self.dataArray removeAllObjects];
}
if (dataArray) {
[self.dataArray addObjectsFromArray:dataArray];
}
[self.mainTableView reloadData];
}
}];
}
- (void)createBtnClick:(UIButton *)btn {
SMCreateClientViewController *vc = [SMCreateClientViewController new];
[self.navigationController pushViewController:vc animated:YES];
}
- (void)tfValueChange:(UITextField *)tf {
self.searchString = tf.text;
if (self.isRequest == NO) {
[self requestDataWithCurrerPage:@"1"];
}
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.dataArray.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
SMClientListModel *model = self.dataArray[indexPath.row];
SMClientCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([SMClientCell class])];
[cell.iconImageView sd_setImageWithURL:[NSURL URLWithString:model.clientimg] placeholderImage:[UIImage imageNamed:@"customer_logo"]];
cell.nameLabel.attributedText = createAttString(model.cname, 18, rgba(76, 74, 66, 1));
NSString *dateString = timestampString(model.createtime.longLongValue/1000,@"YYYY/MM/dd");
cell.timeLabel.attributedText = createAttString([NSString stringWithFormat:@"建档 %@",dateString], 12, rgba(153, 153, 153, 1));
@weakify(self);
cell.cameraBlock = ^{
@strongify(self)
// NSMutableDictionary *pDict = [[NSMutableDictionary alloc] init];
// pDict[@"mid"] = [SMGlobalModel share].mid
// [self.view postFormDataWithUrl:@"/magnifier/member/verifyMemberInfo" params:pDict success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
// @strongify(self);
// if ([JsonData.code isEqualToString:@"200"]) {
//
// }else {
//
// }
// }];
if (islinkDeviceWifi()) {
SMTakeImageViewController *vc = [[SMTakeImageViewController alloc] init];
vc.clinetModel =model;
[self.navigationController pushViewController:vc animated:YES];
}else {
SMLinkDeviceView *linkView = [[SMLinkDeviceView alloc] init];
linkView.flishBlock = ^{
@strongify(self);
SMTakeImageViewController *vc = [[SMTakeImageViewController alloc] init];
vc.clinetModel =model;
[self.navigationController pushViewController:vc animated:YES];
};
[linkView wb_showFromSuperView: self.view];
}
};
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:NO];
SMClientDetailViewController *vc = [[SMClientDetailViewController alloc] init];
vc.clinetModel = self.dataArray[indexPath.row];
[self.navigationController pushViewController:vc animated:YES];
}
//-trailingSwipeActionsConfigurationForRowAtIndexPat
- (UISwipeActionsConfiguration *)tableView:(UITableView *)tableView trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath {
SMClientListModel *model = self.dataArray[indexPath.row];
@weakify(self);
UIContextualAction *deleteRowAction = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:@"delete" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
//左滑删除之后数据处理操作
@strongify(self);
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"确定删除当前顾客吗?" message:@"" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *conform = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSMutableDictionary *pDict = [[NSMutableDictionary alloc] init];
pDict[@"mid"] = [SMGlobalModel share].mid;
pDict[@"clientid"] = model.ID;
[self.view postFormDataWithUrl:@"/magnifier/client/delClientMagnifier" params:pDict success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
if ([JsonData.code isEqualToString:@"200"]) {
@strongify(self);
[self.dataArray removeObjectAtIndex:indexPath.row];
[self.mainTableView reloadData];
};
}];
}];
UIAlertAction *cancleAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
}];
[alert addAction:cancleAction];
[alert addAction:conform];
[self presentViewController:alert animated:YES completion:nil];
}];
deleteRowAction.image = [UIImage imageNamed:@"client_list_button_ch_delete"];//给删除赋值图片
deleteRowAction.backgroundColor = rgba(233, 147, 117, 1);//删除背景颜色
UISwipeActionsConfiguration *Configuration = [UISwipeActionsConfiguration configurationWithActions:@[deleteRowAction]];
return Configuration;
}
@end
//
// SMCreateClientViewController.h
// SkinMagnifier
//
// Created by nana on 2020/11/6.
//
#import <UIKit/UIKit.h>
#import "SMClientListModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface SMCreateClientViewController : UIViewController
@property(nonatomic, strong)SMClientListModel *clientModel;
@end
NS_ASSUME_NONNULL_END
//
// SMCreateClientViewController.m
// SkinMagnifier
//
// Created by nana on 2020/11/6.
//
#import "SMCreateClientViewController.h"
#import "SMTakeImageViewController.h"
#import <AFNetworking.h>
#import "MTRAreaPickView.h"
#import <MOFSPickerManager/MOFSPickerManager.h>
#import <TZImagePickerController.h>
#import <SDWebImage/SDImageCache.h>
#import "SMLinkDeviceView.h"
@interface SMCreateClientViewController ()
@property(nonatomic, strong)NSMutableArray *labelArray;
@property(nonatomic, strong)UIButton *iconBtn;
@property(nonatomic, strong)UITextField *nameTF;
@property(nonatomic, strong)UIButton *grilBtn;
@property(nonatomic, strong)UIButton *boyBtn;
@property(nonatomic, strong)UITextField *phoneTF;
@property(nonatomic, strong)UIButton *birthdayBtn;
@property(nonatomic, strong)UIButton *areaBtn;
@property(nonatomic, strong)UITextField *addressTF;
@property(nonatomic, strong)UIButton *saveBtn;
@property(nonatomic, strong)MTRAreaPickView *rpView;
@property(nonatomic, strong)NSString *sex;
@property(nonatomic, strong)NSString *areaprovince;
@property(nonatomic, strong)NSString *areacity;
@property(nonatomic, strong)NSString *arearegion;
@property(nonatomic, strong)NSString *areatxt;
@end
@implementation SMCreateClientViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.rpView = [[MTRAreaPickView alloc] init];
self.labelArray = [[NSMutableArray alloc] init];
self.view.backgroundColor = [UIColor whiteColor];
if (self.clientModel.ID) {
self.wb_titleLabel.text = @"编辑档案";
}else {
self.wb_titleLabel.text = @"新建档案";
}
NSArray *firstArray = [@"头像,顾客姓名,性别" componentsSeparatedByString:@","];
[self createViewWithNameArray:firstArray firstTop:92.5];
UILabel *lastLabel = self.labelArray.lastObject;
UIView *lineView = [[UIView alloc]init];
lineView.backgroundColor = rgba(243, 243, 243, 1);
[self.view addSubview:lineView];
[lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(lastLabel.mas_bottom).offset(17.5);
make.left.right.mas_equalTo(0);
make.height.mas_equalTo(10);
}];
NSArray *secondArray = [@"联系方式,生日,地区,地址" componentsSeparatedByString:@","];
[self createViewWithNameArray:secondArray firstTop:270];
for (int i = 0; i < self.labelArray.count; i++) {
UILabel *label = self.labelArray[i];
if (i == 0) {
UIButton *iconBtn = [[UIButton alloc] init];
iconBtn.layer.masksToBounds = YES;
iconBtn.layer.cornerRadius = 15;
[iconBtn addTarget:self action:@selector(iconBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[iconBtn wb_setImageName:@"customer_logo"];
// [iconBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(242, 238, 233, 1) size:CGSizeMake(30, 30)] sd_roundedCornerImageWithRadius:15 corners:0xff borderWidth:0 borderColor:[UIColor clearColor]] forState:UIControlStateNormal];
[self.view addSubview:iconBtn];
_iconBtn = iconBtn;
[iconBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(label);
make.right.mas_equalTo(-40.5);
make.size.mas_equalTo(CGSizeMake(30, 30));
}];
UIImageView *showImageView = [[UIImageView alloc] init];
showImageView.image = [UIImage imageNamed:@"customer_icon_xyb"];
[self.view addSubview:showImageView];
[showImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(label);
make.right.mas_equalTo(-22);
}];
}else if (i == 1){
UILabel *xinLabl = [[UILabel alloc] init];
xinLabl.attributedText = createAttString(@"*", 15, rgba(255, 0, 0, 1));
[self.view addSubview:xinLabl];
[xinLabl mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(label).offset(2);
make.left.equalTo(label.mas_right).offset(10);
}];
UITextField *nameTF = [[UITextField alloc] init];
nameTF.textColor = rgba(76, 74, 66, 1);
nameTF.font = [UIFont systemFontOfSize:14];
nameTF.textAlignment = NSTextAlignmentRight;
_nameTF = nameTF;
[nameTF addTarget:self action:@selector(nameTFTextChange:) forControlEvents:UIControlEventEditingChanged];
nameTF.attributedPlaceholder = createAttString(@"未填写", 14, rgba(185, 185, 185, 1));
[self.view addSubview:nameTF];
[nameTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(label);
make.left.mas_equalTo(100);
make.right.mas_equalTo(-22);
}];
}else if (i == 2){
UIImage *norImage = [[UIImage wb_imageWithColor:[UIColor whiteColor] size:CGSizeMake(75.5, 26)] sd_roundedCornerImageWithRadius:13 corners:0xff borderWidth:0.5 borderColor:rgba(255, 124, 78, 1)];
UIImage *selImage = [[UIImage wb_imageWithColor:rgba(255, 124, 78, 1) size:CGSizeMake(75.5, 26)] sd_roundedCornerImageWithRadius:13 corners:0xff borderWidth:0.5 borderColor:rgba(255, 124, 78, 1)];
UIButton *boyBtn = [[UIButton alloc] init];
[boyBtn addTarget:self action:@selector(xbBtnClick:) forControlEvents:UIControlEventTouchUpInside];
_boyBtn = boyBtn;
[boyBtn setAttributedTitle:createAttString(@"男", 14, rgba(255, 124, 78, 1)) forState:UIControlStateNormal];
[boyBtn setAttributedTitle:createAttString(@"男", 14, [UIColor whiteColor]) forState:UIControlStateSelected];
[boyBtn setBackgroundImage:norImage forState:UIControlStateNormal];
[boyBtn setBackgroundImage:selImage forState:UIControlStateSelected];
[self.view addSubview:boyBtn];
[boyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(label);
make.right.mas_equalTo(-22);
}];
UIButton *girlBtn = [[UIButton alloc] init];
[girlBtn addTarget:self action:@selector(xbBtnClick:) forControlEvents:UIControlEventTouchUpInside];
_grilBtn = girlBtn;
girlBtn.selected = YES;
self.sex = @"0";
[girlBtn setAttributedTitle:createAttString(@"女", 14, rgba(255, 124, 78, 1)) forState:UIControlStateNormal];
[girlBtn setAttributedTitle:createAttString(@"女", 14, [UIColor whiteColor]) forState:UIControlStateSelected];
[girlBtn setBackgroundImage:norImage forState:UIControlStateNormal];
[girlBtn setBackgroundImage:selImage forState:UIControlStateSelected];
[self.view addSubview:girlBtn];
[girlBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(label);
make.right.equalTo(boyBtn.mas_left).offset(-13.5);
}];
}else if (i == 3){
UITextField *phoneTF = [[UITextField alloc] init];
phoneTF.textColor = rgba(76, 74, 66, 1);
phoneTF.font = [UIFont systemFontOfSize:14];
phoneTF.keyboardType =UIKeyboardTypePhonePad;
phoneTF.textAlignment = NSTextAlignmentRight;
_phoneTF = phoneTF;
phoneTF.attributedPlaceholder = createAttString(@"未填写", 14, rgba(185, 185, 185, 1));
[self.view addSubview:phoneTF];
[phoneTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(label);
make.left.mas_equalTo(100);
make.right.mas_equalTo(-22);
}];
}else if (i == 4){
UIButton *birthdayBtn = [[UIButton alloc] init];
[birthdayBtn addTarget:self action:@selector(birthdayBtnClick:) forControlEvents:UIControlEventTouchUpInside];
_birthdayBtn = birthdayBtn;
[birthdayBtn setAttributedTitle:createAttString(@"未填写", 14, rgba(185, 185, 185, 1)) forState:UIControlStateNormal];
[birthdayBtn wb_setImageName:@"customer_icon_xyb"];
birthdayBtn.imageEdgeInsets = UIEdgeInsetsMake(0, -4.5, 0, 4.5);
[birthdayBtn wb_setRightImage];
[self.view addSubview:birthdayBtn];
[birthdayBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(label);
make.right.mas_equalTo(-22);
}];
}else if (i == 5) {
UIButton *areaBtn = [[UIButton alloc] init];
_areaBtn = areaBtn;
[areaBtn addTarget:self action:@selector(areaBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[areaBtn setAttributedTitle:createAttString(@"未填写", 14, rgba(185, 185, 185, 1)) forState:UIControlStateNormal];
[areaBtn wb_setImageName:@"customer_icon_xyb"];
areaBtn.imageEdgeInsets = UIEdgeInsetsMake(0, -4.5, 0, 4.5);
[areaBtn wb_setRightImage];
[self.view addSubview:areaBtn];
[areaBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(label);
make.right.mas_equalTo(-22);
}];
@weakify(self);
self.rpView.selectCityBlock = ^(NSInteger province, NSInteger city, NSInteger district, NSString * _Nonnull resultStr) {
@strongify(self);
self.areacity = [NSString stringWithFormat:@"%ld",city];
self.areaprovince = [NSString stringWithFormat:@"%ld",province];
self.arearegion = [NSString stringWithFormat:@"%ld",district];
self.areatxt = resultStr;
[self.areaBtn setAttributedTitle:createAttString(resultStr, 14,rgba(76, 74, 66, 1)) forState:UIControlStateNormal];
};
}else if (i == 6) {
UITextField *addressTF = [[UITextField alloc] init];
addressTF.textColor = rgba(76, 74, 66, 1);
addressTF.font = [UIFont systemFontOfSize:14];
addressTF.textAlignment = NSTextAlignmentRight;
_addressTF = addressTF;
addressTF.attributedPlaceholder = createAttString(@"未填写", 14, rgba(185, 185, 185, 1));
[self.view addSubview:addressTF];
[addressTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(label);
make.left.mas_equalTo(100);
make.right.mas_equalTo(-22);
}];
}
}
UIButton *saveBtn = [[UIButton alloc] init];
_saveBtn = saveBtn;
saveBtn.userInteractionEnabled = NO;
saveBtn.selected = YES;
[saveBtn addTarget:self action:@selector(saveBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[saveBtn setAttributedTitle:createAttString(@"保存", 15, rgba(255, 255, 255, 1)) forState:UIControlStateNormal];
[saveBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 124, 78, 1) size:CGSizeMake(225.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] forState:UIControlStateNormal];
[saveBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 200, 180, 1) size:CGSizeMake(225.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] forState:UIControlStateSelected];
[self.view addSubview:saveBtn];
[saveBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(safaBottom(-50));
make.centerX.mas_equalTo(0);
}];
if (self.clientModel.ID) {
[self.iconBtn sd_setImageWithURL:[NSURL URLWithString:self.clientModel.clientimg] forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:@"customer_logo"]];
self.nameTF.text = self.clientModel.cname;
[self nameTFTextChange:self.nameTF];
if ([self.clientModel.sex isEqualToString:@"0"]) {
[self xbBtnClick:self.grilBtn];
}else {
[self xbBtnClick:self.boyBtn];
}
self.phoneTF.text = self.clientModel.telphone;
if (self.clientModel.birthday.length) {
[self.birthdayBtn setAttributedTitle:createAttString(timestampString(self.clientModel.birthday.longLongValue/1000, @"yyyy-MM-dd") , 14,rgba(76, 74, 66, 1)) forState:UIControlStateNormal];
}
if (self.clientModel.areatxt.length) {
[self.areaBtn setAttributedTitle:createAttString(self.clientModel.areatxt,14,rgba(76, 74, 66, 1)) forState:UIControlStateNormal];
}
self.addressTF.text = self.clientModel.address;
self.sex = self.clientModel.sex;
self.areaprovince = self.clientModel.areaprovince;
self.areacity = self.clientModel.areacity;
self.arearegion = self.clientModel.arearegion;
self.areatxt = self.clientModel.areatxt;
}
}
- (void)iconBtnClick:(UIButton *)btn {
TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:9 delegate:self];
imagePickerVc.allowPickingVideo = NO;
// presentViewController
imagePickerVc.modalPresentationStyle = UIModalPresentationFullScreen;
// You can get the photos by block, the same as by delegate.
// 你可以通过block或者代理,来得到用户选择的照片.
@weakify(self);
[imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) {
@strongify(self);
UIImage *img = photos.firstObject;
[self.iconBtn setImage:img forState:UIControlStateSelected];
self.iconBtn.selected = YES;
}];
[self presentViewController:imagePickerVc animated:YES completion:nil];
}
- (void)areaBtnClick:(UIButton *)btn {
[self.rpView show];
}
- (void)nameTFTextChange:(UITextField *)tf {
bool user = tf.text.length;
self.saveBtn.selected = !user;
self.saveBtn.userInteractionEnabled = user;
}
- (void)xbBtnClick:(UIButton *)btn {
if ([self.boyBtn isEqual:btn]) {
self.sex = @"1";
self.boyBtn.selected = YES;
self.boyBtn.userInteractionEnabled = NO;
self.grilBtn.selected = NO;
self.grilBtn.userInteractionEnabled = YES;
}else {
self.sex = @"0";
self.boyBtn.selected = NO;
self.boyBtn.userInteractionEnabled = YES;
self.grilBtn.selected = YES;
self.grilBtn.userInteractionEnabled = NO;
}
}
- (void)birthdayBtnClick:(UIButton *)btn {
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = @"yyyy-MM-dd";
@weakify(self);
// [[MOFSPickerManager shareManger] showDatePickerWithTag:1 commitBlock:^(NSDate *date) {
// @strongify(self);
// NSString *dateString = [formatter stringFromDate:date];
// [self.birthdayBtn setAttributedTitle:createAttString(dateString, 14,rgba(76, 74, 66, 1)) forState:UIControlStateNormal];
// } cancelBlock:^{
//
// }];
NSString *selectDateString = [btn attributedTitleForState:UIControlStateNormal].string;
//
// [[MOFSPickerManager shareManger] showDatePickerWithTag:1 firstDate:[formatter dateFromString:selectDateString] minDate:[NSDate dateWithTimeIntervalSince1970:0] maxDate:[NSDate date] datePickerMode:UIDatePickerModeDate commitBlock:^(NSDate * _Nonnull date) {
// @strongify(self);
// NSString *dateString = [formatter stringFromDate:date];
// [self.birthdayBtn setAttributedTitle:createAttString(dateString, 14,rgba(76, 74, 66, 1)) forState:UIControlStateNormal];
// } cancelBlock:^{
//
//
// }];
[[MOFSPickerManager shareManger].datePicker showWithTitle:nil commitTitle:@"确定" cancelTitle:@"取消" selectedDate:[formatter dateFromString:selectDateString] minDate:[NSDate dateWithTimeIntervalSince1970:0] maxDate:[NSDate date] datePickerMode:UIDatePickerModeDate commitBlock:^(NSDate * _Nullable date) {
@strongify(self);
NSString *dateString = [formatter stringFromDate:date];
[self.birthdayBtn setAttributedTitle:createAttString(dateString, 14,rgba(76, 74, 66, 1)) forState:UIControlStateNormal];
} cancelBlock:^{
}];
//
}
- (void)saveBtnClick:(UIButton *)btn {
if (self.nameTF.text.length > 40) {
[SVProgressHUD showErrorWithStatus:@"姓名不能超过40个字"];
return;
}
if ([self.nameTF.text containsEmoji]) {
[SVProgressHUD showErrorWithStatus:@"姓名不能输入表情"];
return;
}
if (self.phoneTF.text.length > 30) {
[SVProgressHUD showErrorWithStatus:@"联系方式不能超过30个字"];
return;
}
if (self.addressTF.text.length > 40) {
[SVProgressHUD showErrorWithStatus:@"地址不能超过40个字"];
return;
}
if ([self.addressTF.text containsEmoji]) {
[SVProgressHUD showErrorWithStatus:@"地址不能输入表情"];
return;
}
NSMutableDictionary *pDict = [[NSMutableDictionary alloc] init];
if (self.iconBtn.selected) {
UIImage *iconImg = [self.iconBtn imageForState:UIControlStateSelected];
if (iconImg) {
iconImg = [iconImg sd_resizedImageWithSize:CGSizeMake(100, 100/iconImg.size.width *iconImg.size.height) scaleMode:SDImageScaleModeAspectFill];
NSString *keyString = [NSString stringWithFormat:@"Pictures/header/%@.jpg",nowTimeTimestamp()];
[[MMLocalDataBManager sharedManager] addWithObjectKey:keyString updateData:UIImageJPEGRepresentation(iconImg, 1)];
NSString *iconUrl = [NSString stringWithFormat:@"%@/%@",[[MMAutoUploadTool sharedManager] domain],keyString];
[[SDImageCache sharedImageCache] storeImage:iconImg forKey: iconUrl completion:^{
}];
pDict[@"clientimg"] = iconUrl;
}
}
pDict[@"mid"] = [SMGlobalModel share].mid;
pDict[@"cname"] = self.nameTF.text;
pDict[@"sex"] = self.sex;
NSString *bstring = [self.birthdayBtn attributedTitleForState:UIControlStateNormal].string;
if (![bstring isEqualToString:@"未填写"]) {
pDict[@"birthday"] = bstring;
}
pDict[@"telphone"] = self.phoneTF.text;
pDict[@"address"] = self.addressTF.text;
pDict[@"areatxt"] = self.areatxt;
pDict[@"areaprovince"] = self.areaprovince;
pDict[@"areacity"] = self.areacity;
pDict[@"arearegion"] = self.arearegion;
if (self.clientModel.ID) {
pDict[@"id"] = self.clientModel.ID;
}
@weakify(self);
[self.view postFormDataWithUrl:@"/magnifier/client/saveOrUpdateClient" params:pDict success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
@strongify(self);
if ([JsonData.code isEqualToString:@"200"]) {
if (self.clientModel.ID) {
self.clientModel.cname = pDict[@"cname"];
self.clientModel.sex = pDict[@"sex"];
if ( pDict[@"clientimg"]) {
self.clientModel.clientimg = pDict[@"clientimg"];
}
if (![bstring isEqualToString:@"未填写"]) {
self.clientModel.birthday =
[NSString stringWithFormat:@"%@", ((NSDictionary *)JsonData.data)[@"birthday"] ];
}
self.clientModel.telphone = pDict[@"telphone"];
self.clientModel.address = pDict[@"address"] ;
self.clientModel.areatxt = pDict[@"areatxt"] ;
self.clientModel.areaprovince = pDict[@"areaprovince"] ;
self.clientModel.areacity = pDict[@"areacity"];
self.clientModel.arearegion = pDict[@"arearegion"];
[self.navigationController popViewControllerAnimated:YES];
}else {
if (islinkDeviceWifi()) {
SMTakeImageViewController *vc = [[SMTakeImageViewController alloc] init];
vc.clinetModel = [SMClientListModel mj_objectWithKeyValues:JsonData.data];
[self.navigationController pushViewController:vc animated:YES];
}else {
SMLinkDeviceView *linkView = [[SMLinkDeviceView alloc] init];
linkView.flishBlock = ^{
@strongify(self);
SMTakeImageViewController *vc = [[SMTakeImageViewController alloc] init];
vc.clinetModel = [SMClientListModel mj_objectWithKeyValues:JsonData.data];
[self.navigationController pushViewController:vc animated:YES];
};
[linkView wb_showFromSuperView: self.view];
}
}
}
}];
}
- (void)createViewWithNameArray:(NSArray *)nameArray firstTop:(CGFloat)firstTop{
UIView *lastView = nil;
for (int i = 0; i < nameArray.count; i++) {
UILabel *nameLabel = [[UILabel alloc] init];
nameLabel.attributedText = createAttString(nameArray[i], 15, rgba(76, 74, 66, 1));
[self.view addSubview:nameLabel];
[nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
if (i == 0) {
make.top.mas_equalTo(firstTop);
}else {
make.top.equalTo(lastView.mas_bottom).offset(18);
};
make.left.mas_equalTo(20);
}];
[self.labelArray addObject:nameLabel];
UIView *lineView = [[UIView alloc] init];
lineView.backgroundColor = rgba(229, 229, 229, 1);
[self.view addSubview:lineView];
[lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(20.5);
make.right.mas_equalTo(-22);
make.top.equalTo(nameLabel.mas_bottom).offset(17.5);
make.height.mas_equalTo(0.5);
}];
lastView =lineView;
}
}
@end
//
// SMEditPositionNameView.h
// SkinMagnifier
//
// Created by nana on 2020/11/18.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMEditPositionNameView : UIView
@property(nonatomic, copy)void (^saveBlock)(NSString *str);
- (void)configInputValue:(NSString *)value;
@end
NS_ASSUME_NONNULL_END
//
// SMEditPositionNameView.m
// SkinMagnifier
//
// Created by nana on 2020/11/18.
//
#import "SMEditPositionNameView.h"
#import "SMDownView.h"
@interface SMEditPositionNameView()
@property(nonatomic,weak)UIButton *selectBtn;
@property(nonatomic,weak)UITextField *inputTF;
@property(nonatomic,strong)NSMutableArray *btnArray;
@property(nonatomic,weak)UIButton *saveBtn;
@end
@implementation SMEditPositionNameView
- (instancetype)init
{
self = [super init];
if (self) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.btnArray = [[NSMutableArray alloc] init];
self.backgroundColor = rgba(0, 0, 0, 0.34);
UIView *contView = [[UIView alloc] init];
contView.backgroundColor = rgba(255, 255, 255, 1);
contView.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.17].CGColor;
contView.layer.shadowOffset = CGSizeMake(0,4);
contView.layer.shadowOpacity = 1;
contView.layer.shadowRadius = 30;
[self addSubview:contView];
[contView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(safaTop(64.5));
make.left.bottom.right.mas_equalTo(0);
}];
UIView *hLineView = [[UIView alloc] init];
hLineView.backgroundColor = rgba(239, 239, 239, 1);
hLineView.layer.cornerRadius = 1;
[contView addSubview:hLineView];
[hLineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.top.mas_equalTo(17);
make.size.mas_equalTo(CGSizeMake(39.5, 2));
}];
UILabel *editTipsLabel = [[UILabel alloc] init];
editTipsLabel.attributedText = createAttString(@"编辑部位名称", 25, rgba(76, 74, 66, 1));
[contView addSubview:editTipsLabel];
[editTipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(49);
make.top.mas_equalTo(52);
}];
NSArray *nameArray = @[(@"额头"),(@"下巴"),
(@"左脸颊"),(@"右脸颊"),
(@"鼻头"),(@"鼻翼"),
(@"眼周"),(@"唇周")];
UIImage *selectImage = [[UIImage wb_imageWithColor:rgba(255, 124, 78, 1)size:CGSizeMake(64, 30)]sd_roundedCornerImageWithRadius:30/2 corners:0xff borderWidth:0 borderColor:[UIColor clearColor]];
UIImage *normalImage = [[UIImage wb_imageWithColor:rgba(242, 238, 233, 1) size:CGSizeMake(64, 30)]sd_roundedCornerImageWithRadius:30/2 corners:0xff borderWidth:0 borderColor:[UIColor clearColor]];
for (int i = 0; i < nameArray.count; i++) {
NSString *title = nameArray[i];
UIButton *btn = [[UIButton alloc] init];
[btn setAttributedTitle:createAttString(title, 14, rgba(255, 255, 255, 1)) forState: UIControlStateSelected];
[btn setAttributedTitle:createAttString(title, 14, rgba(255, 124, 78, 1)) forState: UIControlStateNormal];
btn.imageEdgeInsets = UIEdgeInsetsMake(0, -5, 0, 5);
[btn setBackgroundImage:normalImage forState:UIControlStateNormal];
[btn setBackgroundImage:selectImage forState:UIControlStateSelected];
[btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
[contView addSubview:btn];
[self.btnArray addObject:btn];
[btn mas_makeConstraints:^(MASConstraintMaker *make) {
CGFloat l = (i%4*74)+45;
CGFloat t = (i/4*50)+107;
make.left.mas_equalTo(l);
make.top.mas_equalTo(t);
make.size.mas_equalTo(CGSizeMake(64, 30));
}];
}
UIView *lastView = contView.subviews.lastObject;
UITextField *inputTF = [[UITextField alloc] init];
inputTF.placeholder = @"请输入部位名称";
inputTF.font = [UIFont systemFontOfSize:18];
inputTF.textColor = rgba(76, 74, 66, 1);
[inputTF addTarget:self action:@selector(nameTextFieldChange:) forControlEvents:UIControlEventEditingChanged];
[contView addSubview:inputTF];
_inputTF = inputTF;
[inputTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(lastView.mas_bottom).offset(49-13);
make.left.mas_equalTo(48.5);
make.height.mas_equalTo(13+13+16);
make.right.mas_equalTo(-48.5);
}];
UIView *inputLineView = [[UIView alloc] init];
inputLineView.backgroundColor = rgba(229, 229, 229, 1);
[contView addSubview:inputLineView];
[inputLineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(45.5);
make.right.mas_equalTo(-45.5);
make.height.mas_equalTo(0.5);
make.top.equalTo(inputTF.mas_bottom);
}];
UIButton *saveBtn = [[UIButton alloc] init];
_saveBtn = saveBtn;
saveBtn.userInteractionEnabled = NO;
saveBtn.selected = YES;
[saveBtn addTarget:self action:@selector(saveBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[saveBtn setAttributedTitle:createAttString(@"保存", 15, rgba(255, 255, 255, 1)) forState:UIControlStateNormal];
[saveBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 124, 78, 1) size:CGSizeMake(225.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] forState:UIControlStateNormal];
[saveBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 200, 180, 1) size:CGSizeMake(225.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] forState:UIControlStateSelected];
[contView addSubview:saveBtn];
[saveBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(inputLineView.mas_bottom).offset(30);
make.centerX.mas_equalTo(0);
}];
CGSize sSize = [UIScreen mainScreen].bounds.size;
SMDownView *downView = [[SMDownView alloc] init];
downView.frame = CGRectMake(0, 0,sSize.width, 104.5);
[self addSubview:downView];
}
- (void)saveBtnClick:(UIButton *)btn {
if (self.inputTF.text.length == 0) {
[SVProgressHUD showErrorWithStatus:@"部位名称不能为空"];
return;
}
if ([self.inputTF.text containsEmoji]) {
[SVProgressHUD showErrorWithStatus:@"部位名称不能输入表情"];
return;
}
if (self.inputTF.text.length > 6) {
[SVProgressHUD showErrorWithStatus:@"部位名称不能超过6个字"];
return;
}
if (self.saveBlock) {
self.saveBlock(self.inputTF.text);
}
}
- (void)nameTextFieldChange:(UITextField *)tf {
BOOL selectBool = NO;
for (UIButton *btn in self.btnArray) {
NSString *btnTitle = [btn attributedTitleForState:UIControlStateNormal].string;
if ([btnTitle isEqualToString:tf.text]) {
self.selectBtn.selected = NO;
btn.selected = YES;
btn.userInteractionEnabled = NO;
self.selectBtn = btn;
selectBool = YES;
break;
}
}
if (!selectBool) {
self.selectBtn.selected = NO;
self.selectBtn.userInteractionEnabled = YES;
self.selectBtn = nil;
}
self.saveBtn.selected = !tf.text.length;
self.saveBtn.userInteractionEnabled = tf.text.length;
}
- (void)btnClick:(UIButton *)btn {
btn.selected = YES;
btn.userInteractionEnabled = NO;
self.selectBtn.selected = NO;
self.selectBtn.userInteractionEnabled = YES;
self.selectBtn = btn;
_inputTF.text = [btn attributedTitleForState:UIControlStateNormal].string;
self.saveBtn.selected = !_inputTF.text.length;
self.saveBtn.userInteractionEnabled = _inputTF.text.length;
}
- (void)configInputValue:(NSString *)value {
self.inputTF.text = value;
[self nameTextFieldChange:self.inputTF];
}
@end
//
// SMLinkDeviceView.h
// SkinMagnifier
//
// Created by nana on 2020/11/12.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMLinkDeviceView : UIView
@property(nonatomic, strong)void (^cancleBlock)(void);
@property(nonatomic, strong)void (^flishBlock)(void);
@end
NS_ASSUME_NONNULL_END
//
// SMLinkDeviceView.m
// SkinMagnifier
//
// Created by nana on 2020/11/12.
//
#import "SMLinkDeviceView.h"
@interface SMLinkDeviceView()
@property(nonatomic, strong)dispatch_source_t timer;
@end
@implementation SMLinkDeviceView
- (instancetype)init
{
self = [super init];
if (self) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.backgroundColor = [UIColor whiteColor];
UIButton *deleteBtn = [[UIButton alloc] init];
[deleteBtn addTarget:self action:@selector(deleteClick:) forControlEvents:UIControlEventTouchUpInside];
[deleteBtn wb_setImageName:@"pop_icon_Shut"];
[self addSubview:deleteBtn];
[deleteBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(safaTop(25));
make.left.mas_equalTo(10);
make.size.mas_equalTo(CGSizeMake(25, 25));
}];
UILabel *titleLabel = [[UILabel alloc] init];
titleLabel.attributedText = createAttString(@"连接设备", 25, rgba(76, 74, 66, 1));
[self addSubview:titleLabel];
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(safaTop(81.5));
make.centerX.mas_equalTo(0);
}];
UILabel *oneTipsLabel = [[UILabel alloc] init];
/// 抗拉伸
[oneTipsLabel setContentHuggingPriority:UILayoutPriorityDefaultHigh forAxis:UILayoutConstraintAxisHorizontal];
oneTipsLabel.attributedText = createAttString(@"1.将设备开机,等待蓝色指示灯闪烁", 15,rgba(153, 153, 153, 1));
[self addSubview:oneTipsLabel];
[oneTipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(safaTop(138));
make.centerX.mas_equalTo(0);
}];
UILabel *twoTipsLabel = [[UILabel alloc] init];
twoTipsLabel.numberOfLines = 0;
NSMutableAttributedString *twoAttString = [[NSMutableAttributedString alloc] init];
[twoAttString appendAttributedString:createAttString(@"2.将手机连接到以", 15,rgba(153, 153, 153, 1))];
[twoAttString appendAttributedString:createAttString(@"“DAS01-1”", 15,rgba(76, 74, 66, 1))];
[twoAttString appendAttributedString:createAttString(@"开头的WiFi网络,密码:", 15,rgba(153, 153, 153, 1))];
[twoAttString appendAttributedString:createAttString(@"12345678", 15,rgba(76, 74, 66, 1))];
twoTipsLabel.attributedText = twoAttString;
[self addSubview:twoTipsLabel];
[twoTipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(safaTop(138+40));
make.left.right.equalTo(oneTipsLabel);
}];
UILabel *threeTipsLabel = [[UILabel alloc] init];
/// 抗拉伸
threeTipsLabel.attributedText = createAttString(@"3.返回app,此时设备将自动连上", 15,rgba(153, 153, 153, 1));
[self addSubview:threeTipsLabel];
[threeTipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(safaTop(138+40+50));
make.left.equalTo(oneTipsLabel);
}];
UIImageView *imgView = [[UIImageView alloc] init];
imgView.image = [UIImage imageNamed:@"link_tips_pop_bg"];
[self addSubview:imgView];
[imgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.top.equalTo(threeTipsLabel.mas_bottom).offset(32);
}];
UIButton *setBtn = [[UIButton alloc] init];
[setBtn addTarget:self action:@selector(setBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[setBtn setAttributedTitle:createAttString(@"前往设置", 15,rgba(255, 255, 255, 1)) forState:UIControlStateNormal];
[setBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 124, 78, 1) size:CGSizeMake(225.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] forState:UIControlStateNormal];
[self addSubview:setBtn];
[setBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(imgView.mas_bottom).offset(40);
make.centerX.mas_equalTo(0);
}];
@weakify(self);
dispatch_source_t timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_main_queue());
dispatch_source_set_timer(timer, DISPATCH_TIME_NOW, 5 * NSEC_PER_SEC, 0 * NSEC_PER_SEC);
dispatch_source_set_event_handler(timer, ^{
@strongify(self);
[self setTask];
});
dispatch_resume(timer);
_timer = timer;
}
- (void)setTask {
if (islinkDeviceWifi()) {
if (self.flishBlock) {
self.flishBlock();
}
}
if (islinkDeviceWifi()) {
if (self.superview) {
[self wb_disMiss];
}
}
}
- (void)setBtnClick:(UIButton *)btn {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:nil];
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(enterForegroud:) name:UIApplicationWillEnterForegroundNotification object:nil];
}
//- (void)enterForegroud:(NSNotification *)noti {
// [[NSNotificationCenter defaultCenter] removeObserver:self];
// if (islinkDeviceWifi()) {
// if (self.flishBlock) {
// self.flishBlock();
// }
// }
//}
- (void)deleteClick:(UIButton *)btn {
btn.userInteractionEnabled = NO;
[self wb_disMiss];
btn.userInteractionEnabled = YES;
}
@end
//
// WOPageControl.h
// SkinMagnifier
//
// Created by nana on 2020/11/18.
//
#import <UIKit/UIKit.h>
@interface SMPageControl : UIView
@property (nonatomic, assign) int numberOfPages;
@property (nonatomic, assign) int currentPage;
@property (nonatomic, strong) UIColor *otherDotColor;
@property (nonatomic, strong) UIColor *currentDotColor;
@property (nonatomic, assign) CGFloat cornerRadius;
@property (nonatomic, assign) CGFloat currentDotWidth;
@property (nonatomic, assign) CGFloat otherDotWidth;
@property (nonatomic, assign) CGFloat dotHeight;
@property (nonatomic, assign) CGFloat dotSpace;
@end
//
// WOPageControl.m
// SkinMagnifier
//
// Created by nana on 2020/11/18.
//
#import "SMPageControl.h"
@interface SMPageControl ()
@property (nonatomic, strong) NSMutableArray *dotViewArrayM;
@property (nonatomic, assign) BOOL isInitialize;
@property (nonatomic, assign) BOOL inAnimating;
@end
@implementation SMPageControl
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
self.otherDotColor = [UIColor lightGrayColor];
self.currentDotColor = [UIButton buttonWithType:UIButtonTypeSystem].tintColor;
self.isInitialize = YES;
self.inAnimating = NO;
self.dotViewArrayM = [NSMutableArray array];
}
return self;
}
- (void)layoutSubviews {
[super layoutSubviews];
[self updateUI];
}
- (void)updateUI {
if (self.dotViewArrayM.count == 0) return;
if (self.isInitialize) {
self.isInitialize = NO;
CGFloat totalWidth = self.currentDotWidth + (self.numberOfPages - 1) * (self.dotSpace + self.otherDotWidth);
CGFloat currentX = (self.frame.size.width - totalWidth) / 2;
for (int i = 0; i < self.dotViewArrayM.count; i++) {
UIView *dotView = self.dotViewArrayM[i];
// 更新位置
CGFloat width = (i == self.currentPage ? self.currentDotWidth : self.otherDotWidth);
CGFloat height = self.dotHeight;
CGFloat x = currentX;
CGFloat y = (self.frame.size.height - height) / 2;
dotView.frame = CGRectMake(x, y, width, height);
currentX = currentX + width + self.dotSpace; // 走到下一个点开的开头位置
// 更新颜色
dotView.backgroundColor = self.otherDotColor;
if (i == self.currentPage) {
dotView.backgroundColor = self.currentDotColor;
}
}
}
}
#pragma mark - ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ Setter ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
- (void)setNumberOfPages:(int)numberOfPages {
_numberOfPages = numberOfPages;
if (self.dotViewArrayM.count > 0) {
[self.dotViewArrayM enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop)
{
[(UIView *)obj removeFromSuperview];
}];
[self.dotViewArrayM removeAllObjects];
}
for (int i = 0; i < numberOfPages; i++) {
UIView *dotView = [[UIView alloc] initWithFrame:CGRectZero];
dotView.layer.cornerRadius = self.cornerRadius;
[self addSubview:dotView];
[self.dotViewArrayM addObject:dotView];
}
self.isInitialize = YES;
[self setNeedsLayout];
}
- (void)setCurrentPage:(int)currentPage {
if (currentPage < 0 ||
currentPage >= self.dotViewArrayM.count ||
self.dotViewArrayM.count == 0 ||
currentPage == _currentPage ||
self.inAnimating)
{
return;
}
// 向右
if (currentPage > self.currentPage) {
UIView *currentView = self.dotViewArrayM[self.currentPage];
[self bringSubviewToFront:currentView];
self.inAnimating = YES;
[UIView animateWithDuration:0.3 animations:^{
CGRect tempFrame = currentView.frame;
// 当前选中的圆点,x 不变,宽度增加,增加几个圆点和间隙距离
CGFloat width = self.currentDotWidth + (self.dotSpace + self.otherDotWidth) * (currentPage - self.currentPage);
CGFloat height = tempFrame.size.height;
tempFrame.size = CGSizeMake(width, height);
currentView.frame = tempFrame;
} completion:^(BOOL finished) {
UIView *endView = self.dotViewArrayM[currentPage];
endView.backgroundColor = currentView.backgroundColor;
endView.frame = currentView.frame;
[self bringSubviewToFront:endView];
currentView.backgroundColor = self.otherDotColor;
// 逐个左移 view
CGFloat start_X = currentView.frame.origin.x;
for (int i = 0; i < (currentPage - self.currentPage); i++) {
UIView *dotView = self.dotViewArrayM[self.currentPage + i];
CGRect tempFrame = dotView.frame;
// 左移
tempFrame.origin = CGPointMake(start_X + (self.otherDotWidth + self.dotSpace) * i, tempFrame.origin.y);
tempFrame.size = CGSizeMake(self.otherDotWidth, self.dotHeight);
dotView.frame = tempFrame;
}
[UIView animateWithDuration:0.3 animations:^{
CGFloat w = self.currentDotWidth;
CGFloat x = CGRectGetMaxX(endView.frame) - self.currentDotWidth;
CGFloat y = endView.frame.origin.y;
CGFloat h = endView.frame.size.height;
endView.frame = CGRectMake(x, y, w, h);
} completion:^(BOOL finished) {
_currentPage = currentPage;
self.inAnimating = NO;
}];
}];
}
// 向左
else
{
UIView *currentView = self.dotViewArrayM[self.currentPage];
[self bringSubviewToFront:currentView];
self.inAnimating = YES;
[UIView animateWithDuration:0.3 animations:^{
// 当前选中的圆点,x 左移,宽度增加,增加几个圆点和间隙距离
CGFloat x = currentView.frame.origin.x - (self.dotSpace + self.otherDotWidth) * (self.currentPage - currentPage);
CGFloat y = currentView.frame.origin.y;
CGFloat w = self.currentDotWidth + (self.dotSpace + self.otherDotWidth) * (self.currentPage - currentPage);
CGFloat h = currentView.frame.size.height;
currentView.frame = CGRectMake(x, y, w, h);
} completion:^(BOOL finished) {
UIView *endView = self.dotViewArrayM[currentPage];
endView.backgroundColor = currentView.backgroundColor;
endView.frame = currentView.frame;
[self bringSubviewToFront:endView];
currentView.backgroundColor = self.otherDotColor;
// 逐个移动后面的 view
CGFloat start_X = CGRectGetMaxX(currentView.frame);
for (int i = 0; i < (self.currentPage - currentPage); i++) {
UIView *dotView = self.dotViewArrayM[self.currentPage - i];
CGRect tempFrame = dotView.frame;
// 右移
CGFloat x = start_X - self.otherDotWidth - (self.otherDotWidth + self.dotSpace) * i;
CGFloat y = tempFrame.origin.y;
CGFloat w = self.otherDotWidth;
CGFloat h = tempFrame.size.height;
dotView.frame = CGRectMake(x, y, w, h);
}
[UIView animateWithDuration:0.3 animations:^{
CGFloat x = endView.frame.origin.x;
CGFloat y = endView.frame.origin.y;
CGFloat w = self.currentDotWidth;
CGFloat h = endView.frame.size.height;
endView.frame = CGRectMake(x, y, w, h);
} completion:^(BOOL finished) {
_currentPage = currentPage;
self.inAnimating = NO;
}];
}];
}
}
@end
//
// SMReportAddProjectView.h
// SkinMagnifier
//
// Created by nana on 2020/12/1.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMReportAddProjectView : UIView
/// 1.保存 2.删除
@property(nonatomic, copy)void (^saveBlock)(NSString *type, NSString *name,NSInteger status);
- (void)updateType:(NSString *)tyep name:(NSString *)name;
@end
NS_ASSUME_NONNULL_END
//
// SMReportAddProjectView.m
// SkinMagnifier
//
// Created by nana on 2020/12/1.
//
#import "SMReportAddProjectView.h"
#import "SMDownView.h"
@interface SMReportAddProjectView()
@property(nonatomic, strong)UITextField *pTF;
@property(nonatomic, strong)NSString *type;
@property(nonatomic, weak)UIButton *cpselBtn;
@property(nonatomic, weak)UIButton *yqselBtn;
@property(nonatomic, weak)UIButton *cpImageView;
@property(nonatomic, weak)UIButton *yqImageView;
@property(nonatomic, weak)UIButton *cpBtn;
@property(nonatomic, weak)UIButton *yqBtn;
@property(nonatomic, weak)UIButton *delBtn;
@property(nonatomic, weak)UIButton *qdBtn;
@property(nonatomic, weak)UILabel *tipsLabel;
@end
@implementation SMReportAddProjectView
- (instancetype)init
{
self = [super init];
if (self) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.backgroundColor = rgba(0, 0, 0, 0.34);
UIView *contView = [[UIView alloc] init];
contView.backgroundColor = rgba(255, 255, 255, 1);
contView.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.17].CGColor;
contView.layer.shadowOffset = CGSizeMake(0,4);
contView.layer.shadowOpacity = 1;
contView.layer.shadowRadius = 30;
[self addSubview:contView];
[contView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(safaTop(64.5) );
make.left.bottom.right.mas_equalTo(0);
}];
UIView *hLineView = [[UIView alloc] init];
hLineView.backgroundColor = rgba(239, 239, 239, 1);
hLineView.layer.cornerRadius = 1;
[contView addSubview:hLineView];
[hLineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.top.mas_equalTo(17);
make.size.mas_equalTo(CGSizeMake(39.5, 2));
}];
CGSize sSize = [UIScreen mainScreen].bounds.size;
SMDownView *downView = [[SMDownView alloc] init];
downView.frame = CGRectMake(0, 0,sSize.width, 104.5);
[self addSubview:downView];
UILabel *tipsLabel = [[UILabel alloc]init];
tipsLabel.attributedText = createAttString(@"添加项目", 25, rgba(76, 74, 66, 1));
[contView addSubview:tipsLabel];
_tipsLabel = tipsLabel;
[tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(45);
make.top.mas_equalTo(51.5);
}];
UIButton *cpImageView = [[UIButton alloc] init];
_cpImageView = cpImageView;
[cpImageView addTarget:self action:@selector(cpClick:) forControlEvents:UIControlEventTouchUpInside];
[cpImageView wb_setImageName:@"report_icon_add_cp"];
[contView addSubview:cpImageView];
[cpImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(75);
make.top.mas_equalTo(117);
make.size.mas_equalTo(CGSizeMake(79, 79));
}];
UIButton *cpBtn = [[UIButton alloc] init];
_cpBtn = cpBtn;
[cpBtn setAttributedTitle:createAttString(@"产品",12, [UIColor whiteColor]) forState:UIControlStateNormal];
UIImage *img1 = [[[UIImage wb_imageWithColor:rgba(201, 199, 199, 1) size:CGSizeMake(38, 18)] sd_roundedCornerImageWithRadius:5 corners:0xff borderWidth:0 borderColor:[UIColor clearColor]] resizableImageWithCapInsets:UIEdgeInsetsMake(14, 6, 14, 6)];
UIImage *img = [[[UIImage wb_imageWithColor:rgba(255, 124, 78, 1) size:CGSizeMake(38, 18)] sd_roundedCornerImageWithRadius:5 corners:0xff borderWidth:0 borderColor:[UIColor clearColor]] resizableImageWithCapInsets:UIEdgeInsetsMake(14, 6, 14, 6)];
[ cpBtn setBackgroundImage:img1 forState:UIControlStateNormal];
[ cpBtn setBackgroundImage:img forState:UIControlStateSelected];
cpBtn.contentEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 5);
[contView addSubview:cpBtn];
[cpBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo( cpImageView);
make.centerX.equalTo(cpImageView.mas_right);
}];
UIButton *cpselBtn = [[UIButton alloc] init];
_cpselBtn = cpselBtn;
[cpselBtn addTarget:self action:@selector(cpClick:) forControlEvents:UIControlEventTouchUpInside];
[cpselBtn wb_setImageName:@"report_icon_check"];
[contView addSubview:cpselBtn];
[cpselBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo( cpImageView.mas_bottom).offset(12.5);
make.centerX.equalTo(cpImageView);
}];
UIButton *yqImageView = [[UIButton alloc] init];
_yqImageView = yqImageView;
[yqImageView addTarget:self action:@selector(yqClick:) forControlEvents:UIControlEventTouchUpInside];
[yqImageView wb_setImageName:@"report_icon_add_yq"];
[contView addSubview:yqImageView];
[yqImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-75);
make.top.mas_equalTo(117);
make.size.mas_equalTo(CGSizeMake(79, 79));
}];
UIButton *yqBtn = [[UIButton alloc] init];
_yqBtn = yqBtn;
[yqBtn setAttributedTitle:createAttString(@"仪器", 12, [UIColor whiteColor]) forState:UIControlStateNormal];
[ yqBtn setBackgroundImage:img1 forState:UIControlStateNormal];
[ yqBtn setBackgroundImage:img forState:UIControlStateSelected];
yqBtn.contentEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 5);
[contView addSubview:yqBtn];
[yqBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo( yqImageView);
make.centerX.equalTo(yqImageView.mas_right);
}];
UIButton *yqselBtn = [[UIButton alloc] init];
_yqselBtn = yqselBtn;
[yqselBtn addTarget:self action:@selector(yqClick:) forControlEvents:UIControlEventTouchUpInside];
[yqselBtn wb_setImageName:@"report_icon_check"];
[contView addSubview:yqselBtn];
[yqselBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo( yqImageView.mas_bottom).offset(12.5);
make.centerX.equalTo(yqImageView);
}];
UITextField *pTF = [[UITextField alloc] init];
[pTF addTarget:self action:@selector(pTFValueChange:) forControlEvents:UIControlEventEditingChanged];
_pTF = pTF;
pTF.attributedPlaceholder = createAttString(@"请输入名称", 18, rgba(185, 185, 185, 1));
[contView addSubview:pTF];
[pTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo( yqImageView.mas_bottom).offset(68-13);
make.left.mas_equalTo(45);
make.right.mas_equalTo(-45);
make.height.mas_equalTo(26+19);
}];
UIView *lineView = [[UIView alloc] init];
lineView.backgroundColor = rgba(229, 229, 229, 1);
[contView addSubview:lineView];
[lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(0.5);
make.right.left.bottom.equalTo(pTF);
}];
UIImage *saveImage = [[[UIImage wb_imageWithColor:rgba(255, 124, 78, 1) size:CGSizeMake(146, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 20, 0, 20)];
UIImage *delImage =[[[UIImage wb_imageWithColor:rgba(255, 200, 180, 1) size:CGSizeMake(146, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 20, 0, 20)];
UIButton * delBtn = [[UIButton alloc ]init];
delBtn.hidden = YES;
_delBtn = delBtn;
[delBtn addTarget:self action:@selector(delBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[delBtn setAttributedTitle:createAttString(@"删除", 15, rgba(255, 255, 255, 1)) forState:UIControlStateNormal];
[delBtn setBackgroundImage:delImage forState:UIControlStateNormal];
// [delBtn setBackgroundImage:selImage forState:UIControlStateSelected];
[contView addSubview:delBtn];
[delBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(lineView.mas_bottom).offset(30);
make.size.mas_equalTo(CGSizeMake(146, 45));
make.centerX.equalTo(self).multipliedBy(0.6);
}];
UIButton *qdBtn = [[UIButton alloc] init];
qdBtn.selected = YES;
qdBtn.userInteractionEnabled = NO;
_qdBtn = qdBtn;
[qdBtn addTarget:self action:@selector(qdBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[qdBtn setAttributedTitle:createAttString(@"保存", 15, rgba(255, 255, 255, 1)) forState:UIControlStateNormal];
[qdBtn setBackgroundImage:saveImage forState:UIControlStateNormal];
// [qdBtn setBackgroundImage:selImage forState:UIControlStateSelected];
[contView addSubview:qdBtn];
[self.qdBtn mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(lineView.mas_bottom).offset(30);
make.size.mas_equalTo(CGSizeMake(225, 45));
make.centerX.mas_equalTo(0);
}];
[self cpClick:self.cpselBtn];
}
- (void)pTFValueChange:(UITextField *)tf {
self.qdBtn.selected = !tf.text.length;
self.qdBtn.userInteractionEnabled = tf.text.length;
}
- (void)cpClick:(UIButton *)btn {
self.cpBtn.selected = self.cpImageView.selected = self.cpselBtn.selected = YES;
self.yqBtn.selected = self.yqImageView.selected = self.yqselBtn.selected = NO;
self.type = @"2";
}
- (void)yqClick:(UIButton *)btn {
self.cpBtn.selected = self.cpImageView.selected = self.cpselBtn.selected = NO;
self.yqBtn.selected = self.yqImageView.selected = self.yqselBtn.selected = YES;
self.type = @"1";
}
- (void)qdBtnClick:(UIButton *)btn {
if (self.pTF.text.length > 100) {
[SVProgressHUD showErrorWithStatus:@"项目名称不能超过100个字"];
return;
}
if ([self.pTF.text containsEmoji]) {
[SVProgressHUD showErrorWithStatus:@"项目名称不能输入表情"];
return;
}
if (self.saveBlock) {
self.saveBlock(self.type,self.pTF.text,1);
}
[self wb_disMiss];
}
- (void)delBtnClick:(UIButton *)btn {
if (self.saveBlock) {
self.saveBlock(self.type,self.pTF.text,2);
}
[self wb_disMiss];
}
- (void)updateType:(NSString *)tyep name:(NSString *)name {
self.tipsLabel.attributedText = createAttString(@"编辑项目", 25, rgba(76, 74, 66, 1));
self.delBtn.hidden = NO;
if ([tyep isEqualToString:@"2"]) {
self.cpBtn.selected = self.cpImageView.selected = self.cpselBtn.selected = YES;
self.yqBtn.selected = self.yqImageView.selected = self.yqselBtn.selected = NO;
}else {
self.cpBtn.selected = self.cpImageView.selected = self.cpselBtn.selected = NO;
self.yqBtn.selected = self.yqImageView.selected = self.yqselBtn.selected = YES;
}
self.qdBtn.selected = NO;
self.qdBtn.userInteractionEnabled = YES;
self.pTF.text = name;
[self.qdBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(146, 45));
make.centerX.equalTo(self).multipliedBy(1.4);
}];
}
@end
//
// SMReportAddSchemeView.h
// SkinMagnifier
//
// Created by nana on 2020/12/1.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMReportAddSchemeView : UIView
@property(nonatomic, copy)void(^saveBlock)(NSString *sName,NSString *sDescribe,NSString *sMethod);
@end
NS_ASSUME_NONNULL_END
//
// SMReportAddSchemeView.m
// SkinMagnifier
//
// Created by nana on 2020/12/1.
//
#import "SMReportAddSchemeView.h"
#import <IQKeyboardManager/IQTextView.h>
@interface SMReportAddSchemeView()<UITextViewDelegate>
@property(nonatomic, weak)UIView *zzConetView;
//@property(nonatomic, weak)UIView *ssConetView;
@property(nonatomic, weak)UIView *ffConetView;
@property(nonatomic, weak)IQTextView *zzNameTV;
//@property(nonatomic, weak)IQTextView *ssNameTV;
@property(nonatomic, weak)IQTextView *ffNameTV;
@property(nonatomic, strong)NSMutableArray *wenAnArray;
@property(nonatomic, weak)UIButton *qdBtn;
@property(nonatomic, strong)NSMutableArray *typeBtnArray;
@property(nonatomic, assign)CGFloat startY;
@end
@implementation SMReportAddSchemeView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.backgroundColor = [UIColor whiteColor];
UIImageView *tipsImageView = [[UIImageView alloc] init];
tipsImageView.image = [UIImage imageNamed:@"report_header_bg"];
[self addSubview:tipsImageView];
[tipsImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.right.left.mas_equalTo(0);
// make.height.mas_equalTo(258);
}];
UIButton *backBtn = [[UIButton alloc] init];
backBtn.frame = CGRectMake(10, safaTop(20) , 38, 45);
[backBtn wb_setImageName:@"nav_black_back"];
[backBtn addTarget:self action:@selector(backClick:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:backBtn];
UILabel *titleLabel = [[UILabel alloc] init];
titleLabel.attributedText = createAttString(@"添加方案", 17, rgba(76, 74, 66, 1));
[self addSubview:titleLabel];
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.centerY.equalTo(backBtn);
}];
UILabel *tipsLabel = [[UILabel alloc] init];
tipsLabel.attributedText = createAttString(@"预设方案", 17, rgba(68, 57, 53, 1));
[self addSubview:tipsLabel];
[tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(20);
make.top.mas_equalTo(safaTop(79));
}];
NSString *path = [[NSBundle mainBundle] pathForResource:@"ysfa" ofType: @"json"];
NSData *data = [[NSData alloc] initWithContentsOfFile:path];
NSError * error;
NSDictionary *typeDict = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];
NSArray *typeStringArray = typeDict[@"category"];
_wenAnArray = typeStringArray;
self.typeBtnArray = [[NSMutableArray alloc] init];
// [@"敏感,纹理,毛孔粗大,毛孔堵塞,皮脂偏多,皮脂偏少,色素沉淀" componentsSeparatedByString:@","];
UIView *lastView = nil;
CGFloat space = biliSize(10, 10).width;
for (int i = 0; i < typeStringArray.count; i++ ) {
NSDictionary *dict = typeStringArray[i];
NSString *typeString = dict[@"bt"];
UIButton *tipsBtn = [[UIButton alloc] init];
/*
UIImage *selectImage = [[UIImage wb_imageWithColor:rgba(255, 124, 78, 1)size:CGSizeMake(64, 30)]sd_roundedCornerImageWithRadius:30/2 corners:0xff borderWidth:0 borderColor:[UIColor clearColor]];
UIImage *normalImage = [[UIImage wb_imageWithColor:rgba(242, 238, 233, 1) size:CGSizeMake(64, 30)]sd_roundedCornerImageWithRadius:30/2 corners:0xff borderWidth:0 borderColor:[UIColor clearColor]];
for (int i = 0; i < nameArray.count; i++) {
NSString *title = nameArray[i];
UIButton *btn = [[UIButton alloc] init];
rgba(255, 124, 78, 1)
[btn setAttributedTitle:createAttString(title, 14, rgba(255, 255, 255, 1)) forState: UIControlStateSelected];
[btn setAttributedTitle:createAttString(title, 14, rgba(255, 124, 78, 1)) forState: UIControlStateNormal];
*/
[tipsBtn setAttributedTitle:createAttString(typeString, 14, rgba(255, 255, 255, 1)) forState: UIControlStateSelected];
[tipsBtn setAttributedTitle:createAttString(typeString, 14, rgba(153, 153, 153, 1)) forState:UIControlStateNormal];
tipsBtn.tag = 1590 + i;
[tipsBtn addTarget:self action:@selector(typeBtnClick:) forControlEvents:UIControlEventTouchUpInside];
UIImage *img = [[[UIImage wb_imageWithColor:[UIColor whiteColor] size:CGSizeMake(64, 30)] sd_roundedCornerImageWithRadius:15 corners:0xf borderWidth:0 borderColor:[UIColor clearColor]] resizableImageWithCapInsets:UIEdgeInsetsMake(30, 14, 30, 14)];
UIImage *selectImage = [[UIImage wb_imageWithColor:rgba(255, 124, 78, 1)size:CGSizeMake(64, 30)]sd_roundedCornerImageWithRadius:30/2 corners:0xff borderWidth:0 borderColor:[UIColor clearColor]];
[ tipsBtn setBackgroundImage:img forState:UIControlStateNormal];
[ tipsBtn setBackgroundImage:selectImage forState:UIControlStateSelected];
[self addSubview:tipsBtn];
[self.typeBtnArray addObject:tipsBtn];
CGFloat lastX = CGRectGetMaxX(lastView.frame);
CGFloat vW = 0;
if (typeString.length == 2) {
vW = 64;
}else if(typeString.length == 4) {
vW = 84;
}
CGFloat tempW = lastX + space+space + vW;
if (tempW < self.frame.size.width) {
if (i == 0) {
tipsBtn.frame = CGRectMake(20,safaTop(111), vW, 30);
}else {
tipsBtn.frame = CGRectMake( lastX + space, lastView.frame.origin.y, vW, 30);
}
}else {
tipsBtn.frame = CGRectMake(20, CGRectGetMaxY(lastView.frame)+space, vW, 30);
}
lastView = tipsBtn;
}
// 症状名称
self.startY = CGRectGetMaxY(lastView.frame)+20;
UIView *zzConetView = [[UIView alloc] init];
zzConetView.backgroundColor = [UIColor whiteColor];
[self addSubview:zzConetView];
_zzConetView = zzConetView;
zzConetView.frame = CGRectMake(0, self.startY , self.frame.size.width, 120);
UILabel *zztipsLabel = [[UILabel alloc] init];
[zztipsLabel setContentHuggingPriority:UILayoutPriorityDefaultHigh forAxis:UILayoutConstraintAxisVertical];
zztipsLabel.attributedText = createAttString(@"症状名称", 17, rgba(68, 57, 53, 1));
[zzConetView addSubview:zztipsLabel];
[zztipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(20);
make.top.mas_equalTo(20);
}];
IQTextView *zzNameTV = [[IQTextView alloc] init];
_zzNameTV = zzNameTV;
zzNameTV.placeholder = @"请输入症状名称";
zzNameTV.delegate = self;
zzNameTV.font = [UIFont systemFontOfSize:14];
zzNameTV.textColor = rgba(76, 74, 66, 1);
[zzConetView addSubview:zzNameTV];
[zzNameTV mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(20);
make.right.mas_equalTo(-20);
make.top.equalTo(zztipsLabel.mas_bottom).offset(10);
make.bottom.mas_equalTo(-10);
}];
UIView *lineView = [[UIView alloc] init];
lineView.backgroundColor = rgba(243, 243, 243, 1);
[zzConetView addSubview:lineView];
[lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.bottom.right.mas_equalTo(0);
make.height.mas_equalTo(10);
}];
// //症状描述
// UIView *ssConetView = [[UIView alloc] init];
// ssConetView.backgroundColor = [UIColor whiteColor];
// [self addSubview:ssConetView];
// _ssConetView = ssConetView;
// ssConetView.frame = CGRectMake(0,safaTop(310), self.frame.size.width, 130);
// UILabel *sstipsLabel = [[UILabel alloc] init];
// [sstipsLabel setContentHuggingPriority:UILayoutPriorityDefaultHigh forAxis:UILayoutConstraintAxisVertical];
// sstipsLabel.attributedText = createAttString(@"症状描述", 17, rgba(68, 57, 53, 1));
// [ssConetView addSubview:sstipsLabel];
// [sstipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.mas_equalTo(20);
// make.top.mas_equalTo(20);
// }];
//
// IQTextView *ssNameTV = [[IQTextView alloc] init];
// _ssNameTV = ssNameTV;
// ssNameTV.placeholder = @"请输入症状描述";
// ssNameTV.delegate = self;
// ssNameTV.font = [UIFont systemFontOfSize:14];
// ssNameTV.textColor = rgba(76, 74, 66, 1);
// [ssConetView addSubview:ssNameTV];
// [ssNameTV mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.mas_equalTo(20);
// make.right.mas_equalTo(-20);
// make.top.equalTo(sstipsLabel.mas_bottom).offset(14);
// make.bottom.mas_equalTo(-10);
// }];
//
// UIView *sslineView = [[UIView alloc] init];
// sslineView.backgroundColor = rgba(243, 243, 243, 1);
// [ssConetView addSubview:sslineView];
// [sslineView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.bottom.right.mas_equalTo(0);
// make.height.mas_equalTo(10);
// }];
// 护理方法
UIView *ffConetView = [[UIView alloc] init];
ffConetView.backgroundColor = [UIColor whiteColor];
[self addSubview:ffConetView];
_ffConetView = ffConetView;
// ffConetView.frame = CGRectMake(0,safaTop(440), self.frame.size.width, 130);
ffConetView.frame = CGRectMake(0,self.startY+120, self.frame.size.width, ([UIScreen mainScreen].bounds.size.height - (self.startY+120) - 100));
UILabel *fftipsLabel = [[UILabel alloc] init];
[fftipsLabel setContentHuggingPriority:UILayoutPriorityDefaultHigh forAxis:UILayoutConstraintAxisVertical];
fftipsLabel.attributedText = createAttString(@"护理方法", 17, rgba(68, 57, 53, 1));
[ffConetView addSubview:fftipsLabel];
[fftipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(20);
make.top.mas_equalTo(20);
}];
IQTextView *ffNameTV = [[IQTextView alloc] init];
_ffNameTV = ffNameTV;
ffNameTV.placeholder = @"请输入护理方法";
ffNameTV.delegate = self;
ffNameTV.font = [UIFont systemFontOfSize:14];
ffNameTV.textColor = rgba(76, 74, 66, 1);
[ffConetView addSubview:ffNameTV];
[ffNameTV mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(20);
make.right.mas_equalTo(-20);
make.top.equalTo(fftipsLabel.mas_bottom).offset(10);
make.bottom.mas_equalTo(-10);
}];
// UIView *fflineView = [[UIView alloc] init];
// fflineView.backgroundColor = rgba(243, 243, 243, 1);
// [ffConetView addSubview:fflineView];
// [fflineView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.bottom.right.mas_equalTo(0);
// make.height.mas_equalTo(10);
// }];
UIButton *qdBtn = [[UIButton alloc] init];
qdBtn.selected = YES;
qdBtn.userInteractionEnabled = NO;
_qdBtn = qdBtn;
[qdBtn addTarget:self action:@selector(qdBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[qdBtn setAttributedTitle:createAttString(@"保存", 15, rgba(255, 255, 255, 1)) forState:UIControlStateNormal];
[qdBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 124, 78, 1) size:CGSizeMake(225.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] forState:UIControlStateNormal];
[qdBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 200, 180, 1) size:CGSizeMake(225.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] forState:UIControlStateSelected];
[self addSubview:qdBtn];
[qdBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.bottom.mas_equalTo(-37);
}];
}
- (void)typeBtnClick:(UIButton *)btn {
NSInteger index = btn.tag - 1590;
NSDictionary *dict = self.wenAnArray[index];
self.ffNameTV.text = dict[@"fa"];
self.zzNameTV.text = dict[@"bt"];
// self.ssNameTV.text = dict[@"zz"];
self.qdBtn.selected = NO;
self.qdBtn.userInteractionEnabled = YES;
for (int i = 0; i < self.wenAnArray.count; i++) {
NSDictionary *dict = self.wenAnArray[i];
UIButton *btn = self.typeBtnArray[i];
if ( [dict[@"fa"] isEqualToString: self.ffNameTV.text] &&
[dict[@"bt"] isEqualToString: self.zzNameTV.text]) {
btn.selected = YES;
btn.userInteractionEnabled = NO;
}else {
btn.selected = NO;
btn.userInteractionEnabled = YES;
}
}
}
- (void)textViewDidBeginEditing:(UITextView *)textView {
[self bringSubviewToFront:textView.superview];
[UIView animateWithDuration:0.25 animations:^{
CGFloat h = self.frame.size.height - 150;
if ([textView.superview isEqual:self.zzConetView]) {
self.zzConetView.frame = CGRectMake(0, safaTop(64), self.frame.size.width, h);
}else if([textView.superview isEqual:self.ffConetView]) {
self.ffConetView.frame = CGRectMake(0, safaTop(64), self.frame.size.width, h);
}else if([textView.superview isEqual:self.ffConetView]) {
self.ffConetView.frame = CGRectMake(0, safaTop(64), self.frame.size.width, h);
}
}];
}
- (void)textViewDidEndEditing:(UITextView *)textView {
[self bringSubviewToFront:textView.superview];
[UIView animateWithDuration:0.25 animations:^{
if ([textView.superview isEqual:self.zzConetView]) {
self.zzConetView.frame = CGRectMake(0,self.startY, self.frame.size.width, 120);
}else if([textView.superview isEqual:self.ffConetView]) {
self.ffConetView.frame = CGRectMake(0, self.startY+120, self.frame.size.width, ([UIScreen mainScreen].bounds.size.height - ( self.startY+120) - 100));
}
}];
}
- (void)textViewDidChange:(UITextView *)textView {
if ( self.ffNameTV.text.length && self.zzNameTV.text.length) {
self.qdBtn.selected = NO;
self.qdBtn.userInteractionEnabled = YES;
}else {
self.qdBtn.selected = YES;
self.qdBtn.userInteractionEnabled = NO;
}
for (int i = 0; i < self.wenAnArray.count; i++) {
NSDictionary *dict = self.wenAnArray[i];
UIButton *btn = self.typeBtnArray[i];
if ( [dict[@"fa"] isEqualToString: self.ffNameTV.text] &&
[dict[@"bt"] isEqualToString: self.zzNameTV.text]) {
btn.selected = YES;
btn.userInteractionEnabled = NO;
}else {
btn.selected = NO;
btn.userInteractionEnabled = YES;
}
}
}
- (void)backClick:(UIButton *)btn {
[self wb_disLTRMiss];
}
- (void)qdBtnClick:(UIButton *)btn {
NSString *sname = self.zzNameTV.text;
if (sname == 0) {
[SVProgressHUD showErrorWithStatus:@"症状名称不能为空"];
return;
}
if ([sname containsEmoji]) {
[SVProgressHUD showErrorWithStatus:@"症状名称不能输入表情"];
return;
}
if (sname.length > 30) {
[SVProgressHUD showErrorWithStatus:@"症状名称不能超过30个字"];
return;
}
// NSString *sDescribe = self.ssNameTV.text;
// if (sDescribe == 0) {
// [SVProgressHUD showErrorWithStatus:@"症状描述不能为空"];
// return;
// }
// if ([sDescribe containsEmoji]) {
// [SVProgressHUD showErrorWithStatus:@"症状描述不能输入表情"];
// return;
// }
// if (sDescribe.length > 2000) {
// [SVProgressHUD showErrorWithStatus:@"症状描述不能超过2000个字"];
// return;
// }
//
NSString *sMethod = self.ffNameTV.text;
if (sMethod == 0) {
[SVProgressHUD showErrorWithStatus:@"护理方法不能为空"];
return;
}
if ([sMethod containsEmoji]) {
[SVProgressHUD showErrorWithStatus:@"护理方法不能输入表情"];
return;
}
if (sMethod.length > 2000) {
[SVProgressHUD showErrorWithStatus:@"护理方法不能超过2000个字"];
return;
}
if (self.saveBlock) {
self.saveBlock(self.zzNameTV.text,@"",self.ffNameTV.text);
}
[self wb_disLTRMiss];
}
@end
//
// SMReportEditSchemeView.h
// SkinMagnifier
//
// Created by nana on 2020/12/1.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMReportEditSchemeView : UIView
/// yes 保存,no 删除
@property(nonatomic, copy)void (^saveBlock)(NSString *sname,NSString *sDescribe,NSString *sMethod,NSInteger status);
- (void)updateSname:(NSString *)sname sDescribe:(NSString *)sDescribe sMethod:(NSString *)sMethod;
@end
NS_ASSUME_NONNULL_END
//
// SMReportEditSchemeView.m
// SkinMagnifier
//
// Created by nana on 2020/12/1.
//
#import "SMReportEditSchemeView.h"
#import <IQKeyboardManager/IQUIView+Hierarchy.h>
#import <IQKeyboardManager/IQTextView.h>
@interface SMReportEditSchemeView()<UITextViewDelegate>
@property(nonatomic, weak)UIView *zzConetView;
//@property(nonatomic, weak)UIView *ssConetView;
@property(nonatomic, weak)UIView *ffConetView;
@property(nonatomic, weak)IQTextView *zzNameTV;
//@property(nonatomic, weak)IQTextView *ssNameTV;
@property(nonatomic, weak)IQTextView *ffNameTV;
@property(nonatomic, weak)UIButton *qdBtn;
@end
@implementation SMReportEditSchemeView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.backgroundColor = [UIColor whiteColor];
UIImageView *tipsImageView = [[UIImageView alloc] init];
tipsImageView.image = [UIImage imageNamed:@"report_header_bg"];
[self addSubview:tipsImageView];
[tipsImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.right.left.mas_equalTo(0);
// make.height.mas_equalTo(258);
}];
// 症状名称
UIButton *backBtn = [[UIButton alloc] init];
backBtn.frame = CGRectMake(10, safaTop(20) , 38, 45);
[backBtn wb_setImageName:@"nav_black_back"];
[backBtn addTarget:self action:@selector(backClick:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:backBtn];
UILabel *titleLabel = [[UILabel alloc] init];
titleLabel.attributedText = createAttString(@"编辑方案", 17, rgba(76, 74, 66, 1));
[self addSubview:titleLabel];
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.centerY.equalTo(backBtn);
}];
UIView *zzConetView = [[UIView alloc] init];
zzConetView.backgroundColor = [UIColor whiteColor];
[self addSubview:zzConetView];
_zzConetView = zzConetView;
zzConetView.frame = CGRectMake(0, 96.5, self.frame.size.width, 120);
UILabel *zztipsLabel = [[UILabel alloc] init];
[zztipsLabel setContentHuggingPriority:UILayoutPriorityDefaultHigh forAxis:UILayoutConstraintAxisVertical];
zztipsLabel.attributedText = createAttString(@"症状名称", 17, rgba(68, 57, 53, 1));
[zzConetView addSubview:zztipsLabel];
[zztipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(20);
make.top.mas_equalTo(20);
}];
IQTextView *zzNameTV = [[IQTextView alloc] init];
_zzNameTV = zzNameTV;
zzNameTV.placeholder = @"请输入症状名称";
zzNameTV.delegate = self;
zzNameTV.font = [UIFont systemFontOfSize:14];
zzNameTV.textColor = rgba(76, 74, 66, 1);
[zzConetView addSubview:zzNameTV];
[zzNameTV mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(20);
make.right.mas_equalTo(-20);
make.top.equalTo(zztipsLabel.mas_bottom).offset(10);
make.bottom.mas_equalTo(-10);
}];
UIView *lineView = [[UIView alloc] init];
lineView.backgroundColor = rgba(243, 243, 243, 1);
[zzConetView addSubview:lineView];
[lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.bottom.right.mas_equalTo(0);
make.height.mas_equalTo(10);
}];
// 症状描述
// UIView *ssConetView = [[UIView alloc] init];
// ssConetView.backgroundColor = [UIColor whiteColor];
// [self addSubview:ssConetView];
// _ssConetView = ssConetView;
// ssConetView.frame = CGRectMake(0, 196.5, self.frame.size.width, 130);
//
// UILabel *sstipsLabel = [[UILabel alloc] init];
// [sstipsLabel setContentHuggingPriority:UILayoutPriorityDefaultHigh forAxis:UILayoutConstraintAxisVertical];
// sstipsLabel.attributedText = createAttString(@"症状描述", 17, rgba(68, 57, 53, 1));
// [ssConetView addSubview:sstipsLabel];
// [sstipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.mas_equalTo(20);
// make.top.mas_equalTo(20);
// }];
//
// IQTextView *ssNameTV = [[IQTextView alloc] init];
// _ssNameTV = ssNameTV;
// ssNameTV.placeholder = @"请输入症状描述";
// ssNameTV.delegate = self;
// ssNameTV.font = [UIFont systemFontOfSize:14];
// ssNameTV.textColor = rgba(76, 74, 66, 1);
// [ssConetView addSubview:ssNameTV];
// [ssNameTV mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.mas_equalTo(20);
// make.right.mas_equalTo(-20);
// make.top.equalTo(sstipsLabel.mas_bottom).offset(10);
// make.bottom.mas_equalTo(-10);
// }];
//
// UIView *sslineView = [[UIView alloc] init];
// sslineView.backgroundColor = rgba(243, 243, 243, 1);
// [ssConetView addSubview:sslineView];
// [sslineView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.bottom.right.mas_equalTo(0);
// make.height.mas_equalTo(10);
// }];
// 护理方法
UIView *ffConetView = [[UIView alloc] init];
ffConetView.backgroundColor = [UIColor whiteColor];
[self addSubview:ffConetView];
_ffConetView = ffConetView;
ffConetView.frame = CGRectMake(0, 220, self.frame.size.width, ([UIScreen mainScreen].bounds.size.height - 220 - 100));
UILabel *fftipsLabel = [[UILabel alloc] init];
[fftipsLabel setContentHuggingPriority:UILayoutPriorityDefaultHigh forAxis:UILayoutConstraintAxisVertical];
fftipsLabel.attributedText = createAttString(@"护理方法", 17, rgba(68, 57, 53, 1));
[ffConetView addSubview:fftipsLabel];
[fftipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(20);
make.top.mas_equalTo(20);
}];
IQTextView *ffNameTV = [[IQTextView alloc] init];
_ffNameTV = ffNameTV;
ffNameTV.placeholder = @"请输入护理方法";
ffNameTV.delegate = self;
ffNameTV.font = [UIFont systemFontOfSize:14];
ffNameTV.textColor = rgba(76, 74, 66, 1);
[ffConetView addSubview:ffNameTV];
[ffNameTV mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(20);
make.right.mas_equalTo(-20);
make.top.equalTo(fftipsLabel.mas_bottom).offset(14);
make.bottom.mas_equalTo(-10);
}];
// UIView *fflineView = [[UIView alloc] init];
// fflineView.backgroundColor = rgba(243, 243, 243, 1);
// [ffConetView addSubview:fflineView];
// [fflineView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.bottom.right.mas_equalTo(0);
// make.height.mas_equalTo(10);
// }];
UIButton *qdBtn = [[UIButton alloc] init];
qdBtn.selected = YES;
qdBtn.userInteractionEnabled = NO;
_qdBtn = qdBtn;
[qdBtn addTarget:self action:@selector(qdClick:) forControlEvents:UIControlEventTouchUpInside];
[qdBtn setAttributedTitle:createAttString(@"保存", 15, rgba(255, 255, 255, 1)) forState:UIControlStateNormal];
[qdBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 124, 78, 1) size:CGSizeMake(225.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] forState:UIControlStateNormal];
[qdBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 200, 180, 1) size:CGSizeMake(225.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] forState:UIControlStateSelected];
[self addSubview:qdBtn];
[qdBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.bottom.mas_equalTo(-37);
}];
UIButton *delBtn = [[UIButton alloc] init];
[delBtn addTarget:self action:@selector(delBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[delBtn wb_setImageName:@"Program_icon_delete"];
[self addSubview:delBtn];
[delBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(backBtn);
make.right.mas_equalTo(-10);
make.size.mas_equalTo(CGSizeMake(25, 25));
}];
}
- (void)delBtnClick:(UIButton *)btn {
@weakify(self);
//1.创建UIAlertControl
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"删除解决方案" message:@"" preferredStyle:UIAlertControllerStyleAlert];
/*
参数说明:
Title:弹框的标题
message:弹框的消息内容
preferredStyle:弹框样式:UIAlertControllerStyleAlert
*/
//2.添加按钮动作
//2.1 确认按钮
UIAlertAction *conform = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
@strongify(self);
if (self.saveBlock) {
self.saveBlock(self.zzNameTV.text,@"",self.ffNameTV.text,2);
}
[self wb_disLTRMiss];
}];
UIAlertAction *cancleAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
}];
//3.将动作按钮 添加到控制器中
[alert addAction:cancleAction];
[alert addAction:conform];
//4.显示弹框
[self.viewContainingController presentViewController:alert animated:YES completion:nil];
}
- (void)qdClick:(UIButton *)btn {
NSString *sname = self.zzNameTV.text;
if (sname == 0) {
[SVProgressHUD showErrorWithStatus:@"症状名称不能为空"];
return;
}
if ([sname containsEmoji]) {
[SVProgressHUD showErrorWithStatus:@"症状名称不能输入表情"];
return;
}
if (sname.length > 30) {
[SVProgressHUD showErrorWithStatus:@"症状名称不能超过30个字"];
return;
}
// NSString *sDescribe = self.ssNameTV.text;
// if (sDescribe == 0) {
// [SVProgressHUD showErrorWithStatus:@"症状描述不能为空"];
// return;
// }
// if ([sDescribe containsEmoji]) {
// [SVProgressHUD showErrorWithStatus:@"症状描述不能输入表情"];
// return;
// }
// if (sDescribe.length > 2000) {
// [SVProgressHUD showErrorWithStatus:@"症状描述不能超过2000个字"];
// return;
// }
//
NSString *sMethod = self.ffNameTV.text;
if (sMethod == 0) {
[SVProgressHUD showErrorWithStatus:@"护理方法不能为空"];
return;
}
if ([sMethod containsEmoji]) {
[SVProgressHUD showErrorWithStatus:@"护理方法不能输入表情"];
return;
}
if (sMethod.length > 2000) {
[SVProgressHUD showErrorWithStatus:@"护理方法不能超过2000个字"];
return;
}
if (self.saveBlock) {
self.saveBlock(self.zzNameTV.text,@"",self.ffNameTV.text,1);
}
[self wb_disLTRMiss];
}
- (void)textViewDidBeginEditing:(UITextView *)textView {
[self bringSubviewToFront:textView.superview];
[UIView animateWithDuration:0.25 animations:^{
CGFloat h = self.frame.size.height - 150;
if ([textView.superview isEqual:self.zzConetView]) {
self.zzConetView.frame = CGRectMake(0, safaTop(64), self.frame.size.width, h);
}else if([textView.superview isEqual:self.ffConetView]) {
self.ffConetView.frame = CGRectMake(0, safaTop(64), self.frame.size.width, h);
}
}];
}
- (void)textViewDidEndEditing:(UITextView *)textView {
[self bringSubviewToFront:textView.superview];
[UIView animateWithDuration:0.25 animations:^{
if ([textView.superview isEqual:self.zzConetView]) {
self.zzConetView.frame = CGRectMake(0, 96.5, self.frame.size.width, 120);
}else if([textView.superview isEqual:self.ffConetView]) {
self.ffConetView.frame = CGRectMake(0, 220, self.frame.size.width, ([UIScreen mainScreen].bounds.size.height - 220 - 100));
}
}];
}
- (void)textViewDidChange:(UITextView *)textView {
if ( self.ffNameTV.text.length && self.zzNameTV.text.length) {
self.qdBtn.selected = NO;
self.qdBtn.userInteractionEnabled = YES;
}else {
self.qdBtn.selected = YES;
self.qdBtn.userInteractionEnabled = NO;
}
}
- (void)backClick:(UIButton *)btn {
[self wb_disLTRMiss];
}
- (void)updateSname:(NSString *)sname sDescribe:(NSString *)sDescribe sMethod:(NSString *)sMethod {
self.zzNameTV.text = sname;
self.ffNameTV.text = sMethod;
self.qdBtn.selected = NO;
self.qdBtn.userInteractionEnabled = YES;
}
@end
//
// SMReportHeaderCell.h
// SkinMagnifier
//
// Created by nana on 2020/11/23.
//
#import <UIKit/UIKit.h>
#import "SMLocalReportModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface SMReportHeaderCell : UITableViewCell
@property(nonatomic, weak)UICollectionView *imageCView;
@property(nonatomic, weak)UIView *leidaVivew;
@property(nonatomic, weak)SMLocalReportModel *lrModel;
- (instancetype)initWithModel:(SMLocalReportModel *)model;
@end
NS_ASSUME_NONNULL_END
//
// SMReportHeaderCell.m
// SkinMagnifier
//
// Created by nana on 2020/11/23.
//
#import "SMReportHeaderCell.h"
#import "SMPageControl.h"
#import "SMRaderMapCompleteView.h"
#import "SMReportImageCell.h"
#import "SMShowImageView.h"
#import <IQUIView+Hierarchy.h>
@interface SMReportHeaderCell()<UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
@property(nonatomic, strong)SMPageControl *pageControl;
@end
@implementation SMReportHeaderCell
//- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
// if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
// [self setupUI];
// }
// return self;
//}
- - initWithModel:(SMLocalReportModel *)model {
if (self = [super init]) {
_lrModel = model;
[self setupUI];
}
return self;
}
- (void)setupUI
{
self.selectionStyle =UITableViewCellSelectionStyleNone;
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc ] init];
layout.itemSize = biliSize(335, 175.5);
layout.minimumLineSpacing = 0;
layout.minimumInteritemSpacing = 0;
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
UICollectionView *imageCView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
_imageCView = imageCView;
imageCView.layer.masksToBounds = YES;
imageCView.layer.cornerRadius = 10;
[imageCView addObserver:self forKeyPath:@"contentOffset" options:NSKeyValueObservingOptionNew context:nil];
imageCView.pagingEnabled = YES;
imageCView.showsHorizontalScrollIndicator = NO;
imageCView.showsVerticalScrollIndicator = NO;
imageCView.dataSource = self;
imageCView.delegate = self;
[imageCView registerClass:[SMReportImageCell class] forCellWithReuseIdentifier:NSStringFromClass([SMReportImageCell class])];
[self.contentView addSubview:imageCView];
[imageCView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(0);
make.centerX.mas_equalTo(0);
make.size.mas_equalTo(biliSize(335, 175.5));
}];
UIButton *fdBtn = [[UIButton alloc] init];
fdBtn.userInteractionEnabled = NO;
[fdBtn wb_setImageName:@"report_icon_amplification"];
[self.contentView addSubview:fdBtn];
[fdBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(imageCView).offset(-10);
make.right.equalTo(imageCView).offset(-15);
}];
self.pageControl = [[SMPageControl alloc] initWithFrame:CGRectMake(0, 0, 50, 4)];
[self.contentView addSubview:self.pageControl];
[self.pageControl mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(imageCView);
make.bottom.equalTo(imageCView).offset(-10);
}];
self.pageControl.cornerRadius = 5;
self.pageControl.dotHeight = 5;
self.pageControl.dotSpace = 6;
self.pageControl.currentDotWidth = 5;
self.pageControl.otherDotWidth = 5;
self.pageControl.otherDotColor = rgba(210, 202, 202, 1);
self.pageControl.currentDotColor = [UIColor whiteColor];
self.pageControl.numberOfPages = 4;
self.pageControl.currentPage = 0;
UIView *lastView = imageCView;
if (self.lrModel.AISymptomArray.count < 5) {
}else {
UIView *xVivew = [[UIView alloc] init];
xVivew.layer.masksToBounds = YES;
[self.contentView addSubview:xVivew];
[xVivew mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(imageCView.mas_bottom).offset(20);
make.centerX.mas_equalTo(0);
make.height.width.mas_equalTo(300);
}];
NSMutableArray *nameArray = [[NSMutableArray alloc] init];
NSMutableArray *fenArray = [[NSMutableArray alloc] init];
for (int i = 0; i < self.lrModel.AISymptomArray.count; i++) {
SMLocalReportAIModel *model = self.lrModel.AISymptomArray[i];
/// 症状标志名(* :; :;纹理:magn_wrinkle; 毛孔堵塞:magn_pore_clogging;毛孔粗大:magn_pore_large;色素沉淀:magn_pigmentation;皮脂:magn_sebum;)与服务端一一对应,不可修改
if ([model.tagFlag isEqualToString:@"magn_water"] ) {//水份
if (model.tagNum.intValue == 0) {
continue;
[fenArray addObject:@"0.1"];
}else if (model.tagNum.intValue < 45) {
[fenArray addObject:@"0.33"];
}else if (model.tagNum.intValue <= 55) {
[fenArray addObject:@"0.66"];
}else {
[fenArray addObject:@"0.99"];
}
}else if ([model.tagFlag isEqualToString:@"magn_sensity"] ) {//敏感
int fen = 0;
if (model.tagNum.doubleValue > 0 && model.tagNum.doubleValue < 1) {
fen = 1;
}else {
fen = ceilf(model.tagNum.doubleValue);
}
if (fen == 0) {
[fenArray addObject:@"0.99"];
}else if (fen <= 10) {
[fenArray addObject:@"0.66"];
}else if (fen <= 20) {
[fenArray addObject:@"0.33"];
}else {
[fenArray addObject:@"0.1"];
}
}else if ([model.tagFlag isEqualToString:@"magn_pigmentation"]) {
int fen = 0;
if (model.tagNum.doubleValue > 0 && model.tagNum.doubleValue < 1) {
fen = 1;
}else {
fen = ceilf(model.tagNum.doubleValue);
}
if (fen == 0) {
[fenArray addObject:@"0.99"];
}else if (fen <= 7) {
[fenArray addObject:@"0.66"];
}else if (fen <= 15) {
[fenArray addObject:@"0.33"];
}else {
[fenArray addObject:@"0.1"];
}
}else if ([model.tagFlag isEqualToString:@"magn_wrinkle"]) {
if (model.tagNum.intValue == 0) {
[fenArray addObject:@"0.99"];
}else if (model.tagNum.intValue <= 25) {
[fenArray addObject:@"0.66"];
}else if (model.tagNum.intValue <= 40) {
[fenArray addObject:@"0.33"];
}else {
[fenArray addObject:@"0.1"];
}
}else if ([model.tagFlag isEqualToString:@"magn_pore_large"] ||
[model.tagFlag isEqualToString:@"magn_pore_clogging"]) {
if (model.tagNum.intValue == 0) {
[fenArray addObject:@"0.99"];
}else if (model.tagNum.intValue <= 50000) {
[fenArray addObject:@"0.66"];
}else if (model.tagNum.intValue <= 120000) {
[fenArray addObject:@"0.33"];
}else {
[fenArray addObject:@"0.1"];
}
}else if ([model.tagFlag isEqualToString:@"magn_sebum"]) {
if (model.tagNum.intValue <= 9) {
[fenArray addObject:@"0.99"];
}else {
int fen = abs(model.tagNum.intValue - 90);
[fenArray addObject:[NSString stringWithFormat:@"%0.2f",fen/100.0]];
}
}
[nameArray addObject:model.tagname];
}
ElementItem *item1 = [[ElementItem alloc]init];
item1.itemPercent = fenArray;
item1.itemColor = rgba(225, 207, 183, 1);
// @[@"水份",@"皮脂",@"色沉",@"毛孔粗大",@"毛孔堵塞",@"纹理" ,@"敏感"];
SMRaderMapCompleteView *radar = [[SMRaderMapCompleteView alloc]initWithRadarElements:nameArray size:CGSizeMake(300, 300) lengthColor:rgba(229, 213, 193, 1)];
[radar addAbilitysWithElements:@[item1]];
[xVivew addSubview:radar];
[self.contentView bringSubviewToFront:imageCView];
[self.contentView bringSubviewToFront:fdBtn];
UIView *tipsBgView = [[UIView alloc] init];
lastView = tipsBgView;
tipsBgView.backgroundColor = rgba(248, 246, 244, 1);
tipsBgView.layer.cornerRadius =14;
[self.contentView addSubview:tipsBgView];
[tipsBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(xVivew.mas_bottom).offset(-40);
make.centerX.mas_equalTo(0);
make.size.mas_equalTo(CGSizeMake(300, 27));
}];
UILabel *tipsLabel = [[UILabel alloc] init];
tipsLabel.backgroundColor = rgba(248, 246, 244, 1);
tipsLabel.attributedText = createAttString(@"雷达图越往外代表越健康",12, rgba(153, 153, 153, 1));
tipsLabel.textAlignment = NSTextAlignmentCenter;
[tipsBgView addSubview:tipsLabel];
[tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(0);
}];
UILabel *xinLabel = [[UILabel alloc] init];
xinLabel.backgroundColor = rgba(248, 246, 244, 1);
xinLabel.attributedText = createAttString(@"*",12, rgba(153, 153, 153, 1));
xinLabel.textAlignment = NSTextAlignmentCenter;
[tipsBgView addSubview:xinLabel];
[xinLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(2);
make.right.equalTo(tipsLabel.mas_left);
}];
}
UIView *lineView = [[UIView alloc] init];
lineView.backgroundColor = rgba(243, 243, 243, 1);
[self.contentView addSubview:lineView];
[lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(lastView.mas_bottom).offset(25);
make.left.right.mas_equalTo(0);
make.height.mas_equalTo(11.5);
make.bottom.mas_equalTo(0);
}];
}
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context {
int page = (int)(self.imageCView.contentOffset.x / self.imageCView.bounds.size.width+0.5);
if ( self.pageControl.currentPage != page) {
self.pageControl.currentPage = page ;
}
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.lrModel.imageArray.count;;
}
// The cell that is returned must be retrieved from a call to -dequeueReusableCellWithReuseIdentifier:forIndexPath:
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
SMReportImageCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([SMReportImageCell class]) forIndexPath:indexPath];
SMLocalReportImageModel *model = self.lrModel.imageArray[indexPath.row];
@weakify(cell);
cell.iconImageView.contentMode = UIViewContentModeCenter;
[cell.iconImageView sd_setImageWithURL:[NSURL URLWithString:model.iURL] placeholderImage:[UIImage imageNamed:@"report_Placeholder_img"]completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
@strongify(cell);
if (image) {
cell.iconImageView.contentMode = UIViewContentModeScaleAspectFill;
}
}];
[cell.tipsBtn setAttributedTitle:createAttString(model.iname ,15, [UIColor whiteColor]) forState:UIControlStateNormal];
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
SMReportImageCell *cell = (SMReportImageCell *)[collectionView cellForItemAtIndexPath:indexPath];
SMShowImageView *iview = [SMShowImageView new];
iview.dataArray = self.lrModel.imageArray;
iview.selectIndex = indexPath.row;
[iview mm_showFrameView:self.viewContainingController.view positionView:cell];
}
-(void)dealloc {
[self.imageCView removeObserver:self forKeyPath:@"contentOffset"];
}
@end
//
// SMReportImageCell.h
// SkinMagnifier
//
// Created by nana on 2020/11/23.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMReportImageCell : UICollectionViewCell
@property(nonatomic, strong)UIImageView *iconImageView;
@property(nonatomic, strong)UIButton *tipsBtn;
@end
NS_ASSUME_NONNULL_END
//
// SMReportImageCell.m
// SkinMagnifier
//
// Created by nana on 2020/11/23.
//
#import "SMReportImageCell.h"
@implementation SMReportImageCell
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.iconImageView = [[UIImageView alloc] init];
self.iconImageView.backgroundColor = rgba(255, 248, 244, 1);
self.iconImageView.layer.masksToBounds = YES;
[self.contentView addSubview:self.iconImageView];
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(UIEdgeInsetsMake(0, 0, 0, 0));
}];
self.tipsBtn = [[UIButton alloc] init];
self.tipsBtn.imageEdgeInsets = UIEdgeInsetsMake(0, -4.5, 0, 4.5);
[self.tipsBtn setAttributedTitle:createAttString(@" ", 15, [UIColor whiteColor]) forState:UIControlStateNormal];
[self.tipsBtn wb_setImageName:@"report_icon_tips_nor"];
[self.contentView addSubview:self.tipsBtn];
[self.tipsBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(15);
make.top.mas_equalTo(15);
}];
}
@end
//
// SMReportOilCell.h
// SkinMagnifier
//
// Created by nana on 2020/12/7.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMReportOilCell : UITableViewCell
/// 名字
@property(nonatomic, weak)UILabel *nameValueLabel;
///// 描述
//@property(nonatomic, weak)UILabel *symptomValueLabel;
/// 方法
@property(nonatomic, weak)UILabel *nursingValueLabel;
- (void)updateOil:(NSString * )oil;
@end
NS_ASSUME_NONNULL_END
//
// SMReportOilCell.m
// SkinMagnifier
//
// Created by nana on 2020/12/7.
//
#import "SMReportOilCell.h"
@interface SMReportOilCell()
@property(nonatomic, weak)UILabel *symptomTitleLabel;
@property(nonatomic, weak)UILabel *nursingTitleLabel;
@property(nonatomic, weak)UILabel *oilValueLabel;
@property(nonatomic, strong)UIButton *oneBtn;
@property(nonatomic, strong)UIButton *twoBtn;
@property(nonatomic, strong)UIButton *threeBtn;
@end
@implementation SMReportOilCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self setupUI];
}
return self;
}
- (void)setupUI {
UILabel *oilLabel = [[UILabel alloc] init];
self.selectionStyle = UITableViewCellSelectionStyleNone;
_nameValueLabel = oilLabel;
oilLabel.attributedText = createAttString(@" ", 18, rgba(76, 74, 66, 1));
[self.contentView addSubview:oilLabel];
[oilLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(19);
make.centerX.mas_equalTo(0);
}];
UIView *oliLineView = [[UIView alloc] init];
oliLineView.backgroundColor = rgba(235, 230, 223, 1);
[self.contentView insertSubview:oliLineView belowSubview:oilLabel];
[oliLineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(oilLabel.mas_bottom).offset(-1);
make.centerX.equalTo(oilLabel);
make.height.mas_equalTo(6);
make.left.equalTo(oilLabel).offset(-10);
make.right.equalTo(oilLabel).offset(10);
}];
UIView *bgView = [[UIView alloc] init];
bgView.backgroundColor = [UIColor whiteColor];
bgView.layer.borderColor =rgba(255, 217, 204, 1).CGColor;
bgView.layer.borderWidth =1;
bgView.layer.cornerRadius = 10;
bgView.layer.masksToBounds = YES;
[self.contentView addSubview:bgView];
[bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(20);
make.right.mas_equalTo(-20);
make.height.mas_equalTo(100);
make.top.equalTo(oilLabel.mas_bottom).offset(20);
}];
NSMutableAttributedString *mAtt = [[NSMutableAttributedString alloc] init];
[mAtt appendAttributedString:createAttString(@" ", 30, rgba(255, 124, 78, 1))];
[mAtt appendAttributedString:createAttString(@"%", 12, rgba(255, 124, 78, 1))];
UILabel *oilValueLabel = [[UILabel alloc] init];
_oilValueLabel = oilValueLabel;
oilValueLabel.backgroundColor = rgba(255, 242, 237, 1);
oilValueLabel.textAlignment = NSTextAlignmentCenter;
oilValueLabel.attributedText = mAtt;
[bgView addSubview:oilValueLabel];
[oilValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.mas_equalTo(12);
// make.centerY.mas_equalTo(0);
make.top.left.bottom.mas_equalTo(0);
make.width.mas_equalTo(70);
}];
CGFloat mw = [UIScreen mainScreen].bounds.size.width;
CGFloat space = (mw - 40 - 70 - (68*3))/4;
UIButton *oneBtn = [[UIButton alloc] init];
_oneBtn = oneBtn;
[oneBtn setBackgroundImage:[UIImage imageNamed:@"report_bg_qs_nor"] forState:UIControlStateSelected];
[oneBtn setBackgroundImage:[UIImage imageNamed:@"report_bg_qs_sel"] forState: UIControlStateNormal];
[oneBtn setAttributedTitle:createAttString(@"缺水", 14, rgba(129, 109, 80, 0.3)) forState:UIControlStateNormal ];
[oneBtn setAttributedTitle:createAttString(@"缺水", 14, rgba(68, 57, 53, 1)) forState: UIControlStateSelected];
oneBtn.titleEdgeInsets = UIEdgeInsetsMake(-50, 0, 0, 0);
[bgView addSubview:oneBtn];
[oneBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(oilValueLabel.mas_right).offset(space);
make.centerY.mas_equalTo(0);
make.size.mas_equalTo(CGSizeMake(68, 80));
}];
UIButton *twoBtn = [[UIButton alloc] init];
_twoBtn = twoBtn;
[twoBtn setBackgroundImage:[UIImage imageNamed:@"report_bg_qdqs_nor"] forState: UIControlStateSelected];
[twoBtn setBackgroundImage:[UIImage imageNamed:@"report_bg_qdqs_sel"] forState:UIControlStateNormal];
[twoBtn setAttributedTitle:createAttString(@"轻度缺水", 14, rgba(129, 109, 80, 0.3)) forState: UIControlStateNormal];
[twoBtn setAttributedTitle:createAttString(@"轻度缺水", 14, rgba(68, 57, 53, 1)) forState:UIControlStateSelected];
twoBtn.titleEdgeInsets = UIEdgeInsetsMake(-50, 0, 0, 0);
[bgView addSubview:twoBtn];
[twoBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(oneBtn.mas_right).offset(space);
make.centerY.mas_equalTo(0);
make.size.mas_equalTo(CGSizeMake(68, 80));
}];
UIButton *threeBtn = [[UIButton alloc] init];
_threeBtn = threeBtn;
[threeBtn setBackgroundImage:[UIImage imageNamed:@"report_bg_lh_nor"] forState: UIControlStateSelected];
[threeBtn setBackgroundImage:[UIImage imageNamed:@"report_bg_lh_sel"] forState:UIControlStateNormal];
[threeBtn setAttributedTitle:createAttString(@"良好", 14, rgba(129, 109, 80, 0.3)) forState:UIControlStateNormal ];
[threeBtn setAttributedTitle:createAttString(@"良好", 14, rgba(68, 57, 53, 1)) forState: UIControlStateSelected];
threeBtn.titleEdgeInsets = UIEdgeInsetsMake(-50, 0, 0, 0);
[bgView addSubview:threeBtn];
[threeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(twoBtn.mas_right).offset(space);
make.centerY.mas_equalTo(0);
make.size.mas_equalTo(CGSizeMake(68, 80));
}];
// UIImageView *symptomImageView = [[UIImageView alloc] init];
// symptomImageView.image = [UIImage imageNamed:@"report_icon_fa_bg"];
// [self.contentView addSubview:symptomImageView];
// [symptomImageView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.mas_equalTo(22.5);
// make.top.equalTo(bgView.mas_bottom).offset(20);
//
// }];
//
// UILabel *symptomTitleLabel = [[UILabel alloc] init];
// _symptomTitleLabel = symptomTitleLabel;
// symptomTitleLabel.attributedText = createAttString(@"症状描述", 17, rgba(68, 57, 53, 1));
// [self.contentView addSubview:symptomTitleLabel];
// [symptomTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
// make.centerY.equalTo(symptomImageView);
// make.left.equalTo(symptomImageView.mas_right).offset(5);
//
// }];
//
// UILabel *symptomValueLabel = [[UILabel alloc] init];
// symptomValueLabel.numberOfLines = 0;
// _symptomValueLabel = symptomValueLabel;
// symptomValueLabel.attributedText = createAttString(@" ", 14,rgba(76, 74, 66, 1));
// [self.contentView addSubview:symptomValueLabel];
// [symptomValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
// make.top.equalTo(symptomImageView.mas_bottom).offset(13);
// make.left.mas_equalTo(22.5);
// make.right.mas_equalTo(-22.5);
// }];
//
// UIView *lineView = [[UIView alloc] init];
// lineView.backgroundColor = rgba(243, 243, 243, 1);
// [self.contentView addSubview:lineView];
// [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.right.mas_equalTo(0);
// make.height.mas_equalTo(1);
// make.top.equalTo(symptomValueLabel.mas_bottom).offset(18);
// }];
UIImageView *nursingImageView = [[UIImageView alloc] init];
nursingImageView.image = [UIImage imageNamed:@"report_icon_fa_bg"];
[self.contentView addSubview:nursingImageView];
[nursingImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(22.5);
make.top.equalTo(bgView.mas_bottom).offset(31);
}];
UILabel *nursingTitleLabel = [[UILabel alloc] init];
_nursingTitleLabel = nursingTitleLabel;
nursingTitleLabel.attributedText = createAttString(@"护理方法", 17, rgba(68, 57, 53, 1));
[self.contentView addSubview:nursingTitleLabel];
[nursingTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(nursingImageView);
make.left.equalTo(nursingImageView.mas_right).offset(5);
}];
UILabel *nursingValueLabel = [[UILabel alloc] init];
nursingValueLabel.numberOfLines = 0;
_nursingValueLabel = nursingValueLabel;
nursingValueLabel.attributedText = createAttString(@"", 14,rgba(76, 74, 66, 1));
[self.contentView addSubview:nursingValueLabel];
[nursingValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(nursingImageView.mas_bottom).offset(13);
make.left.mas_equalTo(22.5);
make.right.mas_equalTo(-22.5);
make.bottom.mas_equalTo(-28);
}];
UIView *twolineView = [[UIView alloc] init];
twolineView.backgroundColor = rgba(243, 243, 243, 1);
[self.contentView addSubview:twolineView];
[twolineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.bottom.right.mas_equalTo(0);
make.height.mas_equalTo(10);
}];
}
- (void)updateOil:(NSString *)oil {
NSMutableAttributedString *mAtt = [[NSMutableAttributedString alloc] init];
[mAtt appendAttributedString:createAttString(oil, 30, rgba(255, 124, 78, 1))];
[mAtt appendAttributedString:createAttString(@"%", 12, rgba(255, 124, 78, 1))];
self.oilValueLabel.attributedText = mAtt;
if (oil.intValue < 45) {
self.oneBtn.selected = YES;
}else if (oil.intValue > 55) {
self.threeBtn.selected = YES;
} else {
self.twoBtn.selected = YES;
}
}
@end
//
// SMReportProjectCell.h
// SkinMagnifier
//
// Created by nana on 2020/11/26.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMReportProjectCell : UITableViewCell
@property(nonatomic, strong)UIButton *iconImageView;
@property(nonatomic, strong)UIButton *projectTypeBtn;
@property(nonatomic, strong)UILabel *projectNameLabel;
@end
NS_ASSUME_NONNULL_END
//
// SMReportProjectCell.m
// SkinMagnifier
//
// Created by nana on 2020/11/26.
//
#import "SMReportProjectCell.h"
@interface SMReportProjectCell()
@end
@implementation SMReportProjectCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.iconImageView = [[UIButton alloc] init];
[self.iconImageView setImage:[UIImage imageNamed:@"report_icon_add_yq"] forState:UIControlStateNormal];
[self.iconImageView setImage:[UIImage imageNamed:@"report_icon_add_cp"] forState:UIControlStateSelected];
[self.iconImageView setAttributedTitle:createAttString(@"产品", 9, [UIColor whiteColor]) forState:UIControlStateSelected];
[self.contentView addSubview:self.iconImageView];
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(52, 52));
make.top.mas_equalTo(15);
make.bottom.mas_equalTo(-15);
make.left.mas_equalTo(20.5);
}];
self.projectTypeBtn = [[UIButton alloc] init];
[self.projectTypeBtn setAttributedTitle:createAttString(@"仪器", 9, [UIColor whiteColor]) forState:UIControlStateNormal];
[self.projectTypeBtn setAttributedTitle:createAttString(@"产品", 9, [UIColor whiteColor]) forState:UIControlStateSelected];
UIImage *img = [[[UIImage wb_imageWithColor:rgba(169, 169, 169, 1) size:CGSizeMake(30, 14)] sd_roundedCornerImageWithRadius:5 corners:0xff borderWidth:0 borderColor:[UIColor clearColor]] resizableImageWithCapInsets:UIEdgeInsetsMake(14, 6, 14, 6)];
[self.projectTypeBtn setBackgroundImage:img forState:UIControlStateNormal];
self.projectTypeBtn.contentEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 5);
[self.contentView addSubview:self.projectTypeBtn];
[self.projectTypeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo( self.iconImageView);
make.centerX.equalTo(self.iconImageView.mas_right);
}];
self.projectNameLabel = [[UILabel alloc] init];
self.projectNameLabel.attributedText = createAttString(@"洁肤清爽浸透爽肤水", 15, rgba(76, 74, 66, 1));
[self.contentView addSubview:self.projectNameLabel];
[self.projectNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.iconImageView.mas_right).offset(28.5);
make.centerY.equalTo(self.iconImageView);
make.right.mas_equalTo(-20);
}];
UIView *lineView = [[UIView alloc] init];
lineView.backgroundColor = rgba(243, 243, 243, 1);
[self.contentView addSubview:lineView];
[lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(20);
make.bottom.mas_equalTo(0);
make.height.mas_equalTo(1);
make.right.mas_equalTo(-20);
}];
}
@end
//
// SMReportSchemeCell.h
// SkinMagnifier
//
// Created by nana on 2020/11/23.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMReportSchemeCell : UITableViewCell
/// 名字
@property(nonatomic, weak)UILabel *nameValueLabel;
///// 描述
//@property(nonatomic, weak)UILabel *symptomValueLabel;
/// 方法
@property(nonatomic, weak)UILabel *nursingValueLabel;
@end
NS_ASSUME_NONNULL_END
//
// SMReportSchemeCell.m
// SkinMagnifier
//
// Created by nana on 2020/11/23.
//
#import "SMReportSchemeCell.h"
@interface SMReportSchemeCell()
@property(nonatomic, weak)UILabel *symptomTitleLabel;
@property(nonatomic, weak)UILabel *nursingTitleLabel;
@end
@implementation SMReportSchemeCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self setupUI];
}
return self;
}
- (void)setupUI {
UILabel *oilLabel = [[UILabel alloc] init];
_nameValueLabel = oilLabel;
oilLabel.attributedText = createAttString(@" ", 18, rgba(76, 74, 66, 1));
[self.contentView addSubview:oilLabel];
[oilLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(19);
make.centerX.mas_equalTo(0);
}];
UIView *oliLineView = [[UIView alloc] init];
oliLineView.backgroundColor = rgba(235, 230, 223, 1);
[self.contentView insertSubview:oliLineView belowSubview:oilLabel];
[oliLineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(oilLabel.mas_bottom).offset(-1);
make.centerX.equalTo(oilLabel);
make.height.mas_equalTo(6);
make.left.equalTo(oilLabel).offset(-10);
make.right.equalTo(oilLabel).offset(10);
}];
// UIImageView *symptomImageView = [[UIImageView alloc] init];
// symptomImageView.image = [UIImage imageNamed:@"report_icon_fa_bg"];
// [self.contentView addSubview:symptomImageView];
// [symptomImageView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.mas_equalTo(22.5);
// make.top.equalTo(oilLabel.mas_bottom).offset(20);
// }];
//
//// UILabel *symptomTitleLabel = [[UILabel alloc] init];
//// _symptomTitleLabel = symptomTitleLabel;
//// symptomTitleLabel.attributedText = createAttString(@"症状描述", 17, rgba(68, 57, 53, 1));
//// [self.contentView addSubview:symptomTitleLabel];
//// [symptomTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//// make.centerY.equalTo(symptomImageView);
//// make.left.equalTo(symptomImageView.mas_right).offset(5);
//// }];
////
//// UILabel *symptomValueLabel = [[UILabel alloc] init];
//// symptomValueLabel.numberOfLines = 0;
//// _symptomValueLabel = symptomValueLabel;
//// symptomValueLabel.attributedText = createAttString(@" ", 14,rgba(76, 74, 66, 1));
//// [self.contentView addSubview:symptomValueLabel];
//// [symptomValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//// make.top.equalTo(symptomImageView.mas_bottom).offset(13);
//// make.left.mas_equalTo(22.5);
//// make.right.mas_equalTo(-22.5);
//// }];
////
//// UIView *lineView = [[UIView alloc] init];
//// lineView.backgroundColor = rgba(243, 243, 243, 1);
//// [self.contentView addSubview:lineView];
//// [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
//// make.left.right.mas_equalTo(0);
//// make.height.mas_equalTo(1);
//// make.top.equalTo(symptomValueLabel.mas_bottom).offset(18);
//// }];
UIImageView *nursingImageView = [[UIImageView alloc] init];
nursingImageView.image = [UIImage imageNamed:@"report_icon_fa_bg"];
[self.contentView addSubview:nursingImageView];
[nursingImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(22.5);
make.top.equalTo(oilLabel.mas_bottom).offset(20);
}];
UILabel *nursingTitleLabel = [[UILabel alloc] init];
_nursingTitleLabel = nursingTitleLabel;
nursingTitleLabel.attributedText = createAttString(@"护理方法", 17, rgba(68, 57, 53, 1));
[self.contentView addSubview:nursingTitleLabel];
[nursingTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(nursingImageView);
make.left.equalTo(nursingImageView.mas_right).offset(5);
}];
UILabel *nursingValueLabel = [[UILabel alloc] init];
nursingValueLabel.numberOfLines = 0;
_nursingValueLabel = nursingValueLabel;
nursingValueLabel.attributedText = createAttString(@"", 14,rgba(76, 74, 66, 1));
[self.contentView addSubview:nursingValueLabel];
[nursingValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(nursingImageView.mas_bottom).offset(13);
make.left.mas_equalTo(22.5);
make.right.mas_equalTo(-22.5);
make.bottom.mas_equalTo(-28);
}];
UIView *twolineView = [[UIView alloc] init];
twolineView.backgroundColor = rgba(243, 243, 243, 1);
[self.contentView addSubview:twolineView];
[twolineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.bottom.right.mas_equalTo(0);
make.height.mas_equalTo(10);
}];
}
@end
//
// SMReportSymptomCell.h
// SkinMagnifier
//
// Created by nana on 2021/1/7.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMReportSymptomCell : UITableViewCell
@property(nonatomic, strong)UILabel *nameLabel;
@property(nonatomic, strong)UILabel *fenLabel;
@property(nonatomic, strong)UILabel *fangfaLabel;
@property(nonatomic, weak)UIButton *AIBtn;
@property(nonatomic, weak)UILabel *onelevelLabel;
@property(nonatomic, weak)UILabel *twolevelLabel;
@property(nonatomic, weak)UILabel *threelevelLabel;
@property(nonatomic, weak)UILabel *fourlevelLabel;
@property(nonatomic, weak)UIImageView *oneImageView;
@property(nonatomic, weak)UIImageView *twoImageView;
@property(nonatomic, weak)UIImageView *threeImageView;
@property(nonatomic, weak)UIImageView *fourImageView;
@property(nonatomic, copy)void (^AIBtnClickBlock)(void);
@end
NS_ASSUME_NONNULL_END
//
// SMReportSymptomCell.m
// SkinMagnifier
//
// Created by nana on 2021/1/7.
//
#import "SMReportSymptomCell.h"
@interface SMReportSymptomCell()
@end
@implementation SMReportSymptomCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.selectionStyle =UITableViewCellSelectionStyleNone;
self.nameLabel = [[UILabel alloc] init];
self.nameLabel.attributedText = createAttString(@"敏感", 18, rgba(68, 57, 53, 1));
[self.contentView addSubview:self.nameLabel];
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.top.mas_equalTo(25);
}];
UIView *oliLineView = [[UIView alloc] init];
oliLineView.backgroundColor = rgba(235, 230, 223, 1);
[self.contentView insertSubview:oliLineView belowSubview: self.nameLabel];
[oliLineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self.nameLabel.mas_bottom).offset(-1);
make.centerX.equalTo(self.nameLabel);
make.height.mas_equalTo(6);
make.left.equalTo(self.nameLabel).offset(-10);
make.right.equalTo(self.nameLabel).offset(10);
}];
self.fenLabel = [[UILabel alloc] init];
self.fenLabel.textColor = rgba(68, 57, 53, 1);
self.fenLabel.font = [UIFont systemFontOfSize:14];
[self.contentView addSubview:self.fenLabel];
[self.fenLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(20);
make.top.equalTo(self.nameLabel.mas_bottom).offset(30);
}];
UIView *bgView = [[UIView alloc] init];
bgView.backgroundColor = [UIColor whiteColor];
bgView.layer.borderColor =rgba(221, 213, 201, 1).CGColor;
bgView.layer.borderWidth =1;
bgView.layer.cornerRadius = 10;
bgView.layer.masksToBounds = YES;
[self.contentView addSubview:bgView];
[bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(20);
make.right.mas_equalTo(-20);
make.height.mas_equalTo(100);
make.top.equalTo(self.fenLabel.mas_bottom).offset(20);
}];
UIButton *AIBtn = [[UIButton alloc] init];
AIBtn.layer.masksToBounds = YES;
AIBtn.layer.cornerRadius = 10;
[AIBtn addTarget:self action:@selector(AIBtnClick:) forControlEvents:UIControlEventTouchUpInside];
// AIBtn.backgroundColor = [UIColor redColor];
[bgView addSubview:AIBtn];
_AIBtn = AIBtn;
[AIBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(68, 68));
make.left.mas_equalTo(15);
make.centerY.mas_equalTo(0);
}];
UIImageView *aiTipsImageView = [[UIImageView alloc] init];
aiTipsImageView.image = [UIImage imageNamed:@"report_icon_ai_amplification1"];
[AIBtn addSubview:aiTipsImageView];
[aiTipsImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.bottom.mas_equalTo(-7);
}];
CGFloat mw = [UIScreen mainScreen].bounds.size.width;
CGFloat space = (mw - 40 -15-68-220)/2;
UIImageView *oneImageView = [[UIImageView alloc] init];
_oneImageView = oneImageView;
oneImageView.image = [UIImage imageNamed:@"re_no_ai_bg"];
[bgView addSubview:oneImageView];
[oneImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(AIBtn.mas_right).offset(space);
make.top.equalTo(AIBtn).offset(21);
}];
UIImageView *twoImageView = [[UIImageView alloc] init];
_twoImageView = twoImageView;
twoImageView.image = [UIImage imageNamed:@"re_normal_bg"];
[bgView addSubview:twoImageView];
[twoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(AIBtn.mas_right).offset(space);
make.top.equalTo(AIBtn).offset(21);
}];
UIImageView *threeImageView = [[UIImageView alloc] init];
_threeImageView = threeImageView;
threeImageView.image = [UIImage imageNamed:@"re_Mild_bg"];
[bgView addSubview:threeImageView];
[threeImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(oneImageView).offset(-1);
make.top.equalTo(AIBtn).offset(21);
}];
UIImageView *foureImageView = [[UIImageView alloc] init];
_fourImageView = foureImageView;
foureImageView.image = [UIImage imageNamed:@"re_Severe_bg"];
[bgView addSubview:foureImageView];
[foureImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(oneImageView);
make.top.equalTo(AIBtn).offset(21);
}];
UILabel *oneLevelLabel = [[UILabel alloc] init];
_onelevelLabel = oneLevelLabel;
oneLevelLabel.text = @"无";
oneLevelLabel.backgroundColor = [UIColor redColor];
oneLevelLabel.layer.cornerRadius = 10;
oneLevelLabel.layer.cornerRadius = 10;
oneLevelLabel.layer.masksToBounds = YES;
oneLevelLabel.textAlignment = NSTextAlignmentCenter;
oneLevelLabel.font = [UIFont systemFontOfSize:12];
oneLevelLabel.textColor = rgba(222, 215, 205, 1);
[bgView addSubview:oneLevelLabel];
[oneLevelLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(twoImageView).offset(-15);
make.top.equalTo(twoImageView.mas_bottom).offset(2);
make.size.mas_equalTo(CGSizeMake(30, 20));
}];
UILabel *twolevelLabel = [[UILabel alloc] init];
_twolevelLabel = twolevelLabel;
twolevelLabel.text = @"轻度";
twolevelLabel.backgroundColor = [UIColor redColor];
twolevelLabel.layer.cornerRadius = 10;
twolevelLabel.layer.cornerRadius = 10;
twolevelLabel.layer.masksToBounds = YES;
twolevelLabel.textAlignment = NSTextAlignmentCenter;
twolevelLabel.font = [UIFont systemFontOfSize:12];
twolevelLabel.textColor = rgba(222, 215, 205, 1);
[bgView addSubview:twolevelLabel];
[twolevelLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(twoImageView);
make.top.equalTo(twoImageView.mas_bottom).offset(2);
make.size.mas_equalTo(CGSizeMake(43, 20));
}];
UILabel *threelevelLabel = [[UILabel alloc] init];
_threelevelLabel = threelevelLabel;
threelevelLabel.text = @"中度";
threelevelLabel.backgroundColor = [UIColor redColor];
threelevelLabel.layer.cornerRadius = 10;
threelevelLabel.layer.masksToBounds = YES;
threelevelLabel.textAlignment = NSTextAlignmentCenter;
threelevelLabel.font = [UIFont systemFontOfSize:12];
threelevelLabel.textColor = rgba(222, 215, 205, 1);
[bgView addSubview:threelevelLabel];
[threelevelLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(threeImageView);
make.top.equalTo(threeImageView.mas_bottom).offset(2);
make.size.mas_equalTo(CGSizeMake(43, 20));
}];
UILabel *fourlevelLabel = [[UILabel alloc] init];
_fourlevelLabel = fourlevelLabel;
fourlevelLabel.text = @"重度";
fourlevelLabel.backgroundColor = [UIColor redColor];
fourlevelLabel.layer.cornerRadius = 10;
fourlevelLabel.layer.masksToBounds = YES;
fourlevelLabel.textAlignment = NSTextAlignmentCenter;
fourlevelLabel.font = [UIFont systemFontOfSize:12];
fourlevelLabel.textColor = rgba(222, 215, 205, 1);
[bgView addSubview:fourlevelLabel];
[fourlevelLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(foureImageView);
make.top.equalTo(foureImageView.mas_bottom).offset(2);
make.size.mas_equalTo(CGSizeMake(43, 20));
}];
UIImageView *nursingImageView = [[UIImageView alloc] init];
nursingImageView.image = [UIImage imageNamed:@"report_icon_fa_bg"];
[self.contentView addSubview:nursingImageView];
[nursingImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(22.5);
make.top.equalTo(bgView.mas_bottom).offset(31);
}];
UILabel *nursingTitleLabel = [[UILabel alloc] init];
nursingTitleLabel.attributedText = createAttString(@"护理方法", 17, rgba(68, 57, 53, 1));
[self.contentView addSubview:nursingTitleLabel];
[nursingTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(nursingImageView);
make.left.equalTo(nursingImageView.mas_right).offset(5);
}];
self.fangfaLabel = [[UILabel alloc] init];
self.fangfaLabel.numberOfLines = 0;
self.fangfaLabel.attributedText = createAttString(@" ", 14, rgba(76, 74, 66, 1));
[self.contentView addSubview: self.fangfaLabel];
[ self.fangfaLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(nursingTitleLabel.mas_bottom).offset(13);
make.left.mas_equalTo(22.5);
make.right.mas_equalTo(-30);
}];
UIView *lineView = [[UIView alloc] init];
lineView.backgroundColor = rgba(243, 243, 243, 1);
[self.contentView addSubview:lineView];
[lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.fangfaLabel.mas_bottom).offset(25);
make.left.right.mas_equalTo(0);
make.height.mas_equalTo(11.5);
make.bottom.mas_equalTo(0);
}];
}
- (void)AIBtnClick:(UIButton *)btn {
if (self.AIBtnClickBlock) {
self.AIBtnClickBlock();
}
}
@end
//
// SMReportViewController.h
// SkinMagnifier
//
// Created by nana on 2020/11/18.
//
#import <UIKit/UIKit.h>
#import "SMClientListModel.h"
#import "SMLocalReportModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface SMReportViewController : UIViewController
@property(nonatomic, strong)SMClientListModel *clinetModel;
@property(nonatomic, strong)SMLocalReportModel *lrModel;
@property(nonatomic, assign)BOOL netWorkData;
@end
NS_ASSUME_NONNULL_END
//
// SMReportViewController.m
// SkinMagnifier
//
// Created by nana on 2020/11/18.
//
#import "SMReportViewController.h"
#import "SMReportHeaderCell.h"
#import "SMReportSchemeCell.h"
#import "SMReportImageCell.h"
#import "SMReportOilCell.h"
#import "SMReportProjectCell.h"
#import "SMReportAddProjectView.h"
#import "SMReportAddSchemeView.h"
#import "SMReportEditSchemeView.h"
#import <IQKeyboardManager.h>
#import "SMTempCell.h"
#import "SMReportSymptomCell.h"
#import "SMShowOriginalImageView.h"
#define HeaderSectionNumber (0)
#define AISymptomSectionNumber (1)
#define SchemeSectionNumber (2)
#define ProductSectionNumber (3)
@interface SMReportViewController ()<UITableViewDataSource,UITableViewDelegate>
@property(nonatomic, strong)UILabel *reportTitleLabel;
@property(nonatomic, strong)UITableView *mainView;
@end
@implementation SMReportViewController
- (void)viewDidLoad {
[super viewDidLoad];
if (self.navigationController) {
NSArray *childVC = self.navigationController.viewControllers;
NSMutableArray *xinVC = [[NSMutableArray alloc] init];
for (int i = 0 ; i < childVC.count; i++) {
UIViewController *vc = childVC[i];
if ([NSStringFromClass([vc class]) isEqualToString:@"SMCreateClientViewController"] || [NSStringFromClass([vc class]) isEqualToString:@"SMTakeImageViewController"] ) {
}else {
[xinVC addObject:vc];
}
}
self.navigationController.viewControllers = xinVC;
}
self.view.backgroundColor = [UIColor whiteColor];
UILabel *reportTitleLabel = [[UILabel alloc] init];
reportTitleLabel.textAlignment = NSTextAlignmentCenter;
NSString *nameString = [NSString stringWithFormat:@"%@_分析报告",self.clinetModel.cname];
reportTitleLabel.attributedText = createAttString(nameString, 20, rgba(68, 57, 53, 1));
[self.view addSubview:reportTitleLabel];
_reportTitleLabel = reportTitleLabel;
[reportTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(safaTop(33));
make.centerX.mas_equalTo(0);
make.right.mas_equalTo(-70);
make.left.mas_equalTo(70);
}];
UILabel *reportTimeLabel = [[UILabel alloc] init];
reportTimeLabel.attributedText = createAttString(timestampString(self.lrModel.createTime.longLongValue, @"YYYY/MM/dd HH:mm:ss"), 12,rgba(153, 153, 153, 1));
[self.view addSubview:reportTimeLabel];
_reportTitleLabel = reportTimeLabel;
[reportTimeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(reportTitleLabel.mas_bottom).offset(7);
make.centerX.mas_equalTo(0);
}];
self.mainView = [[UITableView alloc] init];
self.mainView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.mainView.dataSource = self;
self.mainView.delegate = self;
[self.mainView registerClass:[SMReportHeaderCell class] forCellReuseIdentifier:NSStringFromClass([SMReportHeaderCell class])];
[self.mainView registerClass:[SMReportSchemeCell class] forCellReuseIdentifier:NSStringFromClass([SMReportSchemeCell class])];
[self.mainView registerClass:[SMReportOilCell class] forCellReuseIdentifier:NSStringFromClass([SMReportOilCell class])];
[self.mainView registerClass:[SMReportProjectCell class] forCellReuseIdentifier:NSStringFromClass([SMReportProjectCell class])];
[self.mainView registerClass:[SMTempCell class] forCellReuseIdentifier:NSStringFromClass([SMTempCell class])];
[self.mainView registerClass:[SMReportSymptomCell class] forCellReuseIdentifier:NSStringFromClass([SMReportSymptomCell class])];
[self.view addSubview:self.mainView];
[self.mainView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.bottom.right.mas_equalTo(0);
make.top.equalTo(reportTimeLabel.mas_bottom).offset(10);
}];
UIButton *schemebtn = [[UIButton alloc] init];
[schemebtn wb_setImageName:@"report_icon_add"];
[schemebtn addTarget:self action:@selector(schemebtnClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:schemebtn];
[schemebtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-14.5);
make.bottom.mas_equalTo(-100);
}];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[[IQKeyboardManager sharedManager] setEnable:NO];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[[IQKeyboardManager sharedManager] setEnable:YES];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 4;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
if (section == HeaderSectionNumber) {
return 1;
}else if (section == SchemeSectionNumber) {
return self.lrModel.symptomArray.count;
}else if (section == ProductSectionNumber) {
return self.lrModel.productArray.count;
}else if (section == AISymptomSectionNumber) {
return self.lrModel.AISymptomArray.count;
}
return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell ;
if (indexPath.section == AISymptomSectionNumber) {
SMLocalReportAIModel *model = self.lrModel.AISymptomArray[indexPath.row];
if ([model.tagFlag isEqualToString:@"magn_water"]) {
if ([model.tagValue isEqualToString:@"0"]) {
SMTempCell *bCell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([SMTempCell class])];
cell = bCell;
}else {
SMReportOilCell *bCell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([SMReportOilCell class])];
bCell.nameValueLabel.attributedText = createAttString(model.tagname, 18, rgba(76, 74, 66, 1));
bCell.nursingValueLabel.attributedText = createAttString(model.dermalogicatext,14,rgba(76, 74, 66, 1));
[bCell updateOil:model.tagValue];
cell = bCell;
}
return cell;
}
SMReportSymptomCell *bCell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([SMReportSymptomCell class])];
bCell.nameLabel.attributedText = createAttString(model.tagname, 18, rgba(76, 74, 66, 1));
bCell.fangfaLabel.attributedText = createAttString(model.dermalogicatext,14,rgba(76, 74, 66, 1));
[bCell.AIBtn sd_setImageWithURL:[NSURL URLWithString:model.aiImageUrl] forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:@"re_Placeholder_img1"]];
bCell.onelevelLabel.text = @"无";
bCell.twolevelLabel.text = @"轻度";
bCell.threelevelLabel.text = @"中度";
bCell.fourlevelLabel.text = @"重度";
bCell.onelevelLabel.textColor = rgba(222, 215, 205, 1);
bCell.twolevelLabel.textColor = rgba(222, 215, 205, 1);
bCell.threelevelLabel.textColor = rgba(222, 215, 205, 1);
bCell.fourlevelLabel.textColor = rgba(222, 215, 205, 1);
bCell.onelevelLabel.backgroundColor = [UIColor clearColor];
bCell.twolevelLabel.backgroundColor = [UIColor clearColor];
bCell.threelevelLabel.backgroundColor = [UIColor clearColor];
bCell.fourlevelLabel.backgroundColor = [UIColor clearColor];
bCell.twoImageView.hidden = YES;
bCell.threeImageView.hidden = YES;
bCell.fourImageView.hidden = YES;
bCell.twoImageView.image = [UIImage imageNamed:@"re_Mild_bg"];
bCell.threeImageView.image = [UIImage imageNamed:@"re_moderate_bg"];
bCell.fourImageView.image = [UIImage imageNamed:@"re_Severe_bg"];
if ([model.tagFlag isEqualToString:@"magn_sebum"]) {
bCell.onelevelLabel.text = @"";
bCell.twolevelLabel.text = @"偏少";
bCell.threelevelLabel.text = @"正常";
bCell.fourlevelLabel.text = @"偏多";
int fen = 0;
if (model.tagValue.doubleValue > 0 && model.tagValue.doubleValue < 1) {
fen = 1;
}else {
fen = ceilf(model.tagValue.doubleValue);
}
bCell.fenLabel.text = [NSString stringWithFormat:@"皮脂面积占比:%d%%",fen];
// 无:绿色 轻度:黄色 中度:橙色 重度:红色
// re_normal_bg 绿色
// re_Severe_bg 红色
// re_Mild_bg 黄色
// re_moderate_bg 橙色
bCell.twoImageView.image = [UIImage imageNamed:@"re_moderate_bg"];
bCell.threeImageView.image = [UIImage imageNamed:@"re_normal_bg"];
bCell.fourImageView.image = [UIImage imageNamed:@"re_moderate_bg"];
if (fen <= 1) {
bCell.twoImageView.hidden = NO;
bCell.twolevelLabel.backgroundColor = rgba(247, 138, 67, 1);
bCell.twolevelLabel.textColor = rgba(255, 255, 255, 1);
}else if (fen <= 9) {
bCell.threeImageView.hidden = NO;
bCell.threelevelLabel.backgroundColor = rgba(90, 219, 90, 1);
bCell.threelevelLabel.textColor = rgba(255, 255, 255, 1);
}else {
bCell.fourImageView.hidden = NO;
bCell.fourlevelLabel.backgroundColor = rgba(247, 138, 67, 1);
bCell.fourlevelLabel.textColor = rgba(255, 255, 255, 1);
}
}else if ([model.tagFlag isEqualToString:@"magn_sensity"]) {// 敏感:
int fen = 0;
if (model.tagValue.doubleValue > 0 && model.tagValue.doubleValue < 1) {
fen = 1;
}else {
fen = ceilf(model.tagValue.doubleValue);
}
bCell.fenLabel.text = [NSString stringWithFormat:@"敏感面积占比:%d%%",fen];
if (fen == 0) {
bCell.onelevelLabel.backgroundColor = rgba(90, 219, 90, 1);
bCell.onelevelLabel.textColor = rgba(255, 255, 255, 1);
}else if (fen <= 10) {
bCell.twoImageView.hidden = NO;
bCell.twolevelLabel.backgroundColor = rgba(253, 188, 50, 1);
bCell.twolevelLabel.textColor = rgba(255, 255, 255, 1);
}else if (fen <= 20) {
bCell.threeImageView.hidden = NO;
bCell.threelevelLabel.backgroundColor = rgba(247, 138, 67, 1);
bCell.threelevelLabel.textColor = rgba(255, 255, 255, 1);
}else {
bCell.fourImageView.hidden = NO;
bCell.fourlevelLabel.backgroundColor = rgba(255, 85, 25, 1);
bCell.fourlevelLabel.textColor = rgba(255, 255, 255, 1);
}
}else if ([model.tagFlag isEqualToString:@"magn_wrinkle"]) {// 纹理:
bCell.fenLabel.text = [NSString stringWithFormat:@"皱纹数量:%@条",model.tagValue];
if (model.tagNum.intValue == 0) {
bCell.onelevelLabel.backgroundColor = rgba(90, 219, 90, 1);
bCell.onelevelLabel.textColor = rgba(255, 255, 255, 1);
}else if (model.tagNum.intValue <=24) {
bCell.twoImageView.hidden = NO;
bCell.twolevelLabel.backgroundColor = rgba(253, 188, 50, 1);
bCell.twolevelLabel.textColor = rgba(255, 255, 255, 1);
}else if (model.tagNum.intValue <= 40) {
bCell.threeImageView.hidden = NO;
bCell.threelevelLabel.backgroundColor = rgba(247, 138, 67, 1);
bCell.threelevelLabel.textColor = rgba(255, 255, 255, 1);
}else {
bCell.fourImageView.hidden = NO;
bCell.fourlevelLabel.backgroundColor = rgba(255, 85, 25, 1);
bCell.fourlevelLabel.textColor = rgba(255, 255, 255, 1);
}
}else if ([model.tagFlag isEqualToString:@"magn_pore_large"]) {// 毛孔粗大: 毛孔堵塞
bCell.fenLabel.text = [NSString stringWithFormat:@"毛孔粗大数量:%@个",model.tagValue];
if (model.tagNum.intValue == 0) {
bCell.onelevelLabel.backgroundColor = rgba(90, 219, 90, 1);
bCell.onelevelLabel.textColor = rgba(255, 255, 255, 1);
}else if (model.tagNum.intValue <= 50000) {
bCell.twoImageView.hidden = NO;
bCell.twolevelLabel.backgroundColor = rgba(253, 188, 50, 1);
bCell.twolevelLabel.textColor = rgba(255, 255, 255, 1);
}else if (model.tagNum.intValue <= 120000) {
bCell.threeImageView.hidden = NO;
bCell.threelevelLabel.backgroundColor = rgba(247, 138, 67, 1);
bCell.threelevelLabel.textColor = rgba(255, 255, 255, 1);
}else {
bCell.fourImageView.hidden = NO;
bCell.fourlevelLabel.backgroundColor = rgba(255, 85, 25, 1);
bCell.fourlevelLabel.textColor = rgba(255, 255, 255, 1);
}
}else if (
[model.tagFlag isEqualToString:@"magn_pore_clogging"] ) {// 毛孔粗大: 毛孔堵塞
bCell.fenLabel.text = [NSString stringWithFormat:@"毛孔堵塞数量:%@个",model.tagValue];
if (model.tagNum.intValue == 0) {
bCell.onelevelLabel.backgroundColor = rgba(90, 219, 90, 1);
bCell.onelevelLabel.textColor = rgba(255, 255, 255, 1);
}else if (model.tagNum.intValue <= 50000) {
bCell.twoImageView.hidden = NO;
bCell.twolevelLabel.backgroundColor = rgba(253, 188, 50, 1);
bCell.twolevelLabel.textColor = rgba(255, 255, 255, 1);
}else if (model.tagNum.intValue <= 120000) {
bCell.threeImageView.hidden = NO;
bCell.threelevelLabel.backgroundColor = rgba(247, 138, 67, 1);
bCell.threelevelLabel.textColor = rgba(255, 255, 255, 1);
}else {
bCell.fourImageView.hidden = NO;
bCell.fourlevelLabel.backgroundColor = rgba(255, 85, 25, 1);
bCell.fourlevelLabel.textColor = rgba(255, 255, 255, 1);
}
}else if ([model.tagFlag isEqualToString:@"magn_pigmentation"]) {// 色素沉淀:
int fen = 0;
if (model.tagValue.doubleValue > 0 && model.tagValue.doubleValue < 1) {
fen = 1;
}else {
fen = ceilf(model.tagValue.doubleValue);
}
bCell.fenLabel.text = [NSString stringWithFormat:@"色沉面积占比:%d%%",fen];
if (fen == 0) {
bCell.onelevelLabel.backgroundColor = rgba(90, 219, 90, 1);
bCell.onelevelLabel.textColor = rgba(255, 255, 255, 1);
}else if (fen <= 7) {
bCell.twoImageView.hidden = NO;
bCell.twolevelLabel.backgroundColor = rgba(253, 188, 50, 1);
bCell.twolevelLabel.textColor = rgba(255, 255, 255, 1);
}else if (fen <= 15) {
bCell.threeImageView.hidden = NO;
bCell.threelevelLabel.backgroundColor = rgba(247, 138, 67, 1);
bCell.threelevelLabel.textColor = rgba(255, 255, 255, 1);
}else {
bCell.fourImageView.hidden = NO;
bCell.fourlevelLabel.backgroundColor = rgba(255, 85, 25, 1);
bCell.fourlevelLabel.textColor = rgba(255, 255, 255, 1);
}
}
@weakify(bCell);
@weakify(self);
bCell.AIBtnClickBlock = ^(void){
@strongify(bCell);
@strongify(self);
SMShowOriginalImageView *imgView = [SMShowOriginalImageView new];
imgView.imgUrlString = model.aiImageUrl;
[imgView mm_showFrameView:self.view positionView:bCell.AIBtn];
};
cell = bCell;
}else if (indexPath.section == HeaderSectionNumber) {
// SMReportHeaderCell *bCell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([SMReportHeaderCell class])];
// [bCell.leidaVivew removeFromSuperview];
SMReportHeaderCell *bCell = [[SMReportHeaderCell alloc] initWithModel:self.lrModel];
cell = bCell;
}else if (indexPath.section == SchemeSectionNumber){
SMLocalReportSymptomModel *model = self.lrModel.symptomArray[indexPath.row];
SMReportSchemeCell *bCell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([SMReportSchemeCell class])];
bCell.nameValueLabel.attributedText = createAttString(model.sName, 18, rgba(76, 74, 66, 1));
// bCell.symptomValueLabel.attributedText = createAttString(model.sDescribe,14,rgba(76, 74, 66, 1));
bCell.nursingValueLabel.attributedText = createAttString(model.sMethod,14,rgba(76, 74, 66, 1));
cell = bCell;
}else if (indexPath.section == ProductSectionNumber){
SMLocalReportProductModel *model = self.lrModel.productArray[indexPath.row];
SMReportProjectCell *bCell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([SMReportProjectCell class])];
bCell.projectTypeBtn.selected = [model.pType isEqualToString:@"2"];
bCell.iconImageView.selected = [model.pType isEqualToString:@"2"];
bCell.projectNameLabel.attributedText = createAttString(model.pName, 15, rgba(76, 74, 66, 1));
cell = bCell;
}
return cell;
}
- (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
if (section == ProductSectionNumber) {
UIView *view = [[UIView alloc] init];
view.frame = CGRectMake(0, 0, 40, 20);
view.backgroundColor = [UIColor whiteColor];
UIButton *btn = [[UIButton alloc] init];
btn.titleEdgeInsets = UIEdgeInsetsMake(0, 5, 0,-5);
[btn wb_setImageName:@"report_icon_fa_bg"];
[btn setAttributedTitle:createAttString(@"推荐项目", 17, rgba(68, 57, 53, 1)) forState:UIControlStateNormal];
[view addSubview:btn];
[btn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(20);
make.centerY.mas_equalTo(0);
}];
UIButton *addBtn = [[UIButton alloc] init];
[addBtn addTarget:self action:@selector(addBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[addBtn wb_setImageName:@"report_button_add"];
[view addSubview:addBtn];
[addBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-20);
make.centerY.mas_equalTo(0);
}];
return view;
}
return nil;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:NO];
@weakify(self);
if (indexPath.section == SchemeSectionNumber) {
SMLocalReportSymptomModel *sModel = self.lrModel.symptomArray[indexPath.row];
SMReportEditSchemeView *view = [[SMReportEditSchemeView alloc] initWithFrame:self.view.bounds];
[view updateSname:sModel.sName sDescribe:sModel.sDescribe sMethod:sModel.sMethod];
[view wb_showRTLFromSuperView:self.view];
view.saveBlock = ^(NSString * _Nonnull sname, NSString * _Nonnull sDescribe, NSString * _Nonnull sMethod, NSInteger status) {
@strongify(self);
if (self.netWorkData) {
if (status == 2) {
NSMutableDictionary *pdict = [[NSMutableDictionary alloc] init];
pdict[@"aReportLinkAitagnameId"] = sModel.sID;
[self.view postFormDataWithUrl:@"/magnifier/report/delReport" params:pdict success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
@strongify(self);
if ([JsonData.code isEqualToString:@"200"]) {
[self.lrModel.symptomArray removeObjectAtIndex:indexPath.row];
[self.mainView reloadData];
}else {
[SVProgressHUD showErrorWithStatus:@"删除失败"];
}
}];
}else if(status == 1) {
NSMutableDictionary *xDict = [[NSMutableDictionary alloc] init];
xDict[@"tagname"] = sname;
xDict[@"areasonList"] = @[@{@"reasontext":sDescribe}];
xDict[@"adermalogicaList"] = @[@{@"dermalogicatext":sMethod}];
xDict[@"magnifierCgid"] = self.lrModel.cgid;
xDict[@"areportLinkAitagnameId"] =sModel.sID;
xDict[@"systSign"] = @"0";
[self.view postJsonWithUrl:@"/magnifier/report/updateReportById" params:xDict success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
@strongify(self);
if ([JsonData.code isEqualToString:@"200"]) {
sModel.sName = sname;
sModel.sDescribe = sDescribe;
sModel.sMethod = sMethod;
[self.mainView reloadData];
}else {
[SVProgressHUD showErrorWithStatus:@"更新失败"];
}
}];
}
}else {
NSArray *localDataArray = [[SMLocalReportBManager sharedManager] selectWithCgid:self.lrModel.cgid];
if (localDataArray.count == 0) {
[SVProgressHUD showErrorWithStatus:@"本地数据变成网络数据,有网的时候再编辑"];
return ;
}
SMLocalReportModel *localModel = localDataArray.firstObject;
if ([localModel.uploadLock isEqualToString:@"1"]) {
[SVProgressHUD showErrorWithStatus:@"本地数据变成网络数据,有网的时候再编辑"];
return ;
}
if (status == 2) {
[self.lrModel.symptomArray removeObjectAtIndex:indexPath.row];
}else if ( status == 1) {
sModel.sName = sname;
sModel.sDescribe = sDescribe;
sModel.sMethod = sMethod;
}
[[SMLocalReportBManager sharedManager] updateWithModel:self.lrModel cgid:self.lrModel.cgid];
[self.mainView reloadData];
}
};
}else if (indexPath.section == ProductSectionNumber) {
SMLocalReportProductModel *rModel = self.lrModel.productArray[indexPath.row];
SMReportAddProjectView *view = [[SMReportAddProjectView alloc] init];
[view updateType:rModel.pType name:rModel.pName];
[view wb_showFromSuperView:self.view];
view.saveBlock = ^(NSString * _Nonnull type, NSString * _Nonnull name,NSInteger status) {
@strongify(self);
if (self.netWorkData) {
if (status == 2) {
NSMutableDictionary *pDict = [[NSMutableDictionary alloc] init];
pDict[@"id"] = rModel.pId;
[self.view postFormDataWithUrl:@"/magnifier/report/delReportGoods" params:pDict success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
@strongify(self);
if ([JsonData.code isEqualToString:@"200"]) {
[self.lrModel.productArray removeObjectAtIndex:indexPath.row];
}else {
[SVProgressHUD showErrorWithStatus:@"删除失败"];
}
[self.mainView reloadData];
}];
}else {
NSMutableDictionary *pDict = [[NSMutableDictionary alloc] init];
pDict[@"goodstype"] = type;
pDict[@"goodsname"] = name;
pDict[@"magnifierCgid"] = self.lrModel.cgid;
pDict[@"id"] = rModel.pId;
[self.view postFormDataWithUrl:@"/magnifier/report/saveOrUpdateReportGoods" params:pDict success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
@strongify(self);
if ([JsonData.code isEqualToString:@"200"]) {
rModel.pType = type;
rModel.pName = name;
[self.mainView reloadData];
}else {
[SVProgressHUD showErrorWithStatus:@"更新失败"];
}
}];
}
}else {
NSArray *localDataArray = [[SMLocalReportBManager sharedManager] selectWithCgid:self.lrModel.cgid];
if (localDataArray.count == 0) {
[SVProgressHUD showErrorWithStatus:@"本地数据变成网络数据,有网的时候再编辑"];
return ;
}
SMLocalReportModel *localModel = localDataArray.firstObject;
if ([localModel.uploadLock isEqualToString:@"1"]) {
[SVProgressHUD showErrorWithStatus:@"本地数据变成网络数据,有网的时候再编辑"];
return ;
}
if (status == 2) {
[self.lrModel.productArray removeObjectAtIndex:indexPath.row];
}else if ( status == 1) {
rModel.pType = type;
rModel.pName = name;
}
[[SMLocalReportBManager sharedManager] updateWithModel:self.lrModel cgid:self.lrModel.cgid];
[self.mainView reloadData];
}
};
}
}
- (void)addBtnClick:(UIButton *)btn {
SMReportAddProjectView *view = [[SMReportAddProjectView alloc] init];
[view wb_showFromSuperView:self.view];
@weakify(self);
view.saveBlock = ^(NSString * _Nonnull type, NSString * _Nonnull name,NSInteger status) {
@strongify(self);
if (self.netWorkData) {
NSMutableDictionary *pDict = [[NSMutableDictionary alloc] init];
pDict[@"goodstype"] = type;
pDict[@"goodsname"] = name;
pDict[@"magnifierCgid"] = self.lrModel.cgid;
[self.view postFormDataWithUrl:@"/magnifier/report/saveOrUpdateReportGoods" params:pDict success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
@strongify(self);
if ([JsonData.code isEqualToString:@"200"]) {
SMLocalReportProductModel *rModel = [[SMLocalReportProductModel alloc] init];
rModel.pType = type;
rModel.pName = name;
rModel.pId = [NSString stringWithFormat:@"%@",((NSDictionary *)JsonData.data)[@"id"]];
[self.lrModel.productArray insertObject:rModel atIndex:0];
[self.mainView reloadData];
}else {
[SVProgressHUD showErrorWithStatus:@"保存失败"];
}
}];
}else {
NSArray *localDataArray = [[SMLocalReportBManager sharedManager] selectWithCgid:self.lrModel.cgid];
if (localDataArray.count == 0) {
[SVProgressHUD showErrorWithStatus:@"本地数据变成网络数据,有网的时候再编辑"];
return ;
}
SMLocalReportModel *localModel = localDataArray.firstObject;
if ([localModel.uploadLock isEqualToString:@"1"]) {
[SVProgressHUD showErrorWithStatus:@"本地数据变成网络数据,有网的时候再编辑"];
return ;
}
SMLocalReportProductModel *rModel = [[SMLocalReportProductModel alloc] init];
rModel.pType = type;
rModel.pName = name;
[self.lrModel.productArray insertObject:rModel atIndex:0];
[[SMLocalReportBManager sharedManager] updateWithModel:self.lrModel cgid:self.lrModel.cgid];
[self.mainView reloadData];
}
};
}
- (void)schemebtnClick:(UIButton *)btn {
SMReportAddSchemeView *view = [[SMReportAddSchemeView alloc] initWithFrame:self.view.bounds];
@weakify(self);
view.saveBlock = ^(NSString * _Nonnull sName, NSString * _Nonnull sDescribe, NSString * _Nonnull sMethod) {
@strongify(self);
if (self.netWorkData) {
NSMutableDictionary *pDict = [[NSMutableDictionary alloc] init];
pDict[@"tagname"] = sName;
pDict[@"areasonList"] = @[@{@"reasontext":sDescribe}];
pDict[@"adermalogicaList"] = @[@{@"dermalogicatext":sMethod}];
pDict[@"magnifierCgid"] = self.lrModel.cgid;
pDict[@"systSign"] = @"0";
[self.view postJsonWithUrl:@"/magnifier/report/addReport" params:pDict success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
@strongify(self);
if ([JsonData.code isEqualToString:@"200"]) {
SMLocalReportSymptomModel *rModel = [[SMLocalReportSymptomModel alloc] init];
rModel.sName = sName;
rModel.sDescribe = sDescribe;
rModel.sMethod = sMethod;
rModel.sID = [NSString stringWithFormat:@"%@",JsonData.data];
[self.lrModel.symptomArray insertObject:rModel atIndex:0];
[self.mainView reloadData];
}else {
[SVProgressHUD showErrorWithStatus:@"添加失败"];
}
}];
}else {
NSArray *localDataArray = [[SMLocalReportBManager sharedManager] selectWithCgid:self.lrModel.cgid];
if (localDataArray.count == 0) {
[SVProgressHUD showErrorWithStatus:@"本地数据变成网络数据,有网的时候再编辑"];
return ;
}
SMLocalReportModel *localModel = localDataArray.firstObject;
if ([localModel.uploadLock isEqualToString:@"1"]) {
[SVProgressHUD showErrorWithStatus:@"本地数据变成网络数据,有网的时候再编辑"];
return ;
}
SMLocalReportSymptomModel *rModel = [[SMLocalReportSymptomModel alloc] init];
rModel.sName = sName;
rModel.sDescribe = sDescribe;
rModel.sMethod = sMethod;
[self.lrModel.symptomArray insertObject:rModel atIndex:0];
[[SMLocalReportBManager sharedManager] updateWithModel:self.lrModel cgid:self.lrModel.cgid];
[self.mainView reloadData];
}
};
[view wb_showRTLFromSuperView:self.view];
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
if (section == ProductSectionNumber) {
return 40;
}
return 0;
}
@end
//
// SMShowImageCell.h
// SkinMagnifier
//
// Created by nana on 2020/12/8.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMShowImageCell : UICollectionViewCell
@property(nonatomic, strong)UIImageView *iconImageView;
@property(nonatomic, strong)UILabel *titleLabel;
@end
NS_ASSUME_NONNULL_END
//
// SMShowImageCell.m
// SkinMagnifier
//
// Created by nana on 2020/12/8.
//
#import "SMShowImageCell.h"
@interface SMShowImageCell()
@end
@implementation SMShowImageCell
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.backgroundColor = [UIColor blackColor];
self.iconImageView = [[UIImageView alloc] init];
self.iconImageView.backgroundColor = [UIColor blackColor];
self.iconImageView.layer.masksToBounds = YES;
[self.contentView addSubview:self.iconImageView];
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.bottom.right.mas_equalTo(0);
// make.center.mas_equalTo(0);
// make.width.height.mas_equalTo([[UIScreen mainScreen] bounds].size.width);
}];
self.titleLabel = [[UILabel alloc] init];
self.titleLabel.font = [UIFont systemFontOfSize:17];
self.titleLabel.text = @"日光图";
self.titleLabel.textColor = [UIColor whiteColor];
[self.contentView addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(safaTop(53.5));
make.centerX.mas_equalTo(0);
}];
}
@end
//
// SMShowImageView.h
// SkinMagnifier
//
// Created by nana on 2020/12/8.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMShowImageView : UIView
- (void)mm_showFrameView:(UIView *)fView positionView:(UIView *)pView;
@property(nonatomic, strong)NSArray *dataArray;
@property(nonatomic, assign)NSInteger selectIndex;
@end
NS_ASSUME_NONNULL_END
//
// SMShowImageView.m
// SkinMagnifier
//
// Created by nana on 2020/12/8.
//
#import "SMShowImageView.h"
#import "SMShowImageCell.h"
#import "SMPageControl.h"
@interface SMShowImageView()<UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
@property(nonatomic, strong)UICollectionView *mainView;
@property(nonatomic, assign)CGRect sRect;
@property(nonatomic, strong)SMPageControl *pageControl;
@end
@implementation SMShowImageView
- (instancetype)init
{
self = [super init];
if (self) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.layer.masksToBounds = YES;
CGSize sSize = [UIScreen mainScreen].bounds.size;
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc ] init];
layout.itemSize =sSize;
layout.minimumLineSpacing = 0;
layout.minimumInteritemSpacing = 0;
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
self.mainView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
self.mainView.dataSource = self;
self.mainView.delegate = self;
[ self.mainView addObserver:self forKeyPath:@"contentOffset" options:NSKeyValueObservingOptionNew context:nil];
self.mainView.pagingEnabled = YES;
self.mainView.showsHorizontalScrollIndicator = NO;
self.mainView.showsVerticalScrollIndicator = NO;
[self.mainView registerClass:[SMShowImageCell class] forCellWithReuseIdentifier:NSStringFromClass([SMShowImageCell class])];
[self addSubview:self.mainView];
[self.mainView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.bottom.right.mas_equalTo(0);
}];
self.pageControl = [[SMPageControl alloc] initWithFrame:CGRectMake(0, 0, 50, 4)];
[self addSubview:self.pageControl];
[self.pageControl mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.bottom.mas_equalTo(-30);
}];
self.pageControl.cornerRadius = 5;
self.pageControl.dotHeight = 5;
self.pageControl.dotSpace = 6;
self.pageControl.currentDotWidth = 5;
self.pageControl.otherDotWidth = 5;
self.pageControl.otherDotColor = rgba(210, 202, 202, 1);
self.pageControl.currentDotColor = [UIColor whiteColor];
self.pageControl.numberOfPages = 4;
}
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context {
int page = (int)(self.mainView.contentOffset.x / self.mainView.bounds.size.width+0.5);
if ( self.pageControl.currentPage != page) {
self.pageControl.currentPage = page ;
}
}
-(void)dealloc {
[self.mainView removeObserver:self forKeyPath:@"contentOffset"];
}
- (void)mm_showFrameView:(UIView *)fView positionView:(UIView *)pView {
CGRect xRect = [pView.superview convertRect:pView.frame toView:fView];
[fView addSubview:self];
self.frame = xRect;
self.sRect = xRect;
[self.mainView reloadData];
[UIView animateWithDuration:0.25 animations:^{
self.frame = CGRectMake(0, 0, fView.frame.size.width, fView.frame.size.height);
}];
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.dataArray.count;
}
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
SMLocalReportImageModel *model = self.dataArray[indexPath.row];
SMShowImageCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([SMShowImageCell class]) forIndexPath:indexPath];
@weakify(cell);
cell.iconImageView.contentMode = UIViewContentModeCenter;
// cell.iconImageView.backgroundColor = rgba(255, 248, 244, 1);
[cell.iconImageView sd_setImageWithURL:[NSURL URLWithString:model.iURL] placeholderImage:nil completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
@strongify(cell);
if (image) {
cell.iconImageView.contentMode = UIViewContentModeScaleAspectFit;
// cell.iconImageView.backgroundColor = [UIColor blackColor];
}
}];
cell.titleLabel.text = model.iname;
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
[self removeFromSuperview];
}
@end
//
// SMShowOriginalImageView.h
// SkinMagnifier
//
// Created by nana on 2021/1/12.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMShowOriginalImageView : UIView
@property(nonatomic ,strong)NSString *imgUrlString;
- (void)mm_showFrameView:(UIView *)fView positionView:(UIView *)pView;
@end
NS_ASSUME_NONNULL_END
//
// SMShowOriginalImageView.m
// SkinMagnifier
//
// Created by nana on 2021/1/12.
//
#import "SMShowOriginalImageView.h"
@interface SMShowOriginalImageView()
@property(nonatomic, assign)CGRect sRect;
@property(nonatomic, strong)UIImageView *imgView;
@end
@implementation SMShowOriginalImageView
- (instancetype)init
{
self = [super init];
if (self) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.layer.masksToBounds = YES;
self.backgroundColor = [UIColor blackColor];
UIControl *ctl = [[UIControl alloc] init];
[ctl addTarget:self action:@selector(ctlClick:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:ctl];
[ctl mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.bottom.right.mas_equalTo(0);
}];
self.imgView = [[UIImageView alloc] init];
// self.imgView.backgroundColor = rgba(255, 248, 244, 1);
self.imgView.backgroundColor = [UIColor blackColor];
[self addSubview:self.imgView];
CGFloat w = [UIScreen mainScreen].bounds.size.width;
[self.imgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.bottom.right.mas_equalTo(0);
// make.center.mas_equalTo(0);
// make.width.height.mas_equalTo(w);
}];
}
- (void)ctlClick:(UIControl *)ctl {
ctl.userInteractionEnabled = NO;
[self removeFromSuperview];
}
- (void)setImgUrlString:(NSString *)imgUrlString {
_imgUrlString = imgUrlString;
self.imgView.contentMode = UIViewContentModeCenter;
// self.imgView.backgroundColor = rgba(255, 248, 244, 1);
@weakify(self);
[self.imgView sd_setImageWithURL:[NSURL URLWithString:imgUrlString] placeholderImage:nil completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
@strongify(self);
if (image) {
self.imgView.contentMode = UIViewContentModeScaleAspectFit;
// self.imgView.backgroundColor = [UIColor blackColor];
}
}];
}
- (void)mm_showFrameView:(UIView *)fView positionView:(UIView *)pView {
CGRect xRect = [pView.superview convertRect:pView.frame toView:fView];
[fView addSubview:self];
self.frame = xRect;
self.sRect = xRect;
[UIView animateWithDuration:0.25 animations:^{
self.frame = [UIScreen mainScreen].bounds;
}];
}
@end
//
// SMTakeImageViewController.h
// SkinMagnifier
//
// Created by nana on 2020/11/17.
//
#import <UIKit/UIKit.h>
#import "SMClientListModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface SMTakeImageViewController : UIViewController
@property(nonatomic, strong)SMClientListModel *clinetModel;
@end
NS_ASSUME_NONNULL_END
//
// SMTakeImageViewController.m
// SkinMagnifier
//
// Created by nana on 2020/11/17.
//
#import "SMTakeImageViewController.h"
#import "SMEditPositionNameView.h"
#import "SMReportViewController.h"
#import "DKWIFIVideoView.h"
#import "DKSocket.h"
#import "DKCmdTool.h"
#import "SMCheckOilBGView.h"
#import "SMLinkDeviceView.h"
#import "SMAIImageTool.h"
#import <SDImageCache.h>
@interface SMTakeImageViewController ()
@property(nonatomic, strong)UIView *dengBGView;
@property(nonatomic, strong)NSMutableArray *dengTypeBtnArray;
@property(nonatomic, weak)DKWIFIVideoView *videoView;
@property(nonatomic, strong)dispatch_source_t timer ;
//@property(nonatomic, strong)NSMutableArray *shuifenArray;
@property(nonatomic, strong)NSMutableDictionary *weiduDcit;
@property(nonatomic, weak)UIButton *takeImageBtn;
@property(nonatomic, weak)UIButton *dengBtn;
@end
static bool netWorkStatus;
@implementation SMTakeImageViewController
- (void)viewDidLoad {
[super viewDidLoad];
[SVProgressHUD dismiss];
if (self.navigationController) {
NSArray *childVC = self.navigationController.viewControllers;
NSMutableArray *xinVC = [[NSMutableArray alloc] init];
for (int i = 0 ; i < childVC.count; i++) {
UIViewController *vc = childVC[i];
if ([NSStringFromClass([vc class]) isEqualToString:@"SMCreateClientViewController"] ) {
}else {
[xinVC addObject:vc];
}
}
self.navigationController.viewControllers = xinVC;
}
// NSString *path = [[NSBundle mainBundle] pathForResource:@"shuifen" ofType: @"json"];
// NSData *data = [[NSData alloc] initWithContentsOfFile:path];
// NSError * error;
// NSDictionary *typeDict = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];
// _shuifenArray = typeDict[@"category"];
NSString *path = [[NSBundle mainBundle] pathForResource:@"weidu" ofType: @"json"];
NSData *data = [[NSData alloc] initWithContentsOfFile:path];
NSError * error;
_weiduDcit = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];
UIWindow *window = [[UIApplication sharedApplication].windows firstObject];
UIEdgeInsets e = window.safeAreaInsets;
DKWIFIVideoView *videoView = [[DKWIFIVideoView alloc ] init];
CGAffineTransform translation = CGAffineTransformMakeTranslation(0,0);
videoView.webView.transform = CGAffineTransformRotate(translation, M_PI_2);
CGFloat vh = self.view.bounds.size.height+20;
CGFloat w = 1920.0*(vh/1080.0);
CGFloat h = vh;
videoView.frame = CGRectMake(self.view.bounds.size.width - w+((e.top+e.bottom) /2.0), 0,w,h);
_videoView = videoView;
[self.view addSubview:videoView];
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[[DKSocket share] connectHost:@"192.168.168.1" port:8336];
[DKSocket share].heartbeatData = dataWithCmd(JFDeviceSendCommandFirmwareVersion);
});
@weakify(self);
[DKSocket share].checkNetWorkBlock = ^(BOOL xx) {
@strongify(self);
netWorkStatus = xx;
};
UIButton *dengBtn = [[UIButton alloc] init];
_dengBtn = dengBtn;
dengBtn.selected = YES;
[dengBtn addTarget:self action:@selector(dengBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[dengBtn wb_setImageName:@"pz_icon_light"];
[self.view addSubview:dengBtn];
[dengBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(safaBottom(-45.5));
make.left.mas_equalTo(35.5);
}];
UIButton *sfbtn = [[UIButton alloc] init];
[sfbtn addTarget:self action:@selector(sfbtnClick:) forControlEvents:UIControlEventTouchUpInside];
[sfbtn setAttributedTitle:createAttString(@"下限", 14, rgba(255, 0, 0, 1)) forState:UIControlStateNormal];
[sfbtn setBackgroundImage:[UIImage wb_imageWithColor:rgba(0, 255, 0, 1) size:CGSizeMake(40, 40)] forState:UIControlStateNormal];
[self.view addSubview:sfbtn];
[sfbtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(safaBottom(-36.5));
make.right.mas_equalTo(-5);
make.size.mas_equalTo(CGSizeMake(40, 40));
}];
UIButton *sfhhhhhbtn = [[UIButton alloc] init];
[sfhhhhhbtn addTarget:self action:@selector(sfbtnhhhhClick:) forControlEvents:UIControlEventTouchUpInside];
[sfhhhhhbtn setAttributedTitle:createAttString(@"上限", 14, rgba(255, 0, 0, 1)) forState:UIControlStateNormal];
[sfhhhhhbtn setBackgroundImage:[UIImage wb_imageWithColor:rgba(0, 255, 0, 1) size:CGSizeMake(40, 40)] forState:UIControlStateNormal];
[self.view addSubview:sfhhhhhbtn];
[sfhhhhhbtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(safaBottom(-36.5));
make.right.mas_equalTo(-65);
make.size.mas_equalTo(CGSizeMake(40, 40));
}];
UIButton *sfhhbtn = [[UIButton alloc] init];
[sfhhbtn addTarget:self action:@selector(sfhhbtnClick:) forControlEvents:UIControlEventTouchUpInside];
[sfhhbtn setAttributedTitle:createAttString(@"水份", 14, rgba(255, 0, 0, 1)) forState:UIControlStateNormal];
[sfhhbtn setBackgroundImage:[UIImage wb_imageWithColor:rgba(0, 255, 0, 1) size:CGSizeMake(40, 40)] forState:UIControlStateNormal];
[self.view addSubview:sfhhbtn];
[sfhhbtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(safaBottom(-36.5));
make.right.mas_equalTo(-125);
make.size.mas_equalTo(CGSizeMake(40, 40));
}];
UIButton *backBtn = [[UIButton alloc] init];
backBtn.frame =CGRectMake(10, safaTop(20) , 38, 45);
[backBtn wb_setImageName:@"nav_white_back"];
[backBtn addTarget:self action:@selector(backClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:backBtn];
UIButton *takeImageBtn = [[UIButton alloc] init];
_takeImageBtn = takeImageBtn;
[takeImageBtn addTarget:self action:@selector(takeImageClick:) forControlEvents:UIControlEventTouchUpInside];
[takeImageBtn wb_setImageName:@"pz_button_xj"];
[self.view addSubview:takeImageBtn];
[takeImageBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(safaBottom(-36.5));
make.centerX.mas_equalTo(0);
}];
self.dengBGView = [[UIView alloc] init];
self.dengBGView.backgroundColor = rgba(51, 51, 51, 0.4);
self.dengBGView.layer.cornerRadius =46/2;
self.dengBGView.layer.masksToBounds = YES;
[self.view addSubview:self.dengBGView];
self.dengBGView.hidden = YES;
[self.dengBGView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(dengBtn.mas_top).offset(-19);
make.centerX.equalTo(dengBtn);
make.size.mas_equalTo(CGSizeMake(46, 208));
}];
// self.dengBGView.frame = CGRectMake(36.5, self.view.bounds.size.height+(safaBottom(-110))-208, 46, 208);
self.dengTypeBtnArray = [[NSMutableArray alloc] init];
UIButton *riGBtn = [[UIButton alloc] init];
riGBtn.tag = 1580;
[riGBtn addTarget:self action:@selector(dengTypeClick:) forControlEvents:UIControlEventTouchUpInside];
[riGBtn wb_setImageName:@"pz_icon_rig"];
[self.dengBGView addSubview:riGBtn];
[riGBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(22);
make.centerX.mas_equalTo(0);
make.size.mas_equalTo(CGSizeMake(30, 30));
}];
UIButton *wlBtn = [[UIButton alloc] init];
[wlBtn wb_setImageName:@"pz_icon_wl"];
wlBtn.tag = 1581;
[wlBtn addTarget:self action:@selector(dengTypeClick:) forControlEvents:UIControlEventTouchUpInside];
[self.dengBGView addSubview:wlBtn];
[wlBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(riGBtn.mas_bottom).offset(17.5);
make.centerX.mas_equalTo(0);
make.size.mas_equalTo(CGSizeMake(30, 30));
}];
UIButton *jhBtn = [[UIButton alloc] init];
[jhBtn wb_setImageName:@"pz_icon_jh"];
jhBtn.tag = 1582;
[jhBtn addTarget:self action:@selector(dengTypeClick:) forControlEvents:UIControlEventTouchUpInside];
[self.dengBGView addSubview:jhBtn];
[jhBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(wlBtn.mas_bottom).offset(17.5);
make.centerX.mas_equalTo(0);
make.size.mas_equalTo(CGSizeMake(30, 30));
}];
UIButton *uvBtn = [[UIButton alloc] init];
[uvBtn wb_setImageName:@"pz_icon_uv"];
uvBtn.tag = 1583;
[uvBtn addTarget:self action:@selector(dengTypeClick:) forControlEvents:UIControlEventTouchUpInside];
[self.dengBGView addSubview:uvBtn];
[uvBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(jhBtn.mas_bottom).offset(17.5);
make.centerX.mas_equalTo(0);
make.size.mas_equalTo(CGSizeMake(30, 30));
}];
[self.dengTypeBtnArray addObjectsFromArray:@[riGBtn,wlBtn,jhBtn,uvBtn]];
if (islinkDeviceWifi()) {
[UIView showFromView:self.view text:@"请将放大镜对准拍摄位置,画面清晰即可拍照" afterDelay:2];
}
}
- (void)sfbtnhhhhClick:(UIButton *)btn{
NSData *sendDate= dataWithCmd(JFDeviceRecvCommandXiaoYanHeightWaterOil);
@weakify(self);
[[DKSocket share] sendData:sendDate completeBlock:^(NSData * _Nonnull response) {
@strongify(self);
if (!response) {
[SVProgressHUD showInfoWithStatus:@"响应超时"];
return;
}
JFDeviceSendCommand cmd;
int outValue = 0;
cmdWithData(response,&outValue, &cmd);
if (outValue == 0) {
[SVProgressHUD showInfoWithStatus:@"水分上限校验失败"];
}else {
[SVProgressHUD showInfoWithStatus:@"水分上限校验成功"];
}
}];
}
- (void)sfhhbtnClick:(UIButton *)btn {
[btn setAttributedTitle:createAttString(@"水份", 14, rgba(255, 0, 0, 1)) forState:UIControlStateNormal];
NSData *sendDate= dataWithCmd(JFDeviceRecvCommandCheckWaterOil);
// @weakify(self);
@weakify(btn);
[[DKSocket share] sendData:sendDate completeBlock:^(NSData * _Nonnull response) {
@strongify(btn);
// @strongify(self);
if (!response) {
[SVProgressHUD showInfoWithStatus:@"响应超时"];
return;
}
JFDeviceSendCommand cmd;
int outValue = 0;
cmdWithData(response,&outValue, &cmd);
NSString *tipsString = [[NSString alloc] initWithFormat:@"%d",outValue];
[btn setAttributedTitle:createAttString(tipsString, 14, rgba(255, 0, 0, 1)) forState:UIControlStateNormal];
}];
}
- (void)backClick:(UIButton *)btn
{
if (self.takeImageBtn.hidden == YES) {
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"正在检测中,确认退出吗?" message:@"" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *conform = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[self backVC];
}];
UIAlertAction *cancleAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
}];
[alert addAction:cancleAction];
[alert addAction:conform];
[self presentViewController:alert animated:YES completion:nil];
}else {
[self backVC];
}
}
- (void)backVC {
NSArray *vcArray = self.navigationController.childViewControllers;
for (int i = 0; i < vcArray.count; i++) {
UIViewController *sVC = vcArray[i];
if ([NSStringFromClass([sVC class]) isEqualToString:@"SMCreateClientViewController"] ) {
[self.navigationController popToViewController:vcArray[i-1] animated:YES];
return;
}
}
[self.navigationController popViewControllerAnimated:YES];
}
- (void)sfbtnClick:(UIButton *)btn {
NSData *sendDate= dataWithCmd(JFDeviceRecvCommandXiaoYanWaterOil);
@weakify(self);
[[DKSocket share] sendData:sendDate completeBlock:^(NSData * _Nonnull response) {
@strongify(self);
if (!response) {
[SVProgressHUD showInfoWithStatus:@"响应超时"];
return;
}
JFDeviceSendCommand cmd;
int outValue = 0;
cmdWithData(response,&outValue, &cmd);
if (outValue == 0) {
[SVProgressHUD showInfoWithStatus:@"水分下限校验失败"];
}else {
[SVProgressHUD showInfoWithStatus:@"水分下限校验成功"];
}
}];
}
- (void)setTask {
}
- (void)dengBtnClick:(UIButton *)btn{
btn.selected = !btn.selected;
self.dengBGView.hidden = btn.selected;
// @weakify(self);
// [[DKSocket share] sendData:dataWithCmd(JFDeviceRecvCommandCheckWaterOil) completeBlock:^(NSData * _Nonnull response) {
// @strongify(self);
//
// NSLog(@"%@",response);
// }];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self lightUpOne];
// if (islinkDeviceWifi()) {
// NEHotspotConfiguration *hotspotConfig = [[NEHotspotConfiguration alloc]initWithSSID:WIFIName() passphrase:deviceWifiPWd() isWEP:NO];
// hotspotConfig.joinOnce = YES;
// [[NEHotspotConfigurationManager sharedManager] applyConfiguration:hotspotConfig completionHandler:^(NSError * _Nullable error) {
// NSLog(@"wifi 连接成功");
// }];
// }
}
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(lightUpOne) object:nil];
[[DKSocket share] sendData:dataWithCmd(JFDeviceSendCommandLightsOFF) completeBlock:^(NSData * _Nonnull response) {
}];
// if (islinkDeviceWifi()) {
// [[NEHotspotConfigurationManager sharedManager] removeConfigurationForSSID:WIFIName()];
// }
}
- (void)lightUpOne {
@weakify(self);
[[DKSocket share] sendData:dataWithCmd(JFDeviceSendCommandLightsRG) completeBlock:^(NSData * _Nonnull response) {
@strongify(self);
if (!response ) {
[self performSelector:@selector(lightUpOne) withObject:nil afterDelay:5];
}
}];
}
- (void)dengTypeClick:(UIButton *)btn {
@weakify(self);
for (UIButton *xbtn in self.dengTypeBtnArray) {
if ([xbtn isEqual:btn]) {
xbtn.selected = YES;
xbtn.userInteractionEnabled = NO;
[[DKSocket share] sendData:dataWithCmd(btn.tag-1580) completeBlock:^(NSData * _Nonnull response) {
@strongify(self);
}];
}else {
xbtn.selected = NO;
xbtn.userInteractionEnabled = YES;
}
}
}
- (void)takeImageClick:(UIButton *)btn {
if (netWorkStatus == NO) {
return;
}
self.dengBtn.hidden =YES;
self.dengBGView.hidden = YES;
btn.hidden = YES;
NSArray *tipsTArray = [@"日光图,极化图,纹理图,UV图,日光图" componentsSeparatedByString:@","];
@weakify(self);
dispatch_async(dispatch_get_global_queue(0, 0), ^{
NSLock *lock = [[NSLock alloc] init];
NSMutableArray *imageArray = [[NSMutableArray alloc] init];
for ( int i=0; i <5; i++) {
[lock lock];
if (i == 4) {
[self checkOilAndArray:imageArray];
[lock unlock];
break;
}
dispatch_async(dispatch_get_main_queue(), ^{
NSString *tipsT = [NSString stringWithFormat:@"%@拍摄中,请勿移动放大镜",tipsTArray[i]];
[UIView showFromView:self.view text:tipsT afterDelay:3];
});
[[DKSocket share] sendData:dataWithCmd(i) completeBlock:^(NSData * _Nonnull response) {
@strongify(self);
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://192.168.168.1:8888/?action=snapshot"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
if (!error) {
UIImage *xImage = [UIImage imageWithData:data];
if (!xImage) {
[imageArray addObject:[self viewSnapshot:self.videoView withInRect:CGRectZero]];
}else {
CGSize Iszie = xImage.size;
//
UIImage *image3 = [xImage sd_rotatedImageWithAngle:M_PI_2 fitSize:YES];
//
[imageArray addObject:image3];
// [imageArray addObject:[[self viewSnapshot:self.videoView withInRect:CGRectZero] sd_rotatedImageWithAngle:M_PI_2 fitSize:YES]];
// [imageArray addObject:[self viewSnapshot:self.videoView withInRect:CGRectZero]];
}
}else {
// [imageArray addObject:[self.videoView captureImage]];
[imageArray addObject:[self viewSnapshot:self.videoView withInRect:CGRectZero]];
}
});
[lock unlock];
}];
[dataTask resume];
});
}];
}
});
}
- (UIImage *)viewSnapshot:(UIView *)theView withInRect:(CGRect)rect;
{
CGRect irect = CGRectZero;
CGSize sSize = self.videoView.frame.size;
if (sSize.width > sSize.height) {
// CGFloat h = sSize.width/1280*720;
// irect = CGRectMake(0, (self.videoView.frame.size.width-h)/2, self.videoView.frame.size.width, self.videoView.frame.size.height );
irect = CGRectMake(0, 300, self.videoView.frame.size.height *1.35 , self.videoView.frame.size.width *1.5);
}else {
CGFloat w = self.videoView.frame.size.height/720*1280;
irect = CGRectMake((w-self.videoView.frame.size.width)/2, 0, self.videoView.frame.size.width, self.videoView.frame.size.height);
}
UIGraphicsBeginImageContextWithOptions(CGSizeMake(self.videoView.frame.size.height*1.35, self.videoView.frame.size.width*1.5), YES, 0);
[[[UIApplication sharedApplication].keyWindow layer] renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
CGImageRef imageRef = viewImage.CGImage;
rect =irect;//这里可以设置想要截图的区域
CGImageRef imageRefRect =CGImageCreateWithImageInRect(imageRef, rect);
UIImage *sendImage = [[UIImage alloc] initWithCGImage:imageRefRect];
// UIImageWriteToSavedPhotosAlbum(sendImage, nil, nil, nil);//保存图片到照片库
// UIGraphicsBeginImageContextWithOptions(CGSizeMake(theView.bounds.size.width, theView.bounds.size.height * 0.8), YES, [UIScreen mainScreen].scale);
// CGContextRef context = UIGraphicsGetCurrentContext();
// UIImage *img;
//
// CGRect irect = CGRectZero;
// CGSize sSize = self.videoView.frame.size;
// if (sSize.width > sSize.height) {
// CGFloat h = sSize.width/1280*720;
// irect = CGRectMake(600, (self.videoView.frame.size.width-h)/2, self.videoView.frame.size.width, self.videoView.frame.size.height );
// }else {
// CGFloat w = self.videoView.frame.size.height/720*1280;
// irect = CGRectMake((w-self.videoView.frame.size.width)/2, 0, self.videoView.frame.size.width, self.videoView.frame.size.height);
// }
//
// if([[[UIDevice currentDevice] systemVersion] floatValue]>=7.0){
// for(UIView *subview in theView.subviews){
// [subview drawViewHierarchyInRect:irect afterScreenUpdates:YES];
// }
// img = UIGraphicsGetImageFromCurrentImageContext();
// }else{
// CGContextSaveGState(context);
// [theView.layer renderInContext:context];
// img = UIGraphicsGetImageFromCurrentImageContext();
// }
// UIGraphicsEndImageContext();
return sendImage;
}
- (UIImage *)captureImage {
UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, self.view.opaque, 0);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *snap = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
CGRect irect = CGRectZero;
CGSize sSize = self.view.frame.size;
if (sSize.width > sSize.height) {
CGFloat h = sSize.width/1280*720;
irect = CGRectMake(0, (self.view.frame.size.width-h)/2, self.view.frame.size.width, self.view.frame.size.height);
}else {
CGFloat w = self.view.frame.size.height/720*1280;
irect = CGRectMake((w-self.view.frame.size.width)/2, 0, self.view.frame.size.width, self.view.frame.size.height);
}
return [self imageByCropToRect:irect image:snap];
}
- (UIImage *)imageByCropToRect:(CGRect)rect image:(UIImage *)image {
rect.origin.x *= image.scale;
rect.origin.y *= image.scale;
rect.size.width *= image.scale;
rect.size.height *= image.scale;
if (rect.size.width <= 0 || rect.size.height <= 0) return nil;
CGImageRef imageRef = CGImageCreateWithImageInRect(image.CGImage, rect);
UIImage *rimage = [UIImage imageWithCGImage:imageRef scale:image.scale orientation:image.imageOrientation];
CGImageRelease(imageRef);
return rimage;
}
- (void)checkOilAndArray:(NSArray *)imageArray {
@weakify(self);
dispatch_async(dispatch_get_main_queue(), ^{
SMCheckOilBGView *oview = [[SMCheckOilBGView alloc] init];
@weakify(oview);
oview.BtnSendBlock = ^(bool send) {
@strongify(oview);
@strongify(self);
if (send) {
[self checkOilAndArray:imageArray];
}else {
[self editPostionWithArray:imageArray outValue:0];
}
[oview wb_disBTlLMiss];
};
oview.frame= self.view.bounds;
[oview wb_showlTBFromSuperView: self.view];
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(4 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [oview wb_disBTlLMiss];
// });
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[[DKSocket share] sendData:dataWithCmd(JFDeviceRecvCommandCheckWaterOil) completeBlock:^(NSData * _Nonnull response) {
@strongify(self);
JFDeviceSendCommand cmd;
int outValue = 0;
cmdWithData(response,&outValue, &cmd);
if (outValue > 85) {
outValue = 85;
}
dispatch_async(dispatch_get_main_queue(), ^{
if (outValue ==0) {
[oview faildViewHidden:NO];
}else {
[oview wb_disBTlLMiss];
[self editPostionWithArray:imageArray outValue:outValue];
}
});
}];
});
});
}
- (void)editPostionWithArray:(NSArray *)imageArray outValue:(int )outValue{
[[DKSocket share] sendData:dataWithCmd(0) completeBlock:^(NSData * _Nonnull response) {
}];
dispatch_async(dispatch_get_main_queue(), ^{
self.takeImageBtn.hidden = NO;
self.dengBtn.hidden = NO;
self.dengBtn.selected = NO;
self.dengBGView.hidden = NO;
SMEditPositionNameView *nameView = [[SMEditPositionNameView alloc] init];
[nameView wb_showFromSuperView:self.view];
@weakify(self);
nameView.saveBlock = ^(NSString * _Nonnull str) {
@strongify(self);
[self reportViewWithName:str imgeArray:imageArray fen:outValue];
};
});
}
- (void)reportViewWithName:(NSString *)name imgeArray:(NSArray *)imgArray fen:(int)fen{
if (imgArray.count < 4) {
[SVProgressHUD showErrorWithStatus:@"拍摄失败,重新拍摄"];
return;
}
[SVProgressHUD show];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
NSMutableArray *imgeArray = [[NSMutableArray alloc] init];
NSArray *tipsTArray = [@"日光图,极化图,纹理图,UV图,日光图" componentsSeparatedByString:@","];
NSString *tID = nowTimeTimestamp();
for (int i = 0; i < 4; i++) {
UIImage *iconImg = imgArray[i];
NSString *keyString = [NSString stringWithFormat:@"Pictures/%@/%@/%@/%d.jpg",[SMGlobalModel share].mid ,self.clinetModel.ID,tID,i];
[[MMLocalDataBManager sharedManager] addWithObjectKey:keyString updateData:UIImageJPEGRepresentation(iconImg, 1)];
NSString *iconUrl = [NSString stringWithFormat:@"%@/%@",[[MMAutoUploadTool sharedManager] domain],keyString];
[[SDImageCache sharedImageCache] storeImage:iconImg forKey: iconUrl completion:^{
}];
SMLocalReportImageModel *model = [[SMLocalReportImageModel alloc] init];
model.iType = [NSString stringWithFormat:@"%d",i];
model.iURL = iconUrl;
model.iname = tipsTArray[i];
[imgeArray addObject:model];
}
SMLocalReportModel *model = [[SMLocalReportModel alloc] init];
model.cid = self.clinetModel.ID;
model.iposition = name;
model.createTime = tID;
model.cgid = tID;
model.imageArray = imgeArray;
model.mid = [SMGlobalModel share].mid;
///敏感
NSDictionary *minganDict = [SMAIImageTool minGanWithJihuaImg:imgArray[1]];
NSDictionary *zhouwenDict = [SMAIImageTool zhouwenWithWenLiImg:imgArray[2]];
NSDictionary *maokongcudaDict = [SMAIImageTool haoKongCuDaWithJihuaImg:imgArray[1]];
NSDictionary *sechenDict = [SMAIImageTool seChenWithJihuaImg:imgArray[1]];
NSDictionary *pizhiDict = [SMAIImageTool piZhiDuSheWithRiGuangImg:imgArray[0]];
NSDictionary *maokongduseDict = [SMAIImageTool haoKongDuSheWithUVImg:imgArray[3]];
SMLocalReportAIModel *shuifenModel = [[SMLocalReportAIModel alloc] init];
shuifenModel.tagFlag = @"magn_water";
shuifenModel.tagValue = [NSString stringWithFormat:@"%d",fen];
shuifenModel.aiImageUrl = @"";
shuifenModel.dermalogicatext = @"";
shuifenModel.tagname = @"水份";
shuifenModel.tagNum = [NSString stringWithFormat:@"%d",fen];
if (fen <= 45) {
shuifenModel.dermalogicatext = (self.weiduDcit[@"magn_water"])[@"one"];
}else if (fen <= 55) {
shuifenModel.dermalogicatext = (self.weiduDcit[@"magn_water"])[@"two"];
}else {
shuifenModel.dermalogicatext = (self.weiduDcit[@"magn_water"])[@"three"];
}
SMLocalReportAIModel *minganModel = [[SMLocalReportAIModel alloc] init];
minganModel.tagFlag = @"magn_sensity";
minganModel.tagValue =[NSString stringWithFormat:@"%@",minganDict[@"ratio"]];
minganModel.aiImageUrl = [self saveLocalImage:minganDict[@"image"] typeString:@"magn_sensity" tID:tID];
minganModel.tagname = @"敏感";
minganModel.tagNum = minganDict[@"ratio"];
int minganFen = [minganDict[@"ratio"]doubleValue];
if (minganFen == 0 ) {
minganModel.dermalogicatext = (self.weiduDcit[@"magn_sensity"])[@"one"];
}else if (minganFen <= 10 ) {
minganModel.dermalogicatext = (self.weiduDcit[@"magn_sensity"])[@"two"];
}else if (minganFen <=20 ) {
minganModel.dermalogicatext = (self.weiduDcit[@"magn_sensity"])[@"three"];
}else {
minganModel.dermalogicatext = (self.weiduDcit[@"magn_sensity"])[@"four"];
}
SMLocalReportAIModel *zhouwenModel = [[SMLocalReportAIModel alloc] init];
zhouwenModel.tagFlag = @"magn_wrinkle";
zhouwenModel.tagValue =[NSString stringWithFormat:@"%@",zhouwenDict[@"wrinkleCount"]];
zhouwenModel.aiImageUrl = [self saveLocalImage:zhouwenDict[@"image"] typeString:@"magn_wrinkle" tID:tID];
zhouwenModel.tagname = @"皱纹";
int zhouwenFen = [zhouwenDict[@"wrinkleCount"]intValue];
zhouwenModel.tagNum =zhouwenDict[@"wrinkleCount"];
if (zhouwenFen == 0 ) {
zhouwenModel.dermalogicatext = (self.weiduDcit[@"magn_wrinkle"])[@"one"];
}else if (zhouwenFen <= 25 ) {
zhouwenModel.dermalogicatext = (self.weiduDcit[@"magn_wrinkle"])[@"two"];
}else if (zhouwenFen <=40 ) {
zhouwenModel.dermalogicatext = (self.weiduDcit[@"magn_wrinkle"])[@"three"];
}else {
zhouwenModel.dermalogicatext = (self.weiduDcit[@"magn_wrinkle"])[@"four"];
}
SMLocalReportAIModel *maokongcudaModel = [[SMLocalReportAIModel alloc] init];
maokongcudaModel.tagFlag = @"magn_pore_large";
maokongcudaModel.tagValue =[NSString stringWithFormat:@"%@",maokongcudaDict[@"roughPoreCount"]];
maokongcudaModel.aiImageUrl = [self saveLocalImage:maokongcudaDict[@"image"] typeString:@"magn_pore_large" tID:tID];
maokongcudaModel.tagname = @"毛孔粗大";
maokongcudaModel.dermalogicatext = @"毛孔粗大的护理方法";
int maokongcudaFen = [maokongcudaDict[@"roughArea"]intValue];
maokongcudaModel.tagNum = maokongcudaDict[@"roughArea"];
if (maokongcudaFen == 0 ) {
maokongcudaModel.dermalogicatext = (self.weiduDcit[@"magn_pore_large"])[@"one"];
}else if (maokongcudaFen <=50000 ) {
maokongcudaModel.dermalogicatext = (self.weiduDcit[@"magn_pore_large"])[@"two"];
}else if (maokongcudaFen <=120000 ) {
maokongcudaModel.dermalogicatext = (self.weiduDcit[@"magn_pore_large"])[@"three"];
}else {
maokongcudaModel.dermalogicatext = (self.weiduDcit[@"magn_pore_large"])[@"four"];
}
SMLocalReportAIModel *maokongduseModel = [[SMLocalReportAIModel alloc] init];
maokongduseModel.tagFlag = @"magn_pore_clogging";
maokongduseModel.tagValue =[NSString stringWithFormat:@"%@",maokongduseDict[@"blockedCount"]];
maokongduseModel.aiImageUrl = [self saveLocalImage:maokongduseDict[@"image"] typeString:@"magn_pore_clogging" tID:tID];
maokongduseModel.tagname = @"毛孔堵塞";
int maokongduseFen = [maokongduseDict[@"blockedArea"]intValue];
maokongduseModel.tagNum = maokongduseDict[@"blockedArea"];
if (maokongduseFen == 0 ) {
maokongduseModel.dermalogicatext = (self.weiduDcit[@"magn_pore_clogging"])[@"one"];
}else if (maokongduseFen <=50000 ) {
maokongduseModel.dermalogicatext = (self.weiduDcit[@"magn_pore_clogging"])[@"two"];
}else if (maokongduseFen <=120000 ) {
maokongduseModel.dermalogicatext = (self.weiduDcit[@"magn_pore_clogging"])[@"three"];
}else {
maokongduseModel.dermalogicatext = (self.weiduDcit[@"magn_pore_clogging"])[@"four"];
}
SMLocalReportAIModel *sechenModel = [[SMLocalReportAIModel alloc] init];
sechenModel.tagFlag = @"magn_pigmentation";
sechenModel.tagValue =[NSString stringWithFormat:@"%@",sechenDict[@"ratio"]];
sechenModel.aiImageUrl = [self saveLocalImage:sechenDict[@"image"] typeString:@"magn_pigmentation" tID:tID];
sechenModel.tagname = @"色沉";
sechenModel.tagNum = sechenDict[@"ratio"];
int secenFen = [sechenDict[@"ratio"]intValue];
if (secenFen == 0 ) {
sechenModel.dermalogicatext = (self.weiduDcit[@"magn_pigmentation"])[@"one"];
}else if (secenFen <=7 ) {
sechenModel.dermalogicatext = (self.weiduDcit[@"magn_pigmentation"])[@"two"];
}else if (secenFen <=15 ) {
sechenModel.dermalogicatext = (self.weiduDcit[@"magn_pigmentation"])[@"three"];
}else {
sechenModel.dermalogicatext = (self.weiduDcit[@"magn_pigmentation"])[@"four"];
}
SMLocalReportAIModel *pizhiModel = [[SMLocalReportAIModel alloc] init];
pizhiModel.tagFlag = @"magn_sebum";
pizhiModel.tagValue =[NSString stringWithFormat:@"%@",pizhiDict[@"ratio"]];
pizhiModel.aiImageUrl = [self saveLocalImage:pizhiDict[@"image"] typeString:@"magn_sebum" tID:tID];
pizhiModel.tagname = @"皮脂";
pizhiModel.dermalogicatext = @"皮脂的护理方法";
pizhiModel.tagNum = pizhiDict[@"ratio"];
int pizhiFen = [pizhiDict[@"ratio"]intValue];
if (pizhiFen <= 1 ) {
pizhiModel.dermalogicatext = (self.weiduDcit[@"magn_sebum"])[@"one"];
}else if (pizhiFen <=9 ) {
pizhiModel.dermalogicatext = (self.weiduDcit[@"magn_sebum"])[@"two"];
}else {
pizhiModel.dermalogicatext = (self.weiduDcit[@"magn_sebum"])[@"three"];
}
NSLog(@"shuifen = %d, minganFen = %d, pizhiFen = %d, secenFen = %d, zhouwenFen = %d, maokongcudaFen = %d",fen,minganFen,pizhiFen,secenFen,zhouwenFen,maokongcudaFen);
model.AISymptomArray = @[shuifenModel,minganModel,zhouwenModel,maokongcudaModel,maokongduseModel,sechenModel,pizhiModel].mutableCopy;
[[SMLocalReportBManager sharedManager] addWithModel:model];
dispatch_async(dispatch_get_main_queue(), ^{
[SVProgressHUD dismiss];
SMReportViewController *vc = [[SMReportViewController alloc] init];
vc.clinetModel = self.clinetModel;
vc.lrModel = model;
[self.navigationController pushViewController:vc animated:YES];
});
});
}
- (NSString *)saveLocalImage:(UIImage *)image typeString:(NSString *)typeString tID:(NSString *)tID{
NSString *mingankeyString = [NSString stringWithFormat:@"Pictures/%@/%@/%@/%@.jpg",[SMGlobalModel share].mid ,self.clinetModel.ID,tID,typeString];
[[MMLocalDataBManager sharedManager] addWithObjectKey:mingankeyString updateData:UIImageJPEGRepresentation(image, 1)];
NSString *iconUrl = [NSString stringWithFormat:@"%@/%@",[[MMAutoUploadTool sharedManager] domain],mingankeyString];
[[SDImageCache sharedImageCache] storeImage:image forKey: iconUrl completion:^{
}];
return iconUrl;
}
@end
//
// SMTempCell.h
// SkinMagnifier
//
// Created by nana on 2020/12/18.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMTempCell : UITableViewCell
@property(nonatomic, strong)UIImageView *tipsImageView;
@property(nonatomic, strong)UILabel *tipsLabel;
@end
NS_ASSUME_NONNULL_END
//
// SMTempCell.m
// SkinMagnifier
//
// Created by nana on 2020/12/18.
//
#import "SMTempCell.h"
@implementation SMTempCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.selectionStyle = UITableViewCellSelectionStyleNone;
self.tipsImageView = [[UIImageView alloc] init];
self.tipsImageView.image = [UIImage imageNamed:@"report_icon_detected"];
[self.contentView addSubview:self.tipsImageView];
[self.tipsImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.top.mas_equalTo(30);
}];
self.tipsLabel = [[UILabel alloc] init];
self.tipsLabel.attributedText = createAttString(@"水份未检测哦~", 12, rgba(153, 153, 153, 1));
[self.contentView addSubview:self.tipsLabel];
[self.tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.top.equalTo(self.tipsImageView.mas_bottom).offset(10);
make.bottom.mas_equalTo(-30);
}];
UIView *twolineView = [[UIView alloc] init];
twolineView.backgroundColor = rgba(243, 243, 243, 1);
[self.contentView addSubview:twolineView];
[twolineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.bottom.right.mas_equalTo(0);
make.height.mas_equalTo(10);
}];
}
@end
//
// SMConfigWIFIView.h
// SkinMagnifier
//
// Created by nana on 2021/3/26.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMConfigWIFIView : UIView
@end
NS_ASSUME_NONNULL_END
//
// SMConfigWIFIView.m
// SkinMagnifier
//
// Created by nana on 2021/3/26.
//
#import "SMConfigWIFIView.h"
#import "DKSocket.h"
#import "DKCmdTool.h"
@interface SMConfigWIFIView ()
@property(nonatomic, strong)UITextField *wifiNameTView;
@property(nonatomic, strong)UITextField *wifiPwdTView;
@property(nonatomic, strong)UILabel *configWIFILabel;
@property(nonatomic, strong)DKSocket *socket;
@property(nonatomic, assign)BOOL connectStatus;
@end
@implementation SMConfigWIFIView
- (instancetype)init {
if (self = [super init]) {
self.backgroundColor = [UIColor whiteColor];
[self setupUI];
}
return self;
}
- (void)setupUI {
self.wifiNameTView = [[UITextField alloc] init];
self.wifiNameTView.placeholder = @"wifi名字";
self.wifiNameTView.backgroundColor = [UIColor orangeColor];
[self addSubview:self.wifiNameTView];
[self.wifiNameTView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(100);
make.left.mas_equalTo(10);
make.right.mas_equalTo(-10);
make.height.mas_equalTo(40);
}];
self.wifiPwdTView = [[UITextField alloc] init];
self.wifiPwdTView.placeholder = @"wifi名字";
self.wifiPwdTView.backgroundColor = [UIColor orangeColor];
[self addSubview:self.wifiPwdTView];
[self.wifiPwdTView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.wifiNameTView.mas_bottom).offset(10);
make.left.mas_equalTo(10);
make.right.mas_equalTo(-10);
make.height.mas_equalTo(40);
}];
UIButton *cfgBtn = [[UIButton alloc] init];
[cfgBtn setTitle:@"配网" forState:UIControlStateNormal];
[cfgBtn setBackgroundImage:[UIImage wb_imageWithColor:[UIColor blueColor] size:CGSizeMake(40, 40)] forState:UIControlStateNormal];
[cfgBtn addTarget:self action:@selector(cfgBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:cfgBtn];
[cfgBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(10);
make.right.mas_equalTo(-10);
make.top.equalTo(self.wifiPwdTView.mas_bottom).offset(10);
make.height.mas_equalTo(40);
}];
UIButton *checkBtn = [[UIButton alloc] init];
[checkBtn setTitle:@"查看" forState:UIControlStateNormal];
[checkBtn setBackgroundImage:[UIImage wb_imageWithColor:[UIColor blueColor] size:CGSizeMake(40, 40)] forState:UIControlStateNormal];
[checkBtn addTarget:self action:@selector(checkBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:checkBtn];
[checkBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(10);
make.right.mas_equalTo(-10);
make.top.equalTo(cfgBtn.mas_bottom).offset(50);
make.height.mas_equalTo(40);
}];
self.configWIFILabel = [[UILabel alloc] init];
self.configWIFILabel.numberOfLines = 0;
self.configWIFILabel.text = @"12312";
self.configWIFILabel.textColor = [UIColor blueColor];
[self addSubview:self.configWIFILabel];
[self.configWIFILabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(10);
make.right.mas_equalTo(-10);
make.top.equalTo(checkBtn.mas_bottom).offset(10);
make.height.mas_equalTo(200);
}];
self.socket = [[DKSocket alloc] init];
[self.socket connectHost:@"192.168.168.1" port:8899];
@weakify(self);
self.socket.checkNetWorkBlock = ^(BOOL networkStaus) {
@strongify(self);
self.connectStatus = networkStaus;
};
}
- (void)checkBtnClick:(UIButton *)btn {
if (self.connectStatus == NO) {
[SVProgressHUD showErrorWithStatus:@"未脸上服务器"];
return;
}
self.configWIFILabel.text = @"";
NSData *sendData =sendGetWIFIInfo();
@weakify(self);
[self.socket sendData:sendData completeBlock:^(NSData * _Nonnull response) {
@strongify(self);
if (response) {
NSString *xxString = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
NSLog(@"ss %@",xxString);
self.configWIFILabel.text = xxString;
}
}];
}
- (void)cfgBtnClick:(UIButton *)btn {
if (self.connectStatus == NO) {
[SVProgressHUD showErrorWithStatus:@"未脸上服务器"];
return;
}
if (!self.wifiNameTView.text.length ) {
[SVProgressHUD showErrorWithStatus:@"Wi-Fi账号"];
return;
}
if (!self.wifiPwdTView.text.length ) {
[SVProgressHUD showErrorWithStatus:@"Wi-Fi密码"];
return;
}
NSData *sendData = sendSetWIFI(self.wifiNameTView.text, self.wifiPwdTView.text);
@weakify(self);
[self.socket sendData:sendData completeBlock:^(NSData * _Nonnull response) {
@strongify(self);
if (response) {
[SVProgressHUD showSuccessWithStatus:@"发送成功准备重启"];
}else {
[SVProgressHUD showSuccessWithStatus:@"发送 失败"];
}
}];
}
@end
//
// SMHomeViewController.h
// SkinMagnifier
//
// Created by nana on 2020/11/4.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMHomeViewController : UIViewController
@end
NS_ASSUME_NONNULL_END
//
// SMHomeViewController.m
// SkinMagnifier
//
// Created by nana on 2020/11/4.
//
#import "SMHomeViewController.h"
#import "SMLoginView.h"
#import "SMLinkDeviceView.h"
#import "SMClientViewController.h"
#import "SMEditShopInfoViewController.h"
#import "SMReportViewController.h"
#import "SMCreateClientViewController.h"
#import "SMLinkDeviceView.h"
#import "SMCheckOilBGView.h"
#import "SMConfigWIFIView.h"
@interface SMHomeViewController()
@property(nonatomic, strong)UILabel *shopNameLabel;
@property(nonatomic, strong)UILabel *shopIdLabel;
@property(nonatomic, strong)SMLoginView *loginView;
@property (nonatomic,assign)BOOL shopInfoComplete;
@end
@implementation SMHomeViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
// [SMAIImageTool piZhiDuSheWithRiGuangImg:[UIImage imageNamed:@"111"]];
UIImageView *bgImageView = [[UIImageView alloc] init];
bgImageView.image = [UIImage wb_biliImageName:@"home_bg"];
bgImageView.contentMode =UIViewContentModeScaleAspectFill ;
[self.view addSubview:bgImageView];
[bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(safaTop(122.5));
make.centerX.mas_equalTo(0);
make.size.mas_equalTo(biliSize(318, 413));
}];
UILabel *shopNameLabel = [[UILabel alloc] init];
_shopNameLabel = shopNameLabel;
[self.view addSubview:shopNameLabel];
shopNameLabel.attributedText = createAttString(@"深圳南山区天利名城店", 19, rgba(76, 74, 66, 1));
[shopNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(bgImageView);
make.top.mas_equalTo( safaTop(53) );
make.right.mas_equalTo(-100);
}];
UILabel *shopidLabel = [[UILabel alloc] init];
_shopIdLabel = shopidLabel;
[self.view addSubview:shopidLabel];
[shopidLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(bgImageView);
make.top.mas_equalTo(safaTop(79) );
}];
UIButton *showBtn = [[UIButton alloc] init];
[showBtn addTarget:self action:@selector(showBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[showBtn wb_setImageName:@"home_tool_icon_clas"];
[self.view addSubview:showBtn];
[showBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo( safaTop(50) );
make.right.mas_equalTo(-22);
}];
UIButton *clientBtn = [[UIButton alloc] init];
[clientBtn wb_setImageName:@"home_icon_xyp"];
[clientBtn setAttributedTitle:createAttString(@"档案列表", 14, rgba(76, 74, 66, 1)) forState:UIControlStateNormal];
clientBtn.imageEdgeInsets = UIEdgeInsetsMake(0, -4.5, 0, 4.5);
[clientBtn wb_setRightImage];
[clientBtn addTarget:self action:@selector(clientClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:clientBtn];
[clientBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo( safaBottom(-101.5));
make.centerX.mas_equalTo(0);
}];
UIButton *createBtn = [[UIButton alloc] init];
[createBtn setAttributedTitle:createAttString(@"新建档案", 17,rgba(254, 254, 255, 1)) forState:UIControlStateNormal];
[createBtn addTarget:self action:@selector(createBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[createBtn setBackgroundImage:[[UIImage wb_imageWithColor:rgba(255, 124, 78, 1) size:CGSizeMake(225.5, 45)] sd_roundedCornerImageWithRadius:45/2.0 corners:0xff borderWidth:0 borderColor:rgba(0, 0, 0, 0)] forState:UIControlStateNormal];
[createBtn wb_setImageName:@"home_icon_personal"];
[self.view addSubview:createBtn];
[createBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(safaBottom(-37.5));
make.centerX.mas_equalTo(0);
}];
SMLoginView *lView = [[SMLoginView alloc] init];
_loginView = lView;
@weakify(lView);
@weakify(self);
lView.loginBlock = ^(NSString *account ,NSString *dmname){
@strongify(lView);
@strongify(self);
[lView removeFromSuperview];
self.shopIdLabel.attributedText = createAttString(account, 12, rgba(153, 153, 153, 1));
self.shopNameLabel.attributedText = createAttString(dmname, 18, rgba(76, 74, 66, 1));
[self requestData ];
};
lView.frame =self.view.bounds;
[self.view addSubview:lView];
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// SMLinkDeviceView *smView = [[SMLinkDeviceView alloc] init];
// [smView wb_showFromSuperView:self.view];
// });
}
- (void)requestData {
NSMutableDictionary *pDict = [[NSMutableDictionary alloc] init];
pDict[@"mid"] = [SMGlobalModel share].mid;
@weakify(self);
[self.view postFormDataWithUrl:@"/magnifier/member/verifyMemberInfo" params:pDict showHUD:NO success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
@strongify(self);
self.shopInfoComplete = [((NSDictionary *)JsonData.data)[@"info"] intValue];
[SMGlobalModel share].shopInfoComplete = self.shopInfoComplete;
if (!self.shopInfoComplete) {
[self alertEditShop];
}
}];
}
- (void)createBtnClick:(UIButton *)btn {
if (self.shopInfoComplete) {
SMCreateClientViewController *vc = [[SMCreateClientViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
}else {
[self alertEditShop];
}
}
- (void)clientClick:(UIButton *)btn {
if (self.shopInfoComplete) {
SMClientViewController *vc = [[SMClientViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
}else {
[self alertEditShop];
}
}
- (void)alertEditShop {
//1.创建UIAlertControl
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"编辑门店信息" message:@"" preferredStyle:UIAlertControllerStyleAlert];
/*
参数说明:
Title:弹框的标题
message:弹框的消息内容
preferredStyle:弹框样式:UIAlertControllerStyleAlert
*/
//2.添加按钮动作
//2.1 确认按钮
UIAlertAction *conform = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[self pushEditCV];
}];
UIAlertAction *cancleAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
}];
//3.将动作按钮 添加到控制器中
[alert addAction:cancleAction];
[alert addAction:conform];
//4.显示弹框
[self presentViewController:alert animated:YES completion:nil];
}
- (void)pushEditCV {
SMEditShopInfoViewController *vc = [[SMEditShopInfoViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
@weakify(self);
vc.saveBlock = ^(NSString * _Nonnull dname) {
@strongify(self);
self.shopNameLabel.text = dname;
self.shopInfoComplete = YES;
[SMGlobalModel share].shopInfoComplete = self.shopInfoComplete;
};
}
- (void)showBtnClick:(UIButton *)btn {
UIView *showView = [[UIView alloc] init];
showView.backgroundColor = [UIColor whiteColor];
showView.layer.cornerRadius = 5;
showView.layer.masksToBounds = YES;
//,连接设备 home_pop_lj
NSArray *iconArray = [@"home_pop_bj,home_pop_esc,home_pop_esc" componentsSeparatedByString:@","];
NSArray *titleArray = [@"编辑信息,退出登录,配网" componentsSeparatedByString:@","];
for (int i = 0 ; i < iconArray.count; i++) {
NSString *titleString = titleArray[i];
NSString *iconString = iconArray[i];
UIButton *btn = [[UIButton alloc] init];
btn.imageEdgeInsets = UIEdgeInsetsMake(0, -7.5, 0, 7.5);
btn.titleEdgeInsets = UIEdgeInsetsMake(0, 7.5, 0, -7.5);
btn.tag = 1650+i;
[btn addTarget:self action:@selector(tagBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[btn wb_setImageName:iconString];
[btn setAttributedTitle:createAttString(titleString, 14, rgba(75, 74, 70, 1)) forState:UIControlStateNormal];
[showView addSubview:btn];
btn.frame = CGRectMake(0, i*52, 127, 51);
UIView *lineView = [[UIView alloc] init];
lineView.backgroundColor = rgba(229, 229, 229, 1);
[showView addSubview:lineView];
lineView.frame = CGRectMake(20, (i+1)*53, 127-40, 1);
}
[showView alertToView:btn Postion:3 vsize:CGSizeMake(127, 157)];
}
- (void)tagBtnClick:(UIButton *)btn {
[btn alertDisMiss];
int indexID = (int)btn.tag - 1650;
if (indexID == 0) {
[self pushEditCV];
}else if (indexID == 1) {
[self loginOut];
// SMLinkDeviceView *smView = [[SMLinkDeviceView alloc] init];
// [smView wb_showFromSuperView:self.view];
}else if (indexID == 2) {
NSLog(@"配网");
SMConfigWIFIView *smView = [[SMConfigWIFIView alloc] init];
[smView wb_showFromSuperView:self.view];
UIButton *canBtn = [[UIButton alloc] init];
[canBtn setTitle:@"返回" forState:UIControlStateNormal];
[canBtn setBackgroundImage:[UIImage wb_imageWithColor:[UIColor blueColor]] forState:UIControlStateNormal];
[canBtn addTarget:smView action:@selector(wb_disMiss) forControlEvents:UIControlEventTouchUpInside];
[smView addSubview:canBtn];
[canBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(40);
make.left.mas_equalTo(40);
make.size.mas_equalTo(CGSizeMake(80, 40));
}];
}
}
- (void)loginOut {
//1.创建UIAlertControler
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"退出登录" message:@"" preferredStyle:UIAlertControllerStyleAlert];
/*
参数说明:
Title:弹框的标题
message:弹框的消息内容
preferredStyle:弹框样式:UIAlertControllerStyleAlert
*/
//2.添加按钮动作
//2.1 确认按钮
UIAlertAction *conform = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[self.loginView wb_showFromSuperView:self.view];
}];
UIAlertAction *cancleAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
}];
//3.将动作按钮 添加到控制器中
[alert addAction:cancleAction];
[alert addAction:conform];
//4.显示弹框
[self presentViewController:alert animated:YES completion:nil];
}
@end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>MoreMe水肤镜</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>7</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSCameraUsageDescription</key>
<string>App需要您的同意,才能访问相机,以便编辑用户头像</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>我们需要获取地理信息,以确定当前用户是否有设备使用权限</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>App需要您的同意,才能访问相册,以便编辑用户头像</string>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIUserInterfaceStyle</key>
<string>Light</string>
</dict>
</plist>
//
// DKCmdTool.h
// DKWF_Example
//
// Created by nana on 2020/7/3.
// Copyright © 2020 304635659@qq.com. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, JFDeviceSendCommand) {
JFDeviceSendCommandLightsRG = 0, //日光模式
JFDeviceSendCommandLightsJXPZ, //交叉偏振模式
JFDeviceSendCommandLightsPHPZ, //平衡偏振模式
JFDeviceSendCommandLightsUV, //UV灯光模式
JFDeviceSendCommandLightsOFF, //关灯
JFDeviceSendCommandLightsCurrent, //灯光当前模式
JFDeviceSendCommandBatteryLevel, //电池电量
JFDeviceSendCommandFirmwareVersion, //固件版本
JFDeviceRecvCommandPhotograph, //拍照
JFDeviceRecvCommandCheckWaterOil, //检测水油
JFDeviceRecvCommandHaveWaterOil, //是否有水油模块
JFDeviceRecvCommandXiaoYanWaterOil, //是否有水油模块
JFDeviceRecvCommandXiaoYanHeightWaterOil //是否有水油模块
};
typedef NS_ENUM(NSInteger, JFDeviceConfig) {
JFDeviceConfigScanWiFI= 0, //扫描WiFi
JFDeviceConfigSetWiFI, //设置WiFi账号密码
JFDeviceConfigGetWiFI, //获取WiFi账号密码
JFDeviceConfigSetCameraFPS, //设置相机帧数
JFDeviceConfigSetCameraSessionPreset, //设置相机分辨率
JFDeviceConfigGetCameraSessionPresetFPS //设置相机分辨率
};
@interface DKCmdTool : NSObject
/// 发送cmd
NSData *dataWithCmd(JFDeviceSendCommand cmd);
/// 接收数据解析
bool cmdWithData(NSData *inData,int *outValue, JFDeviceSendCommand *cmd);
unsigned int CRC_16_Check(NSData *databuf);
/// 发送 扫描周围WiFi
NSData *sendScanWIFI();
/// 发送 配置 硬件设备连网的 WiFi 账号 和密码, 如果WiFi 没有 密码 WifiPwd = @""
NSData *sendSetWIFI(NSString *wifiName ,NSString *WifiPwd );
/// 获取硬件连网的账号和密码
NSData *sendGetWIFIInfo();
/// 发送配置硬件相机的帧数 帧数范围 10 -- 25
NSData *sendSetCameraFPS(int FPS);
/// 发送配置硬件相机的分辨率 分辨率选项为 640x480 800x600 1280x720 1920x1080
NSData *sendSetCameraResolutionRatio(NSString *rr) ;
/// 获取 硬件相机 的分辨率 和帧数
NSData *sendGetCameraInfo();
@end
NS_ASSUME_NONNULL_END
//
// DKCmdTool.m
// DKWF_Example
//
// Created by nana on 2020/7/3.
// Copyright © 2020 304635659@qq.com. All rights reserved.
//
#import "DKCmdTool.h"
@implementation DKCmdTool
NSData *dataWithCmd(JFDeviceSendCommand command) {
NSMutableData *rdata = [[NSMutableData alloc] init];
/// header1 和 header2 没有合在一起, 懒得交换
int header1 = 0x55;
int header2 = 0xaa;
int dataLen = 0x00; //带计算
int device1 = 0x00;
int device2 = 0x1D;
int commtype = 0x31;
int cmdStatus = 0x02;
NSData *data = [NSData data]; ///
switch (command) {
case JFDeviceSendCommandLightsRG:
{
dataLen = 0x06;
commtype = 0x31;
NSInteger x = 0x0006;
data = [NSData dataWithBytes:&x length:2];
break;
}
case JFDeviceSendCommandLightsJXPZ:
{
dataLen = 0x06;
commtype = 0x31;
NSInteger x = 0x0106;
data = [NSData dataWithBytes:&x length:2];
break;
}
case JFDeviceSendCommandLightsPHPZ:
{
dataLen = 0x06;
commtype = 0x31;
NSInteger x = 0x0206;
data = [NSData dataWithBytes:&x length:2];
break;
}
case JFDeviceSendCommandLightsUV:
{
dataLen = 0x06;
commtype = 0x31;
NSInteger x = 0x0306;
data = [NSData dataWithBytes:&x length:2];
break;
}
case JFDeviceSendCommandLightsOFF:
{
dataLen = 0x06;
commtype = 0x31;
NSInteger x = 0x0406;
data = [NSData dataWithBytes:&x length:2];
break;
}
case JFDeviceSendCommandLightsCurrent:
{
dataLen = 0x05;
commtype = 0x33;
NSInteger x = 0x05;
data = [NSData dataWithBytes:&x length:1];
break;
}
case JFDeviceSendCommandBatteryLevel:
{
dataLen = 0x05;
commtype = 0x33;
NSInteger x = 0x04;
data = [NSData dataWithBytes:&x length:1];
break;
}
case JFDeviceSendCommandFirmwareVersion:
{
dataLen = 0x05;
commtype = 0x33;
NSInteger x = 0x18;
data = [NSData dataWithBytes:&x length:1];
break;
}
case JFDeviceRecvCommandCheckWaterOil:
{
dataLen = 0x05;
commtype = 0x33;
NSInteger x = 0x03;
data = [NSData dataWithBytes:&x length:1];
break;
}
case JFDeviceRecvCommandHaveWaterOil:
{
dataLen = 0x05;
commtype = 0x33;
NSInteger x = 0x09;
data = [NSData dataWithBytes:&x length:1];
break;
}
case JFDeviceRecvCommandXiaoYanWaterOil:
{
dataLen = 0x05;
commtype = 0x33;
NSInteger x = 0x0A;
data = [NSData dataWithBytes:&x length:1];
break;
}
case JFDeviceRecvCommandXiaoYanHeightWaterOil:
{
dataLen = 0x05;
commtype = 0x33;
NSInteger x = 0x0B;
data = [NSData dataWithBytes:&x length:1];
break;
}
default:
break;
}
[rdata appendBytes:&header1 length:1];
[rdata appendBytes:&header2 length:1];
[rdata appendBytes:&dataLen length:1];
[rdata appendBytes:&device1 length:1];
[rdata appendBytes:&device2 length:1];
[rdata appendBytes:&commtype length:1];
[rdata appendBytes:&cmdStatus length:1];
[rdata appendData:data];
int CRC16check = _OSSwapInt16(CRC_16_Check([rdata subdataWithRange:NSMakeRange(2, rdata.length-2)]));
[rdata appendBytes:&CRC16check length:2];
return rdata;
}
bool cmdWithData(NSData *inData,int *outValue, JFDeviceSendCommand *cmd){
if (inData.length< 10) {
return false;
}
int header1 = 0x55;
int header2 = 0xaa;
int dataLen = 0x00; //带计算
int device1 = 0x00;
int device2 = 0x1D;
int commtype = 0x31;
int cmdStatus = 0x02;
[inData getBytes:&header1 range:NSMakeRange(0, 1)];
[inData getBytes:&header2 range:NSMakeRange(1, 1)];
[inData getBytes:&dataLen range:NSMakeRange(2, 1)];
[inData getBytes:&device1 range:NSMakeRange(3, 1)];
[inData getBytes:&device2 range:NSMakeRange(4, 1)];
[inData getBytes:&commtype range:NSMakeRange(5, 1)];
[inData getBytes:&cmdStatus range:NSMakeRange(6, 1)];
NSInteger x = 0;
if (commtype == 0x33 &&
cmdStatus == 0x01) {
[inData getBytes:&x range:NSMakeRange(7, 1)];
[inData getBytes:outValue range:NSMakeRange(8, 1)];
}
if (commtype == 0x31) {
[inData getBytes:&x range:NSMakeRange(7, inData.length-7-2)];
}
switch (x) {
case 0x0006 :
{
*cmd = JFDeviceSendCommandLightsRG;
break;
}
case 0x0106 :
{
*cmd = JFDeviceSendCommandLightsJXPZ;
break;
}
case 0x0206 :
{
*cmd = JFDeviceSendCommandLightsPHPZ ;
break;
}
case 0x0306 :
{
*cmd = JFDeviceSendCommandLightsUV;
break;
}
case 0x0406 :
{
*cmd = JFDeviceSendCommandLightsOFF;
break;
}
case 0x05 :
{
*cmd = JFDeviceSendCommandLightsCurrent;
break;
}
case 0x04:
{
*cmd = JFDeviceSendCommandBatteryLevel;
break;
}
case 0x18 :
{
*cmd = JFDeviceSendCommandFirmwareVersion;
break;
}
case 0x07:
{
*cmd = JFDeviceRecvCommandPhotograph;
break;
}
case 0x03:
{
*cmd = JFDeviceRecvCommandCheckWaterOil;
break;
}
case 0x09:
{
*cmd = JFDeviceRecvCommandHaveWaterOil;
break;
}
case 0x0A:
{
*cmd = JFDeviceRecvCommandXiaoYanWaterOil;
break;
}
case 0x0B:
{
*cmd = JFDeviceRecvCommandXiaoYanHeightWaterOil;
break;
}
default:
break;
}
return true;
}
/*************************************************************************** CRC 校验步骤:
1、 设置 CRC 寄存器, 并给其赋值 FFFF(hex)
2、 将数据的第一个 8-bit 字符与 16 位 CRC 寄存器的低 8 位进行异或, 并把结果
存器
3、 CRC 寄存器向右移一位, MSB 补零, 移出并检查 LSB
4、 如果 LSB 为 0, 重复第三步; 若 LSB 为 1, CRC 寄存器与多项式码相异或
5、 重复第 3 与第 4 步直到 8 次移位全部完成。 此时一个 8-bit 数据处理完毕
6、 重复第 2 至第 5 步直到所有数据全部处理完成
7、 最终 CRC 寄存器的内容即为 CRC 值
8、 CRC(16 位)多项式为 X16+X15+X2+1,其对应校验二进制位列为 1 1000 0000 0000 0101 //函数名称: unsigned int CRC_16_Check(void)
//函数功能: CRC16 校验 ****************************************************************************/
unsigned int CRC_16_Check(NSData *databuf) //0x55 0xAA 0x06 0x00 0x1D 0x31 0x02 0x06 0x00
{
int len = (int)databuf.length; //字节长度
unsigned int CRC_index = 0xffff;
for(int i = 0; i < len; i++)
{
unsigned int buffer = 0; // i= 0 :0x55, i = 1 :0xaa
[databuf getBytes:&buffer range:NSMakeRange(i, 1)]; //取数据 存入 buffer 中
CRC_index ^= buffer; for(int j = 0; j < 8; j++) {
if(CRC_index & 0x0001)
{
CRC_index >>= 1;
CRC_index ^= 0xa001;
}
else {
CRC_index >>= 1;
}
}
}
return CRC_index; // 0x9E 0X3D
}
NSData *sendScanWIFI() {
return [@"<?xml version=\"1.0\" encoding=\"utf-8\"?><CMD_REQ code=1 index=1/>" dataUsingEncoding:NSUTF8StringEncoding];
}
NSData *sendSetWIFI(NSString *wifiName ,NSString *WifiPwd ) {
NSString *cmdString = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"utf-8\"?><CMD_REQ code=2 index=2><SSID>%@</SSID><PASSWORD>%@</PASSWORD></CMD_REQ>",wifiName,WifiPwd];
return [cmdString dataUsingEncoding:NSUTF8StringEncoding];
}
NSData *sendGetWIFIInfo() {
return [@"<?xml version=\"1.0\" encoding=\"utf-8\"?><CMD_REQ code=3 index=3/>" dataUsingEncoding:NSUTF8StringEncoding];
}
NSData *sendSetCameraFPS(int FPS) {
if (FPS < 10 || FPS > 25) {
FPS = 10;
}
NSString *cmdString = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"utf-8\"?><CMD_REQ code=4 index=4><FPS>%d</FPS></CMD_REQ>",FPS];
return [cmdString dataUsingEncoding:NSUTF8StringEncoding];
}
NSData *sendSetCameraResolutionRatio(NSString *rr) {
if (![@"640x480800x6001280x7201920x1080" containsString:rr]) {
rr = @"1280x720";
}
NSString *cmdString = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"utf-8\"?><CMD_REQ code=5 index=5><VGA>%@</VGA></CMD_REQ>",rr];
return [cmdString dataUsingEncoding:NSUTF8StringEncoding];
}
NSData *sendGetCameraInfo() {
return [@"<?xml version=\"1.0\" encoding=\"utf-8\"?><CMD_REQ code=6 index=6/>" dataUsingEncoding:NSUTF8StringEncoding];
}
@end
//
// DKSocket.h
// DKWF
//
// Created by nana on 2020/7/1.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface DKSocket : NSObject
@property(nonatomic, copy)void(^checkNetWorkBlock)(BOOL networkStaus);
+ (instancetype)share;
+ (instancetype)share1;
/// 心跳的数据
@property(nonatomic,strong)NSData *heartbeatData;
- (void)disconnect;
- (void)connectHost:(NSString *)host port:(uint16_t)port ;
- (void)sendData:(NSData *)data completeBlock:(void(^)(NSData *response))completeBlock;
@property(nonatomic, copy)void(^recvDataBlock)(NSData *rdata);
@end
NS_ASSUME_NONNULL_END
//
// DKSocket.m
// DKWF
//
// Created by nana on 2020/7/1.
//
#import "DKSocket.h"
#import <CocoaAsyncSocket/GCDAsyncSocket.h>
@interface DKSocket()<GCDAsyncSocketDelegate>
@property(nonatomic, strong)GCDAsyncSocket *tcpSocket;
@property(atomic, strong)NSLock *lock;
@property(nonatomic, strong)dispatch_queue_t sendMessageQueue;
@property(nonatomic, strong)dispatch_queue_t connectQueue;
@property(nonatomic, assign)NSTimeInterval lastReceiveImageTime;
@property(nonatomic, strong)dispatch_source_t gcdTimer;
@property(nonatomic, strong)NSString *host;
@property(nonatomic, assign)int port;
@property(nonatomic, assign)BOOL connectStatus;
@property(atomic, strong)void(^completeBlock)(NSData *response);
@property(nonatomic, strong)NSMutableData *recvData;
@property(nonatomic, assign)BOOL noConnect;
/// 第2次
@property(nonatomic, assign)BOOL doubleSend;
@end
@implementation DKSocket
- (instancetype)init {
if (self = [super init]) {
[self setup];
}
return self;
}
static DKSocket *info = nil;
static dispatch_once_t onceToken;
+(instancetype)share
{
dispatch_once(&onceToken, ^{
if (info==nil) {
info = [[DKSocket alloc] init] ;
}
});
return info ;
}
static DKSocket *cmdSocket = nil;
static dispatch_once_t onceToken1;
+(instancetype)share1
{
dispatch_once(&onceToken1, ^{
if (cmdSocket==nil) {
cmdSocket = [[DKSocket alloc] init] ;
}
});
return cmdSocket ;
}
- (void)setup {
self.noConnect = YES;
_recvData = [NSMutableData data];
_lock =[[NSLock alloc] init];
_sendMessageQueue = dispatch_queue_create("JF.SendMessage", DISPATCH_QUEUE_SERIAL);
_connectQueue = dispatch_queue_create("JF.TCPconnect", DISPATCH_QUEUE_SERIAL);
self.tcpSocket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:_connectQueue];
__weak typeof(self) weakSelf = self;
_gcdTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_global_queue(0, 0));
dispatch_source_set_timer(_gcdTimer, DISPATCH_TIME_NOW, 5.0 * NSEC_PER_SEC, 0.0 * NSEC_PER_SEC);
dispatch_source_set_event_handler(_gcdTimer, ^{
[weakSelf autoCheck];
});
dispatch_resume(_gcdTimer);
}
- (void)autoCheck {
if ( self.noConnect) {
return ;
}
if (self.connectStatus == NO) {
[self connectHost:self.host port:self.port];
}else {
if (self.heartbeatData) {
self.doubleSend = !self.doubleSend;
if (self.doubleSend) {
[self sendData:self.heartbeatData completeBlock:^(NSData * _Nonnull response) {
}];
}
}
}
}
- (void)disconnect {
self.noConnect = YES;
self.connectStatus = NO;
[self.tcpSocket setDelegate:nil delegateQueue:NULL];
[self.tcpSocket disconnect];
}
- (void)connectHost:(NSString *)host port:(uint16_t)port {
self.noConnect = NO;
self.host = host;
self.port = port;
[self.tcpSocket setDelegate:nil delegateQueue:NULL];
[self.tcpSocket disconnect];
[self.tcpSocket setDelegate:self delegateQueue:_connectQueue];
[self.tcpSocket connectToHost:host onPort:port withTimeout:2 error:nil];
}
- (void)sendData:(NSData *)data completeBlock:(void(^)(NSData *response))completeBlock {
if (self.connectStatus == NO || !data) {
if (completeBlock) {
completeBlock(nil);
}
return ;
}
__weak typeof(self) weakSelf = self;
dispatch_async(_sendMessageQueue, ^{
[weakSelf.lock lock];
dispatch_async(dispatch_get_main_queue(), ^{
[self performSelector:@selector(xxx) withObject:nil afterDelay:5];
});
weakSelf.completeBlock = completeBlock;
if (data) {
[weakSelf.tcpSocket writeData:data withTimeout:4 tag:0];
}
});
}
- (void)xxx {
if (self.completeBlock) {
self.completeBlock(nil);
self.completeBlock = nil;
[self.lock unlock];
}
}
-(void)dealloc {
NSLog(@"dealloc socket");
[self.tcpSocket setDelegate:nil delegateQueue:NULL];
[self.tcpSocket disconnect];
}
//已经连接到服务器
- (void)socket:(GCDAsyncSocket *)sock didConnectToHost:(nonnull NSString *)host port:(uint16_t)port{
NSLog(@"连接成功 : %@---%d",host,port);
self.connectStatus = YES;
__weak typeof(self) weakSelf = self;
dispatch_async(dispatch_get_main_queue(), ^{
if (weakSelf.checkNetWorkBlock) {
weakSelf.checkNetWorkBlock(YES);
}
});
[sock readDataWithTimeout:-1 tag:10086];
}
// 连接断开
- (void)socketDidDisconnect:(GCDAsyncSocket *)sock withError:(NSError *)err{
NSLog(@"断开 %d socket连接 原因:%@",self.port, err);
self.connectStatus = NO;
__weak typeof(self) weakSelf = self;
dispatch_async(dispatch_get_main_queue(), ^{
if (weakSelf.checkNetWorkBlock) {
weakSelf.checkNetWorkBlock(NO);
}
});
}
//已经接收服务器返回来的数据
- (void)socket:(GCDAsyncSocket *)sock didReadData:(NSData *)data withTag:(long)tag{
// NSLog(@"%d %ld",sock.connectedPort,data.length);
// NSLog(@"%d %@",sock.connectedPort,data);
__weak typeof(self) weakSelf = self;
dispatch_async(_sendMessageQueue, ^{
// NSLog(@"%d %ld",sock.connectedPort , data.length);
[weakSelf.recvData appendData:data];
if (weakSelf.recvData.length<10) {
[sock readDataWithTimeout:-1 tag:10086];
return ;
}
NSData *rData = [NSData dataWithData:weakSelf.recvData];
dispatch_async(dispatch_get_main_queue(), ^{
if (weakSelf.completeBlock) {
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(xxx) object:nil];
weakSelf.completeBlock(rData);
weakSelf.completeBlock = nil;
[weakSelf.lock unlock];
}
if (weakSelf.recvDataBlock) {
weakSelf.recvDataBlock(rData);
}
});
weakSelf.recvData = [NSMutableData data];
[sock readDataWithTimeout:-1 tag:10086];
});
}
@end
//
// DKWIFIVideoView.h
// Pods
//
// Created by nana on 2020/7/1.
//
#import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface DKWIFIVideoView : UIView
@property (nonatomic,strong)WKWebView *webView;
@property(nonatomic ,strong)NSString *videoUrl;
/// 抓图
-(UIImage *)captureImage;
@end
NS_ASSUME_NONNULL_END
//
// DKWIFIVideoView.m
// Pods
//
// Created by nana on 2020/7/1.
//
#import "DKWIFIVideoView.h"
@interface DKWIFIVideoView()<WKNavigationDelegate>
@property(nonatomic, assign)NSTimeInterval lastReceiveImageTime;
@property(nonatomic, strong)dispatch_source_t gcdTimer;
@end
@implementation DKWIFIVideoView
- (instancetype)init {
if (self = [super init]) {
self.webView = [[WKWebView alloc]init];
self.webView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
self.webView.navigationDelegate = self;
[self addSubview:self.webView];
self.layer.masksToBounds = YES;
@weakify(self);
_gcdTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_global_queue(0, 0));
dispatch_source_set_timer(_gcdTimer, DISPATCH_TIME_NOW, 2.0 * NSEC_PER_SEC, 0.0 * NSEC_PER_SEC);
dispatch_source_set_event_handler(_gcdTimer, ^{
@strongify(self);
NSTimeInterval nowTime = [[NSDate date] timeIntervalSince1970];
if (nowTime-self.lastReceiveImageTime > 5) {
dispatch_sync(dispatch_get_main_queue(), ^{
if (!self.videoUrl) {
self.videoUrl = @"http://192.168.168.1:8888/?action=stream";
}
NSURLRequest *req = [NSURLRequest requestWithURL:[NSURL URLWithString:self.videoUrl]];
[self.webView loadRequest:req];;
});
self.lastReceiveImageTime = nowTime;
}
});
dispatch_resume(_gcdTimer);
}
return self;
}
- (void)layoutSubviews {
[super layoutSubviews];
CGSize sSize = self.frame.size;
if (sSize.width > sSize.height) {
CGFloat h = sSize.width/1280*720;
self.webView.frame = CGRectMake(0,(sSize.height-h)/2,sSize.width,h);
}else {
CGFloat w = sSize.height/720*1280;
self.webView.frame = CGRectMake((sSize.width-w)/2,0,w, self.frame.size.height);
}
}
- (UIImage *)captureImage {
UIGraphicsBeginImageContextWithOptions(self.webView.bounds.size, self.opaque, 0);
[self.webView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *snap = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
CGRect irect = CGRectZero;
CGSize sSize = self.frame.size;
if (sSize.width > sSize.height) {
CGFloat h = sSize.width/1280*720;
irect = CGRectMake(0, (self.frame.size.width-h)/2, self.frame.size.width, self.frame.size.height);
}else {
CGFloat w = self.frame.size.height/720*1280;
irect = CGRectMake((w-self.frame.size.width)/2, 0, self.frame.size.width, self.frame.size.height);
}
return [self imageByCropToRect:irect image:snap];
}
- (UIImage *)imageByCropToRect:(CGRect)rect image:(UIImage *)image {
rect.origin.x *= image.scale;
rect.origin.y *= image.scale;
rect.size.width *= image.scale;
rect.size.height *= image.scale;
if (rect.size.width <= 0 || rect.size.height <= 0) return nil;
CGImageRef imageRef = CGImageCreateWithImageInRect(image.CGImage, rect);
UIImage *rimage = [UIImage imageWithCGImage:imageRef scale:image.scale orientation:image.imageOrientation];
CGImageRelease(imageRef);
return rimage;
}
- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler{
decisionHandler(WKNavigationResponsePolicyAllow);
self.lastReceiveImageTime = [[NSDate date] timeIntervalSince1970];
}
@end
//
// JFBaseModel.h
// JFFD
//
// Created by nana on 2020/1/2.
// Copyright © 2020 idankee. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface JFBaseModel : NSObject
@end
NS_ASSUME_NONNULL_END
//
// JFBaseModel.m
// JFFD
//
// Created by nana on 2020/1/2.
// Copyright © 2020 idankee. All rights reserved.
//
#import "JFBaseModel.h"
#import <objc/runtime.h>
@implementation JFBaseModel
+(NSDictionary *)mj_replacedKeyFromPropertyName {
return @{@"ID" : @"id"};
}
- (instancetype)init {
if (self = [super init]) {
unsigned int count;// 记录属性个数
Ivar *ivarList = class_copyIvarList([self class], &count);
for (int i = 0; i < count; i++) {
Ivar ivar = ivarList[i];
NSString *type = [NSString stringWithUTF8String:ivar_getTypeEncoding(ivar)];
NSString *name = [NSString stringWithUTF8String:ivar_getName(ivar)];
if (type.length <2) {
[self setValue:@0 forKey:name];
}else {
type = [type stringByReplacingOccurrencesOfString:@"@" withString:@""];
type = [type stringByReplacingOccurrencesOfString:@"\"" withString:@""];
[self setValue:[[NSClassFromString(type) alloc] init] forKey:name];
}
}
free(ivarList);
}
return self;
}
#ifdef DEBUG
- (NSString *)description {
NSMutableString* text = [NSMutableString stringWithFormat:@"\n<%@>\n", [self class]];
NSArray* properties = [self filterPropertys];
[properties enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
NSString* key = (NSString*)obj;
id value = [self valueForKey:key];
NSString* valueDescription = (value)?[value description]:@"(null)";
valueDescription = [valueDescription stringByReplacingOccurrencesOfString:@"\n" withString:@"\n "];
[text appendFormat:@" [%@][%@]: %@ \n", key,[value class], valueDescription];
}];
[text appendFormat:@"</%@>", [self class]];;
return text;
}
- (NSArray *)filterPropertys
{
NSMutableArray* props = [NSMutableArray array];
unsigned int count;
objc_property_t *properties = class_copyPropertyList([self class], &count);
for(int i = 0; i < count; i++)
{
objc_property_t property = properties[i];
const char* char_f =property_getName(property);
NSString *propertyName = [NSString stringWithUTF8String:char_f];
[props addObject:propertyName];
}
free(properties);
return props;
}
#endif
@end
//
// JFresponseModel.h
// MoistureOil
//
// Created by nana on 2020/4/1.
// Copyright © 2020 idankee. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "JFBaseModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface JFResponsePageModel : JFBaseModel
@property(nonatomic, strong)NSString *allCounts;
@property(nonatomic, strong)NSString *allPages;
@property(nonatomic, strong)NSString *currPage;
@property(nonatomic, strong)NSString *nextPage;
@property(nonatomic, strong)NSString *pageSize;
@property(nonatomic, strong)NSString *prevPage;
@property(nonatomic, strong)NSString *currentPage;
@property(nonatomic, strong)NSString *totalPage;
@property(nonatomic, strong)NSString *totalCount;
@end
@interface JFResponseMsgModel : JFBaseModel
@property(nonatomic, strong)NSString *returnCode;
@property(nonatomic, strong)NSString *returnMsg;
@end
@interface JFResponseModel : JFBaseModel
@property(nonatomic, strong)JFResponseMsgModel *msg;
@property(nonatomic, strong)NSString *MSG;
@property(nonatomic, strong)JFResponsePageModel *page;
@property(nonatomic, strong)NSObject *records;
@property(nonatomic, strong)NSObject *data;
@property(nonatomic, strong)NSString *code;
@end
NS_ASSUME_NONNULL_END
//
// JFresponseModel.m
// MoistureOil
//
// Created by nana on 2020/4/1.
// Copyright © 2020 idankee. All rights reserved.
//
#import "JFResponseModel.h"
@implementation JFResponsePageModel
@end
@implementation JFResponseMsgModel
@end
@implementation JFResponseModel
+(NSDictionary *)mj_replacedKeyFromPropertyName {
return @{@"MSG" : @"msg"};
}
- (void)setData:(NSObject *)data {
if (!_records) {
_records = data;
}
_data = data;
}
- (void)setRecords:(NSObject *)records {
if (!_data) {
_data =records;
}
_records = records;
}
- (void)setMsg:(JFResponseMsgModel *)msg {
_msg = msg;
_MSG = msg.returnMsg;
_code = msg.returnCode;
}
- (void)setMSG:(NSString *)MSG {
if (!_msg) {
_msg = [JFResponseMsgModel new];
}
_MSG = MSG;
_msg.returnMsg = MSG;
}
- (void)setCode:(NSString *)code {
if (!_msg) {
_msg = [JFResponseMsgModel new];
}
_code = code;
_msg.returnCode = code;
}
@end
//
// DKAutoUploadTool.h
// DKCamera_Example
//
// Created by nana on 2020/9/26.
// Copyright © 2020 304635659@qq.com. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface MMAutoUploadTool : NSObject
@property(nonatomic, strong)NSString *endPoint;
@property(nonatomic, strong)NSString *AccessKey;
@property(nonatomic, strong)NSString *SecretKey;
@property(nonatomic, strong)NSString *BucketName;
@property(nonatomic, strong)NSString *lonlat;
- (NSString *)domain;
/// 单例
+ (instancetype)sharedManager ;
- (void)setupDKEnvironmen;
@property(nonatomic, strong)void(^timeblock)(void(^inBlock)(NSString * keyString,NSData *bufData ,void(^outBlock)(NSString *urlString)));
@end
NS_ASSUME_NONNULL_END
//
// MMAutoUploadTool.m
// DKCamera_Example
//
// Created by nana on 2020/9/26.
// Copyright © 2020 304635659@qq.com. All rights reserved.
//
#import "MMAutoUploadTool.h"
#import <AliyunOSSiOS/AliyunOSSiOS.h>
@interface MMAutoUploadTool()
@property (nonatomic,strong)dispatch_queue_t dkQueue;
@property (nonatomic,strong)dispatch_source_t dktimer;
@end
@implementation MMAutoUploadTool
+ (instancetype)sharedManager {
static MMAutoUploadTool *sharedManager = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedManager = [[MMAutoUploadTool alloc] init];
});
return sharedManager;
}
- (void)setupDKEnvironmen {
__weak __typeof__(self) weakSelf = self;
dispatch_queue_t queue = dispatch_queue_create("com.idankee.DKAutoUpdateDataTool", DISPATCH_QUEUE_SERIAL);
dispatch_source_t timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue);
dispatch_source_set_timer(timer, DISPATCH_TIME_NOW, 5 * NSEC_PER_SEC, 0 * NSEC_PER_SEC);
dispatch_source_set_event_handler(timer, ^{
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf taskData];
});
dispatch_resume(timer);
self.dktimer = timer;
}
- (void)taskData {
if (self.timeblock) {
__weak __typeof__(self) weakSelf = self;
self.timeblock(^(NSString *objectKey,NSData *imageData, void (^ c1Block)(NSString * i2)) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
NSString *endpoints = strongSelf.endPoint;
OSSCustomSignerCredentialProvider *provider = [[OSSCustomSignerCredentialProvider alloc] initWithImplementedSigner:^NSString *(NSString *contentToSign, NSError *__autoreleasing *error) {
// 用户应该在此处将需要签名的字符串发送到自己的业务服务器(AK和SK都在业务服务器保存中,从业务服务器获取签名后的字符串)
OSSFederationToken *token = [OSSFederationToken new];
token.tAccessKey =strongSelf.AccessKey;
token.tSecretKey =strongSelf.SecretKey;
NSString *signedContent = [OSSUtil sign:contentToSign withToken:token];
return signedContent;
}];
OSSClient * client = [[OSSClient alloc] initWithEndpoint:endpoints credentialProvider:provider];
OSSPutObjectRequest * put = [OSSPutObjectRequest new];
// required fields
put.bucketName = strongSelf.BucketName;
// NSString *objectKeys = [NSString stringWithFormat:@"User/%@.jpg",[self getNowTimeTimestamp]];
put.objectKey = objectKey;
//put.uploadingFileURL = [NSURL fileURLWithPath:fullPath];
put.uploadingData = imageData;
// put.uploadProgress = ^(int64_t bytesSent, int64_t totalByteSent, int64_t totalBytesExpectedToSend) {
// NSLog(@"%lld, %lld, %lld", bytesSent, totalByteSent, totalBytesExpectedToSend);
// };
OSSTask * putTask = [client putObject:put];
[putTask continueWithBlock:^id(OSSTask *task) {
task = [client presignPublicURLWithBucketName:strongSelf.BucketName
withObjectKey:objectKey];
NSError * error = nil;
BOOL isExist = [client doesObjectExistInBucket:strongSelf.BucketName objectKey:objectKey error:&error];
if (!isExist) {
[NSThread sleepForTimeInterval:20.0];
}
// dispatch_async(dispatch_get_main_queue(), ^{
if (isExist) {
c1Block([NSString stringWithFormat:@"%@/%@",[strongSelf domain],objectKey]);
} else {
c1Block(nil);
}
// });
return nil;
}];
[putTask waitUntilFinished];
});
}
}
- (NSString *)domain {
int index = 0;
NSMutableString *urlString = [[NSMutableString alloc] initWithString:self.endPoint];
if ([urlString hasPrefix:@"https://"]) {
index = 8;
}else if([urlString hasPrefix:@"http://"]){
index = 7;
}
[urlString insertString:[NSString stringWithFormat:@"%@.",self.BucketName] atIndex:index];
return urlString;
}
@end
//
// MMLocalDataBManager.h
// Hello
//
// Created by nana on 2020/9/15.
// Copyright © 2020 nana. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface MMLocalDataBManager : NSObject
/// 单利
+ (instancetype)sharedManager ;
/// objectKey updataData 必须填写, ID为必须唯一
- (BOOL)addWithID:(NSInteger)ID objectKey:(NSString *)objectKey updateData:(NSData *)updataData infoDict:(NSDictionary *)infoDict;
/// objectKey updataData 必须填写, ID为必须唯一
- (BOOL)addWithObjectKey:(NSString *)objectKey updateData:(NSData *)updataData infoDict:(NSDictionary *)infoDict;
///objectKey updataData 必须填写, ID为 自增加
- (BOOL)addWithObjectKey:(NSString *)objectKey updateData:(NSData *)updataData;
/// 删除
- (BOOL)deleteWithID:(NSInteger)ID;
/// 查询
- (NSArray *)seleteWithID:(NSInteger)ID;
/// 查询 大于ID的前几条数据
- (NSArray *)seleteWithGreaterThanOrEqualTo:(NSInteger)ID limit:(NSInteger)limit;
/// 查询 包含objectKey 的前几条数据
- (NSArray *)selectWithLikeObjectKey:(NSString *)objectKey limit:(NSInteger)limit;
@end
NS_ASSUME_NONNULL_END
//
// MMLocalDataBManager.m
// Hello
//
// Created by nana on 2020/9/15.
// Copyright © 2020 nana. All rights reserved.
//
#import "MMLocalDataBManager.h"
#import <FMDB/FMDB.h>
@interface MMLocalDataBManager()
@property(nonatomic, strong)FMDatabaseQueue *dbQueue;
@property(nonatomic, strong)NSString *dbName;
@end
@implementation MMLocalDataBManager
+ (instancetype)sharedManager {
static MMLocalDataBManager *sharedManager = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedManager = [[MMLocalDataBManager alloc] init];
});
return sharedManager;
}
- (instancetype)init {
if (self = [super init]) {
[self setup];
}
return self;
}
- (void)setup {
NSString *fileName = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES) lastObject] stringByAppendingPathComponent:@"MMAutoUpdateDataTool.sqlite"];
NSLog(@"dbPath = %@",fileName);
//创建数据库
self.dbQueue = [FMDatabaseQueue databaseQueueWithPath:fileName];
// self.dbQueue = [FMDatabaseQueue databaseQueueWithPath:@"/Users/nana/Desktop/wb.db"];
[self.dbQueue inDatabase:^(FMDatabase * _Nonnull db) {
[db executeUpdate:@"CREATE TABLE IF NOT EXISTS t_img (id integer PRIMARY KEY AUTOINCREMENT ,objectKey text,dataBlob blob, infoBlob blob)"];
}];
}
/// 要上传的二进制 , 备注信息 ,该条记录的唯一标识符
- (BOOL)addWithID:(NSInteger)ID objectKey:(NSString *)objectKey updateData:(NSData *)updataData infoDict:(NSDictionary *)infoDict {
if (!updataData || !objectKey) {
return NO;
}
if (!infoDict) {
infoDict = @{};
}
__block BOOL insertState = NO;
NSData *infoDictData = [NSJSONSerialization dataWithJSONObject:infoDict options:NSJSONWritingPrettyPrinted error:nil];
[self.dbQueue inDatabase:^(FMDatabase * _Nonnull db) {
// if (ID) {
insertState = [db executeUpdateWithFormat:@"insert into t_img(id,objectKey, dataBlob,infoBlob) values(%ld,%@,%@,%@)",ID,objectKey,updataData,infoDictData];
// }else {
// insertState = [db executeUpdateWithFormat:@"insert into t_img(objectKey,dataBlob,infoBlob) values(%@,%@,%@)",objectKey,updataData,infoDictData];
// }
// NSLog(@"插入");
}];
// NSLog(@"返回");
return insertState;
}
- (BOOL)addWithObjectKey:(NSString *)objectKey updateData:(NSData *)updataData infoDict:(NSDictionary *)infoDict {
if (!updataData || !objectKey) {
return NO;
}
if (!infoDict) {
infoDict = @{};
}
__block BOOL insertState = NO;
NSData *infoDictData = [NSJSONSerialization dataWithJSONObject:infoDict options:NSJSONWritingPrettyPrinted error:nil];
[self.dbQueue inDatabase:^(FMDatabase * _Nonnull db) {
insertState = [db executeUpdateWithFormat:@"insert into t_img(objectKey, dataBlob,infoBlob) values(%@,%@,%@)",objectKey,updataData,infoDictData];
}];
return insertState;
}
- (BOOL)addWithObjectKey:(NSString *)objectKey updateData:(NSData *)updataData {
if (!updataData || !objectKey) {
return NO;
}
__block BOOL insertState = NO;
[self.dbQueue inDatabase:^(FMDatabase * _Nonnull db) {
insertState = [db executeUpdateWithFormat:@"insert into t_img(objectKey,dataBlob) values(%@,%@)",objectKey,updataData];
// NSLog(@"插入");
}];
// NSLog(@"返回");
return insertState;
}
- (BOOL)deleteWithID:(NSInteger)ID {
if (!ID) {
return NO;
}
__block BOOL insertState = NO;
[self.dbQueue inDatabase:^(FMDatabase * _Nonnull db) {
insertState = [db executeUpdateWithFormat:@"DELETE FROM t_img WHERE ID = %ld",ID];
// NSLog(@"删除");
}];
// NSLog(@"返回");
return insertState;
}
/// 查询
- (NSArray *)seleteWithID:(NSInteger)ID {
NSMutableArray *reArray = [[NSMutableArray alloc] init];
[self.dbQueue inDatabase:^(FMDatabase * _Nonnull db) {
FMResultSet *rs = [db executeQueryWithFormat:@"SELECT * FROM t_img WHERE ID = %ld",ID];
[reArray addObjectsFromArray:[self arrayFromSet:rs]];
}];
return reArray;
}
/// 查询 大于ID的前几条数据
- (NSArray *)seleteWithGreaterThanOrEqualTo:(NSInteger)ID limit:(NSInteger)limit {
NSMutableArray *reArray = [[NSMutableArray alloc] init];
[self.dbQueue inDatabase:^(FMDatabase * _Nonnull db) {
FMResultSet *rs = [db executeQueryWithFormat:@"SELECT * FROM t_img WHERE ID >= %ld LIMIT %ld",ID ,limit];
[reArray addObjectsFromArray:[self arrayFromSet:rs]];
}];
return reArray;
}
/// 查询 包含objectKey 的前几条数据
- (NSArray *)selectWithLikeObjectKey:(NSString *)objectKey limit:(NSInteger)limit {
NSMutableArray *reArray = [[NSMutableArray alloc] init];
[self.dbQueue inDatabase:^(FMDatabase * _Nonnull db) {
FMResultSet *rs = [db executeQueryWithFormat:@"SELECT * FROM t_img WHERE objectKey LIKE '%%%@%%' LIMIT %ld",objectKey ,limit];
[reArray addObjectsFromArray:[self arrayFromSet:rs]];
}];
return reArray;
}
- (NSMutableArray *)arrayFromSet:(FMResultSet *)rs {
NSMutableArray *reArray = [[NSMutableArray alloc] init];
while (rs.next) {
NSString *ID = [rs stringForColumn:@"ID"];
NSString *objectKey = [rs stringForColumn:@"objectKey"];
NSData *dataBlob = [rs dataForColumn:@"dataBlob"];
NSData *infoBlobData = [rs dataForColumn:@"infoBlob"];
NSDictionary *infoBlob = nil;
if (infoBlobData) {
infoBlob = [NSJSONSerialization JSONObjectWithData:infoBlobData options:NSJSONReadingFragmentsAllowed error:nil];
}else {
infoBlob = @{};
}
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
dict[@"ID"] = ID;
dict[@"objectKey"] = objectKey;
dict[@"updateData"] = dataBlob;
dict[@"infoDict"] = infoBlob;
[reArray addObject:dict];
}
return reArray;
}
@end
//
// MTRAreaPickView.h
// Metis
//
// Created by wb on 2019/9/26.
// Copyright © 2019 曾凌坤. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface MTRAreaPickView : UIView
@property(nonatomic, copy)void (^selectCityBlock)(NSInteger province, NSInteger city, NSInteger district,NSString *resultStr);
- (void)show;
- (void)dismiss;
@end
NS_ASSUME_NONNULL_END
//
// MTRAreaPickView.m
// Metis
//
// Created by wb on 2019/9/26.
// Copyright © 2019 曾凌坤. All rights reserved.
//
#import "MTRAreaPickView.h"
#import "MTRegisterAreaModel.h"
#import <MJExtension/MJExtension.h>
@interface MTRAreaPickView()<UIPickerViewDataSource,UIPickerViewDelegate>
@property(nonatomic, strong)UIPickerView *areaView;
@property(nonatomic, strong)NSArray<MTRegisterAreaModel *> *dataArray;
/// 省份选择 记录
@property (nonatomic,assign) NSInteger provinceIndex;
/// 市选择 记录
@property (nonatomic,assign) NSInteger cityIndex;
/// 区选择 记录
@property (nonatomic,assign) NSInteger districtIndex;
@end
@implementation MTRAreaPickView
- (instancetype)init {
if (self = [super init]) {
[self setupUI];
[self loadData];
}
return self;
}
- (void)loadData {
@weakify(self);
static NSArray *dataArray;
if (dataArray) {
self.dataArray = dataArray;
[self.areaView reloadAllComponents];
return ;
}
[self postFormDataWithUrl:@"/magnifier/member/findArea" params:nil success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
@strongify(self);
if ([JsonData.data isKindOfClass:[NSArray class]]) {
self.dataArray = [MTRegisterAreaModel mj_objectArrayWithKeyValuesArray:JsonData.data];
dataArray = self.dataArray;
[self.areaView reloadAllComponents];
}
}];
// [DKNetworkTools post:@"publicAuth/findArea" params:@{}.mutableCopy networkHUD:0 target:self success:^(DKStatusModel *jsonData) {
// @strongify(self);
// if ([jsonData.records isKindOfClass:[NSArray class]]) {
// self.dataArray = [MTRegisterAreaModel mj_objectArrayWithKeyValuesArray:jsonData.records];
// [self.areaView reloadAllComponents];
// }
// } failure:^(NSError *error) {
//
// }];
}
- (void)setupUI {
self.backgroundColor =rgba(0, 0, 0, 0.34);
UIControl *ctl = [[UIControl alloc] init];
[ctl addTarget:self action:@selector(dismiss) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:ctl];
[ctl mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.bottom.right.mas_equalTo(0);
}];
self.areaView = [[UIPickerView alloc] init];
self.areaView.dataSource =self;
self.areaView.delegate = self;
self.areaView.backgroundColor =[UIColor whiteColor];
[self addSubview:self.areaView];
[self.areaView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.bottom.right.mas_equalTo(0);
make.height.mas_equalTo(240);
}];
UIView *bgView = [[UIView alloc] init];
bgView.backgroundColor =[UIColor whiteColor];
[self addSubview:bgView];
[bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(0);
make.height.mas_equalTo(40);
make.bottom.equalTo(self.areaView.mas_top);
}];
UIButton *cancelBtn = [[UIButton alloc] init];
// [cancelBtn setTitle: (@"取消") textColor:[UIColor whiteColor] font:kFontSize(14) forState:UIControlStateNormal];
[cancelBtn setAttributedTitle:createAttString(@"取消", 14, [UIColor blackColor]) forState:UIControlStateNormal];
[cancelBtn addTarget:self action:@selector(cancelBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:cancelBtn];
[cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(0);
make.bottom.equalTo(self.areaView.mas_top);
make.size.mas_equalTo(CGSizeMake(60, 40));
}];
UIButton *saveBtn = [[UIButton alloc] init];
[saveBtn setAttributedTitle:createAttString(@"完成", 14, [UIColor blackColor]) forState:UIControlStateNormal];
[saveBtn addTarget:self action:@selector(saveBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:saveBtn];
[saveBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(0);
make.bottom.equalTo(self.areaView.mas_top);
make.size.mas_equalTo(CGSizeMake(60, 40));
}];
UIView *lineView = [[UIView alloc] init];
lineView.backgroundColor = [UIColor blackColor];
[self.areaView addSubview:lineView];
[lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.mas_equalTo(0);
make.height.mas_equalTo(0.5);
// make.top.equalTo(lineView.mas_bottom);
}];
}
- (void)cancelBtnClick:(UIButton *)btn {
[self dismiss];
}
- (void)saveBtnClick:(UIButton *)btn {
if (self.selectCityBlock) {
NSString * address = @"";
NSString *fristName = @"";
if (_provinceIndex > 1) {
fristName = self.dataArray.count > _provinceIndex ? self.dataArray[_provinceIndex].name : @"";
}
address = [NSString stringWithFormat:@"%@%@%@",fristName, self.dataArray.count > _provinceIndex && self.dataArray[_provinceIndex].childs.count > _cityIndex ? self.dataArray[_provinceIndex].childs[_cityIndex].name : @"",self.dataArray.count > _provinceIndex && self.dataArray[_provinceIndex].childs.count > _cityIndex && self.dataArray[_provinceIndex].childs[_cityIndex].childs.count > _districtIndex ? self.dataArray[_provinceIndex].childs[_cityIndex].childs[_districtIndex].name : @""];
self.selectCityBlock(self.dataArray.count > _provinceIndex ? self.dataArray[_provinceIndex].ID : 0, self.dataArray.count > _provinceIndex && self.dataArray[_provinceIndex].childs.count > _cityIndex ? self.dataArray[_provinceIndex].childs[_cityIndex].ID : 0, self.dataArray.count > _provinceIndex && self.dataArray[_provinceIndex].childs.count > _cityIndex && self.dataArray[_provinceIndex].childs[_cityIndex].childs.count ? self.dataArray[_provinceIndex].childs[_cityIndex].childs[_districtIndex].ID : 0,address);
}
[self dismiss];
}
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
return 3;
}
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
if(component == 0){
return self.dataArray.count;
}
else if (component == 1){
return self.dataArray[_provinceIndex].childs.count;
}
else{
return self.dataArray[_provinceIndex].childs[_cityIndex].childs.count;
}
}
- (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component {
return self.bounds.size.width /3;
}
// 返回每一行的内容
-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
[pickerView setValue:[UIColor blackColor] forKey:@"textColor"];
if(component == 0){
return self.dataArray[row].name;
}
else if (component == 1){
return self.dataArray[_provinceIndex].childs[row].name;
}
else{
return self.dataArray[_provinceIndex].childs[_cityIndex].childs[row].name;
}
}
// 滑动或点击选择,确认pickerView选中结果
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
if(component == 0){
_provinceIndex = row;
_cityIndex = 0;
_districtIndex = 0;
[self.areaView reloadAllComponents];
}
else if (component == 1){
_cityIndex = row;
_districtIndex = 0;
[self.areaView reloadAllComponents];
}
else{
_districtIndex = row;
}
// 重置当前选中项
[self resetPickerSelectRow];
}
-(void)resetPickerSelectRow
{
[self.areaView selectRow:_provinceIndex inComponent:0 animated:YES];
[self.areaView selectRow:_cityIndex inComponent:1 animated:YES];
[self.areaView selectRow:_districtIndex inComponent:2 animated:YES];
}
- (void)show {
if (self.dataArray == nil) {
[self loadData];
}
UIWindow *wind = [UIApplication sharedApplication].keyWindow;
self.frame = wind.bounds;
[wind addSubview:self];
}
- (void)dismiss {
[self removeFromSuperview];
}
@end
//
// MTRegisterAreaModel.h
// Metis
//
// Created by wb on 2019/9/25.
// Copyright © 2019 曾凌坤. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface MTRegisterAreaModel : NSObject
@property (nonatomic,strong) NSMutableArray<MTRegisterAreaModel *> *childs;
/// 名称
@property (nonatomic,copy) NSString *name;
/// 名称
@property (nonatomic,assign)NSInteger ID;
@end
NS_ASSUME_NONNULL_END
//
// MTRegisterAreaModel.m
// Metis
//
// Created by wb on 2019/9/25.
// Copyright © 2019 曾凌坤. All rights reserved.
//
#import "MTRegisterAreaModel.h"
@implementation MTRegisterAreaModel
+ (NSDictionary *)mj_objectClassInArray
{
return @{@"childs": @"MTRegisterAreaModel"};
}
+(NSDictionary *)mj_replacedKeyFromPropertyName {
return @{@"ID": @"id"};
}
@end
//
// RippleView.h
// RippleAnimationView
//
// Created by fitloft on 2018/9/12.
// Copyright © 2018年 Nick. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface RippleView : UIView
/**
扩散波纹的颜色,自动渐变淡化 默认为黄色
*/
@property (nonatomic, strong) UIColor * rippleColor;
/**
扩散的倍数(放大的倍数) 默认为3
*/
@property (nonatomic, assign) CGFloat scaleTimes;
/**
单次扩散的动画时长 默认2.5s
*/
@property (nonatomic, assign) CFTimeInterval singleRippleDuration;
- (instancetype )initWithFrame:(CGRect)frame;
- (void)startAnimation;
- (void)stopAnimation;
/**
出现动画
*/
- (void)startRipplrWithShowAnimation;
/**
消失动画
*/
- (void)stopRippleWithHiddenAnimation;
@end
//
// RippleView.m
// RippleAnimationView
//
// Created by fitloft on 2018/9/12.
// Copyright © 2018年 Nick. All rights reserved.
//
#import "RippleView.h"
#define ColorWithAlpha(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
@interface RippleView ()<CAAnimationDelegate>
@property (nonatomic, strong) CALayer * rippleLayer1;
@property (nonatomic, strong) CALayer * rippleLayer2;
@property (nonatomic, strong) CALayer * rippleLayer3;
@end
@implementation RippleView
- (instancetype )initWithFrame:(CGRect)frame
{
if (self = [super initWithFrame:frame]) {
self.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0];
self.layer.masksToBounds = NO;
self.clipsToBounds = NO;
[self addAnimationLayer];
}
return self;
}
- (void)removeFromSuperview {
[super removeFromSuperview];
[self.layer.sublayers makeObjectsPerformSelector:@selector(removeFromSuperlayer)];
}
- (void)addAnimationLayer {
CGFloat width = self.frame.size.width - 2;
_rippleLayer1 = [CALayer layer];
_rippleLayer1.frame = CGRectMake((self.frame.size.width -width)/2, (self.frame.size.width -width)/2, width, width);
_rippleLayer1.cornerRadius = width/2;
_rippleLayer1.borderColor = self.rippleColor?self.rippleColor.CGColor:ColorWithAlpha(80, 184, 214, 0.5).CGColor;
_rippleLayer1.borderWidth = 0.5;
[self.layer addSublayer:_rippleLayer1];
_rippleLayer2 = [CALayer layer];
_rippleLayer2.frame = CGRectMake((self.frame.size.width -width)/2, (self.frame.size.width -width)/2, width, width);
_rippleLayer2.cornerRadius = width/2;
_rippleLayer2.borderColor = self.rippleColor?self.rippleColor.CGColor:ColorWithAlpha(80, 184, 214, 0.5).CGColor;
_rippleLayer2.borderWidth = 0.5;
[self.layer addSublayer:_rippleLayer2];
_rippleLayer3 = [CALayer layer];
_rippleLayer3.frame = CGRectMake((self.frame.size.width -width)/2, (self.frame.size.width -width)/2, width, width);
_rippleLayer3.cornerRadius = width/2;
_rippleLayer3.borderColor = self.rippleColor?self.rippleColor.CGColor:ColorWithAlpha(80, 184, 214, 0.5).CGColor;
_rippleLayer3.borderWidth = 0.5;
[self.layer addSublayer:_rippleLayer3];
_rippleLayer1.hidden = YES;
_rippleLayer2.hidden = YES;
_rippleLayer3.hidden = YES;
}
//修改的可能有问题
- (void)layoutSubviews {
[super layoutSubviews];
CGFloat width = self.frame.size.width - 2;
_rippleLayer1.frame = CGRectMake((self.frame.size.width -width)/2, (self.frame.size.width -width)/2, width, width);
_rippleLayer2.frame = CGRectMake((self.frame.size.width -width)/2, (self.frame.size.width -width)/2, width, width);
_rippleLayer3.frame = CGRectMake((self.frame.size.width -width)/2, (self.frame.size.width -width)/2, width, width);
_rippleLayer1.cornerRadius = width/2;
_rippleLayer2.cornerRadius = width/2;
_rippleLayer3.cornerRadius = width/2;
}
- (void)setRippleColor:(UIColor *)rippleColor{
_rippleColor = rippleColor;
_rippleLayer1.borderColor = _rippleColor.CGColor;
_rippleLayer2.borderColor = _rippleColor.CGColor;
_rippleLayer3.borderColor = _rippleColor.CGColor;
}
- (void)startAnimation {
if (!_rippleLayer1) {
[self addAnimationLayer];
}
_rippleLayer1.hidden = NO;
_rippleLayer2.hidden = NO;
_rippleLayer3.hidden = NO;
[_rippleLayer1 addAnimation:[self rippleAnimationGroupWithIndex:0] forKey:@"ripple"];
[_rippleLayer2 addAnimation:[self rippleAnimationGroupWithIndex:1] forKey:@"ripple"];
[_rippleLayer3 addAnimation:[self rippleAnimationGroupWithIndex:2] forKey:@"ripple"];
}
- (void)startRipplrWithShowAnimation{
self.hidden = NO;
[self startAnimation];
// [self show];
// [self performSelector:@selector(startAnimation) withObject:nil afterDelay:0.4];
}
- (void)stopAnimation{
_rippleLayer1.hidden = YES;
_rippleLayer2.hidden = YES;
_rippleLayer3.hidden = YES;
[_rippleLayer1 removeAllAnimations];
[_rippleLayer2 removeAllAnimations];
[_rippleLayer3 removeAllAnimations];
}
- (void)stopRippleWithHiddenAnimation{
// [self hiddenAnimation];
// [self performSelector:@selector(stopAnimation) withObject:nil afterDelay:0.3];
[self stopAnimation];
self.hidden = YES;
}
- (CAAnimationGroup *)rippleAnimationGroupWithIndex:(NSInteger )index{
NSArray * animateArr = @[[self scaleAnimate] , [self gradualAnimate] , [self borderColorAnimate]];
CAAnimationGroup * group = [CAAnimationGroup animation];
group.animations = animateArr;
group.beginTime = CACurrentMediaTime() + (double)index * 0.5;
group.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault];
group.duration = self.singleRippleDuration>0?self.singleRippleDuration:2.5;
group.repeatCount = HUGE;
group.removedOnCompletion = NO;
return group;
}
- (CABasicAnimation *)scaleAnimate{
CABasicAnimation * scaleAnimate = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
scaleAnimate.repeatCount = HUGE;
scaleAnimate.fromValue = @(1.0);
scaleAnimate.toValue = self.scaleTimes?@(self.scaleTimes):@(2.0);
return scaleAnimate;
}
- (CAKeyframeAnimation *)gradualAnimate{
CAKeyframeAnimation * animate = [CAKeyframeAnimation animation];
animate.keyPath = @"backgroundColor";
animate.values = @[(__bridge id) [self.rippleColor colorWithAlphaComponent:0.5].CGColor ? (__bridge id) [self.rippleColor colorWithAlphaComponent:0.5].CGColor : (__bridge id)ColorWithAlpha(80, 184, 214, 0.5).CGColor,
(__bridge id) [self.rippleColor colorWithAlphaComponent:0.4].CGColor ? (__bridge id) [self.rippleColor colorWithAlphaComponent:0.4].CGColor : (__bridge id)ColorWithAlpha(80, 184, 214,0.4).CGColor,
(__bridge id) [self.rippleColor colorWithAlphaComponent:0.2].CGColor ? (__bridge id) [self.rippleColor colorWithAlphaComponent:0.2].CGColor : (__bridge id)ColorWithAlpha(80, 184, 214, 0.2).CGColor,
(__bridge id) [self.rippleColor colorWithAlphaComponent:0].CGColor ? (__bridge id) [self.rippleColor colorWithAlphaComponent:0].CGColor : (__bridge id)ColorWithAlpha(80, 184, 214, 0).CGColor
];
animate.keyTimes = @[@0.3,@0.6,@0.9,@1];
return animate;
}
- (CAKeyframeAnimation *)borderColorAnimate{
CAKeyframeAnimation * animate = [CAKeyframeAnimation animation];
animate.keyPath = @"borderColor";
animate.values = @[(__bridge id) [self.rippleColor colorWithAlphaComponent:0.5].CGColor ? (__bridge id) [self.rippleColor colorWithAlphaComponent:0.5].CGColor : (__bridge id)ColorWithAlpha(80, 184, 214, 0.5).CGColor,
(__bridge id) [self.rippleColor colorWithAlphaComponent:0.4].CGColor ? (__bridge id) [self.rippleColor colorWithAlphaComponent:0.4].CGColor : (__bridge id)ColorWithAlpha(80, 184, 214,0.4).CGColor,
(__bridge id) [self.rippleColor colorWithAlphaComponent:0.2].CGColor ? (__bridge id) [self.rippleColor colorWithAlphaComponent:0.2].CGColor : (__bridge id)ColorWithAlpha(80, 184, 214, 0.2).CGColor,
(__bridge id) [self.rippleColor colorWithAlphaComponent:0].CGColor ? (__bridge id) [self.rippleColor colorWithAlphaComponent:0].CGColor : (__bridge id)ColorWithAlpha(80, 184, 214, 0).CGColor
];
animate.keyTimes = @[@0.3,@0.6,@0.9,@1];
return animate;
}
- (void)show{
self.hidden = NO;
CABasicAnimation * scaleAni = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
scaleAni.fromValue = @0.0;
scaleAni.toValue = @1.0;
CABasicAnimation * alphaAni = [CABasicAnimation animationWithKeyPath:@"opacity"];
alphaAni.fromValue = @0.0;
alphaAni.toValue = @1.0;
CAAnimationGroup * group = [CAAnimationGroup animation];
group.animations = @[scaleAni,alphaAni];
group.beginTime = CACurrentMediaTime();
group.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
group.duration = 0.15;
group.repeatCount = 0;
group.fillMode = kCAFillModeForwards;
group.removedOnCompletion = NO;
group.delegate = self;
[self.layer addAnimation:group forKey:@"ShowAnimation"];
}
- (void)hiddenAnimation{
CABasicAnimation * scaleAni = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
scaleAni.fromValue = @1.0;
scaleAni.toValue = @0.0;
CABasicAnimation * alphaAni = [CABasicAnimation animationWithKeyPath:@"opacity"];
alphaAni.fromValue = @1.0;
alphaAni.toValue = @0.0;
CAAnimationGroup * group = [CAAnimationGroup animation];
group.animations = @[scaleAni,alphaAni];
group.beginTime = CACurrentMediaTime();
group.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
group.duration = 0.15;
group.repeatCount = 0;
group.fillMode = kCAFillModeForwards;
group.removedOnCompletion = NO;
group.delegate = self;
[self.layer addAnimation:group forKey:@"HiddenAnimation"];
}
- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{
CAAnimation * showAnimation = [self.layer animationForKey:@"ShowAnimation"];
CAAnimation * hiddenAnimation = [self.layer animationForKey:@"HiddenAnimation"];
if ([anim isEqual:showAnimation]) {
[self.layer removeAnimationForKey:@"ShowAnimation"];
}else if ([anim isEqual:hiddenAnimation]){
self.hidden = YES;
[self.layer removeAnimationForKey:@"HiddenAnimation"];
}
}
@end
//
// SMAgreementView.h
// SkinMagnifier
//
// Created by nana on 2020/12/9.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMAgreementView : UIView
@end
NS_ASSUME_NONNULL_END
//
// SMAgreementView.m
// SkinMagnifier
//
// Created by nana on 2020/12/9.
//
#import "SMAgreementView.h"
#import <WebKit/WebKit.h>
@interface SMAgreementView()<WKNavigationDelegate,WKUIDelegate>
@property(nonatomic, strong)WKWebView *webView;
@end
@implementation SMAgreementView
- (instancetype)init
{
self = [super init];
if (self) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.webView = [[WKWebView alloc] init];
self.webView.UIDelegate = self;
self.webView.navigationDelegate = self;
[self addSubview:self.webView];
[self.webView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.bottom.right.mas_equalTo(0);
}];
UIButton *backBtn = [[UIButton alloc] init];
backBtn.frame = CGRectMake(10, safaTop(20) , 38, 45);
[backBtn wb_setImageName:@"nav_black_back"];
[backBtn addTarget:self action:@selector(backClick:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:backBtn];
@weakify(self);
[self postFormDataWithUrl:@"/magnifier/public/findServiceAgree" params:nil success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
@strongify(self);
NSDictionary *rDict = (NSDictionary *)JsonData.data ;
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:rDict[@"agreementUrl"]]];
[self.webView loadRequest:request];
}];
}
- (void)backClick:(UIButton *)btn {
[self wb_disLTRMiss];
}
@end
//
// SMBase.h
// SkinMagnifier
//
// Created by nana on 2020/11/4.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
#define KPageSize (10)
#define kMultiLangString(str) NSLocalizedString(str, nil)
#ifndef weakify
#if DEBUG
#if __has_feature(objc_arc)
#define weakify(object) autoreleasepool{} __weak __typeof__(object) weak##_##object = object;
#else
#define weakify(object) autoreleasepool{} __block __typeof__(object) block##_##object = object;
#endif
#else
#if __has_feature(objc_arc)
#define weakify(object) try{} @finally{} {} __weak __typeof__(object) weak##_##object = object;
#else
#define weakify(object) try{} @finally{} {} __block __typeof__(object) block##_##object = object;
#endif
#endif
#endif
#ifndef strongify
#if DEBUG
#if __has_feature(objc_arc)
#define strongify(object) autoreleasepool{} __typeof__(object) object = weak##_##object;
#else
#define strongify(object) autoreleasepool{} __typeof__(object) object = block##_##object;
#endif
#else
#if __has_feature(objc_arc)
#define strongify(object) try{} @finally{} __typeof__(object) object = weak##_##object;
#else
#define strongify(object) try{} @finally{} __typeof__(object) object = block##_##object;
#endif
#endif
#endif
#ifdef DEBUG
#define NSLog(format, ...) printf("%s\n", [[NSString stringWithFormat:format, ## __VA_ARGS__] UTF8String])
# define DEBUG_METHOD(format, ...) printf("%s\n", [[NSString stringWithFormat:format, ## __VA_ARGS__] UTF8String])
#else
#define NSLog(format, ...)
#define DEBUG_METHOD(format, ...)
#endif
@interface SMBase : UILabel
UIColor *rgba(int r,int g ,int b ,CGFloat a);
NSAttributedString *createAttString(NSString *str,CGFloat fontSize,UIColor *color);
CGSize biliSize(CGFloat w,CGFloat h);
CGFloat safaTop(CGFloat top);
CGFloat safaBottom(CGFloat bottom);
/// 加密
NSString *encryptAES128(NSString *value, NSString *key);
/// 解密
NSString *decryptAES128(NSString *value, NSString *key);
NSString *md5String(NSString *value);
NSData *hexStringToData(NSString *hexString);
NSString *dataToHexString(NSData *data);
/// 隐私String (xxxx, 2,2,*); xxx****xxx;
NSString *privacyString(NSString *value, int from, int len,NSString *pString);
NSString *nowTimeTimestamp(void);
NSString *timestampString(long long t ,NSString *formatter);
NSString *deviceWifiName(void);
NSString *deviceWifiPWd(void);
// WiFi地址
NSString *WIFIAddress(void);
// WiFi name
NSString *WIFIName(void);
///WIFI mac地址
NSString *WIFIMacAddress(void);
bool islinkDeviceWifi(void);
@end
@interface UILabel (SMBase)
- (void)wb_setFontSize:(CGFloat )fontSize TextColor:(UIColor *)textColor Text:(NSString *)text;
@end
@interface UIImage (SMBase)
+ (instancetype )wb_imageWithColor:(UIColor *)color;
+ (instancetype )wb_imageWithColor:(UIColor *)color size:(CGSize)size;
/// 根据不同比例设置图片
+ (instancetype )wb_biliImageName:(NSString *)name;
@end
@interface UIButton (SMBase)
- (void)wb_setImageName:(NSString *)imageName;
- (void)wb_setRightImage;
@end
@interface UIColor (SMBase)
+ (instancetype)wb_randColor;
@end
@interface NSAttributedString (SMBase)
- (instancetype)wb_initWithString:(NSString *)str FontSize:(CGFloat )fontSize TextColor:(UIColor *)textColor;
@end
@interface UIViewController (SMBase)
@property(nonatomic, strong)UILabel *wb_titleLabel;
@end
@interface UIView(SMBase)
///从下向上移动
- (void)wb_showFromSuperView:(UIView *)view;
- (void)wb_disMiss;
///从右边向左移动
- (void)wb_showRTLFromSuperView:(UIView *)view;
- (void)wb_disLTRMiss;
/// 中间放大
- (void)wb_showlTBFromSuperView:(UIView *)view;
- (void)wb_disBTlLMiss;
+ (void)showFromView:(UIView *)view text:(NSString *)text afterDelay:(CGFloat )afterDelay;
/// 箭头显示在哪个位置 // 0 上,1下.2,左,3右
-(void)alertToView:(UIView *)pView Postion:(int)postion vsize:(CGSize)vsize;
/// 箭头消息在哪个位置 // 0 上,1下.2,左,3右
-(void)alertDisMiss;
@end
NS_ASSUME_NONNULL_END
//
// SMBase.m
// SkinMagnifier
//
// Created by nana on 2020/11/4.
//
#import "SMBase.h"
#import <objc/runtime.h>
#import <CommonCrypto/CommonCryptor.h>
#import <CommonCrypto/CommonDigest.h>
#import <CommonCrypto/CommonHMAC.h>
#import <arpa/inet.h>
#import <ifaddrs.h>
#import <SystemConfiguration/CaptiveNetwork.h>
@implementation SMBase
UIColor *rgba(int r,int g ,int b ,CGFloat a) {
return [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a];
}
NSAttributedString *createAttString(NSString *str,CGFloat fontSize,UIColor *color) {
return [[NSAttributedString alloc] wb_initWithString:str FontSize:fontSize TextColor:color];
}
CGSize biliSize(CGFloat w,CGFloat h) {
static CGSize bSize;
if (!bSize.width) {
bSize = [UIScreen mainScreen].bounds.size;
}
CGFloat bliw = bSize.width / 375.0;
CGFloat blih = bSize.height /667.0;
return CGSizeMake(w * bliw, h * blih);
}
CGFloat safaTop(CGFloat top) {
UIWindow *window = [[UIApplication sharedApplication].windows firstObject];
UIEdgeInsets e = window.safeAreaInsets;
return top + e.top - 20;
}
CGFloat safaBottom(CGFloat bottoom) {
UIWindow *window = [[UIApplication sharedApplication].windows firstObject];
UIEdgeInsets e = window.safeAreaInsets;
return bottoom - e.bottom;
}
NSString *encryptAES128(NSString *value, NSString *key) {
char keyPtr[kCCKeySizeAES128+1];
bzero(keyPtr, sizeof(keyPtr));
[key getCString:keyPtr maxLength:sizeof(keyPtr) encoding:NSUTF8StringEncoding];
// char ivPtr[kCCBlockSizeAES128 + 1];
// bzero(ivPtr, sizeof(ivPtr));
// [iv getCString:ivPtr maxLength:sizeof(ivPtr) encoding:NSUTF8StringEncoding];
NSData* xData = [value dataUsingEncoding:NSUTF8StringEncoding];
NSUInteger dataLength = [xData length];
size_t bufferSize = dataLength + kCCBlockSizeAES128;
void *buffer = malloc(bufferSize);
size_t numBytesEncrypted = 0;
CCCryptorStatus cryptStatus = CCCrypt(kCCEncrypt, kCCAlgorithmAES128,
kCCOptionPKCS7Padding | kCCOptionECBMode,
keyPtr, kCCBlockSizeAES128,
NULL,/*ivPtr*/
[xData bytes], dataLength,
buffer, bufferSize,
&numBytesEncrypted);
if (cryptStatus == kCCSuccess) {
NSData *rData = [NSData dataWithBytes:buffer length:numBytesEncrypted];
free(buffer);
return dataToHexString(rData);
}
free(buffer);
return nil;
}
NSString *decryptAES128(NSString *value, NSString *key) {
char keyPtr[kCCKeySizeAES128 + 1];
bzero(keyPtr, sizeof(keyPtr));
[key getCString:keyPtr maxLength:sizeof(keyPtr) encoding:NSUTF8StringEncoding];
// char ivPtr[kCCBlockSizeAES128 + 1];
// bzero(ivPtr, sizeof(ivPtr));
// [iv getCString:ivPtr maxLength:sizeof(ivPtr) encoding:NSUTF8StringEncoding];
NSData *xData = hexStringToData(value);
NSUInteger dataLength = [xData length];
size_t bufferSize = dataLength + kCCBlockSizeAES128;
void *buffer = malloc(bufferSize);
size_t numBytesDecrypted = 0;
CCCryptorStatus cryptStatus = CCCrypt(kCCDecrypt, kCCAlgorithmAES128,
kCCOptionPKCS7Padding|kCCOptionECBMode,
keyPtr, kCCBlockSizeAES128,
NULL,/*ivPtr*/
[xData bytes], dataLength,
buffer, bufferSize,
&numBytesDecrypted);
if (cryptStatus == kCCSuccess) {
NSData *rData = [NSData dataWithBytes:buffer length:numBytesDecrypted];
free(buffer);
return [[NSString alloc] initWithData:rData encoding:NSUTF8StringEncoding];
}
free(buffer);
return nil;
}
NSString *md5String(NSString *value) {
const char *cStr = [value UTF8String];
unsigned char result[16];
CC_MD5(cStr, strlen(cStr), result); // This is the md5 call
return [NSString stringWithFormat:
@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
result[0], result[1], result[2], result[3],
result[4], result[5], result[6], result[7],
result[8], result[9], result[10], result[11],
result[12], result[13], result[14], result[15]
];
}
NSData *hexStringToData(NSString *hexString) {
if (!hexString || [hexString length] == 0) {
return nil;
}
NSMutableData *hexData = [[NSMutableData alloc] initWithCapacity:20];
NSRange range;
if ([hexString length] % 2 == 0) {
range = NSMakeRange(0, 2);
} else {
range = NSMakeRange(0, 1);
}
for (NSInteger i = range.location; i < [hexString length]; i += 2) {
unsigned int anInt;
NSString *hexCharStr = [hexString substringWithRange:range];
NSScanner *scanner = [[NSScanner alloc] initWithString:hexCharStr];
[scanner scanHexInt:&anInt];
NSData *entity = [[NSData alloc] initWithBytes:&anInt length:1];
[hexData appendData:entity];
range.location += range.length;
range.length = 2;
}
return hexData;
}
NSString *dataToHexString(NSData *data) {
if (!data || [data length] == 0) {
return @"";
}
NSMutableString *string = [[NSMutableString alloc] initWithCapacity:[data length]];
[data enumerateByteRangesUsingBlock:^(const void *bytes, NSRange byteRange, BOOL *stop) {
unsigned char *dataBytes = (unsigned char*)bytes;
for (NSInteger i = 0; i < byteRange.length; i++) {
NSString *hexStr = [NSString stringWithFormat:@"%x", (dataBytes[i]) & 0xff];
if ([hexStr length] == 2) {
[string appendString:hexStr];
} else {
[string appendFormat:@"0%@", hexStr];
}
}
}];
return string;
}
NSString *privacyString(NSString *value, int from, int len,NSString *pString) {
if (value.length ==0 || (value.length-1 < (from+len))) {
return value;
}
NSMutableString *xxx = [[NSMutableString alloc] init];
for (int i = 0; i < len; i++) {
[xxx appendString:pString];
}
NSMutableString *s = [[NSMutableString alloc] initWithString:value];
[s replaceCharactersInRange:NSMakeRange(from, len) withString:xxx];
return s;
}
NSString *nowTimeTimestamp(void) {
NSDateFormatter *formatter = [[NSDateFormatter alloc] init] ;
[formatter setDateStyle:NSDateFormatterMediumStyle];
[formatter setTimeStyle:NSDateFormatterShortStyle];
[formatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"]; // ----------设置你想要的格式,hh与HH的区别:分别表示12小时制,24小时制
//设置时区,这个对于时间的处理有时很重要
NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Shanghai"];
[formatter setTimeZone:timeZone];
NSDate *datenow = [NSDate date];//现在时间,你可以输出来看下是什么格式
NSString *timeSp = [NSString stringWithFormat:@"%lld", (long long)([datenow timeIntervalSince1970]*1000.0)];
return timeSp;
}
NSString *timestampString(long long t ,NSString *formatter){
if (t > 100000000000) {
t = t / 1000;
}
NSDate *date = [NSDate dateWithTimeIntervalSince1970:t];
NSDateFormatter *datef = [[NSDateFormatter alloc] init];
[datef setDateFormat:formatter];
NSString *dateString = [datef stringFromDate:date];
return dateString;
}
NSString *deviceWifiName(void) {
return @"DAS01-1";
}
NSString *deviceWifiPWd(void) {
return @"12345678";
}
NSString *WIFIAddress(void) {
NSString *address = nil;
struct ifaddrs *interfaces = NULL;
struct ifaddrs *temp_addr = NULL;
int success = 0;
// retrieve the current interfaces - returns 0 on success
success = getifaddrs(&interfaces);
if (success == 0) {
// Loop through linked list of interfaces
temp_addr = interfaces;
while(temp_addr != NULL) {
if(temp_addr->ifa_addr->sa_family == AF_INET) {
// Check if interface is en0 which is the wifi connection on the iPhone
if([[NSString stringWithUTF8String:temp_addr->ifa_name] isEqualToString:@"en0"]) {
// Get NSString from C String
address = [NSString stringWithUTF8String:inet_ntoa(((struct sockaddr_in *)temp_addr->ifa_addr)->sin_addr)];
}
}
temp_addr = temp_addr->ifa_next;
}
}
// Free memory
freeifaddrs(interfaces);
return address;
}
NSString *WIFIName(void)
{
NSArray *ifs = CFBridgingRelease(CNCopySupportedInterfaces());
id info = nil;
for (NSString *ifname in ifs) {
info = (__bridge_transfer id)CNCopyCurrentNetworkInfo((CFStringRef) ifname);
if (info && [info count]) {
break;
}
}
NSDictionary *dic = (NSDictionary *)info;
NSString *ssid = [dic objectForKey:@"SSID"];
if (TARGET_IPHONE_SIMULATOR == 1 && TARGET_OS_IPHONE == 1) {
//模拟器
return deviceWifiName();
}
return ssid;
}
///WIFI 名字
NSString *WIFIMacAddress(void) {
NSArray *ifs = CFBridgingRelease(CNCopySupportedInterfaces());
id info = nil;
for (NSString *ifname in ifs) {
info = (__bridge_transfer id)CNCopyCurrentNetworkInfo((CFStringRef) ifname);
if (info && [info count]) {
break;
}
}
NSDictionary *dic = (NSDictionary *)info;
NSString *ssid = [dic objectForKey:@"BSSID"] ;
return ssid;
}
bool islinkDeviceWifi(void) {
return [WIFIName() containsString:deviceWifiName()];
}
@end
@implementation UILabel (SMBase)
- (void)wb_setFontSize:(CGFloat )fontSize TextColor:(UIColor *)textColor Text:(NSString *)text {
self.font = [UIFont systemFontOfSize:fontSize];
self.textColor = textColor;
self.text = text;
}
@end
@implementation UIImage (SMBase)
+ (instancetype )wb_imageWithColor:(UIColor *)color {
return [self wb_imageWithColor:color size:CGSizeMake(1, 1)];
}
+ (instancetype )wb_imageWithColor:(UIColor *)color size:(CGSize)size {
if (!color || size.width <= 0 || size.height <= 0) return nil;
CGRect rect = CGRectMake(0.0f, 0.0f, size.width, size.height);
UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, color.CGColor);
CGContextFillRect(context, rect);
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
/// 根据不同比例设置图片
+ (instancetype )wb_biliImageName:(NSString *)name {
NSString *bImageName = name;
CGSize bSize = [UIScreen mainScreen].bounds.size;
if (abs((int)(bSize.height / 16 - bSize.width / 9)) < 5) {
bImageName = [NSString stringWithFormat:@"%@_16",name];
}
if (abs((int)(bSize.height / 19 - bSize.width / 9)) < 5) {
bImageName = [NSString stringWithFormat:@"%@_19",name];
}
UIImage *image = [UIImage imageNamed:bImageName];
if (!image) {
image = [UIImage imageNamed:name];
}
return image;
}
@end
@implementation UIButton (SMBase)
- (void)wb_setImageName:(NSString *)imageName {
NSString *imageNor = [NSString stringWithFormat:@"%@_nor",imageName];
NSString *imageSel = [NSString stringWithFormat:@"%@_sel",imageName];
UIImage *norImage = [UIImage imageNamed:imageNor];
if (!norImage) {
norImage = [UIImage imageNamed:imageName];
}
[self setImage:norImage forState:UIControlStateNormal];
UIImage *selImage = [UIImage imageNamed:imageSel];
if (selImage) {
[self setImage:selImage forState:UIControlStateSelected];
}
}
- (void)wb_setRightImage {
self.transform = CGAffineTransformRotate(self.transform, M_PI);
self.titleLabel.transform = CGAffineTransformRotate(self.titleLabel.transform, M_PI);
self.imageView.transform = CGAffineTransformRotate(self.imageView.transform, M_PI);
}
@end
@implementation UIColor (SMBase)
+ (instancetype)wb_randColor {
return [UIColor colorWithRed:drand48() green:drand48() blue:drand48() alpha:1];
}
@end
@implementation NSAttributedString (SMBase)
- (instancetype)wb_initWithString:(NSString *)str FontSize:(CGFloat )fontSize TextColor:(UIColor *)textColor{
if (!str || ![str isKindOfClass:[NSString class]]) {
str = @"";
}
NSMutableDictionary *pDict = [[NSMutableDictionary alloc] init];
pDict[NSFontAttributeName] = [UIFont systemFontOfSize:fontSize];
pDict[NSForegroundColorAttributeName] = textColor;
return [[NSAttributedString alloc ] initWithString:str attributes:pDict];
}
@end
@implementation UIViewController (SMBase)
+ (void)load {
Method viewDidLoadM = class_getInstanceMethod(self, @selector(viewDidLoad));
Method zl_viewDidLoadM = class_getInstanceMethod(self, @selector(zl_viewDidLoad));
method_exchangeImplementations(viewDidLoadM, zl_viewDidLoadM);
}
- (void)zl_viewDidLoad {
[self zl_viewDidLoad];
NSLog(@"DEBUG控制器 zl_viewDidLoad %@",[self class]);
self.wb_titleLabel = [[UILabel alloc] init];
self.wb_titleLabel.font = [UIFont systemFontOfSize:17];
self.wb_titleLabel.textColor = rgba(76, 74, 66, 1);
self.wb_titleLabel.textAlignment = NSTextAlignmentCenter;
[self.view addSubview:self.wb_titleLabel];
[self.wb_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(safaTop(35));
make.centerX.mas_equalTo(0);
make.left.mas_equalTo(60);
make.right.mas_equalTo(-60);
}];
}
- (UILabel *)wb_titleLabel {
return objc_getAssociatedObject(self, @selector(wb_titleLabel));
}
- (void)setWb_titleLabel:(UILabel *)wb_title {
return objc_setAssociatedObject(self, @selector(wb_titleLabel), wb_title, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
@end
@implementation UIView (SMBase)
- (void)wb_showFromSuperView:(UIView *)view {
[view addSubview:self];
self.frame = CGRectMake(0, view.bounds.size.height, view.bounds.size.width, view.bounds.size.height);
[UIView animateWithDuration:0.25 animations:^{
self.frame = CGRectMake(0, 0, view.bounds.size.width, view.bounds.size.height);
}];
}
- (void)wb_disMiss {
[UIView animateWithDuration:0.25 animations:^{
CGRect bRect =self.frame;
self.frame = CGRectMake(0,bRect.size.height, bRect.size.width, bRect.size.height);
}completion:^(BOOL finished) {
[self removeFromSuperview];
}];
}
- (void)wb_showRTLFromSuperView:(UIView *)view {
[view addSubview:self];
self.frame = CGRectMake(view.bounds.size.width, 0, view.bounds.size.width, view.bounds.size.height);
[UIView animateWithDuration:0.25 animations:^{
self.frame = CGRectMake(0, 0, view.bounds.size.width, view.bounds.size.height);
}];
}
- (void)wb_disLTRMiss {
[UIView animateWithDuration:0.25 animations:^{
CGRect bRect =self.frame;
self.frame = CGRectMake( bRect.size.width,0, bRect.size.width, bRect.size.height);
}completion:^(BOOL finished) {
[self removeFromSuperview];
}];
}
- (void)wb_showlTBFromSuperView:(UIView *)view {
UIButton *wb_backView = [[UIButton alloc] init];
[wb_backView addTarget:self action:@selector(wb_disBTlLMiss) forControlEvents:UIControlEventTouchUpInside];
wb_backView.frame =[UIScreen mainScreen].bounds;
wb_backView.backgroundColor =[UIColor colorWithRed:0 green:0 blue:0 alpha:0.3];
[wb_backView addSubview:self];
self.center = wb_backView.center;
[view addSubview:wb_backView];
[self animationWithLayer:wb_backView.layer duration:0.25 values:@[@0.0, @1.2, @1.0]];
}
- (void)wb_disBTlLMiss
{
UIView *wb_backView = self.superview;
[self animationWithLayer:wb_backView.layer duration:0.25 values:@[@1.0, @0.66, @0.33, @0.0]];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[wb_backView removeFromSuperview];
});
}
- (void)animationWithLayer:(CALayer *)layer duration:(CGFloat)duration values:(NSArray *)values
{
CAKeyframeAnimation *KFAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
KFAnimation.duration = duration;
KFAnimation.removedOnCompletion = NO;
KFAnimation.fillMode = kCAFillModeForwards;
NSMutableArray *valueArr = [NSMutableArray arrayWithCapacity:values.count];
for (NSUInteger i = 0; i<values.count; i++) {
CGFloat scaleValue = [values[i] floatValue];
[valueArr addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(scaleValue, scaleValue, scaleValue)]];
}
KFAnimation.values = valueArr;
KFAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault];
[layer addAnimation:KFAnimation forKey:nil];
}
+ (void)showFromView:(UIView *)view text:(NSString *)text afterDelay:(CGFloat )afterDelay {
UIView *selfView = [[UIView alloc] init];
selfView.frame = view.bounds;
[view addSubview:selfView];
CGFloat tW = view.bounds.size.width- 100;
CGRect tRect = [text boundingRectWithSize:CGSizeMake(tW, MAXFLOAT)
options:NSStringDrawingUsesFontLeading|NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingTruncatesLastVisibleLine
attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:15]}
context:nil];
UIView *contView = [[UIView alloc] init];
contView.alpha = 0;
contView.backgroundColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:0.34];
contView.layer.cornerRadius = 10;
[selfView addSubview:contView];
[contView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.top.mas_equalTo(100);
make.size.mas_equalTo(CGSizeMake(tW+40, tRect.size.height+40));
}];
UILabel *textLabel = [[UILabel alloc] init];
textLabel.textAlignment = NSTextAlignmentCenter;
textLabel.numberOfLines = 0;
textLabel.attributedText = createAttString(text, 15, [UIColor whiteColor]);
textLabel.frame = CGRectMake(20, 20, tW, tRect.size.height);
[contView addSubview:textLabel];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(afterDelay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[UIView animateWithDuration:0.25 animations:^{
contView.alpha = 0.0;
} completion:^(BOOL finished) {
[selfView removeFromSuperview];
}];
});
[UIView animateWithDuration:0.25 animations:^{
contView.alpha = 1.0;
}];
}
/// 箭头显示在哪个位置
-(void)alertToView:(UIView *)pView Postion:(int)postion vsize:(CGSize)vsize{
UIResponder *nextResponder = pView;
UIViewController *vc = nil;
do
{
nextResponder = [nextResponder nextResponder];
if ([nextResponder isKindOfClass:[UIViewController class]])
{
vc = (UIViewController*)nextResponder;
}
} while (nextResponder);
UIControl *bgView = [[UIControl alloc] init];
bgView.tag = 147889;
[bgView addTarget:bgView action:@selector(removeFromSuperview) forControlEvents:UIControlEventTouchUpInside];
bgView.backgroundColor = rgba(0, 0, 0, 0.3);
bgView.frame = CGRectMake(0, 0, vc.view.frame.size.width, vc.view.frame.size.height);
[vc.view addSubview:bgView];
CGRect xRect = [pView.superview convertRect:pView.frame toView:vc.view];
UIImageView *jtImageView = [[UIImageView alloc] init];
jtImageView.image = [UIImage imageNamed:@"alert_pop_tk"];
[bgView addSubview:jtImageView];
[bgView addSubview:self];
/// 下面
jtImageView.frame = CGRectMake(xRect.origin.x, CGRectGetMaxY(xRect), 18, 14);
CGFloat vX = xRect.origin.x - (vsize.width/2.0);
if (vX +vsize.width > bgView.frame.size.width) { // 右边
CGFloat d = (vX + vsize.width) - bgView.frame.size.width;
vX =vX - d - 10;
}
// 左边为做
self.frame = CGRectMake(vX, CGRectGetMaxY(xRect)+10, vsize.width, vsize.height);
}
-(void)alertDisMiss {
UIResponder *nextResponder = self;
UIViewController *vc = nil;
do
{
nextResponder = [nextResponder nextResponder];
if ([nextResponder isKindOfClass:[UIViewController class]])
{
vc = (UIViewController*)nextResponder;
}
} while (nextResponder);
for (UIView *vView in vc.view.subviews) {
if (vView.tag == 147889) {
[vView removeFromSuperview];
break;;
}
}
}
@end
//
// SMCountDownButton.h
// SkinMagnifier
//
// Created by nana on 2020/11/5.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMCountDownButton : UIButton
@property(nonatomic, copy)void (^timeBlock)(void);
- (void)startTime;
- (void)stopTime;
@end
NS_ASSUME_NONNULL_END
//
// SMCountDownButton.m
// SkinMagnifier
//
// Created by nana on 2020/11/5.
//
#import "SMCountDownButton.h"
@interface SMCountDownButton()
@property(nonatomic, strong)dispatch_source_t timer;
@property(nonatomic, assign)BOOL taskIng;
@end
@implementation SMCountDownButton
- (instancetype)init
{
self = [super init];
if (self) {
[self setupUI];
}
return self;
}
- (void)setupUI {
@weakify(self);
dispatch_source_t timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_main_queue());
dispatch_source_set_timer(timer, DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC, 0 * NSEC_PER_SEC);
dispatch_source_set_event_handler(timer, ^{
@strongify(self);
[self setTask];
});
dispatch_resume(timer);
_timer = timer;
}
- (void)setTask {
if (self.taskIng == NO) {
return;
}
if (self.timeBlock) {
self.timeBlock();
}
}
- (void)startTime {
self.taskIng = YES;
self.userInteractionEnabled = NO;
}
- (void)stopTime {
self.taskIng = NO;
self.userInteractionEnabled = YES;
}
@end
//
// SMDateKeyBoardView.h
// SkinMagnifier
//
// Created by nana on 2020/11/9.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMDateKeyBoardView : UIView
@end
NS_ASSUME_NONNULL_END
//
// SMDateKeyBoardView.m
// SkinMagnifier
//
// Created by nana on 2020/11/9.
//
#import "SMDateKeyBoardView.h"
@implementation SMDateKeyBoardView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
//
// SMDownView.h
// SkinMagnifier
//
// Created by nana on 2020/11/4.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMDownView : UIView
@end
NS_ASSUME_NONNULL_END
//
// SMDownView.m
// SkinMagnifier
//
// Created by nana on 2020/11/4.
//
#import "SMDownView.h"
@interface SMDownView()
@property(nonatomic, assign)CGFloat startY;
@end
@implementation SMDownView
- (instancetype)init
{
self = [super init];
if (self) {
[self setupUI];
}
return self;
}
-(void)setupUI {
UILongPressGestureRecognizer *longTap = [[UILongPressGestureRecognizer alloc] initWithTarget:self action: @selector(longTapClick:)];
longTap.minimumPressDuration = 0;
[self addGestureRecognizer:longTap];
}
- (void)longTapClick:(UILongPressGestureRecognizer *)tap {
UIWindow *window = [[[UIApplication sharedApplication] delegate] window];
CGPoint p = [tap locationInView:window];
CGRect sFrame = self.superview.frame;
switch (tap.state) {
case UIGestureRecognizerStateBegan:
self.startY = p.y;
break;
case UIGestureRecognizerStateEnded:
{
[UIView animateWithDuration:0.25 animations:^{
CGFloat y = 0;
if (p.y > 300) {
y = window.bounds.size.height;
}
self.superview.frame = CGRectMake(sFrame.origin.x, y, sFrame.size.width, sFrame.size.height);
}];
break;
}
default:
self.superview.frame = CGRectMake(0, p.y-self.startY, sFrame.size.width, sFrame.size.height);
break;
}
}
@end
//
// SMGlobalModel.h
// SkinMagnifier
//
// Created by nana on 2020/12/3.
//
#import "JFBaseModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface SMGlobalModel : JFBaseModel
@property(nonatomic ,strong)NSString *mid;
/// 账号
@property(nonatomic, strong)NSString *account;
/// 门店名字
@property(nonatomic, strong)NSString *dmname;
/// 设备Mac地址
@property(nonatomic, strong)NSString *deviceMac;
/// 门店信息是否完整
@property(nonatomic, assign)BOOL shopInfoComplete;
+(instancetype)share;
@end
NS_ASSUME_NONNULL_END
//
// SMGlobalModel.m
// SkinMagnifier
//
// Created by nana on 2020/12/3.
//
#import "SMGlobalModel.h"
@implementation SMGlobalModel
+ (instancetype)share {
static SMGlobalModel *_sharedManager = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
if (_sharedManager == nil) {
_sharedManager = [[SMGlobalModel alloc] init];
}
});
return _sharedManager;
}
@end
//
// MMLocalReportBManager.h
// SkinMagnifier
//
// Created by nana on 2020/12/7.
//
#import <Foundation/Foundation.h>
#import "SMLocalReportModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface SMLocalReportBManager : NSObject
/// 单利
+ (instancetype)sharedManager ;
-(BOOL)addWithModel:(SMLocalReportModel *)model;
/// 更新, 如果model 的属性值 为 nil 表示不更新.
-(BOOL)updateWithModel:(SMLocalReportModel *)model cgid:(NSString *)cgid;
/// 删除
-(BOOL)deleteWitCgid:(NSString *)cgid;
/// 根据Cid 查询数据
-(NSMutableArray *)selectWithCid:(NSString *)cid from:(NSInteger )from;
/// 根据Cgid 查询数据
-(NSMutableArray *)selectWithCgid:(NSString *)cgid;
/// 根据Cid 查询数据
-(NSMutableArray *)selectFristWithMid:(NSString *)Mid;
-(BOOL)updateWithSetKey:(NSString *)setKey setValue:(NSString *)setValue whereKey:(NSString *)whereKey whereValue:(NSString *)whereValue;
@end
NS_ASSUME_NONNULL_END
//
// MMLocalReportBManager.m
// SkinMagnifier
//
// Created by nana on 2020/12/7.
//
#import "SMLocalReportBManager.h"
#import <FMDB/FMDB.h>
@interface SMLocalReportBManager()
@property(nonatomic, strong)FMDatabaseQueue *dbQueue;
@end
@implementation SMLocalReportBManager
+ (instancetype)sharedManager {
static SMLocalReportBManager *sharedManager = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedManager = [[SMLocalReportBManager alloc] init];
});
return sharedManager;
}
- (instancetype)init {
if (self = [super init]) {
[self setup];
}
return self;
}
- (void)setup {
NSString *fileName = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES) lastObject] stringByAppendingPathComponent:@"MMLocalReportBManager.sqlite"];
NSLog(@"dbPath = %@",fileName);
//创建数据库
self.dbQueue = [FMDatabaseQueue databaseQueueWithPath:fileName];
// self.dbQueue = [FMDatabaseQueue databaseQueueWithPath:@"/Users/nana/Desktop/wb.db"];
[self.dbQueue inDatabase:^(FMDatabase * _Nonnull db) {
[db executeUpdate:@"CREATE TABLE IF NOT EXISTS t_report (\
id integer PRIMARY KEY AUTOINCREMENT ,\
mid TEXT,\
cid TEXT,\
cgid TEXT,\
imageArray TEXT,\
symptomArray TEXT,\
productArray TEXT,\
moisture TEXT,\
iposition TEXT,\
createTime TEXT)"];
if (![db columnExists:@"uploadLock" inTableWithName:@"t_report"]){
NSString *alertStr = [NSString stringWithFormat:@"ALTER TABLE %@ ADD %@ TEXT DEFAULT '0'",@"t_report",@"uploadLock"];
[db executeUpdate:alertStr];
}
if (![db columnExists:@"AISymptomArray" inTableWithName:@"t_report"]){
NSString *alertStr = [NSString stringWithFormat:@"ALTER TABLE %@ ADD %@ TEXT DEFAULT '[]'",@"t_report",@"AISymptomArray"];
[db executeUpdate:alertStr];
}
}];
}
-(BOOL)addWithModel:(SMLocalReportModel *)model {
if (!model) {
return false;
}
NSString *imageArray = @"";
if (model.imageArray.count) {
imageArray =[[SMLocalReportImageModel mj_keyValuesArrayWithObjectArray:model.imageArray] mj_JSONString];
}else {
imageArray = @"[]";
}
NSString *symptomArray = @"";
if (model.symptomArray.count) {
symptomArray =[[SMLocalReportSymptomModel mj_keyValuesArrayWithObjectArray:model.symptomArray] mj_JSONString];
}else {
symptomArray = @"[]";
}
NSString *aiSymptomArray = @"";
if (model.AISymptomArray.count) {
aiSymptomArray =[[SMLocalReportAIModel mj_keyValuesArrayWithObjectArray:model.AISymptomArray] mj_JSONString];
}else {
aiSymptomArray = @"[]";
}
NSString *productArray = @"";
if (model.productArray.count) {
productArray = [[SMLocalReportProductModel mj_keyValuesArrayWithObjectArray:model.productArray] mj_JSONString];
}else {
productArray = @"[]";
}
NSString *moisture = [model.moisture mj_JSONString];
__block BOOL insertState = NO;
[self.dbQueue inDatabase:^(FMDatabase * _Nonnull db) {
insertState = [db executeUpdateWithFormat:@"insert into t_report\
(mid,cid,cgid,imageArray,symptomArray,AISymptomArray,productArray,moisture,iposition,createTime)\
values(%@,%@,%@,%@,%@,%@,%@,%@,%@,%@)",
model.mid,model.cid,model.cgid,imageArray,symptomArray,aiSymptomArray,productArray,moisture,model.iposition,model.createTime];
}];
return insertState;
}
-(BOOL)updateWithModel:(SMLocalReportModel *)model cgid:(NSString *)cgid {
if (!model) {
return false;
}
NSMutableDictionary *dict = [model mj_keyValues];
NSMutableArray *StringArray = [[NSMutableArray alloc] init];
for (NSString *key in [dict allKeys]) {
if ([[key uppercaseString] containsString:@"ID"]) {
continue;
}
if (dict[key]) {
NSString *value = dict[key];
if ([key isEqualToString:@"symptomArray"]) {
value =[[SMLocalReportSymptomModel mj_keyValuesArrayWithObjectArray:dict[key]] mj_JSONString];
}else if ([key isEqualToString:@"AISymptomArray"]) {
value =[[SMLocalReportAIModel mj_keyValuesArrayWithObjectArray:dict[key]] mj_JSONString];
}else if ([key isEqualToString:@"imageArray"]) {
value =[[SMLocalReportImageModel mj_keyValuesArrayWithObjectArray:dict[key]] mj_JSONString];
}else if ([key isEqualToString:@"productArray"]) {
value =[[SMLocalReportProductModel mj_keyValuesArrayWithObjectArray:dict[key]] mj_JSONString];
}else if ([key isEqualToString:@"moisture"]) {
NSError *error;
NSDictionary *mDict = dict[key];
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:mDict options:NSJSONWritingPrettyPrinted error:&error];
value = [[NSString alloc]initWithData:jsonData encoding:NSUTF8StringEncoding];
}
NSString *sqlT = [NSString stringWithFormat:@"%@ = '%@'",key,value];
[ StringArray addObject:sqlT];
}
}
NSString *string = [StringArray componentsJoinedByString:@","];
NSString *sql = [NSString stringWithFormat:@"UPDATE t_report SET %@ WHERE cgid = %@",string,cgid];
__block BOOL insertState = NO;
[self.dbQueue inDatabase:^(FMDatabase * _Nonnull db) {
insertState = [db executeUpdate:sql];
}];
return insertState;
}
-(BOOL)deleteWitCgid:(NSString *)cgid {
NSString *sql = [NSString stringWithFormat:@"DELETE FROM t_report WHERE cgid = %@",cgid];
__block BOOL insertState = NO;
[self.dbQueue inDatabase:^(FMDatabase * _Nonnull db) {
insertState = [db executeUpdate:sql];
}];
return insertState;
}
/// 根据Cid 查询数据
-(NSMutableArray *)selectWithCid:(NSString *)cid from:(NSInteger )from{
NSMutableArray *rArray = [[NSMutableArray alloc] init];
if (!cid && cid.length == 0 ) {
return rArray;
}
[self.dbQueue inDatabase:^(FMDatabase * _Nonnull db) {
FMResultSet *set = [db executeQueryWithFormat:@"SELECT * FROM t_report WHERE cid = %@ ORDER BY createTime DESC LIMIT %d,%d",cid,from,KPageSize];
[rArray addObjectsFromArray:[self arrayFromSet:set]];
}];
return rArray;
}
/// 根据Cgid 查询数据
-(NSMutableArray *)selectWithCgid:(NSString *)cgid{
NSMutableArray *rArray = [[NSMutableArray alloc] init];
if (!cgid && cgid.length == 0 ) {
return rArray;
}
[self.dbQueue inDatabase:^(FMDatabase * _Nonnull db) {
FMResultSet *set = [db executeQueryWithFormat:@"SELECT * FROM t_report WHERE cgid = %@ ORDER BY createTime DESC",cgid];
[rArray addObjectsFromArray:[self arrayFromSet:set]];
}];
return rArray;
}
/// 根据Cid 查询数据
-(NSMutableArray *)selectFristWithMid:(NSString *)Mid{
NSMutableArray *rArray = [[NSMutableArray alloc] init];
if (!Mid && Mid.length == 0 ) {
return rArray;
}
[self.dbQueue inDatabase:^(FMDatabase * _Nonnull db) {
FMResultSet *set = [db executeQueryWithFormat:@"SELECT * FROM t_report WHERE mid = %@ ORDER BY createTime ASC LIMIT 0,1",Mid];
[rArray addObjectsFromArray:[self arrayFromSet:set]];
}];
return rArray;;
}
//-(BOOL)updateWithCgid:(NSString *)cgid key:(NSString *)key value:(NSString *)value {
// __block BOOL insertState = NO;
// NSString *sql = [NSString stringWithFormat:@"UPDATE t_report SET %@ = '%@' WHERE cgid = %@",key,value,cgid];
// [self.dbQueue inDatabase:^(FMDatabase * _Nonnull db) {
// insertState = [db executeUpdate:sql];
// }];
// return insertState;
//}
-(BOOL)updateWithSetKey:(NSString *)setKey setValue:(NSString *)setValue whereKey:(NSString *)whereKey whereValue:(NSString *)whereValue {
__block BOOL insertState = NO;
NSString *sql = [NSString stringWithFormat:@"UPDATE t_report SET %@ = '%@' WHERE %@ = '%@'",setKey,setValue,whereKey,whereValue];
[self.dbQueue inDatabase:^(FMDatabase * _Nonnull db) {
insertState = [db executeUpdate:sql];
}];
return insertState;
}
- (NSMutableArray *)arrayFromSet:(FMResultSet *)set {
NSMutableArray *rArray = [[NSMutableArray alloc] init];
while (set.next) {
SMLocalReportModel *model = [[SMLocalReportModel alloc] init];
model.mid = [set stringForColumn:@"mid"];
model.cid = [set stringForColumn:@"cid"];
model.cgid = [set stringForColumn:@"cgid"];
model.iposition = [set stringForColumn:@"iposition"];
model.uploadLock = [set stringForColumn:@"uploadLock"];
model.createTime = [set stringForColumn:@"createTime"];
NSString *moisture = [set stringForColumn:@"moisture"];
if (moisture) {
NSDictionary *mDict = [NSJSONSerialization JSONObjectWithData:[moisture dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingFragmentsAllowed error:nil];
model.moisture = [SMLocalReportOilModel mj_objectWithKeyValues:mDict];
}
NSString *imageArray = [set stringForColumn:@"imageArray"];
if (imageArray.length) {
NSArray *xx = [NSJSONSerialization JSONObjectWithData:[imageArray dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingFragmentsAllowed error:nil];;
model.imageArray = [SMLocalReportImageModel mj_objectArrayWithKeyValuesArray:xx];
}
NSString *AISymptomArray = [set stringForColumn:@"AISymptomArray"];
if (AISymptomArray.length) {
NSArray *xx = [NSJSONSerialization JSONObjectWithData:[AISymptomArray dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingFragmentsAllowed error:nil];;
model.AISymptomArray = [SMLocalReportAIModel mj_objectArrayWithKeyValuesArray:xx];
}
NSString *symptomArray = [set stringForColumn:@"symptomArray"];
if (symptomArray.length) {
NSArray *xx = [NSJSONSerialization JSONObjectWithData:[symptomArray dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingFragmentsAllowed error:nil];;
model.symptomArray = [SMLocalReportSymptomModel mj_objectArrayWithKeyValuesArray:xx];
}
NSString *productArray = [set stringForColumn:@"productArray"];
if (productArray.length) {
NSArray *xx = [NSJSONSerialization JSONObjectWithData:[productArray dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingFragmentsAllowed error:nil];;
model.productArray = [SMLocalReportProductModel mj_objectArrayWithKeyValuesArray:xx];
}
[rArray addObject:model];
}
return rArray;
}
@end
/*
@property(nonatomic, assign)NSInteger ID;
/// 用户ID
@property(nonatomic, strong)NSString *mid;
/// 顾客ID
@property(nonatomic, strong)NSString *cid;
/// 案例组ID
@property(nonatomic, strong)NSString *cgid;
/// 部位
@property(nonatomic, strong)NSString *iposition;
/// 水份
@property(nonatomic, strong)NSString *moisture;
/// 图片数组
@property(nonatomic, strong)NSMutableArray *imageArray;
/// 症状数组
@property(nonatomic, strong)NSMutableArray *symptomArray;
/// 产品数组
@property(nonatomic, strong)NSMutableArray *productArray;
/// 水份
@property(nonatomic, strong)NSString *createTime;
**/
//
// SMLocalReportModel.h
// SkinMagnifier
//
// Created by nana on 2020/12/7.
//
#import "JFBaseModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface SMLocalReportImageModel : JFBaseModel
/// 图片类型
@property(nonatomic, strong)NSString *iType;
/// 图片类型名字
@property(nonatomic, strong)NSString *iname;
/// 图片地址
@property(nonatomic, strong)NSString *iURL;
@end
@interface SMLocalReportSymptomModel : JFBaseModel
/// 症状名字
@property(nonatomic, strong)NSString *sID;
/// 症状名字
@property(nonatomic, strong)NSString *sName;
/// 症状描述
@property(nonatomic, strong)NSString *sDescribe;
/// 症状描述
@property(nonatomic, strong)NSString *sMethod;
@end
@interface SMLocalReportProductModel : JFBaseModel
/// 产品类型 :1-仪器 2-产品',
@property(nonatomic, strong)NSString *pType;
/// 产品名字
@property(nonatomic, strong)NSString *pName;
/// 产品ID
@property(nonatomic, strong)NSString *pId;
@end
@interface SMLocalReportOilModel : JFBaseModel
/// 症状名字
@property(nonatomic, strong)NSString *ofen;
/// 症状名字
@property(nonatomic, strong)NSString *oName;
/// 症状描述
@property(nonatomic, strong)NSString *oDescribe;
/// 症状描述
@property(nonatomic, strong)NSString *oMethod;
@end
@interface SMLocalReportAIModel : JFBaseModel
/// 肌肤放大镜案例ID
@property(nonatomic, strong)NSString *aReportLinkAitagnameId;
/// 症状标志名(* 水份:magn_water; 敏感:magn_sensity;纹理:magn_wrinkle; 毛孔堵塞:magn_pore_clogging;毛孔粗大:magn_pore_large;色素沉淀:magn_pigmentation;皮脂:magn_sebum;)与服务端一一对应,不可修改
@property(nonatomic, strong)NSString *tagFlag;
///症状值
@property(nonatomic, strong)NSString *tagValue;
///AI图片路径
@property(nonatomic, strong)NSString *aiImageUrl;
///水肤案例组id
@property(nonatomic, strong)NSString *magnCgid;
///水肤水肤症状名
@property(nonatomic, strong)NSString *tagname;
///护理方法
@property(nonatomic, strong)NSString *dermalogicatext;
///症状值2
@property(nonatomic, strong)NSString *tagNum;
@end
@interface SMLocalReportModel : JFBaseModel
@property(nonatomic, assign)NSInteger ID;
/// 用户ID
@property(nonatomic, strong)NSString *mid;
/// 顾客ID
@property(nonatomic, strong)NSString *cid;
/// 案例组ID
@property(nonatomic, strong)NSString *cgid;
/// 部位
@property(nonatomic, strong)NSString *iposition;
/// 水份
@property(nonatomic, strong)SMLocalReportOilModel *moisture;
/// 图片数组
@property(nonatomic, strong)NSMutableArray *imageArray;
/// 症状数组
@property(nonatomic, strong)NSMutableArray *symptomArray;
/// AI症状数组
@property(nonatomic, strong)NSMutableArray *AISymptomArray;
/// 产品数组
@property(nonatomic, strong)NSMutableArray *productArray;
/// 水份
@property(nonatomic, strong)NSString *createTime;
///
@property(nonatomic, strong)NSString *uploadLock;
@end
NS_ASSUME_NONNULL_END
//
// SMLocalReportModel.m
// SkinMagnifier
//
// Created by nana on 2020/12/7.
//
#import "SMLocalReportModel.h"
@implementation SMLocalReportImageModel
@end
@implementation SMLocalReportSymptomModel
@end
@implementation SMLocalReportProductModel
@end
@implementation SMLocalReportOilModel
@end
@implementation SMLocalReportAIModel
@end
@implementation SMLocalReportModel
@end
//
// RaderMapCompleteView.h
// RadarMap
//
// Created by A053 on 16/9/22.
// Copyright © 2016年 Yvan. All rights reserved.
//
/*
ElementItem *item1 = [[ElementItem alloc]init];
item1.itemPercent = @[@"0.5",@"0.6",@"0.8",@"0.4",@"0.2",@"0.1"];
item1.itemColor = [UIColor greenColor];
item1.itemName = @"基础综合";
.
.
.
RaderMapCompleteView *radar = [[RaderMapCompleteView alloc]initWithRadarElements:@[@"考试次数",@"考试难度",@"联系次数",@"平均得分",@"错误率",@"准确率"] lengthColor:[UIColor grayColor]];
radar.content = @"能力测评能力测评能力测评能力测评能力测评能力测评能力测评能力测评";
[radar addAbilitysWithElements:@[item1,item2,item3]];
[self.view addSubview:radar];
*/
#import <UIKit/UIKit.h>
/**
* 能力评估方向 基础评估、实践评估、专业评估、
*/
@interface ElementItem : NSObject
/**
* 评估名字
*/
@property (copy, nonatomic) NSString *itemName;
/**
* 评估ID 预留
*/
@property (copy, nonatomic) NSString *itemID;
/**
* 代表该评估方向的颜色
*/
@property (strong, nonatomic) UIColor *itemColor;
/**
* 各项评估结果的百分比数组
*/
@property (strong, nonatomic) NSArray *itemPercent;
@end
/**
* 评估模型UI
*/
@interface Item : UIView
@property (strong, nonatomic) UIView *colorView;
@property (strong, nonatomic) UILabel *itemLabel;
@end
@interface SMRaderMapCompleteView : UIView
/**
* 评估描述内容
*/
@property (copy, nonatomic) NSString *content;
/**
* 实例化
*
* @param elements 各项能力评估的名字数组
* @param lengthColor 主体颜色
*
*/
- (instancetype)initWithRadarElements:(NSArray *)elements size:(CGSize )size lengthColor:(UIColor *)lengthColor;
/**
* 添加评估方向
*
* @param elements 评估方向数组<ElementItem>
*/
- (void)addAbilitysWithElements:(NSArray <ElementItem*>*)elements;
@end
//
// RaderMapCompleteView.m
// RadarMap
//
// Created by A053 on 16/9/22.
// Copyright © 2016年 Yvan. All rights reserved.
//
//#define RADAR_WIDTH ([UIScreen mainScreen].bounds.size.width-20)
//#define RADAR_HEIGHT ([UIScreen mainScreen].bounds.size.width-20)
//#define FONT(x) [UIFont systemFontOfSize:(x*([UIScreen mainScreen].bounds.size.width/375.0))]
//#define LENGTH(x) (x*([UIScreen mainScreen].bounds.size.width/375.0))
#define LENGTH(x) (x)
#define RGB_M(r,g,b) [UIColor colorWithRed:(r/255.0) green:(g/255.0) blue:(b/255.0) alpha:1]
#import "SMRaderMapCompleteView.h"
@implementation ElementItem
- (void)setValue:(id)value forUndefinedKey:(nonnull NSString *)key {}
@end
@implementation Item
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
self.colorView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, LENGTH(10), LENGTH(10))];
[self addSubview:self.colorView];
self.itemLabel = [[UILabel alloc]initWithFrame:CGRectMake(LENGTH(16), 0, LENGTH(40), LENGTH(10))];
self.itemLabel.font = [UIFont systemFontOfSize:14];
self.itemLabel.textAlignment = NSTextAlignmentLeft;
self.itemLabel.textColor =rgba(68, 57, 53, 1);
[self addSubview:self.itemLabel];
}
return self;
}
@end
@interface SMRaderMapCompleteView()
@property (strong, nonatomic) NSArray *elements;
@property (strong, nonatomic) NSMutableArray*items;
@property (strong, nonatomic) UIColor *lengthColor;
@property (strong, nonatomic) UILabel *ablilityLabel;
@property (strong, nonatomic) UITextView *contents;
@property (strong, nonatomic) UIView *abilityBGView;
@property (assign, nonatomic) CGSize contSize;
@end
static float radar_l = 0;
static float center_w = 0;
static float center_h = 0;
@implementation SMRaderMapCompleteView
#pragma mark - 画雷达图主题部分
- (void)drawBody {
// 获取画布
CGContextRef context = UIGraphicsGetCurrentContext();
// 划线颜色
if (self.lengthColor)
CGContextSetStrokeColorWithColor(context, self.lengthColor.CGColor);
else
CGContextSetStrokeColorWithColor(context, RGB_M(148, 148, 148).CGColor);
CGContextSetLineWidth(context, 1);
// 起点坐标
CGContextMoveToPoint(context, center_w, center_h);
// 第一条线
CGContextAddLineToPoint(context, center_w, center_h - radar_l);
// 添加元素名称
UILabel *bodyLabel = [self buildElementLabelWithText:self.elements[0] Frame:CGRectMake(center_w-LENGTH(30), center_h-radar_l-LENGTH(25), LENGTH(60), LENGTH(13)) Alignment:NSTextAlignmentCenter];
[self addSubview:bodyLabel];
//画元素主干
for (int i = 1; i <self.elements.count; i++) {
float x = 0;
float y = 0;
double pi = (M_PI*2.0/(self.elements.count))*i;
// 计算主干落点坐标
Coordinate_2(pi, radar_l+10, center_w, center_h,&x, &y);
float x1 = 0;
float y1 = 0;
Coordinate_2(pi, radar_l, center_w, center_h,&x1, &y1);
//添加元素名称
UILabel *bodyLabel;
CGRect frame;
if (x > center_w) {
frame = CGRectMake(x+LENGTH(7), y-LENGTH(7.5), LENGTH(60), LENGTH(13));
bodyLabel = [self buildElementLabelWithText:self.elements[i] Frame:frame Alignment:NSTextAlignmentLeft];
} else if (x == center_w) {
if (y>center_h) {
frame = CGRectMake(x-LENGTH(30), y+LENGTH(7), LENGTH(60), LENGTH(13));
} else {
frame = CGRectMake(x-LENGTH(30), y-LENGTH(20), LENGTH(60), LENGTH(13));
}
bodyLabel = [self buildElementLabelWithText:self.elements[i] Frame:frame Alignment:NSTextAlignmentCenter];
} else {
frame = CGRectMake(x-LENGTH(67), y-LENGTH(7.5), LENGTH(60), LENGTH(13));
bodyLabel = [self buildElementLabelWithText:self.elements[i] Frame:frame Alignment:NSTextAlignmentRight];
}
[self addSubview:bodyLabel];
// 设置每次的初始点坐标
CGContextMoveToPoint(context, center_w, center_h);
// 设置终点坐标
CGContextAddLineToPoint(context, x1, y1);
}
CGContextStrokePath(context);
}
#pragma mark - 画雷达分等分图
/*
- (void)buildPart {
float r = 3.0f;
// 获取画布
CGContextRef context = UIGraphicsGetCurrentContext();
// 划线颜色
if (self.lengthColor)
CGContextSetStrokeColorWithColor(context, self.lengthColor.CGColor);
else
CGContextSetStrokeColorWithColor(context, RGB_M(148, 148, 148).CGColor);
// 划线宽度
CGContextSetLineWidth(context, 1);
// 添加百分比
UILabel *partLabel = [self buildPartLabelWithText:@"0" Frame:CGRectMake(center_w-LENGTH(25), center_h-LENGTH(3), LENGTH(20), LENGTH(6))];
[self addSubview:partLabel];
// 话分割线
for (int j = 0; j<r; j++) {
// 设置每次的初始点坐标
CGContextMoveToPoint(context, center_w,center_h -radar_l);
// 添加百分比
UILabel *partLabels = [self buildPartLabelWithText:[NSString stringWithFormat:@"%.f",100*((r-j)/r)] Frame:CGRectMake(center_w-LENGTH(30), center_h -radar_l + radar_l*j/r-LENGTH(4), LENGTH(25), LENGTH(6))];
[self addSubview:partLabels];
// 画百分比分部
for (int i = 1; i<=self.elements.count; i++) {
float x = 0;
float y = 0;
double pi = (M_PI*2.0/(self.elements.count))*i;
Coordinate_2(pi,radar_l*(r-j)/r, center_w, center_h,&x, &y);
if (i == 1) {
CGContextMoveToPoint(context, center_w, center_h -radar_l + radar_l*j/r);
}
if (i == self.elements.count) {
CGContextAddLineToPoint(context, center_w, center_h -radar_l + radar_l*j/r);
} else {
CGContextAddLineToPoint(context, x, y);
}
}
}
CGContextStrokePath(context);
}
*/
#pragma mark - 画百分比占比线
- (void)buildPercent {
CGContextRef context = UIGraphicsGetCurrentContext();
for (int i = 0; i<self.items.count; i++) {
ElementItem *item = self.items[i];
// 获取画布
CGContextSetStrokeColorWithColor(context, item.itemColor.CGColor);
// 划线宽度
CGContextSetLineWidth(context, 2);
CGContextMoveToPoint(context, center_w, center_h-radar_l +radar_l*(1-[item.itemPercent[0] floatValue]));
for (int j = 1; j<=item.itemPercent.count; j++) {
float x = 0;
float y = 0;
if (j == self.elements.count) {
//终点,最终回到开始点坐标
CGContextAddLineToPoint(context, center_w, center_h-radar_l +radar_l*(1-[item.itemPercent[0] floatValue]));
} else {
double pi = (M_PI*2.0/(self.elements.count))*j;
Coordinate_2(pi,radar_l*[item.itemPercent[j] floatValue], center_w, center_h,&x, &y);
CGContextAddLineToPoint(context, x, y);
}
}
}
[rgba(247, 138, 67, 0.5) set];
//显示填充路径
CGContextFillPath(context);
CGContextRef context1 = UIGraphicsGetCurrentContext();
for (int i = 0; i<self.items.count; i++) {
ElementItem *item = self.items[i];
// 获取画布
CGContextSetStrokeColorWithColor(context1, item.itemColor.CGColor);
// 划线宽度
CGContextSetLineWidth(context1, 2);
CGContextMoveToPoint(context1, center_w, center_h-radar_l +radar_l*(1-[item.itemPercent[0] floatValue]));
for (int j = 1; j<=item.itemPercent.count; j++) {
float x = 0;
float y = 0;
if (j == self.elements.count) {
//终点,最终回到开始点坐标
CGContextAddLineToPoint(context1, center_w, center_h-radar_l +radar_l*(1-[item.itemPercent[0] floatValue]));
} else {
double pi = (M_PI*2.0/(self.elements.count))*j;
Coordinate_2(pi,radar_l*[item.itemPercent[j] floatValue], center_w, center_h,&x, &y);
CGContextAddLineToPoint(context1, x, y);
}
}
}
[rgba(255, 101, 0, 1) setStroke];
CGContextStrokePath(context1);//边框
}
- (void)buildCircle {
int r = 3;
// 话分割线
for (int j =1; j<=r; j++) {
// 获取画布
CGContextRef context = UIGraphicsGetCurrentContext();
// 划线颜色
if (self.lengthColor)
CGContextSetStrokeColorWithColor(context, self.lengthColor.CGColor);
else
CGContextSetStrokeColorWithColor(context, RGB_M(148, 148, 148).CGColor);
// 划线宽度
CGContextSetLineWidth(context, 1);
if (j == 3) {
CGFloat dashLen =0.0f;
CGContextSetLineDash(context, 0.0, &dashLen, 0);
}else {
CGFloat dashLen = 3.0f;
CGContextSetLineDash(context, 0.0, &dashLen, 1);
}
CGContextAddArc(context, center_w,center_h, ( radar_l/r)*j, 0, 2 * M_PI, 0);
CGContextStrokePath(context);
}
}
#pragma mark - 算落点坐标
void Coordinate_2 (double pi, float l, float c_w , float c_h, float *x, float *y) {
*x = c_w + sin(pi)*l;
*y = c_h - cos(pi)*l;
}
#pragma mark - 百分比占比label
- (UILabel *)buildPartLabelWithText:(NSString *)text Frame:(CGRect)frame{
UILabel *label = [[UILabel alloc]initWithFrame:frame];
label.textAlignment = NSTextAlignmentRight;
label.font = [UIFont systemFontOfSize:frame.size.height];
label.text = text;
return label;
}
#pragma mark - 能力测试方面label
- (UILabel *)buildElementLabelWithText:(NSString *)text Frame:(CGRect)frame Alignment:(NSTextAlignment)alignment {
UILabel *label = [[UILabel alloc]initWithFrame:frame];
label.textAlignment = alignment;
label.font = [UIFont systemFontOfSize:frame.size.height];
label.text = text;
label.textColor = rgba(68, 57, 53, 1);
return label;
}
#pragma mark - 能力评估描述
/*
- (void)abilityContent {
// 能力评估描述
self.contents = [[UITextView alloc]initWithFrame:CGRectMake(LENGTH(25), LENGTH(285), RADAR_WIDTH-LENGTH(50), RADAR_HEIGHT-LENGTH(300))];
self.contents.textColor = RGB_M(151, 156, 155);
self.contents.backgroundColor = [UIColor clearColor];
self.contents.font = [UIFont boldSystemFontOfSize:LENGTH(12)];
self.contents.editable = NO;
self.contents.textAlignment = NSTextAlignmentLeft;
[self addSubview:self.contents];
}
*/
#pragma mark - 能力评估的几个模块
/*
- (void)abillityOptions {
// 能力评估
self.ablilityLabel = [[UILabel alloc]initWithFrame:CGRectMake(RADAR_WIDTH-LENGTH(90), LENGTH(5), LENGTH(60), LENGTH(15))];
self.ablilityLabel.textAlignment = NSTextAlignmentRight;
self.ablilityLabel.font = [UIFont boldSystemFontOfSize:LENGTH(15)];
self.ablilityLabel.text = @"能力评估";
[self addSubview:self.ablilityLabel];
// 能力苹果模块
self.abilityBGView = [[UIView alloc] initWithFrame:CGRectMake(LENGTH(30), LENGTH(25), RADAR_WIDTH-LENGTH(60), LENGTH(10))];
[self addSubview:self.abilityBGView];
}
*/
- (void)addAbilitysWithElements:(NSArray <ElementItem*>*)elements {
[self.items addObjectsFromArray: elements];
for (int i = 0; i < self.items.count; i++) {
ElementItem *element = self.items[i];
Item *item = [[Item alloc]initWithFrame:CGRectMake( self.contSize.width-LENGTH(116)-LENGTH(70)*i, 0, LENGTH(56), LENGTH(10))];
item.itemLabel.text = element.itemName;
item.colorView.backgroundColor = element.itemColor;
[self.abilityBGView addSubview:item];
}
[self setNeedsDisplay];
}
- (void)setContent:(NSString *)content {
_content = content;
self.contents.text = content;
}
- (instancetype)initWithRadarElements:(NSArray *)elements size:(CGSize )size lengthColor:(UIColor *)lengthColor{
if (self = [super init]) {
self.contSize = size;
self.frame = CGRectMake(0, 0, size.width, size.height);
self.backgroundColor = [UIColor whiteColor];
self.elements = elements;
self.lengthColor = lengthColor;
self.items = [[NSMutableArray alloc]init];
radar_l = LENGTH(88);
center_w = size.width/2;
center_h = size.height/2 - LENGTH(15);
// [self abilityContent];
// [self abillityOptions];
}
return self;
}
- (void)drawRect:(CGRect)rect {
// 画主体内容
[self drawBody];
// 画分割线
// [self buildPart];
// 画圆圈
[self buildCircle];
// 画百分比占比
[self buildPercent];
}
@end
//
// SMSearchBar.h
// SkinMagnifier
//
// Created by nana on 2020/11/6.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMSearchBar : UIView
@property(nonatomic, copy)void (^valueChangeBlock)(NSString *value ,bool endEdit);
@property(nonatomic, strong)UITextField *inputTF;
@end
NS_ASSUME_NONNULL_END
//
// SMSearchBar.m
// SkinMagnifier
//
// Created by nana on 2020/11/6.
//
#import "SMSearchBar.h"
@interface SMSearchBar()
@property(nonatomic, strong)UIButton *btnPlaceholder;
@property(nonatomic, strong)UIButton *cancleBtn;
@end
@implementation SMSearchBar
- (instancetype)init
{
self = [super init];
if (self) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.inputTF = [[UITextField alloc] init];
self.inputTF.backgroundColor = rgba(247, 247, 248, 1);;
self.inputTF.leftViewMode = UITextFieldViewModeAlways;
self.inputTF.leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 10, 0)];
self.inputTF.rightViewMode = UITextFieldViewModeAlways;
self.inputTF.rightView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 10, 0)];
[self.inputTF addTarget:self action:@selector(inputTFtextBegin:) forControlEvents:UIControlEventEditingDidBegin];
[self.inputTF addTarget:self action:@selector(inputTFtextChange:) forControlEvents:UIControlEventEditingChanged];
[self.inputTF addTarget:self action:@selector(inputTFtextEnd:) forControlEvents:UIControlEventEditingDidEnd];
self.inputTF.font = [UIFont systemFontOfSize:14];
[self addSubview:self.inputTF];
self.btnPlaceholder = [[UIButton alloc] init];
self.btnPlaceholder.userInteractionEnabled = NO;
[self.btnPlaceholder wb_setImageName:@"list_icon_search"];
[self.btnPlaceholder setAttributedTitle:createAttString(@"搜索顾客", 14, rgba(153, 153, 153, 1)) forState:UIControlStateNormal];
self.btnPlaceholder.imageEdgeInsets = UIEdgeInsetsMake(0, -4.5, 0, 4.5);
[self addSubview:self.btnPlaceholder];
[self.btnPlaceholder sizeToFit];
self.cancleBtn = [[UIButton alloc] init];
[self.cancleBtn addTarget:self action:@selector(cancleBtnClick:) forControlEvents:UIControlEventTouchUpInside];
self.cancleBtn.alpha =0;
[self.cancleBtn setAttributedTitle:createAttString(@"取消", 14,rgba(76, 74, 66, 1)) forState:UIControlStateNormal];
[self addSubview:self.cancleBtn];
}
- (void)layoutSubviews {
[super layoutSubviews];
if (self.inputTF.frame.size.width<10) {
self.btnPlaceholder.center = CGPointMake(self.bounds.size.width/2, self.bounds.size.height/2);
self.inputTF.frame = self.bounds;
self.inputTF.layer.cornerRadius = self.bounds.size.height / 2;
self.inputTF.layer.masksToBounds = YES;
self.cancleBtn.frame = CGRectMake(self.bounds.size.width-60, 0, 60, self.bounds.size.height);
}
}
- (void)inputTFtextBegin:(UITextField *)tf {
if (self.valueChangeBlock) {
self.valueChangeBlock(@"", NO);
}
[UIView animateWithDuration:0.1 animations:^{
self.btnPlaceholder.center = CGPointMake(self.btnPlaceholder.frame.size.width/2+20, self.bounds.size.height/2);
self.inputTF.frame = CGRectMake(0, 0, self.bounds.size.width-60, self.bounds.size.height);
self.cancleBtn.alpha = 1;
}];
}
- (void)inputTFtextChange:(UITextField *)tf {
self.btnPlaceholder.hidden = tf.text.length;
if (self.valueChangeBlock) {
self.valueChangeBlock(tf.text, YES);
}
}
- (void)inputTFtextEnd:(UITextField *)tf {
if (self.valueChangeBlock) {
self.valueChangeBlock(@"", YES);
}
[UIView animateWithDuration:0.1 animations:^{
self.btnPlaceholder.center = CGPointMake(self.bounds.size.width/2, self.bounds.size.height/2);
self.inputTF.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height);
self.cancleBtn.alpha =0;
}];
}
- (void)cancleBtnClick:(UIButton *)btn {
self.inputTF.text = @"";
[self.inputTF sendActionsForControlEvents:UIControlEventEditingChanged];
[self.inputTF endEditing:YES];
}
@end
//
// SMShowTextView.h
// SkinMagnifier
//
// Created by nana on 2020/11/26.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMShowTextView : UIView
@end
NS_ASSUME_NONNULL_END
//
// SMShowTextView.m
// SkinMagnifier
//
// Created by nana on 2020/11/26.
//
#import "SMShowTextView.h"
@interface SMShowTextView()
@property(nonatomic ,strong)UILabel *textLabel;
@property(nonatomic ,strong)UIView *contView;
@end
@implementation SMShowTextView
- (void)showFromView:(UIView *)view text:(NSString *)text afterDelay:(CGFloat )afterDelay {
CGFloat tW = view.bounds.size.width- 100;
CGRect tRect = [text boundingRectWithSize:CGSizeMake(tW, MAXFLOAT)
options:NSStringDrawingUsesFontLeading|NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingTruncatesLastVisibleLine
attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:15]}
context:nil];
UIView *contView = [[UIView alloc] init];
contView.backgroundColor = rgba(51, 51, 51,0.3);
contView.layer.cornerRadius = 10;
contView.layer.masksToBounds= YES;
contView.frame = CGRectMake(50, 100,tW +40, tRect.size.height+40);
[view addSubview:contView];
UILabel *textLabel = [[UILabel alloc] init];
textLabel.numberOfLines = 0;
textLabel.attributedText = createAttString(text, 15, [UIColor whiteColor]);
textLabel.frame = CGRectMake(20, 20, tW, tRect.size.height);
[contView addSubview:textLabel];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(afterDelay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[contView removeFromSuperview];
});
}
@end
//
// SMYZMView.h
// SkinMagnifier
//
// Created by nana on 2020/12/10.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMYZMView : UIView
@property(nonatomic, strong)void (^editBlock)(NSString *str);
@end
NS_ASSUME_NONNULL_END
//
// SMYZMView.m
// SkinMagnifier
//
// Created by nana on 2020/12/10.
//
#import "SMYZMView.h"
@interface SMYZMView()
@property(nonatomic,strong)UITextField *inputTF;
@property(nonatomic,strong)NSMutableArray *btnArray;
@property(nonatomic,strong)UIImageView *gbImageView;
@end
@implementation SMYZMView
- (instancetype)init
{
self = [super init];
if (self) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.inputTF = [[UITextField alloc] init];
[self.inputTF addTarget:self action:@selector(tfTextChange:) forControlEvents:UIControlEventEditingChanged];
[self.inputTF addTarget:self action:@selector(tfTextEnd:) forControlEvents:UIControlEventEditingDidEnd];
self.inputTF.textColor = [UIColor clearColor];
self.inputTF.tintColor = [UIColor clearColor];
[self addSubview:self.inputTF];
[self.inputTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.mas_equalTo(0);
make.size.mas_equalTo(CGSizeMake(2, 2));
}];
self.btnArray = [[NSMutableArray alloc] init];
for (int i = 0; i < 4; i++) {
UIButton *oneBtn = [[UIButton alloc] init];
[oneBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
oneBtn.backgroundColor = rgba(241, 241, 241, 1);
oneBtn.layer.cornerRadius = 10;
[self addSubview:oneBtn];
[oneBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(i*(57+19));
make.centerY.mas_equalTo(0);
make.size.mas_equalTo(CGSizeMake(57, 57));
}];
[self.btnArray addObject:oneBtn];
}
NSMutableArray *imgArray = [[NSMutableArray alloc] init];
for (int i = 0; i < 10; i++) {
UIImage *img2 = [UIImage wb_imageWithColor:rgba(0, 0, 255, i/10.0) size:CGSizeMake(2, 20)];
[imgArray addObject:img2];
UIImage *img1 = [UIImage wb_imageWithColor:rgba(0, 0, 255, i/10.0) size:CGSizeMake(2, 20)];
[imgArray addObject:img1];
}
for (int i = 0; i < 10; i++) {
UIImage *img2 = [UIImage wb_imageWithColor:rgba(0, 0, 255, (10-i)/10.0) size:CGSizeMake(2, 20)];
[imgArray addObject:img2];
UIImage *img1 = [UIImage wb_imageWithColor:rgba(0, 0, 255, (10-i)/10.0) size:CGSizeMake(2, 20)];
[imgArray addObject:img1];
}
self.gbImageView = [[UIImageView alloc] init];
self.gbImageView.animationImages = imgArray;
[self.gbImageView startAnimating];
[self addSubview:self.gbImageView];
}
- (void)tfTextEnd:(UITextField *)tf {
self.gbImageView.hidden = YES;
}
- (void)btnClick:(UIButton *)btn {
[self.inputTF becomeFirstResponder];
self.inputTF.text = @"";
[self tfTextChange:self.inputTF];
}
- (void)tfTextChange:(UITextField *)tf {
for (int i = 0; i < self.btnArray.count; i++) {
UIButton *btn = self.btnArray[i];
if (tf.text.length > i) {
NSString *tString = [tf.text substringWithRange:NSMakeRange(i, 1)];
[btn setAttributedTitle:createAttString(tString, 25, rgba(51, 51, 51, 1)) forState:UIControlStateNormal];
}else {
[btn setAttributedTitle:createAttString(@"", 25, rgba(51, 51, 51, 1)) forState:UIControlStateNormal];
}
}
if (tf.text.length < self.btnArray.count) {
UIButton *lastBtn = self.btnArray[tf.text.length];
self.gbImageView.hidden = NO;
[self.gbImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.center.equalTo(lastBtn);
}];
}else {
self.gbImageView.hidden = YES;
if (self.editBlock) {
self.editBlock(tf.text);
}
tf.text = @"";
[self tfTextChange:tf];
}
}
@end
//
// UIView+Request.h
// MoistureOil
//
// Created by nana on 2020/4/2.
// Copyright © 2020 idankee. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "JFResponseModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface UIView (Request)
/// 设置授权服务器
+(void)setDefaultHost:(NSString *)host;
/// 设置授权默认值
+(void)setAuthorizationDefaultRequestValue:(NSString *)value key:(NSString *)key;
-(void)postFormDataWithUrl:(NSString *)url params:(NSDictionary *)params success:(void (^)(NSDictionary *responseObject,JFResponseModel *JsonData))success;
-(void)postJsonWithUrl:(NSString *)url params:(NSDictionary *)params success:(void (^)(NSDictionary *responseObject,JFResponseModel *JsonData))success;
-(void)postFormDataWithUrl:(NSString *)url params:(NSDictionary *)params showHUD:(BOOL)showHUD success:(void (^)(NSDictionary *responseObject,JFResponseModel *JsonData))success;
-(void)postJsonWithUrl:(NSString *)url params:(NSDictionary *)params showHUD:(BOOL)showHUD success:(void (^)(NSDictionary *responseObject,JFResponseModel *JsonData))success;
@end
NS_ASSUME_NONNULL_END
//
// UIView+Request.m
// MoistureOil
//
// Created by nana on 2020/4/2.
// Copyright © 2020 idankee. All rights reserved.
//
#import "UIView+Request.h"
#import <AFNetworking/AFNetworking.h>
#import <MJExtension/MJExtension.h>
#define kLimitNetwokTimeout (15)
@implementation UIView (Request)
static NSMutableDictionary *defaultDict = nil;
static NSString *defaultHost = nil;
/// 设置授权服务器
+(void)setDefaultHost:(NSString *)host {
defaultHost = host;
}
+(void)setAuthorizationDefaultRequestValue:(NSString *)value key:(NSString *)key {
if (!value || !key) {
return;
}
if (!defaultDict) {
defaultDict = [[NSMutableDictionary alloc] init];
}
defaultDict[key] = value;
}
-(NSString *)checkUrlString:(NSString *)url {
NSString *urlString = url;
if (![url hasPrefix:@"http:"]) {
if ([url hasPrefix:@"/"] && [defaultHost hasSuffix:@"/"]) {
urlString = [NSString stringWithFormat:@"%@%@",defaultHost,[url substringFromIndex:1]];
}else if (![url hasPrefix:@"/"] && ![defaultHost hasSuffix:@"/"]) {
urlString = [NSString stringWithFormat:@"%@/%@",defaultHost,url];
}else {
urlString = [NSString stringWithFormat:@"%@%@",defaultHost,url];
}
}
return urlString;
}
-(void)postFormDataWithUrl:(NSString *)url params:(NSDictionary *)params success:(void (^)(NSDictionary *responseObject,JFResponseModel *JsonData))success {
// self.userInteractionEnabled = NO;
NSString *urlString = [self checkUrlString:url];
AFHTTPSessionManager *manager=[AFHTTPSessionManager manager];
manager.requestSerializer.timeoutInterval = kLimitNetwokTimeout;
AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone];
//是否允许CA不信任的证书通过
policy.allowInvalidCertificates = YES;
//是否验证主机名
policy.validatesDomainName = NO;
manager.securityPolicy = policy;
__block BOOL requestState = NO;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// self.userInteractionEnabled = YES;
if (!requestState) {
[SVProgressHUD show];
}
});
/// 拼接授权
NSMutableDictionary *apDict = [[NSMutableDictionary alloc] initWithDictionary:params];
[apDict addEntriesFromDictionary:defaultDict];
[[manager POST:urlString parameters:apDict headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSLog(@"url:%@\nparameters:%@\nresponseObject:%@",urlString,apDict,responseObject);
requestState = YES;
[SVProgressHUD dismiss];
JFResponseModel *JsonData = [JFResponseModel mj_objectWithKeyValues:responseObject];
success(responseObject,JsonData);
if ([JsonData.code isEqualToString:@"-4"]) {
[self refreshToken];
}
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
requestState = YES;
[SVProgressHUD dismiss];
NSLog(@"url:%@\nparameters:%@\nresponseObject:%@",urlString,apDict,error);
success(nil,nil);
[SVProgressHUD showInfoWithStatus:(@"网络异常,请检查网络设置")];
}] resume] ;
}
-(void)postJsonWithUrl:(NSString *)url params:(NSDictionary *)params success:(void (^)(NSDictionary *responseObject,JFResponseModel *JsonData))success {
// self.userInteractionEnabled = NO;
/// 拼接授权
NSMutableArray *auUrlStringArray = [[NSMutableArray alloc] init];
for (NSString *key in [defaultDict allKeys]) {
[auUrlStringArray addObject:[NSString stringWithFormat:@"%@=%@",key,defaultDict[key]]];
}
NSString *urlString = [NSString stringWithFormat:@"%@?%@",[self checkUrlString:url],[auUrlStringArray componentsJoinedByString:@"&"]];
AFHTTPSessionManager *manager=[AFHTTPSessionManager manager];
manager.requestSerializer = [AFJSONRequestSerializer serializer];
manager.requestSerializer.timeoutInterval = kLimitNetwokTimeout;
AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone];
//是否允许CA不信任的证书通过
policy.allowInvalidCertificates = YES;
//是否验证主机名
policy.validatesDomainName = NO;
manager.securityPolicy = policy;
__block BOOL requestState = NO;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// self.userInteractionEnabled = YES;
if (!requestState) {
[SVProgressHUD show];
}
});
[[manager POST:urlString parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSLog(@"url:%@\nparameters:%@\nresponseObject:%@",urlString,params,responseObject);
requestState = YES;
[SVProgressHUD dismiss];
JFResponseModel *JsonData = [JFResponseModel mj_objectWithKeyValues:responseObject];
success(responseObject,JsonData);
if ([JsonData.code isEqualToString:@"-4"]) {
[self refreshToken];
}
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
requestState = YES;
[SVProgressHUD dismiss];
NSLog(@"url:%@\nparameters:%@\nresponseObject:%@",urlString,params,error);
success(nil,nil);
[SVProgressHUD showInfoWithStatus:(@"网络异常,请检查网络设置")];
}] resume];
}
-(void)postFormDataWithUrl:(NSString *)url params:(NSDictionary *)params showHUD:(BOOL)showHUD success:(void (^)(NSDictionary *responseObject,JFResponseModel *JsonData))success {
// self.userInteractionEnabled = NO;
NSString *urlString = [self checkUrlString:url];
AFHTTPSessionManager *manager=[AFHTTPSessionManager manager];
manager.requestSerializer.timeoutInterval = kLimitNetwokTimeout;
AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone];
//是否允许CA不信任的证书通过
policy.allowInvalidCertificates = YES;
//是否验证主机名
policy.validatesDomainName = NO;
manager.securityPolicy = policy;
__block BOOL requestState = NO;
if (showHUD) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// self.userInteractionEnabled = YES;
if (!requestState) {
[SVProgressHUD show];
}
});
}
/// 拼接授权
NSMutableDictionary *apDict = [[NSMutableDictionary alloc] initWithDictionary:params];
[apDict addEntriesFromDictionary:defaultDict];
[[manager POST:urlString parameters:apDict headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSLog(@"url:%@\nparameters:%@\nresponseObject:%@",urlString,apDict,responseObject);
requestState = YES;
if (showHUD) {
[SVProgressHUD dismiss];
}
JFResponseModel *JsonData = [JFResponseModel mj_objectWithKeyValues:responseObject];
success(responseObject,JsonData);
if ([JsonData.code isEqualToString:@"-4"]) {
[self refreshToken];
}
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
requestState = YES;
if (showHUD) {
[SVProgressHUD dismiss];
[SVProgressHUD showInfoWithStatus:(@"网络异常,请检查网络设置")];
}
NSLog(@"url:%@\nparameters:%@\nresponseObject:%@",urlString,apDict,error);
success(nil,nil);
}] resume] ;
}
-(void)postJsonWithUrl:(NSString *)url params:(NSDictionary *)params showHUD:(BOOL)showHUD success:(void (^)(NSDictionary *responseObject,JFResponseModel *JsonData))success {
NSMutableArray *auUrlStringArray = [[NSMutableArray alloc] init];
for (NSString *key in [defaultDict allKeys]) {
[auUrlStringArray addObject:[NSString stringWithFormat:@"%@=%@",key,defaultDict[key]]];
}
NSString *urlString = [NSString stringWithFormat:@"%@?%@",[self checkUrlString:url],[auUrlStringArray componentsJoinedByString:@"&"]];
AFHTTPSessionManager *manager=[AFHTTPSessionManager manager];
manager.requestSerializer = [AFJSONRequestSerializer serializer];
manager.requestSerializer.timeoutInterval = kLimitNetwokTimeout;
AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone];
//是否允许CA不信任的证书通过
policy.allowInvalidCertificates = YES;
//是否验证主机名
policy.validatesDomainName = NO;
manager.securityPolicy = policy;
__block BOOL requestState = NO;
if (showHUD) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// self.userInteractionEnabled = YES;
if (!requestState) {
[SVProgressHUD show];
}
});
}
[[manager POST:urlString parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSLog(@"url:%@\nparameters:%@\nresponseObject:%@",urlString,params,responseObject);
requestState = YES;
if (showHUD) {
[SVProgressHUD dismiss];
}
JFResponseModel *JsonData = [JFResponseModel mj_objectWithKeyValues:responseObject];
success(responseObject,JsonData);
if ([JsonData.code isEqualToString:@"-4"]) {
[self refreshToken];
}
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
requestState = YES;
if (showHUD) {
[SVProgressHUD dismiss];
[SVProgressHUD showInfoWithStatus:(@"网络异常,请检查网络设置")];
}
NSLog(@"url:%@\nparameters:%@\nresponseObject:%@",urlString,params,error);
success(nil,nil);
}] resume];
}
- (void)refreshToken {
@weakify(self);
[self postFormDataWithUrl:@"/token/createToken" params:nil showHUD:NO success:^(NSDictionary * _Nonnull responseObject, JFResponseModel * _Nonnull JsonData) {
@strongify(self);
if ([JsonData.code isEqualToString:@"200"] && [JsonData.data isKindOfClass:[NSArray class]]) {
NSArray *dataArray = (NSArray *)JsonData.data;
[UIView setAuthorizationDefaultRequestValue:dataArray.firstObject key:@"token"];
}
}];
}
@end
{
"magn_water": {
"one": "1.美容护理(重塑肌肤屏障):请勿祛角质,用热水洗脸,使用温和型洗面产品,一周敷2次以上补水面膜,使用霜类产品帮助锁水,注意防晒\n2.生活护理:保证每天8小时睡眠,1000-1500ml水分摄入,多吃富含维生素的食物和水果,如动物肝、牛奶、鸡蛋、红白萝卜、苹果、香蕉和梨等。",
"two": "提高角质层含水量:一周敷2次以上补水面膜,1次清洁面膜降低皮肤负担,洁面后及时使用补水保湿的护肤品,注意防晒",
"three": "注意防晒,继续保持~"
},
"magn_sensity": {
"one": "注意防晒,继续保持~",
"two": "简化护肤步骤,保留必要的保湿用品,注意防晒。",
"three": "避免过度清洁,,注意保湿补水,促进屏障功能修护。",
"four": "1.美容护理(重塑肌肤屏障):请勿祛角质,用热水洗脸,使用温和型洗面产品,使用霜类产品帮助锁水,注意防晒\n2.生活护理:检查和远离过敏源,尽量不要化浓妆,必要的话建议咨询皮肤专家进行治疗。作息规律,饮食营养来提高免疫力。"
},
"magn_wrinkle": {
"one": "注意防晒,继续保持~",
"two": "注意补水保湿,一周敷2次以上补水面膜,注意防晒",
"three": "注意补水保湿,一周敷2次以上补水面膜,注意防晒,到正规美容院采取筋膜层收紧治疗",
"four": "1.美容护理:科学的卸妆手法和按摩手法,使用添加VC,VE,VA,大豆提取物的抗皱产品,到正规医院采取治疗,如激光去皱,玻尿酸填充,注射肉毒素等,注意防晒\n2.生活护理:饮食营养,补充胶原蛋白,注意面部表情管理"
},
"magn_pore_large": {
"one": "注意清洁,继续保持~",
"two": "清洁控油,及时补水,保持水油平衡",
"three": "一周使用至少2次补水面膜,1次清洁面膜,保持水油平衡,注意防晒",
"four": "1.美容护理:注意清洁,请勿用手挤,补水防晒,必要的话可以采用物理治疗、医美治疗等。\n2.生活护理:坚持运动,增强新陈代谢,多吃青菜水果,适度胡萝卜、猪肝补充维生素A等多种维生素,减少多油脂、糖、淀粉食物摄入。"
},
"magn_pore_clogging": {
"one": "注意清洁,继续保持~",
"two": "清洁控油,及时补水,保持水油平衡",
"three": "一个月1次温和祛角质,一周使用至少2次补水面膜,1次清洁面膜,保持水油平衡,注意防晒",
"four": "1.美容护理:注意清洁,减少粉类化妆品使用,只涂防晒也要卸妆,在医生指导下使用抗菌药物如林可霉素,氧氟沙星,或者动用医疗美容手术,如点阵激光,微针。\n2.生活护理:11点前入睡,减少多油脂、糖、淀粉食物摄入,饮食清淡,调节内分泌。"
},
"magn_sebum": {
"one": "1.美容护理:不宜使用去角质或者磨砂类产品,使用温和清洁产品,避免碱性强、含果酸和磨砂的洁肤产品。每周可做一到二次面膜,加强保湿。洁面后立刻使用保湿性化妆水或乳液、乳霜来补充皮肤水分并按摩3~5分钟,以保持皮肤滋润,一年四季都应做好防晒工作。\n2.生活护理:饮食营养丰富",
"two": "坚持补水,继续保持~",
"three": "1.美容护理:请勿频繁使用吸油纸,使用皂基型洁面产品加强清洁力度,选择收敛控油的化妆水,质地轻薄的“无油”型保湿乳液及防晒霜,每两周做一次去角质。做好防晒\n2.生活护理:规律作息,少吃油腻的、以及含糖量高的食物,多吃新鲜的蔬菜和水果,多喝水,减少便秘保持大便通畅,以减轻皮肤出油。",
"four": "",
},
"magn_pigmentation": {
"one": "注意防晒,继续保持~",
"two": "一周使用2次以上补水面膜,1次美白面膜,注意防晒",
"three": "及时补水,选择保湿及修复类的产品,注意防晒,11点前入睡,饮食清淡,保持适量的运动,加快新陈代谢。",
"four":"1.美容护理:注意防晒,及时补水,使用含甘草,马齿苋成分的面膜缓解炎症,选择保湿及修复类的产品,必要的话可以采取医美治疗如光子嫩肤,激光祛斑。\n2.生活护理:服用维C,维B,花青素,少吃富含酪氨酸的食物,如马铃薯、红薯等,23点前入睡,饮食清淡,劳逸结合,多喝温开水"
}
}
{
"category":[
{
"bt":"痤疮",
"zz": " ",
"fa": "用不含皂基洗面奶清洁皮肤,洗完感觉脸上干净,皮肤柔润又不紧绷,不伤害皮肤角质层,多吃新鲜蔬菜和水果,注意补水保湿,饮食清淡,减少高糖、高脂肪、油腻的食物,作息规律,不要熬夜。必要的话采取物理治疗,如激光祛痘、光子嫩肤、果酸焕肤等。"
}
]
}
//
// PrefixHeader.pch
// SkinMagnifier
//
// Created by nana on 2020/11/4.
//
#ifndef PrefixHeader_pch
#define PrefixHeader_pch
// Include any system framework and library headers here that should be included in all compilation units.
// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
#define SV_APP_EXTENSIONS
//#import <opencv2/opencv.hpp>
//#import <opencv2/imgproc/types_c.h>
//#import <opencv2/imgcodecs/ios.h>
//#import <opencv2/dnn.hpp>
//#import <opencv2/dnn.hpp>
//#import <opencv2/imgproc.hpp>
//#import <opencv2/core/cvstd_wrapper.hpp>
#define KScreenWidth ([[UIScreen mainScreen]bounds].size.width)
#define KScreenHeight ([[UIScreen mainScreen]bounds].size.height)
#import "SMAIImageTool.h"
#import <Masonry/Masonry.h>
#import <SVProgressHUD/SVProgressHUD.h>
#import <UIImageView+WebCache.h>
#import <UIButton+WebCache.h>
#import <UIImage+Transform.h>
#import <MJRefresh/MJRefresh.h>
#import "SMBase.h"
#import "UIView+Request.h"
#import "SMGlobalModel.h"
#import <MJExtension/MJExtension.h>
#import "MMLocalDataBManager.h"
#import "MMAutoUploadTool.h"
#import "SMLocalReportBManager.h"
#import <NSString_RemoveEmoji/NSString_RemoveEmoji-Swift.h>
#endif /* PrefixHeader_pch */
//
// SMNavigationController.h
// SkinMagnifier
//
// Created by nana on 2020/11/4.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMNavigationController : UINavigationController
@end
NS_ASSUME_NONNULL_END
//
// SMNavigationController.m
// SkinMagnifier
//
// Created by nana on 2020/11/4.
//
#import "SMNavigationController.h"
@interface SMNavigationController ()
@property(nonatomic, weak)UIButton *backBtn;
@end
@implementation SMNavigationController
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationBar.hidden = YES;
self.interactivePopGestureRecognizer.enabled = NO;
// _backBtn = backBtn;
}
- (void)backClick:(UIButton *)btn {
UIViewController *vc = self.childViewControllers.lastObject ;
if ([NSStringFromClass([vc class]) isEqualToString:@"SMReportViewController"]) {
NSArray *vcArray = self.childViewControllers;
for (int i = 0; i < vcArray.count; i++) {
UIViewController *sVC = vcArray[i];
if ([NSStringFromClass([sVC class]) isEqualToString:@"SMCreateClientViewController"] ) {
[self popToViewController:vcArray[i-1] animated:YES];
return;
}else if ([NSStringFromClass([sVC class]) isEqualToString:@"SMTakeImageViewController"]) {
[self popToViewController:vcArray[i-1] animated:YES];
return;
}
}
}
[self popViewControllerAnimated:YES];
}
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
[super pushViewController:viewController animated:animated];
if (self.childViewControllers.count>1) {
UIViewController *vc = self.childViewControllers.lastObject;
UIButton *backBtn = [[UIButton alloc] init];
backBtn.frame =CGRectMake(10, safaTop(20) , 38, 45);
if (![NSStringFromClass([vc class]) isEqualToString:@"SMTakeImageViewController"]) {
// [backBtn wb_setImageName:@"nav_white_back"];
// }else {
[backBtn wb_setImageName:@"nav_black_back"];
}
[backBtn addTarget:self action:@selector(backClick:) forControlEvents:UIControlEventTouchUpInside];
[vc.view addSubview:backBtn];
[vc.view bringSubviewToFront:backBtn];
// self.backBtn.hidden = NO;
}else {
// self.backBtn.hidden = YES;
}
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.networking.wifi-info</key>
<true/>
</dict>
</plist>
/**
* author:SiZheng.Chen
* update date:20210120
**/
#include "BlockedPore.h"
BlockedPoreData detectBlocked(Mat image){
BlockedPoreData data;
if(image.empty()||image.type()!=CV_8UC3){
cout<<"image is empty or type error."<<endl;
data.blockedImg=image;
return data;
}
int THRESHOLD_MAX=25000;
int THRESHOLD_L=550;
int THRESHOLD_M=350;
int THRESHOLD_S=0;
Scalar MCOLOR_L=Scalar(99,54,255);
Scalar MCOLOR_M=Scalar(99,54,255);
Mat pore_gray_mat=detectGrayBlocked(image);
Mat pore_normal_mat=detectNormalBlocked(image);
Mat blocked = max(pore_gray_mat,pore_normal_mat);
Mat strcutKernel=getStructuringElement(MORPH_ELLIPSE,cv::Size(7,7));
erode(blocked,blocked,strcutKernel);
dilate(blocked,blocked,strcutKernel);
vector<vector<cv::Point> > contours;
vector<Vec4i> hirearchy;
int count_L=0;
int count_M=0;
double area_L=0;
double area_M=0;
findContours(blocked,contours,hirearchy,RETR_EXTERNAL,CHAIN_APPROX_SIMPLE);
for(int i=0;i<contours.size();++i){
double area = contourArea(contours[i]);
if(area>=THRESHOLD_L&&area<THRESHOLD_MAX){
drawContours(image,contours,i,MCOLOR_L,2);
count_L++;
area_L+=area;
}else if(area>=THRESHOLD_M&&area<THRESHOLD_L){
drawContours(image,contours,i,MCOLOR_M,2);
count_M++;
area_M+=area;
}else{
drawContours(blocked,contours,i,Scalar(0),FILLED);
}
}
data.blockedImg=image;
data.blockedCount=count_L+count_M;
data.blockedArea=area_L+area_M;
// imshow("win",image);
// waitKey();
return data;
}
Mat detectNormalBlocked(Mat image){
Mat hsvImg,grayImg;
cvtColor(image, hsvImg,COLOR_BGR2HSV);
vector<Mat> hsvList;
split(hsvImg,hsvList);
Mat light_image = Mat(image.size(),CV_8UC1,Scalar(255));
Mat colorMat;
applyColorMap(hsvList[0],colorMat,5);
hsvList.clear();
split(colorMat,hsvList);
Mat equa_image;
cv::Ptr<CLAHE> clahe=createCLAHE();
clahe->setClipLimit(1.9);
clahe->setTilesGridSize(cv::Size(10,10));
clahe->apply(hsvList[1],equa_image);
equa_image=light_image-equa_image;
// imshow("win",equa_image);
// waitKey();
Mat bin_image;
adaptiveThreshold(equa_image,bin_image,255,ADAPTIVE_THRESH_GAUSSIAN_C,THRESH_BINARY,225,-25);
Mat structKernel=getStructuringElement(MORPH_RECT,cv::Size(5,5));
erode(bin_image,bin_image,structKernel);
dilate(bin_image,bin_image,structKernel);
Mat darkImg=Mat(image.size(),CV_8UC3,Scalar(0,0,0));
Mat mask_image;
add(image,darkImg,mask_image,bin_image);
// imshow("win",mask_image);
// waitKey();
vector<vector<cv::Point> > contours;
vector<Vec4i> hirearchy;
findContours(bin_image,contours,hirearchy,RETR_EXTERNAL,CHAIN_APPROX_SIMPLE);
vector<vector<cv::Point> > filterContours;
for(int i=0;i<contours.size();++i){
double area=contourArea(contours[i]);
if(150<=area&&area<=29000){
RotatedRect rrt=minAreaRect(contours[i]);
float width=rrt.size.width>rrt.size.height?rrt.size.width:rrt.size.height;
float height=rrt.size.width<rrt.size.height?rrt.size.width:rrt.size.height;
float eccentricity=(width+height)!=0?(width-height)/(width+height):1.0;
cv::Rect box=boundingRect(contours[i]);
int x0=box.x;
int y0=box.y;
int x3=x0+box.width;
int y3=y0+box.height;
float sum_red=0;
float sum_green=0;
float sum_blue=0;
for(int j=x0;j<x3;++j){
for(int k=y0;k<y3;++k){
int gray_value=(int)bin_image.at<uchar>(k,j);
if(gray_value==255){
Vec3b pix=mask_image.at<Vec3b>(k,j);
sum_blue+=pix[0];
sum_green+=pix[1];
sum_red+=pix[2];
}
}
}
double rrtArea = width*height;
double ra = area/rrtArea;
sum_red=sum_red!=0?sum_red:1;
sum_green=sum_green!=0?sum_green:1;
sum_blue=sum_blue!=0?sum_blue:1;
float r1 = sum_blue/sum_red;
float r2 = sum_blue/sum_green;
float r3 = sum_red /sum_green;
if(r3>=1.55||eccentricity>0.365||ra<0.5){ // 0.25-->0.365
filterContours.push_back(contours[i]);
}
}
}
cout<<"filterContours size:"<<filterContours.size()<<endl;
drawContours(bin_image,filterContours,-1,Scalar(0),FILLED);
// imshow("win",bin_image);
// waitKey();
return bin_image;
}
Mat detectGrayBlocked(Mat image){
Mat hsvImg,labImg,grayImg;
cvtColor(image,grayImg,COLOR_BGR2GRAY);
cvtColor(image,labImg,COLOR_BGR2Lab);
cvtColor(image,hsvImg,COLOR_BGR2HSV);
vector<Mat> labList,hsvList;
split(labImg,labList);
split(hsvImg,hsvList);
Mat a=labList[1];
Mat v = hsvList[2];
Mat light_mat=Mat(a.size(),CV_8UC1,Scalar(255));
Scalar avg_a = mean(a);
GaussianBlur(v,v,cv::Size(3,3),0);
GaussianBlur(grayImg,grayImg,cv::Size(7,7),0);
// Mat v_mask;
// adaptiveThreshold(v,v_mask,255,ADAPTIVE_THRESH_GAUSSIAN_C,THRESH_BINARY,235,-48);
vector<vector<cv::Point> > contours;
vector<Vec4i> hirearchy;
// findContours(v_mask,contours,hirearchy,RETR_CCOMP,CHAIN_APPROX_SIMPLE);
// drawContours(a,contours,-1,avg_a,FILLED);
Mat equa_image;
cv::Ptr<CLAHE> clahe=createCLAHE();
clahe->setClipLimit(3.5);
clahe->setTilesGridSize(cv::Size(10,10));
clahe->apply(a,equa_image);
equa_image = light_mat-equa_image;
// imshow("w",equa_image);
// waitKey();
Mat bin_image;
adaptiveThreshold(equa_image,bin_image,255,ADAPTIVE_THRESH_GAUSSIAN_C,THRESH_BINARY,225,-21);
Mat erode_kernel=getStructuringElement(MORPH_RECT,cv::Size(3,3));
erode(bin_image,bin_image,erode_kernel);
dilate(bin_image,bin_image,erode_kernel);
// imshow("w",bin_image);
// waitKey();
contours.clear();
hirearchy.clear();
// cout<<"contours size:"<<contours.size()<<endl;
findContours(bin_image,contours,hirearchy,RETR_EXTERNAL,CHAIN_APPROX_SIMPLE);
for(int i=0;i<contours.size();++i){
double area=contourArea(contours[i]);
RotatedRect box=minAreaRect(contours[i]);
float width=box.size.width>box.size.height?box.size.width:box.size.height;
float height=box.size.width<box.size.height?box.size.width:box.size.height;
float eccentricity=(width+height)!=0?(width-height)/(width+height):1.0;
if(area>=350&&area<=80000&&eccentricity<=0.3){
}else{
drawContours(bin_image,contours,i,Scalar(0),FILLED);
}
}
// imshow("w",bin_image);
// waitKey();
return bin_image;
}
/**
* author:SiZheng.Chen
* update date:20210120
**/
//#pragma once
#include <iostream>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
struct BlockedPoreData
{
Mat blockedImg;
double blockedArea;
int blockedCount;
};
BlockedPoreData detectBlocked(Mat image);
Mat detectGrayBlocked(Mat image);
Mat detectNormalBlocked(Mat image);
//
// SMAIImageTool.h
// SkinMagnifier
//
// Created by nana on 2021/1/7.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SMAIImageTool : NSObject
/// 极化图 --> 毛孔出大
+(NSDictionary *)haoKongCuDaWithJihuaImg:(UIImage *)jihuaImg;
/// 纹理图 --> 皱纹
+(NSDictionary *)zhouwenWithWenLiImg:(UIImage *)WenLiImg;
/// UV --> 毛孔堵塞
+(NSDictionary *)haoKongDuSheWithUVImg:(UIImage *)UVImg;
/// 日光图 --> 皮质
+(NSDictionary *)piZhiDuSheWithRiGuangImg:(UIImage *)RiGuangImg;
/// 极化图 --> 敏感
+(NSDictionary *)minGanWithJihuaImg:(UIImage *)jihuaImg;
/// 极化图 --> 色沉
+(NSDictionary *)seChenWithJihuaImg:(UIImage *)jihuaImg;
@end
NS_ASSUME_NONNULL_END
//
// SMAIImageTool.m
// SkinMagnifier
//
// Created by nana on 2021/1/7.
//
#import "SMAIImageTool.h"
#import "brown.h"
#import "roughPore.h"
#import "wrinkle.h"
#import "BlockedPore.h"
#import <opencv2/imgcodecs/ios.h>
#define pi (3.141592654)
@implementation SMAIImageTool
//皮脂hhsas
float hormone_process(cv::Mat image, cv::Mat map)
{
float ss = 0;
float ratio = 0;
float s = image.cols * image.rows;
cv::Mat gray;
// 获取原图的灰度图
cv::cvtColor(image, gray, COLOR_BGR2GRAY);
// 获取伪色卡图
cv::applyColorMap(gray, map, COLORMAP_COOL);
// cv::imwrite("./1.jpg", map);
// 获取伪色卡的灰度图
cv::cvtColor(map, gray, COLOR_BGR2GRAY);
// 阈值分割
cv::threshold(gray, gray, 127, 255, cv::THRESH_OTSU+cv::THRESH_BINARY_INV);
cv::threshold(gray, gray, 134, 255, cv::THRESH_BINARY);
cv::Mat kernel = cv::getStructuringElement(MORPH_RECT, cv::Size(3,3));
// 膨胀操作
cv::dilate(gray, gray, kernel, cv::Point(-1,-1), 1);
//cv::imwrite("./2.jpg", gray);
std::vector<std::vector<cv::Point> > contours;
// 获取轮廓
cv::findContours(gray, contours, cv::RETR_LIST, cv::CHAIN_APPROX_SIMPLE);
//计算面积占比
ss = cv::countNonZero(gray);
// if (contours.size() > 0)
// {
// for (int i = 0; i < contours.size(); i++)
// {
// vector<cv::Point> c = contours[i];
// float area = fabs(cv::contourArea(c));
// ss = ss + area;
// }
// }
ratio = ss / s * 100;
cv::Mat mask = cv::Mat::zeros(gray.rows, gray.cols, image.type());
cv::fillPoly(mask, contours, cv::Scalar(0, 255, 0));
// cv::imwrite("./3.jpg", mask);
// cout << mask.type() << endl;
cv::addWeighted(image, 1.0, mask, 0.4, 0, map);
// cv::imwrite("./hormone.jpg", map);
return ratio;
}
//红区
float red_process(cv::Mat image, cv::Mat pink, cv::Mat map)
{
float ss = 0;
float ratio = 0;
float s = image.cols * image.rows;
cv::Mat pink_gray;
// 获取原图的灰度图
cv::cvtColor(pink, pink_gray, COLOR_BGR2GRAY);
// 获取伪色卡图
cv::applyColorMap(pink_gray, map, COLORMAP_RAINBOW);
// cv::imwrite("./result1/2.jpg", map);
cv::cvtColor(map, pink_gray, COLOR_BGR2HSV);
cv::inRange(pink_gray, Scalar(11, 254, 254), Scalar(33, 255, 255), pink_gray);
// cv::imwrite("./4.jpg", map);
std::vector<std::vector<cv::Point> > contours;
// 获取轮廓
cv::findContours(pink_gray, contours, cv::RETR_LIST, cv::CHAIN_APPROX_SIMPLE);
//计算面积占比
ss = cv::countNonZero(pink_gray);
// if (contours.size() > 0)
// {
// for (int i = 0; i < contours.size(); i++)
// {
// vector<cv::Point> c = contours[i];
// float area = fabs(cv::contourArea(c));
// ss = ss + area;
// }
// }
ratio = ss / s * 100;
cv::Mat mask = cv::Mat::zeros(pink_gray.rows, pink_gray.cols, image.type());
cv::fillPoly(mask, contours, cv::Scalar(0, 0, 255));
// cv::imwrite("./5.jpg", mask);
// cout << mask.type() << endl;
cv::addWeighted(image, 1.0, mask, 0.4, 0, map);
// cv::imwrite("./result/4.jpg", map);
return ratio;
}
//色沉
float dull_process(cv::Mat image, cv::Mat brown, cv::Mat result)
{
float ss = 0;
float ratio = 0;
float s = image.cols * image.rows;
cv::Mat brown_gray;
// 获取棕图的灰度图
cv::cvtColor(brown, brown_gray, COLOR_BGR2GRAY);
// 阈值分割
cv::threshold(brown_gray, brown_gray, 70, 255, cv::THRESH_BINARY_INV);
// cv::imwrite("./4.jpg", brown_gray);
std::vector<std::vector<cv::Point> > contours;
// 获取轮廓
cv::findContours(brown_gray, contours, cv::RETR_LIST, cv::CHAIN_APPROX_SIMPLE);
//计算面积占比
ss = cv::countNonZero(brown_gray);
// if (contours.size() > 0)
// {
// for (int i = 0; i < contours.size(); i++)
// {
// vector<cv::Point> c = contours[i];
// float area = fabs(cv::contourArea(c));
// ss = ss + area;
// }
// }
ratio = ss / s * 100;
cv::Mat mask = cv::Mat::zeros(brown_gray.rows, brown_gray.cols, image.type());
cv::fillPoly(mask, contours, cv::Scalar(0, 255, 255));
//cv::imwrite("./3.jpg", mask);
cv::addWeighted(image, 1.0, mask, 0.4, 0, result);
//cv::imwrite("./dull.jpg", result);
return ratio;
}
int pink_image_processing( cv::Mat img, cv::Mat& pink_gray, cv::Mat& pink_image)
{
int width, height;
int y, cb, cr;
double a = 0.82556;
double c = -268;
double d = 0;
int length_p = 0;
// double dtime = what_time_is_it_now();
double p[] = {0.20141, 0.20654, 0.21182, 0.21723, 0.22279, 0.22849, 0.23435, 0.24036, 0.24652, 0.25284, 0.25933, 0.26598, 0.27279, 0.27978, 0.28694, 0.29427,
0.30177, 0.30945, 0.31731, 0.32535, 0.33357, 0.34197, 0.35055, 0.35932, 0.36826, 0.37739, 0.38669, 0.39617, 0.40583, 0.41566, 0.42565, 0.43582,
0.44614, 0.45662, 0.46726, 0.47804, 0.48895, 0.50000, 0.51117, 0.52246, 0.53385, 0.54534, 0.55691, 0.56856, 0.58027, 0.59203, 0.60383, 0.61565,
0.62749, 0.63932, 0.65113, 0.66291, 0.67465, 0.68632, 0.69792, 0.70942, 0.72082, 0.73209, 0.74323, 0.75421, 0.76503, 0.77567, 0.78612, 0.79636,
0.80639, 0.81618, 0.82574, 0.83505, 0.84410, 0.85289, 0.86141, 0.86965, 0.87760, 0.88527, 0.89265, 0.89973, 0.90653, 0.91303, 0.91923, 0.92515,
0.93077, 0.93612, 0.94118, 0.94596, 0.95047, 0.95472, 0.95871, 0.96245, 0.96594, 0.96920, 0.97223, 0.97504, 0.97764, 0.98004, 0.98225, 0.98427,
0.98612, 0.98780, 0.98933, 0.99072, 0.99197, 0.99308, 0.99408, 0.99497, 0.99575, 0.99644, 0.99704, 0.99757, 0.99802, 0.99840, 0.99873, 0.99900,
0.99923, 0.99941, 0.99956, 0.99968, 0.99978, 0.99985, 0.99990, 0.99994, 0.99996, 0.99998, 0.99999, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000};
// const unsigned char pink_gray_r[256] = { 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 95, 99, 99, 100, 100, 104, 110, 114, 115, 115, 120, 122, 126, 127, 130, 133, 134, 136, 138, 140, 140, 143, 144, 145, 147, 147, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 161, 162, 163, 164, 164, 166, 166, 167, 167, 169, 169, 170, 171, 172, 172, 173, 174, 174, 175, 175, 176, 177, 177, 178, 178, 179, 180, 181, 181, 182, 182, 183, 184, 184, 184, 186, 186, 186, 187, 188, 188, 189, 189, 190, 191, 191, 192, 192, 192, 193, 194, 194, 195, 195, 196, 197, 197, 197, 198, 198, 199, 200, 200, 200, 201, 202, 202, 203, 203, 203, 204, 205, 205, 205, 206, 206, 207, 207, 208, 208, 209, 209, 209, 210, 211, 211, 211, 212, 212, 213, 213, 214, 214, 215, 215, 215, 216, 217, 217, 217, 218, 218, 219, 219, 219, 220, 220, 221, 221, 222, 222, 223, 223, 223, 224, 224, 225, 225, 225, 226, 226, 227, 227, 228, 228, 228, 229, 229, 229, 230, 230, 231, 231, 231, 232, 233, 233, 233, 234, 234, 234, 235, 235, 236, 236, 236, 237, 237, 237, 238, 239, 239, 239, 240, 240, 240, 241, 241, 241, 242, 242, 242, 243, 243, 243, 244, 244, 245, 245, 245, 246, 246, 246, 247, 248, 248, 248, 248, 249, 250, 250, 250, 250, 251, 251, 251, 252, 252, 253, 253, 253, 254, 254, 254, 254, 255};
// const unsigned char pink_gray_g[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 9, 10, 16, 18, 21, 25, 27, 29, 32, 34, 35, 38, 40, 43, 44, 47, 48, 51, 52, 54, 56, 57, 60, 61, 63, 65, 66, 67, 69, 71, 73, 74, 75, 78, 78, 80, 82, 83, 84, 85, 87, 88, 89, 91, 92, 93, 95, 97, 98, 100, 100, 102, 104, 105, 105, 107, 107, 109, 110, 111, 113, 114, 115, 117, 118, 119, 120, 122, 122, 123, 124, 126, 127, 128, 129, 131, 131, 132, 133, 135, 136, 137, 137, 139, 140, 141, 142, 144, 144, 145, 146, 148, 148, 149, 150, 151, 153, 153, 154, 155, 157, 157, 158, 159, 161, 161, 162, 163, 164, 166, 166, 167, 168, 170, 170, 171, 172, 173, 173, 175, 176, 177, 177, 179, 179, 180, 181, 183, 183, 184, 185, 186, 186, 188, 189, 189, 190, 192, 192, 193, 194, 195, 195, 197, 197, 198, 199, 199, 201, 202, 202, 203, 205, 205, 206, 207, 207, 208, 210, 210, 211, 212, 212, 214, 214, 215, 216, 217, 217, 219, 220, 220, 221, 222, 223, 223, 225, 225, 226, 227, 227, 228, 229, 230, 231, 232, 232, 233, 234, 235, 236, 236, 237, 238, 239, 239, 241, 241, 242, 243, 243, 245, 245, 246, 247, 247, 248, 249, 250, 250, 251, 252, 252, 254, 254, 255};
// const unsigned char pink_gray_b[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 10, 15, 17, 21, 27, 28, 29, 34, 36, 39, 42, 44, 46, 49, 50, 52, 54, 56, 59, 60, 62, 64, 66, 67, 70, 71, 72, 74, 76, 78, 79, 80, 82, 83, 85, 86, 88, 89, 91, 91, 94, 95, 96, 97, 98, 100, 101, 102, 103, 104, 105, 107, 109, 110, 111, 111, 114, 115, 116, 116, 119, 119, 120, 121, 122, 123, 125, 126, 127, 128, 129, 131, 132, 132, 133, 134, 135, 137, 138, 139, 140, 140, 141, 143, 144, 145, 146, 146, 147, 149, 150, 151, 152, 152, 153, 155, 156, 156, 157, 158, 159, 161, 161, 162, 163, 164, 164, 165, 166, 168, 168, 169, 170, 171, 172, 172, 174, 175, 176, 176, 177, 178, 180, 180, 181, 182, 183, 183, 184, 184, 186, 187, 188, 188, 189, 190, 192, 192, 193, 194, 194, 195, 196, 196, 198, 199, 200, 200, 201, 201, 202, 204, 204, 205, 206, 206, 207, 208, 208, 210, 211, 211, 212, 213, 213, 214, 216, 216, 217, 217, 218, 219, 220, 220, 222, 223, 223, 224, 224, 225, 225, 227, 227, 227, 229, 229, 230, 231, 232, 232, 233, 233, 235, 236, 236, 237, 237, 238, 239, 241, 241, 242, 242, 243, 244, 244, 245, 245, 247, 248, 248, 248, 249, 250, 250, 251, 253, 253, 254, 254, 255};
const unsigned char pink_gray_r[256] = {91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 95, 99, 99, 100, 100, 104,
110, 114, 115, 115, 120, 122, 126, 127, 130, 133, 134, 136, 138, 140, 140, 143, 144, 145, 147, 147, 149, 150, 151, 152, 153, 154, 155,
156, 157, 158, 159, 160, 161, 161, 162, 163, 164, 164, 166, 166, 167, 167, 169, 169, 170, 171, 172, 172, 173, 174, 174, 175, 175, 176,
177, 177, 178, 178, 179, 180, 181, 181, 182, 182, 183, 184, 184, 184, 186, 186, 186, 187, 188, 188, 189, 189, 190, 191, 191, 192, 192,
192, 193, 194, 194, 195, 195, 196, 197, 197, 197, 198, 198, 199, 200, 200, 200, 201, 202, 202, 203, 203, 203, 204, 205, 205, 205, 206,
206, 207, 207, 208, 208, 209, 209, 209, 210, 211, 211, 211, 212, 212, 213, 213, 214, 214, 215, 215, 215, 216, 217, 217, 217, 218, 218,
219, 219, 219, 220, 220, 221, 221, 222, 222, 223, 223, 223, 224, 224, 225, 225, 225, 226, 226, 227, 227, 228, 228, 228, 229, 229, 229,
230, 230, 231, 231, 231, 232, 233, 233, 233, 234, 234, 234, 235, 235, 236, 236, 236, 237, 237, 237, 238, 239, 239, 239, 240, 240, 240,
241, 241, 241, 242, 242, 242, 243, 243, 243, 244, 244, 245, 245, 245, 246, 246, 246, 247, 248, 248, 248, 248, 249, 250, 250, 250, 250,
251, 251, 251, 252, 252, 253, 253, 253, 254, 254, 254, 254, 255};
const unsigned char pink_gray_g[256] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 9, 10, 16, 18, 21, 25, 27, 29, 32, 34, 35, 38, 40, 43,
44, 47, 48, 51, 52, 54, 56, 57, 60, 61, 63, 65, 66, 67, 69, 71, 73, 74, 75, 78, 78, 80, 82, 83, 84, 85, 87,
88, 89, 91, 92, 93, 95, 97, 98, 100, 100, 102, 104, 105, 105, 107, 107, 109, 110, 111, 113, 114, 115, 117, 118, 119, 120, 122,
122, 123, 124, 126, 127, 128, 129, 131, 131, 132, 133, 135, 136, 137, 137, 139, 140, 141, 142, 144, 144, 145, 146, 148, 148, 149, 150,
151, 153, 153, 154, 155, 157, 157, 158, 159, 161, 161, 162, 163, 164, 166, 166, 167, 168, 170, 170, 171, 172, 173, 173, 175, 176, 177,
177, 179, 179, 180, 181, 183, 183, 184, 185, 186, 186, 188, 189, 189, 190, 192, 192, 193, 194, 195, 195, 197, 197, 198, 199, 199, 201,
202, 202, 203, 205, 205, 206, 207, 207, 208, 210, 210, 211, 212, 212, 214, 214, 215, 216, 217, 217, 219, 220, 220, 221, 222, 223, 223,
225, 225, 226, 227, 227, 228, 229, 230, 231, 232, 232, 233, 234, 235, 236, 236, 237, 238, 239, 239, 241, 241, 242, 243, 243, 245, 245,
246, 247, 247, 248, 249, 250, 250, 251, 252, 252, 254, 254, 255};
const unsigned char pink_gray_b[256] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 4, 10, 15, 17, 21, 27, 28, 29, 34, 36, 39, 42, 44, 46, 49, 50, 52, 54, 56, 59,
60, 62, 64, 66, 67, 70, 71, 72, 74, 76, 78, 79, 80, 82, 83, 85, 86, 88, 89, 91, 91, 94, 95, 96, 97, 98, 100,
101, 102, 103, 104, 105, 107, 109, 110, 111, 111, 114, 115, 116, 116, 119, 119, 120, 121, 122, 123, 125, 126, 127, 128, 129, 131, 132,
132, 133, 134, 135, 137, 138, 139, 140, 140, 141, 143, 144, 145, 146, 146, 147, 149, 150, 151, 152, 152, 153, 155, 156, 156, 157, 158,
159, 161, 161, 162, 163, 164, 164, 165, 166, 168, 168, 169, 170, 171, 172, 172, 174, 175, 176, 176, 177, 178, 180, 180, 181, 182, 183,
183, 184, 184, 186, 187, 188, 188, 189, 190, 192, 192, 193, 194, 194, 195, 196, 196, 198, 199, 200, 200, 201, 201, 202, 204, 204, 205,
206, 206, 207, 208, 208, 210, 211, 211, 212, 213, 213, 214, 216, 216, 217, 217, 218, 219, 220, 220, 222, 223, 223, 224, 224, 225, 225,
227, 227, 227, 229, 229, 230, 231, 232, 232, 233, 233, 235, 236, 236, 237, 237, 238, 239, 241, 241, 242, 242, 243, 244, 244, 245, 245,
247, 248, 248, 248, 249, 250, 250, 251, 253, 253, 254, 254, 255};
length_p = sizeof(p) / sizeof(double);
if (img.empty()) return -1;
width = img.cols;
height = img.rows;
pink_gray =cv::Mat(img.size(), CV_8UC1);
if (pink_gray.empty()) return -2;
cv::Mat ycbcrimg;
cvtColor(img, ycbcrimg, cv::COLOR_BGR2YCrCb);
std::vector<cv::Mat> imgs;
split(ycbcrimg, imgs);
imgs[0] = imgs[0] + 16;
merge(imgs, ycbcrimg);
for (int i = 0; i < height; i++)
{
uchar* pgray = pink_gray.data + pink_gray.step * i;
uchar* pycbcr = ycbcrimg.data + ycbcrimg.step * i;
for (int j = 0; j < width; j++)
{
int gray;
y = pycbcr[0];
cr = pycbcr[1];
cb = pycbcr[2];
if (y < length_p)
d = 4.25 * (a * cb + cr + c) * p[y] - (1 - p[y]) * 170;
else
d = 4.25 * (a * cb + cr + c);
if (d > 0)
gray = 31;
else
gray = 0.0076 * d * d + 31;
if (gray > 255) gray = 255;
*pgray = gray;
pgray++;
pycbcr += 3;
}
}
GaussianBlur(pink_gray, pink_gray, cv::Size(5,5), 1.6);
cv::Mat pink_color(256, 1, CV_8UC3);
for(int i = 0; i < 256; i++) {
pink_color.at<cv::Vec3b>(i)[0] = pink_gray_b[i];
pink_color.at<cv::Vec3b>(i)[1] = pink_gray_g[i];
pink_color.at<cv::Vec3b>(i)[2] = pink_gray_r[i];
}
applyColorMap(pink_gray, pink_image, pink_color);
// cv::imwrite("./33.jpg", pink_image);
return 0;
}
+(NSDictionary *)haoKongCuDaWithJihuaImg:(UIImage *)jihuaImg {
cv::Mat cvImage;
UIImageToMat(jihuaImg, cvImage);
cvtColor(cvImage,cvImage,COLOR_RGBA2BGR);
RoughPoreData resultData = detectRoughPore(cvImage);
cv::Mat outImg;
cvtColor(resultData.roughImg,outImg,COLOR_BGR2RGBA);
UIImage *image = MatToUIImage(outImg);
NSMutableDictionary *rDict = [NSMutableDictionary new];
rDict[@"image"] = image;
rDict[@"roughPoreCount"] = @(resultData.roughPoreCount);
rDict[@"avgRadius"] = @(resultData.avgRadius);
rDict[@"roughArea"] = @(resultData.roughArea);
return rDict;
}
+(NSDictionary *)zhouwenWithWenLiImg:(UIImage *)wenLiImg {
cv::Mat cvImage;
UIImageToMat(wenLiImg, cvImage);
cvtColor(cvImage,cvImage,COLOR_RGBA2BGR);
WrinkleData resultData = detectWrinkle(cvImage);
cv::Mat outImg;
cvtColor(resultData.wrinkleImg,outImg,COLOR_BGR2RGBA);
UIImage *image = MatToUIImage(outImg);
NSMutableDictionary *rDict = [NSMutableDictionary new];
rDict[@"image"] = image;
rDict[@"wrinkleCount"] = @(resultData.wrinkleCount);
rDict[@"wrinkleLenth"] = @(resultData.wrinkleLenth);
return rDict;
}
+(NSDictionary *)haoKongDuSheWithUVImg:(UIImage *)UVImg {
cv::Mat cvImage;
UIImageToMat(UVImg, cvImage);
cvtColor(cvImage,cvImage,COLOR_RGBA2BGR);
BlockedPoreData resultData=detectBlocked(cvImage);
cv::Mat outImg;
cvtColor(resultData.blockedImg,outImg,COLOR_BGR2RGBA);
UIImage *image = MatToUIImage(outImg);
NSMutableDictionary *rDict = [NSMutableDictionary new];
rDict[@"image"] = image;
rDict[@"blockedArea"] = @(resultData.blockedArea);
rDict[@"blockedCount"] = @(resultData.blockedCount);
return rDict;
}
+(NSDictionary *)piZhiDuSheWithRiGuangImg:(UIImage *)RiGuangImg{
cv::Mat cvImage;
UIImageToMat(RiGuangImg, cvImage);
cvtColor(cvImage,cvImage,COLOR_RGBA2BGR);
cv::Mat map = cv::Mat::zeros(cvImage.rows, cvImage.cols, cvImage.type());
float ratio = hormone_process(cvImage, map);
cvtColor(map,map,COLOR_BGR2RGBA);
UIImage *image = MatToUIImage(map);
NSMutableDictionary *rDict = [NSMutableDictionary new];
rDict[@"image"] = image;
rDict[@"ratio"] = @(ratio);
return rDict;
}
+(NSDictionary *)minGanWithJihuaImg:(UIImage *)jihuaImg {
cv::Mat cvImage;
UIImageToMat(jihuaImg, cvImage);
cvtColor(cvImage,cvImage,COLOR_RGBA2BGR);
// DKmaskPictureDraws *drawAi = [[DKmaskPictureDraws alloc]init];
//棕色图
#pragma 棕色图 未完成
// UIImage *pinkimage = [self getPinkImage:jihuaImg] ;//[drawAi getAIpic:PinkImageType with:img and:img];
// UIImageToMat(pinkimage, cvPinkimage);
cv::Mat cvPinkGray;
cv::Mat cvPinkimage;
pink_image_processing(cvImage, cvPinkGray, cvPinkimage);
cv::Mat map = cv::Mat::zeros(cvImage.rows, cvImage.cols, cvImage.type());
float ratio = red_process(cvImage, cvPinkimage, map);
cvtColor(map,map,COLOR_BGR2RGBA);
UIImage *image = MatToUIImage(map);
NSMutableDictionary *rDict = [NSMutableDictionary new];
rDict[@"image"] = image;
rDict[@"ratio"] = @(ratio);
return rDict;
}
+(NSDictionary *)seChenWithJihuaImg:(UIImage *)jihuaImg{
cv::Mat cvImage;
UIImageToMat(jihuaImg, cvImage);
cvtColor(cvImage,cvImage,COLOR_RGBA2BGR);
cv::Mat gray, brown_image;
int a = brown_image_processing(cvImage, gray, brown_image);
// DKopencvDrawPic *drawAi = [[DKopencvDrawPic alloc]init];
// UIImage *dullimage = [UIImage imageNamed:@"zongse"];
cv::Mat map = cv::Mat::zeros(cvImage.rows, cvImage.cols, cvImage.type());
float ratio = dull_process(cvImage, brown_image, map);
cvtColor(map,map,COLOR_BGR2RGBA);
UIImage *image = MatToUIImage(map);
NSMutableDictionary *rDict = [NSMutableDictionary new];
rDict[@"image"] = image;
rDict[@"ratio"] = @(ratio);
return rDict;
}
@end
#include <fstream>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <vector>
#include <iostream>
#include <sys/time.h>
#include <string.h>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int get_peak_cbcr2(vector<Point2f> pts, unsigned char& cb_peak, unsigned char& cr_peak);
void create_brown_a(double* a, double min_a, double max_a);
void create_brown_offsets(double* offsets, double y1, double y2);
int brown_image_processing(Mat img, Mat& gray, Mat& brown_image);
//int main()
//{
// cv::Mat image = cv::imread("./0.jpg");
// // cv::Mat mask = cv::imread("./1.jpg", 0);
//
// if(image.empty())
// {
// cout << "can&apos;t openc the file!" << endl;
// return -1;
// }
// cv::Mat gray, brown_image;
//
// int a = brown_image_processing(image, gray, brown_image);
//}
// 灰度图的r,g,b通道的色度卡
const unsigned char brown_gray_r[256] = { 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 98, 100, 103, 105, 108, 111, 113, 115, 117,
119, 121, 122, 124, 125, 127, 128, 129, 131, 132, 133, 134, 136, 137, 138, 139,
140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 151, 152, 153, 154,
155, 156, 156, 157, 158, 159, 160, 161, 161, 162, 163, 163, 164, 165, 166, 166,
167, 168, 168, 169, 170, 171, 171, 172, 173, 173, 174, 175, 175, 176, 176, 177,
178, 178, 179, 180, 180, 181, 181, 182, 183, 183, 184, 185, 185, 186, 186, 187,
188, 188, 188, 189, 190, 190, 191, 191, 192, 193, 193, 194, 194, 195, 195, 196,
196, 197, 198, 198, 199, 199, 200, 200, 201, 201, 202, 203, 203, 204, 204, 204,
205, 206, 206, 206, 207, 208, 208, 209, 209, 209, 210, 211, 211, 211, 212, 213,
213, 214, 214, 215, 215, 215, 216, 216, 217, 218, 218, 218, 219, 219, 220, 220,
221, 221, 222, 222, 223, 223, 224, 224, 224, 225, 226, 226, 226, 227, 227, 228,
228, 229, 229, 229, 230, 231, 231, 231, 232, 232, 233, 233, 234, 234, 234, 235,
236, 236, 236, 237, 237, 238, 238, 238, 239, 239, 240, 240, 241, 241, 241, 242,
242, 243, 243, 243, 244, 244, 245, 245, 246, 246, 247, 247, 247, 248, 248, 248,
249, 249, 250, 250, 251, 251, 251, 252, 252, 253, 253, 253, 254, 254, 254, 255};
const unsigned char brown_gray_g[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 8, 11, 14, 17, 19, 22, 25, 27, 30, 31, 35, 36, 39, 40, 43, 45, 47, 49, 50, 53, 54, 56, 57, 59, 61, 63, 64, 66, 68, 69, 71, 72, 73, 75, 77, 78, 80, 81, 82, 84, 85, 87, 88, 89, 91, 92, 93, 94, 96, 97, 98, 100, 101, 102, 103, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117, 119, 120, 121, 122, 123, 124, 125, 126, 128, 129, 130, 131, 132, 133, 134, 135, 135, 137, 138, 139, 140, 141, 142, 143, 144, 145, 145, 148, 148, 150, 150, 151, 152, 153, 154, 154, 156, 157, 158, 159, 160, 161, 162, 163, 164, 164, 166, 167, 168, 168, 169, 170, 171, 172, 173, 173, 175, 176, 177, 177, 178, 179, 180, 181, 182, 183, 183, 184, 185, 186, 187, 188, 189, 189, 191, 191, 192, 192, 194, 195, 196, 196, 197, 198, 199, 200, 200, 201, 202, 202, 204, 205, 205, 206, 207, 208, 209, 209, 210, 211, 211, 213, 214, 214, 215, 216, 217, 218, 218, 219, 220, 221, 221, 222, 223, 224, 225, 225, 226, 227, 228, 228, 229, 230, 230, 232, 232, 233, 234, 234, 235, 236, 237, 237, 238, 239, 240, 240, 241, 242, 243, 243, 244, 245, 246, 246, 247, 248, 248, 249, 249, 251, 252, 252, 253, 254, 254, 255};
const unsigned char brown_gray_b[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 6, 7, 9, 11, 12, 15, 18, 19, 21, 23, 24, 27, 28, 31, 32, 34, 35, 37, 39, 40, 43, 44, 46, 47, 49, 51, 52, 55, 56, 58, 59, 61, 62, 64, 65, 67, 68, 70, 71, 73, 74, 76, 78, 79, 81, 82, 83, 85, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98, 100, 102, 103, 104, 105, 107, 108, 109, 111, 111, 114, 114, 116, 117, 119, 120, 121, 122, 123, 125, 126, 128, 129, 131, 132, 134, 134, 136, 137, 138, 139, 140, 141, 143, 144, 146, 146, 148, 149, 150, 151, 152, 153, 155, 156, 158, 159, 160, 160, 161, 162, 164, 165, 167, 167, 170, 170, 172, 172, 173, 174, 176, 176, 178, 179, 180, 181, 182, 183, 185, 185, 186, 187, 188, 189, 190, 192, 193, 194, 195, 197, 197, 198, 199, 200, 201, 202, 204, 205, 206, 207, 208, 210, 210, 211, 212, 213, 214, 215, 216, 217, 219, 219, 221, 222, 222, 224, 224, 225, 226, 227, 228, 230, 231, 231, 233, 234, 235, 236, 236, 237, 238, 239, 240, 242, 243, 243, 245, 246, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255};
const double brown_percentages[] = {0.05980, 0.06346, 0.06736, 0.07151, 0.07593, 0.08064, 0.08566, 0.09100, 0.09669, 0.10275, 0.10920, 0.11606, 0.12336, 0.13112, 0.13936, 0.14811,
0.15739, 0.16723, 0.17766, 0.18869, 0.20034, 0.21265, 0.22562, 0.23928, 0.25363, 0.26868, 0.28445, 0.30093, 0.31811, 0.33598, 0.35452, 0.37372,
0.39352, 0.41390, 0.43479, 0.45616, 0.47791, 0.50000, 0.52233, 0.54483, 0.56739, 0.58994, 0.61237, 0.63459, 0.65650, 0.67803, 0.69907, 0.71956,
0.73941, 0.75856, 0.77696, 0.79456, 0.81131, 0.82721, 0.84221, 0.85633, 0.86956, 0.88190, 0.89337, 0.90399, 0.91380, 0.92282, 0.93108, 0.93862,
0.94549, 0.95173, 0.95736, 0.96245, 0.96702, 0.97111, 0.97477, 0.97803, 0.98092, 0.98348, 0.98574, 0.98773, 0.98948, 0.99101, 0.99234, 0.99350,
0.99450, 0.99536, 0.99611, 0.99675, 0.99729, 0.99776, 0.99815, 0.99848, 0.99876, 0.99899, 0.99918, 0.99935, 0.99948, 0.99959, 0.99967, 0.99974,
0.99980, 0.99985, 0.99988, 0.99991, 0.99993, 0.99995, 0.99996, 0.99997, 0.99998, 0.99999, 0.99999, 0.99999, 1.00000, 1.00000, 1.00000, 1.00000};
/*
计算cb,cr通道的均值
*/
int get_peak_cbcr2(vector<Point2f> pts, unsigned char& cb_peak, unsigned char& cr_peak)
{
int sum_cb, sum_cr, len;
len = pts.size();
sum_cb = 0;
sum_cr = 0;
for (int i = 0; i < len; i++) {
sum_cb += pts[i].x; // cb
sum_cr += pts[i].y; // cr
}
cb_peak = sum_cb / len;
cr_peak = sum_cr / len;
return 0;
}
void create_brown_a(double* a, double min_a, double max_a)
{
int i = 0;
for (i = 0; i < 16; i++) {
a[i] = min_a;
}
for (i = 16; i < 256; i++) {
a[i] = (max_a - min_a) * (1 - exp(-0.5 * (i - 16) * (i - 16) / (50 * 50))) + min_a;
}
}
void create_brown_offsets(double* offsets, double y1, double y2)
{
int x1 = 15;
int x2 = 230;
double d = 15; // cl: 11.5
double maxy = exp((x2 - x1) / (d * d)) - 1;
double y;
for (int i = 0; i < x1; i++)
offsets[i] = y1;
for (int i = x1; i < x2; i++) {
y = exp((x2 - i) / (d * d)) - 1;
offsets[i] = y * (y1 - y2) / maxy + y2;
}
for (int i = x2; i < 256; i++)
offsets[i] = y2;
}
int brown_image_processing(Mat img, Mat& gray, Mat& brown_image)
{
char filename[256];
int width, height;
int r, g, b;
int y, cb, cr;
unsigned char peak_cb, peak_cr;
double y1, y2;
double brown_offsets[256];
double brown_a[256];
double brown_angle, brown_k, brown_R;
const double PI = 3.1415926;
const double brown_percentages[] = {0.05980, 0.06346, 0.06736, 0.07151, 0.07593, 0.08064, 0.08566, 0.09100, 0.09669, 0.10275, 0.10920, 0.11606, 0.12336, 0.13112, 0.13936, 0.14811,
0.15739, 0.16723, 0.17766, 0.18869, 0.20034, 0.21265, 0.22562, 0.23928, 0.25363, 0.26868, 0.28445, 0.30093, 0.31811, 0.33598, 0.35452, 0.37372,
0.39352, 0.41390, 0.43479, 0.45616, 0.47791, 0.50000, 0.52233, 0.54483, 0.56739, 0.58994, 0.61237, 0.63459, 0.65650, 0.67803, 0.69907, 0.71956,
0.73941, 0.75856, 0.77696, 0.79456, 0.81131, 0.82721, 0.84221, 0.85633, 0.86956, 0.88190, 0.89337, 0.90399, 0.91380, 0.92282, 0.93108, 0.93862,
0.94549, 0.95173, 0.95736, 0.96245, 0.96702, 0.97111, 0.97477, 0.97803, 0.98092, 0.98348, 0.98574, 0.98773, 0.98948, 0.99101, 0.99234, 0.99350,
0.99450, 0.99536, 0.99611, 0.99675, 0.99729, 0.99776, 0.99815, 0.99848, 0.99876, 0.99899, 0.99918, 0.99935, 0.99948, 0.99959, 0.99967, 0.99974,
0.99980, 0.99985, 0.99988, 0.99991, 0.99993, 0.99995, 0.99996, 0.99997, 0.99998, 0.99999, 0.99999, 0.99999, 1.00000, 1.00000, 1.00000, 1.00000};
int brown_percentages_length = sizeof(brown_percentages) / sizeof(double);
Mat ycbcrimg;
if (img.empty())
{
return -1;
}
width = img.cols;
height = img.rows;
// ycbcrimg = img.clone(); // Mat(img.size(), CV_8UC3);
vector<Point2f> pts;
cvtColor(img, ycbcrimg, COLOR_BGR2YCrCb);
vector<Mat> imgs;
split(ycbcrimg, imgs);
imgs[0] = imgs[0] + 16;
merge(imgs, ycbcrimg);
for (int i = 0; i < height; i+=8) {
// uchar* pmask = mask.data + mask.step * i;
uchar* pycbcr = ycbcrimg.data + ycbcrimg.step * i;
for (int j = 0; j < width; j+=8) {
cr = pycbcr[3*j + 1];
cb = pycbcr[3*j + 2];
pts.push_back(Point2f(cb, cr));
}
}
peak_cb = 0; peak_cr = 0;
get_peak_cbcr2(pts, peak_cb, peak_cr);
brown_angle = 18 * PI / 180;
brown_k = tan(brown_angle);
brown_R = sqrt(brown_k*brown_k + 1);
create_brown_a(brown_a, 0.550, 0.1556);
y1 = -90;
y2 = (30 * brown_R + brown_k * peak_cr - peak_cb);
create_brown_offsets(brown_offsets, y1, y2);
gray = Mat(img.size(), CV_8UC1);
if (gray.empty())
{
return -2;
}
for (int i = 0; i < height; i++)
{
uchar* pgray = gray.ptr<uchar>(i); // gray.data + gray.step * i;
uchar* pycbcr = ycbcrimg.ptr<uchar>(i); // ycbcrimg.data + ycbcrimg.step * i;
for (int j = 0; j < width; j++)
{
int t;
y = pycbcr[0];
cr = pycbcr[1];
cb = pycbcr[2];
double d = (cb - brown_k * cr + brown_offsets[y]) / brown_R;
if (y < brown_percentages_length)
d = d * brown_percentages[y] + 25 * (1 - brown_percentages[y]);
t = (int)(brown_a[y] * d * d + 22);
if (t > 255)
t = 255;
else if (t < 0)
t = 0;
*pgray = t;
pgray++;
pycbcr += 3;
}
}
// Mat tgray, imggray;
// Ptr<cv::CLAHE> clahe = createCLAHE(3.5, Size(32, 32));
// clahe->apply(gray, tgray);
// cvtColor(img, imggray, COLOR_BGR2GRAY);
// imggray *= 1.5;
// imggray.convertTo(imggray, CV_32FC1);
// tgray.convertTo(tgray, CV_32FC1);
// imggray /= 255.;
// gray.convertTo(gray, CV_32FC1);
// gray = gray + imggray.mul(tgray - gray);
// gray.convertTo(gray, CV_8UC1);
// GaussianBlur(gray, gray, Size(5, 5), 1.6);
Mat brown_color(256, 1, CV_8UC3);
for(int i = 0; i < 256; i++) {
brown_color.at<Vec3b>(i)[0] = brown_gray_b[i];
brown_color.at<Vec3b>(i)[1] = brown_gray_g[i];
brown_color.at<Vec3b>(i)[2] = brown_gray_r[i];
}
// Mat brown_image;
applyColorMap(gray, brown_image, brown_color);
cv::imwrite("./3.jpg", brown_image);
// imwrite(filepath, brown_image);
return 0;
}
#include <fstream>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <vector>
#include <iostream>
#include <sys/time.h>
#include <string.h>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int get_peak_cbcr2(vector<Point2f> pts, unsigned char& cb_peak, unsigned char& cr_peak);
void create_brown_a(double* a, double min_a, double max_a);
void create_brown_offsets(double* offsets, double y1, double y2);
int brown_image_processing(Mat img, Mat& gray, Mat& brown_image);
\ No newline at end of file
/**
* author:SiZheng.Chen
* update date:20210120
**/
#include "roughPore.h"
RoughPoreData detectRoughPore(Mat image){
double scale=5.0/1214;
RoughPoreData data;
if(image.empty()||image.type()!=CV_8UC3){
cout<<"image is empty or type error."<<endl;
data.roughImg=image;
return data;
}
vector<Mat> bgrList;
Mat grayImg,RedImg,GreenImg,BlueImg;
Mat bgrImg = image.clone();
cvtColor(image,grayImg,COLOR_BGR2GRAY);
split(image,bgrList);
BlueImg = bgrList[0];
GreenImg = bgrList[1];
RedImg = bgrList[2];
Mat hairImg;
adaptiveThreshold(grayImg,hairImg,255,ADAPTIVE_THRESH_GAUSSIAN_C,THRESH_BINARY_INV,75,9);
// imshow("win",hairImg);
// waitKey();
Mat strcutKernel=getStructuringElement(MORPH_ELLIPSE,cv::Size(3,3));
dilate(hairImg,hairImg,strcutKernel);
vector<vector<cv::Point> > contours;
vector<Vec4i> hirearchy;
findContours(hairImg,contours,hirearchy,RETR_EXTERNAL,CHAIN_APPROX_SIMPLE);
int padding = 5;
int width=image.cols;
int height=image.rows;
for(int i=0;i<contours.size();++i){
double area = contourArea(contours[i]);
cv::Rect box = boundingRect(contours[i]);
int x0 = box.x;
int y0 = box.y;
int x3 = x0+box.width;
int y3 = y0+box.height;
x0=(x0-padding)>=0?(x0-padding):0;
y0=(y0-padding)>=0?(y0-padding):0;
x3=(x3+padding)<=width?(x3+padding):width;
y3= (y3+padding)<=height?(y3+padding):height;
int sum_r=0;
int sum_g=0;
int sum_b=0;
int count=0;
Mat roi_img = hairImg(cv::Rect(x0,y0,(x3-x0),(y3-y0)));
Mat roi_red = RedImg(cv::Rect(x0,y0,(x3-x0),(y3-y0)));
Mat roi_green = GreenImg(cv::Rect(x0,y0,(x3-x0),(y3-y0)));
Mat roi_blue = BlueImg(cv::Rect(x0,y0,(x3-x0),(y3-y0)));
for(int j=0;j<roi_img.rows;++j){
for(int k=0;k<roi_img.cols;++k){
if(((int)roi_img.at<uchar>(j,k))!=255){
sum_b+=(int)roi_blue.at<uchar>(j,k);
sum_g+=(int)roi_green.at<uchar>(j,k);
sum_r+=(int)roi_red.at<uchar>(j,k);
count++;
}
}
}
int avg_red=int(sum_r*1.0/count);
int avg_green=int(sum_g*1.0/count);
int avg_blue=int(sum_b*1.0/count);
drawContours(bgrImg,contours,i,Scalar(avg_blue,avg_green,avg_red),FILLED);
}
// imshow("win",bgrImg);
// waitKey();
cvtColor(bgrImg,grayImg,COLOR_BGR2GRAY);
applyColorMap(grayImg,bgrImg,5);
bgrList.clear();
split(bgrImg,bgrList);
applyColorMap(bgrList[1],bgrImg,2);
cvtColor(bgrImg,grayImg,COLOR_BGR2GRAY);
medianBlur(grayImg,grayImg,5);
cv::Ptr<CLAHE> clahe=createCLAHE();
clahe->setClipLimit(3.5);
clahe->setTilesGridSize(cv::Size(10,10));
clahe->apply(grayImg,grayImg);
// imshow("win",grayImg);
// waitKey();
//----------------------------------- normal -------------------------------------------------------------
Mat bin_normal_image;
adaptiveThreshold(grayImg,bin_normal_image,255,ADAPTIVE_THRESH_GAUSSIAN_C,THRESH_BINARY_INV,225,15);
vector<vector<cv::Point> > contours_normal;
vector<Vec4i> hirearchy_normal;
Mat normal_pore=Mat(grayImg.size(),CV_8UC1,Scalar(0));
findContours(bin_normal_image,contours_normal,hirearchy_normal,RETR_EXTERNAL,CHAIN_APPROX_SIMPLE);
for(int i=0;i<contours_normal.size();++i){
double area=contourArea(contours_normal[i]);
if(area>20){
RotatedRect rrt=minAreaRect(contours_normal[i]);
float width=rrt.size.width>rrt.size.height?rrt.size.width:rrt.size.height;
float height=rrt.size.width<rrt.size.height?rrt.size.width:rrt.size.height;
float eccentricity=(width+height)!=0?((width-height)*1.0/(width+height)):(width-height);
float rate_area = area/(width*height);
if(width>50&&height>70&&eccentricity<0.3&&rate_area>0.40){
drawContours(normal_pore,contours_normal,i,Scalar(255),FILLED);
}
}
}
//------------------------------------- lost -------------------------------------------------------------
Mat bin_lost_image;
adaptiveThreshold(grayImg,bin_lost_image,255,ADAPTIVE_THRESH_GAUSSIAN_C,THRESH_BINARY_INV,225,20);
Mat structKernel=getStructuringElement(MORPH_RECT,cv::Size(5,5));
erode(bin_lost_image,bin_lost_image,structKernel);
dilate(bin_lost_image,bin_lost_image,structKernel);
vector<vector<cv::Point> > contours_lost;
vector<Vec4i> hirearchy_lost;
Mat lost_pore=Mat(grayImg.size(),CV_8UC1,Scalar(0));
findContours(bin_lost_image,contours_lost,hirearchy_lost,RETR_EXTERNAL,CHAIN_APPROX_SIMPLE);
for(int i=0;i<contours_lost.size();++i){
double area=contourArea(contours_lost[i]);
if(2000<area){
RotatedRect box=minAreaRect(contours_lost[i]);
float width=box.size.width>box.size.height?box.size.width:box.size.height;
float height=box.size.width<box.size.height?box.size.width:box.size.height;
float eccentricity=(width+height)!=0?((width-height)/(width+height)):(width-height);
float rate_area=area/(width*height);
if(width>50&&height>70&&eccentricity<0.25&&rate_area>0.3){
drawContours(lost_pore,contours_lost,i,Scalar(255),FILLED);
}
}
}
//---------------------------------------- the end ---------------------------------------------------------
Mat pore=max(normal_pore,lost_pore);
contours.clear();
hirearchy.clear();
int count=0;
float sumOfRadius=0;
double sumOfArea=0;
findContours(pore,contours,hirearchy,RETR_EXTERNAL,CHAIN_APPROX_SIMPLE);
for(int i=0;i<contours.size();++i){
double area = contourArea(contours[i]);
RotatedRect box=minAreaRect(contours[i]);
float width=box.size.width>box.size.height?box.size.width:box.size.height;
float height=box.size.width<box.size.height?box.size.width:box.size.height;
count++;
sumOfArea+=area;
sumOfRadius+=((width+height)/2);
RotatedRect ell=fitEllipse(contours[i]);
ellipse(image,ell,Scalar(0,100,0),1,1);
}
data.avgRadius=(sumOfRadius/count)*scale;
data.roughPoreCount=count;
data.roughImg=image;
data.roughArea=sumOfArea;
// imshow("win",image);
// waitKey();
return data;
}
/**
* author:SiZheng.Chen
* update date:20210120
**/
#include <iostream>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
struct RoughPoreData{
Mat roughImg;
int roughPoreCount;
float avgRadius;
double roughArea;
};
RoughPoreData detectRoughPore(Mat image);
\ No newline at end of file
/**
* author:SiZheng.Chen
* update date:20210120
**/
#include "wrinkle.h"
WrinkleData detectWrinkle(Mat image){
WrinkleData data;
if(image.empty()||image.type()!=CV_8UC3){
cout<<"image is empty or type error."<<endl;
data.wrinkleImg=image;
return data;
}
Scalar colorL=Scalar(0,255,0);
int THRESHOLD_LENTH=20;
int THRESHOLD_AREA = 0;
Mat lMat=wrinkleL(image);
vector<vector<cv::Point> > contours;
vector<Vec4i> hirearchy;
findContours(lMat,contours,hirearchy,RETR_EXTERNAL,CHAIN_APPROX_SIMPLE);
int countL=0;
double areaL=0;
for(int i=0;i<contours.size();++i){
double area = contourArea(contours[i]);
RotatedRect box=minAreaRect(contours[i]);
float width=box.size.width>box.size.height?box.size.width:box.size.height;
float height=box.size.width<box.size.height?box.size.width:box.size.height;
if((height<THRESHOLD_LENTH&&width<THRESHOLD_LENTH)||area<THRESHOLD_AREA){
drawContours(lMat,contours,i,Scalar(0),FILLED);
}else{
countL++;
areaL+=area;
drawContours(image,contours,i,colorL,2);
}
}
data.wrinkleLenth=areaL;
data.wrinkleCount=countL;
data.wrinkleImg=image;
return data;
}
Mat wrinkleL(Mat image){
Mat mHairMask=hairMask(image);
Mat grayImg;
cvtColor(image,grayImg,COLOR_BGR2GRAY);
cv::Ptr<CLAHE> clahe=createCLAHE();
clahe->setClipLimit(3.5);
clahe->setTilesGridSize(cv::Size(10,10));
clahe->apply(grayImg,grayImg);
GaussianBlur(grayImg,grayImg,cv::Size(15,15),0);
Mat bilaterMat;
bilateralFilter(grayImg,bilaterMat,0,120,10);
grayImg = bilaterMat;
Mat binImg,maskImg;
adaptiveThreshold(grayImg,binImg,255,ADAPTIVE_THRESH_GAUSSIAN_C,THRESH_BINARY_INV,265,10);
add(binImg,Mat(grayImg.size(),CV_8UC1,Scalar(0)),maskImg,mHairMask);
// Mat kernel = getStructuringElement(MORPH_RECT,Size(15,15));
// dilate(binImg,binImg,kernel);
// erode(binImg,binImg,kernel);
// imshow("win",maskImg);
// waitKey();
vector<vector<cv::Point> > contours;
vector<Vec4i> hirearchy;
binImg = Mat(grayImg.size(),CV_8UC1,Scalar(0));
findContours(maskImg,contours,hirearchy,RETR_LIST,CHAIN_APPROX_NONE);
for(int i=0;i<contours.size();++i){
double area = contourArea(contours[i]);
if(area>=150){
RotatedRect box = minAreaRect(contours[i]);
float width=box.size.width>box.size.height?box.size.width:box.size.height;
float height=box.size.width<box.size.height?box.size.width:box.size.height;
float eccentricity=(width+height)!=0?((width-height)/(width+height)):(width-height);
if(eccentricity>0.0){
drawContours(binImg,contours,i,Scalar(255),FILLED);
}
}
}
thinning(binImg,binImg,THINNING_ZHANGSUEN);
Mat structKernel = getStructuringElement(MORPH_RECT,cv::Size(15,15));
dilate(binImg,binImg,structKernel);
contours.clear();
hirearchy.clear();
findContours(binImg,contours,hirearchy,RETR_LIST,CHAIN_APPROX_SIMPLE);
for(int i=0;i<contours.size();++i){
double area = contourArea(contours[i]);
RotatedRect box = minAreaRect(contours[i]);
float max_len=box.size.width>box.size.height?box.size.width:box.size.height;
if(area>2000&&max_len>280){
}else{
drawContours(binImg,contours,i,Scalar(0),FILLED);
}
}
thinning(binImg,binImg,THINNING_ZHANGSUEN);
Mat viewKernel = getStructuringElement(MORPH_RECT,cv::Size(3,3));
dilate(binImg,binImg,viewKernel);
// imshow("win",binImg);
// waitKey();
return binImg;
}
Mat wrinlLeS(Mat image){
return image;
}
Mat hairMask(Mat image){
Mat grayImg;
cvtColor(image,grayImg,COLOR_BGR2GRAY);
Mat colorMat;
applyColorMap(grayImg,colorMat,2);
cvtColor(colorMat,grayImg,COLOR_BGR2GRAY);
Mat binImg;
adaptiveThreshold(grayImg,binImg,255,ADAPTIVE_THRESH_GAUSSIAN_C,THRESH_BINARY_INV,155,7);
vector<vector<cv::Point> > contours;
vector<Vec4i> hirearchy;
Mat hairMat=Mat(grayImg.size(),CV_8UC1,Scalar(0));
findContours(binImg,contours,hirearchy,RETR_LIST,CHAIN_APPROX_NONE);
for(int i=0;i<contours.size();++i){
double area = contourArea(contours[i]);
if(130<=area){
RotatedRect box = minAreaRect(contours[i]);
float width=box.size.width>box.size.height?box.size.width:box.size.height;
float height=box.size.width<box.size.height?box.size.width:box.size.height;
float eccentricity=(width+height)!=0?((width-height)/(width+height)):(width-height);
if(eccentricity>0.45){
drawContours(hairMat,contours,i,Scalar(255),FILLED);
}
}
}
Mat structKernel=getStructuringElement(MORPH_RECT,cv::Size(9,9));
dilate(hairMat,hairMat,structKernel);
Mat lightMat=Mat(grayImg.size(),CV_8UC1,Scalar(255));
hairMat = lightMat-hairMat;
// imshow("win",hairMat);
// waitKey();
return hairMat;
}
// Applies a thinning iteration to a binary image
static void thinningIteration(Mat img, int iter, int thinningType){
Mat marker = Mat::zeros(img.size(), CV_8UC1);
if(thinningType == THINNING_ZHANGSUEN){
for (int i = 1; i < img.rows-1; i++)
{
for (int j = 1; j < img.cols-1; j++)
{
uchar p2 = img.at<uchar>(i-1, j);
uchar p3 = img.at<uchar>(i-1, j+1);
uchar p4 = img.at<uchar>(i, j+1);
uchar p5 = img.at<uchar>(i+1, j+1);
uchar p6 = img.at<uchar>(i+1, j);
uchar p7 = img.at<uchar>(i+1, j-1);
uchar p8 = img.at<uchar>(i, j-1);
uchar p9 = img.at<uchar>(i-1, j-1);
int A = (p2 == 0 && p3 == 1) + (p3 == 0 && p4 == 1) +
(p4 == 0 && p5 == 1) + (p5 == 0 && p6 == 1) +
(p6 == 0 && p7 == 1) + (p7 == 0 && p8 == 1) +
(p8 == 0 && p9 == 1) + (p9 == 0 && p2 == 1);
int B = p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9;
int m1 = iter == 0 ? (p2 * p4 * p6) : (p2 * p4 * p8);
int m2 = iter == 0 ? (p4 * p6 * p8) : (p2 * p6 * p8);
if (A == 1 && (B >= 2 && B <= 6) && m1 == 0 && m2 == 0)
marker.at<uchar>(i,j) = 1;
}
}
}
if(thinningType == THINNING_GUOHALL){
for (int i = 1; i < img.rows-1; i++)
{
for (int j = 1; j < img.cols-1; j++)
{
uchar p2 = img.at<uchar>(i-1, j);
uchar p3 = img.at<uchar>(i-1, j+1);
uchar p4 = img.at<uchar>(i, j+1);
uchar p5 = img.at<uchar>(i+1, j+1);
uchar p6 = img.at<uchar>(i+1, j);
uchar p7 = img.at<uchar>(i+1, j-1);
uchar p8 = img.at<uchar>(i, j-1);
uchar p9 = img.at<uchar>(i-1, j-1);
int C = ((!p2) & (p3 | p4)) + ((!p4) & (p5 | p6)) +
((!p6) & (p7 | p8)) + ((!p8) & (p9 | p2));
int N1 = (p9 | p2) + (p3 | p4) + (p5 | p6) + (p7 | p8);
int N2 = (p2 | p3) + (p4 | p5) + (p6 | p7) + (p8 | p9);
int N = N1 < N2 ? N1 : N2;
int m = iter == 0 ? ((p6 | p7 | (!p9)) & p8) : ((p2 | p3 | (!p5)) & p4);
if ((C == 1) && ((N >= 2) && ((N <= 3)) & (m == 0)))
marker.at<uchar>(i,j) = 1;
}
}
}
img &= ~marker;
}
// Apply the thinning procedure to a given image
void thinning(InputArray input, OutputArray output, int thinningType){
Mat processed = input.getMat().clone();
// Enforce the range of the input image to be in between 0 - 255
processed /= 255;
Mat prev = Mat::zeros(processed.size(), CV_8UC1);
Mat diff;
do {
thinningIteration(processed, 0, thinningType);
thinningIteration(processed, 1, thinningType);
absdiff(processed, prev, diff);
processed.copyTo(prev);
}
while (countNonZero(diff) > 0);
processed *= 255;
output.assign(processed);
}
/**
* author:SiZheng.Chen
* update date:20210120
**/
#include<iostream>
#include<opencv2/opencv.hpp>
using namespace std;
using namespace cv;
enum thinningType{
THINNING_ZHANGSUEN,
THINNING_GUOHALL
};
struct WrinkleData{
Mat wrinkleImg;
int wrinkleCount;
double wrinkleLenth;
};
WrinkleData detectWrinkle(Mat image);
Mat wrinkleL(Mat image);
Mat wrinlLeS(Mat image);
Mat hairMask(Mat image);
static void thinningIteration(Mat img, int iter, int thinningType);
void thinning(InputArray input, OutputArray output, int thinningType);
//
// main.m
// SkinMagnifier
//
// Created by nana on 2020/11/4.
//
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[]) {
NSString * appDelegateClassName;
@autoreleasepool {
// Setup code that might create autoreleased objects goes here.
appDelegateClassName = NSStringFromClass([AppDelegate class]);
}
return UIApplicationMain(argc, argv, nil, appDelegateClassName);
}
app_identifier("com.hoyar.moremesfj") # The bundle identifier of your app
apple_id("tanhui@idankee.com") # Your Apple email address
itc_team_id("117451257") # App Store Connect Team ID
team_id("H4GTMW67DG") # Developer Portal Team ID
# For more information about the Appfile, see:
# https://docs.fastlane.tools/advanced/#appfile
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
default_platform(:ios)
platform :ios do
desc "Push a new release build to the App Store"
lane :pg do
increment_build_number(xcodeproj: "SkinMagnifier.xcodeproj")
build_app(workspace: "SkinMagnifier.xcworkspace", scheme: "SkinMagnifier")
upload_to_app_store(skip_metadata: true, skip_screenshots: true)
pgyer(api_key: "e4dde5752d54a56907781faba72f84b0", user_key: "3d2fd5bb432094c2e58c0f39d56c5899")
end
lane :pgy do
build_app(export_method: "ad-hoc")
pgyer(api_key: "e4dde5752d54a56907781faba72f84b0", user_key: "3d2fd5bb432094c2e58c0f39d56c5899")
sh("./qywx.sh")
end
end
# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!
gem 'fastlane-plugin-pgyer'
gem 'fastlane-plugin-pgyer'
fastlane documentation
================
# Installation
Make sure you have the latest version of the Xcode command line tools installed:
```
xcode-select --install
```
Install _fastlane_ using
```
[sudo] gem install fastlane -NV
```
or alternatively using `brew install fastlane`
# Available Actions
## iOS
### ios pg
```
fastlane ios pg
```
Push a new release build to the App Store
### ios pgy
```
fastlane ios pgy
```
----
This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).
#! /bin/bash
curl --location --request POST 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=5711c607-2c57-482a-a372-b0dbdab6442c' \
--header 'Content-Type: application/json' \
--data-raw '
{
"msgtype": "news",
"news": {
"articles" : [
{
"title" : "MoreMe水肤镜-蒲公英版本",
"description" : "点击下载发布到蒲公英新版的MoreMe水肤镜",
"url" : "https://www.pgyer.com/9eAG",
"picurl" : "https://www.pgyer.com/app/qrcode/9eAG"
}
]
}
}
'
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="fastlane.lanes">
<testcase classname="fastlane.lanes" name="0: default_platform" time="0.00085">
</testcase>
<testcase classname="fastlane.lanes" name="1: build_app" time="329.224784">
</testcase>
<testcase classname="fastlane.lanes" name="2: pgyer" time="4.332462">
</testcase>
<testcase classname="fastlane.lanes" name="3: ./qywx.sh" time="0.125623">
</testcase>
</testsuite>
</testsuites>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment