https://www.jb51.net/article/163813.htm
https://www.jianshu.com/p/5c1a7f2a4e49
Page({
data: {
motto: '你懂我懂不懂',
list:[]
},
onload:function()
{
this.onRequest();
},
onRequest:function()
{
var that = this;
wx.request({
url: 'https://api.douban.com/v2/movie/top250',
method:"GET",
header: {
'Content-Type': 'json'
},
success: function (res) {
console.log(res.data.subjects);
let datas = res.data.subjects;
that.setData({
list: datas
})
},
fail: function () {
console.log("接口调用失败");
}
})
},
nextPage:function()
{
console.log("下拉触发该函数");
},
//事件处理函数
bindViewTap: function () {
wx.navigateTo({
url: '../logs/logs'
})
},
})