Browse Source

fix:点击切换课程没有课程时的提示。预约考试的样式

xuqiaoying 3 years ago
parent
commit
f0e2043540

+ 5 - 4
src/pages/living-room/index.vue

@@ -12,7 +12,6 @@
             @click="toShare()"
             >分享</el-button>
           <el-button
-            v-if="backNum"
             class="float-right"
             type="primary"
             size="small"
@@ -361,10 +360,11 @@ export default {
           this.goodsName = item.goodsName
           this.sectionType = sectionType
           this.vid = recordingUrl || ''
+          console.log('vid', this.vid, this.sectionType)
           if (item.checkStatus == 1) { // 有权限
             this.identification = new Date().valueOf() + ""
             this.playVideo();
-            if (this.sectionType !=3 ) {
+            if (this.sectionType != 3) {
               this.studyRecordGetLastLive();
             }
           } else {
@@ -428,7 +428,6 @@ export default {
           channelId: this.channelId,
         })
         .then((res) => {
-          console.log('------------res', res.code)
           if (res.code == 200) {
           this.sign = res.data.sign;
           this.token = res.data.token;
@@ -442,7 +441,9 @@ export default {
           } else {
             this.$message.warning(res.msg)
           }
-        });
+        }).catch((err) => {
+          this.$message.warning(err.msg)
+        }) 
     },
 
     async playVideo() {

+ 46 - 14
src/pages/person-center/my-course/components/AppointTest.vue

@@ -9,20 +9,24 @@
             :close-on-press-escape="false"
             :before-close="cancel"
         >
-            <div class="appoint-modal__content">
-                <el-radio
+            <div class="appoint-modal">
+                <div v-for="(appointChild, appointIndex) in appointItem.examApplyGoodsList" :key="appointIndex"  class="appoint_item" >
+                    <div class="names">{{ appointChild.applyName }}</div>
+                    <div class="btns" @click="confirmAppoint(appointChild)">预约</div>
+                </div>
+                <!-- <el-radio
                     v-for="(appointChild, appointIndex) in appointItem.examApplyGoodsList"
                     v-model="applyId"
                     :key="appointIndex"
                     :label="appointChild.applyId"
                 >
                     {{ appointChild.applyName }}
-                </el-radio>
+                </el-radio> -->
             </div>
-            <span slot="footer" class="dialog-footer">
+            <!-- <span slot="footer" class="dialog-footer">
                 <el-button @click="cancel()">取 消</el-button>
                 <el-button type="primary" @click="confirmAppoint">立即预约</el-button>
-            </span>
+            </span> -->
         </el-dialog>
     </div>
 </template>
@@ -37,7 +41,7 @@ export default {
         },
         appointItem: {
             type: Object,
-            default: () => []
+            default: () => {}
         },
     },
     data() {
@@ -49,15 +53,15 @@ export default {
         cancel() {
             this.$emit('update:appointModal', false)
         },
-        confirmAppoint() {
-            if (!this.applyId) {
-                this.$message.warning("请选择要预约的考试");
-                return;
-            }
+        confirmAppoint(item) {
+            // if (!this.applyId) {
+            //     this.$message.warning("请选择要预约的考试");
+            //     return;
+            // }
             var data = {
                 goodsId: this.appointItem.goodsId,
                 gradeId: this.appointItem.gradeId,
-                applyId: this.applyId,
+                applyId: item.applyId,
                 orderGoodsId: this.appointItem.orderGoodsId,
             };
             this.$request.getApplysubscribe(data).then((res) => {
@@ -67,7 +71,7 @@ export default {
                     goodsId: this.appointItem.goodsId,
                     gradeId: this.appointItem.gradeId,
                     orderGoodsId: this.appointItem.orderGoodsId,
-                    applyId: this.applyId,
+                    applyId: item.applyId,
                     },
                 });
             }).catch((err) => {
@@ -79,4 +83,32 @@ export default {
         },
     }
 }
-</script>
+</script>
+
+<style lang="scss" scoped>
+.appoint_item {
+    width: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    height: 84px;
+    border-bottom: 1px solid #F0F0F0;
+    .names {
+        font-size: 14px;
+        font-weight: 500;
+        color: #303030;
+    }
+    .btns {
+        width: 54px;
+        height: 28px;
+        line-height: 28px;
+        text-align: center;
+        background: #FFF5EC;
+        border-radius: 4px;
+        font-size: 12px;
+        font-weight: 500;
+        color: #F67205;
+        cursor: pointer;
+    }
+}
+</style>

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

@@ -834,7 +834,32 @@
     </el-dialog>
     <!-- 预约考试弹窗 -->
     <appoint-test :appointModal.sync="appointModal" :appointItem='appointItem'></appoint-test>
-
+    <!-- <el-dialog
+      title="预约考试"
+      :visible.sync="appointModal"
+      width="600px"
+      class="appoint-modal"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+    >
+      <div class="appoint-modal__content">
+        <el-radio
+          v-for="(
+            appointChild, appointIndex
+          ) in appointItem.examApplyGoodsList"
+          v-model="applyId"
+          :key="appointIndex"
+          :label="appointChild.applyId"
+          >{{ appointChild.applyName }}</el-radio
+        >
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="appointModal = false">取 消</el-button>
+        <el-button type="primary" @click="confirmAppoint"
+          >立即预约</el-button
+        >
+      </span>
+    </el-dialog> -->
     <el-dialog
       title="实名验证确认"
       :visible.sync="showConfirm"

+ 4 - 0
src/pages/person-center/my-course/index.vue

@@ -556,6 +556,10 @@ export default {
       });
     },
     changeCourse() {
+      if (!this.courseList.length) {
+        this.$message.warning('您未购买课程,请先购买')
+        return
+      }
       this.$refs.courseData.openBoxs(this.goodsData);
     },
     changeTest() {