|
|
@ -8,7 +8,7 @@ |
|
|
|
<!-- 问题描述区域 --> |
|
|
|
<view class="form-section"> |
|
|
|
<view class="section-title"> |
|
|
|
<view class="title-indicator"></view> |
|
|
|
<view class="title-indicator" /> |
|
|
|
<text>请描述具体问题</text> |
|
|
|
</view> |
|
|
|
<view class="text-area-container"> |
|
|
@ -20,20 +20,20 @@ |
|
|
|
<!-- 图片上传区域 --> |
|
|
|
<view class="form-section"> |
|
|
|
<view class="section-title"> |
|
|
|
<view class="title-indicator"></view> |
|
|
|
<view class="title-indicator" /> |
|
|
|
<text>请提供相关问题的截图或图片</text> |
|
|
|
</view> |
|
|
|
<view class="upload-area"> |
|
|
|
<view class="image-grid"> |
|
|
|
<view class="image-item" v-for="(image, index) in uploadedImages" :key="'img-'+index"> |
|
|
|
<image :src="image" mode="aspectFill" class="preview-image"></image> |
|
|
|
<image :src="image" mode="aspectFill" class="preview-image" /> |
|
|
|
<view class="delete-icon" @tap="deleteImage(index)"> |
|
|
|
<uv-icon name="close" color="#fff" size="24rpx"></uv-icon> |
|
|
|
<uv-icon name="close" color="#fff" size="24rpx" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="upload-button" @tap="chooseImage" v-if="uploadedImages.length < 9"> |
|
|
|
<uv-icon name="plus" size="60rpx" color="#019245"></uv-icon> |
|
|
|
<uv-icon name="plus" size="60rpx" color="#019245" /> |
|
|
|
<text>添加图片</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -43,11 +43,11 @@ |
|
|
|
<!-- 联系方式 --> |
|
|
|
<view class="form-section"> |
|
|
|
<view class="section-title"> |
|
|
|
<view class="title-indicator"></view> |
|
|
|
<view class="title-indicator" /> |
|
|
|
<text>联系方式</text> |
|
|
|
</view> |
|
|
|
<view class="contact-info"> |
|
|
|
<input class="contact-tip" placeholder="留下联系方式,方便我们向您回复" /> |
|
|
|
<input class="contact-tip" placeholder="留下联系方式,方便我们向您回复" v-model="contactInfo" placeholder-style="color: #999;" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -71,8 +71,9 @@ |
|
|
|
orderId: '', |
|
|
|
problemDescription: '', |
|
|
|
uploadedImages: [], |
|
|
|
contactInfo: '15070023168', // 默认联系方式,实际应该从用户信息中获取 |
|
|
|
orderDetail: null |
|
|
|
contactInfo: '', // 默认联系方式,实际应该从用户信息中获取 |
|
|
|
orderDetail: null, |
|
|
|
idObject:{} |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(options) { |
|
|
@ -88,32 +89,48 @@ |
|
|
|
uni.navigateBack() |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取订单详情 |
|
|
|
getOrderDetail(id) { |
|
|
|
// 从上一页获取订单信息 |
|
|
|
const pages = getCurrentPages() |
|
|
|
const prevPage = pages[pages.length - 2] |
|
|
|
// // 获取订单详情 |
|
|
|
// getOrderDetail(id) { |
|
|
|
// // 从上一页获取订单信息 |
|
|
|
// const pages = getCurrentPages() |
|
|
|
// const prevPage = pages[pages.length - 2] |
|
|
|
|
|
|
|
if (prevPage && prevPage.route.includes('order')) { |
|
|
|
// 查找匹配ID的订单 |
|
|
|
const foundOrder = prevPage.$vm.orderList.find(order => order.id === id) |
|
|
|
if (foundOrder) { |
|
|
|
this.orderDetail = foundOrder |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
// if (prevPage && prevPage.route.includes('order')) { |
|
|
|
// // 查找匹配ID的订单 |
|
|
|
// const foundOrder = prevPage.$vm.orderList.find(order => order.id === id) |
|
|
|
// if (foundOrder) { |
|
|
|
// this.orderDetail = foundOrder |
|
|
|
// </span><span class="err"> pan> } |
|
|
|
// } |
|
|
|
// }, |
|
|
|
|
|
|
|
// 选择图片 |
|
|
|
chooseImage() { |
|
|
|
uni.chooseImage({ |
|
|
|
count: 9 - this.uploadedImages.length, |
|
|
|
sizeType: ['compressed'], |
|
|
|
sourceType: ['album', 'camera'], |
|
|
|
success: (res) => { |
|
|
|
// uni.chooseImage({ |
|
|
|
// count: 9 - this.uploadedImages.length, |
|
|
|
// sizeType: ['compressed'], // 压缩图 |
|
|
|
// sourceType: ['album', 'camera'], // 相册和相机 |
|
|
|
// success: (res) => { |
|
|
|
// console.log('图片上传',res); |
|
|
|
|
|
|
|
// 预览图片 |
|
|
|
this.uploadedImages = [...this.uploadedImages, ...res.tempFilePaths] |
|
|
|
// this.uploadedImages = [...this.uploadedImages, ...res.tempFilePaths] |
|
|
|
this.$Oss.ossUploadImage({ |
|
|
|
key: '', // 不传则自动生成 |
|
|
|
folder: '', // 不传则使用日期作为文件夹 |
|
|
|
compressed: true, |
|
|
|
success: (url) => { |
|
|
|
this.uploadedImages.push(url) |
|
|
|
}, |
|
|
|
fail: (err) => { |
|
|
|
uni.showToast({ |
|
|
|
title: `上传失败${err}`, |
|
|
|
icon: 'error' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
// } |
|
|
|
// }) |
|
|
|
}, |
|
|
|
|
|
|
|
// 删除图片 |
|
|
@ -127,7 +144,7 @@ |
|
|
|
if (!this.problemDescription.trim()) { |
|
|
|
uni.showToast({ |
|
|
|
title: '请描述您的问题', |
|
|
|
icon: 'none' |
|
|
|
icon: 'error' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
@ -136,25 +153,45 @@ |
|
|
|
uni.showLoading({ |
|
|
|
title: '正在提交...' |
|
|
|
}) |
|
|
|
|
|
|
|
// 模拟上传图片 |
|
|
|
setTimeout(() => { |
|
|
|
// 模拟表单提交 |
|
|
|
setTimeout(() => { |
|
|
|
uni.hideLoading() |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
this.$api('addAfterService', { |
|
|
|
...this.idObject, |
|
|
|
phone: this.contactInfo, |
|
|
|
content: this.problemDescription, |
|
|
|
images: this.uploadedImages |
|
|
|
}, res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.code == 200) { |
|
|
|
uni.showModal({ |
|
|
|
title: '提交成功', |
|
|
|
icon: 'success', |
|
|
|
duration: 2000 |
|
|
|
content: '您的售后申请已提交,请等待审核', |
|
|
|
confirmColor: '#019245', |
|
|
|
showCancel: false, |
|
|
|
success: () => { |
|
|
|
uni.navigateBack() |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
// 延迟后返回 |
|
|
|
setTimeout(() => { |
|
|
|
this.navigateBack() |
|
|
|
}, 1500) |
|
|
|
}, 1000) |
|
|
|
}, 1000) |
|
|
|
} else { |
|
|
|
uni.showToast({ |
|
|
|
title: res.msg, |
|
|
|
icon: 'error' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
onLoad(arg) { |
|
|
|
if (arg.orderId && arg.userId && arg.id){ |
|
|
|
this.idObject = { |
|
|
|
...arg |
|
|
|
} |
|
|
|
}else { |
|
|
|
uni.showToast({ |
|
|
|
title: '数据不足', |
|
|
|
icon: 'error' |
|
|
|
}) |
|
|
|
this.$util.navigateBack() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -268,9 +305,14 @@ |
|
|
|
.contact-tip { |
|
|
|
font-size: 26rpx; |
|
|
|
color: #999; |
|
|
|
// margin-bottom: 10rpx; |
|
|
|
color: black ; |
|
|
|
// margin-bottom: 10rpx; |
|
|
|
display: block; |
|
|
|
} |
|
|
|
|
|
|
|
.contact-placeholder { |
|
|
|
color: #999; |
|
|
|
} |
|
|
|
|
|
|
|
.contact-value { |
|
|
|
font-size: 28rpx; |
|
|
|