<template>
  <div>
    <exam-end @cardChange="cardChange"></exam-end>
  </div>
</template>

<script>
// import { Toast } from 'vant'
export default {
  data() {
    return {
      questionsData: null,
      requestData: null
    }
  },
  computed: {
    isWeapp() {
      return this.$store.state.isWeapp
    }
  },
  metaInfo () {
    return {
      title: '成绩报告',
      meta: [
        // { vmid: 'description', name: 'description', content: this.description }
      ]
    }
  },
  methods: {
    cardChange(e) {
      const eData = JSON.stringify(e).replace(/:/gi, '=').replace(/,/gi, '&').replace(/({")|("})/gi, '').replace(/"/gi, '')
      const path = `/exam/answer?${eData}`
      if (this.isWeapp) {
        const src = encodeURIComponent(`${window.location.origin}${path}`)
        wx.miniProgram.navigateTo({
          url: `/pages/web/index?src=${src}`
        })
      } else {
        this.$router.push({ path })
      }
      // this.$router.push({
      //   path: '/exam/answer',
      //   query: e
      // })
    }
  }
}
</script>
<style lang="scss" scoped>
</style>
