123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- <template>
- <RightFillPano>
- <template #header>
- <div class="tabs" :class="{ disabled: isEdit }">
- <span
- v-for="tab in tabs"
- :key="tab.key"
- :class="{ active: tab.key === current }"
- @click="current = tab.key"
- >
- {{ tab.text }}
- </span>
- </div>
- </template>
- <GuideEdit v-if="current === 'guide'" ref="quiskObj" />
- <PathEdit v-if="current === 'path'" ref="quiskObj" />
- </RightFillPano>
- <Teleport to=".laser-layer">
- <div class="quisks" v-if="!isEdit && !currentIsFullView">
- <div class="quisk-item fun-ctrl" @click="quiskAdd('guide')">
- <ui-icon type="a-guide_s" />
- <span>导览</span>
- </div>
- <div class="quisk-item fun-ctrl" @click="quiskAdd('animation')">
- <ui-icon type="a-animation_s" />
- <span>动画</span>
- </div>
- <div class="quisk-item fun-ctrl" @click="quiskAdd('path')">
- <ui-icon type="a-path_s" />
- <span>路线</span>
- </div>
- </div>
- </Teleport>
- </template>
- <script lang="ts" setup>
- import { RightFillPano } from "@/layout";
- import GuideEdit from "./guide/edit.vue";
- import PathEdit from "./path/edit.vue";
- import { nextTick, reactive, ref, watchEffect } from "vue";
- import { guides, isEdit, paths } from "@/store";
- import router from "@/router";
- import { currentIsFullView } from "@/utils/full";
- import { SDK, sdk as _sdk } from "@/sdk";
- const current = ref("path");
- const tabs = reactive([
- { key: "path", text: "路线()" },
- { key: "guide", text: "导览()" },
- ]);
- watchEffect(() => {
- tabs[1].text = `导览(${guides.value.length})`;
- tabs[0].text = `路线(${paths.value.length})`;
- });
- const quiskObj = ref<any>();
- const quiskAdd = async (key: string) => {
- if (key === "animation") {
- router.push({ name: key });
- } else {
- current.value = key;
- await nextTick();
- quiskObj.value.add();
- }
- };
- </script>
- <style lang="scss" scoped>
- .tabs {
- height: 60px;
- border-bottom: 1px solid rgba(255, 255, 255, 0.16);
- display: flex;
- margin: -20px;
- margin-bottom: 20px;
- > span {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: center;
- position: relative;
- transition: color 0.3s ease;
- cursor: pointer;
- font-size: 16px;
- &::after {
- content: "";
- transition: height 0.3s ease;
- position: absolute;
- background-color: #00c8af;
- left: 0;
- right: 0;
- bottom: 0;
- height: 0;
- }
- &:hover,
- &.active {
- color: #00c8af;
- }
- &.active::after {
- height: 3px;
- }
- }
- }
- .quisks {
- position: absolute;
- bottom: 20px;
- left: 50%;
- transform: translateX(-50%);
- display: flex;
- align-items: center;
- .quisk-item {
- width: 80px;
- height: 80px;
- border-radius: 10px;
- background: rgba(27, 27, 28, 0.8);
- color: #ffffff;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- &:not(:last-child) {
- margin-right: 20px;
- }
- span {
- margin-top: 6px;
- font-size: 14px;
- }
- .icon {
- font-size: 22px;
- }
- }
- }
- </style>
|