Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 6cf3b825
由
cgx
编写于
2022-07-02 16:13:26 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
搭建我的积分页面UI框架
1 个父辈
9896fcfd
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
399 行增加
和
30 行删除
DreamSleep/DreamSleep.xcodeproj/project.pbxproj
DreamSleep/DreamSleep.xcworkspace/xcuserdata/peter.xcuserdatad/UserInterfaceState.xcuserstate
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/DailyTaskView.h
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/DailyTaskView.m
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/MyPointController.m
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/MyPointView.h
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/MyPointView.m
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/RankHeadView.h
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/RankHeadView.m
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/RankViewCell.h
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/RankViewCell.m
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/ScoreLevelView.h
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/ScoreLevelView.m
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/DailyTaskSrollView.h → DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/TaskPointSrollView.h
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/DailyTaskSrollView.m → DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/TaskPointSrollView.m
DreamSleep/DreamSleep.xcodeproj/project.pbxproj
查看文件 @
6cf3b82
...
...
@@ -33,6 +33,10 @@
D01C9D6E28168BFC00163567 /* WSDatePickerView.xib in Resources */ = {isa = PBXBuildFile; fileRef = D01C9D6B28168BFC00163567 /* WSDatePickerView.xib */; };
D01C9D6F28168BFC00163567 /* WSDatePickerView.m in Sources */ = {isa = PBXBuildFile; fileRef = D01C9D6C28168BFC00163567 /* WSDatePickerView.m */; };
D01C9D7028168BFC00163567 /* NSDate+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = D01C9D6D28168BFC00163567 /* NSDate+Extension.m */; };
D01DC95128701ECD0035B78B /* MyPointView.m in Sources */ = {isa = PBXBuildFile; fileRef = D01DC95028701ECD0035B78B /* MyPointView.m */; };
D01DC954287022740035B78B /* ScoreLevelView.m in Sources */ = {isa = PBXBuildFile; fileRef = D01DC953287022740035B78B /* ScoreLevelView.m */; };
D01DC957287023C20035B78B /* RankHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = D01DC956287023C20035B78B /* RankHeadView.m */; };
D01DC95A28702F270035B78B /* RankViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D01DC95928702F260035B78B /* RankViewCell.m */; };
D020CE1F280D951400E7E82F /* invite_friend.webp in Resources */ = {isa = PBXBuildFile; fileRef = D020CE1E280D915D00E7E82F /* invite_friend.webp */; };
D027EE2627FB3DC0004BBA61 /* NetLoadingStateView.m in Sources */ = {isa = PBXBuildFile; fileRef = D027EE2527FB3DC0004BBA61 /* NetLoadingStateView.m */; };
D027EE2927FB51D0004BBA61 /* DSGifHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = D027EE2827FB51D0004BBA61 /* DSGifHeader.m */; };
...
...
@@ -41,7 +45,7 @@
D0336163285035AB005573CF /* DailyBgView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0336162285035AB005573CF /* DailyBgView.m */; };
D037C497284F4A22000F3089 /* SignTaskView.m in Sources */ = {isa = PBXBuildFile; fileRef = D037C496284F4A22000F3089 /* SignTaskView.m */; };
D037C49A284F4F0D000F3089 /* DailyTaskCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D037C499284F4F0D000F3089 /* DailyTaskCell.m */; };
D037C49D284F5DE8000F3089 /*
DailyTaskSrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = D037C49C284F5DE8000F3089 /* DailyTask
SrollView.m */; };
D037C49D284F5DE8000F3089 /*
TaskPointSrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = D037C49C284F5DE8000F3089 /* TaskPoint
SrollView.m */; };
D03AE82B281A9010001C0726 /* MyFeedDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D03AE82A281A9010001C0726 /* MyFeedDetailModel.m */; };
D043DD55285B11860043A4CE /* VersionUpdateBox.m in Sources */ = {isa = PBXBuildFile; fileRef = D043DD54285B11860043A4CE /* VersionUpdateBox.m */; };
D043DD58285B25EE0043A4CE /* VersionRequestModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D043DD57285B25EE0043A4CE /* VersionRequestModel.m */; };
...
...
@@ -294,6 +298,14 @@
D01C9D6B28168BFC00163567 /* WSDatePickerView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WSDatePickerView.xib; sourceTree = "<group>"; };
D01C9D6C28168BFC00163567 /* WSDatePickerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WSDatePickerView.m; sourceTree = "<group>"; };
D01C9D6D28168BFC00163567 /* NSDate+Extension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDate+Extension.m"; sourceTree = "<group>"; };
D01DC94F28701ECD0035B78B /* MyPointView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyPointView.h; sourceTree = "<group>"; };
D01DC95028701ECD0035B78B /* MyPointView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyPointView.m; sourceTree = "<group>"; };
D01DC952287022740035B78B /* ScoreLevelView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScoreLevelView.h; sourceTree = "<group>"; };
D01DC953287022740035B78B /* ScoreLevelView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ScoreLevelView.m; sourceTree = "<group>"; };
D01DC955287023C20035B78B /* RankHeadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RankHeadView.h; sourceTree = "<group>"; };
D01DC956287023C20035B78B /* RankHeadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RankHeadView.m; sourceTree = "<group>"; };
D01DC95828702F260035B78B /* RankViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RankViewCell.h; sourceTree = "<group>"; };
D01DC95928702F260035B78B /* RankViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RankViewCell.m; sourceTree = "<group>"; };
D020CE1E280D915D00E7E82F /* invite_friend.webp */ = {isa = PBXFileReference; lastKnownFileType = file; path = invite_friend.webp; sourceTree = "<group>"; };
D027EE2427FB3DC0004BBA61 /* NetLoadingStateView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NetLoadingStateView.h; sourceTree = "<group>"; };
D027EE2527FB3DC0004BBA61 /* NetLoadingStateView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NetLoadingStateView.m; sourceTree = "<group>"; };
...
...
@@ -309,8 +321,8 @@
D037C496284F4A22000F3089 /* SignTaskView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SignTaskView.m; sourceTree = "<group>"; };
D037C498284F4F0D000F3089 /* DailyTaskCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DailyTaskCell.h; sourceTree = "<group>"; };
D037C499284F4F0D000F3089 /* DailyTaskCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DailyTaskCell.m; sourceTree = "<group>"; };
D037C49B284F5DE8000F3089 /*
DailyTaskSrollView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DailyTask
SrollView.h; sourceTree = "<group>"; };
D037C49C284F5DE8000F3089 /*
DailyTaskSrollView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DailyTask
SrollView.m; sourceTree = "<group>"; };
D037C49B284F5DE8000F3089 /*
TaskPointSrollView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TaskPoint
SrollView.h; sourceTree = "<group>"; };
D037C49C284F5DE8000F3089 /*
TaskPointSrollView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TaskPoint
SrollView.m; sourceTree = "<group>"; };
D03ABDAB28328F1400DD88B0 /* UnityFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = UnityFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D03ABDAF28328F4300DD88B0 /* UnityFramework.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UnityFramework.framework; path = "TapiOS/build/Release-iphoneos/UnityFramework.framework"; sourceTree = "<group>"; };
D03AE829281A9010001C0726 /* MyFeedDetailModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyFeedDetailModel.h; sourceTree = "<group>"; };
...
...
@@ -1087,6 +1099,14 @@
D091E664283F0C4800D3279E /* ScoreTaskRequestModel.m */,
D091E666283F0E8800D3279E /* MyPointController.h */,
D091E667283F0E8800D3279E /* MyPointController.m */,
D01DC94F28701ECD0035B78B /* MyPointView.h */,
D01DC95028701ECD0035B78B /* MyPointView.m */,
D01DC952287022740035B78B /* ScoreLevelView.h */,
D01DC953287022740035B78B /* ScoreLevelView.m */,
D01DC955287023C20035B78B /* RankHeadView.h */,
D01DC956287023C20035B78B /* RankHeadView.m */,
D01DC95828702F260035B78B /* RankViewCell.h */,
D01DC95928702F260035B78B /* RankViewCell.m */,
D091E669283F120100D3279E /* MyScoreModel.h */,
D091E66A283F120100D3279E /* MyScoreModel.m */,
D091E672283F5B4200D3279E /* ScoreDetailModel.h */,
...
...
@@ -1111,8 +1131,8 @@
D0D4107B2844B8DB00009638 /* DailyTaskController.m */,
D0336161285035AB005573CF /* DailyBgView.h */,
D0336162285035AB005573CF /* DailyBgView.m */,
D037C49B284F5DE8000F3089 /*
DailyTask
SrollView.h */,
D037C49C284F5DE8000F3089 /*
DailyTask
SrollView.m */,
D037C49B284F5DE8000F3089 /*
TaskPoint
SrollView.h */,
D037C49C284F5DE8000F3089 /*
TaskPoint
SrollView.m */,
D0D4107D2844D38400009638 /* RankModel.h */,
D0D4107E2844D38400009638 /* RankModel.m */,
D0BE536C2845A7AF007F15B3 /* SignModel.h */,
...
...
@@ -1973,7 +1993,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D037C49D284F5DE8000F3089 /*
DailyTask
SrollView.m in Sources */,
D037C49D284F5DE8000F3089 /*
TaskPoint
SrollView.m in Sources */,
D09D0E9D280D73B6008DEDAB /* InviteController.m in Sources */,
D043DD58285B25EE0043A4CE /* VersionRequestModel.m in Sources */,
D07257F3286BF99F0080F458 /* DailyTaskView.m in Sources */,
...
...
@@ -2047,6 +2067,7 @@
D0A75108282E2A8500589B0E /* NoisePlayBar.m in Sources */,
D0C50B4627FD66FB00DC68F0 /* DSConstUtil.m in Sources */,
D08F79DC281A1838000D99DD /* TZProgressView.m in Sources */,
D01DC95128701ECD0035B78B /* MyPointView.m in Sources */,
D091E66B283F120100D3279E /* MyScoreModel.m in Sources */,
D01BD428282C003900BA86B3 /* NoiseTypeModel.m in Sources */,
D01814D227FFCBAF00583D4E /* CWFlowLayout.m in Sources */,
...
...
@@ -2081,6 +2102,7 @@
D0AEFE822817DD1500230DC6 /* MyFeedListController.m in Sources */,
D055BEC828252D8200BC11A4 /* AudioCourseCell.m in Sources */,
D0AEFE7C2817D13400230DC6 /* UITableViewCell+CardRadius.m in Sources */,
D01DC957287023C20035B78B /* RankHeadView.m in Sources */,
D0D5BB0D286D7A8D00D0507E /* TaskGroupModel.m in Sources */,
D09BF331280E570D00E5F06C /* UserModel.m in Sources */,
D0C50B4F27FD832300DC68F0 /* LeadView.m in Sources */,
...
...
@@ -2115,6 +2137,7 @@
D055BECB28252E4000BC11A4 /* SubAudioModel.m in Sources */,
D01814DC27FFD92200583D4E /* DSDataSource.m in Sources */,
D07DACA92810557D0067A1BF /* UIImage+RSKImageCropper.m in Sources */,
D01DC95A28702F270035B78B /* RankViewCell.m in Sources */,
D0B5ECC827F2E97A003EDFE3 /* MacroFuncUtil.m in Sources */,
D055BEB928250D3400BC11A4 /* CourseCollectionCell.m in Sources */,
D01814E227FFDBB800583D4E /* HomeHeaderView.m in Sources */,
...
...
@@ -2134,6 +2157,7 @@
D0930F1A2801874B006B497A /* UIViewController+Swizzling.m in Sources */,
D0D4107F2844D38400009638 /* RankModel.m in Sources */,
D01C9D6728167F9D00163567 /* InfoModifyAlertView.m in Sources */,
D01DC954287022740035B78B /* ScoreLevelView.m in Sources */,
D0BB9AA728164DFB00DB209E /* NickNameController.m in Sources */,
D0E6F1FD28290128004150E5 /* TimingView.m in Sources */,
D091E677283F614900D3279E /* ScoreDetailCell.m in Sources */,
...
...
DreamSleep/DreamSleep.xcworkspace/xcuserdata/peter.xcuserdatad/UserInterfaceState.xcuserstate
查看文件 @
6cf3b82
此文件类型无法预览
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/DailyTaskView.h
查看文件 @
6cf3b82
...
...
@@ -28,7 +28,12 @@ NS_ASSUME_NONNULL_BEGIN
-
(
instancetype
)
initWithDelegate
:(
id
<
DailyTaskViewDelegate
>
)
delegate
;
/// 更新签到视图
/// @param requestModel requestModel
-
(
void
)
updateSignView
:(
ScoreTaskRequestModel
*
)
requestModel
;
/// 更新任务视图
/// @param requestModel requestModel
-
(
void
)
updateTaskView
:(
ScoreTaskRequestModel
*
)
requestModel
;
@end
...
...
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/DailyTaskView.m
查看文件 @
6cf3b82
...
...
@@ -6,14 +6,14 @@
//
#import "DailyTaskView.h"
#import "
DailyTask
SrollView.h"
#import "
TaskPoint
SrollView.h"
#import "DailyBgView.h"
#import "SignTaskView.h"
#import "DailyTaskCell.h"
#import "TaskGroupModel.h"
@interface
DailyTaskView
()
<
UIScrollViewDelegate
,
UITableViewDelegate
,
UITableViewDataSource
,
DailyTaskCellDelegate
>
@property
(
nonatomic
,
strong
)
DailyTask
SrollView
*
dtSrollView
;
@property
(
nonatomic
,
strong
)
TaskPoint
SrollView
*
dtSrollView
;
@property
(
nonatomic
,
strong
)
UIScrollView
*
scrollInnerView
;
@property
(
nonatomic
,
strong
)
DailyBgView
*
dailyBgView
;
@property
(
nonatomic
,
strong
)
UITableView
*
taskTableView
;
...
...
@@ -187,9 +187,9 @@
}
#pragma mark - lazy
-
(
DailyTask
SrollView
*
)
dtSrollView
{
-
(
TaskPoint
SrollView
*
)
dtSrollView
{
if
(
!
_dtSrollView
)
{
_dtSrollView
=
[[
DailyTask
SrollView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
kScreenHeight
)];
_dtSrollView
=
[[
TaskPoint
SrollView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
kScreenHeight
)];
_dtSrollView
.
contentSize
=
CGSizeMake
(
kScreenWidth
,
self
.
bgHeight
+
kScreenHeight
-
self
.
coverHeight
);
_dtSrollView
.
showsVerticalScrollIndicator
=
NO
;
_dtSrollView
.
contentInsetAdjustmentBehavior
=
UIScrollViewContentInsetAdjustmentNever
;
...
...
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/MyPointController.m
查看文件 @
6cf3b82
...
...
@@ -8,29 +8,30 @@
#import "MyPointController.h"
#import "ScoreTaskRequestModel.h"
#import "ScoreDetailController.h"
#import "MyPointView.h"
@interface
MyPointController
()
@property
(
nonatomic
,
strong
)
UIImageView
*
headBgIV
;
@interface
MyPointController
()
<
MyPointViewDelegate
>
@property
(
nonatomic
,
strong
)
MyPointView
*
myPointView
;
@property
(
nonatomic
,
strong
)
UIButton
*
scoreDetailBtn
;
@end
@implementation
MyPointController
-
(
void
)
loadView
{
self
.
view
=
self
.
myPointView
;
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
view
.
backgroundColor
=
DSWhite
;
self
.
myPointView
.
dk_backgroundColorPicker
=
DKColorPickerWithKey
(
VCViewBG
)
;
self
.
naviBgColor
=
DSClearColor
;
self
.
naviTitle
=
@"我的积分"
;
self
.
naviBarAlpha
=
1
.
0
;
self
.
naviTitle
=
@"我的积分"
;
self
.
titleLab
.
dk_textColorPicker
=
DKColorPickerWithColors
(
MainTextColor
,
DkTitleColor
,
DSWhite
);
[
self
.
backBtn
dk_setImage
:
DKImagePickerWithNames
(
@"cus_back_icon"
,
@"sys_back_icon"
,
@"sys_back_icon"
)
forState
:
UIControlStateNormal
];
[
self
.
dsNaviBar
addSubview
:
self
.
backBtn
];
[
self
.
view
insertSubview
:
self
.
headBgIV
atIndex
:
0
];
[
self
.
headBgIV
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
top
.
left
.
right
.
equalTo
(
self
.
view
);
}];
[
self
.
dsNaviBar
addSubview
:
self
.
scoreDetailBtn
];
[
self
.
scoreDetailBtn
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
right
.
equalTo
(
self
.
dsNaviBar
);
...
...
@@ -57,14 +58,25 @@
[
self
.
navigationController
pushViewController
:
detailVC
animated
:
YES
];
}
#pragma mark - lazy
-
(
UIImageView
*
)
headBgIV
{
if
(
!
_headBgIV
)
{
_headBgIV
=
[[
UIImageView
alloc
]
dk_initWithImagePicker
:
DKImagePickerWithNames
(
@"bj_jf_dingbu"
,
@"dk_bj_jf_dingbu"
,
@"dk_bj_jf_dingbu"
)];
#pragma mark - MyPointViewDelegate
-
(
void
)
didScrollToMaxOffsetY
:
(
BOOL
)
isMax
{
if
(
isMax
)
{
self
.
isNeedUpdateStatusBarStyle
=
YES
;
self
.
dsNaviBar
.
dk_backgroundColorPicker
=
DKColorPickerWithColors
(
BrandColor
,
SubNaviDarkColor
,
BrandColor
);
[
self
.
backBtn
setImage
:[
UIImage
imageNamed
:
@"sys_back_icon"
]
forState
:
UIControlStateNormal
];
self
.
titleLab
.
textColor
=
DSWhite
;
[
self
.
scoreDetailBtn
setTitleColor
:
DSWhite
forState
:
UIControlStateNormal
];
}
else
{
self
.
naviBgColor
=
DSClearColor
;
self
.
isNeedUpdateStatusBarStyle
=
NO
;
[
self
.
backBtn
dk_setImage
:
DKImagePickerWithNames
(
@"cus_back_icon"
,
@"sys_back_icon"
,
@"sys_back_icon"
)
forState
:
UIControlStateNormal
];
self
.
titleLab
.
dk_textColorPicker
=
DKColorPickerWithColors
(
MainTextColor
,
DkTitleColor
,
DSWhite
);
[
self
.
scoreDetailBtn
dk_setTitleColorPicker
:
DKColorPickerWithKey
(
Dk_TITLE
)
forState
:
UIControlStateNormal
];
}
return
_headBgIV
;
self
.
scoreDetailBtn
.
layer
.
borderColor
=
self
.
scoreDetailBtn
.
titleLabel
.
textColor
.
CGColor
;
}
#pragma mark - lazy
-
(
UIButton
*
)
scoreDetailBtn
{
if
(
!
_scoreDetailBtn
)
{
_scoreDetailBtn
=
[
UIButton
btnWithTitle
:
@"积分明细"
font
:
SysFont
(
12
.
0
)];
...
...
@@ -78,4 +90,11 @@
return
_scoreDetailBtn
;
}
-
(
MyPointView
*
)
myPointView
{
if
(
!
_myPointView
)
{
_myPointView
=
[[
MyPointView
alloc
]
initWithDelegate
:
self
];
}
return
_myPointView
;
}
@end
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/MyPointView.h
0 → 100644
查看文件 @
6cf3b82
//
// MyPointView.h
// DreamSleep
//
// Created by peter on 2022/7/2.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@protocol
MyPointViewDelegate
<
NSObject
>
/// 监听scrollview是否滚动到临界值
/// @param isMax isMax
-
(
void
)
didScrollToMaxOffsetY
:
(
BOOL
)
isMax
;
@end
/// 自定义我的积分主视图
@interface
MyPointView
:
UIView
@property
(
nonatomic
,
weak
)
id
<
MyPointViewDelegate
>
delegate
;
-
(
instancetype
)
initWithDelegate
:(
id
<
MyPointViewDelegate
>
)
delegate
;
@end
NS_ASSUME_NONNULL_END
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/MyPointView.m
0 → 100644
查看文件 @
6cf3b82
//
// MyPointView.m
// DreamSleep
//
// Created by peter on 2022/7/2.
//
#import "MyPointView.h"
#import "TaskPointSrollView.h"
#import "ScoreLevelView.h"
#import "RankHeadView.h"
#import "RankViewCell.h"
@interface
MyPointView
()
<
UIScrollViewDelegate
,
UITableViewDelegate
,
UITableViewDataSource
>
@property
(
nonatomic
,
strong
)
TaskPointSrollView
*
pointSrollView
;
@property
(
nonatomic
,
strong
)
UIScrollView
*
scrollInnerView
;
@property
(
nonatomic
,
strong
)
UIImageView
*
headBgIV
;
@property
(
nonatomic
,
strong
)
ScoreLevelView
*
scoreLevelView
;
@property
(
nonatomic
,
strong
)
UITableView
*
rankTableView
;
@property
(
nonatomic
,
strong
)
RankHeadView
*
rankHeadView
;
@property
(
nonatomic
,
assign
)
BOOL
vccanScroll
;
@property
(
nonatomic
,
assign
)
CGFloat
bgHeight
;
@property
(
nonatomic
,
strong
)
NSArray
*
rankListArr
;
@end
@implementation
MyPointView
-
(
instancetype
)
initWithDelegate
:(
id
<
MyPointViewDelegate
>
)
delegate
{
if
(
self
=
[
super
init
])
{
_delegate
=
delegate
;
self
.
vccanScroll
=
YES
;
self
.
bgHeight
=
277
;
self
.
rankListArr
=
@[
@1
,
@2
,
@3
,
@4
,
@5
,
@6
,
@7
,
@8
,
@9
];
[
self
addSubview
:
self
.
headBgIV
];
[
self
.
headBgIV
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
top
.
left
.
right
.
equalTo
(
self
);
}];
[
self
addSubview
:
self
.
pointSrollView
];
}
return
self
;
}
#pragma mark - UITableViewDelegate && UITableViewDataSource
-
(
NSInteger
)
tableView
:(
UITableView
*
)
tableView
numberOfRowsInSection
:(
NSInteger
)
section
{
return
self
.
rankListArr
.
count
;
}
-
(
CGFloat
)
tableView
:(
UITableView
*
)
tableView
heightForRowAtIndexPath
:(
NSIndexPath
*
)
indexPath
{
return
70
;
}
-
(
UITableViewCell
*
)
tableView
:(
UITableView
*
)
tableView
cellForRowAtIndexPath
:(
NSIndexPath
*
)
indexPath
{
RankViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
NSStringFromClass
([
RankViewCell
class
])
forIndexPath
:
indexPath
];
cell
.
textLabel
.
text
=
[
NSString
stringWithFormat
:
@"%ld"
,
indexPath
.
row
+
1
];
return
cell
;
}
#pragma mark - lazy
-
(
TaskPointSrollView
*
)
pointSrollView
{
if
(
!
_pointSrollView
)
{
_pointSrollView
=
[[
TaskPointSrollView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
kScreenHeight
)];
_pointSrollView
.
contentSize
=
CGSizeMake
(
kScreenWidth
,
self
.
bgHeight
+
kScreenHeight
);
_pointSrollView
.
showsVerticalScrollIndicator
=
NO
;
_pointSrollView
.
contentInsetAdjustmentBehavior
=
UIScrollViewContentInsetAdjustmentNever
;
_pointSrollView
.
delegate
=
self
;
_pointSrollView
.
bounces
=
NO
;
_pointSrollView
.
backgroundColor
=
DSClearColor
;
[
_pointSrollView
addSubview
:
self
.
scrollInnerView
];
}
return
_pointSrollView
;
}
-
(
UIScrollView
*
)
scrollInnerView
{
if
(
_scrollInnerView
==
nil
)
{
_scrollInnerView
=
[[
UIScrollView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
kScreenHeight
+
self
.
bgHeight
)];
_scrollInnerView
.
contentSize
=
CGSizeMake
(
kScreenWidth
,
kScreenHeight
+
self
.
bgHeight
);
_scrollInnerView
.
showsVerticalScrollIndicator
=
NO
;
_scrollInnerView
.
delegate
=
self
;
_scrollInnerView
.
backgroundColor
=
DSClearColor
;
[
_scrollInnerView
addSubview
:
self
.
scoreLevelView
];
[
_scrollInnerView
addSubview
:
self
.
rankTableView
];
}
return
_scrollInnerView
;
}
-
(
UIImageView
*
)
headBgIV
{
if
(
!
_headBgIV
)
{
_headBgIV
=
[[
UIImageView
alloc
]
dk_initWithImagePicker
:
DKImagePickerWithNames
(
@"bj_jf_dingbu"
,
@"dk_bj_jf_dingbu"
,
@"dk_bj_jf_dingbu"
)];
}
return
_headBgIV
;
}
-
(
ScoreLevelView
*
)
scoreLevelView
{
if
(
!
_scoreLevelView
)
{
_scoreLevelView
=
[[
ScoreLevelView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
self
.
bgHeight
)];
[
_scoreLevelView
debugViewShowBorder
];
}
return
_scoreLevelView
;
}
-
(
UITableView
*
)
rankTableView
{
if
(
!
_rankTableView
)
{
_rankTableView
=
[[
UITableView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
self
.
bgHeight
,
kScreenWidth
,
kScreenHeight
)
style
:
UITableViewStyleGrouped
];
_rankTableView
.
delegate
=
self
;
_rankTableView
.
dataSource
=
self
;
_rankTableView
.
backgroundColor
=
DSClearColor
;
_rankTableView
.
showsVerticalScrollIndicator
=
NO
;
_rankTableView
.
separatorStyle
=
UITableViewCellSeparatorStyleNone
;
_rankTableView
.
tableHeaderView
=
self
.
rankHeadView
;
[
_rankTableView
registerClass
:[
RankViewCell
class
]
forCellReuseIdentifier
:
NSStringFromClass
([
RankViewCell
class
])];
}
return
_rankTableView
;
}
-
(
RankHeadView
*
)
rankHeadView
{
if
(
!
_rankHeadView
)
{
_rankHeadView
=
[[
RankHeadView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
186
)];
}
return
_rankHeadView
;
}
-
(
NSArray
*
)
rankListArr
{
if
(
!
_rankListArr
)
{
_rankListArr
=
[
NSArray
array
];
}
return
_rankListArr
;
}
#pragma mark - UIScrollViewDelegate
-
(
void
)
scrollViewDidScroll
:
(
UIScrollView
*
)
scrollView
{
CGFloat
offsetY
=
scrollView
.
contentOffset
.
y
;
if
(
scrollView
==
self
.
pointSrollView
)
{
CGFloat
maxOffsetY
=
self
.
bgHeight
;
if
(
offsetY
>=
maxOffsetY
)
{
scrollView
.
contentOffset
=
CGPointMake
(
0
,
maxOffsetY
);
self
.
vccanScroll
=
NO
;
if
(
self
.
delegate
&&
[
self
.
delegate
respondsToSelector
:
@selector
(
didScrollToMaxOffsetY
:)])
{
[
self
.
delegate
didScrollToMaxOffsetY
:
YES
];
}
}
else
{
if
(
self
.
vccanScroll
==
NO
)
{
scrollView
.
contentOffset
=
CGPointMake
(
0
,
maxOffsetY
);
}
}
if
(
offsetY
<=
0
)
{
if
(
self
.
delegate
&&
[
self
.
delegate
respondsToSelector
:
@selector
(
didScrollToMaxOffsetY
:)])
{
[
self
.
delegate
didScrollToMaxOffsetY
:
NO
];
}
}
}
else
if
(
scrollView
==
self
.
rankTableView
)
{
CGPoint
point
=
[
scrollView
.
panGestureRecognizer
translationInView
:
scrollView
];
CGFloat
taboffsetY
=
point
.
y
;
if
(
offsetY
<
0
)
{
self
.
vccanScroll
=
YES
;
}
if
(
taboffsetY
<
0
)
{
if
(
self
.
pointSrollView
.
contentOffset
.
y
<
self
.
bgHeight
)
{
self
.
rankTableView
.
contentOffset
=
CGPointZero
;
}
}
else
{
if
(
offsetY
>
0
)
{
self
.
pointSrollView
.
contentOffset
=
CGPointMake
(
0
,
self
.
bgHeight
);
}
else
if
(
offsetY
<
0
)
{
if
(
self
.
pointSrollView
.
contentOffset
.
y
>
0
&&
self
.
pointSrollView
.
contentOffset
.
y
<
self
.
bgHeight
)
{
self
.
rankTableView
.
contentOffset
=
CGPointZero
;
}
}
}
}
}
@end
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/RankHeadView.h
0 → 100644
查看文件 @
6cf3b82
//
// RankHeadView.h
// DreamSleep
//
// Created by peter on 2022/7/2.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
/// 自定义等级头部视图
@interface
RankHeadView
:
UIView
@end
NS_ASSUME_NONNULL_END
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/RankHeadView.m
0 → 100644
查看文件 @
6cf3b82
//
// RankHeadView.m
// DreamSleep
//
// Created by peter on 2022/7/2.
//
#import "RankHeadView.h"
@interface
RankHeadView
()
@end
@implementation
RankHeadView
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
{
if
(
self
=
[
super
initWithFrame
:
frame
])
{
self
.
backgroundColor
=
[
UIColor
greenColor
];
}
return
self
;
}
@end
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/RankViewCell.h
0 → 100644
查看文件 @
6cf3b82
//
// RankViewCell.h
// DreamSleep
//
// Created by peter on 2022/7/2.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
/// 排名cell
@interface
RankViewCell
:
UITableViewCell
@end
NS_ASSUME_NONNULL_END
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/RankViewCell.m
0 → 100644
查看文件 @
6cf3b82
//
// RankViewCell.m
// DreamSleep
//
// Created by peter on 2022/7/2.
//
#import "RankViewCell.h"
@interface
RankViewCell
()
@end
@implementation
RankViewCell
-
(
instancetype
)
initWithStyle
:(
UITableViewCellStyle
)
style
reuseIdentifier
:(
NSString
*
)
reuseIdentifier
{
if
(
self
=
[
super
initWithStyle
:
style
reuseIdentifier
:
reuseIdentifier
])
{
self
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
self
.
dk_backgroundColorPicker
=
DKColorPickerWithKey
(
VCViewBG
);
}
return
self
;
}
@end
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/ScoreLevelView.h
0 → 100644
查看文件 @
6cf3b82
//
// ScoreLevelView.h
// DreamSleep
//
// Created by peter on 2022/7/2.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
/// 当前用户积分级别视图
@interface
ScoreLevelView
:
UIView
@end
NS_ASSUME_NONNULL_END
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/ScoreLevelView.m
0 → 100644
查看文件 @
6cf3b82
//
// ScoreLevelView.m
// DreamSleep
//
// Created by peter on 2022/7/2.
//
#import "ScoreLevelView.h"
@implementation
ScoreLevelView
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
{
if
(
self
=
[
super
initWithFrame
:
frame
])
{
}
return
self
;
}
@end
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/
DailyTask
SrollView.h
→
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/
TaskPoint
SrollView.h
查看文件 @
6cf3b82
//
//
DailyTask
SrollView.h
//
TaskPoint
SrollView.h
// DreamSleep
//
// Created by peter on 2022/6/7.
...
...
@@ -9,8 +9,8 @@
NS_ASSUME_NONNULL_BEGIN
@interface
DailyTaskSrollView
:
UIScrollView
/// 任务积分自定义滚动视图
@interface
TaskPointSrollView
:
UIScrollView
@end
NS_ASSUME_NONNULL_END
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/
DailyTask
SrollView.m
→
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/
TaskPoint
SrollView.m
查看文件 @
6cf3b82
//
//
DailyTask
SrollView.m
//
TaskPoint
SrollView.m
// DreamSleep
//
// Created by peter on 2022/6/7.
//
#import "
DailyTask
SrollView.h"
#import "
TaskPoint
SrollView.h"
@implementation
DailyTask
SrollView
@implementation
TaskPoint
SrollView
//返回YES,则可以多个手势一起触发方法,返回NO则为互斥(比如外层UIScrollView名为mainScroll内嵌的UIScrollView名为subScroll,当我们拖动subScroll时,mainScroll是不会响应手势的(多个手势默认是互斥的),当下面这个代理返回YES时,subScroll和mainScroll就能同时响应手势,同时滚动,这符合我们这里的需求)
-
(
BOOL
)
gestureRecognizer
:(
UIGestureRecognizer
*
)
gestureRecognizer
shouldRecognizeSimultaneouslyWithGestureRecognizer
:(
UIGestureRecognizer
*
)
otherGestureRecognizer
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论