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
026d733f
Commit
026d733f
authored
Apr 03, 2025
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
c8fa828f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
16 deletions
+17
-16
YHMakePlanViewController.swift
...odules/Plan(方案)/MakePlan/C/YHMakePlanViewController.swift
+1
-0
YHMakePlanModel.swift
...Classes/Modules/Plan(方案)/MakePlan/M/YHMakePlanModel.swift
+16
-16
No files found.
galaxy/galaxy/Classes/Modules/Plan(方案)/MakePlan/C/YHMakePlanViewController.swift
View file @
026d733f
...
@@ -185,6 +185,7 @@ extension YHMakePlanViewController: UITableViewDelegate, UITableViewDataSource {
...
@@ -185,6 +185,7 @@ extension YHMakePlanViewController: UITableViewDelegate, UITableViewDataSource {
self
.
viewModel
.
makePlanModel
.
toggleAddCartStatus
(
for
:
product
)
self
.
viewModel
.
makePlanModel
.
toggleAddCartStatus
(
for
:
product
)
self
.
updataPrice
()
self
.
updataPrice
()
self
.
getScore
()
self
.
getScore
()
self
.
tableView
.
reloadData
()
}
}
return
cell
return
cell
}
}
...
...
galaxy/galaxy/Classes/Modules/Plan(方案)/MakePlan/M/YHMakePlanModel.swift
View file @
026d733f
...
@@ -142,27 +142,27 @@ extension YHMakePlanModel {
...
@@ -142,27 +142,27 @@ extension YHMakePlanModel {
}
}
func
calculateTotalPrice
()
->
String
{
func
calculateTotalPrice
()
->
String
{
let
allCategories
=
[
basic
,
work
,
live
,
invest
]
let
allCategories
=
[
basic
,
work
,
live
,
invest
]
var
total
:
Double
=
0
var
total
:
Double
=
0
for
category
in
allCategories
{
for
category
in
allCategories
{
for
mainModel
in
category
{
for
mainModel
in
category
{
// Check main product
// Check main product
if
mainModel
.
is_add_cart
,
let
price
=
Double
(
mainModel
.
price
)
{
if
mainModel
.
is_add_cart
,
let
price
=
Double
(
mainModel
.
price
),
mainModel
.
sub_product
.
count
==
0
{
total
+=
price
}
// Check sub products
for
subModel
in
mainModel
.
sub_product
{
if
subModel
.
is_add_cart
,
let
price
=
Double
(
subModel
.
price
)
{
total
+=
price
total
+=
price
}
}
// Check sub products
for
subModel
in
mainModel
.
sub_product
{
if
subModel
.
is_add_cart
,
let
price
=
Double
(
subModel
.
price
)
{
total
+=
price
}
}
}
}
}
}
return
"
\(
total
)
"
}
}
return
"
\(
total
)
"
}
}
}
extension
YHMakePlanMainModel
{
extension
YHMakePlanMainModel
{
...
...
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