瀏覽代碼

fix:预约考试判断

xuqiaoying 3 年之前
父節點
當前提交
d2b4cd4acc

+ 3 - 1
src/pages/course-detail/index.vue

@@ -3163,7 +3163,9 @@ export default {
       this.dialogVisible = true;
     },
     handleClick(tab) {
-      console.log('tab', tab)
+      if (tab.name == '3') {
+        this.getAnswerList() //答疑列表
+      }
     },
     /**
      * 确定选中

+ 2 - 2
src/pages/person-center/my-course/courseData.vue

@@ -269,7 +269,7 @@
                           activeItem.learningStatus == 2 ||
                           activeItem.classStatus == 0 ||
                           (activeItem.learningStatus == 3 &&
-                            sysTime < activeItem.learningTimeStart)
+                            sysTime < activeItem.learningTimeStart) || !activeItem.examApplyGoodsList.length
                         )
                       "
                       >预约考试</el-button
@@ -678,7 +678,7 @@
                           item.learningStatus == 2 ||
                           item.classStatus == 0 ||
                           (item.learningStatus == 3 &&
-                            sysTime < item.learningTimeStart)
+                            sysTime < item.learningTimeStart)  || !item.examApplyGoodsList.length
                         )
                       "
                       >预约考试</el-button

+ 16 - 1
src/pages/person-center/my-course/index.vue

@@ -14,7 +14,21 @@
           @click="changeCourse"
           >切换科目</el-button
         >
-        <el-button size="mini" type="warning" plain style="margin-left: 14px" @click="changeTest()">预约考试
+        
+        <el-button v-if="
+          goodsData.applyStatus === 1 &&
+          !(
+            sysTime <= goodsData.serviceStartTime ||
+            sysTime >= goodsData.serviceEndTime ||
+            (goodsData.classStartTime &&
+              sysTime <= goodsData.classStartTime) ||
+            (goodsData.classEndTime && sysTime >= goodsData.classEndTime) ||
+            goodsData.learningStatus == 2 ||
+            goodsData.classStatus == 0 ||
+            (goodsData.learningStatus == 3 &&
+              sysTime < goodsData.learningTimeStart) || !goodsData.examApplyGoodsList.length
+          )
+        " size="mini" type="warning" plain style="margin-left: 14px" @click="changeTest()">预约考试
         </el-button>
       </h4>
       <div v-for="(item, index) in courseList" :key="index">
@@ -556,6 +570,7 @@ export default {
       });
     },
     changeCourse() {
+      console.log('this.goodsData', this.goodsData)
       this.$refs.courseData.openBoxs(this.goodsData);
     },
     changeTest() {