Browse Source

样式修改

lilei 3 years ago
parent
commit
1bd83d9b4a
2 changed files with 23 additions and 16 deletions
  1. 1 16
      App.vue
  2. 22 0
      pages/index/index.vue

+ 1 - 16
App.vue

@@ -20,22 +20,7 @@
 			this.$config('init');
 		},
 		onLaunch: function() {
-			 const theme = getApp().globalData.theme
-			 uni.setTabBarStyle({
-			   color: this.$config("topBarTitleColors"),
-			   selectedColor: this.$config("primaryColor"),
-			   borderStyle: 'white'
-			 })
-			 uni.setTabBarItem({
-			   "index": 0,
-			   "iconPath": "static/"+theme+"/tabbar/record.png",
-			   "selectedIconPath": "static/"+theme+"/tabbar/record-active.png",
-			 })
-			 uni.setTabBarItem({
-			   "index": 1,
-			   "iconPath": "static/"+theme+"/tabbar/user.png",
-			   "selectedIconPath": "static/"+theme+"/tabbar/user-active.png",
-			 })
+			console.log('App launch')
 		},
 		onShow: function() {
 			console.log('App Show')

+ 22 - 0
pages/index/index.vue

@@ -13,6 +13,28 @@
 				
 			}
 		},
+		onLoad() {
+			// 设置底部tabbar 样式
+			const theme = getApp().globalData.theme
+			uni.setTabBarItem({
+			  "index": 0,
+			  "iconPath": "static/"+theme+"/tabbar/record.png",
+			  "selectedIconPath": "static/"+theme+"/tabbar/record-active.png",
+			})
+			uni.setTabBarItem({
+			  "index": 1,
+			  "iconPath": "static/"+theme+"/tabbar/user.png",
+			  "selectedIconPath": "static/"+theme+"/tabbar/user-active.png",
+			})
+			uni.setTabBarStyle({
+			  color: this.$config("topBarTitleColors"),
+			  selectedColor: this.$config("primaryColor"),
+			  borderStyle: 'white',
+			  complete: function(res){
+				console.log(res)
+			  }
+			})
+		},
 		onShow() {
 			
 		},