小程序首页轮播图设计

效果图

微信小程序的数据详解

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;
}
相关推荐
千寻技术帮12 小时前
基于小程序的旅游管理系统(源码+脚本+文档)_50033
mysql·小程序·springboot·旅游·旅游管理系统
AI源码13 小时前
乡村振兴三农小程序
小程序·notepad++
千寻技术帮14 小时前
基于微信小程序的家政服务系统(源码+脚本+文档)_50039
mysql·微信小程序·小程序·毕业设计·家政服务
cooldream200915 小时前
计算机专业本科毕业设计系列05——类型②:移动应用与小程序
小程序·毕业设计·课程设计
源码手记18 小时前
基于微信小程序的购物商城系统-毕设源码
微信小程序·小程序·课程设计
SXkehuirongsheng18 小时前
太原做小程序定制的服务商是否支持源码交付?
小程序
源码手记2 天前
基于微信小程序的上门代厨厨师预约系统-毕设源码
微信小程序·小程序·课程设计
微订校园外卖系统2 天前
自建自营小程序落地前,先把订单状态机与试单链路跑通
小程序·外卖系统·本地生活·微订
千寻技术帮2 天前
基于微信小程序的点餐管理系统_50044(源码+脚本+文档)
mysql·微信小程序·小程序·毕业设计·springboot·点餐管理系统
AI源码2 天前
中医药文化介绍小程序
小程序·notepad++