index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <div>
  3. <SldHomeTopSearch />
  4. <NavCatHeader />
  5. <div class="bottom_line"></div>
  6. <Home></Home>
  7. <OpenScreen
  8. @closeScreen="closeScreen"
  9. v-if="show_open_screen && openScreenData.data.show_switch"
  10. :openScreenData="openScreenData.data"
  11. ></OpenScreen>
  12. </div>
  13. </template>
  14. <script setup>
  15. const show_open_screen = ref(false);
  16. const openScreenData = reactive({ data: {} }); //开屏数据
  17. const getBaseInfo = async () => {
  18. const { data: value } = await useFetchRaw(
  19. apiUrl + "v3/system/front/setting/getSettings",
  20. {
  21. params: {
  22. names: "sys_seo_title,sys_seo_desc,sys_seo_keywords",
  23. },
  24. }
  25. );
  26. let res = value._rawValue;
  27. debugger;
  28. if (res.state == 200) {
  29. useHead({
  30. title: res.data[0],
  31. meta: [
  32. {
  33. name: "description",
  34. content: res.data[1],
  35. },
  36. {
  37. name: "keywords",
  38. content: res.data[2],
  39. },
  40. ],
  41. });
  42. }
  43. };
  44. getBaseInfo();
  45. const getAdv = () => {
  46. get("v3/system/front/deco/firstAdv").then((res) => {
  47. if (res.state == 200) {
  48. openScreenData.data = JSON.parse(res.data.data.replace(/&quot;/g, '"'));
  49. show_open_screen.value = true;
  50. }
  51. });
  52. };
  53. getAdv();
  54. const closeScreen = () => {
  55. show_open_screen.value = false;
  56. document.body.style.overflow = "";
  57. };
  58. onMounted(() => {
  59. setTimeout(() => {
  60. sldStatEvent({
  61. behaviorType: "pv",
  62. pageUrl: defaultUrl,
  63. referrerPageUrl: apiUrl,
  64. });
  65. }, 3000);
  66. });
  67. </script>
  68. <style lang="scss">
  69. .bottom_line {
  70. width: 100%;
  71. height: 2px;
  72. background: $colorMain;
  73. margin-top: -2px;
  74. }
  75. .home_adv_con {
  76. overflow: hidden;
  77. height: 80px;
  78. position: relative;
  79. margin: 0 auto;
  80. }
  81. .home_adv {
  82. width: 1920px;
  83. height: 80px;
  84. background-position: center center;
  85. background-size: cover;
  86. background-repeat: no-repeat;
  87. position: absolute;
  88. left: 50%;
  89. top: 0;
  90. margin-left: -960px;
  91. }
  92. .adv1200 {
  93. width: 1200px;
  94. height: 80px;
  95. margin: 0 auto;
  96. position: relative;
  97. }
  98. .close1 {
  99. top: 10px;
  100. right: 10px;
  101. z-index: 2;
  102. position: absolute;
  103. background: rgba(0, 0, 0, 0.5);
  104. width: 22px;
  105. height: 22px;
  106. line-height: 22px;
  107. color: #fff;
  108. cursor: pointer;
  109. text-align: center;
  110. font-size: 17px;
  111. /*font-family: cursive;*/
  112. }
  113. </style>