generated from Leo_Ding/web-template
修改视频部分内容
This commit is contained in:
parent
0504a726ae
commit
def686b838
4
.env.dev
4
.env.dev
@ -12,8 +12,8 @@ VITE_ROUTER_BASE=/
|
|||||||
VITE_ROUTER_HISTORY=hash
|
VITE_ROUTER_HISTORY=hash
|
||||||
|
|
||||||
# api
|
# api
|
||||||
VITE_API_BASIC=https://api.hailin-keji.com
|
#VITE_API_BASIC=https://api.hailin-keji.com
|
||||||
#VITE_API_BASIC=http://10.10.1.6:8060
|
VITE_API_BASIC=http://10.10.1.6:8060
|
||||||
VITE_API_HTTP=/api/v1/
|
VITE_API_HTTP=/api/v1/
|
||||||
# storage
|
# storage
|
||||||
VITE_STORAGE_NAMESPACE = gin-admin_local_
|
VITE_STORAGE_NAMESPACE = gin-admin_local_
|
||||||
|
|||||||
@ -94,23 +94,23 @@
|
|||||||
</a-row>
|
</a-row>
|
||||||
|
|
||||||
<edit-dialog ref="editDialogRef" @ok="onOk"></edit-dialog>
|
<edit-dialog ref="editDialogRef" @ok="onOk"></edit-dialog>
|
||||||
<!-- 移出表格,放在 template 最底部 -->
|
<!-- 自定义视频预览弹窗 -->
|
||||||
<el-dialog
|
<div v-if="dialogVisible" class="video-modal-overlay" @click.self="handleClose">
|
||||||
v-model="dialogVisible"
|
<div class="video-modal-content">
|
||||||
title="视频预览"
|
|
||||||
width="60%"
|
|
||||||
@close="handleClose"
|
|
||||||
>
|
|
||||||
<video
|
<video
|
||||||
v-if="currentVideoUrl"
|
v-if="currentVideoUrl"
|
||||||
|
ref="previewVideoRef"
|
||||||
|
:src="currentVideoUrl"
|
||||||
controls
|
controls
|
||||||
autoplay
|
autoplay
|
||||||
style="width: 100%"
|
class="video-modal-player"
|
||||||
:src="config('http.apiBasic') + currentVideoUrl"
|
|
||||||
></video>
|
></video>
|
||||||
</el-dialog>
|
<button class="video-modal-close" @click="handleClose">×</button>
|
||||||
|
<div class="video-modal-footer">
|
||||||
|
<button @click="handleClose" class="video-modal-cancel-btn">取消预览</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -243,6 +243,7 @@ async function onOk() {
|
|||||||
|
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const currentVideoUrl = ref('')
|
const currentVideoUrl = ref('')
|
||||||
|
const previewVideoRef = ref(null)
|
||||||
|
|
||||||
// 预览处理
|
// 预览处理
|
||||||
const handlePreview = (videoUrl) => {
|
const handlePreview = (videoUrl) => {
|
||||||
@ -256,9 +257,76 @@ const handlePreview = (videoUrl) => {
|
|||||||
|
|
||||||
// 关闭处理
|
// 关闭处理
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
|
if (previewVideoRef.value) {
|
||||||
|
previewVideoRef.value.pause()
|
||||||
|
previewVideoRef.value.currentTime = 0
|
||||||
|
}
|
||||||
currentVideoUrl.value = ''
|
currentVideoUrl.value = ''
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped></style>
|
<style lang="less" scoped>
|
||||||
|
.video-modal-overlay {
|
||||||
|
position: fixed;
|
||||||
|
z-index: 2000;
|
||||||
|
left: 0; top: 0; right: 0; bottom: 0;
|
||||||
|
background: rgba(0,0,0,0.6);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.video-modal-content {
|
||||||
|
position: relative;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 40px 40px 56px 24px;
|
||||||
|
box-shadow: 0 8px 40px rgba(0,0,0,0.25);
|
||||||
|
min-width: 320px;
|
||||||
|
max-width: 90vw;
|
||||||
|
max-height: 80vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.video-modal-player {
|
||||||
|
width: 60vw;
|
||||||
|
max-width: 800px;
|
||||||
|
max-height: 60vh;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #000;
|
||||||
|
}
|
||||||
|
.video-modal-close {
|
||||||
|
position: absolute;
|
||||||
|
right: 16px;
|
||||||
|
top: 12px;
|
||||||
|
font-size: 28px;
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
color: #888;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: color 0.2s;
|
||||||
|
}
|
||||||
|
.video-modal-close:hover {
|
||||||
|
color: #f56c6c;
|
||||||
|
}
|
||||||
|
.video-modal-footer {
|
||||||
|
position: absolute;
|
||||||
|
left: 0; right: 0; bottom: 12px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.video-modal-cancel-btn {
|
||||||
|
padding: 6px 24px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: #f5f5f5;
|
||||||
|
color: #333;
|
||||||
|
font-size: 16px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background 0.2s;
|
||||||
|
}
|
||||||
|
.video-modal-cancel-btn:hover {
|
||||||
|
background: #e6e6e6;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@ -114,8 +114,8 @@ async function getPageList() {
|
|||||||
reportNum.value = res.data.reportNum
|
reportNum.value = res.data.reportNum
|
||||||
socialMedia.value = Array.isArray(res.data.socialMedia) ? res.data.socialMedia : []
|
socialMedia.value = Array.isArray(res.data.socialMedia) ? res.data.socialMedia : []
|
||||||
//console.log(affirm.value)
|
//console.log(affirm.value)
|
||||||
console.log(id.value)
|
console.log("web-Id:",id.value)
|
||||||
console.log(res.data)
|
console.log('webData',res.data)
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
message.error('获取声明内容失败')
|
message.error('获取声明内容失败')
|
||||||
@ -129,6 +129,8 @@ async function getPageList() {
|
|||||||
async function handleSearch() {
|
async function handleSearch() {
|
||||||
try {
|
try {
|
||||||
showLoading()
|
showLoading()
|
||||||
|
console.log("id.value:", id.value)
|
||||||
|
|
||||||
await apis.webSite.updateWebData(id.value, {
|
await apis.webSite.updateWebData(id.value, {
|
||||||
affirm: affirm.value,
|
affirm: affirm.value,
|
||||||
reportContent: reportContent.value,
|
reportContent: reportContent.value,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user