js代码
onLoad: function () {
var that = this;
wx.request({
url: 'https://www.fashici.com/wechat/weibos',
method: 'GET',
success: function (res) {
that.setData({
result: res.data.results
})
}
})
}
html代码
<block wx:for-items="{{result}}">
<view style="width:100%; height: 50rpx"></view>
<!--index默认为下标,item为每项-->
<text>{{item.screen_name}}</text>
<text>地址{{item.content}}</text>
</block>