Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 2db98064
由
cgx
编写于
2022-06-07 15:11:16 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
优化网络异常h5页面无法返回
1 个父辈
03525e60
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
69 行增加
和
55 行删除
DreamSleep/DreamSleep/Basement/H5/DsWebController.m
DreamSleep/DreamSleep/Class/AISleepModule/AISleepCoachController.m
DreamSleep/DreamSleep/Class/AISleepModule/RelaxBodyView.m
DreamSleep/DreamSleep/Class/ProfileModule/Account/Controller/NickNameController.m
DreamSleep/DreamSleep/Class/ProfileModule/Account/View/UserInfoView.m
DreamSleep/DreamSleep/Resource/Assets.xcassets/Profile/portrait.imageset/Contents.json
DreamSleep/DreamSleep/Resource/Assets.xcassets/Profile/portrait.imageset/portrait.png
DreamSleep/DreamSleep/Resource/Assets.xcassets/Profile/portrait.imageset/portrait@2x.png
DreamSleep/DreamSleep/Resource/Assets.xcassets/Profile/portrait.imageset/portrait@3x.png
DreamSleep/DreamSleep/Basement/H5/DsWebController.m
查看文件 @
2db9806
...
@@ -18,6 +18,8 @@
...
@@ -18,6 +18,8 @@
@property
(
nonatomic
,
strong
)
NSMutableURLRequest
*
request
;
@property
(
nonatomic
,
strong
)
NSMutableURLRequest
*
request
;
@property
(
nonatomic
,
strong
)
UIProgressView
*
progressView
;
@property
(
nonatomic
,
strong
)
UIProgressView
*
progressView
;
@property
(
nonatomic
,
strong
)
ExceptionDefaultView
*
exceptionView
;
@property
(
nonatomic
,
strong
)
ExceptionDefaultView
*
exceptionView
;
/// 白天/夜间模式导航栏返回按钮
@property
(
nonatomic
,
strong
)
UIButton
*
dkBackBtn
;
@end
@end
@implementation
DsWebController
@implementation
DsWebController
...
@@ -47,6 +49,9 @@
...
@@ -47,6 +49,9 @@
[
self
.
view
addSubview
:
self
.
webView
];
[
self
.
view
addSubview
:
self
.
webView
];
[
self
.
view
addSubview
:
self
.
progressView
];
[
self
.
view
addSubview
:
self
.
progressView
];
if
(
self
.
isShowNavi
==
NO
)
{
[
self
.
view
addSubview
:
self
.
dkBackBtn
];
}
[
self
.
webView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
[
self
.
webView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
edges
.
equalTo
(
self
.
view
).
insets
(
UIEdgeInsetsMake
(
0
,
0
,
0
,
0
));
make
.
edges
.
equalTo
(
self
.
view
).
insets
(
UIEdgeInsetsMake
(
0
,
0
,
0
,
0
));
...
@@ -61,19 +66,10 @@
...
@@ -61,19 +66,10 @@
[
self
.
webView
removeObserver
:
self
forKeyPath
:
@"estimatedProgress"
];
[
self
.
webView
removeObserver
:
self
forKeyPath
:
@"estimatedProgress"
];
}
}
#pragma mark - 关闭侧滑
-
(
void
)
closeCurrentPage
{
-
(
BOOL
)
enableInteractivePopGestureRecognizer
{
if
(
self
.
navigationController
.
viewControllers
.
count
)
{
return
NO
;
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
}
#pragma mark - 隐藏导航栏
-
(
BOOL
)
isShowNavigationBar
{
return
!
self
.
isShowNavi
;
}
#pragma mark - H5页面导航栏为默认模式
-
(
NaviStyle
)
navigationBarStyle
{
return
NaviStyleDefault
;
}
}
#pragma mark - WKWebView的监听方法
#pragma mark - WKWebView的监听方法
...
@@ -94,6 +90,7 @@
...
@@ -94,6 +90,7 @@
-
(
void
)
webView
:
(
WKWebView
*
)
webView
didFinishNavigation
:
(
WKNavigation
*
)
navigation
{
-
(
void
)
webView
:
(
WKWebView
*
)
webView
didFinishNavigation
:
(
WKNavigation
*
)
navigation
{
[[
UIApplication
sharedApplication
]
setNetworkActivityIndicatorVisible
:
NO
];
[[
UIApplication
sharedApplication
]
setNetworkActivityIndicatorVisible
:
NO
];
self
.
exceptionView
.
hidden
=
YES
;
self
.
exceptionView
.
hidden
=
YES
;
if
(
self
.
isShowNavi
==
NO
)
{
self
.
dkBackBtn
.
hidden
=
YES
;
}
[
DsMaskView
showMaskWithSuperView
:
self
.
view
];
[
DsMaskView
showMaskWithSuperView
:
self
.
view
];
self
.
webView
.
hidden
=
NO
;
self
.
webView
.
hidden
=
NO
;
}
}
...
@@ -102,6 +99,7 @@
...
@@ -102,6 +99,7 @@
[[
UIApplication
sharedApplication
]
setNetworkActivityIndicatorVisible
:
NO
];
[[
UIApplication
sharedApplication
]
setNetworkActivityIndicatorVisible
:
NO
];
DSLog
(
@"加载失败:%@"
,
error
.
userInfo
);
DSLog
(
@"加载失败:%@"
,
error
.
userInfo
);
self
.
exceptionView
.
hidden
=
NO
;
self
.
exceptionView
.
hidden
=
NO
;
if
(
self
.
isShowNavi
==
NO
)
{
self
.
dkBackBtn
.
hidden
=
NO
;
}
}
}
#pragma mark - WKScriptMessageHandler
#pragma mark - WKScriptMessageHandler
...
@@ -110,7 +108,7 @@
...
@@ -110,7 +108,7 @@
NSDictionary
*
bodyDic
=
message
.
body
;
NSDictionary
*
bodyDic
=
message
.
body
;
int
type
=
[
bodyDic
[
@"type"
]
intValue
];
int
type
=
[
bodyDic
[
@"type"
]
intValue
];
DSLog
(
@"bodyDic:%@"
,
bodyDic
);
DSLog
(
@"bodyDic:%@"
,
bodyDic
);
if
(
type
==
88
)
{
if
(
type
==
88
)
{
// 新开webview,关闭
if
(
self
.
refreshDelegate
&&
[
self
.
refreshDelegate
respondsToSelector
:
@selector
(
reloadAIPage
)])
{
if
(
self
.
refreshDelegate
&&
[
self
.
refreshDelegate
respondsToSelector
:
@selector
(
reloadAIPage
)])
{
[
self
.
refreshDelegate
reloadAIPage
];
[
self
.
refreshDelegate
reloadAIPage
];
}
}
...
@@ -167,10 +165,41 @@
...
@@ -167,10 +165,41 @@
weakSelf
.
progressView
.
hidden
=
NO
;
weakSelf
.
progressView
.
hidden
=
NO
;
weakSelf
.
progressView
.
progress
=
0
;
weakSelf
.
progressView
.
progress
=
0
;
weakSelf
.
exceptionView
.
hidden
=
YES
;
weakSelf
.
exceptionView
.
hidden
=
YES
;
if
(
weakSelf
.
isShowNavi
==
NO
)
{
weakSelf
.
dkBackBtn
.
hidden
=
YES
;
}
[
weakSelf
.
webView
loadRequest
:
weakSelf
.
request
];
[
weakSelf
.
webView
loadRequest
:
weakSelf
.
request
];
}
superView
:
self
.
view
];
}
superView
:
self
.
view
];
}
}
return
_exceptionView
;
return
_exceptionView
;
}
}
-
(
UIButton
*
)
dkBackBtn
{
if
(
!
_dkBackBtn
)
{
_dkBackBtn
=
[[
UIButton
alloc
]
initWithFrame
:
CGRectMake
(
0
,
kStatusBarHeight
,
40
,
40
)];
[
_dkBackBtn
dk_setImage
:
DKImagePickerWithNames
(
@"cus_back_icon"
,
@"dk_cus_back_icon"
,
@"dk_cus_back_icon"
)
forState
:
UIControlStateNormal
];
[
_dkBackBtn
addTarget
:
self
action
:
@selector
(
closeCurrentPage
)
forControlEvents
:
UIControlEventTouchUpInside
];
_dkBackBtn
.
hidden
=
YES
;
}
return
_dkBackBtn
;
}
#pragma mark - 关闭侧滑
-
(
BOOL
)
enableInteractivePopGestureRecognizer
{
return
NO
;
}
#pragma mark - 隐藏导航栏
-
(
BOOL
)
isShowNavigationBar
{
return
!
self
.
isShowNavi
;
}
#pragma mark - H5页面导航栏为默认模式
-
(
NaviStyle
)
navigationBarStyle
{
return
NaviStyleDefault
;
}
#pragma mark - 设置状态栏文字颜色
-
(
UIStatusBarStyle
)
preferredStatusBarStyle
{
return
[
self
.
dk_manager
.
themeVersion
isEqualToString
:
DKThemeVersionNormal
]
?
UIStatusBarStyleDefault
:
UIStatusBarStyleLightContent
;
}
@end
@end
DreamSleep/DreamSleep/Class/AISleepModule/AISleepCoachController.m
查看文件 @
2db9806
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
-
(
void
)
viewDidLoad
{
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
[
super
viewDidLoad
];
self
.
view
.
dk_backgroundColorPicker
=
DKColorPickerWithKey
(
VCViewBG
);
// 创建WKWebView对象,添加到界面(storyboard没有控件)
// 创建WKWebView对象,添加到界面(storyboard没有控件)
[
self
.
view
addSubview
:
self
.
aiWebView
];
[
self
.
view
addSubview
:
self
.
aiWebView
];
[
self
.
view
addSubview
:
self
.
progressView
];
[
self
.
view
addSubview
:
self
.
progressView
];
...
@@ -39,21 +41,6 @@
...
@@ -39,21 +41,6 @@
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
name
:
NeedUpdateAICoach
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
name
:
NeedUpdateAICoach
object
:
nil
];
}
}
#pragma mark - 关闭侧滑
-
(
BOOL
)
enableInteractivePopGestureRecognizer
{
return
NO
;
}
#pragma mark - 隐藏导航栏
-
(
BOOL
)
isShowNavigationBar
{
return
YES
;
}
#pragma mark - 品牌模式
-
(
NaviStyle
)
navigationBarStyle
{
return
NaviStyleDefault
;
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
[
super
viewWillAppear
:
animated
];
[
super
viewWillAppear
:
animated
];
...
@@ -134,6 +121,7 @@
...
@@ -134,6 +121,7 @@
-
(
void
)
webView
:
(
WKWebView
*
)
webView
didFailProvisionalNavigation
:
(
WKNavigation
*
)
navigation
withError
:
(
NSError
*
)
error
{
-
(
void
)
webView
:
(
WKWebView
*
)
webView
didFailProvisionalNavigation
:
(
WKNavigation
*
)
navigation
withError
:
(
NSError
*
)
error
{
[[
UIApplication
sharedApplication
]
setNetworkActivityIndicatorVisible
:
NO
];
[[
UIApplication
sharedApplication
]
setNetworkActivityIndicatorVisible
:
NO
];
self
.
exceptionView
.
hidden
=
NO
;
self
.
exceptionView
.
hidden
=
NO
;
self
.
aiWebView
.
hidden
=
YES
;
DSLog
(
@"加载失败:%@"
,
error
);
DSLog
(
@"加载失败:%@"
,
error
);
}
}
...
@@ -247,4 +235,24 @@
...
@@ -247,4 +235,24 @@
return
_exceptionView
;
return
_exceptionView
;
}
}
#pragma mark - 关闭侧滑
-
(
BOOL
)
enableInteractivePopGestureRecognizer
{
return
NO
;
}
#pragma mark - 隐藏导航栏
-
(
BOOL
)
isShowNavigationBar
{
return
YES
;
}
#pragma mark - 品牌模式
-
(
NaviStyle
)
navigationBarStyle
{
return
NaviStyleDefault
;
}
#pragma mark - 设置状态栏文字颜色
-
(
UIStatusBarStyle
)
preferredStatusBarStyle
{
return
[
self
.
dk_manager
.
themeVersion
isEqualToString
:
DKThemeVersionNormal
]
?
UIStatusBarStyleDefault
:
UIStatusBarStyleLightContent
;
}
@end
@end
DreamSleep/DreamSleep/Class/AISleepModule/RelaxBodyView.m
查看文件 @
2db9806
...
@@ -256,7 +256,7 @@
...
@@ -256,7 +256,7 @@
_sliderView
=
[
UISlider
new
];
_sliderView
=
[
UISlider
new
];
[
_sliderView
cornerRadius
:
2
.
0
];
[
_sliderView
cornerRadius
:
2
.
0
];
_sliderView
.
minimumTrackTintColor
=
BrandColor
;
_sliderView
.
minimumTrackTintColor
=
BrandColor
;
_sliderView
.
dk_maximumTrackTintColorPicker
=
DKColorPickerWithColors
(
ColorFromHex
(
0xE3E1E1
),
ColorFromHex
(
0x131724
),
DSWhite
);
_sliderView
.
maximumTrackTintColor
=
ColorFromHex
(
0xE3E1E1
);
[
_sliderView
setThumbImage
:[
UIImage
imageNamed
:
@"muse_slider_thumbImage"
]
forState
:
UIControlStateNormal
];
[
_sliderView
setThumbImage
:[
UIImage
imageNamed
:
@"muse_slider_thumbImage"
]
forState
:
UIControlStateNormal
];
[
_sliderView
addTarget
:
self
action
:
@selector
(
sliderValueChanged
:
)
forControlEvents
:
UIControlEventValueChanged
];
[
_sliderView
addTarget
:
self
action
:
@selector
(
sliderValueChanged
:
)
forControlEvents
:
UIControlEventValueChanged
];
[
_sliderView
addTarget
:
self
action
:
@selector
(
sliderTouchDown
:
)
forControlEvents
:
UIControlEventTouchDown
];
[
_sliderView
addTarget
:
self
action
:
@selector
(
sliderTouchDown
:
)
forControlEvents
:
UIControlEventTouchDown
];
...
...
DreamSleep/DreamSleep/Class/ProfileModule/Account/Controller/NickNameController.m
查看文件 @
2db9806
...
@@ -95,7 +95,7 @@
...
@@ -95,7 +95,7 @@
if
(
!
_portraitIV
)
{
if
(
!
_portraitIV
)
{
_portraitIV
=
[
UIImageView
new
];
_portraitIV
=
[
UIImageView
new
];
_portraitIV
.
dk_alphaPicker
=
DKAlphaPickerWithAlphas
(
1
,
.
5
,
.
5
);
_portraitIV
.
dk_alphaPicker
=
DKAlphaPickerWithAlphas
(
1
,
.
5
,
.
5
);
[
_portraitIV
yy_setImageWithURL
:[
NSURL
URLWithString
:[
LoginUtils
getFaceImg
]]
placeholder
:[
UIImage
imageNamed
:
@"
portrait
"
]];
[
_portraitIV
yy_setImageWithURL
:[
NSURL
URLWithString
:[
LoginUtils
getFaceImg
]]
placeholder
:[
UIImage
imageNamed
:
@"
basicPlaceholder
"
]];
[
_portraitIV
cornerRadius
:
145
/
2
.
0
];
[
_portraitIV
cornerRadius
:
145
/
2
.
0
];
}
}
return
_portraitIV
;
return
_portraitIV
;
...
...
DreamSleep/DreamSleep/Class/ProfileModule/Account/View/UserInfoView.m
查看文件 @
2db9806
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
if
(
self
=
[
super
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
kScreenHeight
-
kTopHeight
(
0
))])
{
if
(
self
=
[
super
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
kScreenHeight
-
kTopHeight
(
0
))])
{
_delegate
=
delegate
;
_delegate
=
delegate
;
[
self
.
portraitIV
yy_setImageWithURL
:[
NSURL
URLWithString
:[
LoginUtils
getFaceImg
]]
placeholder
:[
UIImage
imageNamed
:
@"
portrait
"
]];
[
self
.
portraitIV
yy_setImageWithURL
:[
NSURL
URLWithString
:[
LoginUtils
getFaceImg
]]
placeholder
:[
UIImage
imageNamed
:
@"
basicPlaceholder
"
]];
[
self
addSubview
:
self
.
userInfoTV
];
[
self
addSubview
:
self
.
userInfoTV
];
[
self
addSubview
:
self
.
layoutBtn
];
[
self
addSubview
:
self
.
layoutBtn
];
...
...
DreamSleep/DreamSleep/Resource/Assets.xcassets/Profile/portrait.imageset/Contents.json
deleted
100644 → 0
查看文件 @
03525e6
{
"images"
:
[
{
"filename"
:
"portrait.png"
,
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"portrait@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"portrait@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
DreamSleep/DreamSleep/Resource/Assets.xcassets/Profile/portrait.imageset/portrait.png
deleted
100644 → 0
查看文件 @
03525e6
21.1 KB
DreamSleep/DreamSleep/Resource/Assets.xcassets/Profile/portrait.imageset/portrait@2x.png
deleted
100644 → 0
查看文件 @
03525e6
62.6 KB
DreamSleep/DreamSleep/Resource/Assets.xcassets/Profile/portrait.imageset/portrait@3x.png
deleted
100644 → 0
查看文件 @
03525e6
123.4 KB
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论