Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 859a366c
由
cgx
编写于
2022-06-18 16:50:23 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
优化轮播图自动无限循环播放
1 个父辈
3beeb052
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
43 行增加
和
24 行删除
DreamSleep/DreamSleep.xcodeproj/project.pbxproj
DreamSleep/DreamSleep/Class/HomeModule/Home/Controller/HomeViewController.m
DreamSleep/DreamSleep/Class/HomeModule/Home/View/DSHomeView.h
DreamSleep/DreamSleep/Class/HomeModule/Home/View/DSHomeView.m
DreamSleep/DreamSleep/Class/HomeModule/Home/View/HomeHeaderView.h
DreamSleep/DreamSleep/Class/HomeModule/Home/View/HomeHeaderView.m
DreamSleep/DreamSleep/Class/HomeModule/Home/View/SafeHelperCollectionViewCell.m
DreamSleep/DreamSleep/Class/HomeModule/UnityGame/UnityGameController.m
DreamSleep/DreamSleep/Class/ProfileModule/UserLogin/LoginController.m
DreamSleep/DreamSleep/Vendors/CWCarousel/CWCarousel.h
DreamSleep/DreamSleep/Vendors/CWCarousel/CWCarousel.m
DreamSleep/DreamSleep.xcodeproj/project.pbxproj
查看文件 @
859a366
...
@@ -2276,7 +2276,7 @@
...
@@ -2276,7 +2276,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 = Manual;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION =
9
;
CURRENT_PROJECT_VERSION =
10
;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 4NDZ6UX8PW;
DEVELOPMENT_TEAM = 4NDZ6UX8PW;
ENABLE_BITCODE = NO;
ENABLE_BITCODE = NO;
...
@@ -2352,7 +2352,7 @@
...
@@ -2352,7 +2352,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 =
9
;
CURRENT_PROJECT_VERSION =
10
;
DEVELOPMENT_TEAM = 4NDZ6UX8PW;
DEVELOPMENT_TEAM = 4NDZ6UX8PW;
ENABLE_BITCODE = NO;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
FRAMEWORK_SEARCH_PATHS = (
...
@@ -2488,7 +2488,7 @@
...
@@ -2488,7 +2488,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 =
9
;
CURRENT_PROJECT_VERSION =
10
;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 4NDZ6UX8PW;
DEVELOPMENT_TEAM = 4NDZ6UX8PW;
ENABLE_BITCODE = NO;
ENABLE_BITCODE = NO;
...
...
DreamSleep/DreamSleep/Class/HomeModule/Home/Controller/HomeViewController.m
查看文件 @
859a366
...
@@ -79,6 +79,24 @@
...
@@ -79,6 +79,24 @@
// 自动登录请求(调用时机)
// 自动登录请求(调用时机)
[
UserRequestModel
autoLoginRequestWithCompletion
:
^
(
UserRequestModel
*
_Nonnull
requestModel
)
{}];
[
UserRequestModel
autoLoginRequestWithCompletion
:
^
(
UserRequestModel
*
_Nonnull
requestModel
)
{}];
}
}
[
self
.
homeTV
.
headerView
controllerWillAppear
];
}
-
(
void
)
viewWillDisappear
:
(
BOOL
)
animated
{
[
super
viewWillDisappear
:
animated
];
[
self
.
homeTV
.
headerView
controllerWillDisAppear
];
}
-
(
void
)
viewDidDisappear
:
(
BOOL
)
animated
{
[
super
viewDidDisappear
:
animated
];
[[
NoisePlayerManager
sharedNoisePlayerManager
]
pauseAll
];
}
-
(
void
)
dealloc
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
name
:
NeedUpdateHomePage
object
:
nil
];
}
}
#pragma mark - 先放大,再缩小
#pragma mark - 先放大,再缩小
...
@@ -100,16 +118,6 @@
...
@@ -100,16 +118,6 @@
[
view
.
layer
addAnimation
:
animation
forKey
:
nil
];
[
view
.
layer
addAnimation
:
animation
forKey
:
nil
];
}
}
-
(
void
)
viewDidDisappear
:
(
BOOL
)
animated
{
[
super
viewDidDisappear
:
animated
];
[[
NoisePlayerManager
sharedNoisePlayerManager
]
pauseAll
];
}
-
(
void
)
dealloc
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
name
:
NeedUpdateHomePage
object
:
nil
];
}
-
(
void
)
needUpdate
{
-
(
void
)
needUpdate
{
[
self
.
homeTV
.
mj_header
beginRefreshing
];
[
self
.
homeTV
.
mj_header
beginRefreshing
];
}
}
...
...
DreamSleep/DreamSleep/Class/HomeModule/Home/View/DSHomeView.h
查看文件 @
859a366
...
@@ -6,12 +6,14 @@
...
@@ -6,12 +6,14 @@
//
//
#import <UIKit/UIKit.h>
#import <UIKit/UIKit.h>
#import "HomeHeaderView.h"
#import "SafeSleepModel.h"
#import "SafeSleepModel.h"
NS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN
/// APP首页自定义视图
/// APP首页自定义视图
@interface
DSHomeView
:
UITableView
@interface
DSHomeView
:
UITableView
@property
(
nonatomic
,
strong
)
HomeHeaderView
*
headerView
;
/// 刷新banner
/// 刷新banner
/// @param bannerListData bannerListData
/// @param bannerListData bannerListData
...
...
DreamSleep/DreamSleep/Class/HomeModule/Home/View/DSHomeView.m
查看文件 @
859a366
...
@@ -6,12 +6,10 @@
...
@@ -6,12 +6,10 @@
//
//
#import "DSHomeView.h"
#import "DSHomeView.h"
#import "HomeHeaderView.h"
#import "CourseMusicCell.h"
#import "CourseMusicCell.h"
#import "GoodSleepSoundCell.h"
#import "GoodSleepSoundCell.h"
@interface
DSHomeView
()
<
UITableViewDelegate
,
UITableViewDataSource
>
@interface
DSHomeView
()
<
UITableViewDelegate
,
UITableViewDataSource
>
@property
(
nonatomic
,
strong
)
HomeHeaderView
*
headerView
;
@property
(
nonatomic
,
strong
)
NSArray
*
courseMusicArr
;
@property
(
nonatomic
,
strong
)
NSArray
*
courseMusicArr
;
/// 类型数据
/// 类型数据
@property
(
nonatomic
,
strong
)
NSArray
*
typeArr
;
@property
(
nonatomic
,
strong
)
NSArray
*
typeArr
;
...
@@ -27,7 +25,6 @@
...
@@ -27,7 +25,6 @@
self
.
showsVerticalScrollIndicator
=
NO
;
self
.
showsVerticalScrollIndicator
=
NO
;
self
.
delegate
=
self
;
self
.
delegate
=
self
;
self
.
dataSource
=
self
;
self
.
dataSource
=
self
;
self
.
contentInsetAdjustmentBehavior
=
UIScrollViewContentInsetAdjustmentNever
;
[
self
registerClass
:[
CourseMusicCell
class
]
forCellReuseIdentifier
:
NSStringFromClass
([
CourseMusicCell
class
])];
[
self
registerClass
:[
CourseMusicCell
class
]
forCellReuseIdentifier
:
NSStringFromClass
([
CourseMusicCell
class
])];
[
self
registerClass
:[
GoodSleepSoundCell
class
]
forCellReuseIdentifier
:
NSStringFromClass
([
GoodSleepSoundCell
class
])];
[
self
registerClass
:[
GoodSleepSoundCell
class
]
forCellReuseIdentifier
:
NSStringFromClass
([
GoodSleepSoundCell
class
])];
self
.
tableHeaderView
=
self
.
headerView
;
self
.
tableHeaderView
=
self
.
headerView
;
...
...
DreamSleep/DreamSleep/Class/HomeModule/Home/View/HomeHeaderView.h
查看文件 @
859a366
...
@@ -16,6 +16,9 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -16,6 +16,9 @@ NS_ASSUME_NONNULL_BEGIN
/// @param listData listData
/// @param listData listData
-
(
void
)
updateBannerWithListData
:(
NSArray
*
)
listData
;
-
(
void
)
updateBannerWithListData
:(
NSArray
*
)
listData
;
-
(
void
)
controllerWillAppear
;
-
(
void
)
controllerWillDisAppear
;
@end
@end
NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
DreamSleep/DreamSleep/Class/HomeModule/Home/View/HomeHeaderView.m
查看文件 @
859a366
...
@@ -52,6 +52,14 @@
...
@@ -52,6 +52,14 @@
[
self
.
barnnerView
freshCarousel
];
[
self
.
barnnerView
freshCarousel
];
}
}
-
(
void
)
controllerWillAppear
{
[
self
.
barnnerView
controllerWillAppear
];
}
-
(
void
)
controllerWillDisAppear
{
[
self
.
barnnerView
controllerWillDisAppear
];
}
#pragma mark - CWCarouselDatasource
#pragma mark - CWCarouselDatasource
-
(
NSInteger
)
numbersForCarousel
{
-
(
NSInteger
)
numbersForCarousel
{
return
self
.
bannerDatas
.
count
;
return
self
.
bannerDatas
.
count
;
...
...
DreamSleep/DreamSleep/Class/HomeModule/Home/View/SafeHelperCollectionViewCell.m
查看文件 @
859a366
...
@@ -36,6 +36,8 @@
...
@@ -36,6 +36,8 @@
if
(
cellIndex
==
0
)
{
// 舒眠课程
if
(
cellIndex
==
0
)
{
// 舒眠课程
[
self
addSubview
:
self
.
courseIcon
];
[
self
addSubview
:
self
.
courseIcon
];
[
self
addSubview
:
self
.
courseLab
];
[
self
addSubview
:
self
.
courseLab
];
self
.
courseIcon
.
hidden
=
NO
;
self
.
courseLab
.
hidden
=
NO
;
self
.
courseLab
.
text
=
[
NSString
stringWithFormat
:
@"%d"
,
model
.
count
];
self
.
courseLab
.
text
=
[
NSString
stringWithFormat
:
@"%d"
,
model
.
count
];
[
self
.
courseLab
sizeToFit
];
[
self
.
courseLab
sizeToFit
];
...
@@ -48,6 +50,9 @@
...
@@ -48,6 +50,9 @@
make
.
left
.
equalTo
(
self
.
courseIcon
.
mas_right
).
offset
(
6
);
make
.
left
.
equalTo
(
self
.
courseIcon
.
mas_right
).
offset
(
6
);
make
.
centerY
.
equalTo
(
self
.
courseIcon
);
make
.
centerY
.
equalTo
(
self
.
courseIcon
);
}];
}];
}
else
{
if
(
_courseIcon
)
{
_courseIcon
.
hidden
=
YES
;
}
if
(
_courseLab
)
{
_courseLab
.
hidden
=
YES
;
}
}
}
CGFloat
width
=
128
;
CGFloat
width
=
128
;
...
...
DreamSleep/DreamSleep/Class/HomeModule/UnityGame/UnityGameController.m
查看文件 @
859a366
...
@@ -122,5 +122,7 @@ extern char** gArgv;
...
@@ -122,5 +122,7 @@ extern char** gArgv;
1、默认情况关闭手机静音按钮,进入Unity游戏后播放音频没有声音,需要到Unity工程-UnityAppController.mm修改源代码;
1、默认情况关闭手机静音按钮,进入Unity游戏后播放音频没有声音,需要到Unity工程-UnityAppController.mm修改源代码;
2、首次启动Unity游戏,默认会加载主APP启动页面,需要到Unity工程-UnityAppController+ViewHandling.mm修改源代码;
2、首次启动Unity游戏,默认会加载主APP启动页面,需要到Unity工程-UnityAppController+ViewHandling.mm修改源代码;
3、Unity工程不支持bitcode,需要关闭;
3、Unity工程不支持bitcode,需要关闭;
4、Unity工程有变化时需要手动编译生成新的UnityFramework.framework动态库,然后导入到该目录下:
$(PROJECT_DIR)/unity_build_framework(后续通过脚本优化?)
*/
*/
@end
@end
DreamSleep/DreamSleep/Class/ProfileModule/UserLogin/LoginController.m
查看文件 @
859a366
...
@@ -160,7 +160,7 @@
...
@@ -160,7 +160,7 @@
#pragma mark - 授权失败的回调
#pragma mark - 授权失败的回调
-
(
void
)
authorizationController
:
(
ASAuthorizationController
*
)
controller
didCompleteWithError
:
(
NSError
*
)
error
API_AVAILABLE
(
ios
(
13
.
0
))
{
-
(
void
)
authorizationController
:
(
ASAuthorizationController
*
)
controller
didCompleteWithError
:
(
NSError
*
)
error
API_AVAILABLE
(
ios
(
13
.
0
))
{
NSString
*
errorMsg
=
nil
;
NSString
*
errorMsg
=
@""
;
switch
(
error
.
code
)
{
switch
(
error
.
code
)
{
case
ASAuthorizationErrorCanceled
:
case
ASAuthorizationErrorCanceled
:
errorMsg
=
@"用户取消了授权请求"
;
errorMsg
=
@"用户取消了授权请求"
;
...
@@ -183,7 +183,7 @@
...
@@ -183,7 +183,7 @@
}
}
DSLog
(
@"controller requests:%@, errorMsg:%@"
,
controller
.
authorizationRequests
,
errorMsg
);
DSLog
(
@"controller requests:%@, errorMsg:%@"
,
controller
.
authorizationRequests
,
errorMsg
);
[
DataStatisticsUtil
event
:
Apple_Login
attributes
:@{
@"name"
:
@"苹果登录授权失败"
}];
[
DataStatisticsUtil
event
:
Apple_Login
attributes
:@{
@"name"
:
errorMsg
}];
}
}
#pragma mark - ASAuthorizationControllerPresentationContextProviding
#pragma mark - ASAuthorizationControllerPresentationContextProviding
...
...
DreamSleep/DreamSleep/Vendors/CWCarousel/CWCarousel.h
查看文件 @
859a366
...
@@ -149,18 +149,12 @@
...
@@ -149,18 +149,12 @@
*/
*/
-
(
void
)
controllerWillDisAppear
;
-
(
void
)
controllerWillDisAppear
;
/// 滚动到指定下标
/// 滚动到指定下标
/// @param index 指定下标
/// @param index 指定下标
/// @param animation 是否开启滚动动画
/// @param animation 是否开启滚动动画
-
(
void
)
scrollTo
:(
NSInteger
)
index
animation
:(
BOOL
)
animation
;
-
(
void
)
scrollTo
:(
NSInteger
)
index
animation
:(
BOOL
)
animation
;
@end
@end
@interface
CWCarouselCollectionView
:
UICollectionView
<
UIGestureRecognizerDelegate
>
@interface
CWCarouselCollectionView
:
UICollectionView
<
UIGestureRecognizerDelegate
>
@end
@end
...
...
DreamSleep/DreamSleep/Vendors/CWCarousel/CWCarousel.m
查看文件 @
859a366
此文件的差异被折叠,
点击展开。
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论