Commit 4fcb2bc6 cgx

完成首页活动运营及首次启动弹框

1 个父辈 bd3d46eb
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
39CC172FB610DA5F29120B56 /* Pods_DreamSleep.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D11699D88A7A7BDB6168B71 /* Pods_DreamSleep.framework */; settings = {ATTRIBUTES = (Required, ); }; }; 39CC172FB610DA5F29120B56 /* Pods_DreamSleep.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D11699D88A7A7BDB6168B71 /* Pods_DreamSleep.framework */; settings = {ATTRIBUTES = (Required, ); }; };
D00291892816CD4500C0573B /* DsCacheUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = D00291882816CD4500C0573B /* DsCacheUtils.m */; }; D00291892816CD4500C0573B /* DsCacheUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = D00291882816CD4500C0573B /* DsCacheUtils.m */; };
D00A63572824C42300AFFEAA /* DSNetworkCache.m in Sources */ = {isa = PBXBuildFile; fileRef = D00A63562824C42300AFFEAA /* DSNetworkCache.m */; };
D01814D127FFCBAF00583D4E /* CWCarousel.m in Sources */ = {isa = PBXBuildFile; fileRef = D01814CB27FFCBAF00583D4E /* CWCarousel.m */; }; D01814D127FFCBAF00583D4E /* CWCarousel.m in Sources */ = {isa = PBXBuildFile; fileRef = D01814CB27FFCBAF00583D4E /* CWCarousel.m */; };
D01814D227FFCBAF00583D4E /* CWFlowLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = D01814CD27FFCBAF00583D4E /* CWFlowLayout.m */; }; D01814D227FFCBAF00583D4E /* CWFlowLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = D01814CD27FFCBAF00583D4E /* CWFlowLayout.m */; };
D01814D527FFCCFA00583D4E /* HomeTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = D01814D427FFCCFA00583D4E /* HomeTableView.m */; }; D01814D527FFCCFA00583D4E /* HomeTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = D01814D427FFCCFA00583D4E /* HomeTableView.m */; };
...@@ -132,6 +133,8 @@ ...@@ -132,6 +133,8 @@
D0CFD3D027FB3B920002982B /* launcher@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = D0CFD3CD27FB3B910002982B /* launcher@3x.png */; }; D0CFD3D027FB3B920002982B /* launcher@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = D0CFD3CD27FB3B910002982B /* launcher@3x.png */; };
D0CFD3D127FB3B920002982B /* launcher.png in Resources */ = {isa = PBXBuildFile; fileRef = D0CFD3CE27FB3B920002982B /* launcher.png */; }; D0CFD3D127FB3B920002982B /* launcher.png in Resources */ = {isa = PBXBuildFile; fileRef = D0CFD3CE27FB3B920002982B /* launcher.png */; };
D0D3826728124E8A005BB219 /* FeedbackController.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D3826628124E8A005BB219 /* FeedbackController.m */; }; D0D3826728124E8A005BB219 /* FeedbackController.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D3826628124E8A005BB219 /* FeedbackController.m */; };
D0D69ED3282360F100A0D5EB /* LookAllController.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D69ED2282360F100A0D5EB /* LookAllController.m */; };
D0D69ED628236E0800A0D5EB /* SafeSleepListController.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D69ED528236E0800A0D5EB /* SafeSleepListController.m */; };
D0DB33A528204E7C00E15914 /* FirstLeadAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0DB33A428204E7C00E15914 /* FirstLeadAlertView.m */; }; D0DB33A528204E7C00E15914 /* FirstLeadAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0DB33A428204E7C00E15914 /* FirstLeadAlertView.m */; };
D0DB33A828224D5100E15914 /* PromotionModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D0DB33A728224D5100E15914 /* PromotionModel.m */; }; D0DB33A828224D5100E15914 /* PromotionModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D0DB33A728224D5100E15914 /* PromotionModel.m */; };
D0DF90AE2814390000FC0F64 /* BannerModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D0DF90AD2814390000FC0F64 /* BannerModel.m */; }; D0DF90AE2814390000FC0F64 /* BannerModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D0DF90AD2814390000FC0F64 /* BannerModel.m */; };
...@@ -165,6 +168,8 @@ ...@@ -165,6 +168,8 @@
9B4D4A8254C6E2872914AB4D /* Pods-DreamSleep.beta.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DreamSleep.beta.xcconfig"; path = "Target Support Files/Pods-DreamSleep/Pods-DreamSleep.beta.xcconfig"; sourceTree = "<group>"; }; 9B4D4A8254C6E2872914AB4D /* Pods-DreamSleep.beta.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DreamSleep.beta.xcconfig"; path = "Target Support Files/Pods-DreamSleep/Pods-DreamSleep.beta.xcconfig"; sourceTree = "<group>"; };
D00291872816CD4500C0573B /* DsCacheUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DsCacheUtils.h; sourceTree = "<group>"; }; D00291872816CD4500C0573B /* DsCacheUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DsCacheUtils.h; sourceTree = "<group>"; };
D00291882816CD4500C0573B /* DsCacheUtils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DsCacheUtils.m; sourceTree = "<group>"; }; D00291882816CD4500C0573B /* DsCacheUtils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DsCacheUtils.m; sourceTree = "<group>"; };
D00A63552824C42300AFFEAA /* DSNetworkCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DSNetworkCache.h; sourceTree = "<group>"; };
D00A63562824C42300AFFEAA /* DSNetworkCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DSNetworkCache.m; sourceTree = "<group>"; };
D01814CB27FFCBAF00583D4E /* CWCarousel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CWCarousel.m; sourceTree = "<group>"; }; D01814CB27FFCBAF00583D4E /* CWCarousel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CWCarousel.m; sourceTree = "<group>"; };
D01814CC27FFCBAF00583D4E /* CWCarouselHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CWCarouselHeader.h; sourceTree = "<group>"; }; D01814CC27FFCBAF00583D4E /* CWCarouselHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CWCarouselHeader.h; sourceTree = "<group>"; };
D01814CD27FFCBAF00583D4E /* CWFlowLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CWFlowLayout.m; sourceTree = "<group>"; }; D01814CD27FFCBAF00583D4E /* CWFlowLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CWFlowLayout.m; sourceTree = "<group>"; };
...@@ -348,7 +353,7 @@ ...@@ -348,7 +353,7 @@
D0AEFE7E2817DD1500230DC6 /* MyFeedCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyFeedCell.m; sourceTree = "<group>"; }; D0AEFE7E2817DD1500230DC6 /* MyFeedCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyFeedCell.m; sourceTree = "<group>"; };
D0AEFE7F2817DD1500230DC6 /* MyFeedListController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyFeedListController.h; sourceTree = "<group>"; }; D0AEFE7F2817DD1500230DC6 /* MyFeedListController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyFeedListController.h; sourceTree = "<group>"; };
D0AEFE802817DD1500230DC6 /* MyFeedListController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyFeedListController.m; sourceTree = "<group>"; }; D0AEFE802817DD1500230DC6 /* MyFeedListController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyFeedListController.m; sourceTree = "<group>"; };
D0B5ECA127F2D9DE003EDFE3 /* DreamSleepDev.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DreamSleepDev.app; sourceTree = BUILT_PRODUCTS_DIR; }; D0B5ECA127F2D9DE003EDFE3 /* 小梦睡眠-Dev.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "小梦睡眠-Dev.app"; sourceTree = BUILT_PRODUCTS_DIR; };
D0B5ECA427F2D9DE003EDFE3 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; D0B5ECA427F2D9DE003EDFE3 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
D0B5ECA527F2D9DE003EDFE3 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; }; D0B5ECA527F2D9DE003EDFE3 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
D0B5ECAE27F2D9DE003EDFE3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; D0B5ECAE27F2D9DE003EDFE3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
...@@ -397,6 +402,10 @@ ...@@ -397,6 +402,10 @@
D0CFD3CE27FB3B920002982B /* launcher.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = launcher.png; sourceTree = "<group>"; }; D0CFD3CE27FB3B920002982B /* launcher.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = launcher.png; sourceTree = "<group>"; };
D0D3826528124E8A005BB219 /* FeedbackController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FeedbackController.h; sourceTree = "<group>"; }; D0D3826528124E8A005BB219 /* FeedbackController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FeedbackController.h; sourceTree = "<group>"; };
D0D3826628124E8A005BB219 /* FeedbackController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FeedbackController.m; sourceTree = "<group>"; }; D0D3826628124E8A005BB219 /* FeedbackController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FeedbackController.m; sourceTree = "<group>"; };
D0D69ED1282360F100A0D5EB /* LookAllController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LookAllController.h; sourceTree = "<group>"; };
D0D69ED2282360F100A0D5EB /* LookAllController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LookAllController.m; sourceTree = "<group>"; };
D0D69ED428236E0800A0D5EB /* SafeSleepListController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SafeSleepListController.h; sourceTree = "<group>"; };
D0D69ED528236E0800A0D5EB /* SafeSleepListController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SafeSleepListController.m; sourceTree = "<group>"; };
D0D7480328118D0B00036379 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = "<group>"; }; D0D7480328118D0B00036379 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = "<group>"; };
D0D7480428118D0B00036379 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/LaunchScreen.strings"; sourceTree = "<group>"; }; D0D7480428118D0B00036379 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/LaunchScreen.strings"; sourceTree = "<group>"; };
D0DB33A328204E7C00E15914 /* FirstLeadAlertView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FirstLeadAlertView.h; sourceTree = "<group>"; }; D0DB33A328204E7C00E15914 /* FirstLeadAlertView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FirstLeadAlertView.h; sourceTree = "<group>"; };
...@@ -531,6 +540,8 @@ ...@@ -531,6 +540,8 @@
D070509928071BAF006D72E1 /* DSNetworkTool.m */, D070509928071BAF006D72E1 /* DSNetworkTool.m */,
D0E65FFD2807AC5E006562F2 /* DSProgressHUD.h */, D0E65FFD2807AC5E006562F2 /* DSProgressHUD.h */,
D0E65FFE2807AC5E006562F2 /* DSProgressHUD.m */, D0E65FFE2807AC5E006562F2 /* DSProgressHUD.m */,
D00A63552824C42300AFFEAA /* DSNetworkCache.h */,
D00A63562824C42300AFFEAA /* DSNetworkCache.m */,
D027EE2427FB3DC0004BBA61 /* NetLoadingStateView.h */, D027EE2427FB3DC0004BBA61 /* NetLoadingStateView.h */,
D027EE2527FB3DC0004BBA61 /* NetLoadingStateView.m */, D027EE2527FB3DC0004BBA61 /* NetLoadingStateView.m */,
); );
...@@ -857,7 +868,7 @@ ...@@ -857,7 +868,7 @@
D0B5ECA227F2D9DE003EDFE3 /* Products */ = { D0B5ECA227F2D9DE003EDFE3 /* Products */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
D0B5ECA127F2D9DE003EDFE3 /* DreamSleepDev.app */, D0B5ECA127F2D9DE003EDFE3 /* 小梦睡眠-Dev.app */,
); );
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1001,6 +1012,10 @@ ...@@ -1001,6 +1012,10 @@
D0F808FA280420DE0097899F /* Model */, D0F808FA280420DE0097899F /* Model */,
D0F808F9280420A30097899F /* View */, D0F808F9280420A30097899F /* View */,
D0F808F82804208C0097899F /* Controller */, D0F808F82804208C0097899F /* Controller */,
D0D69ED1282360F100A0D5EB /* LookAllController.h */,
D0D69ED2282360F100A0D5EB /* LookAllController.m */,
D0D69ED428236E0800A0D5EB /* SafeSleepListController.h */,
D0D69ED528236E0800A0D5EB /* SafeSleepListController.m */,
); );
path = Home; path = Home;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1246,7 +1261,7 @@ ...@@ -1246,7 +1261,7 @@
); );
name = DreamSleep; name = DreamSleep;
productName = DreamSleep; productName = DreamSleep;
productReference = D0B5ECA127F2D9DE003EDFE3 /* DreamSleepDev.app */; productReference = D0B5ECA127F2D9DE003EDFE3 /* 小梦睡眠-Dev.app */;
productType = "com.apple.product-type.application"; productType = "com.apple.product-type.application";
}; };
/* End PBXNativeTarget section */ /* End PBXNativeTarget section */
...@@ -1386,6 +1401,7 @@ ...@@ -1386,6 +1401,7 @@
D01814D127FFCBAF00583D4E /* CWCarousel.m in Sources */, D01814D127FFCBAF00583D4E /* CWCarousel.m in Sources */,
D0B5ECB727F2D9E0003EDFE3 /* main.m in Sources */, D0B5ECB727F2D9E0003EDFE3 /* main.m in Sources */,
D07DACA62810557D0067A1BF /* RSKTouchView.m in Sources */, D07DACA62810557D0067A1BF /* RSKTouchView.m in Sources */,
D0D69ED628236E0800A0D5EB /* SafeSleepListController.m in Sources */,
D09D0E9A280D507F008DEDAB /* ProfileAlertView.m in Sources */, D09D0E9A280D507F008DEDAB /* ProfileAlertView.m in Sources */,
D0FAC41F281B817D00D4B859 /* UIScrollView+GKPhotoBrowser.m in Sources */, D0FAC41F281B817D00D4B859 /* UIScrollView+GKPhotoBrowser.m in Sources */,
D0AEFE79281781CF00230DC6 /* MyFeedModel.m in Sources */, D0AEFE79281781CF00230DC6 /* MyFeedModel.m in Sources */,
...@@ -1412,6 +1428,7 @@ ...@@ -1412,6 +1428,7 @@
D0C50B4627FD66FB00DC68F0 /* DSConstUtil.m in Sources */, D0C50B4627FD66FB00DC68F0 /* DSConstUtil.m in Sources */,
D08F79DC281A1838000D99DD /* TZProgressView.m in Sources */, D08F79DC281A1838000D99DD /* TZProgressView.m in Sources */,
D01814D227FFCBAF00583D4E /* CWFlowLayout.m in Sources */, D01814D227FFCBAF00583D4E /* CWFlowLayout.m in Sources */,
D0D69ED3282360F100A0D5EB /* LookAllController.m in Sources */,
D07A4B2D280EA73B00BA0EC0 /* UserInfoView.m in Sources */, D07A4B2D280EA73B00BA0EC0 /* UserInfoView.m in Sources */,
D0878F48280BD18F005F1B7F /* LoginView.m in Sources */, D0878F48280BD18F005F1B7F /* LoginView.m in Sources */,
D08F79D4281A1838000D99DD /* TZImageCropManager.m in Sources */, D08F79D4281A1838000D99DD /* TZImageCropManager.m in Sources */,
...@@ -1446,6 +1463,7 @@ ...@@ -1446,6 +1463,7 @@
D07DACA72810557D0067A1BF /* UIApplication+RSKImageCropper.m in Sources */, D07DACA72810557D0067A1BF /* UIApplication+RSKImageCropper.m in Sources */,
D027EE2927FB51D0004BBA61 /* DSGifHeader.m in Sources */, D027EE2927FB51D0004BBA61 /* DSGifHeader.m in Sources */,
D0FAC421281B817D00D4B859 /* GKPhotoView.m in Sources */, D0FAC421281B817D00D4B859 /* GKPhotoView.m in Sources */,
D00A63572824C42300AFFEAA /* DSNetworkCache.m in Sources */,
D08F79DA281A1838000D99DD /* TZPhotoPreviewController.m in Sources */, D08F79DA281A1838000D99DD /* TZPhotoPreviewController.m in Sources */,
D01814EE28002DC700583D4E /* HeaderDataModel.m in Sources */, D01814EE28002DC700583D4E /* HeaderDataModel.m in Sources */,
D0506B1B2805500E00229278 /* SafeHelperCollectionViewCell.m in Sources */, D0506B1B2805500E00229278 /* SafeHelperCollectionViewCell.m in Sources */,
...@@ -1634,7 +1652,7 @@ ...@@ -1634,7 +1652,7 @@
CODE_SIGN_ENTITLEMENTS = DreamSleep/Basement/DSConfig/DreamSleepDebug.entitlements; CODE_SIGN_ENTITLEMENTS = DreamSleep/Basement/DSConfig/DreamSleepDebug.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = SPH85C3TWU; DEVELOPMENT_TEAM = SPH85C3TWU;
EXCLUDED_ARCHS = ""; EXCLUDED_ARCHS = "";
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
...@@ -1672,7 +1690,7 @@ ...@@ -1672,7 +1690,7 @@
"$(PROJECT_DIR)/DreamSleep/Vendors/UMSocial_6.10.4/SocialLibraries/WeChat/WechatSDK", "$(PROJECT_DIR)/DreamSleep/Vendors/UMSocial_6.10.4/SocialLibraries/WeChat/WechatSDK",
"$(PROJECT_DIR)/DreamSleep/Vendors/UMSocial_6.10.4/SocialLibraries/QQ", "$(PROJECT_DIR)/DreamSleep/Vendors/UMSocial_6.10.4/SocialLibraries/QQ",
); );
MARKETING_VERSION = 1.1.2; MARKETING_VERSION = 1.0.3;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
...@@ -1682,7 +1700,7 @@ ...@@ -1682,7 +1700,7 @@
); );
PRODUCT_BUNDLE_IDENTIFIER = com.aolei.sleep.dev123; PRODUCT_BUNDLE_IDENTIFIER = com.aolei.sleep.dev123;
PRODUCT_MODULE_NAME = DreamSleepDev; PRODUCT_MODULE_NAME = DreamSleepDev;
PRODUCT_NAME = "$(TARGET_NAME)Dev"; PRODUCT_NAME = "小梦睡眠-Dev";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
TARGETED_DEVICE_FAMILY = 1; TARGETED_DEVICE_FAMILY = 1;
...@@ -1700,7 +1718,7 @@ ...@@ -1700,7 +1718,7 @@
CODE_SIGN_ENTITLEMENTS = DreamSleep/DreamSleep.entitlements; CODE_SIGN_ENTITLEMENTS = DreamSleep/DreamSleep.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = 4NDZ6UX8PW; DEVELOPMENT_TEAM = 4NDZ6UX8PW;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
...@@ -1737,7 +1755,7 @@ ...@@ -1737,7 +1755,7 @@
"$(PROJECT_DIR)/DreamSleep/Vendors/UMSocial_6.10.4/SocialLibraries/WeChat/WechatSDK", "$(PROJECT_DIR)/DreamSleep/Vendors/UMSocial_6.10.4/SocialLibraries/WeChat/WechatSDK",
"$(PROJECT_DIR)/DreamSleep/Vendors/UMSocial_6.10.4/SocialLibraries/QQ", "$(PROJECT_DIR)/DreamSleep/Vendors/UMSocial_6.10.4/SocialLibraries/QQ",
); );
MARKETING_VERSION = 1.1.2; MARKETING_VERSION = 1.0.3;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
...@@ -1747,7 +1765,7 @@ ...@@ -1747,7 +1765,7 @@
); );
PRODUCT_BUNDLE_IDENTIFIER = com.aolei.sleep; PRODUCT_BUNDLE_IDENTIFIER = com.aolei.sleep;
PRODUCT_MODULE_NAME = DreamSleep; PRODUCT_MODULE_NAME = DreamSleep;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "小梦睡眠-冥想解压助眠健康养生";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
TARGETED_DEVICE_FAMILY = 1; TARGETED_DEVICE_FAMILY = 1;
...@@ -1806,11 +1824,13 @@ ...@@ -1806,11 +1824,13 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
HOST_URL = "https:${SLANT}/cbti.mynatapp.cc/sleepiql";
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = NO; ONLY_ACTIVE_ARCH = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SLANT = /;
}; };
name = Beta; name = Beta;
}; };
...@@ -1825,7 +1845,7 @@ ...@@ -1825,7 +1845,7 @@
CODE_SIGN_ENTITLEMENTS = DreamSleep/Basement/DSConfig/DreamSleepBeta.entitlements; CODE_SIGN_ENTITLEMENTS = DreamSleep/Basement/DSConfig/DreamSleepBeta.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = 4NDZ6UX8PW; DEVELOPMENT_TEAM = 4NDZ6UX8PW;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
...@@ -1862,7 +1882,7 @@ ...@@ -1862,7 +1882,7 @@
"$(PROJECT_DIR)/DreamSleep/Vendors/UMSocial_6.10.4/SocialLibraries/WeChat/WechatSDK", "$(PROJECT_DIR)/DreamSleep/Vendors/UMSocial_6.10.4/SocialLibraries/WeChat/WechatSDK",
"$(PROJECT_DIR)/DreamSleep/Vendors/UMSocial_6.10.4/SocialLibraries/QQ", "$(PROJECT_DIR)/DreamSleep/Vendors/UMSocial_6.10.4/SocialLibraries/QQ",
); );
MARKETING_VERSION = 1.1.2; MARKETING_VERSION = 1.0.3;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
...@@ -1872,7 +1892,7 @@ ...@@ -1872,7 +1892,7 @@
); );
PRODUCT_BUNDLE_IDENTIFIER = com.aolei.sleep; PRODUCT_BUNDLE_IDENTIFIER = com.aolei.sleep;
PRODUCT_MODULE_NAME = DreamSleepBeta; PRODUCT_MODULE_NAME = DreamSleepBeta;
PRODUCT_NAME = "$(TARGET_NAME)Beta"; PRODUCT_NAME = "小梦睡眠-Beta";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
TARGETED_DEVICE_FAMILY = 1; TARGETED_DEVICE_FAMILY = 1;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "D0B5ECA027F2D9DE003EDFE3" BlueprintIdentifier = "D0B5ECA027F2D9DE003EDFE3"
BuildableName = "DreamSleep.app" BuildableName = "&#x5c0f;&#x68a6;&#x7761;&#x7720;-&#x51a5;&#x60f3;&#x89e3;&#x538b;&#x52a9;&#x7720;&#x5065;&#x5eb7;&#x517b;&#x751f;.app"
BlueprintName = "DreamSleep" BlueprintName = "DreamSleep"
ReferencedContainer = "container:DreamSleep.xcodeproj"> ReferencedContainer = "container:DreamSleep.xcodeproj">
</BuildableReference> </BuildableReference>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "D0B5ECA027F2D9DE003EDFE3" BlueprintIdentifier = "D0B5ECA027F2D9DE003EDFE3"
BuildableName = "DreamSleep.app" BuildableName = "&#x5c0f;&#x68a6;&#x7761;&#x7720;-&#x51a5;&#x60f3;&#x89e3;&#x538b;&#x52a9;&#x7720;&#x5065;&#x5eb7;&#x517b;&#x751f;.app"
BlueprintName = "DreamSleep" BlueprintName = "DreamSleep"
ReferencedContainer = "container:DreamSleep.xcodeproj"> ReferencedContainer = "container:DreamSleep.xcodeproj">
</BuildableReference> </BuildableReference>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "D0B5ECA027F2D9DE003EDFE3" BlueprintIdentifier = "D0B5ECA027F2D9DE003EDFE3"
BuildableName = "DreamSleep.app" BuildableName = "&#x5c0f;&#x68a6;&#x7761;&#x7720;-&#x51a5;&#x60f3;&#x89e3;&#x538b;&#x52a9;&#x7720;&#x5065;&#x5eb7;&#x517b;&#x751f;.app"
BlueprintName = "DreamSleep" BlueprintName = "DreamSleep"
ReferencedContainer = "container:DreamSleep.xcodeproj"> ReferencedContainer = "container:DreamSleep.xcodeproj">
</BuildableReference> </BuildableReference>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "D0B5ECA027F2D9DE003EDFE3" BlueprintIdentifier = "D0B5ECA027F2D9DE003EDFE3"
BuildableName = "DreamSleep.app" BuildableName = "&#x5c0f;&#x68a6;&#x7761;&#x7720;-&#x51a5;&#x60f3;&#x89e3;&#x538b;&#x52a9;&#x7720;&#x5065;&#x5eb7;&#x517b;&#x751f;.app"
BlueprintName = "DreamSleep" BlueprintName = "DreamSleep"
ReferencedContainer = "container:DreamSleep.xcodeproj"> ReferencedContainer = "container:DreamSleep.xcodeproj">
</BuildableReference> </BuildableReference>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "D0B5ECA027F2D9DE003EDFE3" BlueprintIdentifier = "D0B5ECA027F2D9DE003EDFE3"
BuildableName = "DreamSleep.app" BuildableName = "&#x5c0f;&#x68a6;&#x7761;&#x7720;-&#x51a5;&#x60f3;&#x89e3;&#x538b;&#x52a9;&#x7720;&#x5065;&#x5eb7;&#x517b;&#x751f;.app"
BlueprintName = "DreamSleep" BlueprintName = "DreamSleep"
ReferencedContainer = "container:DreamSleep.xcodeproj"> ReferencedContainer = "container:DreamSleep.xcodeproj">
</BuildableReference> </BuildableReference>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "D0B5ECA027F2D9DE003EDFE3" BlueprintIdentifier = "D0B5ECA027F2D9DE003EDFE3"
BuildableName = "DreamSleep.app" BuildableName = "&#x5c0f;&#x68a6;&#x7761;&#x7720;-&#x51a5;&#x60f3;&#x89e3;&#x538b;&#x52a9;&#x7720;&#x5065;&#x5eb7;&#x517b;&#x751f;.app"
BlueprintName = "DreamSleep" BlueprintName = "DreamSleep"
ReferencedContainer = "container:DreamSleep.xcodeproj"> ReferencedContainer = "container:DreamSleep.xcodeproj">
</BuildableReference> </BuildableReference>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "D0B5ECA027F2D9DE003EDFE3" BlueprintIdentifier = "D0B5ECA027F2D9DE003EDFE3"
BuildableName = "DreamSleep.app" BuildableName = "&#x5c0f;&#x68a6;&#x7761;&#x7720;-&#x51a5;&#x60f3;&#x89e3;&#x538b;&#x52a9;&#x7720;&#x5065;&#x5eb7;&#x517b;&#x751f;.app"
BlueprintName = "DreamSleep" BlueprintName = "DreamSleep"
ReferencedContainer = "container:DreamSleep.xcodeproj"> ReferencedContainer = "container:DreamSleep.xcodeproj">
</BuildableReference> </BuildableReference>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "D0B5ECA027F2D9DE003EDFE3" BlueprintIdentifier = "D0B5ECA027F2D9DE003EDFE3"
BuildableName = "DreamSleep.app" BuildableName = "&#x5c0f;&#x68a6;&#x7761;&#x7720;-&#x51a5;&#x60f3;&#x89e3;&#x538b;&#x52a9;&#x7720;&#x5065;&#x5eb7;&#x517b;&#x751f;.app"
BlueprintName = "DreamSleep" BlueprintName = "DreamSleep"
ReferencedContainer = "container:DreamSleep.xcodeproj"> ReferencedContainer = "container:DreamSleep.xcodeproj">
</BuildableReference> </BuildableReference>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "D0B5ECA027F2D9DE003EDFE3" BlueprintIdentifier = "D0B5ECA027F2D9DE003EDFE3"
BuildableName = "DreamSleep.app" BuildableName = "&#x5c0f;&#x68a6;&#x7761;&#x7720;-&#x51a5;&#x60f3;&#x89e3;&#x538b;&#x52a9;&#x7720;&#x5065;&#x5eb7;&#x517b;&#x751f;.app"
BlueprintName = "DreamSleep" BlueprintName = "DreamSleep"
ReferencedContainer = "container:DreamSleep.xcodeproj"> ReferencedContainer = "container:DreamSleep.xcodeproj">
</BuildableReference> </BuildableReference>
......
#import <Foundation/Foundation.h>
/** 缓存完成结果回调 */
typedef void(^KBNetworkCacheCompletionBlock) (BOOL result);
/** 文件缓存 */
@interface DSNetworkCache : NSObject
/**
* @brief 写入/更新缓存(同步) [按APP版本号缓存,不同版本APP,同一接口缓存数据互不干扰]
* @param jsonResponse 要写入的数据(JSON)
* @param URL 数据请求URL
* @return 是否写入成功
*/
+ (BOOL)saveJsonResponseToCacheFile:(id)jsonResponse andURL:(NSString *)URL;
/**
* @brief 写入/更新缓存(异步) [按APP版本号缓存,不同版本APP,同一接口缓存数据互不干扰]
* @param jsonResponse 要写入的数据(JSON)
* @param URL 数据请求URL
* @param completedBlock 异步完成回调(主线程回调)
*/
+ (void)save_asyncJsonResponseToCacheFile:(id)jsonResponse andURL:(NSString *)URL completed:(KBNetworkCacheCompletionBlock)completedBlock;
/**
* @brief 获取缓存的对象(同步)
* @param URL 数据请求URL
* @return 缓存对象
*/
+ (id)cacheJsonWithURL:(NSString *)URL;
/** 获取缓存路径 */
+ (NSString *)cachePath;
/** 清除缓存 */
+ (BOOL)clearCache;
/** 获取缓存大小(单位:M) */
+ (CGFloat)cacheSize;
/**
* @brief 获取缓存大小,(以..kb/..M)形式获取
* 小于1M,以kb形式返回,大于1M,以M形式返回
* @return 缓存大小+单位
*/
+ (NSString *)cacheSizeFormat;
@end
#import "DSNetworkCache.h"
#import <CommonCrypto/CommonDigest.h>
@implementation DSNetworkCache
+ (BOOL)saveJsonResponseToCacheFile:(id)jsonResponse andURL:(NSString *)URL
{
if(jsonResponse == nil) return NO;
NSData *data = [self jsonToData:jsonResponse];
return [[NSFileManager defaultManager] createFileAtPath:[self cacheFilePathWithURL:URL] contents:data attributes:nil];
}
+ (void)save_asyncJsonResponseToCacheFile:(id)jsonResponse andURL:(NSString *)URL completed:(KBNetworkCacheCompletionBlock)completedBlock
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
BOOL result = [self saveJsonResponseToCacheFile:jsonResponse andURL:URL];
dispatch_async(dispatch_get_main_queue(), ^{
if(completedBlock) completedBlock(result);
});
});
}
/** 默认缓存日期 */
static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24; // 1 day
+ (id)cacheJsonWithURL:(NSString *)URL
{
NSString *path = [self cacheFilePathWithURL:URL];
// 是否存在缓存文件
if ([[NSFileManager defaultManager] fileExistsAtPath:path isDirectory:nil] == YES) {
// 缓存文件最近修改日期
NSDictionary *fileURLAttributes = [[NSURL fileURLWithPath:path] resourceValuesForKeys:[NSArray arrayWithObjects:NSURLContentModificationDateKey, nil] error:nil];
NSDate *lastModifiedDate = [fileURLAttributes objectForKey:NSURLContentModificationDateKey];
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"yyyy-MM-dd"];
NSString *lastModifiedDateStr = [dateFormat stringFromDate:lastModifiedDate];
// (当前日期-缓存时效)
NSDate *expirationDate = [NSDate dateWithTimeIntervalSinceNow:-kDefaultCacheMaxCacheAge];
NSString *expirationDateStr = [dateFormat stringFromDate:expirationDate];
DSLog(@"lastModifiedDateStr=%@, expirationDateStr=%@", lastModifiedDateStr, expirationDateStr);
if ([lastModifiedDateStr isEqualToString:expirationDateStr]) {
return nil;
}
NSData *data = [[NSFileManager defaultManager] contentsAtPath:path];
if (data == nil) return nil;
return [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
}
return nil;
}
+ (NSString *)cacheFilePathWithURL:(NSString *)URL
{
NSString *path = [self cachePath];
// checkDirectory
[self checkDirectory:path];
// fileName
NSString *cacheFileNameString = [NSString stringWithFormat:@"URL:%@ AppVersion:%@", URL, [self appVersionString]];
NSString *cacheFileName = [self md5StringFromString:cacheFileNameString];
path = [path stringByAppendingPathComponent:cacheFileName];
return path;
}
+ (NSData *)jsonToData:(id)jsonResponse
{
if(jsonResponse == nil) return nil;
NSError *error;
NSData *data = [NSJSONSerialization dataWithJSONObject:jsonResponse options:NSJSONWritingPrettyPrinted error:&error];
if (error) {
DSLog(@"ERROR, faild to get json data");
return nil;
}
return data;
}
+ (NSString *)cachePath
{
NSString *pathOfLibrary = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *path = [pathOfLibrary stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_%d", @"query_promotion_image", [LoginUtils getUserID]]];
return path;
}
+ (void)checkDirectory:(NSString *)path
{
NSFileManager *fileManager = [NSFileManager defaultManager];
BOOL isDir;
if (![fileManager fileExistsAtPath:path isDirectory:&isDir]) {
[self createBaseDirectoryAtPath:path];
} else {
if (!isDir) {
NSError *error = nil;
[fileManager removeItemAtPath:path error:&error];
[self createBaseDirectoryAtPath:path];
}
}
}
+ (void)createBaseDirectoryAtPath:(NSString *)path {
__autoreleasing NSError *error = nil;
[[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES
attributes:nil error:&error];
if (error) {
DSLog(@"create cache directory failed, error = %@", error);
} else {
// DSLog(@"path = %@", path);
[self addDoNotBackupAttribute:path];
}
}
+ (void)addDoNotBackupAttribute:(NSString *)path {
NSURL *url = [NSURL fileURLWithPath:path];
NSError *error = nil;
[url setResourceValue:[NSNumber numberWithBool:YES] forKey:NSURLIsExcludedFromBackupKey error:&error];
if (error) {
DSLog(@"error to set do not backup attribute, error = %@", error);
}
}
+ (NSString *)md5StringFromString:(NSString *)string {
if(string == nil || [string length] == 0) return nil;
const char *value = [string UTF8String];
unsigned char outputBuffer[CC_MD5_DIGEST_LENGTH];
CC_MD5(value, (CC_LONG)strlen(value), outputBuffer);
NSMutableString *outputString = [[NSMutableString alloc] initWithCapacity:CC_MD5_DIGEST_LENGTH * 2];
for(NSInteger count = 0; count < CC_MD5_DIGEST_LENGTH; count++) {
[outputString appendFormat:@"%02x", outputBuffer[count]];
}
return outputString;
}
+ (NSString *)appVersionString {
return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
}
+ (BOOL)clearCache
{
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *path = [self cachePath];
BOOL result = [fileManager removeItemAtPath:path error:nil];
[self checkDirectory:[self cachePath]];
return result;
}
+ (CGFloat)cacheSize
{
NSString *directoryPath = [self cachePath];
BOOL isDir = NO;
unsigned long long total = 0;
if ([[NSFileManager defaultManager] fileExistsAtPath:directoryPath isDirectory:&isDir]) {
if (isDir) {
NSError *error = nil;
NSArray *array = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:directoryPath error:&error];
if (error == nil) {
for (NSString *subpath in array) {
NSString *path = [directoryPath stringByAppendingPathComponent:subpath];
NSDictionary *dict = [[NSFileManager defaultManager] attributesOfItemAtPath:path
error:&error];
if (!error) {
total += [dict[NSFileSize] unsignedIntegerValue];
}
}
}
}
}
return total/(1024.0*1024.0);
}
+ (NSString *)cacheSizeFormat
{
NSString *sizeUnitString;
float size = [self cacheSize];
if(size < 1) {
size *= 1024.0; // 小于1M转化为kb
sizeUnitString = [NSString stringWithFormat:@"%.1fkb", size];
} else {
sizeUnitString = [NSString stringWithFormat:@"%.1fM", size];
}
return sizeUnitString;
}
@end
...@@ -17,6 +17,8 @@ FOUNDATION_EXTERN NSString * const FirstShowPrivacy; ...@@ -17,6 +17,8 @@ FOUNDATION_EXTERN NSString * const FirstShowPrivacy;
// 引导页 // 引导页
FOUNDATION_EXTERN NSString * const IsFirstGuide; FOUNDATION_EXTERN NSString * const IsFirstGuide;
// 首次启动APP进入主页弹框
FOUNDATION_EXTERN NSString * const IsFirstAlert;
// 关于我们 // 关于我们
FOUNDATION_EXTERN NSString * const AboutUS; FOUNDATION_EXTERN NSString * const AboutUS;
......
...@@ -13,6 +13,7 @@ NSString * const PrivacyStatement = @"欢迎来到小梦睡眠,我们依据最 ...@@ -13,6 +13,7 @@ NSString * const PrivacyStatement = @"欢迎来到小梦睡眠,我们依据最
NSString * const FirstShowPrivacy = @"FirstShowPrivacy"; NSString * const FirstShowPrivacy = @"FirstShowPrivacy";
NSString * const IsFirstGuide = @"isFirstGuide"; NSString * const IsFirstGuide = @"isFirstGuide";
NSString * const IsFirstAlert = @"isFirstAlert";
NSString * const AboutUS = @"https://www.cbti.cn/sleep/user/about"; NSString * const AboutUS = @"https://www.cbti.cn/sleep/user/about";
NSString * const MYCBTI = @"https://www.cbti.cn/sleep/ssmian/cbti"; NSString * const MYCBTI = @"https://www.cbti.cn/sleep/ssmian/cbti";
......
...@@ -46,6 +46,13 @@ ...@@ -46,6 +46,13 @@
// Remove // Remove
#define kUserDefaultsRemoveObj(key) [[NSUserDefaults standardUserDefaults] removeObjectForKey:key] #define kUserDefaultsRemoveObj(key) [[NSUserDefaults standardUserDefaults] removeObjectForKey:key]
#pragma mark - 沙盒
// Document路径
#define kDocumentPath [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]
#pragma mark - 运营弹框标记
#define kPromotionTime [NSString stringWithFormat:@"%@/%@_%d_%@", kDocumentPath, @"query_promotion_image", [LoginUtils getUserID], DSAppVersion]
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface MacroFuncUtil : NSObject @interface MacroFuncUtil : NSObject
@end @end
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/// 三分钟即刻入睡VC /// 三分钟即刻入睡VC(哄睡界面)
@interface ThreeMinuteController : UIViewController @interface ThreeMinuteController : UIViewController
@end @end
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
[self addSubview:self.titleLab]; [self addSubview:self.titleLab];
[self addSubview:self.aiBtn]; [self addSubview:self.aiBtn];
[self addSubview:self.ssBtn]; [self addSubview:self.ssBtn];
[self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) { [self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self).offset(15); make.left.equalTo(self).offset(15);
make.top.equalTo(self).offset(51); make.top.equalTo(self).offset(51);
...@@ -60,6 +60,9 @@ ...@@ -60,6 +60,9 @@
} }
- (void)dismiss { - (void)dismiss {
kSetUserDefaultsBOOL(YES, IsFirstAlert);
kUserDefaultsSynchronize;
[self removeFromSuperview]; [self removeFromSuperview];
} }
......
...@@ -19,6 +19,7 @@ typedef void (^JumpBlock)(void); ...@@ -19,6 +19,7 @@ typedef void (^JumpBlock)(void);
- (instancetype)initWithJumpBlock:(JumpBlock)block imageUrl:(NSString *)imageUrl; - (instancetype)initWithJumpBlock:(JumpBlock)block imageUrl:(NSString *)imageUrl;
- (void)show; - (void)show;
- (void)dismiss;
@end @end
......
...@@ -45,11 +45,13 @@ ...@@ -45,11 +45,13 @@
} }
- (void)dismiss { - (void)dismiss {
// 标记活动弹框时间,用于判断弹框时效
[[NSFileManager defaultManager] createFileAtPath:kPromotionTime contents:nil attributes:nil];
[self removeFromSuperview]; [self removeFromSuperview];
} }
- (void)tapAction { - (void)tapAction {
[self dismiss];
if (self.block) { self.block(); } if (self.block) { self.block(); }
} }
......
...@@ -11,9 +11,11 @@ ...@@ -11,9 +11,11 @@
#import "FirstLeadAlertView.h" #import "FirstLeadAlertView.h"
#import "UserRequestModel.h" #import "UserRequestModel.h"
#import "HomeRequestModel.h" #import "HomeRequestModel.h"
#import "ThreeMinuteController.h"
@interface HomeViewController () @interface HomeViewController ()
@property (nonatomic, strong) HomeTableView *homeTV; @property (nonatomic, strong) HomeTableView *homeTV;
@property (nonatomic, strong) RescuePlanView *rescuePlanView;
@end @end
@implementation HomeViewController @implementation HomeViewController
...@@ -36,49 +38,97 @@ ...@@ -36,49 +38,97 @@
}]; }];
} }
// 运营活动弹框时机(已登录还是未登录) // 活动运营弹框(首次启动不弹框,后面每隔24个小时请求后台接口)
// [self queryPromotionImageRequest]; [self promotionAlert];
// APP首次启动弹框(只出现一次)
[self showFirstLeadAlertView];
} }
#pragma mark - APP首次启动弹框 #pragma mark - APP首次启动弹框
- (void)showFirstLeadAlertView { - (void)showFirstLeadAlertView {
if (kGetUserDefaultsBOOL(IsFirstAlert)) { return; }
FirstLeadAlertView *view = [[FirstLeadAlertView alloc] initWithJumpBlock:^(JumpType type) { FirstLeadAlertView *view = [[FirstLeadAlertView alloc] initWithJumpBlock:^(JumpType type) {
if (type == JumpTypeAI) { if (type == JumpTypeAI) {
// 切换到AI睡眠教练标签 // 切换到AI睡眠教练标签
self.tabBarController.selectedIndex = 1; self.tabBarController.selectedIndex = 1;
} else { } else {
// 进入快速入眠页面 // 进入快速入眠页面(首页)
self.tabBarController.selectedIndex = 0;
} }
}]; }];
[view show]; [view show];
} }
#pragma mark - 运营活动弹窗接口 #pragma mark - 运营活动相关
- (void)promotionAlert {
if (kGetUserDefaultsBOOL(IsFirstAlert) == NO) {
return;
}
if ([[NSFileManager defaultManager] fileExistsAtPath:kPromotionTime isDirectory:nil]) {
// 缓存文件最近修改日期
NSDictionary *fileURLAttributes = [[NSURL fileURLWithPath:kPromotionTime] resourceValuesForKeys:[NSArray arrayWithObjects:NSURLContentModificationDateKey, nil] error:nil];
NSDate *lastModifiedDate = [fileURLAttributes objectForKey:NSURLContentModificationDateKey];
// 活动更新时效24小时
NSInteger updateTime = 60 * 60 * 24;
NSDate *expirationDate = [NSDate dateWithTimeIntervalSinceNow:-updateTime];
NSComparisonResult result = [expirationDate compare:lastModifiedDate];
// 运营活动弹框时机(每天调用1次)
if (result == NSOrderedDescending) {
[self queryPromotionImageRequest];
}
} else {
[self queryPromotionImageRequest];
}
}
- (void)queryPromotionImageRequest { - (void)queryPromotionImageRequest {
[HomeRequestModel queryPromotionImageWithCompletion:^(HomeRequestModel * _Nonnull requestModel) { [HomeRequestModel queryPromotionImageWithCompletion:^(HomeRequestModel * _Nonnull requestModel) {
if (requestModel.resCode == DSResCodeSuccess) { if (requestModel.resCode == DSResCodeSuccess) {
PromotionModel *pModel = requestModel.promotionModel; PromotionModel *pModel = requestModel.promotionModel;
[self showRescuePlanView:pModel]; if (pModel) { [self showRescuePlanView:pModel]; }
} }
}]; }];
} }
#pragma mark - 显示失眠拯救计划弹框
- (void)showRescuePlanView:(PromotionModel *)pModel { - (void)showRescuePlanView:(PromotionModel *)pModel {
BOOL isNative = [pModel.page_url containsString:@"native"];
WS(weakSelf);
RescuePlanView *rescuePlanView = [[RescuePlanView alloc] initWithJumpBlock:^{ RescuePlanView *rescuePlanView = [[RescuePlanView alloc] initWithJumpBlock:^{
// 跳转到原生页面 if (pModel.login_flag == 1) { // 需要用户登录才可以点击进入相应界面
if (isNative) { // 判断是否登录成功
int type = [[[pModel.page_url componentsSeparatedByString:@"type="] lastObject] intValue]; if ([LoginUtils getUserLoginData]) {
[self jumpToActiveInterface:pModel];
} else { } else {
// 跳转到H5页面 // 跳转到登录页面
[weakSelf.navigationController pushViewController:[[DsWebController alloc] initWithTitle:pModel.title link:pModel.page_url] animated:YES]; [LoginUtils jumpToLoginControllerWithTarget:self];
}
} else { // 不需要登录也可以进入相应界面
[self jumpToActiveInterface:pModel];
} }
} imageUrl:pModel.image_url]; } imageUrl:pModel.image_url];
[rescuePlanView show]; self.rescuePlanView = rescuePlanView;
[self.rescuePlanView show];
}
- (void)jumpToActiveInterface:(PromotionModel *)pModel {
[self.rescuePlanView dismiss];
WS(weakSelf);
BOOL isNative = [pModel.page_url containsString:@"native"];
// 跳转到原生页面
if (isNative) {
int type = [[[pModel.page_url componentsSeparatedByString:@"type="] lastObject] intValue];
if (type == 1) { // AI睡眠教练
// 切换到AI睡眠教练标签
self.tabBarController.selectedIndex = 1;
} else if (type == 2) { // 首页
self.tabBarController.selectedIndex = 0;
} else if (type == 3) { // 哄睡页面(未登录就可以进去)
ThreeMinuteController *threeVC = [[ThreeMinuteController alloc] init];
[self.navigationController pushViewController:threeVC animated:YES];
}
} else {
// 跳转到H5页面
[weakSelf.navigationController pushViewController:[[DsWebController alloc] initWithTitle:pModel.title link:pModel.page_url] animated:YES];
}
} }
#pragma mark - 导航栏日间、黑夜模式 #pragma mark - 导航栏日间、黑夜模式
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!