|
@@ -16,28 +16,74 @@
|
|
|
<h1>知识问答</h1>
|
|
|
</div>
|
|
|
<QuestionPending
|
|
|
- v-if="!isShowDesc"
|
|
|
+ v-show="!isShowDesc"
|
|
|
ref="question-pending"
|
|
|
:is-submitted="isSubmitted"
|
|
|
@submit="onSubmit"
|
|
|
/>
|
|
|
+ <AnswerDesc
|
|
|
+ v-show="isShowDesc"
|
|
|
+ />
|
|
|
<button
|
|
|
- v-if="!isSubmitted && (questionInfo?.questionType === '多选题' || questionInfo.questionType === '连线题')"
|
|
|
+ v-show="!isSubmitted && (questionInfo?.questionType === '多选题' || questionInfo.questionType === '连线题')"
|
|
|
class="submit"
|
|
|
@click="onSubmit"
|
|
|
>
|
|
|
提交答案
|
|
|
</button>
|
|
|
+ <div
|
|
|
+ v-show="!isShowDesc && isSubmitted && $refs['question-pending']?.isCorrect"
|
|
|
+ class="button-wrapper-correct"
|
|
|
+ >
|
|
|
+ <button
|
|
|
+ class="watch-desc"
|
|
|
+ @click="onClickWatchDesc"
|
|
|
+ >
|
|
|
+ 答案解析
|
|
|
+ </button>
|
|
|
+ <button class="next">
|
|
|
+ 下一题(2)
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-show="!isShowDesc && isSubmitted && !$refs['question-pending']?.isCorrect"
|
|
|
+ class="button-wrapper-wrong"
|
|
|
+ >
|
|
|
+ <button class="next">
|
|
|
+ 下一题(2)
|
|
|
+ </button>
|
|
|
+ <button
|
|
|
+ class="retry"
|
|
|
+ @click="onClickRetry"
|
|
|
+ >
|
|
|
+ 重新答题
|
|
|
+ </button>
|
|
|
+ <button
|
|
|
+ class="watch-desc"
|
|
|
+ @click="onClickWatchDesc"
|
|
|
+ >
|
|
|
+ 答案解析
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ <button
|
|
|
+ v-show="isShowDesc"
|
|
|
+ class="return-question"
|
|
|
+ @click="isShowDesc = false"
|
|
|
+ >
|
|
|
+ 返回题目
|
|
|
+ </button>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
// import browser from "@/utils/browser";
|
|
|
import QuestionPending from "@/views/QuestionPending.vue"
|
|
|
+import AnswerDesc from "@/views/AnswerDesc.vue"
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
- QuestionPending
|
|
|
+ QuestionPending,
|
|
|
+ AnswerDesc,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -59,14 +105,18 @@ export default {
|
|
|
window.parent.document.getElementById('closepop').click()
|
|
|
},
|
|
|
onSubmit() {
|
|
|
- const selectedIdxList = this.$refs['question-pending'].selectedIdxList
|
|
|
- const selectedCount = selectedIdxList.reduce((accumulator, currentValue) => {
|
|
|
- return accumulator + currentValue
|
|
|
- })
|
|
|
- if (selectedCount > 0) {
|
|
|
+ if (this.$refs['question-pending'].canSubmit > 0) {
|
|
|
this.isSubmitted = true
|
|
|
console.log('submit!')
|
|
|
}
|
|
|
+ },
|
|
|
+ onClickWatchDesc() {
|
|
|
+ this.isShowDesc = true
|
|
|
+ },
|
|
|
+ onClickRetry() {
|
|
|
+ this.isSubmitted = false
|
|
|
+ this.isShowDesc = false
|
|
|
+ this.$refs['question-pending'].selectedIdxList = []
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -133,5 +183,86 @@ export default {
|
|
|
font-weight: 400;
|
|
|
color: #FFFFFF;
|
|
|
}
|
|
|
+ > .button-wrapper-correct {
|
|
|
+ margin-top: 10px;
|
|
|
+ margin-bottom: 70px;
|
|
|
+ > button {
|
|
|
+ width: 149px;
|
|
|
+ height: 40px;
|
|
|
+ &.watch-desc {
|
|
|
+ background-image: url(@/assets/images/btn-normal-bg.png);
|
|
|
+ background-size: contain;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-position: center center;
|
|
|
+ margin-right: 15px;
|
|
|
+ }
|
|
|
+ &.next {
|
|
|
+ background-image: url(@/assets/images/btn-main-bg.png);
|
|
|
+ background-size: contain;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-position: center center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ > .button-wrapper-wrong {
|
|
|
+ margin-top: 10px;
|
|
|
+ margin-bottom: 70px;
|
|
|
+ > button.next {
|
|
|
+ display: block;
|
|
|
+ width: 313px;
|
|
|
+ height: 40px;
|
|
|
+ background-image: url(@/assets/images/btn-main-long-bg.png);
|
|
|
+ background-size: 100% 100%;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-position: center center;
|
|
|
+ font-size: 20px;
|
|
|
+ font-family: LiSu-Regular, LiSu;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #FFFFFF;
|
|
|
+ line-height: 32px;
|
|
|
+ margin-bottom: 8px;
|
|
|
+ }
|
|
|
+ > button.retry {
|
|
|
+ width: 149px;
|
|
|
+ height: 40px;
|
|
|
+ background-image: url(@/assets/images/btn-normal-bg.png);
|
|
|
+ background-size: contain;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-position: center center;
|
|
|
+ font-size: 20px;
|
|
|
+ font-family: LiSu-Regular, LiSu;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #8F4831;
|
|
|
+ margin-right: 15px;
|
|
|
+ }
|
|
|
+ > button.watch-desc {
|
|
|
+ width: 149px;
|
|
|
+ height: 40px;
|
|
|
+ background-image: url(@/assets/images/btn-normal-bg.png);
|
|
|
+ background-size: contain;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-position: center center;
|
|
|
+ font-size: 20px;
|
|
|
+ font-family: LiSu-Regular, LiSu;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #8F4831;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ > button.return-question {
|
|
|
+ margin-top: 10px;
|
|
|
+ margin-bottom: 70px;
|
|
|
+ display: block;
|
|
|
+ width: 313px;
|
|
|
+ height: 40px;
|
|
|
+ background-image: url(@/assets/images/btn-main-long-bg.png);
|
|
|
+ background-size: 100% 100%;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-position: center center;
|
|
|
+ font-size: 20px;
|
|
|
+ font-family: LiSu-Regular, LiSu;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #FFFFFF;
|
|
|
+ line-height: 32px;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|