Răsfoiți Sursa

需要更新

于添 8 luni în urmă
părinte
comite
2d8fc98e0d

+ 2 - 2
.env.development

@@ -5,9 +5,9 @@ NODE_ENV = development
 VITE_TITLE = Snowy
 
 # 接口地址
-VITE_API_BASEURL = http://192.168.31.81:9003
+# VITE_API_BASEURL = http://192.168.31.81:9003
 VITE_FILEURL = http://192.168.1.245:10005/education/
-# VITE_API_BASEURL = http://192.168.31.80:9003
+VITE_API_BASEURL = http://192.168.31.14:9003
 # VITE_API_BASEURL = http://192.168.31.6:9003
 
 # 本地端口

+ 138 - 34
index.html

@@ -1,42 +1,146 @@
 <!DOCTYPE html>
 <html lang="zh_cn">
+
 <head>
-  <meta charset="utf-8">
-  <meta http-equiv="X-UA-Compatible" content="IE=edge">
-  <meta name="viewport" content="width=device-width,initial-scale=1.0">
-  <link rel="icon" href="/favicon.ico">
-  <title>Snowy</title>
-  <style>
-    .dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:32px;width:32px;height:32px;box-sizing:border-box}.dot i{width:14px;height:14px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.dot i:nth-child(1){top:0;left:0}.dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}
-    .app-loading {position: absolute;top:0px;left:0px;right:0px;bottom:0px;display: flex;justify-content: center;align-items: center;flex-direction: column;background: #fff;}
-    .app-loading__logo {margin-bottom: 30px;}
-    .app-loading__logo img {width: 90px;vertical-align: bottom;}
-    .app-loading__title {font-size: 24px;color: #333;margin-top: 30px;}
-    @keyframes loader {
-      0% {
-        transform: rotate(0deg);
-      }
-      100% {
-        transform: rotate(360deg);
-      }
-    }
-  </style>
+    <meta charset="utf-8">
+    <meta charset="UTF-8" name="referrer" content="no-referrer" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width,initial-scale=1.0">
+    <link rel="icon" href="/favicon.ico">
+    <title>Snowy</title>
+    <style>
+        .dot {
+            animation: antRotate 1.2s infinite linear;
+            transform: rotate(45deg);
+            position: relative;
+            display: inline-block;
+            font-size: 32px;
+            width: 32px;
+            height: 32px;
+            box-sizing: border-box
+        }
+
+        .dot i {
+            width: 14px;
+            height: 14px;
+            position: absolute;
+            display: block;
+            background-color: #1890ff;
+            border-radius: 100%;
+            transform: scale(.75);
+            transform-origin: 50% 50%;
+            opacity: .3;
+            animation: antSpinMove 1s infinite linear alternate
+        }
+
+        .dot i:nth-child(1) {
+            top: 0;
+            left: 0
+        }
+
+        .dot i:nth-child(2) {
+            top: 0;
+            right: 0;
+            -webkit-animation-delay: .4s;
+            animation-delay: .4s
+        }
+
+        .dot i:nth-child(3) {
+            right: 0;
+            bottom: 0;
+            -webkit-animation-delay: .8s;
+            animation-delay: .8s
+        }
+
+        .dot i:nth-child(4) {
+            bottom: 0;
+            left: 0;
+            -webkit-animation-delay: 1.2s;
+            animation-delay: 1.2s
+        }
+
+        @keyframes antRotate {
+            to {
+                -webkit-transform: rotate(405deg);
+                transform: rotate(405deg)
+            }
+        }
+
+        @-webkit-keyframes antRotate {
+            to {
+                -webkit-transform: rotate(405deg);
+                transform: rotate(405deg)
+            }
+        }
+
+        @keyframes antSpinMove {
+            to {
+                opacity: 1
+            }
+        }
+
+        @-webkit-keyframes antSpinMove {
+            to {
+                opacity: 1
+            }
+        }
+
+        .app-loading {
+            position: absolute;
+            top: 0px;
+            left: 0px;
+            right: 0px;
+            bottom: 0px;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            flex-direction: column;
+            background: #fff;
+        }
+
+        .app-loading__logo {
+            margin-bottom: 30px;
+        }
+
+        .app-loading__logo img {
+            width: 90px;
+            vertical-align: bottom;
+        }
+
+        .app-loading__title {
+            font-size: 24px;
+            color: #333;
+            margin-top: 30px;
+        }
+
+        @keyframes loader {
+            0% {
+                transform: rotate(0deg);
+            }
+
+            100% {
+                transform: rotate(360deg);
+            }
+        }
+    </style>
 
 </head>
+
 <body>
-<noscript>
-  <strong>We're sorry but Snowy2.0 doesn't work properly without JavaScript
-    enabled. Please enable it to continue.</strong>
-</noscript>
-<div id="app" class="admin-ui">
-  <div class="app-loading">
-    <div class="app-loading__logo">
-      <img src="/img/logo.png"/>
+    <noscript>
+        <strong>We're sorry but Snowy2.0 doesn't work properly without JavaScript
+            enabled. Please enable it to continue.</strong>
+    </noscript>
+    <div id="app" class="admin-ui">
+        <div class="app-loading">
+            <div class="app-loading__logo">
+                <img src="/img/logo.png" />
+            </div>
+            <div><span class="dot dot-spin"><i></i><i></i><i></i><i></i></span></div>
+            <div class="app-loading__title">Snowy</div>
+        </div>
     </div>
-    <div><span class="dot dot-spin"><i></i><i></i><i></i><i></i></span></div>
-    <div class="app-loading__title">Snowy</div>
-  </div>
-</div>
-<script type="module" src="/src/main.js"></script>
+    <script type="module" src="/src/main.js"></script>
 </body>
-</html>
+
+</html>

Fișier diff suprimat deoarece este prea mare
+ 724 - 51
package-lock.json


+ 11 - 0
src/api/portal/index.js

@@ -19,4 +19,15 @@ export const detail = (p) => request('disk/courseauditrecord/detail', p, 'get')
 export const add = (p) => request('disk/collect/add', p, 'post')
 //收藏查询
 export const queryList = (p) => request('disk/collect/queryList', p, 'get')
+//取消收藏
 export const cancel = (p) => request('disk/collect/cancel', p, 'post')
+//添加评论/回复
+export const addComment = (p) => request('disk/comment/add', p, 'post')
+//修改评论
+export const editComment = (p) => request('disk/comment/edit', p, 'post')
+//删除评论
+export const deleteComment = (p) => request('disk/comment/delete', p, 'post')
+//评论查询
+export const pageComment = (p) => request('disk/comment/page', p, 'get')
+//点赞
+export const giveComment = (p) => request('disk/comment/give', p, 'get')

BIN
src/assets/images/pdf.png


+ 8 - 2
src/views/portal/index.vue

@@ -1,5 +1,6 @@
 <template>
 	<div style="overflow-y: auto">
+		<!-- <img :src="images" style="width: 100%; height: 100%" /> -->
 		<a-layout>
 			<Header @onChangeCurrent="onChangeCurrent" />
 			<div style="width: 71%; margin-left: 10%">
@@ -17,12 +18,13 @@
 	import BreadCrumb from './components/BreadCrumb.vue'
 	import Footer from './components/Footer.vue'
 	import ResourceCenter from '@/views/resourceCenter/index.vue'
-	import ResourceDetails from '@/views/resourceDetails/index.vue'
 	import EventBus from '@/utils/EventBus'
 	import { useRouter, useRoute } from 'vue-router'
 	const router = useRouter()
 
 	const indexType = ref('resourceCenter')
+
+	const images = ref('')
 	const ResourceDetailsRef = ref(null)
 	const onChangeCurrent = (current) => {
 		indexType.value = current
@@ -49,7 +51,11 @@
 			}
 		})
 	}
-
+	onMounted(() => {
+		// setTimeout(() => {
+		// 	images.value = 'http://192.168.1.245:10005/education/2025/7/2/1940361083973906434.jpg'
+		// }, 10000)
+	})
 	EventBus.off('openResourceDetails', handleOpenResourceDetails)
 	EventBus.on('openResourceDetails', handleOpenResourceDetails)
 </script>

+ 16 - 2
src/views/resourceCenter/components/ResourceList.vue

@@ -20,9 +20,22 @@
 		<a-row :gutter="[16, 16]">
 			<a-col :span="8" v-for="(item, index) in resources" :key="index">
 				<div style="border-radius: 10px 10px 5px 5px; border: 1px solid #dcdcdc">
-					<div style="display: flex">
+					<div style="display: flex; position: relative">
 						<div class="resource" @click="handleItem(item)">
-							<PlayCircleOutlined :style="{ fontSize: '40px', color: 'white' }" />
+							<a-image
+								style="width: 100%; height: 100%"
+								:src="
+									item.coverImagePath != '' && sysConfig.FILE_URL + item.coverImagePath
+										? sysConfig.FILE_URL + item.coverImagePath
+										: ''
+								"
+								alt=""
+								:preview="false"
+							></a-image>
+							<PlayCircleOutlined
+								:style="{ fontSize: '40px', color: 'white' }"
+								style="position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%)"
+							/>
 						</div>
 					</div>
 					<div style="display: flex; flex-direction: column; padding: 5px 10px">
@@ -67,6 +80,7 @@
 	import { list } from '@/api/portal'
 	import tool from '@/utils/tool'
 	import EventBus from '@/utils/EventBus'
+	import sysConfig from '@/config/index'
 
 	const total = ref(1024)
 	const tabKey = ref('new')

+ 47 - 1
src/views/resourceDetails/components/TallList.vue

@@ -45,6 +45,30 @@
 					<a-button style="width: 100px" disabled>发布</a-button>
 				</div>
 			</div>
+			<div>
+				<div style="display: flex">
+					<div style="display: flex; flex-direction: column; margin-left: 10px; margin-right: 10px">
+						<div
+							style="
+								width: 30px;
+								height: 30px;
+								background: #1e90ff;
+								border-radius: 50%;
+								margin-top: 15px;
+								margin-right: 15px;
+							"
+						></div>
+						<span style="display: block; font-size: 10px">未登录</span>
+					</div>
+
+					<div style="width: 100%; height: 100%; display: flex; position: relative">
+						<a-textarea placeholder="" :rows="4" v-model:value="talk" style="margin-top: 5px" />
+					</div>
+				</div>
+				<div style="display: flex; justify-content: flex-end; margin-top: 10px">
+					<a-button style="width: 100px" @click="handerPublish">发布</a-button>
+				</div>
+			</div>
 
 			<div style="display: flex; justify-content: space-between; margin-top: 40px">
 				<div style="display: flex; align-items: center">
@@ -53,6 +77,7 @@
 				</div>
 				<TabSwitcher></TabSwitcher>
 			</div>
+
 			<div class="line"></div>
 
 			<div>
@@ -77,9 +102,13 @@
 	import TabSwitcher from './TabSwitcher.vue'
 	import TallItem from './TallItem.vue'
 	import EqualItem from './EqualItem.vue'
+	import { addViewCount, detail, add, cancel, queryList, pageComment, addComment } from '@/api/portal'
+	import { useRoute } from 'vue-router'
 	const emit = defineEmits(['selectTab'])
 	const listUnpublishedView = ref(null)
-
+	const route = useRoute()
+	const id = route.query.id
+	const talk = ref('')
 	const equalList = ref([
 		{
 			id: 1,
@@ -140,6 +169,15 @@
 		console.log('最后的', list.value)
 	}
 
+	const handerPublish = () => {
+		addComment({ resourceId: id, commentName: talk.value })
+			.then((res) => {})
+			.catch((err) => {
+				console.log(err)
+			})
+		//....
+		// listUnpublishedView.value.setData(tableData.value)
+	}
 	const onQuery = (form) => {
 		console.log('查询内容', form)
 		//....
@@ -151,9 +189,17 @@
 		//....
 		// listUnpublishedView.value.setData(tableData.value)
 	}
+	const getPageComment = () => {
+		pageComment({ resourceId: id })
+			.then((res) => {})
+			.catch((err) => {
+				console.log(err)
+			})
+	}
 
 	onMounted(() => {
 		getList()
+		getPageComment()
 	})
 </script>
 

+ 108 - 25
src/views/resourceDetails/components/VideoDetails.vue

@@ -4,7 +4,50 @@
 		<div style="height: 25px"></div>
 		<div class="user-info-container">
 			<div class="video-info" style="width: 850px">
-				<div style="width: 850px; height: 350px; background-color: aqua"></div>
+				<div
+					v-if="videoFormat == 'jpg' || videoFormat == 'bmp' || videoFormat == 'png' || videoFormat == 'jepg'"
+					style="width: 850px; height: 350px"
+				>
+					<!-- <img :src="imgs + itemData.coverImagePath" style="width: 100%; height: 100%" /> -->
+					<!-- <img :v-lazy="imagess" style="width: 100%; height: 100%" /> -->
+					<a-image width="850px" height="350px" :src="resSrc" :preview="true" />
+					<!-- <image :src="resSrc" style="object-fit: cover" /> -->
+				</div>
+				<!-- "wmv","avi","flv","mpeg","mpg","rmvb","mov","mkv" -->
+				<div
+					v-if="
+						videoFormat == 'mkv' ||
+						videoFormat == 'mp4' ||
+						videoFormat == 'wmv' ||
+						videoFormat == 'avi' ||
+						videoFormat == 'flv' ||
+						videoFormat == 'mpeg' ||
+						videoFormat == 'mpg' ||
+						videoFormat == 'rmvb' ||
+						videoFormat == 'mov'
+					"
+					style="width: 850px; height: 350px"
+				>
+					<video :src="resSrc" controls style="width: 100%; height: 100%" />
+				</div>
+				<!-- "doc","docx","ppt","pptx","xls","xlsx" -->
+				<div
+					v-if="
+						videoFormat == 'docx' ||
+						videoFormat == 'doc' ||
+						videoFormat == 'ppt' ||
+						videoFormat == 'pptx' ||
+						videoFormat == 'xls' ||
+						videoFormat == 'xlsx'
+					"
+					style="width: 850px; height: 350px"
+				>
+					<!-- <PDF :src="resSrc" :width="850" :height="350" /> -->
+
+					<a-image width="200px" height="220px" :src="pdf" :preview="false" @click="handleDownload(resSrc)" />
+					<!-- <a-button type="primary" @click="handleDownload(resSrc)">去预览</a-button> -->
+				</div>
+
 				<div style="height: 20px"></div>
 				<!-- 用户信息部分 -->
 				<div class="user-info" style="display: flex; flex-direction: column">
@@ -43,7 +86,8 @@
 								</div>
 								<div style="width: 10px"></div>
 								<div style="display: flex; align-items: center; cursor: pointer" @click="handlerCollection">
-									<StarOutlined />
+									<StarOutlined v-if="starTag == false" />
+									<StarFilled v-if="starTag == true" />
 									<div style="width: 10px"></div>
 									<button class="favorite-btn">收藏资源</button>
 								</div>
@@ -64,12 +108,12 @@
 					<span style="display: block; font-weight: bold">课程信息</span>
 				</div>
 				<div style="display: flex; justify-content: center; align-items: center; height: 40px">
-					<span style="display: block; font-weight: bold">资源名称</span>
+					<span style="display: block; font-weight: bold">{{ resName }}</span>
 				</div>
-				<div style="display: flex; align-items: center">
+				<!-- <div style="display: flex; align-items: center">
 					<span style="font-weight: bold; margin-right: 10px">授课老师: </span>
 					<span style="display: block">{{ teacherName }}</span>
-				</div>
+				</div> -->
 				<div style="display: flex; align-items: center">
 					<span style="font-weight: bold; margin-right: 10px">所属院系: </span>
 					<span style="display: block">{{ department }}</span>
@@ -86,7 +130,7 @@
 					<span style="font-weight: bold; margin-right: 10px">课件格式: </span>
 					<span style="display: block">{{ videoFormat }}</span>
 				</div>
-				<div style="display: flex; align-items: center">
+				<div style="display: flex; align-items: center" v-if="videoFormat != 'jpg'">
 					<span style="font-weight: bold; margin-right: 10px">视频时长: </span>
 					<span style="display: block">{{ videoDuration }}</span>
 				</div>
@@ -98,11 +142,11 @@
 					<span style="font-weight: bold; margin-right: 10px">发布时间: </span>
 					<span style="display: block">{{ releaseTime }}</span>
 				</div>
-				<div style="display: flex; flex-direction: column">
+				<!-- <div style="display: flex; flex-direction: column">
 					<span style="font-weight: bold; margin-right: 10px">课程介绍: </span>
 					<br />
 					<span style="display: block">{{ courseDescription }}</span>
-				</div>
+				</div> -->
 				<br />
 				<span>资源标签</span>
 				<div style="display: flex; width: 100%; flex-wrap: wrap">
@@ -116,10 +160,14 @@
 
 <script setup>
 	import { ref } from 'vue'
-	import { Tag, Typography, Space } from 'ant-design-vue'
+	// import PDF from 'vue-pdf'
+	import { Tag, Typography, Space, message } from 'ant-design-vue'
 	import ShareDialog from './ShareDialog.vue'
 	import { addViewCount, detail, add, cancel, queryList } from '@/api/portal'
 	import { useRoute } from 'vue-router'
+	import sysConfig from '@/config/index'
+	import pdf from '@/assets/images/pdf.png'
+
 	// const props = defineProps({
 	// 	itemData: {
 	// 		type: Object,
@@ -127,7 +175,9 @@
 	// 	}
 	// })
 	const itemData = ref({})
+	const starTag = ref(false)
 	const ShareDialogRef = ref(null)
+	const resSrc = ref('')
 	const resName = ref('资源名称')
 
 	const teacherName = ref('王某某')
@@ -138,28 +188,43 @@
 	const videoDuration = ref('59:34')
 	const videoSize = ref('598M')
 	const releaseTime = ref('2025-10-01 11:33:59')
-	const courseDescription = ref(
-		'“我们正步入一个数据或许比软件更重要的新时代。——Tim O’ Reilly” 运用数据是精准刻画事物、呈现发展规律的主要手段,分析数据展示规律,把思想变得更精细!——“弹指之间·享受创新”,通过4周学习,你将掌握利用Python语言表示、清洗、统计和展示数据的能力。'
-	)
+	// const courseDescription = ref(
+	// 	'“我们正步入一个数据或许比软件更重要的新时代。——Tim O’ Reilly” 运用数据是精准刻画事物、呈现发展规律的主要手段,分析数据展示规律,把思想变得更精细!——“弹指之间·享受创新”,通过4周学习,你将掌握利用Python语言表示、清洗、统计和展示数据的能力。'
+	// )
 	const tags = ref(['标签名称1', '标签名称2', '标签名称3', '标签名称4', '标签名称5'])
 	const route = useRoute()
 	const emit = defineEmits(['selectTab'])
 	const listUnpublishedView = ref(null)
-
+	const handleDownload = (src) => {
+		window.open(src)
+	}
 	const handlerShareDialog = () => {
 		console.log('打开分享弹窗')
 		ShareDialogRef.value.open(itemData.value)
 	}
-	const handlerCollection = () => {
+	const handlerCollection = async () => {
 		console.log('打开收藏', itemData.value)
-
-		add({ resourceId: itemData.value.id })
-			.then((res) => {
-				console.log('收藏成功')
-			})
-			.catch((err) => {
-				console.log(err)
-			})
+		const id = route.query.id
+		if (id != undefined && id != '') {
+			if (starTag.value == true) {
+				await cancel({ resourceId: id })
+				message.success('取消收藏')
+			} else {
+				await add({ resourceId: id })
+				message.success('收藏成功')
+			}
+			queryList({ resourceId: id })
+				.then((ress) => {
+					if (ress.data == true) {
+						starTag.value = true
+					} else {
+						starTag.value = false
+					}
+				})
+				.catch((err) => {
+					console.log(err)
+				})
+		}
 	}
 
 	const getList = () => {
@@ -174,8 +239,20 @@
 			.then((res) => {
 				if (res.code == 200) {
 					itemData.value = res.data
+					courseType.value = itemData.value.resourceTypeName
+					department.value = itemData.value.collegeAllIdName
+					teacherName.value = itemData.value.resourceCreaterUserName
+					resName.value = itemData.value.fileName
 
-					// VideoDetailsRef.value.setData(res.data)
+					videoFormat.value = itemData.value.suffix
+					releaseTime.value = itemData.value.uploadTime
+					videoSize.value = itemData.value.FILESIZE + 'b'
+
+					resSrc.value = sysConfig.FILE_URL + itemData.value.priviewFileUrl
+					// imagess.value = ''+itemData.value.coverImagePath
+					// imagess.value = 'http://192.168.1.245:10005/education/' + itemData.value.priviewFileUrl
+
+					// VideoDetailsRef.value.setData(res.sdata)
 				}
 			})
 			.catch((err) => {})
@@ -185,11 +262,17 @@
 		const id = route.query.id
 		if (id != undefined && id != '') {
 			queryList({ resourceId: id })
-				.then((res) => {})
+				.then((res) => {
+					if (res.data == true) {
+						starTag.value = true
+					} else {
+						starTag.value = false
+					}
+				})
 				.catch((err) => {
 					console.log(err)
 				})
-			getData({ id: item.id })
+			getData({ id: id })
 		}
 	})
 

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff