This commit is contained in:
lianxiang
2018-09-06 21:19:50 +08:00
parent 17d4481f2c
commit 0f09748cc8
69 changed files with 966 additions and 439 deletions
+12 -28
View File
@@ -26,6 +26,7 @@
8340BFAB213E665D008F22E4 /* GIGAUserLocalizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8340BFAA213E665D008F22E4 /* GIGAUserLocalizable.strings */; };
8340BFAF213E739D008F22E4 /* GiGaNoNetWorkView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8340BFAE213E739D008F22E4 /* GiGaNoNetWorkView.m */; };
8342D9FD2131150200D16B1D /* 4481.wav in Resources */ = {isa = PBXBuildFile; fileRef = 8342D9FC2131150200D16B1D /* 4481.wav */; };
8345C13621414D3B00051717 /* NSString+Unicode.m in Sources */ = {isa = PBXBuildFile; fileRef = 8345C13521414D3B00051717 /* NSString+Unicode.m */; };
8349585C212511040064DB6C /* AppDelegate+ThirdParty.m in Sources */ = {isa = PBXBuildFile; fileRef = 8349585B212511040064DB6C /* AppDelegate+ThirdParty.m */; };
835060A2212D1225007E6220 /* GiGaMeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 835060A1212D1225007E6220 /* GiGaMeViewController.m */; };
835060A5212D3536007E6220 /* AppDelegate+GiGaConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 8361B40A21217B2100238FEB /* AppDelegate+GiGaConfig.m */; };
@@ -163,6 +164,8 @@
8340BFAD213E739D008F22E4 /* GiGaNoNetWorkView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaNoNetWorkView.h; sourceTree = "<group>"; };
8340BFAE213E739D008F22E4 /* GiGaNoNetWorkView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaNoNetWorkView.m; sourceTree = "<group>"; };
8342D9FC2131150200D16B1D /* 4481.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = 4481.wav; sourceTree = "<group>"; };
8345C13421414D3B00051717 /* NSString+Unicode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSString+Unicode.h"; sourceTree = "<group>"; };
8345C13521414D3B00051717 /* NSString+Unicode.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSString+Unicode.m"; sourceTree = "<group>"; };
8349585A212511040064DB6C /* AppDelegate+ThirdParty.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AppDelegate+ThirdParty.h"; sourceTree = "<group>"; };
8349585B212511040064DB6C /* AppDelegate+ThirdParty.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "AppDelegate+ThirdParty.m"; sourceTree = "<group>"; };
835060A0212D1225007E6220 /* GiGaMeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaMeViewController.h; sourceTree = "<group>"; };
@@ -626,6 +629,8 @@
838500DB2137F3F7003514A3 /* GiGaAttributedLabel.m */,
8340BF9C213E3846008F22E4 /* SHineLabel.h */,
8340BF9D213E3846008F22E4 /* SHineLabel.m */,
8345C13421414D3B00051717 /* NSString+Unicode.h */,
8345C13521414D3B00051717 /* NSString+Unicode.m */,
);
path = Category;
sourceTree = "<group>";
@@ -1246,6 +1251,7 @@
83835BBC212E60E5001480F2 /* MessageDetailViewController.m in Sources */,
83835BCD212E856A001480F2 /* NSString+MD5.m in Sources */,
8340BFA2213E60DD008F22E4 /* GIGAMBHUDHelper.m in Sources */,
8345C13621414D3B00051717 /* NSString+Unicode.m in Sources */,
83835BC7212E7BBF001480F2 /* GiGaNavTitileView.m in Sources */,
8361B4322121832800238FEB /* GiGaBaseViewController.m in Sources */,
8357ADD32123C7C6000816F2 /* GiGaAPIResult.m in Sources */,
@@ -1461,10 +1467,7 @@
);
INFOPLIST_FILE = GIGA/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.gigamask.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
@@ -1491,10 +1494,7 @@
);
INFOPLIST_FILE = GIGA/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.gigamask.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
@@ -1509,11 +1509,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = GIGATests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = lianxiang.GIGATests;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
@@ -1527,11 +1523,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = GIGATests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = lianxiang.GIGATests;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
@@ -1544,11 +1536,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = GIGAUITests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = lianxiang.GIGAUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
@@ -1561,11 +1549,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = GIGAUITests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = lianxiang.GIGAUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
@@ -1,5 +1,9 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "hud_error@2x.png",
@@ -1,5 +1,9 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "hud_info@2x.png",
@@ -1,5 +1,9 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "hud_ok@2x.png",
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "bg_img_face.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "bg_img_face@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "bg_img_face@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

@@ -6,11 +6,12 @@
},
{
"idiom" : "universal",
"filename" : "img_bg@2x.png",
"filename" : "bg_logo@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "bg_logo@3x.png",
"scale" : "3x"
}
],
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

@@ -6,11 +6,12 @@
},
{
"idiom" : "universal",
"filename" : "img_bg_head@2x.png",
"filename" : "bg_name@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "bg_name@3x.png",
"scale" : "3x"
}
],
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "btn_more@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "btn_more@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "btn_start_mask@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "btn_start_mask@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "btn_start_test@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "btn_start_test@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_love.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_love@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_love@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 680 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "img_mask.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "img_mask@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "img_mask@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "mask_bg_up@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "mask_bg_up@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 747 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -2,15 +2,16 @@
"images" : [
{
"idiom" : "universal",
"filename" : "maske_dismiss_waring.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "maske_dismiss_waring@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "maske_dismiss_waring@3x.png",
"scale" : "3x"
}
],
Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 B

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "nav_circle_avatar@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "nav_circle_avatar@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

+49 -6
View File
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
@@ -13,18 +14,60 @@
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="rI7-K2-WFe"/>
<viewControllerLayoutGuide type="bottom" id="diS-X4-gLC"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="bg_logo" translatesAutoresizingMaskIntoConstraints="NO" id="HQY-KF-maA">
<rect key="frame" x="140" y="131" width="95" height="95"/>
<constraints>
<constraint firstAttribute="height" constant="95" id="jfp-Pv-euv"/>
<constraint firstAttribute="width" constant="95" id="xC0-N5-5NN"/>
</constraints>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="bg_name" translatesAutoresizingMaskIntoConstraints="NO" id="OAL-V9-kkZ">
<rect key="frame" x="132" y="274" width="110" height="70"/>
<constraints>
<constraint firstAttribute="width" constant="110" id="2ws-gJ-XpT"/>
<constraint firstAttribute="height" constant="70" id="qDD-uK-zvA"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hjv-Hw-vVK">
<rect key="frame" x="110" y="362" width="154" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="bf7-wA-tlK"/>
</constraints>
<attributedString key="attributedText">
<fragment content="一款独具匠心的优质面膜">
<attributes>
<color key="NSColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<font key="NSFont" size="14" name="PingFangSC-Medium"/>
<paragraphStyle key="NSParagraphStyle" alignment="right" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
</attributedString>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.43137254901960786" green="0.0" blue="0.043137254901960784" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="hjv-Hw-vVK" firstAttribute="centerX" secondItem="ose-FF-1Ln" secondAttribute="centerX" id="1HZ-N0-YD5"/>
<constraint firstItem="HQY-KF-maA" firstAttribute="centerX" secondItem="ose-FF-1Ln" secondAttribute="centerX" id="Dbo-Hj-G3n"/>
<constraint firstItem="HQY-KF-maA" firstAttribute="top" secondItem="ose-FF-1Ln" secondAttribute="top" constant="111" id="Dq6-Zk-1ih"/>
<constraint firstItem="OAL-V9-kkZ" firstAttribute="top" secondItem="HQY-KF-maA" secondAttribute="bottom" constant="48" id="R8Y-OF-fH6"/>
<constraint firstItem="hjv-Hw-vVK" firstAttribute="top" secondItem="OAL-V9-kkZ" secondAttribute="bottom" constant="18" id="caI-B5-oAs"/>
<constraint firstItem="OAL-V9-kkZ" firstAttribute="centerX" secondItem="ose-FF-1Ln" secondAttribute="centerX" id="fvk-sy-cnk"/>
</constraints>
<viewLayoutGuide key="safeArea" id="ose-FF-1Ln"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
<point key="canvasLocation" x="-129" y="374"/>
</scene>
</scenes>
<resources>
<image name="bg_logo" width="88" height="88"/>
<image name="bg_name" width="110" height="68"/>
</resources>
</document>
+16
View File
@@ -0,0 +1,16 @@
//
// NSString+Unicode.h
// GIGA
//
// Created by lianxiang on 2018/9/6.
// Copyright © 2018年 com.giga.ios. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSString (Unicode)
- (NSString *)replaceUnicode:(NSString *)unicodeStr;
- (NSString *)htmlEntityDecode:(NSString *)string;
@end
+39
View File
@@ -0,0 +1,39 @@
//
// NSString+Unicode.m
// GIGA
//
// Created by lianxiang on 2018/9/6.
// Copyright © 2018年 com.giga.ios. All rights reserved.
//
#import "NSString+Unicode.h"
@implementation NSString (Unicode)
- (NSString *)replaceUnicode:(NSString *)unicodeStr {
NSString *tempStr1 = [unicodeStr stringByReplacingOccurrencesOfString:@"\\u"withString:@"\\U"];
NSString *tempStr2 = [tempStr1 stringByReplacingOccurrencesOfString:@"\""withString:@"\\\""];
NSString *tempStr3 = [[@"\""stringByAppendingString:tempStr2]stringByAppendingString:@"\""];
NSData *tempData = [tempStr3 dataUsingEncoding:NSUTF8StringEncoding];
NSString* returnStr = [NSPropertyListSerialization propertyListFromData:tempData
mutabilityOption:NSPropertyListImmutable
format:NULL
errorDescription:NULL];
return [returnStr stringByReplacingOccurrencesOfString:@"\\r\\n"withString:@"\n"];
}
//将 &lt 等类似的字符转化为HTML中的“<”等
- (NSString *)htmlEntityDecode:(NSString *)string
{
string = [string stringByReplacingOccurrencesOfString:@"&quot;" withString:@"\""];
string = [string stringByReplacingOccurrencesOfString:@"&apos;" withString:@"'"];
string = [string stringByReplacingOccurrencesOfString:@"&lt;" withString:@"<"];
string = [string stringByReplacingOccurrencesOfString:@"&gt;" withString:@">"];
string = [string stringByReplacingOccurrencesOfString:@"&amp;" withString:@"&"]; // Do this last so that, e.g. @"&amp;lt;" goes to @"&lt;" not @"<"
return string;
}
@end
+1 -1
View File
@@ -26,7 +26,7 @@ static char overlayKey;
[self setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
self.overlay = [[UIView alloc] initWithFrame:CGRectMake(0, -PhoneX_STATUBAR_H, [UIScreen mainScreen].bounds.size.width, CGRectGetHeight(self.bounds) + PhoneX_STATUBAR_H)];
self.overlay.userInteractionEnabled = NO;
//self.overlay.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
self.overlay.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
[self insertSubview:self.overlay atIndex:0];
}
+1 -2
View File
@@ -24,8 +24,7 @@
[super viewDidLoad];
// Do any additional setup after loading the view.
[self.navigationController.navigationBar cnSetBackgroundColor:GIGARGB(216, 216, 216, 1)];
//[self.navigationController.navigationBar cnSetBackgroundColor:GIGARGB(216, 216, 216, 1)];
}
+5
View File
@@ -53,5 +53,10 @@
*/
+(BOOL)isPhoneNumber:(NSString*)mobileNumber;
+(NSAttributedString *)stringWithText:(NSString *)title textColor:(UIColor *)color textFont:(UIFont *)font leterSpace:(CGFloat )space;
+(NSString *)convertToJsonData:(NSDictionary *)dict;
+(NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;
@end
+69
View File
@@ -171,7 +171,76 @@
return NO;
}
}
+(NSAttributedString *)stringWithText:(NSString *)title textColor:(UIColor *)color textFont:(UIFont *)font leterSpace:(CGFloat )space
{
NSMutableParagraphStyle *paragraStyle = [[NSMutableParagraphStyle alloc] init];
paragraStyle.alignment = NSTextAlignmentCenter;
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:font,NSForegroundColorAttributeName:color,NSKernAttributeName:@(space),NSParagraphStyleAttributeName:paragraStyle}];
return attributedString;
}
+(NSString *)convertToJsonData:(NSDictionary *)dict
{
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dict options:NSJSONWritingPrettyPrinted error:&error];
NSString *jsonString;
if (!jsonData) {
NSLog(@"%@",error);
}else{
jsonString = [[NSString alloc]initWithData:jsonData encoding:NSUTF8StringEncoding];
}
NSMutableString *mutStr = [NSMutableString stringWithString:jsonString];
NSRange range = {0,jsonString.length};
//去掉字符串中的空格
[mutStr replaceOccurrencesOfString:@" " withString:@"" options:NSLiteralSearch range:range];
NSRange range2 = {0,mutStr.length};
//去掉字符串中的换行符
[mutStr replaceOccurrencesOfString:@"\n" withString:@"" options:NSLiteralSearch range:range2];
return mutStr;
}
+(NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString
{
if (jsonString == nil) {
return nil;
}
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
NSError *err;
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData
options:NSJSONReadingMutableContainers
error:&err];
if(err)
{
NSLog(@"json解析失败:%@",err);
return nil;
}
return dic;
}
@end
@@ -14,7 +14,6 @@
{
if (self = [super initWithFrame:frame]) {
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, 44)];
//label.textColor = GIGAUIColorFromRGBA(0x777777);
label.textColor = [UIColor whiteColor];
label.text = str;
label.font = [UIFont fontWithName:@"PingFangSC-Medium" size:18.f];
+5 -1
View File
@@ -60,7 +60,7 @@ colorWithRed:((float)((rgbValue & 0xFF000000) >> 24))/255.0 \
green:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
blue:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
alpha:((float)(rgbValue & 0xFF))/255.0]
#define GIGA_MAIN_BGCOLOR [UIColor colorWithRed:131/255.0f green:10/255.0f blue:10/255.0f alpha:1]
#define SCREEN [UIScreen mainScreen]
#define WIDTH self.view.frame.size.width
@@ -91,6 +91,10 @@ alpha:((float)(rgbValue & 0xFF))/255.0]
#define GIGA_FONTNAME @"PingFangSC-Medium"
#define GIGA_FONTBOLD @"PingFangSC-Semibold"
#define GIGA_TEXTFONTBOLD(font) [UIFont fontWithName:GIGA_FONTBOLD size:font]
#define GIGA_TEXTFONTMEDIUM(font) [UIFont fontWithName:GIGA_FONTNAME size:font]
//国际化
#define GIGALocalComm(key) NSLocalizedStringFromTable(key, @"GIGACommonLocalizabe", nil)
//个人中心
@@ -6,3 +6,5 @@
Copyright © 2018年 com.giga.ios. All rights reserved.
*/
"masktime_nav_title" = "面膜时间";
"masktime_adview_passadtitle" = "跳过广告";
"masktime_adview_desc" = "一款独具匠心的优质面膜";
@@ -9,6 +9,7 @@
#import "GiGaStartAdView.h"
#import "GiGaFileNanager.h"
#import "UIImageView+WebCache.h"
#import "GiGaHelper.h"
@interface GiGaStartAdView()
@@ -17,6 +18,7 @@
@property (nonatomic,assign) int count;
@end
static int const showTime = 5;
@implementation GiGaStartAdView
@@ -40,50 +42,124 @@ static int const showTime = 5;
}
-(void)initUIWithFrame:(CGRect)frame{
self.backgroundColor = [UIColor whiteColor];
self.backgroundColor = GIGARGB(131, 10,10, 1);
_adView = [[UIImageView alloc] initWithFrame:frame];
_adView.userInteractionEnabled = YES;
_adView.contentMode = UIViewContentModeScaleAspectFill;
_adView.clipsToBounds = YES;
//广告点击手势
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(gotoAd)];
[_adView addGestureRecognizer:tap];
CGFloat btnW = 60;
CGFloat btnH = 30;
_countBtn = [[UIButton alloc] initWithFrame:CGRectMake(KMainW - btnW - 24, btnH + 10, btnW, btnH)];
// UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(gotoAd)];
// [_adView addGestureRecognizer:tap];
CGFloat btnW = 80;
CGFloat btnH = 26;
_countBtn = [[UIButton alloc] initWithFrame:CGRectMake(KMainW - btnW - 24,PhoneX_STATUBAR_H + 10, btnW, btnH)];
[_countBtn addTarget:self action:@selector(removeAdView) forControlEvents:UIControlEventTouchUpInside];
[_countBtn setTitle:[NSString stringWithFormat:@"跳过%d",showTime] forState:UIControlStateNormal];
_countBtn.titleLabel.font = [UIFont systemFontOfSize:15];
[_countBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
_countBtn.backgroundColor = GIGARGB(38, 38, 38, 0.6) ;
// [_countBtn setTitle:[NSString stringWithFormat:@"跳过%d",showTime] forState:UIControlStateNormal];
[_countBtn setTitle:GIGALocalComm(@"masktime_adview_passadtitle") forState:UIControlStateNormal];
_countBtn.titleLabel.font = [UIFont fontWithName:GIGA_FONTBOLD size:14];
[_countBtn setTitleColor:GIGARGB(144, 25, 31, 1) forState:UIControlStateNormal];
_countBtn.backgroundColor = GIGARGB(235,234,234,1) ;
_countBtn.layer.masksToBounds = YES;
_countBtn.layer.cornerRadius = 4;
_countBtn.layer.cornerRadius = _countBtn.frame.size.height / 2 ;
[self addSubview:_adView];
[self addSubview:_countBtn];
UIImageView *imageViewlogo = [[UIImageView alloc] init];
imageViewlogo.image = [UIImage imageNamed:@"bg_logo"];
UIImageView *imageView27Mask = [[UIImageView alloc] init];
imageView27Mask.image = [UIImage imageNamed:@"bg_name"];
imageView27Mask.contentMode = UIViewContentModeScaleAspectFit;
UILabel *detailLabel = [[UILabel alloc] init];
detailLabel.attributedText = [GiGaHelper stringWithText:GIGALocalComm(@"masktime_adview_desc") textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(14) leterSpace:2];
UIButton *moreinfoBtn = [UIButton buttonWithType:UIButtonTypeCustom];
// [moreinfoBtn setImage:[UIImage imageNamed:@"btn_more"] forState:UIControlStateNormal];
[moreinfoBtn setBackgroundImage:[UIImage imageNamed:@"btn_more"] forState:UIControlStateNormal];
[moreinfoBtn addTarget:self action:@selector(gotoAd:) forControlEvents:UIControlEventTouchUpInside];
NSMutableAttributedString *title = [[NSMutableAttributedString alloc] initWithString:@"了解更多" attributes:@{NSFontAttributeName:[UIFont fontWithName:GIGA_FONTNAME size:18],NSForegroundColorAttributeName:[UIColor whiteColor]}];
[moreinfoBtn setAttributedTitle:title forState:UIControlStateNormal];
UILabel *year = [[UILabel alloc] init];
year.textColor = [UIColor whiteColor];
year.font = GIGA_TEXTFONTBOLD(10);
year.text = @"2018";
[self addSubview:imageViewlogo];
[self addSubview:imageView27Mask];
[self addSubview:detailLabel];
[self addSubview:moreinfoBtn];
[self addSubview:year];
[imageViewlogo mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.mas_top).offset(131);
make.height.and.width.mas_equalTo(95);
make.centerX.mas_equalTo(self.mas_centerX);
}];
[imageView27Mask mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.mas_top).offset(271);
make.width.mas_equalTo(120);
make.height.mas_equalTo(70);
make.centerX.mas_equalTo(self.mas_centerX);
}];
[detailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.mas_top).offset(362);
make.width.mas_equalTo(180);
make.height.mas_equalTo(21);
make.centerX.mas_equalTo(self.mas_centerX);
}];
[moreinfoBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.mas_top).offset(478);
make.width.mas_equalTo(135);
make.height.mas_equalTo(35);
make.centerX.mas_equalTo(self.mas_centerX);
}];
[year mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.mas_bottom).offset(-(10 + PhoneX_BottomMargin));
make.width.mas_equalTo(31);
make.height.mas_equalTo(14);
make.left.mas_equalTo(20);
}];
}
-(void)removeAdView{
[self.countTimer invalidate];
self.countTimer = nil;
[UIView animateWithDuration:0.3f animations:^{
self.transform = CGAffineTransformMakeScale(1, 1);
[UIView animateWithDuration:0.6f delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{
self.transform = CGAffineTransformMakeScale(1.4, 1.4);
self.alpha = 0.f;
} completion:^(BOOL finished) {
[self removeFromSuperview];
}];
}
-(void)gotoAd{
[self removeAdView];
-(void)gotoAd:(UIButton *)btn{
btn.userInteractionEnabled = NO;
NC_POST_NAME_OBJECT(APP_PUSHTO_DETAILVIEW, nil);
[NSTimer scheduledTimerWithTimeInterval:0.6 target:self selector:@selector(removeAdView) userInfo:nil repeats:NO];
//[self removeAdView];
}
-(void)countDown{
_count --;
[_countBtn setTitle:[NSString stringWithFormat:@"跳过%d",_count] forState:UIControlStateNormal];
//[_countBtn setTitle:[NSString stringWithFormat:@"跳过%d",_count] forState:UIControlStateNormal];
if (_count == 0) {
[self removeAdView];
}
@@ -92,7 +168,7 @@ static int const showTime = 5;
-(void)show{
[self loadImage];
//[self loadImage];
UIWindow *window = [UIApplication sharedApplication].keyWindow;
[window addSubview:self];
//[self startTimer];
@@ -135,7 +211,7 @@ static int const showTime = 5;
}else{ dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf.countBtn setTitle:[NSString stringWithFormat:@"跳过%d",timeout] forState:UIControlStateNormal];
//[weakSelf.countBtn setTitle:[NSString stringWithFormat:@"跳过%d",timeout] forState:UIControlStateNormal];
});
timeout--;
@@ -31,11 +31,11 @@
@implementation GiGaRegistViewController
- (void)viewDidLoad {
[super viewDidLoad];
//self.title = @"注册";
[self addNavTitile:@"注册"];
//[self addNavTitile:@"注册"];
_time = 60;
// Do any additional setup after loading the view from its nib.
[self confirmUI];
@@ -44,6 +44,12 @@
[self.checkBtn addTarget:self action:@selector(checkBtnAction:) forControlEvents:UIControlEventTouchUpInside];
}
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
}
-(void)dealloc{
if (_timer) {
[_timer unfireTimer];
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -26,66 +26,47 @@
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="piO-PU-j8g">
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_circle_avatar" translatesAutoresizingMaskIntoConstraints="NO" id="SEO-0F-Irb">
<rect key="frame" x="131" y="107" width="114" height="114"/>
<rect key="frame" x="130" y="87" width="114" height="114"/>
<constraints>
<constraint firstAttribute="width" secondItem="SEO-0F-Irb" secondAttribute="height" multiplier="1:1" id="DXE-XM-Ewy"/>
<constraint firstAttribute="width" constant="114" id="GOs-M2-rAk"/>
<constraint firstAttribute="height" constant="114" id="af0-Mm-2fL"/>
</constraints>
</imageView>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入手机号" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="uJG-KF-a91">
<rect key="frame" x="66" y="250" width="243" height="48"/>
<rect key="frame" x="66" y="230" width="244" height="48"/>
<constraints>
<constraint firstAttribute="height" constant="48" id="EoB-aP-I0k"/>
<constraint firstAttribute="height" constant="48" id="pzi-4C-7s8"/>
</constraints>
<color key="textColor" red="0.77254901960784317" green="0.77254901960784317" blue="0.77254901960784317" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
<textInputTraits key="textInputTraits" keyboardType="numberPad"/>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="短信验证码" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="dR7-iu-Eup">
<rect key="frame" x="66" y="306" width="131" height="48"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ubQ-Za-dV7">
<rect key="frame" x="65" y="280" width="245" height="1"/>
<color key="backgroundColor" red="0.94901960784313721" green="0.94901960784313721" blue="0.94901960784313721" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="48" id="5Og-5V-Pzs"/>
<constraint firstAttribute="height" constant="1" id="Gbv-lr-zmA"/>
</constraints>
</view>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="短信验证码" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="dR7-iu-Eup">
<rect key="frame" x="66" y="286" width="131" height="48"/>
<constraints>
<constraint firstAttribute="height" constant="48" id="Iqo-gI-2Z3"/>
</constraints>
<color key="textColor" red="0.7725490196" green="0.7725490196" blue="0.7725490196" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
<textInputTraits key="textInputTraits" keyboardType="numberPad"/>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="设置登录密码" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="UUC-74-fsa">
<rect key="frame" x="65" y="362" width="244" height="48"/>
<constraints>
<constraint firstAttribute="height" constant="48" id="PcQ-aA-iwb"/>
</constraints>
<color key="textColor" red="0.77254901960784317" green="0.77254901960784317" blue="0.77254901960784317" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
<textInputTraits key="textInputTraits" keyboardType="numbersAndPunctuation"/>
</textField>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ubQ-Za-dV7">
<rect key="frame" x="65" y="299" width="245" height="1"/>
<color key="backgroundColor" red="0.94901960784313721" green="0.94901960784313721" blue="0.94901960784313721" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="8Ou-gP-rKg"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Trq-bz-kQT">
<rect key="frame" x="65" y="355" width="245" height="1"/>
<color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="IDq-fJ-8qH"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Pb5-1e-TXp">
<rect key="frame" x="65" y="411" width="245" height="1"/>
<color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="kWY-vL-sbU"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qAH-Fa-AmF">
<rect key="frame" x="214" y="306" width="88" height="48"/>
<rect key="frame" x="222" y="286" width="88" height="48"/>
<constraints>
<constraint firstAttribute="height" constant="48" id="dmG-UE-Ob4"/>
<constraint firstAttribute="width" constant="88" id="oNZ-6H-eha"/>
<constraint firstAttribute="width" constant="88" id="kZw-pm-n5p"/>
<constraint firstAttribute="height" constant="48" id="oB6-lP-x7P"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
<inset key="titleEdgeInsets" minX="-77" minY="0.0" maxX="0.0" maxY="0.0"/>
@@ -94,63 +75,97 @@
<color key="titleColor" red="0.60784313725490191" green="0.60784313725490191" blue="0.60784313725490191" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="b06-w9-r2g">
<rect key="frame" x="94" y="560" width="39" height="37"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Trq-bz-kQT">
<rect key="frame" x="65" y="336" width="245" height="1"/>
<color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="37" id="BVg-id-9GB"/>
<constraint firstAttribute="width" constant="39" id="gPN-W1-lt7"/>
<constraint firstAttribute="height" constant="1" id="BYZ-mC-rOK"/>
</constraints>
<state key="normal" image="btn_right"/>
</button>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Pb5-1e-TXp">
<rect key="frame" x="65" y="395" width="245" height="1"/>
<color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="SYH-LK-7FR"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hZA-nj-Wmu">
<rect key="frame" x="87" y="457" width="201" height="41"/>
<rect key="frame" x="84" y="437" width="207" height="41"/>
<color key="backgroundColor" red="0.0" green="0.87058823529411766" blue="0.74117647058823533" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="41" id="4e7-y8-S2C"/>
<constraint firstAttribute="height" constant="41" id="IZZ-Wn-zMh"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="18"/>
<state key="normal" title="注 册"/>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="已阅读并同意《用户服务协议》" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Vxb-TL-wDd" customClass="GiGaAttributedLabel">
<rect key="frame" x="129" y="570.5" width="140" height="15"/>
<rect key="frame" x="117.5" y="550" width="140" height="15"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="10"/>
<color key="textColor" red="0.56862745098039214" green="0.56862745098039214" blue="0.56862745098039214" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="highlightedColor" red="0.56862745100000001" green="0.56862745100000001" blue="0.56862745100000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</label>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="设置登录密码" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="UUC-74-fsa">
<rect key="frame" x="65" y="345" width="245" height="48"/>
<constraints>
<constraint firstAttribute="height" constant="48" id="o8f-Xh-HGs"/>
</constraints>
<color key="textColor" red="0.77254901960784317" green="0.77254901960784317" blue="0.77254901960784317" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
<textInputTraits key="textInputTraits" keyboardType="numbersAndPunctuation"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="b06-w9-r2g">
<rect key="frame" x="75" y="539" width="39" height="37"/>
<constraints>
<constraint firstAttribute="width" constant="39" id="FeL-ci-mXv"/>
<constraint firstAttribute="height" constant="37" id="sLA-cD-5zI"/>
</constraints>
<inset key="imageEdgeInsets" minX="14" minY="0.0" maxX="0.0" maxY="0.0"/>
<state key="normal" image="btn_right"/>
</button>
</subviews>
<constraints>
<constraint firstItem="UUC-74-fsa" firstAttribute="width" secondItem="uJG-KF-a91" secondAttribute="width" constant="1" id="5jJ-Jz-Etj"/>
<constraint firstItem="hZA-nj-Wmu" firstAttribute="centerX" secondItem="piO-PU-j8g" secondAttribute="centerX" id="7gX-TX-GAa"/>
<constraint firstItem="Vxb-TL-wDd" firstAttribute="centerX" secondItem="piO-PU-j8g" secondAttribute="centerX" id="Bz2-Js-CTt"/>
<constraint firstItem="ubQ-Za-dV7" firstAttribute="leading" secondItem="piO-PU-j8g" secondAttribute="leading" constant="65" id="CGf-BO-qJR"/>
<constraint firstAttribute="bottom" secondItem="Trq-bz-kQT" secondAttribute="bottom" constant="310" id="CnD-h1-kaA"/>
<constraint firstItem="SEO-0F-Irb" firstAttribute="centerX" secondItem="piO-PU-j8g" secondAttribute="centerX" id="E3K-GK-vYR"/>
<constraint firstItem="uJG-KF-a91" firstAttribute="top" secondItem="SEO-0F-Irb" secondAttribute="bottom" constant="29" id="ECP-qY-1cd"/>
<constraint firstItem="UUC-74-fsa" firstAttribute="top" secondItem="Trq-bz-kQT" secondAttribute="bottom" constant="8" id="Gtf-ex-Tqo"/>
<constraint firstItem="Trq-bz-kQT" firstAttribute="width" secondItem="ubQ-Za-dV7" secondAttribute="width" id="Hgf-r3-bsh"/>
<constraint firstItem="Trq-bz-kQT" firstAttribute="top" secondItem="dR7-iu-Eup" secondAttribute="bottom" constant="2" id="On3-Zy-Uny"/>
<constraint firstItem="dR7-iu-Eup" firstAttribute="leading" secondItem="uJG-KF-a91" secondAttribute="leading" id="Qnw-mC-uGY"/>
<constraint firstItem="uJG-KF-a91" firstAttribute="leading" secondItem="piO-PU-j8g" secondAttribute="leading" constant="66" id="TcJ-CB-sQB"/>
<constraint firstItem="Trq-bz-kQT" firstAttribute="trailing" secondItem="qAH-Fa-AmF" secondAttribute="trailing" id="Tpn-cp-PFc"/>
<constraint firstItem="Vxb-TL-wDd" firstAttribute="top" secondItem="hZA-nj-Wmu" secondAttribute="bottom" constant="72" id="V7V-X1-2jA"/>
<constraint firstItem="Pb5-1e-TXp" firstAttribute="top" secondItem="UUC-74-fsa" secondAttribute="bottom" constant="2" id="WrL-SR-oVV"/>
<constraint firstItem="ubQ-Za-dV7" firstAttribute="top" secondItem="uJG-KF-a91" secondAttribute="bottom" constant="2" id="aeU-Sw-M2f"/>
<constraint firstItem="Vxb-TL-wDd" firstAttribute="leading" secondItem="b06-w9-r2g" secondAttribute="trailing" constant="3.5" id="bJR-59-KMw"/>
<constraint firstItem="qAH-Fa-AmF" firstAttribute="centerY" secondItem="dR7-iu-Eup" secondAttribute="centerY" id="eJi-uE-qBs"/>
<constraint firstItem="hZA-nj-Wmu" firstAttribute="leading" secondItem="piO-PU-j8g" secondAttribute="leading" constant="84" id="fcO-XF-ODc"/>
<constraint firstItem="uJG-KF-a91" firstAttribute="centerX" secondItem="piO-PU-j8g" secondAttribute="centerX" id="flh-N1-FvK"/>
<constraint firstItem="qAH-Fa-AmF" firstAttribute="trailing" secondItem="uJG-KF-a91" secondAttribute="trailing" id="fsZ-rC-rlA"/>
<constraint firstAttribute="trailing" secondItem="ubQ-Za-dV7" secondAttribute="trailing" constant="65" id="j6B-5X-ymb"/>
<constraint firstItem="dR7-iu-Eup" firstAttribute="top" secondItem="ubQ-Za-dV7" secondAttribute="bottom" constant="5" id="jKd-do-Qv6"/>
<constraint firstItem="Pb5-1e-TXp" firstAttribute="width" secondItem="Trq-bz-kQT" secondAttribute="width" id="kqU-bv-fGy"/>
<constraint firstItem="Pb5-1e-TXp" firstAttribute="centerX" secondItem="piO-PU-j8g" secondAttribute="centerX" id="mX6-oT-Oeq"/>
<constraint firstItem="ubQ-Za-dV7" firstAttribute="trailing" secondItem="qAH-Fa-AmF" secondAttribute="trailing" id="nsg-Xa-gCY"/>
<constraint firstItem="qAH-Fa-AmF" firstAttribute="leading" secondItem="dR7-iu-Eup" secondAttribute="trailing" constant="25" id="v8b-9v-awi"/>
<constraint firstItem="hZA-nj-Wmu" firstAttribute="top" secondItem="Pb5-1e-TXp" secondAttribute="bottom" constant="41" id="xYx-Fr-OyO"/>
<constraint firstItem="b06-w9-r2g" firstAttribute="centerY" secondItem="Vxb-TL-wDd" secondAttribute="centerY" id="y5u-W9-HjP"/>
<constraint firstItem="UUC-74-fsa" firstAttribute="centerX" secondItem="piO-PU-j8g" secondAttribute="centerX" id="yQJ-WR-KVx"/>
<constraint firstItem="SEO-0F-Irb" firstAttribute="top" secondItem="piO-PU-j8g" secondAttribute="top" constant="87" id="ylx-4z-k36"/>
</constraints>
</scrollView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="ubQ-Za-dV7" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="65" id="2JV-ih-aWQ"/>
<constraint firstItem="Vxb-TL-wDd" firstAttribute="leading" secondItem="b06-w9-r2g" secondAttribute="trailing" constant="-4" id="3xm-2N-nGj"/>
<constraint firstItem="hZA-nj-Wmu" firstAttribute="top" secondItem="UUC-74-fsa" secondAttribute="bottom" constant="47" id="4Ny-tr-SQK"/>
<constraint firstAttribute="trailing" secondItem="Pb5-1e-TXp" secondAttribute="trailing" constant="65" id="4r6-39-cqm"/>
<constraint firstItem="dR7-iu-Eup" firstAttribute="top" secondItem="ubQ-Za-dV7" secondAttribute="bottom" constant="6" id="5AI-lo-BIZ"/>
<constraint firstItem="Trq-bz-kQT" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="65" id="5wT-D8-1gY"/>
<constraint firstItem="SEO-0F-Irb" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="7P5-hD-rSJ"/>
<constraint firstItem="uJG-KF-a91" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="7qC-LL-nvo"/>
<constraint firstItem="UUC-74-fsa" firstAttribute="top" secondItem="Trq-bz-kQT" secondAttribute="bottom" constant="6" id="8hA-N7-fkB"/>
<constraint firstItem="UUC-74-fsa" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="65" id="Bja-9z-dcO"/>
<constraint firstItem="SEO-0F-Irb" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="131" id="Cvk-mn-yKv"/>
<constraint firstItem="hZA-nj-Wmu" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="87" id="DqU-NP-4f5"/>
<constraint firstAttribute="trailing" secondItem="Trq-bz-kQT" secondAttribute="trailing" constant="65" id="GUO-SG-oNK"/>
<constraint firstItem="qAH-Fa-AmF" firstAttribute="top" secondItem="uJG-KF-a91" secondAttribute="bottom" constant="8" id="HbD-BO-bbP"/>
<constraint firstItem="ubQ-Za-dV7" firstAttribute="top" secondItem="uJG-KF-a91" secondAttribute="bottom" constant="1" id="LDG-vR-kTg"/>
<constraint firstItem="Pb5-1e-TXp" firstAttribute="top" secondItem="UUC-74-fsa" secondAttribute="bottom" constant="1" id="MiP-4J-kau"/>
<constraint firstItem="hZA-nj-Wmu" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="bjY-fC-f0d"/>
<constraint firstItem="Trq-bz-kQT" firstAttribute="top" secondItem="dR7-iu-Eup" secondAttribute="bottom" constant="1" id="bqX-bp-Y1W"/>
<constraint firstItem="uJG-KF-a91" firstAttribute="top" secondItem="SEO-0F-Irb" secondAttribute="bottom" constant="29" id="dgm-Ml-Hfb"/>
<constraint firstItem="qAH-Fa-AmF" firstAttribute="leading" secondItem="dR7-iu-Eup" secondAttribute="trailing" constant="17" id="hPp-7L-ChH"/>
<constraint firstAttribute="trailing" secondItem="ubQ-Za-dV7" secondAttribute="trailing" constant="65" id="iKP-5V-WP4"/>
<constraint firstItem="Pb5-1e-TXp" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="65" id="k2n-Mo-tk9"/>
<constraint firstItem="dR7-iu-Eup" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="66" id="kEf-x4-abN"/>
<constraint firstItem="Vxb-TL-wDd" firstAttribute="centerY" secondItem="b06-w9-r2g" secondAttribute="centerY" id="mR2-xW-ifS"/>
<constraint firstItem="b06-w9-r2g" firstAttribute="top" secondItem="hZA-nj-Wmu" secondAttribute="bottom" constant="62" id="pur-Ys-i5n"/>
<constraint firstItem="b06-w9-r2g" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="94" id="pxn-ec-ZyW"/>
<constraint firstItem="UUC-74-fsa" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="q9F-nT-aJr"/>
<constraint firstItem="SEO-0F-Irb" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="107" id="r8t-sA-k7V"/>
<constraint firstAttribute="trailing" secondItem="qAH-Fa-AmF" secondAttribute="trailing" constant="73" id="wRx-IO-sxn"/>
<constraint firstItem="uJG-KF-a91" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="66" id="zs7-sD-XZI"/>
<constraint firstItem="piO-PU-j8g" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="20" id="FeS-pw-yBz"/>
<constraint firstAttribute="bottom" secondItem="piO-PU-j8g" secondAttribute="bottom" id="LJj-gu-XvO"/>
<constraint firstItem="piO-PU-j8g" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="TBf-ZS-9tS"/>
<constraint firstAttribute="trailing" secondItem="piO-PU-j8g" secondAttribute="trailing" id="wPj-4k-nEv"/>
</constraints>
<viewLayoutGuide key="safeArea" id="7gZ-WS-Wjh"/>
<point key="canvasLocation" x="33.5" y="53.5"/>
</view>
</objects>
@@ -7,7 +7,8 @@
//
#import "GiGaBaseNavViewController.h"
#import "GiGaBaseViewController.h"
@interface GiGaUserLoginVC : UIViewController
@interface GiGaUserLoginVC : GiGaBaseViewController
@end
+14 -31
View File
@@ -48,10 +48,16 @@
NC_ADD_TARGET_NAME_OBJECT(self, @selector(WeiXinLongIn:), kWeiXinAuthrization_Success, nil)
NC_ADD_TARGET_NAME_OBJECT(self, @selector(userRegistSuccsessNoti:), kUserRegistSucccess, nil)
// if (![WXApi isWXAppInstalled]) {
// self.weiXinLoginBtn.hidden = YES;
// }
if (![WXApi isWXAppInstalled]) {
self.weiXinLoginBtn.hidden = YES;
}
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController.navigationBar setClearNav];
}
@@ -110,12 +116,6 @@
[self dismissViewControllerAnimated:YES completion:nil];
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController.navigationBar setClearNav];
}
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
if([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
@@ -133,7 +133,6 @@
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)forgetPassBtn:(id)sender {
@@ -167,13 +166,11 @@
GIGA_ShowToast(@"密码不能为空");
return;
}
// if (self.passwordTextField.text.length < =6) {
// GIGA_ShowToast(@"密码长度不能小于六位字符");
// return;
// }
if (self.passwordTextField.text.length <= 6) {
GIGA_ShowToast(@"密码长度不能小于六位字符");
return;
}
// [self dismissViewControllerAnimated:YES completion:nil];
[self loginWithAction:btn];
}
@@ -184,16 +181,6 @@
@"username":self.acountTextField.text,
@"password":self.passwordTextField.text
};
// GiGaBaseAPiRequest *loginApi = [GiGaBaseAPiRequest initWithRequestPath:@"sys/v1/login" method:RequestPostMethod parms:params];
//weakify(self);
// [loginApi requstDataWithResult:^(GiGaAPIResult *result) {
// GILog(@"**登陆***\n resultDic:%ld\n code:%@\n *******\n",(long)result.code,result.dic);
// if (result.success) {
// GILog(@"****登陆成功****");
// [self saveUserData];
// [self dismissViewControllerAnimated:YES completion:nil];
// }
// }];
[self.view makeToastActivity:CSToastPositionCenter];
NSString *url = [NSString stringWithFormat:@"%@sys/v1/login",[GiGaServerConfig getMainUrl]];
@@ -225,7 +212,6 @@
//埋点
[MobClick endEvent:MobClick_UserLogin];
[GiGaUserDefault saveUserId:@"123"];
}
#pragma mark - 微信登录
@@ -281,9 +267,6 @@
}
//接收注册成功通知
-(void)userRegistSuccsessNoti:(NSNotification *)noti{
@@ -292,6 +275,7 @@
//密码加密按钮
-(void)secretBtnAction:(UIButton *)btn{
btn.selected = !btn.selected;
if (btn.selected) {
//秘文
@@ -301,7 +285,6 @@
self.passwordTextField.secureTextEntry = NO;
[btn setImage:[UIImage imageNamed:@"btn_tab_desplay"] forState:UIControlStateNormal];
}
}
@end
@@ -7,7 +7,7 @@
//
#import <UIKit/UIKit.h>
#import "GiGaBaseViewController.h"
typedef NS_ENUM(NSInteger,WebSourceType)
{
WebSourceTypeLoacalHtml,
@@ -15,7 +15,7 @@ typedef NS_ENUM(NSInteger,WebSourceType)
};
@interface GiGaWebViewController : UIViewController
@interface GiGaWebViewController : GiGaBaseViewController
@property (nonatomic,strong) NSString *url;
@property (nonatomic,assign) WebSourceType souceType;
@@ -80,6 +80,7 @@
[self startTimer:btn];
[self requstCode:btn];
}
//计时
-(void)startTimer:(UIButton *)btn{
@@ -165,8 +166,8 @@
GIGA_WIndowTost(result.message);
[self.navigationController popViewControllerAnimated:YES];
}
}];
}
- (void)didReceiveMemoryWarning {
@@ -175,11 +176,11 @@
}
-(void)dealloc{
if (_timer) {
[_timer unfireTimer];
[_timer invalidate];
_timer = nil;
}
}
@@ -41,9 +41,9 @@
</constraints>
</view>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="短信验证码" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="nCj-Hg-8pQ">
<rect key="frame" x="65" y="162" width="148" height="51"/>
<rect key="frame" x="65" y="162" width="169" height="48"/>
<constraints>
<constraint firstAttribute="height" constant="51" id="bP2-dP-V9B"/>
<constraint firstAttribute="height" constant="48" id="bP2-dP-V9B"/>
</constraints>
<nil key="textColor"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="12"/>
@@ -63,18 +63,6 @@
<constraint firstAttribute="height" constant="1" id="pu6-ak-TJR"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Dv2-ja-F8y">
<rect key="frame" x="227" y="162" width="83" height="51"/>
<constraints>
<constraint firstAttribute="height" constant="51" id="bin-f7-lIk"/>
<constraint firstAttribute="width" constant="83" id="jyJ-IU-vK2"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="12"/>
<inset key="titleEdgeInsets" minX="-84" minY="0.0" maxX="0.0" maxY="0.0"/>
<state key="normal" title="发送验证码" image="btn_meaasag">
<color key="titleColor" red="0.60784313725490191" green="0.60784313725490191" blue="0.60784313725490191" alpha="1" colorSpace="calibratedRGB"/>
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="w3j-WU-gmW">
<rect key="frame" x="87" y="316" width="200" height="41"/>
<color key="backgroundColor" red="0.0" green="0.87058823529411766" blue="0.74117647058823533" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -95,17 +83,29 @@
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="12"/>
<textInputTraits key="textInputTraits" keyboardType="numbersAndPunctuation"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Dv2-ja-F8y">
<rect key="frame" x="234" y="161" width="76" height="48"/>
<constraints>
<constraint firstAttribute="height" constant="48" id="bin-f7-lIk"/>
<constraint firstAttribute="width" constant="76" id="jyJ-IU-vK2"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="12"/>
<inset key="titleEdgeInsets" minX="-77" minY="0.0" maxX="0.0" maxY="0.0"/>
<state key="normal" title="发送验证码" image="btn_meaasag">
<color key="titleColor" red="0.60784313725490191" green="0.60784313725490191" blue="0.60784313725490191" alpha="1" colorSpace="calibratedRGB"/>
</state>
</button>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="gY9-PP-yev" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="0wd-N9-CJi"/>
<constraint firstAttribute="trailing" secondItem="rm0-UH-T6r" secondAttribute="trailing" constant="65" id="3Ze-9p-DXQ"/>
<constraint firstItem="eTv-jk-ONL" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="65" id="3f8-py-rVY"/>
<constraint firstItem="rno-VM-u1V" firstAttribute="top" secondItem="nCj-Hg-8pQ" secondAttribute="bottom" constant="1" id="7B6-yw-Ang"/>
<constraint firstItem="rno-VM-u1V" firstAttribute="top" secondItem="nCj-Hg-8pQ" secondAttribute="bottom" constant="4" id="7B6-yw-Ang"/>
<constraint firstItem="MHD-nb-UXj" firstAttribute="width" secondItem="gY9-PP-yev" secondAttribute="width" id="9Rj-pz-EBS"/>
<constraint firstAttribute="trailing" secondItem="eTv-jk-ONL" secondAttribute="trailing" constant="65" id="9mt-NK-XDb"/>
<constraint firstItem="w3j-WU-gmW" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="87" id="Abo-oW-YM4"/>
<constraint firstItem="Dv2-ja-F8y" firstAttribute="leading" secondItem="nCj-Hg-8pQ" secondAttribute="trailing" constant="14" id="C7G-Au-fA7"/>
<constraint firstItem="Dv2-ja-F8y" firstAttribute="leading" secondItem="nCj-Hg-8pQ" secondAttribute="trailing" id="C7G-Au-fA7"/>
<constraint firstItem="eTv-jk-ONL" firstAttribute="top" secondItem="gY9-PP-yev" secondAttribute="bottom" constant="1" id="Esi-VW-e2G"/>
<constraint firstItem="gY9-PP-yev" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="65" id="GjR-Hw-LgY"/>
<constraint firstItem="nCj-Hg-8pQ" firstAttribute="leading" secondItem="gY9-PP-yev" secondAttribute="leading" id="K4P-aZ-p4J"/>
@@ -115,7 +115,7 @@
<constraint firstItem="rno-VM-u1V" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="65" id="aJl-ZC-hPs"/>
<constraint firstItem="Dv2-ja-F8y" firstAttribute="trailing" secondItem="gY9-PP-yev" secondAttribute="trailing" id="bbV-7x-WFt"/>
<constraint firstItem="nCj-Hg-8pQ" firstAttribute="top" secondItem="gY9-PP-yev" secondAttribute="bottom" constant="4" id="gP5-TX-MXq"/>
<constraint firstItem="Dv2-ja-F8y" firstAttribute="centerY" secondItem="nCj-Hg-8pQ" secondAttribute="centerY" id="jWN-Se-6P6"/>
<constraint firstItem="Dv2-ja-F8y" firstAttribute="centerY" secondItem="nCj-Hg-8pQ" secondAttribute="centerY" constant="-1.5" id="jWN-Se-6P6"/>
<constraint firstItem="MHD-nb-UXj" firstAttribute="top" secondItem="rno-VM-u1V" secondAttribute="bottom" constant="6" id="mrM-C1-VFv"/>
<constraint firstItem="gY9-PP-yev" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="107" id="qsl-vw-gFU"/>
<constraint firstItem="w3j-WU-gmW" firstAttribute="top" secondItem="rm0-UH-T6r" secondAttribute="bottom" constant="42" id="sFk-c0-xql"/>
+113 -45
View File
@@ -13,71 +13,131 @@
#import "GiGaCommentModel.h"
#import "LXDanMuManagerConfig.h"
#import "IQKeyboardManager.h"
#import <SocketIO/SocketIO-Swift.h>
#import "NSString+Unicode.h"
//弹幕控制器
@interface GiGaFlingCommitVC ()
@property (nonatomic,strong) GiGaFlyingCommitInputView *commitInputView;
@property (nonatomic,strong) SocketIOClient *client;
@property (nonatomic,strong) SocketManager *manager;
@end
@implementation GiGaFlingCommitVC
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
NC_ADD_TARGET_NAME_OBJECT(self, @selector(maskTimeEnd), kUserNoti_MASKEND, nil);
[self.view addSubview: self.commitInputView];
self.commitInputView.SendCommentHandler = ^(NSString *content) {
GILog(@"发送->:%@",content);
};
[[LXDanMuManager shareInstance] createDanmuWithTrackSpeedArray:@[@1.00,@1.00,@3.00,@4.00] centerY:self.view.frame.size.height / 4 trackWidth:self.view.frame.size.width showInView:self.view];
[[LXDanMuManager shareInstance] start];
[NSTimer scheduledTimerWithTimeInterval:2 target:self selector:@selector(danmuAction) userInfo:nil repeats:YES];
}
-(void)danmuAction{
[self showFlyingCommit];
}
- (GiGaFlyingCommitInputView *)commitInputView{
if (!_commitInputView) {
// _commitInputView = [[GiGaFlyingCommitInputView alloc] initWithFrame:CGRectMake(0,self.view.frame.size.height - 60 , KMainW, 60)];
_commitInputView = [[GiGaFlyingCommitInputView alloc] initWithFrame:self.view.bounds];
[_commitInputView setPalceholderText:@"请输入弹幕"];
}
return _commitInputView;
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
NC_ADD_TARGET_NAME_OBJECT(self, @selector(maskTimeEnd), kUserNoti_MASKEND, nil);
[IQKeyboardManager sharedManager].enable = NO;
[[IQKeyboardManager sharedManager] setEnableAutoToolbar:NO];
}
- (void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
NC_REMOVE_NAME(self, kUserNoti_MASKEND, nil);
[IQKeyboardManager sharedManager].enable = YES;
[[IQKeyboardManager sharedManager] setEnableAutoToolbar:YES];
}
-(void)showFlyingCommit{
NSArray *classArray = @[@"GiGaCommentView",@"GiGaCommentView"];
NSArray *nameArray = @[@"mc子龙",@"小明",@"赵四",@"狂小狗",@"葬爱"];
NSArray *msgArray = @[@"老铁666",@"主播,多少礼物给卡黄啊?",@"文明观球,大家有秩序排队观看,不要着急",@"主播,我报警啦",@"就是个萨比,还扮滴酷酷滴aaaaa"];
NSArray *avatarArray = @[@"home_login_qq_color",@"home_login_qq_color",@"home_login_qq_color",@"home_login_qq_color",@"home_login_qq_color"];
int classRandomIndex = arc4random() % 2;
int nameRandomIndex = arc4random() % 5;
int msgRandomIndex = arc4random() % 5;
int avatarRandomIndex = arc4random() % 5;
- (void)viewDidLoad {
GiGaCommentModel *model = [[GiGaCommentModel alloc]init];
model.userName = nameArray[nameRandomIndex];
model.msg = msgArray[msgRandomIndex];
model.userAvatar = avatarArray[avatarRandomIndex];
[super viewDidLoad];
// Do any additional setup after loading the view.
[self.view addSubview: self.commitInputView];
weakify(self);
self.commitInputView.SendCommentHandler = ^(NSString *content) {
GILog(@"发送->:%@",content);
NSArray *arr = @[@{
@"content":content,
@"room":@"",
@"sendUserName":@"lianxiang"
}];
[weakSelf.client emit:@"talk" with:arr];
};
//开启弹幕
[[LXDanMuManager shareInstance] createDanmuWithTrackSpeedArray:@[@1.00,@1.00,@3.00,@4.00] centerY:KMainH / 4 trackWidth:KMainW showInView:self.view];
[[LXDanMuManager shareInstance] start];
//socket
[self connetction];
}
-(void)connetction{
NSURL* url = [[NSURL alloc] initWithString:@"http://wsyts.s1.natapp.cc"];
// NSDictionary* headers = @{@"EncodeUTF8":@YES};
SocketManager *manager = [[SocketManager alloc] initWithSocketURL:url config:@{@"log": @NO, @"forcePolling": @YES,@"connectParams":@{@"token":@""},@"doubleEncodeUTF8":@YES}];
_manager = manager;
_client = manager.defaultSocket;
[self.manager connect];
weakify(self);
[self.client on:@"connect" callback:^(NSArray* data, SocketAckEmitter* ack) {
NSLog(@"*************\n\niOS客户端上线\n\n*************");
}];
[self.client on:@"connectedSocket" callback:^(NSArray * _Nonnull event, SocketAckEmitter * _Nonnull ack) {
NSLog(@"connectedSocket:%@",event);
}];
[self.client on:@"onTalk" callback:^(NSArray * _Nonnull envent, SocketAckEmitter * _Nonnull ack) {
NSString *json =envent[0];
NSLog(@"callback json***:%@",json);
NSDictionary *dic = [GiGaHelper dictionaryWithJsonString:json];
if (dic == nil) {
NSLog(@"解析失败");
}else{
GiGaCommentModel *commentModel = [[GiGaCommentModel alloc] initWithDictionary:dic error:nil];
GILog(@"接收->:%@",[dic[@"content"] replaceUnicode:dic[@"content"]]);
[weakSelf showDanMuWith:commentModel];
}
}];
[self.client on:@"disconnect" callback:^(NSArray * _Nonnull event, SocketAckEmitter * _Nonnull ack) {
NSLog(@"*************\n\niOS客户端下线\n\n*************%@",event?event[0]:@"");
}];
[self.client on:@"error" callback:^(NSArray * _Nonnull event, SocketAckEmitter * _Nonnull ack) {
// NSString *htmlString =event[0];
// htmlString = [self htmlEntityDecode:htmlString];
//
// UIWebView * webView = [[UIWebView alloc]initWithFrame:CGRectMake(20, 300, self.view.frame.size.width - 40, 400)];
// [webView loadHTMLString:htmlString baseURL:nil];
// [self.view addSubview:webView];
//
// NSLog(@"*************\n\n%@\n\n*************",event?event[0]:@"");
GILog(@"请求超时");
}];
}
- (GiGaFlyingCommitInputView *)commitInputView{
if (!_commitInputView) {
_commitInputView = [[GiGaFlyingCommitInputView alloc] initWithFrame:self.view.bounds];
[_commitInputView setPalceholderText:@"请输入弹幕"];
}
return _commitInputView;
}
//弹幕插入
-(void)showDanMuWith:(GiGaCommentModel *)model{
NSArray *classArray = @[@"GiGaCommentView",@"GiGaCommentView"];
int classRandomIndex = arc4random() % 2;
GiGaCommentView *customView = [[NSClassFromString(classArray[classRandomIndex]) alloc] initWithMsgModel:model height:TRACK_HEIGHT];
[[LXDanMuManager shareInstance] appendDanMuWithCustomView:customView toTrackIndex:-1];
}
@@ -90,11 +150,19 @@
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(void)dealloc{
NC_REMOVE_NAME(self, kUserNoti_MASKEND, nil);
NSLog(@"dealloc");
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
[self.manager disconnectSocket:self.client];
[self.manager disconnect];
[self.client disconnect];
self.client = nil;
self.manager = nil;
[self dismissViewControllerAnimated:YES completion:nil];
}
@end
@@ -34,64 +34,45 @@
}
@property(nonatomic,strong)MaskViewBootomWaringView *waringView;
@property(nonatomic,strong)UILabel *descLabl;
@property(nonatomic,strong)UIView *descBackView;
//@property (nonatomic,strong) GiGaFlyingCommitInputView *commitInputView;
@property(nonatomic,strong) UIImageView *maskImageView;
@property(nonatomic,strong) UIImageView *faceView;
//@property(nonatomic,strong) UIDynamicAnimator *animator;
//@property(nonatomic,strong) UIAttachmentBehavior *attachmentBehavior;
@property(nonatomic) CGPoint attachPoint;
@property(nonatomic,strong) MaskTimeCircularProgressView *cicleProgressView;
@property(nonatomic,strong) UIImageView *swipeGaurdimagView;
@property(nonatomic,strong) UIButton *startMaskButton;
@property(nonatomic,strong) UIButton *startTestButton;
@end
@implementation GiGaMaskTaskViewController
//提示label
- (UILabel *)descLabl{
if(!_descLabl){
_descLabl = [[UILabel alloc] init];
_descLabl.text = @"请点击或按住面膜上滑敷到脸部开始倒计时";
_descLabl.textAlignment = NSTextAlignmentCenter;
_descLabl.numberOfLines = 2;
_descLabl.textColor = GIGARGB(89, 216, 197, 1);
_descLabl.font = [UIFont fontWithName:GIGA_FONTNAME size:11];
}
return _descLabl;
}
- (UIView *)descBackView{
if(!_descBackView){
_descBackView = [[UIView alloc] init];
_descBackView.layer.borderWidth = 1;
_descBackView.layer.borderColor = GIGARGB(120, 217, 202, 1).CGColor;
_descBackView.layer.masksToBounds = YES;
_descBackView.layer.cornerRadius = 1;
}
return _descBackView;
}
#pragma mark - property
//面膜
- (UIImageView *)maskImageView{
if (!_maskImageView) {
_maskImageView = [[UIImageView alloc] init];
_maskImageView.userInteractionEnabled = YES;
//_maskImageView.backgroundColor = [UIColor purpleColor];
_maskImageView.image = [UIImage imageNamed:@"img_bg"];
UIPanGestureRecognizer *pangesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureAction:)];
[_maskImageView addGestureRecognizer:pangesture];
_maskImageView.image = [UIImage imageNamed:@"img_mask"];
UISwipeGestureRecognizer * upSwipeGesture = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(maskupSwipeGesture)];
[upSwipeGesture setDirection:(UISwipeGestureRecognizerDirectionUp)];
[_maskImageView addGestureRecognizer:upSwipeGesture];
UITapGestureRecognizer *tapgesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(maskTapAction)];
[_maskImageView addGestureRecognizer:tapgesture];
}
return _maskImageView;
}
//人脸
- (UIImageView *)faceView{
if (!_faceView) {
_faceView = [[UIImageView alloc] init];
//_faceView.backgroundColor = [UIColor lightGrayColor];
_faceView.userInteractionEnabled = YES;
_faceView.image = [UIImage imageNamed:@"img_bg_head"];
_faceView.image = [UIImage imageNamed:@"bg_img_face"];
}
return _faceView;
}
@@ -107,6 +88,40 @@
}
return _cicleProgressView;
}
//⬆️
- (UIImageView *)swipeGaurdimagView{
if (!_swipeGaurdimagView) {
_swipeGaurdimagView = [[UIImageView alloc] init];
_swipeGaurdimagView.image = [UIImage imageNamed:@"mask_bg_up"];
}
return _swipeGaurdimagView;
}
//开始面膜
- (UIButton *)startMaskButton{
if (!_startMaskButton) {
_startMaskButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_startMaskButton setBackgroundImage:[UIImage imageNamed:@"btn_start_mask"] forState:UIControlStateNormal];
NSAttributedString *title = [GiGaHelper stringWithText:@"开始敷面膜" textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTMEDIUM(13) leterSpace:0];
[_startMaskButton setAttributedTitle:title forState:UIControlStateNormal];
[_startMaskButton addTarget:self action:@selector(startMaskButtonAction) forControlEvents:UIControlEventTouchUpInside];
}
return _startMaskButton;
}
//开始测试
- (UIButton *)startTestButton{
if (!_startTestButton) {
_startTestButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_startTestButton setBackgroundImage:[UIImage imageNamed:@"btn_start_test"] forState:UIControlStateNormal];
NSAttributedString *title = [GiGaHelper stringWithText:@"测试肤质" textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(18) leterSpace:0];
[_startTestButton setAttributedTitle:title forState:UIControlStateNormal];
[_startTestButton addTarget:self action:@selector(testBtnAcion:) forControlEvents:UIControlEventTouchUpInside];
}
return _startTestButton;
}
//底部提示栏
- (MaskViewBootomWaringView *)waringView{
@@ -127,80 +142,14 @@
}else{
GiGaFlingVC.modalPresentationStyle = UIModalPresentationCurrentContext;
}
GiGaFlingVC.view.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
GiGaFlingVC.view.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.3];
[self presentViewController:GiGaFlingVC animated:NO completion:nil];
}
//滑动手势
-(void)panGestureAction:(UIPanGestureRecognizer *)pan{
CGPoint panLocation = [pan locationInView:self.view];
NSLog(@"panlocation.y:%f",panLocation.y);
if (pan.state == UIGestureRecognizerStateBegan) {
[self animaMask];
}else if (pan.state == UIGestureRecognizerStateChanged){
}else if (pan.state == UIGestureRecognizerStateEnded){
}else{
}
}
#pragma mark -开始面膜时间动画
-(void)animaMask{
self.descLabl.hidden = YES;
self.descBackView.hidden = YES;
[self.view layoutIfNeeded];
[UIView animateWithDuration:1.0 animations:^{
[self.maskImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.attachPoint.y - 118);
}];
[self.faceView mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.attachPoint.y -174);
}];
[self.view layoutIfNeeded];
} completion:^(BOOL finished) {
self.cicleProgressView.hidden = NO;
self.maskImageView.userInteractionEnabled = NO;
//开始面膜时间
[self startMaskTime];
}];
}
#pragma mark 面膜时间结束复原动画
-(void)endMaskAnimation{
self.cicleProgressView.hidden = YES;
self.descLabl.hidden = NO;
self.descBackView.hidden = NO;
[self.view layoutIfNeeded];
[UIView animateWithDuration:1.0 animations:^{
[self.maskImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(314 + PhoneX_TopMargin);
}];
[self.faceView mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(103 + PhoneX_TopMargin);
}];
[self.view layoutIfNeeded];
} completion:^(BOOL finished) {
self.maskImageView.userInteractionEnabled = YES;
}];
}
#pragma mark - 生命周期
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
}
-(void)viewDidAppear:(BOOL)animated{
@@ -233,49 +182,121 @@
}
#pragma mark - 响应事件
#pragma mark 上滑动手势
-(void)maskupSwipeGesture{
[self animaMask];
}
#pragma mark 点击手势
-(void)maskTapAction{
[self animaMask];
}
#pragma mark 点击测试按钮
-(void)startMaskButtonAction{
[self animaMask];
}
#pragma mark - 开始面膜时间动画
-(void)animaMask{
self.swipeGaurdimagView.hidden = YES;
self.startMaskButton.hidden = YES;
self.startTestButton.hidden = YES;
[self.view layoutIfNeeded];
[UIView animateWithDuration:1.0 animations:^{
[self.maskImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.attachPoint.y - 87);
}];
[self.faceView mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.attachPoint.y -124);
}];
[self.view layoutIfNeeded];
} completion:^(BOOL finished) {
self.cicleProgressView.hidden = NO;
self.maskImageView.userInteractionEnabled = NO;
//开始面膜时间
[self startMaskTime];
}];
}
#pragma mark 面膜时间结束复原动画
-(void)endMaskAnimation{
self.cicleProgressView.hidden = YES;
self.swipeGaurdimagView.hidden = NO;
self.startMaskButton.hidden = NO;
self.startTestButton.hidden = NO;
[self.view layoutIfNeeded];
[UIView animateWithDuration:1.0 animations:^{
[self.maskImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(254 + PhoneX_TopMargin);
}];
[self.faceView mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(91 + PhoneX_TopMargin);
}];
[self.view layoutIfNeeded];
} completion:^(BOOL finished) {
self.maskImageView.userInteractionEnabled = YES;
}];
}
#pragma mark 布局
-(void)initUI{
self.view.backgroundColor = GIGARGB(56, 56, 56, 1);
self.view.backgroundColor = GIGA_MAIN_BGCOLOR;
[self.view addSubview:self.maskImageView];
[self.view addSubview:self.faceView];
[self.view bringSubviewToFront:self.maskImageView];
[self.view addSubview:self.descBackView];
[self.view addSubview:self.swipeGaurdimagView];
[self.view addSubview:self.startMaskButton];
[self.view addSubview:self.startTestButton];
[self.view addSubview:self.cicleProgressView];
//face
[self.faceView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view.mas_top).offset(103 + PhoneX_TopMargin);
make.left.mas_equalTo(self.view.mas_centerX).offset(-69);
make.size.mas_equalTo(CGSizeMake(138, 174));
make.top.mas_equalTo(self.view.mas_top).offset(91 + PhoneX_TopMargin);
make.size.mas_equalTo(CGSizeMake(99, 124));
make.centerX.mas_equalTo(self.view.mas_centerX);
}];
//mask
[self.maskImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view.mas_top).offset(314 + PhoneX_TopMargin);
make.left.mas_equalTo(self.view.mas_centerX).offset(-51);
make.size.mas_equalTo(CGSizeMake(102, 118));
}];
//描述
[self.descBackView mas_makeConstraints:^(MASConstraintMaker *make){
make.top.mas_equalTo(500 + PhoneX_TopMargin);
make.width.mas_equalTo(149);
make.height.mas_equalTo(45);
make.top.mas_equalTo(self.view.mas_top).offset(254 + PhoneX_TopMargin);
make.size.mas_equalTo(CGSizeMake(72, 87));
make.centerX.mas_equalTo(self.view.mas_centerX);
}];
[self.descBackView addSubview:self.descLabl];
[self.descLabl mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(121);
make.height.mas_equalTo(32);
make.center.mas_equalTo(self.descBackView.center);
//up
[self.swipeGaurdimagView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view.mas_top).offset(368);
make.width.and.height.mas_equalTo(20);
make.centerX.mas_equalTo(self.view.mas_centerX);
}];
//startMask
[self.startMaskButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view.mas_top).offset(412);
make.size.mas_equalTo(CGSizeMake(117, 25));
make.centerX.mas_equalTo(self.view.mas_centerX);
}];
//startTest
[self.startTestButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view.mas_top).offset(486);
make.size.mas_equalTo(CGSizeMake(132, 41));
make.centerX.mas_equalTo(self.view.mas_centerX);
}];
// UIButton *testBtn = [UIButton buttonWithType:UIButtonTypeCustom];
@@ -403,6 +424,8 @@
#pragma mark 开始测试
-(void)testBtnAcion:(UIButton *)btn{
[self createInputView];
return;
BOOL isUserLogin = [GiGaUserDefault isUserLogin];
@@ -478,17 +501,18 @@
#pragma mark - setUpNav
-(void)setUpNav{
//leftItem
UIButton *leftBtn = [UIButton buttonWithType:UIButtonTypeCustom];
leftBtn.frame = CGRectMake(0, 0, 40, 40);
leftBtn.backgroundColor = [UIColor redColor];
[leftBtn setImage:[UIImage imageNamed:@"btn_back"] forState:UIControlStateNormal];
[leftBtn addTarget:self action:@selector(leftBtnAction) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:leftBtn];
// UIButton *leftBtn = [UIButton buttonWithType:UIButtonTypeCustom];
// leftBtn.frame = CGRectMake(0, 0, 40, 40);
// leftBtn.backgroundColor = [UIColor redColor];
// [leftBtn setImage:[UIImage imageNamed:@"btn_back"] forState:UIControlStateNormal];
// [leftBtn addTarget:self action:@selector(leftBtnAction) forControlEvents:UIControlEventTouchUpInside];
// self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:leftBtn];
//rightItem
UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
rightBtn.frame = CGRectMake(0, 0, 40, 40);
rightBtn.backgroundColor = [UIColor blueColor];
[rightBtn setImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
//rightBtn.backgroundColor = [UIColor blueColor];
[rightBtn setImage:[UIImage imageNamed:@"nav_circle_avatar"] forState:UIControlStateNormal];
[rightBtn addTarget:self action:@selector(rightBtnAction) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn];
@@ -18,7 +18,6 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
//self.view.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
[self creatUI];
+5 -4
View File
@@ -10,9 +10,10 @@
#import "JSONModel.h"
@interface GiGaCommentModel :JSONModel
@property (nonatomic,copy) NSString *userName;
@property (nonatomic,copy) NSString *userLevel;
@property (nonatomic,copy) NSString *msg;
@property (nonatomic,copy) NSString *userAvatar;
@property (nonatomic,copy) NSString *color;
@property (nonatomic,copy) NSString *content;
@property (nonatomic,copy) NSString *room;
@property (nonatomic,copy) NSString *sendUserHeadImg;
@property (nonatomic,copy) NSString *sendUserName;
@end
+12 -5
View File
@@ -8,6 +8,9 @@
#import "GiGaCommentView.h"
#import "Masonry.h"
#import "UIImageView+WebCache.h"
#import "NSString+Unicode.h"
@interface GiGaCommentView()
@property(nonatomic,strong) UILabel *userName;
@property(nonatomic,strong) UIImageView *userAvtar;
@@ -38,12 +41,10 @@
-(void)initUI{
UIImageView *avatar = [[UIImageView alloc] init];
avatar.image = [UIImage imageNamed:@"home_login_qq_color"];
//avatar.frame = CGRectMake(3, 3, self.frame.size.height - 6, self.frame.size.height - 6);
avatar.layer.masksToBounds = YES;
avatar.layer.cornerRadius = 15;
[self addSubview:avatar];
avatar.image = [UIImage imageNamed:_msgModel.userAvatar];
[avatar sd_setImageWithURL:[NSURL URLWithString:_msgModel.sendUserHeadImg] placeholderImage:[UIImage imageNamed:@"nav_circle_avatar"]];
self.userAvtar = avatar;
[self.userAvtar mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(30);
@@ -57,7 +58,10 @@
namelabel.font = [UIFont systemFontOfSize:14];
namelabel.textColor = [UIColor blackColor];
//namelabel.frame= CGRectMake(CGRectGetMaxX(avatar.frame) + 5, 4, namelabel.frame.size.width, namelabel.frame.size.height);
namelabel.text = _msgModel.userName;
namelabel.text = @"用户名";
if (_msgModel.sendUserName && _msgModel.sendUserName.length > 0) {
namelabel.text = [_msgModel.sendUserName replaceUnicode:_msgModel.sendUserName];
}
[namelabel sizeToFit];
self.userName = namelabel;
[self addSubview:self.userName];
@@ -73,7 +77,10 @@
msglabel.textColor = [UIColor blackColor];
//msglabel.frame= CGRectMake(namelabel.frame.origin.x, CGRectGetMaxY(avatar.frame) - msglabel.frame.size.height - namelabel.frame.origin.y, msglabel.frame.size.width, msglabel.frame.size.height);
msglabel.text = _msgModel.msg;
msglabel.text = @"信息内容";
if (_msgModel.content && _msgModel.content.length > 0) {
msglabel.text = [_msgModel.content replaceUnicode:_msgModel.content];
}
self.msg = msglabel;
[msglabel sizeToFit];
[self addSubview:self.msg];
@@ -81,7 +81,6 @@
_countLabel.text = @"00:00";
_countLabel.font = [UIFont fontWithName:GIGA_FONTBOLD size:22];
}
return _countLabel;
}
@@ -15,7 +15,7 @@
self = [super initWithFrame:frame];
if (self) {
self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.8];
self.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.2];
[self setUpUI];
}
@@ -24,26 +24,17 @@
-(void)setUpUI{
UIImageView *iconImg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@""]];
iconImg.backgroundColor = [UIColor redColor];
[self addSubview:iconImg];
[iconImg mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.and.height.mas_equalTo(40);
make.left.mas_equalTo(10);
make.centerY.mas_equalTo(self.mas_centerY);
}];
UILabel *waringLabel = [[UILabel alloc] init];
waringLabel.text = @"爱滴,请您务必要开启手机声音哦";
waringLabel.text = @"♥️ 亲,请您务必要开启手机声音哦~";
waringLabel.textColor = [UIColor whiteColor];
waringLabel.textAlignment = NSTextAlignmentCenter;
waringLabel.font = [UIFont systemFontOfSize:12];
waringLabel.font = GIGA_TEXTFONTMEDIUM(14);
[self addSubview:waringLabel];
[waringLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.mas_left).offset(40);
make.left.mas_equalTo(self.mas_left).offset(10);
make.right.mas_equalTo(self.mas_right).offset(-40);
make.centerY.mas_equalTo(self.mas_centerY);
}];
+4 -2
View File
@@ -16,9 +16,8 @@
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor purpleColor];
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
@@ -29,5 +28,8 @@
// Dispose of any resources that can be recreated.
}
- (UIStatusBarStyle)preferredStatusBarStyle{
return UIStatusBarStyleLightContent;
}
@end