Эх сурвалжийг харах

视频课目录样式和刷题锁定接口

xuqiaoying 3 жил өмнө
parent
commit
952a47bc9c

+ 23 - 13
components/course/courseChapter.vue

@@ -1,9 +1,12 @@
 <template>
-  <view style="margin: 20rpx 0">
+<!-- style="margin: 20rpx 0" -->
+  <view>
     <view class="title" @click="openChapter(menuItem)">
-      <image src="/static/icon/up1.png" class="icon_up" v-if="down"></image>
-      <image src="/static/icon/down1.png" class="icon_up" v-if="!down"></image>
-      <text style="margin-left: 30rpx">{{ menuItem.name }}</text>
+      <!-- <image src="/static/icon/up1.png" class="icon_up" v-if="down"></image>
+      <image src="/static/icon/down1.png" class="icon_up" v-if="!down"></image> -->
+      <u-icon name="arrow-down" color="#999" size="24" v-if="!down"></u-icon>
+      <u-icon name="arrow-right" color="#999" size="24" v-if="down"></u-icon>
+      <text class="menu_name">{{ menuItem.name }}</text>
     </view>
     <view v-show="!down">
       <view v-for="(itemM, indexM) in list" :key="indexM">
@@ -593,7 +596,7 @@ export default {
 };
 </script>
 
-<style scoped>
+<style lang="scss" scoped>
 .tagRe {
   width: 80rpx;
   height: 28rpx;
@@ -638,13 +641,20 @@ export default {
   height: 24rpx;
 }
 .title {
-  font-size: 30rpx;
-  font-family: PingFang SC;
-  font-weight: bold;
-  color: #666666;
-  white-space: nowrap;
-  overflow: hidden;
-  text-overflow: ellipsis;
-  margin-bottom: 30rpx;
+  // margin-bottom: 30rpx;
+  height: 78rpx;
+  display: flex;
+  align-items: center;
+  border-bottom: 1rpx solid #EEEEEE;
+  .menu_name {
+    font-size: 24rpx;
+    font-family: PingFang SC;
+    font-weight: bold;
+    color: #333;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    margin-left: 8rpx;
+  }
 }
 </style>

+ 27 - 14
components/course/courseModule.vue

@@ -1,9 +1,14 @@
 <template>
-	<view style="margin: 20rpx 0;">
+<!-- style="margin: 20rpx 0;" -->
+	<view>
 		<view class="title" @click="openModule(menuItem)">
-		<image src="/static/icon/up1.png" class="icon_up" v-if="down"></image>
-		<image src="/static/icon/down1.png" class="icon_up" v-if="!down"></image>
-		<text style="margin-left: 10rpx;">{{menuItem.name}}</text>
+		<!-- <image src="/static/icon/up1.png" class="icon_up" v-if="down"></image>
+		<image src="/static/icon/down1.png" class="icon_up" v-if="!down"></image> -->
+			<text class="title_name" style="margin-left: 10rpx;">{{menuItem.name}}</text>
+			<view>
+				<image src="/static/icon/up.png" class="icon_up" v-if="down"></image>
+				<image src="/static/icon/down.png" class="icon_up" v-if="!down"></image>
+			</view>
 		</view>
 		<view v-show="!down">
 			<view v-for="(itemM,indexM) in list" :key="indexM">
@@ -152,19 +157,27 @@ export default {
 };
 </script>
 
-<style scoped>
+<style lang="scss" scoped>
+	
+.title{
+	height: 70rpx;
+	font-family: PingFang SC;
+	// margin-bottom:30rpx;
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+	border-bottom: 1rpx solid #EEEEEE;
+	.title_name {
+		font-size: 24rpx;
+		font-weight: 500;
+		color: #333333;
+		white-space:nowrap;
+		overflow:hidden;
+		text-overflow:ellipsis; 
+	}
 	.icon_up{
 		width: 24rpx;
 		height: 24rpx;
 	}
-.title{
-	font-size: 30rpx;
-	font-family: PingFang SC;
-	font-weight: bold;
-	color: #333333;
-	white-space:nowrap;
-	overflow:hidden;
-	text-overflow:ellipsis; 
-	margin-bottom:30rpx;
 }
 </style>

+ 17 - 8
pages/learn/index.vue

@@ -27,7 +27,11 @@
 								<image v-if="bgShow(live.liveStartTime, live.watchStatus)" src="/static/learn/living.png" class="liv_icon"></image>
 								<image v-else src="/static/learn/wlive.png" class="liv_icon"></image>
 								<text class="status_s">{{ live.liveStartTime | liveStatus(live.watchStatus)}}</text>
-								<view class="look_bt" :class="lookTimeStatus(live.liveStartTime, live.watchStatus, 'class')">
+								<view class="look_bt" 
+									:class="{'living': lookTimeStatus(live.liveStartTime, live.watchStatus) == 1, 
+											'futuring': lookTimeStatus(live.liveStartTime, live.watchStatus) == 4,
+											'curring': [2,3].includes(lookTimeStatus(live.liveStartTime, live.watchStatus))}"
+									>
 									<text v-if="lookTimeStatus(live.liveStartTime, live.watchStatus) == 1">点击观看</text>
 									<text v-if="lookTimeStatus(live.liveStartTime, live.watchStatus) == 2">即将开播</text>
 									<template v-if="lookTimeStatus(live.liveStartTime, live.watchStatus) == 3">
@@ -165,7 +169,7 @@
 				</view>
 			</view>
 			<!-- 没有学习的课程 -->
-			<view v-else class="no_datas">
+			<view v-if="!allLoading && !allCourse" class="no_datas">
 				<image class="courses" src="/static/learn/no_course.png" mode=""></image>
 				<view class="no_learns">您目前没有可学习的课程</view>
 				<view class="choose" @click="toChoose()">立即去选购</view>
@@ -204,6 +208,7 @@ export default {
 			},
 			queitemIndex:'',
 			livingLists: [],
+			allLoading: false, // 加载样式
         }
     },
 	filters: {
@@ -213,7 +218,7 @@ export default {
 			if (curTime < value) { // 判断当前时间和直播开始时间
 				return ' 未开播'
 			} else {
-				return watchStatus == 'live' ? '正在直播中...' : '即将开播'
+				return watchStatus == 'live' ? '正在直播中' : '即将开播'
 			}
 		}
 	},
@@ -223,6 +228,7 @@ export default {
 		}
 	},
 	onLoad() {
+		console.log('dsfdsf2222222222')
 		// 1668787200 ,2022.22.19的时间戳
 		this.leftDays = 1668787200 - parseInt(curTime/1000)
 		this.getCourseLiveQues()
@@ -240,7 +246,7 @@ export default {
 				return watchStatus == 'live' ? true : false
 			}
 		},
-		lookTimeStatus(liveTime, watchStatus, type) {
+		lookTimeStatus(liveTime, watchStatus) {
 			// let curTime = new Date().getTime() // 当前时间的时间戳
 			let value = liveTime * 1000
 			var Y = value.getFullYear()
@@ -250,15 +256,15 @@ export default {
 			let curZeroTime = new Date(valZ).getTime() // 获取开始直播时间当天的零点时间戳
 			if (curTime > value) { // 判断当前时间和直播开始时间
 				if (watchStatus == 'live') { // 
-					return type ? 'living' : 1
+					return 1
 				} else {
-					return type ? 'curring' : 2
+					return 2
 				}
 			} else {
 				if (curZeroTime <= curTime && curTime <= value) { //当天
-					return type ? 'curring' : 3
+					return 3
 				} else {
-					return type ? 'futuring' : 4
+					return 4
 				}
 				
 			}
@@ -274,6 +280,7 @@ export default {
 		},
 		// 查询直播课
 		getCourseLiveQues() {
+			this.allLoading = true
 			let arrs = [
 				this.$api.courseGoodsList(this.paramC), // 查询用户拥有的商品/课程列表/course/goodsList
 				this.$api.listGoodsUserQuestion(this.paramQ), // 题库列表
@@ -295,9 +302,11 @@ export default {
 					if (res3.code == 200) {
 						this.livingLists = res3.rows || []
 					}
+					this.allLoading = false
 					console.log('this.courseLists;', this.courseLists, this.questionLists,this.livingLists)
 				// }
 			}).catch(err => {
+				this.allLoading = false
 				// this.$u.toast('请重新刷新请求')
 			})
 		},

+ 15 - 1
pages2/bank/question_detail.vue

@@ -136,13 +136,20 @@ export default {
 		};
 	},
 	onUnload() {
-		
+		clearInterval(this.timer)
+		this.$api.lockDelLock({
+			action:'bank'
+		}).then(res => {
+			
+		})
 	},
 	computed: { ...mapGetters(['userInfo']) },
 	onLoad(option) {
 		this.orderGoodsId = option.orderGoodsId
 		this.id = option.id;
 		this.getDetail();
+		this.getLock()
+		this.timer = setInterval(this.getLock,10000)
 		// this.goodsBankList();
 		// this.getCollectNum();
 		// this.getWrongNum()
@@ -153,6 +160,13 @@ export default {
 		this.goodsBank();
 	},
 	methods: {
+		getLock() {
+			this.$api.lockLockAction({
+				action:'bank'
+			}).then(res => {
+				
+			})
+		},
 		/**
 		 * 继续做题
 		 */

+ 9 - 13
pages2/wd/question_bank.vue

@@ -61,23 +61,12 @@
 			}
 		},
 		onLoad(option) {
-			this.$api.lockLockAction({
-				action:'bank'
-			}).then(res => {
-				
-			})
-			this.timer = setInterval(() => {
-				this.$api.lockLockAction({
-					action:'bank'
-				}).then(res => {
-					
-				})
-			},10000)
+			this.getLock()
+			this.timer = setInterval(this.getLock,10000)
 			// websocket.sendMsg('doQuestion')
 			// this.getDict()
 		},
 		onUnload() {
-			console.log('liking离开')
 			clearInterval(this.timer)
 			this.$api.lockDelLock({
 				action:'bank'
@@ -90,6 +79,13 @@
 			
 		},
 		methods: {
+			getLock() {
+				this.$api.lockLockAction({
+					action:'bank'
+				}).then(res => {
+					
+				})
+			}
 		},
 		
 	}

+ 4 - 1
pages3/live/detail.vue

@@ -105,7 +105,7 @@
       </view>
       <u-line color="#D6D6DB" />
     </view>
-    <view class="box">
+    <view class="box" :class="{'first_ml': current == 0}">
       <scroll-view class="box_in" scroll-y="true">
         <!--目录 -->
         <view v-show="current == 0">
@@ -2037,6 +2037,9 @@ export default {
       height: 100%;
     }
   }
+  .first_ml {
+    margin: 16rpx 16rpx 16rpx 16rpx;
+  }
 }
 .btnSet {
   width: 440rpx;

+ 126 - 99
pages3/polyv/detail.vue

@@ -60,62 +60,12 @@
               >从头播放</cover-view
             >
           </cover-view>
-          <view class="mulu">
-                <scroll-view class="box_in" scroll-y="true">
-                    <view class="menuBox" v-for="(item, index) in menuList" :key="index">
-                        <!--模块 -->
-                        <view v-if="item.type == 1"
-                        ><courseModule
-                            :orderGoodsId="orderGoodsId"
-                            :sectionMaxNum="goodsData.sectionMaxNum"
-                            :needOpen="menuIndex[0] === index ? true : false"
-                            :courseId="courseId"
-                            :preItem="menuList[index - 1]"
-                            :learningOrder="businessData.goodsLearningOrder"
-                            :goodsId="goodsId"
-                            :gradeId="gradeId"
-                            :isBuy="true"
-                            :menuItem="item"
-                            :levelId="item.menuId"
-                        ></courseModule
-                        ></view>
-                        <!--章 -->
-                        <view v-if="item.type == 2"
-                        ><courseChapter
-                                            :orderGoodsId="orderGoodsId"
-                            :sectionMaxNum="goodsData.sectionMaxNum"
-                            :needOpen="menuIndex[0] === index ? true : false"
-                            :courseId="courseId"
-                            :preItem="menuList[index - 1]"
-                            @playEnd="sectionPlayEnd($event, index)"
-                            :learningOrder="businessData.goodsLearningOrder"
-                            :goodsId="goodsId"
-                            :gradeId="gradeId"
-                            :isBuy="true"
-                            :menuItem="item"
-                            :levelId="'0-' + item.menuId"
-                        ></courseChapter
-                        ></view>
-                        <!--节 -->
-                        <view v-if="item.type == 3"
-                        ><courseSection
-                                            :orderGoodsId="orderGoodsId"
-                            :sectionMaxNum="goodsData.sectionMaxNum"
-                            @playEnd="sectionPlayEnd($event, index)"
-                            :courseId="courseId"
-                            :preItem="menuList[index - 1]"
-                            :learningOrder="businessData.goodsLearningOrder"
-                            :goodsId="goodsId"
-                            :gradeId="gradeId"
-                            :isBuy="true"
-                            :menuItem="item"
-                            :levelId="'0-0-' + item.menuId"
-                        ></courseSection
-                        ></view>
-                    </view>
-                </scroll-view>
-          </view>
-
+          <!-- 全屏时的目录 -->
+          <!-- v-if="showMulu" -->
+          <cover-view class="full_mulu">
+            <image src="/pages3/static/imgs/mulu.png" style="width: 45rpx;height: 32rpx;" @click="clickMulu()"></image>
+          </cover-view>
+          
         </view>
         <view
           class="video_box"
@@ -132,7 +82,7 @@
           />
         </view>
       </view>
-      <view>
+      <view class="course_name">
         <u-row>
           <u-col span="10">
             <view class="video_t1">{{ detail.courseName }}</view>
@@ -161,7 +111,7 @@
       </view>
       <u-line color="#D6D6DB" />
     </view>
-    <view class="box">
+    <view class="box" :class="{'first_ml': current == 0}">
       <scroll-view class="box_in" scroll-y="true">
         <!--目录 -->
         <view v-show="current == 0">
@@ -235,19 +185,6 @@
               <image v-else src="/pages3/static/imgs/downLoading.png" style="width: 40rpx;height: 40rpx;"></image>
             </view>
           </view>
-
-          <!-- <view style="text-align: center" v-else>暂无讲义</view> -->
-          <!-- <view class="lecture-content">
-						<rich-text :nodes="'讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容'"></rich-text>
-					</view> -->
-
-          <!-- 	<view class="inputBottom">
-						<view style="width: 10%;"><image src="/static/icon/note3.png" style="width: 39rpx;height: 39rpx;margin:0 29rpx;"></image></view>
-						<view style="width: 73%;height: 100%;padding: 10rpx 0;">
-							<u-input class="input" height="60" fixed="true" placeholder="您可以在这里输入笔记内容" type="textarea" :custom-style="inputStyle" v-model="noteValue" />
-						</view>
-						<view style="color: #007AFF;font-size: 30rpx;font-weight: bold;width: 15%;text-align: center;" @click="postNote">提交</view>
-					</view> -->
         </view>
         <!--笔记 -->
         <view v-show="current == 2">
@@ -578,8 +515,65 @@
 			</view>
 		
 		</u-modal>
-		
-		
+		 
+     <view class="full_mulu">
+        <scroll-view :class="muluStyle ? 'mulu_box_in' : 'mulu_box_out'" scroll-y="true">
+            <view class="menuBox" v-for="(item, index) in menuList" :key="index">
+                <!--模块 -->
+                <view v-if="item.type == 1"
+                ><courseModule
+                    :orderGoodsId="orderGoodsId"
+                    :sectionMaxNum="goodsData.sectionMaxNum"
+                    :needOpen="menuIndex[0] === index ? true : false"
+                    :courseId="courseId"
+                    :preItem="menuList[index - 1]"
+                    :learningOrder="businessData.goodsLearningOrder"
+                    :goodsId="goodsId"
+                    :gradeId="gradeId"
+                    :isBuy="true"
+                    :menuItem="item"
+                    :levelId="item.menuId"
+                ></courseModule
+                ></view>
+                <!--章 -->
+                <view v-if="item.type == 2"
+                ><courseChapter
+                                    :orderGoodsId="orderGoodsId"
+                    :sectionMaxNum="goodsData.sectionMaxNum"
+                    :needOpen="menuIndex[0] === index ? true : false"
+                    :courseId="courseId"
+                    :preItem="menuList[index - 1]"
+                    @playEnd="sectionPlayEnd($event, index)"
+                    :learningOrder="businessData.goodsLearningOrder"
+                    :goodsId="goodsId"
+                    :gradeId="gradeId"
+                    :isBuy="true"
+                    :menuItem="item"
+                    :levelId="'0-' + item.menuId"
+                ></courseChapter
+                ></view>
+                <!--节 -->
+                <view v-if="item.type == 3"
+                ><courseSection
+                                    :orderGoodsId="orderGoodsId"
+                    :sectionMaxNum="goodsData.sectionMaxNum"
+                    @playEnd="sectionPlayEnd($event, index)"
+                    :courseId="courseId"
+                    :preItem="menuList[index - 1]"
+                    :learningOrder="businessData.goodsLearningOrder"
+                    :goodsId="goodsId"
+                    :gradeId="gradeId"
+                    :isBuy="true"
+                    :menuItem="item"
+                    :levelId="'0-0-' + item.menuId"
+                ></courseSection
+                ></view>
+            </view>
+        </scroll-view>
+        <view class="mulu_img">
+          <image src="/pages3/static/imgs/mulu.png" style="width: 45rpx;height: 32rpx;" @click="clickMulu()"></image>
+        </view>
+      </view>
   </view>
 </template>
 
@@ -692,6 +686,8 @@ export default {
 			option:null,
 			isOther:'',
       downLoading: false, //下载讲义加载
+      showMulu: false, //显示和隐藏目录
+      muluStyle: false, //显示和隐藏目录样式
     };
   },
   computed: {
@@ -2294,12 +2290,15 @@ export default {
      * 进入全屏
      */
     fullscreenchange(event) {
-      console.log(event);
+      console.log('进入全屏',event);
       if (event.detail.direction == "vertical") {
         this.navShow = true;
+        this.showMulu = false
       } else if (event.detail.direction == "horizontal") {
         this.navShow = false;
+        this.showMulu = true
       }
+      console.log('quanping::', this.showMulu)
     },
     getGoodsDetail() {
       let self = this;
@@ -2510,6 +2509,9 @@ export default {
         },
       });
     },
+    clickMulu() {
+      this.muluStyle = !this.muluStyle
+    }
   },
 };
 </script>
@@ -2547,11 +2549,12 @@ export default {
 				color: #FFFFFF;
 			}
 			
-			.desc {
-				
-			}
 		}
 	}
+#top {
+  position: relative;
+  z-index: 99;
+}
 .polyv_detail {
   display: flex;
   flex-direction: column;
@@ -2573,11 +2576,13 @@ export default {
     flex: 1;
     overflow: hidden;
     margin: 16rpx 16rpx 100rpx 16rpx;
-
     .box_in {
       height: 100%;
     }
   }
+  .first_ml {
+    margin: 16rpx 16rpx 16rpx 16rpx;
+  }
 }
 .btnSet {
   width: 440rpx;
@@ -2754,11 +2759,6 @@ export default {
   color: #999999;
 }
 
-page {
-  // padding-top: 10px;
-  // padding-top: constant(safe-area-inset-top);
-  // padding-top: env(safe-area-inset-top);
-}
 .Answering {
   .answer_item {
     &:nth-child(2) {
@@ -2840,7 +2840,7 @@ page {
   width: 100%;
   background: #ffffff;
   border-radius: 16rpx;
-  padding: 20rpx;
+  padding: 0rpx 20rpx;
   margin-bottom: 20rpx;
 }
 .btnspric {
@@ -3119,6 +3119,10 @@ page {
   font-weight: 500;
   color: #666666;
 }
+.course_name {
+  height: 80rpx;
+  background-color: #fff;
+}
 .video_t1 {
   height: 80rpx;
   color: #333333;
@@ -3201,20 +3205,7 @@ page {
     border-radius: 50%;
     color: rgba(255, 255, 255, 0.3);
   }
-  .mulu {
-    position: absolute;
-    top: 0rpx;
-    right: 0rpx;
-    width: 50%;
-    height: 100%;
-    background: rgba(0, 0, 0, 0.6);
-    color: #333;
-    // color: rgba(255, 255, 255, 0.3);
-    .box_in {
-        width: 100%;
-        height: 100%;
-    }
-  }
+  
 }
 .rotoct {
   transform: rotate(90deg);
@@ -3242,6 +3233,42 @@ page {
     }
   }
 }
-
+.full_mulu {
+    position: absolute;
+    bottom: 100rpx;
+    right: 200rpx;
+    width: 485rpx;
+    height: 515rpx;
+    // background: rgba(0, 0, 0, 0.6);
+    color: #333;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    z-index: 9999;
+    .mulu_box_in {
+        width: 406rpx;
+        height: 515rpx;
+        background-color: #b7b7b7;
+        border-radius: 16rpx;
+        // transition: all 0.5s;
+        &::after {
+          content: "";
+          width: 0;
+          height: 0;    
+          position: absolute;    
+          top: 235rpx;
+          right: 24px;
+          border-top: 16rpx solid transparent;
+          border-right: 16rpx solid transparent;
+          border-left: 16rpx solid #b7b7b7;
+          border-bottom: 16rpx solid transparent;
+        }
+    }
+    .mulu_box_out {
+      visibility: hidden;
+      // width: 0rpx;
+      // transition: all 0.5s;
+    }
+  }
 
 </style>

BIN
pages3/static/imgs/mulu.png