diff --git a/duduji.xcodeproj/project.pbxproj b/duduji.xcodeproj/project.pbxproj index fd8a80d..9b25ca8 100644 --- a/duduji.xcodeproj/project.pbxproj +++ b/duduji.xcodeproj/project.pbxproj @@ -23,6 +23,8 @@ 24C1E5962A07A9D300F09364 /* Avatar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24C1E5952A07A9D300F09364 /* Avatar.swift */; }; 24C1E59A2A07AC6D00F09364 /* ToolBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24C1E5992A07AC6D00F09364 /* ToolBar.swift */; }; 24C1E59C2A07BB5C00F09364 /* NotificationRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24C1E59B2A07BB5C00F09364 /* NotificationRow.swift */; }; + 24C1E5A12A07C9DE00F09364 /* ProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24C1E5A02A07C9DE00F09364 /* ProfileView.swift */; }; + 24C1E5A32A07CA0000F09364 /* ProfileTabView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24C1E5A22A07CA0000F09364 /* ProfileTabView.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -44,6 +46,8 @@ 24C1E5952A07A9D300F09364 /* Avatar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Avatar.swift; sourceTree = ""; }; 24C1E5992A07AC6D00F09364 /* ToolBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToolBar.swift; sourceTree = ""; }; 24C1E59B2A07BB5C00F09364 /* NotificationRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationRow.swift; sourceTree = ""; }; + 24C1E5A02A07C9DE00F09364 /* ProfileView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileView.swift; sourceTree = ""; }; + 24C1E5A22A07CA0000F09364 /* ProfileTabView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileTabView.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -114,6 +118,7 @@ 24A07CE02A02702800F4ECA8 /* Core */ = { isa = PBXGroup; children = ( + 24C1E59D2A07C9C800F09364 /* Profile */, 24A07CFE2A07A30200F4ECA8 /* Notification */, 24A07CF62A076E2C00F4ECA8 /* MainTab */, 24A07CEE2A03E7BA00F4ECA8 /* Feeds */, @@ -241,6 +246,31 @@ path = ViewModels; sourceTree = ""; }; + 24C1E59D2A07C9C800F09364 /* Profile */ = { + isa = PBXGroup; + children = ( + 24C1E59F2A07C9D300F09364 /* ViewModels */, + 24C1E59E2A07C9CE00F09364 /* Views */, + ); + path = Profile; + sourceTree = ""; + }; + 24C1E59E2A07C9CE00F09364 /* Views */ = { + isa = PBXGroup; + children = ( + 24C1E5A02A07C9DE00F09364 /* ProfileView.swift */, + 24C1E5A22A07CA0000F09364 /* ProfileTabView.swift */, + ); + path = Views; + sourceTree = ""; + }; + 24C1E59F2A07C9D300F09364 /* ViewModels */ = { + isa = PBXGroup; + children = ( + ); + path = ViewModels; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -313,11 +343,13 @@ files = ( 24C1E59A2A07AC6D00F09364 /* ToolBar.swift in Sources */, 24A07CD22A026DDA00F4ECA8 /* ContentView.swift in Sources */, + 24C1E5A32A07CA0000F09364 /* ProfileTabView.swift in Sources */, 24C1E5962A07A9D300F09364 /* Avatar.swift in Sources */, 24A07CFC2A07A26A00F4ECA8 /* TimeLineTabView.swift in Sources */, 24A07CF32A03E80200F4ECA8 /* TimeLineView.swift in Sources */, 24C1E59C2A07BB5C00F09364 /* NotificationRow.swift in Sources */, 24A07CD02A026DDA00F4ECA8 /* dudujiApp.swift in Sources */, + 24C1E5A12A07C9DE00F09364 /* ProfileView.swift in Sources */, 24A07D052A07A33900F4ECA8 /* NotificationTabView.swift in Sources */, 24A07CFA2A076E5400F4ECA8 /* MainTabView.swift in Sources */, 24A07CEB2A029C6A00F4ECA8 /* InstanceInfo.swift in Sources */, diff --git a/duduji.xcodeproj/xcuserdata/ching.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/duduji.xcodeproj/xcuserdata/ching.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..2433c2c --- /dev/null +++ b/duduji.xcodeproj/xcuserdata/ching.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,6 @@ + + + diff --git a/duduji/Core/Profile/Views/ProfileTabView.swift b/duduji/Core/Profile/Views/ProfileTabView.swift new file mode 100644 index 0000000..66bb7c8 --- /dev/null +++ b/duduji/Core/Profile/Views/ProfileTabView.swift @@ -0,0 +1,25 @@ +// +// ProfileTabView.swift +// duduji +// +// Created by ching on 2023/5/7. +// + +import SwiftUI + +struct ProfileTabView: View { + var body: some View { + NavigationStack { + ProfileView() +// .toolbar { +// ToolBar() +// } + } + } +} + +struct ProfileTabView_Previews: PreviewProvider { + static var previews: some View { + ProfileTabView() + } +} diff --git a/duduji/Core/Profile/Views/ProfileView.swift b/duduji/Core/Profile/Views/ProfileView.swift new file mode 100644 index 0000000..1d1a316 --- /dev/null +++ b/duduji/Core/Profile/Views/ProfileView.swift @@ -0,0 +1,87 @@ +// +// ProfileView.swift +// duduji +// +// Created by ching on 2023/5/7. +// + +import SwiftUI + +struct ProfileView: View { + var body: some View { + VStack(alignment: .leading) { + // banner & avarta + HStack { + Color(.systemRed) + } + .frame(height: 192) +// .ignoresSafeArea() + + // user stats + HStack(alignment: .top, spacing: 12) { + RoundedRectangle(cornerRadius: 6) + .fill(Color.blue) + .frame(width: 96, height: 96) + .overlay( + RoundedRectangle(cornerRadius: 6) + .stroke(.gray.opacity(0.5), lineWidth: 2) + ) + .padding(.horizontal) + .offset(y: -40) + Spacer() + VStack { + Text("1234") + .bold() + .font(.title3) + .foregroundColor(.cyan) + Text("嘟文") + .foregroundColor(.gray) + } + VStack { + Text("1234") + .bold() + .font(.title3) + .foregroundColor(.cyan) + Text("关注") + .foregroundColor(.gray) + } + VStack { + Text("1234") + .bold() + .font(.title3) + .foregroundColor(.cyan) + Text("粉丝") + .foregroundColor(.gray) + } + } + .padding(.bottom, -50) + .padding(.trailing) + + // user info + HStack(alignment: .firstTextBaseline) { + VStack(alignment: .leading, spacing: 6) { + Text("科代") + .font(.title3) + .bold() + Text("@Kedai") + .foregroundColor(.gray) + HStack(spacing: 2) { + Image(systemName: "calendar") + Text("加入于 2021 年 11 月 12 日") + } + .foregroundColor(.gray) + .font(.caption) + } + .padding() + } + + Spacer() + } + } +} + +struct ProfileView_Previews: PreviewProvider { + static var previews: some View { + ProfileView() + } +}