Merge remote-tracking branch 'origin/develop_01' 4.7.7
# Conflicts: # .DS_Store
|
|
@ -2245,6 +2245,12 @@
|
|||
C024B7B12379668B00509424 /* NSMutableArray+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = C024B79D2379668B00509424 /* NSMutableArray+AvoidCrash.h */; };
|
||||
C02ED596249E3B7300CAC37D /* InfoByImageViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = C02ED594249E3B7300CAC37D /* InfoByImageViewController.h */; };
|
||||
C02ED597249E3B7300CAC37D /* InfoByImageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C02ED595249E3B7300CAC37D /* InfoByImageViewController.m */; };
|
||||
C072196A253AE2290065CF17 /* IfishP2PPlayBackListViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C0721969253AE2290065CF17 /* IfishP2PPlayBackListViewController.xib */; };
|
||||
C072196D253B1F4F0065CF17 /* DatePickerCustomView.h in Headers */ = {isa = PBXBuildFile; fileRef = C072196B253B1F4F0065CF17 /* DatePickerCustomView.h */; };
|
||||
C072196E253B1F4F0065CF17 /* DatePickerCustomView.m in Sources */ = {isa = PBXBuildFile; fileRef = C072196C253B1F4F0065CF17 /* DatePickerCustomView.m */; };
|
||||
C0721972253C054D0065CF17 /* PlayBackViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = C072196F253C054D0065CF17 /* PlayBackViewController.h */; };
|
||||
C0721973253C054D0065CF17 /* PlayBackViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C0721970253C054D0065CF17 /* PlayBackViewController.m */; };
|
||||
C0721974253C054D0065CF17 /* PlayBackViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C0721971253C054D0065CF17 /* PlayBackViewController.xib */; };
|
||||
C0837A57244FF5510034FEC5 /* EGOCache.m in Sources */ = {isa = PBXBuildFile; fileRef = C0837A55244FF5500034FEC5 /* EGOCache.m */; };
|
||||
C0837A58244FF5510034FEC5 /* EGOCache.h in Headers */ = {isa = PBXBuildFile; fileRef = C0837A56244FF5500034FEC5 /* EGOCache.h */; };
|
||||
C0873EE12491060000D47D34 /* ESPUDPSocketClient.h in Headers */ = {isa = PBXBuildFile; fileRef = C0873EBE249105FF00D47D34 /* ESPUDPSocketClient.h */; };
|
||||
|
|
@ -5704,6 +5710,12 @@
|
|||
C024B79D2379668B00509424 /* NSMutableArray+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableArray+AvoidCrash.h"; sourceTree = "<group>"; };
|
||||
C02ED594249E3B7300CAC37D /* InfoByImageViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InfoByImageViewController.h; sourceTree = "<group>"; };
|
||||
C02ED595249E3B7300CAC37D /* InfoByImageViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = InfoByImageViewController.m; sourceTree = "<group>"; };
|
||||
C0721969253AE2290065CF17 /* IfishP2PPlayBackListViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = IfishP2PPlayBackListViewController.xib; sourceTree = "<group>"; };
|
||||
C072196B253B1F4F0065CF17 /* DatePickerCustomView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatePickerCustomView.h; sourceTree = "<group>"; };
|
||||
C072196C253B1F4F0065CF17 /* DatePickerCustomView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DatePickerCustomView.m; sourceTree = "<group>"; };
|
||||
C072196F253C054D0065CF17 /* PlayBackViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlayBackViewController.h; sourceTree = "<group>"; };
|
||||
C0721970253C054D0065CF17 /* PlayBackViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PlayBackViewController.m; sourceTree = "<group>"; };
|
||||
C0721971253C054D0065CF17 /* PlayBackViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PlayBackViewController.xib; sourceTree = "<group>"; };
|
||||
C0837A55244FF5500034FEC5 /* EGOCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EGOCache.m; sourceTree = "<group>"; };
|
||||
C0837A56244FF5500034FEC5 /* EGOCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EGOCache.h; sourceTree = "<group>"; };
|
||||
C0873EBE249105FF00D47D34 /* ESPUDPSocketClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ESPUDPSocketClient.h; sourceTree = "<group>"; };
|
||||
|
|
@ -6597,6 +6609,7 @@
|
|||
3D1C4FEB221A9EDD0096AE43 /* CameraNoParyBackVideoView.m */,
|
||||
3D1C4FF4221A9EDD0096AE43 /* IfishP2PPlayBackListViewController.h */,
|
||||
3D1C4FEC221A9EDD0096AE43 /* IfishP2PPlayBackListViewController.m */,
|
||||
C0721969253AE2290065CF17 /* IfishP2PPlayBackListViewController.xib */,
|
||||
3D1C4FF0221A9EDD0096AE43 /* IfishPlaybackViewCell.h */,
|
||||
3D1C4FF7221A9EDD0096AE43 /* IfishPlaybackViewCell.m */,
|
||||
3D1C4FF2221A9EDD0096AE43 /* IfishPlaybackViewCell.xib */,
|
||||
|
|
@ -6606,6 +6619,9 @@
|
|||
3D1C4FF3221A9EDD0096AE43 /* P2PPlayingbackVC.m */,
|
||||
3D1C4FEF221A9EDD0096AE43 /* PlayBaseViewController.h */,
|
||||
3D1C4FF5221A9EDD0096AE43 /* PlayBaseViewController.m */,
|
||||
C072196F253C054D0065CF17 /* PlayBackViewController.h */,
|
||||
C0721970253C054D0065CF17 /* PlayBackViewController.m */,
|
||||
C0721971253C054D0065CF17 /* PlayBackViewController.xib */,
|
||||
);
|
||||
path = IfishP2PPlayBack;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -10156,6 +10172,8 @@
|
|||
883E79771D48B0280030E075 /* mypicView */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C072196B253B1F4F0065CF17 /* DatePickerCustomView.h */,
|
||||
C072196C253B1F4F0065CF17 /* DatePickerCustomView.m */,
|
||||
883E79781D48B0280030E075 /* Box.png */,
|
||||
883E79791D48B0280030E075 /* MydatePickerView.h */,
|
||||
883E797A1D48B0280030E075 /* MydatePickerView.m */,
|
||||
|
|
@ -12875,6 +12893,7 @@
|
|||
C0873EF62491060000D47D34 /* ESPTools.h in Headers */,
|
||||
CB8B6468230F7F980032EB24 /* IfishMainInfoCell.h in Headers */,
|
||||
C0EA8A2A23AF74F4003DC53B /* SDWebImageOperation.h in Headers */,
|
||||
C072196D253B1F4F0065CF17 /* DatePickerCustomView.h in Headers */,
|
||||
CB484E1122B8C8C90075F050 /* version.h in Headers */,
|
||||
3D1C5122221A9EE00096AE43 /* IfishRecVideoViewCell.h in Headers */,
|
||||
CB48207C2334E99700A50C92 /* IQTextView.h in Headers */,
|
||||
|
|
@ -13107,6 +13126,7 @@
|
|||
3D1C50D3221A9EE00096AE43 /* UIScrollView+SVInfiniteScrolling.h in Headers */,
|
||||
CBA61655228F9A6C00ED380D /* YYModel.h in Headers */,
|
||||
CB484DFE22B8C8C80075F050 /* cpu.h in Headers */,
|
||||
C0721972253C054D0065CF17 /* PlayBackViewController.h in Headers */,
|
||||
C0EA8A2F23AF74F4003DC53B /* UIImage+MultiFormat.h in Headers */,
|
||||
CB4820882334E99700A50C92 /* IQKeyboardManagerConstants.h in Headers */,
|
||||
3D1C5089221A9EDF0096AE43 /* KTPhotoView.h in Headers */,
|
||||
|
|
@ -14242,6 +14262,7 @@
|
|||
883E788C1D48A5E50030E075 /* infoSureBtnCell.xib in Resources */,
|
||||
882956881DBDA3A200E9DDD7 /* ifish_hold_headerImg@2x.png in Resources */,
|
||||
882956EF1DBDA3A300E9DDD7 /* bubble@1x.png in Resources */,
|
||||
C0721974253C054D0065CF17 /* PlayBackViewController.xib in Resources */,
|
||||
882957601DBDA3A300E9DDD7 /* icon2.png in Resources */,
|
||||
8829570E1DBDA3A300E9DDD7 /* ifish_shareblog.png in Resources */,
|
||||
886D15871E6066D20085F7D6 /* introlImage_1.png in Resources */,
|
||||
|
|
@ -14533,6 +14554,7 @@
|
|||
882956DD1DBDA3A300E9DDD7 /* ifishdropview_add_device@3x.png in Resources */,
|
||||
881478241E712A2700BFB79C /* task_openShareCamera@3x.png in Resources */,
|
||||
887492511E7BB58A00CDA284 /* gold_background@3x.png in Resources */,
|
||||
C072196A253AE2290065CF17 /* IfishP2PPlayBackListViewController.xib in Resources */,
|
||||
882957961DBDA3A400E9DDD7 /* xutobtn2_on@3x.png in Resources */,
|
||||
885606AC1E32081C0002C17C /* sharing_v_attestation@3x.png in Resources */,
|
||||
881A1D331DD2C31500BA1AF4 /* kankanlook_icon_sentiment@2x.png in Resources */,
|
||||
|
|
@ -14628,6 +14650,7 @@
|
|||
883E78621D48A5E50030E075 /* RightViewController.m in Sources */,
|
||||
CBA61675228F9AB100ED380D /* NSLayoutConstraint+MASDebugAdditions.m in Sources */,
|
||||
886FB1A11E5A9D0A00256332 /* FishDocSection0ViewImgCell.m in Sources */,
|
||||
C072196E253B1F4F0065CF17 /* DatePickerCustomView.m in Sources */,
|
||||
881672381EA5DE2B00BEBF23 /* UMComSimpleAssociatedFeedTableViewCell.m in Sources */,
|
||||
883E76431D4897570030E075 /* TwoControlBackmsgmodel.m in Sources */,
|
||||
3D3512DB2159C172009DDB0F /* IfishHotBarModifyNameVc.m in Sources */,
|
||||
|
|
@ -15527,6 +15550,7 @@
|
|||
8876A5881BB83447007A4B54 /* main.m in Sources */,
|
||||
889133071ECE999A00F52EBC /* LXCompressionVideo.m in Sources */,
|
||||
886E3A0B1EEA44B5007C0B04 /* UserExtendataArchaver.m in Sources */,
|
||||
C0721973253C054D0065CF17 /* PlayBackViewController.m in Sources */,
|
||||
881F0F4F1D73DF4E0091507E /* BaoGaoViewFirstCell.m in Sources */,
|
||||
E51D7D5B208CF4E7001FF053 /* RuiMeiInputViewController.m in Sources */,
|
||||
881672241EA5DE2B00BEBF23 /* UMComSelectTopicCell.m in Sources */,
|
||||
|
|
@ -15753,7 +15777,7 @@
|
|||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 29;
|
||||
CURRENT_PROJECT_VERSION = 4;
|
||||
DEVELOPMENT_TEAM = WFX8GD5HFX;
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
|
|
@ -15828,7 +15852,7 @@
|
|||
"$(PROJECT_DIR)/Ifish/controllers/IfishYooseeFile/IfishYsooseeNewLib/libAVCtrlIOS/libAVCtrl",
|
||||
"$(PROJECT_DIR)/Ifish/controllers/IfishYooseeFile/IfishYsooseeNewLib/libAVCtrl",
|
||||
);
|
||||
MARKETING_VERSION = 4.7.4;
|
||||
MARKETING_VERSION = 5.1.7;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_LDFLAGS = (
|
||||
"-ObjC",
|
||||
|
|
@ -15871,7 +15895,7 @@
|
|||
CODE_SIGN_IDENTITY = "iPhone Distribution";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
CURRENT_PROJECT_VERSION = 29;
|
||||
CURRENT_PROJECT_VERSION = 4;
|
||||
DEVELOPMENT_TEAM = WFX8GD5HFX;
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
|
|
@ -15946,7 +15970,7 @@
|
|||
"$(PROJECT_DIR)/Ifish/controllers/IfishYooseeFile/IfishYsooseeNewLib/libAVCtrlIOS/libAVCtrl",
|
||||
"$(PROJECT_DIR)/Ifish/controllers/IfishYooseeFile/IfishYsooseeNewLib/libAVCtrl",
|
||||
);
|
||||
MARKETING_VERSION = 4.7.4;
|
||||
MARKETING_VERSION = 5.1.7;
|
||||
ONLY_ACTIVE_ARCH = NO;
|
||||
OTHER_LDFLAGS = (
|
||||
"-ObjC",
|
||||
|
|
|
|||
|
|
@ -4,5 +4,7 @@
|
|||
<dict>
|
||||
<key>BuildSystemType</key>
|
||||
<string>Original</string>
|
||||
<key>PreviewsEnabled</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
|||
|
|
@ -159,4 +159,6 @@ typedef enum{
|
|||
+ (NSString *)getRandomStringWithNum:(NSInteger)num;
|
||||
|
||||
CGAffineTransform GetCGAffineTransformRotateAroundPoint(float centerX, float centerY ,float x ,float y ,float angle);
|
||||
+ (void)interfaceOrientation:(UIInterfaceOrientation)orientation;
|
||||
+ (UIBarButtonItem*)ItemWithTitle:(NSString *)title target:(id)target action:(SEL)action titleColor:(UIColor*)titleColor;
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -287,6 +287,31 @@
|
|||
return timeString;
|
||||
|
||||
}
|
||||
+ (void)interfaceOrientation:(UIInterfaceOrientation)orientation
|
||||
{
|
||||
if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) {
|
||||
SEL selector = NSSelectorFromString(@"setOrientation:");
|
||||
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[UIDevice instanceMethodSignatureForSelector:selector]];
|
||||
[invocation setSelector:selector];
|
||||
[invocation setTarget:[UIDevice currentDevice]];
|
||||
int val = orientation;
|
||||
// 从2开始是因为0 1 两个参数已经被selector和target占用
|
||||
[invocation setArgument:&val atIndex:2];
|
||||
[invocation invoke];
|
||||
}
|
||||
}
|
||||
+ (UIBarButtonItem*)ItemWithTitle:(NSString *)title target:(id)target action:(SEL)action titleColor:(UIColor*)titleColor
|
||||
{
|
||||
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
if(title.length) [button setTitle:title forState:UIControlStateNormal];
|
||||
button.titleLabel.font = [UIFont systemFontOfSize:16];
|
||||
if (titleColor==nil) titleColor = [UIColor whiteColor];
|
||||
[button setTitleColor:titleColor forState:UIControlStateNormal];
|
||||
[button setTitleColor:[UIColor lightGrayColor] forState:UIControlStateDisabled];
|
||||
[button sizeToFit];
|
||||
[button addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
|
||||
return [[UIBarButtonItem alloc] initWithCustomView:button];
|
||||
}
|
||||
+ (NSDictionary *)getSSIDInfo
|
||||
{
|
||||
NSArray *interfaceNames = CFBridgingRelease(CNCopySupportedInterfaces());
|
||||
|
|
@ -519,7 +544,7 @@ CGAffineTransform GetCGAffineTransformRotateAroundPoint(float centerX, float ce
|
|||
}
|
||||
+ (BOOL)isIphoneX {
|
||||
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
|
||||
return [[UIScreen mainScreen] bounds].size.height >= 812.0f;
|
||||
return ([[UIApplication sharedApplication] statusBarFrame].size.height> 20);
|
||||
}else{
|
||||
return NO;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>5.1.5</string>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
|
|
@ -372,6 +372,8 @@
|
|||
</dict>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>爱鱼奇需要您的同意,才能使用相机,以使用图片上传或扫一扫等功能</string>
|
||||
<key>NSLocalNetworkUsageDescription</key>
|
||||
<string>为给爱鱼奇智能硬件产品配置网络,发送指令等,需要使用本地网络</string>
|
||||
<key>NSLocationAlwaysUsageDescription</key>
|
||||
<string>为获取爱鱼奇智能硬件产品及用户的地址区域分布,以提供更好的特色服务,爱鱼奇将获取您的地址</string>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina6_1" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
|
||||
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="UMComLoginViewController">
|
||||
|
|
@ -20,22 +21,22 @@
|
|||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rxC-n2-48U" userLabel="account_bar">
|
||||
<rect key="frame" x="0.0" y="15" width="600" height="108"/>
|
||||
<rect key="frame" x="0.0" y="15" width="414" height="108"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hKX-4Q-d6g" userLabel="account_color_view">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="54"/>
|
||||
<color key="backgroundColor" red="0.94509803921568625" green="0.96470588235294119" blue="0.96862745098039216" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="54"/>
|
||||
<color key="backgroundColor" red="0.94509803921568625" green="0.96470588235294119" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="toK-cn-6hG" userLabel="pwd_color_view">
|
||||
<rect key="frame" x="0.0" y="54" width="600" height="54"/>
|
||||
<color key="backgroundColor" red="0.94509803920000002" green="0.96470588239999999" blue="0.96862745100000003" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<rect key="frame" x="0.0" y="54" width="414" height="54"/>
|
||||
<color key="backgroundColor" red="0.94509803920000002" green="0.96470588239999999" blue="0.96862745100000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</view>
|
||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入有效邮箱,便于找回密码" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="5J0-WW-KgS" userLabel="account_input">
|
||||
<rect key="frame" x="57" y="10" width="523" height="34"/>
|
||||
<rect key="frame" x="57" y="10" width="337" height="34"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="34" id="70j-gl-TkV"/>
|
||||
</constraints>
|
||||
|
|
@ -53,7 +54,7 @@
|
|||
</constraints>
|
||||
</imageView>
|
||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入密码" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="oIt-Hg-Kdv" userLabel="password_input">
|
||||
<rect key="frame" x="57" y="64" width="523" height="34"/>
|
||||
<rect key="frame" x="57" y="64" width="337" height="34"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="34" id="95R-ni-5SI"/>
|
||||
</constraints>
|
||||
|
|
@ -71,14 +72,14 @@
|
|||
</constraints>
|
||||
</imageView>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6Jl-HR-dKG" userLabel="line">
|
||||
<rect key="frame" x="57" y="53.5" width="543" height="1"/>
|
||||
<color key="backgroundColor" red="0.87450980392156863" green="0.87450980392156863" blue="0.87450980392156863" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<rect key="frame" x="57" y="53.5" width="357" height="1"/>
|
||||
<color key="backgroundColor" red="0.87450980392156863" green="0.87450980392156863" blue="0.87450980392156863" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="1" id="tH4-Aj-SyM"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="6Jl-HR-dKG" firstAttribute="centerY" secondItem="rxC-n2-48U" secondAttribute="centerY" id="1kF-m0-xBZ"/>
|
||||
<constraint firstItem="oIt-Hg-Kdv" firstAttribute="leading" secondItem="gE9-uD-XZv" secondAttribute="trailing" constant="15" id="2Yg-VU-Ujm"/>
|
||||
|
|
@ -112,38 +113,38 @@
|
|||
</mask>
|
||||
</variation>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="meQ-ij-ubJ" userLabel="forgot">
|
||||
<button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="meQ-ij-ubJ" userLabel="forgot">
|
||||
<rect key="frame" x="528" y="143" width="52" height="16"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="16" id="xom-j2-nM8"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="13"/>
|
||||
<state key="normal" title="忘记密码">
|
||||
<color key="titleColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="forgotPassword:" destination="-1" eventType="touchUpInside" id="T58-af-AfP"/>
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="3Km-Ya-48m" userLabel="line">
|
||||
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3Km-Ya-48m" userLabel="line">
|
||||
<rect key="frame" x="528" y="158" width="52" height="1"/>
|
||||
<color key="backgroundColor" red="0.27843137254901962" green="0.56862745098039214" blue="0.96470588235294119" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="backgroundColor" red="0.27843137254901962" green="0.56862745098039214" blue="0.96470588235294119" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="1" id="F6M-3c-3Za"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="2re-uF-wff" userLabel="login">
|
||||
<rect key="frame" x="20" y="179" width="560" height="44"/>
|
||||
<color key="backgroundColor" red="0.27450980392156865" green="0.61960784313725492" blue="0.97254901960784312" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<rect key="frame" x="20" y="179" width="374" height="44"/>
|
||||
<color key="backgroundColor" red="0.27450980392156865" green="0.61960784313725492" blue="0.97254901960784312" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="44" id="53G-lE-PzN"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="19"/>
|
||||
<state key="normal" title="登 录">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<state key="highlighted">
|
||||
<color key="titleColor" red="0.90980392160000001" green="0.91764705879999997" blue="0.93333333330000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleColor" red="0.90980392160000001" green="0.91764705879999997" blue="0.93333333330000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
|
|
@ -155,17 +156,17 @@
|
|||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="1Bp-56-HWj" userLabel="register">
|
||||
<rect key="frame" x="20" y="243" width="560" height="44"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<rect key="frame" x="20" y="243" width="374" height="44"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="44" id="dgO-jX-FE7"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="19"/>
|
||||
<state key="normal" title="注 册">
|
||||
<color key="titleColor" red="0.27450980392156865" green="0.61960784313725492" blue="0.97254901960784312" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleColor" red="0.27450980392156865" green="0.61960784313725492" blue="0.97254901960784312" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<state key="highlighted">
|
||||
<color key="titleColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
|
|
@ -177,7 +178,7 @@
|
|||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.88235294117647056" green="0.90196078431372551" blue="0.9137254901960784" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="backgroundColor" red="0.88235294117647056" green="0.90196078431372551" blue="0.9137254901960784" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="meQ-ij-ubJ" secondAttribute="trailing" constant="20" id="4z7-Lu-UVZ"/>
|
||||
<constraint firstItem="3Km-Ya-48m" firstAttribute="bottom" secondItem="meQ-ij-ubJ" secondAttribute="bottom" id="6hq-R8-fXz"/>
|
||||
|
|
|
|||
|
|
@ -81,6 +81,10 @@ alpha:1.0]
|
|||
#define MAINSCREEN_SCALE [[UIScreen mainScreen] scale]
|
||||
#define KWidth_Scale [UIScreen mainScreen].bounds.size.width/375.0f
|
||||
|
||||
#define IS_iPhoneX [CommonUtils isIphoneX]
|
||||
#define TabbarHeight (IS_iPhoneX?83:49)
|
||||
#define MyNavBarHeight (IS_iPhoneX?88:64)
|
||||
#define StatusBarHeight (IS_iPhoneX?[[UIApplication sharedApplication] statusBarFrame].size.height:20)
|
||||
#import "MyControl.h"
|
||||
#import "DataCenter.h"
|
||||
#import "UserModel.h"
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ FOUNDATION_EXPORT const unsigned char EGOCacheVersionString[];
|
|||
|
||||
- (NSString* __nullable)stringForKey:(NSString* __nonnull)key;
|
||||
- (void)setString:(NSString* __nonnull)aString forKey:(NSString* __nonnull)key;
|
||||
- (void)setSynString:(NSString*)aString forKey:(NSString*)key;
|
||||
- (void)setString:(NSString* __nonnull)aString forKey:(NSString* __nonnull)key withTimeoutInterval:(NSTimeInterval)timeoutInterval;
|
||||
|
||||
- (NSDate* __nullable)dateForKey:(NSString* __nonnull)key;
|
||||
|
|
|
|||
|
|
@ -274,6 +274,13 @@ static inline NSString* cachePathForKey(NSString* directory, NSString* key) {
|
|||
- (void)setString:(NSString*)aString forKey:(NSString*)key {
|
||||
[self setString:aString forKey:key withTimeoutInterval:self.defaultTimeoutInterval];
|
||||
}
|
||||
- (void)setSynString:(NSString*)aString forKey:(NSString*)key {
|
||||
CHECK_FOR_EGOCACHE_PLIST();
|
||||
NSString* cachePath = cachePathForKey(_directory, key);
|
||||
[[aString dataUsingEncoding:NSUTF8StringEncoding] writeToFile:cachePath atomically:YES];
|
||||
[self setCacheTimeoutInterval:self.defaultTimeoutInterval forKey:key];
|
||||
}
|
||||
|
||||
|
||||
- (void)setString:(NSString*)aString forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval {
|
||||
[self setData:[aString dataUsingEncoding:NSUTF8StringEncoding] forKey:key withTimeoutInterval:timeoutInterval];
|
||||
|
|
|
|||
|
|
@ -318,7 +318,11 @@ methodType url : (NSString *)url
|
|||
success:(void (^)(id response))success
|
||||
failure:(void (^)(NSError* err))failure
|
||||
{
|
||||
|
||||
if ([deviceId isKindOfClass:[NSNumber class]])
|
||||
{
|
||||
NSString*devid=[NSString stringWithFormat:@"%@",deviceId];
|
||||
deviceId=devid;
|
||||
}
|
||||
NSString*macid=[[deviceId componentsSeparatedByString:@"_"] firstObject];
|
||||
|
||||
NSString*deviceType=[[deviceId componentsSeparatedByString:@"_"] lastObject];
|
||||
|
|
|
|||
|
|
@ -131,15 +131,6 @@
|
|||
//
|
||||
#ifdef IOS6
|
||||
|
||||
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
|
||||
{
|
||||
return UIInterfaceOrientationLandscapeRight;
|
||||
}
|
||||
|
||||
- (BOOL)shouldAutorotate {
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (NSUInteger)supportedInterfaceOrientations {
|
||||
return UIInterfaceOrientationMaskLandscapeRight;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -320,6 +320,11 @@ Copy NSString *deviceId;
|
|||
self.HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
||||
self.HUD.mode = MBProgressHUDModeIndeterminate;
|
||||
self.HUD.labelText = msg;
|
||||
if ([msg isEqualToString:@"Socket连接失败"])
|
||||
{
|
||||
[self.HUD hide:YES afterDelay:3];
|
||||
[self endProgress];
|
||||
}
|
||||
}
|
||||
-(void)endProgress{
|
||||
[self.progressView endProgressWithString:@"连接结束"];
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@
|
|||
#import "Xuanduo2TimerModel.h"
|
||||
#import "IfishDeviceInfo.h"
|
||||
#import "NSString+Add.h"
|
||||
#import "XuToControlName.h"
|
||||
#import "UserExtendataArchaver.h"
|
||||
|
||||
#define kBtnTag 500
|
||||
#define kSwitchBtnTag 600
|
||||
|
|
@ -120,11 +122,22 @@ static NSString *setTimerflag = @"SetTimerCell";
|
|||
}
|
||||
|
||||
- (void)setupTable {
|
||||
_titieArr = @[@"循环泵",@"增氧泵",@"灯光1",@"灯光2",@"造浪泵",@"杀菌灯"];
|
||||
|
||||
XuToControlName *name = [UserExtendataArchaver currentNewXuToControlName:self.currentdevice.macAddress];
|
||||
if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
|
||||
{
|
||||
name=[UserExtendataArchaver currentPetsXuToControlName:self.currentdevice.macAddress];
|
||||
}
|
||||
// _titieArr = @[@"循环泵",@"增氧泵",@"灯光1",@"灯光2",@"造浪泵",@"杀菌灯"];
|
||||
_titieArr = @[name.xunhuanPump,name.zengyangPump,name.light1,name.light2,name.zaolangPump,name.shajunLight];
|
||||
|
||||
_imgArr = @[@"xunhuan_big",@"gas_big",@"light_big",@"light_big",@"wave_big",@"shajun_big"];
|
||||
|
||||
|
||||
|
||||
if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
|
||||
{
|
||||
_titieArr = @[@"照明",@"换气",@"杀菌"];
|
||||
_titieArr = @[name.xunhuanPump,name.zaolangPump,name.light1];
|
||||
_imgArr = @[@"照明开",@"换气开",@"杀菌开"];
|
||||
}
|
||||
|
||||
|
|
@ -706,14 +719,14 @@ static NSString *setTimerflag = @"SetTimerCell";
|
|||
|
||||
NSData*selctorData=[dataContorl stringToHexData:selectorString];
|
||||
[[Socketsingleton sharedInstance] soketWriteData:selctorData];
|
||||
[_indicatorView startAnimating];
|
||||
// [_indicatorView startAnimating];
|
||||
|
||||
readModel.selectorNumber = timerModel.selectorNumber;
|
||||
NSString*readString=[NSString stringWithFormat:@"%@%@%@",readModel.description,readModel.selectorNumber,readModel.crc16str];
|
||||
NSLog(@"read str = %@",readString);
|
||||
NSData*readData=[dataContorl stringToHexData:readString];
|
||||
[[Socketsingleton sharedInstance] soketWriteData:readData];
|
||||
[_indicatorView startAnimating];
|
||||
;
|
||||
}
|
||||
else if ([group isKindOfClass: [XuanduoCycleModel class] ])
|
||||
{
|
||||
|
|
@ -1547,9 +1560,7 @@ static NSString *setTimerflag = @"SetTimerCell";
|
|||
}
|
||||
NSLog(@"dataarr.count = %ld",dataArr.count);
|
||||
|
||||
[self.XuTohud hidmyHud];
|
||||
[self.indicatorView stopAnimating];
|
||||
[self.tableView reloadData];
|
||||
|
||||
}
|
||||
else if (_selectSection-2<_titieArr.count && _selectSection-2>=0 && [readTimer isEqualToString:@"0119"]) {
|
||||
|
||||
|
|
@ -1561,17 +1572,16 @@ static NSString *setTimerflag = @"SetTimerCell";
|
|||
[dataArr addObject:_cycleModel];
|
||||
|
||||
|
||||
[self.XuTohud hidmyHud];
|
||||
[self.indicatorView stopAnimating];
|
||||
[self.tableView reloadData];
|
||||
|
||||
}
|
||||
if ([readTimer isEqualToString:@"0108"] || [readTimer isEqualToString:@"0105"]) {
|
||||
[Xuanduo2DataUtility readSocketDataWithBackMsgModel:self.dataModel addWithBackData:data type:self.currentdevice.type];
|
||||
[self refreshWithData:self.dataModel];
|
||||
[self.XuTohud hidmyHud];
|
||||
[self.indicatorView stopAnimating];
|
||||
[self.tableView reloadData];
|
||||
|
||||
}
|
||||
[self.XuTohud hidmyHud];
|
||||
[self.indicatorView stopAnimating];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
-(void)ifishDeviceLogInFail{
|
||||
|
|
|
|||
|
|
@ -608,7 +608,7 @@
|
|||
{
|
||||
status=((Xuanduo3fModel*)self.dataModel).constTmep;
|
||||
}
|
||||
if ([status isKindOfClass:[NSNull class]]||status ) {
|
||||
if ([status isKindOfClass:[NSNull class]]||!status ) {
|
||||
|
||||
status = @"0000";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -184,6 +184,12 @@ Assign BOOL isInitHostoryView;
|
|||
self.vo.wornCode=code;
|
||||
self.vo.upTeamp=up;
|
||||
self.vo.downTeamp=down;
|
||||
IfishHotBarVo*vo1=self.datas[1];
|
||||
if (!IsEmptyStr(self.vo.upTeamp)) {
|
||||
vo1.subTitle = [NSString stringWithFormat:@"%.1f°c~%.1f°c",[self.vo.downTeamp floatValue],[self.vo.upTeamp floatValue]];
|
||||
}
|
||||
|
||||
[self.mainTableView reloadData];
|
||||
[self setTeampletureWithUp:self.vo.upTeamp andDown:self.vo.downTeamp andHnum:0 andWarmC:self.vo.wornCode];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
// CFShow((__bridge CFTypeRef)(infoDic));
|
||||
NSString *app_Version=[infoDic objectForKey:@"CFBundleShortVersionString"];
|
||||
NSLog(@"app_Version%@",app_Version);
|
||||
app_Version=@"4.7.5";
|
||||
app_Version=@"4.7.7";
|
||||
NSString *versionStr = [NSString stringWithFormat:@"v%@",app_Version];
|
||||
NSString *buildVersion = [infoDic objectForKey:@"CFBundleVersion"];
|
||||
if (buildVersion.length > 0) {
|
||||
|
|
|
|||
|
|
@ -1283,12 +1283,7 @@ Assign BOOL isPush;
|
|||
}
|
||||
else if ([model.type isEqualToString:@"camera"]){
|
||||
|
||||
// self.hidesBottomBarWhenPushed = YES;
|
||||
// IfishP2PPlayBackListViewController *cameraShopVC=[[IfishP2PPlayBackListViewController alloc]init];
|
||||
// cameraShopVC.camera = model.camera;
|
||||
// [self.navigationController pushViewController:cameraShopVC animated:YES];
|
||||
// self.hidesBottomBarWhenPushed = NO;
|
||||
|
||||
|
||||
//切换时主动 断开 soket
|
||||
[[Socketsingleton sharedInstance] cutOffSocket];
|
||||
//进入摄像头页面
|
||||
|
|
|
|||
|
|
@ -632,7 +632,7 @@ Strong UIImage *screenShotImage;//截图
|
|||
|
||||
|
||||
//布防撤防、对讲、截图工具栏 ****** 云台
|
||||
CameraBottomHView *bottomToolHView = [[CameraBottomHView alloc] initWithFrame:CGRectMake(0.0, CGRectGetMaxY(self.segControl.frame) + 10, width, height-CGRectGetMaxY(self.segControl.frame))];
|
||||
CameraBottomHView *bottomToolHView = [[CameraBottomHView alloc] initWithFrame:CGRectMake(0.0, CGRectGetMaxY(self.segControl.frame) + 10, width, height-CGRectGetMaxY(self.segControl.frame)- MyNavBarHeight -10)];
|
||||
bottomToolHView.cameraHViewDelegate = self;
|
||||
bottomToolHView.camera = self.contact;
|
||||
[self.view addSubview:bottomToolHView];
|
||||
|
|
@ -640,7 +640,7 @@ Strong UIImage *screenShotImage;//截图
|
|||
self.bottomToolHView.hidden = NO;
|
||||
|
||||
//底部view 水族箱view
|
||||
UIView *bottomHView = [[UIView alloc] initWithFrame:CGRectMake(0.0, CGRectGetMaxY(self.segControl.frame) + 10, width, height-CGRectGetMaxY(self.segControl.frame))];
|
||||
UIView *bottomHView = [[UIView alloc] initWithFrame:CGRectMake(0.0, CGRectGetMaxY(self.segControl.frame) + 10, width, height-CGRectGetMaxY(self.segControl.frame)-10-MyNavBarHeight)];
|
||||
bottomHView.backgroundColor = JWUIColorFromRGB(0xdddddd);
|
||||
[self.view addSubview:bottomHView];
|
||||
self.bottomFishHView = bottomHView;
|
||||
|
|
@ -4570,6 +4570,23 @@ GWP2PCallErrorNotSupport,
|
|||
}];
|
||||
|
||||
}
|
||||
//视频录制
|
||||
else if (indexPath.row ==6){
|
||||
CameraRecordViewController*ca=[[CameraRecordViewController alloc]init];
|
||||
ca.camera=self.contact;
|
||||
[self.navigationController pushViewController:ca animated:YES];
|
||||
|
||||
|
||||
}
|
||||
|
||||
else if (indexPath.row ==7){
|
||||
|
||||
IfishP2PPlayBackListViewController *cameraShopVC=[[IfishP2PPlayBackListViewController alloc]init];
|
||||
cameraShopVC.camera = self.contact;
|
||||
[self.navigationController pushViewController:cameraShopVC animated:YES];
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
if (self) {
|
||||
CGFloat viewH =200;
|
||||
UIView *holdView = [[UIView alloc] initWithFrame:CGRectMake(0,frame.size.height/2 -viewH, kScreenSize.width, viewH)];
|
||||
UIView *holdView = [[UIView alloc] initWithFrame:self.bounds];
|
||||
self.backgroundColor = TABLE_BACKGROUD_COLOR;
|
||||
holdView.backgroundColor = TABLE_BACKGROUD_COLOR;
|
||||
//self.backgroundColor = [UIColor redColor];
|
||||
|
|
@ -55,15 +55,15 @@
|
|||
|
||||
if (self.dataType == noDataViewTypeNOSDCard) {
|
||||
|
||||
CGFloat imgX = self.frame.size.width/2 - 110*KWidth_Scale/2;
|
||||
self.backImg.frame =CGRectMake(imgX ,kScreenSize.height/4,110*KWidth_Scale, 110*KWidth_Scale*0.82);
|
||||
CGFloat imgX = self.frame.size.width/2 - 110/2;
|
||||
self.backImg.frame =CGRectMake(imgX,(self.frame.size.height-110*0.82)/2, 110, 110*0.82);
|
||||
self.title.frame =CGRectMake(0, CGRectGetMaxY(self.backImg.frame) + 20 , self.frame.size.width,20);
|
||||
self.subTitle.frame = CGRectMake(0, CGRectGetMaxY(self.title.frame) + 10, self.frame.size.width,20);
|
||||
|
||||
}else{
|
||||
|
||||
CGFloat imgX = self.frame.size.width/2 - 90*KWidth_Scale/2;
|
||||
self.backImg.frame =CGRectMake(imgX ,kScreenSize.height/4,90*KWidth_Scale, 90*KWidth_Scale*0.86);
|
||||
CGFloat imgX = self.frame.size.width/2 - 110/2;
|
||||
self.backImg.frame =CGRectMake(imgX,(self.frame.size.height-110*0.82)/2, 110, 110*0.82);
|
||||
self.title.frame =CGRectMake(0, CGRectGetMaxY(self.backImg.frame) + 23 , self.frame.size.width,20);
|
||||
//self.backgroundColor = [UIColor blueColor];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,5 +11,8 @@
|
|||
#import "IfishCameraModel.h"
|
||||
@interface IfishP2PPlayBackListViewController : BaseViewController
|
||||
@property (nonatomic,strong) IfishCameraModel *camera;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *startBtn;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *endBtn;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *searchBtn;
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -10,13 +10,16 @@
|
|||
#import "CameraNoParyBackVideoView.h"
|
||||
#import "P2PClient.h"
|
||||
#import "IfishPlaybackViewCell.h"
|
||||
#import <GWP2P/GWP2P.h>
|
||||
#import "DatePickerCustomView.h"
|
||||
#import "PlayBackViewController.h"
|
||||
#define BACKVIEW_ROWH 60
|
||||
#define ANIM_VIEW_WIDTH_AND_HEIGHT 80
|
||||
|
||||
//新
|
||||
#import "P2PPlayingbackVC.h"
|
||||
@interface IfishP2PPlayBackListViewController ()<UITableViewDelegate,UITableViewDataSource,P2PPlaybackDelegate>
|
||||
@property(nonatomic,strong)UITableView *tableView;
|
||||
@property(nonatomic,strong) IBOutlet UITableView *tableView;
|
||||
@property(retain, nonatomic) NSMutableArray *playbackFiles;
|
||||
@property(retain, nonatomic) NSMutableArray *playbackSize;
|
||||
@property(retain, nonatomic) NSMutableArray *timesData;
|
||||
|
|
@ -26,24 +29,27 @@
|
|||
@property(retain, nonatomic) NSMutableArray *timesDataMore;
|
||||
@property(nonatomic,strong) CameraNoParyBackVideoView *noDataView;
|
||||
@property(strong, nonatomic) NSString *nextEndDate;
|
||||
@property (nonatomic) BOOL isloadMore;//是否更多
|
||||
@property (nonatomic) BOOL hasSDCard;//是否更多
|
||||
@property(strong, nonatomic) UIView *movieView;
|
||||
@property (nonatomic) BOOL isInItDevice; //是否连接设备
|
||||
@property (nonatomic, strong) DatePickerCustomView *datePickView;
|
||||
@property (nonatomic, strong) NSDate *startDate;
|
||||
@property (nonatomic, strong) NSDate *endDate;
|
||||
@end
|
||||
|
||||
@implementation IfishP2PPlayBackListViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[[P2PClient sharedClient] setIsClearPlaybackFilesLength:YES];//isClearPlaybackFilesLength
|
||||
// Do any additional setup after loading the view.
|
||||
_isloadMore = NO;
|
||||
_isInItDevice = NO;
|
||||
|
||||
_hasSDCard = NO;
|
||||
|
||||
self.playbackFiles = [NSMutableArray arrayWithCapacity:0];
|
||||
self.playbackSize = [NSMutableArray arrayWithCapacity:0];
|
||||
self.playbackFilesMore = [NSMutableArray arrayWithCapacity:0];
|
||||
self.playbackSizeMore = [NSMutableArray arrayWithCapacity:0];
|
||||
[self addTitleViewWithTitle:@"回放"];
|
||||
[self addTitleViewWithTitle:@"视频回放"];
|
||||
[self connectDevice];
|
||||
[self initUI];
|
||||
|
||||
//[[P2PClient sharedClient] setPlaybackDelegate:self];
|
||||
|
|
@ -53,57 +59,36 @@
|
|||
|
||||
-(void)connectDevice{
|
||||
|
||||
//LoginResult *loginResult = [UDManager getLoginInfo];
|
||||
//8225账号
|
||||
// NSString * P2PVerifyCode1 = @"1528438234";
|
||||
// NSString * P2PVerifyCode2 = @"992805759";
|
||||
// NSString *UserID = @"-2144354932";
|
||||
|
||||
UserModel *model=[[DataCenter defaultDtacenter] valueForKey:@"UserLogIn"];
|
||||
UserModel *model=[dataContorl getUserInfo];
|
||||
NSString *userIDName=[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff];
|
||||
|
||||
|
||||
//初始化设备
|
||||
if (!_isInItDevice) {
|
||||
NSLog(@"正在初始化设备");
|
||||
_isInItDevice = [[P2PClient sharedClient] p2pConnectWithId:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2];
|
||||
|
||||
// _isInItDevice = [[P2PClient sharedClient] p2pConnectWithId:model.gwellUserID codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2];
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(_isInItDevice){
|
||||
|
||||
NSLog(@"p2pConnect success. 成功 可以操作设备了");
|
||||
//成功 可以操作设备了
|
||||
usleep(600000);
|
||||
[self startMonitor];
|
||||
|
||||
}else{//new added
|
||||
NSLog(@"p2pConnect failure.失败,不能操作设备");
|
||||
//[self connectDevice];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
-(void)startMonitor{
|
||||
|
||||
if (_isInItDevice) {
|
||||
NSLog(@"发送呼叫命令");
|
||||
|
||||
[[P2PClient sharedClient] setIsBCalled:NO];
|
||||
[[P2PClient sharedClient] setP2pCallState:P2PCALL_STATUS_CALLING];
|
||||
|
||||
|
||||
[[P2PClient sharedClient] p2pCallWithId:self.camera.cameraId password:self.camera.cameraPass callType:P2PCALL_TYPE_PLAYBACK];
|
||||
if ([GWP2PClient sharedClient].linkStatus != P2PLinkStatusOK) {
|
||||
NSLog(@"正在检查P2P连接状态");
|
||||
BOOL connectDevice = [[GWP2PClient sharedClient] connectWithAccount:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2 sessionID1:model.sessionID sessionID2:model.sessionID2 customerIDs:nil];
|
||||
|
||||
if (connectDevice) {
|
||||
|
||||
[[GWP2PClient sharedClient] getDeviceStorageInfomationWithDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
|
||||
|
||||
if (success)
|
||||
{
|
||||
self.hasSDCard=YES;
|
||||
[self initNoSDDataViewHidden:YES];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self initNoSDDataViewHidden:NO];
|
||||
}
|
||||
}];
|
||||
|
||||
}else{
|
||||
NSLog(@"p2pConnect failure.失败,不能操作设备");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[AppDelegate sharedDefault].canFullScreen = YES;
|
||||
|
|
@ -113,36 +98,16 @@
|
|||
|
||||
-(void)viewWillDisappear:(BOOL)animated{
|
||||
[super viewWillDisappear:animated];
|
||||
//[AppDelegate sharedDefault].canFullScreen = YES;
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:RECEIVE_REMOTE_MESSAGE object:nil];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"read_play_false" object:nil];
|
||||
}
|
||||
|
||||
-(void)viewDidAppear:(BOOL)animated{
|
||||
[super viewDidAppear:animated];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveRemoteMessage:) name:RECEIVE_REMOTE_MESSAGE object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(readPlayFalse:) name:@"read_play_false" object:nil];
|
||||
|
||||
[[P2PClient sharedClient] getSDCardInfoWithId:self.camera.cameraId password:self.camera.cameraPass];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)readPlayFalse:(NSNotification*)noti{
|
||||
///
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[UIView transitionWithView:self.movieView duration:0.3 options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self.movieView.alpha = 0.3;
|
||||
}
|
||||
|
||||
completion:^(BOOL finished){
|
||||
[self.movieView setHidden:YES];
|
||||
[self.view makeToast:NSLocalizedString(@"connection_failed_please_reconnect", nil)];
|
||||
}
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
-(void)goBackAction{
|
||||
|
|
@ -152,114 +117,7 @@
|
|||
}
|
||||
|
||||
|
||||
- (void)receiveRemoteMessage:(NSNotification *)notification{
|
||||
|
||||
NSDictionary *parameter = [notification userInfo];
|
||||
int key = [[parameter valueForKey:@"key"] intValue];
|
||||
|
||||
switch (key) {
|
||||
case RET_GET_PLAYBACK_FILES:
|
||||
{
|
||||
//回放文件名称
|
||||
NSArray *array = [NSArray arrayWithArray:(NSArray*)[parameter valueForKey:@"files"]];
|
||||
//回放文件的时间记录
|
||||
NSArray *times = [NSArray arrayWithArray:(NSArray*)[parameter valueForKey:@"times"]];
|
||||
//回放文件的播放时长
|
||||
NSArray *sizes = [NSArray arrayWithArray:(NSArray*)[parameter valueForKey:@"sizes"]];
|
||||
|
||||
|
||||
//若不是加载更多时,则往已playbackFiles数组存放回放文件
|
||||
//若是加载更多,则往playbackFilesMore的数组添加回放文件
|
||||
//若不是加载更多时,则往playbackSize数组存放回放文件的播放时长
|
||||
//若是上拉加载更多,则往playbackSizeMore数组末尾添加回放文件的播放时长
|
||||
if (_isloadMore) {
|
||||
|
||||
for (NSString *file in array){
|
||||
[self.playbackFilesMore addObject:file];
|
||||
}
|
||||
for (NSString *size in sizes){
|
||||
[self.playbackSizeMore addObject:size];
|
||||
}
|
||||
//刷新表格
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self.tableView reloadData];
|
||||
if (self.playbackFilesMore.count < 1) {
|
||||
//[self.view makeToast:NSLocalizedString(@"no_playback_file", nil)];
|
||||
[self.view makeToast:@"没有更多视频"];
|
||||
}
|
||||
});
|
||||
self.timesDataMore = [NSMutableArray arrayWithArray:times];
|
||||
if (self.timesDataMore.count==0) {
|
||||
return;
|
||||
}
|
||||
|
||||
//记录最近1天、3天...已显示文件里最后一个文件的时间(最早文件的时间)
|
||||
//用于上拉加载时传入的结束时间
|
||||
self.nextEndDate = [self.timesDataMore lastObject];
|
||||
|
||||
}else{
|
||||
|
||||
for (NSString *file in array){
|
||||
[self.playbackFiles addObject:file];
|
||||
}
|
||||
for (NSString *size in sizes){
|
||||
[self.playbackSize addObject:size];
|
||||
}
|
||||
//刷新表格
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self.tableView reloadData];
|
||||
if (self.playbackFiles.count < 1) {
|
||||
//[self.view makeToast:NSLocalizedString(@"no_playback_file", nil)];
|
||||
[self initNoVideoDataViewHidden:NO];
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
self.timesData = [NSMutableArray arrayWithArray:times];
|
||||
if (self.timesData.count==0) {
|
||||
return;
|
||||
}
|
||||
|
||||
//记录最近1天、3天...已显示文件里最后一个文件的时间(最早文件的时间)
|
||||
//用于上拉加载时传入的结束时间
|
||||
self.nextEndDate = [self.timesData lastObject];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case RET_GET_SDCARD_INFO:
|
||||
|
||||
{
|
||||
NSInteger result = [[parameter valueForKey:@"result"] intValue];
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (result == 1) {
|
||||
|
||||
//[self.view makeToast:@"sdk卡可使用"];
|
||||
[[P2PClient sharedClient] setCurrentLabel:1];
|
||||
[[P2PClient sharedClient] getPlaybackFilesWithId:self.camera.cameraId password:self.camera.cameraPass timeInterval:1];
|
||||
[[P2PClient sharedClient] setPlaybackDelegate:self];
|
||||
|
||||
}else{
|
||||
//sd卡不存在,
|
||||
//[self.view makeToast:NSLocalizedString(@"no_storage", nil)];
|
||||
[self initNoSDDataViewHidden:NO];
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)initNoSDDataViewHidden:(BOOL)hidden
|
||||
|
||||
|
|
@ -273,7 +131,7 @@
|
|||
|
||||
if (!self.noDataView) {
|
||||
|
||||
self.noDataView = [[CameraNoParyBackVideoView alloc] initWithFrame:self.view.bounds];
|
||||
self.noDataView = [[CameraNoParyBackVideoView alloc] initWithFrame:self.tableView.frame];
|
||||
|
||||
[self.view addSubview:self.noDataView];
|
||||
}
|
||||
|
|
@ -288,7 +146,7 @@
|
|||
{
|
||||
if (!self.noDataView) {
|
||||
//CGFloat viewH =200;
|
||||
self.noDataView = [[CameraNoParyBackVideoView alloc] initWithFrame:self.view.bounds];
|
||||
self.noDataView = [[CameraNoParyBackVideoView alloc] initWithFrame:self.tableView.frame];
|
||||
[self.view addSubview:self.noDataView];
|
||||
}
|
||||
|
||||
|
|
@ -301,34 +159,96 @@
|
|||
}
|
||||
-(void)initUI
|
||||
{
|
||||
|
||||
|
||||
self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0,0,self.view.frame.size.width,self.view.frame.size.height) style:UITableViewStyleGrouped];
|
||||
self.tableView.delegate = self;
|
||||
self.tableView.dataSource = self;
|
||||
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
self.tableView.showsVerticalScrollIndicator = NO;
|
||||
self.tableView.backgroundColor = RGB(241, 241, 241);
|
||||
[self.view addSubview:self.tableView];
|
||||
|
||||
UIView *movieView = [[UIView alloc] initWithFrame:CGRectMake(0, NAVIGATION_BAR_HEIGHT, self.view.frame.size.width, self.view.frame.size.height-NAVIGATION_BAR_HEIGHT)];
|
||||
[movieView setBackgroundColor:XBlack_128];
|
||||
|
||||
UIImageView *animView = [[UIImageView alloc] initWithFrame:CGRectMake((movieView.frame.size.width-ANIM_VIEW_WIDTH_AND_HEIGHT)/2, (movieView.frame.size.height-ANIM_VIEW_WIDTH_AND_HEIGHT)/2, ANIM_VIEW_WIDTH_AND_HEIGHT, ANIM_VIEW_WIDTH_AND_HEIGHT)];
|
||||
|
||||
NSArray *imagesArray = [NSArray arrayWithObjects:LXImageWithImageName(@"movie1.png"),LXImageWithImageName(@"movie2.png"),LXImageWithImageName(@"movie3.png"),nil];
|
||||
|
||||
animView.animationImages = imagesArray;
|
||||
animView.animationDuration = ((CGFloat)[imagesArray count])*100.0f/1000.0f;
|
||||
animView.animationRepeatCount = 0;
|
||||
[animView startAnimating];
|
||||
[movieView addSubview:animView];
|
||||
[movieView setHidden:YES];
|
||||
[self.view addSubview:movieView];
|
||||
self.movieView = movieView;
|
||||
|
||||
|
||||
NSDate *nowDate = [NSDate date]; // 当前时间
|
||||
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
|
||||
formatter.dateFormat = @"yyyy-MM-dd HH:mm";
|
||||
NSString *string = [formatter stringFromDate:nowDate]; //
|
||||
[self.startBtn setTitle:[formatter stringFromDate:[nowDate dateByAddingTimeInterval:-60*60]] forState:UIControlStateNormal];
|
||||
[self.endBtn setTitle:string forState:UIControlStateNormal];
|
||||
self.startDate=[nowDate dateByAddingTimeInterval:-60*60];
|
||||
self.endDate=nowDate;
|
||||
}
|
||||
|
||||
- (IBAction)startTimeClick:(UIButton *)sender {
|
||||
|
||||
[self.datePickView removeFromSuperview];
|
||||
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
|
||||
[dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier: @"zh_CN"]];
|
||||
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"];
|
||||
DatePickerCustomView* dateView = [DatePickerCustomView showInView:self.view Mode:UIDatePickerModeDateAndTime date:[dateFormatter dateFromString:[sender titleForState:UIControlStateNormal]]];
|
||||
dateView.datePicker.maximumDate=[NSDate date];
|
||||
|
||||
self.datePickView=dateView;
|
||||
WEAK_SELF;
|
||||
|
||||
__weak DatePickerCustomView* weakDateView =dateView;
|
||||
dateView.dateChanged =^{
|
||||
|
||||
[sender setTitle:[dateFormatter stringFromDate:weakDateView.datePicker.date] forState:UIControlStateNormal];
|
||||
weakSelf.startDate=weakDateView.datePicker.date;
|
||||
|
||||
};
|
||||
dateView.cancelBlock = ^{
|
||||
|
||||
};
|
||||
}
|
||||
- (IBAction)endTimeClick:(UIButton *)sender {
|
||||
|
||||
[self.datePickView removeFromSuperview];
|
||||
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
|
||||
[dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier: @"zh_CN"]];
|
||||
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"];
|
||||
DatePickerCustomView* dateView = [DatePickerCustomView showInView:self.view Mode:UIDatePickerModeDateAndTime date:[dateFormatter dateFromString:[sender titleForState:UIControlStateNormal]]];
|
||||
dateView.datePicker.maximumDate=[NSDate date];
|
||||
|
||||
self.datePickView=dateView;
|
||||
|
||||
__weak DatePickerCustomView* weakDateView =dateView;
|
||||
WEAK_SELF;
|
||||
dateView.dateChanged =^{
|
||||
|
||||
[sender setTitle:[dateFormatter stringFromDate:weakDateView.datePicker.date] forState:UIControlStateNormal];
|
||||
weakSelf.endDate=weakDateView.datePicker.date;
|
||||
};
|
||||
dateView.cancelBlock = ^{
|
||||
|
||||
};
|
||||
}
|
||||
- (IBAction)searchClick:(UIButton *)sender {
|
||||
|
||||
if ([self.startDate compare:self.endDate]==NSOrderedDescending) {
|
||||
[self.view makeToast:@"开始时间必须小于结束时间"];
|
||||
return;;
|
||||
}
|
||||
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
||||
[[GWP2PClient sharedClient] getDevicePlaybackFilesWithDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass startDate:self.startDate endDate:self.endDate completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
|
||||
[MBProgressHUD hideHUDForView:self.view animated:YES];
|
||||
NSLog(@"dataDictionary=%@",dataDictionary);
|
||||
[self.playbackFiles removeAllObjects];
|
||||
if (success&&[dataDictionary[@"error value"] intValue]==0)
|
||||
{
|
||||
|
||||
NSArray*files=dataDictionary[@"files"];
|
||||
if ([files isKindOfClass:[NSArray class]]&&files.count)
|
||||
{
|
||||
[self initNoVideoDataViewHidden:YES];
|
||||
[self.playbackFiles addObjectsFromArray:files];
|
||||
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self initNoVideoDataViewHidden:NO];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
[self initNoVideoDataViewHidden:NO];
|
||||
[self connectDevice];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
|
|
@ -336,17 +256,12 @@
|
|||
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
|
||||
return 2;
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
if (section ==0) {
|
||||
|
||||
return [self.playbackFiles count];
|
||||
}
|
||||
return [self.playbackFilesMore count];
|
||||
|
||||
return self.playbackFiles.count;
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
|
|
@ -359,68 +274,15 @@
|
|||
|
||||
|
||||
IfishPlaybackViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"IfishPlaybackViewCell"];
|
||||
GWPlaybackFileModel*model=[self.playbackFiles objectAtIndex:indexPath.row];
|
||||
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle]loadNibNamed:@"IfishPlaybackViewCell" owner:self options:nil]lastObject];
|
||||
|
||||
}
|
||||
cell.model=model;
|
||||
|
||||
|
||||
//每一分区这里加载不同数据源
|
||||
if (indexPath.section ==0) {
|
||||
if (self.playbackFiles.count!=0) {
|
||||
|
||||
NSString* name = [self.playbackFiles objectAtIndex:indexPath.row];
|
||||
|
||||
int iSize = 0;
|
||||
if ([self.playbackFiles count] == [self.playbackSize count]) //查询到了文件长度
|
||||
{
|
||||
NSNumber* number = [self.playbackSize objectAtIndex:indexPath.row];
|
||||
iSize = [number intValue];
|
||||
}
|
||||
if (iSize != 0) {//支持返回播放时长
|
||||
//cell.videoTime.text = [NSString stringWithFormat:@"%@ (%02d:%02d)", name, iSize/60, iSize%60];
|
||||
cell.videoTime.text = [NSString stringWithFormat:@"%@", name];
|
||||
cell.videoLongth.text = [NSString stringWithFormat:@"%02d分钟",iSize/60];
|
||||
if (iSize<60) {
|
||||
|
||||
cell.videoLongth.text = [NSString stringWithFormat:@"%02d秒钟",iSize%60];
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
cell.videoTime.text = [NSString stringWithFormat:@"%@", name];
|
||||
cell.videoLongth.text = @"未知";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}else{
|
||||
//更多
|
||||
if (self.playbackFilesMore.count !=0) {
|
||||
|
||||
NSString* name = [self.playbackFilesMore objectAtIndex:indexPath.row];
|
||||
|
||||
int iSize = 0;
|
||||
if ([self.playbackFilesMore count] == [self.playbackSizeMore count]) //查询到了文件长度
|
||||
{
|
||||
NSNumber* number = [self.playbackSizeMore objectAtIndex:indexPath.row];
|
||||
iSize = [number intValue];
|
||||
}
|
||||
if (iSize != 0) {//支持返回播放时长
|
||||
//cell.videoTime.text = [NSString stringWithFormat:@"%@ (%02d:%02d)", name, iSize/60, iSize%60];
|
||||
cell.videoTime.text = [NSString stringWithFormat:@"%@", name];
|
||||
cell.videoLongth.text = [NSString stringWithFormat:@"%02d分钟",iSize/60];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
cell.videoTime.text = [NSString stringWithFormat:@"%@", name];
|
||||
cell.videoLongth.text = @"未知";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return cell;
|
||||
|
||||
|
|
@ -428,144 +290,133 @@
|
|||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
|
||||
[self.movieView setHidden:NO];
|
||||
self.movieView.alpha = 0.3;
|
||||
GWPlaybackFileModel*model=[self.playbackFiles objectAtIndex:indexPath.row];
|
||||
PlayBackViewController*play=[[PlayBackViewController alloc]init];
|
||||
play.camera=self.camera;
|
||||
play.model=model;
|
||||
|
||||
[UIView transitionWithView:self.movieView duration:0.3 options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
self.movieView.alpha = 1.0;
|
||||
}
|
||||
|
||||
completion:^(BOOL finished){
|
||||
|
||||
}
|
||||
];
|
||||
if (indexPath.section ==0) {
|
||||
|
||||
[[P2PClient sharedClient] p2pPlaybackCallWithId:self.camera.cameraId password:self.camera.cameraPass index:indexPath.row];
|
||||
|
||||
}else{
|
||||
[[P2PClient sharedClient] p2pPlaybackCallWithId:self.camera.cameraId password:self.camera.cameraPass index:indexPath.row + self.playbackFiles.count];
|
||||
}
|
||||
|
||||
[self.navigationController pushViewController:play animated:YES];
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
||||
|
||||
if (section==0) {
|
||||
//描述 + 回放列表 + 今天 + 1 像素线
|
||||
return 50 +BACKVIEW_ROWH +BACKVIEW_ROWH + 1;
|
||||
}
|
||||
return 0.1;
|
||||
}
|
||||
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
|
||||
|
||||
if (section ==1) {
|
||||
|
||||
return BACKVIEW_ROWH;
|
||||
}
|
||||
return 0.1;
|
||||
}
|
||||
-(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
||||
|
||||
CGFloat space = 10;
|
||||
|
||||
if (section ==0) {
|
||||
|
||||
UIView *section0Header =[[UIView alloc] init];
|
||||
section0Header.frame = CGRectMake(0, 0, self.view.frame.size.width, 191);
|
||||
|
||||
UILabel *describleLabe=[[UILabel alloc] init];
|
||||
describleLabe.frame = CGRectMake(0, 0,self.view.frame.size.width, 50);
|
||||
describleLabe.textColor =RGB(102, 102, 102);
|
||||
describleLabe.textAlignment = NSTextAlignmentCenter;
|
||||
describleLabe.text = @"30分钟录制一次,录像最多存储7日";
|
||||
describleLabe.font = [UIFont systemFontOfSize:12];
|
||||
describleLabe.backgroundColor = RGB(241, 245, 246);
|
||||
|
||||
[section0Header addSubview:describleLabe];
|
||||
|
||||
UIView *listLabeBack =[[UIView alloc] init];
|
||||
listLabeBack.frame = CGRectMake(0,CGRectGetMaxY(describleLabe.frame), self.view.frame.size.width,BACKVIEW_ROWH);
|
||||
listLabeBack.backgroundColor = [UIColor whiteColor];
|
||||
|
||||
[section0Header addSubview:listLabeBack];
|
||||
|
||||
UILabel *listLabe=[[UILabel alloc] init];
|
||||
listLabe.frame = CGRectMake(space,CGRectGetHeight(listLabeBack.frame)/2,200, 20);
|
||||
listLabe.textColor =RGB(102, 102, 102);
|
||||
listLabe.font = [UIFont systemFontOfSize:15];
|
||||
listLabe.text = @"回放列表";
|
||||
[listLabeBack addSubview:listLabe];
|
||||
CGFloat listlW = 50;
|
||||
UILabel *listl=[[UILabel alloc] init];
|
||||
listl.frame = CGRectMake(self.view.frame.size.width - space -listlW -4,CGRectGetHeight(listLabeBack.frame)/2,listlW, 20);
|
||||
listl.textColor =RGB(102, 102, 102);
|
||||
listl.font = [UIFont systemFontOfSize:14];
|
||||
listl.text = @"时长";
|
||||
listl.textAlignment = NSTextAlignmentRight;
|
||||
[listLabeBack addSubview:listl];
|
||||
|
||||
|
||||
//一像素分割线
|
||||
UIView *lineView =[[UIView alloc] init];
|
||||
lineView.frame = CGRectMake(0, CGRectGetMaxY(listLabeBack.frame), self.view.frame.size.width,1);
|
||||
lineView.backgroundColor = RGB(241, 241, 241);
|
||||
[section0Header addSubview:lineView];
|
||||
//今天
|
||||
UIView *todayLabeBack =[[UIView alloc] init];
|
||||
todayLabeBack.frame = CGRectMake(0,CGRectGetMaxY(lineView.frame),self.view.frame.size.width, BACKVIEW_ROWH);
|
||||
todayLabeBack.backgroundColor = [UIColor whiteColor];
|
||||
|
||||
[section0Header addSubview:todayLabeBack];
|
||||
UILabel *todayLabe=[[UILabel alloc] init];
|
||||
todayLabe.frame = CGRectMake(space,0,self.view.frame.size.width, BACKVIEW_ROWH);
|
||||
todayLabe.textColor =RGB(153, 153, 153);
|
||||
todayLabe.font = [UIFont systemFontOfSize:14];
|
||||
todayLabe.text = @"最近24小时";
|
||||
todayLabe.backgroundColor = [UIColor whiteColor];
|
||||
//todayLabe.text.
|
||||
[todayLabeBack addSubview:todayLabe];
|
||||
|
||||
|
||||
|
||||
return section0Header;
|
||||
}
|
||||
|
||||
return nil;
|
||||
|
||||
}
|
||||
|
||||
-(UIView*)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
|
||||
CGFloat space = 10;
|
||||
|
||||
if (section ==1) {
|
||||
//更多
|
||||
UIView *moreLabeBack =[[UIView alloc] init];
|
||||
moreLabeBack.frame = CGRectMake(0,0,self.view.frame.size.width, BACKVIEW_ROWH);
|
||||
moreLabeBack.backgroundColor = [UIColor whiteColor];
|
||||
UILabel *moreLabe=[[UILabel alloc] init];
|
||||
moreLabe.frame = CGRectMake(space,0,self.view.frame.size.width, BACKVIEW_ROWH);
|
||||
moreLabe.textColor =RGB(153, 153, 153);
|
||||
moreLabe.font = [UIFont systemFontOfSize:14];
|
||||
moreLabe.text = @"查看更多";
|
||||
moreLabe.backgroundColor = [UIColor whiteColor];
|
||||
[moreLabeBack addSubview:moreLabe];
|
||||
moreLabe.userInteractionEnabled = YES;
|
||||
UITapGestureRecognizer *moreGesture =[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(moreDataRequset)];
|
||||
[moreLabe addGestureRecognizer:moreGesture];
|
||||
|
||||
return moreLabeBack;
|
||||
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
//
|
||||
//-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
||||
//
|
||||
// if (section==0) {
|
||||
// //描述 + 回放列表 + 今天 + 1 像素线
|
||||
// return 50 +BACKVIEW_ROWH +BACKVIEW_ROWH + 1;
|
||||
// }
|
||||
// return 0.1;
|
||||
//}
|
||||
//
|
||||
//-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
|
||||
//
|
||||
// if (section ==1) {
|
||||
//
|
||||
// return BACKVIEW_ROWH;
|
||||
// }
|
||||
// return 0.1;
|
||||
//}
|
||||
//-(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
||||
//
|
||||
// CGFloat space = 10;
|
||||
//
|
||||
// if (section ==0) {
|
||||
//
|
||||
// UIView *section0Header =[[UIView alloc] init];
|
||||
// section0Header.frame = CGRectMake(0, 0, self.view.frame.size.width, 191);
|
||||
//
|
||||
// UILabel *describleLabe=[[UILabel alloc] init];
|
||||
// describleLabe.frame = CGRectMake(0, 0,self.view.frame.size.width, 50);
|
||||
// describleLabe.textColor =RGB(102, 102, 102);
|
||||
// describleLabe.textAlignment = NSTextAlignmentCenter;
|
||||
// describleLabe.text = @"30分钟录制一次,录像最多存储7日";
|
||||
// describleLabe.font = [UIFont systemFontOfSize:12];
|
||||
// describleLabe.backgroundColor = RGB(241, 245, 246);
|
||||
//
|
||||
// [section0Header addSubview:describleLabe];
|
||||
//
|
||||
// UIView *listLabeBack =[[UIView alloc] init];
|
||||
// listLabeBack.frame = CGRectMake(0,CGRectGetMaxY(describleLabe.frame), self.view.frame.size.width,BACKVIEW_ROWH);
|
||||
// listLabeBack.backgroundColor = [UIColor whiteColor];
|
||||
//
|
||||
// [section0Header addSubview:listLabeBack];
|
||||
//
|
||||
// UILabel *listLabe=[[UILabel alloc] init];
|
||||
// listLabe.frame = CGRectMake(space,CGRectGetHeight(listLabeBack.frame)/2,200, 20);
|
||||
// listLabe.textColor =RGB(102, 102, 102);
|
||||
// listLabe.font = [UIFont systemFontOfSize:15];
|
||||
// listLabe.text = @"回放列表";
|
||||
// [listLabeBack addSubview:listLabe];
|
||||
// CGFloat listlW = 50;
|
||||
// UILabel *listl=[[UILabel alloc] init];
|
||||
// listl.frame = CGRectMake(self.view.frame.size.width - space -listlW -4,CGRectGetHeight(listLabeBack.frame)/2,listlW, 20);
|
||||
// listl.textColor =RGB(102, 102, 102);
|
||||
// listl.font = [UIFont systemFontOfSize:14];
|
||||
// listl.text = @"时长";
|
||||
// listl.textAlignment = NSTextAlignmentRight;
|
||||
// [listLabeBack addSubview:listl];
|
||||
//
|
||||
//
|
||||
// //一像素分割线
|
||||
// UIView *lineView =[[UIView alloc] init];
|
||||
// lineView.frame = CGRectMake(0, CGRectGetMaxY(listLabeBack.frame), self.view.frame.size.width,1);
|
||||
// lineView.backgroundColor = RGB(241, 241, 241);
|
||||
// [section0Header addSubview:lineView];
|
||||
// //今天
|
||||
// UIView *todayLabeBack =[[UIView alloc] init];
|
||||
// todayLabeBack.frame = CGRectMake(0,CGRectGetMaxY(lineView.frame),self.view.frame.size.width, BACKVIEW_ROWH);
|
||||
// todayLabeBack.backgroundColor = [UIColor whiteColor];
|
||||
//
|
||||
// [section0Header addSubview:todayLabeBack];
|
||||
// UILabel *todayLabe=[[UILabel alloc] init];
|
||||
// todayLabe.frame = CGRectMake(space,0,self.view.frame.size.width, BACKVIEW_ROWH);
|
||||
// todayLabe.textColor =RGB(153, 153, 153);
|
||||
// todayLabe.font = [UIFont systemFontOfSize:14];
|
||||
// todayLabe.text = @"最近24小时";
|
||||
// todayLabe.backgroundColor = [UIColor whiteColor];
|
||||
// //todayLabe.text.
|
||||
// [todayLabeBack addSubview:todayLabe];
|
||||
//
|
||||
//
|
||||
//
|
||||
// return section0Header;
|
||||
// }
|
||||
//
|
||||
// return nil;
|
||||
//
|
||||
//}
|
||||
//
|
||||
//-(UIView*)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
|
||||
// CGFloat space = 10;
|
||||
//
|
||||
// if (section ==1) {
|
||||
// //更多
|
||||
// UIView *moreLabeBack =[[UIView alloc] init];
|
||||
// moreLabeBack.frame = CGRectMake(0,0,self.view.frame.size.width, BACKVIEW_ROWH);
|
||||
// moreLabeBack.backgroundColor = [UIColor whiteColor];
|
||||
// UILabel *moreLabe=[[UILabel alloc] init];
|
||||
// moreLabe.frame = CGRectMake(space,0,self.view.frame.size.width, BACKVIEW_ROWH);
|
||||
// moreLabe.textColor =RGB(153, 153, 153);
|
||||
// moreLabe.font = [UIFont systemFontOfSize:14];
|
||||
// moreLabe.text = @"查看更多";
|
||||
// moreLabe.backgroundColor = [UIColor whiteColor];
|
||||
// [moreLabeBack addSubview:moreLabe];
|
||||
// moreLabe.userInteractionEnabled = YES;
|
||||
// UITapGestureRecognizer *moreGesture =[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(moreDataRequset)];
|
||||
// [moreLabe addGestureRecognizer:moreGesture];
|
||||
//
|
||||
// return moreLabeBack;
|
||||
//
|
||||
// }
|
||||
// return nil;
|
||||
//}
|
||||
#pragma mark - moreDataRequset
|
||||
|
||||
-(void)moreDataRequset{
|
||||
_isloadMore =YES;
|
||||
|
||||
// //today
|
||||
NSDate *nowDate = [NSDate date];
|
||||
NSInteger interval =31;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,271 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_1" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
|
||||
<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>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="IfishP2PPlayBackListViewController">
|
||||
<connections>
|
||||
<outlet property="endBtn" destination="tn6-eP-Fcy" id="fCN-FK-dN3"/>
|
||||
<outlet property="searchBtn" destination="pFd-XZ-Jwy" id="bV2-Y5-cFu"/>
|
||||
<outlet property="startBtn" destination="kku-gY-Q7f" id="rZc-J9-BHd"/>
|
||||
<outlet property="tableView" destination="4mg-Y4-tdd" id="icl-Nx-NUp"/>
|
||||
<outlet property="view" destination="iN0-l3-epB" id="ofW-7c-1C6"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view contentMode="scaleToFill" id="iN0-l3-epB">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="arN-mi-hdC">
|
||||
<rect key="frame" x="0.0" y="44" width="414" height="260"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HW3-zp-qaz" userLabel="start">
|
||||
<rect key="frame" x="0.0" y="20" width="414" height="60"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="g9K-Lj-fdX" userLabel="line2">
|
||||
<rect key="frame" x="0.0" y="59.5" width="414" height="0.5"/>
|
||||
<color key="backgroundColor" red="0.50594329829999996" green="0.50971984859999997" blue="0.51372647289999995" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="0.5" id="eYX-dI-CCb"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GsK-Vz-f8c" userLabel="line1">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="0.5"/>
|
||||
<color key="backgroundColor" red="0.50594329829999996" green="0.50971984859999997" blue="0.51372647289999995" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="0.5" id="ARj-zQ-gsw"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="开始日期:" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="I8c-Yw-b6c">
|
||||
<rect key="frame" x="0.0" y="0.0" width="100" height="60"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="100" id="eRB-vs-cgp"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kku-gY-Q7f" userLabel="startBtn">
|
||||
<rect key="frame" x="137" y="10" width="140" height="40"/>
|
||||
<color key="backgroundColor" red="0.85882914070000005" green="0.85481816529999999" blue="0.8588245511" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="140" id="cyL-N8-h3p"/>
|
||||
</constraints>
|
||||
<state key="normal" title="2020-10-17 15:44">
|
||||
<color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
|
||||
</state>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="20"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<action selector="startTimeClick:" destination="-1" eventType="touchUpInside" id="pbD-ic-I7y"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="g9K-Lj-fdX" firstAttribute="leading" secondItem="HW3-zp-qaz" secondAttribute="leading" id="4lF-M9-cfP"/>
|
||||
<constraint firstItem="GsK-Vz-f8c" firstAttribute="top" secondItem="HW3-zp-qaz" secondAttribute="top" id="9AY-YC-o1a"/>
|
||||
<constraint firstAttribute="bottom" secondItem="I8c-Yw-b6c" secondAttribute="bottom" id="9kN-30-AYl"/>
|
||||
<constraint firstAttribute="bottom" secondItem="g9K-Lj-fdX" secondAttribute="bottom" id="OI4-VN-uXY"/>
|
||||
<constraint firstItem="I8c-Yw-b6c" firstAttribute="top" secondItem="HW3-zp-qaz" secondAttribute="top" id="RNn-F5-Xeq"/>
|
||||
<constraint firstAttribute="bottom" secondItem="kku-gY-Q7f" secondAttribute="bottom" constant="10" id="RjY-yi-2zb"/>
|
||||
<constraint firstItem="GsK-Vz-f8c" firstAttribute="leading" secondItem="HW3-zp-qaz" secondAttribute="leading" id="RqV-wa-sUI"/>
|
||||
<constraint firstAttribute="height" constant="60" id="bbP-qb-Nyd"/>
|
||||
<constraint firstAttribute="trailing" secondItem="g9K-Lj-fdX" secondAttribute="trailing" id="bra-HK-zdf"/>
|
||||
<constraint firstItem="I8c-Yw-b6c" firstAttribute="leading" secondItem="HW3-zp-qaz" secondAttribute="leading" id="gvF-ka-pbb"/>
|
||||
<constraint firstItem="kku-gY-Q7f" firstAttribute="centerX" secondItem="HW3-zp-qaz" secondAttribute="centerX" id="hcl-7j-RES"/>
|
||||
<constraint firstItem="kku-gY-Q7f" firstAttribute="top" secondItem="HW3-zp-qaz" secondAttribute="top" constant="10" id="ldA-ZL-75A"/>
|
||||
<constraint firstAttribute="trailing" secondItem="GsK-Vz-f8c" secondAttribute="trailing" id="o1G-oH-GFV"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
|
||||
<color key="value" red="0.50594329829999996" green="0.50971984859999997" blue="0.51372647289999995" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gbN-3d-Trv" userLabel="end">
|
||||
<rect key="frame" x="0.0" y="80" width="414" height="60"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="结束日期:" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RAo-9M-Wa2">
|
||||
<rect key="frame" x="0.0" y="0.0" width="100" height="60"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="100" id="Ecq-wU-f1p"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Hek-yp-JXZ" userLabel="line3">
|
||||
<rect key="frame" x="0.0" y="59.5" width="414" height="0.5"/>
|
||||
<color key="backgroundColor" red="0.50594329829999996" green="0.50971984859999997" blue="0.51372647289999995" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="0.5" id="6P3-F7-EXy"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tn6-eP-Fcy" userLabel="endBtn">
|
||||
<rect key="frame" x="137" y="10" width="140" height="40"/>
|
||||
<color key="backgroundColor" red="0.86272245650000001" green="0.85881525280000004" blue="0.85882407429999996" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="140" id="X9l-lJ-tdi"/>
|
||||
</constraints>
|
||||
<state key="normal" title="2020-10-17 15:44">
|
||||
<color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
|
||||
</state>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="20"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<action selector="endTimeClick:" destination="-1" eventType="touchUpInside" id="Dk2-9N-clp"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="Hek-yp-JXZ" secondAttribute="bottom" id="Fyk-hr-dlw"/>
|
||||
<constraint firstAttribute="bottom" secondItem="tn6-eP-Fcy" secondAttribute="bottom" constant="10" id="SUI-cz-yfp"/>
|
||||
<constraint firstItem="RAo-9M-Wa2" firstAttribute="top" secondItem="gbN-3d-Trv" secondAttribute="top" id="VDB-rV-fB2"/>
|
||||
<constraint firstItem="tn6-eP-Fcy" firstAttribute="centerX" secondItem="gbN-3d-Trv" secondAttribute="centerX" id="a0d-KX-0lz"/>
|
||||
<constraint firstAttribute="bottom" secondItem="RAo-9M-Wa2" secondAttribute="bottom" id="b9w-79-N3y"/>
|
||||
<constraint firstItem="Hek-yp-JXZ" firstAttribute="leading" secondItem="gbN-3d-Trv" secondAttribute="leading" id="jdm-Ai-2VY"/>
|
||||
<constraint firstAttribute="height" constant="60" id="lhS-sk-0G5"/>
|
||||
<constraint firstItem="RAo-9M-Wa2" firstAttribute="leading" secondItem="gbN-3d-Trv" secondAttribute="leading" id="q94-03-dQ9"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Hek-yp-JXZ" secondAttribute="trailing" id="vUo-tc-qfJ"/>
|
||||
<constraint firstItem="tn6-eP-Fcy" firstAttribute="top" secondItem="gbN-3d-Trv" secondAttribute="top" constant="10" id="zmh-Za-93K"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
|
||||
<color key="value" red="0.50594329829999996" green="0.50971984859999997" blue="0.51372647289999995" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="scl-co-ww3" userLabel="bottom">
|
||||
<rect key="frame" x="0.0" y="210" width="414" height="50"/>
|
||||
<subviews>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="zSW-Qs-mlC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="50"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="开始时间" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ycQ-nI-y8x">
|
||||
<rect key="frame" x="0.0" y="0.0" width="138" height="50"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="结束时间" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2KQ-jC-hOC">
|
||||
<rect key="frame" x="138" y="0.0" width="138" height="50"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="点击播放" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="c9x-ah-UDf">
|
||||
<rect key="frame" x="276" y="0.0" width="138" height="50"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="ycQ-nI-y8x" firstAttribute="top" secondItem="zSW-Qs-mlC" secondAttribute="top" id="4X7-Lq-oVR"/>
|
||||
<constraint firstItem="2KQ-jC-hOC" firstAttribute="top" secondItem="zSW-Qs-mlC" secondAttribute="top" id="XVc-8x-dEb"/>
|
||||
<constraint firstAttribute="bottom" secondItem="c9x-ah-UDf" secondAttribute="bottom" id="XWB-Nq-MKw"/>
|
||||
<constraint firstAttribute="bottom" secondItem="2KQ-jC-hOC" secondAttribute="bottom" id="Zt7-Ka-OPb"/>
|
||||
<constraint firstAttribute="bottom" secondItem="ycQ-nI-y8x" secondAttribute="bottom" id="fBG-AY-ao5"/>
|
||||
<constraint firstItem="c9x-ah-UDf" firstAttribute="top" secondItem="zSW-Qs-mlC" secondAttribute="top" id="tRq-Ha-QiN"/>
|
||||
</constraints>
|
||||
</stackView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.85882914070000005" green="0.85481816529999999" blue="0.8588245511" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
|
||||
<color key="tintColor" red="0.50594329829999996" green="0.50971984859999997" blue="0.51372647289999995" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
|
||||
<constraints>
|
||||
<constraint firstItem="zSW-Qs-mlC" firstAttribute="top" secondItem="scl-co-ww3" secondAttribute="top" id="FXx-hH-bkT"/>
|
||||
<constraint firstAttribute="bottom" secondItem="zSW-Qs-mlC" secondAttribute="bottom" id="NsQ-qX-yNh"/>
|
||||
<constraint firstAttribute="trailing" secondItem="zSW-Qs-mlC" secondAttribute="trailing" id="d01-l2-FCR"/>
|
||||
<constraint firstAttribute="height" constant="50" id="h38-Zb-UEl"/>
|
||||
<constraint firstItem="zSW-Qs-mlC" firstAttribute="leading" secondItem="scl-co-ww3" secondAttribute="leading" id="mA5-SY-jbp"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pFd-XZ-Jwy" userLabel="searchbtn">
|
||||
<rect key="frame" x="107" y="155" width="200" height="40"/>
|
||||
<color key="backgroundColor" red="0.18429952860000001" green="0.30440244080000001" blue="0.60787326100000005" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="40" id="1yp-Hf-JjV"/>
|
||||
<constraint firstAttribute="width" constant="200" id="gx4-BG-yFb"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<state key="normal" title="搜索">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="22"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<action selector="searchClick:" destination="-1" eventType="touchUpInside" id="rSZ-cN-U9H"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="scl-co-ww3" secondAttribute="trailing" id="1VR-WR-e6W"/>
|
||||
<constraint firstAttribute="trailing" secondItem="gbN-3d-Trv" secondAttribute="trailing" id="KhA-b0-anV"/>
|
||||
<constraint firstAttribute="bottom" secondItem="scl-co-ww3" secondAttribute="bottom" id="L07-CX-pdS"/>
|
||||
<constraint firstItem="gbN-3d-Trv" firstAttribute="top" secondItem="HW3-zp-qaz" secondAttribute="bottom" id="Okw-TR-kVK"/>
|
||||
<constraint firstItem="gbN-3d-Trv" firstAttribute="leading" secondItem="arN-mi-hdC" secondAttribute="leading" id="Opk-FY-W4j"/>
|
||||
<constraint firstAttribute="height" constant="260" id="SsD-g5-MmX"/>
|
||||
<constraint firstItem="HW3-zp-qaz" firstAttribute="leading" secondItem="arN-mi-hdC" secondAttribute="leading" id="agv-XB-JbS"/>
|
||||
<constraint firstItem="pFd-XZ-Jwy" firstAttribute="bottom" secondItem="scl-co-ww3" secondAttribute="top" constant="-15" id="cT0-Zx-pUY"/>
|
||||
<constraint firstItem="pFd-XZ-Jwy" firstAttribute="centerX" secondItem="arN-mi-hdC" secondAttribute="centerX" id="dHp-bj-eHJ"/>
|
||||
<constraint firstItem="scl-co-ww3" firstAttribute="leading" secondItem="arN-mi-hdC" secondAttribute="leading" id="haG-gj-UoE"/>
|
||||
<constraint firstItem="gbN-3d-Trv" firstAttribute="height" secondItem="HW3-zp-qaz" secondAttribute="height" id="kl6-xN-0VO"/>
|
||||
<constraint firstAttribute="trailing" secondItem="HW3-zp-qaz" secondAttribute="trailing" id="oFM-ba-NAO"/>
|
||||
<constraint firstItem="HW3-zp-qaz" firstAttribute="top" secondItem="arN-mi-hdC" secondAttribute="top" constant="20" id="p1u-8F-9Ts"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="4mg-Y4-tdd">
|
||||
<rect key="frame" x="0.0" y="304" width="414" height="558"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="-1" id="CH5-1Z-Qaq"/>
|
||||
<outlet property="delegate" destination="-1" id="JH8-Tr-RKB"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="Lst-Xu-cte"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="arN-mi-hdC" firstAttribute="leading" secondItem="Lst-Xu-cte" secondAttribute="leading" id="30u-N1-5B0"/>
|
||||
<constraint firstItem="Lst-Xu-cte" firstAttribute="trailing" secondItem="arN-mi-hdC" secondAttribute="trailing" id="8U8-5f-eTf"/>
|
||||
<constraint firstItem="4mg-Y4-tdd" firstAttribute="leading" secondItem="Lst-Xu-cte" secondAttribute="leading" id="Cze-nN-z6e"/>
|
||||
<constraint firstItem="arN-mi-hdC" firstAttribute="top" secondItem="Lst-Xu-cte" secondAttribute="top" id="EwH-aK-ekx"/>
|
||||
<constraint firstItem="Lst-Xu-cte" firstAttribute="bottom" secondItem="4mg-Y4-tdd" secondAttribute="bottom" id="FwL-3f-iZL"/>
|
||||
<constraint firstItem="4mg-Y4-tdd" firstAttribute="top" secondItem="arN-mi-hdC" secondAttribute="bottom" id="MjI-zf-0B5"/>
|
||||
<constraint firstItem="Lst-Xu-cte" firstAttribute="trailing" secondItem="4mg-Y4-tdd" secondAttribute="trailing" id="fux-Ym-8Qa"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="137.68115942028987" y="81.696428571428569"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<systemColor name="systemBackgroundColor">
|
||||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</systemColor>
|
||||
</resources>
|
||||
</document>
|
||||
|
|
@ -7,11 +7,12 @@
|
|||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <GWP2P/GWP2P.h>
|
||||
|
||||
@interface IfishPlaybackViewCell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *palybackVideo;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UILabel *videoLongth;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *videoTime;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *playImageView;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *startTimeLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *endTimeLabel;
|
||||
@property (nonatomic, strong) GWPlaybackFileModel *model;
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
self.palybackVideo.image = LXImageWithImageName(@"playback_iocn_video");
|
||||
self.playImageView.image = LXImageWithImageName(@"playBackIcon");
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -22,5 +22,36 @@
|
|||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
-(void)setModel:(GWPlaybackFileModel *)model
|
||||
{
|
||||
_model=model;
|
||||
|
||||
NSString*start=[NSString stringWithFormat:@"%ld%02ld%02ld%02ld%02ld",model.year,model.month,model.day,model.hour,model.minute];
|
||||
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
|
||||
formatter.dateFormat = @"yyyyMMddHHmmss";
|
||||
NSDate*date=model.date;
|
||||
if (!date
|
||||
) {
|
||||
date= [formatter dateFromString:[start stringByAppendingFormat:@"%02ld",model.second]];
|
||||
|
||||
}
|
||||
|
||||
NSString*end=[NSString stringWithFormat:@"%ld%02ld%02ld%02ld%02ld",model.year,model.month,model.day,model.hour,model.minute];
|
||||
if (date)
|
||||
{
|
||||
|
||||
date=[date dateByAddingTimeInterval:model.time];
|
||||
|
||||
formatter.dateFormat=@"yyyyMMddHHmm";
|
||||
end=[formatter stringFromDate:date];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
self.startTimeLabel.text=start;
|
||||
self.endTimeLabel.text=end;
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -1,60 +1,78 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11542" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina6_1" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
|
||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="IfishPlaybackViewCell" id="KGk-i7-Jjw" customClass="IfishPlaybackViewCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="70"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="539" height="70"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="69"/>
|
||||
<tableViewCellContentView key="contentView" autoresizesSubviews="NO" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" ambiguous="YES" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="539" height="70"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="录像" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Fr5-kU-lL9">
|
||||
<rect key="frame" x="54" y="13" width="208" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6iO-V5-oJZ">
|
||||
<rect key="frame" x="54" y="36" width="208" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="10"/>
|
||||
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="30分钟" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uW9-bN-ief">
|
||||
<rect key="frame" x="270" y="36" width="42" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="10"/>
|
||||
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="AnP-CM-Ycx">
|
||||
<rect key="frame" x="0.0" y="68" width="320" height="1"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<color key="backgroundColor" red="0.94509803921568625" green="0.96078431372549022" blue="0.96470588235294119" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</view>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="mrW-Tn-00Y">
|
||||
<rect key="frame" x="10" y="24" width="30" height="20"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
</imageView>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="y6h-3U-eVp">
|
||||
<rect key="frame" x="0.0" y="0.0" width="503" height="539"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="202010171833" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mtl-sb-DhZ">
|
||||
<rect key="frame" x="0.0" y="261" width="206.5" height="17"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="202010171833" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jDd-Rf-aT2">
|
||||
<rect key="frame" x="206.5" y="261" width="206" height="17"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" id="Syh-58-pnu" userLabel="backView">
|
||||
<rect key="frame" x="412.5" y="269.5" width="90.5" height="0.0"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="YVK-ee-AkR">
|
||||
<rect key="frame" x="15.5" y="-30" width="60" height="60"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="60" id="OAr-LF-mDb"/>
|
||||
<constraint firstAttribute="height" constant="60" id="y9z-26-RmD"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="YVK-ee-AkR" firstAttribute="centerX" secondItem="Syh-58-pnu" secondAttribute="centerX" id="BlS-n1-JSf"/>
|
||||
<constraint firstItem="YVK-ee-AkR" firstAttribute="centerY" secondItem="Syh-58-pnu" secondAttribute="centerY" id="GZW-7p-Umo"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</stackView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="y6h-3U-eVp" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="0BY-ct-2rB"/>
|
||||
<constraint firstItem="y6h-3U-eVp" firstAttribute="trailing" secondItem="H2p-sc-9uM" secondAttribute="trailing" id="BjQ-0S-K1J"/>
|
||||
<constraint firstItem="y6h-3U-eVp" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="Xxg-jR-ij3"/>
|
||||
<constraint firstItem="y6h-3U-eVp" firstAttribute="bottom" secondItem="H2p-sc-9uM" secondAttribute="bottom" id="orC-r6-VT1"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="palybackVideo" destination="mrW-Tn-00Y" id="fjd-ft-f5S"/>
|
||||
<outlet property="videoLongth" destination="uW9-bN-ief" id="xo3-Jd-NaM"/>
|
||||
<outlet property="videoTime" destination="6iO-V5-oJZ" id="3ar-eN-xk7"/>
|
||||
<outlet property="endTimeLabel" destination="jDd-Rf-aT2" id="C1n-EA-bru"/>
|
||||
<outlet property="playImageView" destination="YVK-ee-AkR" id="FUp-PM-im4"/>
|
||||
<outlet property="startTimeLabel" destination="mtl-sb-DhZ" id="tf7-Iz-LJA"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="-34.399999999999999" y="400.29985007496254"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<systemColor name="systemBackgroundColor">
|
||||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</systemColor>
|
||||
</resources>
|
||||
</document>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
//
|
||||
// PlayBackViewController.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by 祝发冬 on 2020/10/18.
|
||||
// Copyright © 2020 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "BaseViewController.h"
|
||||
#import "IfishCameraModel.h"
|
||||
#import <GWP2P/GWP2P.h>
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface PlayBackViewController : BaseViewController
|
||||
@property (nonatomic,strong) IfishCameraModel *camera;
|
||||
@property (weak, nonatomic) IBOutlet UIView *playView;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *retryBtn;
|
||||
@property (nonatomic,strong) GWPlaybackFileModel *model;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
@ -0,0 +1,215 @@
|
|||
//
|
||||
// PlayBackViewController.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by 祝发冬 on 2020/10/18.
|
||||
// Copyright © 2020 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "PlayBackViewController.h"
|
||||
|
||||
@interface PlayBackViewController ()<GWP2PPlayerProtocol>
|
||||
@property (nonatomic, strong) GWP2PPlaybackPlayer *player;//摄像头页面
|
||||
@property (nonatomic) BOOL isReject;
|
||||
@end
|
||||
|
||||
@implementation PlayBackViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
self.navigationController.navigationBar.hidden=YES;
|
||||
[[UIApplication sharedApplication] setStatusBarHidden:YES];
|
||||
[AppDelegate sharedDefault].canFullScreen = YES;
|
||||
|
||||
[self setTitleString:@"视频回放"];
|
||||
UIBarButtonItem*bat=[CommonUtils ItemWithTitle:@"切换" target:self action:@selector(varyOritation) titleColor:[UIColor whiteColor]];
|
||||
self.navigationItem.rightBarButtonItems=nil;
|
||||
self.navigationItem.rightBarButtonItem=bat;
|
||||
self.view.backgroundColor=[UIColor blackColor];
|
||||
UITapGestureRecognizer*tap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(taptochange)];
|
||||
|
||||
[self.view addGestureRecognizer:tap];
|
||||
[CommonUtils interfaceOrientation:UIDeviceOrientationLandscapeRight];
|
||||
[self connectDevice];
|
||||
|
||||
// Do any additional setup after loading the view from its nib.
|
||||
}
|
||||
|
||||
-(void)viewDidLayoutSubviews
|
||||
{
|
||||
[super viewDidLayoutSubviews];
|
||||
|
||||
}
|
||||
-(void)playFiles
|
||||
{
|
||||
//添加播放器VC
|
||||
|
||||
self.player = [[GWP2PPlaybackPlayer alloc] init];
|
||||
|
||||
self.player.mute = YES;
|
||||
self.player.delegate=self;
|
||||
self.player.viewController.view.backgroundColor = [UIColor clearColor];
|
||||
self.player.viewController.view.autoresizingMask=UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
|
||||
|
||||
self.player.viewController.view.frame=self.playView.bounds;
|
||||
[self addChildViewController:self.player.viewController];
|
||||
[self.playView addSubview:self.player.viewController.view];
|
||||
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
||||
WEAK_SELF;
|
||||
[self.player p2pCallPlaybackFileWithDeviceId:self.camera.cameraId password:self.camera.cameraPass playbackFile:self.model calling:^(NSDictionary *parameters) {
|
||||
|
||||
} accept:^(NSDictionary *parameters) {
|
||||
|
||||
} reject:^(GWP2PCallError error, NSString *errorCode) {
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[MBProgressHUD hideHUDForView:weakSelf.view animated:YES];
|
||||
[weakSelf.view makeToast:@"连接失败请重试!"];
|
||||
|
||||
weakSelf.retryBtn.hidden=NO;
|
||||
[AppDelegate sharedDefault].canFullScreen = NO;
|
||||
|
||||
|
||||
[CommonUtils interfaceOrientation:UIDeviceOrientationPortrait];
|
||||
|
||||
});
|
||||
|
||||
|
||||
} ready:^{
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[MBProgressHUD hideHUDForView:weakSelf.view animated:YES];
|
||||
|
||||
weakSelf.retryBtn.hidden=YES;
|
||||
});
|
||||
}] ;
|
||||
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
-(void)connectDevice{
|
||||
|
||||
UserModel *model=[dataContorl getUserInfo];
|
||||
NSString *userIDName=[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff];
|
||||
//初始化设备
|
||||
if ([GWP2PClient sharedClient].linkStatus != P2PLinkStatusOK) {
|
||||
NSLog(@"正在检查P2P连接状态");
|
||||
BOOL connectDevice = [[GWP2PClient sharedClient] connectWithAccount:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2 sessionID1:model.sessionID sessionID2:model.sessionID2 customerIDs:nil];
|
||||
|
||||
if (connectDevice) {
|
||||
|
||||
[self playFiles];
|
||||
|
||||
}else{
|
||||
[self retry:nil];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
[self playFiles];
|
||||
}
|
||||
|
||||
}
|
||||
-(BOOL)p2pPlayer:(GWP2PPlayer *)player shouldHandlerSwipeGesture:(UIGestureRecognizer *)gesture
|
||||
{
|
||||
return YES;;
|
||||
}
|
||||
-(void)goBackAction{
|
||||
|
||||
[self.player p2pPause];
|
||||
self.player=nil;
|
||||
[self.navigationController popViewControllerAnimated: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.
|
||||
}
|
||||
*/
|
||||
- (IBAction)retry:(UIButton *)sender {
|
||||
|
||||
[self.player p2pStop];
|
||||
[self.player.viewController.view removeFromSuperview];
|
||||
self.player=nil;
|
||||
[self connectDevice];
|
||||
}
|
||||
-(void)taptochange
|
||||
{
|
||||
self.navigationController.navigationBar.hidden=!self.navigationController.navigationBar.hidden;
|
||||
[[UIApplication sharedApplication] setStatusBarHidden:self.navigationController.navigationBar.isHidden];
|
||||
}
|
||||
|
||||
-(void)dealloc
|
||||
{
|
||||
self.navigationController.navigationBar.hidden=NO;
|
||||
[[UIApplication sharedApplication] setStatusBarHidden:NO];
|
||||
[AppDelegate sharedDefault].canFullScreen = NO;
|
||||
[CommonUtils interfaceOrientation:UIInterfaceOrientationPortrait];
|
||||
}
|
||||
|
||||
-(UIInterfaceOrientationMask)supportedInterfaceOrientations{
|
||||
|
||||
return UIInterfaceOrientationMaskAll;
|
||||
}
|
||||
|
||||
#pragma mark 一开始希望的屏幕方向
|
||||
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
|
||||
return UIDeviceOrientationLandscapeRight;
|
||||
}
|
||||
|
||||
#pragma mark - 屏幕旋转
|
||||
-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
|
||||
{
|
||||
|
||||
|
||||
if (toInterfaceOrientation == UIInterfaceOrientationPortrait)
|
||||
{
|
||||
|
||||
}
|
||||
else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
|
||||
|
||||
}
|
||||
else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
-(BOOL)shouldAutorotate
|
||||
{
|
||||
return YES;;
|
||||
}
|
||||
-(BOOL)prefersStatusBarHidden
|
||||
|
||||
{
|
||||
return self.navigationController.isNavigationBarHidden;
|
||||
|
||||
}
|
||||
|
||||
|
||||
-(void)varyOritation
|
||||
{
|
||||
UIInterfaceOrientation statusBarOrientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
if (statusBarOrientation==UIInterfaceOrientationPortrait)
|
||||
{
|
||||
[AppDelegate sharedDefault].canFullScreen = YES;
|
||||
|
||||
[CommonUtils interfaceOrientation:UIDeviceOrientationLandscapeRight];
|
||||
}
|
||||
else
|
||||
{
|
||||
[AppDelegate sharedDefault].canFullScreen = NO;
|
||||
|
||||
|
||||
[CommonUtils interfaceOrientation:UIDeviceOrientationPortrait];
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_1" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
|
||||
<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>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="PlayBackViewController">
|
||||
<connections>
|
||||
<outlet property="playView" destination="mNp-Wq-9sr" id="zUA-J4-PXU"/>
|
||||
<outlet property="retryBtn" destination="JXh-6B-ny2" id="R7G-iJ-hDT"/>
|
||||
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mNp-Wq-9sr" userLabel="playView">
|
||||
<rect key="frame" x="0.0" y="331.5" width="414" height="233"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" secondItem="mNp-Wq-9sr" secondAttribute="height" multiplier="16:9" id="Sov-CF-1ZL"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="JXh-6B-ny2">
|
||||
<rect key="frame" x="185" y="644.5" width="44" height="44"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="44" id="aIO-hU-m50"/>
|
||||
<constraint firstAttribute="height" constant="44" id="eI2-fw-A9X"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<state key="normal" title="重试">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="retry:" destination="-1" eventType="touchUpInside" id="Wcp-lZ-BMl"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="Q5M-cg-NOt"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="mNp-Wq-9sr" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="C17-he-7L2"/>
|
||||
<constraint firstItem="JXh-6B-ny2" firstAttribute="top" secondItem="mNp-Wq-9sr" secondAttribute="bottom" constant="80" id="HhU-0V-Mvn"/>
|
||||
<constraint firstItem="JXh-6B-ny2" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="I6S-Xj-ICX"/>
|
||||
<constraint firstItem="mNp-Wq-9sr" firstAttribute="centerY" secondItem="i5M-Pr-FkT" secondAttribute="centerY" id="NtZ-L6-gOK"/>
|
||||
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="mNp-Wq-9sr" secondAttribute="trailing" id="q7g-0A-JED"/>
|
||||
<constraint firstItem="mNp-Wq-9sr" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" id="qUP-ru-Lyf"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="138" y="71"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<systemColor name="systemBackgroundColor">
|
||||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</systemColor>
|
||||
</resources>
|
||||
</document>
|
||||
|
|
@ -68,10 +68,10 @@ static NSString *bootomRecCellIdentifier = @"IfishRecVideoViewCell";
|
|||
////录制回放功能打开
|
||||
//_dataImgArray = @[LXImageWithImageName(@"devicename_iocn_screenshots.png"),LXImageWithImageName(@"devicename_iocn_gallery.png"),LXImageWithImageName(@"devicename_iocn_rec.png"),LXImageWithImageName(@"devicename_iocn_playback.png"),LXImageWithImageName(@"devicename_iocn_care.png"),LXImageWithImageName(@"devicename_iocn_look.png"),LXImageWithImageName(@"devicename_iocn_Ilookat.png"),LXImageWithImageName(@"devicename_iocn_look.png"),LXImageWithImageName(@"devicename_iocn_look.png")];
|
||||
//equipment_iocn_playback
|
||||
_dataImgArray = @[LXImageWithImageName(@"equipment_iocn_printscreen"),LXImageWithImageName(@"equipment_iocn_gallery"),LXImageWithImageName(@"equipment_iocn_care"),LXImageWithImageName(@"equipment_iocn_look"),LXImageWithImageName(@"equipment_iocn_mylook"),LXImageWithImageName(@"equipment_iocn_share")];
|
||||
_dataImgArray = @[LXImageWithImageName(@"equipment_iocn_printscreen"),LXImageWithImageName(@"equipment_iocn_gallery"),LXImageWithImageName(@"equipment_iocn_care"),LXImageWithImageName(@"equipment_iocn_look"),LXImageWithImageName(@"equipment_iocn_mylook"),LXImageWithImageName(@"equipment_iocn_share"),LXImageWithImageName(@"equipment_iocn_videorecord"),LXImageWithImageName(@"equipment_iocn_videoback")];
|
||||
|
||||
//_dataNameArray = @[@"截图",@"图库",@"录制",@"回放",@"我的看护",@"爱鱼看看",@"我的看看",@"",@""];
|
||||
_dataNameArray = @[@"截图",@"图库",@"我的看护",@"爱鱼看看",@"我的看看",@"分享爱鱼奇"];
|
||||
_dataNameArray = @[@"截图",@"图库",@"我的看护",@"爱鱼看看",@"我的看看",@"分享爱鱼奇",@"视频录制",@"视频回放"];
|
||||
}
|
||||
|
||||
#pragma mark - UICollectionViewDataSource
|
||||
|
|
@ -84,7 +84,7 @@ static NSString *bootomRecCellIdentifier = @"IfishRecVideoViewCell";
|
|||
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
|
||||
|
||||
//return 9;
|
||||
return 6;
|
||||
return 8;
|
||||
|
||||
}
|
||||
#pragma mark 设置item内容
|
||||
|
|
|
|||
|
|
@ -9,7 +9,11 @@
|
|||
#import "BaseViewController.h"
|
||||
#import "IfishCameraModel.h"
|
||||
#import "MBProgressHUD.h"
|
||||
#import <GWP2P/GWP2P.h>
|
||||
|
||||
|
||||
@interface CameraRecordViewController : BaseViewController
|
||||
@property (nonatomic,strong) IfishCameraModel *camera;
|
||||
@property (nonatomic, strong) GWP2PVideoPlayer *player;//摄像头页面
|
||||
@property (strong, nonatomic) MBProgressHUD *progressAlert;
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@
|
|||
#import "IfishCameraRecordfirstCell.h"
|
||||
#import "IfishCameraRecordSecondCell.h"
|
||||
#import "IfishCameraRecordThirdCell.h"
|
||||
#import "TemperatureSetModel.h"
|
||||
#import "TemperatureSetCell.h"
|
||||
#import "MydatePickerView.h"
|
||||
#define RECODIEECELL_TIME 911
|
||||
#define RECODIEECELL_BTN 922
|
||||
#define RECODIEECELL_SWiTCH 933
|
||||
|
|
@ -25,15 +28,16 @@ static const CGFloat ToastFade = 0.2;
|
|||
@property(nonatomic) NSInteger minute;
|
||||
@property(nonatomic,strong) NSTimer*timer;
|
||||
@property(nonatomic,copy) NSString *timestr;
|
||||
|
||||
@property (nonatomic, assign) BOOL isConnectCamera;
|
||||
@property(nonatomic) BOOL isRecording;
|
||||
@property(nonatomic) NSIndexPath *timerIndex;
|
||||
@property(nonatomic) NSIndexPath *switchIndex;
|
||||
@property(nonatomic) NSIndexPath *buttonIndex;
|
||||
@property(assign) unsigned int remoteRecordState;
|
||||
//本app 需求模式 非摄像头模式
|
||||
@property(nonatomic) BOOL isManual;
|
||||
|
||||
@property(nonatomic,strong) NSMutableArray*array;
|
||||
@property(nonatomic,strong) NSString*recordType;
|
||||
@property (nonatomic, strong)MydatePickerView *mydatepicView;
|
||||
|
||||
@end
|
||||
|
||||
|
|
@ -41,43 +45,23 @@ static const CGFloat ToastFade = 0.2;
|
|||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self connectDevice];
|
||||
|
||||
// Do any additional setup after loading the view.
|
||||
[self addTitleViewWithTitle:@"手动录制"];
|
||||
_timestr= @"00:00";
|
||||
_isRecording = NO;
|
||||
_isManual = NO;
|
||||
|
||||
[self addTitleViewWithTitle:@"录制视频"];
|
||||
self.recordType=[[DataCenter defaultDtacenter].cache stringForKey:@"recordType"];
|
||||
if (!self.recordType.length)
|
||||
{
|
||||
self.recordType=@"0";
|
||||
}
|
||||
|
||||
[self creatUI];
|
||||
self.view.backgroundColor = RGB(242, 242, 242);
|
||||
// self.view.backgroundColor = RGB(242, 242, 242);
|
||||
|
||||
}
|
||||
|
||||
-(void)goBackAction{
|
||||
|
||||
if (_isRecording) {
|
||||
|
||||
UIAlertController*ac=[UIAlertController alertControllerWithTitle:@"" message:@"是否结束手动录制" preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[self presentViewController:ac animated:YES completion:nil];
|
||||
[ac addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction*action){
|
||||
|
||||
|
||||
|
||||
}]];
|
||||
|
||||
[ac addAction:[UIAlertAction actionWithTitle:@"结束" style:UIAlertActionStyleDefault handler:^(UIAlertAction*action){
|
||||
[[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId
|
||||
password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_OFF];
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
|
||||
}]];
|
||||
|
||||
|
||||
}else{
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
-(void)creatUI{
|
||||
|
||||
|
|
@ -88,10 +72,39 @@ static const CGFloat ToastFade = 0.2;
|
|||
self.tab.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
self.tab.showsVerticalScrollIndicator = NO;
|
||||
self.tab.scrollEnabled = NO;
|
||||
self.tab.backgroundColor = RGB(242, 242, 242);
|
||||
//self.tab.backgroundColor = RGB(242, 242, 242);
|
||||
[self.view addSubview:self.tab];
|
||||
[self.tab reloadData];
|
||||
|
||||
}
|
||||
-(void)connectDevice{
|
||||
|
||||
UserModel *model=[dataContorl getUserInfo];
|
||||
NSString *userIDName=[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff];
|
||||
//初始化设备
|
||||
if ([GWP2PClient sharedClient].linkStatus != P2PLinkStatusOK) {
|
||||
NSLog(@"正在检查P2P连接状态");
|
||||
BOOL connectDevice = [[GWP2PClient sharedClient] connectWithAccount:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2 sessionID1:model.sessionID sessionID2:model.sessionID2 customerIDs:nil];
|
||||
|
||||
if (connectDevice) {
|
||||
[[GWP2PClient sharedClient] setDeviceRecordDefinition:GWP2PRecordDefinitionStandardDefinition withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
|
||||
|
||||
}];
|
||||
}else{
|
||||
|
||||
[self.view makeToast:@"p2pConnect failure.失败,不能操作设备,请重试"];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
[[GWP2PClient sharedClient] setDeviceRecordDefinition:GWP2PRecordDefinitionStandardDefinition withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
|
|
@ -100,574 +113,276 @@ static const CGFloat ToastFade = 0.2;
|
|||
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveRemoteMessage:) name:RECEIVE_REMOTE_MESSAGE object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ack_receiveRemoteMessage:) name:ACK_RECEIVE_REMOTE_MESSAGE object:nil];
|
||||
[[P2PClient sharedClient] getNpcSettingsWithId:self.camera.cameraId password:self.camera.cameraPass];
|
||||
// [[P2PClient sharedClient] getSDCardInfoWithId:self.camera.cameraId password:self.camera.cameraPass];
|
||||
|
||||
}
|
||||
|
||||
-(void)viewWillDisappear:(BOOL)animated{
|
||||
[super viewWillDisappear:animated];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:RECEIVE_REMOTE_MESSAGE object:nil];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:ACK_RECEIVE_REMOTE_MESSAGE object:nil];
|
||||
|
||||
|
||||
}
|
||||
#pragma mark - receiveRemoteMessage
|
||||
|
||||
- (void)receiveRemoteMessage:(NSNotification *)notification
|
||||
{
|
||||
NSDictionary *parameter = [notification userInfo];
|
||||
int key = [[parameter valueForKey:@"key"] intValue];
|
||||
switch (key) {
|
||||
|
||||
case RET_GET_SDCARD_INFO:
|
||||
|
||||
{
|
||||
NSInteger result = [[parameter valueForKey:@"result"] intValue];
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (result == 1) {
|
||||
|
||||
//[self.view makeToast:@"sdk卡可使用"];
|
||||
//获取状态信息
|
||||
// [[P2PClient sharedClient] getNpcSettingsWithId:self.camera.cameraId password:self.camera.cameraPass];
|
||||
|
||||
if (_isManual) {
|
||||
if (self.remoteRecordState ==1){
|
||||
//[self.view makeToast:@"请先关闭自动录制"];
|
||||
[self showLableAction:@"请先关闭自动录制"];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self hiddenTostVIew];
|
||||
|
||||
});
|
||||
[self resetTimerlabel];
|
||||
|
||||
return ;
|
||||
|
||||
}
|
||||
|
||||
NSArray *buttonindex =@[self.buttonIndex];
|
||||
[self.tab reloadRowsAtIndexPaths:buttonindex withRowAnimation:UITableViewRowAnimationNone];
|
||||
|
||||
[[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId
|
||||
password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_ON];
|
||||
}else{
|
||||
|
||||
[self showLableAction:@"请先关闭自动录制"];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self hiddenTostVIew];
|
||||
|
||||
});
|
||||
[self resetTimerlabel];
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
//sd卡不存在,
|
||||
//停止计时
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self hiddenTostVIew];
|
||||
|
||||
});
|
||||
[self resetTimerlabel];
|
||||
[self.view makeToast:NSLocalizedString(@"no_storage", nil)];
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
break;
|
||||
case RET_GET_NPCSETTINGS_PRERECORD: //预录像开关 获取时
|
||||
{
|
||||
|
||||
NSInteger state = [[parameter valueForKey:@"state"] intValue];
|
||||
|
||||
NSLog(@"预录像开关 获取时state%ld",(long)state);
|
||||
}
|
||||
break;
|
||||
|
||||
case RET_SET_NPCSETTINGS_PRERECORD: //预录像开关 设置时
|
||||
{
|
||||
NSInteger result = [[parameter valueForKey:@"result"] intValue];
|
||||
|
||||
if(result==0){
|
||||
|
||||
NSLog(@"预录像开关设置result%ld",(long)result);
|
||||
|
||||
}else{
|
||||
|
||||
NSLog(@"预录像开关设置result%ld",(long)result);
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case RET_SET_NPCSETTINGS_REMOTE_RECORD:
|
||||
{
|
||||
NSInteger result = [[parameter valueForKey:@"result"] integerValue];
|
||||
|
||||
|
||||
if(result==0){
|
||||
//设置成功主动获取一次状态 刷新
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self hiddenTostVIew];
|
||||
|
||||
});
|
||||
|
||||
[[P2PClient sharedClient] getNpcSettingsWithId:self.camera.cameraId password:self.camera.cameraPass];
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
NSLog(@"设置失败:%li",(long)result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case RET_GET_NPCSETTINGS_REMOTE_RECORD:
|
||||
{
|
||||
//
|
||||
|
||||
NSInteger state = [[parameter valueForKey:@"state"] intValue];
|
||||
self.remoteRecordState = (unsigned int)state;
|
||||
|
||||
if (state ==0) {
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
||||
|
||||
[self resetTimerlabel];
|
||||
|
||||
});
|
||||
|
||||
}else{
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (_isManual) {
|
||||
//手动模式开启不刷新switch按钮状态
|
||||
|
||||
return;
|
||||
}
|
||||
NSLog(@"获取 remote record state:%li",(long)state);
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
NSArray *index =@[self.switchIndex];
|
||||
[self.tab reloadRowsAtIndexPaths:index withRowAnimation:UITableViewRowAnimationNone];
|
||||
// NSArray *buttonindex =@[self.buttonIndex];
|
||||
// [self.tab reloadRowsAtIndexPaths:buttonindex withRowAnimation:UITableViewRowAnimationNone];
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
case RET_GET_NPCSETTINGS_RECORD_TYPE:
|
||||
{
|
||||
NSInteger type = [[parameter valueForKey:@"type"] intValue];
|
||||
//0手动模式 摄像头模式
|
||||
|
||||
NSLog(@"获取录像模式类型type%ld",(long)type);
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case RET_SET_NPCSETTINGS_RECORD_TYPE:
|
||||
{
|
||||
NSInteger result = [[parameter valueForKey:@"result"] intValue];
|
||||
//0类型设置成功
|
||||
if (result==0) {
|
||||
//[[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId
|
||||
// password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_ON];
|
||||
}
|
||||
|
||||
NSLog(@"设置录像模式类型result%ld",(long)result);
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#pragma mark -ack_receiveRemoteMessage
|
||||
- (void)ack_receiveRemoteMessage:(NSNotification *)notification{
|
||||
NSDictionary *parameter = [notification userInfo];
|
||||
int key = [[parameter valueForKey:@"key"] intValue];
|
||||
int result = [[parameter valueForKey:@"result"] intValue];
|
||||
switch (key) {
|
||||
case ACK_RET_GET_SDCARD_INFO:
|
||||
{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if(result==1){
|
||||
|
||||
[self.view makeToast:NSLocalizedString(@"device_password_error", nil)];
|
||||
// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
// usleep(800000);
|
||||
//
|
||||
//
|
||||
// });
|
||||
|
||||
}else if(result==2){
|
||||
DLog(@"resend do device update");
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
DLog(@"ACK_RET_GET_SDCARD_INFO:%i",result);
|
||||
}
|
||||
break;
|
||||
case ACK_RET_SET_SDCARD_INFO:
|
||||
{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if(result==1){
|
||||
|
||||
[self.view makeToast:NSLocalizedString(@"device_password_error", nil)];
|
||||
// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
// usleep(800000);
|
||||
// dispatch_async(dispatch_get_main_queue(), ^{
|
||||
// });
|
||||
// });
|
||||
|
||||
}else if(result==2){
|
||||
DLog(@"resend do device update");
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
if (section ==2) {
|
||||
|
||||
return 2;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return 3;
|
||||
return 2;
|
||||
}
|
||||
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
|
||||
|
||||
TemperatureSetCell*cell=[tableView dequeueReusableCellWithIdentifier:@"TemperatureSetCell"];
|
||||
if (cell==nil) {
|
||||
cell=[[[NSBundle mainBundle]loadNibNamed:@"TemperatureSetCell" owner:self options:nil]lastObject];
|
||||
}
|
||||
cell.backgroundView=nil;
|
||||
cell.backgroundColor= RGB(242, 242, 242);
|
||||
if (indexPath.section ==0 && indexPath.row ==0) {
|
||||
IfishCameraRecordfirstCell *cell = [tableView dequeueReusableCellWithIdentifier:@"IfishCameraRecordfirstCell"];
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle]loadNibNamed:@"IfishCameraRecordfirstCell" owner:self options:nil]lastObject];
|
||||
|
||||
|
||||
TemperatureSetModel*model=[[TemperatureSetModel alloc]init];
|
||||
model.title=@"即时录制";
|
||||
model.temperatureLabel=@"";
|
||||
model.status=self.recordType;;
|
||||
cell.titleLabel.text=model.title;
|
||||
|
||||
cell.temperaturelabel.text=model.temperatureLabel;
|
||||
[cell.temPSwitch addTarget:self action:@selector(nowRecordBtnAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[cell.temPSwitch setBackgroundImage:[UIImage imageNamed:@"greenbtn_big"] forState:UIControlStateSelected];
|
||||
[cell.temPSwitch setBackgroundImage:[UIImage imageNamed:@"graybtn_big"] forState:UIControlStateNormal];
|
||||
|
||||
cell.temPSwitch.selected=[model.status isEqualToString:@"1"];
|
||||
|
||||
}
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
return cell;
|
||||
|
||||
}else if (indexPath.section ==2 && indexPath.row ==0){
|
||||
IfishCameraRecordSecondCell *cell = [tableView dequeueReusableCellWithIdentifier:@"IfishCameraRecordSecondCell"];
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle]loadNibNamed:@"IfishCameraRecordSecondCell" owner:self options:nil]lastObject];
|
||||
|
||||
}
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
cell.tag = RECODIEECELL_TIME;
|
||||
self.timerIndex = indexPath;
|
||||
cell.timeLabe.text = _timestr;
|
||||
|
||||
_isRecording ? [cell.timeLabe setTextColor:RGB(51, 51, 51)] : [cell.timeLabe setTextColor:RGB(153, 153, 153)];
|
||||
[cell cellRecordBViewCorner];
|
||||
return cell;
|
||||
|
||||
}else if (indexPath.section ==2 && indexPath.row ==1){
|
||||
|
||||
IfishCameraRecordThirdCell *cell = [tableView dequeueReusableCellWithIdentifier:@"IfishCameraRecordThirdCell"];
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle]loadNibNamed:@"IfishCameraRecordThirdCell" owner:self options:nil]lastObject];
|
||||
|
||||
}
|
||||
cell.tag = RECODIEECELL_BTN;
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
[cell.recordBtn addTarget:self action:@selector(recordBtnAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
if (_isRecording) {
|
||||
cell.recordBtn.selected = YES;
|
||||
[cell.recordBtn setBackgroundColor:RGB(255,115,92)];
|
||||
[cell.recordBtn setTitle:@"结束录制" forState:UIControlStateNormal];
|
||||
}else{
|
||||
cell.recordBtn.selected = NO;
|
||||
[cell.recordBtn setBackgroundColor:RGB(0,184,239)];
|
||||
[cell.recordBtn setTitle:@"开始录制" forState:UIControlStateNormal];
|
||||
}
|
||||
self.buttonIndex =indexPath;
|
||||
[cell cellSetRecordBtnBackViewCorner];
|
||||
return cell;
|
||||
|
||||
|
||||
}else if (indexPath.section ==1 && indexPath.row ==0){
|
||||
|
||||
self.switchIndex = indexPath;
|
||||
IfishCameraRecordFourCell *cell = [tableView dequeueReusableCellWithIdentifier:@"IfishCameraRecordFourCell"];
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle]loadNibNamed:@"IfishCameraRecordFourCell" owner:self options:nil]lastObject];
|
||||
|
||||
}
|
||||
cell.tag = RECODIEECELL_SWiTCH;
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
[cell.zidongSw addTarget:self action:@selector(switchAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
if (self.remoteRecordState==1) {
|
||||
|
||||
[cell.zidongSw setOn:YES];
|
||||
|
||||
}else{
|
||||
[cell.zidongSw setOn:NO];
|
||||
}
|
||||
|
||||
return cell;
|
||||
TemperatureSetModel*model=[[TemperatureSetModel alloc]init];
|
||||
model.title=@"定时录制";
|
||||
model.temperatureLabel=[[DataCenter defaultDtacenter].cache stringForKey:@"schduleRecordTime"].length?[[DataCenter defaultDtacenter].cache stringForKey:@"schduleRecordTime"]:@"09:00-16:00";
|
||||
model.status=self.recordType;;
|
||||
cell.titleLabel.text=model.title;
|
||||
|
||||
cell.temperaturelabel.text=model.temperatureLabel;
|
||||
[cell.temPSwitch addTarget:self action:@selector(schduleRecordAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
[cell.temPSwitch setBackgroundImage:[UIImage imageNamed:@"greenbtn_big"] forState:UIControlStateSelected];
|
||||
[cell.temPSwitch setBackgroundImage:[UIImage imageNamed:@"graybtn_big"] forState:UIControlStateNormal];
|
||||
|
||||
cell.temPSwitch.selected=[model.status isEqualToString:@"2"];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return nil;
|
||||
return cell;
|
||||
|
||||
}
|
||||
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
if (indexPath.section ==0 && indexPath.row ==0) {
|
||||
|
||||
return kScreenSize.width*0.516;
|
||||
|
||||
}else if (indexPath.section ==2 && indexPath.row ==0){
|
||||
|
||||
return kScreenSize.width*0.357;
|
||||
|
||||
}else if (indexPath.section ==1 && indexPath.row ==0){
|
||||
|
||||
return 46*KWidth_Scale;
|
||||
}else if (indexPath.section ==2 && indexPath.row ==1){
|
||||
|
||||
return 76*KWidth_Scale;
|
||||
}
|
||||
return 0;
|
||||
|
||||
return 50;
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
||||
|
||||
if (section==0) {
|
||||
return kScreenSize.width*0.213;
|
||||
}
|
||||
return 5;
|
||||
return 5;
|
||||
}
|
||||
|
||||
-(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
||||
if (section ==0) {
|
||||
UIView *sectionV1=[[UIView alloc] initWithFrame:CGRectMake(0, 0,self.view.frame.size.width,kScreenSize.width*0.213)];
|
||||
sectionV1.backgroundColor = RGB(242, 242, 242);
|
||||
return sectionV1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
UIView *sectionV2=[[UIView alloc] initWithFrame:CGRectMake(0, 0,self.view.frame.size.width,5)];
|
||||
sectionV2.backgroundColor = RGB(242, 242, 242);
|
||||
sectionV2.backgroundColor =[UIColor whiteColor];
|
||||
return sectionV2;
|
||||
|
||||
}
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
if (indexPath.section==1)
|
||||
{
|
||||
if (!self.mydatepicView) {
|
||||
_mydatepicView=[[MydatePickerView alloc]init];
|
||||
|
||||
_mydatepicView.frame=CGRectMake(0,0,kScreenSize.width,kScreenSize.height);
|
||||
[_mydatepicView setIsNewXuanduo:YES];
|
||||
[_mydatepicView.picView reloadAllComponents];
|
||||
[_mydatepicView.cancleButton addTarget:self action:@selector(cancleButtonClick) forControlEvents:UIControlEventTouchUpInside];
|
||||
[_mydatepicView.sureButton addTarget:self action:@selector(doneButtonClick) forControlEvents:UIControlEventTouchUpInside];
|
||||
NSString*time=[[DataCenter defaultDtacenter].cache stringForKey:@"schduleRecordTime"].length?[[DataCenter defaultDtacenter].cache stringForKey:@"schduleRecordTime"]:@"09:00-16:00";
|
||||
NSString*start=[[time componentsSeparatedByString:@"-"] firstObject];
|
||||
NSString*end=[[time componentsSeparatedByString:@"-"] lastObject];
|
||||
NSString*startHour=[[start componentsSeparatedByString:@":"] firstObject];
|
||||
NSString*startMin=[[start componentsSeparatedByString:@":"] lastObject];
|
||||
|
||||
NSString*endHour=[[end componentsSeparatedByString:@":"] firstObject];
|
||||
|
||||
NSString*endMin=[[end componentsSeparatedByString:@":"] lastObject];
|
||||
_mydatepicView.startString=startHour;
|
||||
_mydatepicView.endString=startMin;
|
||||
_mydatepicView.startString1=endHour;
|
||||
_mydatepicView.endString1=endHour;
|
||||
[_mydatepicView.picView selectRow:[(NSArray*)(_mydatepicView.dataArr[0]) indexOfObject:startHour] inComponent:0 animated:YES];
|
||||
[_mydatepicView.picView selectRow:[(NSArray*)(_mydatepicView.dataArr[1]) indexOfObject:startMin] inComponent:1 animated:YES];
|
||||
[_mydatepicView.picView selectRow:[(NSArray*)(_mydatepicView.dataArr[2]) indexOfObject:endHour] inComponent:2 animated:YES];
|
||||
[_mydatepicView.picView selectRow:[(NSArray*)(_mydatepicView.dataArr[3]) indexOfObject:endMin] inComponent:3 animated:YES];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
[self.view addSubview:_mydatepicView];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - recordBtnAction
|
||||
|
||||
-(void)recordBtnAction:(UIButton*)btn{
|
||||
#pragma mark 设置时间段
|
||||
-(void)doneButtonClick{
|
||||
|
||||
if (btn.selected) {
|
||||
[self resetTimerlabel];
|
||||
|
||||
_isManual = NO;
|
||||
//停止录制
|
||||
[self startTostVIew];
|
||||
[[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId
|
||||
password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_OFF];
|
||||
|
||||
[self showLableAction:@"录制成功,请在回放中查看"];
|
||||
|
||||
}else{
|
||||
|
||||
|
||||
[self startRunTimerlabel];
|
||||
_isManual = YES;
|
||||
//开始录制
|
||||
//获取SDCard状态
|
||||
[self startTostVIew];
|
||||
[[P2PClient sharedClient] getSDCardInfoWithId:self.camera.cameraId password:self.camera.cameraPass];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)startRunTimerlabel
|
||||
|
||||
{
|
||||
//IfishCameraRecordThirdCell *cell=[self.view viewWithTag:RECODIEECELL_BTN];
|
||||
//cell.recordBtn.selected =YES;
|
||||
_isRecording=YES;
|
||||
__weak typeof(self)weakSelf=self;
|
||||
NSInteger count = 30*60;
|
||||
//NSInteger count = -1;
|
||||
//NSInteger count = 60;
|
||||
weakSelf.timer = [NSTimer scheduledTimerWithTimeInterval:1 count:count callback:^{
|
||||
weakSelf.second++;
|
||||
if (weakSelf.second ==60) {
|
||||
weakSelf.second = 0;
|
||||
weakSelf.minute++;
|
||||
}
|
||||
if (weakSelf.minute ==30) {
|
||||
weakSelf.minute =0;
|
||||
weakSelf.second =0;
|
||||
|
||||
[self resetTimerlabel];
|
||||
|
||||
_isManual = NO;
|
||||
//停止录制
|
||||
[self startTostVIew];
|
||||
[[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId
|
||||
password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_OFF];
|
||||
[self showLableAction:@"录制成功,请在回放中查看"];
|
||||
return ;
|
||||
|
||||
}
|
||||
|
||||
_timestr= [IfishHelperUtils formatCameraPalybackTime:weakSelf.minute second:weakSelf.second];
|
||||
NSArray *index =@[self.timerIndex];
|
||||
[self.tab reloadRowsAtIndexPaths:index withRowAnimation:UITableViewRowAnimationNone];
|
||||
|
||||
}];
|
||||
|
||||
[[NSRunLoop currentRunLoop] addTimer: weakSelf.timer forMode:NSRunLoopCommonModes];
|
||||
|
||||
|
||||
// NSArray *buttonindex =@[self.buttonIndex];
|
||||
// [self.tab reloadRowsAtIndexPaths:buttonindex withRowAnimation:UITableViewRowAnimationNone];
|
||||
|
||||
}
|
||||
|
||||
-(void)resetTimerlabel
|
||||
{
|
||||
|
||||
_isRecording=NO;
|
||||
|
||||
if (_timer) {
|
||||
[_timer unfireTimer];
|
||||
}
|
||||
self.minute =0;
|
||||
self.second =0;
|
||||
_timestr = @"00:00";
|
||||
NSArray *index =@[self.timerIndex];
|
||||
[self.tab reloadRowsAtIndexPaths:index withRowAnimation:UITableViewRowAnimationNone];
|
||||
|
||||
NSArray *buttonindex =@[self.buttonIndex];
|
||||
[self.tab reloadRowsAtIndexPaths:buttonindex withRowAnimation:UITableViewRowAnimationNone];
|
||||
|
||||
|
||||
}
|
||||
|
||||
#pragma mark -加载中
|
||||
|
||||
-(void)startTostVIew{
|
||||
|
||||
self.progressAlert = [[MBProgressHUD alloc] initWithView:self.view];
|
||||
[self.view addSubview:self.progressAlert];
|
||||
self.progressAlert.mode=MBProgressHUDModeIndeterminate;
|
||||
self.progressAlert.customView = [[UIView alloc] init];
|
||||
//self.progressAlert.labelText = [NSString stringWithFormat:@"%@...",NSLocalizedString(@"validating", nil)];
|
||||
[self.progressAlert show:YES];
|
||||
//设置5秒超时
|
||||
[self.progressAlert hide:YES afterDelay:5];
|
||||
}
|
||||
|
||||
-(void)hiddenTostVIew
|
||||
{
|
||||
[self.progressAlert hide:YES];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - switchAction:
|
||||
|
||||
-(void)switchAction:(UISwitch*)sender
|
||||
|
||||
{
|
||||
|
||||
IfishCameraRecordFourCell *cell =[self.view viewWithTag:RECODIEECELL_SWiTCH];
|
||||
UISwitch* swt=(UISwitch*)sender;
|
||||
cell.zidongSw = swt;
|
||||
if (_isRecording) {
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[cell.zidongSw setOn:NO];
|
||||
});
|
||||
//[self.view makeToast:@"请先结束手动录制"];
|
||||
[self showLableAction:@"请先结束手动录制"];
|
||||
return;
|
||||
}
|
||||
|
||||
[self startTostVIew];
|
||||
|
||||
if (swt.isOn) {
|
||||
_isManual = YES;
|
||||
[[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId
|
||||
password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_OFF];
|
||||
_mydatepicView.resultString=nil;
|
||||
if (_mydatepicView.startString==nil||_mydatepicView.endString==nil) {
|
||||
[self showTitle:@"" messsage:@"请选择时间"];
|
||||
}else{
|
||||
|
||||
_isManual = NO;
|
||||
[[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId
|
||||
password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_ON];
|
||||
_mydatepicView.resultString=[NSString stringWithFormat:@"%@:%@-%@:%@",_mydatepicView.startString,_mydatepicView.endString,_mydatepicView.startString1,_mydatepicView.endString1];
|
||||
[[DataCenter defaultDtacenter].cache setSynString:_mydatepicView.resultString forKey:@"schduleRecordTime"];
|
||||
|
||||
[_mydatepicView removeFromSuperview];
|
||||
|
||||
TemperatureSetCell*cell=[self.tab cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:1]];
|
||||
cell.temperaturelabel.text=_mydatepicView.resultString;
|
||||
|
||||
}
|
||||
}
|
||||
-(void)cancleButtonClick{
|
||||
|
||||
|
||||
[_mydatepicView removeFromSuperview];
|
||||
}
|
||||
|
||||
-(void)nowRecordBtnAction:(UIButton*)btn{
|
||||
|
||||
btn.selected=!btn.selected;
|
||||
;
|
||||
if (btn.selected)
|
||||
{
|
||||
self.recordType=@"1";
|
||||
[[DataCenter defaultDtacenter].cache setSynString:self.recordType forKey:@"recordType"];
|
||||
|
||||
[[GWP2PClient sharedClient] setDeviceManuallyRecordState:YES withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
|
||||
|
||||
}];
|
||||
[[GWP2PClient sharedClient] setDeviceRecordType:GWP2PRecordTypeManual withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
|
||||
|
||||
if (success)
|
||||
{
|
||||
[self.view makeToast:@"设置成功"];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self.view makeToast:@"设置失败"];
|
||||
}
|
||||
}];
|
||||
|
||||
[[GWP2PClient sharedClient] setDeviceManuallyRecordState:YES withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
|
||||
|
||||
}];
|
||||
|
||||
}else
|
||||
{
|
||||
self.recordType=@"0";
|
||||
[[DataCenter defaultDtacenter].cache setSynString:self.recordType forKey:@"recordType"];
|
||||
|
||||
[[GWP2PClient sharedClient] setDeviceRecordType:GWP2PRecordTypeAlarm withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
|
||||
NSLog(@"data=%@",dataDictionary);
|
||||
}];
|
||||
[[GWP2PClient sharedClient] setDevicePrerecordState:YES withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
|
||||
|
||||
}];
|
||||
[[GWP2PClient sharedClient] setDeviceAlarmRecordTime:3 withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
|
||||
|
||||
}];
|
||||
[[GWP2PClient sharedClient] setDeviceManuallyRecordState:NO withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
[self.tab reloadData];
|
||||
}
|
||||
|
||||
- (void)showLableAction:(NSString *)str{
|
||||
|
||||
UILabel *laberAction =[[UILabel alloc]init];
|
||||
CGFloat labW = 200;
|
||||
laberAction.frame =CGRectMake(kScreenSize.width/2 - labW/2,kScreenSize.height*3/4 - 50 , labW, 40);
|
||||
laberAction.clipsToBounds =YES;
|
||||
laberAction.layer.cornerRadius =5;
|
||||
laberAction.layer.backgroundColor = [UIColor blackColor].CGColor;
|
||||
laberAction.alpha =1;
|
||||
laberAction.text =str;
|
||||
laberAction.textAlignment =NSTextAlignmentCenter;
|
||||
//laberAction.backgroundColor =IndicatorBack_COLOR;
|
||||
laberAction.font=[UIFont systemFontOfSize:14];
|
||||
laberAction.textColor=[UIColor whiteColor];
|
||||
|
||||
[self.view addSubview:laberAction];
|
||||
|
||||
[UIView animateWithDuration:ToastFade
|
||||
delay:0.0
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
laberAction.alpha = 1.0;
|
||||
} completion:^(BOOL finished) {
|
||||
[UIView animateWithDuration:ToastFade
|
||||
delay:1.5
|
||||
options:UIViewAnimationOptionCurveEaseIn
|
||||
animations:^{
|
||||
laberAction.alpha = 0.0;
|
||||
} completion:^(BOOL finished) {
|
||||
[laberAction removeFromSuperview];
|
||||
}];
|
||||
}];
|
||||
|
||||
|
||||
-(void)schduleRecordAction:(UISwitch*)btn
|
||||
|
||||
{
|
||||
|
||||
btn.selected=!btn.selected;
|
||||
|
||||
|
||||
|
||||
if (btn.selected) {
|
||||
|
||||
self.recordType=@"2";
|
||||
[[DataCenter defaultDtacenter].cache setSynString:self.recordType forKey:@"recordType"];
|
||||
[[GWP2PClient sharedClient] setDeviceManuallyRecordState:NO withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
|
||||
|
||||
}];
|
||||
[[GWP2PClient sharedClient] setDeviceRecordType:GWP2PRecordTypeSchedule withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
|
||||
NSLog(@"data=%@",dataDictionary);
|
||||
}];
|
||||
NSString*time=[[DataCenter defaultDtacenter].cache stringForKey:@"schduleRecordTime"].length?[[DataCenter defaultDtacenter].cache stringForKey:@"schduleRecordTime"]:@"09:00-16:00";
|
||||
NSString*start=[[time componentsSeparatedByString:@"-"] firstObject];
|
||||
NSString*end=[[time componentsSeparatedByString:@"-"] lastObject];
|
||||
NSString*startHour=[[start componentsSeparatedByString:@":"] firstObject];
|
||||
NSString*startMin=[[start componentsSeparatedByString:@":"] lastObject];
|
||||
|
||||
NSString*endHour=[[end componentsSeparatedByString:@":"] firstObject];
|
||||
|
||||
NSString*endMin=[[end componentsSeparatedByString:@":"] lastObject];
|
||||
[[GWP2PClient sharedClient] setDevicePlanedRecordTimeWithFromHour:startHour.integerValue fromMinute:startMin.integerValue toHour:endHour.integerValue toMinute:endMin.integerValue deviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
|
||||
|
||||
if (success)
|
||||
{
|
||||
[self.view makeToast:@"设置成功"];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self.view makeToast:@"设置失败"];
|
||||
}
|
||||
}];
|
||||
|
||||
|
||||
}else{
|
||||
self.recordType=@"0";
|
||||
[[DataCenter defaultDtacenter].cache setSynString:self.recordType forKey:@"recordType"];
|
||||
|
||||
[[GWP2PClient sharedClient] setDeviceRecordType:GWP2PRecordTypeAlarm withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
|
||||
NSLog(@"data=%@",dataDictionary);
|
||||
}];
|
||||
[[GWP2PClient sharedClient] setDevicePrerecordState:YES withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
|
||||
|
||||
}];
|
||||
[[GWP2PClient sharedClient] setDeviceAlarmRecordTime:3 withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
|
||||
|
||||
}];
|
||||
[[GWP2PClient sharedClient] setDeviceManuallyRecordState:NO withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
|
||||
|
||||
}];
|
||||
}
|
||||
[self.tab reloadData];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 9.9 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 51 KiB |
|
|
@ -166,7 +166,7 @@
|
|||
-(void)onUdpSocket:(AsyncUdpSocket *)sock didNotReceiveDataWithTag:(long)tag dueToError:(NSError *)error{
|
||||
|
||||
NSLog(@"dueToError%@",error);
|
||||
[self postmsg:error.localizedDescription];
|
||||
[self postmsg:@"Socket连接失败"];
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ extern BOOL isfromCameraView;
|
|||
[self.view addSubview:_maclabel];
|
||||
[self.view bringSubviewToFront:_maclabel];
|
||||
self.bakbutton.userInteractionEnabled=YES;
|
||||
[self mmPogressHUDdismiss];
|
||||
|
||||
[self connectNormalView];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[self.view makeToast:@"设备类型不匹配,请重新选择入口绑定"];
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@
|
|||
#define CURR_LANG ([[NSLocale preferredLanguages] objectAtIndex:0])
|
||||
#define LanguageIsEnglish ([CURR_LANG isEqualToString:@"en-US"] || [CURR_LANG isEqualToString:@"en-CA"] || [CURR_LANG isEqualToString:@"en-GB"] || [CURR_LANG isEqualToString:@"en-CN"] || [CURR_LANG isEqualToString:@"en"])
|
||||
|
||||
@interface XWCountryCodeController()<UITableViewDataSource,UITableViewDelegate,UISearchBarDelegate,UISearchDisplayDelegate>{
|
||||
@interface XWCountryCodeController()<UITableViewDataSource,UITableViewDelegate,UISearchBarDelegate,UISearchResultsUpdating>{
|
||||
//国际代码主tableview
|
||||
UITableView *countryCodeTableView;
|
||||
//搜索
|
||||
UISearchDisplayController *searchController;
|
||||
UISearchController *searchController;
|
||||
// UISearchController *searchController;
|
||||
UISearchBar *searchBar;
|
||||
//代码字典
|
||||
|
|
@ -53,7 +53,7 @@
|
|||
-(void)creatSubviews{
|
||||
searchResultValuesArray = [[NSMutableArray alloc] init];
|
||||
|
||||
countryCodeTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 20, self.view.bounds.size.width, self.view.bounds.size.height-20) style:UITableViewStylePlain];
|
||||
countryCodeTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 20, self.view.bounds.size.width, self.view.bounds.size.height-40) style:UITableViewStylePlain];
|
||||
[self.view addSubview:countryCodeTableView];
|
||||
//自动调整自己的宽度,保证与superView左边和右边的距离不变。
|
||||
[countryCodeTableView setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
|
||||
|
|
@ -61,18 +61,15 @@
|
|||
[countryCodeTableView setDelegate:self];
|
||||
[countryCodeTableView setSectionIndexBackgroundColor:[UIColor clearColor]];
|
||||
|
||||
searchBar = [[UISearchBar alloc] init];
|
||||
[searchBar sizeToFit];
|
||||
[searchBar setDelegate:self];
|
||||
//关闭系统自动联想和首字母大写功能
|
||||
[searchBar setAutocapitalizationType:UITextAutocapitalizationTypeNone];
|
||||
[countryCodeTableView setTableHeaderView:searchBar];
|
||||
|
||||
searchController = [[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self];
|
||||
[searchController setDelegate:self];
|
||||
searchController.searchResultsDataSource = self;
|
||||
searchController.searchResultsDelegate = self;
|
||||
|
||||
|
||||
searchController = [[UISearchController alloc]initWithSearchResultsController:nil];
|
||||
[searchController setSearchResultsUpdater:self];
|
||||
searchController.dimsBackgroundDuringPresentation=NO;
|
||||
searchController.definesPresentationContext=NO;
|
||||
searchController.searchBar.delegate=self;
|
||||
countryCodeTableView.tableHeaderView=searchController.searchBar;
|
||||
searchBar=searchController.searchBar;
|
||||
NSString *plistPathCH = [[NSBundle mainBundle] pathForResource:@"sortedChnames" ofType:@"plist"];
|
||||
NSString *plistPathEN = [[NSBundle mainBundle] pathForResource:@"sortedEnames" ofType:@"plist"];
|
||||
|
||||
|
|
@ -91,25 +88,29 @@
|
|||
|
||||
}
|
||||
|
||||
//搜索
|
||||
-(void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText{
|
||||
-(void)updateSearchResultsForSearchController:(UISearchController *)searchController
|
||||
{
|
||||
NSLog(@"%s",__FUNCTION__);
|
||||
[searchResultValuesArray removeAllObjects];
|
||||
|
||||
for (NSArray *array in [sortedNameDict allValues]) {
|
||||
for (NSString *value in array) {
|
||||
if ([value containsString:searchBar.text]) {
|
||||
if ([value containsString:searchController.searchBar.text]) {
|
||||
[searchResultValuesArray addObject:value];
|
||||
}
|
||||
}
|
||||
}
|
||||
[searchController.searchResultsTableView reloadData];
|
||||
|
||||
|
||||
[countryCodeTableView reloadData];
|
||||
}
|
||||
|
||||
|
||||
|
||||
#pragma mark - UITableView
|
||||
//section
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
if (tableView == countryCodeTableView) {
|
||||
if (!searchController.isActive) {
|
||||
return [sortedNameDict allKeys].count;
|
||||
}else{
|
||||
return 1;
|
||||
|
|
@ -117,7 +118,7 @@
|
|||
}
|
||||
//row
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
if (tableView == countryCodeTableView) {
|
||||
if (!searchController.isActive) {
|
||||
|
||||
NSArray *array = [sortedNameDict objectForKey:[indexArray objectAtIndex:section]];
|
||||
return array.count;
|
||||
|
|
@ -134,7 +135,7 @@
|
|||
|
||||
//初始化cell
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (tableView == countryCodeTableView) {
|
||||
if (!searchController.isActive) {
|
||||
static NSString *ID1 = @"cellIdentifier1";
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID1];
|
||||
if (!cell) {
|
||||
|
|
@ -164,7 +165,7 @@
|
|||
|
||||
//indexTitle
|
||||
-(NSArray<NSString *> *)sectionIndexTitlesForTableView:(UITableView *)tableView{
|
||||
if (tableView == countryCodeTableView) {
|
||||
if (!searchController.isActive) {
|
||||
return indexArray;
|
||||
}else{
|
||||
return nil;
|
||||
|
|
@ -172,7 +173,7 @@
|
|||
}
|
||||
//
|
||||
-(NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index{
|
||||
if (tableView == countryCodeTableView) {
|
||||
if (!searchController.isActive) {
|
||||
return index;
|
||||
}else{
|
||||
return 0;
|
||||
|
|
@ -181,7 +182,7 @@
|
|||
|
||||
- (CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
|
||||
{
|
||||
if (tableView == countryCodeTableView) {
|
||||
if (!searchController.isActive) {
|
||||
if (section == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -212,6 +213,9 @@
|
|||
if (self.returnCountryCodeBlock != nil) {
|
||||
self.returnCountryCodeBlock(cell.textLabel.text);
|
||||
}
|
||||
if (searchController.isActive) {
|
||||
[searchController dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,5 +11,5 @@
|
|||
@interface TemperatureSetModel : NSObject
|
||||
@property(nonatomic,copy)NSString*title;
|
||||
@property(nonatomic,copy)NSString*temperatureLabel;
|
||||
//@property(nonatomic);
|
||||
@property(nonatomic,copy)NSString*status;//开关状态,新增
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// DatePickerCustomView.h
|
||||
// E-Mobile
|
||||
//
|
||||
// Created by Yang on 15/9/18.
|
||||
//
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface DatePickerCustomView : UIView
|
||||
@property(nonatomic,copy)dispatch_block_t dateChanged;
|
||||
@property(nonatomic,copy)dispatch_block_t cancelBlock;
|
||||
@property(nonatomic,strong)UIDatePicker* datePicker;
|
||||
+(instancetype)showInView:(UIView*)view Mode:(UIDatePickerMode)mode date:(NSDate*)date;
|
||||
@end
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
//
|
||||
// DatePickerCustomView.m
|
||||
// E-Mobile
|
||||
//
|
||||
// Created by Yang on 15/9/18.
|
||||
//
|
||||
//
|
||||
#import "DatePickerCustomView.h"
|
||||
|
||||
@interface DatePickerCustomView(){
|
||||
|
||||
}
|
||||
@property(nonatomic,strong)UIButton* timePickerCancelBtn;
|
||||
@property(nonatomic,strong)UIView* buttonView;
|
||||
@end
|
||||
|
||||
@implementation DatePickerCustomView
|
||||
|
||||
+(instancetype)showInView:(UIView*)view Mode:(UIDatePickerMode)mode date:(NSDate*)date
|
||||
{
|
||||
DatePickerCustomView* customView = [[self alloc] initWithFrame:CGRectMake(0, 0, view.frame.size.width, view.frame.size.height)];
|
||||
if (customView) {
|
||||
customView.backgroundColor=RGBA(0, 0, 0, 0.3);
|
||||
|
||||
UIButton* timePickerCancelBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
customView.timePickerCancelBtn = timePickerCancelBtn;
|
||||
timePickerCancelBtn.tag = 100;
|
||||
timePickerCancelBtn.frame = customView.bounds;
|
||||
[timePickerCancelBtn addTarget:customView action:@selector(datePickerCancelBtnPressed:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[customView addSubview:timePickerCancelBtn];
|
||||
|
||||
UIDatePicker* datePicker = [[UIDatePicker alloc] initWithFrame: CGRectMake(0, customView.frame.size.height+40, customView.frame.size.width, 216)];
|
||||
customView.datePicker = datePicker;
|
||||
[datePicker setLocale:[NSLocale autoupdatingCurrentLocale]];
|
||||
[datePicker setDatePickerMode:mode];
|
||||
datePicker.backgroundColor=[UIColor whiteColor];
|
||||
datePicker.tag = 101;
|
||||
if (date) {
|
||||
[datePicker setDate:date];
|
||||
}
|
||||
// [datePicker addTarget:customView action:@selector(datePickerChanged:) forControlEvents:UIControlEventValueChanged];
|
||||
[customView addSubview:datePicker];
|
||||
|
||||
UIView *buttonView = [[UIView alloc] initWithFrame:CGRectMake(0, customView.frame.size.height, customView.frame.size.width, 40)];
|
||||
customView.buttonView = buttonView;
|
||||
buttonView.backgroundColor = [UIColor colorWithRed:0.95 green:0.95 blue:0.95 alpha:1];
|
||||
[customView addSubview:buttonView];
|
||||
|
||||
UIButton *cancelBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 60, 40)];
|
||||
[cancelBtn addTarget:customView action:@selector(datePickerCancelBtnPressed:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[cancelBtn setTitle:NSLocalizedString(@"取消", nil) forState:UIControlStateNormal];
|
||||
[cancelBtn setTitle:NSLocalizedString(@"取消", nil) forState:UIControlStateSelected];
|
||||
cancelBtn.titleLabel.font = [UIFont systemFontOfSize:15];
|
||||
[cancelBtn setTitleColor:[UIColor colorWithRed:21.0/255 green:126.0/255 blue:251.0/255 alpha:1] forState:UIControlStateNormal];
|
||||
[cancelBtn setTitleColor:[UIColor colorWithRed:21.0/255 green:126.0/255 blue:251.0/255 alpha:1] forState:UIControlStateSelected];
|
||||
[buttonView addSubview:cancelBtn];
|
||||
|
||||
UIButton *commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(customView.frame.size.width-60, 0, 60, 40)];
|
||||
[commitBtn addTarget:customView action:@selector(datePickerCommitBtnPressed:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[commitBtn setTitle:NSLocalizedString(@"确定", nil) forState:UIControlStateNormal];
|
||||
[commitBtn setTitle:NSLocalizedString(@"确定", nil) forState:UIControlStateSelected];
|
||||
commitBtn.titleLabel.font = [UIFont systemFontOfSize:15];
|
||||
[commitBtn setTitleColor:[UIColor colorWithRed:21.0/255 green:126.0/255 blue:251.0/255 alpha:1] forState:UIControlStateNormal];
|
||||
[commitBtn setTitleColor:[UIColor colorWithRed:21.0/255 green:126.0/255 blue:251.0/255 alpha:1] forState:UIControlStateSelected];
|
||||
[buttonView addSubview:commitBtn];
|
||||
|
||||
[customView showDatePickerInView:view];
|
||||
}
|
||||
return customView;
|
||||
}
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
/*init code*/
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)datePickerCancelBtnPressed:(UIButton*)btn{
|
||||
[UIView animateWithDuration:0.2 animations:^{
|
||||
self.datePicker.frame = CGRectMake(0, self.frame.size.height+40, self.frame.size.width, 216);
|
||||
self.buttonView.frame = CGRectMake(0, self.frame.size.height, self.frame.size.width, 40);
|
||||
}completion:^(BOOL finished) {
|
||||
if (self.cancelBlock) {
|
||||
self.cancelBlock();
|
||||
}
|
||||
[self removeFromSuperview];
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)datePickerCommitBtnPressed:(UIButton*)btn {
|
||||
[UIView animateWithDuration:0.2 animations:^{
|
||||
self.datePicker.frame = CGRectMake(0, self.frame.size.height+40, self.frame.size.width, 216);
|
||||
self.buttonView.frame = CGRectMake(0, self.frame.size.height, self.frame.size.width, 40);
|
||||
}completion:^(BOOL finished) {
|
||||
self.dateChanged();
|
||||
[self removeFromSuperview];
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)showDatePickerInView:(UIView*)view{
|
||||
[view addSubview:self];
|
||||
[UIView animateWithDuration:0.2 animations:^{
|
||||
self.datePicker.frame = CGRectMake(0, self.frame.size.height-216, self.frame.size.width, 216);
|
||||
self.buttonView.frame = CGRectMake(0, self.frame.size.height-216-40, self.frame.size.width, 40);
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)datePickerChanged:(id)sender{
|
||||
self.dateChanged();
|
||||
}
|
||||
@end
|
||||