老師result是空值還報錯怎么辦


onLoad: function (options) {
wx.cloud.callFunction({
name:'movieList',
data:{
start:this.data.movieList.length,
count:10
}
}).then(res=>{
// console.log(res);
this.setData({
movieList: this.data.movieList.concat(JSON.parse(res.result).subjects)
});
}).catch(err=>{
console.error(err);
})
},
2019-05-16
你現在使用的API我不確定是否好用,但我推薦給你那個肯定是好用的,把http://api.douban.com/v2/movie/in_theaters?apikey=0df993c66c0c636e29ecbb5344252a4a&start=0&count=10?粘貼到瀏覽器里是有結果返回的,說明接口沒有問題,那問題應該就出現在代碼上。
1、確定API確實改成了我給你的這個
2、確定云函數上傳成功了
3、在云控制臺中進行云端測試,看結果是否是正確的
4、在小程序端輸出這個res,看結果是什么
2019-05-22
rp(`https://api.douban.com/v2/movie/in_theaters?apikey=0df993c66c0c636e29ecbb5344252a4a&start=${event.start}&count=${event.count}`)
2019-05-16
對比我的看下,我這個是可以,盡量不要換行,開始的時候換行了也是不行,寫在一行就沒問題了,你試試
2019-05-16
把url改成http://api.douban.com/v2/movie/in_theaters?apikey=0df993c66c0c636e29ecbb5344252a4a&start=0&count=10也沒有用