[] 더보기 페이지 그리기 완료

This commit is contained in:
Seonkyu_Kim 2025-02-14 10:16:20 +09:00
parent f75751670c
commit c6f224a9d9
15 changed files with 121 additions and 50 deletions

View File

@ -14,26 +14,34 @@ struct HomeView: View {
@State private var topViewState: Bool = false @State private var topViewState: Bool = false
//MARK: - //MARK: -
@State private var myType: UserType = .Student // @State private var myType: UserType = .Student
@Binding var myType: UserType
var body: some View { var body: some View {
VStack(spacing: 0) { VStack(spacing: 0) {
ZStack { ZStack {
OffsetObservableScrollView(showsIndicators: false, scrollOffset: $scrollOffset) { proxy in if !topViewState {
VStack(spacing: 0) { VStack {
Rectangle()
.foregroundStyle(Color(.Other.cell))
.frame(height: 100 + (scrollOffset.y < 0 ? scrollOffset.y * -1 : 0))
.frame(maxWidth: .infinity)
.edgesIgnoringSafeArea(.all)
Spacer(minLength: 1)
}
}
TopProfileView(userType: .Student) OffsetObservableScrollView(showsIndicators: false, scrollOffset: $scrollOffset) { proxy in
.padding(.bottom,12) VStack(spacing: 24) {
TopProfileView(myType: myType)
Group { Group {
AttendanceBoxView() AttendanceBoxView()
// CalendarBoxView(summaryCalDataList: [])
CalendarBoxView(summaryCalDataList: [ CalendarBoxView(summaryCalDataList: [
SummaryCalendar(id: "123", date: "2025-02-28", summary: "요약내용입니다."), SummaryCalendar(id: "123", date: "2025-02-28", summary: "요약내용입니다."),
SummaryCalendar(id: "123", date: "2025-02-28", summary: "요약내용입니다.")]) SummaryCalendar(id: "123", date: "2025-02-28", summary: "요약내용입니다.")])
// ManagementBoxView(managementList: [])
ManagementBoxView(managementList: [ ManagementBoxView(managementList: [
SummaryManagement(id: "01", title: "과목 명1", teacher: "A", ratio: 27, homework: 3), SummaryManagement(id: "01", title: "과목 명1", teacher: "A", ratio: 27, homework: 3),
SummaryManagement(id: "02", title: "과목 명2", teacher: "B", ratio: 80, homework: 10), SummaryManagement(id: "02", title: "과목 명2", teacher: "B", ratio: 80, homework: 10),
@ -41,7 +49,6 @@ struct HomeView: View {
SummaryManagement(id: "04", title: "과목 명4", teacher: "D", ratio: 72, homework: 0), SummaryManagement(id: "04", title: "과목 명4", teacher: "D", ratio: 72, homework: 0),
]) ])
// NoticeBoxView(noticeList: [])
NoticeBoxView(noticeList: [ NoticeBoxView(noticeList: [
SummaryNotice(id: "00", title: "공지사항1", date: "2025-02-11", new: true), SummaryNotice(id: "00", title: "공지사항1", date: "2025-02-11", new: true),
SummaryNotice(id: "01", title: "공지사항2", date: "2025-01-11", new: false), SummaryNotice(id: "01", title: "공지사항2", date: "2025-01-11", new: false),
@ -62,8 +69,7 @@ struct HomeView: View {
RoundedRectangle(cornerRadius: 8) RoundedRectangle(cornerRadius: 8)
.foregroundStyle(Color(.Other.cell)) .foregroundStyle(Color(.Other.cell))
} }
.padding(EdgeInsets(top: 12, leading: 24, bottom: 12, trailing: 24)) .padding([.leading, .trailing], 24)
} }
} }
@ -79,6 +85,8 @@ struct HomeView: View {
} }
.frame(maxWidth: .infinity, maxHeight: .infinity) .frame(maxWidth: .infinity, maxHeight: .infinity)
.onAppear { .onAppear {
// MARK: TO-DO
//
topVM.titleName = "Name" topVM.titleName = "Name"
if myType == .Student { if myType == .Student {

View File

@ -10,7 +10,7 @@ import SwiftUI
struct TopProfileView: View { struct TopProfileView: View {
@StateObject var btnVM = ButtonViewModel() @StateObject var btnVM = ButtonViewModel()
var userType: UserType var myType: UserType
// MARK: TO-DO // MARK: TO-DO
// //
@ -68,7 +68,7 @@ struct TopProfileView: View {
// MARK: TO-DO // MARK: TO-DO
// //
if userType == .Parent { if myType == .Parent {
HStack(spacing: 0) { HStack(spacing: 0) {
ForEach(Array(childIDList.enumerated()),id: \.offset){ index, id in ForEach(Array(childIDList.enumerated()),id: \.offset){ index, id in
CircleBtnView(vm: btnVM, id: id) CircleBtnView(vm: btnVM, id: id)
@ -95,7 +95,7 @@ struct TopProfileView: View {
// //
switch self.userType { switch self.myType {
case .Student: case .Student:
typeName = "학생" typeName = "학생"
case .Parent: case .Parent:

View File

@ -17,16 +17,30 @@ struct ChattingView: View {
TopView(topVM: topVM) TopView(topVM: topVM)
OffsetObservableScrollView(showsIndicators: false, scrollOffset: $scrollOffset) { proxy in OffsetObservableScrollView(showsIndicators: false, scrollOffset: $scrollOffset) { proxy in
VStack(spacing: 24) {
Group {
DashBoardView(image: Image(.Icon.group), title: "클래스") {
}
DashBoardView(image: Image(.Icon.talk), title: "선생님과 1:1") {
}
}
.background {
RoundedRectangle(cornerRadius: 8)
.foregroundStyle(Color(.Other.cell))
}
}
.padding(24)
} }
.frame(maxWidth: .infinity, maxHeight: .infinity) .frame(maxWidth: .infinity, maxHeight: .infinity)
} }
.onAppear { .onAppear {
topVM.titleName = "" topVM.titleName = ""
topVM.setLeftBtn(size: CGPoint(x: 40, y: 40), action: leftAct) topVM.setLeftBtn(size: CGPoint(x: 40, y: 40), action: leftAct)
topVM.setRightBtn(size: CGPoint(x: 40, y: 40), action: rightAct) topVM.setRightBtn(size: CGPoint(x: 40, y: 40), action: rightAct)
} }
} }

View File

@ -19,7 +19,7 @@ struct AppInfoView: View {
.frame(width: 40, height: 40, alignment: .center) .frame(width: 40, height: 40, alignment: .center)
.padding(.trailing, 12) .padding(.trailing, 12)
Text("설치 버전: \(currentVer)") Text("설치 버전: \(currentVer)")
.font(.nps(font: .bold, size: 20)) .font(.nps(font: .bold, size: 16))
.foregroundStyle(Color(.Text.detail)) .foregroundStyle(Color(.Text.detail))
Spacer(minLength: 1) Spacer(minLength: 1)
if currentVer == finalVer { if currentVer == finalVer {

View File

@ -8,40 +8,45 @@
import SwiftUI import SwiftUI
struct DevInfoView: View { struct DevInfoView: View {
private var attributeText: AttributedString {
let longText = """
> > 1:1 .
"""
var attributeText = AttributedString(longText)
attributeText.font = .nps(size: 8)
if let range = attributeText.range(of: "더보기 > 고객센터 > 1:1 문의") {
attributeText[range].font = .nps(font: .bold, size: 8)
}
return attributeText
}
var body: some View { var body: some View {
VStack(alignment: .leading, spacing: 24) { VStack(alignment: .leading, spacing: 24) {
Text("""
Text(attributeText)
> > 1:1 .
""")
.font(.nps(size: 8))
.foregroundStyle(Color(.Text.detail)) .foregroundStyle(Color(.Text.detail))
.lineLimit(2) .lineLimit(2)
.multilineTextAlignment(.center) .multilineTextAlignment(.center)
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center) .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center)
// .padding([.leading,.trailing],24)
Image(.Logo.appIcon).resizable()
.frame(width: 40, height: 40,alignment: .leading)
.background(
RoundedRectangle(cornerRadius: 8)
.frame(width: 40, height: 40,alignment: .leading)
.foregroundStyle(Color(.Normal.light))
)
VStack(alignment: .leading, spacing: 12){ VStack(alignment: .leading, spacing: 12){
Text("AcaMate") HStack(alignment: .center, spacing: 8) {
.font(.nps(font: .bold, size: 16)) Image(.Logo.appIcon).resizable()
.foregroundStyle(Color(.Text.detail)) .frame(width: 40, height: 40,alignment: .leading)
Text("AcaMate")
VStack(spacing: 4) { .font(.nps(font: .bold, size: 16))
Text("문의: sean.kk@daum.net")
.font(.nps(size: 12))
.foregroundStyle(Color(.Text.detail))
Text("문의: sean.kk@daum.net")
.font(.nps(size: 12))
.foregroundStyle(Color(.Text.detail)) .foregroundStyle(Color(.Text.detail))
} }
// MARK: TO-DO
//
Text(verbatim:"""
: sean.kk@daum.net
: sean.kk@daum.net
""")
.font(.nps(size: 12))
.foregroundStyle(Color(.Text.detail))
} }

View File

@ -9,10 +9,9 @@ import SwiftUI
struct EtcView: View { struct EtcView: View {
@StateObject private var topVM = TopViewModel() @StateObject private var topVM = TopViewModel()
@State private var scrollOffset: CGPoint = .zero @State private var scrollOffset: CGPoint = .zero
@Binding var myType: UserType
var body: some View { var body: some View {
VStack(spacing: 0) { VStack(spacing: 0) {
@ -21,7 +20,7 @@ struct EtcView: View {
OffsetObservableScrollView(showsIndicators: false, scrollOffset: $scrollOffset) { proxy in OffsetObservableScrollView(showsIndicators: false, scrollOffset: $scrollOffset) { proxy in
VStack(spacing: 24) { VStack(spacing: 24) {
UserInfoView(userData: SummaryUser(profile: Image(.Icon.face), name: "이름", userID: "abcdefg", email: "abcdefg@gmail.com")) UserInfoView(userData: SummaryUser(profile: Image(.Icon.face), name: "이름", userID: "abcdefg", email: "abcdefg@gmail.com"))
UserSettingView() UserSettingView(myType: myType)
CsCenterView() CsCenterView()
TsCsView() TsCsView()
AppInfoView() AppInfoView()

View File

@ -8,6 +8,8 @@
import SwiftUI import SwiftUI
struct UserSettingView: View { struct UserSettingView: View {
var myType: UserType
var body: some View { var body: some View {
EtcBoxView(title: "설정") { EtcBoxView(title: "설정") {
VStack(spacing: 0){ VStack(spacing: 0){
@ -24,6 +26,17 @@ struct UserSettingView: View {
// //
printLog("계정 관리 이동") printLog("계정 관리 이동")
} }
if myType == .Admin {
DashedDivider()
EtcCellView(title: "관리자 페이지") {
// MARK: TO-DO
//
printLog("관리자 페이지 이동")
}
}
} }
} }
} }

View File

@ -14,13 +14,15 @@ struct MainView: View {
@State var cancellables: Set<AnyCancellable> = [] @State var cancellables: Set<AnyCancellable> = []
@Binding var naviState : NaviState @Binding var naviState : NaviState
@State private var myType: UserType = .Student
var body: some View { var body: some View {
VStack(spacing: 0) { VStack(spacing: 0) {
Group { Group {
switch appVM.menuName { switch appVM.menuName {
case .Home: case .Home:
HomeView() HomeView(myType: $myType)
case .Management: case .Management:
ManagementView() ManagementView()
case .Chatting: case .Chatting:
@ -28,10 +30,10 @@ struct MainView: View {
case .Calendar: case .Calendar:
CalendarView() CalendarView()
case .Etc: case .Etc:
EtcView() EtcView(myType: $myType)
} }
} }
Spacer(minLength: 1) // Spacer(minLength: 1)
BottomView() BottomView()
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity)

View File

@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "Group.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "Talk.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B