|
@@ -9,16 +9,21 @@ struct SettingPurchaseTopView: View {
|
|
|
var eventPublisher: ListEventPublisher
|
|
|
@Binding var vipType: PremiumPeriod
|
|
|
var body: some View {
|
|
|
+#if DEBUG
|
|
|
+// let vipType = PremiumPeriod.week
|
|
|
+#endif
|
|
|
let topW = k_ScreenWidth-32
|
|
|
let topH = 134.0 //kGetScaleHeight(originalSize: CGSize(width: 343, height: 130), width: topW)
|
|
|
- let updateText = vipType == .week ? "Upgrade Yearly Pro".localized : "Update to PRO".localized
|
|
|
+ let updateText = vipType == .week ? "Upgrade Yearly Pro".localized : "Upgrade to PRO".localized
|
|
|
+ let timeString = "Due Date:".localized + " \(PurchaseManager.default.expiredDateString)"
|
|
|
+ let timeText = vipType == .week ? timeString : "Limited Time Discount".localized
|
|
|
ZStack {
|
|
|
Image(.settingVipBj).resizable().cornerRadius(16.0)
|
|
|
if vipType == .year {
|
|
|
VStack(alignment: .center) {
|
|
|
customGradientText(text: "\(kAppName) pro", font: .font(name: .PoppinsBoldItalic,size: 36))
|
|
|
- Spacer().frame(height: 16)
|
|
|
- Text("Due Date:".localized + " \(PurchaseManager.default.expiredDateString)")
|
|
|
+ Spacer().frame(height: 20)//16
|
|
|
+ Text(timeString)
|
|
|
.foregroundColor(.white.opacity(0.6))
|
|
|
.font(.font(size: 14,weight: .medium))
|
|
|
.frame(height: 14)
|
|
@@ -27,9 +32,9 @@ struct SettingPurchaseTopView: View {
|
|
|
VStack(){
|
|
|
HStack {
|
|
|
VStack(alignment: .leading,spacing: 8) {
|
|
|
- customGradientText(text: updateText, font: .font(name: .PoppinsBoldItalic,size: 22),colors: [.white]).frame(height: 26)
|
|
|
+ customGradientText(text: updateText, font: .font(name: .PoppinsBoldItalic,size: 22),colors: [.white]).frame(width: 230.0*kDesignScale,height: 26,alignment: .leading)
|
|
|
HStack {
|
|
|
- Text("Limited Time Discount".localized)
|
|
|
+ Text(timeText)
|
|
|
.font(.font(size: 14))
|
|
|
.frame(height: 14)
|
|
|
.foregroundColor(UIColor.white.withAlphaComponent(0.6).color)
|
|
@@ -40,12 +45,14 @@ struct SettingPurchaseTopView: View {
|
|
|
Spacer()
|
|
|
|
|
|
Text("Save-Vip".localized + " 80%")
|
|
|
+ .lineLimit(1)
|
|
|
.foregroundColor(Color.white)
|
|
|
.font(.font(size: 12,weight: .semibold))
|
|
|
- .frame(width: 82, height: 28, alignment: .center)
|
|
|
+ .frame(width: 82*kDesignScale, height: 28, alignment: .center)
|
|
|
.foregroundColor("#010101".uiColor.color)
|
|
|
.background(Color.hex("#E83E3E"))
|
|
|
.cornerRadius(4.0)
|
|
|
+ .minimumScaleFactor(0.5)
|
|
|
.rotationEffect(.degrees(15)) // 向右旋转45度
|
|
|
}
|
|
|
|
|
@@ -66,33 +73,18 @@ struct SettingPurchaseTopView: View {
|
|
|
|
|
|
}.frame(width: topW, height: topH)
|
|
|
}
|
|
|
-
|
|
|
- // 定义一个返回 View 的方法
|
|
|
- func customText(text:String,fontName:FontName,color:Color) -> some View {
|
|
|
- let gorgeousColor = color //UIColor.themeColor.color
|
|
|
- return Text(text)
|
|
|
- .font(.font(name: fontName,size: 36))
|
|
|
-// .gradientForeground(
|
|
|
-// colors: [gorgeousColor,gorgeousColor],
|
|
|
-// startPoint: UnitPoint.leading,
|
|
|
-// endPoint: UnitPoint.trailing
|
|
|
-// )
|
|
|
-// .shadow(color: gorgeousColor.opacity(0.7), radius: 6, x: 0, y: 0)
|
|
|
- .foregroundColor(gorgeousColor)
|
|
|
- .frame(height: 20)
|
|
|
-// .minimumScaleFactor(0.5) // 最小缩放比例(0.5表示最小可缩放到初始大小的50%)
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
func customGradientText(text:String,font:Font,colors:[Color] = [.hex("#FA794F"),.hex("#F8C32A"),.hex("#FEFBF4")]) -> some View {
|
|
|
return Text(text)
|
|
|
+ .lineLimit(1)
|
|
|
.font(font)
|
|
|
.gradientForeground(
|
|
|
colors: colors,
|
|
|
startPoint: UnitPoint.leading,
|
|
|
endPoint: UnitPoint.trailing
|
|
|
)
|
|
|
+ .minimumScaleFactor(0.5)
|
|
|
// .shadow(color: gorgeousColor.opacity(0.7), radius: 6, x: 0, y: 0)
|
|
|
- .frame(height: 20)
|
|
|
}
|
|
|
|
|
|
// 定义一个返回 View 的方法
|