<template>
  <div>
    <h4>公司简介</h4>
    <div class="requirement" v-html="props.info.enterprise.introduce.replace(/\n/g, '</br>')"></div>
    <v-divider class="my-3"></v-divider>
    <div>
      <h4>公司地址</h4>
      <div class="mt-1">
        <v-icon size="25" color="primary">mdi-map-marker</v-icon>
        <span style="color: #666;font-size: 15px;">{{ props.info.business.address }}</span>
      </div>
    </div>
    <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-item>
      </v-slide-group>
    </div>
  </div>
</template>

<script setup>
defineOptions({ name: 'enterprise-introduction'})
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',
  'https://zhipin-company-1251955568.file.myqcloud.com/zhipin-company/99/20240411/fp0316a40013_f2abd6bc44254064931620a9a1dbdf21-OSS11.30.go15.fmHblack.mp4?sign=8bbdf46fa8ec4f97a742edf59e559379&t=1716168952'
]

const isImage = (url) => {
  var reg = /\.(png|jpg|gif|jpeg|webp)$/
  return reg.test(url)
}
</script>

<style scoped lang="scss">
.requirement {
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 28px;
  color: #333;
  font-size: 15px;
  text-align: justify;
  letter-spacing: 0;
}
.videos-radius {
  border-radius: 8px;
}
</style>
