Commit f26e5683 cgx

banner和运营弹框新增人气测评和社区跳转

1 个父辈 c904c4f4
...@@ -7,6 +7,24 @@ ...@@ -7,6 +7,24 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
// 选中的tabbar item
typedef NS_ENUM(NSInteger, SelectedTabBarItem) {
SelectedTabBarItemHome = 0, // 首页
SelectedTabBarItemAI = 1, // AI睡眠教练
SelectedTabBarItemCom = 2, // 社区
SelectedTabBarItemMe = 3 // 我的
};
// 页面跳转类型(首页banner、活动运营、首次APP弹框)
typedef NS_ENUM(NSInteger, PageJumpType) {
PageJumpTypeAI = 1, // AI睡眠教练
PageJumpTypeHome = 2, // 首页
PageJumpTypeCoax = 3, // 哄睡
PageJumpTypeBox = 4, // 小球
PageJumpTypeEva = 5, // 人气测评
PageJumpTypeCom = 6 // 社区
};
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
// 用户服务协议和隐私政策 // 用户服务协议和隐私政策
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#import "FirstLeadAlertView.h" #import "FirstLeadAlertView.h"
#import "HomeRequestModel.h" #import "HomeRequestModel.h"
#import "UnityGameController.h" #import "UnityGameController.h"
#import "EvaluateController.h"
#import "SafeSleepRequestModel.h" #import "SafeSleepRequestModel.h"
#import "WhiteNoiseRequestModel.h" #import "WhiteNoiseRequestModel.h"
#import "NoisePlayBar.h" #import "NoisePlayBar.h"
...@@ -237,10 +238,10 @@ ...@@ -237,10 +238,10 @@
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 = SelectedTabBarItemAI;
} else { } else {
// 进入快速入眠页面(首页) // 进入快速入眠页面(首页)
self.tabBarController.selectedIndex = 0; self.tabBarController.selectedIndex = SelectedTabBarItemHome;
} }
}]; }];
[view show]; [view show];
...@@ -303,19 +304,23 @@ ...@@ -303,19 +304,23 @@
// 跳转到原生页面 // 跳转到原生页面
if (isNative) { if (isNative) {
int type = [[[pModel.page_url componentsSeparatedByString:@"type="] lastObject] intValue]; int type = [[[pModel.page_url componentsSeparatedByString:@"type="] lastObject] intValue];
if (type == 1) { // AI睡眠教练 if (type == PageJumpTypeAI) { // AI睡眠教练
// 切换到AI睡眠教练标签 // 切换到AI睡眠教练标签
self.tabBarController.selectedIndex = 1; self.tabBarController.selectedIndex = SelectedTabBarItemAI;
} else if (type == 2) { // 首页 } else if (type == PageJumpTypeHome) { // 首页
self.tabBarController.selectedIndex = 0; self.tabBarController.selectedIndex = SelectedTabBarItemHome;
} else if (type == 3) { // 哄睡页面(未登录就可以进去) } else if (type == PageJumpTypeCoax) { // 哄睡页面(未登录就可以进去)
UnityGameController *gameVC = [UnityGameController new]; UnityGameController *gameVC = [UnityGameController new];
gameVC.gameType = GameTypeCoax; gameVC.gameType = GameTypeCoax;
[self.navigationController pushViewController:gameVC animated:YES]; [self.navigationController pushViewController:gameVC animated:YES];
} else if (type == 4) { // 小球游戏(未登录就可以进去) } else if (type == PageJumpTypeBox) { // 小球游戏(未登录就可以进去)
UnityGameController *gameVC = [UnityGameController new]; UnityGameController *gameVC = [UnityGameController new];
gameVC.gameType = GameTypeBall; gameVC.gameType = GameTypeBall;
[self.navigationController pushViewController:gameVC animated:YES]; [self.navigationController pushViewController:gameVC animated:YES];
} else if (type == PageJumpTypeEva) { // 人气测评
[self.navigationController pushViewController:[EvaluateController new] animated:YES];
} else if (type == PageJumpTypeCom) { // 社区
self.tabBarController.selectedIndex = SelectedTabBarItemCom;
} }
} else { } else {
// 跳转到H5页面 // 跳转到H5页面
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#import "UnityGameController.h" #import "UnityGameController.h"
#import "SleepStoryController.h" #import "SleepStoryController.h"
#import "StoryPlayController.h" #import "StoryPlayController.h"
#import "EvaluateController.h"
@interface HomeHeaderView () <CWCarouselDatasource, CWCarouselDelegate, UIScrollViewDelegate> @interface HomeHeaderView () <CWCarouselDatasource, CWCarouselDelegate, UIScrollViewDelegate>
// 轮播图 // 轮播图
...@@ -169,18 +170,22 @@ ...@@ -169,18 +170,22 @@
// 跳转到原生页面 // 跳转到原生页面
if (isNative) { if (isNative) {
int type = [[[model.info_url componentsSeparatedByString:@"type="] lastObject] intValue]; int type = [[[model.info_url componentsSeparatedByString:@"type="] lastObject] intValue];
if (type == 1) { // 切换到AI睡眠教练标签 if (type == PageJumpTypeAI) { // 切换到AI睡眠教练标签
self.ds_viewController.tabBarController.selectedIndex = 1; self.ds_viewController.tabBarController.selectedIndex = SelectedTabBarItemAI;
} else if (type == 2) { // 首页 } else if (type == PageJumpTypeHome) { // 首页
self.ds_viewController.tabBarController.selectedIndex = 0; self.ds_viewController.tabBarController.selectedIndex = SelectedTabBarItemHome;
} else if (type == 3) { // 哄睡页面 } else if (type == PageJumpTypeCoax) { // 哄睡页面
UnityGameController *gameVC = [UnityGameController new]; UnityGameController *gameVC = [UnityGameController new];
gameVC.gameType = GameTypeCoax; gameVC.gameType = GameTypeCoax;
[self.ds_viewController.navigationController pushViewController:gameVC animated:YES]; [self.ds_viewController.navigationController pushViewController:gameVC animated:YES];
} else if (type == 4) { // 小球游戏 } else if (type == PageJumpTypeBox) { // 小球游戏
UnityGameController *gameVC = [UnityGameController new]; UnityGameController *gameVC = [UnityGameController new];
gameVC.gameType = GameTypeBall; gameVC.gameType = GameTypeBall;
[self.ds_viewController.navigationController pushViewController:gameVC animated:YES]; [self.ds_viewController.navigationController pushViewController:gameVC animated:YES];
} else if (type == PageJumpTypeEva) { // 人气测评
[self.ds_viewController.navigationController pushViewController:[EvaluateController new] animated:YES];
} else if (type == PageJumpTypeCom) { // 社区
self.ds_viewController.tabBarController.selectedIndex = SelectedTabBarItemCom;
} }
} else { } else {
// 跳转到H5页面 // 跳转到H5页面
......
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
break; break;
case 3: // 开通AI case 3: // 开通AI
{ {
self.tabBarController.selectedIndex = 1; self.tabBarController.selectedIndex = SelectedTabBarItemAI;
} }
break; break;
case 4: // 我的睡眠报告 case 4: // 我的睡眠报告
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
- (void)goToTaskPageWithTaskID:(TaskItem)task_id url:(NSString *)url { - (void)goToTaskPageWithTaskID:(TaskItem)task_id url:(NSString *)url {
if (task_id == TaskItemGood) { // 好眠声音(直接回到首页) if (task_id == TaskItemGood) { // 好眠声音(直接回到首页)
self.tabBarController.selectedIndex = 0; self.tabBarController.selectedIndex = SelectedTabBarItemHome;
[self.navigationController popViewControllerAnimated:YES]; [self.navigationController popViewControllerAnimated:YES];
return; return;
} }
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
switch (task_id) { switch (task_id) {
case TaskItemCoach: // AI睡眠教练(该任务不需要手动调用更新状态接口) case TaskItemCoach: // AI睡眠教练(该任务不需要手动调用更新状态接口)
{ {
self.tabBarController.selectedIndex = 1; self.tabBarController.selectedIndex = SelectedTabBarItemAI;
} }
break; break;
case TaskItemBall: // 小球页面 case TaskItemBall: // 小球页面
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!