Browse Source

update init

wangxy 3 tuần trước cách đây
mục cha
commit
aad51bd02a

+ 57 - 0
components/zhuapaiConfirm/answerQueren.vue

@@ -0,0 +1,57 @@
+<template>
+  <view>
+    <uni-popup ref="popupRef" type="dialog" :animation="false" :is-mask-click="false"
+               mask-background-color="rgba(0, 0, 0, 0.4);">
+      <uni-popup-dialog mode="input"
+                        class="phone-ksxz-dialog"
+                        title="提示"
+                        :duration="2000"
+                        :before-close="true"
+                        :showClose="true"
+                        @close="handleClose"
+                        @confirm="handleConfirm">
+        <text>
+          您已经回答了{{data.answercartsCount}}题(共{{data.answercartsTotal}}题),确认交卷?
+        </text>
+      </uni-popup-dialog>
+    </uni-popup>
+  </view>
+</template>
+
+<script setup>
+import {
+  ref,reactive
+} from "vue";
+const popupRef = ref(null)
+const data = reactive({
+  answercartsCount: '',
+  answercartsTotal: '',
+
+})
+
+const emits = defineEmits(['confirm', 'cancel'])
+
+function showDialog(options) {
+  data.answercartsCount = options.answercartsCount;
+  data.answercartsTotal = options.answercartsTotal;
+  popupRef.value.open()
+}
+
+function handleClose() {
+  emits('cancel');
+  popupRef.value.close()
+}
+
+function handleConfirm() {
+  emits('confirm', data);
+  popupRef.value.close()
+}
+
+defineExpose({
+  showDialog
+})
+
+</script>
+
+<style>
+</style>

+ 103 - 0
components/zhuapaiConfirm/submitScore.vue

@@ -0,0 +1,103 @@
+<template>
+  <uni-popup ref="popupRef" background-color="#fff" :animation="false" :is-mask-click="false" :mask-click="false">
+    <view class="exam-score-popup">
+      <customNavbarVue class="exam-score-navBar-box" title="考试得分"></customNavbarVue>
+      <view class="score-content-box">
+        <view class="score-content-name">{{data[nameKey]}}</view>
+        <view class="content-score-box">
+          <view>
+            <view class="score-content-text">正确数量:{{data.rightCount}}</view>
+            <view class="score-content-text">试题总数:{{data.shitiTotal}}</view>
+            <view class="score-content-text">及格分数:{{data.okScore}}</view>
+            <view class="score-content-text">{{labelName}}:{{data.ksScore}}</view>
+          </view>
+          <view class="score-content-text"><text>{{data.userScore}}</text>分</view>
+        </view>
+      </view>
+
+      <view class="progress-text-btn-box">
+        <text class="progress-text">正确率</text>
+        <c-progress-circle :progress='data.userAccuracy/100' color='#0856e6' size='280rpx'
+                           boderWidth="280rpx" class="progress-circle-box"></c-progress-circle>
+        <view class="score-dialog-btn" @click="handleCheckSj">查看成绩</view>
+      </view>
+    </view>
+  </uni-popup>
+</template>
+
+<script setup>
+import customNavbarVue from "@/components/custom-navbar/custom-navbar.vue";
+import {
+  ref,
+  reactive
+} from "vue";
+const popupRef = ref(null)
+const data = reactive({
+  ksName: '',
+  lxName: '',
+  ksScore: '',
+  okScore: '',
+  rightCount: '',
+  shitiTotal: '',
+  userScore: '',
+})
+
+defineProps({
+  title: {
+    type: String,
+    default: '考试得分'
+  },
+  labelName: {
+    type: String,
+    default: '考试总分'
+  },
+  nameKey: {
+    type: String,
+    default: 'ksName'
+  }
+})
+
+const emits = defineEmits(['confirm', 'close'])
+
+function handleClose() {
+  emits('close');
+  popupRef.value.close()
+}
+
+function handleCheckSj() {
+  emits('confirm', data);
+  popupRef.value.close()
+}
+
+function showDialog(options) {
+  data.ksName = options.ksName;
+  data.lxName = options.lxName;
+  data.ksScore = options.ksScore;
+  data.okScore = options.okScore;
+  data.rightCount = options.rightCount;
+  data.shitiTotal = options.shitiTotal;
+  data.userScore = options.userScore;
+  data.userAccuracy = options.userAccuracy;
+  popupRef.value.open()
+}
+
+defineExpose({
+  showDialog
+})
+</script>
+
+<style lang="scss">
+.content{
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  padding-top: 20rpx;
+  font-size: 28rpx;
+}
+.btnBox{
+  width: 100%;
+  display: flex;
+  align-items: center;
+  margin-top:30rpx;
+}
+</style>

+ 4 - 0
pages/exam/exam.vue

@@ -130,6 +130,8 @@
 	} from "./examTools"
 	import customNavbarVue from "@/components/custom-navbar/custom-navbar.vue";
 	import commonDialog from "@/components/dialog/commonDialog.vue"
+	import answerQueren from "@/components/zhuapaiConfirm/answerQueren.vue";
+	import submitScoreVue from "@/components/zhuapaiConfirm/submitScore.vue";
 
 	const {
 		checkDanxuanReply,
@@ -436,8 +438,10 @@
 
 	function handleJiaojuan() {
 		const result = checkJiaojuan()
+				console.log('answerQrRef.value',answerQrRef.value)
 		if (result.count) {
 			// 提示
+	
 			answerQrRef.value.showDialog({
 				answercartsCount: result.total - result.count,
 				answercartsTotal: result.total,