submitScore.vue 2.6 KB

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