index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <script setup lang="ts">
  2. import left_top_logo from '@/static/image/shouye/lt_logo.png'
  3. import Rectangle from '@/static/image/shouye/Rectangle.png'
  4. import ToolFun from '@/utils/index'
  5. const titleName = ref<string>('首页')
  6. const safeHeight = ToolFun.getSafeHeight()
  7. const videoSrc = ref(
  8. 'https://test-cos-1308655658.cos.ap-shanghai.myqcloud.com/bright-intro-video.mp4',
  9. )
  10. </script>
  11. <template>
  12. <TitleBar :title-name="titleName" />
  13. <view
  14. class="flex flex-col bg-[#F5F6F7] overflow-y-auto"
  15. :style="`height: calc(100vh - ${safeHeight}px)`"
  16. >
  17. <view class="container">
  18. <video
  19. class="absolute top-0 left-0 w-screen h-screen"
  20. :src="videoSrc"
  21. autoplay
  22. loop
  23. object-fit="cover"
  24. muted
  25. :controls="false"
  26. />
  27. <view class="content absolute box-border top-0 left-0 w-full h-full p-[23px]">
  28. <image :src="left_top_logo" class="left-3 w-48 h-6" />
  29. <view
  30. class="content_text flex justify-between flex-col w-full h-full items-center "
  31. >
  32. <view
  33. class="flex justify-center flex-col text-[29px] w-full items-center mt-[100px]
  34. tracking-[5.45px] text-[#FFF] leading-[37px]"
  35. >
  36. <view>为你的爱宠建档</view>
  37. <view>制定专业喂养方案</view>
  38. <view class="mt-[15px] text-[12px] text-center font-normal tracking-[1.45px] leading-[16px]">
  39. 科学喂养专业有爱
  40. </view>
  41. </view>
  42. <view class="flex justify-center flex-col w-full items-center h-full mt-[200px] text-[#FFF]">
  43. <view
  44. class="content_botton flex w-[176px] h-[47px] justify-center
  45. items-center bg-[#4545E5] rounded-[69px]"
  46. >
  47. <button
  48. class=" text-[18px] font-normal
  49. tracking-[.36px] leading-[37px] shrink-0" hover-class="bg-[#4545E5]"
  50. >
  51. 开始建档
  52. </button>
  53. </view>
  54. <view class="content_details tracking-[1.8px] mt-[40px] text-[12px] font-normal ">
  55. 下拉了解详情
  56. </view>
  57. <view class="content_img mt-[15px]">
  58. <image :src="Rectangle" class="w-[15px] h-[8.485px] shrink-0 stroke-[2px] fill-white stroke-white" />
  59. <image :src="Rectangle" class="w-[15px] h-[8.485px] shrink-0 stroke-[2px] fill-white stroke-white" />
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </template>
  67. <style lang="sass" scoped>
  68. .container
  69. position: relative
  70. width: 100%
  71. height: 650px /* 根据需要设置视频容器的高度 */
  72. /* display: flex; */
  73. overflow: hidden
  74. padding-top: calc(100% / (16 / 9)) /* 视频宽高比 */
  75. .video-player
  76. position: absolute
  77. top: 0
  78. left: 0
  79. width: 100%
  80. height: 100%
  81. controlslist: none
  82. aspect-ratio: 16 / 9
  83. object-fit: cover
  84. </style>