Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
WXDownloadingKit
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanggang
WXDownloadingKit
Commits
ad6e557b
Commit
ad6e557b
authored
Mar 22, 2020
by
wanggang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加下载完成通知
parent
a1efd29b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
40 additions
and
0 deletions
+40
-0
project.pbxproj
Pods/Pods.xcodeproj/project.pbxproj
+0
-0
project.pbxproj
WXDownloadingKit.xcodeproj/project.pbxproj
+12
-0
UserInterfaceState.xcuserstate
...ata/davinci.pi.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
CODownloadModel.h
WXDownloadingKit/Downloading/Model/CODownloadModel.h
+11
-0
CODownloadObject.m
WXDownloadingKit/Downloading/Model/CODownloadObject.m
+2
-0
WXCOMacros.h
WXDownloadingKit/Downloading/Other/WXCOMacros.h
+12
-0
CODownloadManager+Paper.m
WXDownloadingKit/Downloading/Tool/CODownloadManager+Paper.m
+3
-0
No files found.
Pods/Pods.xcodeproj/project.pbxproj
View file @
ad6e557b
This diff is collapsed.
Click to expand it.
WXDownloadingKit.xcodeproj/project.pbxproj
View file @
ad6e557b
...
...
@@ -707,6 +707,12 @@
isa
=
XCBuildConfiguration
;
baseConfigurationReference
=
6993EC242D8AF84C1273D9A5
/* Pods-WXDownloadingComponent.debug.xcconfig */
;
buildSettings
=
{
ARCHS
=
(
arm64
,
arm64e
,
armv7
,
armv7s
,
);
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
1
;
DEAD_CODE_STRIPPING
=
NO
;
...
...
@@ -742,6 +748,12 @@
isa
=
XCBuildConfiguration
;
baseConfigurationReference
=
174BC2B187AD7DCACE6ED9D2
/* Pods-WXDownloadingComponent.release.xcconfig */
;
buildSettings
=
{
ARCHS
=
(
arm64
,
arm64e
,
armv7
,
armv7s
,
);
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
1
;
DEAD_CODE_STRIPPING
=
NO
;
...
...
WXDownloadingKit.xcworkspace/xcuserdata/davinci.pi.xcuserdatad/UserInterfaceState.xcuserstate
View file @
ad6e557b
No preview for this file type
WXDownloadingKit/Downloading/Model/CODownloadModel.h
View file @
ad6e557b
...
...
@@ -273,6 +273,17 @@ typedef NS_ENUM(NSInteger, DownloadRejectReason) {
/// 试卷的文件大小
@property
(
nonatomic
,
strong
)
NSString
*
pdf_size
;
/// 下载内容对应的 channel,题库、IIP 等
@property
(
nonatomic
,
copy
)
NSString
*
channel
;
/// 是否新线
@property
(
nonatomic
,
assign
)
BOOL
isNewLine
;
/// 题库相关下载的 PDF 类型和来源
@property
(
nonatomic
,
assign
)
WXDownloadPDFSourceType
pdfSourceType
;
@end
NS_ASSUME_NONNULL_END
WXDownloadingKit/Downloading/Model/CODownloadObject.m
View file @
ad6e557b
...
...
@@ -361,6 +361,8 @@
weakSelf
.
downloadModel
.
down_state
=
stateCompleted
;
weakSelf
.
downloadModel
.
down_date
=
[
WXCOUtility
getTimeNow
];
[[
CODownloadManager
sharedInstance
]
co_syncDownRecordForDownloadModel
:
weakSelf
.
downloadModel
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
WXDownloadingTaskDidCompleteNotification
object
:
weakSelf
.
downloadModel
];
}
else
if
(
error
.
code
==
-
999
)
{
}
// 取消或暂停
else
if
(
error
.
code
==
-
1005
)
{
}
// 网络连接已中断 在网络切换时发生
...
...
WXDownloadingKit/Downloading/Other/WXCOMacros.h
View file @
ad6e557b
...
...
@@ -15,6 +15,18 @@
//字符串是否为空
#define WXCOStringIsEmpty(str) ([str isKindOfClass:[NSNull class]] || str == nil || [str length] < 1 ? YES : NO )
/// 文件下载完成的通知,object 参数传递当前下载的 CODownloadModel 实例
#define WXDownloadingTaskDidCompleteNotification @"WXDownloadingTaskDidCompleteNotification"
/// 分为默认列表类型 和 下载模式下的类型
typedef
NS_ENUM
(
NSUInteger
,
COLessonModelDownloadType
)
{
COLessonModelDownloadTypeDisable
,
//不可下载
COLessonModelDownloadTypeCanDownload
,
//可下载
COLessonModelDownloadTypeHasDownload
,
//已下载 并完成
COLessonModelDownloadTypeDownloading
,
//正在下载
COLessonModelDownloadTypeSelected
,
//选中准备下载
};
/// 节点下载状态(针对视频、直接打开的PDF等)
typedef
NS_ENUM
(
NSInteger
,
DownloadState
)
{
/// 未下载
...
...
WXDownloadingKit/Downloading/Tool/CODownloadManager+Paper.m
View file @
ad6e557b
...
...
@@ -146,6 +146,9 @@
model
.
need_sync
=
needSyncValueYES
;
model
.
is_show
=
isShowValueYES
;
model
.
check_expired
=
checkExpiredValueNO
;
model
.
channel
=
paperModel
.
channel
;
model
.
isNewLine
=
paperModel
.
isNewLine
;
model
.
pdfSourceType
=
paperModel
.
pdfSourceType
;
[
self
.
newDownloadModels
addObject
:
model
];
// 新生成的下载模型数据
return
model
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment