Przeglądaj źródła

公司信息展示-企业相册

lifanagju_citu 11 miesięcy temu
rodzic
commit
31baa2076d

+ 40 - 0
src/views/enterprise/enterpriseCenter/components/video.vue

@@ -0,0 +1,40 @@
+<!-- 企业视频 -->
+<template>
+  <div class="box">
+    <div class="box-item" v-for="(val, i) in props.info.enterprise?.albumList" :key="val">
+      <v-img v-if="checkIsImage(val)" width="205" height="115" :src="val" cover rounded @click="handleClick(i)"></v-img>
+      <video v-else class="videos-radius" :src="val" controls height="118" width="200" preload="preload" @click="handleClick(i)"></video>
+    </div>
+  </div>
+  <PreviewImg v-if="showPreview" :current="current" :list="props.info.enterprise?.albumList" @close="showPreview = !showPreview"></PreviewImg>
+</template>
+
+<script setup>
+import { checkIsImage } from '@/utils'
+import { ref } from 'vue'
+defineOptions({name: 'enterprise-enterpriseCenter-video'})
+
+const props = defineProps({
+  info: {
+    type: Object,
+    default: () => {}
+  }
+})
+
+// 预览
+const showPreview = ref(false)
+const current = ref(0)
+const handleClick = (index) => {
+  showPreview.value = !showPreview.value
+  current.value = index
+}
+</script>
+<style lang="scss" scoped>
+.box {
+  display: flex;
+  flex-wrap: wrap;
+  .box-item {
+    margin: 0 12px 12px 0;
+  }
+}
+</style>