hotspot.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <view class="w-full" :style="[hotspotWrapStyle]">
  3. <view class="hotspot">
  4. <image :src="dataConfig.picStyle.url" mode="widthFix" class="image" :style="[imageRadius]"></image>
  5. <view
  6. v-for="(item, index) in dataConfig.picStyle.list"
  7. :key="item.number"
  8. :style="{
  9. top: `${item.starY / 2}px`,
  10. left: `${item.starX / 2}px`,
  11. width: `${item.areaWidth / 2}px`,
  12. height: `${item.areaHeight / 2}px`
  13. }"
  14. class="area"
  15. @click="goPage(item.link)"
  16. ></view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. props: {
  23. dataConfig: {
  24. type: Object,
  25. default: () => {}
  26. },
  27. isSortType: {
  28. type: String | Number,
  29. default: 0
  30. }
  31. },
  32. data() {
  33. return {};
  34. },
  35. computed: {
  36. imageRadius() {
  37. // let borderRadius = `${this.dataConfig.fillet.val * 2}rpx`;
  38. // if (this.dataConfig.fillet.type) {
  39. // borderRadius =
  40. // `${this.dataConfig.fillet.valList[0].val * 2}rpx ${this.dataConfig.fillet.valList[1].val * 2}rpx ${this.dataConfig.fillet.valList[2].val * 2}rpx ${this.dataConfig.fillet.valList[3].val * 2}rpx`;
  41. // }
  42. // return {
  43. // 'border-radius': borderRadius,
  44. // };
  45. },
  46. hotspotWrapStyle() {
  47. // let windowWidth = uni.getSystemInfoSync().windowWidth;
  48. // let boxWidth = windowWidth * 2 - this.dataConfig.prConfig.val * 2;
  49. return {
  50. 'margin-top': `${this.dataConfig.mbConfig.val}rpx`
  51. };
  52. }
  53. },
  54. methods: {
  55. goPage(link) {
  56. this.$util.JumpPath(link);
  57. }
  58. }
  59. };
  60. </script>
  61. <style lang="scss" scoped>
  62. .hotspot {
  63. position: relative;
  64. width: 100%;
  65. .image {
  66. display: block;
  67. width: 100%;
  68. }
  69. .area {
  70. position: absolute;
  71. }
  72. }
  73. </style>