123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <template>
- <div>
- <SldHomeTopSearch />
- <NavCatHeader />
- <div class="bottom_line"></div>
- <Home></Home>
- <OpenScreen
- @closeScreen="closeScreen"
- v-if="show_open_screen && openScreenData.data.show_switch"
- :openScreenData="openScreenData.data"
- ></OpenScreen>
- </div>
- </template>
- <script setup>
- const show_open_screen = ref(false);
- const openScreenData = reactive({ data: {} }); //开屏数据
- const getBaseInfo = async () => {
- const { data: value } = await useFetchRaw(
- apiUrl + "v3/system/front/setting/getSettings",
- {
- params: {
- names: "sys_seo_title,sys_seo_desc,sys_seo_keywords",
- },
- }
- );
- let res = value._rawValue;
- if (res.state == 200) {
- useHead({
- title: res.data[0],
- meta: [
- {
- name: "description",
- content: res.data[1],
- },
- {
- name: "keywords",
- content: res.data[2],
- },
- ],
- });
- }
- };
- getBaseInfo();
- const getAdv = () => {
- get("v3/system/front/deco/firstAdv").then((res) => {
- if (res.state == 200) {
- openScreenData.data = JSON.parse(res.data.data.replace(/"/g, '"'));
- show_open_screen.value = true;
- }
- });
- };
- getAdv();
- const closeScreen = () => {
- show_open_screen.value = false;
- document.body.style.overflow = "";
- };
- onMounted(() => {
- setTimeout(() => {
- sldStatEvent({
- behaviorType: "pv",
- pageUrl: defaultUrl,
- referrerPageUrl: apiUrl,
- });
- }, 3000);
- });
- </script>
- <style lang="scss">
- .bottom_line {
- width: 100%;
- height: 2px;
- background: $colorMain;
- margin-top: -2px;
- }
- .home_adv_con {
- overflow: hidden;
- height: 80px;
- position: relative;
- margin: 0 auto;
- }
- .home_adv {
- width: 1920px;
- height: 80px;
- background-position: center center;
- background-size: cover;
- background-repeat: no-repeat;
- position: absolute;
- left: 50%;
- top: 0;
- margin-left: -960px;
- }
- .adv1200 {
- width: 1200px;
- height: 80px;
- margin: 0 auto;
- position: relative;
- }
- .close1 {
- top: 10px;
- right: 10px;
- z-index: 2;
- position: absolute;
- background: rgba(0, 0, 0, 0.5);
- width: 22px;
- height: 22px;
- line-height: 22px;
- color: #fff;
- cursor: pointer;
- text-align: center;
- font-size: 17px;
- /*font-family: cursive;*/
- }
- </style>
|