|
|
|
@ -8,7 +8,7 @@ Page({ |
|
|
|
|
*/ |
|
|
|
|
data: { |
|
|
|
|
array: ['请选择', 'bug问题', '业务问题', '功能使用问题', '其他'], |
|
|
|
|
objectArray: [{ |
|
|
|
|
problemArray: [{ |
|
|
|
|
id: 0, |
|
|
|
|
name: '请选择' |
|
|
|
|
}, |
|
|
|
@ -29,16 +29,16 @@ Page({ |
|
|
|
|
name: '其他' |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
index: 0, |
|
|
|
|
srxI: '', |
|
|
|
|
|
|
|
|
|
index: 0, //问题下标
|
|
|
|
|
problemStr:'', |
|
|
|
|
//图片数组
|
|
|
|
|
addImgBtn: { |
|
|
|
|
isBtn: true, |
|
|
|
|
text: "+", |
|
|
|
|
func: "addImage" |
|
|
|
|
}, |
|
|
|
|
imageArr: [] |
|
|
|
|
imageArr: [], //显示图片列表
|
|
|
|
|
upImageArr: [], //需要上传的图片路径
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
bindPickerChange(e) { |
|
|
|
@ -49,15 +49,24 @@ Page({ |
|
|
|
|
|
|
|
|
|
//提交数据
|
|
|
|
|
goMyorder() { |
|
|
|
|
if(this.data.index === 0){ |
|
|
|
|
if (this.data.index === 0) { |
|
|
|
|
wx.showToast({ |
|
|
|
|
title: '请选择问题类型', |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
var problem = objectArray[this.data.index]; //问题类型
|
|
|
|
|
request.post(`/feedBack/push?type=${this.data.index}&describe=${problem}`).then(res=>{ |
|
|
|
|
|
|
|
|
|
var problem = this.data.problemArray[this.data.index]; //问题类型
|
|
|
|
|
var data = { |
|
|
|
|
'type': this.data.index, |
|
|
|
|
'describe': this.data.problemStr, |
|
|
|
|
'imgs':this.data.upImageArr.toString |
|
|
|
|
} |
|
|
|
|
console.log(JSON.stringify(data)) |
|
|
|
|
request.post(`/feedBack/push`, data).then(res => { |
|
|
|
|
wx.showToast({ |
|
|
|
|
title: 'title', |
|
|
|
|
}) |
|
|
|
|
console.log(JSON.stringify(res.data)) |
|
|
|
|
}); |
|
|
|
|
// wx.switchTab({
|
|
|
|
|
// url: '../about/about',
|
|
|
|
@ -77,7 +86,7 @@ Page({ |
|
|
|
|
count: 1, |
|
|
|
|
mediaType: ['image'], |
|
|
|
|
sourceType: ['album'], |
|
|
|
|
sizeType:['compressed'], |
|
|
|
|
sizeType: ['compressed'], |
|
|
|
|
success: res => { |
|
|
|
|
var imgSrc = res.tempFiles[0].tempFilePath; |
|
|
|
|
_this.addCallBackImage(imgSrc); |
|
|
|
@ -88,7 +97,6 @@ Page({ |
|
|
|
|
|
|
|
|
|
//显示回调图片
|
|
|
|
|
addCallBackImage(imageSrc) { |
|
|
|
|
console.log("imgSrc=" + imageSrc); |
|
|
|
|
var temp = { |
|
|
|
|
isBtn: false, |
|
|
|
|
imgUrl: imageSrc, |
|
|
|
@ -105,18 +113,20 @@ Page({ |
|
|
|
|
upImg(imageSrc) { |
|
|
|
|
request.upImgFile(`/feedBack/upload`, imageSrc).then(res => { |
|
|
|
|
var resObj = JSON.parse(res.data); |
|
|
|
|
if(resObj.code === 500){ |
|
|
|
|
if (resObj.code > 400) { |
|
|
|
|
wx.showModal({ |
|
|
|
|
title: '提示', |
|
|
|
|
content: resObj.message, |
|
|
|
|
complete: (res) => { |
|
|
|
|
if (res.cancel) { |
|
|
|
|
} |
|
|
|
|
if (res.confirm) { |
|
|
|
|
} |
|
|
|
|
//移除图片
|
|
|
|
|
if (res.cancel) {} |
|
|
|
|
if (res.confirm) {} |
|
|
|
|
//上传失败后移除图片
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
//保存图片路径到数组
|
|
|
|
|
this.data.upImageArr.push(resObj.data.url); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|