From 20b4c7ccf58191066b6a9ecf434604087d675d38 Mon Sep 17 00:00:00 2001 From: liuwh <liuwh@hugeinfo.com.cn> Date: Fri, 28 Feb 2020 09:31:19 +0800 Subject: [PATCH] 提交 --- SunshineLnsMinApp/pages/zhdtInfo/zhdtInfo.js | 96 ++++++++++++++--------------------------------- 1 files changed, 29 insertions(+), 67 deletions(-) diff --git a/SunshineLnsMinApp/pages/zhdtInfo/zhdtInfo.js b/SunshineLnsMinApp/pages/zhdtInfo/zhdtInfo.js index 30ea5b2..39ad0a6 100644 --- a/SunshineLnsMinApp/pages/zhdtInfo/zhdtInfo.js +++ b/SunshineLnsMinApp/pages/zhdtInfo/zhdtInfo.js @@ -8,121 +8,83 @@ 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 () { } }) \ No newline at end of file -- Gitblit v1.8.0