zhuf před 1 rokem
rodič
revize
d6e873b7d0

+ 45 - 1
src/pages/detail/[type]/[tmk_id]/[tmz_id]/homework.vue

@@ -9,9 +9,10 @@ const props = defineProps<{
 const theType = TypeMap[props.type]
 const truthPid = props.tmk_id === '-' ? undefined : props.tmk_id
 
+/* 章节详情 */
 const tmp_detail = ref(JSON.parse(sessionStorage.getItem('tmp_detail')!))
 if (!tmp_detail.value) {
-  request({
+  await request({
     url: `/txwx/${props.type}/detail`,
     data: {
       [theType.id]: props.tmz_id,
@@ -21,9 +22,52 @@ if (!tmp_detail.value) {
       tmp_detail.value = res.data.one_info
   })
 }
+
+console.log('tmp_detail  : ', tmp_detail)
+
+const testInfo = ref<any[]>([])
+
+// // 视频结束测验
+// const tmz_kczjwjcs_tq_id = tmp_detail.value?.tmz_kczjwjcs_tq_id
+// request({
+//   url: '/txwx/question/index',
+//   data: {
+//     tq_id: tmz_kczjwjcs_tq_id,
+//     tqr_data_type: '3',
+//     tqr_data_id: props.tmz_id,
+//     tqr_pos: 2,
+//   },
+// })
+
+// 课后作业
+const tmz_zjsjdajx_tq_id = tmp_detail.value?.tmz_zjsjdajx_tq_id
+request({
+  url: '/txwx/question/index',
+  data: {
+    tq_id: tmz_zjsjdajx_tq_id,
+    tqr_data_type: '3',
+    tqr_data_id: props.tmz_id,
+    tqr_pos: 1,
+  },
+}).then((res) => {
+  if (res?.code === '1')
+    testInfo.value = res.data.page_data
+})
 </script>
 
 <template>
+  <ul class="text-14px space-y-10px">
+    <li v-for="item in testInfo" :key="item.tq_id">
+      <div class="flex justify-between">
+        <div class="leading-18px" v-html="item.tq_content" />
+        <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>
+    </li>
+  </ul>
+  <!-- pc端代码 -->
   <!-- <div>
     <div v-if="wordVisiable && navSelected === '1' && testInfo.length > 0"
       class="res-list bg-hex-fff w-full pt-34px px-54px">

+ 7 - 2
src/pages/detail/[type]/[tmk_id]/[tmz_id].vue

@@ -141,6 +141,11 @@ function handleGoodjob() {
   })
 }
 
+function isShowHomework() {
+  // return props.type === 'kclx' && detail.value?.tmz_zy
+  return true
+}
+
 function routerToHomework() {
   console.log('routerToHomework')
   sessionStorage.setItem('tmp_detail', JSON.stringify(detail.value))
@@ -208,12 +213,12 @@ function routerToHomework() {
       </div>
     </div>
 
-    <div class="flex items-center justify-between px-14px mb-2" @click="routerToHomework">
+    <!-- <div v-if="isShowHomework" class="flex items-center justify-between px-14px mb-2" @click="routerToHomework">
       <div class="text-16px font-bold">
         作业 & 答案
       </div>
       <van-icon name="arrow" size="18" />
-    </div>
+    </div> -->
 
     <div
       class="flex items-center justify-between px-14px "

+ 1 - 1
tsconfig.json

@@ -2,7 +2,7 @@
   "compilerOptions": {
     "baseUrl": ".",
     "module": "ESNext",
-    "target": "es2016",
+    "target": "es2017",
     "lib": [
       "DOM",
       "ESNext"