|
|
@@ -85,7 +85,7 @@
|
|
|
alt=""
|
|
|
draggable="false"
|
|
|
>
|
|
|
- <span class="number">{{ bonusPointForShow }}</span>
|
|
|
+ <span class="number">{{ bonusPoint }}</span>
|
|
|
</div>
|
|
|
<div class="info-item time-count">
|
|
|
<img
|
|
|
@@ -103,11 +103,17 @@
|
|
|
>
|
|
|
下一题
|
|
|
</button>
|
|
|
+
|
|
|
<van-loading
|
|
|
v-show="isShowLoading"
|
|
|
class="loading"
|
|
|
type="spinner"
|
|
|
/>
|
|
|
+
|
|
|
+ <transition name="fade-out">
|
|
|
+ <NotifyBonusPointReachedLimit v-if="isShowNotifyBonusPointReachedLimit" />
|
|
|
+ </transition>
|
|
|
+
|
|
|
<GameRule
|
|
|
v-show="isShowRule"
|
|
|
game-title="助农课堂"
|
|
|
@@ -126,6 +132,7 @@ import dayjs from 'dayjs'
|
|
|
import { shuffle } from 'lodash'
|
|
|
import { addScore, getScore, getExamQuestionList } from '@/api.js'
|
|
|
import GameRule from '@/components/GameRule.vue'
|
|
|
+import NotifyBonusPointReachedLimit from '@/components/NotifyBonusPointReachedLimit.vue'
|
|
|
|
|
|
const route = useRoute()
|
|
|
const router = useRouter()
|
|
|
@@ -196,13 +203,7 @@ const timeCountForShow = computed(() => {
|
|
|
|
|
|
// 积分
|
|
|
const bonusPoint = ref(0)
|
|
|
-const bonusPointForShow = computed(() => {
|
|
|
- if (!store.state.ifScoreLimitReached) {
|
|
|
- return bonusPoint.value
|
|
|
- } else {
|
|
|
- return `已达本日上限${store.state.scoreLimit}分`
|
|
|
- }
|
|
|
-})
|
|
|
+
|
|
|
// 答对计数
|
|
|
const correntCount = ref(0)
|
|
|
|
|
|
@@ -243,13 +244,10 @@ const currentQuestionIdx = ref(0)
|
|
|
const isSubmitted = computed(() => {
|
|
|
return selectedIdx.value !== null
|
|
|
})
|
|
|
-const isCorrect = computed(() => {
|
|
|
- return true
|
|
|
-})
|
|
|
function onClickOption(idx) {
|
|
|
selectedIdx.value = idx
|
|
|
if (selectedIdx.value === questionList.value[currentQuestionIdx.value].rightOptionIdx) {
|
|
|
- if (store.state.loginStatus) {
|
|
|
+ if (store.state.loginStatus && !store.state.ifScoreLimitReached) {
|
|
|
bonusPoint.value += store.state.gameRuleList[1].score
|
|
|
}
|
|
|
correntCount.value++
|
|
|
@@ -277,6 +275,14 @@ function onClickNext() {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+const isShowNotifyBonusPointReachedLimit = ref(false)
|
|
|
+if (store.state.ifScoreLimitReached) {
|
|
|
+ isShowNotifyBonusPointReachedLimit.value = true
|
|
|
+ setTimeout(() => {
|
|
|
+ isShowNotifyBonusPointReachedLimit.value = false
|
|
|
+ }, 2000)
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|