Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 9bbde2ef
由
cgx
编写于
2022-04-25 21:32:20 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
优化H5页面
1 个父辈
10ab82db
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
14 行增加
和
83 行删除
DreamSleep/DreamSleep.xcodeproj/project.pbxproj
DreamSleep/DreamSleep/HomeModule/Home/View/HomeHeaderView.m
DreamSleep/DreamSleep/PrivacyPolicy/PrivacyView.m
DreamSleep/DreamSleep/PrivacyPolicy/PrivacyViewController.h
DreamSleep/DreamSleep/PrivacyPolicy/PrivacyViewController.m
DreamSleep/DreamSleep/Profile/Me/ProfileController.m
DreamSleep/DreamSleep/Profile/SystemSet/SystemSetController.m
DreamSleep/DreamSleep/Profile/UserLogin/LoginController.m
DreamSleep/DreamSleep.xcodeproj/project.pbxproj
查看文件 @
9bbde2e
...
...
@@ -1383,7 +1383,7 @@
GENERATE_INFOPLIST_FILE = YES;
HEADER_SEARCH_PATHS = "$(inherited)/**";
INFOPLIST_FILE = DreamSleep/DSConfig/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "小梦睡眠-
Dev
";
INFOPLIST_KEY_CFBundleDisplayName = "小梦睡眠-
冥想解压助眠健康养生
";
INFOPLIST_KEY_NSCameraUsageDescription = "APP需要访问您的相机。";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
...
...
@@ -1504,7 +1504,7 @@
GENERATE_INFOPLIST_FILE = YES;
HEADER_SEARCH_PATHS = "$(inherited)/**";
INFOPLIST_FILE = DreamSleep/DSConfig/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "小梦睡眠-
Dev
";
INFOPLIST_KEY_CFBundleDisplayName = "小梦睡眠-
Beta
";
INFOPLIST_KEY_NSCameraUsageDescription = "APP需要访问您的相机。";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
...
...
DreamSleep/DreamSleep/HomeModule/Home/View/HomeHeaderView.m
查看文件 @
9bbde2e
...
...
@@ -12,7 +12,6 @@
#import "HeaderDataModel.h"
#import "DsMiddleView.h"
#import "ThreeMinuteController.h"
#import "PrivacyViewController.h"
@interface
HomeHeaderView
()
<
CWCarouselDatasource
,
CWCarouselDelegate
>
// 轮播图
...
...
@@ -95,7 +94,7 @@
}
break
;
case
8
:
{
// 进入睡眠评测页面
[
self
.
ds_viewController
.
navigationController
pushViewController
:[[
PrivacyViewController
alloc
]
initWithTitle
:
@"睡眠评测"
link
:[
NSURL
URLWithString
:
model
.
info_url
]
isDetail
:
YES
]
animated
:
YES
];
[
self
.
ds_viewController
.
navigationController
pushViewController
:[[
DsWebController
alloc
]
initWithTitle
:
@"睡眠评测"
link
:
model
.
info_url
]
animated
:
YES
];
}
break
;
default
:
...
...
DreamSleep/DreamSleep/PrivacyPolicy/PrivacyView.m
查看文件 @
9bbde2e
...
...
@@ -121,7 +121,7 @@
#pragma mark - UITextViewDelegate
-
(
BOOL
)
textView
:
(
UITextView
*
)
textView
shouldInteractWithURL
:
(
NSURL
*
)
URL
inRange
:
(
NSRange
)
characterRange
interaction
:
(
UITextItemInteraction
)
interaction
{
NSString
*
title
=
[
URL
.
absoluteString
isEqualToString
:
UserServiceAgreement
]
?
@"用户服务协议"
:
@"隐私政策"
;
[
self
.
ds_viewController
.
navigationController
pushViewController
:[[
PrivacyViewController
alloc
]
initWithTitle
:
title
link
:
URL
isDetail
:
YES
]
animated
:
YES
];
[
self
.
ds_viewController
.
navigationController
pushViewController
:[[
DsWebController
alloc
]
initWithTitle
:
title
link
:
URL
.
absoluteString
]
animated
:
YES
];
return
NO
;
}
...
...
DreamSleep/DreamSleep/PrivacyPolicy/PrivacyViewController.h
查看文件 @
9bbde2e
...
...
@@ -9,14 +9,8 @@
NS_ASSUME_NONNULL_BEGIN
/// 隐私政策弹框
及详情控制器(H页面,需要改名封装)
/// 隐私政策弹框
控制器
@interface
PrivacyViewController
:
UIViewController
/// 隐私政策详情控制器初始化
/// @param title title
/// @param link h5链接
/// @param isDetail YES:详情
-
(
instancetype
)
initWithTitle
:(
NSString
*
)
title
link
:(
NSURL
*
)
link
isDetail
:(
BOOL
)
isDetail
;
@end
NS_ASSUME_NONNULL_END
DreamSleep/DreamSleep/PrivacyPolicy/PrivacyViewController.m
查看文件 @
9bbde2e
...
...
@@ -7,55 +7,25 @@
#import "PrivacyViewController.h"
#import "PrivacyView.h"
#import <WebKit/webKit.h>
@interface
PrivacyViewController
()
@property
(
nonatomic
,
strong
)
PrivacyView
*
policyView
;
@property
(
nonatomic
,
strong
)
UIView
*
maskView
;
@property
(
nonatomic
,
copy
)
NSString
*
naviTitle
;
@property
(
nonatomic
,
strong
)
NSURL
*
link
;
@property
(
nonatomic
,
assign
)
BOOL
isDetail
;
@property
(
nonatomic
,
strong
)
WKWebView
*
webView
;
// 黑夜模式遮罩(到时候提取出来,全局通用)
@property
(
nonatomic
,
strong
)
UIView
*
darkMaskView
;
@end
@implementation
PrivacyViewController
-
(
instancetype
)
initWithTitle
:(
NSString
*
)
title
link
:(
NSURL
*
)
link
isDetail
:(
BOOL
)
isDetail
{
if
(
self
=
[
super
init
])
{
self
.
naviTitle
=
title
;
self
.
link
=
link
;
self
.
isDetail
=
isDetail
;
}
return
self
;
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
view
.
backgroundColor
=
DSWhite
;
if
(
self
.
isDetail
)
{
self
.
title
=
self
.
naviTitle
;
[
self
.
view
addSubview
:
self
.
webView
];
}
else
{
[
self
showPrivacyView
];
}
if
(
self
.
isDetail
)
{
self
.
darkMaskView
.
hidden
=
!
[
self
.
dk_manager
.
themeVersion
isEqualToString
:
DKThemeVersionNight
];
}
}
-
(
void
)
dealloc
{
[
self
.
maskView
removeFromSuperview
];
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
[
super
viewWillAppear
:
animated
];
self
.
navigationController
.
navigationBarHidden
=
!
self
.
isDetail
;
self
.
navigationController
.
navigationBarHidden
=
YES
;
}
#pragma mark - 关闭侧滑
...
...
@@ -63,19 +33,14 @@
return
NO
;
}
#pragma mark -
H5页面导航栏为默认模式
#pragma mark -
导航栏为NaviStyleUndef
-
(
NaviStyle
)
navigationBarStyle
{
return
self
.
isDetail
?
NaviStyleDefault
:
NaviStyleUndef
;
return
NaviStyleUndef
;
}
#pragma mark - 设置状态栏文字颜色
-
(
UIStatusBarStyle
)
preferredStatusBarStyle
{
if
(
self
.
isDetail
)
{
// 导航栏显示不会执行以下代码
return
UIStatusBarStyleLightContent
;
}
else
{
return
[
self
.
dk_manager
.
themeVersion
isEqualToString
:
DKThemeVersionNormal
]
?
UIStatusBarStyleDefault
:
UIStatusBarStyleLightContent
;
}
}
-
(
void
)
showPrivacyView
{
...
...
@@ -96,28 +61,4 @@
self
.
maskView
.
hidden
=
NO
;
}
-
(
WKWebView
*
)
webView
{
if
(
!
_webView
)
{
_webView
=
[[
WKWebView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
kScreenHeight
-
kTopHeight
(
0
))];
_webView
.
backgroundColor
=
DSWhite
;
_webView
.
scrollView
.
showsVerticalScrollIndicator
=
NO
;
_webView
.
scrollView
.
showsHorizontalScrollIndicator
=
NO
;
_webView
.
scrollView
.
contentInsetAdjustmentBehavior
=
UIScrollViewContentInsetAdjustmentNever
;
NSURLRequest
*
request
=
[
NSURLRequest
requestWithURL
:
self
.
link
];
[
_webView
loadRequest
:
request
];
}
return
_webView
;
}
-
(
UIView
*
)
darkMaskView
{
if
(
!
_darkMaskView
)
{
_darkMaskView
=
[[
UIView
alloc
]
initWithFrame
:[
UIScreen
mainScreen
].
bounds
];
_darkMaskView
.
backgroundColor
=
ColorFromHex
(
0x6B7485
);
_darkMaskView
.
alpha
=
.
5
;
_darkMaskView
.
userInteractionEnabled
=
NO
;
[
self
.
view
addSubview
:
_darkMaskView
];
}
return
_darkMaskView
;
}
@end
DreamSleep/DreamSleep/Profile/Me/ProfileController.m
查看文件 @
9bbde2e
...
...
@@ -10,7 +10,6 @@
#import "AccountController.h"
#import "SystemSetController.h"
#import "InviteController.h"
#import "PrivacyViewController.h"
#import "ProfileAlertView.h"
@interface
ProfileController
()
...
...
@@ -90,7 +89,7 @@
break
;
case
4
:
// 关于我们
{
[
self
.
navigationController
pushViewController
:[[
PrivacyViewController
alloc
]
initWithTitle
:
@"关于我们"
link
:[
NSURL
URLWithString
:
AboutUS
]
isDetail
:
YE
S
]
animated
:
YES
];
[
self
.
navigationController
pushViewController
:[[
DsWebController
alloc
]
initWithTitle
:
@"关于我们"
link
:
AboutU
S
]
animated
:
YES
];
}
break
;
case
5
:
// 前往小程序
...
...
@@ -112,7 +111,7 @@
break
;
case
8
:
// CBTI
{
[
self
.
navigationController
pushViewController
:[[
PrivacyViewController
alloc
]
initWithTitle
:
@"失眠的认知行为疗法(CBTI)"
link
:[
NSURL
URLWithString
:
MYCBTI
]
isDetail
:
YES
]
animated
:
YES
];
[
self
.
navigationController
pushViewController
:[[
DsWebController
alloc
]
initWithTitle
:
@"失眠的认知行为疗法(CBTI)"
link
:
MYCBTI
]
animated
:
YES
];
}
break
;;
default
:
...
...
DreamSleep/DreamSleep/Profile/SystemSet/SystemSetController.m
查看文件 @
9bbde2e
...
...
@@ -6,7 +6,6 @@
//
#import "SystemSetController.h"
#import "PrivacyViewController.h"
#import "SetTableView.h"
@interface
SystemSetController
()
<
SetTableViewDelegate
>
...
...
@@ -34,12 +33,12 @@
switch
(
indexPath
.
row
)
{
case
1
:
// 用户协议
{
[
self
.
navigationController
pushViewController
:[[
PrivacyViewController
alloc
]
initWithTitle
:
@"用户服务协议"
link
:[
NSURL
URLWithString
:
UserServiceAgreement
]
isDetail
:
YES
]
animated
:
YES
];
[
self
.
navigationController
pushViewController
:[[
DsWebController
alloc
]
initWithTitle
:
@"用户服务协议"
link
:
UserServiceAgreement
]
animated
:
YES
];
}
break
;
case
2
:
// 隐私政策
{
[
self
.
navigationController
pushViewController
:[[
PrivacyViewController
alloc
]
initWithTitle
:
@"隐私政策"
link
:[
NSURL
URLWithString
:
PrivacyPolicy
]
isDetail
:
YES
]
animated
:
YES
];
[
self
.
navigationController
pushViewController
:[[
DsWebController
alloc
]
initWithTitle
:
@"隐私政策"
link
:
PrivacyPolicy
]
animated
:
YES
];
}
break
;
default
:
...
...
DreamSleep/DreamSleep/Profile/UserLogin/LoginController.m
查看文件 @
9bbde2e
...
...
@@ -7,7 +7,6 @@
#import "LoginController.h"
#import "LoginView.h"
#import "PrivacyViewController.h"
#import <AuthenticationServices/AuthenticationServices.h>
#import "UserRequestModel.h"
...
...
@@ -96,12 +95,12 @@
break
;
case
4
:
// 许可协议
{
[
self
.
navigationController
pushViewController
:[[
PrivacyViewController
alloc
]
initWithTitle
:
@"用户服务协议"
link
:[
NSURL
URLWithString
:
UserServiceAgreement
]
isDetail
:
YES
]
animated
:
YES
];
[
self
.
navigationController
pushViewController
:[[
DsWebController
alloc
]
initWithTitle
:
@"用户服务协议"
link
:
UserServiceAgreement
]
animated
:
YES
];
}
break
;
case
5
:
// 隐私保护指引
{
[
self
.
navigationController
pushViewController
:[[
PrivacyViewController
alloc
]
initWithTitle
:
@"隐私政策"
link
:[
NSURL
URLWithString
:
PrivacyPolicy
]
isDetail
:
YES
]
animated
:
YES
];
[
self
.
navigationController
pushViewController
:[[
DsWebController
alloc
]
initWithTitle
:
@"隐私政策"
link
:
PrivacyPolicy
]
animated
:
YES
];
}
break
;
default
:
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论