فهرست منبع

第七阶段学习中心页面开发

chenxiong 3 سال پیش
والد
کامیت
8c7b625fd3
3فایلهای تغییر یافته به همراه186 افزوده شده و 13 حذف شده
  1. 2 2
      common/request.js
  2. 177 10
      pages/course/index.vue
  3. 7 1
      pages3/polyv/detail.vue

+ 2 - 2
common/request.js

@@ -5,8 +5,8 @@ import api from './api.js'
 var num = 1
 //接口api   
 // export const BASE_URL = 'https://api.xyyxt.net'   //release
-export const BASE_URL = 'https://test.xyyxt.net'   //预发布
-// export const BASE_URL = 'http://42.192.164.187:19005'    //test
+// export const BASE_URL = 'https://test.xyyxt.net'   //预发布
+export const BASE_URL = 'http://42.192.164.187:19005'    //test
 // export const BASE_URL = 'http://192.168.1.222:5055'    //dev
 
  //图片上传api

+ 177 - 10
pages/course/index.vue

@@ -24,13 +24,87 @@
 		</view>
 		
 		<view class="note-list">
-			<view class="text">继续教育-建造师-二级</view>
+			<picker class='picker' :range="list" range-key="name" @change="change">
+				<view class="text">{{businessName || '请选择业务层次'}}</view>
+				
+			</picker>
 			<u-icon name="arrow-down"></u-icon>
 		</view>
 		
-		<view class="note-modal">
-			
+		
+		<view class="course-list">
+			<navigator
+			  hover-class="none"
+			  url="/pages5/liveDetail/list"
+			  class="menu_box"
+			>
+			  <view class="box_left">
+			    <image src="/static/icon/my_icon3.png" class="my_icon">
+					</image>
+					<view class="point" v-if="total2 > 0"></view>
+			    <view>我的网课</view>
+			  </view>
+			  <view class="box_right">
+			    <text>{{ total2 }}</text>
+			    个课程直播中
+			  </view>
+			</navigator>
+			<navigator
+			  hover-class="none"
+			  url="/pages5/liveDetail/list"
+			  class="menu_box"
+			>
+			  <view class="box_left">
+			    <image src="/static/icon/my_icon12.png" class="my_icon">
+					</image>
+					<view class="point" v-if="total2 > 0"></view>
+			    <view>我的直播课</view>
+			  </view>
+			  <view class="box_right">
+			    <text>{{ total2 }}</text>
+			    个课程直播中
+			  </view>
+			</navigator>
+			<navigator
+			  hover-class="none"
+			  url="/pages2/learn/my_learn"
+			  class="menu_box"
+			>
+			  <view class="box_left">
+			    <image src="/static/icon/my_icon2.png" class="my_icon"></image>
+					<view class="point" v-if="userNums.periodSum > 0"></view>
+			    <view>我的学时</view>
+			  </view>
+			  <view class="box_right">
+			    累计
+			    <text>{{ userNums.periodSum }}</text>
+			    学时未通过
+			  </view>
+			</navigator>
+			<navigator hover-class="none" url="/pages5/exam/index" class="menu_box">
+			  <view class="box_left">
+			    <image src="/static/icon/my_icon11.png" class="my_icon"></image>
+					<view class="point" v-if="total1 > 0"></view>
+			    <view>我的模考</view>
+			  </view>
+			  <view class="box_right">
+			    <text>{{ total1 }}</text>
+			    个模考预约
+			  </view>
+			</navigator>
+			<navigator hover-class="none" url="/pages2/exam/index" class="menu_box">
+			  <view class="box_left">
+			    <image src="/static/icon/my_icon10.png" class="my_icon"></image>
+					<view class="point" v-if="userNums.subscribeSum > 0"></view>
+			    <view>我的考试</view>
+			  </view>
+			  <view class="box_right">
+			    <text>{{ userNums.subscribeSum }}</text>
+			    考试预约
+			  </view>
+			</navigator>
 		</view>
+		
   </view>
 </template>
 
@@ -40,7 +114,12 @@ export default {
   components: {},
   data() {
     return {
-      
+      list:[{name:'继续教育-建造师-二级',id:1},{name:'继续教育-建造师-一级',id:2}],
+			businessId:'',
+			businessName:'',
+			userNums: {},
+			total1: 0,
+			total2: 0,
     };
   },
   onPullDownRefresh() {
@@ -49,7 +128,54 @@ export default {
   onLoad(option) {
     
   },
+	onShow() {
+		
+	},
   methods: {
+		change(e) {
+			this.businessId = this.list[e.detail.value].id
+			this.businessName = this.list[e.detail.value].name
+			
+			this.isLogin = this.$method.isLogin();
+			if (this.isLogin) {
+			  this.$store.state.allowLoading = false;
+			  this.getCount();
+			  this.goodsLivingSectionList();
+				this.getNums()
+			  this.$store.state.allowLoading = true;
+			}
+		},
+		getCount() {
+		  this.$api
+		    .mockSubscribeListSubscribe({
+		      mockStatus: 0,
+		      pageNum: 1,
+		      pageSize: 1,
+		    })
+		    .then((res) => {
+		      this.total1 = res.data.total;
+		    });
+		},
+		getNums() {
+		  this.$api.getinfoAttached().then((res) => {
+		    if (res.data.code === 200) {
+		      this.userNums = res.data.data;
+		      const nums =
+		        res.data.data.informSum +
+		        res.data.data.orderSum +
+		        res.data.data.periodSum +
+		        res.data.data.planSum +
+		        res.data.data.subscribeSum;
+		      this.$store.commit("tabNum", nums);
+		    }
+		  });
+		},
+		goodsLivingSectionList() {
+		  this.$api.goodsLivingSectionList().then((res) => {
+		    this.total2 = res.data.data.length;
+		  });
+		},
+		
     goIndex() {
 			uni.switchTab({
 				url:'../index/index'
@@ -111,24 +237,65 @@ page {
 	
 	
 	.note-list {
-		height: 80rpx;
 		background: #FFFFFF;
 		display: flex;
 		align-items: center;
+		height: 80rpx;
 		padding:0 32rpx;
 		
-		.text {
+		.picker {
 			flex:1;
 		}
-	}
-	
-	.note-modal {
-		position:absolute;
 		
 	}
 	
 	.course-list {
+		padding:0 32rpx;
+		
+		.menu_box {
+		  height: 104rpx;
+		  background: #ffffff;
+		  border-radius: 24rpx;
+		  margin-top: 30rpx;
+		  display: flex;
+		  align-items: center;
+		  padding: 0 20rpx;
+		  justify-content: space-between;
+		  color: #666666;
+		  font-size: 32rpx;
+		
+		  .box_left {
+		    display: flex;
+		    align-items: center;
+				position:relative;
+				
+				.point {
+					width:16rpx;
+					height:16rpx;
+					border-radius:50%;
+					background: red;
+					position:absolute;
+					left:50rpx;
+					top:0;
+				}
+		  }
+		
+		  .box_right {
+		    font-size: 32rpx;
 		
+		    text {
+		      color: #007aff;
+		      margin: 0 5rpx;
+		    }
+		  }
+		}
+		
+		
+		.my_icon {
+		  width: 56rpx;
+		  height: 56rpx;
+		  margin-right: 20rpx;
+		}
 	}
 }
 

+ 7 - 1
pages3/polyv/detail.vue

@@ -856,7 +856,13 @@ export default {
 		 */
 		courseChange() {
 			return new Promise((resolve) => {
-				
+				if(this.playSectionId) {
+					this.postStudyRecord(0)
+				}
+				this.$store.commit("setPlayChannelId", { playChannelId: 0 });
+				this.$store.commit("setPlayVID", { playVID: null });
+				this.startStatus = false;
+				this.vid = ''
 				this.courseDetail();
 				this.getAnswerList();
 				this.studyRecordMenuAllList();