Commit d5fb7e49 by 前端

弹框

1 parent 182469a1
<template> <template>
<div <div class="mask" v-if="isShowDialog">
class="mask"
v-if="isShowDialog"
>
<div class="dialog-wrap"> <div class="dialog-wrap">
<div <div class="close" @click="closeHandle">
class="close"
@click="closeHandle"
>
<img src="@/assets/images/icon-close.png" /> <img src="@/assets/images/icon-close.png" />
</div> </div>
<div class="dialog"> <div class="dialog">
<div <div :class="['dialog-content', modeName]" :style="{ 'background-image': `url(${backgroundImageList[currentIndex]})` }">
:class="['dialog-content',modeName]"
:style="{'background-image': `url(${backgroundImageList[currentIndex]})`}"
>
<div class="dialog-title"> <div class="dialog-title">
{{titleList[currentIndex]}} {{ titleList[currentIndex] }}
</div> </div>
</div> </div>
</div> </div>
<div class="left_arrow"> <div class="left_arrow">
<div <div class="arrow_inner" @click="changeHandle(-1)">
class="arrow_inner" <img src="@/assets/images/arrow_left.png" class="img" />
@click="changeHandle(-1)" <img src="@/assets/images/arrow_circle.png" class="circle" />
>
<img
src="@/assets/images/arrow_left.png"
class="img"
/>
<img
src="@/assets/images/arrow_circle.png"
class="circle"
/>
</div> </div>
</div> </div>
<div class="right_arrow"> <div class="right_arrow">
<div <div class="arrow_inner" @click="changeHandle(1)">
class="arrow_inner" <img src="@/assets/images/arrow_right.png" class="img" />
@click="changeHandle(1)" <img src="@/assets/images/arrow_circle.png" class="circle" />
>
<img
src="@/assets/images/arrow_right.png"
class="img"
/>
<img
src="@/assets/images/arrow_circle.png"
class="circle"
/>
</div> </div>
</div> </div>
</div> </div>
...@@ -73,23 +46,28 @@ export default { ...@@ -73,23 +46,28 @@ export default {
default: () => [] default: () => []
} }
}, },
data () { data() {
return { return {
modeName: '' modeName: ''
} }
}, },
methods: { methods: {
closeHandle () { closeHandle() {
this.$emit('update:isShowDialog', false) this.$emit('update:isShowDialog', false)
}, },
changeHandle (val) { changeHandle(val) {
const { currentIndex, backgroundImageList } = this let { currentIndex, backgroundImageList } = this
if ((currentIndex == 0 && val == -1) || (currentIndex == backgroundImageList.length - 1 && val == 1)) return alert('无更多内容') if (currentIndex == 0 && val == -1) {
currentIndex = 4
}
if (currentIndex == backgroundImageList.length - 1 && val == 1) {
currentIndex = -1
}
this.modeName = val == -1 ? 'to-left' : 'to-right' this.modeName = val == -1 ? 'to-left' : 'to-right'
this.$emit('update:currentIndex', currentIndex + val) this.$emit('update:currentIndex', currentIndex + val)
setTimeout(()=>{ setTimeout(() => {
this.modeName = '' this.modeName = ''
},300) }, 300)
} }
} }
} }
......
...@@ -90,8 +90,7 @@ export default { ...@@ -90,8 +90,7 @@ export default {
height: 878px; height: 878px;
border: 4px solid rgba(18, 117, 248, 0.5); border: 4px solid rgba(18, 117, 248, 0.5);
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; margin: 20px calc((100vw - 1560px) / 2);
margin: 20px auto;
position: relative; position: relative;
.video-box { .video-box {
width: 100%; width: 100%;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!