zhengkaixin 3 роки тому
батько
коміт
b32b303222

+ 5 - 0
components/Tabbar.vue

@@ -49,6 +49,9 @@
 			};
 			
 		},methods:{
+			setcount(c){
+				this.myCurrent=c
+			},
 			beforeSwitch(index){
 			
 				
@@ -72,8 +75,10 @@
 		},mounted(){
 			
 		},destroyed(){
+			
 		}
 		
+		
 	}
 </script>
 

+ 8 - 1
pages/index/index.vue

@@ -217,7 +217,7 @@
 				<text class="button" @click="toLogin">登录/注册</text>
 			</view>
 		</view>
-		<Tabbar :current="0"></Tabbar>
+		<Tabbar :current="0" ref="tabbarMain" ></Tabbar>
 	</view>
 </template>
 
@@ -291,6 +291,13 @@
 			if (this.newsList.length < this.recordsTotal) {
 				this.myLoadmore();
 			}
+		},
+		onShow() {
+			if(this.$refs.tabbarMain){
+				this.$refs.tabbarMain.setcount(0);
+			}
+			
+			
 		},
 		onReady() {
 			if (this.carhelp.getPersonInfo()) {

+ 1 - 1
pages/login/welcome.vue

@@ -43,7 +43,7 @@
 		data() {
 			return {
 				isReady:true,
-				step:3,
+				step:2,
 				imgH:'',
 				imgmode:true
 			}

+ 4 - 1
pages/searchPile/searchPile.vue

@@ -254,7 +254,7 @@
 		</view>
 		 
 		
-		<Tabbar :current="1"></Tabbar> 
+		<Tabbar :current="1"  ref="tabbarMain"></Tabbar> 
 	</view>
 </template>
 
@@ -426,6 +426,9 @@ export default {
 		//		console.log('latitude3  '+this.latitude)
 	},
 	onShow() {
+		if(this.$refs.tabbarMain){
+			this.$refs.tabbarMain.setcount(1);
+		}
 		
 //		console.log('onShow')
 		if (this.isReady) {

+ 5 - 2
pages/user/index.vue

@@ -104,7 +104,7 @@
 			</view>
 		</view>
 		
-		<Tabbar :current="2"></Tabbar>
+		<Tabbar :current="2"  ref="tabbarMain" ></Tabbar>
 	</view>
 </template>
 
@@ -144,7 +144,10 @@
 				this.getUserInfo();
 				this.getCouponList();
 			}
-			
+			if(this.$refs.tabbarMain){
+				this.$refs.tabbarMain.setcount(2);
+			}
+				
 			this.elderStatus=this.carhelp.get("getElderModeClass");
 		},
 		onReady() {