submitScore.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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="exam-score-dialog">
  5. <view class="icon-title-bjcolor-navBar-box">
  6. <view @click="handleClose" class="nav-bar-icon"></view>
  7. <text class="nav-bar-title">{{title}}</text>
  8. </view>
  9. <view class="score-content-box">
  10. <view class="score-content-name">{{data.ksName}}</view>
  11. <view class="score-content-text">考试总分:{{data.ksScore}}</view>
  12. <view class="score-content-text">及格分数:{{data.okScore}}</view>
  13. <view class="score-content-text">正确数量:{{data.rightCount}}</view>
  14. <view class="score-content-text">试题总数:{{data.shitiTotal}}</view>
  15. <view class="score-content-text">用户得分:{{data.userScore}}</view>
  16. </view>
  17. <button type="default" class="phone-green-btn score-dialog-btn" @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>