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
|
||||
|
||||
# api
|
||||
VITE_API_BASIC=https://api.hailin-keji.com
|
||||
#VITE_API_BASIC=http://10.10.1.6:8060
|
||||
#VITE_API_BASIC=https://api.hailin-keji.com
|
||||
VITE_API_BASIC=http://10.10.1.6:8060
|
||||
VITE_API_HTTP=/api/v1/
|
||||
# storage
|
||||
VITE_STORAGE_NAMESPACE = gin-admin_local_
|
||||
|
||||
@ -94,23 +94,23 @@
|
||||
</a-row>
|
||||
|
||||
<edit-dialog ref="editDialogRef" @ok="onOk"></edit-dialog>
|
||||
<!-- 移出表格,放在 template 最底部 -->
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
title="视频预览"
|
||||
width="60%"
|
||||
@close="handleClose"
|
||||
>
|
||||
<video
|
||||
v-if="currentVideoUrl"
|
||||
controls
|
||||
autoplay
|
||||
style="width: 100%"
|
||||
:src="config('http.apiBasic') + currentVideoUrl"
|
||||
></video>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<!-- 自定义视频预览弹窗 -->
|
||||
<div v-if="dialogVisible" class="video-modal-overlay" @click.self="handleClose">
|
||||
<div class="video-modal-content">
|
||||
<video
|
||||
v-if="currentVideoUrl"
|
||||
ref="previewVideoRef"
|
||||
:src="currentVideoUrl"
|
||||
controls
|
||||
autoplay
|
||||
class="video-modal-player"
|
||||
></video>
|
||||
<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>
|
||||
|
||||
@ -243,6 +243,7 @@ async function onOk() {
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const currentVideoUrl = ref('')
|
||||
const previewVideoRef = ref(null)
|
||||
|
||||
// 预览处理
|
||||
const handlePreview = (videoUrl) => {
|
||||
@ -256,9 +257,76 @@ const handlePreview = (videoUrl) => {
|
||||
|
||||
// 关闭处理
|
||||
const handleClose = () => {
|
||||
if (previewVideoRef.value) {
|
||||
previewVideoRef.value.pause()
|
||||
previewVideoRef.value.currentTime = 0
|
||||
}
|
||||
currentVideoUrl.value = ''
|
||||
dialogVisible.value = false
|
||||
}
|
||||
</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
|
||||
socialMedia.value = Array.isArray(res.data.socialMedia) ? res.data.socialMedia : []
|
||||
//console.log(affirm.value)
|
||||
console.log(id.value)
|
||||
console.log(res.data)
|
||||
console.log("web-Id:",id.value)
|
||||
console.log('webData',res.data)
|
||||
}
|
||||
} catch (e) {
|
||||
message.error('获取声明内容失败')
|
||||
@ -129,6 +129,8 @@ async function getPageList() {
|
||||
async function handleSearch() {
|
||||
try {
|
||||
showLoading()
|
||||
console.log("id.value:", id.value)
|
||||
|
||||
await apis.webSite.updateWebData(id.value, {
|
||||
affirm: affirm.value,
|
||||
reportContent: reportContent.value,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user