|
@@ -74,9 +74,10 @@ class TSPurchaseVC: TSBaseVC {
|
|
}()
|
|
}()
|
|
|
|
|
|
lazy var hostVc: UIHostingController<PurchaseView> = {
|
|
lazy var hostVc: UIHostingController<PurchaseView> = {
|
|
- if PurchaseManager.default.vipType == .none {
|
|
|
|
- viewModel.selectedType = .month
|
|
|
|
- }
|
|
|
|
|
|
+ //增加月付费
|
|
|
|
+// if PurchaseManager.default.vipType == .none {
|
|
|
|
+// viewModel.selectedType = .month
|
|
|
|
+// }
|
|
|
|
|
|
let vc = UIHostingController(rootView: PurchaseView(viewModel: viewModel))
|
|
let vc = UIHostingController(rootView: PurchaseView(viewModel: viewModel))
|
|
vc.view.backgroundColor = .clear
|
|
vc.view.backgroundColor = .clear
|
|
@@ -349,8 +350,12 @@ struct PurchaseView :View {
|
|
|
|
|
|
if vipType == .none {
|
|
if vipType == .none {
|
|
ZStack(alignment: .topTrailing) {
|
|
ZStack(alignment: .topTrailing) {
|
|
- PurchaseItemView(title: "One Month".localized, type: .month, selectedType: $viewModel.selectedType).onTapGesture {
|
|
|
|
- viewModel.selectedType = .month
|
|
|
|
|
|
+// //增加月付费
|
|
|
|
+// PurchaseItemView(title: "One Month".localized, type: .month, selectedType: $viewModel.selectedType).onTapGesture {
|
|
|
|
+// viewModel.selectedType = .month
|
|
|
|
+ PurchaseItemView(title: "One Year".localized, type: .year, selectedType: $viewModel.selectedType).onTapGesture {
|
|
|
|
+ viewModel.selectedType = .year
|
|
|
|
+
|
|
viewModel.buyPublisher.send(true)
|
|
viewModel.buyPublisher.send(true)
|
|
}
|
|
}
|
|
TSVipRecView(save: vipType.saveString)
|
|
TSVipRecView(save: vipType.saveString)
|
|
@@ -451,7 +456,7 @@ struct PurchaseItemView: View {
|
|
|
|
|
|
HStack {
|
|
HStack {
|
|
Text(PurchaseManager.default.price(for: type) ?? "--").font(.font(size: 18,weight: .medium)).foregroundColor(UIColor.mainText.color)
|
|
Text(PurchaseManager.default.price(for: type) ?? "--").font(.font(size: 18,weight: .medium)).foregroundColor(UIColor.mainText.color)
|
|
- if type == .month {
|
|
|
|
|
|
+ if type == .year { //.month {//增加月付费
|
|
Text(" (≈\(PurchaseManager.default.averageWeekly(for:type) ?? "--")/\("Per week".localized))").font(.font(size: 12,weight: .medium)).foregroundColor(UIColor.mainText.withAlphaComponent(0.6).color)
|
|
Text(" (≈\(PurchaseManager.default.averageWeekly(for:type) ?? "--")/\("Per week".localized))").font(.font(size: 12,weight: .medium)).foregroundColor(UIColor.mainText.withAlphaComponent(0.6).color)
|
|
}
|
|
}
|
|
}
|
|
}
|