Browse Source

组件

master
tianyi 4 weeks ago
parent
commit
4416586f08
  1. 36
      pages/index/index.vue

36
pages/index/index.vue

@ -401,14 +401,14 @@
</view>
</view>
<view class="swiper-page" v-if="currentIndex == 1">
<de-livery></de-livery>
<view class="swiper-page" v-show="currentIndex == 1">
<de-livery ref="deLiveryPage"></de-livery>
</view>
<view class="swiper-page" v-if="currentIndex == 3">
<post-list></post-list>
<view class="swiper-page" v-show="currentIndex == 3">
<post-list ref="postListPage"></post-list>
</view>
<view class="swiper-page" v-if="currentIndex == 4">
<my-center></my-center>
<view class="swiper-page" v-show="currentIndex == 4">
<my-center ref="myCenterPage"></my-center>
</view>
</view>
<!-- 弹出区域选择 -->
@ -727,14 +727,26 @@
},
//tab
changeIndex(index) {
if (index == 2) {
uni.navigateTo({
url: '/package1/tabbar/release'
})
return
}
let that = this;
this.lastIndex = this.currentIndex
this.currentIndex = index
switch (index) {
case 1:
console.log(that.$refs)
that.$refs.deLiveryPage.init()
break;
case 2:
uni.navigateTo({
url: '/package1/tabbar/release'
})
break;
case 3:
that.$refs.postListPage.init()
break;
case 4:
that.$refs.myCenterPage.init()
break;
}
}
}
}

Loading…
Cancel
Save