Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit bc6a86ac
由
cgx
编写于
2022-04-11 10:28:01 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
隐私页面导航栏调整 && Universal Link配置
1 个父辈
51af4980
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
87 行增加
和
70 行删除
DreamSleep/DreamSleep.xcodeproj/project.pbxproj
DreamSleep/DreamSleep/AISleepCoach/AISleepCoachController.m
DreamSleep/DreamSleep/DreamSleep.entitlements
DreamSleep/DreamSleep/DreamSleepDebug.entitlements
DreamSleep/DreamSleep/Home/DsMiddleView.m
DreamSleep/DreamSleep/Launcher/LeadView.m
DreamSleep/DreamSleep/Main/AppDelegate.m
DreamSleep/DreamSleep/Main/BaseNaviController.m
DreamSleep/DreamSleep/PrivacyPolicy/PrivacyViewController.m
DreamSleep/DreamSleep/Utils/DSConstUtil.m
DreamSleep/DreamSleep.xcodeproj/project.pbxproj
查看文件 @
bc6a86a
...
...
@@ -160,7 +160,7 @@
D0E9408427FE96A900D57495 /* WXApiObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXApiObject.h; sourceTree = "<group>"; };
D0E9408627FE96A900D57495 /* WechatAuthSDK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WechatAuthSDK.h; sourceTree = "<group>"; };
D0E9408727FE96A900D57495 /* libWeChatSDK.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libWeChatSDK.a; sourceTree = "<group>"; };
D0
E9409127FED77000D57495 /* DreamSleep.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DreamSleep
.entitlements; sourceTree = "<group>"; };
D0
F808ED2803C83A0097899F /* DreamSleepDebug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DreamSleepDebug
.entitlements; sourceTree = "<group>"; };
F02C34A5649294F60932630C /* Pods-DreamSleep.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DreamSleep.release.xcconfig"; path = "Target Support Files/Pods-DreamSleep/Pods-DreamSleep.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
...
...
@@ -354,7 +354,7 @@
D0B5ECA327F2D9DE003EDFE3 /* DreamSleep */ = {
isa = PBXGroup;
children = (
D0
E9409127FED77000D57495 /* DreamSleep
.entitlements */,
D0
F808ED2803C83A0097899F /* DreamSleepDebug
.entitlements */,
D0E9408127FE961300D57495 /* Vendors */,
D04567AA27F6D067009F0A82 /* Main */,
D04567AB27F6D0A5009F0A82 /* Home */,
...
...
@@ -750,11 +750,11 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
Bundle_Display_Name = "小梦睡眠-Dev";
CODE_SIGN_ENTITLEMENTS = DreamSleep/DreamSleep.entitlements;
CODE_SIGN_ENTITLEMENTS = DreamSleep/DreamSleep
Debug
.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE =
Manual
;
CODE_SIGN_STYLE =
Automatic
;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM =
""
;
DEVELOPMENT_TEAM =
SPH85C3TWU
;
GCC_PREFIX_HEADER = "${SRCROOT}/DreamSleep/Utils/PrefixHeader.pch";
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
GENERATE_INFOPLIST_FILE = YES;
...
...
@@ -799,8 +799,8 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
Bundle_Display_Name = "小梦睡眠-冥想解压助眠健康养生";
CODE_SIGN_ENTITLEMENTS = DreamSleep/DreamSleep.entitlements;
CODE_SIGN_IDENTITY = "
iPhone Distribution
";
CODE_SIGN_STYLE =
Manual
;
CODE_SIGN_IDENTITY = "
Apple Development
";
CODE_SIGN_STYLE =
Automatic
;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 4NDZ6UX8PW;
GCC_PREFIX_HEADER = "${SRCROOT}/DreamSleep/Utils/PrefixHeader.pch";
...
...
@@ -832,7 +832,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.aolei.sleep;
PRODUCT_MODULE_NAME = DreamSleep;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER =
xiaomengSleep_dis_profile
;
PROVISIONING_PROFILE_SPECIFIER =
""
;
SWIFT_EMIT_LOC_STRINGS = YES;
TARGETED_DEVICE_FAMILY = 1;
};
...
...
@@ -905,10 +905,10 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
Bundle_Display_Name = "小梦睡眠-Beta";
CODE_SIGN_ENTITLEMENTS = DreamSleep/DreamSleep.entitlements;
CODE_SIGN_IDENTITY = "
Apple Development
";
CODE_SIGN_STYLE =
Automatic
;
CODE_SIGN_IDENTITY = "
iPhone Distribution
";
CODE_SIGN_STYLE =
Manual
;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM =
""
;
DEVELOPMENT_TEAM =
4NDZ6UX8PW
;
GCC_PREFIX_HEADER = "${SRCROOT}/DreamSleep/Utils/PrefixHeader.pch";
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
GENERATE_INFOPLIST_FILE = YES;
...
...
@@ -938,7 +938,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.aolei.sleep;
PRODUCT_MODULE_NAME = DreamSleepBeta;
PRODUCT_NAME = "$(TARGET_NAME)Beta";
PROVISIONING_PROFILE_SPECIFIER =
""
;
PROVISIONING_PROFILE_SPECIFIER =
xiaomengSleep_adhot_profile
;
SWIFT_EMIT_LOC_STRINGS = YES;
TARGETED_DEVICE_FAMILY = 1;
};
...
...
DreamSleep/DreamSleep/AISleepCoach/AISleepCoachController.m
查看文件 @
bc6a86a
...
...
@@ -112,7 +112,7 @@
_aiWebView
.
navigationDelegate
=
self
;
_aiWebView
.
scrollView
.
showsVerticalScrollIndicator
=
NO
;
_aiWebView
.
scrollView
.
showsHorizontalScrollIndicator
=
NO
;
//
iOS 11:
//
解决页面顶部出现白色问题
_aiWebView
.
scrollView
.
contentInsetAdjustmentBehavior
=
UIScrollViewContentInsetAdjustmentNever
;
// 测试地址:https://www.cbti.cn/sleep/ai/sleep_aicocah
...
...
DreamSleep/DreamSleep/DreamSleep.entitlements
查看文件 @
bc6a86a
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist
version=
"1.0"
>
<dict/>
<dict>
<key>
com.apple.developer.associated-domains
</key>
<array>
<string>
applinks:https://www.cbti.cn/sleep_apple
</string>
</array>
</dict>
</plist>
DreamSleep/DreamSleep/DreamSleepDebug.entitlements
0 → 100644
查看文件 @
bc6a86a
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist
version=
"1.0"
>
<dict/>
</plist>
DreamSleep/DreamSleep/Home/DsMiddleView.m
查看文件 @
bc6a86a
...
...
@@ -8,6 +8,7 @@
#import "DsMiddleView.h"
#import "HeaderDataModel.h"
#import "BreatheController.h"
#import "WXApi.h"
@interface
DsMiddleView
()
@property
(
nonatomic
,
strong
)
UIButton
*
unityBtn
;
...
...
@@ -77,6 +78,16 @@
[
self
.
ds_viewController
.
navigationController
pushViewController
:
breatheVC
animated
:
YES
];
self
.
ds_viewController
.
hidesBottomBarWhenPushed
=
NO
;
}
#pragma mark - 模拟微信登录
// // 构造SendAuthReq结构体
// SendAuthReq* req = [[SendAuthReq alloc] init];
// req.scope = @"snsapi_userinfo";
// req.state = @"123";
// // 第三方向微信终端发送一个SendAuthReq消息结构
// [WXApi sendReq:req completion:^(BOOL success) {
// DSLog(@"调起微信成功...");
// }];
}
@end
DreamSleep/DreamSleep/Launcher/LeadView.m
查看文件 @
bc6a86a
...
...
@@ -6,7 +6,6 @@
//
#import "LeadView.h"
#import "WXApi.h"
@interface
LeadView
()
<
UIScrollViewDelegate
>
@property
(
nonatomic
,
strong
)
UIScrollView
*
mainScrollView
;
...
...
@@ -85,16 +84,6 @@
}
-
(
void
)
startAction
{
#pragma mark - 模拟微信登录
// // 构造SendAuthReq结构体
// SendAuthReq* req = [[SendAuthReq alloc] init];
// req.scope = @"snsapi_userinfo";
// req.state = @"123";
// // 第三方向微信终端发送一个SendAuthReq消息结构
// [WXApi sendReq:req completion:^(BOOL success) {
// DSLog(@"调起微信成功...");
// }];
if
(
self
.
delegate
&&
[
self
.
delegate
respondsToSelector
:
@selector
(
startExplore
)])
{
[
self
.
delegate
startExplore
];
}
...
...
DreamSleep/DreamSleep/Main/AppDelegate.m
查看文件 @
bc6a86a
...
...
@@ -10,6 +10,7 @@
#import "PrivacyViewController.h"
#import "DSTabBarController.h"
#import "WXApi.h"
#import "BaseNaviController.h"
@interface
AppDelegate
()
<
WXApiDelegate
>
@end
...
...
@@ -22,9 +23,9 @@
[
self
.
window
makeKeyAndVisible
];
UIStoryboard
*
mainStoryBoard
=
[
UIStoryboard
storyboardWithName
:
@"Main"
bundle
:
nil
];
self
.
window
.
rootViewController
=
[
mainStoryBoard
instantiateViewControllerWithIdentifier
:
@"mainSB"
];
// UINavigationController *navi = [[UINavigation
Controller alloc] initWithRootViewController:[[PrivacyViewController alloc] init]];
// self.window.rootViewController = navi;
// BaseNaviController *navi = [[BaseNavi
Controller alloc] initWithRootViewController:[[PrivacyViewController alloc] init]];
// self.window.rootViewController = navi;
[
self
initWeChat
];
...
...
@@ -33,17 +34,17 @@
-
(
void
)
initWeChat
{
// 在register之前打开log, 后续可以根据log排查问题
// [WXApi startLogByLevel:WXLogLevelDetail logBlock:^(NSString *log) {
// N
SLog(@"WeChatSDK: %@", log);
// }];
// [WXApi startLogByLevel:WXLogLevelDetail logBlock:^(NSString *log) {
// D
SLog(@"WeChatSDK: %@", log);
// }];
// 务必在调用自检函数前注册
[
WXApi
registerApp
:
WeChatAppID
universalLink
:
@"https://help.wechat.com/sdksample/"
];
[
WXApi
registerApp
:
WeChatAppID
universalLink
:
UNIVERSAL_LINK
];
// 调用自检函数
// [WXApi checkUniversalLinkReady:^(WXULCheckStep step, WXCheckULStepResult* result) {
// N
SLog(@"%@, %u, %@, %@", @(step), result.success, result.errorInfo, result.suggestion);
// }];
// [WXApi checkUniversalLinkReady:^(WXULCheckStep step, WXCheckULStepResult* result) {
// D
SLog(@"%@, %u, %@, %@", @(step), result.success, result.errorInfo, result.suggestion);
// }];
}
-
(
BOOL
)
application
:
(
UIApplication
*
)
app
openURL
:
(
NSURL
*
)
url
options
:
(
NSDictionary
<
UIApplicationOpenURLOptionsKey
,
id
>
*
)
options
{
...
...
@@ -55,8 +56,34 @@
DSLog
(
@"req:%@"
,
req
);
}
-
(
void
)
onResp
:
(
BaseResp
*
)
resp
{
DSLog
(
@"resp:%@"
,
resp
);
/*! 微信回调,不管是登录还是分享成功与否,都是走这个方法 @brief 发送一个sendReq后,收到微信的回应
*
* 收到一个来自微信的处理结果。调用一次sendReq后会收到onResp。
* 可能收到的处理结果有SendMessageToWXResp、SendAuthResp等。
* @param resp 具体的回应内容,是自动释放的
*/
-
(
void
)
onResp
:
(
BaseResp
*
)
resp
{
DSLog
(
@"resp %d"
,
resp
.
errCode
);
/*
enum WXErrCode {
WXSuccess = 0, 成功
WXErrCodeCommon = -1, 普通错误类型
WXErrCodeUserCancel = -2, 用户点击取消并返回
WXErrCodeSentFail = -3, 发送失败
WXErrCodeAuthDeny = -4, 授权失败
WXErrCodeUnsupport = -5, 微信不支持
};
*/
// 授权登录的类
if
([
resp
isKindOfClass
:[
SendAuthResp
class
]])
{
if
(
resp
.
errCode
==
0
)
{
SendAuthResp
*
resp2
=
(
SendAuthResp
*
)
resp
;
DSLog
(
@"resp2.code:%@"
,
resp2
.
code
);
}
else
{
DSLog
(
@"error:%@"
,
resp
.
errStr
);
}
}
}
@end
DreamSleep/DreamSleep/Main/BaseNaviController.m
查看文件 @
bc6a86a
...
...
@@ -21,11 +21,14 @@
+
(
void
)
setNavigationBarStyle
:
(
NaviStyle
)
style
vc
:
(
UIViewController
*
)
vc
{
UINavigationBar
*
naviBar
=
vc
.
navigationController
.
navigationBar
;
UIColor
*
titleColor
=
ColorFromHex
(
0x333333
);
UIColor
*
bgColor
=
DSWhite
;
UIColor
*
barTintColor
=
DSWhite
;
// NaviStyleDefault
UIColor
*
titleColor
=
DSWhite
;
UIColor
*
bgColor
=
BrandColor
;
UIColor
*
barTintColor
=
BrandColor
;
if
(
style
==
NaviStyleLight
)
{
titleColor
=
ColorFromHex
(
0x333333
);
bgColor
=
DSWhite
;
barTintColor
=
DSWhite
;
}
else
if
(
style
==
NaviStyleDark
)
{
titleColor
=
DSWhite
;
bgColor
=
DarkColor
;
...
...
@@ -44,7 +47,8 @@
appearance
.
shadowColor
=
DSClearColor
;
// 生效
naviBar
.
scrollEdgeAppearance
=
appearance
;
// naviBar.standardAppearance = appearance;
// 滚动视图滚动后导航栏背景色不会被影响
naviBar
.
standardAppearance
=
appearance
;
}
else
{
// 导航栏title颜色
[
naviBar
setTitleTextAttributes
:
titleTextAttributes
];
...
...
DreamSleep/DreamSleep/PrivacyPolicy/PrivacyViewController.m
查看文件 @
bc6a86a
...
...
@@ -33,7 +33,6 @@
[
super
viewDidLoad
];
self
.
view
.
backgroundColor
=
DSWhite
;
[
self
naviSetting
];
if
(
self
.
isDetail
)
{
self
.
title
=
self
.
naviTitle
;
...
...
@@ -49,29 +48,6 @@
self
.
navigationController
.
navigationBarHidden
=
!
self
.
isDetail
;
}
-
(
void
)
naviSetting
{
// 设置导航栏返回按钮文字
self
.
navigationItem
.
backBarButtonItem
=
[[
UIBarButtonItem
alloc
]
initWithTitle
:
@""
style
:
UIBarButtonItemStylePlain
target
:
self
action
:
nil
];
// 设置导航栏返回按钮颜色
self
.
navigationController
.
navigationBar
.
tintColor
=
DSWhite
;
// 设置导航栏背景色和title颜色
NSDictionary
*
titleTextAttributes
=
@{
NSForegroundColorAttributeName
:
DSWhite
};
if
(
@available
(
iOS
13
.
0
,
*
))
{
UINavigationBarAppearance
*
appearance
=
[
UINavigationBarAppearance
new
];
appearance
.
titleTextAttributes
=
titleTextAttributes
;
appearance
.
backgroundColor
=
BrandColor
;
self
.
navigationController
.
navigationBar
.
standardAppearance
=
appearance
;
self
.
navigationController
.
navigationBar
.
scrollEdgeAppearance
=
appearance
;
}
else
{
self
.
navigationController
.
navigationBar
.
barTintColor
=
BrandColor
;
[
self
.
navigationController
.
navigationBar
setTitleTextAttributes
:
titleTextAttributes
];
}
}
-
(
void
)
showPrivacyView
{
self
.
policyView
=
[[
PrivacyView
alloc
]
init
];
[
self
.
view
addSubview
:
self
.
policyView
];
...
...
@@ -92,7 +68,7 @@
-
(
WKWebView
*
)
webView
{
if
(
!
_webView
)
{
_webView
=
[[
WKWebView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
kTopHeight
(
0
)
,
kScreenWidth
,
kScreenHeight
-
kTopHeight
(
0
))];
_webView
=
[[
WKWebView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
kScreenHeight
-
kTopHeight
(
0
))];
_webView
.
backgroundColor
=
DSWhite
;
_webView
.
scrollView
.
showsVerticalScrollIndicator
=
NO
;
_webView
.
scrollView
.
showsHorizontalScrollIndicator
=
NO
;
...
...
DreamSleep/DreamSleep/Utils/DSConstUtil.m
查看文件 @
bc6a86a
...
...
@@ -13,7 +13,7 @@ NSString * const PrivacyStatement = @"欢迎来到小梦睡眠,我们依据最
NSString
*
const
WeChatAppID
=
@"wx4cdd4760092cdfdf"
;
NSString
*
const
WeChatAppSecret
=
@""
;
NSString
*
const
UNIVERSAL_LINK
=
@""
;
NSString
*
const
UNIVERSAL_LINK
=
@"
https://www.cbti.cn/sleep_apple/
"
;
@implementation
DSConstUtil
@end
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论