Commit a57b9a2a cgx

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

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