|
@@ -3,7 +3,7 @@
|
|
|
<cu-custom :navbar-data='nvabarData'></cu-custom>
|
|
|
<!-- 采美采购商城 -->
|
|
|
<view :style="{'display':show_index == 0 ?'block':'none'}">
|
|
|
- <seller-home ref="home"></seller-home>
|
|
|
+ <seller-home ref="home" v-if="isHomeData"></seller-home>
|
|
|
</view>
|
|
|
<!-- 商品分类 -->
|
|
|
<view :style="{'display':show_index == 1? 'block':'none'}">
|
|
@@ -18,8 +18,8 @@
|
|
|
<!-- 导航的中间圆圈 -->
|
|
|
<view class="tabBar_list" :style="{paddingBottom:isIphoneX?'40rpx':''}">
|
|
|
<view v-for="(item) in tab_nav_list" :key="item.id" class="tabBar_item" @tap="cut_index(item.id)">
|
|
|
- <image v-if="show_index == item.id" :src="`../../../static/${item.id+1}${item.id+1}.png`"></image>
|
|
|
- <image v-else :src="`../../../static/${item.id+1}.png`"></image>
|
|
|
+ <image v-if="show_index == item.id" :src="item.iconAc"></image>
|
|
|
+ <image v-else :src="item.icon"></image>
|
|
|
<view :class="{'tabBar_name':true,'nav_active':show_index == item.id}">{{item.name}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -39,45 +39,52 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- show_index:0,//控制显示那个组件
|
|
|
+ show_index:2,//控制显示那个组件
|
|
|
isUserData: false,
|
|
|
isCategory: false,
|
|
|
isHomeData: false,
|
|
|
tab_nav_list :[//菜单列表
|
|
|
- {'id':0,'name':'首页'},
|
|
|
- {'id':1,'name':'分类'},
|
|
|
- {'id':2,'name':'我的'}
|
|
|
+ {'id':0,'name':'首页',icon:'../../../static/icon-home@3x.png',iconAc:'../../../static/icon-home-active@3x.png'},
|
|
|
+ {'id':1,'name':'分类',icon:'../../../static/icon-sort@3x.png',iconAc:'../../../static/icon-sort-active@3x.png'},
|
|
|
+ {'id':2,'name':'我的',icon:'../../../static/icon-user@3x.png',iconAc:'../../../static/icon-user-active@3x.png'}
|
|
|
],
|
|
|
nvabarData: { //顶部自定义导航
|
|
|
showCapsule: 0, // 是否显示左上角图标 1表示显示 0表示不显示,
|
|
|
showSearch: 0,
|
|
|
- title: '采美采购商城', // 导航栏 中间的标题
|
|
|
+ title: '账户中心', // 导航栏 中间的标题
|
|
|
},
|
|
|
isIphoneX:this.$store.state.isIphoneX,
|
|
|
CustomBar:this.CustomBar,// 顶部导航栏高度
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
- this.isIphoneX = this.$is_bang
|
|
|
- this.$nextTick(function(){// 一定要等视图更新完再调用方法
|
|
|
- setTimeout(function(){
|
|
|
- this.isHomeData= true//初次加载第一个页面的请求数据
|
|
|
+ this.$nextTick(()=>{// 一定要等视图更新完再调用方法
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.isUserData = true
|
|
|
},100)
|
|
|
})
|
|
|
- console.log("是否为刘海屏",this.isIphoneX )
|
|
|
},
|
|
|
methods: {
|
|
|
// 切换组件
|
|
|
cut_index(type){
|
|
|
this.show_index = type
|
|
|
if(this.show_index == 0){
|
|
|
- this.isHomeData= true
|
|
|
+ this.isHomeData = true
|
|
|
+ this.isUserData = false
|
|
|
+ this.isCategory = false
|
|
|
+ // this.$refs.home.getCheekeyCode()
|
|
|
this.nvabarData.title = '采美采购商城'
|
|
|
}else if(this.show_index == 1){
|
|
|
+ this.isHomeData = false
|
|
|
+ this.isUserData = false
|
|
|
this.isCategory = true
|
|
|
+ // this.$refs.category.getProductCate()
|
|
|
this.nvabarData.title = '商品分类'
|
|
|
}else if(this.show_index == 2){
|
|
|
+ this.isHomeData = false
|
|
|
this.isUserData = true
|
|
|
+ this.isCategory = false
|
|
|
+ // this.$refs.user.initData()
|
|
|
this.nvabarData.title = '账户中心'
|
|
|
}
|
|
|
},
|
|
@@ -119,7 +126,7 @@
|
|
|
margin-bottom:2rpx
|
|
|
}
|
|
|
.tabBar_item{
|
|
|
- width:68rpx;
|
|
|
+ width:150rpx;
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
align-items: center;
|