Browse Source

修改:1.修改课程详情文字;2.学分明细页面修改;3.增加学分明细详情页;4.浏览记录修改展示字段

littleblue55 18 hours ago
parent
commit
19f09912db

+ 12 - 0
api/edu.js

@@ -123,4 +123,16 @@ export function regCourse(id){
 		},
 		'method': 'post'
 	})
+}
+
+// 年度学分详情
+export function loadCreditDatial(data){
+	return request({
+		'url': '/course/creditDetail',
+		headers: {
+			isToken: true
+		},
+		'method': 'post',
+		data: data
+	})
 }

+ 11 - 0
pages.json

@@ -481,6 +481,17 @@
 					"titleNView": true
 				}
 			}
+		},
+		{
+			"path" : "pages/goOnEdu/course/courseMine/mineRecord/recordDetail",
+			"style": {
+				"navigationBarBackgroundColor": "#FFFFFF",
+				"navigationBarTitleText": "学分明细",
+				"enablePullDownRefresh": false,
+				"app-plus": {
+					"titleNView": false
+				}
+			}
 		}
 	],
 	"globalStyle": {

+ 2 - 3
pages/goOnEdu/course/courseDetail/courseDetail.vue

@@ -27,7 +27,7 @@
 					<view class="text-content">{{courseDetail.date ? getDateWeek(courseDetail.date) : ''}}</view>
 					<view class="text-title">培训地点</view>
 					<view class="text-content">{{courseDetail.loc}}</view>
-					<view class="text-title">如需取消报名,请联系培训服务部刘小姐取消报名,电话:13332876414。</view>
+					<view class="text-title" style="color: red;font-weight: 500;font-size: 30rpx;">如需取消报名,请联系教育培训部工作人员13332876414/13302262603</view>
 					<view class="text-tip" v-if="!isMember && courseDetail.viewMode === '2'">个人会员或单位会员免费,点击现在入会></view>
 					<view style="width: 100%;height: 200rpx;"></view>
 				</view>
@@ -337,12 +337,11 @@
 	});
 
 	onShareAppMessage(async (res) => {
-		const processedImage = courseDetail.value.cover;
 		// console.log(processedImage)
 		return {
 			title: courseName.value,
 			path: `/pages/goOnEdu/course/courseDetail/courseDetail?id=${courseId.value}&title=${courseName.value}`,
-			imageUrl: processedImage
+			// imageUrl: courseDetail.value.cover
 		};
 	})
 

+ 20 - 7
pages/goOnEdu/course/courseMine/mineCredits/mineCredits.vue

@@ -5,29 +5,37 @@
 				<view class="list-item">
 					学习年度
 				</view>
-				<view class="list-item">
+				<view class="list-item" style="width: 40%;">
 					会员网络教育<br/>完成学分情况
 				</view>
-				<view class="list-item">
+				<view class="list-item" style="width: 35%;">
+					学分明细
+				</view>
+				<!-- <view class="list-item">
 					年检情况
 				</view>
 				<view class="list-item">
 					是否完成观看
-				</view>
+				</view> -->
 			</view>
 			<view class="list-item-box" v-for="(item, index) in list" :key="index">
 				<view class="list-item">
 					{{item.year}}
 				</view>
-				<view class="list-item">
+				<view class="list-item" style="width: 40%;">
 					{{item.gotCredit}}/{{item.credit}}
 				</view>
-				<view class="list-item" v-html="item.annIns!=='学分未达标不能申请年检' ? item.annIns : '学分未达标,<br/>不能申请年检'"></view>
+				<view class="list-item" style="width: 35%;">
+					<view class="button" :class="['primary']" @click="toPage(item.year)">
+						点击查看学分明细
+					</view>
+				</view>
+				<!-- <view class="list-item" v-html="item.annIns!=='学分未达标不能申请年检' ? item.annIns : '学分未达标,<br/>不能申请年检'"></view>
 				<view class="list-item">
 					<view class="button" :class="[item.finish ? 'primary' : 'error']">
 						{{item.finish ? '已完成观看' : '未完成'}}
 					</view>
-				</view>
+				</view> -->
 			</view>
 		</view>
 	</view>
@@ -45,6 +53,11 @@
 			}
 		})
 	}
+	const toPage = (year) =>{
+		uni.navigateTo({
+			url:"/pages/goOnEdu/course/courseMine/mineRecord/recordDetail?year="+year
+		})
+	}
 	onLoad(() => {
 		initList()
 		// console.log('onLoad')
@@ -83,7 +96,7 @@
 			}
 			padding: 15rpx 0;
 			text-align: center;
-			font-size: $uni-font-size-3;
+			font-size: $uni-font-size-2;
 			font-weight: bold;
 			display: flex;
 			align-items: center;

+ 4 - 3
pages/goOnEdu/course/courseMine/mineRecord/mineRecord.vue

@@ -12,14 +12,14 @@
 			<view v-for="(course,index) in courses" :key="course.id" @click="toCourse(course)">
 				<view class="course-item">
 					<view class="course-item-image">
-						<image class="course-image" :src="course.cover" mode="aspectFill"></image>
+						<image class="course-image" :src="course.thumImg ? course.thumImg : course.cover" mode="aspectFit"></image>
 					</view>
 					<view class="course-item-content">
 						<view class="course-title">
-							<text>{{ course.courseName }}</text>
+							<text>{{ course.title }}</text>
 
 						</view>
-						<view class="course-type">{{ course.courseType }}</view>
+						<view class="course-type">{{ course.type }}</view>
 						<view class="course-date">
 							<u-icon name="clock" size="28"></u-icon>
 							{{ getDateWeek(course.viewDate) }}
@@ -124,6 +124,7 @@
 
 			.course-image {
 				width: 100%;
+				height: 100%;
 			}
 
 		}

+ 233 - 0
pages/goOnEdu/course/courseMine/mineRecord/recordDetail.vue

@@ -0,0 +1,233 @@
+<template>
+	<view class="container">
+		<view class="list-box">
+			<view class="list-item-box">
+				<view class="list-item">
+					获得时间
+				</view>
+				<view class="list-item" style="width: 50%;">
+					课程名称
+				</view>
+				<view class="list-item" style="width: 25%;">
+					学分
+				</view>
+				<!-- <view class="list-item">
+					年检情况
+				</view>
+				<view class="list-item">
+					是否完成观看
+				</view> -->
+			</view>
+			<scroll-view scroll-y="true" class="scroll-Y" @scrolltolower="scrolltolower" v-if="list.length > 0">
+				<view class="list-item-content" v-for="(item, index) in list" :key="index">
+					<view class="list-item">
+						{{item.date}}
+					</view>
+					<view class="list-item" style="width: 50%;">
+						{{item.source}}
+					</view>
+					<view class="list-item" style="width: 25%;">
+						{{ item.credit }}
+					</view>
+					<!-- <view class="list-item" v-html="item.annIns!=='学分未达标不能申请年检' ? item.annIns : '学分未达标,<br/>不能申请年检'"></view>
+					<view class="list-item">
+						<view class="button" :class="[item.finish ? 'primary' : 'error']">
+							{{item.finish ? '已完成观看' : '未完成'}}
+						</view>
+					</view> -->
+				</view>
+			</scroll-view>
+			<u-empty v-else text="暂无数据" mode="list" style="margin: 20rpx"></u-empty>
+		</view>
+	</view>
+</template>
+
+<script setup>
+	import {
+		ref
+	} from 'vue'
+	import {
+		onLoad
+	} from '@dcloudio/uni-app'
+	import {
+		loadCreditDatial
+	} from '@/api/edu.js'
+	const list = ref([])
+	const currentYear = ref("");
+	const pageNumber = ref(1);
+	const pageSize = ref(30);
+	const count = ref(0);
+	const status = ref("loadmore")
+	const initList = () => {
+		const data = {
+			"pageNumber": pageNumber.value,
+			"pageSize": pageSize.value,
+			"year": currentYear.value
+		}
+		if(pageNumber.value===1){
+			list.value = [] 
+		}
+		uni.showLoading({
+			title: '加载中',
+		})
+		loadCreditDatial(data).then(res => {
+			uni.hideLoading()
+			if (res && res?.code === 0) {
+				count.value = res.count;
+				list.value = [...list.value, ...res.data];
+				if(list.value.length ===count.value){
+					status.value = 'nomore'
+				}
+				pageNumber.value = pageNumber.value + 1;
+			}
+		})
+	}
+	const scrolltolower = () => {
+		if(status.value === 'nomore'){
+			return
+		}
+		initList()
+	}
+	onLoad((options) => {
+		const {
+			year
+		} = options;
+		// console.log(year)
+		currentYear.value = year
+		pageNumber.value = 1
+		initList()
+		// console.log('onLoad')
+	})
+</script>
+
+<style lang="scss">
+	page {
+		background-color: $uni-bg-color;
+	}
+
+	.container {
+		box-sizing: border-box;
+		height: 100vh;
+		width: 100vw;
+		background-color: $uni-bg-color;
+		// background-color: #fff;
+		// padding: 0 20rpx env(safe-area-inset-bottom, 0);
+		padding: 30rpx;
+	}
+
+	.scroll-Y {
+		flex: 1;
+		overflow: hidden;
+	}
+
+	.list-box {
+		height: 100%;
+		display: flex;
+		flex-direction: column;
+		// margin: 20rpx 20rpx;
+		background-color: $uni-bg-color-grey;
+		border-radius: $uni-card-border-radius;
+
+		// padding: 20rpx 15rpx;
+		// margin-bottom: 30rpx;
+		.list-item-box {
+			&:first-child {
+				border-bottom: 5rpx solid #E6E6E6;
+				font-size: $uni-font-size-1;
+				font-weight: bold;
+				flex: 0 0 auto;
+
+				.list-item {
+					width: 25%;
+					text-align: center;
+
+					&:last-child {
+						color: #303133;
+						font-weight: bold;
+					}
+				}
+			}
+
+			padding: 15rpx 0;
+			text-align: center;
+			font-size: $uni-font-size-2;
+			font-weight: bold;
+			display: flex;
+			align-items: center;
+
+			.list-item {
+				width: 25%;
+				text-align: center;
+
+				&:last-child {
+					color: $uni-text-color-inverse;
+					font-weight: normal;
+				}
+			}
+
+			.button {
+				width: fit-content;
+				border-radius: $uni-card-border-radius;
+				margin: 0 auto;
+			}
+
+			.primary {
+				padding: 5rpx 25rpx;
+				background-color: $uni-color-primary;
+			}
+
+			.error {
+				padding: 5rpx 15rpx;
+				background-color: $uni-color-error;
+			}
+		}
+
+		.list-item-content {
+			// &:first-child {
+			// 	border-bottom: 5rpx solid #E6E6E6;
+			// 	font-size: $uni-font-size-1;
+			// 	font-weight: bold;
+			// 	.list-item {
+			// 		width: 25%;
+			// 		text-align: center;
+			// 		&:last-child {
+			// 			color: #303133;
+			// 			font-weight: bold;
+			// 		}
+			// 	}
+			// }
+			padding: 15rpx 0;
+			text-align: center;
+			font-size: $uni-font-size-2;
+			font-weight: bold;
+			display: flex;
+			align-items: center;
+
+			.list-item {
+				width: 25%;
+				text-align: center;
+
+				&:last-child {
+					color: $uni-text-color-inverse;
+					font-weight: normal;
+				}
+			}
+
+			.button {
+				width: fit-content;
+				border-radius: $uni-card-border-radius;
+				margin: 0 auto;
+			}
+
+			.primary {
+				padding: 5rpx 25rpx;
+				background-color: $uni-color-primary;
+			}
+
+			.error {
+				padding: 5rpx 15rpx;
+				background-color: $uni-color-error;
+			}
+		}
+	}
+</style>