Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
P
PhoneManager
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yang
PhoneManager
Commits
8dfd80ad
Commit
8dfd80ad
authored
May 22, 2025
by
shenyong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_syong' into dev_main
parents
5ce1c1ce
6b055c94
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
197 additions
and
50 deletions
+197
-50
AppDelegateEx.swift
PhoneManager/AppDelegateEx.swift
+3
-3
Contents.json
...r/Assets.xcassets/Pay/icon_gift_sa.imageset/Contents.json
+22
-0
优惠图标@2x.png
...ger/Assets.xcassets/Pay/icon_gift_sa.imageset/优惠图标@2x.png
+0
-0
优惠图标@3x.png
...ger/Assets.xcassets/Pay/icon_gift_sa.imageset/优惠图标@3x.png
+0
-0
PayDistanceViewController.swift
...s/Page/Pay/ViewController/PayDistanceViewController.swift
+172
-47
No files found.
PhoneManager/AppDelegateEx.swift
View file @
8dfd80ad
...
...
@@ -14,9 +14,9 @@ extension AppDelegate{
func
setupDynamicShortcuts
()
{
let
shortcutItem
=
UIApplicationShortcutItem
(
type
:
"com.app.phonemanager.iap.distance"
,
localizedTitle
:
"Unlock
Exclusive Discount
s"
,
localizedSubtitle
:
"
Your special offer is awaiting—don't miss this limited-time second chance benefit!
"
,
icon
:
UIApplicationShortcutIcon
(
templateImageName
:
"
"
),
//UIApplicationShortcutIcon(systemImageName: "star.fill"),
localizedTitle
:
"Unlock
Special Offer
s"
,
localizedSubtitle
:
"
A Special Offer Just for You!🎁
"
,
icon
:
UIApplicationShortcutIcon
(
),
//UIApplicationShortcutIcon(templateImageName: "icon_gift_sa
"), //UIApplicationShortcutIcon(systemImageName: "star.fill"),
userInfo
:
nil
)
UIApplication
.
shared
.
shortcutItems
=
[
shortcutItem
]
...
...
PhoneManager/Assets.xcassets/Pay/icon_gift_sa.imageset/Contents.json
0 → 100644
View file @
8dfd80ad
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"优惠图标@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"优惠图标@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
PhoneManager/Assets.xcassets/Pay/icon_gift_sa.imageset/优惠图标@2x.png
0 → 100644
View file @
8dfd80ad
1.95 KB
PhoneManager/Assets.xcassets/Pay/icon_gift_sa.imageset/优惠图标@3x.png
0 → 100644
View file @
8dfd80ad
2.14 KB
PhoneManager/Class/Page/Pay/ViewController/PayDistanceViewController.swift
View file @
8dfd80ad
...
...
@@ -15,8 +15,11 @@ class PayDistanceViewController: UIViewController {
var
scrollView
:
UIScrollView
!
var
dropImage
:
UIImageView
!
var
distanceL
:
UILabel
!
var
annual
:
UILabel
!
var
cancelLabel
:
UILabel
!
var
yearDistacePrice
:
UILabel
!
var
offerImage
:
UIImageView
!
var
payBtn
:
UIButton
!
...
...
@@ -46,7 +49,7 @@ class PayDistanceViewController: UIViewController {
closeBtn
.
addTarget
(
self
,
action
:
#selector(
payClose
)
,
for
:
.
touchUpInside
)
scrollView
.
addSubview
(
closeBtn
)
let
offerImage
=
UIImageView
()
offerImage
=
UIImageView
()
offerImage
.
image
=
UIImage
.
init
(
named
:
"iap_distance_offer"
)
scrollView
.
addSubview
(
offerImage
)
...
...
@@ -56,14 +59,16 @@ class PayDistanceViewController: UIViewController {
scrollView
.
addSubview
(
dropImage
)
let
distanceL
=
UILabel
()
distanceL
=
UILabel
()
distanceL
.
text
=
"50% Discount"
distanceL
.
textAlignment
=
.
center
distanceL
.
font
=
UIFont
.
systemFont
(
ofSize
:
40
,
weight
:
.
semibold
)
distanceL
.
textColor
=
UIColor
.
colorWithHex
(
hexStr
:
"#111111"
)
scrollView
.
addSubview
(
distanceL
)
let
annual
=
UILabel
()
annual
=
UILabel
()
annual
.
text
=
"Annual visit"
annual
.
textAlignment
=
.
center
annual
.
font
=
UIFont
.
systemFont
(
ofSize
:
18
,
weight
:
.
semibold
)
annual
.
textColor
=
UIColor
.
colorWithHex
(
hexStr
:
"#111111"
)
scrollView
.
addSubview
(
annual
)
...
...
@@ -72,12 +77,14 @@ class PayDistanceViewController: UIViewController {
yearDistacePrice
.
font
=
UIFont
.
systemFont
(
ofSize
:
14
,
weight
:
.
semibold
)
yearDistacePrice
.
textColor
=
UIColor
.
colorWithHex
(
hexStr
:
"#111111"
)
yearDistacePrice
.
text
=
""
//"$39.99 $19.99 / Year"
yearDistacePrice
.
textAlignment
=
.
center
scrollView
.
addSubview
(
yearDistacePrice
)
let
cancelLabel
=
UILabel
()
cancelLabel
=
UILabel
()
cancelLabel
.
font
=
UIFont
.
systemFont
(
ofSize
:
12
,
weight
:
.
semibold
)
cancelLabel
.
textColor
=
UIColor
.
colorWithHex
(
hexStr
:
"#0082FF"
)
cancelLabel
.
text
=
"Cancel at any time"
cancelLabel
.
textAlignment
=
.
center
scrollView
.
addSubview
(
cancelLabel
)
payBtn
=
UIButton
()
...
...
@@ -123,18 +130,18 @@ class PayDistanceViewController: UIViewController {
make
.
size
.
equalTo
(
30
)
}
offerImage
.
snp
.
makeConstraints
{
make
in
make
.
centerX
.
equalToSuperview
()
make
.
top
.
equalTo
(
kSafeAreaInsets
.
top
+
70
)
make
.
width
.
equalTo
(
111
)
make
.
height
.
equalTo
(
37
)
}
distanceL
.
snp
.
makeConstraints
{
make
in
make
.
centerX
.
equalToSuperview
()
make
.
top
.
equalTo
(
annual
.
snp
.
top
)
.
offset
(
-
115
.
RH
())
}
//
offerImage.snp.makeConstraints { make in
//
make.centerX.equalToSuperview()
//
make.top.equalTo(kSafeAreaInsets.top+70)
//
make.width.equalTo(111)
//
make.height.equalTo(37)
//
}
//
//
distanceL.snp.makeConstraints { make in
//
make.centerX.equalToSuperview()
//
make.top.equalTo(annual.snp.top).offset(-115.RH())
//
}
//
appleLabel
.
snp
.
makeConstraints
{
make
in
...
...
@@ -155,23 +162,23 @@ class PayDistanceViewController: UIViewController {
make
.
bottom
.
equalTo
(
appleLabel
.
snp
.
top
)
.
offset
(
-
24
)
}
cancelLabel
.
snp
.
makeConstraints
{
make
in
make
.
centerX
.
equalToSuperview
()
make
.
bottom
.
equalTo
(
payBtn
.
snp
.
top
)
.
offset
(
-
22
)
make
.
height
.
equalTo
(
22
)
}
yearDistacePrice
.
snp
.
makeConstraints
{
make
in
make
.
centerX
.
equalToSuperview
()
make
.
bottom
.
equalTo
(
cancelLabel
.
snp
.
top
)
.
offset
(
0
)
make
.
height
.
equalTo
(
22
)
}
annual
.
snp
.
makeConstraints
{
make
in
make
.
centerX
.
equalToSuperview
()
make
.
bottom
.
equalTo
(
yearDistacePrice
.
snp
.
top
)
.
offset
(
-
8
)
make
.
height
.
equalTo
(
22
)
}
//
cancelLabel.snp.makeConstraints { make in
//
make.centerX.equalToSuperview()
//
make.bottom.equalTo(payBtn.snp.top).offset(-22)
//
make.height.equalTo(22)
//
}
//
//
yearDistacePrice.snp.makeConstraints { make in
//
make.centerX.equalToSuperview()
//
make.bottom.equalTo(cancelLabel.snp.top).offset(0)
//
make.height.equalTo(22)
//
}
//
//
annual.snp.makeConstraints { make in
//
make.centerX.equalToSuperview()
//
make.bottom.equalTo(yearDistacePrice.snp.top).offset(-8)
//
make.height.equalTo(22)
//
}
scrollView
.
addSubview
(
termsView
)
...
...
@@ -218,21 +225,139 @@ class PayDistanceViewController: UIViewController {
let
dropW
=
CGFloat
(
300
.
RW
())
let
dropH
=
CGFloat
(
224
.
RW
())
dropImage
.
frame
=
CGRect
(
x
:
(
ScreenW
-
dropW
)
/
2
,
y
:
-
dropH
,
width
:
dropW
,
height
:
dropH
)
// dropImage.frame = CGRect(x: (ScreenW - dropW) / 2, y: -dropH, width: dropW, height: dropH)
//
// offerImage.frame = CGRect(x: (ScreenW - 111) / 2, y: -37, width: 111, height: 37)
// distanceL.frame = CGRect(x: (ScreenW - 270) / 2, y: -40, width: 270, height: 40)
// annual.frame = CGRect(x: (ScreenW - 150) / 2, y: -30, width: 150, height: 22)
// yearDistacePrice.frame = CGRect(x: (ScreenW - 200) / 2, y: -30, width: 200, height: 22)
// cancelLabel.frame = CGRect(x: (ScreenW - 150) / 2, y: -30, width: 150, height: 22)
// 添加重力动画效果
UIView
.
animate
(
withDuration
:
1.1
,
delay
:
0.2
,
usingSpringWithDamping
:
0.5
,
// 弹性系数,越小弹性越大
initialSpringVelocity
:
0.8
,
// 初始速度
options
:
.
curveEaseIn
,
animations
:
{
// 设置最终位置
self
.
dropImage
.
frame
=
CGRect
(
x
:
(
ScreenW
-
dropW
)
/
2.0
,
y
:
kSafeAreaInsets
.
top
+
129
.
RH
(),
// 根据原来的约束位置计算
width
:
dropW
,
height
:
dropH
)
},
completion
:
nil
)
self
.
offerImage
.
frame
=
CGRect
(
x
:
(
ScreenW
-
111
)
/
2
,
y
:
kSafeAreaInsets
.
top
+
70
,
width
:
111
,
height
:
37
)
self
.
distanceL
.
frame
=
CGRect
(
x
:
(
ScreenW
-
270
)
/
2
,
y
:
kSafeAreaInsets
.
top
+
CGFloat
(
129
.
RH
())
+
dropH
+
CGFloat
(
40
.
RH
()),
width
:
270
,
height
:
40
)
self
.
annual
.
frame
=
CGRect
(
x
:
(
ScreenW
-
150
)
/
2
,
y
:
self
.
distanceL
.
frame
.
maxY
+
CGFloat
(
115
.
RH
()),
width
:
150
,
height
:
22
)
self
.
yearDistacePrice
.
frame
=
CGRect
(
x
:
(
ScreenW
-
200
)
/
2
,
y
:
self
.
annual
.
frame
.
maxY
+
8
,
width
:
200
,
height
:
22
)
self
.
cancelLabel
.
frame
=
CGRect
(
x
:
(
ScreenW
-
150
)
/
2
,
y
:
self
.
yearDistacePrice
.
frame
.
maxY
,
width
:
150
,
height
:
22
)
payBtn
.
alpha
=
0
dropImage
.
alpha
=
0
offerImage
.
alpha
=
0
distanceL
.
alpha
=
0
annual
.
alpha
=
0
yearDistacePrice
.
alpha
=
0
cancelLabel
.
alpha
=
0
UIView
.
animate
(
withDuration
:
1.1
)
{
self
.
payBtn
.
alpha
=
1
self
.
dropImage
.
alpha
=
1
self
.
offerImage
.
alpha
=
1
self
.
distanceL
.
alpha
=
1
self
.
annual
.
alpha
=
1
self
.
yearDistacePrice
.
alpha
=
1
self
.
cancelLabel
.
alpha
=
1
}
// 添加重力动画效果
// UIView.animate(withDuration: 1.1,
// delay: 0.2,
// usingSpringWithDamping: 0.5, // 弹性系数,越小弹性越大
// initialSpringVelocity: 0.8, // 初始速度
// options: .curveEaseIn,
// animations: {
// // 设置最终位置
// self.dropImage.frame = CGRect(x: (ScreenW - dropW)/2.0,
// y: kSafeAreaInsets.top + 129.RH(), // 根据原来的约束位置计算
// width: dropW,
// height: dropH)
//
// self.offerImage.frame = CGRect(x: (ScreenW - 111) / 2,
// y: kSafeAreaInsets.top + 70,
// width: 111,
// height: 37)
//
// self.distanceL.frame = CGRect(x: (ScreenW - 270) / 2,
// y: kSafeAreaInsets.top + CGFloat(129.RH()) + dropH + CGFloat(40.RH()),
// width: 270,
// height: 40)
//
// self.annual.frame = CGRect(x: (ScreenW - 150) / 2,
// y: self.distanceL.frame.maxY + CGFloat(115.RH()),
// width: 150,
// height: 22)
//
// self.yearDistacePrice.frame = CGRect(x: (ScreenW - 200) / 2,
// y: self.annual.frame.maxY + 8,
// width: 200,
// height: 22)
//
// self.cancelLabel.frame = CGRect(x: (ScreenW - 150) / 2,
// y: self.yearDistacePrice.frame.maxY,
// width: 150,
// height: 22)
// }, completion: nil)
// offerImage.frame = CGRect(x: (ScreenW - 111) / 2, y: -37, width: 111, height: 37)
// distanceL.frame = CGRect(x: (ScreenW - 270) / 2, y: -40, width: 270, height: 40)
// annual.frame = CGRect(x: (ScreenW - 150) / 2, y: -30, width: 150, height: 22)
// yearDistacePrice.frame = CGRect(x: (ScreenW - 200) / 2, y: -30, width: 200, height: 22)
// cancelLabel.frame = CGRect(x: (ScreenW - 150) / 2, y: -30, width: 150, height: 22)
//
// // 添加下落动画
// UIView.animate(withDuration: 0.3,
// delay: 0, // 稍微延迟一点,让动画错开
// options: .curveEaseOut) {
// // 设置最终位置
// self.offerImage.frame = CGRect(x: (ScreenW - 111) / 2,
// y: kSafeAreaInsets.top + 70,
// width: 111,
// height: 37)
//
// self.distanceL.frame = CGRect(x: (ScreenW - 270) / 2,
// y: kSafeAreaInsets.top + CGFloat(129.RH()) + dropH + CGFloat(40.RH()),
// width: 270,
// height: 40)
//
// self.annual.frame = CGRect(x: (ScreenW - 150) / 2,
// y: self.distanceL.frame.maxY + CGFloat(115.RH()),
// width: 150,
// height: 22)
//
// self.yearDistacePrice.frame = CGRect(x: (ScreenW - 200) / 2,
// y: self.annual.frame.maxY + 8,
// width: 200,
// height: 22)
//
// self.cancelLabel.frame = CGRect(x: (ScreenW - 150) / 2,
// y: self.yearDistacePrice.frame.maxY,
// width: 150,
// height: 22)
//
// }
// 添加呼吸动画
...
...
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