default.vue 810 B

123456789101112131415161718192021222324252627282930313233
  1. <template>
  2. <div>
  3. <div class="home_adv_con" v-show="advTop.show_switch&&router.currentRoute.value.fullPath=='/'">
  4. <div class="home_adv" :style="{backgroundImage:'url('+advTop.imgUrl+')'}" @click="navTo">
  5. <div class="adv1200">
  6. <div class="close1" @click.stop="advTop.show_switch = false">×</div>
  7. </div>
  8. </div>
  9. </div>
  10. <NavTopBar/>
  11. <slot/>
  12. <FooterBottom/>
  13. </div>
  14. </template>
  15. <script setup>
  16. const router = useRouter()
  17. const advTop = ref({})
  18. const getAdv = () => {
  19. get("v3/system/front/deco/firstAdv",{
  20. type: 2
  21. }).then((res) => {
  22. if (res.state == 200) {
  23. advTop.value = JSON.parse(res.data.data.replace(/&quot;/g, "\""))
  24. }
  25. });
  26. };
  27. getAdv()
  28. </script>