<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ~~~ // pages/move/moremove/moremove.js import utils from "../../../utils/utils"; var http = utils.http; var star = utils.star; const app = getApp(); const douban = app.globalData.doubanUrl; Page({ /** * 頁面的初始數據 */ data: { start: 0, // 定義movies的數據是否為空 isEmpty: true, huan: false }, /** * 生命周期函數--監聽頁面加載 */ onLoad: function (options) { wx.showLoading({ title: '正在加載...', }); // console.log(options); var title = options.title; var type = options.type; var url = douban + type; var huan = wx.getStorageSync(type).huan; // 沒有數據 緩存為空 類型不一致 if (this.data.isEmpty == true && huan == false || huan == undefined) { // http(url, this.handleData); } else { // 獲取緩存 設置緩存 var movies = wx.getStorageSync(type).movies; var title = wx.getStorageSync(type).title; this.setData({ movies, title }) wx.hideLoading(); } /* 設置標題 */ wx.setNavigationBarTitle({ title }); this.setData({ type, }) }, handleData(res) { var title = res.data.title; var subjects = res.data.subjects; var moviess = []; var type = this.data.type subjects.forEach(ele => { var average = ele.rating.average; var stars = star(ele.rating.stars); var title = ele.title; var imgUrl = ele.images.small; var id = ele.id; var temp = { average, stars, title, imgUrl, id }; // console.log(temp) moviess.push(temp); }); // isEmpty定義movies是否為空 if (this.data.isEmpty) { this.setData({ movies: moviess, title, isEmpty: false, huan: true }); // 第一次加載了數據將數據設置在緩存 var huan = this.data.huan; var movies = this.data.movies; var title = this.data.title; wx.setStorageSync(type, { movies, title, huan }); } else { this.setData({ movies: this.data.movies.concat(moviess) }) var huan = this.data.huan; var movies = this.data.movies; var title = this.data.title; wx.setStorageSync(type, { movies, title, huan }); } wx.hideLoading(); }, onReachBottom: function () { var type = this.data.type; this.data.start += 20; var start = this.data.start; var url = `${douban}${type}?start=${start}&count=20`; console.log(url) http(url, this.handleData); //下拉觸發加載 wx.showLoading({ title: "加載數據" }); }, moveDetails(res) { // console.log(res) var id = res.currentTarget.dataset.id; var title = res.currentTarget.dataset.title; // console.log(title) wx.navigateTo({ url: '/pages/move/movedetails/movedetails?id=' + id + "&title=" + title, }) } }) ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看