@@ -20,10 +20,11 @@ struct WeatherMainView: View {
2020 Text ( self . _vm. model? . now? . address ?? " " ) . font ( Font . system ( size: 20.0 ) ) . fontWeight ( . semibold)
2121 Button ( action: {
2222 print ( " aaa " )
23+
2324 } ) {
2425 Image ( systemName: " plus.circle.fill " )
2526 }
26- } . frame ( height: kNavBarHeight) . offset ( x : 0.0 , y: 10.0 )
27+ } . frame ( height: kNavBarHeight) . offset ( y: 10.0 )
2728
2829 ScrollView {
2930 VStack ( alignment: . leading) {
@@ -44,16 +45,7 @@ struct WeatherMainView: View {
4445 }
4546 }
4647
47- // Button(action: {
48- // self._isLoading.toggle()
49- // if self._isLoading {
50- // self._vm.loadData()
51- // }
52- // }) {
53- // Text(self._isLoading ? "加载" : "刷新")
54- // }.frame(width: 60.0, height: 60.0, alignment: .center).background(Color.black.opacity(0.6)).cornerRadius(30.0)
55-
56- } . foregroundColor ( Color . white) . background ( WebImage ( self . _vm. model? . now? . skin, configuration: { $0. resizable ( ) } ) . scaledToFill ( ) . edgesIgnoringSafeArea ( . all) ) . edgesIgnoringSafeArea ( . all) . statusBar ( hidden: false ) . onAppear {
48+ } . foregroundColor ( Color . black) . background ( WebImage ( self . _vm. model? . now? . skin, configuration: { $0. resizable ( ) } ) . scaledToFill ( ) . edgesIgnoringSafeArea ( . all) ) . edgesIgnoringSafeArea ( . all) . statusBar ( hidden: false ) . onAppear {
5749
5850 self . _vm. loadData ( )
5951 NotificationCenter . default. addObserver ( forName: UIApplication . didBecomeActiveNotification, object: nil , queue: OperationQueue . current) { ( _) in
@@ -96,10 +88,12 @@ struct AqiView: View {
9688 Circle ( ) . fill ( Color ( r: 76 , g: 60 , b: 134 ) )
9789 }
9890 } . frame ( width: 30.0 , height: 30.0 )
99- WebImage ( self . vm. model? . now? . aqiIcon) . frame ( width: 14.0 , height: 14.0 ) . scaledToFit ( )
91+ WebImage ( self . vm. model? . now? . aqiIcon) { ( img) -> Image in
92+ return img. resizable ( )
93+ } . frame ( width: 15.0 , height: 15.0 )
10094 }
101- Text ( " \( self . vm. model? . now? . aqi ?? 0 ) " ) . foregroundColor ( Color . white ) . fontWeight ( . semibold)
102- Text ( self . vm. model? . now? . aqiDesc ?? " " ) . foregroundColor ( Color . white ) . fontWeight ( . semibold)
95+ Text ( " \( self . vm. model? . now? . aqi ?? 0 ) " ) . fontWeight ( . semibold)
96+ Text ( self . vm. model? . now? . aqiDesc ?? " " ) . fontWeight ( . semibold)
10397 } . padding ( . init( top: 0.0 , leading: 8.0 , bottom: 0.0 , trailing: 16.0 ) ) . frame ( height: 42.0 ) . background ( Color . black. opacity ( 0.3 ) ) . cornerRadius ( 26.0 )
10498 }
10599}
@@ -115,7 +109,7 @@ struct TipsView: View {
115109 } . background ( Color . black. opacity ( 0.3 ) ) . cornerRadius ( 15.0 )
116110
117111 Text ( self . vm. model? . now? . tips ?? " " ) . fontWeight ( . semibold)
118- } . foregroundColor ( Color . white ) . font ( Font . system ( size: 16.0 ) )
112+ } . font ( Font . system ( size: 16.0 ) )
119113 }
120114}
121115
@@ -168,7 +162,7 @@ struct FutureView: View {
168162// MARK: -文字内容样式
169163struct ContentTextModifier : ViewModifier {
170164 func body( content: Content ) -> some View {
171- content. font ( Font . system ( size: 16.0 ) ) . foregroundColor ( Color . white )
165+ content. font ( Font . system ( size: 16.0 ) )
172166 }
173167}
174168
0 commit comments