forked from nsjcy/frontEnd/nsjcy

xuxj
2020-05-09 d99603fa4c5188d19991de978c185b2b9247c5af
SunshineLnsMinApp/pages/yshjqyfw/yshjqyfw.js
@@ -6,7 +6,8 @@
   * 页面的初始数据
   */
  data: {
    wjgk:'./../../images/wjgk.jpg',
    wjgk: './../../images/wjgk.jpg',
    qiyefuwu: app.globalData.imgUrl + '/images/qiyefuwu.png',
    dongtai1_1: app.globalData.imgUrl + '/image/dongtai1-1.jpg',
    dongtai2_1: app.globalData.imgUrl + '/image/dongtai2-1.jpg',
    dongtai3_1: app.globalData.imgUrl + '/image/dongtai3-1.jpg',
@@ -61,13 +62,51 @@
      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,
          })
        }
      }
    })
  },
  folder: function(event) {
    var title = event.currentTarget.dataset['title'];
    wx.navigateTo({
      url: '../law2Publicitylist/law2Publicitylist?title=' + title,
    })
  },
  // 跳转