![Alt](https://i-blog.csdnimg.cn/blog_migrate/2ea023d54f8306c540ac45fb400c2144.jpeg)
1、看了几个小程序代码会看到这样的代码(一段轮播图代码)
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
<block wx:for="{{imgUrls}}" wx:key="index">
<swiper-item>
<image src="{{item}}" class="slide-image" />
</swiper-item>
</block>
</swiper>
2、同时js文件中也可以看到这样的代码 请求后端接口代码
wx.request({
url: 'http://www.easy-mock.com/mock/5a1ffb42583969285ab22bb7/orderOnline/orderOnline',
complete: res => {
console.log(res);
app.globalData.classifyList = res.data;
console.log(app.globalData.classifyList);
this.setData({
classifyList: app.globalData.classifyList.myTrump,
newGoods: app.globalData.classifyList.newGoods,
classicGoods: app.globalData.classifyList.classicGoods,
components: app.globalData.classifyList.components,
headLines: app.globalData.classifyList.headLines,
});
},
});