submitScore.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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="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. ksScore: '',
  39. okScore: '',
  40. rightCount: '',
  41. shitiTotal: '',
  42. userScore: '',
  43. })
  44. defineProps({
  45. title: {
  46. type: String,
  47. default: '考试得分'
  48. },
  49. labelName: {
  50. type: String,
  51. default: '考试总分'
  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.ksScore = options.ksScore;
  66. data.okScore = options.okScore;
  67. data.rightCount = options.rightCount;
  68. data.shitiTotal = options.shitiTotal;
  69. data.userScore = options.userScore;
  70. data.userAccuracy = options.userAccuracy;
  71. popupRef.value.open()
  72. }
  73. defineExpose({
  74. showDialog
  75. })
  76. </script>
  77. <style lang="scss">
  78. .content{
  79. display: flex;
  80. flex-direction: column;
  81. align-items: center;
  82. padding-top: 20rpx;
  83. font-size: 28rpx;
  84. }
  85. .btnBox{
  86. width: 100%;
  87. display: flex;
  88. align-items: center;
  89. margin-top:30rpx;
  90. }
  91. </style>