|
|
@@ -740,9 +740,8 @@ const choiceFile = (e) => {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- uni.chooseMedia({
|
|
|
+ uni.chooseImage({
|
|
|
count: questionList[index].RuleInfo.FileCount,
|
|
|
- mediaType: ['image'],
|
|
|
sourceType: ['album', 'camera'],
|
|
|
sizeType: ['compressed'],
|
|
|
async success(res) {
|
|
|
@@ -753,13 +752,13 @@ const choiceFile = (e) => {
|
|
|
let m = 1024 * 1024;
|
|
|
if (res.tempFiles[i].size < m) {
|
|
|
let imgUrl = (await uploadFile(
|
|
|
- res.tempFiles[i].tempFilePath,
|
|
|
+ res.tempFilePaths[i],
|
|
|
questionList[index].RuleInfo.FileCount,
|
|
|
answerList[answerIndex].Answer
|
|
|
)) as string;
|
|
|
if (common.isNotEmpty(imgUrl)) {
|
|
|
imgUrl =
|
|
|
- imgUrl.indexOf('http') > -1 ? imgUrl : useDomain() + imgUrl.replace(/\\/g, '/');
|
|
|
+ imgUrl.indexOf('http') > -1 ? imgUrl : `${useDomain()}/${imgUrl.replace(/\\/g, '/')}`;
|
|
|
answerList[answerIndex].Answer.push(imgUrl);
|
|
|
questionList[index].AnswerList = answerList[answerIndex].Answer;
|
|
|
quesList.value.QuestionList = questionList;
|
|
|
@@ -804,7 +803,7 @@ const uploadFile = (imgItem, fileCount, imgList) => {
|
|
|
} else {
|
|
|
common.showModal(data.msg);
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
@@ -918,6 +917,7 @@ const submit = () => {
|
|
|
item.Answer = item.Answer.join();
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
answers.AnswerList = JSON.stringify(quesAnswers.AnswerList);
|
|
|
// 安全读取 currentUser 字段,缺失则置空
|
|
|
const mobile = currentUser.value?.mobile ?? ''
|