data: {
evalList: [{ tempFilePaths: [], imgList: [] }]
},
//添加图片
joinPicture: function (e) {
var index = e.currentTarget.dataset.index;
var evalList = this.data.evalList;
var that = this;
var imgNumber = evalList[index].tempFilePaths;
if (imgNumber.length >= 3) {
wx.showModal({
title: '',
content: '最多上传三张图片',
showCancel: false,
})
return;
}
wx.showActionSheet({
itemList: ["从相册中选择", "拍照"],
itemColor: "#f7982a",
success: function (res) {
if (!res.cancel) {
if (res.tapIndex == 0) {
that.chooseWxImage("album", imgNumber);
} else if (res.tapIndex == 1) {
that.chooseWxImage("camera", imgNumber);
}
}
}
})
},
chooseWxImage: function (type, list) {
var img = list;
var len = img.length;
var that = this;
var evalList = this.data.evalList;
wx.chooseImage({
count: 3,
sizeType: ["original", "compressed"],
sourceType: [type],
success: function (res) {
var addImg = res.tempFilePaths;
var addLen = add