Browse Source

我的研修接口对接

liurongli 3 tuần trước cách đây
mục cha
commit
c32e151e1c

+ 15 - 1
components/nav-bar.vue

@@ -38,7 +38,8 @@
 	import uniIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue';
 	import {
 		reactive,
-		onMounted
+		onMounted,
+		watch
 	} from 'vue';
 	const emit = defineEmits(['GoBack','CommonFilterData']);
 	const props = defineProps({
@@ -101,6 +102,11 @@
 		},
 		searchInputPlaceholderStyle: 'color: #C0C4CC;fontSize: 28rpx' //搜素框样式
 	})
+	watch(()=>props.tabList,(newVal, oldVal)=>{
+		if(newVal){
+			state.tabsSelected = props?.tabList?.[0]?.value || ''; //tab 默认值
+		}
+	})
 	//关键字搜索
 	const HandleSearchInput = (e) => {
 		state.searchWord = e;
@@ -113,6 +119,14 @@
 		const valueIndex = e.detail.value; //下拉框选中值的索引
 		const selectedValue = props.filterPickerData?.[index]?.list?.[valueIndex]?.value ?? '';
 		state.filterPickerValue[index] = selectedValue;
+		//处理下一级默认值
+		for(let i = 0; i < props.filterPickerData.length; i++){
+			if(i > index){
+				const list = props.filterPickerData?.[i]?.list || [];
+				state.filterPickerValue[i] = list.length > 0 ? list[0].value : '';
+			}
+		}
+		console.log(state.filterPickerValue,props.filterPickerData,37888)
 		CommonFilterData(state.searchWord, {
 			valueIndex,
 			index,

+ 1 - 1
pages/teacherStudy/courseCenter/index.vue

@@ -20,7 +20,7 @@
 			<view class="page_list">
 				<view class="list_item" v-for="item in state.pageList" :key="item.id">
 					<image class="item_img" mode="aspectFill" :src="item.videoCoverUrl"></image>
-					<view class="item_title">2025{{item.courseName}}</view>
+					<view class="item_title">{{item.courseName}}</view>
 					<view class="item_time">
 						<image class="img" src="@/static/image/icon/time2x.png"></image>
 						<text class="time">{{item.courseStartDatetime}}</text>

+ 79 - 40
pages/teacherStudy/myLearning/index.vue

@@ -21,10 +21,14 @@
 				<view class="list_item" v-for="item in state.pageList" :key="item.id">
 					<view class="item_img_box">
 						<image class="item_img" mode="aspectFill" :src="item.videoCoverUrl"></image>
-						<view class="remaining_days">剩余{{item.remainingTime}}</view>
+						<view v-if="(item.learnStatus == 3 || item.learnStatus == 4 || item.learnStatus == 1) && state.courseType == '0'" :class="['remaining_days',{wait:item.learnStatus == 3,finish:item.learnStatus == 4,overtime:item.learnStatus == 1}]">
+							<template v-if="item.learnStatus == 3">剩余{{item.remainingTime}}</template>
+							<template v-if="item.learnStatus == 4">已完成</template>
+							<template v-if="item.learnStatus == 1">已结束</template>
+						</view>
 						<view class="progress"><view class="done" :style="{width:item.progress}"></view></view>
 					</view>
-					<view class="item_title">2025{{item.courseName}}</view>
+					<view class="item_title">{{item.courseName}}</view>
 					<view class="item_time">
 						<image class="img" src="@/static/image/icon/time2x.png"></image>
 						<text class="time">{{item.courseStartDatetime}}</text>
@@ -52,6 +56,16 @@
 	const state = reactive({
 		courseTypeData:[],//顶部查询数据 
 		filterPickerData: [{
+			valueIndex:0,//默认值索引
+			defaultValue:'0',//默认值
+			list:[{
+				label:'必修任务',
+				value:'0',
+			},{
+				label:'自主研修',
+				value:'1',
+			}]
+		},{
 			valueIndex:0,//默认值索引
 			defaultValue:'',//默认值
 			list:[]
@@ -59,22 +73,37 @@
 			valueIndex:0,//默认值索引
 			defaultValue:'',//默认值
 			list:[]
-		}],
-		tabList: [{
-			label: '最新发布',
-			value: '0'
+		}],//必修任务tab
+		tabList:[],
+		mustTabList: [{
+			label: '全部',
+			value: ''
 		}, {
-			label: '播放最多',
-			value: '1'
+			label: '待完成',
+			value: '3'
+		}, {
+			label: '已完成',
+			value: '4'
 		}, {
-			label: '关注最多',
-			value: '2'
+			label: '已结束',
+			value: '1'
 		}],
+		selftabList: [{
+			label: '学习中',
+			value: '3'
+		}, {
+			label: '已完成',
+			value: '4'
+		}, {
+			label: '已关注',
+			value: '5'
+		}],//自主研修tab
 		pageList:[],//列表数据
 		queryStr: '',
-		courseType: '0',//排序方式,课程中心参数,0-最新发布,1-播放最多,2-关注最多
-		teachCourseTypeClassId: '',//研修专题	
+		courseType:'0',//默认必修任务
 		teachCourseTypeId: '',//内容领域	
+		teachCourseTypeClassId: '',//研修专题
+		learnStatus: '',//tab选中值
 		pageSize: 30,
 		pageNum: 1,
 		scrollTop:0,
@@ -85,6 +114,7 @@
 		loadStatus:'more',//loading状态
 	})
 	onMounted(() => {
+		state.tabList = [...state.mustTabList];
 		getCourseTypeDataList();
 		OnLoadData(true);
 	});
@@ -99,32 +129,27 @@
 				}];
 				const resData = res?.data || [];
 				state.courseTypeData = defaultData.concat(resData);
-				//一级条件
-				state.filterPickerData[0].list = state.courseTypeData.map(item=>({
+				//内容领域
+				state.filterPickerData[1].list = state.courseTypeData.map(item=>({
 					...item,
 					value:item.id
 				}))
-			}else{
-				state.courseTypeData = [];
-				state.filterPickerData = [{
-					valueIndex:0,//默认值索引
-					defaultValue:'',//默认值
-					list:[],
-				},{
-					valueIndex:0,
-					defaultValue:'',//默认值
-					list:[],
-				}]
 			}
 		})
 	}
 	//切换条件选择器
 	const CommonFilterData = (searchWord,filterPicker,tabsSelected,type) => {
 		const {valueIndex, index,filterPickerValue} = filterPicker;
+		state.queryStr = searchWord;
+		state.courseType = filterPickerValue[0];
+		state.teachCourseTypeId = filterPickerValue[1];
+		state.teachCourseTypeClassId = filterPickerValue[2];
+		state.learnStatus = tabsSelected;
 		if(type == 'filterPicker'){
-			if(index==0){//索引
-				state.filterPickerData[index].valueIndex = valueIndex;//一级条件选中项的索引
-				state.filterPickerData[1].valueIndex = 0;//二级条件选中项的索引
+			state.filterPickerData[index].valueIndex = valueIndex;//研修场景、内容领域、研修专题选中项的索引
+			if(index==1){//切换内容领域选中项
+				//研修专题默认切换到全部 同时获取研修专题所有选项
+				state.filterPickerData[2].valueIndex = 0;
 				const childrenData = state.courseTypeData?.[valueIndex]?.children || [];
 				const childrenList = childrenData.map(item=>({
 					...item,
@@ -132,20 +157,22 @@
 				}))
 				if(childrenList.length){
 					childrenList.unshift({
-						label:'内容领域',
+						label:'研修专题',
 						id:'',
 						value:''
 					})
 				}
-				state.filterPickerData[1].list = childrenList;//二级条件数据
+				state.filterPickerData[2].list = childrenList;
 			}else{
-				state.filterPickerData[index].valueIndex = valueIndex;//二级条件选中项的索引
+				if(index == 0){
+					state.filterPickerData[1].valueIndex = 0;//内容领域
+					state.filterPickerData[2].valueIndex = 0;//研修专题
+					state.filterPickerData[2].list = [];//研修专题选项
+					state.tabList = valueIndex == 0 ? [...state.mustTabList] : [...state.selftabList];
+					state.learnStatus = valueIndex == 0 ? '' : '3';
+				}
 			}
 		}
-		state.queryStr = searchWord;
-		state.teachCourseTypeId = filterPickerValue[0];
-		state.teachCourseTypeClassId = filterPickerValue[1];
-		state.courseType = tabsSelected;
 		OnLoadData(true)
 	}
 	/*
@@ -161,10 +188,10 @@
 		state.loadStatus = 'loading';
 		recordPageListData({
 			queryStr:state.queryStr,
+			courseType:state.courseType,
 			teachCourseTypeId:state.teachCourseTypeId,
 			teachCourseTypeClassId:state.teachCourseTypeClassId,
-			courseType:'0',
-			learnStatus:'',
+			learnStatus:state.learnStatus,
 			pageSize:state.pageSize,
 			pageNum:state.pageNum
 		}).then(res=>{
@@ -255,15 +282,27 @@
 						position: absolute;
 						top:0;
 						right: 0;
-						width: 134rpx;
-						height: 48rpx;
-						background-color: #2E64FA;
 						border-radius: 0px 8px 0px 8px;
 						font-weight: 400;
 						font-size: 28rpx;
 						color: #FFFFFF;
 						text-align: center;
+						height: 48rpx;
 						line-height: 48rpx;
+						&.wait{
+							min-width: 134rpx;
+							padding:0 16rpx;
+							box-sizing: border-box;
+							background-color: #2E64FA;
+						}
+						&.finish{
+							width: 116rpx;
+							background-color: #90CB75;
+						}
+						&.overtime{
+							width: 116rpx;
+							background-color: #F56C6C;
+						}
 					}
 					.progress{
 						width: 100%;

+ 8 - 14
unpackage/dist/cache/.vite/deps/_metadata.json

@@ -1,19 +1,13 @@
 {
-"hash": "6fd40272",
-  "configHash": "5ccaef1e",
-  "lockfileHash": "79268a42",
-  "browserHash": "753a0eb0",  
+  "hash": "75325abd",
+  "configHash": "1b48dfbe",
+  "lockfileHash": "4eefd62d",
+  "browserHash": "2ae6d303",
   "optimized": {
-        "@wangeditor/editor-for-vue": {
-      "src": "../../../../../node_modules/@wangeditor/editor-for-vue/dist/index.esm.js",
-      "file": "@wangeditor_editor-for-vue.js",
-      "fileHash": "11135f85",
-      "needsInterop": false
-    },
-    "uview-plus": {
-      "src": "../../../../../node_modules/uview-plus/index.js",
-      "file": "uview-plus.js",
-      "fileHash": "fa9408bf",
+    "jsencrypt": {
+      "src": "../../../../../node_modules/jsencrypt/lib/index.js",
+      "file": "jsencrypt.js",
+      "fileHash": "5db203d0",
       "needsInterop": false
     }
   },

+ 15 - 15
unpackage/dist/cache/.vite/deps/jsencrypt.js

@@ -1,4 +1,4 @@
-// ../../../../wpl/hjy/workApp/node_modules/jsencrypt/lib/lib/jsbn/util.js
+// D:/huijiaoyan/mobile8.1/workApp/node_modules/jsencrypt/lib/lib/jsbn/util.js
 var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
 function int2char(n) {
   return BI_RM.charAt(n);
@@ -50,7 +50,7 @@ function cbit(x) {
   return r;
 }
 
-// ../../../../wpl/hjy/workApp/node_modules/jsencrypt/lib/lib/jsbn/base64.js
+// D:/huijiaoyan/mobile8.1/workApp/node_modules/jsencrypt/lib/lib/jsbn/base64.js
 var b64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
 var b64pad = "=";
 function hex2b64(h) {
@@ -111,7 +111,7 @@ function b64tohex(s) {
   return ret;
 }
 
-// ../../../../wpl/hjy/workApp/node_modules/jsencrypt/lib/lib/asn1js/hex.js
+// D:/huijiaoyan/mobile8.1/workApp/node_modules/jsencrypt/lib/lib/asn1js/hex.js
 var decoder;
 var Hex = {
   decode: function(a) {
@@ -162,7 +162,7 @@ var Hex = {
   }
 };
 
-// ../../../../wpl/hjy/workApp/node_modules/jsencrypt/lib/lib/asn1js/base64.js
+// D:/huijiaoyan/mobile8.1/workApp/node_modules/jsencrypt/lib/lib/asn1js/base64.js
 var decoder2;
 var Base64 = {
   decode: function(a) {
@@ -235,7 +235,7 @@ var Base64 = {
   }
 };
 
-// ../../../../wpl/hjy/workApp/node_modules/jsencrypt/lib/lib/asn1js/int10.js
+// D:/huijiaoyan/mobile8.1/workApp/node_modules/jsencrypt/lib/lib/asn1js/int10.js
 var max = 1e13;
 var Int10 = (
   /** @class */
@@ -308,7 +308,7 @@ var Int10 = (
   }()
 );
 
-// ../../../../wpl/hjy/workApp/node_modules/jsencrypt/lib/lib/asn1js/asn1.js
+// D:/huijiaoyan/mobile8.1/workApp/node_modules/jsencrypt/lib/lib/asn1js/asn1.js
 var ellipsis = "…";
 var reTimeS = /^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;
 var reTimeL = /^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;
@@ -825,7 +825,7 @@ var ASN1Tag = (
   }()
 );
 
-// ../../../../wpl/hjy/workApp/node_modules/jsencrypt/lib/lib/jsbn/jsbn.js
+// D:/huijiaoyan/mobile8.1/workApp/node_modules/jsencrypt/lib/lib/jsbn/jsbn.js
 var dbits;
 var canary = 244837814094590;
 var j_lm = (canary & 16777215) == 15715070;
@@ -2304,7 +2304,7 @@ function nbits(x) {
 BigInteger.ZERO = nbv(0);
 BigInteger.ONE = nbv(1);
 
-// ../../../../wpl/hjy/workApp/node_modules/jsencrypt/lib/lib/jsbn/prng4.js
+// D:/huijiaoyan/mobile8.1/workApp/node_modules/jsencrypt/lib/lib/jsbn/prng4.js
 var Arcfour = (
   /** @class */
   function() {
@@ -2347,7 +2347,7 @@ function prng_newstate() {
 }
 var rng_psize = 256;
 
-// ../../../../wpl/hjy/workApp/node_modules/jsencrypt/lib/lib/jsbn/rng.js
+// D:/huijiaoyan/mobile8.1/workApp/node_modules/jsencrypt/lib/lib/jsbn/rng.js
 var rng_state;
 var rng_pool = null;
 var rng_pptr;
@@ -2421,7 +2421,7 @@ var SecureRandom = (
   }()
 );
 
-// ../../../../wpl/hjy/workApp/node_modules/jsencrypt/lib/lib/jsbn/rsa.js
+// D:/huijiaoyan/mobile8.1/workApp/node_modules/jsencrypt/lib/lib/jsbn/rsa.js
 function pkcs1pad1(s, n) {
   if (n < s.length + 22) {
     console.error("Message too long for RSA");
@@ -2732,7 +2732,7 @@ function removeDigestHeader(str) {
   return str;
 }
 
-// ../../../../wpl/hjy/workApp/node_modules/jsencrypt/lib/lib/jsrsasign/yahoo.js
+// D:/huijiaoyan/mobile8.1/workApp/node_modules/jsencrypt/lib/lib/jsrsasign/yahoo.js
 var YAHOO = {};
 YAHOO.lang = {
   /**
@@ -2788,7 +2788,7 @@ YAHOO.lang = {
   }
 };
 
-// ../../../../wpl/hjy/workApp/node_modules/jsencrypt/lib/lib/jsrsasign/asn1-1.0.js
+// D:/huijiaoyan/mobile8.1/workApp/node_modules/jsencrypt/lib/lib/jsrsasign/asn1-1.0.js
 var KJUR = {};
 if (typeof KJUR.asn1 == "undefined" || !KJUR.asn1)
   KJUR.asn1 = {};
@@ -3526,7 +3526,7 @@ KJUR.asn1.DERTaggedObject = function(params) {
 };
 YAHOO.lang.extend(KJUR.asn1.DERTaggedObject, KJUR.asn1.ASN1Object);
 
-// ../../../../wpl/hjy/workApp/node_modules/jsencrypt/lib/JSEncryptRSAKey.js
+// D:/huijiaoyan/mobile8.1/workApp/node_modules/jsencrypt/lib/JSEncryptRSAKey.js
 var __extends = /* @__PURE__ */ function() {
   var extendStatics = function(d, b) {
     extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
@@ -3700,7 +3700,7 @@ var JSEncryptRSAKey = (
   }(RSAKey)
 );
 
-// ../../../../wpl/hjy/workApp/node_modules/jsencrypt/lib/JSEncrypt.js
+// D:/huijiaoyan/mobile8.1/workApp/node_modules/jsencrypt/lib/JSEncrypt.js
 var _a;
 var version = typeof process !== "undefined" ? (_a = process.env) === null || _a === void 0 ? void 0 : _a.npm_package_version : void 0;
 var JSEncrypt = (
@@ -3784,7 +3784,7 @@ var JSEncrypt = (
   }()
 );
 
-// ../../../../wpl/hjy/workApp/node_modules/jsencrypt/lib/index.js
+// D:/huijiaoyan/mobile8.1/workApp/node_modules/jsencrypt/lib/index.js
 var lib_default = JSEncrypt;
 export {
   JSEncrypt,