【重要】最新電影API地址~~~
近期電影接口有所調整,請大家認真閱讀下面的修改。
完整代碼請查看該課程主頁右邊的資料下載中的課程源碼。
1、修改movielist云函數,cloudfunctions/movielist/index.js文件,把獲取電影列表接口地址改為:
`https://frodo.douban.com/api/v2/subject_collection/movie_showing/items?start=${event.start}&count=${event.count}&apiKey=054022eaeae0b00e0fc068c0c0a2102a`
修改之后請重新上傳云函數
2、修改 miniprogram/pages/movie/movie.js文件中調用云函數成功的代碼:
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).subject_collection_items)
????});
????wx.hideLoading();
}).catch(err => {
????console.error(err);
????wx.hideLoading();
});
3、修改miniprogram/pages/movie/movie.wxml中顯示的屬性名稱(顯示屬性的名稱是根據云函數的返回值來寫的):
(1)圖片路徑改為:
<image class="movie-img" src="{{item.cover.url}}"></image>
(2)觀眾評分改為:
<text class="movie-score"> {{item.rating.value}}分</text>
(3)主演改為:
<text wx:key="index" wx:for="{{item.actors}}">{{item}} </text>
4、修改getDetail云函數,cloudfunctions/getDetail/index.js文件,把獲取電影詳情接口地址改為:
`https://frodo.douban.com/api/v2/movie/${event.movieid}?apiKey=054022eaeae0b00e0fc068c0c0a2102a`
修改之后請重新上傳云函數
5、修改miniprogram/pages/comment/comment.wxml文件中顯示的屬性名稱(顯示屬性的名稱是根據云函數的返回值來寫的):
(1)detail-container對應的背景圖片路徑改為:
<view class='detail-container' style='background: url({{detail.cover.image.large.url}}) no-repeat ?top/cover'></view>
(2)圖片路徑修改為:
<image src="{{detail.cover.image.normal.url}}" class='detail-img'></image>
(3)detail.original_title修改為:
<view>{{detail.aka[0]}}</view>
(4)電影簡介修改為:
<view class='desc'>{{detail.intro}}</view>
2021-06-08
2021-03-16
請大家查看最新的課程公告:
2021-03-16
獲取詳情的接口在云函數端應該是不行,是豆瓣那邊做了限制,詳情接口可以在小程序端使用wx.request()來實現。
2021-06-07
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)
這個問題應該如何解決??。?/p>
2021-02-23
接口又用不了了老師
2021-01-27
詳情頁面不出怎么辦,老師希望可以解決這個問題
2021-01-15
厲害了!?
2020-10-19
老師,電影詳情的接口應該是掛了,看了源碼也是不行,老師什么時候可以更新一下電影詳情的接口?
2020-10-04
電影詳情頁面好像又返回不到數據了,顯示為空
2020-09-29
# TMDb API
https://developers.themoviedb.org/3/getting-started/introduction