forked from nsjcy/frontEnd/nsjcy

liuwh
2020-02-24 2bcd556961208b80af1cb157633c594faab1eca2
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
//index.js
//获取应用实例
const app = getApp()
 
 
Page({
  data: {
    src: app.globalData.imgUrl +'/image/bg.jpg',
    itemIcon: app.globalData.imgUrl +'/image/ceshi.jpg',
    icon: app.globalData.imgUrl +'/image/fzl.svg',
    user: app.globalData.imgUrl +'/image/user.svg',
    yes: app.globalData.imgUrl +'/image/yes.svg',
    add: app.globalData.imgUrl +'/image/add.svg',
    del: app.globalData.imgUrl +'/image/del.svg',
    imglist: [],
    text: '',
    color: '',
    newData: {},
    createTime: '',
    result: '',
    resulttetx: '',
    adjustDate: '',
    reason: '',
    adjustTime: '',
    isAdjust:''
  },
  //事件处理函数
  schedulelawyer: function () {
    wx.navigateTo({
      url: '../schedulelawyer/schedulelawyer?newData=' + encodeURIComponent(JSON.stringify(this.data['newData'])),
    })
  },
 
  schedulecase: function() {
    wx.navigateTo({
      url: '../schedulecase/schedulecase?newData=' + encodeURIComponent(JSON.stringify(this.data['newData'])),
    })
  },
  videoInfo: function() {
    wx.navigateTo({
      url: '../videoInfo/videoInfo',
    })
  },
 
  onLoad: function(options) {
    var _this = this;
    var id = options.id;
    var newimg = [];
    wx.request({
      url: app.globalData.url + '/api/v1/paperApply/find/' + id,
      success: function(res) {
        if (res.data.code == 0) {
          var date = new Date(res.data.data.createTime);
          var month = date.getMonth();
          var dateTime = date.getFullYear() + "-" + month + "-" + date.getDate()
          _this.setData({
            createTime: dateTime,
            adjustDate: res.data.data.adjustDate,
            adjustTime: res.data.data.adjustTime,
            reason: res.data.data.reason,
            newData: res.data.data,
          });
          res.data.data.attachments.map(function(track) {
            if (track.type === 1001) {
              newimg.push(track.path);
              _this.setData({
                imglist: newimg
              })
            } else {
              _this.setData({
                imglist: newimg
              })
            }
          });
          if (res.data.data.isAdjust == 0){
            _this.setData({
              isAdjust:"displayNone"
            })
          } else{
            isAdjust: ""
          }
          if (res.data.data.status == 1) {
            _this.setData({
              text: "审核中",
              color: "backgroundorange-title",
            })
          } else if (res.data.data.status == 2) {
            _this.setData({
              text: "通过",
              color: "backgroundgreen-title",
            })
          } else if (res.data.data.status == 3) {
            _this.setData({
              text: "补充",
              color: "backgroundblue-title",
            })
          } else {
            _this.setData({
              text: "驳回",
              color: "backgroundred-title",
            })
          };
          if (res.data.data.result == null) {
            _this.setData({
              result: "displayNone",
              resulttetx: ''
            })
 
          } else {
            _this.setData({
              result: "displayblock",
              resulttetx: res.data.data.result
            })
 
          }
        } else {
          wx.showModal({
            title: '提示',
            content: "提交失败!"
          })
        }
      }
    })
  },
  previewImage: function(e) {
    var current = e.target.dataset.src;
    wx.previewImage({
      current: current, // 当前显示图片的http链接  
      urls: this.data.imglist // 需要预览的图片http链接列表  
    })
  },
})