submitScore.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <uni-popup ref="popupRef" background-color="#fff" :animation="false" :is-mask-click="false" :mask-click="false">
  3. <view class="exam-score-popup">
  4. <customNavbarVue class="exam-score-navBar-box" title="考试得分"></customNavbarVue>
  5. <view class="score-content-box">
  6. <view class="score-content-name">{{data[nameKey]}}</view>
  7. <view class="content-score-box">
  8. <view>
  9. <view class="score-content-text">正确数量:{{data.rightCount}}</view>
  10. <view class="score-content-text">试题总数:{{data.shitiTotal}}</view>
  11. <view class="score-content-text">及格分数:{{data.okScore}}</view>
  12. <view class="score-content-text">{{labelName}}:{{data.ksScore}}</view>
  13. </view>
  14. <view class="score-content-text"><text>{{data.userScore}}</text>分</view>
  15. </view>
  16. </view>
  17. <view class="progress-text-btn-box">
  18. <text class="progress-text">正确率</text>
  19. <c-progress-circle :progress='data.userAccuracy/100' color='#0856e6' size='280rpx'
  20. boderWidth="280rpx" class="progress-circle-box"></c-progress-circle>
  21. <view class="score-dialog-btn" @click="handleCheckSj">查看成绩</view>
  22. </view>
  23. </view>
  24. </uni-popup>
  25. </template>
  26. <script setup>
  27. import customNavbarVue from "@/components/custom-navbar/custom-navbar.vue";
  28. import {
  29. ref,
  30. reactive
  31. } from "vue";
  32. const popupRef = ref(null)
  33. const data = reactive({
  34. ksName: '',
  35. lxName: '',
  36. ksScore: '',
  37. okScore: '',
  38. rightCount: '',
  39. shitiTotal: '',
  40. userScore: '',
  41. })
  42. defineProps({
  43. title: {
  44. type: String,
  45. default: '考试得分'
  46. },
  47. labelName: {
  48. type: String,
  49. default: '考试总分'
  50. },
  51. nameKey: {
  52. type: String,
  53. default: 'ksName'
  54. }
  55. })
  56. const emits = defineEmits(['confirm', 'close'])
  57. function handleClose() {
  58. emits('close');
  59. popupRef.value.close()
  60. }
  61. function handleCheckSj() {
  62. emits('confirm', data);
  63. popupRef.value.close()
  64. }
  65. function showDialog(options) {
  66. data.ksName = options.ksName;
  67. data.lxName = options.lxName;
  68. data.ksScore = options.ksScore;
  69. data.okScore = options.okScore;
  70. data.rightCount = options.rightCount;
  71. data.shitiTotal = options.shitiTotal;
  72. data.userScore = options.userScore;
  73. data.userAccuracy = options.userAccuracy;
  74. popupRef.value.open()
  75. }
  76. defineExpose({
  77. showDialog
  78. })
  79. </script>
  80. <style lang="scss">
  81. .content{
  82. display: flex;
  83. flex-direction: column;
  84. align-items: center;
  85. padding-top: 20rpx;
  86. font-size: 28rpx;
  87. }
  88. .btnBox{
  89. width: 100%;
  90. display: flex;
  91. align-items: center;
  92. margin-top:30rpx;
  93. }
  94. </style>