forked from gzzfw/frontEnd/gzDyh

liuwh
2024-09-09 2e4d56e2ed95cb0f336522216fedc37167fb446d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// pages/myRegisterDetail/index.js
const $$ = require('../../utils/util');
 
// 详情接口
function getByIdApi(param) {
  return $$.request({
    url: 'caseInfo/getCaseInfo',
    type: 'get',
    submitData: param || {},
    service: 'mediate'
  })
}
 
// 附件查询接口
function getfilesApi(param) {
  return $$.request({
    url: 'fileInfo/listByMainId',
    type: 'get',
    submitData: param || {},
    service: 'sys'
  })
}
 
 
Page({
 
  /**
   * 页面的初始数据
   */
  data: {
    imgUrl: $$.url.img,
    submitData: {},
    oneList: [],
    fileList: []
  },
 
  // 获取附件信息
  async getFilesId(id) {
    $$.showLoading();
    const res = await getfilesApi({
      mainId: id
    });
    $$.hideLoading();
    if (res.type) {
      let data = res.data || {};
      this.setData({
        fileList: data
      });
    }
  },
 
  detailPerson(e) {
    let item = e.currentTarget.dataset.item;
    console.log('item', item);
    wx.navigateTo({
      url: '../../pages/DetailPerson/index?id=' + item.id + '&perType=' + item.perType,
    });
  },
 
  // 获取纠纷案件详情
  async getById(data) {
    $$.showLoading();
    const res = await getByIdApi({
      id: data.id
    });
    $$.hideLoading();
    if (res.type) {
      let data = res.data || {};
      this.setData({
        submitData: data,
        oneList: [...data.personList, ...data.agentList]
      });
      this.getFilesId(data.id)
 
    }
  },
 
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.getById(options);
  },
 
 
})