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
68987815
Commit
68987815
authored
Apr 03, 2025
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// plan
parent
7c77d9d9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
8 deletions
+46
-8
YHPlanViewController.swift
...axy/Classes/Modules/Plan(方案)/C/YHPlanViewController.swift
+14
-0
YHPlanAnalyzeInfoCell.swift
...xy/Classes/Modules/Plan(方案)/V/YHPlanAnalyzeInfoCell.swift
+6
-0
YHPlanProductListView.swift
...xy/Classes/Modules/Plan(方案)/V/YHPlanProductListView.swift
+26
-8
No files found.
galaxy/galaxy/Classes/Modules/Plan(方案)/C/YHPlanViewController.swift
View file @
68987815
...
@@ -255,6 +255,7 @@ class YHPlanViewController: YHBaseViewController {
...
@@ -255,6 +255,7 @@ class YHPlanViewController: YHBaseViewController {
v
.
addSubview
(
listView
)
v
.
addSubview
(
listView
)
let
button
=
YHLookPlanButton
(
frame
:
.
zero
)
let
button
=
YHLookPlanButton
(
frame
:
.
zero
)
button
.
addTarget
(
self
,
action
:
#selector(
didBottomBtnClicked
)
,
for
:
.
touchUpInside
)
v
.
addSubview
(
button
)
v
.
addSubview
(
button
)
listView
.
snp
.
makeConstraints
{
make
in
listView
.
snp
.
makeConstraints
{
make
in
...
@@ -291,6 +292,15 @@ class YHPlanViewController: YHBaseViewController {
...
@@ -291,6 +292,15 @@ class YHPlanViewController: YHBaseViewController {
self
.
navigationController
?
.
pushViewController
(
vc
)
self
.
navigationController
?
.
pushViewController
(
vc
)
}
}
@objc
func
didBottomBtnClicked
()
{
self
.
enterMakePlanPage
()
}
func
enterMakePlanPage
()
{
let
vc
=
YHMakePlanViewController
()
self
.
navigationController
?
.
pushViewController
(
vc
)
}
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
...
@@ -422,6 +432,10 @@ extension YHPlanViewController: UITableViewDelegate, UITableViewDataSource {
...
@@ -422,6 +432,10 @@ extension YHPlanViewController: UITableViewDelegate, UITableViewDataSource {
return
UITableViewCell
()
return
UITableViewCell
()
}
}
cell2
.
model
=
analyzeArr
[
indexPath
.
section
-
1
]
cell2
.
model
=
analyzeArr
[
indexPath
.
section
-
1
]
cell2
.
clickBlock
=
{
[
weak
self
]
model
in
guard
let
self
=
self
else
{
return
}
self
.
enterMakePlanPage
()
}
return
cell2
return
cell2
}
else
if
indexPath
.
section
==
5
{
}
else
if
indexPath
.
section
==
5
{
...
...
galaxy/galaxy/Classes/Modules/Plan(方案)/V/YHPlanAnalyzeInfoCell.swift
View file @
68987815
...
@@ -63,6 +63,8 @@ class YHPlanAnalyzeInfoCell: UITableViewCell {
...
@@ -63,6 +63,8 @@ class YHPlanAnalyzeInfoCell: UITableViewCell {
static
let
cellReuseIdentifier
=
"YHPlanAnalyzeInfoCell"
static
let
cellReuseIdentifier
=
"YHPlanAnalyzeInfoCell"
var
clickBlock
:((
YHPlanProductModel
)
->
())?
var
model
=
YHPlanAnalyzeModel
()
{
var
model
=
YHPlanAnalyzeModel
()
{
didSet
{
didSet
{
titleLabel
.
text
=
"
\(
model
.
getTitle
()
)
分析"
titleLabel
.
text
=
"
\(
model
.
getTitle
()
)
分析"
...
@@ -152,6 +154,10 @@ class YHPlanAnalyzeInfoCell: UITableViewCell {
...
@@ -152,6 +154,10 @@ class YHPlanAnalyzeInfoCell: UITableViewCell {
lazy
var
productListView
:
YHPlanProductListView
=
{
lazy
var
productListView
:
YHPlanProductListView
=
{
let
v
=
YHPlanProductListView
(
frame
:
.
zero
)
let
v
=
YHPlanProductListView
(
frame
:
.
zero
)
v
.
clickBlock
=
{
[
weak
self
]
model
in
guard
let
self
=
self
else
{
return
}
self
.
clickBlock
?(
model
)
}
v
.
isHidden
=
true
v
.
isHidden
=
true
return
v
return
v
}()
}()
...
...
galaxy/galaxy/Classes/Modules/Plan(方案)/V/YHPlanProductListView.swift
View file @
68987815
...
@@ -10,6 +10,20 @@ import UIKit
...
@@ -10,6 +10,20 @@ import UIKit
class
YHPlanProductItemView
:
UIView
{
class
YHPlanProductItemView
:
UIView
{
var
clickBlock
:((
YHPlanProductModel
)
->
())?
var
product
:
YHPlanProductModel
=
YHPlanProductModel
()
{
didSet
{
titleLabel
.
text
=
product
.
title
descLabel
.
text
=
product
.
description
if
let
url
=
URL
(
string
:
product
.
img_url
)
{
iconImgV
.
sd_setImage
(
with
:
url
,
placeholderImage
:
UIImage
(
named
:
"global_default_image"
))
}
else
{
iconImgV
.
image
=
UIImage
(
named
:
"global_default_image"
)
}
}
}
lazy
var
iconImgV
:
UIImageView
=
{
lazy
var
iconImgV
:
UIImageView
=
{
let
v
=
UIImageView
()
let
v
=
UIImageView
()
v
.
backgroundColor
=
.
red
v
.
backgroundColor
=
.
red
...
@@ -49,8 +63,16 @@ class YHPlanProductItemView: UIView {
...
@@ -49,8 +63,16 @@ class YHPlanProductItemView: UIView {
fatalError
(
"init(coder:) has not been implemented"
)
fatalError
(
"init(coder:) has not been implemented"
)
}
}
@objc
func
didItemViewClicked
()
{
clickBlock
?(
self
.
product
)
}
func
createUI
()
{
func
createUI
()
{
backgroundColor
=
.
init
(
hex
:
0xF8F9FB
)
backgroundColor
=
.
init
(
hex
:
0xF8F9FB
)
let
tap
=
UITapGestureRecognizer
(
target
:
self
,
action
:
#selector(
didItemViewClicked
)
)
self
.
addGestureRecognizer
(
tap
)
self
.
addSubview
(
iconImgV
)
self
.
addSubview
(
iconImgV
)
self
.
addSubview
(
titleLabel
)
self
.
addSubview
(
titleLabel
)
self
.
addSubview
(
descLabel
)
self
.
addSubview
(
descLabel
)
...
@@ -84,6 +106,8 @@ class YHPlanProductItemView: UIView {
...
@@ -84,6 +106,8 @@ class YHPlanProductItemView: UIView {
}
}
class
YHPlanProductListView
:
UIView
{
class
YHPlanProductListView
:
UIView
{
var
clickBlock
:((
YHPlanProductModel
)
->
())?
var
products
:
[
YHPlanProductModel
]
=
[]
{
var
products
:
[
YHPlanProductModel
]
=
[]
{
didSet
{
didSet
{
...
@@ -91,14 +115,8 @@ class YHPlanProductListView: UIView {
...
@@ -91,14 +115,8 @@ class YHPlanProductListView: UIView {
var
lastItemView
:
YHPlanProductItemView
?
var
lastItemView
:
YHPlanProductItemView
?
for
(
index
,
item
)
in
products
.
enumerated
()
{
for
(
index
,
item
)
in
products
.
enumerated
()
{
let
v
=
YHPlanProductItemView
(
frame
:
.
zero
)
let
v
=
YHPlanProductItemView
(
frame
:
.
zero
)
v
.
titleLabel
.
text
=
item
.
title
v
.
product
=
item
v
.
descLabel
.
text
=
item
.
description
v
.
clickBlock
=
self
.
clickBlock
if
let
url
=
URL
(
string
:
item
.
img_url
)
{
v
.
iconImgV
.
sd_setImage
(
with
:
url
,
placeholderImage
:
UIImage
(
named
:
"global_default_image"
))
}
else
{
v
.
iconImgV
.
image
=
UIImage
(
named
:
"global_default_image"
)
}
listView
.
addSubview
(
v
)
listView
.
addSubview
(
v
)
v
.
snp
.
makeConstraints
{
make
in
v
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
left
.
right
.
equalToSuperview
()
...
...
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