BG大游集团|Home

135-2716-3909
网站建设资讯详细

微信小程□□□序如何使※用swiper制作类似APP引导页

发表日期:2026-06-04 15:01:59   作者来源:BG大游集团   浏览:9617   标签:微信小程序    
大家使用□□□□过的APP,如果是安◥装后第一□□□次打开,百分之八◎十都有引♦导页,主要是几▼张图片切□□换,介绍APP的用途和□□特色。而微信小□□□□程序相对□□□□比较简单,则比较少□□□□出现这种❖引导页,但是如果□□□你的小程□□□□序相对比□□□□较复杂,就需要制□□□作一个类□□似APP引导页,里面放几□□□张图片介□□□□绍如何使♦用小程序。那么具体□□如何制作·呢?

制作要点有以下几点:

1、判断用户□□□□是否第一□□□□次打开小□□程序,只有当第□□□□一次打开□□□才自动跳□□□转到引导□□□□页;
2、使用微信小程序组件swiper切换展示图片;
3、需要有一个“立即体验”的按钮调回主界面。

操作步骤如下:

1、增加页面

在app.json里增加一个引导页界面 "pages/index/guide"

2、guide.wxml代码如下

<swiper class="guide_swiper" indicator-dots="{{indicatorDots}}"
autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
<block wx:for="{{imgUrls}}">
<swiper-item>
<image src="{{item}}" mode='aspectFit' class="slide-image" />
</swiper-item>
</block>
</swiper>
<view class="next_btn" bindtap='goto_next'>
立即体验
</view>

3、guide.wxss如下

page{
background-color:#fff;
}
.guide_swiper{
width:100%;
height:100vh;
}
.slide-image{
margin:0 auto;
height:100vh;
width:100%;
}
.next_btn{
position:fixed;
z-index:1000;
bottom:60rpx;
width:210rpx;
height:60rpx;
line-height:60rpx;
left:270rpx;
font-size:30rpx;
text-align:center;
box-sizing:border-box;
background-color: #33b6ea;
opacity:0.7;
color:#fff;
border-radius:30rpx;
}

4、guide.js代码如下

Page({
data: {
imgUrls: [
'图片地址1',
'图片地址2',
'图片地址3',
'图片地址4',
'图片地址5'
],
indicatorDots: true,
autoplay: false,
interval: 5000,
duration: 300
},
goto_next:function(val) {
wx.redirectTo({
url: '/pages/index/index'
})
}
})


这样就做好了一个小程序的引导页。

小程序引导页

BG大游集团专注于微信小程序定制开发,欢迎广大客户咨询。
如没特殊注明,文章均为BG大游集团原创,转载请注明来自https://www.yichuanlaw.com/news/4177.html