fix:修改带图片的投票显示问题

This commit is contained in:
wyx
2023-03-07 22:34:40 +08:00
parent 683636bb65
commit 3930ea07b0

View File

@@ -99,6 +99,7 @@
style="width: 140px; height: 140px; border-radius: 8px"
:src="value.optionPictureAddress"
/>
<div v-else-if="isExistImg(item.optionDetailList)" style="width: 140px; height: 140px; border-radius: 8px"></div>
<div class="radio">
<label @click="choiceQuestion(item,value)">
<div class="radio-img">
@@ -219,6 +220,18 @@ const choiceQuestion = (item, value) => {
item.optionDetailList?.forEach(t => t.isAnswer = false);
value.isAnswer = true;
};
// 判断当前题目中是否有的选项有图片有的没有
const isExistImg = (data) => {
let exist = false;
data.forEach((i,n)=>{
console.log(i,n)
if(i.optionPictureAddress){
exist = true;
return exist;
}
})
return exist;
}
// 提交投票
const submitVote = () => {
let nowTime = new Date().getTime();