123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395 |
- <template>
- <Panel v-show="player.showWidgets">
- <div class="menu color">
- <div class="logo">
- <img :src="require('@/assets/images/icon/logo.png')" alt="" />
- <p>cdf澳门上葡京</p>
- </div>
- <div class="vline"></div>
- <ul>
- <li v-if="tours.length > 0">
- <ui-icon type="preview" @click.stop="playTour"></ui-icon>
- <div>導覽</div>
- </li>
- <li v-for="(item, i) in menulist" :key="i">
- <ui-icon :type="item.icon"></ui-icon>
- <div>{{ item.name }}</div>
- </li>
- </ul>
- </div>
- <div class="toolbar color">
- <div class="navigation">
- <div class="h3">專櫃導航</div>
- <div class="swiper-container" id="sw-navigation">
- <ul class="swiper-wrapper">
- <li class="swiper-slide" @click.stop="onClickShop(item)" v-for="(item, i) in brandlist" :key="i">
- <img :src="item.shopLogo" alt="" />
- <div>{{ item.shopName }}</div>
- </li>
- </ul>
- </div>
- </div>
- <div class="category">
- <div class="swiper-container" id="sw-category">
- <ul class="swiper-wrapper">
- <li
- class="swiper-slide"
- :class="{ categoryactive: '' == currentCategory.id }"
- @click.stop="
- onClickCategory({
- id: '',
- categoryName: '全部',
- })
- "
- >
- <div>全部</div>
- </li>
- <li
- @click.stop="onClickCategory(item)"
- :class="{ categoryactive: item.id == currentCategory.id }"
- class="swiper-slide"
- v-for="(item, i) in categorylist"
- :key="i"
- >
- <div>{{ item.categoryName }}</div>
- </li>
- </ul>
- </div>
- </div>
- </div>
- </Panel>
- </template>
- <script setup>
- import { useStore } from "vuex";
- import { onMounted, watch, computed, reactive, ref, nextTick } from "vue";
- import Panel from "@/views/Panel.vue";
- import { useApp, getApp } from "@/app";
- import * as apis from "@/apis/index.js";
- const store = useStore();
- const currentCategory = ref({
- id: "",
- categoryName: "全部",
- });
- const isPlay = computed(() => {
- let status = store.getters["tour/isPlay"];
- let map = document.querySelector(".kankan-app div[xui_min_map]");
- if (map) {
- if (status) {
- map.classList.add("disabled");
- } else {
- map.classList.remove("disabled");
- }
- }
- return status;
- });
- const partId = computed(() => store.getters["tour/partId"]);
- const playTour = async () => {
- let player = await getApp().TourManager.player;
- if (isPlay.value) {
- store.commit("tour/setData", { isPlay: true });
- player.pause();
- } else {
- store.commit("tour/setData", { isPlay: true });
- player.play(partId.value);
- }
- };
- const metadata = computed(() => store.getters["scene/metadata"]);
- const player = computed(() => store.getters["player"]);
- const tours = computed(() => store.getters["tour/tours"]);
- const menulist = ref([
- {
- icon: "customer_service",
- name: "客服",
- },
- {
- icon: "guided_shopping",
- name: "导购",
- },
- {
- icon: "shopping",
- name: "购物",
- },
- ]);
- const categorylist = ref([]);
- const brandlist = ref([
- {
- img: "show_3d_normal",
- name: "GAP 盖璞",
- },
- {
- img: "show_3d_normal",
- name: "MOOST·理MOOST·理MOOST·理MOOST·理MOOST·理",
- },
- {
- img: "show_3d_normal",
- name: "H&M",
- },
- {
- img: "show_3d_normal",
- name: "GAP 盖璞",
- },
- {
- img: "show_3d_normal",
- name: "MOOST·理",
- },
- {
- img: "show_3d_normal",
- name: "H&M",
- },
- {
- img: "show_3d_normal",
- name: "GAP 盖璞",
- },
- {
- img: "show_3d_normal",
- name: "MOOST·理",
- },
- {
- img: "show_3d_normal",
- name: "H&M",
- },
- {
- img: "show_3d_normal",
- name: "GAP 盖璞",
- },
- {
- img: "show_3d_normal",
- name: "MOOST·理",
- },
- {
- img: "show_3d_normal",
- name: "H&M",
- },
- ]);
- const brandScroll = () => {
- nextTick(() => {
- let t = setTimeout(() => {
- clearTimeout(t);
- new Swiper("#sw-navigation", {
- freeMode: true,
- slidesPerView: "auto",
- centeredSlides: false,
- spaceBetween: 10,
- grid: {
- rows: 2,
- },
- on: {
- touchMove(swiper, e) {
- e.stopPropagation();
- e.preventDefault();
- },
- },
- });
- new Swiper("#sw-category", {
- freeMode: true,
- slidesPerView: "auto",
- spaceBetween: 10,
- on: {
- touchMove(swiper, e) {
- e.stopPropagation();
- e.preventDefault();
- },
- },
- });
- }, 100);
- });
- };
- const getCategorylist = async () => {
- let res = await apis.get_category_list({});
- categorylist.value = res.data;
- brandScroll();
- };
- const onClickCategory = (item) => {
- currentCategory.value.id = item.id;
- currentCategory.value.categoryName = item.categoryName;
- };
- const onClickShop = (item) => {
- window.location.href = "".concat(window.location.pathname, "?").concat(`m=${item.sceneUrl}&novideo=1`);
- };
- watch(
- () => currentCategory,
- (val, old) => {
- getShoplist();
- },
- {
- deep: true,
- }
- );
- const getShoplist = async () => {
- let res = await apis.get_shop_list({
- categoryId: currentCategory.value.id,
- });
- brandlist.value = res.data;
- brandScroll();
- };
- onMounted(() => {
- useApp().then(async (sdk) => {
- getCategorylist();
- getShoplist();
- });
- });
- </script>
- <style lang="scss" scoped>
- .menu {
- width: 100%;
- border-radius: 6px;
- border: 1px solid rgba(255, 255, 255, 0.2);
- background: rgba(0, 0, 0, 0.5);
- display: flex;
- justify-content: space-between;
- box-sizing: border-box;
- position: relative;
- align-items: center;
- height: 48px;
- padding: 0 12px;
- text-align: center;
- .logo {
- width: 90px;
- transform: translateY(-24%);
- > img {
- width: 100%;
- border-radius: 4px;
- }
- > p {
- margin: 2px 0;
- font-size: 10px;
- }
- }
- .vline {
- width: 1px;
- height: 14px;
- background: #fff;
- }
- > ul {
- display: flex;
- align-items: center;
- font-size: 0;
- justify-content: flex-end;
- > li {
- margin-left: 0.5rem;
- &:first-of-type {
- margin-left: 0;
- }
- > div {
- margin-top: 4px;
- font-size: 10px;
- }
- }
- }
- }
- .toolbar {
- width: 100%;
- border-radius: 6px;
- border: 1px solid rgba(255, 255, 255, 0.2);
- margin-top: 8px;
- margin-bottom: 30px;
- background: rgba(0, 0, 0, 0.5);
- .navigation {
- padding: 8px 14px;
- .h3 {
- font-size: 14px;
- }
- .swiper-container {
- width: 100%;
- height: 130px;
- overflow: hidden;
- margin-top: 8px;
- padding-right: 2px;
- position: relative;
- &::after {
- position: absolute;
- right: 0;
- bottom: 0;
- content: "";
- display: inline-block;
- height: 100%;
- z-index: 99;
- width: 17px;
- background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, #000000 100%);
- opacity: 0.4;
- pointer-events: none;
- }
- > ul {
- margin: 0 !important;
- > li {
- width: 60px;
- height: 60px;
- border-radius: 4px;
- position: relative;
- font-size: 0;
- overflow: hidden;
- > img {
- width: 100%;
- }
- > div {
- width: 100%;
- position: absolute;
- bottom: -1px;
- font-size: 12px;
- left: 0;
- background: rgba(0, 0, 0, 0.5);
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- text-align: center;
- padding: 2px 4px;
- box-sizing: border-box;
- word-break: break-all;
- }
- }
- }
- }
- }
- .category {
- padding: 8px 14px;
- border-top: 1px solid rgba(255, 255, 255, 0.2);
- .swiper-container {
- width: 100%;
- overflow: hidden;
- > ul {
- > li {
- width: auto;
- color: rgba(255, 255, 255, 0.5);
- > div {
- width: 100%;
- font-size: 14px;
- padding: 2px 4px;
- }
- }
- .categoryactive {
- color: #fff;
- }
- }
- }
- }
- }
- </style>
|