| | |
| | | // pages/fzxkt/fzxkt.js |
| | | var app = getApp() |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad: function(options) { |
| | | |
| | | onLoad: function (options) { |
| | | var that = this; |
| | | wx.showLoading(); |
| | | wx.request({ |
| | | url: app.globalData.url + '/api/article/publicMsgQuery', |
| | | data: { |
| | | page: 1, |
| | | size: 1000, |
| | | flag:'法治小课堂', |
| | | }, |
| | | success: function (res) { |
| | | wx.hideLoading(); |
| | | console.log('res', res); |
| | | if (res.data.code == 0) { |
| | | let content = res.data.data.result.content.map(({ |
| | | startTime, |
| | | ...i |
| | | }) => ({ |
| | | ...i, |
| | | startTime: app.formatDate(startTime), |
| | | })); |
| | | that.setData({ |
| | | items: content |
| | | }) |
| | | } else { |
| | | wx.showToast({ |
| | | title: res.data.msg, |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow: function() { |
| | | onShow: function () { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面隐藏 |
| | | */ |
| | | onHide: function() { |
| | | onHide: function () { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 页面上拉触底事件的处理函数 |
| | | */ |
| | | onReachBottom: function() { |
| | | onReachBottom: function () { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 用户点击右上角分享 |
| | | */ |
| | | onShareAppMessage: function() { |
| | | onShareAppMessage: function () { |
| | | |
| | | } |
| | | }) |