123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453 |
- <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 @click.stop="onClickMenu(item)" 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" :class="{liactive:item.sceneUrl === currentM && (item.inPosition.indexOf(currentPose)>-1)}" @click.stop="onClickShop(item)" v-for="(item, i) in brandlist" :key="i">
- <div v-if="item.shopLogo" class="img" :style="{ 'background-image': `url(${item.shopLogo})` }"></div>
- <div class="name" v-if="item.shopName">
- <span :class="{active:item.shopName.length>6}">
- {{ item.shopName }}
- </span>
- </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";
- import browser from "@/utils/browser";
- const store = useStore();
- const currentCategory = ref({
- id: "",
- categoryName: "全部",
- });
- const currentM = computed(()=>(browser.getURLParam("m")))
- const currentPose = computed(()=>(browser.getURLParam("pose")))
- console.log(currentPose.value,'=============================');
- 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 = computed(() => {
- let fff = [
- {
- icon: "customer_service",
- id: "kefu",
- name: "客服",
- },
- // {
- // icon: "guided_shopping",
- // name: "導購",
- // },
- {
- icon: "shopping",
- id: "shopping",
- name: "購物",
- },
- ];
- // if (browser.detectWeixinMiniProgram()) {
- // fff.shift();
- // }
- return fff;
- });
- 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 onClickMenu = (item) => {
- if (item.id == "kefu") {
- let mglink =
- "https://webpage.qidian.qq.com/2/chat/h5/index.html?linkType=1&env=ol&kfuin=3009110132&fid=3655&key=9b4334768c39150ead3f23e11e5dc2e4&cate=7&source=0&isLBS=0&isCustomEntry=0&type=10&ftype=1&_type=wpa&qidian=true&_pid=kvrmvu.74cg11.l43qvbcu&translateSwitch=0&isSsc=0&roleValue=4&roleData=922223821";
- window.open(mglink,'_blank')
- } else if (item.id == "shopping") {
- browser.openLink("/subPackage/pages/shoppingcart/shoppingcart", "https://m.cdfmembers.com/shop/600667208/shoppingcart", "/pages/shoppingcart/main");
- }
- };
- 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&${item.inPosition}`);
- };
- 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.2);
- 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.2);
- .navigation {
- padding: 8px 0;
- .h3 {
- font-size: 14px;
- padding: 0 14px;
- }
- .swiper-container {
- width: 100%;
- height: 130px;
- overflow: hidden;
- margin-top: 8px;
- padding-right: 2px;
- padding-left: 14px;
- 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;
- border: 1px transparent solid;
- box-sizing: border-box;
- &.liactive{
- color:var(--editor-main-color);
- border: 1px var(--editor-main-color) solid;
- }
- .img {
- width: 100%;
- height: 100%;
- background-size: contain;
- }
- .name {
- 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;
- > span {
- display: inline-block;
- white-space: nowrap;
- }
- .active{
- animation: 5s wordsLoop linear infinite normal;
- }
- }
- }
- }
- }
- }
- .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;
- }
- }
- }
- }
- }
- @keyframes wordsLoop {
- 0% {
- transform: translateX(100%);
- -webkit-transform: translateX(100%);
- }
- 100% {
- transform: translateX(-100%);
- -webkit-transform: translateX(-100%);
- }
- }
- </style>
|