|
@ -43,10 +43,10 @@ export default { |
|
|
this.brand_id = options?.brand_id ?? ''; |
|
|
this.brand_id = options?.brand_id ?? ''; |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
// 选择反馈图片 |
|
|
chooseImg(){ |
|
|
chooseImg(){ |
|
|
uni.chooseImage({ |
|
|
uni.chooseImage({ |
|
|
success: imgRes =>{ |
|
|
success: imgRes =>{ |
|
|
console.log(imgRes); |
|
|
|
|
|
this.imgTempLs = imgRes?.tempFilePaths || [] |
|
|
this.imgTempLs = imgRes?.tempFilePaths || [] |
|
|
}, |
|
|
}, |
|
|
failMsg: imgErr => { |
|
|
failMsg: imgErr => { |
|
@ -54,6 +54,7 @@ export default { |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 删除图片 |
|
|
delImg(idx){ |
|
|
delImg(idx){ |
|
|
this.imgTempLs.splice(idx, 1); |
|
|
this.imgTempLs.splice(idx, 1); |
|
|
}, |
|
|
}, |
|
@ -61,16 +62,19 @@ export default { |
|
|
let { iptTxt, imgTempLs, brand_id } = this; |
|
|
let { iptTxt, imgTempLs, brand_id } = this; |
|
|
if(!iptTxt)return showModal({ title: '提示', content: '请输入反馈内容' }); |
|
|
if(!iptTxt)return showModal({ title: '提示', content: '请输入反馈内容' }); |
|
|
try{ |
|
|
try{ |
|
|
|
|
|
// 批量上传图片 |
|
|
showLoad(); |
|
|
showLoad(); |
|
|
let _imgLs = await Promise.all(imgTempLs.map((e, i) => { |
|
|
let _imgLs = await Promise.all(imgTempLs.map((e, i) => { |
|
|
return this.uploadImg(e) |
|
|
return this.uploadImg(e) |
|
|
})); |
|
|
})); |
|
|
hideLoad(); |
|
|
hideLoad(); |
|
|
|
|
|
|
|
|
|
|
|
// 过滤上传失败的图片 |
|
|
|
|
|
let _effectivityImgs = _imgLs.filter(e => e?.type !== 'error'); |
|
|
|
|
|
// 提交反馈信息 |
|
|
this.submitComplaintInfo({ |
|
|
this.submitComplaintInfo({ |
|
|
brand_id: brand_id, |
|
|
brand_id: brand_id, |
|
|
mc_text: iptTxt ?? '', |
|
|
mc_text: iptTxt ?? '', |
|
|
mc_imgs: _imgLs?.map(e => e?.url ?? '') || [] |
|
|
|
|
|
|
|
|
mc_imgs: _effectivityImgs?.map(e => e?.url ?? '') || [] |
|
|
}) |
|
|
}) |
|
|
}catch(err){ |
|
|
}catch(err){ |
|
|
hideLoad(); |
|
|
hideLoad(); |
|
|