Pārlūkot izejas kodu

课程详情跳转论坛纠错添加

canghailong 7 mēneši atpakaļ
vecāks
revīzija
805def8af5

+ 7 - 4
src/views/forum/addForum.vue

@@ -35,7 +35,7 @@
 					</a-col>
 					<a-col :span="24">
 						<a-form-item label="内容:" name="postContent">
-							<xn-editor v-model="formData.postContent" placeholder="请输入内容" :height="400"></xn-editor>
+							<xn-editor v-model="formData.postContent" placeholder="请输入内容" :height="600"></xn-editor>
 						</a-form-item>
 					</a-col>
 				</a-row>
@@ -56,6 +56,7 @@
 	import XnEditor from '@/components/Editor/index.vue'
 	import Bowser from 'bowser'
 	import { useRoute, useRouter } from 'vue-router'
+	import sysConfig from '@/config/index'
 	const route = useRoute()
 	const router = useRouter()
 	const { proxy } = getCurrentInstance()
@@ -77,8 +78,7 @@
 		return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
 	}
 
-	// 打开抽屉
-	const onOpen = () => {
+	const getData = () => {
 		forumApi.forumTypeList().then((data) => {
 			typeOptions.value = data.map((r) => {
 				return {
@@ -105,7 +105,7 @@
 		}
 	}
 	setTimeout(() => {
-		onOpen()
+		getData()
 	}, 0)
 	// 关闭抽屉
 	const onClose = () => {
@@ -180,5 +180,8 @@
 				resourceId: route.query.id
 			}
 		}
+		let videoUrl = decodeURIComponent(atob(route.query.videoUrl))
+		let html = `<p>${route.query.title}</p><video controls name="media" style="width:100%; height: auto;"><source src="${videoUrl}"></video>`
+		formData.value.postContent = html
 	}
 </script>

+ 28 - 1
src/views/student/classCentre/index.vue

@@ -96,6 +96,11 @@
 						</a-tabs>
 					</a-card>
 				</div>
+				<div class="redressBox" @click="jumpRedressUrl">
+					<a-tooltip title="纠错" :getPopupContainer="(trigger) => trigger.parentElement">
+						<SnippetsOutlined style="font-size: 40px" />
+					</a-tooltip>
+				</div>
 			</a-layout-content>
 		</a-layout>
 	</a-layout>
@@ -180,7 +185,7 @@
 		}
 		return item
 	})
-	const videoUrl = ''
+	const videoUrl = ref('')
 	const newsschedule = ref(0)
 	const currTime = ref(null)
 	const maxTime = ref(0)
@@ -277,6 +282,18 @@
 		}
 		return s
 	}
+	const jumpRedressUrl = () => {
+		let item = findNodeByKey(classTimeList.value, selectedKeys.value[0])
+		router.push({
+			path: '/forum/addForum',
+			query: {
+				postType:2,
+				id:selectedKeys.value[0],
+				videoUrl:btoa(encodeURIComponent(videoRef.value.src)),
+				title:item.name
+			}
+		})
+	}
 </script>
 <style scoped lang="less">
 	.classTitle {
@@ -292,4 +309,14 @@
 		display: flex;
 		justify-content: space-between;
 	}
+	.redressBox {
+		position: fixed;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		right: 20px;
+		bottom: 200px;
+		color: #ff4d4f;
+		cursor: pointer;
+	}
 </style>