Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 8d8999a5
由
cgx
编写于
2022-07-20 11:49:53 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
安睡准备新增建议文案提示
1 个父辈
26389133
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
37 行增加
和
8 行删除
DreamSleep/DreamSleep/Class/AISleepModule/SleepReady/Controller/SleepReadyController.m
DreamSleep/DreamSleep/Class/AISleepModule/SleepReady/RequestModel/SleepReadyRequestModel.h
DreamSleep/DreamSleep/Class/AISleepModule/SleepReady/RequestModel/SleepReadyRequestModel.m
DreamSleep/DreamSleep/Class/AISleepModule/SleepReady/View/PrepareItemsCell.m
DreamSleep/DreamSleep/Class/AISleepModule/SleepReady/View/ReadyItemCell.m
DreamSleep/DreamSleep/Class/AISleepModule/SleepReady/View/StartReadyView.h
DreamSleep/DreamSleep/Class/AISleepModule/SleepReady/View/StartReadyView.m
DreamSleep/DreamSleep/Class/AISleepModule/SleepReady/View/XLCircle.m
DreamSleep/DreamSleep/Class/AISleepModule/SleepReady/Controller/SleepReadyController.m
查看文件 @
8d8999a
...
@@ -56,6 +56,7 @@
...
@@ -56,6 +56,7 @@
if
(
requestModel
.
resCode
==
DSResCodeSuccess
)
{
if
(
requestModel
.
resCode
==
DSResCodeSuccess
)
{
self
.
adjustedItems
=
requestModel
.
relax_items
;
self
.
adjustedItems
=
requestModel
.
relax_items
;
[
self
.
startReadyView
updateAdjustView
:
self
.
adjustedItems
];
[
self
.
startReadyView
updateAdjustView
:
self
.
adjustedItems
];
[
self
.
startReadyView
updateAdviceMessage
:
requestModel
.
advice_message
];
}
}
}];
}];
}
}
...
@@ -172,6 +173,7 @@
...
@@ -172,6 +173,7 @@
if
(
!
_tipsBtn
)
{
if
(
!
_tipsBtn
)
{
WS
(
weakSelf
);
WS
(
weakSelf
);
_tipsBtn
=
[
UIButton
new
];
_tipsBtn
=
[
UIButton
new
];
_tipsBtn
.
showsTouchWhenHighlighted
=
YES
;
[
_tipsBtn
dk_setImage
:
DKImagePickerWithNames
(
@"ic_zhunbei_zhushi"
,
@"dk_ic_zhunbei_zhushi"
,
@"ic_zhunbei_zhushi"
)
forState
:
UIControlStateNormal
];
[
_tipsBtn
dk_setImage
:
DKImagePickerWithNames
(
@"ic_zhunbei_zhushi"
,
@"dk_ic_zhunbei_zhushi"
,
@"ic_zhunbei_zhushi"
)
forState
:
UIControlStateNormal
];
[
_tipsBtn
addTouchUpInsideHandler
:
^
(
NSInteger
tag
)
{
[
_tipsBtn
addTouchUpInsideHandler
:
^
(
NSInteger
tag
)
{
[
weakSelf
.
sRTipsView
showTipsAlertView
];
[
weakSelf
.
sRTipsView
showTipsAlertView
];
...
@@ -184,6 +186,7 @@
...
@@ -184,6 +186,7 @@
if
(
!
_setBtn
)
{
if
(
!
_setBtn
)
{
WS
(
weakSelf
);
WS
(
weakSelf
);
_setBtn
=
[
UIButton
new
];
_setBtn
=
[
UIButton
new
];
_setBtn
.
showsTouchWhenHighlighted
=
YES
;
[
_setBtn
dk_setImage
:
DKImagePickerWithNames
(
@"ic_zhunbei_set"
,
@"dk_ic_zhunbei_set"
,
@"ic_zhunbei_set"
)
forState
:
UIControlStateNormal
];
[
_setBtn
dk_setImage
:
DKImagePickerWithNames
(
@"ic_zhunbei_set"
,
@"dk_ic_zhunbei_set"
,
@"ic_zhunbei_set"
)
forState
:
UIControlStateNormal
];
[
_setBtn
addTouchUpInsideHandler
:
^
(
NSInteger
tag
)
{
[
_setBtn
addTouchUpInsideHandler
:
^
(
NSInteger
tag
)
{
ReadyListController
*
setListVC
=
[[
ReadyListController
alloc
]
initWithDelegate
:
weakSelf
];
ReadyListController
*
setListVC
=
[[
ReadyListController
alloc
]
initWithDelegate
:
weakSelf
];
...
...
DreamSleep/DreamSleep/Class/AISleepModule/SleepReady/RequestModel/SleepReadyRequestModel.h
查看文件 @
8d8999a
...
@@ -13,6 +13,8 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -13,6 +13,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface
SleepReadyRequestModel
:
DSNetworkTool
@interface
SleepReadyRequestModel
:
DSNetworkTool
/// 放松准备顶部背景图
/// 放松准备顶部背景图
@property
(
nonatomic
,
copy
)
NSString
*
relax_bg
;
@property
(
nonatomic
,
copy
)
NSString
*
relax_bg
;
/// 建议
@property
(
nonatomic
,
copy
)
NSString
*
advice_message
;
/// 任务总时长
/// 任务总时长
@property
(
nonatomic
,
assign
)
int
relax_time
;
@property
(
nonatomic
,
assign
)
int
relax_time
;
/// 睡前规划任务项数据
/// 睡前规划任务项数据
...
...
DreamSleep/DreamSleep/Class/AISleepModule/SleepReady/RequestModel/SleepReadyRequestModel.m
查看文件 @
8d8999a
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
requestModel
.
resCode
=
DSResCodeSuccess
;
requestModel
.
resCode
=
DSResCodeSuccess
;
NSDictionary
*
resultDic
=
apiDic
[
@"result"
];
NSDictionary
*
resultDic
=
apiDic
[
@"result"
];
requestModel
.
relax_bg
=
resultDic
[
@"relax_bg"
];
requestModel
.
relax_bg
=
resultDic
[
@"relax_bg"
];
requestModel
.
advice_message
=
resultDic
[
@"advice_message"
];
NSArray
*
relax_items
=
resultDic
[
@"relax_items"
];
NSArray
*
relax_items
=
resultDic
[
@"relax_items"
];
NSMutableArray
*
tmp_relax_items
=
[
NSMutableArray
array
];
NSMutableArray
*
tmp_relax_items
=
[
NSMutableArray
array
];
for
(
int
i
=
0
;
i
<
relax_items
.
count
;
i
++
)
{
for
(
int
i
=
0
;
i
<
relax_items
.
count
;
i
++
)
{
...
...
DreamSleep/DreamSleep/Class/AISleepModule/SleepReady/View/PrepareItemsCell.m
查看文件 @
8d8999a
...
@@ -105,7 +105,7 @@
...
@@ -105,7 +105,7 @@
-
(
UILabel
*
)
descLab
{
-
(
UILabel
*
)
descLab
{
if
(
!
_descLab
)
{
if
(
!
_descLab
)
{
_descLab
=
[
UILabel
labWithFont
:
SysFont
(
12
.
0
)];
_descLab
=
[
UILabel
labWithFont
:
SysFont
(
12
.
0
)];
_descLab
.
dk_textColorPicker
=
DKColorPickerWithColors
(
SmallTextColor
,
ColorFromHexA
(
0xFFFFFF
,
.
3
));
_descLab
.
dk_textColorPicker
=
DKColorPickerWithColors
(
SmallTextColor
,
ColorFromHexA
(
0xFFFFFF
,
.
3
)
,
DSWhite
);
}
}
return
_descLab
;
return
_descLab
;
}
}
...
...
DreamSleep/DreamSleep/Class/AISleepModule/SleepReady/View/ReadyItemCell.m
查看文件 @
8d8999a
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
if
(
!
_timeLab
)
{
if
(
!
_timeLab
)
{
_timeLab
=
[
UILabel
labWithFont
:
SysFont
(
12
.
0
)];
_timeLab
=
[
UILabel
labWithFont
:
SysFont
(
12
.
0
)];
_timeLab
.
textAlignment
=
NSTextAlignmentCenter
;
_timeLab
.
textAlignment
=
NSTextAlignmentCenter
;
_timeLab
.
dk_textColorPicker
=
DKColorPickerWithColors
(
MainTextColor
,
ColorFromHexA
(
0xFFFFFF
,
.
3
));
_timeLab
.
dk_textColorPicker
=
DKColorPickerWithColors
(
MainTextColor
,
ColorFromHexA
(
0xFFFFFF
,
.
3
)
,
DSWhite
);
}
}
return
_timeLab
;
return
_timeLab
;
}
}
...
...
DreamSleep/DreamSleep/Class/AISleepModule/SleepReady/View/StartReadyView.h
查看文件 @
8d8999a
...
@@ -25,6 +25,9 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -25,6 +25,9 @@ NS_ASSUME_NONNULL_BEGIN
/// @param adjustedItems adjustedItems
/// @param adjustedItems adjustedItems
-
(
void
)
updateAdjustView
:(
NSArray
*
)
adjustedItems
;
-
(
void
)
updateAdjustView
:(
NSArray
*
)
adjustedItems
;
/// 更新建议文案
/// @param adviceMessage 建议
-
(
void
)
updateAdviceMessage
:(
NSString
*
)
adviceMessage
;
@end
@end
NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
DreamSleep/DreamSleep/Class/AISleepModule/SleepReady/View/StartReadyView.m
查看文件 @
8d8999a
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
@end
@end
@implementation
LineView
@implementation
LineView
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
{
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
{
if
(
self
==
[
super
initWithFrame
:
frame
])
{
if
(
self
==
[
super
initWithFrame
:
frame
])
{
UILabel
*
lineLab
=
[
UILabel
labWithText
:
@"- - - - - - - - - - - - - - - -"
font
:
SysFont
(
10
)
fit
:
YES
];
UILabel
*
lineLab
=
[
UILabel
labWithText
:
@"- - - - - - - - - - - - - - - -"
font
:
SysFont
(
10
)
fit
:
YES
];
...
@@ -46,7 +45,6 @@
...
@@ -46,7 +45,6 @@
}
}
return
self
;
return
self
;
}
}
@end
@end
@interface
ItemCell
:
UIView
@interface
ItemCell
:
UIView
...
@@ -112,7 +110,7 @@
...
@@ -112,7 +110,7 @@
if
(
!
_timeLab
)
{
if
(
!
_timeLab
)
{
_timeLab
=
[
UILabel
labWithFont
:
SysFont
(
12
.
0
)];
_timeLab
=
[
UILabel
labWithFont
:
SysFont
(
12
.
0
)];
_timeLab
.
textAlignment
=
NSTextAlignmentCenter
;
_timeLab
.
textAlignment
=
NSTextAlignmentCenter
;
_timeLab
.
dk_textColorPicker
=
DKColorPickerWithColors
(
SubTitleColor
,
ColorFromHexA
(
0xFFFFFF
,
.
3
));
_timeLab
.
dk_textColorPicker
=
DKColorPickerWithColors
(
SubTitleColor
,
ColorFromHexA
(
0xFFFFFF
,
.
3
)
,
DSWhite
);
}
}
return
_timeLab
;
return
_timeLab
;
}
}
...
@@ -124,6 +122,7 @@
...
@@ -124,6 +122,7 @@
@property
(
nonatomic
,
strong
)
NSArray
*
adjustedItems
;
@property
(
nonatomic
,
strong
)
NSArray
*
adjustedItems
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
adjustedCells
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
adjustedCells
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
sepLines
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
sepLines
;
@property
(
nonatomic
,
strong
)
UILabel
*
adviceMessageLab
;
@end
@end
@implementation
StartReadyView
@implementation
StartReadyView
...
@@ -138,7 +137,8 @@
...
@@ -138,7 +137,8 @@
[
self
addSubview
:
self
.
headIV
];
[
self
addSubview
:
self
.
headIV
];
[
self
addSubview
:
self
.
startBtn
];
[
self
addSubview
:
self
.
startBtn
];
[
self
addSubview
:
self
.
adviceMessageLab
];
[
self
.
headIV
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
[
self
.
headIV
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
top
.
left
.
right
.
equalTo
(
self
);
make
.
top
.
left
.
right
.
equalTo
(
self
);
}];
}];
...
@@ -147,6 +147,12 @@
...
@@ -147,6 +147,12 @@
make
.
centerX
.
equalTo
(
self
);
make
.
centerX
.
equalTo
(
self
);
make
.
bottom
.
equalTo
(
self
).
offset
(
-
94
-
Bottom_SafeArea_Height
);
make
.
bottom
.
equalTo
(
self
).
offset
(
-
94
-
Bottom_SafeArea_Height
);
}];
}];
[
self
.
adviceMessageLab
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
centerX
.
equalTo
(
self
);
make
.
left
.
equalTo
(
self
).
offset
(
5
);
make
.
right
.
equalTo
(
self
).
offset
(
-
5
);
make
.
top
.
equalTo
(
self
.
startBtn
.
mas_bottom
).
offset
(
10
);
}];
}
}
return
self
;
return
self
;
}
}
...
@@ -196,6 +202,10 @@
...
@@ -196,6 +202,10 @@
}
}
}
}
-
(
void
)
updateAdviceMessage
:(
NSString
*
)
adviceMessage
{
self
.
adviceMessageLab
.
text
=
adviceMessage
;
}
#pragma mark - lazy
#pragma mark - lazy
-
(
UIImageView
*
)
headIV
{
-
(
UIImageView
*
)
headIV
{
if
(
!
_headIV
)
{
if
(
!
_headIV
)
{
...
@@ -221,4 +231,13 @@
...
@@ -221,4 +231,13 @@
return
_startBtn
;
return
_startBtn
;
}
}
-
(
UILabel
*
)
adviceMessageLab
{
if
(
!
_adviceMessageLab
)
{
_adviceMessageLab
=
[
UILabel
labWithFont
:
SysFont
(
12
.
0
)];
_adviceMessageLab
.
textAlignment
=
NSTextAlignmentCenter
;
_adviceMessageLab
.
dk_textColorPicker
=
DKColorPickerWithColors
(
SubTitleColor
,
ColorFromHexA
(
0xFFFFFF
,
.
3
),
DSWhite
);
}
return
_adviceMessageLab
;
}
@end
@end
DreamSleep/DreamSleep/Class/AISleepModule/SleepReady/View/XLCircle.m
查看文件 @
8d8999a
...
@@ -90,12 +90,13 @@ static CGFloat endPointMargin = 8.0f;
...
@@ -90,12 +90,13 @@ static CGFloat endPointMargin = 8.0f;
-
(
void
)
updateEndPoint
{
-
(
void
)
updateEndPoint
{
// 转成弧度
// 转成弧度
CGFloat
angle
=
M_PI
*
2
*
_progress
;
CGFloat
angle
=
M_PI
*
2
*
_progress
;
float
radius
=
(
self
.
bounds
.
size
.
width
-
_lineWidth
)
/
2
.
0
;
float
radius
=
(
self
.
bounds
.
size
.
width
-
_lineWidth
)
/
2
.
0
;
// 用户区分在第几象限内
// 用户区分在第几象限内
int
index
=
(
angle
)
/
M_PI_2
;
int
index
=
(
angle
)
/
M_PI_2
;
// 用于计算正弦/余弦的角度
// 用于计算正弦/余弦的角度
float
needAngle
=
angle
-
index
*
M_PI_2
;
float
needAngle
=
angle
-
index
*
M_PI_2
;
float
x
=
0
,
y
=
0
;
//用于保存_dotView的frame
// 用于保存_dotView的frame
float
x
=
0
,
y
=
0
;
switch
(
index
)
{
switch
(
index
)
{
case
0
:
// 第一象限
case
0
:
// 第一象限
x
=
radius
+
sinf
(
needAngle
)
*
radius
;
x
=
radius
+
sinf
(
needAngle
)
*
radius
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论