detail.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view style="padding: 30px 15px;">
  3. <view v-if="paperData!=null && paperData.id!=null">
  4. <uni-forms :modelValue="postForm" ref="form" :label-width="100">
  5. <!-- 显示感谢文字 -->
  6. <!-- <result-thanks v-if="paperData.resultType===1" :data="paperData" /> -->
  7. <!-- 显示感谢文字加分数 -->
  8. <!-- <result-score v-if="paperData.resultType===2" :data="paperData" /> -->
  9. <uni-forms-item label="姓名" name="realName" style="margin-bottom: 0px;">
  10. <view style="height: 36px;line-height: 36px;">{{postForm.realName}}</view>
  11. </uni-forms-item>
  12. <uni-forms-item label="身份证号" name="idCard" style="margin-bottom: 0px;">
  13. <view style="height: 36px;line-height: 36px;">{{postForm.idCard}}</view>
  14. </uni-forms-item>
  15. <uni-forms-item label="手机号" name="mobile" style="margin-bottom: 10px;">
  16. <view style="height: 36px;line-height: 36px;">{{postForm.mobile}}</view>
  17. </uni-forms-item>
  18. <view style="height: 150px;display: flex;justify-content: space-around;">
  19. <img :src="postForm.avatar" style="width: 100%;max-width: 100px;;max-height: 150px" alt="">
  20. <img :src="postForm.face" style="width: 100%;max-width: 200px;max-height: 150px" alt="">
  21. </view>
  22. <!-- <uni-forms-item label="照片" name="avatar">
  23. <img :src="postForm.avatar" style="width: 100px;max-height: 200px" alt="">
  24. </uni-forms-item>
  25. <uni-forms-item label="身份证" name="face">
  26. <img :src="postForm.face" style="width: 100%;max-height: 150px" alt="">
  27. </uni-forms-item> -->
  28. </uni-forms>
  29. <!-- 显示完整解析详情 -->
  30. <!-- <result-detail v-if="paperData.resultType===3" :data="paperData" /> -->
  31. <result-detail style="margin-top: 20px;" :data="paperData" />
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import ResultDetail from "./components/ResultDetail.vue"
  37. import ResultScore from "./components/ResultScore.vue"
  38. import ResultThanks from "./components/ResultThanks.vue"
  39. import {
  40. info
  41. } from '@/api/user'
  42. import {
  43. paperResult
  44. } from '@/api/paper.js'
  45. export default {
  46. components: {
  47. ResultDetail,
  48. ResultScore,
  49. ResultThanks
  50. },
  51. data() {
  52. return {
  53. paperId: '',
  54. paperData: {},
  55. postForm: {
  56. avatar: '',
  57. face: ''
  58. },
  59. }
  60. },
  61. onLoad(option) {
  62. this.paperId = option.id;
  63. this.fetchPaperResult()
  64. this.handleInfo()
  65. },
  66. onBackPress(e) {
  67. // //正常返回页面
  68. // uni.redirectTo({
  69. // url:"/pages/paper/list?id="+this.paperData.examId
  70. // })
  71. // return true;
  72. },
  73. methods: {
  74. // 获取当前用户信息
  75. handleInfo() {
  76. let token = uni.getStorageSync('token');
  77. info(token).then(res => {
  78. this.postForm = res
  79. })
  80. },
  81. backHome() {
  82. uni.switchTab({
  83. url: '/pages/index/index'
  84. });
  85. },
  86. // 加载考试列表
  87. fetchPaperResult() {
  88. uni.showLoading({
  89. title: '加载中..'
  90. });
  91. paperResult(this.paperId).then(data => {
  92. this.paperData = data
  93. uni.hideLoading()
  94. }, error => {
  95. console.log(error);
  96. })
  97. }
  98. }
  99. }
  100. </script>