submitScore.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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">{{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. defineProps({
  35. title: {
  36. type: String,
  37. default: '考试得分'
  38. }
  39. })
  40. const emits = defineEmits(['confirm', 'close'])
  41. function handleClose() {
  42. emits('close');
  43. popupRef.value.close()
  44. }
  45. function handleCheckSj() {
  46. emits('confirm', data);
  47. popupRef.value.close()
  48. }
  49. function showDialog(options) {
  50. data.ksName = options.ksName;
  51. data.ksScore = options.ksScore;
  52. data.okScore = options.okScore;
  53. data.rightCount = options.rightCount;
  54. data.shitiTotal = options.shitiTotal;
  55. data.userScore = options.userScore;
  56. popupRef.value.open()
  57. }
  58. defineExpose({
  59. showDialog
  60. })
  61. </script>
  62. <style lang="scss" scoped>
  63. .score-content {
  64. height: 100vh;background-color: #fff;
  65. }
  66. .popup-height {
  67. }
  68. </style>