1. <ul id="0c1fb"></ul>

      <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
      <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区

      RELATEED CONSULTING
      相關(guān)咨詢
      選擇下列產(chǎn)品馬上在線溝通
      服務(wù)時(shí)間:8:30-17:00
      你可能遇到了下面的問題
      關(guān)閉右側(cè)工具欄

      新聞中心

      這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
      微信小程序中scroll-view怎么實(shí)現(xiàn)上拉加載與下拉刷新

      這篇文章主要講解了“微信小程序中scroll-view怎么實(shí)現(xiàn)上拉加載與下拉刷新”,文中的講解內(nèi)容簡單清晰,易于學(xué)習(xí)與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“微信小程序中scroll-view怎么實(shí)現(xiàn)上拉加載與下拉刷新”吧!

      創(chuàng)新互聯(lián)專業(yè)為企業(yè)提供桓仁網(wǎng)站建設(shè)、桓仁做網(wǎng)站、桓仁網(wǎng)站設(shè)計(jì)、桓仁網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計(jì)與制作、桓仁企業(yè)網(wǎng)站模板建站服務(wù),10多年桓仁做網(wǎng)站經(jīng)驗(yàn),不只是建網(wǎng)站,更提供有價(jià)值的思路和整體網(wǎng)絡(luò)服務(wù)。

      微信小程序 scroll-view實(shí)現(xiàn)上拉加載與下拉刷新的實(shí)例

      實(shí)現(xiàn)效果圖:

      微信小程序中scroll-view怎么實(shí)現(xiàn)上拉加載與下拉刷新

      如圖,使用小程序的scroll-view實(shí)現(xiàn)的上拉加載數(shù)據(jù),下拉刷新數(shù)據(jù),試下代碼如下:

      js文件代碼:

      var url = "http://192.168.30.4:8080/gtxcx/carrier/getCarrier.action"; 
      var page = 1; 
       
      var GetList = function (that) { 
       that.setData({ 
       hidden: false 
       }); 
       wx.request({ 
       url: url, 
       data: { 
        pageSize: 10, 
        pageNo: page 
       }, 
       success: function (res) { 
        var l = that.data.list 
        for (var i = 0; i < res.data.length; i++) { 
        l.push(res.data[i]) 
        } 
        that.setData({ 
        list: l 
        }); 
        page++; 
        that.setData({ 
        hidden: true 
        }); 
       } 
       }); 
      } 
      Page({ 
       data: { 
       hidden: true, 
       list: [], 
       scrollTop: 0, 
       scrollHeight: 0 
       }, 
       onLoad: function () { 
       var that = this; 
       wx.getSystemInfo({ 
        success: function (res) { 
        console.info(res.windowHeight); 
        that.setData({ 
         scrollHeight: res.windowHeight 
        }); 
        } 
       }); 
       }, 
       onShow: function () { 
       var that = this; 
       GetList(that); 
       }, 
       bindDownLoad: function () { 
       var that = this; 
       GetList(that); 
       }, 
       scroll: function (event) { 
       this.setData({ 
        scrollTop: event.detail.scrollTop 
       }); 
       }, 
       refresh: function (event) { 
       page = 1; 
       this.setData({ 
        list: [], 
        scrollTop: 0 
       }); 
       GetList(this) 
       }, 
       onPullDownRefresh: function () { 
       console.log("下拉") 
       }, 
       onReachBottom: function () { 
       console.log("上拉"); 
       } 
      })

      json文件代碼

      { 
       "navigationBarTitleText": "下拉刷新", 
       "enablePullDownRefresh": true, 
       "backgroundTextStyle": "dark" 
      }

      wxml文件代碼:

       
        
        
         
         
        {{item.carrierName}} 
        {{item.carrierTelphone}} 
        {{item.carrierId}} 
         
        
        
        
        
        加載中... 
        
        
      

      wxss文件代碼

      .container{ 
       height: 100%; 
       padding: 20rpx; 
      } 
       
      .item{ 
       display: flex; 
       margin-bottom: 50rpx; 
      width:100%; 
      background:#f0f0f0; 
      overflow:hidden; 
      } 
       
      .img{ 
       height: 100rpx; 
       width: 100rpx; 
       border-radius: 50%; 
      } 
       
      .text{ 
       display: flex; 
       flex-shrink:1; 
       flex-grow:1; 
       padding: 10rpx; 
       flex-wrap: wrap; 
       font-size: 50rpx; 
      } 
       
      .title{ 
       font-size: 50rpx; 
       margin:10rpx 100rpx 10rpx 100rpx; 
      } 
      .description{ 
       font-size: 50rpx; 
       align-self:flex-end; 
      }

      注意,

      http://192.168.30.4:8080/gtxcx/carrier/getCarrier.action這個(gè)接口就是更具傳入的頁數(shù),每次返回不同數(shù)據(jù)。

      感謝各位的閱讀,以上就是“微信小程序中scroll-view怎么實(shí)現(xiàn)上拉加載與下拉刷新”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對微信小程序中scroll-view怎么實(shí)現(xiàn)上拉加載與下拉刷新這一問題有了更深刻的體會,具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識點(diǎn)的文章,歡迎關(guān)注!


      網(wǎng)頁題目:微信小程序中scroll-view怎么實(shí)現(xiàn)上拉加載與下拉刷新
      文章位置:http://ef60e0e.cn/article/pesoec.html
      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区
      1. <ul id="0c1fb"></ul>

        <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
        <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

        福鼎市| 德令哈市| 措美县| 饶平县| 青州市| 科技| 拉萨市| 玛纳斯县| 芜湖县| 白玉县| 清镇市| 板桥市| 轮台县| 临夏市| 进贤县| 林周县| 铜陵市| 巴彦淖尔市| 凉山| 仁寿县| 漯河市| 江津市| 武穴市| 岳西县| 浦县| 绥滨县| 高台县| 抚宁县| 滕州市| 昌都县| 夹江县| 平顺县| 璧山县| 准格尔旗| 嘉峪关市| 安国市| 斗六市| 新和县| 忻城县| 北流市| 辽宁省|