Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d1b707a1
由
cgx
编写于
2022-06-27 15:19:48 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
优化首页轮播图逻辑
1 个父辈
7f49ef22
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
35 行增加
和
28 行删除
DreamSleep/DreamSleep/Class/HomeModule/Home/Model/BannerModel.h
DreamSleep/DreamSleep/Class/HomeModule/Home/View/HomeHeaderView.m
DreamSleep/DreamSleep/Class/HomeModule/Home/Model/BannerModel.h
查看文件 @
d1b707a
...
@@ -22,6 +22,8 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -22,6 +22,8 @@ NS_ASSUME_NONNULL_BEGIN
@property
(
nonatomic
,
copy
)
NSString
*
info_url
;
@property
(
nonatomic
,
copy
)
NSString
*
info_url
;
// banner图描述
// banner图描述
@property
(
nonatomic
,
copy
)
NSString
*
banner_desc
;
@property
(
nonatomic
,
copy
)
NSString
*
banner_desc
;
// 登录标识
@property
(
nonatomic
,
assign
)
int
login_flag
;
@end
@end
NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
DreamSleep/DreamSleep/Class/HomeModule/Home/View/HomeHeaderView.m
查看文件 @
d1b707a
...
@@ -85,37 +85,42 @@
...
@@ -85,37 +85,42 @@
#pragma mark - CWCarouselDelegate
#pragma mark - CWCarouselDelegate
-
(
void
)
CWCarousel
:
(
CWCarousel
*
)
carousel
didSelectedAtIndex
:
(
NSInteger
)
index
{
-
(
void
)
CWCarousel
:
(
CWCarousel
*
)
carousel
didSelectedAtIndex
:
(
NSInteger
)
index
{
// 判断是否登录成功
BannerModel
*
model
=
self
.
bannerDatas
[
index
];
if
([
LoginUtils
getUserLoginData
])
{
if
(
model
.
login_flag
==
0
)
{
// 用户无需登录直接跳转
BannerModel
*
model
=
self
.
bannerDatas
[
index
];
[
self
jumpToBannerPageWithModel
:
model
];
}
else
{
[
DataStatisticsUtil
event
:
Banner_Click
attributes
:@{
@"name"
:
model
.
banner_name
,
@"url"
:
model
.
banner_url
}];
if
([
LoginUtils
getUserLoginData
])
{
[
self
jumpToBannerPageWithModel
:
model
];
}
else
{
// 跳转到登录页面
[
LoginUtils
jumpToLoginControllerWithTarget
:
self
.
ds_viewController
];
}
}
}
switch
(
model
.
banner_id
)
{
-
(
void
)
jumpToBannerPageWithModel
:
(
BannerModel
*
)
model
{
case
13
:
{
// 进入失眠拯救计划页面
[
DataStatisticsUtil
event
:
Banner_Click
attributes
:@{
@"name"
:
model
.
banner_name
,
@"url"
:
model
.
banner_url
}];
[
self
.
ds_viewController
.
navigationController
pushViewController
:[[
DsWebController
alloc
]
initWithLink
:
model
.
info_url
isShowNavi
:
NO
]
animated
:
YES
];
}
BOOL
isNative
=
[
model
.
info_url
containsString
:
@"native"
];
break
;
// 跳转到原生页面
case
11
:
{
// 切换到AI睡眠教练标签
if
(
isNative
)
{
self
.
ds_viewController
.
tabBarController
.
selectedIndex
=
1
;
int
type
=
[[[
model
.
info_url
componentsSeparatedByString
:
@"type="
]
lastObject
]
intValue
];
}
if
(
type
==
1
)
{
// 切换到AI睡眠教练标签
break
;
self
.
ds_viewController
.
tabBarController
.
selectedIndex
=
1
;
case
10
:
{
// 进入哄睡页面
}
else
if
(
type
==
2
)
{
// 首页
UnityGameController
*
gameVC
=
[
UnityGameController
new
];
self
.
ds_viewController
.
tabBarController
.
selectedIndex
=
0
;
gameVC
.
gameType
=
GameTypeCoax
;
}
else
if
(
type
==
3
)
{
// 哄睡页面
[
self
.
ds_viewController
.
navigationController
pushViewController
:
gameVC
animated
:
YES
];
UnityGameController
*
gameVC
=
[
UnityGameController
new
];
}
gameVC
.
gameType
=
GameTypeCoax
;
break
;
[
self
.
ds_viewController
.
navigationController
pushViewController
:
gameVC
animated
:
YES
];
case
8
:
{
// 进入睡眠评测页面
}
else
if
(
type
==
4
)
{
// 小球游戏
[
self
.
ds_viewController
.
navigationController
pushViewController
:[[
DsWebController
alloc
]
initWithLink
:
model
.
info_url
isShowNavi
:
NO
]
animated
:
YES
];
UnityGameController
*
gameVC
=
[
UnityGameController
new
];
}
gameVC
.
gameType
=
GameTypeBall
;
break
;
[
self
.
ds_viewController
.
navigationController
pushViewController
:
gameVC
animated
:
YES
];
default
:
break
;
}
}
}
else
{
}
else
{
// 跳转到
登录
页面
// 跳转到
H5
页面
[
LoginUtils
jumpToLoginControllerWithTarget
:
self
.
ds_viewController
];
[
self
.
ds_viewController
.
navigationController
pushViewController
:[[
DsWebController
alloc
]
initWithLink
:
model
.
info_url
isShowNavi
:
NO
]
animated
:
YES
];
}
}
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论