| | |
| | | data: { |
| | | id: '', |
| | | swiperList: [], |
| | | data:{}, |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad: function(options) { |
| | | onLoad: function (options) { |
| | | console.log(options.id) |
| | | this.setData({ |
| | | id: options.id, |
| | | var that = this; |
| | | wx.request({ |
| | | url: app.globalData.url + '/api/article/publicMsgDetails?msgId=' + options.id, |
| | | success: function (res) { |
| | | wx.hideLoading(); |
| | | console.log(res) |
| | | if (res.data.code == 0) { |
| | | that.setData({ |
| | | data: { |
| | | ...res.data.data, |
| | | createTime: app.formatDate(res.data.data.createTime), |
| | | } |
| | | }) |
| | | } else { |
| | | wx.showModal({ |
| | | title: '提示', |
| | | content: "请求失败!" |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | if (options.id == '1') { |
| | | this.setData({ |
| | | swiperList: [{ |
| | | id: 0, |
| | | type: 'image', |
| | | url: app.globalData.imgUrl + '/image/dongtai1-1.jpg', |
| | | }, { |
| | | id: 1, |
| | | type: 'image', |
| | | url: app.globalData.imgUrl + '/image/dongtai1-2.jpg', |
| | | }, { |
| | | id: 2, |
| | | type: 'image', |
| | | url: app.globalData.imgUrl + '/image/dongtai1-3.jpg', |
| | | }], |
| | | }) |
| | | } else if (options.id == '2') { |
| | | this.setData({ |
| | | swiperList: [{ |
| | | id: 0, |
| | | type: 'image', |
| | | url: app.globalData.imgUrl + '/image/dongtai2-1.jpg', |
| | | }, { |
| | | id: 1, |
| | | type: 'image', |
| | | url: app.globalData.imgUrl + '/image/dongtai2-2.jpg', |
| | | }, { |
| | | id: 4, |
| | | type: 'image', |
| | | url: app.globalData.imgUrl + '/image/dongtai2-5.jpg', |
| | | }, { |
| | | id: 5, |
| | | type: 'image', |
| | | url: app.globalData.imgUrl + '/image/dongtai2-6.jpg', |
| | | }, { |
| | | id: 6, |
| | | type: 'image', |
| | | url: app.globalData.imgUrl + '/image/dongtai2-7.jpg', |
| | | }], |
| | | }) |
| | | }else{ |
| | | this.setData({ |
| | | swiperList: [{ |
| | | id: 0, |
| | | type: 'image', |
| | | url: app.globalData.imgUrl + '/image/dongtai3-1.jpg', |
| | | }, { |
| | | id: 1, |
| | | type: 'image', |
| | | url: app.globalData.imgUrl + '/image/dongtai3-2.jpg', |
| | | }, { |
| | | id: 2, |
| | | type: 'image', |
| | | url: app.globalData.imgUrl + '/image/dongtai3-3.jpg', |
| | | }], |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady: function() { |
| | | onReady: function () { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow: function() { |
| | | onShow: function () { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面隐藏 |
| | | */ |
| | | onHide: function() { |
| | | onHide: function () { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面卸载 |
| | | */ |
| | | onUnload: function() { |
| | | onUnload: function () { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 页面相关事件处理函数--监听用户下拉动作 |
| | | */ |
| | | onPullDownRefresh: function() { |
| | | onPullDownRefresh: function () { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 页面上拉触底事件的处理函数 |
| | | */ |
| | | onReachBottom: function() { |
| | | onReachBottom: function () { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 用户点击右上角分享 |
| | | */ |
| | | onShareAppMessage: function() { |
| | | onShareAppMessage: function () { |
| | | |
| | | } |
| | | }) |