xusd
7 days ago 998218675eb243d43912c203174a6b72b299c0f8
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
// pages/course/index.js
const $$ = require('../../utils/util');
 
// 获取案件历程
function getCourseApi(url, submitData) {
    return $$.request({ url, submitData, type: 'get', service: 'mediate' });
}
 
Page({
    /**
     * 页面的初始数据
     */
    data: {
        imgUrl: $$.url.img,
        pageType: '', //1为调解历程页面、2为司法历程页面
        contentData: {},
    },
 
    //
    async _getCourseData(options, modelData) {
        let url, params;
        if (options.pageType === '1') {
            url = 'paCaseInfo/getCourse';
            params = { caseId: options.id };
        } else if (options.pageType === '2') {
            url = 'paJudicInfo/getCourse';
            params = { judicId: options.id };
        }
        $$.showLoading();
        const res = await getCourseApi(url, params);
        $$.hideLoading();
        if (res.type) {
            res.data.applyTime = $$.timeFormat(res.data.applyTime);
            this.setData({
                pageType: options.pageType,
                contentData: res.data,
            });
        }
    },
 
    // 查看附件
    onCheck(e) {
        let idx = e.currentTarget.dataset.fileidx;
        let fileItem = this.data.contentData.fileInfoList[idx];
        let type = fileItem.cat;
        let url = $$.baseUrl + $$.url.fileShowUrl + fileItem.id;
        $$.openFiles(type, url, [url]);
    },
 
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        wx.setNavigationBarTitle({
            title: options.pageType === '1' ? '调解历程' : '司法确认历程',
        });
        let adjustModel = [
            { title: '调解案号:', value: 'caseNo' },
            { title: '申请渠道:', value: 'sourceName' },
            { title: '申请时间:', value: 'applyTime' },
            { title: '申请人:', value: 'plaintiffs' },
            { title: '被申请人:', value: 'defendants' },
        ];
        let judicialModel = [
            { title: '司法确认案号:', value: 'judicNo' },
            { title: '申请时间:', value: 'applyTime' },
            { title: '调解组织:', value: 'applyUnitName' },
            { title: '申请人:', value: 'plaintiffs' },
            { title: '被申请人:', value: 'defendants' },
        ];
        let con = options.pageType === '1' ? adjustModel : judicialModel;
        this._getCourseData(options, con);
    },
});