init
This commit is contained in:
@@ -7,11 +7,18 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
963267362B56C65600D7FAC9 /* TabbarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 963267352B56C65600D7FAC9 /* TabbarView.swift */; };
|
||||
963267382B56C6EF00D7FAC9 /* UserView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 963267372B56C6EF00D7FAC9 /* UserView.swift */; };
|
||||
9632673B2B56C77500D7FAC9 /* ExploreView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9632673A2B56C77500D7FAC9 /* ExploreView.swift */; };
|
||||
963267422B56CAD900D7FAC9 /* UserCardComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 963267412B56CAD900D7FAC9 /* UserCardComponent.swift */; };
|
||||
963267472B56CEA100D7FAC9 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 963267462B56CEA100D7FAC9 /* ViewController.swift */; };
|
||||
9632674C2B5A095600D7FAC9 /* LaunchScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9632674B2B5A095600D7FAC9 /* LaunchScreen.swift */; };
|
||||
9632674E2B5A0C4F00D7FAC9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9632674D2B5A0C4F00D7FAC9 /* LaunchScreen.storyboard */; };
|
||||
963267502B5A1B3100D7FAC9 /* TabBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9632674F2B5A1B3100D7FAC9 /* TabBar.swift */; };
|
||||
963267522B5A1BCC00D7FAC9 /* TabBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 963267512B5A1BCC00D7FAC9 /* TabBarView.swift */; };
|
||||
963267552B5A25FE00D7FAC9 /* MallView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 963267542B5A25FE00D7FAC9 /* MallView.swift */; };
|
||||
963267582B5A273B00D7FAC9 /* MessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 963267572B5A273B00D7FAC9 /* MessageView.swift */; };
|
||||
9632675B2B5A2FCC00D7FAC9 /* LoginView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9632675A2B5A2FCC00D7FAC9 /* LoginView.swift */; };
|
||||
9632675E2B5A564100D7FAC9 /* RegisterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9632675D2B5A564100D7FAC9 /* RegisterView.swift */; };
|
||||
9634A8F32B569860007C90C0 /* MyApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9634A8F22B569860007C90C0 /* MyApp.swift */; };
|
||||
9634A8F52B569860007C90C0 /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9634A8F42B569860007C90C0 /* HomeView.swift */; };
|
||||
9634A8F92B569862007C90C0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9634A8F82B569862007C90C0 /* Assets.xcassets */; };
|
||||
@@ -19,6 +26,7 @@
|
||||
9634A9062B569862007C90C0 /* jasonTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9634A9052B569862007C90C0 /* jasonTests.swift */; };
|
||||
9634A9102B569862007C90C0 /* jasonUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9634A90F2B569862007C90C0 /* jasonUITests.swift */; };
|
||||
9634A9122B569862007C90C0 /* jasonUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9634A9112B569862007C90C0 /* jasonUITestsLaunchTests.swift */; };
|
||||
968A6F562B5E1DA1008609EE /* SearchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968A6F552B5E1DA1008609EE /* SearchView.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@@ -40,11 +48,18 @@
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
963267342B56C56700D7FAC9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
963267352B56C65600D7FAC9 /* TabbarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabbarView.swift; sourceTree = "<group>"; };
|
||||
963267372B56C6EF00D7FAC9 /* UserView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserView.swift; sourceTree = "<group>"; };
|
||||
9632673A2B56C77500D7FAC9 /* ExploreView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExploreView.swift; sourceTree = "<group>"; };
|
||||
963267412B56CAD900D7FAC9 /* UserCardComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserCardComponent.swift; sourceTree = "<group>"; };
|
||||
963267462B56CEA100D7FAC9 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
|
||||
9632674B2B5A095600D7FAC9 /* LaunchScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = LaunchScreen.swift; sourceTree = "<group>"; usesTabs = 0; };
|
||||
9632674D2B5A0C4F00D7FAC9 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
9632674F2B5A1B3100D7FAC9 /* TabBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBar.swift; sourceTree = "<group>"; };
|
||||
963267512B5A1BCC00D7FAC9 /* TabBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarView.swift; sourceTree = "<group>"; };
|
||||
963267542B5A25FE00D7FAC9 /* MallView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MallView.swift; sourceTree = "<group>"; };
|
||||
963267572B5A273B00D7FAC9 /* MessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageView.swift; sourceTree = "<group>"; };
|
||||
9632675A2B5A2FCC00D7FAC9 /* LoginView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginView.swift; sourceTree = "<group>"; };
|
||||
9632675D2B5A564100D7FAC9 /* RegisterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegisterView.swift; sourceTree = "<group>"; };
|
||||
9634A8EF2B569860007C90C0 /* jason.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = jason.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
9634A8F22B569860007C90C0 /* MyApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyApp.swift; sourceTree = "<group>"; };
|
||||
9634A8F42B569860007C90C0 /* HomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = "<group>"; };
|
||||
@@ -55,6 +70,7 @@
|
||||
9634A90B2B569862007C90C0 /* jasonUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = jasonUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
9634A90F2B569862007C90C0 /* jasonUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = jasonUITests.swift; sourceTree = "<group>"; };
|
||||
9634A9112B569862007C90C0 /* jasonUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = jasonUITestsLaunchTests.swift; sourceTree = "<group>"; };
|
||||
968A6F552B5E1DA1008609EE /* SearchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchView.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -114,6 +130,40 @@
|
||||
path = Components;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
963267482B5A07DD00D7FAC9 /* Layouts */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9632674B2B5A095600D7FAC9 /* LaunchScreen.swift */,
|
||||
963267512B5A1BCC00D7FAC9 /* TabBarView.swift */,
|
||||
);
|
||||
path = Layouts;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
963267532B5A25D300D7FAC9 /* Mall */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
963267542B5A25FE00D7FAC9 /* MallView.swift */,
|
||||
);
|
||||
path = Mall;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
963267562B5A272D00D7FAC9 /* Message */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
963267572B5A273B00D7FAC9 /* MessageView.swift */,
|
||||
);
|
||||
path = Message;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
963267592B5A2FBE00D7FAC9 /* Auth */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9632675A2B5A2FCC00D7FAC9 /* LoginView.swift */,
|
||||
9632675D2B5A564100D7FAC9 /* RegisterView.swift */,
|
||||
);
|
||||
path = Auth;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9634A8E62B569860007C90C0 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -185,10 +235,15 @@
|
||||
9634A91F2B5698AB007C90C0 /* Views */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
963267352B56C65600D7FAC9 /* TabbarView.swift */,
|
||||
968A6F532B5E1D91008609EE /* Search */,
|
||||
963267592B5A2FBE00D7FAC9 /* Auth */,
|
||||
963267562B5A272D00D7FAC9 /* Message */,
|
||||
963267532B5A25D300D7FAC9 /* Mall */,
|
||||
963267482B5A07DD00D7FAC9 /* Layouts */,
|
||||
9632673E2B56C8BD00D7FAC9 /* Explore */,
|
||||
9632673C2B56C88D00D7FAC9 /* Home */,
|
||||
9632673D2B56C89900D7FAC9 /* User */,
|
||||
9632674D2B5A0C4F00D7FAC9 /* LaunchScreen.storyboard */,
|
||||
);
|
||||
path = Views;
|
||||
sourceTree = "<group>";
|
||||
@@ -196,10 +251,19 @@
|
||||
9634A9202B5698B0007C90C0 /* Models */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9632674F2B5A1B3100D7FAC9 /* TabBar.swift */,
|
||||
);
|
||||
path = Models;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
968A6F532B5E1D91008609EE /* Search */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
968A6F552B5E1DA1008609EE /* SearchView.swift */,
|
||||
);
|
||||
path = Search;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
@@ -304,6 +368,7 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
9632674E2B5A0C4F00D7FAC9 /* LaunchScreen.storyboard in Resources */,
|
||||
9634A8FC2B569862007C90C0 /* Preview Assets.xcassets in Resources */,
|
||||
9634A8F92B569862007C90C0 /* Assets.xcassets in Resources */,
|
||||
);
|
||||
@@ -330,10 +395,17 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
963267362B56C65600D7FAC9 /* TabbarView.swift in Sources */,
|
||||
963267552B5A25FE00D7FAC9 /* MallView.swift in Sources */,
|
||||
9632674C2B5A095600D7FAC9 /* LaunchScreen.swift in Sources */,
|
||||
9632675E2B5A564100D7FAC9 /* RegisterView.swift in Sources */,
|
||||
963267522B5A1BCC00D7FAC9 /* TabBarView.swift in Sources */,
|
||||
9634A8F52B569860007C90C0 /* HomeView.swift in Sources */,
|
||||
9634A8F32B569860007C90C0 /* MyApp.swift in Sources */,
|
||||
963267502B5A1B3100D7FAC9 /* TabBar.swift in Sources */,
|
||||
9632675B2B5A2FCC00D7FAC9 /* LoginView.swift in Sources */,
|
||||
963267582B5A273B00D7FAC9 /* MessageView.swift in Sources */,
|
||||
963267382B56C6EF00D7FAC9 /* UserView.swift in Sources */,
|
||||
968A6F562B5E1DA1008609EE /* SearchView.swift in Sources */,
|
||||
963267422B56CAD900D7FAC9 /* UserCardComponent.swift in Sources */,
|
||||
963267472B56CEA100D7FAC9 /* ViewController.swift in Sources */,
|
||||
9632673B2B56C77500D7FAC9 /* ExploreView.swift in Sources */,
|
||||
@@ -504,8 +576,12 @@
|
||||
ENABLE_PREVIEWS = YES;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = jason/Info.plist;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = "小陈叔叔";
|
||||
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
|
||||
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
|
||||
INFOPLIST_KEY_UILaunchStoryboardName = "";
|
||||
INFOPLIST_KEY_UIStatusBarHidden = NO;
|
||||
INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleDarkContent;
|
||||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
|
||||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
|
||||
@@ -538,8 +614,12 @@
|
||||
ENABLE_PREVIEWS = YES;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = jason/Info.plist;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = "小陈叔叔";
|
||||
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
|
||||
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
|
||||
INFOPLIST_KEY_UILaunchStoryboardName = "";
|
||||
INFOPLIST_KEY_UIStatusBarHidden = NO;
|
||||
INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleDarkContent;
|
||||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
|
||||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0xFF",
|
||||
"green" : "0xFF",
|
||||
"red" : "0xFF"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0x00",
|
||||
"green" : "0x00",
|
||||
"red" : "0x00"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
21
jason/Assets.xcassets/Images/LaunchScreen.imageset/Contents.json
vendored
Normal file
21
jason/Assets.xcassets/Images/LaunchScreen.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "sunset-675847_1920.jpg",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
jason/Assets.xcassets/Images/LaunchScreen.imageset/sunset-675847_1920.jpg
vendored
Normal file
BIN
jason/Assets.xcassets/Images/LaunchScreen.imageset/sunset-675847_1920.jpg
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 420 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
BIN
jason/Assets.xcassets/Images/logo.imageset/3ac79f3df8dcd10010dddf20758b4710b9122f69.jpg
vendored
Normal file
BIN
jason/Assets.xcassets/Images/logo.imageset/3ac79f3df8dcd10010dddf20758b4710b9122f69.jpg
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 37 KiB |
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "3 1.jpg",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "3.jpg",
|
||||
"filename" : "3ac79f3df8dcd10010dddf20758b4710b9122f69.jpg",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
import SwiftUI
|
||||
|
||||
struct UserCardComponent: View {
|
||||
|
||||
var body: some View {
|
||||
VStack (alignment: .leading, spacing: 8, content: {
|
||||
Spacer()
|
||||
@@ -27,7 +28,8 @@ struct UserCardComponent: View {
|
||||
})
|
||||
.padding(.all, 20)
|
||||
.frame(height: 300)
|
||||
.background(.ultraThinMaterial)
|
||||
.background(Image("Images/banner2").resizable().aspectRatio(contentMode: .fill))
|
||||
// .background(.ultraThinMaterial)
|
||||
.cornerRadius(10)
|
||||
.shadow(radius: 20)
|
||||
.padding(.horizontal, 10)
|
||||
|
||||
29
jason/Models/TabBar.swift
Normal file
29
jason/Models/TabBar.swift
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// TabBar.swift
|
||||
// jason
|
||||
//
|
||||
// Created by Jason on 2024/1/19.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct TabItem: Identifiable {
|
||||
var id = UUID()
|
||||
var icon: String
|
||||
var text: String
|
||||
var tab: Tab
|
||||
}
|
||||
|
||||
var tabItems = [
|
||||
TabItem(icon: "book", text: "图书馆", tab: .home),
|
||||
TabItem(icon: "bag", text: "生活馆", tab: .explore),
|
||||
TabItem(icon: "cart", text: "购物车", tab: .message),
|
||||
TabItem(icon: "person", text: "个人中心", tab: .account)
|
||||
]
|
||||
|
||||
enum Tab: String {
|
||||
case home
|
||||
case explore
|
||||
case message
|
||||
case account
|
||||
}
|
||||
@@ -6,13 +6,12 @@
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import SwiftData
|
||||
|
||||
@main
|
||||
struct MyApp: App {
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
TabbarView()
|
||||
TabBarView()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
72
jason/Views/Auth/LoginView.swift
Normal file
72
jason/Views/Auth/LoginView.swift
Normal file
@@ -0,0 +1,72 @@
|
||||
//
|
||||
// LoginView.swift
|
||||
// jason
|
||||
//
|
||||
// Created by Jason on 2024/1/19.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct LoginView: View {
|
||||
@AppStorage("authUsername") private var username: String = ""
|
||||
@State private var password: String = ""
|
||||
@State private var remember: Bool = false
|
||||
@State private var toRegister: Bool = false
|
||||
|
||||
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
|
||||
NavigationLink(destination: RegisterView(), label: {
|
||||
Text("去注册")
|
||||
})
|
||||
|
||||
VStack(alignment: .leading ,spacing: 12) {
|
||||
// Button(action: {
|
||||
// dismiss()
|
||||
// }, label: {
|
||||
// Image(systemName: "chevron.backward")
|
||||
// Text("返回")
|
||||
// })
|
||||
|
||||
|
||||
TextField("请输入用户名",text: $username)
|
||||
SecureField("请输入密码", text: $password)
|
||||
Toggle(isOn: $remember) {
|
||||
Text("记住用户")
|
||||
}
|
||||
|
||||
HStack {
|
||||
|
||||
Button("注册") {
|
||||
toRegister = true
|
||||
}
|
||||
.padding(.vertical, 12)
|
||||
.padding(.horizontal, 32)
|
||||
.foregroundColor(.white)
|
||||
|
||||
.cornerRadius(6)
|
||||
.fullScreenCover(isPresented: $toRegister, content: {
|
||||
RegisterView()
|
||||
})
|
||||
|
||||
Spacer()
|
||||
|
||||
Button("登录") {
|
||||
|
||||
}
|
||||
.padding(.vertical, 12)
|
||||
.padding(.horizontal, 32)
|
||||
.foregroundColor(.white)
|
||||
|
||||
.cornerRadius(6)
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, 12)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
LoginView()
|
||||
}
|
||||
70
jason/Views/Auth/RegisterView.swift
Normal file
70
jason/Views/Auth/RegisterView.swift
Normal file
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// RegisterView.swift
|
||||
// jason
|
||||
//
|
||||
// Created by Jason on 2024/1/19.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct RegisterView: View {
|
||||
@State private var username: String = ""
|
||||
@State private var password: String = ""
|
||||
@State private var showNext: Bool = false
|
||||
|
||||
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
VStack (alignment: .leading, spacing: 12) {
|
||||
// Button(action: {
|
||||
// dismiss()
|
||||
// }, label: {
|
||||
// Image(systemName: "chevron.backward")
|
||||
// Text("返回")
|
||||
// })
|
||||
//
|
||||
TextField("请输入用户名",text: $username)
|
||||
.padding(.all, 12)
|
||||
.cornerRadius(6)
|
||||
.border(Color.gray)
|
||||
|
||||
SecureField("请输入密码", text: $password)
|
||||
.padding(.all, 12)
|
||||
.cornerRadius(6)
|
||||
.border(Color.gray)
|
||||
|
||||
HStack {
|
||||
Button("注册") {
|
||||
showNext = true
|
||||
}
|
||||
.padding(.vertical, 12)
|
||||
.padding(.horizontal, 32)
|
||||
.foregroundColor(.white)
|
||||
|
||||
.cornerRadius(6)
|
||||
.fullScreenCover(isPresented: $showNext, content: {
|
||||
RegisterView()
|
||||
})
|
||||
|
||||
Spacer()
|
||||
|
||||
Button("登录") {
|
||||
|
||||
}
|
||||
.padding(.vertical, 12)
|
||||
.padding(.horizontal, 32)
|
||||
.foregroundColor(.white)
|
||||
|
||||
.cornerRadius(6)
|
||||
}
|
||||
}
|
||||
.padding(.all, 12)
|
||||
.navigationTitle("注册")
|
||||
.navigationBarTitleDisplayMode(.large)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
RegisterView()
|
||||
}
|
||||
@@ -11,9 +11,9 @@ import SwiftData
|
||||
struct HomeView: View {
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
VStack(alignment: .leading, content: {
|
||||
ZStack(alignment: .leading) {
|
||||
UserCardComponent()
|
||||
})
|
||||
}
|
||||
}
|
||||
.background(Color.orange)
|
||||
}
|
||||
|
||||
49
jason/Views/LaunchScreen.storyboard
Normal file
49
jason/Views/LaunchScreen.storyboard
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" fixedFrame="YES" image="Images/LaunchScreen" translatesAutoresizingMaskIntoConstraints="NO" id="YBo-Ve-E6d">
|
||||
<rect key="frame" x="-369" y="-10" width="960" height="640"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Jason.Test" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kdI-F4-fGB">
|
||||
<rect key="frame" x="22" y="648" width="145" height="39"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="32"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Copyright 2023" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FpI-q0-oUO">
|
||||
<rect key="frame" x="288" y="803" width="89" height="15"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
||||
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="Images/LaunchScreen" width="960" height="639.5"/>
|
||||
</resources>
|
||||
</document>
|
||||
30
jason/Views/Layouts/LaunchScreen.swift
Normal file
30
jason/Views/Layouts/LaunchScreen.swift
Normal file
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// LaunchScreen.swift
|
||||
// jason
|
||||
//
|
||||
// Created by Jason on 2024/1/19.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct LaunchScreen: View {
|
||||
var body: some View {
|
||||
|
||||
Spacer()
|
||||
Text("Jason.App")
|
||||
.font(.largeTitle)
|
||||
.fontWeight(.bold)
|
||||
.foregroundColor(Color.red)
|
||||
.multilineTextAlignment(.center)
|
||||
Spacer()
|
||||
Text("Copyright By Jason 2023")
|
||||
.font(.custom("", size: 10))
|
||||
.foregroundColor(Color.gray)
|
||||
.multilineTextAlignment(.center)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
LaunchScreen()
|
||||
}
|
||||
65
jason/Views/Layouts/TabbarView.swift
Normal file
65
jason/Views/Layouts/TabbarView.swift
Normal file
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// TabBarView.swift
|
||||
// jason
|
||||
//
|
||||
// Created by Jason on 2024/1/19.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct TabBarView: View {
|
||||
@AppStorage("selectedTab") var selectedTab : Tab = .home
|
||||
|
||||
var body: some View {
|
||||
ZStack(alignment: .leading) {
|
||||
Group {
|
||||
switch selectedTab {
|
||||
case .home:
|
||||
HomeView()
|
||||
case .explore:
|
||||
MallView()
|
||||
case .message:
|
||||
MessageView()
|
||||
case .account:
|
||||
UserView()
|
||||
}
|
||||
}
|
||||
// .offset(y: -44)
|
||||
// .safeAreaInset(edge: .top) {
|
||||
// Color.clear.frame(height: 32)
|
||||
// }
|
||||
|
||||
HStack {
|
||||
ForEach(tabItems) { item in
|
||||
Button(action: {
|
||||
selectedTab = item.tab
|
||||
}, label: {
|
||||
VStack (spacing: 6) {
|
||||
Image(systemName: item.icon).resizable().frame(width: 18, height: 18)
|
||||
Text(item.text)
|
||||
.font(.caption)
|
||||
.fontWeight(.regular)
|
||||
.multilineTextAlignment(.center)
|
||||
.lineLimit(1)
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
})
|
||||
.foregroundColor(selectedTab == item.tab ? Color("MainText") : Color.secondary)
|
||||
.shadow(color: (selectedTab == item.tab ? Color.orange: Color.blue), radius: 15)
|
||||
}
|
||||
}
|
||||
.padding(.top, 12.0)
|
||||
.padding(.bottom, 32)
|
||||
.background(Color("TabBarColor"))
|
||||
.frame(maxHeight: .infinity, alignment: .bottom)
|
||||
.shadow(color: Color.gray.opacity(0.5), radius: 6, x: 0, y: 6)
|
||||
.ignoresSafeArea()
|
||||
}
|
||||
.statusBarHidden(false)
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
TabBarView()
|
||||
}
|
||||
|
||||
20
jason/Views/Mall/MallView.swift
Normal file
20
jason/Views/Mall/MallView.swift
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// MallView.swift
|
||||
// jason
|
||||
//
|
||||
// Created by Jason on 2024/1/19.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct MallView: View {
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
MallView()
|
||||
}
|
||||
25
jason/Views/Message/MessageView.swift
Normal file
25
jason/Views/Message/MessageView.swift
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// MessageView.swift
|
||||
// jason
|
||||
//
|
||||
// Created by Jason on 2024/1/19.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct MessageView: View {
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
|
||||
ForEach (0 ..< 55) { item in
|
||||
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
MessageView()
|
||||
}
|
||||
18
jason/Views/Search/SearchView.swift
Normal file
18
jason/Views/Search/SearchView.swift
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// SearchView.swift
|
||||
// jason
|
||||
//
|
||||
// Created by Jason on 2024/1/22.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct SearchView: View {
|
||||
var body: some View {
|
||||
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
SearchView()
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
//
|
||||
// TabbarView.swift
|
||||
// jason
|
||||
//
|
||||
// Created by Jason on 2024/1/16.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct TabbarView: View {
|
||||
var body: some View {
|
||||
TabView() {
|
||||
HomeView()
|
||||
.tabItem {
|
||||
Image(systemName: "house")
|
||||
Text("Home")
|
||||
}
|
||||
.tag(1)
|
||||
ExploreView()
|
||||
.tabItem {
|
||||
Image(systemName: "magnifyingglass")
|
||||
Text("Explore")
|
||||
}
|
||||
.tag(2)
|
||||
UserView()
|
||||
.tabItem {
|
||||
Image(systemName: "person")
|
||||
Text("User")
|
||||
}
|
||||
.tag(3)
|
||||
}
|
||||
.background(Color.white)
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
TabbarView()
|
||||
}
|
||||
@@ -8,17 +8,86 @@
|
||||
import SwiftUI
|
||||
|
||||
struct UserView: View {
|
||||
@State private var toLogin: Bool = false
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
ScrollView {
|
||||
VStack (alignment: .leading) {
|
||||
UserCardComponent()
|
||||
Text("item")
|
||||
VStack (alignment: .leading, spacing: 12) {
|
||||
Header
|
||||
|
||||
ToVip
|
||||
|
||||
|
||||
|
||||
//
|
||||
// NavigationLink(destination: LoginView(), label: {
|
||||
// Text("qu zhuce ")
|
||||
// })
|
||||
// Button("登录"){
|
||||
// toLogin = true
|
||||
// }
|
||||
// .padding(.vertical, 12)
|
||||
// .padding(.horizontal, 32)
|
||||
// .foregroundColor(.white)
|
||||
// .background(Color.blue)
|
||||
// .cornerRadius(12)
|
||||
// .fullScreenCover(isPresented: $toLogin, content: {
|
||||
// LoginView()
|
||||
// })
|
||||
}
|
||||
|
||||
}
|
||||
.background(Color.red)
|
||||
}
|
||||
}
|
||||
|
||||
var Header : some View {
|
||||
HStack {
|
||||
Image("Images/logo")
|
||||
.resizable()
|
||||
.frame(width: 64, height: 64)
|
||||
.cornerRadius(32)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 32, style: .continuous)
|
||||
.stroke(Color.red, lineWidth: 2)
|
||||
)
|
||||
|
||||
VStack (alignment: .leading, spacing: 12, content: {
|
||||
Text("用户名称")
|
||||
.font(.title2)
|
||||
.fontWeight(.regular)
|
||||
Text("我的用户简介,超出部分需要隐藏,隐藏需要自动设置,这个文字长度也要有约束")
|
||||
.font(.caption)
|
||||
.foregroundColor(Color.gray)
|
||||
.lineLimit(1)
|
||||
})
|
||||
|
||||
Image(systemName: "gearshape")
|
||||
.foregroundColor(Color.gray)
|
||||
}
|
||||
.padding(.horizontal, 16)
|
||||
}
|
||||
|
||||
var ToVip: some View {
|
||||
HStack(spacing: /*@START_MENU_TOKEN@*/nil/*@END_MENU_TOKEN@*/, content: {
|
||||
Spacer()
|
||||
Button("立即开通") {
|
||||
|
||||
}
|
||||
.foregroundColor(Color.red)
|
||||
.font(.subheadline)
|
||||
.padding(.vertical, 8)
|
||||
.padding(.horizontal, 16)
|
||||
.background(Color.gray)
|
||||
.cornerRadius(32)
|
||||
})
|
||||
.padding(16)
|
||||
.frame(maxWidth: .infinity)
|
||||
.frame( height: 64)
|
||||
.background(Image("Images/banner3").resizable().cornerRadius(/*@START_MENU_TOKEN@*/12.0/*@END_MENU_TOKEN@*/))
|
||||
.padding(.horizontal, 16)
|
||||
}
|
||||
}
|
||||
#Preview {
|
||||
UserView()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user