Files
e-party-iOS/yana/Views/FeedView.swift
edwinQQQ 9844289d72 feat: 添加设置功能和动态视图
- 新增设置功能模块,包含用户信息管理和设置选项。
- 实现动态视图,展示用户动态内容。
- 更新HomeView以支持设置页面的展示和动态视图的切换。
- 添加底部导航栏,增强用户体验。
- 更新相关视图和组件,确保一致的UI风格和交互体验。
2025-07-11 10:42:28 +08:00

134 lines
4.6 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import SwiftUI
struct FeedView: View {
var body: some View {
ScrollView {
VStack(spacing: 20) {
//
HStack {
Spacer()
Text("Enjoy your Life Time")
.font(.system(size: 22, weight: .semibold))
.foregroundColor(.white)
Spacer()
}
.padding(.top, 20)
//
Image(systemName: "heart.fill")
.font(.system(size: 60))
.foregroundColor(.red)
.padding(.top, 40)
//
Text("The disease is like a cruel ruler,\nand time is our most precious treasure.\nEvery moment we live is a victory\nagainst the inevitable.")
.font(.system(size: 16))
.multilineTextAlignment(.center)
.foregroundColor(.white.opacity(0.9))
.padding(.horizontal, 30)
.padding(.top, 20)
//
LazyVStack(spacing: 16) {
ForEach(0..<3) { index in
DynamicCardView(index: index)
}
}
.padding(.horizontal, 16)
.padding(.top, 30)
//
Color.clear.frame(height: 100)
}
}
}
}
// MARK: -
struct DynamicCardView: View {
let index: Int
var body: some View {
VStack(alignment: .leading, spacing: 12) {
//
HStack(spacing: 12) {
//
Circle()
.fill(Color.blue.opacity(0.6))
.frame(width: 40, height: 40)
.overlay(
Text("👤")
.font(.system(size: 20))
)
VStack(alignment: .leading, spacing: 2) {
HStack {
Text("NAMENAMENAME....")
.font(.system(size: 14, weight: .medium))
.foregroundColor(.white)
Spacer()
Text("ID:7271557")
.font(.caption)
.foregroundColor(.white.opacity(0.7))
}
Text("09/12")
.font(.caption)
.foregroundColor(.white.opacity(0.7))
}
}
//
Text("这是动态内容 \(index + 1)。今天是美好的一天,分享一些生活中的点点滴滴。")
.font(.system(size: 15))
.foregroundColor(.white)
.lineLimit(nil)
//
LazyVGrid(columns: Array(repeating: GridItem(.flexible(), spacing: 8), count: 3), spacing: 8) {
ForEach(0..<3) { imageIndex in
Rectangle()
.fill(Color.gray.opacity(0.3))
.aspectRatio(1, contentMode: .fit)
.overlay(
Image(systemName: "photo")
.foregroundColor(.white.opacity(0.6))
)
}
}
//
HStack(spacing: 20) {
Button(action: {}) {
HStack(spacing: 4) {
Image(systemName: "message")
.font(.system(size: 16))
Text("354")
.font(.system(size: 14))
}
.foregroundColor(.white.opacity(0.8))
}
Button(action: {}) {
HStack(spacing: 4) {
Image(systemName: "heart")
.font(.system(size: 16))
Text("354")
.font(.system(size: 14))
}
.foregroundColor(.white.opacity(0.8))
}
Spacer()
}
.padding(.top, 8)
}
.padding(16)
.background(
Color.white.opacity(0.1)
.cornerRadius(12)
)
}
}