Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
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
mobile-group
galaxy-iOS
Commits
7d7aba4b
Commit
7d7aba4b
authored
Apr 12, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 消息
parent
12aea708
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
13 deletions
+70
-13
YHSearchInfomationVC.swift
...axy/Classes/Modules/Home(首页)/C/YHSearchInfomationVC.swift
+21
-3
YHSearchInfoCell.swift
.../galaxy/Classes/Modules/Home(首页)/V/YHSearchInfoCell.swift
+8
-2
YHMyNotifySettingVC.swift
...laxy/Classes/Modules/Mine(我的)/C/YHMyNotifySettingVC.swift
+1
-1
YHMyPermissionSettingVC.swift
.../Classes/Modules/Mine(我的)/C/YHMyPermissionSettingVC.swift
+40
-7
No files found.
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHSearchInfomationVC.swift
View file @
7d7aba4b
...
...
@@ -10,11 +10,28 @@ import UIKit
class
YHSearchInfomationVC
:
YHBaseViewController
{
var
items
:[
String
]
=
[
"阿斯顿法师法师法师"
,
"发大水发生大法师懂法守法三大发沙发沙发沙发沙发沙发啥打法上大V撒大V啊三大发啥打法四大法守法"
,
"发大水发生大法师懂法守法三大发沙发沙发沙发沙发沙发啥打法上大V撒大V啊三大发啥打法四大法守法发大水发生大法师懂法守法三大发沙发沙发沙发沙发沙发啥打法上大V撒大V啊三大发啥打法四大法守法"
,
"啊发顺丰"
]
var
items
:[
YHHomeListModel
]
=
[
]
lazy
var
viewModel
:
YHHomePageViewModel
=
{
let
viewModel
=
YHHomePageViewModel
()
return
viewModel
}()
lazy
var
searchBar
:
YHSearchInfoBar
=
{
let
bar
=
YHSearchInfoBar
(
frame
:
CGRect
(
x
:
20
,
y
:
k_Height_NavigationtBarAndStatuBar
+
8.0
,
width
:
KScreenWidth
-
40
,
height
:
36.0
))
bar
.
searchBlock
=
{
[
weak
self
]
text
in
guard
let
self
=
self
else
{
return
}
self
.
viewModel
.
searchArticleList
(
text
??
""
)
{
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
items
.
removeAll
()
if
let
arr
=
self
.
viewModel
.
arrHomeNewsData
{
items
.
append
(
contentsOf
:
arr
)
}
self
.
tableView
.
reloadData
()
}
}
return
bar
}()
...
...
@@ -54,6 +71,7 @@ class YHSearchInfomationVC: YHBaseViewController {
view
.
addSubview
(
searchBar
)
view
.
addSubview
(
searchHistoryView
)
view
.
addSubview
(
tableView
)
searchBar
.
textField
.
becomeFirstResponder
()
searchBar
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalToSuperview
()
.
offset
(
20
)
...
...
@@ -92,7 +110,7 @@ extension YHSearchInfomationVC: UITableViewDelegate, UITableViewDataSource {
if
0
<=
indexPath
.
section
&&
indexPath
.
section
<
items
.
count
{
let
item
=
items
[
indexPath
.
section
]
cell
.
titleLabel
.
text
=
items
[
indexPath
.
section
]
cell
.
updateModel
(
item
)
}
return
cell
}
...
...
@@ -104,7 +122,7 @@ extension YHSearchInfomationVC: UITableViewDelegate, UITableViewDataSource {
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
if
0
<=
indexPath
.
section
&&
indexPath
.
section
<
items
.
count
{
let
text
=
items
[
indexPath
.
section
]
let
articleInfo
=
items
[
indexPath
.
section
]
self
.
tableView
.
isHidden
=
true
self
.
searchHistoryView
.
isHidden
=
false
}
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/V/YHSearchInfoCell.swift
View file @
7d7aba4b
...
...
@@ -7,8 +7,7 @@
//
import
UIKit
import
Kingfisher
class
YHSearchInfoCell
:
UITableViewCell
{
...
...
@@ -41,6 +40,13 @@ class YHSearchInfoCell: UITableViewCell {
return
label
}()
func
updateModel
(
_
model
:
YHHomeListModel
)
{
titleLabel
.
text
=
model
.
title
if
let
url
=
URL
(
string
:
model
.
img_url
)
{
headImgView
.
kf
.
setImage
(
with
:
url
)
}
}
func
setupUI
()
{
contentView
.
backgroundColor
=
.
white
...
...
galaxy/galaxy/Classes/Modules/Mine(我的)/C/YHMyNotifySettingVC.swift
View file @
7d7aba4b
...
...
@@ -10,7 +10,7 @@ import UIKit
class
YHMyNotifySettingVC
:
YHBaseViewController
{
var
items
:[
YHPermissionItem
]
=
[
YHPermissionItem
(
title
:
"接收推送消息通知"
.
local
,
enableStatus
:
false
)]
var
items
:[
YHPermissionItem
]
=
[
YHPermissionItem
(
title
:
"接收推送消息通知"
.
local
,
type
:
.
notify
,
enableStatus
:
false
)]
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
...
...
galaxy/galaxy/Classes/Modules/Mine(我的)/C/YHMyPermissionSettingVC.swift
View file @
7d7aba4b
...
...
@@ -8,22 +8,34 @@
import
UIKit
enum
YHPermissionType
:
Int
{
case
none
=
0
case
network
=
1
case
photo
=
2
case
camera
=
3
case
location
=
4
case
file
=
5
case
notify
=
6
}
class
YHPermissionItem
{
var
type
:
YHPermissionType
=
.
none
var
title
:
String
=
""
var
enableStatus
:
Bool
=
false
init
(
title
:
String
,
enableStatus
:
Bool
)
{
init
(
title
:
String
,
type
:
YHPermissionType
,
enableStatus
:
Bool
)
{
self
.
title
=
title
self
.
type
=
type
self
.
enableStatus
=
enableStatus
}
}
class
YHMyPermissionSettingVC
:
YHBaseViewController
{
var
items
:[
YHPermissionItem
]
=
[
YHPermissionItem
(
title
:
"网络"
.
local
,
enableStatus
:
true
),
YHPermissionItem
(
title
:
"照片"
.
local
,
enableStatus
:
true
),
YHPermissionItem
(
title
:
"相机"
.
local
,
enableStatus
:
false
),
YHPermissionItem
(
title
:
"位置"
.
local
,
enableStatus
:
true
),
YHPermissionItem
(
title
:
"文件"
.
local
,
enableStatus
:
false
)]
var
items
:[
YHPermissionItem
]
=
[
YHPermissionItem
(
title
:
"网络"
.
local
,
type
:
.
network
,
enableStatus
:
true
),
YHPermissionItem
(
title
:
"照片"
.
local
,
type
:
.
photo
,
enableStatus
:
true
),
YHPermissionItem
(
title
:
"相机"
.
local
,
type
:
.
camera
,
enableStatus
:
false
),
YHPermissionItem
(
title
:
"位置"
.
local
,
type
:
.
location
,
enableStatus
:
true
),
YHPermissionItem
(
title
:
"文件"
.
local
,
type
:
.
file
,
enableStatus
:
false
)]
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
...
...
@@ -76,7 +88,28 @@ extension YHMyPermissionSettingVC: UITableViewDelegate, UITableViewDataSource {
}
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
if
0
<=
indexPath
.
row
&&
indexPath
.
row
<
items
.
count
{
let
item
=
items
[
indexPath
.
row
]
if
item
.
type
==
.
photo
||
item
.
type
==
.
camera
{
let
url
=
URL
(
string
:
UIApplication
.
openSettingsURLString
)
if
let
url
=
url
,
UIApplication
.
shared
.
canOpenURL
(
url
)
{
UIApplication
.
shared
.
open
(
url
,
options
:
[:],
completionHandler
:
{
(
success
)
in
})
}
return
}
if
item
.
type
==
.
location
{
if
let
url
=
URL
(
string
:
"App-prefs:Photos"
)
{
UIApplication
.
shared
.
open
(
url
,
options
:
[:],
completionHandler
:
nil
)
}
}
else
if
item
.
type
==
.
file
{
}
}
}
private
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
CGFloat
{
...
...
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