日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

微信小程序——获取所有资讯接口数据

發布時間:2025/4/16 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 微信小程序——获取所有资讯接口数据 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

首先獲取數據把數據打印出來

接口文檔


第一現在app.js 賦值 如:
app.js文件

App({globalData: {//資訊接口zixu_url: "http://192.168.1.107:8080/ls/api/client/info/list",//資訊id接口info_url:"http://192.168.1.107:8080/ls/api/client/info/id/",// 資訊詳情id 的評論數據接口admin_comment:"http://192.168.1.107:8080/ls/api/client/comment/list/info/"} })

index.js文件

onLoad:function(){// 生命周期函數--監聽頁面加載 //'?page=0'+'&size=5' 展示前五條 var zix_data= app.globalData.zixu_url+'?page=0'+'&size=5';this.getMovieListData(zix_data)// console.log(postList)} getMovieListData: function (url) {var that = this;wx.request({url: url,method: 'post', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECTheader: {'content-type': 'application/json'},success: function (res) {that.setData({postList:res.data.objects,}););}},fail: function (error) {// failconsole.log(error)}})

}

index.wxml文件

<!--pages/index/index.wxml--> <import src="zix-template/zix-template.wxml" /> <!--<import src="/pages/posts/post-item/post-item-template.wxml" />--><scroll-view class='container' bindscrolltolower="lower" scroll-x='true' scroll-y='true'><block wx:for="{{postList}}" wx:for-item="item" ><!--//template--><view "><view class='zix_template'><image class='zix_img' src="{{coverImage}}"></image><text class='zix_tilte'>{{title}} </text></view></view></block> </scroll-view>

本人只是為了個人技術回顧
第二節 如何下滑加載指定的數量數據
第三節 跳轉詳情頁面的跳轉
第四節 詳情頁面評論和 評論時間的轉換遍歷展示

總結

以上是生活随笔為你收集整理的微信小程序——获取所有资讯接口数据的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。