1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- //
- // SettingListView.swift
- // AIEmoji
- //
- // Created by 100Years on 2025/1/16.
- //
- import SwiftUI
- struct TSSettingListView: View {
- @ObservedObject var viewModel: TSSetingViewModel
- var publisher: ListEventPublisher
- var body: some View {
- ScrollView {
- // Color.clear
- VStack(spacing: 0) {
- Spacer().frame(height: 16)
-
- SettingPurchaseTopView(eventPublisher: publisher, isViper: $viewModel.isViper)
- .frame(height: 117*kDesignScale)
- .onTapGesture {
- if PurchaseManager.default.isVip {
- return
- }
- publisher.enterPurchasePublisher.send(true)
- }
-
- ForEach(viewModel.settingTypes, id:\.self) { type in
- Spacer().frame(height: 16)
- SettingListItemView(type: type,viewModel: viewModel)
- .onTapGesture {
- publisher.settingPublisher.send(type)
- }
- }
-
- Spacer()
- }
- .padding(.horizontal)
- Spacer().frame(height: 20)
- }
- }
- }
- struct SettingListItemView: View {
- var type : SettingType
- var viewModel: TSSetingViewModel
- var body: some View {
-
- ZStack {
- Color.white.opacity(0.1)
- HStack {
- Text(type.rawValue.localized).font(.font(size: 16.0)).foregroundColor(.white)
- Spacer()
- // if type != .about {
- // Image(.whiteRightArrow)
- // }else{
- // Text(appVersion()).foregroundColor(.hex("#FFFFFF").opacity(0.4)).font(.font(size: 16))
- // }
-
- if type == .update {
- if viewModel.isHaveNewVersion {
- Color.hex("#FECB34").frame(width: 4, height: 4).cornerRadius(2)
- Spacer().frame(width: 4)
- }
- Text(appVersion()).foregroundColor(.hex("#FFFFFF").opacity(0.4)).font(.font(size: 16))
- }
-
- Image(.whiteRightArrow)
- }.padding(.horizontal)
- }
- .frame(height: 64)
- .cornerRadius(16)
- // .cornerRadius(.allCorners, 16)
- }
- }
|