1、底部的tabBar
可设置的属性有color、selectedColor、borderStyle、backgroundColor、list至少2个,最多5个(其属性有pagePath、text、iconPath、selectedIconPath等)
效果如下图所示:

2、滑块视图容器swiper
滑块视图容器。
属性名
类型
默认值
说明
最低版本
indicator-dots
Boolean
false
是否显示面板指示点
indicator-color
Color
rgba(0, 0, 0, .3)
指示点颜色
<a href="https://mp.weixin.qq.com/debug/wxadoc/dev/framework/compatibility.html">1.1.0</a>
indicator-active-color
#000000
当前选中的指示点颜色
autoplay
是否自动切换
current
Number
当前所在页面的 index
interval
5000
自动切换时间间隔
duration
500
滑动动画时长
circular
是否采用衔接滑动
vertical
滑动方向是否为纵向
bindchange
EventHandle
current 改变时会触发 change 事件,event.detail = {current: current, source: source}
从公共库v1.4.0开始,<code>change</code>事件返回<code>detail</code>中包含一个<code>source</code>字段,表示导致变更的原因,可能值如下:
<code>autoplay</code> 自动播放导致swiper变化;
<code>touch</code> 用户划动引起swiper变化;
其他原因将用空字符串表示。
注意:其中只可放置<code><swiper-item/></code>组件,否则会导致未定义的行为。
仅可放置在<code><swiper/></code>组件中,宽高自动设置为100%。
示例代码:
3、豆瓣API
在浏览器中输入豆瓣电影接口地址
http://api.douban.com/v2/movie/in_theaters
然后F12,打开调试窗口,选择Console,输入var a=接口返回的json串,如下图所示:
然后回车,再输入a,再回车,即可看到已经格式化的JSON对象,如下图所示:
3、从接口获取数据进行绑定
4、加载进度条
5、如果出现请求的URL地址不在合法域名列表中的话,会出现如下问题:
解决方案:打开小程序微信公众平台设置小程序开发设置,配置服务器合法域名(必须是https),如下图所示: