This commit is contained in:
lianxiang 2018-09-29 20:12:56 +08:00
parent cb0accdb66
commit fc47921130
99 changed files with 1635 additions and 563 deletions

View File

@ -46,6 +46,10 @@
834415F6215B89A300A6D906 /* MaskTimeTopAnimationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 834415F5215B89A300A6D906 /* MaskTimeTopAnimationView.m */; };
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 */; };
834BDA48215C7D10001E1DB7 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 834BDA47215C7D0F001E1DB7 /* InfoPlist.strings */; };
834DA5A5215F5F3B003FC4C6 /* ShareViewSystemImageHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 834DA5A4215F5F3B003FC4C6 /* ShareViewSystemImageHelper.m */; };
834DA5A8215F5FE0003FC4C6 /* ShareCustomIamgeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 834DA5A7215F5FE0003FC4C6 /* ShareCustomIamgeModel.m */; };
834DA5AB215F6840003FC4C6 /* JobModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 834DA5AA215F6840003FC4C6 /* JobModel.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 */; };
835060A9212D38EE007E6220 /* GiGaStartAdView.m in Sources */ = {isa = PBXBuildFile; fileRef = 835060A8212D38EE007E6220 /* GiGaStartAdView.m */; };
@ -237,7 +241,6 @@
83C78A192159D74D0083DDD9 /* UIImage+LogoQrCode.m in Sources */ = {isa = PBXBuildFile; fileRef = 83C78A182159D74D0083DDD9 /* UIImage+LogoQrCode.m */; };
83C78A1C2159DD920083DDD9 /* UIImage+ShotImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 83C78A1B2159DD920083DDD9 /* UIImage+ShotImage.m */; };
83D3832D215A2CF5009E8669 /* MaskHistryRecord.m in Sources */ = {isa = PBXBuildFile; fileRef = 83D3832C215A2CF5009E8669 /* MaskHistryRecord.m */; };
83E40B2B21218B6F008149C4 /* GiGaExercisesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83E40B2A21218B6F008149C4 /* GiGaExercisesViewController.m */; };
83E40B2F21218BA0008149C4 /* GiGaUserViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83E40B2E21218BA0008149C4 /* GiGaUserViewController.m */; };
/* End PBXBuildFile section */
@ -326,6 +329,13 @@
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>"; };
834BDA47215C7D0F001E1DB7 /* InfoPlist.strings */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; path = InfoPlist.strings; sourceTree = "<group>"; };
834DA5A3215F5F3B003FC4C6 /* ShareViewSystemImageHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShareViewSystemImageHelper.h; sourceTree = "<group>"; };
834DA5A4215F5F3B003FC4C6 /* ShareViewSystemImageHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShareViewSystemImageHelper.m; sourceTree = "<group>"; };
834DA5A6215F5FE0003FC4C6 /* ShareCustomIamgeModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShareCustomIamgeModel.h; sourceTree = "<group>"; };
834DA5A7215F5FE0003FC4C6 /* ShareCustomIamgeModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShareCustomIamgeModel.m; sourceTree = "<group>"; };
834DA5A9215F6840003FC4C6 /* JobModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JobModel.h; sourceTree = "<group>"; };
834DA5AA215F6840003FC4C6 /* JobModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JobModel.m; sourceTree = "<group>"; };
835060A0212D1225007E6220 /* GiGaMeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaMeViewController.h; sourceTree = "<group>"; };
835060A1212D1225007E6220 /* GiGaMeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaMeViewController.m; sourceTree = "<group>"; };
835060A3212D2321007E6220 /* GIGA.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = GIGA.entitlements; sourceTree = "<group>"; };
@ -667,8 +677,6 @@
83C78A1B2159DD920083DDD9 /* UIImage+ShotImage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIImage+ShotImage.m"; sourceTree = "<group>"; };
83D3832B215A2CF5009E8669 /* MaskHistryRecord.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MaskHistryRecord.h; sourceTree = "<group>"; };
83D3832C215A2CF5009E8669 /* MaskHistryRecord.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MaskHistryRecord.m; sourceTree = "<group>"; };
83E40B2921218B6F008149C4 /* GiGaExercisesViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaExercisesViewController.h; sourceTree = "<group>"; };
83E40B2A21218B6F008149C4 /* GiGaExercisesViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaExercisesViewController.m; sourceTree = "<group>"; };
83E40B2D21218BA0008149C4 /* GiGaUserViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaUserViewController.h; sourceTree = "<group>"; };
83E40B2E21218BA0008149C4 /* GiGaUserViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaUserViewController.m; sourceTree = "<group>"; };
B14B65914FBF61910191D7A8 /* Pods_GIGA.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GIGA.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@ -852,6 +860,8 @@
8376B8222154927300AB79F8 /* GIGaMaskShareViewController.m */,
8376B8342154C74300AB79F8 /* ShareViewController.h */,
8376B8352154C74300AB79F8 /* ShareViewController.m */,
834DA5A3215F5F3B003FC4C6 /* ShareViewSystemImageHelper.h */,
834DA5A4215F5F3B003FC4C6 /* ShareViewSystemImageHelper.m */,
);
path = Controller;
sourceTree = "<group>";
@ -863,6 +873,8 @@
8392900E2134FA0A0077D2E8 /* GiGaCommentModel.m */,
834415F1215B5F8200A6D906 /* GiGaShareModel.h */,
834415F2215B5F8200A6D906 /* GiGaShareModel.m */,
834DA5A6215F5FE0003FC4C6 /* ShareCustomIamgeModel.h */,
834DA5A7215F5FE0003FC4C6 /* ShareCustomIamgeModel.m */,
);
path = Model;
sourceTree = "<group>";
@ -959,6 +971,7 @@
8340BFA7213E6532008F22E4 /* Localizable */,
8361B3D8212155C300238FEB /* main.m */,
8361B3FB21215BE900238FEB /* GIGA.pch */,
834BDA47215C7D0F001E1DB7 /* InfoPlist.strings */,
);
path = GIGA;
sourceTree = "<group>";
@ -1051,7 +1064,6 @@
835060AE212D5423007E6220 /* AppAD */,
83E40B3021219078008149C4 /* Mask */,
83E40B2C21218B7E008149C4 /* LogIn */,
8361B42521217FC000238FEB /* GiGaExercises */,
8361B42421217F6000238FEB /* Me */,
);
path = Modules;
@ -1076,39 +1088,6 @@
path = Me;
sourceTree = "<group>";
};
8361B42521217FC000238FEB /* GiGaExercises */ = {
isa = PBXGroup;
children = (
8361B4282121807100238FEB /* Controller */,
8361B4272121806500238FEB /* View */,
8361B4262121805800238FEB /* Model */,
);
path = GiGaExercises;
sourceTree = "<group>";
};
8361B4262121805800238FEB /* Model */ = {
isa = PBXGroup;
children = (
);
path = Model;
sourceTree = "<group>";
};
8361B4272121806500238FEB /* View */ = {
isa = PBXGroup;
children = (
);
path = View;
sourceTree = "<group>";
};
8361B4282121807100238FEB /* Controller */ = {
isa = PBXGroup;
children = (
83E40B2921218B6F008149C4 /* GiGaExercisesViewController.h */,
83E40B2A21218B6F008149C4 /* GiGaExercisesViewController.m */,
);
path = Controller;
sourceTree = "<group>";
};
8361B4292121809A00238FEB /* Model */ = {
isa = PBXGroup;
children = (
@ -1120,6 +1099,8 @@
83A1DDB121574807006DE881 /* GIGaFeedKind.m */,
83D3832B215A2CF5009E8669 /* MaskHistryRecord.h */,
83D3832C215A2CF5009E8669 /* MaskHistryRecord.m */,
834DA5A9215F6840003FC4C6 /* JobModel.h */,
834DA5AA215F6840003FC4C6 /* JobModel.m */,
);
path = Model;
sourceTree = "<group>";
@ -1850,6 +1831,7 @@
838762E8214B9FA60039D241 /* GIGaUserCityViewCell.xib in Resources */,
834415EB215B4E6F00A6D906 /* HistoryNoDataViewCell.xib in Resources */,
8342FD8B2151095100D141F4 /* AppVersionLogoCell.xib in Resources */,
834BDA48215C7D10001E1DB7 /* InfoPlist.strings in Resources */,
8382DFEF21564A1F00BBA5A5 /* photopicker_back.png in Resources */,
83BFAE68213CCF10004EF801 /* GiGaMineUserViewCell.xib in Resources */,
8376B8202154913E00AB79F8 /* city.json in Resources */,
@ -1993,6 +1975,7 @@
8361B3CE212155C200238FEB /* ViewController.m in Sources */,
8361B4382121847600238FEB /* UINavigationBar+Custom.m in Sources */,
83BFAE6C213CD0E3004EF801 /* GiGaMineInfoViewCell.m in Sources */,
834DA5A8215F5FE0003FC4C6 /* ShareCustomIamgeModel.m in Sources */,
8376B8402154CEB200AB79F8 /* MaskShareTimeMidViewCell.m in Sources */,
8390116B214E20B2004CA790 /* LYSDateContentView.m in Sources */,
83BC8A872148BE8A00820437 /* NYPopover.m in Sources */,
@ -2107,14 +2090,15 @@
835147312151E4EF00B25A88 /* GIGaAboutUsVC.m in Sources */,
8376B8282154A0A200AB79F8 /* MaskTimeEndViewImgaeCell.m in Sources */,
83901174214E20B2004CA790 /* LYSDateIndicatorViewController.m in Sources */,
83E40B2B21218B6F008149C4 /* GiGaExercisesViewController.m in Sources */,
8390117B214E20B2004CA790 /* LYSDatePickerHeaderView.m in Sources */,
838762E7214B9FA60039D241 /* GIGaUserCityViewCell.m in Sources */,
8342FD822150FA1500D141F4 /* AppVersionDescCell.m in Sources */,
834DA5AB215F6840003FC4C6 /* JobModel.m in Sources */,
83BFAE77213CDE91004EF801 /* GiGaSettingsViewCell.m in Sources */,
83835BA7212E4748001480F2 /* MAssaageCenterCell.m in Sources */,
836EE5D42136454500F0ABB2 /* RegistGetSMSCodeRequest.m in Sources */,
8361B42E2121812000238FEB /* GiGaServerConfig.m in Sources */,
834DA5A5215F5F3B003FC4C6 /* ShareViewSystemImageHelper.m in Sources */,
838762DD214B9F140039D241 /* GIGaUserWeChatViewCell.m in Sources */,
8382DFA72156247F00BBA5A5 /* GiGaFeedLeiIingViewCell.m in Sources */,
8382DFA12155F68800BBA5A5 /* MaskActionSheetViewCell.m in Sources */,

View File

@ -6,7 +6,7 @@
#import "AppDelegate+GiGaConfig.h"
#import "GiGaServerConfig.h"
#import "GiGaUserViewController.h"
#import "GiGaExercisesViewController.h"
#import "GiGaBaseNavViewController.h"
#import "GiGaMaskTaskViewController.h"
#import "GiGaUserDefault.h"
@ -18,13 +18,13 @@
-(void)setupTabBarController{
GiGaExercisesViewController *exerciseVC = [[GiGaExercisesViewController alloc] init];
GiGaBaseNavViewController *exerciseNav =[[GiGaBaseNavViewController alloc] initWithRootViewController:exerciseVC];
exerciseNav.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor blackColor]};
exerciseNav.title = @"测试";
exerciseNav.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"测试"
image:nil
selectedImage:nil];
// GiGaExercisesViewController *exerciseVC = [[GiGaExercisesViewController alloc] init];
// GiGaBaseNavViewController *exerciseNav =[[GiGaBaseNavViewController alloc] initWithRootViewController:exerciseVC];
// exerciseNav.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor blackColor]};
// exerciseNav.title = @"测试";
// exerciseNav.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"测试"
// image:nil
// selectedImage:nil];
GiGaMaskTaskViewController *maskVC = [[GiGaMaskTaskViewController alloc] init];
GiGaBaseNavViewController *maskNav =[[GiGaBaseNavViewController alloc] initWithRootViewController:maskVC];
@ -43,7 +43,7 @@
[[UITabBar appearance] setTintColor:GIGARGB(70, 70, 70, 1)];
self.rootTabBarVC = [[UITabBarController alloc] init];
self.rootTabBarVC.viewControllers = @[exerciseNav,maskNav,userNav];
self.rootTabBarVC.viewControllers = @[maskNav,userNav];
[self initTabItems];
self.window.rootViewController = self.rootTabBarVC;
self.window.backgroundColor = [UIColor whiteColor];

View File

@ -81,8 +81,15 @@
[[UIApplication sharedApplication].keyWindow makeToast:@"授权失败" duration:1.6 position:CSToastPositionCenter];
}
}else if ([resp isKindOfClass:[SendMessageToWXResp class]]){
if (resp.errCode == 0) {
//cancelsuccesssuccess
//20180813 !!!
//App
if (resp.errCode == WXSuccess) {
GILog(@"分享取消或成功");
NC_POST_NAME_OBJECT(NC_UseShareSuccessNoti, nil);
}else if (resp.errCode == WXErrCodeUserCancel){
GILog(@"分享取消");
}
}
}

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -1,9 +1,17 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "share_oneblack@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "sharebg_6@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 870 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "sharebg_7@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 KiB

View File

@ -1,9 +1,17 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "user_day@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {

View File

@ -1,9 +1,17 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "user_time@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "applink.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "share_minute@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "share_tim@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -19,55 +19,51 @@
<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"/>
<rect key="frame" x="140" y="136" width="88" height="88"/>
<constraints>
<constraint firstAttribute="height" constant="95" id="jfp-Pv-euv"/>
<constraint firstAttribute="width" constant="95" id="xC0-N5-5NN"/>
<constraint firstAttribute="height" constant="88" id="jfp-Pv-euv"/>
<constraint firstAttribute="width" constant="88" 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>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="面膜时间" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YxK-fX-bo7">
<rect key="frame" x="151" y="248" width="73" height="26"/>
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<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="gxW-qE-dJB">
<rect key="frame" x="107" y="305" width="160" height="15"/>
<fontDescription key="fontDescription" name=".AppleSystemUIFont" family=".AppleSystemUIFont" pointSize="12"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="MaskTime" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ses-Mh-1Fi">
<rect key="frame" x="153.5" y="556" width="68.5" height="20"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="14"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.43137254901960786" green="0.0" blue="0.043137254901960784" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" red="0.51372549019607838" green="0.039215686274509803" blue="0.039215686274509803" 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"/>
<constraint firstItem="gxW-qE-dJB" firstAttribute="centerX" secondItem="ose-FF-1Ln" secondAttribute="centerX" id="4hD-Y3-bWg"/>
<constraint firstItem="gxW-qE-dJB" firstAttribute="top" secondItem="YxK-fX-bo7" secondAttribute="bottom" constant="31" id="9rI-bg-jpf"/>
<constraint firstItem="HQY-KF-maA" firstAttribute="centerX" secondItem="ose-FF-1Ln" secondAttribute="centerX" constant="-3.5" id="Dbo-Hj-G3n"/>
<constraint firstItem="HQY-KF-maA" firstAttribute="top" secondItem="ose-FF-1Ln" secondAttribute="top" constant="116" id="Dq6-Zk-1ih"/>
<constraint firstItem="ses-Mh-1Fi" firstAttribute="centerX" secondItem="ose-FF-1Ln" secondAttribute="centerX" id="c4I-me-csY"/>
<constraint firstItem="YxK-fX-bo7" firstAttribute="centerX" secondItem="ose-FF-1Ln" secondAttribute="centerX" id="c8e-n0-8ZX"/>
<constraint firstItem="ose-FF-1Ln" firstAttribute="bottom" secondItem="ses-Mh-1Fi" secondAttribute="bottom" constant="91" id="gwO-Xh-C3o"/>
<constraint firstItem="YxK-fX-bo7" firstAttribute="top" secondItem="HQY-KF-maA" secondAttribute="bottom" constant="24" id="jRH-w0-vI0"/>
</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="-129" y="374"/>
<point key="canvasLocation" x="-130.40000000000001" y="373.76311844077964"/>
</scene>
</scenes>
<resources>
<image name="bg_logo" width="88" height="88"/>
<image name="bg_name" width="110" height="68"/>
</resources>
</document>

View File

@ -11,5 +11,6 @@
@interface UIImage (ShotImage)
//截图tableviewi
+(UIImage *)saveLongImage:(UITableView *)table;
+(UIImage *)saveNavsuitImage:(UITableView *)table;
@end

View File

@ -14,24 +14,39 @@
UIImage* image = nil;
// NOYES
UIGraphicsBeginImageContextWithOptions(table.contentSize, YES, [UIScreen mainScreen].scale);
UIGraphicsBeginImageContextWithOptions(CGSizeMake(table.contentSize.width,table.contentSize.height), YES, [UIScreen mainScreen].scale);
CGPoint savedContentOffset = table.contentOffset;
CGRect savedFrame = table.frame;
table.contentOffset = CGPointZero;
table.frame = CGRectMake(0, 0, table.contentSize.width, table.contentSize.height);
table.frame = CGRectMake(0, 0, table.contentSize.width, table.contentSize.height +100);
[table.layer renderInContext: UIGraphicsGetCurrentContext()];
image = UIGraphicsGetImageFromCurrentImageContext();
table.contentOffset = savedContentOffset;
table.frame = savedFrame;
UIGraphicsEndImageContext();
return image;
}
+(UIImage *)saveNavsuitImage:(UITableView *)table {
UIImage* image = nil;
// NOYES
UIGraphicsBeginImageContextWithOptions(CGSizeMake(table.contentSize.width,table.contentSize.height+30), YES, [UIScreen mainScreen].scale);
CGPoint savedContentOffset = table.contentOffset;
CGRect savedFrame = table.frame;
table.contentOffset = CGPointZero;
table.frame = CGRectMake(0, 0, table.contentSize.width, table.contentSize.height +30);
[table.layer renderInContext: UIGraphicsGetCurrentContext()];
image = UIGraphicsGetImageFromCurrentImageContext();
table.contentOffset = savedContentOffset;
table.frame = savedFrame;
UIGraphicsEndImageContext();
return image;
}

View File

@ -28,7 +28,9 @@
if (token) {
[manager.requestSerializer setValue:token forHTTPHeaderField:@"token"];
}
[manager.requestSerializer setValue:@"ios" forHTTPHeaderField:@"device"];
switch (requestMethod) {
case RequestGetMethod:
@ -85,7 +87,7 @@
AFHTTPSessionManager*manager=[[AFHTTPSessionManager alloc] init];
manager.responseSerializer=[AFHTTPResponseSerializer serializer];
[manager.requestSerializer setValue:@"ios" forHTTPHeaderField:@"device"];
[manager POST:url parameters:param progress:^(NSProgress * _Nonnull uploadProgress) {
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
@ -131,6 +133,8 @@
[manager.requestSerializer setValue:token forHTTPHeaderField:@"token"];
[requst setValue:token forHTTPHeaderField:@"token"];
}
[manager.requestSerializer setValue:@"ios" forHTTPHeaderField:@"device"];
[requst setValue:@"ios" forHTTPHeaderField:@"device"];
[requst setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[requst setValue:@"application/json" forHTTPHeaderField:@"Accept"];
@ -179,6 +183,8 @@
if (token) {
[manager.requestSerializer setValue:token forHTTPHeaderField:@"token"];
}
[manager.requestSerializer setValue:@"ios" forHTTPHeaderField:@"device"];
[manager POST:url parameters:parms constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
@ -232,6 +238,7 @@
if (token) {
[manager.requestSerializer setValue:token forHTTPHeaderField:@"token"];
}
[manager.requestSerializer setValue:@"ios" forHTTPHeaderField:@"device"];
NSString *fullurl = [NSString stringWithFormat:@"%@%@",[GiGaServerConfig getMainUrl],url];
[manager POST:fullurl parameters:parms constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {

View File

@ -42,7 +42,7 @@
NSString*fullpath=[[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]stringByAppendingPathComponent:imageName];
UIImage*saveImage=[[UIImage alloc]initWithContentsOfFile:fullpath];
if (!saveImage) {
saveImage = [UIImage imageNamed:@"sharebg_1"];
saveImage = [UIImage imageNamed:@"sharebg_6"];
}
return saveImage;
}

View File

@ -50,6 +50,14 @@
+(void)saveWeiXinaccesstokenInfoWithDic:(NSDictionary *)dic;
+(NSDictionary *)getWeiXinAccessToenDic;
/**
code
@param code code
*/
+(void)saveWeiXinCode:(NSString *)code;
+(NSString *)getWeiXinCode;
//面膜时间 未登录用户默认16分钟 测试用户对应测试结果

View File

@ -16,6 +16,7 @@ NSString *const kWeiXinSaveToken = @"WeiXinSaveToken";
NSString *const kWeiXinUserInfo = @"WeiXinUserinfo";
NSString *const kGiGaToken = @"GiGatoken";
NSString *const kMaskeTime= @"userMaskeTime";
NSString *const kWeiXinCodeInfo = @"WeiXinCodeinfo";
#define MASKTIME_DEFAULT 20;
@implementation GiGaUserDefault
@ -60,6 +61,7 @@ NSString *const kMaskeTime= @"userMaskeTime";
UD_REMOVE_KEY(kGiGaToken);
UD_REMOVE_KEY(kMaskeTime);
UD_REMOVE_KEY(GIGADEFAULTKEY_USERID);
}
+(void)saveDBVersion:(NSInteger)versionNum{
@ -111,6 +113,17 @@ NSString *const kMaskeTime= @"userMaskeTime";
return [UD_STADARDUD objectForKey:kWeiXinSaveToken];
}
+(void)saveWeiXinCode:(NSString *)code{
[UD_STADARDUD setObject:code forKey:kWeiXinCodeInfo];
[UD_STADARDUD synchronize];
}
+(NSString *)getWeiXinCode{
return [UD_STADARDUD objectForKey:kWeiXinCodeInfo];
}
+(void)saveWeiXinUserInfoDic:(NSDictionary *)dic
{
[UD_STADARDUD setObject:dic forKey:kWeiXinUserInfo];
@ -131,9 +144,9 @@ NSString *const kMaskeTime= @"userMaskeTime";
NSTimeInterval time = [UD_STADARDUD doubleForKey:kMaskeTime];
if (time == 0) {
//17
time = 17 * 60;
time = MASKTIME_DEFAULT;
//15
time = 15 * 60;
//time = MASKTIME_DEFAULT;
}
return time;
}

View File

@ -28,15 +28,20 @@
//修改密码
#define kPAiUSerEditpwd @"user/v1/editpwd"
//修改手机号
#define kApiChangePhone @"user/v1/editmobil"
//修改手机号发送验证码
#define kApiChangeMobleCode @"msg/sms/v1/editsendcode"
//发送验证码
#define kApiSendPhoneCode @"msg/sms/v1/sendcode";
#define kApiChangePhone @"user/v1/editmobile"
//修改手机号发送旧手机验证码
#define kApiChangeMobleOldCode @"msg/sms/v1/editsendcode"
//修改手机号发送新手机验证码
#define kApiChangeMobleNewCode @"msg/sms/v1/editsendcode2"
//找回密码发送验证码
#define kApiChangePassSendCode @"msg/sms/v1/retrievesendcode"
//异步验证手机验证码
#define kApiVersifyPhoneCode @"user/v1/validateSmsCode"
//注册发送短信
#define kApiUserRegistSendCode @"msg/sms/v1/registersendcode"
//获取意见反馈类型 (设置意见反馈)
#define kApiGetFeedList @"sys/sysdict/v1/maskproposaltype"
@ -57,6 +62,14 @@
#define kApiEndMaskTime @"activity/maskuselog/v1/end"
//每日分享
#define kApiShareAction @"activity/maskuselog/v1/sharedata"
//微信登陆
#define kApiWeiChatLogin @"sys/v1/wechatlogin"
//版本说明
//测试
//#define kIMPRITNT @"http://yts.s1.natapp.cc/mask/imprint.html"
//正式
#define kIMPRITNT @"http://app.mianmoshijian.com/imprint.html?device=ios"
#endif /* ApiRequestConfig_h */

View File

@ -101,7 +101,7 @@ alpha:((float)(rgbValue & 0xFF))/255.0]
// 状态栏高度 所有机型
#define Phone_STATUBAR_H [[UIApplication sharedApplication] statusBarFrame].size.height
//状态栏—➕导航栏
#define SAFE_NAV_HEIGHT ([[UIApplication sharedApplication] statusBarFrame].size.height + self.navigationController.navigationBar.frame.size.height)
#define SAFE_NAV_HEIGHT ([[UIApplication sharedApplication] statusBarFrame].size.height == 44.0 ? 88.0 : 64.0)
#define GIGA_FONTNAME @"PingFangSC-Medium"

View File

@ -12,5 +12,6 @@
+ (void)setServerType:(NSInteger) type;
+ (NSString *)getMainUrl;
+(NSString*)getsocketUrl;
@end

View File

@ -18,12 +18,19 @@
switch (type) {
case 0://
{
[[NSUserDefaults standardUserDefaults] setValue:@"http://apiyts.s1.natapp.cc/v1/" forKey:@"MainUrl"];
[[NSUserDefaults standardUserDefaults] setValue:@"http://apiyts.s1.natapp.cc/v1/" forKey:@"MainUrl"];
[[NSUserDefaults standardUserDefaults] setValue:@"http://wsyts.s1.natapp.cc" forKey:@"gigasocketUrl"];
// [[NSUserDefaults standardUserDefaults] setValue:@"https://api.mianmoshijian.com/v1/" forKey:@"MainUrl"];
// [[NSUserDefaults standardUserDefaults] setValue:@"https://ws.mianmoshijian.com" forKey:@"gigasocketUrl"];
}
break;
case 1: //
{
[[NSUserDefaults standardUserDefaults] setValue:@"https://" forKey:@"MainUrl"];
//https://api.mianmoshijian.com/v1/
[[NSUserDefaults standardUserDefaults] setValue:@"https://api.mianmoshijian.com/v1/" forKey:@"MainUrl"];
[[NSUserDefaults standardUserDefaults] setValue:@"https://ws.mianmoshijian.com" forKey:@"gigasocketUrl"];
}
break;
@ -37,4 +44,8 @@
return [[NSUserDefaults standardUserDefaults] objectForKey:@"MainUrl"];
}
+(NSString*)getsocketUrl{
return [[NSUserDefaults standardUserDefaults] objectForKey:@"gigasocketUrl"];
}
@end

View File

@ -2,23 +2,12 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>保存图片到相册</string>
<key>BuglyAppIDString</key>
<string>8f49773330</string>
<key>CFBundleDevelopmentRegion</key>
<string>cn</string>
<key>CFBundleDisplayName</key>
<string>面膜时间</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array/>
<key>CFBundleTypeName</key>
<string></string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
@ -30,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>0.8.0</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
@ -53,7 +42,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<string>1.4.0</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>weixin</string>
@ -67,6 +56,8 @@
</dict>
<key>NSCameraUsageDescription</key>
<string>是否允许此App使用您的 相机?</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>保存图片到相册</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>是否允许此App使用您的相册</string>
<key>UIBackgroundModes</key>

10
GIGA/InfoPlist.strings Normal file
View File

@ -0,0 +1,10 @@
/*
InfoPlist.strings
GIGA
Created by lianxiang on 2018/9/27.
Copyright © 2018年 com.giga.ios. All rights reserved.
*/
CFBundleDisplayName = "面膜时间";

View File

@ -5,3 +5,4 @@
Created by lianxiang on 2018/9/4.
Copyright © 2018年 com.giga.ios. All rights reserved.
*/

View File

@ -86,6 +86,7 @@ static int const showTime = 5;
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);
@ -131,6 +132,8 @@ static int const showTime = 5;
make.left.mas_equalTo(20);
}];
moreinfoBtn.hidden = YES;
}
-(void)removeAdView{

View File

@ -1,13 +0,0 @@
//
// GiGaExercisesViewController.h
// GIGA
//
// Created by lianxiang on 2018/8/13.
// Copyright © 2018年 com.giga.ios. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GiGaExercisesViewController : UIViewController
@end

View File

@ -1,37 +0,0 @@
//
// GiGaExercisesViewController.m
// GIGA
//
// Created by lianxiang on 2018/8/13.
// Copyright © 2018 com.giga.ios. All rights reserved.
//
#import "GiGaExercisesViewController.h"
@interface GiGaExercisesViewController ()
@end
@implementation GiGaExercisesViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end

View File

@ -46,6 +46,7 @@
[self.checkBtn addTarget:self action:@selector(checkBtnAction:) forControlEvents:UIControlEventTouchUpInside];
[self resetBackimg];
}
-(void)resetBackimg{
@ -122,7 +123,7 @@
NSDictionary *param = @{
@"mobile":phoneNumber
};
GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath:@"msg/sms/v1/registersendcode" method:RequestPostMethod parms:param];
GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath:kApiUserRegistSendCode method:RequestPostMethod parms:param];
[api requstDataWithResult:^(GiGaAPIResult *result) {
[MBProgressHUD hideHUDForView:self.view animated:YES];
@ -182,9 +183,10 @@
// [self.navigationController pushViewController:webView animated:YES];
GiGaWebViewController *webView = [[GiGaWebViewController alloc] init];
webView.souceType = WebSourceTypeUrlLink;
webView.url = @"http://www.youtansu.com";
webView.url = @"http://app.mianmoshijian.com/userAgrerment.html";
[self.navigationController pushViewController:webView animated:YES];
}
#pragma mark
@ -216,11 +218,16 @@
-(void)regeist:(UIButton *)btn{
btn.userInteractionEnabled = NO;
NSDictionary *weixinInfoDic = [GiGaUserDefault getWeiXinAccessToenDic];
//NSDictionary *weixinInfoDic = [GiGaUserDefault getWeiXinAccessToenDic];
NSString *wechatCode = [GiGaUserDefault getWeiXinCode];
NSDictionary *param = nil;
if (weixinInfoDic) {
param = @{@"username":self.phoneNumberTextField.text,@"verifiedCode":self.codeTextField.text,@"password":self.passTexFied.text,@"openid":weixinInfoDic[@"openid"]};
if (wechatCode) {
param = @{@"username":self.phoneNumberTextField.text,@"verifiedCode":self.codeTextField.text,@"password":self.passTexFied.text,@"wechatCode":wechatCode};
}else{
param = @{@"username":self.phoneNumberTextField.text,@"verifiedCode":self.codeTextField.text,@"password":self.passTexFied.text};
}
@ -230,21 +237,49 @@
btn.userInteractionEnabled = YES;
GILog(@"注册->%@",result.message);
if (result.code == 0) {
NC_POST_NAME_OBJECT(kUserRegistSucccess,self.phoneNumberTextField.text);
GIGA_ShowToast(result.message);
[self.navigationController popToRootViewControllerAnimated:YES];
}else if (result.code == GiGAErrorCode_USER_EXIST){
GIGA_ShowToast(@"用户已存在");
NC_POST_NAME_OBJECT(kUserRegistSucccess,self.phoneNumberTextField.text);
if (result.success) {
// NC_POST_NAME_OBJECT(kUserRegistSucccess,self.phoneNumberTextField.text);
// GIGA_ShowToast(result.message);
// [self.navigationController popToRootViewControllerAnimated:YES];
if (result.dic) {
//token
[GiGaUserDefault saveToken:result.dic[@"token"]];
//
[MobClick endEvent:MobClick_UserLogin];
GIGA_WIndowTost(@"登录成功!");
//
[[GiGaUserManager shareUser] synsisUserInfo:^(GiGaUser *user) {
GILog(@"user.userId:%@",user.userId);
NC_POST_NAME_OBJECT(kUserLoginSuccessNoti, nil);
[self dismissViewControllerAnimated:YES completion:nil];
} userErrorMsgBlock:^(NSDictionary *errorCodemsg) {
GILog(@"%@",errorCodemsg);
}];
}
}else{
GIGA_ShowToast(result.message);
}
}];
}
-(void)userloginAuto{
[[GiGaUserManager shareUser] synsisUserInfo:^(GiGaUser *user) {
GILog(@"user.userId:%@",user.userId);
NC_POST_NAME_OBJECT(kUserLoginSuccessNoti, nil);
} userErrorMsgBlock:^(NSDictionary *errorCodemsg) {
}];
}
-(void)checkBtnAction:(UIButton *)btn{
btn.selected = !btn.selected;
if (btn.selected) {
@ -253,7 +288,7 @@
self.registBtn.userInteractionEnabled = YES;
}else{
[btn setImage:[UIImage imageNamed:@"btn_turndown"] forState:UIControlStateSelected];
[btn setImage:[UIImage imageNamed:@"btn_turndown"] forState:UIControlStateNormal];
[self.registBtn setBackgroundColor:[UIColor lightGrayColor]];
self.registBtn.userInteractionEnabled = NO;
@ -265,4 +300,5 @@
// Dispose of any resources that can be recreated.
}
@end

View File

@ -1,11 +1,11 @@
<?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" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14313.18" 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"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@ -31,14 +31,14 @@
<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="130" y="87" width="114" height="114"/>
<rect key="frame" x="130.5" y="87" width="114" height="114"/>
<constraints>
<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="230" width="244" height="48"/>
<rect key="frame" x="66" y="230" width="243" height="48"/>
<constraints>
<constraint firstAttribute="height" constant="48" id="pzi-4C-7s8"/>
</constraints>
@ -47,14 +47,14 @@
<textInputTraits key="textInputTraits" keyboardType="numberPad"/>
</textField>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ubQ-Za-dV7">
<rect key="frame" x="65" y="280" width="245" height="1"/>
<rect key="frame" x="65" y="280" width="244" 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="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"/>
<rect key="frame" x="66" y="286" width="130" height="48"/>
<constraints>
<constraint firstAttribute="height" constant="48" id="Iqo-gI-2Z3"/>
</constraints>
@ -63,7 +63,7 @@
<textInputTraits key="textInputTraits" keyboardType="numberPad"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qAH-Fa-AmF">
<rect key="frame" x="222" y="286" width="88" height="48"/>
<rect key="frame" x="221" y="286" width="88" height="48"/>
<constraints>
<constraint firstAttribute="width" constant="88" id="kZw-pm-n5p"/>
<constraint firstAttribute="height" constant="48" id="oB6-lP-x7P"/>
@ -76,14 +76,14 @@
</state>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Trq-bz-kQT">
<rect key="frame" x="65" y="336" width="245" height="1"/>
<rect key="frame" x="65" y="336" width="244" 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="BYZ-mC-rOK"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Pb5-1e-TXp">
<rect key="frame" x="65" y="395" width="245" height="1"/>
<rect key="frame" x="65.5" y="395" width="244" 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"/>
@ -105,7 +105,7 @@
<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"/>
<rect key="frame" x="65.5" y="345" width="244" height="48"/>
<constraints>
<constraint firstAttribute="height" constant="48" id="o8f-Xh-HGs"/>
</constraints>
@ -142,7 +142,7 @@
<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="hZA-nj-Wmu" firstAttribute="leading" relation="lessThanOrEqual" 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"/>

View File

@ -188,14 +188,16 @@
-(void)loginWithAction:(UIButton *)btn{
NSDictionary *weixinInfoDic = [GiGaUserDefault getWeiXinAccessToenDic];
// NSDictionary *weixinInfoDic = [GiGaUserDefault getWeiXinAccessToenDic];
NSString *wechatCode = [GiGaUserDefault getWeiXinCode];
NSDictionary *params = nil;
if (weixinInfoDic) {
if (wechatCode) {
params = @{
@"username":self.acountTextField.text,
@"password":self.passwordTextField.text,
@"openid":weixinInfoDic[@"openid"],
@"wechatCode":wechatCode,
};
}else{
@ -241,33 +243,37 @@
}
}
//access_token
//access_token()
-(void)WeiXinLongIn:(NSNotification *)notification{
//
//[self testNetworkStatus];
//code
[GiGaUserDefault saveWeiXinCode:notification.object[@"code"]];
[self.view makeToastActivity:CSToastPositionCenter];
NSDictionary *param = @{
@"appid":WXin_APPID,
@"secret":WXin_APPSecret,
@"code":notification.object[@"code"],
@"grant_type":@"authorization_code"
@"code":notification.object[@"code"]
};
[WeiIXinApiManager weixinAccessTokeRequstUrl:@"https://api.weixin.qq.com/sns/oauth2/access_token" parameters:param success:^(id response) {
NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingAllowFragments error:nil];
GILog(@"access_token back -->%@",dict);
[GiGaUserDefault saveWeiXinaccesstokenInfoWithDic:dict];
[self requstWeiXinUserinfo];
} failure:^(NSError *err) {
[self.view makeToast:err.localizedDescription];
GILog(@"access_token err-->%@",err.localizedDescription);
}];
[self gigaUploadweixinInfo:param];
// NSDictionary *param = @{
// @"appid":WXin_APPID,
// @"secret":WXin_APPSecret,
// @"code":notification.object[@"code"],
// @"grant_type":@"authorization_code"
// };
//
// [WeiIXinApiManager weixinAccessTokeRequstUrl:@"https://api.weixin.qq.com/sns/oauth2/access_token" parameters:param success:^(id response) {
// NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingAllowFragments error:nil];
// GILog(@"access_token back -->%@",dict);
// [GiGaUserDefault saveWeiXinaccesstokenInfoWithDic:dict];
// [self requstWeiXinUserinfo];
//
// } failure:^(NSError *err) {
// [self.view makeToast:err.localizedDescription];
// GILog(@"access_token err-->%@",err.localizedDescription);
// }];
}
//
//
-(void)requstWeiXinUserinfo{
@ -280,7 +286,7 @@
[WeiIXinApiManager getWeiXinUserInfoUrl:@"https://api.weixin.qq.com/sns/userinfo" parameters:param success:^(id response) {
NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingAllowFragments error:nil];
GILog(@"weixinUser info back -->%@",dict);
[self gigaUploadweixinInfo:dict];
// [self gigaUploadweixinInfo:dict];
} failure:^(NSError *err) {
[self.view makeToast:err.localizedDescription];
@ -292,7 +298,8 @@
-(void)gigaUploadweixinInfo:(NSDictionary *)weiXinUserinfo{
[self.view makeToastActivity:CSToastPositionCenter];
NSString *url = [NSString stringWithFormat:@"%@sys/v1/wechatlogin",[GiGaServerConfig getMainUrl]];
NSString *url = [NSString stringWithFormat:@"%@%@",[GiGaServerConfig getMainUrl],kApiWeiChatLogin];
[GiGaNetManager requestMethod:RequestPostMethod Url:url params:weiXinUserinfo responseBlock:^(NSDictionary *responseDict, NSDictionary *responseHeaderFields, NSError *error) {
[self.view hideToastActivity];
if (!error) {
@ -303,8 +310,8 @@
}else if([responseDict[@"code"] integerValue] == 500){
//
[self.view makeToast:responseDict[@"msg"] duration:2.0 position:CSToastPositionCenter];
[self jxt_showAlertWithTitle:@"温馨提示" message:@"请绑定手机号" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) {
[self jxt_showAlertWithTitle:@"温馨提示" message:@"请绑定手机号" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) {
alertMaker.addActionCancelTitle(@"知道了");
} actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) {
}];

View File

@ -1,11 +1,11 @@
<?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" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14313.18" 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"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@ -53,7 +53,7 @@
</constraints>
<nil key="textColor"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
<textInputTraits key="textInputTraits" keyboardType="numbersAndPunctuation"/>
<textInputTraits key="textInputTraits" keyboardType="numbersAndPunctuation" secureTextEntry="YES"/>
</textField>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ZJU-Uo-5TM">
<rect key="frame" x="65" y="331" width="245" height="2"/>
@ -96,14 +96,14 @@
<state key="normal" image="btn_tab_desplay"/>
</button>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_circle_avatar" translatesAutoresizingMaskIntoConstraints="NO" id="RIl-8E-GcR">
<rect key="frame" x="131" y="82" width="114" height="114"/>
<rect key="frame" x="130.5" y="82" width="114" height="114"/>
<constraints>
<constraint firstAttribute="height" constant="114" id="JgO-PU-ypI"/>
<constraint firstAttribute="width" constant="114" id="mG0-1p-gP7"/>
</constraints>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" hasAttributedTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="dnL-WV-spY">
<rect key="frame" x="115" y="523" width="144" height="38"/>
<rect key="frame" x="115.5" y="523" width="144" height="38"/>
<constraints>
<constraint firstAttribute="height" constant="38" id="l1O-3i-Plv"/>
<constraint firstAttribute="width" constant="144" id="zzO-p2-ENu"/>
@ -122,7 +122,7 @@
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="F5p-cf-frr">
<rect key="frame" x="108" y="436" width="161" height="40"/>
<rect key="frame" x="107" y="436" width="161" height="40"/>
<constraints>
<constraint firstAttribute="width" constant="161" id="EU3-ax-K1r"/>
<constraint firstAttribute="height" constant="40" id="W9a-lX-GbY"/>

View File

@ -64,7 +64,9 @@
[self.view makeToast:@"链接为空" duration:1 position:CSToastPositionCenter];
return;
}
NSURLRequest *req = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:self.url]];
NSMutableURLRequest *req = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:self.url]];
[req setValue:@"ios" forHTTPHeaderField:@"device"];
[_webview loadRequest:req];
}
break;

View File

@ -17,6 +17,8 @@
#import "GiGaBaseAPiRequest.h"
#import "GiGaShareModel.h"
#import "UIImageView+WebCache.h"
#import "UIButton+WebCache.h"
@interface GIGaMaskShareViewController ()<UIImagePickerControllerDelegate,UINavigationControllerDelegate>
@property(nonatomic,strong) GiGaShareModel *model;
@end
@ -35,10 +37,41 @@
self.tableView.estimatedSectionFooterHeight= 0;
self.tableView.estimatedSectionHeaderHeight = 0;
//self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectMake(0, 0,self.view.frame.size.width, 30)];
self.tableView.frame = CGRectMake(0,0,KMainW, self.view.frame.size.height);
self.tableView.frame = CGRectMake(0,0,KMainW, self.view.frame.size.height-SAFE_NAV_HEIGHT);
[self requestshareInfo];
[self initUserAvator];
}
-(void)initUserAvator{
//rightItem
UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
rightBtn.frame = CGRectMake(0, 0, 40, 40);
rightBtn.layer.masksToBounds = YES;
rightBtn.layer.cornerRadius = 20;
[rightBtn setImage:[UIImage imageNamed:@"nav_circle_avatar"] forState:UIControlStateNormal];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn];
if ([[[UIDevice currentDevice] systemVersion] doubleValue] >= 11.0) {
[rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(40, 40));
}];
}
BOOL isUserLogin = [GiGaUserDefault isUserLogin];
if (isUserLogin) {
GiGaUser *user = [[GiGaUserManager shareUser] getCurrentUser];
if (user) {
if (user.headImgUrl && ![user.headImgUrl isKindOfClass:[NSNull class]]) {
NSURL *url = [NSURL URLWithString:user.headImgUrl];
[rightBtn sd_setImageWithURL:url forState:UIControlStateNormal];
}
}
}
}
- (void)didReceiveMemoryWarning {
@ -64,7 +97,11 @@
if (self.model) {
cell.minuteLab.text = [NSString stringWithFormat:@"%@min",self.model.minute];
cell.timeLable.text = [NSString stringWithFormat:@"这是您敷面膜的第:%@张",self.model.monthMaskNum];
if (self.model.productImgUrl && ![self.model.productImgUrl isKindOfClass:[NSNull class]]) {
[cell.holdImagView sd_setImageWithURL:[NSURL URLWithString:self.model.productImgUrl]];
}
}
return cell;
}else if (indexPath.section == 1){

View File

@ -19,29 +19,86 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = [UIColor lightGrayColor];
self.view.backgroundColor = [UIColor blueColor];
[GiGaUserDefault saveAppGaurdflag:YES];
[self creatUI];
}
-(void)creatUI{
UIImageView *backimage = [[UIImageView alloc] init];
backimage.image = [UIImage imageNamed:@"appgaurd_bg"];
backimage.frame = CGRectMake(0, 0, KMainW, KMainH);
//backimage.contentMode = UIViewContentModeScaleToFill;
[self.view addSubview:backimage];
[backimage mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view.mas_top);
make.bottom.mas_equalTo(self.view.mas_bottom);
make.left.mas_equalTo(self.view.mas_left);
make.right.mas_equalTo(self.view.mas_right);
}];
UIImageView *girlimage = [[UIImageView alloc] init];
girlimage.image = [UIImage imageNamed:@"appgaurd_woman"];
[self.view addSubview:girlimage];
girlimage.contentMode = UIViewContentModeScaleAspectFit;
[girlimage mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view.mas_top).offset(104 + PhoneX_TopMargin);
make.centerX.mas_equalTo(self.view.mas_centerX);
}];
UIImageView *moonimage = [[UIImageView alloc] init];
moonimage.image = [UIImage imageNamed:@"appgaurd_moon"];
[self.view addSubview:moonimage];
[moonimage mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view.mas_top).offset(13 + PhoneX_TopMargin);
make.right.mas_equalTo(self.view.mas_right).offset(-5.5);
}];
UIButton *dismisBtn= [UIButton buttonWithType:UIButtonTypeCustom];
[dismisBtn setTitle:@"立即体验" forState:UIControlStateNormal];
dismisBtn.backgroundColor = [UIColor greenColor];
//dismisBtn.backgroundColor = [UIColor greenColor];
[dismisBtn addTarget:self action:@selector(dismisBtnAction) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:dismisBtn];
[dismisBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(200);
make.height.mas_equalTo(30);
make.width.mas_equalTo(160);
make.height.mas_equalTo(40);
make.centerX.mas_equalTo(self.view.mas_centerX);
make.top.mas_equalTo(self.view.mas_top).offset(200);
make.bottom.mas_equalTo(self.view.mas_bottom).offset(-100);
make.top.mas_greaterThanOrEqualTo(girlimage.mas_bottom).offset(20);
}];
dismisBtn.layer.masksToBounds = YES;
dismisBtn.layer.cornerRadius = 15;
dismisBtn.layer.masksToBounds = YES;
dismisBtn.layer.cornerRadius = 20;
dismisBtn.layer.borderWidth = 1;
dismisBtn.layer.borderColor = [UIColor whiteColor].CGColor;
UIView *botomlineView = [[UIView alloc] init];
botomlineView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:botomlineView];
[botomlineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(self.view.frame.size.width, 1));
make.bottom.mas_equalTo(self.view.mas_bottom).offset(-10 - PhoneX_BottomMargin);
make.centerX.mas_equalTo(self.view.mas_centerX);
}];
}
-(void)dismisBtnAction{
@ -51,6 +108,11 @@
}];
}
-(BOOL)prefersStatusBarHidden
{
return YES;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.

View File

@ -18,39 +18,57 @@
#import "GIGAMBHUDHelper.h"
#import "LXCustomSwith.h"
#import "GiGaUserDefault.h"
#import "GiGaServerConfig.h"
//
@interface GiGaFlingCommitVC ()
@property (nonatomic,strong) GiGaFlyingCommitInputView *commitInputView;
@property (nonatomic,strong) SocketIOClient *client;
@property (nonatomic,strong) SocketManager *manager;
@property (nonatomic,strong) LXCustomSwith *danmuSwitch;
//@property (nonatomic,strong) LXCustomSwith *danmuSwitch;
//
@property(nonatomic,strong) UIButton *openDanmuButton;
@end
@implementation GiGaFlingCommitVC
- (LXCustomSwith *)danmuSwitch{
if (!_danmuSwitch) {
_danmuSwitch = [[LXCustomSwith alloc] initWithFrame:CGRectMake(KMainW - 50 - 25 , 64 + PhoneX_TopMargin +10, 50, 18)];
//- (LXCustomSwith *)danmuSwitch{
// if (!_danmuSwitch) {
// _danmuSwitch = [[LXCustomSwith alloc] initWithFrame:CGRectMake(KMainW - 50 - 25 , 64 + PhoneX_TopMargin +10, 50, 18)];
//
// [_danmuSwitch setOffthumTitle:@"弹幕"];
// [_danmuSwitch setOnthumTitle:@"弹幕"];
// [_danmuSwitch setOnTintColor:GIGARGB(91, 0, 2, 1)];
// [_danmuSwitch setTintColor:GIGARGB(91, 0, 2, 1)];
// [_danmuSwitch setThumbTintColor:GIGARGB(203, 42, 50, 1)];
// _danmuSwitch.on = YES;
// _danmuSwitch.thumbLabel.font = GIGA_TEXTFONTMEDIUM(10);
// _danmuSwitch.thumbLabel.textColor = [UIColor whiteColor];
// [_danmuSwitch addTarget:self action:@selector(mycuntomSwitchAction:) forControlEvents:UIControlEventValueChanged];
// }
//
// return _danmuSwitch;
//
//}
- (UIButton *)openDanmuButton{
if (!_openDanmuButton) {
_openDanmuButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_openDanmuButton addTarget:self action:@selector(openDanmuButtonAction) forControlEvents:UIControlEventTouchUpInside];
_openDanmuButton.backgroundColor = GIGARGB(112, 0, 0, 1);
_openDanmuButton.frame = CGRectMake(KMainW - 25 -50,SAFE_NAV_HEIGHT + 15, 50, 20);
_openDanmuButton.layer.masksToBounds = YES;
_openDanmuButton.layer.cornerRadius = 10;
NSAttributedString *att = [GiGaHelper stringWithText:@"弹幕" textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTMEDIUM(10) leterSpace:0];
[_openDanmuButton setAttributedTitle:att forState:UIControlStateNormal];
[_openDanmuButton setImage:[UIImage imageNamed:@"btn_talk"] forState:UIControlStateNormal];
_openDanmuButton.imageEdgeInsets = UIEdgeInsetsMake(0,18, 0, -18);
_openDanmuButton.titleEdgeInsets = UIEdgeInsetsMake(0, -4, 0, 4);
[_danmuSwitch setOffthumTitle:@"弹幕"];
[_danmuSwitch setOnthumTitle:@"弹幕"];
[_danmuSwitch setOnTintColor:GIGARGB(91, 0, 2, 1)];
[_danmuSwitch setTintColor:GIGARGB(91, 0, 2, 1)];
[_danmuSwitch setThumbTintColor:GIGARGB(203, 42, 50, 1)];
_danmuSwitch.on = YES;
_danmuSwitch.thumbLabel.font = GIGA_TEXTFONTMEDIUM(10);
_danmuSwitch.thumbLabel.textColor = [UIColor whiteColor];
[_danmuSwitch addTarget:self action:@selector(mycuntomSwitchAction:) forControlEvents:UIControlEventValueChanged];
}
return _danmuSwitch;
return _openDanmuButton;
}
- (GiGaFlyingCommitInputView *)commitInputView{
if (!_commitInputView) {
@ -64,8 +82,6 @@
-(void)mycuntomSwitchAction:(id)sender{
LXCustomSwith *nkswitch = (LXCustomSwith *)sender;
if (nkswitch.isOn)
NSLog(@"switchPressed ON");
@ -77,6 +93,13 @@
NSLog(@"switchPressed OFF");
}
-(void)openDanmuButtonAction{
[[LXDanMuManager shareInstance] destory];
[self destorySocket];
NC_POST_NAME_OBJECT(@"UserCloseChatRoomAction", nil);
[self dismissViewControllerAnimated:YES completion:nil];
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
NC_ADD_TARGET_NAME_OBJECT(self, @selector(maskTimeEnd), kUserNoti_MASKEND, nil);
@ -98,8 +121,9 @@
// Do any additional setup after loading the view.
[self.view addSubview: self.commitInputView];
[self.view addSubview:self.danmuSwitch];
[self.view bringSubviewToFront:self.danmuSwitch];
// [self.view addSubview:self.danmuSwitch];
// [self.view bringSubviewToFront:self.danmuSwitch];
[self.view addSubview:self.openDanmuButton];
weakify(self);
@ -114,7 +138,7 @@
};
//
[[LXDanMuManager shareInstance] createDanmuWithTrackSpeedArray:@[@1.00,@1.00,@3.00,@4.00] centerY:KMainH / 4 trackWidth:KMainW showInView:self.view];
[[LXDanMuManager shareInstance] createDanmuWithTrackSpeedArray:@[@1.00,@1.00,@3.00,@3.00] centerY:KMainH / 4 trackWidth:KMainW showInView:self.view];
[[LXDanMuManager shareInstance] start];
//socket
[self connetction];
@ -133,9 +157,9 @@
//@"connectParams":@{@"token":@""}
NSString *token = [GiGaUserDefault getCurentToken];
if (!token) {
token = @"";
token = @"1";
}
NSString *urlstr = [NSString stringWithFormat:@"http://wsyts.s1.natapp.cc"];
NSString *urlstr = [GiGaServerConfig getsocketUrl];
NSURL* url = [[NSURL alloc] initWithString:urlstr];
SocketManager *manager = [[SocketManager alloc] initWithSocketURL:url config:@{@"log": @NO, @"forcePolling": @YES,@"extraHeaders":@{@"device":@"ios"},@"connectParams":@{@"token":token}}];
@ -147,14 +171,32 @@
[self.client on:@"connect" callback:^(NSArray* data, SocketAckEmitter* ack) {
//GIGA_WIndowTost(@"客户端上线");
NSLog(@"*************\n\niOS客户端上线\n\n*************");
NSArray *arr = @[@{
@"token":token,
}];
[weakSelf.client emit:@"login" with:arr];
}];
[self.client on:@"connectedSocket" callback:^(NSArray * _Nonnull event, SocketAckEmitter * _Nonnull ack) {
[self.client on:@"onLogin" callback:^(NSArray * _Nonnull event, SocketAckEmitter * _Nonnull ack) {
//
[GIGAMBHUDHelper messageAddto:self.view title:@"弹幕链接成功"];
NSLog(@"connectedSocket:%@",event);
NSLog(@"login 监听:%@",event);
}];
[self.client on:@"connectedSocket" callback:^(NSArray * _Nonnull event, SocketAckEmitter * _Nonnull ack) {
// [GIGAMBHUDHelper messageAddto:self.view title:@"弹幕链接成功"];
NSLog(@"connectedSocket:%@",event);
}];
[self.client on:@"onTalk" callback:^(NSArray * _Nonnull data, SocketAckEmitter * _Nonnull ack) {
//NSString *json =data[0];
@ -175,7 +217,7 @@
[self.client on:@"disconnect" callback:^(NSArray * _Nonnull event, SocketAckEmitter * _Nonnull ack) {
GIGA_WIndowTost(@"客户端下线");
GIGA_WIndowTost(@"弹幕已断开");
NSLog(@"*************\n\niOS客户端下线\n\n*************%@",event?event[0]:@"");
}];
@ -221,4 +263,5 @@
self.manager = nil;
}
@end

View File

@ -90,7 +90,7 @@
[_openDanmuButton setImage:[UIImage imageNamed:@"btn_talk"] forState:UIControlStateNormal];
//_openDanmuButton.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 0);
_openDanmuButton.titleEdgeInsets = UIEdgeInsetsMake(0, -25, 0, 25);
_openDanmuButton.hidden = YES;
}
return _openDanmuButton;
}
@ -143,6 +143,8 @@
_cicleProgressView = [[MaskTimeCircularProgressView alloc] initWithFrame:CGRectMake(100, 251 + PhoneX_TopMargin, 125, 125) backColor:GIGARGB(88, 0, 2, 1) progressColor:[UIColor blueColor] lineWidth:10 timeinterval:10];
_cicleProgressView.delegate = self;
_cicleProgressView.hidden = YES;
UITapGestureRecognizer *cicleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(maskTimeCycleTapAction)];
[_cicleProgressView addGestureRecognizer:cicleTap];
}
return _cicleProgressView;
@ -194,7 +196,7 @@
#pragma mark
-(void)createInputView{
self.openDanmuButton.hidden = YES;
GiGaFlingCommitVC* GiGaFlingVC = [[GiGaFlingCommitVC alloc] init];
if (ISIOS8) {
GiGaFlingVC.modalPresentationStyle = UIModalPresentationOverCurrentContext;
@ -211,7 +213,7 @@
[super viewWillAppear:animated];
//
[self.navigationController.navigationBar setTranslucent:YES];
self.openDanmuButton.hidden = NO;
}
@ -221,18 +223,14 @@
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
}
//  app
// BOOL showAppGaurd = [GiGaUserDefault isShowedAppGaurd];
// if (showAppGaurd == NO) {
// [self showAPPappGaurdView];
// }
//
BOOL isshowGaurd = [GiGaUserDefault isShowedGaurd];
if (isshowGaurd == NO) {
NSLog(@"%d",(int)isshowGaurd );
[self showUserGaurdView];
//  app
BOOL showAppGaurd = [GiGaUserDefault isShowedAppGaurd];
if (showAppGaurd == NO) {
[self showAPPappGaurdView];
}
}
@ -268,6 +266,23 @@
[self animaMask];
}
#pragma mark
-(void)maskTimeCycleTapAction{
[self jxt_showAlertWithTitle:@"提示" message:@"确定结束面膜时间?" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) {
alertMaker.addActionCancelTitle(@"取消");
alertMaker.addActionDefaultTitle(@"结束");
} actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) {
if (buttonIndex == 1) {
[self.cicleProgressView stop];
[self maskTimeEnd];
}
}];
}
#pragma mark -
-(void)animaMask{
@ -294,11 +309,10 @@
[self.view layoutIfNeeded];
} completion:^(BOOL finished) {
// self.cicleProgressView.hidden = NO;
// self.maskImageView.userInteractionEnabled = NO;
//
//[self startMaskTime];
[self updateMaskingView];
}];
}
#pragma mark
@ -425,7 +439,7 @@
//startTest
[self.startTestButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view.mas_top).offset(486 + PhoneX_TopMargin);
make.top.mas_equalTo(self.view.mas_top).offset(476 + PhoneX_TopMargin);
make.size.mas_equalTo(CGSizeMake(132, 41));
make.centerX.mas_equalTo(self.view.mas_centerX);
}];
@ -459,6 +473,7 @@
#pragma mark
-(void)startMaskTime{
self.openDanmuButton.hidden = YES;
//
[self sendBengainMaskTime];
[self createInputView]; //
@ -468,13 +483,12 @@
}
delegate.isMasking = YES;
[_musicPalyer play];
//[self setBackGroundPlayingInfo];//
[self setBackGroundPlayingInfo];//
// s
//NSTimeInterval timeInterVal = [GiGaUserDefault getUserMaskeTime];
NSTimeInterval timeInterVal = 6;
[self.cicleProgressView startWith:timeInterVal];
NSTimeInterval timeInterVal = [GiGaUserDefault getUserMaskeTime];
[self.cicleProgressView startWith:timeInterVal];
//
[self showWaringView];
@ -524,7 +538,7 @@
#pragma mark
-(void)maskTimeEnd{
self.openDanmuButton.hidden = YES;
[self sendEndMaskTime];
NC_POST_NAME_OBJECT(kUserNoti_MASKEND, nil);
//
@ -617,7 +631,7 @@
}else{
userGuardVC.modalPresentationStyle = UIModalPresentationCurrentContext;
}
userGuardVC.view.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.3];
userGuardVC.view.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
[self presentViewController:userGuardVC animated:NO completion:nil];
}

View File

@ -25,7 +25,7 @@
@property(nonatomic,strong) UITableView *tab;
@property(nonatomic,strong) UIImageView *backimageview ;
@property(nonatomic) int curentImageIndex ;
@property(nonatomic,strong) NSArray *descArr;
@end
@ -34,9 +34,9 @@
- (void)viewDidLoad {
[super viewDidLoad];
_curentImageIndex = 0;
_curentImageIndex = 5;
[self creatTabUI];
self.descArr = @[@"生活不易,必须美丽",@"长夜漫漫,不如面膜时间",@"敷片面膜,人间值得",@"打开面膜时间,撰写你与美丽的故事",@"人越美丽,责任越大",@"吃得苦中苦,方为人上人",@"该放弃的决不挽留,该留住的决不放手"];
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(20,20 +PhoneX_TopMargin, 40, 40);
@ -70,8 +70,7 @@
backimageview.frame = CGRectMake(0,0,self.view.frame.size.width, self.view.frame.size.height);
backimageview.userInteractionEnabled = YES;
backimageview.image = [GIGaUserFileHelper getUserShareImage:kUSERSHAREA_IMAGENAME];
// self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"sharebg_1"]];
self.backimageview = backimageview;
self.tab.backgroundView = backimageview;
@ -92,8 +91,10 @@
cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskTimeShareViewCell" owner:self options:nil] lastObject];
}
//
cell.descLabe.text = self.descArr[self.curentImageIndex];
return cell;
}else if (indexPath.row == 1){
MaskShareTimeMidViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MaskShareTimeMidViewCell"];
if (!cell) {
@ -192,26 +193,31 @@
case 1:
{
//
self->_curentImageIndex ++;
if (self->_curentImageIndex == 4) {
self->_curentImageIndex = 0;
self.curentImageIndex ++;
if (self.curentImageIndex > 6) {
self.curentImageIndex = 0;
}
NSArray *images = @[@"sharebg_1",@"sharebg_2",@"sharebg_3",@"sharebg_4",@"sharebg_5"];
NSArray *images = @[@"sharebg_1",@"sharebg_2",@"sharebg_3",@"sharebg_4",@"sharebg_5",@"sharebg_6",@"sharebg_7"];
[self.backimageview setImage:[UIImage imageNamed: images[self->_curentImageIndex]]];
MaskTimeShareViewCell *cell = [self.tab cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
if (self.curentImageIndex==0) {
cell.shareLabe.image = [UIImage imageNamed:@"share_oneblack"];
cell.doinglabel.textColor = [UIColor blackColor];
}
NSArray *shareimages = @[@"share_oneblack",@"share_one",@"share_one",@"share_one",@"share_one",@"share_one",@"share_one"];
NSArray*doingcolorS = @[[UIColor blackColor],GIGARGB(170, 170, 170, 1),[UIColor blackColor],[UIColor blackColor],[UIColor blackColor],[UIColor blackColor],[UIColor blackColor]];
cell.shareLabe.image = [UIImage imageNamed:shareimages[self.curentImageIndex]];
cell.doinglabel.textColor = doingcolorS[self.curentImageIndex];
NSArray *descArr = @[@"生活不易,必须美丽",@"长夜漫漫,不如面膜时间",@"敷片面膜,人间值得",@"打开面膜时间,撰写你与美丽的故事",@"人越美丽,责任越大",@"吃得苦中苦,方为人上人",@"该放弃的决不挽留,该留住的决不放手"];
NSArray *desColor = @[[UIColor whiteColor],[UIColor whiteColor],[UIColor blackColor],[UIColor whiteColor],[UIColor whiteColor],[UIColor whiteColor],[UIColor blackColor]];
cell.descLabe.text = descArr[self.curentImageIndex];
cell.descLabe.textColor = desColor[self.curentImageIndex];
if (self.curentImageIndex == 1) {
cell.shareLabe.image = [UIImage imageNamed:@"share_one"];
cell.doinglabel.textColor = GIGARGB(170, 170, 170, 1);
}
}
@ -324,9 +330,9 @@
}
UIImage *image = [UIImage saveLongImage:self.tab];
[self jxt_showActionSheetWithTitle:@"分享微信" message:@"" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) {
[self jxt_showActionSheetWithTitle:@"分享微信" message:@"" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) {
alertMaker.addActionDefaultTitle(@"友");
alertMaker.addActionDefaultTitle(@"微信好友");
alertMaker.addActionDefaultTitle(@"朋友圈");
alertMaker.addActionCancelTitle(@"取消");
} actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) {
@ -366,6 +372,8 @@
//
-(void)usershareSuccessNoti{
GIGA_ShowToast(@"分享成功");
}

View File

@ -0,0 +1,19 @@
//
// ShareViewSystemImageHelper.h
// GIGA
//
// Created by lianxiang on 2018/9/29.
// Copyright © 2018年 com.giga.ios. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface ShareViewSystemImageHelper : NSObject
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,13 @@
//
// ShareViewSystemImageHelper.m
// GIGA
//
// Created by lianxiang on 2018/9/29.
// Copyright © 2018 com.giga.ios. All rights reserved.
//
#import "ShareViewSystemImageHelper.h"
@implementation ShareViewSystemImageHelper
@end

View File

@ -87,9 +87,11 @@
titleLabel.font = [UIFont fontWithName:GIGA_FONTBOLD size:16];
titleLabel.textColor = GIGARGB(63, 63, 63, 1);
titleLabel.numberOfLines = 2;
//titleLabel.backgroundColor = [UIColor redColor];
self.questionlabel = titleLabel;
[titleLabel sizeToFit];
//[titleLabel sizeToFit];
[self.view addSubview:titleLabel];
UILabel *descLabel = [[UILabel alloc] init];
descLabel.text = @"精准的选择,让小优更好的为您挑选最符合您的肤质的面膜";
@ -113,7 +115,8 @@
make.left.mas_equalTo(numberBtn.mas_right).offset(12);
make.centerY.mas_equalTo(numberBtn.mas_centerY);
make.right.mas_equalTo(self.view.mas_right).offset(-20);
make.height.mas_equalTo(40);
}];
@ -139,9 +142,13 @@
[self.view addSubview:nextBtn];
[nextBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view.mas_top).offset(529 -navH);
if (self.view.frame.size.height <=504) {
make.top.mas_equalTo(self.view.mas_top).offset(504 - navH);
}else{
make.top.mas_equalTo(self.view.mas_top).offset(529 - navH);
}
make.size.mas_equalTo(CGSizeMake(126, 40));
make.left.mas_equalTo(self.view.mas_left).offset(self.view.frame.size.width /2 - 126 /2);
make.left.mas_equalTo(self.view.mas_centerX).offset(- 126 /2);
}];
@ -159,15 +166,23 @@
[self.view addSubview:self.preBtn];
[self.preBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.view.mas_left).offset(69);
make.top.mas_equalTo(self.view.mas_top).offset(529 - navH);
make.size.mas_equalTo(CGSizeMake(97, 40));
if (self.view.frame.size.height <=504) {
make.top.mas_equalTo(self.view.mas_top).offset(504 - navH);
}else{
make.top.mas_equalTo(self.view.mas_top).offset(529 - navH);
}
make.size.mas_equalTo(CGSizeMake(97, 40));
make.left.mas_equalTo(self.view.mas_centerX).offset(-10-97);
}];
if (_page == 1) {
self.preBtn.hidden = YES;
}
[self reloadViews];
}
-(void)creatQustionView{
@ -247,8 +262,8 @@
}else{
model.defaultFlag = 0;
}
}];
}
-(void)loadRequestQuestions{
@ -262,6 +277,10 @@
NSLog(@"result:%@",result.dic);
NSArray *list = result.dic[@"list"];
if (list.count==0 || [list isKindOfClass: [NSNull class]]) {
GIGA_ShowToast(@"空");
return ;
}
for (NSDictionary *answerDic in list) {
ExercisesModel *model = [[ExercisesModel alloc] initWithDictionary:answerDic error:nil];
model.slidervalue = 0;
@ -290,8 +309,8 @@
[self.questonArray addObject:model];
}
self.currentModel = self.questonArray[0];
self.currentModel = self.questonArray[0];
[self initUI];
}
}];
@ -303,6 +322,7 @@
_currentModel = _questonArray[_page - 1];
[self reloadViews];
}
#pragma mark
@ -310,11 +330,20 @@
-(void)reloadViews{
//
// NSAttributedString *numbertitle = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%ld",(long)_page] attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:18],NSForegroundColorAttributeName:[UIColor whiteColor]}];
//
// [_numberBtn setAttributedTitle:numbertitle forState:UIControlStateNormal];
if (_page == self.questonArray.count) {
NSAttributedString *nextTitle = [[NSAttributedString alloc] initWithString:@"完成" attributes:@{NSFontAttributeName:[UIFont fontWithName:GIGA_FONTBOLD size:18],NSForegroundColorAttributeName:[UIColor whiteColor]}];
[_nextBtn setAttributedTitle:nextTitle forState:UIControlStateNormal];
}else{
NSAttributedString *nextTitle = [[NSAttributedString alloc] initWithString:@"下一题" attributes:@{NSFontAttributeName:[UIFont fontWithName:GIGA_FONTBOLD size:18],NSForegroundColorAttributeName:[UIColor whiteColor]}];
[_nextBtn setAttributedTitle:nextTitle forState:UIControlStateNormal];
}
self.questionlabel.text = [NSString stringWithFormat:@"%@",_currentModel.question];
self.descLabel.text = _currentModel.remark;
//
@ -325,19 +354,35 @@
if (_page > 1) {
self.preBtn.hidden = NO;
[self.nextBtn mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view.mas_top).offset(529 -SAFE_NAV_HEIGHT);
make.size.mas_equalTo(CGSizeMake(126, 40));
make.left.mas_equalTo(self.view.mas_left).offset(self.view.frame.size.width /2 + 10);
if (self.view.frame.size.height <= 504) {
[self.nextBtn mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view.mas_top).offset(504 -SAFE_NAV_HEIGHT);
make.size.mas_equalTo(CGSizeMake(126, 40));
make.left.mas_equalTo(self.view.mas_centerX).offset(10);
}];
}];
}else{
[self.nextBtn mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view.mas_top).offset(529 -SAFE_NAV_HEIGHT);
make.size.mas_equalTo(CGSizeMake(126, 40));
make.left.mas_equalTo(self.view.mas_centerX).offset(10);
}];
}
}else{
[self.nextBtn mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view.mas_top).offset(529 -SAFE_NAV_HEIGHT);
if (self.view.frame.size.height <= 504) {
make.top.mas_equalTo(self.view.mas_top).offset(504 -SAFE_NAV_HEIGHT);
}else{
make.top.mas_equalTo(self.view.mas_top).offset(529 -SAFE_NAV_HEIGHT);
}
make.size.mas_equalTo(CGSizeMake(126, 40));
make.left.mas_equalTo(self.view.mas_left).offset(self.view.frame.size.width /2 - 126 /2);
make.left.mas_equalTo(self.view.mas_centerX).offset(-63);
}];
self.preBtn.hidden = YES;
}
@ -349,6 +394,7 @@
[self saveProgress];
if (_page == self.questonArray.count ) {
//GIGA_ShowToast(@"没有了");
[self submitAnswer];
return;
}
@ -363,7 +409,7 @@
-(void)submitAnswer{
[self userTestEnd];
}
@ -397,10 +443,12 @@
//
-(void)getTestResult{
self.nextBtn.userInteractionEnabled = NO;
NSDictionary *params = @{@"singleChoiceList":self.answerArray};
[self.view makeToastActivity:CSToastPositionCenter];
NSString *url = [NSString stringWithFormat:@"%@%@",[GiGaServerConfig getMainUrl],kAiSkinTestResult];
[GiGaNetManager userbodyRequest:url params:params completionHandler:^(NSURLResponse *response, NSDictionary *resDic, NSError * _Nullable error) {
self.nextBtn.userInteractionEnabled = YES;
[self.view hideToastActivity];
GiGaAPIResult *result = [[GiGaAPIResult alloc] initWithDictionary:resDic];
if (result.success) {
@ -423,6 +471,7 @@
// MaskTestResult *model =[[MaskTestResult alloc] initWithDictionary:dic error:nil];
MaskTestResultVC *resultVC = [[MaskTestResultVC alloc] init];
resultVC.model = mode;
resultVC.isfromshouYE = YES;
[self.navigationController pushViewController:resultVC animated:YES];
}else{

View File

@ -11,6 +11,7 @@
@interface MaskTestResultVC : GiGaBaseViewController
@property (nonatomic,strong) MaskTestResult *model;
@property (nonatomic) BOOL isfromshouYE;
@end

View File

@ -17,17 +17,22 @@
#import <WXApi.h>
#import "MaskTestResult.h"
#import "MaskTestNODataViewCell.h"
#import "UIButton+WebCache.h"
#import "UIImageView+WebCache.h"
@interface MaskTestResultVC ()
@property (nonatomic,strong) UIView *tabheader;
//@property (nonatomic,strong) UIImageView *qrimageView;
@end
@implementation MaskTestResultVC
- (void)viewDidLoad {
[super viewDidLoad];
[self addNavTitile:@"测试结果"];
[super viewDidLoad];
// Do any additional setup after loading the view.
[self.view addSubview:self.tableView];
self.tableView.delegate = self;
@ -37,26 +42,160 @@
self.tableView.sectionFooterHeight = 0;
self.tableView.estimatedSectionFooterHeight= 0;
self.tableView.estimatedSectionHeaderHeight = 0;
//self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectMake(0, 0,self.view.frame.size.width, 30)];
self.tableView.frame = CGRectMake(0,0,KMainW, self.view.frame.size.height);
//
UIView *holdView = [[UIView alloc] initWithFrame:CGRectMake(0, 0,self.view.frame.size.width, SAFE_NAV_HEIGHT)];
holdView.backgroundColor = [UIColor whiteColor];
UIView *tabheader = [[UIView alloc] initWithFrame:holdView.bounds];
tabheader.backgroundColor = GIGA_MAIN_BGCOLOR;
[holdView addSubview:tabheader];
UILabel *reslabel = [[UILabel alloc] init];
reslabel.text = @"我的皮肤测试结果:";
reslabel.textColor = [UIColor whiteColor];
reslabel.font = GIGA_TEXTFONTBOLD(20);
[tabheader addSubview:reslabel];
[reslabel sizeToFit];
[reslabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(tabheader.mas_left).offset(18);
make.centerY.mas_equalTo(tabheader.mas_centerY);
}];
UIImageView *shareUserImageView = [[UIImageView alloc] init];
BOOL isUserLogin = [GiGaUserDefault isUserLogin];
if (isUserLogin) {
GiGaUser *user = [[GiGaUserManager shareUser] getCurrentUser];
if (user) {
if (user.headImgUrl && ![user.headImgUrl isKindOfClass:[NSNull class]]) {
NSURL *url = [NSURL URLWithString:user.headImgUrl];
[shareUserImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"nav_circle_avatar"]];
}
}
}
[tabheader addSubview:shareUserImageView];
[shareUserImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(tabheader.mas_right).offset(-18);
make.size.mas_equalTo(CGSizeMake(34, 34));
make.centerY.mas_equalTo(tabheader.mas_centerY);
}];
shareUserImageView.layer.masksToBounds = YES;
shareUserImageView.layer.cornerRadius = 17;
tabheader.hidden = YES;
self.tabheader = tabheader;
self.tableView.tableHeaderView = holdView;
self.tableView.frame = CGRectMake(0,-SAFE_NAV_HEIGHT,KMainW,KMainH);
[self.tableView registerClass:[MaskResultPercentCell class] forCellReuseIdentifier:@"MaskResultPercentCell"];
[self.tableView registerClass:[MaskResultMinViewCell class] forCellReuseIdentifier:@"MaskResultMinViewCell"];
[self.tableView registerClass:[MaskResultShareViewCell class] forCellReuseIdentifier:@"MaskResultShareViewCell"];
// if (@available(iOS 11.0, *)) {
// self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
//
//
// } else {
//
// self.automaticallyAdjustsScrollViewInsets = NO;
// }
if (!self.model) {
[self addNavTitile:@"历史测试"];
[self requstLatestTestData];
}else{
[self addNavTitile:@"测试结果"];
}
NC_ADD_TARGET_NAME_OBJECT(self, @selector(usershareSuccessNoti), NC_UseShareSuccessNoti, nil);
[self initUserAvator];
//
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(0, 0, 40, 40);
[backBtn setImage:[UIImage imageNamed:@"btn_moment_back"] forState:UIControlStateNormal];
[backBtn setImageEdgeInsets:UIEdgeInsetsMake(0,-14, 0, 14)];
//backBtn.backgroundColor = [UIColor redColor];
[backBtn addTarget:self action:@selector(backItemAction) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
}
//
- (void)backItemAction{
if (_isfromshouYE) {
[self.navigationController popToRootViewControllerAnimated:YES];
}else{
[self.navigationController popViewControllerAnimated:YES];
}
}
- (void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
if (_isfromshouYE) {
if([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
}
}
}
- (void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
if (_isfromshouYE) {
if([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = YES;
}
}
}
-(void)dealloc{
NC_REMOVE_NAME(self, NC_UseShareSuccessNoti, nil);
}
-(void)initUserAvator{
//rightItem
UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
rightBtn.frame = CGRectMake(0, 0, 40, 40);
rightBtn.layer.masksToBounds = YES;
rightBtn.layer.cornerRadius = 20;
[rightBtn setImage:[UIImage imageNamed:@"nav_circle_avatar"] forState:UIControlStateNormal];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn];
if ([[[UIDevice currentDevice] systemVersion] doubleValue] >= 11.0) {
[rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(40, 40));
}];
}
BOOL isUserLogin = [GiGaUserDefault isUserLogin];
if (isUserLogin) {
GiGaUser *user = [[GiGaUserManager shareUser] getCurrentUser];
if (user) {
if (user.headImgUrl && ![user.headImgUrl isKindOfClass:[NSNull class]]) {
NSURL *url = [NSURL URLWithString:user.headImgUrl];
[rightBtn sd_setImageWithURL:url forState:UIControlStateNormal];
}
}
}
}
-(void)requstLatestTestData{
[self.view makeToastActivity:CSToastPositionCenter];
@ -139,8 +278,11 @@
if (self.model == nil) {
return 255;
}
CGFloat viewH = KMainH - SAFE_NAV_HEIGHT;
CGFloat cellH = viewH / 3 ;
if (KMainW < 375) {
return 201;
}
CGFloat viewH = self.view.frame.size.height - SAFE_NAV_HEIGHT;
CGFloat cellH = viewH / 3;
return cellH;
}
@ -160,16 +302,17 @@
GIGA_ShowToast(@"未安装微信");
return;
}
UIImage *image = [UIImage saveLongImage:self.tableView];
[self showFinalShareView];
UIImage *image = [UIImage saveNavsuitImage:self.tableView];
//[[GiGaFileNanager shareInstance] saveImaeToAlBum:image];
[self jxt_showActionSheetWithTitle:@"分享微信" message:@"" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) {
[self jxt_showActionSheetWithTitle:@"分享微信" message:@"" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) {
alertMaker.addActionDefaultTitle(@"友");
alertMaker.addActionDefaultTitle(@"微信好友");
alertMaker.addActionDefaultTitle(@"朋友圈");
alertMaker.addActionCancelTitle(@"取消");
} actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) {
[self hidSomeViews];
if (buttonIndex==0) {
//
[self shareImagToWX:image scene:WXSceneSession];
@ -178,9 +321,30 @@
}else if (buttonIndex==1){
//
[self shareImagToWX:image scene:WXSceneTimeline];
}else{
GILog(@"取消");
}
}];
}
-(void)hidSomeViews{
MaskResultShareViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:2 inSection:0]];
cell.qrcodeImage.hidden = YES;
cell.shareBtn.hidden = NO;
cell.lastLabe.text = @"让更多的朋友一起加入面膜时间吧!";
self.tabheader.hidden = YES;
}
-(void)showFinalShareView{
MaskResultShareViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:2 inSection:0]];
cell.qrcodeImage.hidden = NO;
cell.shareBtn.hidden = YES;
cell.lastLabe.text = @"长按扫描二维码,测试你的肤质";
self.tabheader.hidden = NO;
}
-(void)shareImagToWX:(UIImage *)image scene:(int)scene{
WXMediaMessage *msg = [WXMediaMessage message];
@ -207,15 +371,20 @@
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
//
-(void)usershareSuccessNoti{
//GIGA_ShowToast(@"分享成功");
if (_isfromshouYE) {
[self.navigationController popToRootViewControllerAnimated:YES];
}
}
-(void)testBtnAction{
[self.navigationController popToRootViewControllerAnimated:YES];
}
@end

View File

@ -30,6 +30,7 @@
twoLabel.textColor = GIGARGB(240, 147, 147, 0.1);
twoLabel.alpha = 0.6;
twoLabel.font = GIGA_TEXTFONTMEDIUM(200);
//oneLabel.backgroundColor = [UIColor redColor];
[self addSubview:twoLabel];
self.twoLabel = twoLabel;
@ -42,29 +43,55 @@
make.bottom.mas_equalTo(self.mas_bottom);
}];
UILabel *jianyiLabel = [[UILabel alloc] init];
//jianyiLabel.backgroundColor = [UIColor redColor];
jianyiLabel.text = @"建议敷面膜时间";
jianyiLabel.textColor = [UIColor blackColor];
jianyiLabel.font = GIGA_TEXTFONTBOLD(24);
[self addSubview:jianyiLabel];
[jianyiLabel sizeToFit];
[jianyiLabel mas_makeConstraints:^(MASConstraintMaker *make) {
UIImageView *jianyiImageView = [[UIImageView alloc] init];
jianyiImageView.contentMode = UIViewContentModeScaleAspectFit;
jianyiImageView.image = [UIImage imageNamed:@"share_tim"];
[self addSubview:jianyiImageView];
[jianyiImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.mas_left).offset(40);
make.top.mas_equalTo(self.mas_top).offset(36);
if (KMainW < 375) {
make.size.mas_equalTo(CGSizeMake(139, 30));
}else{
make.size.mas_equalTo(CGSizeMake(179, 30));
}
}];
//
UILabel *timeLabel = [[UILabel alloc] init];
timeLabel.textColor = [UIColor blackColor];
timeLabel.font = GIGA_TEXTFONTBOLD(35);
timeLabel.text = @"17分钟";
if (KMainW < 375) {
timeLabel.font = GIGA_TEXTFONTBOLD(24);
}else{
timeLabel.font = GIGA_TEXTFONTBOLD(35);
}
timeLabel.text = @"17";
self.timeLabel = timeLabel;
[self addSubview:timeLabel];
[timeLabel sizeToFit];
[timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.mas_left).offset(73);
make.top.mas_equalTo(jianyiLabel.mas_bottom).offset(20);
make.top.mas_equalTo(jianyiImageView.mas_bottom).offset(20);
}];
//
UIImageView *minueImageview = [[UIImageView alloc] init];
minueImageview.image = [UIImage imageNamed:@"share_minute"];
minueImageview.contentMode = UIViewContentModeScaleAspectFit;
[self addSubview:minueImageview];
[minueImageview mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(timeLabel.mas_right);
if (KMainW < 375) {
//se 5s
make.size.mas_equalTo(CGSizeMake(48, 49));
}else{
make.size.mas_equalTo(CGSizeMake(72, 49));
}
make.centerY.mas_equalTo(timeLabel.mas_centerY);
}];
//
@ -91,7 +118,8 @@
}];
[self bringSubviewToFront:jianyiLabel];
[self bringSubviewToFront:jianyiImageView];
[self bringSubviewToFront:minueImageview];
[self bringSubviewToFront:timeLabel];
}
@ -128,7 +156,7 @@
if ([minute isKindOfClass:[NSNull class]]) {
minute = @"17";
}
NSString *time = [NSString stringWithFormat:@"%@分钟",minute];
NSString *time = [NSString stringWithFormat:@"%@",minute];
self.timeLabel.text = time;
}

View File

@ -80,7 +80,11 @@
UILabel *duibiLabel = [[UILabel alloc] init];
duibiLabel.text = @"皮肤水油比";
duibiLabel.textColor = GIGARGB(55, 55, 55, 1);
duibiLabel.font = GIGA_TEXTFONTBOLD(24);
if (KMainW < 375) {
duibiLabel.font = GIGA_TEXTFONTBOLD(20);
}else{
duibiLabel.font = GIGA_TEXTFONTBOLD(24);
}
[self addSubview:duibiLabel];
[duibiLabel sizeToFit];
[duibiLabel mas_makeConstraints:^(MASConstraintMaker *make) {

View File

@ -15,6 +15,7 @@
-(void)kidTitle:(MaskTestResult *)model;
@property (nonatomic,strong) UILabel *candLabe;
@property (nonatomic,strong) UIImageView *qrcodeImage;
@property (nonatomic,strong) UILabel *lastLabe;
@end

View File

@ -38,13 +38,18 @@
UILabel *candLabe = [[UILabel alloc] init];
candLabe.textColor = [UIColor blackColor];
candLabe.text = @"全效型";
candLabe.font = GIGA_TEXTFONTBOLD(30);
if (KMainW < 375) {
candLabe.font = GIGA_TEXTFONTBOLD(20);
}else{
candLabe.font = GIGA_TEXTFONTBOLD(30);
}
self.candLabe = candLabe;
[self addSubview:candLabe];
[candLabe sizeToFit];
[candLabe mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(shiheLabe.mas_right);
make.top.mas_equalTo(self.mas_top).offset(30);
make.centerY.mas_equalTo(shiheLabe.mas_centerY);
}];
//
NSArray * imagesArr = @[@"result_water",@"result_moon",@"result_push"];
@ -82,7 +87,31 @@
[logo mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.mas_left).offset(26);
make.size.mas_equalTo(CGSizeMake(36, 36));
make.top.mas_equalTo(shareBtn.mas_bottom).offset(7);
if (KMainW < 375) {
make.top.mas_equalTo(self.mas_bottom).offset(-33);
}else{
make.top.mas_equalTo(self.mas_bottom).offset(-21);
}
}];
UIImageView *qrcodeImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"applink"]];
[self addSubview:qrcodeImage];
self.qrcodeImage = qrcodeImage;
self.qrcodeImage.hidden = YES;
[qrcodeImage mas_makeConstraints:^(MASConstraintMaker *make) {
if (KMainW < 375) {
make.size.mas_equalTo(CGSizeMake(60, 60));
make.right.mas_equalTo(self.mas_right).offset(-10);
}else{
make.size.mas_equalTo(CGSizeMake(85, 85));
make.right.mas_equalTo(self.mas_right).offset(-25);
}
make.bottom.mas_equalTo(self.mas_bottom).offset(15);
}];
UILabel *lastLabe = [[UILabel alloc] init];
@ -90,11 +119,13 @@
lastLabe.font = GIGA_TEXTFONTBOLD(12);
lastLabe.textColor = GIGARGB(166, 33, 33, 1);
[self addSubview:lastLabe];
self.lastLabe = lastLabe;
[lastLabe sizeToFit];
[lastLabe mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(logo.mas_centerY);
make.centerX.mas_equalTo(self.mas_centerX);
make.top.mas_equalTo(shareBtn.mas_bottom).offset(15);
}];
//3

View File

@ -17,5 +17,6 @@
@property(nonatomic,copy) NSString *monthMaskNum;
@property(nonatomic,copy) NSString *msg;
@property(nonatomic,copy) NSString *totalMaskNum;
@property(nonatomic,copy) NSString *productImgUrl;
@end

View File

@ -0,0 +1,17 @@
//
// ShareCustomIamgeModel.h
// GIGA
//
// Created by lianxiang on 2018/9/29.
// Copyright © 2018年 com.giga.ios. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface ShareCustomIamgeModel : NSObject
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,13 @@
//
// ShareCustomIamgeModel.m
// GIGA
//
// Created by lianxiang on 2018/9/29.
// Copyright © 2018 com.giga.ios. All rights reserved.
//
#import "ShareCustomIamgeModel.h"
@implementation ShareCustomIamgeModel
@end

View File

@ -110,7 +110,7 @@ static const CGFloat kInputViewH = 44.f;
if (self.SendCommentHandler) {
self.SendCommentHandler(self.inputTextField.text);
}
self.inputTextField.text = @"";
if (![self.inputTextField isFirstResponder]) return;
[self dismissKeyboard];

View File

@ -18,8 +18,8 @@
self.backgroundColor = [UIColor clearColor];
// UIImage *imag = [ZXingWrapper createCodeWithString:@"giga" size:CGSizeMake(170, 170) CodeFomart:kBarcodeFormatQRCode];
UIImage *imag = [UIImage createQrImageWith:[UIImage imageNamed:@"result_logo"] logoSize:CGSizeZero qrText:@"jijia"];
self.codeImageVIew.image = imag;
// UIImage *imag = [UIImage createQrImageWith:[UIImage imageNamed:@"result_logo"] logoSize:CGSizeZero qrText:@"jijia"];
// self.codeImageVIew.image = imag;
}

View File

@ -1,12 +1,11 @@
<?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" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14313.18" 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="Constraints to layout margins" minToolsVersion="6.0"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@ -23,17 +22,20 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="做精致女人" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LJO-K7-zpZ">
<rect key="frame" x="33" y="32" width="85" height="24"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="17"/>
<color key="textColor" red="0.2156862745" green="0.2156862745" blue="0.2156862745" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="从现在开始给皮肤最好的呵护" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6i0-MD-I2r">
<rect key="frame" x="33" y="58" width="221" height="24"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="从现在开始悉心呵护你的肌肤" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6i0-MD-I2r">
<rect key="frame" x="33" y="58" width="191" height="49"/>
<constraints>
<constraint firstAttribute="height" constant="49" id="rnk-Oe-LEL"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="17"/>
<color key="textColor" red="0.2156862745" green="0.2156862745" blue="0.2156862745" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GOk-wH-zsa">
<rect key="frame" x="33" y="103" width="100" height="4"/>
<rect key="frame" x="33" y="128" width="100" height="4"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="100" id="HgT-jl-BEp"/>
@ -41,7 +43,7 @@
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="长按识别二维码一起加入面膜时间吧" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ema-eN-n8K">
<rect key="frame" x="33" y="86" width="160" height="14"/>
<rect key="frame" x="33" y="111" width="160" height="14"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="10"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
@ -52,7 +54,7 @@
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="tq8-in-Amj">
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="applink" translatesAutoresizingMaskIntoConstraints="NO" id="tq8-in-Amj">
<rect key="frame" x="226" y="15" width="85" height="85"/>
<constraints>
<constraint firstAttribute="width" constant="85" id="dP3-Bc-Lp3"/>
@ -72,6 +74,7 @@
<constraint firstItem="GOk-wH-zsa" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leadingMargin" constant="17" id="feu-CD-ceE"/>
<constraint firstItem="6i0-MD-I2r" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="33" id="fsa-Yg-uQP"/>
<constraint firstItem="Ema-eN-n8K" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="33" id="im1-OZ-dbX"/>
<constraint firstItem="tq8-in-Amj" firstAttribute="leading" secondItem="6i0-MD-I2r" secondAttribute="trailing" constant="2" id="lvs-3e-K8e"/>
<constraint firstAttribute="trailing" secondItem="tq8-in-Amj" secondAttribute="trailing" constant="9" id="yPL-AS-Ahb"/>
</constraints>
</tableViewCellContentView>
@ -79,6 +82,10 @@
<connections>
<outlet property="codeImageVIew" destination="tq8-in-Amj" id="Axa-dF-svf"/>
</connections>
<point key="canvasLocation" x="137.59999999999999" y="151.12443778110946"/>
</tableViewCell>
</objects>
<resources>
<image name="applink" width="300" height="300"/>
</resources>
</document>

View File

@ -64,7 +64,7 @@
<color key="textColor" red="0.21568627450980393" green="0.21568627450980393" blue="0.21568627450980393" alpha="1" colorSpace="calibratedRGB"/>
<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="QzN-Xb-uz3">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="我的精致超过了" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QzN-Xb-uz3">
<rect key="frame" x="101" y="107" width="84" height="17"/>
<constraints>
<constraint firstAttribute="width" constant="84" id="KCi-Px-w1F"/>
@ -80,13 +80,13 @@
<color key="textColor" red="0.2156862745" green="0.2156862745" blue="0.2156862745" alpha="1" colorSpace="calibratedRGB"/>
<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="pKf-Uc-fSs">
<rect key="frame" x="218" y="107" width="48" height="17"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="本月敷面膜" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pKf-Uc-fSs">
<rect key="frame" x="206" y="107" width="60" height="17"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
<color key="textColor" red="0.2156862745" green="0.2156862745" blue="0.2156862745" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="min" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="raB-J7-45m">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="raB-J7-45m">
<rect key="frame" x="245" y="158" width="21" height="17"/>
<constraints>
<constraint firstAttribute="height" constant="17" id="MEd-UN-o3r"/>

View File

@ -11,5 +11,7 @@
@interface MaskTimeShareViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UILabel *doinglabel;
@property (weak, nonatomic) IBOutlet UIImageView *shareLabe;
@property (weak, nonatomic) IBOutlet UILabel *descLabe;
@end

View File

@ -1,11 +1,11 @@
<?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" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14313.18" 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"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@ -23,26 +23,26 @@
<rect key="frame" x="112" y="25" width="185" height="85"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="现在做些什么呢?" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rO9-ia-OyA">
<rect key="frame" x="31" y="168" width="112" height="20"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="14"/>
<rect key="frame" x="31" y="168" width="128" height="22.5"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="16"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="What are we doing now?" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ajv-9T-Bcf">
<rect key="frame" x="31" y="195" width="142" height="17"/>
<rect key="frame" x="31" y="197.5" width="142" height="17"/>
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="12"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="share_two" translatesAutoresizingMaskIntoConstraints="NO" id="27f-OZ-xO3">
<rect key="frame" x="33" y="224" width="198" height="35"/>
<rect key="frame" x="33" y="226.5" width="198" height="35"/>
<constraints>
<constraint firstAttribute="width" constant="198" id="kws-RO-ZT9"/>
<constraint firstAttribute="height" constant="35" id="zzS-Dk-zsi"/>
</constraints>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="share_oneblack" translatesAutoresizingMaskIntoConstraints="NO" id="dlk-Er-Voj">
<rect key="frame" x="42" y="229" width="162" height="19"/>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="share_one" translatesAutoresizingMaskIntoConstraints="NO" id="dlk-Er-Voj">
<rect key="frame" x="42" y="231.5" width="162" height="19"/>
<constraints>
<constraint firstAttribute="height" constant="19" id="JLN-Jh-Gue"/>
<constraint firstAttribute="width" constant="162" id="L4g-bl-Q8T"/>
@ -64,6 +64,7 @@
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<connections>
<outlet property="descLabe" destination="rO9-ia-OyA" id="gVT-gy-RXY"/>
<outlet property="doinglabel" destination="ajv-9T-Bcf" id="Le0-Q8-0zg"/>
<outlet property="shareLabe" destination="dlk-Er-Voj" id="iWt-Wf-6y7"/>
</connections>
@ -72,7 +73,7 @@
</objects>
<resources>
<image name="share_logo" width="185" height="85"/>
<image name="share_oneblack" width="133" height="17"/>
<image name="share_one" width="133" height="17"/>
<image name="share_two" width="155" height="35"/>
</resources>
</document>

View File

@ -231,11 +231,15 @@
}
-(void)stop{
self.isMoving = NO;
self.progress = 0 ;
self.currentTimeinterval = 0;
[self.displayLink invalidate];
self.displayLink = nil;
[self.timer destoryTimer];
[self.playTimer invalidate];
self.playTimer = nil;
}
//calculate angle between start to point

View File

@ -1,11 +1,11 @@
<?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" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14313.18" 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"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@ -25,7 +25,7 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="OSF-Gb-h1M">
<rect key="frame" x="6" y="12" width="329" height="217"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="bg_logo" translatesAutoresizingMaskIntoConstraints="NO" id="iJy-9p-48y">
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="bg_logo" translatesAutoresizingMaskIntoConstraints="NO" id="iJy-9p-48y">
<rect key="frame" x="8" y="8" width="313" height="175"/>
<constraints>
<constraint firstAttribute="height" constant="175" id="0Jj-uy-CDT"/>
@ -52,13 +52,13 @@
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="17min" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="H5z-ZV-VGm">
<rect key="frame" x="35" y="17" width="28" height="14"/>
<rect key="frame" x="35" y="17.5" width="28" height="14"/>
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="10"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="这是您敷面膜的第10张" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="o4N-kZ-Uph">
<rect key="frame" x="193" y="17" width="111" height="14"/>
<rect key="frame" x="193" y="17.5" width="111" height="14"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="10"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>

View File

@ -74,7 +74,7 @@
<color key="textColor" red="0.2156862745" green="0.2156862745" blue="0.2156862745" alpha="1" colorSpace="calibratedRGB"/>
<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="Tme-2V-NlI">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="我的精致超过了" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Tme-2V-NlI">
<rect key="frame" x="128.5" y="89" width="84" height="17"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
<color key="textColor" red="0.2156862745" green="0.2156862745" blue="0.2156862745" alpha="1" colorSpace="calibratedRGB"/>
@ -89,8 +89,8 @@
<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="j6s-4L-8FL">
<rect key="frame" x="279" y="89" width="48" height="17"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="本月敷面膜" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="j6s-4L-8FL">
<rect key="frame" x="267" y="89" width="60" height="17"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
<color key="textColor" red="0.2156862745" green="0.2156862745" blue="0.2156862745" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
@ -111,7 +111,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="张" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dic-3G-CvO">
<rect key="frame" x="311" y="139" width="21" height="17"/>
<rect key="frame" x="314" y="139" width="21" height="17"/>
<constraints>
<constraint firstAttribute="height" constant="17" id="7vV-ZK-S0b"/>
<constraint firstAttribute="width" constant="21" id="8AJ-vw-Jnl"/>
@ -137,7 +137,7 @@
<constraint firstItem="dic-3G-CvO" firstAttribute="top" secondItem="j6s-4L-8FL" secondAttribute="bottom" constant="33" id="Ht3-2Y-5Mb"/>
<constraint firstItem="Tme-2V-NlI" firstAttribute="top" secondItem="R09-WA-3qM" secondAttribute="bottom" constant="26" id="KUx-Nw-4kf"/>
<constraint firstItem="R09-WA-3qM" firstAttribute="top" secondItem="tEV-Hx-dgE" secondAttribute="top" constant="61" id="LNc-ql-jSY"/>
<constraint firstAttribute="trailing" secondItem="dic-3G-CvO" secondAttribute="trailing" constant="9" id="Lb3-Ut-P6Z"/>
<constraint firstAttribute="trailing" secondItem="dic-3G-CvO" secondAttribute="trailing" constant="6" id="Lb3-Ut-P6Z"/>
<constraint firstItem="8Kf-o0-1q0" firstAttribute="top" secondItem="Tme-2V-NlI" secondAttribute="bottom" constant="33" id="Lev-qu-Zmr"/>
<constraint firstItem="xEv-bM-Qny" firstAttribute="top" secondItem="Tme-2V-NlI" secondAttribute="bottom" constant="4" id="P0c-5d-JJq"/>
<constraint firstItem="UA6-7v-cad" firstAttribute="leading" secondItem="tEV-Hx-dgE" secondAttribute="leading" constant="19" id="Tzt-3x-Lfy"/>
@ -146,7 +146,7 @@
<constraint firstItem="Yd8-h2-8ZW" firstAttribute="top" secondItem="j6s-4L-8FL" secondAttribute="bottom" constant="3" id="XWR-b8-Nl1"/>
<constraint firstItem="SKr-dU-xbP" firstAttribute="top" secondItem="TkO-iO-bzM" secondAttribute="bottom" constant="4" id="lYD-5E-uY3"/>
<constraint firstItem="UA6-7v-cad" firstAttribute="top" secondItem="tEV-Hx-dgE" secondAttribute="top" constant="10" id="mLH-mh-9mJ"/>
<constraint firstItem="dic-3G-CvO" firstAttribute="leading" secondItem="Yd8-h2-8ZW" secondAttribute="trailing" constant="1" id="rVx-wc-qRN"/>
<constraint firstItem="dic-3G-CvO" firstAttribute="leading" secondItem="Yd8-h2-8ZW" secondAttribute="trailing" constant="4" id="rVx-wc-qRN"/>
<constraint firstItem="5p1-hF-pIU" firstAttribute="leading" secondItem="SKr-dU-xbP" secondAttribute="trailing" constant="8" id="sm5-de-qgC"/>
<constraint firstItem="Yg7-YX-5c6" firstAttribute="top" secondItem="tEV-Hx-dgE" secondAttribute="top" constant="20" id="vNY-Db-SYT"/>
<constraint firstItem="j6s-4L-8FL" firstAttribute="top" secondItem="R09-WA-3qM" secondAttribute="bottom" constant="26" id="xu2-eN-sWL"/>

View File

@ -53,7 +53,12 @@ typedef NS_ENUM(NSUInteger, GYTitlePosition) {
_textLabel.textAlignment = NSTextAlignmentCenter;
_textLabel.textColor = [UIColor whiteColor];
_textLabel.font = GIGA_TEXTFONTMEDIUM(13);
if (KMainW < 375) {
_textLabel.font = GIGA_TEXTFONTMEDIUM(10);
}else{
_textLabel.font = GIGA_TEXTFONTMEDIUM(12);
}
[self.layer addSublayer:_textLabel.layer];
self.clipsToBounds = NO; /*YES*/

View File

@ -1,11 +1,11 @@
<?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" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14313.18" 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"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@ -38,11 +38,11 @@
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ns1-dj-ePW">
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ns1-dj-ePW">
<rect key="frame" x="68.5" y="289" width="238" height="88"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="客服热线: 400-0000-000" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fQZ-vC-DAg">
<rect key="frame" x="44" y="25" width="151" height="17"/>
<rect key="frame" x="43.5" y="25" width="151" height="17"/>
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="12"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>

View File

@ -25,16 +25,27 @@
@property(nonatomic,copy) NSString *xinCode;
@property(nonatomic,strong) NSTimer*timer;
@property(nonatomic) NSInteger time;
@property(nonatomic,strong) UIButton *codeBtn;
@end
@implementation GiGaChangePhoneNumberVC
- (void)dealloc
{
if (self.timer) {
[self.timer invalidate];
self.timer = nil;
}
}
- (void)viewDidLoad {
[super viewDidLoad];
[self addNavTitile:@"修改手机号"];
_nextSteep = NO;
_time = 60;
// Do any additional setup after loading the view from its nib.
[self.view addSubview:self.tableView];
self.tableView.delegate = self;
@ -66,13 +77,23 @@
cell = [[[NSBundle mainBundle] loadNibNamed:@"GIGaUserChangeMobleCell" owner:self options:nil] lastObject];
}
[cell.codeSendBtn addTarget:self action:@selector(sendCodeBtnAction:) forControlEvents:UIControlEventTouchUpInside];
self.codeBtn = cell.codeSendBtn;
if (_nextSteep) {
cell.numberTexFiled.userInteractionEnabled = YES;
cell.numberTexFiled.text = @"";
cell.numberTexFiled.placeholder = @"请输入新手机号";
cell.codeTexFiled.text = @"";
cell.codeTexFiled.placeholder = @"请输入新手机验证码";
cell.oldBtn.backgroundColor = GIGARGB(227, 227, 227, 1);
NSAttributedString *att = [GiGaHelper stringWithText:@"发送验证码" textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(10) leterSpace:0];
[cell.codeSendBtn setAttributedTitle:att forState:UIControlStateNormal];
cell.codeSendBtn.backgroundColor = GIGARGB(181, 14, 14, 1);
cell.codeSendBtn.userInteractionEnabled = YES;
NSAttributedString *atti1 = [GiGaHelper stringWithText:@"1.验证原号码" textColor:GIGARGB(165,165, 165, 1) textFont:GIGA_TEXTFONTMEDIUM(13) leterSpace:0];
[cell.oldBtn setAttributedTitle:atti1 forState:UIControlStateNormal];
@ -122,10 +143,10 @@
[nextBtn addTarget:self action:@selector(nextBtnAction:) forControlEvents:UIControlEventTouchUpInside];
nextBtn.frame = CGRectMake((KMainW - 244)/2 , 5, 244, 41);
if (_nextSteep) {
NSAttributedString *attrititle = [GiGaHelper stringWithText:@"下一步" textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(16) leterSpace:0];
NSAttributedString *attrititle = [GiGaHelper stringWithText:@"完成" textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(16) leterSpace:0];
[nextBtn setAttributedTitle:attrititle forState:UIControlStateNormal];
}else{
NSAttributedString *attrititle = [GiGaHelper stringWithText:@"完成" textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(16) leterSpace:0];
NSAttributedString *attrititle = [GiGaHelper stringWithText:@"下一步" textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(16) leterSpace:0];
[nextBtn setAttributedTitle:attrititle forState:UIControlStateNormal];
}
@ -160,7 +181,7 @@
#pragma mark Or
-(void)nextBtnAction:(UIButton *)btn{
if (_nextSteep) {
GILog(@"完成");
@ -180,8 +201,7 @@
}
[self verifyPhoneCode:cell.numberTexFiled.text code:cell.codeTexFiled.text btn:btn];
}else{
GILog(@"下一步");
@ -195,6 +215,7 @@
GiGaUser *user = [[GiGaUserManager shareUser] getCurrentUser];
if (!user.mobile || [user.mobile isKindOfClass:[NSNull class]]) {
GILog(@"手机号为空");
return;
}
@ -207,8 +228,10 @@
GiGaUser *user = [[GiGaUserManager shareUser] getCurrentUser];
NSString *oldphone = user.mobile;
GIGaUserChangeMobleCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0
inSection:0]];
GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath: kApiChangePhone method:RequestPostMethod parms:@{@"oldMobile":oldphone,@"newMobile":xinNumber,@"oldVerifiedCode":self.oldCode,@"newVerifiedCode":self.xinCode}];
GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath: kApiChangePhone method:RequestPostMethod parms:@{@"oldMobile":oldphone,@"newMobile":xinNumber,@"oldVerifiedCode":self.oldCode,@"newVerifiedCode":cell.codeTexFiled.text}];
[api requstDataWithResult:^(GiGaAPIResult *result) {
btn.userInteractionEnabled = YES;
[self.view hideToastActivity];
@ -226,18 +249,22 @@
-(void)sendCodeBtnAction:(UIButton *)btn{
if (_nextSteep) {
GIGaUserChangeMobleCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
if (cell.numberTexFiled.text.length == 0) {
GIGA_ShowToast(@"请输新手机号");
return;
}
if (![GiGaHelper isPhoneNumber:cell.numberTexFiled.text]) {
GIGA_ShowToast(@"请输入正确手机号");
return;
}
btn.userInteractionEnabled = NO;
[self startTimer:btn];
self.time = 60;
self.xinCode = cell.codeTexFiled.text;
[self sendCodeWith:cell.numberTexFiled.text];
//
[self sendCodeWith:cell.numberTexFiled.text
codebtn:btn];
}else{
@ -247,45 +274,72 @@
return;
}
btn.userInteractionEnabled = NO;
[self startTimer:btn];
[self sendCodeWith:user.mobile];
//
[self sendCodeWith:user.mobile codebtn:btn];
}
}
//
-(void)startTimer:(UIButton *)btn{
-(void)startTimer{
[self cancleTimerCount];
self.timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(startTimercount) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSDefaultRunLoopMode];
}
-(void)startTimercount{
GIGaUserChangeMobleCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0
inSection:0]];
cell.codeSendBtn.backgroundColor = [UIColor lightGrayColor];
cell.codeSendBtn.userInteractionEnabled = NO;
__weak typeof(cell) weakCell = cell;
if (_time>0) {
_timer = [NSTimer scheduledTimerWithTimeInterval:1 count:60 callback:^{
NSString *timeStr=[NSString stringWithFormat:@"%lds",(long)self->_time];
[btn setTitle:timeStr forState:UIControlStateNormal];
self->_time--;
weakify(self);
weakSelf.time -- ;
NSString *timeStr=[NSString stringWithFormat:@"%lds",(long)weakSelf.time];
NSAttributedString *att = [GiGaHelper stringWithText:timeStr textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(10) leterSpace:0];
[weakCell.codeSendBtn setAttributedTitle:att forState:UIControlStateNormal];
if (weakSelf.time==0) {
if (self->_time==0) {
[self codeBtnStateNormal];
}
[weakSelf codeBtnStateNormal];
weakCell.codeSendBtn.userInteractionEnabled = YES;
weakCell.codeSendBtn.backgroundColor = GIGARGB(181, 14, 14, 1);
[self cancleTimerCount];
}];
[[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];
}
}
}
-(void)sendCodeWith:(NSString *)phone{
-(void)cancleTimerCount{
if (self.timer) {
[self.timer invalidate];
self.timer = nil;
}
}
-(void)sendCodeWith:(NSString *)phone codebtn:(UIButton *)btn{
NSString *utl = nil;
if (_nextSteep) {
utl= kApiChangeMobleCode;
utl= kApiChangeMobleNewCode;
}else{
utl= kApiSendPhoneCode;
utl= kApiChangeMobleOldCode;
}
GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath:utl method:RequestPostMethod parms:@{@"mobile":phone}];
[api requstDataWithResult:^(GiGaAPIResult *result) {
if (result.success) {
[self startTimer];
GIGA_ShowToast(@"已发送");
}else{
[self codeBtnStateNormal];
GIGA_ShowToast(result.message);
}
}];
@ -293,12 +347,11 @@
-(void)codeBtnStateNormal{
NSAttributedString *att = [GiGaHelper stringWithText:@"发送验证码" textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(10) leterSpace:0];
[self.codeBtn setAttributedTitle:att forState:UIControlStateNormal];
if (self.timer) {
[self.timer invalidate];
self.timer = nil;
}
self.time =60;
self.codeBtn.userInteractionEnabled = YES;
}
@ -318,12 +371,14 @@
[self finishBtn:btn wtihNewPhone:phonenumber];
}else{
btn.userInteractionEnabled = YES;
[self.view hideToastActivity];
self.nextSteep = YES;
self.oldCode = code;
[self codeBtnStateNormal];
[self.tableView reloadData];
[self codeBtnStateNormal];
}
}else{
@ -334,10 +389,7 @@
}];
}
-(void)dealloc{
[self.timer invalidate];
self.timer = nil;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.

View File

@ -17,8 +17,8 @@
#import "GiGaFeedBackKindView.h"
#import "GIGaUserFileHelper.h"
#import "GiGaServerConfig.h"
@interface GiGaFeedBackViewController ()
#import <Photos/Photos.h>
@interface GiGaFeedBackViewController ()<UIImagePickerControllerDelegate,UINavigationControllerDelegate>
@property(nonatomic,strong) NSMutableArray *imagesUrl;
@property(nonatomic,copy) NSString *kinCode;
@property(nonatomic,strong) UIButton *tijiaoBtn;
@ -58,9 +58,9 @@
[footer addSubview:btn];
self.tijiaoBtn = btn;
self.tableView.tableFooterView = footer;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 4;
}
@ -96,16 +96,18 @@
__weak typeof(cell) weakCell = cell;
cell.pickerBalock = ^{
[[SJPhotoPicker shareSJPhotoPicker] showPhotoPickerToController:self pickedAssets:^(NSArray<PHAsset *> *assets) {
if ((weakCell.images.count + assets.count) > 6) {
GIGA_ShowToast(@"最多六张");
return ;
}
[weakCell.images addObjectsFromArray:assets];
[weakCell.collectionView reloadData];
}];
// [[SJPhotoPicker shareSJPhotoPicker] showPhotoPickerToController:self pickedAssets:^(NSArray<PHAsset *> *assets) {
//
// if ((weakCell.images.count + assets.count) > 6) {
// GIGA_ShowToast(@"最多六张");
// return ;
// }
// [weakCell.images addObjectsFromArray:assets];
// [weakCell.collectionView reloadData];
//
//
// }];
[self showAcitonSheet];
};
return cell;
@ -200,36 +202,29 @@
dic = @{@"type":self.kinCode,@"content":contencell.contentFiled.text,@"contact":qqcom
};
//
if (self.imagesUrl.count <= 0) {
//
[self uploadFeedinfo:dic imgUrlList:self.imagesUrl];
}else{
////
[self uploadImags:dic];
}
[self uploadImags:dic];
}
// imageurls
// imageurls
-(void)uploadImags:(NSDictionary *)params{
[self.imagesUrl removeAllObjects];
GIGaFeedPhontosViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:3]];
NSArray *names =cell.imageNames;
if (names.count <= 0) {
GIGA_ShowToast(@"请选择图片");
//
[self uploadFeedinfo:params imgUrlList:self.imagesUrl];
GILog(@"未选择图片");
return;
}
NSLog(@"names:%@",names);
[self.view makeToastActivity:CSToastPositionCenter];
//.线
//
dispatch_queue_t queue = dispatch_queue_create("serialQueue", DISPATCH_QUEUE_SERIAL);
for (NSUInteger i= 0; i < names.count; i ++) {
dispatch_sync(queue, ^{
@ -248,9 +243,7 @@
}
}
//
-(void)uploadImage:(NSData *)imageData name:(NSString *)name info:(NSDictionary *)info totalCount:(NSInteger)count{
[self.view makeToastActivity:CSToastPositionCenter];
self.tijiaoBtn.userInteractionEnabled = NO;
@ -278,6 +271,7 @@
[GiGaBaseAPiRequest userTokenTimeOutGologinFromVC:self];
}else{
GIGA_ShowToast(result.message);
self.tijiaoBtn.userInteractionEnabled = YES;
}
@ -322,6 +316,7 @@
}
//
-(void)mutipuleUpload{
// [GiGaNetManager uploadImage:kUploadFeed imageNames:names parms:@{@"file":@"file"} responseBlock:^(NSDictionary *responseDict, NSDictionary *responseHeaderFields, NSError *error) {
// [self.view hideToastActivity];
// if (error) {
@ -352,6 +347,152 @@
// Dispose of any resources that can be recreated.
}
-(void)showAcitonSheet{
[self jxt_showActionSheetWithTitle:@"选择图片" message:@"" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) {
alertMaker.addActionDefaultTitle(@"拍照");
alertMaker.addActionDefaultTitle(@"相册");
alertMaker.addActionCancelTitle(@"取消");
} actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) {
if (buttonIndex == 0) {
[self satartCamera];
}else if (buttonIndex == 1){
[self fromAlbums];
}
}];
}
-(void)fromAlbums{
GIGaFeedPhontosViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:3]];
[[SJPhotoPicker shareSJPhotoPicker] showPhotoPickerToController:self pickedAssets:^(NSArray<PHAsset *> *assets) {
if (assets.count == 0) {
return ;
}
for (NSInteger i= 0; i < assets.count; i++) {
[cell.images addObject:assets[i]];
if ((cell.images.count) == 6) {
GIGA_ShowToast(@"最多六张");
break;
}
}
[cell.collectionView reloadData];
}];
}
-(void)satartCamera{
GIGaFeedPhontosViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:3]];
if ((cell.images.count + 1) > 6) {
GIGA_ShowToast(@"最多六张");
return ;
}
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; imagePickerController.delegate = self; imagePickerController.allowsEditing = YES;
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
//使
NSString *mediaType = AVMediaTypeVideo;//
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:mediaType];//
if(authStatus == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied){
NSString *errorStr = @"应用相机权限受限,请在设置中启用";
[self jxt_showAlertWithTitle:@"" message:errorStr appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) {
alertMaker.addActionCancelTitle(@"取消");
alertMaker.addActionDefaultTitle(@"去开启");
} actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) {
if (buttonIndex == 1) {
NSString *urlStr = @"App-Prefs:root=Photos";
if (@available(iOS 10.0, *)) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlStr] options:@{} completionHandler:nil];
} else {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlStr]];
// Fallback on earlier versions
}
}
}];
return;
}
//
imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentViewController:imagePickerController animated:YES completion:nil];
}
}
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{
[picker dismissViewControllerAnimated:YES completion:nil];
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<UIImagePickerControllerInfoKey,id> *)info
{
[picker dismissViewControllerAnimated:YES completion:nil];
GIGaFeedPhontosViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:3]];
UIImage*imge=[info objectForKey:UIImagePickerControllerEditedImage];
//
NSError *error = nil;
//__block PHObjectPlaceholder *createdAsset = nil;
NSMutableArray *imageIds = [NSMutableArray array];
[[PHPhotoLibrary sharedPhotoLibrary] performChangesAndWait:^{
PHAssetChangeRequest *req = [PHAssetChangeRequest creationRequestForAssetFromImage:imge];
[imageIds addObject:req.placeholderForCreatedAsset.localIdentifier];
} error:&error];
if (error) {
NSLog(@"%@",error.localizedDescription);
}else{
__block PHAsset *imageAsset = nil;
PHFetchResult *result = [PHAsset fetchAssetsWithLocalIdentifiers:imageIds options:nil];
[result enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
imageAsset = obj;
*stop = YES;
}];
if (imageAsset) {
[cell.images addObject:imageAsset];
[cell.collectionView reloadData];
}
}
}
#pragma mark - < PHAsset >
- (NSArray *)getAllPhotosAssetInAblumCollection:(PHAssetCollection *)assetCollection ascending:(BOOL)ascending {
//
NSMutableArray *assets = [NSMutableArray array];
//
PHFetchOptions *option = [[PHFetchOptions alloc] init]; option.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:ascending]]; option.predicate = [NSPredicate predicateWithFormat:@"mediaType == %ld", PHAssetMediaTypeImage];
//
PHFetchResult *result = [PHAsset fetchAssetsInAssetCollection:assetCollection options:option];
//
[result enumerateObjectsUsingBlock:^(PHAsset *asset, NSUInteger idx, BOOL * _Nonnull stop) {
[assets addObject:asset];
}];
return assets;
}
@end

View File

@ -24,6 +24,7 @@
#import "GiGaNetManager.h"
#import "GiGaServerConfig.h"
#import "GiGaAPIResult.h"
#import "JobModel.h"
@interface GiGaUserViewController ()<LYSDatePickerSelectDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate>
@property (nonatomic,strong) GiGaUser *user;
@ -63,6 +64,7 @@
}
-(void)creatTab{
[self.view addSubview:self.tableView];
self.tableView.delegate = self;
self.tableView.dataSource = self;
@ -134,7 +136,7 @@
}
[cell loadCellData:indexPath user:self.user];
//0 1
//2 1
weakify(self);
[cell userSelectSexAction:^(int sex) {
weakSelf.user.sexCode = sex;
@ -166,8 +168,9 @@
}];
}];
[cell setButtnImage:self.jobSpread with:self.jobArr];
[cell userSelectjob:^(NSString *title) {
self.user.occupationCode = title;
[cell userSelectjob:^(JobModel *job) {
self.user.occupationCode = job.dictCode;
self.user.occupationName = job.dictLabel;
[UIView performWithoutAnimation:^{
[tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:3 inSection:2]] withRowAnimation:UITableViewRowAnimationNone];
@ -372,11 +375,12 @@
GiGaBaseAPiRequest *api =[GiGaBaseAPiRequest initWithRequestPath:kApiOccuption method:RequestPostMethod parms:param];
[api requstDataWithResult:^(GiGaAPIResult *result) {
if (result.success) {
// GILog(@"%@",result.dic);
GILog(@"%@",result.dic);
NSDictionary *dic = result.dic;
NSArray *josA = dic[@"list"];
for (NSDictionary *jobDic in josA ) {
[self.jobArr addObject:jobDic[@"dictLabel"]];
JobModel *mdel = [[JobModel alloc] initWithDictionary:jobDic error:nil];
[self.jobArr addObject:mdel];
}
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:3] withRowAnimation:UITableViewRowAnimationNone];
@ -395,7 +399,8 @@
-(void)showCameraAndPhotoAlert{
UIAlertController *alertSheet = [UIAlertController alertControllerWithTitle:@"选择头像" message:nil preferredStyle:UIAlertControllerStyleActionSheet]; UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; imagePickerController.delegate = self; imagePickerController.allowsEditing = YES;
UIAlertController *alertSheet = [UIAlertController alertControllerWithTitle:@"选择头像" message:nil preferredStyle:UIAlertControllerStyleActionSheet];
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; imagePickerController.delegate = self; imagePickerController.allowsEditing = YES;
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
UIAlertAction *cameraAction = [UIAlertAction actionWithTitle:@"拍照" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {

View File

@ -87,7 +87,14 @@
cell.timeLabe.text = [NSString stringWithFormat:@"%ld",(long)self.totalMinute];
if (self.exquisitePercent) {
cell.rankLabe.text = [NSString stringWithFormat:@"本月超过%@用户",self.exquisitePercent];
NSString *text = [NSString stringWithFormat:@"本月超过%@用户",self.exquisitePercent];
NSString *percent = self.exquisitePercent;
NSRange range = [text rangeOfString:percent];
NSMutableAttributedString *atttri =[[NSMutableAttributedString alloc] initWithString:text];
[atttri addAttributes:@{NSFontAttributeName:GIGA_TEXTFONTMEDIUM(16)} range:range];
//cell.rankLabe.text = [NSString stringWithFormat:@"本月超过%@用户",self.exquisitePercent];
cell.rankLabe.attributedText = atttri;
}
[cell.guizeBtn addTarget:self action:@selector(guizeShow) forControlEvents:UIControlEventTouchUpInside];

View File

@ -15,6 +15,8 @@
#import "GIGaAboutUsVC.h"
#import "GiGaFeedBackViewController.h"
#import "GiGaWebViewController.h"
#import "GiGaServerConfig.h"
@interface GiSysSettingsVC ()
@end
@ -80,9 +82,9 @@
}else if (indexPath.row == 3){
// AppVerionDescriptionVC *verVC =[[AppVerionDescriptionVC alloc] init];
// [self.navigationController pushViewController:verVC animated:YES];
//
GiGaWebViewController *webVC = [[GiGaWebViewController alloc] init];
webVC.url = @"";
webVC.url = kIMPRITNT;
webVC.souceType = WebSourceTypeUrlLink;
[self.navigationController pushViewController:webVC animated:YES];
@ -149,6 +151,7 @@
}
}];
}
//http://yts.s1.natapp.cc/mask/clearZear.html
-(void)userlogOut{

View File

@ -25,6 +25,7 @@
@property(nonatomic,copy) NSString *mobileStatusName;
@property(nonatomic,copy) NSString *nickName;
@property(nonatomic,copy) NSString *occupationCode;
@property(nonatomic,copy) NSString *occupationName;
@property(nonatomic,copy) NSString *provinceId;
@property(nonatomic,copy) NSString *provinceName;
@property(nonatomic,assign) int sexCode;

View File

@ -0,0 +1,18 @@
//
// JobModel.h
// GIGA
//
// Created by lianxiang on 2018/9/29.
// Copyright © 2018年 com.giga.ios. All rights reserved.
//
#import <JSONModel/JSONModel.h>
@interface JobModel : JSONModel
@property(nonatomic,copy) NSString *dictLabel;
@property(nonatomic,copy) NSString *dictCode;
@end

View File

@ -0,0 +1,18 @@
//
// JobModel.m
// GIGA
//
// Created by lianxiang on 2018/9/29.
// Copyright © 2018 com.giga.ios. All rights reserved.
//
#import "JobModel.h"
@implementation JobModel
+ (BOOL)propertyIsOptional:(NSString *)propertyName{
return YES;
}
@end

View File

@ -30,7 +30,7 @@
}
if ( textView.text.length <=100 ) {
self.holdLabe.hidden = YES;
self.numberCountLabe.text = [NSString stringWithFormat:@"%lu/100",(unsigned long)textView.text.length];
self.contentFiled.text = textView.text;
self.textMAx = textView.text;

View File

@ -6,7 +6,6 @@
<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>
@ -14,10 +13,10 @@
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="MasHistoryFirstViewCell" rowHeight="170" id="KGk-i7-Jjw" customClass="MasHistoryFirstViewCell">
<rect key="frame" x="0.0" y="0.0" width="320" height="170"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="170"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="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="169.5"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="169.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="f8a-yz-Ecb">
@ -30,54 +29,18 @@
<inset key="titleEdgeInsets" minX="-80" minY="0.0" maxX="0.0" maxY="0.0"/>
<state key="normal" title="清零小规则" image="history_rule"/>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kdE-Q9-u1i">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="* 请在一周内再次使用面膜" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kdE-Q9-u1i">
<rect key="frame" x="22" y="42" width="57" height="26"/>
<constraints>
<constraint firstAttribute="width" constant="57" id="HVg-ED-OKU"/>
<constraint firstAttribute="height" constant="26" id="n41-cc-XrC"/>
</constraints>
<string key="text">* 请在80小时内
再次使用面膜</string>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="8"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="XgR-jp-VUJ">
<rect key="frame" x="109" y="11" width="100" height="100"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="共敷" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="7" translatesAutoresizingMaskIntoConstraints="NO" id="yat-Uk-2j1">
<rect key="frame" x="32" y="12" width="37" height="25.5"/>
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="18"/>
<color key="textColor" red="1" 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" text="min" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aJM-2t-hFP">
<rect key="frame" x="38.5" y="64" width="24.5" height="20"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="14"/>
<color key="textColor" red="1" 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" text="180" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fqH-WX-zEA">
<rect key="frame" x="22" y="25" width="58" height="50.5"/>
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="36"/>
<color key="textColor" red="1" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="yat-Uk-2j1" firstAttribute="top" secondItem="XgR-jp-VUJ" secondAttribute="top" constant="12" id="3xZ-MZ-f3I"/>
<constraint firstItem="aJM-2t-hFP" firstAttribute="centerX" secondItem="XgR-jp-VUJ" secondAttribute="centerX" id="P2i-aA-ZJF"/>
<constraint firstItem="fqH-WX-zEA" firstAttribute="centerX" secondItem="XgR-jp-VUJ" secondAttribute="centerX" constant="1" id="dhW-15-2LC"/>
<constraint firstAttribute="width" secondItem="XgR-jp-VUJ" secondAttribute="height" multiplier="1:1" id="fVj-dY-YeA"/>
<constraint firstAttribute="bottom" secondItem="aJM-2t-hFP" secondAttribute="bottom" constant="16" id="pvb-40-kKm"/>
<constraint firstItem="yat-Uk-2j1" firstAttribute="centerX" secondItem="XgR-jp-VUJ" secondAttribute="centerX" constant="0.5" id="t5T-IV-EBK"/>
<constraint firstItem="fqH-WX-zEA" firstAttribute="centerY" secondItem="XgR-jp-VUJ" secondAttribute="centerY" id="vdQ-y0-8o5"/>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="88" id="zgI-yU-SUl"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="本月超过80%的用户" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gnX-9k-8vZ">
<rect key="frame" x="175" y="139" width="129" height="20"/>
<rect key="frame" x="230" y="139" width="129" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="Q4p-6w-N8a"/>
</constraints>
@ -85,18 +48,61 @@
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="XgR-jp-VUJ">
<rect key="frame" x="128" y="11" width="119" height="118"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="共敷" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="7" translatesAutoresizingMaskIntoConstraints="NO" id="yat-Uk-2j1">
<rect key="frame" x="41" y="16" width="37" height="25.5"/>
<constraints>
<constraint firstAttribute="width" constant="37" id="3yU-pS-4Pb"/>
<constraint firstAttribute="height" constant="25.5" id="EC2-3e-Xae"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="18"/>
<color key="textColor" red="1" 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" text="180" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fqH-WX-zEA">
<rect key="frame" x="30" y="40" width="58" height="50.5"/>
<constraints>
<constraint firstAttribute="height" constant="50.5" id="85h-EW-hg3"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="36"/>
<color key="textColor" red="1" 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" text="min" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aJM-2t-hFP">
<rect key="frame" x="47" y="90" width="24.5" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="5Oe-im-gkA"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="14"/>
<color key="textColor" red="1" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="fqH-WX-zEA" firstAttribute="centerX" secondItem="XgR-jp-VUJ" secondAttribute="centerX" id="Huy-BG-lGv"/>
<constraint firstItem="aJM-2t-hFP" firstAttribute="centerX" secondItem="XgR-jp-VUJ" secondAttribute="centerX" id="RgZ-CQ-Lhm"/>
<constraint firstItem="aJM-2t-hFP" firstAttribute="top" secondItem="fqH-WX-zEA" secondAttribute="bottom" constant="-0.5" id="WBv-2U-0cS"/>
<constraint firstItem="yat-Uk-2j1" firstAttribute="top" secondItem="XgR-jp-VUJ" secondAttribute="top" constant="16" id="WZC-sR-cPc"/>
<constraint firstAttribute="width" constant="119" id="WsA-J0-Gli"/>
<constraint firstItem="yat-Uk-2j1" firstAttribute="centerX" secondItem="XgR-jp-VUJ" secondAttribute="centerX" id="aLv-jU-RHg"/>
<constraint firstAttribute="height" constant="118" id="aOY-R6-46q"/>
<constraint firstItem="fqH-WX-zEA" firstAttribute="top" secondItem="yat-Uk-2j1" secondAttribute="bottom" constant="-1.5" id="eot-uQ-07L"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" red="1" green="0.70196078431372544" blue="0.70196078431372544" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="kdE-Q9-u1i" firstAttribute="top" secondItem="f8a-yz-Ecb" secondAttribute="bottom" constant="-6" id="33L-Pm-zjw"/>
<constraint firstItem="XgR-jp-VUJ" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="11" id="F2r-eg-vAz"/>
<constraint firstAttribute="trailing" secondItem="XgR-jp-VUJ" secondAttribute="trailing" constant="111" id="UwV-Lm-aak"/>
<constraint firstItem="XgR-jp-VUJ" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="11" id="3HH-sH-rJP"/>
<constraint firstItem="gnX-9k-8vZ" firstAttribute="top" secondItem="XgR-jp-VUJ" secondAttribute="bottom" constant="10" id="992-53-WQM"/>
<constraint firstItem="XgR-jp-VUJ" firstAttribute="centerX" secondItem="H2p-sc-9uM" secondAttribute="centerX" id="JUF-mj-xVh"/>
<constraint firstItem="f8a-yz-Ecb" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="VMM-iR-qKh"/>
<constraint firstAttribute="trailing" secondItem="gnX-9k-8vZ" secondAttribute="trailing" constant="16" id="aUb-zx-Io4"/>
<constraint firstItem="f8a-yz-Ecb" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="3" id="fed-Wy-3U8"/>
<constraint firstItem="gnX-9k-8vZ" firstAttribute="top" secondItem="XgR-jp-VUJ" secondAttribute="bottom" constant="28" id="hQc-U7-TzD"/>
<constraint firstAttribute="bottom" secondItem="gnX-9k-8vZ" secondAttribute="bottom" constant="10.5" id="heD-OR-neY"/>
<constraint firstItem="XgR-jp-VUJ" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="109" id="mKf-YY-Itt"/>
<constraint firstItem="kdE-Q9-u1i" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="22" id="ts5-1h-1Td"/>
</constraints>
</tableViewCellContentView>

View File

@ -13,7 +13,7 @@
@property (weak, nonatomic) IBOutlet UIButton *skinBtn;
@property (weak, nonatomic) IBOutlet UIButton *timeBtn;
@property (weak, nonatomic) IBOutlet UILabel *timeLabe;
@property (weak, nonatomic) IBOutlet UILabel *timesLabe;
-(void)loadCellDataAt:(NSIndexPath *)indepath recod:(MaskHistryRecord*)model;
@end

View File

@ -23,16 +23,17 @@
-(void)loadCellDataAt:(NSIndexPath *)indepath recod:(MaskHistryRecord*)model
{
self.timesLabe.text = [NSString stringWithFormat:@"第%@天敷面膜",model.dayNum];
self.timeLabe.text = model.createTime;
if (![model.skinTypeName isKindOfClass:[NSNull class]] && model.skinTypeName) {
NSAttributedString *atrtskin = [GiGaHelper stringWithText:model.skinTypeName textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTMEDIUM(10) leterSpace:0];
if (![model.dayNum isKindOfClass:[NSNull class]] && model.dayNum) {
NSString *str = [NSString stringWithFormat:@"%@天",model.dayNum];
NSAttributedString *atrtskin = [GiGaHelper stringWithText:str textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTMEDIUM(10) leterSpace:0];
[self.skinBtn setAttributedTitle:atrtskin forState:UIControlStateNormal];
}
if (![model.minute isKindOfClass:[NSNull class]] && model.minute) {
NSAttributedString *atrtskin = [GiGaHelper stringWithText:[NSString stringWithFormat:@"倒计时%@分钟",model.minute] textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTMEDIUM(10) leterSpace:0];
NSAttributedString *atrtskin = [GiGaHelper stringWithText:[NSString stringWithFormat:@"%@分钟",model.minute] textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTMEDIUM(10) leterSpace:0];
[self.timeBtn setAttributedTitle:atrtskin forState:UIControlStateNormal];
}

View File

@ -39,10 +39,12 @@
<inset key="imageEdgeInsets" minX="-31" minY="0.0" maxX="0.0" maxY="0.0"/>
<state key="normal" title="2天" image="user_day"/>
</button>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="yqe-qC-fXL">
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="yqe-qC-fXL">
<rect key="frame" x="0.0" y="89" width="320" height="1"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.92156862745098034" green="0.92156862745098034" blue="0.92156862745098034" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="aWv-dI-zfh"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xUV-cj-Gt5">
<rect key="frame" x="128" y="22" width="80" height="22"/>
@ -58,9 +60,12 @@
</subviews>
<constraints>
<constraint firstItem="xUV-cj-Gt5" firstAttribute="leading" secondItem="TIW-fP-uXf" secondAttribute="trailing" constant="32" id="FLX-8w-r6S"/>
<constraint firstAttribute="bottom" secondItem="yqe-qC-fXL" secondAttribute="bottom" id="H0P-mF-de9"/>
<constraint firstItem="yqe-qC-fXL" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="Ift-bs-oY0"/>
<constraint firstItem="2o1-kY-jHA" firstAttribute="top" secondItem="TIW-fP-uXf" secondAttribute="bottom" constant="21" id="Lix-N2-E7N"/>
<constraint firstItem="TIW-fP-uXf" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="22" id="OK4-lu-IY7"/>
<constraint firstItem="xUV-cj-Gt5" firstAttribute="centerY" secondItem="TIW-fP-uXf" secondAttribute="centerY" id="U8G-ca-TRT"/>
<constraint firstAttribute="trailing" secondItem="yqe-qC-fXL" secondAttribute="trailing" id="ZZF-vh-ZnH"/>
<constraint firstItem="2o1-kY-jHA" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="gw8-ZC-PCe"/>
<constraint firstAttribute="bottom" secondItem="2o1-kY-jHA" secondAttribute="bottom" constant="10.5" id="rmO-12-pDZ"/>
<constraint firstItem="TIW-fP-uXf" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="ze4-YE-CYw"/>

View File

@ -7,7 +7,9 @@
//
#import <UIKit/UIKit.h>
#import "JobModel.h"
@interface JobMaskButton : UIButton
@property (nonatomic,copy) NSString *jobStr;
@property (nonatomic,strong) JobModel *job;
@end

View File

@ -45,9 +45,11 @@
}else if (indexPath.section == 2 && indexPath.row == 3){
self.cityLabel.text = @"职业";
if (user.occupationCode && ![user.occupationCode isKindOfClass:[NSNull class]] && ![user.occupationCode isEqualToString:@""]) {
self.detalTitle.text = user.occupationCode;
if (user.occupationName && ![user.occupationName isKindOfClass:[NSNull class]] && ![user.occupationName isEqualToString:@""]) {
self.detalTitle.text = user.occupationName;
}else{
self.detalTitle.text = @"请从下方标签中选择一项";
}
}

View File

@ -8,9 +8,10 @@
#import <UIKit/UIKit.h>
//展开关闭按钮
#import "JobModel.h"
typedef void (^jobBtnAction)(void);
//选中
typedef void (^jobSelectAction)(NSString *title);
typedef void (^jobSelectAction)(JobModel *model);
@interface GiGaUserJobViewCell : UITableViewCell
@property (nonatomic,strong) UIButton *upDownBtn;

View File

@ -13,11 +13,11 @@
#define MAR_GAINX 22.f //
#define MARK_H 31.f //
@interface GiGaUserJobViewCell()
@property (nonatomic,assign) int countY;
@property (nonatomic,assign) int countX;
@property (nonatomic,strong) NSArray *titles;
@property (nonatomic,copy) NSString *selectjob;
@property (nonatomic) CGFloat btnMaXY;
@end
@ -32,7 +32,7 @@
_countX = 0;
_btnMaXY = 10;
[self creatUI];
self.titles = [NSArray new];
self.jobs = [NSArray new];
//self.backgroundColor = [UIColor blueColor];
}
return self;
@ -69,21 +69,21 @@
}
-(void)setButtnImage:(BOOL)isUp with:(NSArray *)titles{
self.titles = titles;
self.selectjob = @"";
-(void)setButtnImage:(BOOL)isUp with:(NSArray *)jobs{
self.jobs = jobs;
if (isUp) {
[self setUpUPSubViewstitles:titles isUp:isUp];
[self setUpUPSubViewstitles:jobs isUp:isUp];
}else{
[self setUpDownSubviewstitles:titles isUp:isUp];
[self setUpDownSubviewstitles:jobs isUp:isUp];
}
}
-(void)setUpUPSubViewstitles:(NSArray *)titles isUp:(BOOL)isUp{
-(void)setUpUPSubViewstitles:(NSArray *)jobs isUp:(BOOL)isUp{
//
[_upDownBtn setBackgroundImage:[UIImage imageNamed:@"userjob_up"] forState:UIControlStateNormal];
if (titles.count > 0) {
if (jobs.count > 0) {
for (JobMaskButton *btn in self.subviews) {
if ([btn isKindOfClass:[JobMaskButton class]]) {
@ -93,10 +93,11 @@
_countX =0;
_countY = 0;
CGFloat X = MAR_GAINX;
for (int i=0; i<titles.count; i ++) {
for (int i=0; i<jobs.count; i ++) {
CGFloat width = 0;
NSString *title = titles[i];
JobModel *mode = jobs[i];
NSString *title = mode.dictLabel;
if (title.length == 2) {
width = 55;
}else if (title.length == 3){
@ -108,7 +109,7 @@
width = 55;
}
[self creatjob:titles[i] index:i isUp:isUp orinX:X width:width];
[self creatjob:mode index:i isUp:isUp orinX:X width:width];
if (_countX == 0) {
X = MAR_GAINX;
}else{
@ -119,10 +120,10 @@
}
}
-(void)setUpDownSubviewstitles:(NSArray *)titles isUp:(BOOL)isUp{
-(void)setUpDownSubviewstitles:(NSArray *)jobs isUp:(BOOL)isUp{
//
[_upDownBtn setBackgroundImage:[UIImage imageNamed:@"userjob_down"] forState:UIControlStateNormal];
if (titles.count > 0) {
if (jobs.count > 0) {
// [titles enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
// NSString *title = obj;
// [self creatjob:title index:idx];
@ -136,10 +137,11 @@
_countX =0;
_countY = 0;
CGFloat X = MAR_GAINX;
for (int i=0; i<titles.count; i ++) {
for (int i=0; i<jobs.count; i ++) {
CGFloat width = 0;
NSString *title = titles[i];
JobModel *mode = jobs[i];
NSString *title = mode.dictLabel;
if (title.length == 2) {
width = 55;
}else if (title.length == 3){
@ -151,7 +153,7 @@
width = 55;
}
[self creatjob:titles[i] index:i isUp:isUp orinX:X width:width];
[self creatjob:mode index:i isUp:isUp orinX:X width:width];
if (_countX == 0) {
X = MAR_GAINX;
@ -163,7 +165,7 @@
}
}
-(void)creatjob:(NSString *)title index:(int)idx isUp:(BOOL)isUp orinX:(CGFloat)X width:(CGFloat)width{
-(void)creatjob:(JobModel *)job index:(int)idx isUp:(BOOL)isUp orinX:(CGFloat)X width:(CGFloat)width{
CGFloat Y = 10 + (MARK_H + SPACE_Y)*_countY;
@ -193,7 +195,7 @@
}
if (idx == self.titles.count - 1) {
if (idx == self.jobs.count - 1) {
_btnMaXY = Y;
[self updateActionBtnFrame];
}
@ -206,8 +208,11 @@
jobBtn.layer.cornerRadius = MARK_H /2;
jobBtn.layer.borderWidth = 1;
jobBtn.layer.borderColor = GIGARGB(222, 222, 222, 1).CGColor;
jobBtn.jobStr = title;
NSAttributedString *attri = [GiGaHelper stringWithText:title textColor:GIGARGB(151, 151, 151, 1) textFont:GIGA_TEXTFONTMEDIUM(13) leterSpace:0];
jobBtn.job = job;
if (!job.dictLabel) {
job.dictLabel = @"??";
}
NSAttributedString *attri = [GiGaHelper stringWithText:job.dictLabel textColor:GIGARGB(151, 151, 151, 1) textFont:GIGA_TEXTFONTMEDIUM(13) leterSpace:0];
[jobBtn setAttributedTitle:attri forState:UIControlStateNormal];
jobBtn.frame = CGRectMake(X,Y,width, MARK_H);
[jobBtn addTarget:self action:@selector(jobClick:) forControlEvents:UIControlEventTouchUpInside];
@ -226,7 +231,7 @@
-(void)jobClick:(JobMaskButton *)btn{
self.jobblock(btn.jobStr);
self.jobblock(btn.job);
}
- (void)awakeFromNib {

View File

@ -25,7 +25,7 @@
-(void)configUserSex:(int)sex{
if (sex == 0) {
if (sex == 2) {
[self.usefemale setImage:[UIImage imageNamed:@"sex_selected"] forState:UIControlStateNormal];
[self.usermale setImage:[UIImage imageNamed:@"sex_disselect"] forState:UIControlStateNormal];
}else{
@ -40,8 +40,8 @@
}
-(void)userfemaleClick{
self.actionblock(0);
[self configUserSex:0];
self.actionblock(2);
[self configUserSex:2];
}
-(void)userSelectSexAction:(femaleBtnAction)block{
self.actionblock = block;