Browse Source

组件

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

32
pages/index/index.vue

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

Loading…
Cancel
Save