forked from nsjcy/frontEnd/nsjcy

1
liuwh
2020-03-23 ed96dab91fbac7159525fe557af2ecdd135c791d
SunshineLnsMinApp/pages/yshjqyfw/yshjqyfw.js
@@ -61,13 +61,44 @@
      badge: 0,
      name: '版权'
    }],
    dataSet: []
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    var that = this;
    wx.showLoading();
    wx.request({
      url: app.globalData.url + '/api/question/examination',
      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,
          })
        }
      }
    })
  },
  // 跳转