master
hua 4 years ago
parent 5a79705fa5
commit 8def448ca7
  1. 9
      Weibo/ContentView.swift
  2. 4
      Weibo/LoginView.swift

@ -19,16 +19,9 @@ struct ContentView: View {
@State var selection=2 @State var selection=2
var body: some View { var body: some View {
TabView(selection: self.$selection) { TabView(selection: self.$selection) {
if self.user.access_token==nil{ if (self.user.access_token != nil){
IndexView().tabItem { VStack {
Image("house")
Text("首页")
.foregroundColor(Color.black)
} }.tag(1).hidden()
}else{
IndexView().tabItem { VStack { IndexView().tabItem { VStack {
Image("house") Image("house")
Text("首页") Text("首页")

@ -86,12 +86,12 @@ struct UserView:View {
var body:some View{ var body:some View{
VStack { VStack {
HStack { HStack {
ImageView(imageUrl: self.user.avatar_hd!) ImageView(imageUrl: self.user.avatar_hd ?? "")
.frame(width: 60.0, height: 60.0) .frame(width: 60.0, height: 60.0)
.clipShape(/*@START_MENU_TOKEN@*/Circle()/*@END_MENU_TOKEN@*/) .clipShape(/*@START_MENU_TOKEN@*/Circle()/*@END_MENU_TOKEN@*/)
VStack { VStack {
Text(self.user.name!) Text(self.user.name!)
Text("简介:\(self.user.desc!)") Text("简介:\(self.user.desc ?? "")")
} }
Spacer() Spacer()
Button(action: { Button(action: {

Loading…
Cancel
Save