add new View
This commit is contained in:
@@ -21,7 +21,7 @@ import SwiftUI
|
|||||||
|
|
||||||
struct MessageCenterView: View {
|
struct MessageCenterView: View {
|
||||||
|
|
||||||
@Environment(\.presentationMode) var presentationMode // 环境变量用于控制视图的呈现
|
@Environment(\.presentationMode) var presentationMode
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationView(content: {
|
NavigationView(content: {
|
||||||
@@ -31,7 +31,7 @@ struct MessageCenterView: View {
|
|||||||
HStack{
|
HStack{
|
||||||
Button(action: {
|
Button(action: {
|
||||||
|
|
||||||
presentationMode.wrappedValue.dismiss() // 手动触发返回
|
presentationMode.wrappedValue.dismiss()
|
||||||
}, label: {
|
}, label: {
|
||||||
|
|
||||||
Image(systemName: "chevron.left")
|
Image(systemName: "chevron.left")
|
||||||
@@ -39,7 +39,7 @@ struct MessageCenterView: View {
|
|||||||
|
|
||||||
Text("返回")
|
Text("返回")
|
||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
}).padding(10) // 增加可点击区域
|
}).padding(10)
|
||||||
Spacer(minLength: 0)
|
Spacer(minLength: 0)
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@ struct MessageCenterView: View {
|
|||||||
})
|
})
|
||||||
|
|
||||||
.navigationBarHidden(true)
|
.navigationBarHidden(true)
|
||||||
.navigationBarBackButtonHidden(true) // 隐藏返回按钮
|
.navigationBarBackButtonHidden(true)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ struct SideMenuView: View {
|
|||||||
|
|
||||||
HStack{
|
HStack{
|
||||||
Button(action: {
|
Button(action: {
|
||||||
isPresented = false // Close the side menu
|
isPresented = false
|
||||||
}, label: {
|
}, label: {
|
||||||
|
|
||||||
Image(systemName: "chevron.left")
|
Image(systemName: "chevron.left")
|
||||||
@@ -56,7 +56,7 @@ struct SideMenuView: View {
|
|||||||
|
|
||||||
Text("返回")
|
Text("返回")
|
||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
}).padding(10) // 增加可点击区域
|
}).padding(10)
|
||||||
Spacer(minLength: 0)
|
Spacer(minLength: 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@ struct SideMenuView: View {
|
|||||||
Text(errorMessage)
|
Text(errorMessage)
|
||||||
.bold()
|
.bold()
|
||||||
.foregroundColor(.red)
|
.foregroundColor(.red)
|
||||||
.multilineTextAlignment(.center) // 确保多行文本居中
|
.multilineTextAlignment(.center)
|
||||||
.padding()
|
.padding()
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
@@ -162,9 +162,9 @@ struct SideMenuView: View {
|
|||||||
Color.red
|
Color.red
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
Spacer() // Fill the remaining space to push the white rectangle to the left
|
Spacer()
|
||||||
}
|
}
|
||||||
.frame(height: 20) // Set the total width and height for the bar
|
.frame(height: 20)
|
||||||
.background(
|
.background(
|
||||||
RoundedRectangle(cornerRadius: 10)
|
RoundedRectangle(cornerRadius: 10)
|
||||||
.fill(
|
.fill(
|
||||||
@@ -214,23 +214,23 @@ struct SideMenuView: View {
|
|||||||
NavigationLink(destination: SupportTicketView()) {
|
NavigationLink(destination: SupportTicketView()) {
|
||||||
MenuItem(icon: "listclipboard", title: "我的工单", color: .white, isNew: false)
|
MenuItem(icon: "listclipboard", title: "我的工单", color: .white, isNew: false)
|
||||||
}
|
}
|
||||||
Divider() // 分隔线
|
Divider()
|
||||||
|
|
||||||
if (paymentURLKey.count > 3){
|
if (paymentURLKey.count > 3){
|
||||||
|
|
||||||
NavigationLink(destination: UpgradeView()) {
|
NavigationLink(destination: UpgradeView()) {
|
||||||
MenuItem(icon: "crown.fill", title: "升级套餐", color: .yellow, isNew: true)
|
MenuItem(icon: "crown.fill", title: "升级套餐", color: .yellow, isNew: true)
|
||||||
}
|
}
|
||||||
Divider() // 分隔线
|
Divider()
|
||||||
NavigationLink(destination: OrderListView()) {
|
NavigationLink(destination: OrderListView()) {
|
||||||
MenuItem(icon: "checkout", title: "我的订单", color: .white, isNew: false)
|
MenuItem(icon: "checkout", title: "我的订单", color: .white, isNew: false)
|
||||||
}
|
}
|
||||||
|
|
||||||
Divider() // 分隔线
|
Divider()
|
||||||
NavigationLink(destination: InviteListView(isPresented: $isInviteActive)) {
|
NavigationLink(destination: InviteListView(isPresented: $isInviteActive)) {
|
||||||
MenuItem(icon: "star.fill", title: "邀请中心", color: .white, isNew: false)
|
MenuItem(icon: "star.fill", title: "邀请中心", color: .white, isNew: false)
|
||||||
}
|
}
|
||||||
Divider() // 分隔线
|
Divider()
|
||||||
|
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
@@ -238,7 +238,7 @@ struct SideMenuView: View {
|
|||||||
NavigationLink(destination: MessageCenterView()) {
|
NavigationLink(destination: MessageCenterView()) {
|
||||||
MenuItem(icon: "message.badge.circle", title: "消息通知", color: .white, isNew: false)
|
MenuItem(icon: "message.badge.circle", title: "消息通知", color: .white, isNew: false)
|
||||||
}
|
}
|
||||||
Divider() // 分隔线
|
Divider()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -246,16 +246,16 @@ struct SideMenuView: View {
|
|||||||
MenuItem(icon: "questionmark.app", title: "问题解答", color: .white, isNew: false)
|
MenuItem(icon: "questionmark.app", title: "问题解答", color: .white, isNew: false)
|
||||||
}
|
}
|
||||||
|
|
||||||
Divider() // 分隔线
|
Divider()
|
||||||
|
|
||||||
NavigationLink(destination: SupportView()) {
|
NavigationLink(destination: SupportView()) {
|
||||||
MenuItem(icon: "headphones", title: "联系客服", color: .white, isNew: false)
|
MenuItem(icon: "headphones", title: "联系客服", color: .white, isNew: false)
|
||||||
}
|
}
|
||||||
Divider() // 分隔线
|
Divider()
|
||||||
NavigationLink(destination: AboutUsView()) {
|
NavigationLink(destination: AboutUsView()) {
|
||||||
MenuItem(icon: "info.circle.fill", title: "关于我们", color: .white, isNew: false)
|
MenuItem(icon: "info.circle.fill", title: "关于我们", color: .white, isNew: false)
|
||||||
}
|
}
|
||||||
Divider() // 分隔线
|
Divider()
|
||||||
}).padding()
|
}).padding()
|
||||||
|
|
||||||
Button(action: {
|
Button(action: {
|
||||||
@@ -265,7 +265,7 @@ struct SideMenuView: View {
|
|||||||
alert = Alert(YesOrNOMessage: "确定退出登录吗?", {
|
alert = Alert(YesOrNOMessage: "确定退出登录吗?", {
|
||||||
isLogouting=true
|
isLogouting=true
|
||||||
UserManager.shared.clearUserData()
|
UserManager.shared.clearUserData()
|
||||||
//删除订阅信息
|
// 删除订阅信息
|
||||||
Task {
|
Task {
|
||||||
//await reloadSubscribe()
|
//await reloadSubscribe()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user