Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 1fd29804
由
cgx
编写于
2022-05-30 17:30:58 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
注销按钮添加倒计时
1 个父辈
f3865b43
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
44 行增加
和
9 行删除
DreamSleep/DreamSleep/Class/AISleepModule/AISleepCoachController.m
DreamSleep/DreamSleep/Class/ProfileModule/Account/View/CloseAlertView.m
DreamSleep/DreamSleep/Class/ProfileModule/UserLogin/UserRequestModel.m
DreamSleep/DreamSleep/Class/AISleepModule/AISleepCoachController.m
查看文件 @
1fd2980
...
@@ -123,14 +123,14 @@
...
@@ -123,14 +123,14 @@
[
self
startOpen
];
[
self
startOpen
];
// 注入js代码用于强制刷新小梦睡眠
// 注入js代码用于强制刷新小梦睡眠
// NSString *jsCallBack = @"window.parent.location.reload()";
// NSString *jsCallBack = @"window.parent.location.reload()";
// [self.aiWebView evaluateJavaScript:jsCallBack completionHandler:^(id _Nullable result, NSError * _Nullable error) {
// [self.aiWebView evaluateJavaScript:jsCallBack completionHandler:^(id _Nullable result, NSError * _Nullable error) {
// [self.aiWebView loadRequest:self.request];
// [self.aiWebView loadRequest:self.request];
// DSLog(@"注入成功...");
// DSLog(@"注入成功...");
// if (error) {
// if (error) {
// DSLog(@"err is %@", error.domain);
// DSLog(@"err is %@", error.domain);
// }
// }
// }];
// }];
}
}
}
}
}
}
...
...
DreamSleep/DreamSleep/Class/ProfileModule/Account/View/CloseAlertView.m
查看文件 @
1fd2980
...
@@ -13,6 +13,9 @@
...
@@ -13,6 +13,9 @@
@property
(
nonatomic
,
strong
)
UIImageView
*
cryIV
;
@property
(
nonatomic
,
strong
)
UIImageView
*
cryIV
;
@property
(
nonatomic
,
strong
)
UILabel
*
redLab
;
@property
(
nonatomic
,
strong
)
UILabel
*
redLab
;
@property
(
nonatomic
,
strong
)
UIView
*
dealView
;
@property
(
nonatomic
,
strong
)
UIView
*
dealView
;
@property
(
nonatomic
,
strong
)
UIButton
*
closeBtn
;
@property
(
nonatomic
,
strong
)
NSTimer
*
closeTimer
;
@property
(
nonatomic
,
assign
)
int
totalSecond
;
@end
@end
@implementation
CloseAlertView
@implementation
CloseAlertView
...
@@ -20,6 +23,8 @@
...
@@ -20,6 +23,8 @@
-
(
instancetype
)
initWithDelegate
:(
id
<
CloseAlertViewDelegate
>
)
delegate
{
-
(
instancetype
)
initWithDelegate
:(
id
<
CloseAlertViewDelegate
>
)
delegate
{
if
(
self
=
[
super
initWithFrame
:[
UIScreen
mainScreen
].
bounds
])
{
if
(
self
=
[
super
initWithFrame
:[
UIScreen
mainScreen
].
bounds
])
{
_delegate
=
delegate
;
_delegate
=
delegate
;
_totalSecond
=
10
;
self
.
dk_backgroundColorPicker
=
DKColorPickerWithColors
(
ColorFromHex
(
0x6F7587
),
DSClearColor
,
DSWhite
);
self
.
dk_backgroundColorPicker
=
DKColorPickerWithColors
(
ColorFromHex
(
0x6F7587
),
DSClearColor
,
DSWhite
);
self
.
backgroundColor
=
[
self
.
backgroundColor
colorWithAlphaComponent
:
0
.
6
];
self
.
backgroundColor
=
[
self
.
backgroundColor
colorWithAlphaComponent
:
0
.
6
];
...
@@ -36,13 +41,21 @@
...
@@ -36,13 +41,21 @@
return
self
;
return
self
;
}
}
-
(
void
)
dealloc
{
[
_closeTimer
invalidate
];
_closeTimer
=
nil
;
}
#pragma mark - public
#pragma mark - public
-
(
void
)
showCloseUserAlertView
{
-
(
void
)
showCloseUserAlertView
{
[
DSKeyWindow
addSubview
:
self
];
[
DSKeyWindow
addSubview
:
self
];
[
self
.
closeTimer
setFireDate
:[
NSDate
date
]];
}
}
-
(
void
)
dismissCloseUserAlertView
{
-
(
void
)
dismissCloseUserAlertView
{
[
self
removeFromSuperview
];
[
self
removeFromSuperview
];
[
self
.
closeTimer
setFireDate
:[
NSDate
distantFuture
]];
self
.
totalSecond
=
10
;
}
}
#pragma mark - actions
#pragma mark - actions
...
@@ -129,7 +142,9 @@
...
@@ -129,7 +142,9 @@
UIButton
*
closeBtn
=
[
UIButton
btnWithTitle
:
@"注销"
titleColor
:
BrandColor
font
:
BoldFont
(
15
)
bgColor
:
DSClearColor
];
UIButton
*
closeBtn
=
[
UIButton
btnWithTitle
:
@"注销"
titleColor
:
BrandColor
font
:
BoldFont
(
15
)
bgColor
:
DSClearColor
];
[
closeBtn
addTarget
:
self
action
:
@selector
(
closeAction
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
closeBtn
addTarget
:
self
action
:
@selector
(
closeAction
)
forControlEvents
:
UIControlEventTouchUpInside
];
closeBtn
.
enabled
=
NO
;
[
_dealView
addSubview
:
closeBtn
];
[
_dealView
addSubview
:
closeBtn
];
self
.
closeBtn
=
closeBtn
;
UIButton
*
cancelBtn
=
[
UIButton
btnWithTitle
:
@"取消"
font
:
BoldFont
(
15
)];
UIButton
*
cancelBtn
=
[
UIButton
btnWithTitle
:
@"取消"
font
:
BoldFont
(
15
)];
[
cancelBtn
dk_setTitleColorPicker
:
DKColorPickerWithKey
(
TEXT
)
forState
:
UIControlStateNormal
];
[
cancelBtn
dk_setTitleColorPicker
:
DKColorPickerWithKey
(
TEXT
)
forState
:
UIControlStateNormal
];
...
@@ -160,4 +175,25 @@
...
@@ -160,4 +175,25 @@
return
_dealView
;
return
_dealView
;
}
}
-
(
NSTimer
*
)
closeTimer
{
if
(
!
_closeTimer
)
{
WS
(
weakSelf
);
_closeTimer
=
[
NSTimer
timerWithTimeInterval
:
1
.
0
repeats
:
YES
block
:^
(
NSTimer
*
_Nonnull
timer
)
{
if
(
weakSelf
.
totalSecond
==
0
)
{
[
weakSelf
.
closeTimer
setFireDate
:[
NSDate
distantFuture
]];
[
weakSelf
.
closeBtn
setTitle
:
@"注销"
font
:
BoldFont
(
15
)];
[
weakSelf
.
closeBtn
setTitleColor
:
BrandColor
forState
:
UIControlStateNormal
];
weakSelf
.
closeBtn
.
enabled
=
YES
;
return
;
}
weakSelf
.
closeBtn
.
enabled
=
NO
;
[
weakSelf
.
closeBtn
setTitle
:[
NSString
stringWithFormat
:
@"注销(%d)"
,
weakSelf
.
totalSecond
]
font
:
BoldFont
(
15
)];
[
weakSelf
.
closeBtn
dk_setTitleColorPicker
:
DKColorPickerWithColors
(
SubTitleColor
,
ColorFromHexA
(
0xFFFFFF
,
.
5
),
DSWhite
)
forState
:
UIControlStateNormal
];
weakSelf
.
totalSecond
--
;
}];
[[
NSRunLoop
currentRunLoop
]
addTimer
:
_closeTimer
forMode
:
NSRunLoopCommonModes
];
}
return
_closeTimer
;
}
@end
@end
DreamSleep/DreamSleep/Class/ProfileModule/UserLogin/UserRequestModel.m
查看文件 @
1fd2980
...
@@ -88,7 +88,6 @@
...
@@ -88,7 +88,6 @@
+
(
NSURLSessionDataTask
*
)
revokeTokensRequestWithParams
:(
NSDictionary
*
)
params
completion
:(
void
(
^
)(
UserRequestModel
*
requestModel
))
completion
+
(
NSURLSessionDataTask
*
)
revokeTokensRequestWithParams
:(
NSDictionary
*
)
params
completion
:(
void
(
^
)(
UserRequestModel
*
requestModel
))
completion
{
{
UserRequestModel
*
requestModel
=
[[
UserRequestModel
alloc
]
init
];
return
[
self
httpVendorPostRequestWithHost
:
@"https://appleid.apple.com/auth/revoke"
params
:
params
view
:
nil
hasNetActivity
:
YES
loadingInfo
:
nil
hasFailInfo
:
YES
success
:^
(
NSDictionary
*
responseObj
)
{
return
[
self
httpVendorPostRequestWithHost
:
@"https://appleid.apple.com/auth/revoke"
params
:
params
view
:
nil
hasNetActivity
:
YES
loadingInfo
:
nil
hasFailInfo
:
YES
success
:^
(
NSDictionary
*
responseObj
)
{
}
failure
:^
(
id
failureInfo
)
{
}
failure
:^
(
id
failureInfo
)
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论