uView实现全屏选项卡

// 直接复制粘贴即可使用

html 复制代码
<template>
    <view>
        <view class="tabsBox">
            <u-tabs-swiper ref="uTabs" :list="list"
                           :current="current"
                           @change="tabsChange"
                           :is-scroll="false">
            </u-tabs-swiper>
        </view>

        <view>
            <swiper class="swiperBox" :current="swiperCurrent" @transition="transition"
                    @animationfinish="animationFinish">
                <swiper-item class="swiperBox-item">
                    <scroll-view scroll-y @scrolltolower="onReachBottom">
                        反馈信息
                    </scroll-view>
                </swiper-item>

                <swiper-item class="swiperBox-item">
                    <scroll-view scroll-y @scrolltolower="onReachBottom">
                        基础信息
                    </scroll-view>
                </swiper-item>

            </swiper>
        </view>

        <view class="bottomBox">
            <view class="bottomBox-icon">
                <view @click="rejectIt(1)" class="bottomBox-icon-iconBox">
                    <u-icon name="yidongcaozuo-bohui" custom-prefix="custom-icon" color="#1F1F1F"></u-icon>
                    <view> 驳回</view>
                </view>

            </view>
            <view class="bottomBox-box">
                <view class="none" @click='goBack'>取消</view>
                <view class="sure" @click="rejectIt(2)">反馈</view>
            </view>
        </view>
    </view>
</template>

<script>
    export default {
        name: "disposalConfirmationDetail",
        components: {
            // feedbackInfo: () => import("./feedbackInfo"),
            // basicInfo: () => import("./basicInfo"),
        },
        data() {
            return {
                list: [{
                    name: '反馈信息'
                }, {
                    name: '基础信息'
                }],
                current: 0,
                swiperCurrent: 0,
                id: null,
            };
        },
        methods: {
            tabsChange(index) {
                this.swiperCurrent = index;
            },
            transition(e) {
                let dx = e.detail.dx;
                this.$refs.uTabs.setDx(dx);
            },
            animationFinish(e) {
                let current = e.detail.current;
                this.$refs.uTabs.setFinishCurrent(current);
                this.swiperCurrent = current;
                this.current = current;
            },
            onReachBottom() {
            },

            rejectIt(flag) {
                console.log(flag)
            },
            goBack() {
                uni.navigateBack({
                    delta: 1,
                })
            },

        },
        onLoad(option) {
            this.id = option.id
        },
    };
</script>

<style lang="scss" scoped>
    .tabsBox {
        height: 44px;
    }

    .swiperBox {
        height: calc(100vh - var(--window-top) - var(--window-bottom) - 96px - 44px - 2px);
        /*border: 1px solid red;*/

        &-item {
            height: 100%;
            width: 100vw;
        }
    }

    .bottomBox {
        width: 100%;
        position: absolute;
        bottom: 0px;
        height: 96px;
        z-index: 999;
        background: #FFFFFF;
        box-shadow: inset 0px 1px 0px 0px rgba(25, 31, 37, 0.12);
        /*border: 2px solid red;*/
        display: flex;
        justify-content: space-between;

        &-icon {
            width: 55%;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10rpx 60rpx 0;

            &-iconBox {
                display: flex;
                flex-direction: column;
                align-items: center;
                font-size: 28rpx;
                font-family: PingFangSC-Regular, PingFang SC;
                font-weight: 400;
                color: #1F1F1F;
                height: 44px;

                .u-icon {
                    font-size: 40rpx;
                    margin-bottom: 12rpx;
                }
            }
        }

        &-box {
            margin-top: 8px;
            display: flex;
            align-items: center;
            padding: 0 32rpx;
            flex: 1;

            view {
                width: 50%;
                height: 44px;
                border-radius: 4px;
                border: 1px solid rgba(31, 31, 31, 0.1);
                display: flex;
                justify-content: center;
                align-items: center;
                font-size: 34rpx;
                font-family: PingFangSC-Regular, PingFang SC;
                font-weight: 400;
            }

            .none {
                color: #1F1F1F;
                margin-right: 16rpx;
            }

            .none:active {
                background: rgba(31, 31, 31, 0.17);
            }

            .sure {
                background: #3296FA;
                color: #FFFFFF;
            }

            .sure:active {
                background: rgba(32, 116, 212, 1);
            }
        }
    }

</style>
相关推荐
太阳花ˉ4 分钟前
html+css+js实现step进度条效果
javascript·css·html
小白学习日记1 小时前
【复习】HTML常用标签<table>
前端·html
john_hjy1 小时前
11. 异步编程
运维·服务器·javascript
风清扬_jd1 小时前
Chromium 中JavaScript Fetch API接口c++代码实现(二)
javascript·c++·chrome
丁总学Java1 小时前
微信小程序-npm支持-如何使用npm包
前端·微信小程序·npm·node.js
yanlele2 小时前
前瞻 - 盘点 ES2025 已经定稿的语法规范
前端·javascript·代码规范
It'sMyGo2 小时前
Javascript数组研究09_Array.prototype[Symbol.unscopables]
开发语言·javascript·原型模式
懒羊羊大王呀2 小时前
CSS——属性值计算
前端·css
DOKE2 小时前
VSCode终端:提升命令行使用体验
前端
xgq2 小时前
使用File System Access API 直接读写本地文件
前端·javascript·面试