forked from gzzfw/frontEnd/gzDyh

liuwh
2024-09-14 e7d382efc71d1a738a6a7c52d0978d6fdb077a8a
gz-wxparty/pages/myRegisterList/index.js
@@ -12,6 +12,17 @@
  })
}
function getfilesApi(param) {
  return $$.request({
    url: 'fileInfo/listByMainIdAndType',
    type: 'get',
    submitData: param || {},
    service: 'sys'
  })
}
Page({
  /**
@@ -19,6 +30,7 @@
   */
  data: {
    imgUrl: $$.url.img,
    fileUrl: $$.baseUrl + $$.url.fileShowUrl,
    search: {
      page: 1,
      size: 10,
@@ -171,7 +183,7 @@
      }
    })
  },
  // 关闭协议要点
  agreeContentClosePopup(e) {
    this.setData({
      showData: {
@@ -181,6 +193,31 @@
    })
  },
  // 查看协议文书
  async agreeClick(e) {
    let item = e.currentTarget.dataset.item;
    $$.showLoading();
    const res = await getfilesApi({
      mainId: item.id,
      ownerType: '22_00018-302',
    });
    $$.hideLoading();
    if (res.type) {
      let data = res.data || [];
      if (data?.length === 0) {
        $$.showToast({
          title: '暂无协议文书',
          duration: 1000
        });
      }
      wx.previewImage({
        current: `${this.data.fileUrl}${data[0].showUrl}`,
        urls: data.map(item => `${this.data.fileUrl}${item.showUrl}`) // 需要预览的图片http链接列表
      });
    }
  },
  // 评价
  evaluate(e) {
    let id = e.currentTarget.dataset.id;