joke.wxml源代码
//如果实名认证成功了,把里面的key改变一下,应该就可以加载成功了3.20
<view wx:for="{{ jokes}}" wx:key=" {{joke.hashId}}">
{{ item.content}}
</view>
==========================================================
joke文件下面的 joke.js 源代码
// pages/joke/joke.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var that = this;
var timestamp = parseInt( new Date()).getTime() / 1000
wx.request({
url:'http://v.juhe.cn/joke/content/list.php',
data:{
key:" a17c1458ae83ae4e0dd786f0a3830a2f ",
time: timestamp,
page:1,
pagesize:10,
sort: "desc"
},
success: function(res){
var jokes = res.data.result.data;
that.setData({
jokes: jokes
});
},
success:function(res){
console.log(res);
}
})
var that = this;
wx.request({
url: ' http://apis.juhe.cn/idiomJie/query',
data:{
key:" a17c1458ae83ae4e0dd786f0a3830a2f "
}
})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
}
})