小程序-新闻精选

曹え 5811 发布于:2019-03-14 22:05:08

首页

//index.js
//获取应用实例
const app = getApp()

Page({
data: {
userInfo: {},
list:{}

},
//事件处理函数
bindViewTap: function() {
wx.navigateTo({
url: '../logs/logs'
})
},
onLoad: function () {
if (app.globalData.userInfo) {
this.setData({
userInfo: app.globalData.userInfo,
hasUserInfo: true
})
}
var _this = this;
wx.request({
url: 'http://vip.5811.com.cn/vip_blog_json.php', // 仅为示例,并非真实的接口地址
data: {
start: 0,
count: 10
},
header: {
'content-type': 'application/json' // 默认值
},
success(res) {
console.log(res.data)
_this.setData({
list:res.data
})
}
})

}
})


觉得有用请点个赞吧!
0 591