submitScore.vue 2.6 KB

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