openScreen.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <!--
  2. * @Author: wangwei
  3. * @Date: 2021-01-09 10:28:06
  4. * @LastEditTime: 2021-02-01 .gitignore:17:01
  5. * @LastEditors: Please set LastEditors
  6. * @Description: 首页开屏图
  7. * @FilePath: /java-pc/src/components/OpenScreen.vue
  8. -->
  9. <template>
  10. <div class="sld_open_screen">
  11. <div class="image">
  12. <img
  13. class="pointer"
  14. :src="openScreenData.imgUrl"
  15. @click="diyNavTo(openScreenData)"
  16. alt=""
  17. />
  18. <img @click="close" class="close" :src="close_layer_icon" alt="" />
  19. </div>
  20. </div>
  21. </template>
  22. <script setup>
  23. import { getCurrentInstance, ref } from "vue";
  24. const props = defineProps({
  25. openScreenData: Object, //装修的数据
  26. });
  27. const emit = defineEmits(['closeScreen'])
  28. const { proxy } = getCurrentInstance();
  29. const close_layer_icon = ref("/coupon/close_layer_icon.png");
  30. const close = () => {
  31. emit("closeScreen");
  32. };
  33. const diyNavTo = (val) => {
  34. diyNavToFun(val);
  35. };
  36. </script>
  37. <style lang="scss" scoped>
  38. .sld_open_screen {
  39. position: fixed;
  40. background: rgba(0, 0, 0, 0.4);
  41. width: 100%;
  42. height: 100%;
  43. left: 0;
  44. top: 0;
  45. right: 0;
  46. z-index: 1000;
  47. text-align: center;
  48. display: flex;
  49. align-items: center;
  50. justify-content: center;
  51. .image {
  52. width: 680px;
  53. height: 420px;
  54. position: relative;
  55. display: flex;
  56. align-items: center;
  57. justify-content: center;
  58. img {
  59. max-width: 100%;
  60. max-height: 100%;
  61. }
  62. }
  63. .close {
  64. position: absolute;
  65. width: 28px;
  66. height: 28px;
  67. top: 10px;
  68. right: 40px;
  69. z-index: 2;
  70. cursor: pointer;
  71. }
  72. }
  73. </style>