mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-student.git
synced 2025-12-10 11:26:49 +08:00
fix:修改带图片的投票显示问题
This commit is contained in:
@@ -99,6 +99,7 @@
|
|||||||
style="width: 140px; height: 140px; border-radius: 8px"
|
style="width: 140px; height: 140px; border-radius: 8px"
|
||||||
:src="value.optionPictureAddress"
|
:src="value.optionPictureAddress"
|
||||||
/>
|
/>
|
||||||
|
<div v-else-if="isExistImg(item.optionDetailList)" style="width: 140px; height: 140px; border-radius: 8px"></div>
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<label @click="choiceQuestion(item,value)">
|
<label @click="choiceQuestion(item,value)">
|
||||||
<div class="radio-img">
|
<div class="radio-img">
|
||||||
@@ -219,6 +220,18 @@ const choiceQuestion = (item, value) => {
|
|||||||
item.optionDetailList?.forEach(t => t.isAnswer = false);
|
item.optionDetailList?.forEach(t => t.isAnswer = false);
|
||||||
value.isAnswer = true;
|
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 = () => {
|
const submitVote = () => {
|
||||||
let nowTime = new Date().getTime();
|
let nowTime = new Date().getTime();
|
||||||
|
|||||||
Reference in New Issue
Block a user