|
@@ -19,6 +19,7 @@
|
|
|
:cardType="state.card?.cardType"
|
|
|
:board="state.card?.board"
|
|
|
:mode="state.mode"
|
|
|
+ :tipsButton="state.card.tipsButton"
|
|
|
:cardDesc="state.card.cardDesc"
|
|
|
:playLoading="state.playLoading"
|
|
|
@playAudio="playAudio"
|
|
@@ -45,8 +46,6 @@ import riveAni from '@/components/rive-ani/rive-ani.vue';
|
|
|
import { ref } from 'vue';
|
|
|
import { useAppBridge } from '@/hooks/app';
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* README.md 里有详细的参数说明
|
|
|
*/
|
|
@@ -107,7 +106,7 @@ const riveAniRef = ref()
|
|
|
|
|
|
const navbarState = reactive({
|
|
|
progress: 1,
|
|
|
- countdownTotal: 60,
|
|
|
+ countdownTotal: 0,
|
|
|
mode: CardModeEnum.PREVIEW
|
|
|
})
|
|
|
|
|
@@ -131,29 +130,26 @@ const state = reactive<State>({
|
|
|
})
|
|
|
|
|
|
const stx = useScheduler(() => {
|
|
|
- navbarState.countdownTotal--
|
|
|
- if (navbarState.countdownTotal <= 0) {
|
|
|
- stx.stop()
|
|
|
- }
|
|
|
+ navbarState.countdownTotal++
|
|
|
}, 1000)
|
|
|
|
|
|
// 控制游戏开始
|
|
|
const gameStart = () => {
|
|
|
- navbarState.countdownTotal = 60
|
|
|
+ navbarState.countdownTotal = 0
|
|
|
stx.start()
|
|
|
playAudio()
|
|
|
}
|
|
|
|
|
|
// 提交单张题卡数据
|
|
|
const onSubmitCard = async () => {
|
|
|
-
|
|
|
+
|
|
|
stx.stop()
|
|
|
-
|
|
|
+
|
|
|
// 触发做题完成的动画
|
|
|
await riveAniRef.value.start(calcQuantityStore.getStar(), state.card?.cardType)
|
|
|
|
|
|
wisdomCoinStore.itemCoin += calcQuantityStore.getStar()
|
|
|
-
|
|
|
+
|
|
|
// 保存做题记录
|
|
|
opraRecordStore.push({
|
|
|
correctQuantity: calcQuantityStore.correctQuantity,
|
|
@@ -163,12 +159,11 @@ const onSubmitCard = async () => {
|
|
|
})
|
|
|
|
|
|
// 保存做题时间
|
|
|
- gameCountdownStore.sum(60 - navbarState.countdownTotal)
|
|
|
+ gameCountdownStore.sum(navbarState.countdownTotal)
|
|
|
|
|
|
// 触发游戏结束
|
|
|
if (navbarState.progress == state.cardIds.length) {
|
|
|
- console.log('我会触发吗');
|
|
|
-
|
|
|
+
|
|
|
gameCompleted()
|
|
|
|
|
|
return
|
|
@@ -179,7 +174,7 @@ const onSubmitCard = async () => {
|
|
|
if (state.opraMode == OpraModeEnum.PRACTICE) {
|
|
|
|
|
|
// state.cardId
|
|
|
-
|
|
|
+
|
|
|
} else {
|
|
|
navbarState.progress++
|
|
|
|
|
@@ -209,12 +204,11 @@ const gameCompleted = async () => {
|
|
|
}
|
|
|
|
|
|
const data = await submitlearnPortAns($par, state.queryParams?.submitUrl!)
|
|
|
-
|
|
|
|
|
|
opraRecordStore.clear()
|
|
|
// 如果opraMode 的是learn 则跳转到app-web页面
|
|
|
if (state.opraMode == OpraModeEnum.LEARN) {
|
|
|
- window.location.href = `https://nginx.test.luojigou.vip/app_web/learn-plan.html#/?from='exercise'`
|
|
|
+ // window.location.href = `https://nginx.test.luojigou.vip/app_web/learn-plan.html#/?from='exercise'`
|
|
|
}
|
|
|
|
|
|
}
|