TSSettingListView.swift 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //
  2. // SettingListView.swift
  3. // AIEmoji
  4. //
  5. // Created by 100Years on 2025/1/16.
  6. //
  7. import SwiftUI
  8. struct TSSettingListView: View {
  9. @ObservedObject var viewModel: TSSetingViewModel
  10. var publisher: ListEventPublisher
  11. var body: some View {
  12. ZStack {
  13. Color.clear
  14. VStack(spacing: 0) {
  15. Spacer().frame(height: 16)
  16. SettingPurchaseTopView(eventPublisher: publisher, isViper: $viewModel.isViper)
  17. .frame(height: 117*kDesignScale)
  18. .onTapGesture {
  19. if PurchaseManager.default.isVip {
  20. return
  21. }
  22. publisher.enterPurchasePublisher.send(true)
  23. }
  24. ForEach(viewModel.settingTypes, id:\.self) { type in
  25. Spacer().frame(height: 16)
  26. SettingListItemView(type: type)
  27. .onTapGesture {
  28. publisher.settingPublisher.send(type)
  29. }
  30. }
  31. Spacer()
  32. }
  33. .padding(.horizontal)
  34. }
  35. }
  36. }
  37. struct SettingListItemView: View {
  38. var type : SettingType
  39. var body: some View {
  40. ZStack {
  41. Color.white.opacity(0.1)
  42. HStack {
  43. Text(type.rawValue).font(.font(size: 16.0)).foregroundColor(.white)
  44. Spacer()
  45. if type != .about {
  46. Image(.whiteRightArrow)
  47. }else{
  48. Text(appVersion()).foregroundColor(.hex("#FFFFFF").opacity(0.4)).font(.font(size: 16))
  49. }
  50. }.padding(.horizontal)
  51. }
  52. .frame(height: 64)
  53. .cornerRadius(16)
  54. // .cornerRadius(.allCorners, 16)
  55. }
  56. }