|
|
@@ -40,8 +40,7 @@
|
|
40
|
40
|
<!-- 图片显示区域 -->
|
|
41
|
41
|
<view v-if="selectedCheckbox.includes('photo技巧') && photoTipsImages.length > 0"
|
|
42
|
42
|
class="image-list">
|
|
43
|
|
- <view v-for="(image, index) in photoTipsImages" :key="index" class="image-item"
|
|
44
|
|
- @click="previewImageHandler(image, 'photoTips')">
|
|
|
43
|
+ <view v-for="(image, index) in photoTipsImages" :key="index" class="image-item">
|
|
45
|
44
|
<image :src="image" mode="aspectFill" class="image-thumb"></image>
|
|
46
|
45
|
</view>
|
|
47
|
46
|
</view>
|
|
|
@@ -63,8 +62,7 @@
|
|
63
|
62
|
<!-- 图片显示区域 -->
|
|
64
|
63
|
<view v-if="selectedCheckbox.includes('face2face') && face2faceImages.length > 0"
|
|
65
|
64
|
class="image-list">
|
|
66
|
|
- <view v-for="(image, index) in face2faceImages" :key="index" class="image-item"
|
|
67
|
|
- @click="previewImageHandler(image, 'face2face')">
|
|
|
65
|
+ <view v-for="(image, index) in face2faceImages" :key="index" class="image-item">
|
|
68
|
66
|
<image :src="image" mode="aspectFill" class="image-thumb"></image>
|
|
69
|
67
|
</view>
|
|
70
|
68
|
</view>
|
|
|
@@ -224,7 +222,7 @@ export default {
|
|
224
|
222
|
},
|
|
225
|
223
|
|
|
226
|
224
|
// 下一步按钮点击事件
|
|
227
|
|
- handleNextClick() {
|
|
|
225
|
+ async handleNextClick() {
|
|
228
|
226
|
// 创建一个只包含被勾选checkbox对应数据的对象
|
|
229
|
227
|
const result = {};
|
|
230
|
228
|
|
|
|
@@ -257,6 +255,49 @@ export default {
|
|
257
|
255
|
nowPage: 'formTwo',
|
|
258
|
256
|
form: result,
|
|
259
|
257
|
})
|
|
|
258
|
+
|
|
|
259
|
+ // 下一步的时候要通过判断是否有联系师傅,师傅拍图技巧,到达客户面对面,如果有的话调uni.$u.api.addOrderFollow(orderFormData);接口按照 联系师傅;内容;url1,url2,url3,的格式上传
|
|
|
260
|
+ //先判断有没有联系师傅
|
|
|
261
|
+ if (this.selectedCheckbox.includes('contact师傅')) {
|
|
|
262
|
+ console.log('触发联系师傅')
|
|
|
263
|
+ // 联系师傅的手机号,已:为分割,取后面的内容
|
|
|
264
|
+ const phone = this.formData.contactPhone || '';
|
|
|
265
|
+ const data = `联系师傅;${phone}`;
|
|
|
266
|
+ // 调用接口上传
|
|
|
267
|
+ await uni.$u.api.addOrderFollow({
|
|
|
268
|
+ orderId: this.orderId,
|
|
|
269
|
+ content: data,
|
|
|
270
|
+ })
|
|
|
271
|
+ }
|
|
|
272
|
+ if (this.selectedCheckbox.includes('photo技巧')) {
|
|
|
273
|
+ console.log('触发师傅拍图技巧')
|
|
|
274
|
+ // 师傅拍图技巧的内容,已:为分割,取后面的内容
|
|
|
275
|
+ const photoTips = this.formData.photoTips || '';
|
|
|
276
|
+ const urls = this.photoTipsImages.join(',');
|
|
|
277
|
+
|
|
|
278
|
+ const data = `师傅拍图技巧;${photoTips};${urls}`;
|
|
|
279
|
+ console.log('urls9999999', data)
|
|
|
280
|
+
|
|
|
281
|
+ // 调用接口上传
|
|
|
282
|
+ await uni.$u.api.addOrderFollow({
|
|
|
283
|
+ orderId: this.orderId,
|
|
|
284
|
+ content: data,
|
|
|
285
|
+ })
|
|
|
286
|
+ }
|
|
|
287
|
+ if (this.selectedCheckbox.includes('face2face')) {
|
|
|
288
|
+ // 到达客户面对面的内容,已:为分割,取后面的内容
|
|
|
289
|
+ const face2faceNotes = this.formData.face2faceNotes || '';
|
|
|
290
|
+ const urls = this.face2faceImages.join(',');
|
|
|
291
|
+
|
|
|
292
|
+
|
|
|
293
|
+ const data = `到达客户面对面;${face2faceNotes};${urls}`;
|
|
|
294
|
+ // 调用接口上传
|
|
|
295
|
+
|
|
|
296
|
+ await uni.$u.api.addOrderFollow({
|
|
|
297
|
+ orderId: this.orderId,
|
|
|
298
|
+ content: data,
|
|
|
299
|
+ })
|
|
|
300
|
+ }
|
|
260
|
301
|
},
|
|
261
|
302
|
checkFollowUpContent() {
|
|
262
|
303
|
// 检查跟进记录是否包含上面的三个选择
|
|
|
@@ -266,20 +307,30 @@ export default {
|
|
266
|
307
|
if (item.includes('联系师傅')) {
|
|
267
|
308
|
this.selectedCheckbox.push('contact师傅');
|
|
268
|
309
|
// 联系师傅的手机号,已:为分割,取后面的内容
|
|
269
|
|
- const phone = item.split('联系师傅:')[1] || '';
|
|
|
310
|
+ const phone = item.split(';')[1] || '';
|
|
|
311
|
+ console.log('联系师傅的手机号111111', phone)
|
|
270
|
312
|
this.formData.contactPhone = phone;
|
|
271
|
313
|
}
|
|
272
|
314
|
if (item.includes('师傅拍图技巧')) {
|
|
273
|
315
|
this.selectedCheckbox.push('photo技巧');
|
|
274
|
316
|
// 师傅拍图技巧的内容,已:为分割,取后面的内容
|
|
275
|
|
- const photoTips = item.split('师傅拍图技巧:')[1] || '';
|
|
|
317
|
+ const photoTips = item.split(';')[1] || '';
|
|
276
|
318
|
this.formData.photoTips = photoTips;
|
|
|
319
|
+ const urls = item.split(';')[2] || ''
|
|
|
320
|
+ //把url转为数组
|
|
|
321
|
+ const urlArray = urls.split(',').map(url => url.trim());
|
|
|
322
|
+ this.photoTipsImages = [...this.photoTipsImages, ...urlArray];
|
|
|
323
|
+
|
|
277
|
324
|
}
|
|
278
|
325
|
if (item.includes('到达客户面对面')) {
|
|
279
|
326
|
this.selectedCheckbox.push('face2face');
|
|
280
|
327
|
// 到达客户面对面的内容,已:为分割,取后面的内容
|
|
281
|
|
- const face2faceNotes = item.split('到达客户面对面:')[1] || '';
|
|
|
328
|
+ const face2faceNotes = item.split(';')[1] || '';
|
|
282
|
329
|
this.formData.face2faceNotes = face2faceNotes;
|
|
|
330
|
+ const urls = item.split(';')[2] || ''
|
|
|
331
|
+ //把url转为数组
|
|
|
332
|
+ const urlArray = urls.split(',').map(url => url.trim());
|
|
|
333
|
+ this.face2faceImages = [...this.face2faceImages, ...urlArray];
|
|
283
|
334
|
}
|
|
284
|
335
|
})
|
|
285
|
336
|
},
|
|
|
@@ -296,13 +347,14 @@ export default {
|
|
296
|
347
|
// 把blob数组上传到服务器,然后返回路径
|
|
297
|
348
|
try {
|
|
298
|
349
|
const res = await Promise.all(tempFilePath.map(filePath => uni.$u.api.uploadFile(filePath)));
|
|
299
|
|
- console.log('上传的图片路径数组是:', res.map(item => item.data.fileUrl))
|
|
|
350
|
+ console.log('上传的图片路径数组是:', res.forEach(item => console.log(item.data.url)))
|
|
300
|
351
|
// 把返回的路径赋值给对应的数组
|
|
301
|
352
|
if (field == 'photoTips') {
|
|
302
|
|
- this.photoTipsImages = [...this.photoTipsImages, ...res.map(item => item.data.fileUrl)];
|
|
303
|
|
- } else if (field == 'face2face') {
|
|
304
|
|
- this.face2faceImages = [...this.face2faceImages, ...res.map(item => item.data.fileUrl)];
|
|
305
|
|
- }
|
|
|
353
|
+ this.photoTipsImages = [...this.photoTipsImages, ...res.map(item => item.data.url)];
|
|
|
354
|
+ } else if (field == 'face2faceNotes') {
|
|
|
355
|
+ console.log('1111')
|
|
|
356
|
+ this.face2faceImages = [...this.face2faceImages, ...res.map(item => item.data.url)];
|
|
|
357
|
+ }
|
|
306
|
358
|
} catch (error) {
|
|
307
|
359
|
console.error('上传失败:', error);
|
|
308
|
360
|
uni.$u.toast('上传失败');
|
|
|
@@ -720,7 +772,7 @@ u-checkbox {
|
|
720
|
772
|
flex: 1;
|
|
721
|
773
|
border-radius: 12rpx;
|
|
722
|
774
|
font-size: 36rpx;
|
|
723
|
|
- padding: 32rpx 0;
|
|
|
775
|
+ padding: 20rpx 0;
|
|
724
|
776
|
min-width: 0;
|
|
725
|
777
|
text-align: center;
|
|
726
|
778
|
color: #ffffff;
|