Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 0ec9cf91
由
cgx
编写于
2022-06-01 18:19:36 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
对接部分H5页面
1 个父辈
fb3f3ce2
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
14 行增加
和
2 行删除
DreamSleep/DreamSleep/Basement/H5/DsWebController.m
DreamSleep/DreamSleep/Basement/Utils/ServerAPIUtil.h
DreamSleep/DreamSleep/Class/AISleepModule/AISleepCoachController.m
DreamSleep/DreamSleep/Basement/H5/DsWebController.m
查看文件 @
0ec9cf9
...
@@ -106,6 +106,7 @@
...
@@ -106,6 +106,7 @@
_webView
.
scrollView
.
dk_backgroundColorPicker
=
DKColorPickerWithKey
(
VCViewBG
);
_webView
.
scrollView
.
dk_backgroundColorPicker
=
DKColorPickerWithKey
(
VCViewBG
);
_webView
.
scrollView
.
showsVerticalScrollIndicator
=
NO
;
_webView
.
scrollView
.
showsVerticalScrollIndicator
=
NO
;
_webView
.
hidden
=
YES
;
_webView
.
hidden
=
YES
;
_webView
.
scrollView
.
bounces
=
NO
;
_webView
.
scrollView
.
contentInsetAdjustmentBehavior
=
UIScrollViewContentInsetAdjustmentNever
;
_webView
.
scrollView
.
contentInsetAdjustmentBehavior
=
UIScrollViewContentInsetAdjustmentNever
;
[
_webView
addObserver
:
self
forKeyPath
:
@"estimatedProgress"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
[
_webView
addObserver
:
self
forKeyPath
:
@"estimatedProgress"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
NSMutableURLRequest
*
request
=
[[
NSMutableURLRequest
alloc
]
initWithURL
:
self
.
linkUrl
cachePolicy
:
NSURLRequestUseProtocolCachePolicy
timeoutInterval
:
10
.
0
];
NSMutableURLRequest
*
request
=
[[
NSMutableURLRequest
alloc
]
initWithURL
:
self
.
linkUrl
cachePolicy
:
NSURLRequestUseProtocolCachePolicy
timeoutInterval
:
10
.
0
];
...
...
DreamSleep/DreamSleep/Basement/Utils/ServerAPIUtil.h
查看文件 @
0ec9cf9
...
@@ -10,9 +10,9 @@
...
@@ -10,9 +10,9 @@
// 服务器主机地址
// 服务器主机地址
#define ServerURL DSInfoDic[@"HOST_URL"]
#define ServerURL DSInfoDic[@"HOST_URL"]
// API接口地址
// API接口地址
#define APIURL [
ServerURL stringByAppendingPathComponent:
@"sleepiql"]
#define APIURL [
NSString stringWithFormat:@"%@/%@", ServerURL,
@"sleepiql"]
// AI睡眠教练接口地址
// AI睡眠教练接口地址
#define AICoachURL [
ServerURL stringByAppendingPathComponent:
@"sleep/ai/sleep_aicocah"]
#define AICoachURL [
NSString stringWithFormat:@"%@/%@", ServerURL,
@"sleep/ai/sleep_aicocah"]
// 我的睡眠报告地址
// 我的睡眠报告地址
#define MySleepReportURL [ServerURL stringByAppendingPathComponent:@"sleep/ssmian/sleep_diary?step=10"]
#define MySleepReportURL [ServerURL stringByAppendingPathComponent:@"sleep/ssmian/sleep_diary?step=10"]
// 我的睡眠评测
// 我的睡眠评测
...
...
DreamSleep/DreamSleep/Class/AISleepModule/AISleepCoachController.m
查看文件 @
0ec9cf9
...
@@ -93,6 +93,17 @@
...
@@ -93,6 +93,17 @@
}
}
#pragma mark - WKNavigationDelegate
#pragma mark - WKNavigationDelegate
-
(
void
)
webView
:
(
WKWebView
*
)
webView
decidePolicyForNavigationAction
:
(
nonnull
WKNavigationAction
*
)
navigationAction
decisionHandler
:
(
nonnull
void
(
^
)(
WKNavigationActionPolicy
))
decisionHandler
{
NSString
*
url
=
navigationAction
.
request
.
URL
.
absoluteString
;
if
([
url
isEqualToString
:
AICoachURL
])
{
decisionHandler
(
WKNavigationActionPolicyAllow
);
}
else
{
// 开启新的webview页面加载
[
self
.
navigationController
pushViewController
:[[
DsWebController
alloc
]
initWithLink
:
url
isShowNavi
:
YES
]
animated
:
YES
];
decisionHandler
(
WKNavigationActionPolicyCancel
);
}
}
// 开始加载
// 开始加载
-
(
void
)
webView
:
(
WKWebView
*
)
webView
didCommitNavigation
:
(
WKNavigation
*
)
navigation
{
-
(
void
)
webView
:
(
WKWebView
*
)
webView
didCommitNavigation
:
(
WKNavigation
*
)
navigation
{
[[
UIApplication
sharedApplication
]
setNetworkActivityIndicatorVisible
:
YES
];
[[
UIApplication
sharedApplication
]
setNetworkActivityIndicatorVisible
:
YES
];
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论