电影列表页也不能取下面20行了?
改成 wx.request 方式才可以:
getMovieList: function() {
var that = this
wx.showLoading({
title: '加载中',
})
wx.request({
url: `https://frodo.douban.com/api/v2/subject_collection/movie_showing/items?start=${this.data.movieList.length}&count=10&apiKey=054022eaeae0b00e0fc068c0c0a2102a`,
method:"GET",
//header : {},
success:function(res){
console.log(res.data)
if (res.statusCode==200){
that.setData({
movieList:that.data.movieList.concat(res.data.subject_collection_items)
})
}
wx.hideLoading();
},
fail:function(err){
console.error(err)
wx.hideLoading();
}
})
},
获取详情的接口在云函数端应该是不行,详情接口可以在小程序端使用wx.request()来实现。
获取电影列表的接口在云函数端应该是没问题的。
VM8 asdebug.js:1 GET https://frodo.douban.com/api/v2/subject_collection/movie_showing/items?start=0&count=10&apiKey=054022eaeae0b00e0fc068c0c0a2102a 400 (Bad Request)(env: Windows,mp,1.05.2105170; lib: 2.14.1)
这个问题应该怎么解决呀?!!
电影详情页使用wx.request调用函数成功了,获得的detail的返回值为0,是豆瓣限制了吗?还是怎么回事。
wx.request获取不到电影列表。
wx.request({
url: `http://t.yushu.im/v2/movie/in_theaters?apikey=0df993c66c0c636e29ecbb5344252a4a&start=0&count=10`,
method:"GET",
错误如下:
GET http://t.yushu.im/v2/movie/in_theaters?apikey=0df993c66c0c636e29ecbb5344252a4a&start=0&count=10 403 (Forbidden)
第一次可以获取,但是取第二次的20条不行了,还是原来的20条电影记录。