小程序首页轮播图设计

效果图

微信小程序的数据详解

indicator-dots:是否显示面板指示点【默认false 】

indicator-color:指示点颜色【默认rgba(0, 0, 0, .3)】

indicator-active-color:当前选中的指示点颜色【默认#000000】

autoplay:是否自动切换【默认false】

interval:自动切换时间间隔【默认5000】

duration:滑动动画时长【默认500】

circular:是否采用衔接滑动【默认false】

vertical:滑动方向是否为纵向【默认false】

源码如下

index.wxml

html 复制代码
<view class="index-container">
  <view class="index-header">
    <van-search value="{{ searchInfo }}" shape="round" background="#9c7bf0" placeholder="请输入搜索内容" />
    <view class="index-swiper">
      <swiper class="myswiper" indicator-dots="true" indicator-color="#fff" indicator-active-color="#9c7bf0" autoplay="true" interval="5000" duration="500" circular="true">
        <swiper-item>
          <image class="swiper-img" mode="heightFix" src="../../images/swiper/shop1.png"></image>
        </swiper-item>
        <swiper-item>
          <image class="swiper-img" mode="heightFix" src="../../images/swiper/shop2.png"></image>
        </swiper-item>
      </swiper>
    </view>
  </view>
</view>

index.wxss

css 复制代码
.index-header {
  background-image: linear-gradient(to bottom right, rgb(114, 135, 254), rgb(130, 88, 186));
  width: 100%;
  height: 190px;
  border-bottom-left-radius: 100%;
  border-bottom-right-radius: 100%;
}
.index-swiper{
  padding: 10px;
}
.swiper-img {
  height: 140px;
}
相关推荐
万岳科技系统开发7 小时前
外卖系统选型与源码与 SaaS 实践的思考
数据库·小程序
bug总结10 小时前
小程序云函数 vs 传统前后端分离(阿里云)原理解析
阿里云·小程序·云计算
2501_9339072111 小时前
如何通过上海本凡科技获得优质的小程序开发服务?
科技·微信小程序·小程序
a17798877121 天前
小程序上传图像失败
小程序·c#
花卷HJ1 天前
微信小程序国际化完整方案
微信小程序·小程序·notepad++
2501_916008891 天前
2026 iOS 证书管理,告别钥匙串依赖,构建可复制的签名环境
android·ios·小程序·https·uni-app·iphone·webview
土土哥V_araolin1 天前
十二星商城小公排系统开发
小程序·个人开发·零售
hashiqimiya1 天前
微信小程序--动态切换登录注册标签页
微信小程序·小程序
hashiqimiya1 天前
微信小程序--获取验证码设计倒计时灰白色
微信小程序·小程序
weixin_lynhgworld1 天前
电商营销新风口,淘宝扭蛋机小程序引爆流量与转化
小程序