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
57cb89c0
Commit
57cb89c0
authored
Apr 03, 2025
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
方案逻辑
parent
68877ba1
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
177 additions
and
19 deletions
+177
-19
YHMakePlanViewController.swift
...odules/Plan(方案)/MakePlan/C/YHMakePlanViewController.swift
+37
-7
YHMakePlanHeadView.swift
...sses/Modules/Plan(方案)/MakePlan/V/YHMakePlanHeadView.swift
+6
-0
YHMakePlanShareAlertView.swift
...odules/Plan(方案)/MakePlan/V/YHMakePlanShareAlertView.swift
+7
-9
YHMakePlanStateHeadView.swift
...Modules/Plan(方案)/MakePlan/V/YHMakePlanStateHeadView.swift
+9
-3
YHMakePlanTopView.swift
...asses/Modules/Plan(方案)/MakePlan/V/YHMakePlanTopView.swift
+12
-0
YHMakePlanViewModel.swift
...es/Modules/Plan(方案)/MakePlan/VM/YHMakePlanViewModel.swift
+83
-0
YHAllApiName.swift
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
+1
-0
Contents.json
...r/invitation_with_gifts_share_plan.imageset/Contents.json
+22
-0
invitation_with_gifts_share_plan@2x.png
...are_plan.imageset/invitation_with_gifts_share_plan@2x.png
+0
-0
invitation_with_gifts_share_plan@3x.png
...are_plan.imageset/invitation_with_gifts_share_plan@3x.png
+0
-0
No files found.
galaxy/galaxy/Classes/Modules/Plan(方案)/MakePlan/C/YHMakePlanViewController.swift
View file @
57cb89c0
...
@@ -11,9 +11,11 @@ import UIKit
...
@@ -11,9 +11,11 @@ import UIKit
class
YHMakePlanViewController
:
YHBaseViewController
{
class
YHMakePlanViewController
:
YHBaseViewController
{
var
items
:
[[
Int
]]
=
[]
var
items
:
[[
Int
]]
=
[]
let
viewModel
=
YHMakePlanViewModel
()
let
viewModel
=
YHMakePlanViewModel
()
private
var
lastContentOffset
:
CGFloat
=
0
private
let
scrollThreshold
:
CGFloat
=
100
// 滑动100点显示导航栏
lazy
var
headView
:
YHMakePlanHeadView
=
{
private
var
isNavigationBarHidden
=
false
let
view
=
YHMakePlanHeadView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
333
.
fix
+
44
))
return
view
}()
lazy
var
tableView
:
UITableView
=
{
lazy
var
tableView
:
UITableView
=
{
...
@@ -27,7 +29,7 @@ class YHMakePlanViewController: YHBaseViewController {
...
@@ -27,7 +29,7 @@ class YHMakePlanViewController: YHBaseViewController {
tableView
.
delegate
=
self
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
tableView
.
dataSource
=
self
tableView
.
register
(
cellWithClass
:
YHMakePlanCell
.
self
)
tableView
.
register
(
cellWithClass
:
YHMakePlanCell
.
self
)
tableView
.
tableHeaderView
=
YHMakePlanHeadView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
333
.
fix
+
44
))
tableView
.
tableHeaderView
=
headView
return
tableView
return
tableView
}()
}()
...
@@ -78,11 +80,35 @@ class YHMakePlanViewController: YHBaseViewController {
...
@@ -78,11 +80,35 @@ class YHMakePlanViewController: YHBaseViewController {
let
totalPrice
=
viewModel
.
makePlanModel
.
calculateTotalPrice
()
let
totalPrice
=
viewModel
.
makePlanModel
.
calculateTotalPrice
()
priceView
.
configure
(
price
:
totalPrice
,
actionText
:
"去办理"
)
{
priceView
.
configure
(
price
:
totalPrice
,
actionText
:
"去办理"
)
{
YHMakePlanPriceAlertView
.
show
(
dataSource
:
self
.
viewModel
.
makePlanModel
)
{
_
in
YHMakePlanPriceAlertView
.
show
(
dataSource
:
self
.
viewModel
.
makePlanModel
)
{
_
in
self
.
addShopCard
()
}
}
}
nextHandler
:
{
}
nextHandler
:
{
YHMakePlanPriceAlertView
.
show
(
dataSource
:
self
.
viewModel
.
makePlanModel
)
{
_
in
self
.
addShopCard
()
}
}
func
addShopCard
()
{
self
.
viewModel
.
addShopCard
(
model
:
self
.
viewModel
.
makePlanModel
)
{
success
,
error
in
if
success
{
//跳转购物车
if
let
token
=
YHLoginManager
.
shared
.
userModel
?
.
token
,
token
.
count
>
5
{
var
url
=
YHBaseUrlManager
.
shared
.
curH5URL
()
+
"superAppBridge.html#/goods/cart"
url
=
url
+
"?param="
+
YHLoginManager
.
shared
.
h5Token
printLog
(
"URL:
\(
url
)
"
)
var
tUrl
=
url
if
!
url
.
contains
(
"navigationH="
)
{
tUrl
=
url
+
"?navigationH=
\(
k_Height_NavigationtBarAndStatuBar
)
"
if
url
.
contains
(
"?"
)
{
tUrl
=
url
+
"&navigationH=
\(
k_Height_NavigationtBarAndStatuBar
)
"
}
}
let
vc
=
YHH5WebViewVC
()
vc
.
url
=
tUrl
vc
.
isFullScreenFlag
=
false
vc
.
navTitle
=
"购物车"
vc
.
isSupportWebviewInterBackFlag
=
true
self
.
navigationController
?
.
pushViewController
(
vc
)
}
}
}
}
}
}
}
...
@@ -94,8 +120,10 @@ class YHMakePlanViewController: YHBaseViewController {
...
@@ -94,8 +120,10 @@ class YHMakePlanViewController: YHBaseViewController {
}
}
@objc
func
share
()
{
@objc
func
share
()
{
YHMakePlanShareAlertView
.
show
(
url
:
viewModel
.
score
.
url
)
{
_
in
}
}
}
func
requestData
()
{
func
requestData
()
{
viewModel
.
getProductList
{[
weak
self
]
_
,
_
in
viewModel
.
getProductList
{[
weak
self
]
_
,
_
in
...
@@ -108,7 +136,8 @@ class YHMakePlanViewController: YHBaseViewController {
...
@@ -108,7 +136,8 @@ class YHMakePlanViewController: YHBaseViewController {
func
getScore
()
{
func
getScore
()
{
viewModel
.
getRate
(
model
:
viewModel
.
makePlanModel
)
{[
weak
self
]
_
,
_
in
viewModel
.
getRate
(
model
:
viewModel
.
makePlanModel
)
{[
weak
self
]
_
,
_
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
self
.
headView
.
dataSource
=
viewModel
.
score
self
.
topView
.
dataSource
=
viewModel
.
score
}
}
}
}
...
@@ -142,6 +171,7 @@ extension YHMakePlanViewController: UITableViewDelegate, UITableViewDataSource {
...
@@ -142,6 +171,7 @@ extension YHMakePlanViewController: UITableViewDelegate, UITableViewDataSource {
cell
.
actionHandler
=
{
product
in
cell
.
actionHandler
=
{
product
in
self
.
viewModel
.
makePlanModel
.
toggleAddCartStatus
(
for
:
product
)
self
.
viewModel
.
makePlanModel
.
toggleAddCartStatus
(
for
:
product
)
self
.
updataPrice
()
self
.
updataPrice
()
self
.
getScore
()
}
}
return
cell
return
cell
}
}
...
...
galaxy/galaxy/Classes/Modules/Plan(方案)/MakePlan/V/YHMakePlanHeadView.swift
View file @
57cb89c0
...
@@ -34,6 +34,12 @@ class YHMakePlanHeadView: UIView {
...
@@ -34,6 +34,12 @@ class YHMakePlanHeadView: UIView {
return
view
return
view
}()
}()
var
dataSource
:
YHMakePlanScoreModel
?
{
didSet
{
centerView
.
dataSource
=
dataSource
}
}
override
init
(
frame
:
CGRect
)
{
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
super
.
init
(
frame
:
frame
)
setUpView
()
setUpView
()
...
...
galaxy/galaxy/Classes/Modules/Plan(方案)/MakePlan/V/YHMakePlanShareAlertView.swift
View file @
57cb89c0
...
@@ -15,10 +15,11 @@ class YHMakePlanShareAlertView: UIView {
...
@@ -15,10 +15,11 @@ class YHMakePlanShareAlertView: UIView {
var
sureButton
:
UIButton
!
var
sureButton
:
UIButton
!
var
leftButton
:
YHShareButton
!
var
leftButton
:
YHShareButton
!
var
rightButton
:
YHShareButton
!
var
rightButton
:
YHShareButton
!
var
url
:
String
=
""
static
func
show
(
callBack
:
@escaping
((
Int
)
->
Void
))
{
static
func
show
(
url
:
String
,
callBack
:
@escaping
((
Int
)
->
Void
))
{
let
view
=
YHMakePlanShareAlertView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
KScreenHeight
))
let
view
=
YHMakePlanShareAlertView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
KScreenHeight
))
view
.
block
=
callBack
view
.
block
=
callBack
view
.
url
=
url
let
window
=
UIApplication
.
shared
.
yhKeyWindow
()
let
window
=
UIApplication
.
shared
.
yhKeyWindow
()
window
?
.
addSubview
(
view
)
window
?
.
addSubview
(
view
)
}
}
...
@@ -97,16 +98,13 @@ class YHMakePlanShareAlertView: UIView {
...
@@ -97,16 +98,13 @@ class YHMakePlanShareAlertView: UIView {
}
}
@objc
func
wxClick
()
{
@objc
func
wxClick
()
{
// guard let combinedImage = combinedImageFrom(imageView: centerImageView) else { return }
if
let
url
=
URL
(
string
:
url
)
{
YHShareManager
.
shared
.
sendLinkContent
(
"香港身份规划专属礼包,限时领取!"
,
"资深银河规划专家1V1评估方案"
,
UIImage
(
named
:
"invitation_with_gifts_share_other"
)
??
UIImage
(),
link
:
YHBaseUrlManager
.
shared
.
curH5URL
()
+
"superAppBridge.html#/evaluation?channel=lkhtj-app&customer_id=
\(
YHLoginManager
.
shared
.
userModel
?
.
id
??
""
)
&scene_id=30"
)
UIPasteboard
.
general
.
url
=
url
// YHShareManager.shared.sendImageContent(combinedImage)
}
}
}
@objc
func
peopleClick
()
{
@objc
func
peopleClick
()
{
// guard let combinedImage = combinedImageFrom(imageView: centerImageView) else { return }
YHShareManager
.
shared
.
sendLinkContent
(
"香港续签至永居方案分析"
,
"具体方案您可以联系专属顾问和生活管家深入咨询~"
,
UIImage
(
named
:
"invitation_with_gifts_share_plan"
)
??
UIImage
(),
link
:
url
)
// YHShareManager.shared.sendImageContent(combinedImage, WXSceneTimeline)
YHShareManager
.
shared
.
sendLinkContent
(
"香港身份规划专属礼包,限时领取!"
,
"资深银河规划专家1V1评估方案"
,
UIImage
(
named
:
"invitation_with_gifts_share_other"
)
??
UIImage
(),
link
:
YHBaseUrlManager
.
shared
.
curH5URL
()
+
"superAppBridge.html#/evaluation?channel=lkhtj-app&customer_id=
\(
YHLoginManager
.
shared
.
userModel
?
.
id
??
""
)
&scene_id=30"
,
WXSceneTimeline
)
}
}
@objc
private
func
handleTap
(
_
sender
:
AnyObject
?)
{
@objc
private
func
handleTap
(
_
sender
:
AnyObject
?)
{
...
...
galaxy/galaxy/Classes/Modules/Plan(方案)/MakePlan/V/YHMakePlanStateHeadView.swift
View file @
57cb89c0
...
@@ -9,6 +9,12 @@
...
@@ -9,6 +9,12 @@
import
UIKit
import
UIKit
class
YHMakePlanStateHeadView
:
UIView
{
class
YHMakePlanStateHeadView
:
UIView
{
var
dataSource
:
YHMakePlanScoreModel
?
{
didSet
{
guard
let
dataSource
=
dataSource
else
{
return
}
configure
(
model
:
dataSource
)
}
}
// MARK: - UI Components
// MARK: - UI Components
private
let
yearsLabel
:
UILabel
=
{
private
let
yearsLabel
:
UILabel
=
{
...
@@ -95,8 +101,8 @@ class YHMakePlanStateHeadView: UIView {
...
@@ -95,8 +101,8 @@ class YHMakePlanStateHeadView: UIView {
}
}
// MARK: - Configuration
// MARK: - Configuration
func
configure
(
years
:
Int
,
percentage
:
Float
)
{
func
configure
(
model
:
YHMakePlanScoreModel
)
{
yearsLabel
.
text
=
"
\(
years
)
"
yearsLabel
.
text
=
"
\(
model
.
year
)
"
percentageLabel
.
text
=
"
\(
Int
(
percentage
*
100
)
)
%"
percentageLabel
.
text
=
model
.
pass_rate
}
}
}
}
galaxy/galaxy/Classes/Modules/Plan(方案)/MakePlan/V/YHMakePlanTopView.swift
View file @
57cb89c0
...
@@ -10,6 +10,18 @@ import UIKit
...
@@ -10,6 +10,18 @@ import UIKit
import
AttributedString
import
AttributedString
class
YHMakePlanTopView
:
UIView
{
class
YHMakePlanTopView
:
UIView
{
var
dataSource
:
YHMakePlanScoreModel
?
{
didSet
{
let
a
:
ASAttributedString
=
.
init
(
"预计可续期(年) "
,
.
font
(
UIFont
.
PFSC_M
(
ofSize
:
14
)),
.
foreground
(
UIColor
(
hex
:
0x6a7586
)))
let
b
:
ASAttributedString
=
.
init
(
"
\(
dataSource
?
.
year
)
"
,
.
font
(
UIFont
.
PFSC_M
(
ofSize
:
24
)),
.
foreground
(
UIColor
.
mainTextColor
))
yearsLabel
.
attributed
.
text
=
a
+
b
let
aa
:
ASAttributedString
=
.
init
(
"续签综合通过率 "
,
.
font
(
UIFont
.
PFSC_M
(
ofSize
:
14
)),
.
foreground
(
UIColor
(
hex
:
0x6a7586
)))
let
bb
:
ASAttributedString
=
.
init
(
"
\(
dataSource
?
.
pass_rate
)
"
,
.
font
(
UIFont
.
PFSC_M
(
ofSize
:
24
)),
.
foreground
(
UIColor
.
mainTextColor
))
// let c: ASAttributedString = .init("%", .font(UIFont.PFSC_M(ofSize: 16)), .foreground(UIColor.mainTextColor))
percentageLabel
.
attributed
.
text
=
aa
+
bb
}
}
private
let
yearsLabel
:
UILabel
=
{
private
let
yearsLabel
:
UILabel
=
{
let
label
=
UILabel
()
let
label
=
UILabel
()
let
a
:
ASAttributedString
=
.
init
(
"预计可续期(年) "
,
.
font
(
UIFont
.
PFSC_M
(
ofSize
:
14
)),
.
foreground
(
UIColor
(
hex
:
0x6a7586
)))
let
a
:
ASAttributedString
=
.
init
(
"预计可续期(年) "
,
.
font
(
UIFont
.
PFSC_M
(
ofSize
:
14
)),
.
foreground
(
UIColor
(
hex
:
0x6a7586
)))
...
...
galaxy/galaxy/Classes/Modules/Plan(方案)/MakePlan/VM/YHMakePlanViewModel.swift
View file @
57cb89c0
...
@@ -123,4 +123,87 @@ class YHMakePlanViewModel: YHBaseViewModel {
...
@@ -123,4 +123,87 @@ class YHMakePlanViewModel: YHBaseViewModel {
callBackBlock
(
false
,
err
)
callBackBlock
(
false
,
err
)
}
}
}
}
func
addShopCard
(
model
:
YHMakePlanModel
,
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
Void
)
{
var
basic
:
[
Int
]
=
[]
let
basicArray
=
makePlanModel
.
basic
let
workArray
=
makePlanModel
.
work
let
liveArray
=
makePlanModel
.
live
let
investArray
=
makePlanModel
.
invest
for
item
in
basicArray
{
if
item
.
is_add_cart
==
true
{
if
item
.
sub_product
.
count
>
0
{
for
subItem
in
item
.
sub_product
{
if
subItem
.
is_add_cart
==
true
{
basic
.
append
(
subItem
.
product_id
)
}
}
}
else
{
basic
.
append
(
item
.
product_id
)
}
}
}
for
item
in
workArray
{
if
item
.
is_add_cart
==
true
{
if
item
.
sub_product
.
count
>
0
{
for
subItem
in
item
.
sub_product
{
if
subItem
.
is_add_cart
==
true
{
basic
.
append
(
subItem
.
product_id
)
}
}
}
else
{
basic
.
append
(
item
.
product_id
)
}
}
}
for
item
in
liveArray
{
if
item
.
is_add_cart
==
true
{
if
item
.
sub_product
.
count
>
0
{
for
subItem
in
item
.
sub_product
{
if
subItem
.
is_add_cart
==
true
{
basic
.
append
(
subItem
.
product_id
)
}
}
}
else
{
basic
.
append
(
item
.
product_id
)
}
}
}
for
item
in
investArray
{
if
item
.
is_add_cart
==
true
{
if
item
.
sub_product
.
count
>
0
{
for
subItem
in
item
.
sub_product
{
if
subItem
.
is_add_cart
==
true
{
basic
.
append
(
subItem
.
product_id
)
}
}
}
else
{
basic
.
append
(
item
.
product_id
)
}
}
}
let
params
:
[
String
:
Any
]
=
[
"ids"
:
basic
,
"create_source"
:
2
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
ResignPlan
.
store
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
,
params
:
params
)
{
[
weak
self
]
json
,
_
in
// 1. json字符串 转 对象
guard
self
!=
nil
else
{
return
}
if
json
.
code
==
200
{
guard
let
dic
=
json
.
data
?
.
peel
as?
[
String
:
Any
],
let
result
=
YHMakePlanScoreModel
.
deserialize
(
from
:
dic
)
else
{
callBackBlock
(
false
,
nil
)
return
}
callBackBlock
(
true
,
nil
)
}
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
.
count
>
0
?
json
.
msg
:
"数据错误"
)
callBackBlock
(
false
,
error
)
}
}
failBlock
:
{
err
in
callBackBlock
(
false
,
err
)
}
}
}
}
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
View file @
57cb89c0
...
@@ -757,6 +757,7 @@ class YHAllApiName {
...
@@ -757,6 +757,7 @@ class YHAllApiName {
static
let
planlistApi
=
"super-app/renewal/advice/get-renewal-plan"
static
let
planlistApi
=
"super-app/renewal/advice/get-renewal-plan"
static
let
productListApi
=
"super-app/renewal/advice/get-renewal-product-list"
static
let
productListApi
=
"super-app/renewal/advice/get-renewal-product-list"
static
let
getRate
=
"super-app/renewal/advice/get-year-and-pass-rate"
static
let
getRate
=
"super-app/renewal/advice/get-year-and-pass-rate"
static
let
store
=
"super-app/presale/app/shop-cart/store"
}
}
// 问卷
// 问卷
...
...
galaxy/galaxy/Res/Assets.xcassets/Home/Invitationr/invitation_with_gifts_share_plan.imageset/Contents.json
0 → 100644
View file @
57cb89c0
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"invitation_with_gifts_share_plan@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"invitation_with_gifts_share_plan@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/Home/Invitationr/invitation_with_gifts_share_plan.imageset/invitation_with_gifts_share_plan@2x.png
0 → 100644
View file @
57cb89c0
3.39 KB
galaxy/galaxy/Res/Assets.xcassets/Home/Invitationr/invitation_with_gifts_share_plan.imageset/invitation_with_gifts_share_plan@3x.png
0 → 100644
View file @
57cb89c0
4.79 KB
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