submitScore.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <uni-popup ref="popupRef" :animation="false" :is-mask-click="false" type="bottom"
  3. mask-background-color="rgba(0, 0, 0, 0.4);" >
  4. <view class="score-content">
  5. <view class="icon-title-navBar-box">
  6. <view @click="handleClose" class="nav-bar-icon"></view>
  7. <text class="nav-bar-title">考试得分</text>
  8. </view>
  9. <view class="popup-height">
  10. <view>考试名称:{{data.ksName}}</view>
  11. <view>考试总分:{{data.ksScore}}</view>
  12. <view>及格分数:{{data.okScore}}</view>
  13. <view>正确数量:{{data.rightCount}}</view>
  14. <view>试题总数:{{data.shitiTotal}}</view>
  15. <view>用户得分:{{data.userScore}}</view>
  16. </view>
  17. <button type="primary" @click="handleCheckSj">查看成绩</button>
  18. </view>
  19. </uni-popup>
  20. </template>
  21. <script setup>
  22. import {
  23. ref,reactive
  24. } from "vue";
  25. const popupRef = ref(null)
  26. const data = reactive({
  27. ksName: '',
  28. ksScore: '',
  29. okScore: '',
  30. rightCount: '',
  31. shitiTotal: '',
  32. userScore: '',
  33. })
  34. const emits = defineEmits(['confirm', 'close'])
  35. function handleClose() {
  36. emits('close');
  37. popupRef.value.close()
  38. }
  39. function handleCheckSj() {
  40. emits('confirm', data);
  41. popupRef.value.close()
  42. }
  43. function showDialog(options) {
  44. data.ksName = options.ksName;
  45. data.ksScore = options.ksScore;
  46. data.okScore = options.okScore;
  47. data.rightCount = options.rightCount;
  48. data.shitiTotal = options.shitiTotal;
  49. data.userScore = options.userScore;
  50. popupRef.value.open()
  51. }
  52. defineExpose({
  53. showDialog
  54. })
  55. </script>
  56. <style lang="scss" scoped>
  57. .score-content {
  58. height: 100vh;background-color: #fff;
  59. }
  60. .popup-height {
  61. }
  62. </style>