uview tabsSwiper 全屏选项卡 的简单例子

<template>
    <view>
        <view class="wrap">
            <view class="u-tabs-box">
                <u-tabs-swiper activeColor="#f29100" ref="tabs" :list="list" :current="current" @change="change" :is-scroll="false" swiperWidth="750"></u-tabs-swiper>
            </view>
            <swiper class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
                <swiper-item class="swiper-item">
                    <scroll-view scroll-y style="height: 100%;width: 100%;">
                        
                            
                                
                                 
                                
                                    <view >待付款</view>
                                    
                                
                            
                            
                        
                    </scroll-view>
                </swiper-item>
                <swiper-item class="swiper-item">
                    <scroll-view scroll-y style="height: 100%;width: 100%;"   >
                        
                            
                                
                                 
                                
                                    
                                    <view >代发货</view>
                                    
                                
                            
                            
                    </scroll-view>
                </swiper-item>
                <swiper-item class="swiper-item">
                    <scroll-view scroll-y style="height: 100%;width: 100%;">
                        
                            
                                    <view >待收货</view>
                                
                    </scroll-view>
                </swiper-item>
                <swiper-item class="swiper-item">
                    <scroll-view scroll-y style="height: 100%;width: 100%;"   >
                        
                            
                                    
                                    <view >待评价</view>
                            
                            
                        
                    </scroll-view>
                </swiper-item>
            </swiper>
        </view>
    </view>
</template>

<script>
export default {
    data() {
        return {
            
            
            list: [
                {
                    name: '待付款'
                },
                {
                    name: '待发货'
                },
                {
                    name: '待收货'
                },
                {
                    name: '待评价',
                    count: 12
                }
            ],
            current: 0,
            swiperCurrent: 0,
            tabsHeight: 0,
            dx: 0,
            
        };
    },
    
    
    methods: {
        
        
        
        // tab栏切换
        change(index) {
            this.swiperCurrent = index;
            
        },
        transition({ detail: { dx } }) {
            this.$refs.tabs.setDx(dx);
        },
        animationfinish({ detail: { current } }) {
            this.$refs.tabs.setFinishCurrent(current);
            this.swiperCurrent = current;
            this.current = current;
        }
    }
};
</script>

<style>
/* #ifndef H5 */
page {
    height: 100%;
    background-color: #f2f2f2;
}
/* #endif */
</style>

<style lang="scss" scoped>

.wrap {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--window-top));
    width: 100%;
    
}

</style>