ZhaoJing 1 год назад
Родитель
Сommit
2532a28d79
2 измененных файлов с 125 добавлено и 19 удалено
  1. 2 2
      src/pages/jsd/wdkc/zbkc/live.vue
  2. 123 17
      src/pages/zbkc/homework.vue

+ 2 - 2
src/pages/jsd/wdkc/zbkc/live.vue

@@ -75,10 +75,10 @@
             <div class="w-300px mt-46px right-box pt-30px relative">
                  <el-button v-if="chapter_info.tzk_zjr_user_id === user.user_id" type="primary" color="#1259a1" size="large" class="w-100px live-btn" @click="launchLive">启动直播工具
                 </el-button>
-                <div v-if="user.user_role_id === '75'" class="right-nav ml-20px">
+                <!-- <div v-if="user.user_role_id === '75'" class="right-nav ml-20px">
                     <span>相关文档</span>
                     <i></i>
-                </div>
+                </div> -->
             	<homeworkBlock :id="tzk_id" :dxa="chapter_info.tzk_dxa_file" :homework="chapter_info.tzk_ksce_file" :file="chapter_info.tzk_files_json" :zjr="chapter_info.tzk_zjr_user_id" :ks_id="chapter_info.tzk_ksce_tq_id" @filePre="filePre"></homeworkBlock>
             </div>
    		 </div>

+ 123 - 17
src/pages/zbkc/homework.vue

@@ -1,7 +1,7 @@
 <script setup>
 import { user } from '~/store/index';
 import downLoadFile1 from '@/utils/download'
-import { ElRadioGroup, ElRadio, ElCheckboxGroup, ElCheckbox } from 'element-plus'
+// import { ElRadioGroup, ElRadio, ElCheckboxGroup, ElCheckbox } from 'element-plus'
 const props = defineProps({
     id: String,
     homework: String,
@@ -133,12 +133,61 @@ function filePre(item) {
 function download(item) {
     downLoadFile1(getFullUrl(item.split(';')[2].split('|')[0]), `${item.split(';')[0]}`)
 }
+
+let answerVisiable = $ref(false);
+let answerInfo = $ref([]);
+function submitTest() {
+    let question = [];
+    let flag = true;
+    testInfo.forEach((item, index) => {
+        if (!item.answer) {
+            ElMessage.warning(`第${index + 1}题未选择`)
+            flag = false;
+            return
+        }
+        question.push({
+            tq_id: item.tq_id,
+            user_answer: item.answer,
+        })
+    })
+    if (flag) {
+        request({
+            url: '/txwx/question_record/save',
+            data: {
+                tqr_data_type: '4',
+                tqr_data_id: props?.id,
+                tqr_pos: '1',
+                question,
+            }
+        }).then(res => {
+            if (res.code == '1') {
+                ElMessage.success(res.msg);
+                wordVisiable = false;
+                request({
+                    url: '/txwx/question/index',
+                    data: {
+                        tq_id: props?.ks_id,
+                        tqr_data_type: '4',
+                        tqr_data_id: props?.id,
+                        tqr_pos: '1'
+                    }
+                }).then(res => {
+                    if (res.code == '1') {
+                        answerInfo = res.data.page_data;
+                        answerVisiable = true;
+                    }
+                })
+            }
+        })
+    }
+}
 </script>
 
 <template>
     <div class="w-300px h-400px flex flex-col shadow home">
         <!--  v-if="user.user_id === props?.zjr" -->
-        <div v-if="user.user_id === props?.zjr" class="h-100 overflow-hidden overflow-y-auto flex-auto home_scroll" ref="chatBox">
+        <div v-if="user.user_id === props?.zjr" class="h-100 overflow-hidden overflow-y-auto flex-auto home_scroll"
+            ref="chatBox">
             <div class="right-nav ml-20px">
                 <span>相关章节</span>
                 <i></i>
@@ -209,27 +258,60 @@ function download(item) {
                 <div v-for="item in testInfo" :key="item.tq_id">
                     <div class="flex">
                         <div class="leading-loose" v-html="item.tq_content"></div>
-                        <div class="min-w-60px">
+                        <div class="min-w-60px mt-8px ml-10px">
                             <span class="py-3px px-10px rounded-10px bg-hex-1259A1 text-white text-12px">{{
                                 item.tq_type_name }}</span>
                         </div>
                     </div>
-                    <ElRadioGroup v-if="item.tq_type == '1'" class="my-10px" size="30" v-model="item.answer">
-                        <el-radio size="30" class="mr-15px" v-for="e in item.tq_option_choosen" :label="e"><span
-                                class="px-10px">{{ e }}</span></el-radio>
+                    <ElRadioGroup fill="#1259a1" v-if="item.tq_type == '1'" class="mt-10px mb-20px" v-model="item.answer">
+                        <el-radio-button size="30" class="mx-10px" v-for="e in item.tq_option_choosen" :label="e">{{ e
+                        }}</el-radio-button>
                     </ElRadioGroup>
-                    <ElCheckboxGroup v-else-if="item.tq_type == '2'" v-model="item.answer">
-                        <el-checkbox v-for="e in item.tq_option_choosen"><span class="px-10px">{{ e }}</span></el-checkbox>
+                    <ElCheckboxGroup fill="#1259a1" v-else-if="item.tq_type == '2'" class="mt-10px mb-20px"
+                        v-model="item.answer">
+                        <el-checkbox-button v-for="e in item.tq_option_choosen" class="mx-10px">{{ e }}</el-checkbox-button>
                     </ElCheckboxGroup>
-                    <ElRadioGroup v-else class="my-10px" size="30" v-model="item.answer">
-                        <el-radio size="30" class="mr-15px" v-for="e in item.tq_option_choosen" :label="e"><span
-                                class="px-10px">{{ e }}</span></el-radio>
+                    <ElRadioGroup fill="#1259a1" v-else class="mt-10px mb-20px" size="30" v-model="item.answer">
+                        <el-radio-button size="30" class="mx-10px" v-for="e in item.tq_option_choosen" :label="e"><span
+                                class="px-10px">{{ e }}</span></el-radio-button>
                     </ElRadioGroup>
                 </div>
+                <div id="footer" class="flex justify-center my-30px">
+                    <el-button class="mr-20px" @click="submitTest">提交</el-button>
+                    <el-button class="over" @click="wordVisiable = false">跳过</el-button>
+                </div>
             </div>
 
         </el-dialog>
-
+        <el-dialog v-model="answerVisiable">
+            <div v-if="answerInfo.length > 0">
+                <div v-for="item in answerInfo" :key="item.tq_id">
+                    <div class="flex">
+                        <div class="leading-loose" v-html="item.tq_content"></div>
+                        <div class="min-w-60px mt-8px ml-10px">
+                            <span class="py-3px px-10px rounded-10px bg-hex-1259A1 text-white text-12px">{{
+                                item.tq_type_name }}</span>
+                        </div>
+                    </div>
+                    <div class="flex my-15px text-16px">
+                        <p class="mr-10px">正确答案: </p>
+                        <p class="text-hex-5dc248">{{ item.tq_answer }}</p>
+                    </div>
+                    <div class="flex text-16px">
+                        <p class="mr-10px">你的答案: </p>
+                        <p :class="item.my_answer.tqr_correct == '0' ? 'text-red-500' : 'text-hex-1259A1'">{{
+                            item.my_answer?.tqr_user_answer }}</p>
+                    </div>
+                    <div class="mb-25px mt-15px text-16px">
+                        <p class="text-red-500">解析: </p>
+                        <p class="leading-loose">{{ item.tq_alyz }}</p>
+                    </div>
+                </div>
+                <div id="footer" class="flex justify-center my-30px">
+                    <el-button class="mr-20px over bg-gray-500" @click="answerVisiable = false">确认</el-button>
+                </div>
+            </div>
+        </el-dialog>
     </div>
 </template>
 
@@ -276,17 +358,23 @@ $color: #1259A1;
 
 ::v-deep .el-button {
     width: 111px !important;
-    height: 32px;
-    opacity: 0.7;
-    background: linear-gradient(90deg, #2586e9 1%, #57c6d8 100%);
-    border-radius: 38px;
-    padding: 5px 40px;
+    height: 40px;
+    // opacity: 0.7;
+    background: $color;
+    border-radius: 10px !important;
+    // padding: 10px 40px;
+    color: #fff;
 
     span {
         font-size: 14px;
     }
 }
 
+::v-deep .over {
+    background-color: #f2f2f2;
+    color: $color;
+}
+
 .home_scroll::-webkit-scrollbar {
     width: 2px;
 }
@@ -335,5 +423,23 @@ $color: #1259A1;
 
 ::v-deep .western {
     line-height: 30px !important;
+
+    img {
+        display: inline-block;
+    }
+}
+
+::v-deep .el-radio-button {
+    .el-radio-button__inner {
+        border-radius: 20px !important;
+        padding: 8px 25px;
+        background-color: #f2f2f2;
+    }
+}
+
+::v-deep .el-checkbox-button__inner {
+    border-radius: 20px !important;
+    padding: 8px 25px;
+    background-color: #f2f2f2;
 }
 </style>