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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
| // Componet/Componet.js
| const app = getApp();
| Component({
| /**
| * 组件的属性列表
| */
| properties: {
|
| // 是否显示用户授权
| item: {
| type: Object
| }
| },
| /**
| * 组件的初始数据
| */
| data: {
| uploadUrl: app.globalData.url + '/api/v1/attachment/wechatMaterials?',
| fileIcon: app.globalData.imgUrl + '/images/icon_file.png',
| },
|
| ready: function() {
|
| },
| /**
| * 组件的方法列表
| */
| methods: {
|
| // 直播调解跳转
| linkLive(e) {
| var roomid = e.currentTarget.dataset['roomid'];
| console.log(roomid);
| wx.navigateTo({
| url: '../linkLive/linkLive?roomId=' + roomid
| })
|
| },
|
| // 附件处理
| onChange(e) {
| console.log('onChange', e);
| const {
| file
| } = e.detail;
| if (file.status === 'uploading') {
| wx.showLoading()
| } else if (file.status === 'done') { }
| },
| onSuccess(e) {
| console.log('onSuccess', e)
| },
| onFail(e) {
| console.log('onFail', e)
| },
| onComplete(e) {
| let that = this;
| console.log('onComplete', e);
| var id = e.currentTarget.dataset['id'];
| console.log('id', id);
| let {
| supplyAttachmentList
| } = that.data.item;
| if (e.detail.statusCode == 200) {
| let data = JSON.parse(e.detail.data);
| that.data.item.supplyAttachmentList = supplyAttachmentList.concat(data.data);
| console.log(that.data.item);
| that.setData({
| item: that.data.item
| });
| wx.hideLoading();
| } else {
| wx.hideLoading({
| title: '上传失败, 请重试...',
| icon: 'none'
| });
| }
| },
| onProgress(e) {
| console.log('onProgress', e)
| },
| onPreview(e) {
| console.log('onPreview', e)
| const {
| file,
| fileList
| } = e.detail
| wx.previewImage({
| current: file.url,
| urls: fileList.map((n) => n.url),
| })
| },
| onRemove(e) {
| const {
| file,
| fileList
| } = e.detail;
| let that = this;
| var id = e.currentTarget.dataset['id'];
| console.log(id);
| let {
| supplyAttachmentList
| } = that.data.item;
| wx.showModal({
| content: '确定删除?',
| success: (res) => {
| if (res.confirm) {
| wx.showLoading();
| wx.request({
| url: app.globalData.url + '/api/v1/attachment/deleteByOwnerAtt',
| method: 'GET',
| data: {
| attId: file.id,
| owenId: id
| },
| success: function (res) {
| console.log('res', res);
| that.data.item.supplyAttachmentList = supplyAttachmentList.filter((n) => n.uid !== file.uid)
| that.setData({
| item: that.data.item
| })
| wx.hideLoading();
| }
| })
| }
| },
| })
| },
|
| // 案件补录跳转
| onCaseSupply(e) {
| var id = e.currentTarget.dataset['id'];
| console.log('id', id);
| wx.navigateTo({
| url: '../applyMediation/applyMediation?caseId=' + id
| })
| },
|
| openFile(e) {
| app.openFileByType(e);
| },
|
| // 签到调解
| signIn(e) {
| var meetingtype = e.currentTarget.dataset['meetingtype'];
| var caseid = e.currentTarget.dataset['caseid'];
| console.log(meetingtype, caseid);
| var that = this;
| wx.showLoading();
| wx.request({
| url: app.globalData.url + '/api/meetingPerson/wechatSignIn/' + wx.getStorageSync('#wxEmpowerInfo#').openId + '/' + caseid + '/' + meetingtype,
| method: 'GET',
| header: {
| "Content-Type": "application/json"
| },
| success: function (res) {
| console.log(res.data.data)
| if (res.data.code == 0) {
| wx.hideLoading();
| wx.showToast({
| title: '签到成功',
| icon: 'success',
| success() {
| that.triggerEvent('onLoadRender', {});
| }
| })
| } else {
| wx.hideLoading();
| wx.showToast({
| title: '网络请求失败,请稍后再试!',
| icon: 'none'
| })
| }
| }
| })
| }
|
| }
| })
|
|