riku
2022-08-26 9f78f3f014a3423ea3fcab8f9f1056c57cd47fc8
pages/module_consult/consulthome/consulthome.js
@@ -39,6 +39,7 @@
   */
  onLoad: function (options) {
    this.getHotTopic()
    this.getTopicItem()
  },
  /**
@@ -110,9 +111,30 @@
    })
  },
  gotoDetail(e) {
    var i = e.currentTarget.dataset.index
    var fileId = this.data.pageList[0][i].mfGuid
  getTopicItem() {
    var that = this
    consultservice.getTopicItem(app.globalData.accessToken.userId, {
      success(res) {
        res.forEach(r => {
          r.miItemContent = r.miItemContent.replace('\\n', '<br/>')
          // r.mfKeywordLv1 = r.mfKeywordLv1.split('、').slice(0, 5)
          // r.mfReleaseDate = that.formateTime(r.mfReleaseDate)
          // r.mfEffectiveDate = that.formateTime(r.mfEffectiveDate)
          // r.mfClosingDate = that.formateTime(r.mfClosingDate)
        });
        that.setData({
          'pageList[2]': res
        })
        console.log(that.data.pageList);
      }
    })
  },
  gotoFile(e) {
    const iList = e.currentTarget.dataset.index.split(',')
    const i1 = iList[0]
    const i2 = iList[1]
    var fileId = this.data.pageList[i1][i2].mfGuid
    wx.navigateTo({
      url: '/pages/module_consult/consultdetail/consultdetail',
      success: (res) => {
@@ -124,6 +146,22 @@
    })
  },
  gotoItem(e) {
    const iList = e.currentTarget.dataset.index.split(',')
    const i1 = iList[0]
    const i2 = iList[1]
    var itemId = this.data.pageList[i1][i2].miGuid
    wx.navigateTo({
      url: '/pages/module_consult/consultdetailitem/consultdetailitem',
      success: (res) => {
        // 通过 eventChannel 向被打开页面传送数据
        res.eventChannel.emit('acceptDataFromOpenerPage', {
          itemId: itemId
        })
      },
    })
  },
  formateTime(t) {
    if (t) {
      return moment(t).format("YYYY年MM月DD日")