小程序首页轮播图设计

效果图

微信小程序的数据详解

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;
}
相关推荐
熊猫钓鱼>_>5 小时前
中国版Cursor,基于腾讯云CodeBuddy的节日推荐小程序的智能化开发实践
小程序·腾讯云·节日
AC-PEACE6 小时前
小程序初始化加载时间优化 步骤思考与总结
react.js·小程序·前端框架
说私域6 小时前
桑德拉精神与开源链动2+1模式AI智能名片S2B2C商城小程序的协同价值研究
人工智能·小程序·开源·零售
说私域9 小时前
基于开源AI大模型与S2B2C生态的个人品牌优势挖掘与标签重构研究
人工智能·小程序·开源·零售
wx_cxc28486989189 小时前
商城小程序源码介绍
微信小程序·小程序
菜鸟una11 小时前
【taro3 + vue3 + webpack4】在微信小程序中的请求封装及使用
前端·vue.js·微信小程序·小程序·typescript·taro
HumoChen991 天前
GZip+Base64压缩字符串在ios上解压报错问题解决(安卓、PC模拟器正常)
android·小程序·uniapp·base64·gzip
qq_12498707531 天前
原生小程序+springboot+vue医院医患纠纷管理系统的设计与开发(程序+论文+讲解+安装+售后)
java·数据库·spring boot·后端·小程序·毕业设计
小新1101 天前
微信小程序 密码框改为text后不可见,需要点击一下
微信小程序·小程序·notepad++
Maitians1 天前
微信小程序 自定义图片分享-绘制数据图片以及信息文字
微信小程序·小程序