detail.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view style="padding: 30px 15px;">
  3. <view v-if="paperData!=null && paperData.id!=null">
  4. <!-- 显示感谢文字 -->
  5. <result-thanks v-if="paperData.resultType===1" :data="paperData" />
  6. <!-- 显示感谢文字加分数 -->
  7. <result-score v-if="paperData.resultType===2" :data="paperData" />
  8. <!-- 显示完整解析详情 -->
  9. <result-detail v-if="paperData.resultType===3" :data="paperData" />
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import ResultDetail from "./components/ResultDetail.vue"
  15. import ResultScore from "./components/ResultScore.vue"
  16. import ResultThanks from "./components/ResultThanks.vue"
  17. import { paperResult } from '@/api/paper.js'
  18. export default {
  19. components: {
  20. ResultDetail, ResultScore, ResultThanks
  21. },
  22. data() {
  23. return {
  24. paperId: '',
  25. paperData: {}
  26. }
  27. },
  28. onLoad(option) {
  29. this.paperId = option.id;
  30. this.fetchPaperResult()
  31. },
  32. onBackPress(e){
  33. // //正常返回页面
  34. // uni.redirectTo({
  35. // url:"/pages/paper/list?id="+this.paperData.examId
  36. // })
  37. // return true;
  38. },
  39. methods: {
  40. backHome(){
  41. uni.switchTab({
  42. url: '/pages/index/index'
  43. });
  44. },
  45. // 加载考试列表
  46. fetchPaperResult() {
  47. uni.showLoading({
  48. title: '加载中..'
  49. });
  50. paperResult(this.paperId).then(data => {
  51. this.paperData = data
  52. uni.hideLoading()
  53. }, error => {
  54. console.log(error);
  55. })
  56. }
  57. }
  58. }
  59. </script>