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

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
//MARK: -
@State private var myType: UserType = .Student
// @State private var myType: UserType = .Student
@Binding var myType: UserType
var body: some View {
VStack(spacing: 0) {
ZStack {
OffsetObservableScrollView(showsIndicators: false, scrollOffset: $scrollOffset) { proxy in
VStack(spacing: 0) {
if !topViewState {
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)
.padding(.bottom,12)
OffsetObservableScrollView(showsIndicators: false, scrollOffset: $scrollOffset) { proxy in
VStack(spacing: 24) {
TopProfileView(myType: myType)
Group {
AttendanceBoxView()
// CalendarBoxView(summaryCalDataList: [])
CalendarBoxView(summaryCalDataList: [
SummaryCalendar(id: "123", date: "2025-02-28", summary: "요약내용입니다."),
SummaryCalendar(id: "123", date: "2025-02-28", summary: "요약내용입니다.")])
// ManagementBoxView(managementList: [])
ManagementBoxView(managementList: [
SummaryManagement(id: "01", title: "과목 명1", teacher: "A", ratio: 27, homework: 3),
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),
])
// NoticeBoxView(noticeList: [])
NoticeBoxView(noticeList: [
SummaryNotice(id: "00", title: "공지사항1", date: "2025-02-11", new: true),
SummaryNotice(id: "01", title: "공지사항2", date: "2025-01-11", new: false),
@ -62,8 +69,7 @@ struct HomeView: View {
RoundedRectangle(cornerRadius: 8)
.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)
.onAppear {
// MARK: TO-DO
//
topVM.titleName = "Name"
if myType == .Student {

View File

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

View File

@ -17,16 +17,30 @@ struct ChattingView: View {
TopView(topVM: topVM)
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)
}
.onAppear {
topVM.titleName = ""
topVM.setLeftBtn(size: CGPoint(x: 40, y: 40), action: leftAct)
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)
.padding(.trailing, 12)
Text("설치 버전: \(currentVer)")
.font(.nps(font: .bold, size: 20))
.font(.nps(font: .bold, size: 16))
.foregroundStyle(Color(.Text.detail))
Spacer(minLength: 1)
if currentVer == finalVer {

View File

@ -8,40 +8,45 @@
import SwiftUI
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 {
VStack(alignment: .leading, spacing: 24) {
Text("""
> > 1:1 .
""")
.font(.nps(size: 8))
Text(attributeText)
.foregroundStyle(Color(.Text.detail))
.lineLimit(2)
.multilineTextAlignment(.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){
Text("AcaMate")
.font(.nps(font: .bold, size: 16))
.foregroundStyle(Color(.Text.detail))
VStack(spacing: 4) {
Text("문의: sean.kk@daum.net")
.font(.nps(size: 12))
.foregroundStyle(Color(.Text.detail))
Text("문의: sean.kk@daum.net")
.font(.nps(size: 12))
HStack(alignment: .center, spacing: 8) {
Image(.Logo.appIcon).resizable()
.frame(width: 40, height: 40,alignment: .leading)
Text("AcaMate")
.font(.nps(font: .bold, size: 16))
.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 {
@StateObject private var topVM = TopViewModel()
@State private var scrollOffset: CGPoint = .zero
@Binding var myType: UserType
var body: some View {
VStack(spacing: 0) {
@ -21,7 +20,7 @@ struct EtcView: View {
OffsetObservableScrollView(showsIndicators: false, scrollOffset: $scrollOffset) { proxy in
VStack(spacing: 24) {
UserInfoView(userData: SummaryUser(profile: Image(.Icon.face), name: "이름", userID: "abcdefg", email: "abcdefg@gmail.com"))
UserSettingView()
UserSettingView(myType: myType)
CsCenterView()
TsCsView()
AppInfoView()

View File

@ -8,6 +8,8 @@
import SwiftUI
struct UserSettingView: View {
var myType: UserType
var body: some View {
EtcBoxView(title: "설정") {
VStack(spacing: 0){
@ -24,6 +26,17 @@ struct UserSettingView: View {
//
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> = []
@Binding var naviState : NaviState
@State private var myType: UserType = .Student
var body: some View {
VStack(spacing: 0) {
Group {
switch appVM.menuName {
case .Home:
HomeView()
HomeView(myType: $myType)
case .Management:
ManagementView()
case .Chatting:
@ -28,10 +30,10 @@ struct MainView: View {
case .Calendar:
CalendarView()
case .Etc:
EtcView()
EtcView(myType: $myType)
}
}
Spacer(minLength: 1)
// Spacer(minLength: 1)
BottomView()
.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