fix: 答题样式调整
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="option_item" @click.stop="click_option()" :class="select_status">
|
||||
<view class="option_text">
|
||||
{{props.analysisVo.itemContent}}
|
||||
{{props.analysisVo.itemNo}}. {{props.analysisVo.itemContent}}
|
||||
</view>
|
||||
<!-- <image v-show="select_status==='primary'" class="img" src="@/static/images/common/primary.png" mode="heightFix">
|
||||
</image>
|
||||
@@ -47,9 +47,9 @@
|
||||
});
|
||||
const select_status = computed(() => {
|
||||
if (props.backend_answer.length === 0) {
|
||||
return props.my_answer.includes(props.analysisVo.itemId) ? 'primary' : 'info';
|
||||
return (props.my_answer||[]).includes(props.analysisVo.itemId) ? 'primary' : 'info';
|
||||
} else {
|
||||
return props.my_answer.includes(props.analysisVo.itemId) ? 'success' :
|
||||
return (props.my_answer||[]).includes(props.analysisVo.itemId) ? 'success' :
|
||||
'error';
|
||||
}
|
||||
})
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<view class="type">
|
||||
{{subject_type_text}}
|
||||
</view>
|
||||
<view class="score">
|
||||
<view class="score" v-if="mode !== 'study'">
|
||||
5分
|
||||
</view>
|
||||
<view class="fl1">
|
||||
<view class="fl1" v-if="mode !== 'study'">
|
||||
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="right" v-if="mode !== 'study'">
|
||||
<view class="mark_and_feedback_div">
|
||||
<image :src="markIcon(props.item.mark?'#0066FF':'#ABABAB')" class="img" @click="mark_click()"></image>
|
||||
<image :src="feedbackIcon()" class="img" @click="feedback_click()"></image>
|
||||
@@ -23,13 +23,13 @@
|
||||
{{subject_data.qnsContent}}
|
||||
</view>
|
||||
<view class="option_div">
|
||||
<radioSubjectItem v-for="(analysisVo,index) in subject_data.itemVos" @click_option="click_option"
|
||||
:key="index" :analysisVo="analysisVo" :my_answer="props.item.my_answer"
|
||||
:backend_answer="props.item.backend_answer"></radioSubjectItem>
|
||||
<radioSubjectItem v-for="(analysisVo,index) in subject_data.itemVos" @click_option="click_option" :key="index"
|
||||
:analysisVo="analysisVo" :my_answer="props.item.my_answer" :backend_answer="props.item.backend_answer">
|
||||
</radioSubjectItem>
|
||||
</view>
|
||||
<view class="option_div_button" v-if="subject_data.qnsTyp==='MU' && props.mode=='practice'" >
|
||||
<view class="option_div_button" v-if="subject_data.qnsTyp==='MU' && ['practice','study'].includes(props.mode)">
|
||||
<uv-button type="primary" class="send_evaluate" :custom-style="customStyle" :throttleTime="300"
|
||||
:hairline="false" >确定</uv-button>
|
||||
@click="muCheckbox" :hairline="false">确定</uv-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -44,7 +44,8 @@
|
||||
} from 'vue'
|
||||
import radioSubjectItem from './radio-subject-item.vue'
|
||||
import {
|
||||
markIcon,feedbackIcon
|
||||
markIcon,
|
||||
feedbackIcon
|
||||
} from '@/common/imgSvg'
|
||||
import {
|
||||
SUBJECT_TYPE
|
||||
@@ -66,14 +67,14 @@
|
||||
required: true,
|
||||
}
|
||||
});
|
||||
|
||||
const feedback_click = () =>{
|
||||
|
||||
const feedback_click = () => {
|
||||
emit('subject_click', 'feedback', props.item)
|
||||
}
|
||||
const mark_click = () =>{
|
||||
const mark_click = () => {
|
||||
emit('subject_click', 'mark', props.item)
|
||||
}
|
||||
|
||||
|
||||
const subject_data = reactive({
|
||||
qnsId: '',
|
||||
qnsContent: '',
|
||||
@@ -97,35 +98,45 @@
|
||||
// // 无论什么类型如果表里已经有了,再次点击就是弹出
|
||||
if (props.item.my_answer.includes(analysisVo.itemId)) {
|
||||
props.item.my_answer = props.item.my_answer.filter(id => id !== analysisVo.itemId);
|
||||
}
|
||||
else if (props.item.qnsTyp === 'SN') { // 单选
|
||||
} else if (props.item.qnsTyp === 'SN') { // 单选
|
||||
// 单选插入,并且移除其他
|
||||
props.item.my_answer[0] = analysisVo.itemId
|
||||
}
|
||||
else if (props.item.qnsTyp === 'MU') { // 多选题
|
||||
muCheckbox()
|
||||
} else if (props.item.qnsTyp === 'MU') { // 多选题
|
||||
// 多选直接插入
|
||||
props.item.my_answer.push(analysisVo.itemId)
|
||||
} else if (props.item.qnsTyp === 'JD') { // 判断题
|
||||
// 判断插入,并且移除其他
|
||||
props.item.my_answer = [analysisVo.itemId]
|
||||
muCheckbox()
|
||||
}
|
||||
}
|
||||
const muCheckbox = () => {
|
||||
emit('subject_click', 'answer', {
|
||||
qnsTyp: props.item.qnsTyp,
|
||||
qnsId: props.item.qnsId,
|
||||
answer: props.item.my_answer,
|
||||
answerItems: subject_data.itemVos.filter(t=> props.item.my_answer.includes(t.itemId))
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.mark_and_feedback_div{
|
||||
.mark_and_feedback_div {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
.img{
|
||||
|
||||
.img {
|
||||
width: 38rpx;
|
||||
height: 38rpx;
|
||||
margin-left: 4rpx;
|
||||
padding: 4rpx;
|
||||
}
|
||||
}
|
||||
.option_div_button{
|
||||
|
||||
.option_div_button {
|
||||
width: 100%;
|
||||
height: 84rpx;
|
||||
padding-top: 30rpx;
|
||||
@@ -134,16 +145,18 @@
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.item {
|
||||
// height: 170rpx;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-bottom: 40rpx;
|
||||
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.type {
|
||||
width: 108rpx;
|
||||
height: 46rpx;
|
||||
@@ -168,7 +181,7 @@
|
||||
.right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
|
||||
.right_text {
|
||||
font-family: PingFangSC;
|
||||
font-weight: 600;
|
||||
@@ -178,9 +191,9 @@
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
.question_text {
|
||||
font-family: PingFangSC;
|
||||
font-weight: 500;
|
||||
|
||||
@@ -19,10 +19,11 @@
|
||||
<text class="talking-text" v-if="[3, 5, 6].indexOf(type) >= 0 && !dataInfo.isLoading">
|
||||
{{ showContent }}
|
||||
</text>
|
||||
<text class="talking-text" v-if="[4].indexOf(type) >= 0">
|
||||
<text class="talking-text" v-if="[4].indexOf(type) >= 0 && dataInfo.qnsTyp === 'ES'">
|
||||
<!-- 请您思考并作答:<br> -->
|
||||
{{ showContent }}
|
||||
</text>
|
||||
<RadioSubject v-if="[4].indexOf(type) >= 0 && dataInfo.qnsTyp !== 'ES'" :item="dataInfo" :mode="mode" @subject_click="subject_click" />
|
||||
<view v-if="type === 3" style="overflow: hidden;">
|
||||
<ImagePreview class="cont-img-box" v-if="(dataInfo.imageAddrs||[]).length>0" :imgId="dataInfo.imageAddrs[0]" :previewDetail="true"></ImagePreview>
|
||||
<VideoPreview class="cont-img-box" v-if="(dataInfo.vidoAddrs||[]).length>0" :fileId="dataInfo.vidoAddrs[0]"></VideoPreview>
|
||||
@@ -199,6 +200,8 @@ import { getUserInfo } from '@/common/common';
|
||||
import { useStorageStore } from "@/store/storage.js"
|
||||
import { onUnload } from '@dcloudio/uni-app'
|
||||
|
||||
import RadioSubject from '@/components/examination/radio-subject.vue'
|
||||
|
||||
const storageStore = useStorageStore()
|
||||
const audioCacheObj = computed(() => storageStore.audioObj)
|
||||
const props = defineProps({
|
||||
@@ -249,13 +252,15 @@ const audioCacheObj = computed(() => storageStore.audioObj)
|
||||
})
|
||||
|
||||
const { type, dataInfo, activeVoiceId, isPlaying, isLast, lastQuestionInfo, teacherInfo} = toRefs(props)
|
||||
const emit = defineEmits(['changePlay', 'nextQuestion', 'withdraw', 'finishQuestion'])
|
||||
const emit = defineEmits(['changePlay', 'nextQuestion', 'withdraw', 'finishQuestion', 'answerQuestion'])
|
||||
// 声音播放初始化
|
||||
const talkVoiceObj = ref(uni.createInnerAudioContext())
|
||||
talkVoiceObj.value.playbackRate = Number(props.voiceRate)
|
||||
const userInfo = computed(() => getUserInfo())
|
||||
const itemVoice = ref('')
|
||||
|
||||
const mode = ref('study') // 考试 examination 练习practice 学习study
|
||||
|
||||
const showWithdraw = computed(()=>{
|
||||
let _isMe = unref(lastQuestionInfo).qstLogId === unref(dataInfo).qstLogId
|
||||
let _isQuestion = unref(lastQuestionInfo).isQuestion
|
||||
@@ -316,6 +321,7 @@ const audioCacheObj = computed(() => storageStore.audioObj)
|
||||
return str.replace(/\/n/g,"\n")
|
||||
}
|
||||
const voiceTime = ref('')
|
||||
const itemInfo = ref({})
|
||||
onMounted(()=>{
|
||||
console.log()
|
||||
initVoice()
|
||||
@@ -504,6 +510,13 @@ const audioCacheObj = computed(() => storageStore.audioObj)
|
||||
const finishQuestion = (data) => {
|
||||
emit('finishQuestion',data)
|
||||
}
|
||||
// 答题 选择
|
||||
const subject_click = (type,data) => {
|
||||
if(type === 'answer'){
|
||||
emit('answerQuestion', data)
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@@ -546,6 +559,7 @@ const audioCacheObj = computed(() => storageStore.audioObj)
|
||||
background-color: #fff;
|
||||
overflow: hidden;
|
||||
padding-bottom: 30rpx;
|
||||
width: 100%;
|
||||
&.talking-info-less{
|
||||
float: left;
|
||||
min-width: 400rpx;
|
||||
|
||||
@@ -73,6 +73,7 @@
|
||||
@changePlay="changePlayItemId"
|
||||
@nextQuestion="nextQuestionSuccess"
|
||||
@withdraw="withdrawNow"
|
||||
@answerQuestion="answerQuestionNow"
|
||||
@finishQuestion="finishQuestionNow"
|
||||
:id="'item' + item.id"
|
||||
:isLast="talkingList.length === (index+1)"
|
||||
@@ -440,6 +441,7 @@ const getQuestionInfoUnStudy = (pgrphId) => {
|
||||
}).finally(() => {})
|
||||
return
|
||||
}
|
||||
console.log(_body.chatBody)
|
||||
if(_body.chatBody && _body.chatBody?.stdyStat !== 'N'){
|
||||
let _id = new Date().getTime() + 'id'
|
||||
lastTalkingInfo.value = {
|
||||
@@ -454,8 +456,11 @@ const getQuestionInfoUnStudy = (pgrphId) => {
|
||||
type: 4,
|
||||
userInfo: {...choiceTeacherInfo.value},
|
||||
id: _id,
|
||||
isQuestion: true
|
||||
isQuestion: true,
|
||||
my_answer:[],
|
||||
backend_answer: []
|
||||
}
|
||||
console.log(lastTalkingInfo.value)
|
||||
talkingList.value.push(JSON.parse(JSON.stringify(lastTalkingInfo.value)))
|
||||
qstLogId.value = _body.chatBody?.qstLogId
|
||||
scrollToBottomNow()
|
||||
@@ -827,6 +832,9 @@ const withdrawNow = (data) => {
|
||||
})
|
||||
}
|
||||
const loadingQstLogId = ref('')
|
||||
const answerQuestionNow = (data) => {
|
||||
console.log(data,1111111111)
|
||||
}
|
||||
// 完成
|
||||
const finishQuestionNow = (data) => {
|
||||
textChartApi({
|
||||
|
||||
Reference in New Issue
Block a user