安瑾然
2023-03-21 b4661f300194a13c4bc391f2f45a3f7a0a8dff08
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
87
88
89
90
91
92
// index.ts
// 获取应用实例
const memberDetail = getApp()
 
Page({
    data: {
        reportDetail: {},
        isShow: false,
        causeList: [],
        causeIndex: 0,
    },
    // 事件处理函数
    bindViewTap() {
        wx.navigateTo({
            url: '../logs/logs',
        })
    },
//查看图片
face(){
    wx.previewMedia({
        sources:[{url:managerCauseDetail.globalData.imageUrl+"/img/"+this.data.reportDetail.pic}]
    })
},
    //选择案件
    pickCause(e) {
        this.data.reportDetail.causeId = this.data.causeList[e.detail.value].id
        console.log(this.data.reportDetail)
 
    },
    //通过
    // pass(){
    //     wx.request(
    //         {
    //             url: memberDetail.globalData.url +"/report/audit" ,
    //             method:"POST",
    //             data:this.data.reportDetail,
    //             header: { 'token':wx.getStorageSync('token') ,
    //             'content-type': 'application/json'
    //         } ,success:(res)=>{
    //             console.log(res)
    //              wx.reLaunch({
    //                 url:'../../cause/index'
    //             })
    //         }   
    // })   
   
 
// },
    onLoad(e) {
        console.log(e)
        wx.request(
            {
                url:memberDetail.globalData.url+"/wx/group/member/detail",
                method: "GET",
                data:{
                    id:e.id
                },
                header: { 'token':wx.getStorageSync('token') },
                success: (res) => {
                    var  ress=res.data.data
                    ress.pic=memberDetail.globalData.imageUrl+"/img/"+ress.pic
                    this.setData({
                        reportDetail:ress,
                        images:res.data.data.reportMaterials.split(",")
                    })
            
                    for (let index = 0; index < this.data.images.length; index++) {
                        if(this.data.images!=null&&this.data.images[index]!=""&&this.data.images!=undefined){
                            this.data.images[index]=memberDetail.globalData.imageUrl+"/img/"+this.data.images[index]
                        }  else{
                            this.data.images=[]
                        } 
                    }
                    this.setData({
                        images:this.data.images
                    })
                    console.log(this.data.reportDetail)
                }
            })
        // wx.request(
        //     {
        //         url: managerReportDetail.globalData.url+  "/cause/getCauseList",
        //         method: "GET",
        //         // header: { 'token': wx.getStorageSync('token')},
        //         success: (res) => {
        //             this.setData({
        //                 causeList: res.data.data.records
        //             })
        //         }
        //     })
    }
})