submitScore.vue 2.3 KB

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