s-hotzone-block.vue 910 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <!-- 装修图文组件:热区 -->
  2. <template>
  3. <view class="hotzone-wrap">
  4. <image :src="sheep.$url.cdn(data.imgUrl)" style="width: 100%" mode="widthFix"></image>
  5. <view
  6. class="hotzone-box"
  7. v-for="(item, index) in data.list"
  8. :key="index"
  9. :style="[
  10. {
  11. top: `${item.top}px`,
  12. left: `${item.left}px`,
  13. width: `${item.width}px`,
  14. height: `${item.height}px`,
  15. },
  16. ]"
  17. @tap.stop="sheep.$router.go(item.url)"
  18. >
  19. </view>
  20. </view>
  21. </template>
  22. <script setup>
  23. import sheep from '@/sheep';
  24. // 接收参数
  25. const props = defineProps({
  26. data: {
  27. type: Object,
  28. default: () => ({}),
  29. },
  30. styles: {
  31. type: Object,
  32. default: () => ({}),
  33. },
  34. });
  35. </script>
  36. <style lang="scss" scoped>
  37. .hotzone-wrap {
  38. position: relative;
  39. }
  40. .hotzone-box {
  41. position: absolute;
  42. }
  43. </style>