jinx 8 месяцев назад
Родитель
Сommit
8d04be299d

+ 0 - 146
src/views/food/data.js

@@ -1,146 +0,0 @@
-export const foodList = [
-  {
-    id: 1,
-    name: "青椒铁山鱼头",
-    desc: "产自铁山水库的雄鱼,头大,体小,颜色黑亮。岳阳人烹饪鱼汤是有讲究的,开始用大火将水烧开,然后转为小火,慢炖几个小时,鱼肉完整鲜嫩,鱼汤会渐至奶白。随着青椒与佐料的加入,轻轻搅动勺子,香气扑面而来,让人瞬间打开味蕾。",
-    thumb: "青椒铁山鱼头.png",
-    video: "青椒铁山鱼头.mp4",
-    url: "",
-  },
-  {
-    id: 2,
-    name: "三色蒸回头鱼",
-    desc: "回头鱼又称江团。三色蒸回头鱼以蒜蓉、豆豉、红剁椒为佐料蒸制,三色对比,既有蒜豉椒香,又得鱼味的自然鲜美。",
-    thumb: "三色蒸回头鱼.png",
-    video: "三色蒸回头鱼.mp4",
-    url: "",
-  },
-  {
-    id: 3,
-    name: "岳阳口味虾",
-    desc: "岳阳有大小湖泊165个,大小河流280多条,域内活水绵延,全市养虾面积超100万亩。好水出好虾,岳阳小龙虾具有出货早、供货时间长、肚皮干净、肉质Q弹等特点。口味虾重点在高汤现卤,其肉既嫩又辣又爽,给人满口的幸福感。",
-    thumb: "岳阳口味虾.png",
-    video: "岳阳口味虾.mp4",
-    url: "https://www.720yun.com/3dm/355z4e2Of6k",
-  },
-  {
-    id: 4,
-    name: "银鱼炒蛋",
-    desc: "银鱼古称玉簪鱼,鱼头扁平鱼身无鳞,洁白如银,银鱼体柔,若无骨无肠,漫游水中,快似银箭离弦。银鱼炒蛋讲究香鲜嫩,白黄相间,鱼蛋滑嫩,诱人食欲。",
-    thumb: "银鱼炒蛋.png",
-    video: "银鱼炒蛋.mp4",
-    url: "",
-  },
-  {
-    id: 5,
-    name: "平江酱干",
-    desc: "平江酱干是一道历史悠久的传统小吃,以黄豆为主要原料,经过多次加工而成。酱干口感独特、味道鲜美,是佐餐佳品。",
-    thumb: "平江酱干.png",
-    video: "平江酱干.mp4",
-    url: "",
-  },
-  {
-    id: 6,
-    name: "华容团子",
-    desc: "华容团子是岳阳的传统小吃,以其独特的制法和口感而闻名。团子外皮软糯、馅料丰富,有肉馅和菜馅等多种选择。在品尝团子的同时,不妨再配上一碗热气腾腾的米粥,更能感受到其美味。",
-    thumb: "华容团子.png",
-    video: "华容团子.mp4",
-    url: "",
-  },
-  {
-    id: 7,
-    name: "姜辣凤爪",
-    desc: "凤凰是中国传统文化中的神鸟,因为鸡爪的形状类似凤凰的爪子,因此把鸡爪称为凤爪,寓意吉祥如意。姜辣系列是源自岳阳的新派湘菜,近年来风靡大江南北的湘菜馆。烹饪凤爪时,做料头的生姜丁是极多的,成菜味型突出姜香冲辣,姜辣凤爪与姜蒜干辣椒相熬出汁,因味型霸道,刺激味蕾,而独具岳阳地方特色。",
-    thumb: "姜辣凤爪.png",
-    video: "姜辣凤爪.mp4",
-    url: "https://www.720yun.com/3dm/603ze82Of6s",
-  },
-  {
-    id: 8,
-    name: "清炒樟树港辣椒",
-    desc: "湘阴县樟树镇,是一江一湖两港相夹而成的小“盆地”,形成了适合辣椒生长独特的环境。樟树港辣椒清炒时皮肉不分离,清脆柔软,椒香浓烈,曾被食客们戏称为辣椒中的“劳斯莱斯”。",
-    thumb: "清炒樟树港辣椒.png",
-    video: "清炒樟树港辣椒.mp4",
-    url: "",
-  },
-  {
-    id: 9,
-    name: "张谷英油豆腐",
-    desc: "张谷英村做油豆腐已经有几百年历史了,当地人会100多种豆腐做法,因此张谷英也被称作最会做豆腐的“古镇”。做油豆腐,必须用当地黄豆、渭洞茶油和龙涎井清泉来做,只有这样才足够外黄内白、外实内空,更好地吸汁。除了好的食材,采取传统工艺加工而成,也是张谷英油豆腐闻名遐迩的主要原因。",
-    thumb: "张谷英油豆腐.png",
-    video: "张谷英油豆腐.mp4",
-    url: "",
-  },
-  {
-    id: 10,
-    name: "铁山刁子鱼",
-    desc: "",
-    thumb: "铁山刁子鱼.png",
-    video: "铁山刁子鱼.mp4",
-    url: "",
-  },
-  {
-    id: 11,
-    name: "岳阳豆皮",
-    desc: "洞庭湖畔的岳阳豆皮,是本土早餐的灵魂。外皮以洞庭绿豆与早稻米(2:1)浸泡9小时磨浆,经发酵、摊凉、炸制等工序,成就金黄酥脆、内里柔韧的独特层次。\n2019年起,其制作技艺先后入选岳阳楼区、市级非遗。凭借咸香地道的口感、饱腹便携的特性,既是市井烟火味的承载,也是岳阳人舌尖的乡愁。",
-    thumb: "岳阳豆皮.png",
-    video: "岳阳豆皮.mp4",
-    url: "",
-  },
-  {
-    id: 12,
-    name: "岳阳烧烤",
-    desc: "岳阳烧烤,湘北夜宵江湖的味觉名片,以炭火淬炼湖湘风味。招牌烤牛油在烈焰中化作金黄脆珠,奶香与焦香交织;嫩滑牛肉裹着红亮辣衣,锁住丰盈肉汁;五花肉在高温下蜕变成酥脆脂香,搭配现烤洞庭鲫鱼的剁椒嫩鲜,每一串都诠释着粗犷与精细并存的烧烤哲学。",
-    thumb: "岳阳烧烤.png",
-    video: "岳阳烧烤.mp4",
-    url: "",
-  },
-  {
-    id: 13,
-    name: "香煎原味翘白",
-    desc: "翘白鱼就是翘嘴白鱼,其肉白而细,首尾上翘,猎食性强,是我国淡水四大名鱼之一。制作香煎翘白时,得把翘白鱼切成几段,两面煎得金黄,上桌时完美不破皮,外脆内嫩,原汁原味。",
-    thumb: "香煎原味翘白.png",
-    video: "香煎原味翘白.mp4",
-    url: "",
-  },
-  {
-    id: 14,
-    name: "白灼河虾",
-    desc: "洞庭湖区人对大湖习惯称为河,如汴河街,下河街等,对洞庭湖广袤水域里的虾习惯称为河虾。白灼河虾就是等清水沸腾后,倒入河虾至红色,辅以佐料即成鲜活美味。",
-    thumb: "白灼河虾.png",
-    video: "白灼河虾.mp4",
-    url: "",
-  },
-  {
-    id: 15,
-    name: "金汤小米桂鱼打边炉",
-    desc: "这道菜得到湘菜泰斗王墨泉大师的嫡传弟子、祖庵菜技艺传承人、湘菜大师杨龙的亲自指点,把桂鱼肉质的鲜嫩爽滑完美呈现出来。经过特殊熬制的小米,其清香醇厚包裹住细嫩的鱼肉,异常爽滑,久煮不柴。",
-    thumb: "金汤小米桂鱼打边炉.png",
-    video: "金汤小米桂鱼打边炉.mp4",
-    url: "",
-  },
-  {
-    id: 16,
-    name: "腊味芦笋",
-    desc: "洞庭湖的芦苇荡里遍布一种俯拾皆是的时鲜芦笋,将芦笋煮沸焯水,去掉苦涩,这时鲜嫩的颜色更加讨喜,暖色的鹅黄交融着淡淡的乳白,当香喷喷的腊肉遇上新鲜芦笋,锅中翻炒时,芦笋就像一只只蝴蝶在锅里跳舞,起锅上桌让人口齿留香。",
-    thumb: "腊味芦笋.png",
-    video: "腊味芦笋.mp4",
-    url: "",
-  },
-  {
-    id: 17,
-    name: "清炒藜蒿",
-    desc: "正月藜,二月蒿,藜蒿广泛生长在洞庭湖区,冰雪未消融就冲破严寒,簇簇绽放,清香鲜嫩,风味冠春蔬,最是人家美味,只要藜蒿独特香,不炒腊肉饭也光,在烹饪藜蒿时,可以采用简单的方法来保留其最原始的风味,将藜蒿洗净切段,用热油快速翻炒,加入适量的盐和蒜末调味,便能品尝到藜蒿的鲜嫩于清香。",
-    thumb: "清炒藜蒿.png",
-    video: "清炒藜蒿.mp4",
-    url: "",
-  },
-  {
-    id: 18,
-    name: "荷塘三宝(藕丁、莲子、菱角合炒)",
-    desc: "洞庭湖区民间早就有荷莲一身宝,秋藕最补人的说法,家住大湖边,荷塘随处是,吃菱角,闻荷香,尝藕尖,吃莲子,品湖藕,记忆中的味道如此根深蒂固地成为一抹淡淡地乡愁。湖区人眼里地荷塘三宝就是湖藕,莲子,菱角。烹饪时要把新鲜的湖藕与菱角切丁与莲子合炒,怎么炒都能诱人品尝,清香可口。",
-    thumb: "荷塘三宝.png",
-    video: "荷塘三宝.mp4",
-    url: "",
-  },
-];

+ 0 - 566
src/views/food/index-new.vue

@@ -1,566 +0,0 @@
-<!--  -->
-<template>
-  <div class="food" :class="{ isLandscape }" v-if="foodList">
-    <Header v-if="!isLandscape" title="数字美食" path="map" />
-    <div class="top">
-      <div class="food-title"></div>
-      <div class="food-container">
-        <div class="swiper-wrapper">
-          <div class="swiper-slide" :class="{ 'swiper-no-swiping': isLandscape }" @click="goToView(i)" v-for="i in foodList">
-            <div class="slide-bg"></div>
-
-            <!-- <img :src="`./static/image/美食/封面/${getThumb(i.thumb)}`" alt="" /> -->
-            <img :src="`./static/image/美食/封面/${i.thumb}`" alt="" />
-          </div>
-
-          <!-- 更多幻灯片 -->
-        </div>
-        <!-- 如果需要分页器 -->
-        <!-- <div class="swiper-pagination"></div> -->
-        <div class="swiper-button-prev"></div>
-        <div class="swiper-button-next"></div>
-      </div>
-    </div>
-
-    <div class="food-msg">
-      <div class="btn-box">
-        <div class="model-btn" @click="goToView(foodList[swipeIndex])" v-if="foodList[swipeIndex].url">
-          <div></div>
-          <span>3D美食</span>
-        </div>
-
-        <div class="video-btn" @click="videoUrl = foodList[swipeIndex].video" v-if="foodList[swipeIndex].video">
-          <div></div>
-          <span>视频教程</span>
-        </div>
-      </div>
-
-      <div class="desc">
-        <div>
-          {{ foodList[swipeIndex].desc }}
-        </div>
-      </div>
-      <!-- <div v-if="foodList[swipeIndex].channel" class="miniprogram-btn" @click="odorPlay">播放气味</div> -->
-    </div>
-    <!-- <div class="model-btn"></div> -->
-  </div>
-  <WebView v-if="openData" :food="openData" @close="closeWebView" />
-
-  <div class="video-layer" :class="{ isLandscape }" v-if="videoUrl">
-    <div class="video-box">
-      <video controls :autoplay="true" :src="`./static/image/美食/视频/${foodList[swipeIndex].video}`" x5-playsinline playsinline webkit-playsinline="true"></video>
-    </div>
-    <div class="close-btn" @click="videoUrl = null"></div>
-  </div>
-</template>
-
-<script setup>
-import { reactive, ref, toRefs, onBeforeMount, onMounted, nextTick } from "vue";
-import Swiper from "swiper";
-import Header from "@/components/header/index.vue";
-import "swiper/css/swiper.css";
-// import { foodList } from "./data.js";
-import WebView from "../webview/index.vue";
-import { playOdor, getDevices, stopOdors, playMoreOdor } from "./playOdor.js";
-import { useRoute } from "vue-router";
-import axios from "axios";
-import router from "@/router";
-const route = useRoute();
-const swipeIndex = ref(0);
-const isLandscape = ref(false);
-let swiper = null;
-const foodList = ref(null);
-// const showWebView = ref(false);
-const device = ref(1);
-const getData = () => {
-  axios
-    .get("./static/data/food.json")
-    .then((res) => {
-      foodList.value = res.data;
-      nextTick(() => {
-        initTab();
-      });
-    })
-    .catch((error) => {
-      console.log(error);
-    });
-};
-const getThumb = (thumb) => {
-  let name = thumb.split(".")[0] + ".png";
-  return name;
-};
-const closeWebView = () => {
-  openData.value = null;
-};
-const videoUrl = ref(null);
-const openData = ref(null);
-// const openData = ref({
-//   id: 7,
-//   name: "姜辣凤爪",
-//   desc: "凤凰是中国传统文化中的神鸟,因为鸡爪的形状类似凤凰的爪子,因此把鸡爪称为凤爪,寓意吉祥如意。姜辣系列是源自岳阳的新派湘菜,近年来风靡大江南北的湘菜馆。烹饪凤爪时,做料头的生姜丁是极多的,成菜味型突出姜香冲辣,姜辣凤爪与姜蒜干辣椒相熬出汁,因味型霸道,刺激味蕾,而独具岳阳地方特色。",
-//   thumb: "姜辣凤爪.png",
-//   video: "姜辣凤爪.mp4",
-//   url: "https://www.720yun.com/3dm/603ze82Of6s",
-// });
-
-const odorPlay = async () => {
-  let mac = route.query.mac || foodList.value[swipeIndex.value]?.mac || 1;
-  if (device.value == 1) {
-  } else {
-  }
-
-  let channel = route.query.channel || foodList.value[swipeIndex.value]?.channel || 1;
-  let times = route.query.times;
-  let data = {
-    mac,
-    channel,
-    times,
-  };
-
-  let stop = await stopOdors(data);
-  if (stop) {
-    let res = await playOdor(data);
-    // let res = await playMoreOdor(data);
-    if (res.code == 200) {
-      console.log("播放成功");
-    }
-  }
-};
-const initTab = () => {
-  swiper = new Swiper(".food-container", {
-    direction: "horizontal",
-    // slidesPerView: "auto",
-    centeredSlides: true,
-    // noSwiping: true,
-    // spaceBetween: 0,
-    // nextButton: ".swiper-button-next",
-    // prevButton: ".swiper-button-prev",
-    slidesPerView: isLandscape.value ? 3 : "auto",
-    spaceBetween: isLandscape.value ? 30 : 0,
-    navigation: {
-      nextEl: ".swiper-button-next",
-      prevEl: ".swiper-button-prev",
-      // disabledClass: "my-button-disabled",
-    },
-    // Swiper选项...
-    loop: false,
-    on: {
-      slideChange: (e) => {
-        swipeIndex.value = swiper.activeIndex;
-      },
-      init: () => {},
-    },
-  });
-};
-const goToView = (item) => {
-  if (!item.url) {
-    return;
-  }
-  openData.value = item;
-  console.error(openData.value);
-};
-onMounted(() => {
-  if (window.innerWidth > window.innerHeight) {
-    isLandscape.value = true;
-    console.error("横屏");
-  }
-  // isLandscape
-  getData();
-  // getDevices();
-});
-</script>
-<style lang="scss" scoped>
-.video-layer {
-  width: 100%;
-  height: 100%;
-  position: absolute;
-  top: 0;
-  left: 0;
-  background: rgba(0, 0, 0, 0.9);
-  z-index: 100000;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
-  .video-box {
-    width: 100%;
-    height: 5.7333rem;
-    video {
-      width: 100%;
-      height: auto;
-    }
-  }
-  .close-btn {
-    width: 0.9333rem;
-    height: 0.9333rem;
-    margin-top: 2.2133rem;
-    background: url("@/assets/images/video-close.png") no-repeat;
-    background-color: rgba(0, 0, 0, 0.5);
-    border-radius: 50%;
-
-    background-size: 100% 100%;
-  }
-}
-.food {
-  width: 100%;
-  height: 100%;
-
-  position: relative;
-  overflow-x: hidden;
-  background: url("@/assets/images/foodBg.png") no-repeat;
-  background-size: 100% 100%;
-  position: fixed;
-  top: 0;
-  left: 0;
-  .top {
-    width: 100%;
-    height: 50%;
-    position: absolute;
-    left: 0;
-    // top: 13%;
-  }
-  .food-title {
-    font-weight: bold;
-    font-size: 0.4267rem;
-    color: #785c49;
-    line-height: 0.4933rem;
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    position: absolute;
-    top: 1.8667rem;
-    left: 50%;
-    transform: translateX(-50%);
-    width: 64.8%;
-    height: 2.7467rem;
-    background: url("@/assets/images/foodTitlePic.png") no-repeat;
-    background-size: contain;
-  }
-  .food-msg {
-    position: absolute;
-    width: 100%;
-    height: 50%;
-    left: 0;
-    bottom: 0;
-    padding: 0 1.3333rem;
-    .btn-box {
-      min-width: 2.6667rem;
-      position: absolute;
-      top: 23%;
-      left: 50%;
-      transform: translateX(-50%);
-      z-index: 2;
-      display: flex;
-      align-items: center;
-      justify-content: center;
-      .model-btn {
-        // position: absolute;
-        // top: 23%;
-        // left: 50%;
-        // transform: translateX(-50%);
-        // z-index: 2;
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        flex-direction: column;
-        margin: 0 0.2667rem;
-        > div {
-          width: 1.3333rem;
-          height: 1.3333rem;
-          background: url("@/assets/images/food-model-btn.png") no-repeat;
-          background-size: 100% 100%;
-        }
-        span {
-          font-size: 0.28rem;
-          color: #785b47;
-          margin-top: -0.1333rem;
-        }
-      }
-      .video-btn {
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        flex-direction: column;
-        margin: 0 0.2667rem;
-        > div {
-          width: 1.3333rem;
-          height: 1.3333rem;
-          background: url("@/assets/images/food-video-btn.png") no-repeat;
-          background-size: 100% 100%;
-        }
-        span {
-          font-size: 0.28rem;
-          color: #785b47;
-          margin-top: -0.1333rem;
-        }
-        // position: absolute;
-        // top: 23%;
-        // left: 50%;
-        // transform: translateX(-50%);
-        // z-index: 2;
-      }
-    }
-
-    .desc {
-      padding: 0 1.3333rem;
-      width: 100%;
-      // height: 50%;
-      height: 40%;
-      overflow-y: auto;
-      position: absolute;
-
-      top: 40%;
-      left: 50%;
-      transform: translateX(-50%);
-      font-weight: 400;
-      font-size: 0.28rem;
-      color: #707070;
-      line-height: 0.4133rem;
-      letter-spacing: 0.0267rem;
-      z-index: 1;
-      margin-top: 0.5333rem;
-    }
-    // .miniprogram-btn {
-    //   font-weight: bold;
-    //   font-size: 0.4667rem;
-    //   color: #ffffff;
-    //   line-height: 0.3733rem;
-    //   width: 4.2666rem;
-    //   height: 1.0933rem;
-    //   background: url("@/assets/images/fristBtn.png") no-repeat;
-    //   background-size: 100% 100%;
-    //   position: absolute;
-    //   bottom: 5%;
-    //   left: 50%;
-    //   transform: translateX(-50%);
-    //   display: flex;
-    //   align-items: center;
-    //   justify-content: center;
-    //   z-index: 2;
-    // }
-  }
-
-  .food-container {
-    // margin-top: 28vh;
-    // height: 38%;
-    height: 80%;
-    width: 100%;
-    position: absolute;
-    // top: 22%;
-    top: 45%;
-    left: 0;
-
-    // visibility: hidden;
-    &.show {
-      visibility: visible;
-    }
-    .swiper-button-prev {
-      display: none;
-    }
-    .swiper-button-next {
-      display: none;
-    }
-    .swiper-slide {
-      // background: red;
-      width: 60%;
-      height: 100%;
-      transition: all 0.3s ease-in-out;
-
-      position: relative;
-      display: flex;
-      align-items: center;
-      justify-content: center;
-      transform: scale(0.8);
-      &.swiper-slide-active {
-        transform: scale(1);
-      }
-      // &::after {
-      //   position: absolute;
-      //   width: 100%;
-      //   height: 100%;
-      //   content: "";
-      //   z-index: 3;
-      // }
-      .slide-bg {
-        position: absolute;
-        width: 110%;
-        height: 110%;
-        background: url("@/assets/images/foodSliderBg.png") no-repeat;
-        background-size: 100% 100%;
-        top: 50%;
-        left: 50%;
-        transform: translate(-50%, -50%);
-        z-index: 1;
-      }
-      img {
-        // width: 100%;
-        // height: 100%;
-        width: 80%;
-        height: 36%;
-        object-fit: cover;
-        z-index: 2;
-        position: relative;
-      }
-    }
-    .swiper-slide-prev {
-      // transform: scale(0.8) translateY(-120px);
-      transform: scale(0.64);
-    }
-    .swiper-slide-active {
-      transform: scale(1);
-    }
-    .swiper-slide-next {
-      transform: scale(0.64);
-    }
-  }
-}
-
-.isLandscape {
-  &.food {
-    background: url("@/assets/images/foodBgPc.png") no-repeat;
-    background-size: 100% 100%;
-  }
-  &.video-layer {
-    .video-box {
-      height: 100%;
-      width: 100%;
-      top: 0;
-      position: absolute;
-      video {
-        width: 100%;
-        height: 100%;
-      }
-    }
-    .close-btn {
-      right: 20px;
-      top: 20px;
-      position: absolute;
-      z-index: 9999;
-      margin-top: 0;
-      cursor: pointer;
-    }
-  }
-
-  .top {
-    height: 100%;
-    top: 0;
-    .food-title {
-      width: 517px;
-      height: 76px;
-      top: 8%;
-    }
-    z-index: 1;
-  }
-  .food-container {
-    height: 42%;
-    top: 20%;
-    .swiper-button-prev {
-      background: url("@/assets/images/foodPrev.png") no-repeat;
-      background-size: 100% 100%;
-      height: 211px;
-      width: 153px;
-      left: -40px;
-      top: 50%;
-      transform: translateY(-45%);
-      display: block;
-      &::after {
-        display: none;
-      }
-    }
-    .swiper-button-next {
-      background: url("@/assets/images/foodNext.png") no-repeat;
-      background-size: 100% 100%;
-      height: 211px;
-      width: 153px;
-      right: -40px;
-      top: 50%;
-      transform: translateY(-45%);
-      display: block;
-      &::after {
-        display: none;
-      }
-    }
-    .swiper-wrapper {
-      display: flex;
-      align-items: center;
-    }
-    .swiper-slide {
-      // width: 244px;
-      // height: 159px;
-
-      height: 100%;
-      transform: none;
-
-      &.swiper-slide-active {
-        transform: scale(1);
-      }
-      .slide-bg {
-        background: url("@/assets/images/foodSliderBgPc.png") no-repeat;
-        background-size: 100% 100%;
-      }
-      img {
-        width: 80%;
-        height: 70%;
-        object-fit: contain;
-        z-index: 2;
-        position: relative;
-      }
-    }
-    .swiper-slide-prev {
-      // width: 443px;
-      // height: 288px;
-      transform: scale(0.7);
-    }
-    .swiper-slide-active {
-      // width: 705px;
-      // height: 458px;
-      height: 100%;
-    }
-    .swiper-slide-next {
-      // width: 443px;
-      // height: 288px;
-      transform: scale(0.7);
-    }
-  }
-  .food-msg {
-    height: calc(100% - 62%);
-    z-index: 2;
-    .btn-box {
-      top: 0;
-      .model-btn {
-        cursor: pointer;
-        > div {
-          width: 62px;
-          height: 62px;
-          background: url("@/assets/images/food-model-btn.png") no-repeat;
-          background-size: 100% 100%;
-        }
-        span {
-          font-size: 17px;
-        }
-      }
-      .video-btn {
-        cursor: pointer;
-        > div {
-          width: 62px;
-          height: 62px;
-          background: url("@/assets/images/food-video-btn.png") no-repeat;
-          background-size: 100% 100%;
-        }
-        span {
-          font-size: 17px;
-        }
-      }
-    }
-
-    .desc {
-      margin-top: 0;
-      bottom: 10%;
-      top: auto;
-      font-size: 18px;
-      line-height: 34px;
-      padding: 0 15%;
-    }
-  }
-}
-</style>

+ 0 - 565
src/views/food/index-old.vue

@@ -1,565 +0,0 @@
-<!--  -->
-<template>
-  <div class="food" :class="{ isLandscape }" v-if="foodList">
-    <Header v-if="!isLandscape" title="数字美食" path="map" />
-    <div class="top">
-      <div class="food-title">{{ foodList[swipeIndex].name }}</div>
-      <div class="food-container">
-        <div class="swiper-wrapper">
-          <div class="swiper-slide" :class="{ 'swiper-no-swiping': isLandscape }" @click="goToView(i)" v-for="i in foodList">
-            <div class="slide-bg"></div>
-
-            <!-- <img :src="`./static/image/美食/封面/${getThumb(i.thumb)}`" alt="" /> -->
-            <img :src="`./static/image/美食/封面/${i.thumb}`" alt="" />
-          </div>
-
-          <!-- 更多幻灯片 -->
-        </div>
-        <!-- 如果需要分页器 -->
-        <!-- <div class="swiper-pagination"></div> -->
-        <div class="swiper-button-prev"></div>
-        <div class="swiper-button-next"></div>
-      </div>
-    </div>
-
-    <div class="food-msg">
-      <div class="btn-box">
-        <div class="model-btn" @click="goToView(foodList[swipeIndex])" v-if="foodList[swipeIndex].url">
-          <div></div>
-          <span>3D美食</span>
-        </div>
-
-        <div class="video-btn" @click="videoUrl = foodList[swipeIndex].video" v-if="foodList[swipeIndex].video">
-          <div></div>
-          <span>视频教程</span>
-        </div>
-      </div>
-
-      <div class="desc">
-        <div>
-          {{ foodList[swipeIndex].desc }}
-        </div>
-      </div>
-      <!-- <div v-if="foodList[swipeIndex].channel" class="miniprogram-btn" @click="odorPlay">播放气味</div> -->
-    </div>
-    <!-- <div class="model-btn"></div> -->
-  </div>
-  <WebView v-if="openData" :food="openData" @close="closeWebView" />
-
-  <div class="video-layer" :class="{ isLandscape }" v-if="videoUrl">
-    <div class="video-box">
-      <video controls :autoplay="true" :src="`./static/image/美食/视频/${foodList[swipeIndex].video}`" x5-playsinline playsinline webkit-playsinline="true"></video>
-    </div>
-    <div class="close-btn" @click="videoUrl = null"></div>
-  </div>
-</template>
-
-<script setup>
-import { reactive, ref, toRefs, onBeforeMount, onMounted, nextTick } from "vue";
-import Swiper from "swiper";
-import Header from "@/components/header/index.vue";
-import "swiper/css/swiper.css";
-// import { foodList } from "./data.js";
-import WebView from "../webview/index.vue";
-import { playOdor, getDevices, stopOdors, playMoreOdor } from "./playOdor.js";
-import { useRoute } from "vue-router";
-import axios from "axios";
-import router from "@/router";
-const route = useRoute();
-const swipeIndex = ref(0);
-const isLandscape = ref(false);
-let swiper = null;
-const foodList = ref(null);
-// const showWebView = ref(false);
-const device = ref(1);
-const getData = () => {
-  axios
-    .get("./static/data/food.json")
-    .then((res) => {
-      foodList.value = res.data;
-      nextTick(() => {
-        initTab();
-      });
-    })
-    .catch((error) => {
-      console.log(error);
-    });
-};
-const getThumb = (thumb) => {
-  let name = thumb.split(".")[0] + ".png";
-  return name;
-};
-const closeWebView = () => {
-  openData.value = null;
-};
-const videoUrl = ref(null);
-const openData = ref(null);
-// const openData = ref({
-//   id: 7,
-//   name: "姜辣凤爪",
-//   desc: "凤凰是中国传统文化中的神鸟,因为鸡爪的形状类似凤凰的爪子,因此把鸡爪称为凤爪,寓意吉祥如意。姜辣系列是源自岳阳的新派湘菜,近年来风靡大江南北的湘菜馆。烹饪凤爪时,做料头的生姜丁是极多的,成菜味型突出姜香冲辣,姜辣凤爪与姜蒜干辣椒相熬出汁,因味型霸道,刺激味蕾,而独具岳阳地方特色。",
-//   thumb: "姜辣凤爪.png",
-//   video: "姜辣凤爪.mp4",
-//   url: "https://www.720yun.com/3dm/603ze82Of6s",
-// });
-
-const odorPlay = async () => {
-  let mac = route.query.mac || foodList.value[swipeIndex.value]?.mac || 1;
-  if (device.value == 1) {
-  } else {
-  }
-
-  let channel = route.query.channel || foodList.value[swipeIndex.value]?.channel || 1;
-  let times = route.query.times;
-  let data = {
-    mac,
-    channel,
-    times,
-  };
-
-  let stop = await stopOdors(data);
-  if (stop) {
-    let res = await playOdor(data);
-    // let res = await playMoreOdor(data);
-    if (res.code == 200) {
-      console.log("播放成功");
-    }
-  }
-};
-const initTab = () => {
-  swiper = new Swiper(".food-container", {
-    direction: "horizontal",
-    // slidesPerView: "auto",
-    centeredSlides: true,
-    // noSwiping: true,
-    // spaceBetween: 0,
-    // nextButton: ".swiper-button-next",
-    // prevButton: ".swiper-button-prev",
-    slidesPerView: isLandscape.value ? 3 : "auto",
-    spaceBetween: isLandscape.value ? 30 : 0,
-    navigation: {
-      nextEl: ".swiper-button-next",
-      prevEl: ".swiper-button-prev",
-      // disabledClass: "my-button-disabled",
-    },
-    // Swiper选项...
-    loop: false,
-    on: {
-      slideChange: (e) => {
-        swipeIndex.value = swiper.activeIndex;
-      },
-      init: () => {},
-    },
-  });
-};
-const goToView = (item) => {
-  if (!item.url) {
-    return;
-  }
-  openData.value = item;
-  console.error(openData.value);
-};
-onMounted(() => {
-  if (window.innerWidth > window.innerHeight) {
-    isLandscape.value = true;
-    console.error("横屏");
-  }
-  // isLandscape
-  getData();
-  // getDevices();
-});
-</script>
-<style lang="scss" scoped>
-.video-layer {
-  width: 100%;
-  height: 100%;
-  position: absolute;
-  top: 0;
-  left: 0;
-  background: rgba(0, 0, 0, 0.9);
-  z-index: 100000;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
-  .video-box {
-    width: 100%;
-    height: 5.7333rem;
-    video {
-      width: 100%;
-      height: auto;
-    }
-  }
-  .close-btn {
-    width: 0.9333rem;
-    height: 0.9333rem;
-    margin-top: 2.2133rem;
-    background: url("@/assets/images/video-close.png") no-repeat;
-    background-color: rgba(0, 0, 0, 0.5);
-    border-radius: 50%;
-
-    background-size: 100% 100%;
-  }
-}
-.food {
-  width: 100%;
-  height: 100%;
-
-  position: relative;
-  overflow-x: hidden;
-  background: url("@/assets/images/foodBg.png") no-repeat;
-  background-size: 100% 100%;
-  position: fixed;
-  top: 0;
-  left: 0;
-  .top {
-    width: 100%;
-    height: 50%;
-    position: absolute;
-    left: 0;
-    // top: 13%;
-  }
-  .food-title {
-    font-weight: bold;
-    font-size: 0.4267rem;
-    color: #785c49;
-    line-height: 0.4933rem;
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    position: absolute;
-    top: 20%;
-    left: 50%;
-    transform: translateX(-50%);
-    min-width: 5.5333rem;
-    height: 0.8533rem;
-    background: url("@/assets/images/foodTitleBg.png") no-repeat;
-    background-size: 100% 100%;
-  }
-  .food-msg {
-    position: absolute;
-    width: 100%;
-    height: 50%;
-    left: 0;
-    bottom: 0;
-    padding: 0 1.3333rem;
-    .btn-box {
-      min-width: 2.6667rem;
-      position: absolute;
-      top: 23%;
-      left: 50%;
-      transform: translateX(-50%);
-      z-index: 2;
-      display: flex;
-      align-items: center;
-      justify-content: center;
-      .model-btn {
-        // position: absolute;
-        // top: 23%;
-        // left: 50%;
-        // transform: translateX(-50%);
-        // z-index: 2;
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        flex-direction: column;
-        margin: 0 0.2667rem;
-        > div {
-          width: 1.3333rem;
-          height: 1.3333rem;
-          background: url("@/assets/images/food-model-btn.png") no-repeat;
-          background-size: 100% 100%;
-        }
-        span {
-          font-size: 0.28rem;
-          color: #785b47;
-          margin-top: -0.1333rem;
-        }
-      }
-      .video-btn {
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        flex-direction: column;
-        margin: 0 0.2667rem;
-        > div {
-          width: 1.3333rem;
-          height: 1.3333rem;
-          background: url("@/assets/images/food-video-btn.png") no-repeat;
-          background-size: 100% 100%;
-        }
-        span {
-          font-size: 0.28rem;
-          color: #785b47;
-          margin-top: -0.1333rem;
-        }
-        // position: absolute;
-        // top: 23%;
-        // left: 50%;
-        // transform: translateX(-50%);
-        // z-index: 2;
-      }
-    }
-
-    .desc {
-      padding: 0 1.3333rem;
-      width: 100%;
-      height: 50%;
-      overflow-y: auto;
-      position: absolute;
-
-      top: 40%;
-      left: 50%;
-      transform: translateX(-50%);
-      font-weight: 400;
-      font-size: 0.28rem;
-      color: #707070;
-      line-height: 0.4133rem;
-      letter-spacing: 0.0267rem;
-      z-index: 1;
-      margin-top: 0.5333rem;
-    }
-    // .miniprogram-btn {
-    //   font-weight: bold;
-    //   font-size: 0.4667rem;
-    //   color: #ffffff;
-    //   line-height: 0.3733rem;
-    //   width: 4.2666rem;
-    //   height: 1.0933rem;
-    //   background: url("@/assets/images/fristBtn.png") no-repeat;
-    //   background-size: 100% 100%;
-    //   position: absolute;
-    //   bottom: 5%;
-    //   left: 50%;
-    //   transform: translateX(-50%);
-    //   display: flex;
-    //   align-items: center;
-    //   justify-content: center;
-    //   z-index: 2;
-    // }
-  }
-
-  .food-container {
-    // margin-top: 28vh;
-    // height: 38%;
-    height: 80%;
-    width: 100%;
-    position: absolute;
-    // top: 22%;
-    top: 40%;
-    left: 0;
-
-    // visibility: hidden;
-    &.show {
-      visibility: visible;
-    }
-    .swiper-button-prev {
-      display: none;
-    }
-    .swiper-button-next {
-      display: none;
-    }
-    .swiper-slide {
-      // background: red;
-      width: 60%;
-      height: 100%;
-      transition: all 0.3s ease-in-out;
-
-      position: relative;
-      display: flex;
-      align-items: center;
-      justify-content: center;
-      transform: scale(0.8);
-      &.swiper-slide-active {
-        transform: scale(1);
-      }
-      // &::after {
-      //   position: absolute;
-      //   width: 100%;
-      //   height: 100%;
-      //   content: "";
-      //   z-index: 3;
-      // }
-      .slide-bg {
-        position: absolute;
-        width: 110%;
-        height: 110%;
-        background: url("@/assets/images/foodSliderBg.png") no-repeat;
-        background-size: 100% 100%;
-        top: 50%;
-        left: 50%;
-        transform: translate(-50%, -50%);
-        z-index: 1;
-      }
-      img {
-        // width: 100%;
-        // height: 100%;
-          width: 80%;
-        height: 36%;
-        object-fit: cover;
-        z-index: 2;
-        position: relative;
-      }
-    }
-    .swiper-slide-prev {
-      // transform: scale(0.8) translateY(-120px);
-      transform: scale(0.64);
-    }
-    .swiper-slide-active {
-      transform: scale(1);
-    }
-    .swiper-slide-next {
-      transform: scale(0.64);
-    }
-  }
-}
-
-.isLandscape {
-  &.food {
-    background: url("@/assets/images/foodBgPc.png") no-repeat;
-    background-size: 100% 100%;
-  }
-  &.video-layer {
-    .video-box {
-      height: 100%;
-      width: 100%;
-      top: 0;
-      position: absolute;
-      video {
-        width: 100%;
-        height: 100%;
-      }
-    }
-    .close-btn {
-      right: 20px;
-      top: 20px;
-      position: absolute;
-      z-index: 9999;
-      margin-top: 0;
-      cursor: pointer;
-    }
-  }
-
-  .top {
-    height: 100%;
-    top: 0;
-    .food-title {
-      width: 517px;
-      height: 76px;
-      top: 8%;
-    }
-    z-index: 1;
-  }
-  .food-container {
-    height: 42%;
-    top: 20%;
-    .swiper-button-prev {
-      background: url("@/assets/images/foodPrev.png") no-repeat;
-      background-size: 100% 100%;
-      height: 211px;
-      width: 153px;
-      left: -40px;
-      top: 50%;
-      transform: translateY(-45%);
-      display: block;
-      &::after {
-        display: none;
-      }
-    }
-    .swiper-button-next {
-      background: url("@/assets/images/foodNext.png") no-repeat;
-      background-size: 100% 100%;
-      height: 211px;
-      width: 153px;
-      right: -40px;
-      top: 50%;
-      transform: translateY(-45%);
-      display: block;
-      &::after {
-        display: none;
-      }
-    }
-    .swiper-wrapper {
-      display: flex;
-      align-items: center;
-    }
-    .swiper-slide {
-      // width: 244px;
-      // height: 159px;
-
-      height: 100%;
-      transform: none;
-
-      &.swiper-slide-active {
-        transform: scale(1);
-      }
-      .slide-bg {
-        background: url("@/assets/images/foodSliderBgPc.png") no-repeat;
-        background-size: 100% 100%;
-      }
-      img {
-        width: 80%;
-        height: 70%;
-        object-fit: contain;
-        z-index: 2;
-        position: relative;
-      }
-    }
-    .swiper-slide-prev {
-      // width: 443px;
-      // height: 288px;
-      transform: scale(0.7);
-    }
-    .swiper-slide-active {
-      // width: 705px;
-      // height: 458px;
-      height: 100%;
-    }
-    .swiper-slide-next {
-      // width: 443px;
-      // height: 288px;
-      transform: scale(0.7);
-    }
-  }
-  .food-msg {
-    height: calc(100% - 62%);
-    z-index: 2;
-    .btn-box {
-      top: 0;
-      .model-btn {
-        cursor: pointer;
-        > div {
-          width: 62px;
-          height: 62px;
-          background: url("@/assets/images/food-model-btn.png") no-repeat;
-          background-size: 100% 100%;
-        }
-        span {
-          font-size: 17px;
-        }
-      }
-      .video-btn {
-        cursor: pointer;
-        > div {
-          width: 62px;
-          height: 62px;
-          background: url("@/assets/images/food-video-btn.png") no-repeat;
-          background-size: 100% 100%;
-        }
-        span {
-          font-size: 17px;
-        }
-      }
-    }
-
-    .desc {
-      margin-top: 0;
-      bottom: 10%;
-      top: auto;
-      font-size: 18px;
-      line-height: 34px;
-      padding: 0 15%;
-    }
-  }
-}
-</style>

+ 0 - 26
src/views/line/data.js

@@ -1,26 +0,0 @@
-export const trvelLine = [
-  {
-    id: 1,
-    name: "江湖风味游",
-    time: 36000,
-    list: [1, 42, 7, 49, 15],
-  },
-  {
-    id: 2,
-    name: "激情山水游",
-    time: 36000,
-    list: [51, 8, 61, 89, 49],
-  },
-  {
-    id: 3,
-    time: 36000,
-    name: "Citywalk城市漫步游",
-    list: [66, 73, 21, 75, 82, 26],
-  },
-  {
-    id: 4,
-    time: 36000,
-    name: "亲子趣玩/研学游",
-    list: [10, 74, 67, 23, 1, 66, 2, 24, 18],
-  },
-];

+ 2 - 209
src/views/line/index.vue

@@ -65,7 +65,6 @@ let iconList = {
 };
 let AMap = null;
 let map = null;
-let imageLayer = null;
 const dialogData = ref(null);
 const activeId = ref(0);
 let infoWindow = null;
@@ -193,19 +192,10 @@ const gotoItem = (data) => {
       const button = document.getElementById("detailsBtn");
       const vrBtn = document.getElementById("vrBtn");
       const closeBtn = document.getElementById("closeBtn");
-      // if ("ontouchend" in window) {
-      //   button.addEventListener("touchend", openDetails);
-      //   vrBtn.addEventListener("touchend", openVrLink);
-      //   closeBtn.addEventListener("touchend", closeTag);
-      // } else {
+
       button.addEventListener("click", openDetails);
       vrBtn.addEventListener("click", openVrLink);
       closeBtn.addEventListener("click", closeTag);
-      // }
-
-      // button.addEventListener("touchstart", openDetails);
-      // vrBtn.addEventListener("touchstart", openVrLink);
-      // closeBtn.addEventListener("touchstart", closeTag);
     }, 100);
   }, 100);
 };
@@ -230,42 +220,25 @@ const setMarker = () => {
     let iconH = 57 * 0.8;
     let customIcon = null;
     let offset = [new AMap.Pixel(0, 0)];
-    // if (data[i].iconSize) {
-    //   iconW = (data[i].iconSize[0] - 0) * scale;
-    //   iconH = (data[i].iconSize[1] - 0) * scale;
-    //   customIcon = new AMap.Icon({
-    //     // size: new AMap.Size(50, 50),
-    //     image: `./static/image/景点地标切图/${data[i].name}.png`,
-    //     imageSize: new AMap.Size(iconW, iconH),
-    //   });
-    //   offset = new AMap.Pixel(-(iconW / 2), -(iconH / 2));
-    // } else {
+
     offset = new AMap.Pixel(-(iconW / 2), -(iconH / 2));
     customIcon = new AMap.Icon({
       size: new AMap.Size(iconW, iconH),
-      // image: eval(`tagIcon${lineData.value[i].type}`),
       image: iconList[`tagIcon${lineData.value[i].type}`],
       imageSize: new AMap.Size(iconW, iconH),
     });
-    // }
 
     let pos = lineData.value[i].location.split(",");
     let extData = lineData.value[i];
     let marker = new AMap.Marker({
-      // position: new AMap.LngLat(106.837106, 29.712762),
-
       position: new AMap.LngLat(pos[0], pos[1]),
       offset: offset,
-      // content: !data[i].iconSize ? markerContent : null, //将 html 传给 content
       label: {
-        // Marker标签
         direction: "top",
         content: extData.name, // 标签内容
         offset: new AMap.Pixel(0, -5), // 标签偏移量,可根据需要调整
       },
-      // icon: data[i].iconSize ? customIcon : null, //添加 icon 图标 URL
       icon: customIcon, //添加 icon 图标 URL
-      // title: data[i].name,
       zooms: [8, 20], // 设置可见级别,[最小级别,最大级别]
       id: `marker_${lineData.value[i].id}`,
       extData: {
@@ -276,7 +249,6 @@ const setMarker = () => {
     });
     markers.push(marker);
     marker.on("mousedown", hanlderMakerEvent);
-    // marker.off("mousedown", hanlderMakerEvent);
     map.add(marker);
   }
 
@@ -334,7 +306,6 @@ const createdLine = () => {
     map.add(routeLine);
 
     // 调整视野达到最佳显示区域
-    // map.setFitView([startMarker, endMarker, routeLine]);
     map.setFitView([routeLine]);
   }
   function parseRouteToPath(route) {
@@ -354,31 +325,20 @@ const createdLine = () => {
 
 const initMap = async () => {
   window._AMapSecurityConfig = {
-    // securityJsCode: "2d0885f937e5fa6d093830e1765f593d",
     securityJsCode: mapConfig.securityJsCode,
   };
   const _AMap = await AMapLoader.load({
-    // key: "655ac083de961ed970f2be4ba23b3c9f",//玉骑账号
     key: mapConfig.key,
     version: "2.0",
     plugins: ["AMap.MoveAnimation", "AMap.ImageLayer", "AMap.TileLayer", "AMap.DistrictSearch", "AMap.Driving", "AMap.Walking"],
   });
   AMap = _AMap;
 
-  addImageLayer();
-
-  // const layer = new AMap.createDefaultLayer({
-  //   visible: true, // 是否可见
-  //   opacity: 1, // 透明度
-  //   zIndex: 10, // 叠加层级
-  // });
   var tilerLayer = new AMap.TileLayer({
     zIndex: 10,
     zooms: [0, 16],
     dataZooms: [8, 16],
     getTileUrl: function (x, y, z) {
-      //return /*dir*/'tiles/' + z + '/' + x + '_' + y + '.png';
-      // return /*dir*/ "tiles/" + z + "/" + x + "_" + y + ".png";
       return /*dir*/ "static/tiles/" + z + "/" + x + "/" + y + ".png";
     },
   });
@@ -388,184 +348,17 @@ const initMap = async () => {
     labels: true,
     zoom: 10, // 地图显示的缩放级别
     zooms: [8, 18],
-    // center: [106.837106, 29.712762],
-    // center: [114.2983, 30.5466],
     center: [113.236426, 29.138033],
-    // center: [116.399028, 39.845042], //路线
-
-    // center: [116.397428, 39.90923], //地图中心点
     resizeEnable: true, // 是否监控地图容器尺寸变化
-    // layers: [layer, imageLayer],
-    // layers: [layer],
-    // features: ["bg", "point", "road"],
   });
 
   map.add(tilerLayer);
-  // 当前示例的目标是展示如何根据规划结果绘制路线,因此walkOption为空对象
-  // var walkingOption = { policy: 0 };
-
-  // // 步行导航
-  // var walking = new AMap.Walking(walkingOption);
-
-  // var waypoints = [
-  //   // 途经点数组,格式为 [经度, 纬度]
-  //   [116.403953, 39.915378],
-  //   [116.410837, 39.910887],
-  // ];
-
-  // //根据起终点坐标规划步行路线
-  // walking.search([116.403953, 39.915378], [116.436281, 39.880719], function (status, result) {
-  //   console.error(result);
-  //   if (status === "complete") {
-  //     if (result.routes && result.routes.length) {
-  //       drawRoute(result.routes[0]);
-  //       // log.success('绘制步行路线完成')
-  //     }
-  //   } else {
-  //     // log.error('步行路线数据查询失败' + result)
-  //   }
-  // });
-
-  // var driving = new AMap.Driving({
-  //   //驾车路线规划策略,0是速度优先的策略
-  //   policy: AMap.DrivingPolicy.LEAST_TIME,
-  //   //map 指定将路线规划方案绘制到对应的 AMap.Map 对象上
-  //   // map: map,
-  //   //panel 指定将结构化的路线详情数据显示的对应的 DOM 上,传入值需是 DOM 的 ID
-  //   // panel: "panel",
-  // });
-  // var startLngLat = [116.379028, 39.865042]; //起始点坐标
-  // var endLngLat = [116.427281, 39.903719]; //终点坐标
-  // var opts = {
-  //   waypoints: [
-  //     [116.397455, 39.909187],
-  //     [116.410837, 39.910887],
-  //   ], //途经点参数,最多支持传入16个途经点
-  // };
-  // //搜索完成后,将自动绘制路线到地图上
-  // driving.search(startLngLat, endLngLat, opts, function (status, result) {
-  //   if (status === "complete") {
-  //     if (result.routes && result.routes.length) {
-  //       console.error(result);
-  //       drawRoute(result);
-  //       // log.success('绘制步行路线完成')
-  //     }
-  //   } else {
-  //     // log.error('步行路线数据查询失败' + result)
-  //   }
-  // });
-
-  // 解析WalkRoute对象,构造成AMap.Polyline的path参数需要的格式
-  // WalkRoute对象的结构文档 https://lbs.amap.com/api/javascript-api/reference/route-search#m_WalkRoute
-
-  // AMap.plugin(["AMap.PlaceSearch"], function () {
-  //   //构造地点查询类
-  //   var placeSearch = new AMap.PlaceSearch({
-  //     pageSize: 5, // 单页显示结果条数
-  //     pageIndex: 1, // 页码
-  //     city: "010", // 兴趣点城市
-  //     citylimit: true, //是否强制限制在设置的城市内搜索
-  //     // map: map, // 展现结果的地图实例
-  //     // panel: "panel", // 结果列表将在此容器中进行展示。
-  //     autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
-  //   });
-  //   //关键字查询
-  //   placeSearch.search("停车场", function (status, result) {
-  //     // 查询成功时,result即对应匹配的POI信息
-  //     console.error(result);
-  //     var pois = result.poiList.pois;
-  //     for (var i = 0; i < pois.length; i++) {
-  //       var poi = pois[i];
-  //       var marker = [];
-  //       marker[i] = new AMap.Marker({
-  //         position: poi.location, // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
-  //         title: poi.name,
-  //       });
-  //       // 将创建的点标记添加到已有的地图实例:
-  //       map.add(marker[i]);
-  //       marker[i].on("click", () => {
-  //         console.error(1);
-  //       });
-  //     }
-  //     // map.setFitView();
-  //   });
-  // });
-
-  // map.setFeatures(["bg", "road", "building"]);
-
-  // map.setFeatures(["bg", "road", "roadLabel"], true); // 显示背景、道路和建筑物
-  // map.setFeatures(['roadLabel'], false); // 关闭道路名称显示
-
-  // var circle = new AMap.Rectangle({
-  //   bounds: new AMap.Bounds(
-  //     [106.837106, 29.712762], // 左下  手绘图左下相对于地图的经纬度
-  //     [106.848727, 29.720554] // 右上  手绘图右上相对于地图的经纬度
-  //   ), //矩形的范围
-  //   strokeColor: "red", //轮廓线颜色
-  //   strokeWeight: 6, //轮廓线宽度
-  //   strokeOpacity: 0.5, //轮廓线透明度
-  //   strokeStyle: "dashed", //轮廓线样式,dashed 虚线,还支持 solid 实线
-  //   strokeDasharray: [30, 10], //勾勒形状轮廓的虚线和间隙的样式,30代表线段长度 10代表间隙长度
-  //   fillColor: "blue", //矩形填充颜色
-  //   fillOpacity: 0.5, //矩形填充透明度
-  //   cursor: "pointer", //指定鼠标悬停时的鼠标样式
-  //   zIndex: 1001, //矩形在地图上的层级
-
-  //   extData: {
-  //     //自定义数据
-  //     name: "北京",
-  //   },
-  // });
-  //单独将点标记和矢量圆形添加到地图上
-  // circle.on("click", (e) => {
-  //   console.error("click", e.target.getExtData());
-  //   showDialog.value = true;
-  // });
-  // map.add(circle);
 
   tilerLayer.on("click", () => {});
   map.on("zoomchange", () => {
     console.log("当前缩放级别:", map.getZoom());
-    // if (map.getZoom() < 10 || map.getZoom() > 15) {
-    //   map.remove(tilerLayer);
-    // } else {
-    //   map.add(tilerLayer);
-    // }
   });
   setMarker();
-
-  map.on("click", (ev) => {
-    //触发事件的对象
-    var target = ev.target;
-
-    //触发事件的地理坐标,AMap.LngLat 类型
-    var lnglat = ev.lnglat;
-
-    //触发事件的像素坐标,AMap.Pixel 类型
-    var pixel = ev.pixel;
-
-    //触发事件类型
-    var type = ev.type;
-  });
-
-  // map.add(imageLayer);
-  // map.add(marker);
-};
-
-const addImageLayer = () => {
-  imageLayer = new AMap.ImageLayer({
-    bounds: new AMap.Bounds(
-      [112.327252, 29.848416], // 左下  手绘图左下相对于地图的经纬度
-      [114.158561, 28.41688] // 右上  手绘图右上相对于地图的经纬度
-    ),
-    // url为手绘图地址
-    // url: "https://amappc.cn-hangzhou.oss-pub.aliyun-inc.com/lbs/static/img/dongwuyuan.jpg",
-    url: "./static/tiles/yueyang.png",
-
-    zIndex: 10,
-    clickable: true,
-    zooms: [0, 16], // 设置可见级别,[最小级别,最大级别]
-  });
 };
 
 onMounted(() => {

Разница между файлами не показана из-за своего большого размера
+ 0 - 1978
src/views/map/data.js


+ 3 - 288
src/views/map/index.vue

@@ -113,8 +113,7 @@
 <script setup>
 import { nextTick, onMounted, ref, watch, computed } from "vue";
 import { mapConfig, deepseekConfig } from "@/utils/config.js";
-// import { mapData, typeData } from "./data.js";
-import { trvelLine } from "../line/data.js";
+
 import Dialog from "./dialog.vue";
 import Header from "@/components/header/index.vue";
 import "swiper/css/swiper.css";
@@ -125,7 +124,6 @@ import tagIcon4 from "@/assets/images/tag-4.png";
 import tagIcon5 from "@/assets/images/tag-5.png";
 import tagIcon6 from "@/assets/images/tag-6.png";
 import tagIcon3d from "@/assets/images/tag-3d.png";
-import tagIcon from "@/assets/images/tagIcon.png";
 import MarkdownIt from "markdown-it";
 import router from "@/router";
 import OpenAI from "openai";
@@ -133,12 +131,9 @@ import Swiper from "swiper";
 import AMapLoader from "@amap/amap-jsapi-loader";
 import axios from "axios";
 
-import { useLineStore } from "@/stores/line";
 import { useAudioStore } from "@/stores/audio";
 const audioStore = useAudioStore();
 const audioStatus = computed(() => audioStore.audioStatus);
-// import { throttle } from "lodash";
-const lineStore = useLineStore();
 const mapData = ref(null);
 const typeData = ref(null);
 const weightData = ref(null);
@@ -171,7 +166,6 @@ const getData = async () => {
           let questItems = document.querySelectorAll(".quest-item");
           let w = 0;
           questItems.forEach((item, index) => {
-            // console.error(item.getBoundingClientRect().width);
             w += item.getBoundingClientRect().width + 10;
           });
           questW.value = w;
@@ -217,7 +211,6 @@ let iconList = {
   tagIcon6,
   tagIcon3d,
 };
-// const trvelList = ref(trvelLine);
 const trvelList = ref(null);
 const compass = ref(null);
 const showLineList = ref(false);
@@ -239,16 +232,10 @@ const initTrvel = () => {
         opts.waypoints.push([obj.location.split(",")[0], obj.location.split(",")[1]]);
       }
     });
-    // return obj
-    // j_item = obj;
 
     var driving = new AMap.Driving({
       //驾车路线规划策略,0是速度优先的策略
       policy: AMap.DrivingPolicy.LEAST_TIME,
-      //map 指定将路线规划方案绘制到对应的 AMap.Map 对象上
-      // map: map,
-      //panel 指定将结构化的路线详情数据显示的对应的 DOM 上,传入值需是 DOM 的 ID
-      // panel: "panel",
     });
 
     // //搜索完成后,将自动绘制路线到地图上
@@ -266,8 +253,6 @@ const initTrvel = () => {
   });
 };
 const goTd = () => {
-  // let data =
-  // tabType.value = "3d";
   chooseItem({ type: "3d" });
 };
 
@@ -392,7 +377,6 @@ const scrollRef = ref(null);
 
 const goLine = (i) => {
   router.replace(`/line/${i.id}`);
-  // lineStore.initLineTime(i.time);
 };
 const messages = ref([]);
 if (sessionStorage.getItem("messages")) {
@@ -491,8 +475,6 @@ const initTab = () => {
 
 const dialogData = ref(null);
 const chooseItem = (i, index) => {
-  // marker.clearEvents("mousedown");
-  // marker.off("mousedown", hanlderMakerEvent);
   tabType.value = i.type;
   closeTag();
   switchView(false);
@@ -505,13 +487,7 @@ const chooseItem = (i, index) => {
   if (clusters) {
     clusters.setMap(null); // 将点聚合移除
     clusters = null;
-    // clusters.forEach((item) => {
-    //   console.error(item);
-    //   map.remove(item);
-    //   item.off("click", hanlderClusterEvent);
-    // });
   }
-  // setMarker();
   setMarkerCluster();
 };
 const showChat = ref(false);
@@ -527,109 +503,6 @@ const hanlderMakerEvent = (e) => {
 
 let markers = [];
 let clusters = null;
-const setMarker = () => {
-  let data = mapData.value.filter((item) => item.type == tabType.value);
-  // switchView(true);
-  let scale = 0.2;
-
-  for (let i = 0; i < data.length; i++) {
-    let iconW = 41;
-    let iconH = 57;
-    let customIcon = null;
-    let offset = [new AMap.Pixel(0, 0)];
-    // if (data[i].iconSize) {
-    //   iconW = (data[i].iconSize[0] - 0) * scale;
-    //   iconH = (data[i].iconSize[1] - 0) * scale;
-    //   customIcon = new AMap.Icon({
-    //     // size: new AMap.Size(50, 50),
-    //     image: `./static/image/景点地标切图/${data[i].name}.png`,
-    //     imageSize: new AMap.Size(iconW, iconH),
-    //   });
-    //   offset = new AMap.Pixel(-(iconW / 2), -(iconH / 2));
-    // } else {
-    offset = new AMap.Pixel(-(iconW / 2), -(iconH / 2));
-    customIcon = new AMap.Icon({
-      size: new AMap.Size(iconW, iconH),
-      // image: eval(`tagIcon${data[i].type}`),
-      image: iconList[`tagIcon${data[i].type}`],
-      imageSize: new AMap.Size(iconW, iconH),
-    });
-    // customIcon = markerContent;
-    // }
-
-    let pos = data[i].location.split(",");
-    let extData = data[i];
-    let marker = new AMap.Marker({
-      // position: new AMap.LngLat(106.837106, 29.712762),
-
-      position: new AMap.LngLat(pos[0], pos[1]),
-      offset: offset,
-      // content: !data[i].iconSize ? markerContent : null, //将 html 传给 content
-      label: {
-        // Marker标签
-        direction: "top",
-        content: extData.name, // 标签内容
-        offset: new AMap.Pixel(0, -5), // 标签偏移量,可根据需要调整
-      },
-      // icon: data[i].iconSize ? customIcon : null, //添加 icon 图标 URL
-      icon: customIcon, //添加 icon 图标 URL
-      // title: data[i].name,
-      zooms: [9, 20], // 设置可见级别,[最小级别,最大级别]
-      id: `marker_${data[i].id}`,
-      extData: {
-        //自定义数据
-        ...extData,
-      },
-      clickable: true,
-    });
-    markers.push(marker);
-    marker.on("mousedown", hanlderMakerEvent);
-    // marker.off("mousedown", hanlderMakerEvent);
-    map.add(marker);
-  }
-};
-// const setSingleMarker = (data) => {
-//   console.error(data);
-//   let scale = 0.2;
-//   let iconW = 50;
-//   let iconH = 50;
-//   let customIcon = null;
-//   let offset = [0, 0];
-//   if (data.iconSize) {
-//     iconW = (data.iconSize[0] - 0) * scale;
-//     iconH = (data.iconSize[1] - 0) * scale;
-//     customIcon = new AMap.Icon({
-//       // size: new AMap.Size(50, 50),
-//       image: `./static/image/景点地标切图/${data.name}.png`,
-//       imageSize: new AMap.Size(iconW, iconH),
-//     });
-//     offset = new AMap.Pixel(-(iconW / 2), -(iconH / 2));
-//   } else {
-//     offset = 0;
-//   }
-
-//   let pos = data.location.split(",");
-//   let extData = data;
-//   let marker = new AMap.Marker({
-//     // position: new AMap.LngLat(106.837106, 29.712762),
-
-//     position: new AMap.LngLat(pos[0], pos[1]),
-//     // content: markerContent, //将 html 传给 content
-//     offset: offset,
-//     icon: customIcon, //添加 icon 图标 URL
-//     // title: data[i].name,
-//     zooms: [9, 20], // 设置可见级别,[最小级别,最大级别]
-//     extData: {
-//       //自定义数据
-//       ...extData,
-//     },
-//     clickable: true,
-//   });
-//   markers.push(marker);
-//   marker.on("mousedown", hanlderMakerEvent);
-//   // marker.off("mousedown", hanlderMakerEvent);
-//   map.add(marker);
-// };
 
 const setMarkerCluster = () => {
   let pointers = [];
@@ -676,21 +549,13 @@ const setMarkerCluster = () => {
     {
       gridSize: 30,
       clusterByZoomChange: true,
-      // styles: {
-      //   // url: `./static/image/景点地标切图/${data.name}.png`,
-      //   url: `//a.amap.com/jsapi_demos/static/demo-center/icons/dir-via-marker.png`,
-      //   size: new AMap.Size(50, 50),
-      // },
       renderClusterMarker: (cluster) => {
         let iconW = 115 * 0.5,
           iconH = 115 * 0.5;
-        // let offset = new AMap.Pixel(-(iconW / 2), -(iconH / 2));
         let offset = new AMap.Pixel(-(iconW / 2), -(iconH * 0.6));
         const { marker } = cluster;
         let extData = cluster.clusterData[0].info;
-        // console.error(extData);
-        // marker.setContent(`<div class="custom-marker"><p>${extData.name}</p><img  src="${iconList[`tagIcon${extData.type}`]}" /></div>`);
-        // marker.setContent(`<div class="custom-marker">${extData.length}</div>`);
+
         marker.setContent(
           `<div class="custom-marker"><p class="cluster-marker-title">${extData.name}等...</p><div class="cluster-marker-count" style="width:${iconW}px;height:${iconH}px;"><span>${cluster.clusterData.length}</span></div></div>`
         );
@@ -717,7 +582,6 @@ const setMarkerCluster = () => {
       },
     }
   );
-  // clusters.push(cluster);
   clusters.on("click", hanlderClusterEvent);
 };
 let wiondowButton,
@@ -743,140 +607,61 @@ const hanlderClusterEvent = (e) => {
       wiondowButton = document.getElementById("detailsBtn");
       vrBtn = document.getElementById("vrBtn");
       closeBtn = document.getElementById("closeBtn");
-      // const mapWindow = document.getElementById("mapWindow");
-
-      // mapWindow.addEventListener("click", (e) => {
-      //   e.stopPropagation();
-      // });
-
-      // if ("ontouchend" in window) {
-      //   console.log("支持 touchend");
-      //   wiondowButton.addEventListener("touchend", openDetails);
-      //   vrBtn.addEventListener("touchend", openVrLink);
-      //   closeBtn.addEventListener("touchend", closeTag);
-      // } else {
-      // console.log("不支持 touchend");
+
       wiondowButton.addEventListener("click", openDetails);
       vrBtn.addEventListener("click", openVrLink);
       closeBtn.addEventListener("click", closeTag);
-      // }
     }, 100);
   } else {
-    // console.error(map.getZoom());
     setTimeout(() => {
-      // map.setZoomAndCenter(map.getZoom() + 2);
       let center = e.clusterData[0].info.location.split(",");
       console.error(center);
       map.setZoomAndCenter(map.getZoom() + 2, center, false, 300);
     }, 0);
-    // console.error(map.getZoom());
   }
 };
 
 const initMap = async () => {
   window._AMapSecurityConfig = {
-    // securityJsCode: "2d0885f937e5fa6d093830e1765f593d",
     securityJsCode: mapConfig.securityJsCode, //玉琦账号
   };
   const _AMap = await AMapLoader.load({
     key: mapConfig.key, //玉琦账号
-    // key: "b19c9847b3775cd993c5a8a71c5fa1a0",
     version: "2.0",
     plugins: ["AMap.MoveAnimation", "AMap.ImageLayer", "AMap.TileLayer", "AMap.Geolocation", "AMap.DistrictSearch", "AMap.Driving", "AMap.Walking", "AMap.MarkerCluster", "AMap.InfoWindow"],
   });
   AMap = _AMap;
 
-  // addImageLayer();
-
-  // const layer = new AMap.createDefaultLayer({
-  //   visible: true, // 是否可见
-  //   opacity: 1, // 透明度
-  //   zIndex: 10, // 叠加层级
-  // });
   var tilerLayer = new AMap.TileLayer({
     zIndex: 10,
     zooms: [0, 16],
     dataZooms: [8, 16],
     getTileUrl: function (x, y, z) {
-      //return /*dir*/'tiles/' + z + '/' + x + '_' + y + '.png';
-      // return /*dir*/ "tiles/" + z + "/" + x + "_" + y + ".png";
       return /*dir*/ "static/tiles/" + z + "/" + x + "/" + y + ".png";
     },
   });
   map = new AMap.Map("amap", {
     viewMode: "2D",
-    // mapStyle: "amap://styles/76c9ffde986e653b6c8dc2bba6a9186e", //设置地图的显示样式
     mapStyle: mapConfig.mapStyle, //玉琦账号
     labels: true,
     zoom: 8.2, // 地图显示的缩放级别
     zooms: [8, 18],
-    // center: [106.837106, 29.712762],
-    // center: [114.2983, 30.5466],
     center: [113.236426, 29.138033],
-    // center: [116.399028, 39.845042], //路线
-
-    // center: [116.397428, 39.90923], //地图中心点
     resizeEnable: true, // 是否监控地图容器尺寸变化
   });
 
   initTrvel();
 
-  // tilerLayer.setMap(map);
-  // tilerLayer.on("click", () => {
-  //   console.error("click");
-  // });
   map.on("zoomchange", () => {
     console.log("当前缩放级别:", map.getZoom());
-    // if (map.getZoom() < 10 || map.getZoom() > 15) {
-    //   map.remove(tilerLayer);
-    // } else {
-    //   map.add(tilerLayer);
-    // }
   });
   map.on("moveend", () => {
     // var center = map.getCenter(); // 获取当前中心点坐标
-    // searchPos();
     // console.log("当前中心点坐标:", center.getLng(), center.getLat());
   });
-  // setMarker();
   setMarkerCluster();
 
-  // map.on("click", (ev) => {
-  //   //触发事件的对象
-  //   var target = ev.target;
-
-  //   //触发事件的地理坐标,AMap.LngLat 类型
-  //   var lnglat = ev.lnglat;
-
-  //   //触发事件的像素坐标,AMap.Pixel 类型
-  //   var pixel = ev.pixel;
-
-  //   //触发事件类型
-  //   var type = ev.type;
-  //   // console.error(pixel);
-  // });
-
-  // map.add(imageLayer);
   map.add(tilerLayer);
-  // map.add(marker);
-};
-
-const addImageLayer = () => {
-  imageLayer = new AMap.ImageLayer({
-    bounds: new AMap.Bounds(
-      // [112.327252, 29.848416], // 左下  手绘图左下相对于地图的经纬度
-      // [114.158561, 28.41688] // 右上  手绘图右上相对于地图的经纬度
-      [112.319302, 29.848272], // 左下  手绘图左下相对于地图的经纬度
-      [114.159538, 28.396902] // 右上  手绘图右上相对于地图的经纬度
-    ),
-    // url为手绘图地址
-    // url: "https://amappc.cn-hangzhou.oss-pub.aliyun-inc.com/lbs/static/img/dongwuyuan.jpg",
-    url: "./static/tiles/yueyang.png",
-
-    zIndex: 10,
-    clickable: true,
-    zooms: [0, 20], // 设置可见级别,[最小级别,最大级别]
-  });
 };
 
 //*
@@ -912,16 +697,13 @@ const switchView = (effect = true) => {
     }
   }
 
-  // [113.236426, 29.138033]
   map.setZoomAndCenter(scale, center, effect, 100);
 };
 
 const autoScroll = () => {
   setTimeout(() => {
-    // console.error(scrollRef.value.scrollHeight)
     let scrollHeight = scrollRef.value.scrollHeight;
     scrollRef.value.scrollTo({
-      // top: 999999,
       top: scrollHeight,
       behavior: "smooth",
     });
@@ -929,71 +711,6 @@ const autoScroll = () => {
 };
 
 let services = ref([]);
-const searchPos = () => {
-  if (services.value.length) {
-    services.value.forEach((item) => {
-      map.remove(item);
-    });
-  }
-  AMap.plugin(["AMap.PlaceSearch"], function () {
-    //构造地点查询类
-    var placeSearch = new AMap.PlaceSearch({
-      pageSize: 5, // 单页显示结果条数
-      pageIndex: 1, // 页码
-      city: "岳阳", // 兴趣点城市
-      citylimit: true, //是否强制限制在设置的城市内搜索
-      // map: map, // 展现结果的地图实例
-      // panel: "panel", // 结果列表将在此容器中进行展示。
-      autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
-    });
-    //关键字查询
-    // placeSearch.search("公共厕所", function (status, result) {
-    //   // 查询成功时,result即对应匹配的POI信息
-    //   console.error(result);
-    //   var pois = result.poiList.pois;
-    //   for (var i = 0; i < pois.length; i++) {
-    //     var poi = pois[i];
-    //     var marker = [];
-    //     marker[i] = new AMap.Marker({
-    //       position: poi.location, // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
-    //       title: poi.name,
-    //       zIndex: 9999,
-    //     });
-    //     // 将创建的点标记添加到已有的地图实例:
-    //     map.add(marker[i]);
-    //     marker[i].on("click", () => {
-    //       console.error(1);
-    //     });
-    //   }
-    //   map.setFitView();
-    // });
-    console.error(map.getCenter());
-
-    var center = map.getCenter(); // 获取当前中心点坐标
-    var cpoint = [center.getLng(), center.getLat()]; //中心点坐标
-    console.error(cpoint);
-    placeSearch.searchNearBy("公共厕所", cpoint, 20000, function (status, result) {
-      //查询成功时,result 即对应匹配的 POI 信息
-      console.log("services", services.value);
-      var pois = result.poiList.pois;
-      for (var i = 0; i < pois.length; i++) {
-        var poi = pois[i];
-        console.log("services", services.value);
-        services.value[i] = new AMap.Marker({
-          position: poi.location, // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
-          title: poi.name,
-          zIndex: 9999,
-        });
-        // 将创建的点标记添加到已有的地图实例:
-        console.log("services", services.value);
-        map.add(services.value[i]);
-        // services.value[i].on("click", () => {
-        //   console.error(1);
-        // });
-      }
-    });
-  });
-};
 
 const rotateNum = ref(0);
 let tabNum = ref(0);
@@ -1020,8 +737,6 @@ onMounted(() => {
   getData();
 
   nextTick(() => {
-    // initHammer();
-    // initTab();
     initKeyFrames();
   });
 });