|
@@ -13,36 +13,35 @@
|
|
|
<v-divider class="my-3"></v-divider>
|
|
|
<div>
|
|
|
<h4>公司相册</h4>
|
|
|
- <v-slide-group :show-arrows="true" class="mt-3 img-box">
|
|
|
- <!-- props.info.enterprise.albumList -->
|
|
|
- <v-slide-group-item v-for="val in list" :key="val">
|
|
|
- <v-img v-if="isImage(val)" class="mr-3" width="200" height="115" :src="val" cover rounded></v-img>
|
|
|
- <video v-else class="videos-radius" :src="val" controls height="118" width="200" preload="preload"></video>
|
|
|
+ <v-slide-group :show-arrows="true" class="mt-3 img-box cursor-pointer">
|
|
|
+ <v-slide-group-item v-for="(val, i) in props.info.enterprise.albumList" :key="val">
|
|
|
+ <v-img v-if="checkIsImage(val)" class="mr-3" width="200" height="115" :src="val" cover rounded @click="handleClick(i)"></v-img>
|
|
|
+ <video v-else class="videos-radius mr-3" :src="val" controls height="118" width="200" preload="preload" @click="handleClick(i)"></video>
|
|
|
</v-slide-group-item>
|
|
|
</v-slide-group>
|
|
|
</div>
|
|
|
+ <PreviewImg v-if="showPreview" :current="current" :list="props.info.enterprise.albumList" @close="showPreview = !showPreview"></PreviewImg>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
defineOptions({ name: 'enterprise-introduction'})
|
|
|
+import { checkIsImage } from '@/utils'
|
|
|
+import { ref } from 'vue'
|
|
|
+
|
|
|
const props = defineProps({
|
|
|
info: {
|
|
|
type: Object,
|
|
|
default: () => {}
|
|
|
}
|
|
|
})
|
|
|
-const list = [
|
|
|
- 'https://img.bosszhipin.com/beijin/upload/com/img/20190823/9ed988f78163bf3784fa162764d429124d4ba1fec2b1a061e4a46fb61ddab12d.jpg',
|
|
|
- 'https://img.bosszhipin.com/beijin/upload/com/img/20190823/f01c227906f5c15554d19904cf5009944d4ba1fec2b1a061e4a46fb61ddab12d.jpg',
|
|
|
- 'https://img.bosszhipin.com/beijin/upload/com/img/20190823/154f6a1bc139eea59bf2610c3115fc664d4ba1fec2b1a061e4a46fb61ddab12d.jpg',
|
|
|
- 'https://img.bosszhipin.com/beijin/upload/com/img/20190823/644c82121f1d19cb120c1e4c2836d1004d4ba1fec2b1a061e4a46fb61ddab12d.jpg',
|
|
|
- 'https://img.bosszhipin.com/beijin/upload/com/img/20190823/4b867202f288d6512dac50856bae61194d4ba1fec2b1a061e4a46fb61ddab12d.jpg'
|
|
|
-]
|
|
|
|
|
|
-const isImage = (url) => {
|
|
|
- var reg = /\.(png|jpg|gif|jpeg|webp)$/
|
|
|
- return reg.test(url)
|
|
|
+// 预览
|
|
|
+const showPreview = ref(false)
|
|
|
+const current = ref(0)
|
|
|
+const handleClick = (index) => {
|
|
|
+ showPreview.value = !showPreview.value
|
|
|
+ current.value = index
|
|
|
}
|
|
|
</script>
|
|
|
|