<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之旅 廣告
                ### 將請求函數封裝實現瀑布流 ~~~ //index.js //獲取應用實例 const app = getApp() Page({ data: { list: [], count: 0, show:false }, onLoad() { this.http() }, onReachBottom: function () { // 到底部下拉加載時最上方顯示加載圖標 wx.showNavigationBarLoading(); var self = this; self.setData({ count: self.data.count + 20, }); this.http() }, http() { var self = this; wx.request({ // url: 'https://www.easy-mock.com/mock/5bac6e450132334db716717d/test/test', url: `https://douban.uieee.com/v2/movie/top250?start${self.data.count}&count=${self.data.count + 20}`, header: { 'Content-Type': 'json' }, success: function (res) { // var dat=res.data; var data = res.data.subjects; var list = []; for (let key in data) { var temp = {}; // console.log(data[key]); temp.title = data[key].title; temp.images = data[key].images.small; temp.average = data[key].rating.average; list.push(temp); } // console.log(list) self.setData({ list, /頁面加載時取消加載圖標 show:true }); // 當加載完畢時取消頂部加載圖標 wx.hideNavigationBarLoading() } }); } }) ~~~ ### index.js(未封裝) ~~~ //index.js //獲取應用實例 const app = getApp() Page({ data:{ list:[], count:0, show:false }, onLoad(){ var self=this; wx.request({ // url: 'https://www.easy-mock.com/mock/5bac6e450132334db716717d/test/test', url: `https://douban.uieee.com/v2/movie/top250?start${self.data.count}&count=${self.data.count+20}`, header: { 'Content-Type': 'json' }, success: function(res) { // var dat=res.data; var data=res.data.subjects; // var data=res.data.data; // self.setData({ // data, // }); // console.log(res) // console.log(data); // temp.title=; var list=[]; for(let key in data){ var temp={}; // console.log(data[key]); temp.title=data[key].title; temp.images=data[key].images.small; temp.average=data[key].rating.average; list.push(temp); } //console.log(list) self.setData({ list, /頁面加載時取消加載圖標 show:true }); } }); }, //當頁面滑到最底部時觸發的事件(請求數據部分和上面的onload里面的求一樣) onReachBottom: function () { // 到底部下拉加載時最上方顯示加載圖標 wx.showNavigationBarLoading(); var self=this; // console.log(this.data.count) self.setData({ count:self.data.count+20, }); // console.log(this.data.count) // console.log(this.data.list); // var count =20; wx.request({ url: `https://douban.uieee.com/v2/movie/top250?start${self.data.count}&count=${self.data.count+20}`, header: { 'Content-Type': 'json' }, success: function(res){ // console.log(res); var data=res.data.subjects; var list=[]; for(let key in data){ var temp={}; // console.log(data[key]); temp.title=data[key].title; temp.images=data[key].images.small; temp.average=data[key].rating.average; list.push(temp); } self.setData({ list, /頁面加載時取消加載圖標 show:true }); // 當加載完畢時取消頂部加載圖標 wx.hideNavigationBarLoading() } }) } }) ~~~ 代碼詳情 ~~~ <loading hidden="{{show}}"></loading> <view class="cont"> <block wx:for="{{list}}" wx:key="index"> <view class="content"> <!-- <view>{{item.images.small}}</view> --> <image src="{{item.images}}" /> <view class="pf">{{item.title}}</view> <text>評分:{{item.average}}</text> </view> </block> </view> /**index.wxss**/ .cont image{ width: 200rpx; height: 280rpx; margin-bottom: 10rpx; } .cont{ display: flex; flex-wrap: wrap; justify-content:space-around; } .pf{ font-size: 30rpx; width: 200rpx; overflow: hidden; text-overflow:ellipsis; white-space: nowrap; } .cont text{ font-size: 27rpx; opacity: .7; } .content{ margin-bottom: 25rpx; text-align: left; } ~~~
                  <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>

                              哎呀哎呀视频在线观看