콘텐츠 메인, 라이브 메인, 오디션 메인, 마이페이지

- 로그인 하지 않고 페이지 조회가 되도록 수정
This commit is contained in:
Yu Sung
2025-03-24 18:32:27 +09:00
parent fa94c5447f
commit 80cb19a1c7
32 changed files with 874 additions and 595 deletions

View File

@@ -20,165 +20,168 @@ struct SettingsView: View {
GeometryReader { geo in
VStack(spacing: 0) {
DetailNavigationBar(title: "설정")
VStack(spacing: 0) {
HStack(spacing: 0) {
Text("공지사항")
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(Color.grayee)
Spacer()
Image("ic_forward")
.resizable()
.frame(width: 20, height: 20)
}
.padding(.horizontal, 3.3)
.frame(width: cardWidth - 26.7, height: 50)
.contentShape(Rectangle())
.onTapGesture {
AppState.shared.setAppStep(step: .notices)
}
Rectangle()
.frame(width: cardWidth - 26.7, height: 0.3)
.foregroundColor(Color.gray90)
HStack(spacing: 0) {
Text("이벤트")
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(Color.grayee)
Spacer()
Image("ic_forward")
.resizable()
.frame(width: 20, height: 20)
}
.padding(.horizontal, 3.3)
.frame(width: cardWidth - 26.7, height: 50)
.contentShape(Rectangle())
.onTapGesture {
AppState.shared.setAppStep(step: .events)
}
Rectangle()
.frame(width: cardWidth - 26.7, height: 0.3)
.foregroundColor(Color.gray90)
HStack(spacing: 0) {
Text("알림 설정")
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(Color.grayee)
Spacer()
Image("ic_forward")
.resizable()
.frame(width: 20, height: 20)
}
.padding(.horizontal, 3.3)
.frame(width: cardWidth - 26.7, height: 50)
.contentShape(Rectangle())
.onTapGesture {
AppState.shared.setAppStep(step: .notificationSettings)
}
}
.padding(.horizontal, 13.3)
.frame(width: cardWidth)
.background(Color.gray22)
.cornerRadius(6.7)
.padding(.top, 26.7)
if UserDefaults.bool(forKey: .auth) {
HStack(spacing: 0) {
Text("콘텐츠 보기 설정")
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(Color.grayee)
ScrollView(.vertical, showsIndicators: false) {
VStack(spacing: 0) {
VStack(spacing: 0) {
HStack(spacing: 0) {
Text("공지사항")
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(Color.grayee)
Spacer()
Image("ic_forward")
.resizable()
.frame(width: 20, height: 20)
}
.padding(.horizontal, 3.3)
.frame(width: cardWidth - 26.7, height: 50)
.contentShape(Rectangle())
.onTapGesture {
AppState.shared.setAppStep(step: .notices)
}
Rectangle()
.frame(width: cardWidth - 26.7, height: 0.3)
.foregroundColor(Color.gray90)
HStack(spacing: 0) {
Text("이벤트")
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(Color.grayee)
Spacer()
Image("ic_forward")
.resizable()
.frame(width: 20, height: 20)
}
.padding(.horizontal, 3.3)
.frame(width: cardWidth - 26.7, height: 50)
.contentShape(Rectangle())
.onTapGesture {
AppState.shared.setAppStep(step: .events)
}
Rectangle()
.frame(width: cardWidth - 26.7, height: 0.3)
.foregroundColor(Color.gray90)
HStack(spacing: 0) {
Text("알림 설정")
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(Color.grayee)
Spacer()
Image("ic_forward")
.resizable()
.frame(width: 20, height: 20)
}
.padding(.horizontal, 3.3)
.frame(width: cardWidth - 26.7, height: 50)
.contentShape(Rectangle())
.onTapGesture {
AppState.shared.setAppStep(step: .notificationSettings)
}
}
.padding(.horizontal, 13.3)
.frame(width: cardWidth)
.background(Color.gray22)
.cornerRadius(6.7)
.padding(.top, 26.7)
Spacer()
if UserDefaults.bool(forKey: .auth) {
HStack(spacing: 0) {
Text("콘텐츠 보기 설정")
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(Color.grayee)
Spacer()
Image("ic_forward")
.resizable()
.frame(width: 20, height: 20)
}
.padding(.horizontal, 16.7)
.frame(width: cardWidth, height: 50)
.background(Color.gray22)
.cornerRadius(6.7)
.contentShape(Rectangle())
.padding(.top, 13.3)
.onTapGesture {
AppState.shared.setAppStep(step: .contentViewSettings)
}
}
Image("ic_forward")
.resizable()
.frame(width: 20, height: 20)
}
.padding(.horizontal, 16.7)
.frame(width: cardWidth, height: 50)
.background(Color.gray22)
.cornerRadius(6.7)
.contentShape(Rectangle())
.padding(.top, 13.3)
.onTapGesture {
AppState.shared.setAppStep(step: .contentViewSettings)
}
}
VStack(spacing: 0) {
HStack(spacing: 0) {
Text("이용약관")
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(Color.grayee)
VStack(spacing: 0) {
HStack(spacing: 0) {
Text("이용약관")
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(Color.grayee)
Spacer()
Image("ic_forward")
.resizable()
.frame(width: 20, height: 20)
}
.padding(.horizontal, 3.3)
.frame(width: cardWidth - 26.7, height: 50)
.contentShape(Rectangle())
.onTapGesture {
AppState.shared.setAppStep(step: .terms)
}
Rectangle()
.frame(width: cardWidth - 26.7, height: 0.3)
.foregroundColor(Color.gray90)
HStack(spacing: 0) {
Text("개인정보처리방침")
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(Color.grayee)
Spacer()
Image("ic_forward")
.resizable()
.frame(width: 20, height: 20)
}
.padding(.horizontal, 3.3)
.frame(width: cardWidth - 26.7, height: 50)
.contentShape(Rectangle())
.onTapGesture {
AppState.shared.setAppStep(step: .privacy)
}
}
.padding(.horizontal, 13.3)
.frame(width: cardWidth)
.background(Color.gray22)
.cornerRadius(6.7)
.padding(.top, 13.3)
Spacer()
HStack(spacing: 0) {
Text("앱 버전 정보")
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(Color.grayee)
Spacer()
let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
Text("Ver \(version!)")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color.grayee)
}
.padding(.horizontal, 16.7)
.frame(width: cardWidth, height: 50)
.background(Color.gray22)
.cornerRadius(6.7)
.padding(.top, 13.3)
Image("ic_forward")
.resizable()
.frame(width: 20, height: 20)
}
.padding(.horizontal, 3.3)
.frame(width: cardWidth - 26.7, height: 50)
.contentShape(Rectangle())
.onTapGesture {
AppState.shared.setAppStep(step: .terms)
}
Rectangle()
.frame(width: cardWidth - 26.7, height: 0.3)
.foregroundColor(Color.gray90)
HStack(spacing: 0) {
Text("개인정보처리방침")
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(Color.grayee)
Spacer()
Image("ic_forward")
.resizable()
.frame(width: 20, height: 20)
}
.padding(.horizontal, 3.3)
.frame(width: cardWidth - 26.7, height: 50)
.contentShape(Rectangle())
.onTapGesture {
AppState.shared.setAppStep(step: .privacy)
}
}
.padding(.horizontal, 13.3)
.frame(width: cardWidth)
.background(Color.gray22)
.cornerRadius(6.7)
.padding(.top, 13.3)
HStack(spacing: 0) {
Text("앱 버전 정보")
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(Color.grayee)
Spacer()
let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
Text("Ver \(version!)")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color.grayee)
}
.padding(.horizontal, 16.7)
.frame(width: cardWidth, height: 50)
.background(Color.gray22)
.cornerRadius(6.7)
.padding(.top, 13.3)
Text("""
Text("""
- 회사명 : 주식회사 소다라이브
- 대표자 : 이재형
@@ -193,39 +196,40 @@ struct SettingsView: View {
- 대표 이메일 : sodalive.official@gmail.com
""")
.font(.custom(Font.medium.rawValue, size: 11))
.foregroundColor(Color.gray77)
.frame(width: cardWidth, alignment: .leading)
.padding(.top, 13.3)
Spacer()
Text("로그아웃")
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(Color.grayee)
.frame(width: cardWidth, height: 50)
.background(Color.gray22)
.cornerRadius(6.7)
.onTapGesture {
isShowLogoutDialog = true
}
Text("모든 기기에서 로그아웃")
.font(.custom(Font.medium.rawValue, size: 14.7))
.foregroundColor(Color.gray77)
.padding(.top, 13.3)
.onTapGesture {
isShowLogoutAllDeviceDialog = true
}
Text("회원탈퇴")
.font(.custom(Font.medium.rawValue, size: 14.7))
.foregroundColor(Color.gray77)
.underline()
.padding(.vertical, 26.7)
.onTapGesture {
AppState.shared.setAppStep(step: .signOut)
.font(.custom(Font.medium.rawValue, size: 11))
.foregroundColor(Color.gray77)
.frame(width: cardWidth, alignment: .leading)
.padding(.top, 13.3)
Text("로그아웃")
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(Color.grayee)
.frame(width: cardWidth, height: 50)
.background(Color.gray22)
.cornerRadius(6.7)
.onTapGesture {
isShowLogoutDialog = true
}
.padding(.top, 46.7)
Text("모든 기기에서 로그아웃")
.font(.custom(Font.medium.rawValue, size: 14.7))
.foregroundColor(Color.gray77)
.padding(.top, 13.3)
.onTapGesture {
isShowLogoutAllDeviceDialog = true
}
Text("회원탈퇴")
.font(.custom(Font.medium.rawValue, size: 14.7))
.foregroundColor(Color.gray77)
.underline()
.padding(.vertical, 26.7)
.onTapGesture {
AppState.shared.setAppStep(step: .signOut)
}
}
}
}
}
@@ -239,8 +243,9 @@ struct SettingsView: View {
ContentPlayerPlayManager.shared.resetPlayer()
viewModel.logout {
self.isShowLogoutDialog = false
AppState.shared.setAppStep(step: .main)
UserDefaults.reset()
AppState.shared.isChangeAdultContentVisible = true
AppState.shared.setAppStep(step: .splash)
}
},
cancelButtonTitle: "취소",
@@ -260,8 +265,9 @@ struct SettingsView: View {
ContentPlayerPlayManager.shared.resetPlayer()
viewModel.logoutAllDevice {
self.isShowLogoutAllDeviceDialog = false
AppState.shared.setAppStep(step: .main)
UserDefaults.reset()
AppState.shared.isChangeAdultContentVisible = true
AppState.shared.setAppStep(step: .splash)
}
},
cancelButtonTitle: "취소",

View File

@@ -56,6 +56,7 @@ final class SignOutViewModel: ObservableObject {
if decoded.success {
UserDefaults.reset()
AppState.shared.isChangeAdultContentVisible = true
AppState.shared.setAppStep(step: .splash)
} else {
if let message = decoded.message {