Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
此号慢热型
o2oa
提交
7b925cd6
o2oa
项目概览
此号慢热型
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7b925cd6
编写于
8月 01, 2020
作者:
F
fancy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ios已办查询功能,修复多次下拉闪退的bug
上级
4fae7791
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
66 addition
and
57 deletion
+66
-57
o2ios/O2Platform/App/Work-工作/c/TodoTaskViewController.swift
o2ios/O2Platform/App/Work-工作/c/TodoTaskViewController.swift
+63
-54
o2ios/O2Platform/Info.plist
o2ios/O2Platform/Info.plist
+3
-3
未找到文件。
o2ios/O2Platform/App/Work-工作/c/TodoTaskViewController.swift
浏览文件 @
7b925cd6
...
...
@@ -73,8 +73,6 @@ class TodoTaskViewController: UITableViewController {
return
[
0
:
TaskURLGenenater
(
url
:
todoTaskURL
!
,
pageModel
:
CommonPageModel
()),
2
:
TaskURLGenenater
(
url
:
todoedTaskURL
!
,
pageModel
:
CommonPageModel
()),
1
:
TaskURLGenenater
(
url
:
readTaskURL
!
,
pageModel
:
CommonPageModel
()),
3
:
TaskURLGenenater
(
url
:
readedTaskURL
!
,
pageModel
:
CommonPageModel
())]
}
//容器视图
var
searchBarContainerView
=
UIView
()
//搜索文本
var
searchText
=
""
...
...
@@ -104,17 +102,23 @@ class TodoTaskViewController: UITableViewController {
let
taskIndex
=
AppConfigSettings
.
shared
.
taskIndex
self
.
currentTaskURLGenenater
=
self
.
urls
[
taskIndex
]
// //添加搜索功能
// self.searchController.searchResultsUpdater = self
// self.searchController.delegate = self
// self.searchController.dimsBackgroundDuringPresentation = false
// self.searchController.hidesNavigationBarDuringPresentation = false
// definesPresentationContext = true
// self.searchController.searchBar.sizeToFit()
// self.searchController.searchBar.backgroundColor = RGB(251, g: 71, b: 71)
// self.tableView.tableHeaderView = self.searchController.searchBar
self
.
searchController
.
searchResultsUpdater
=
self
self
.
searchController
.
delegate
=
self
self
.
searchController
.
dimsBackgroundDuringPresentation
=
false
self
.
searchController
.
hidesNavigationBarDuringPresentation
=
false
definesPresentationContext
=
true
self
.
searchController
.
searchBar
.
sizeToFit
()
self
.
searchController
.
searchBar
.
backgroundColor
=
RGB
(
251
,
g
:
71
,
b
:
71
)
self
.
searchController
.
searchBar
.
setImage
(
UIImage
(
named
:
"contact_search"
),
for
:
.
search
,
state
:
.
normal
)
if
let
searchField
=
self
.
searchController
.
searchBar
.
value
(
forKey
:
"searchField"
)
as?
UITextField
{
searchField
.
textColor
=
.
white
}
//
// //设置搜索框是否显示
//
self.setSearchBarIsShow()
self
.
setSearchBarIsShow
()
//分页刷新功能
self
.
tableView
.
mj_header
=
MJRefreshNormalHeader
(
refreshingBlock
:
{
...
...
@@ -125,21 +129,23 @@ class TodoTaskViewController: UITableViewController {
self
.
footerLoadData
()
})
self
.
headerLoadData
()
//self.tableView.mj_header.beginRefreshing()
//self.loadDataByURL(genernater!.nextPage(nil))
}
//隐藏搜索框
func
setSearchBarIsShow
(){
// if taskIndex == 0 {
// self.searchController.searchBar.isHidden = true
// }else{
// self.searchController.searchBar.isHidden = false
// }
let
taskIndex
=
AppConfigSettings
.
shared
.
taskIndex
if
taskIndex
==
2
{
self
.
tableView
.
tableHeaderView
=
self
.
searchController
.
searchBar
}
else
{
if
self
.
searchController
.
isActive
{
self
.
searchController
.
isActive
=
false
}
self
.
tableView
.
tableHeaderView
=
nil
}
}
func
headerLoadData
(){
DDLogDebug
(
"加载数据。。。。。。。。。"
)
let
taskIndex
=
AppConfigSettings
.
shared
.
taskIndex
if
!
self
.
searchController
.
isActive
{
self
.
currentTaskURLGenenater
=
self
.
urls
[
taskIndex
]
...
...
@@ -155,6 +161,7 @@ class TodoTaskViewController: UITableViewController {
}
func
footerLoadData
(){
DDLogDebug
(
"获取更多数据。。。。。。。。。。。。。。"
)
var
genernater
=
self
.
currentTaskURLGenenater
if
!
(
genernater
?
.
pageModel
.
isLast
())
!
{
genernater
?
.
pageModel
.
nextPage
()
...
...
@@ -172,15 +179,15 @@ class TodoTaskViewController: UITableViewController {
}
func
loadFilterFirstDataByURL
(){
DDLogDebug
(
"查询数据 loadFilterFirstDataByURL"
)
let
tv
=
self
.
tableView
as!
ZLBaseTableView
tv
.
emptyTitle
=
self
.
emptyTexts
[
AppConfigSettings
.
shared
.
taskIndex
]
//ProgressHUD.show("加载中...",interaction: false)
self
.
filterModels
.
removeAll
()
Alamofire
.
request
(
self
.
currentTaskURLGenenater
.
pagingURL
(),
method
:
.
post
,
parameters
:
[
"key"
:
self
.
searchText
],
encoding
:
JSONEncoding
.
default
,
headers
:
nil
)
.
responseJSON
{
(
response
)
in
switch
response
.
result
{
case
.
success
(
let
val
):
let
type
=
JSON
(
val
)[
"type"
]
if
type
==
"success"
{
self
.
filterModels
.
removeAll
()
let
data
=
JSON
(
val
)[
"data"
]
let
todoTaskArray
=
Mapper
<
TodoTask
>
()
.
mapArray
(
JSONString
:
data
.
description
)
if
let
todoTasks
=
todoTaskArray
{
...
...
@@ -194,23 +201,22 @@ class TodoTaskViewController: UITableViewController {
//第一次设置总数
self
.
currentTaskURLGenenater
.
pageModel
.
setPageTotal
(
count
.
int
!
)
DispatchQueue
.
main
.
async
{
self
.
tableView
.
reloadData
()
//ProgressHUD.showSuccess("加载成功")
if
self
.
searchController
.
isActive
{
self
.
tableView
.
reloadData
()
}
}
}
else
{
DispatchQueue
.
main
.
async
{
DDLogError
(
JSON
(
val
)
.
description
)
self
.
tableView
.
reloadData
()
//ProgressHUD.showError("加载失败")
self
.
showError
(
title
:
"查询失败!"
)
}
}
case
.
failure
(
let
err
):
DispatchQueue
.
main
.
async
{
DDLogError
(
err
.
localizedDescription
)
self
.
tableView
.
reloadData
()
//ProgressHUD.showError("加载失败")
}
DispatchQueue
.
main
.
async
{
DDLogError
(
err
.
localizedDescription
)
self
.
showError
(
title
:
"查询失败!"
)
}
}
if
tv
.
mj_header
.
isRefreshing
(){
tv
.
mj_header
.
endRefreshing
()
...
...
@@ -220,11 +226,14 @@ class TodoTaskViewController: UITableViewController {
}
func
loadFilterNexdataByURL
(){
DDLogDebug
(
"下一页数据 loadFilterNexdataByURL"
)
let
tv
=
self
.
tableView
as!
ZLBaseTableView
tv
.
emptyTitle
=
self
.
emptyTexts
[
AppConfigSettings
.
shared
.
taskIndex
]
//ProgressHUD.show("加载中...",interaction: false)
let
todoTask
=
self
.
models
.
last
?
.
sourceObj
!
self
.
currentTaskURLGenenater
.
pageModel
.
nextPageId
=
(
todoTask
?
.
id
)
!
guard
let
todoTask
=
self
.
filterModels
.
last
?
.
sourceObj
else
{
DDLogError
(
"没有最后一条数据,无法加载更多。。。。"
)
return
}
self
.
currentTaskURLGenenater
.
pageModel
.
nextPageId
=
todoTask
.
id
!
Alamofire
.
request
(
self
.
currentTaskURLGenenater
.
pagingURL
(),
method
:
.
post
,
parameters
:
[
"key"
:
self
.
searchText
],
encoding
:
JSONEncoding
.
default
,
headers
:
nil
)
.
responseJSON
{
(
response
)
in
switch
response
.
result
{
case
.
success
(
let
val
):
...
...
@@ -239,22 +248,21 @@ class TodoTaskViewController: UITableViewController {
}
}
DispatchQueue
.
main
.
async
{
self
.
tableView
.
reloadData
()
// ProgressHUD.showSuccess("加载成功")
if
self
.
searchController
.
isActive
{
self
.
tableView
.
reloadData
()
}
}
}
else
{
DispatchQueue
.
main
.
async
{
DDLogError
(
JSON
(
val
)
.
description
)
self
.
tableView
.
reloadData
()
//ProgressHUD.showSuccess("加载失败")
self
.
showError
(
title
:
"查询失败!"
)
}
}
case
.
failure
(
let
err
):
DispatchQueue
.
main
.
async
{
DDLogError
(
err
.
localizedDescription
)
self
.
tableView
.
reloadData
()
//ProgressHUD.showSuccess("加载失败")
self
.
showError
(
title
:
"查询失败!"
)
}
}
if
tv
.
mj_footer
.
isRefreshing
()
{
...
...
@@ -267,15 +275,15 @@ class TodoTaskViewController: UITableViewController {
//加载第一页数据
func
loadFirstDataByURL
(){
DDLogDebug
(
"加载数据 loadFirstDataByURL"
)
let
tv
=
self
.
tableView
as!
ZLBaseTableView
tv
.
emptyTitle
=
self
.
emptyTexts
[
AppConfigSettings
.
shared
.
taskIndex
]
//ProgressHUD.show("加载中...",interaction: false)
self
.
models
.
removeAll
()
Alamofire
.
request
(
self
.
currentTaskURLGenenater
.
pagingURL
(),
method
:
.
get
,
parameters
:
nil
,
encoding
:
JSONEncoding
.
default
,
headers
:
nil
)
.
responseJSON
{
(
response
)
in
switch
response
.
result
{
case
.
success
(
let
val
):
let
type
=
JSON
(
val
)[
"type"
]
if
type
==
"success"
{
self
.
models
.
removeAll
()
let
data
=
JSON
(
val
)[
"data"
]
let
todoTaskArray
=
Mapper
<
TodoTask
>
()
.
mapArray
(
JSONString
:
data
.
description
)
if
let
todoTasks
=
todoTaskArray
{
...
...
@@ -289,22 +297,21 @@ class TodoTaskViewController: UITableViewController {
//第一次设置总数
self
.
currentTaskURLGenenater
.
pageModel
.
setPageTotal
(
count
.
int
!
)
DispatchQueue
.
main
.
async
{
self
.
tableView
.
reloadData
()
//ProgressHUD.showSuccess("加载成功")
if
!
self
.
searchController
.
isActive
{
self
.
tableView
.
reloadData
()
}
}
}
else
{
DispatchQueue
.
main
.
async
{
DDLogError
(
JSON
(
val
)
.
description
)
self
.
tableView
.
reloadData
()
//ProgressHUD.showError("加载失败")
self
.
showError
(
title
:
"查询失败!"
)
}
}
case
.
failure
(
let
err
):
DispatchQueue
.
main
.
async
{
DDLogError
(
err
.
localizedDescription
)
self
.
tableView
.
reloadData
()
//ProgressHUD.showError("加载失败")
self
.
showError
(
title
:
"查询失败!"
)
}
}
if
tv
.
mj_header
.
isRefreshing
(){
...
...
@@ -316,9 +323,9 @@ class TodoTaskViewController: UITableViewController {
//加载下一页数据
func
loadDataNextByURL
()
{
DDLogDebug
(
"下一页数据 loadDataNextByURL"
)
let
tv
=
self
.
tableView
as!
ZLBaseTableView
tv
.
emptyTitle
=
self
.
emptyTexts
[
AppConfigSettings
.
shared
.
taskIndex
]
//ProgressHUD.show("加载中...",interaction: false)
let
todoTask
=
self
.
models
.
last
?
.
sourceObj
!
self
.
currentTaskURLGenenater
.
pageModel
.
nextPageId
=
(
todoTask
?
.
id
)
!
Alamofire
.
request
(
self
.
currentTaskURLGenenater
.
pagingURL
(),
method
:
.
get
,
parameters
:
nil
,
encoding
:
JSONEncoding
.
default
,
headers
:
nil
)
.
responseJSON
{
(
response
)
in
...
...
@@ -335,22 +342,21 @@ class TodoTaskViewController: UITableViewController {
}
}
DispatchQueue
.
main
.
async
{
self
.
tableView
.
reloadData
()
// ProgressHUD.showSuccess("加载成功")
if
!
self
.
searchController
.
isActive
{
self
.
tableView
.
reloadData
()
}
}
}
else
{
DispatchQueue
.
main
.
async
{
DDLogError
(
JSON
(
val
)
.
description
)
self
.
tableView
.
reloadData
()
//ProgressHUD.showSuccess("加载失败")
self
.
showError
(
title
:
"查询失败!"
)
}
}
case
.
failure
(
let
err
):
DispatchQueue
.
main
.
async
{
DDLogError
(
err
.
localizedDescription
)
self
.
tableView
.
reloadData
()
//ProgressHUD.showSuccess("加载失败")
self
.
showError
(
title
:
"查询失败!"
)
}
}
if
tv
.
mj_footer
.
isRefreshing
()
{
...
...
@@ -511,9 +517,12 @@ extension TodoTaskViewController:UISearchResultsUpdating,UISearchControllerDeleg
}
func
updateSearchResults
(
for
searchController
:
UISearchController
)
{
DDLogDebug
(
"updateSearchResults........"
)
if
let
sText
=
searchController
.
searchBar
.
text
{
self
.
searchText
=
sText
self
.
headerLoadData
()
}
else
{
DDLogDebug
(
"search text is nil .................."
)
}
}
...
...
o2ios/O2Platform/Info.plist
浏览文件 @
7b925cd6
...
...
@@ -17,7 +17,7 @@
<key>
CFBundlePackageType
</key>
<string>
APPL
</string>
<key>
CFBundleShortVersionString
</key>
<string>
5.1.
3
</string>
<string>
5.1.
4
</string>
<key>
CFBundleURLTypes
</key>
<array>
<dict>
...
...
@@ -32,7 +32,7 @@
</dict>
</array>
<key>
CFBundleVersion
</key>
<string>
7
3
</string>
<string>
7
4
</string>
<key>
LSRequiresIPhoneOS
</key>
<true/>
<key>
NSAppTransportSecurity
</key>
...
...
@@ -167,7 +167,7 @@
<key>
centerContext
</key>
<string>
/x_program_center
</string>
<key>
centerHost
</key>
<string>
123.125.39.51
</string>
<string>
wrdp3.zoneland.net
</string>
<key>
centerPort
</key>
<integer>
20030
</integer>
<key>
httpProtocol
</key>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录