banner (swiper)
轮播图,首页展示。
-
修改banner高度
注意:
- data 内一定要有空格,不然就会渲染失败。添加
height
配置banner高度。
<template is="banner" data="{{ param:{height: 905, ...origin-param} }}" />
- data 内一定要有空格,不然就会渲染失败。添加
-
修改banner指示点样式
注意:
.banner
是组件顶级根class属性.wx-swiper-dot.wx-swiper-dot-active
必须紧挨着,不能拆开写
/* 默认指示点的样式 */ .banner .wx-swiper-dot { width: 20rpx; height: 15rpx; background: #bbb; border-radius: 20rpx; } /* 选中指示点的样式 */ .banner .wx-swiper-dot.wx-swiper-dot-active { width: 40rpx; background: #ffcccc; }
cat - title
商品分类,首页展示
-
wxml
- 使用 cat.big_pic_url 大图,以达成横向最大的需求。
components\common\index.wxml
<!-- 新版标题 <view class="title-bar flex-y-center flex-x-center"> ...... </view> --> <navigator class="title-bar flex-y-center flex-x-center" url="..." > <image wx:if="{{cat.big_pic_url}}" mode="aspectFit" src="{{cat.big_pic_url}}" /> </navigator>
-
wxss
pages\index
/* #region cat */ .title-bar { position: relative; border: 0; height: 232rpx; } .title-bar image { width: 100%; height: 100%; } /* #endregion */