index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. if (res.state == 200) {
  28. useHead({
  29. title: res.data[0],
  30. meta: [
  31. {
  32. name: "description",
  33. content: res.data[1],
  34. },
  35. {
  36. name: "keywords",
  37. content: res.data[2],
  38. },
  39. ],
  40. });
  41. }
  42. };
  43. getBaseInfo();
  44. const getAdv = () => {
  45. get("v3/system/front/deco/firstAdv").then((res) => {
  46. if (res.state == 200) {
  47. openScreenData.data = JSON.parse(res.data.data.replace(/&quot;/g, '"'));
  48. show_open_screen.value = true;
  49. }
  50. });
  51. };
  52. getAdv();
  53. const closeScreen = () => {
  54. show_open_screen.value = false;
  55. document.body.style.overflow = "";
  56. };
  57. onMounted(() => {
  58. setTimeout(() => {
  59. sldStatEvent({
  60. behaviorType: "pv",
  61. pageUrl: defaultUrl,
  62. referrerPageUrl: apiUrl,
  63. });
  64. }, 3000);
  65. });
  66. </script>
  67. <style lang="scss">
  68. .bottom_line {
  69. width: 100%;
  70. height: 2px;
  71. background: $colorMain;
  72. margin-top: -2px;
  73. }
  74. .home_adv_con {
  75. overflow: hidden;
  76. height: 80px;
  77. position: relative;
  78. margin: 0 auto;
  79. }
  80. .home_adv {
  81. width: 1920px;
  82. height: 80px;
  83. background-position: center center;
  84. background-size: cover;
  85. background-repeat: no-repeat;
  86. position: absolute;
  87. left: 50%;
  88. top: 0;
  89. margin-left: -960px;
  90. }
  91. .adv1200 {
  92. width: 1200px;
  93. height: 80px;
  94. margin: 0 auto;
  95. position: relative;
  96. }
  97. .close1 {
  98. top: 10px;
  99. right: 10px;
  100. z-index: 2;
  101. position: absolute;
  102. background: rgba(0, 0, 0, 0.5);
  103. width: 22px;
  104. height: 22px;
  105. line-height: 22px;
  106. color: #fff;
  107. cursor: pointer;
  108. text-align: center;
  109. font-size: 17px;
  110. /*font-family: cursive;*/
  111. }
  112. </style>