|
|
@@ -79,7 +79,7 @@
|
|
|
import { ref, computed, watch, onMounted } from "vue"
|
|
|
import { useRoute, useRouter } from "vue-router"
|
|
|
import { useStore } from "vuex"
|
|
|
-import { redeem } from '@/api.js'
|
|
|
+import { redeem, getScore } from '@/api.js'
|
|
|
import NotifyComp from '@/components/NotifyComp.vue'
|
|
|
|
|
|
const route = useRoute()
|
|
|
@@ -105,12 +105,17 @@ function submit() {
|
|
|
redeem(detail.value, name.value, contact.value, prizeInfo.id, prizeInfo.score).then((res) => {
|
|
|
ifShowNotify.value = true
|
|
|
haveSubmitted.value = true
|
|
|
- setTimeout(() => {
|
|
|
- ifShowNotify.value = false
|
|
|
+ getScore().then((res) => {
|
|
|
+ store.commit('setScore', res.total)
|
|
|
+ store.commit('setIfScoreLimitReached', res.hasOver)
|
|
|
setTimeout(() => {
|
|
|
- router.go(-1)
|
|
|
+ ifShowNotify.value = false
|
|
|
+ setTimeout(() => {
|
|
|
+ router.go(-1)
|
|
|
+ }, 1000)
|
|
|
}, 1000)
|
|
|
- }, 1000)
|
|
|
+
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
</script>
|