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/zhdt/zhdt.js | 41 ++++++++++++++++++++++++++++++++++++----- 1 files changed, 36 insertions(+), 5 deletions(-) diff --git a/SunshineLnsMinApp/pages/zhdt/zhdt.js b/SunshineLnsMinApp/pages/zhdt/zhdt.js index a8fcc04..e81fff8 100644 --- a/SunshineLnsMinApp/pages/zhdt/zhdt.js +++ b/SunshineLnsMinApp/pages/zhdt/zhdt.js @@ -11,13 +11,44 @@ dongtai3_1: app.globalData.imgUrl + '/image/dongtai3-1.jpg', inputShowed: false, inputVal: "", + dataSet:[] }, /** * 生命周期函数--监听页面加载 */ - 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(({ + createTime, + ...i + }) => ({ + ...i, + createTime: app.formatDate(createTime), + })); + console.log(content) + that.setData({ + dataSet: content + }) + } else { + wx.showToast({ + title: res.data.msg, + }) + } + } + }) }, linkFunction: function (event) { @@ -28,19 +59,19 @@ }) }, - showInput: function() { + showInput: function () { this.setData({ inputShowed: true }); }, - hideInput: function() { + hideInput: function () { this.setData({ inputVal: "", inputShowed: false }); }, - clearInput: function() { + clearInput: function () { this.setData({ inputVal: "" }, () => {}); -- Gitblit v1.8.0