Commit 9a8becb7 by zhangcheng

调整首页

parent dd7c5b76
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<shopCar></shopCar> <shopCar ref="shopbar"></shopCar>
<tabBar :selectedTabbar="selectedTabbar"></tabBar> <tabBar :selectedTabbar="selectedTabbar"></tabBar>
</view> </view>
</view> </view>
...@@ -126,7 +126,13 @@ import { $EventBus } from '@/utils/EventBus'; ...@@ -126,7 +126,13 @@ import { $EventBus } from '@/utils/EventBus';
}, },
async onShow() { async onShow() {
console.log(1243) console.log(1243)
// 获取首页菜单数据
let shopInfo = this.$store.getters.shopInfo;
if(shopInfo && shopInfo[0].id){
await this.getMenuList(shopInfo[0].id);
}else{
await this.getMenuList(6);
}
let _this = this; let _this = this;
uni.createSelectorQuery() uni.createSelectorQuery()
.select(".menu-banner") .select(".menu-banner")
...@@ -146,17 +152,13 @@ import { $EventBus } from '@/utils/EventBus'; ...@@ -146,17 +152,13 @@ import { $EventBus } from '@/utils/EventBus';
} }
this.getHeightList(); this.getHeightList();
}, },
onHide() {
this.$refs.shopbar.showShopCar=false;
},
onLoad: async function (options) { onLoad: async function (options) {
if(options.orderId){ if(options.orderId){
this.orderId=options.orderId; this.orderId=options.orderId;
} }
// 获取首页菜单数据
let shopInfo = this.$store.getters.shopInfo;
if(shopInfo && shopInfo[0].id){
await this.getMenuList(shopInfo[0].id);
}else{
await this.getMenuList(6);
}
$EventBus.$off('getMenuList') $EventBus.$off('getMenuList')
$EventBus.$on('getMenuList',(data)=>{ $EventBus.$on('getMenuList',(data)=>{
this.shopInfo=data; this.shopInfo=data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment