引導(dǎo)頁(yè)

說明

  1. nvue不支持App.vue中引用的公共樣式
  2. 去掉原生導(dǎo)航條
{
    "path": "pages/guide",
    "style": {
        "navigationStyle": "custom"
    }
},

代碼

<template>
    <swiper :style="{'height':`${windowHeight}px`}" :current="current" @change="changeGuide">
        <swiper-item class="guide" v-for="(item,index) in list" :key="index">
            <view class="guide-item-image">
                <image class="image" :src="item.image" mode=""></image>
            </view>
            <view class="guide-item-text">
                <text class="text-1">{{item.text1}}</text>
                <text class="text-2">{{item.text2}}</text>
            </view>
            <view class="btn" v-if="current==list.length-1" :style="{'width':`${windowWidth}px`}">
                <text class="btn-text">立即開啟</text>
            </view>
            <view class="scroll-tag" :style="{'width':`${windowWidth}px`}" v-if="current==index">
                <view :class="indexTag==current?'tag-line':'tag-point'" v-for="(itemTag,indexTag) in list" :key="indexTag" />
            </view>
        </swiper-item>
        
    </swiper>
</template>

<script>
    export default {
        data() {
            return {
                windowWidth: 0,
                windowHeight: 0,
                current:0,
                list:[{
                    text1:'輕快 便捷 豐富 實(shí)惠',
                    text2:'移動(dòng)OA 您的生活辦公好幫手',
                    image:'../static/guide/guide-1.png'
                },{
                    text1:'優(yōu)惠連綿不斷 功能一如既往',
                    text2:'充值打折 玩轉(zhuǎn)流量 寬帶優(yōu)惠 消費(fèi)查詢',
                    image:'../static/guide/guide-2.png'
                },{
                    text1:'多姿多彩好生活',
                    text2:'生活繳費(fèi) 社保查詢',
                    image:'../static/guide/guide-3.png'
                },{
                    text1:'優(yōu)質(zhì)特產(chǎn)歡樂購(gòu)',
                    text2:'豐富的原生態(tài)產(chǎn)品',
                    image:'../static/guide/guide-4.png'
                }]
            }
        },
        onLoad() {
            const res = uni.getSystemInfoSync();
            //console.log(res);
            this.windowHeight = res.windowHeight;
            this.windowWidth = res.windowWidth;
        },
        methods: {
            changeGuide(e){
                console.log(e.detail.current);
                this.current=e.detail.current;
            }
        }
    }
</script>

<style lang="scss" scoped>
    .guide {
        align-items: center;

        .guide-item-image {
            justify-content: flex-end;
            height: 400px;

            .image {
                height: 280px;
                width: 280px;
            }
        }

        .guide-item-text {
            align-items: center;
            padding: 20px;

            .text-1 {
                font-size: 18px;
                color: #262626;
            }

            .text-2 {
                padding: 5px;
                font-size: 14px;
                color: #595959;
            }
        }
        .btn{
            flex-direction: row;
            justify-content: center;
            position: fixed;
            bottom: 80px;
            .btn-text{
                background-color: #409EFF;
                color: #FFFFFF;
                font-size: 16px;
                padding: 5px 30px;
                border-radius: 20px;
            }
        }
        

        .scroll-tag {
            flex-direction: row;
            justify-content: center;
            position: fixed;
            bottom: 50px;

            .tag-line {
                height: 6px;
                width: 18px;
                border-radius: 3px;
                background-color: #409EFF;
                margin: 0 4px;
            }

            .tag-point {
                height: 6px;
                width: 6px;
                border-radius: 3px;
                background-color: #bae3ff;
                margin: 0 4px;
            }
        }
    }
    
</style>

引導(dǎo)頁(yè)需要資源

guide-1.png
guide-2.png
guide-3.png
guide-4.png
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • uni-app框架介紹 介紹 uni-app 是一個(gè)跨端開發(fā)框架,一套代碼運(yùn)行多個(gè)平臺(tái),并可以使用條件編譯實(shí)現(xiàn)不同...
    Jagtu閱讀 13,598評(píng)論 0 0
  • 什么是 uni-app uni-app是一個(gè)使用vue的語(yǔ)法 + 微信小程序的標(biāo)簽和API的跨平臺(tái)前端框架,開發(fā)者...
    hh_虎閱讀 42,493評(píng)論 0 9
  • 首先在 pages.json 里配置,引導(dǎo)頁(yè)放在第一顯示頁(yè)并禁用原生導(dǎo)航欄 設(shè)置 intro.vue 頁(yè)面樣式,...
    晚安_bd35閱讀 5,811評(píng)論 0 1
  • 16宿命:用概率思維提高你的勝算 以前的我是風(fēng)險(xiǎn)厭惡者,不喜歡去冒險(xiǎn),但是人生放棄了冒險(xiǎn),也就放棄了無數(shù)的可能。 ...
    yichen大刀閱讀 7,682評(píng)論 0 4
  • 公元:2019年11月28日19時(shí)42分農(nóng)歷:二零一九年 十一月 初三日 戌時(shí)干支:己亥乙亥己巳甲戌當(dāng)月節(jié)氣:立冬...
    石放閱讀 7,412評(píng)論 0 2

友情鏈接更多精彩內(nèi)容