Ver código fonte

表格图片的增删接口链接

Yannay 2 meses atrás
pai
commit
0cc3f2023a

+ 8 - 5
pages/orderDetailNew/components/orderDetailNewView.vue

@@ -5,11 +5,11 @@
5 5
             <pageOne @handleNextClick="handleNextClick" :orderDetail="detail" :orderId="orderId" />
6 6
         </view>
7 7
         <view class="page-item" v-show="activeIndex === 1">
8
-            <pageTwo @handleNextClick="handleNextClick" :orderDetail="detail" />
8
+            <pageTwo @handleNextClick="handleNextClick" :orderDetail="detail" :orderId="orderId" />
9 9
         </view>
10 10
         <view class="page-item" v-show="activeIndex === 2">
11
-            <pageThree @handleNextClick="handleNextClick" :detailImages="allFroms.formTwo.detailImages || []"
12
-                :orderDetail="detail" @handleNeedSave="handleNeedSave" />
11
+            <pageThree @handleNextClick="handleNextClick" :orderDetail="detail" @handleNeedSave="handleNeedSave"
12
+                ref="pageThreeComp" :orderId="orderId" />
13 13
         </view>
14 14
         <view class="page-item" v-show="activeIndex === 3">
15 15
             <pageFour @handleNextClick="handleNextClick" :orderDetail="detail" />
@@ -67,6 +67,10 @@ export default {
67 67
             this.activeIndex++
68 68
             this.allFroms[nowPage] = form
69 69
             console.log("all page data:", this.allFroms[nowPage])
70
+            // 当点击到第三页时,更新第三页的图片列表
71
+            if (nowPage === 'formTwo') {
72
+                this.$refs.pageThreeComp.getList('2', '3');
73
+            }
70 74
         },
71 75
         // 支付前保存数据
72 76
         async saveData() {
@@ -157,8 +161,7 @@ export default {
157 161
             } catch (error) {
158 162
                 uni.$u.toast(`支付失败:${response.msg}`)
159 163
             }
160
-        }
161
-
164
+        },
162 165
     }
163 166
 }
164 167
 

+ 4 - 151
pages/orderDetailNew/components/pageOne.vue

@@ -17,7 +17,7 @@
17 17
                 <view class="image-list">
18 18
                     <view class="image-item" v-for="(item, index) in trueUploadList" :key="'truePic-' + index">
19 19
                         <pic-comp :src="item.fileUrl"></pic-comp>
20
-                        <view class="delete-btn" @click="deleteImage('truePic', item)">×</view>
20
+                        <view class="delete-btn" @click="deleteImage(item)">×</view>
21 21
                     </view>
22 22
                     <view class="upload-btn" @click="uploadImage('truePic')">
23 23
                         <u-icon name="plus" size="40" color="#999"></u-icon>
@@ -34,7 +34,7 @@
34 34
                     <view class="image-item" v-for="(item, index) in chatRecordsUploadList"
35 35
                         :key="'chatRecords-' + index">
36 36
                         <pic-comp :src="item.fileUrl"></pic-comp>
37
-                        <view class="delete-btn" @click="deleteImage('chatRecords', item)">×</view>
37
+                        <view class="delete-btn" @click="deleteImage(item)">×</view>
38 38
                     </view>
39 39
                     <view class="upload-btn" @click="uploadImage('chatRecords')">
40 40
                         <u-icon name="plus" size="40" color="#999"></u-icon>
@@ -90,8 +90,9 @@
90 90
 </template>
91 91
 <script>
92 92
 import picComp from './picComp.vue'
93
-
93
+import imgUploadAndDownLoad from '../mixin/imgUploadAndDownLoad.js'
94 94
 export default {
95
+    mixins: [imgUploadAndDownLoad],
95 96
     props: {
96 97
         orderDetail: {
97 98
             type: Object,
@@ -126,134 +127,12 @@ export default {
126 127
         }
127 128
     },
128 129
     methods: {
129
-        // 选择图片
130
-        uploadImage(type) {
131
-            uni.chooseImage({
132
-                count: 9, // 最多选择9张
133
-                sizeType: ['compressed'], // 压缩图片
134
-                sourceType: ['album', 'camera'], // 从相册选择或拍照
135
-                success: (res) => {
136
-                    const tempFilePaths = res.tempFilePaths
137
-                    console.log('上传的图片路径:11', tempFilePaths)
138
-                    this.uploadToServer(tempFilePaths, type)
139
-                },
140
-                fail: (err) => {
141
-                    console.error('选择图片失败:', err)
142
-                }
143
-            })
144
-        },
145
-        // 删除图片
146
-        deleteImage(type, item) {
147
-            uni.showModal({
148
-                title: '提示',
149
-                content: '确定要删除这张图片吗?',
150
-                success: (res) => {
151
-                    if (res.confirm) {
152
-                        // 调接口删除
153
-                        console.log('现在要删除的文件文件是:', type, item.fileUrl, item.id)
154
-                        this.deleteImg(item.id)
155
-                        this.getList('2', '1');
156
-                        this.getList('2', '2');
157
-                    }
158
-                }
159
-            })
160
-        },
161
-        // 删除图片
162
-        async deleteImg(id) {
163
-            try {
164
-                await uni.$u.api.deleteClueFile([id])
165
-                uni.showToast({
166
-                    title: '删除成功',
167
-                    icon: 'success',
168
-                    duration: 2000
169
-                })
170
-            } catch (error) {
171
-                uni.showToast({
172
-                    title: '删除失败',
173
-                    icon: 'error',
174
-                    duration: 2000
175
-                })
176
-            }
177
-        },
178
-        // 上传到服务
179
-        async uploadToServer(filePaths, type) {
180
-            // 实际的上传逻辑
181
-            try {
182
-                //实物图的话就是2,聊天记录的话就是1
183
-                let p = type == 'truePic' ? '2' : type == 'chatRecords' ? '1' : ''
184
-                console.log('当前上传的图片类型是', p)
185
-                const res = await Promise.all(filePaths.map(filePath => this.uploadFile(filePath, p)));
186
-
187
-                // 绑定
188
-                this.bindOrder(type, p);
189
-
190
-                // 实物图的话传2
191
-                if (type == 'truePic') {
192
-                    // this.bindOrder('2', '2');
193
-                    this.getList('2', '2');
194
-                }
195
-                // 实物图的话聊天记录的话传1
196
-                if (type == 'chatRecords') {
197
-                    // 实物图的话聊天记录的话传1
198
-                    // this.bindOrder('2', '1');
199
-                    this.getList('2', '1');
200
-                }
201 130
 
202 131
 
203
-            } catch (error) {
204
-                console.error('上传失败:', error);
205
-                uni.$u.toast('上传失败');
206
-            }
207
-        },
208
-        //绑定订单
209
-        async bindOrder(type, orderFileType) {
210
-            const res = await uni.$u.api.saveClueFile({
211
-                clueId: this.orderDetail.clueId,//线索id
212
-                list: this.bindList,
213
-                sourceId: this.orderId,//订单id,sendformid
214
-                type: type,
215
-                orderFileType: orderFileType
216
-            });
217
-            uni.$u.toast("上传成功");
218
-            uni.hideLoading();
219
-            // 清空待绑定的图片列表
220
-            this.bindList = [];
221
-        },
222
-        // 上传文件
223
-        async uploadFile(fileUrl, orderFileType) {
224
-            try {
225
-                uni.showLoading({
226
-                    title: '上传中...',
227
-                    mask: true
228
-                });
229
-
230
-                console.log(111, fileUrl)
231
-                // 调用统一的上传接口
232
-                const { data } = await uni.$u.api.uploadFile(fileUrl);
233 132
 
234
-                const fileObj = {
235
-                    fileSize: data.fileSize,
236
-                    fileSuffix: data.fileSuffix,
237
-                    fileName: data.name,
238
-                    fileUrl: data.url,
239
-                    orderFileType: orderFileType
240
-                };
241 133
 
242 134
 
243 135
 
244
-                if (orderFileType == '2') {
245
-                    // this.trueUploadList.push(fileObj);
246
-                } else if (orderFileType == '1') {
247
-                    // this.chatRecordsUploadList.push(fileObj);
248
-                }
249
-                this.bindList.push(fileObj);
250
-
251
-            } catch (error) {
252
-                uni.hideLoading();
253
-                console.error('文件上传失败:', error);
254
-                uni.$u.toast('上传失败,请重试');
255
-            }
256
-        },
257 136
 
258 137
         // 电话卡片点击事件
259 138
         handlePhoneClick() {
@@ -320,32 +199,6 @@ export default {
320 199
                 form: this.form,
321 200
             })
322 201
         },
323
-        // 获取文件列表
324
-        async getList(type, orderFileType) {
325
-            console.log('获取文件列表', type, orderFileType)
326
-
327
-            try {
328
-                const params = {
329
-                    clueId: this.orderDetail.clueId,
330
-                    sourceId: this.orderId,
331
-                    type,
332
-                    orderFileType,
333
-                    isDuplicate: '1',//先传1
334
-                    pageNum: 1,
335
-                    pageSize: 1000 // 设置一个较大的值以获取所有数据
336
-                }
337
-                const response = await uni.$u.api.selectClueFileByDto(params)
338
-                if (orderFileType == '1') {
339
-                    this.trueUploadList = response.rows || []
340
-                } else if (orderFileType == '2') {
341
-                    this.chatRecordsUploadList = response.rows || []
342
-                }
343
-            } catch (error) {
344
-                uni.$u.toast(`获取列表失败:${error.message}`)
345
-                this.trueUploadList = []
346
-                this.chatRecordsUploadList = []
347
-            }
348
-        },
349 202
 
350 203
         //一键复制
351 204
         copyAllImages() {

+ 24 - 67
pages/orderDetailNew/components/pageThree.vue

@@ -44,19 +44,19 @@
44 44
                         </view>
45 45
 
46 46
                         <!-- 图片列表 -->
47
-                        <view class="detail-image-item" v-for="(item, index) in localDetailImages"
48
-                            :key="'detail-' + index" :class="{
47
+                        <view class="detail-image-item" v-for="(item, index) in detailImages" :key="'detail-' + index"
48
+                            :class="{
49 49
                                 'dragging': draggingIndex === index,
50 50
                                 'can-drop': canDropIndex === index
51 51
                             }" @touchstart.stop="onTouchStart($event, index)" @touchmove.stop="onTouchMove($event)"
52 52
                             @touchend.stop="onTouchEnd" @touchcancel.stop="onTouchEnd">
53
-                            <pic-comp :src="item.value"></pic-comp>
53
+                            <pic-comp :src="item.fileUrl"></pic-comp>
54 54
                             <view class="image-type-tag">{{ getImageType(index) }}</view>
55
-                            <view class="detail-delete-btn" @click.stop="deleteImage(index)">×</view>
55
+                            <view class="detail-delete-btn" @click.stop="deleteImage(item)">×</view>
56 56
                         </view>
57 57
 
58 58
                         <!-- 上传按钮 -->
59
-                        <view class="detail-upload-btn" @click="uploadDetailImage">
59
+                        <view class="detail-upload-btn" @click="uploadImage('detailImages')">
60 60
                             <u-icon name="plus" size="40rpx" color="#999"></u-icon>
61 61
                         </view>
62 62
                     </view>
@@ -137,16 +137,18 @@
137 137
 
138 138
 <script>
139 139
 import picComp from './picComp.vue'
140
-
140
+import imgUploadAndDownLoad from '../mixin/imgUploadAndDownLoad'
141 141
 export default {
142
+    mixins: [imgUploadAndDownLoad],
142 143
     props: {
143 144
         orderDetail: {
144 145
             type: Object,
145 146
             default: () => { },
146 147
         },
147
-        detailImages: {
148
-            type: Array,
149
-            default: () => []
148
+
149
+        orderId: {
150
+            type: String,
151
+            default: '',
150 152
         }
151 153
     },
152 154
     watch: {
@@ -157,19 +159,13 @@ export default {
157 159
                     this.paymentInfo.bankName = newVal.bankName || ''
158 160
                     this.paymentInfo.bankAccount = newVal.bankCardNumber || ''
159 161
                     this.paymentInfo.idNumber = newVal.idCard || ''
162
+
163
+                    this.getList('2', '3');
160 164
                 }
161 165
             },
162 166
             deep: true,
163 167
         },
164
-        detailImages: {
165
-            handler(newVal) {
166
-                this.localDetailImages = newVal.map((item, index) => ({
167
-                    value: item,
168
-                    position: index
169
-                }));
170
-            },
171
-            deep: true
172
-        }
168
+
173 169
     },
174 170
     components: {
175 171
         picComp
@@ -190,11 +186,7 @@ export default {
190 186
                 bankAccount: '', // 银行账号
191 187
                 idNumber: '' // 身份证号
192 188
             },
193
-            // Local copy of detailImages prop to avoid direct mutation
194
-            localDetailImages: this.detailImages.map((item, index) => ({
195
-                value: item,
196
-                position: index
197
-            })),
189
+
198 190
             // 拖拽相关状态
199 191
             draggingIndex: -1, // 当前正在拖拽的元素索引
200 192
             placeholderIndex: -1, // 占位符的位置
@@ -204,53 +196,20 @@ export default {
204 196
             startY: 0, // 触摸起始Y坐标
205 197
             dragOffsetX: 0, // 拖拽元素的X偏移
206 198
             dragOffsetY: 0, // 拖拽元素的Y偏移
207
-            placeholderStyle: '' // 占位符的样式
199
+            placeholderStyle: '', // 占位符的样式
200
+
201
+
202
+
203
+            detailImages: [],// 高清细节图数组
204
+            // 绑定订单相关
205
+            bindList: [] // 待绑定的图片列表
208 206
         };
209 207
     },
210 208
 
211 209
     methods: {
212
-        // 上传高清细节图
213
-        uploadDetailImage() {
214
-            uni.chooseImage({
215
-                count: 9 - this.localDetailImages.length, // 最多选择9张
216
-                sizeType: ['compressed'], // 压缩图片
217
-                sourceType: ['album', 'camera'], // 从相册选择或拍照
218
-                success: (res) => {
219
-                    const tempFilePaths = res.tempFilePaths;
220
-                    // 将图片路径转换为对象数组并添加到本地数组
221
-                    const newImages = tempFilePaths.map((path, index) => ({
222
-                        value: path,
223
-                        position: this.localDetailImages.length + index
224
-                    }));
225
-                    this.localDetailImages = [...this.localDetailImages, ...newImages];
226
-                },
227
-                fail: (err) => {
228
-                    console.error('选择图片失败:', err);
229
-                    uni.showToast({
230
-                        title: '选择图片失败',
231
-                        icon: 'none'
232
-                    });
233
-                }
234
-            });
235
-        },
236 210
 
237
-        // 删除图片
238
-        deleteImage(index) {
239
-            uni.showModal({
240
-                title: '提示',
241
-                content: '确定要删除这张图片吗?',
242
-                success: (res) => {
243
-                    if (res.confirm) {
244
-                        this.localDetailImages.splice(index, 1);
245
-
246
-                        // Update position properties after deletion
247
-                        this.localDetailImages.forEach((item, idx) => {
248
-                            item.position = idx + 1;
249
-                        });
250
-                    }
251
-                }
252
-            });
253
-        },
211
+
212
+
254 213
 
255 214
         // 获取图片类型
256 215
         getImageType(index) {
@@ -385,7 +344,6 @@ export default {
385 344
             this.$emit('handleNeedSave', {
386 345
                 nowPage: 'formThree',
387 346
                 form: {
388
-                    detailImages: this.localDetailImages,
389 347
                     ...this.paymentInfo,
390 348
                     paymentAmount: this.paymentAmount
391 349
                 }
@@ -418,7 +376,6 @@ export default {
418 376
             this.$emit('handleNextClick', {
419 377
                 nowPage: 'formThree',
420 378
                 form: {
421
-                    detailImages: this.localDetailImages,
422 379
                     ...this.paymentInfo
423 380
                 }
424 381
             });

+ 22 - 62
pages/orderDetailNew/components/pageTwo.vue

@@ -113,10 +113,10 @@
113 113
                 <div class="detail-image-upload-container">
114 114
                     <view class="detail-image-list">
115 115
                         <view class="detail-image-item" v-for="(item, index) in detailImages" :key="'detail-' + index">
116
-                            <pic-comp :src="item"></pic-comp>
117
-                            <view class="detail-delete-btn" @click="deleteDetailImage(index)">×</view>
116
+                            <pic-comp :src="item.fileUrl"></pic-comp>
117
+                            <view class="detail-delete-btn" @click="deleteImage(item)">×</view>
118 118
                         </view>
119
-                        <view class="detail-upload-btn" @click="uploadDetailImage">
119
+                        <view class="detail-upload-btn" @click="uploadImage('detailImages')">
120 120
                             <u-icon name="plus" size="40rpx" color="#999"></u-icon>
121 121
                         </view>
122 122
                     </view>
@@ -130,19 +130,25 @@
130 130
 
131 131
 <script>
132 132
 import picComp from './picComp.vue'
133
-
133
+import imgUploadAndDownLoad from '../mixin/imgUploadAndDownLoad'
134 134
 export default {
135
+    mixins: [imgUploadAndDownLoad],
135 136
     props: {
136 137
         orderDetail: {
137 138
             type: Object,
138 139
             default: () => { },
140
+        },
141
+        orderId: {
142
+            type: String,
143
+            default: '',
139 144
         }
140 145
     },
141 146
     watch: {
142 147
         orderDetail: {
143
-            handler(newVal, oldVal) {
148
+            handler(newVal) {
144 149
                 if (newVal) {
145 150
                     this.approvedPrice = newVal.itemPrice || 0;
151
+                    this.getList('2', '3');
146 152
                 }
147 153
             },
148 154
             deep: true,
@@ -169,34 +175,15 @@ export default {
169 175
             // 核准价格相关
170 176
             approvedPrice: 0, // 核准价格初始值
171 177
             // 高清细节图相关
172
-            detailImages: [] // 高清细节图数组
178
+
179
+
180
+            detailImages: [],// 高清细节图数组
181
+            // 绑定订单相关
182
+            bindList: [] // 待绑定的图片列表
173 183
         };
174 184
     },
175 185
     methods: {
176
-        // 选择图片方法
177
-        chooseImage(type) {
178
-            uni.chooseImage({
179
-                count: 9, // 最多选择9张图片
180
-                sizeType: ['original', 'compressed'], // 原图或压缩图
181
-                sourceType: ['album', 'camera'], // 从相册或相机选择
182
-                success: (res) => {
183
-                    const tempFilePaths = res.tempFilePaths;
184
-                    // 根据类型将图片添加到对应的数组
185
-                    if (type === 'photoTips') {
186
-                        this.photoTipsImages = [...this.photoTipsImages, ...tempFilePaths];
187
-                    } else if (type === 'face2face') {
188
-                        this.face2faceImages = [...this.face2faceImages, ...tempFilePaths];
189
-                    }
190
-                },
191
-                fail: (err) => {
192
-                    console.error('选择图片失败:', err);
193
-                    uni.showToast({
194
-                        title: '选择图片失败',
195
-                        icon: 'none'
196
-                    });
197
-                }
198
-            });
199
-        },
186
+
200 187
 
201 188
 
202 189
         // 价格输入回调
@@ -257,39 +244,12 @@ export default {
257 244
                 form: result,
258 245
             })
259 246
         },
260
-        //获取文件列表
261
-        async getList() {
262
-            console.log('获取文件列表', type, orderFileType)
263
-
264
-            try {
265
-                const params = {
266
-                    clueId: this.orderDetail.clueId,
267
-                    sourceId: this.orderId,
268
-                    type: '2',
269
-                    orderFileType: '3',
270
-                    isDuplicate: '1',//先传1
271
-                    pageNum: 1,
272
-                    pageSize: 1000 // 设置一个较大的值以获取所有数据
273
-                }
274
-                const response = await uni.$u.api.selectClueFileByDto(params)
275
-                this.detailImages = response.rows || []
276
-            } catch (error) {
277
-                uni.$u.toast(`获取列表失败:${error.message}`)
278
-            }
279
-        },
280
-        // 上传高清细节图
281
-        uploadDetailImage() {
282 247
 
283
-        },
284
-        // 删除高清细节图
285
-        deleteDetailImage(index) {
286
-            uni.showModal({
287
-                title: '提示',
288
-                content: '确定要删除这张图片吗?',
289
-                success: (res) => {
290
-                }
291
-            });
292
-        },
248
+
249
+
250
+
251
+
252
+
293 253
     }
294 254
 };
295 255
 </script>

+ 142 - 0
pages/orderDetailNew/mixin/imgUploadAndDownLoad.js

@@ -0,0 +1,142 @@
1
+export default {
2
+    methods: {
3
+
4
+        //删除图片
5
+        deleteImage(item) {
6
+            uni.showModal({
7
+                title: '提示',
8
+                content: '确定要删除这张图片吗?',
9
+                success: async (res) => {
10
+                    if (res.confirm) {
11
+                        // 调接口删除
12
+                        console.log('现在要删除的文件文件是:', item.id)
13
+                        try {
14
+                            await uni.$u.api.deleteClueFile([item.id])
15
+                            uni.showToast({
16
+                                title: '删除成功',
17
+                                icon: 'success',
18
+                                duration: 2000
19
+                            })
20
+                        } catch (error) {
21
+                            uni.showToast({
22
+                                title: '删除失败',
23
+                                icon: 'error',
24
+                                duration: 2000
25
+                            })
26
+                        }
27
+                        // 删除成功后刷新列表
28
+                        this.getList('2', '1');
29
+                        this.getList('2', '2');
30
+                        this.getList('2', '3');
31
+                    }
32
+                }
33
+            })
34
+        },
35
+        //获取文件列表
36
+        async getList(type, orderFileType) {
37
+            console.log('获取文件列表', type, orderFileType)
38
+
39
+            try {
40
+                const params = {
41
+                    clueId: this.orderDetail.clueId,
42
+                    sourceId: this.orderId,
43
+                    type,
44
+                    orderFileType,
45
+                    isDuplicate: '1',//先传1
46
+                    pageNum: 1,
47
+                    pageSize: 1000 // 设置一个较大的值以获取所有数据
48
+                }
49
+                const response = await uni.$u.api.selectClueFileByDto(params)
50
+                if (orderFileType == '1') {
51
+                    this.trueUploadList = response.rows || []
52
+                } else if (orderFileType == '2') {
53
+                    this.chatRecordsUploadList = response.rows || []
54
+                } else if (orderFileType == '3') {
55
+                    this.detailImages = response.rows || []
56
+                }
57
+            } catch (error) {
58
+                uni.$u.toast(`获取列表失败:${error.message}`)
59
+                this.trueUploadList = []
60
+                this.chatRecordsUploadList = []
61
+            }
62
+        },
63
+        // 选择图片
64
+        uploadImage(type) {
65
+            uni.chooseImage({
66
+                count: 9, // 最多选择9张
67
+                sizeType: ['compressed'], // 压缩图片
68
+                sourceType: ['album', 'camera'], // 从相册选择或拍照
69
+                success: (res) => {
70
+                    const tempFilePaths = res.tempFilePaths
71
+                    console.log('上传的图片路径:11', tempFilePaths)
72
+                    this.uploadToServer(tempFilePaths, type)
73
+                },
74
+                fail: (err) => {
75
+                    console.error('选择图片失败:', err)
76
+                }
77
+            })
78
+        },
79
+        // 上传到服务器
80
+        async uploadToServer(filePaths, type) {
81
+            // 实际的上传逻辑
82
+            try {
83
+                //实物图的话就是1,聊天记录的话就是2,高清细节图的话就是3
84
+                let p = type == 'truePic' ? '1' : type == 'chatRecords' ? '2' : type == 'detailImages' ? '3' : ''
85
+                console.log('当前上传的图片类型是', p)
86
+                const res = await Promise.all(filePaths.map(filePath => this.uploadFile(filePath, p)));
87
+
88
+                // 绑定
89
+                this.bindOrder(p);
90
+
91
+                this.getList('2', '1');
92
+                this.getList('2', '2');
93
+                this.getList('2', '3');
94
+
95
+
96
+            } catch (error) {
97
+                console.error('上传失败:', error);
98
+                uni.$u.toast('上传失败');
99
+            }
100
+        },
101
+        // 上传文件
102
+        async uploadFile(fileUrl, orderFileType) {
103
+            try {
104
+                uni.showLoading({
105
+                    title: '上传中...',
106
+                    mask: true
107
+                });
108
+
109
+                // 调用统一的上传接口
110
+                const { data } = await uni.$u.api.uploadFile(fileUrl);
111
+
112
+                const fileObj = {
113
+                    fileSize: data.fileSize,
114
+                    fileSuffix: data.fileSuffix,
115
+                    fileName: data.name,
116
+                    fileUrl: data.url,
117
+                    orderFileType: orderFileType
118
+                };
119
+                this.bindList.push(fileObj);
120
+
121
+            } catch (error) {
122
+                uni.hideLoading();
123
+                console.error('文件上传失败:', error);
124
+                uni.$u.toast('上传失败,请重试');
125
+            }
126
+        },
127
+        //绑定订单
128
+        async bindOrder(orderFileType) {
129
+            const res = await uni.$u.api.saveClueFile({
130
+                clueId: this.orderDetail.clueId,//线索id
131
+                list: this.bindList,
132
+                sourceId: this.orderId,//订单id,sendformid
133
+                type: '2',
134
+                orderFileType: orderFileType
135
+            });
136
+            uni.$u.toast("上传成功");
137
+            uni.hideLoading();
138
+            // 清空待绑定的图片列表
139
+            this.bindList = [];
140
+        },
141
+    }
142
+}