forked from nsjcy/frontEnd/nsjcy

1
liuwh
2020-03-05 c79f4fea5045445c40cd417c3bdcf78c843f87ae
SunshineLnsMinApp/pages/zhwj/zhwj.js
@@ -61,13 +61,44 @@
      badge: 0,
      name: '版权'
    }],
    dataSet: []
  },
  /**
   * 生命周期函数--监听页面加载
   */
  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,
          })
        }
      }
    })
  },
  // 跳转