|
|
@@ -1,6 +1,7 @@
|
|
|
<template>
|
|
|
- <Header title="智游岳阳" />
|
|
|
<div class="map-box">
|
|
|
+ <Header title="智游岳阳" />
|
|
|
+
|
|
|
<!-- <div class="tab-bar">
|
|
|
<div class="swiper-container">
|
|
|
<div class="swiper-wrapper">
|
|
|
@@ -18,30 +19,30 @@
|
|
|
<div class="circle-item" :class="{ active: tabType == i.type }" @click="chooseItem(i, index)" v-for="(i, index) in typeData">{{ i.title }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="line-btn" @click="showLineList = true"></div>
|
|
|
+ <div class="line-btn" @click="openLineList()"></div>
|
|
|
</div>
|
|
|
<div id="amap" />
|
|
|
<div id="panel"></div>
|
|
|
- <div style="position: absolute; top: 0; left: 0; z-index: 1000">
|
|
|
- <!-- <wx-open-launch-weapp appid="wx0bc995dace29b2ba" path="pages/banner/index"> -->
|
|
|
- <!-- <wx-open-launch-weapp appid="wx4cbb8e9d0a6fface">
|
|
|
+ <!-- <div style="position: absolute; top: 100px; left: 0; z-index: 100000"> -->
|
|
|
+ <!-- <wx-open-launch-weapp appid="wx0bc995dace29b2ba" path="pages/banner/index"> -->
|
|
|
+ <!-- <wx-open-launch-weapp appid="wx4cbb8e9d0a6fface">
|
|
|
<component :is="'script'" type="text/wxtag-template">
|
|
|
<button class="btn">打开小程序</button>
|
|
|
</component>
|
|
|
- </wx-open-launch-weapp>
|
|
|
- <button @click="goLocation()">导航1</button>
|
|
|
- <button @click="goLocation(2)">导航2</button>
|
|
|
+ </wx-open-launch-weapp> -->
|
|
|
+ <!-- <button @click="goLocation()">导航1</button> -->
|
|
|
+ <!-- <button @click="goLocation(2)">导航2</button>
|
|
|
<button @click="goLocation(3)">导航3</button>
|
|
|
<button @click="openApp">打开小程序</button>
|
|
|
- <button @click="switchView(1)">切换视图1</button>
|
|
|
- <button @click="switchView(2)">切换视图2</button>-->
|
|
|
- <!-- <button @click="test()">拉起</button> -->
|
|
|
- </div>
|
|
|
+ <button @click="switchView(1)">切换视图1</button>
|
|
|
+ <button @click="switchView(2)">切换视图2</button> -->
|
|
|
+ <!-- <button @click="test()">拉起</button> -->
|
|
|
+ <!-- </div> -->
|
|
|
|
|
|
<!-- <div class="open-line" @click="showLineList = true"></div> -->
|
|
|
<div class="open-chat" @click="switchChat()"></div>
|
|
|
<div class="slide-tab">
|
|
|
- <div class="btn"></div>
|
|
|
+ <div class="btn" @click="slideToView('/food')"></div>
|
|
|
<div class="btn"></div>
|
|
|
</div>
|
|
|
<div class="chat-box" :class="{ show: showChat }">
|
|
|
@@ -80,19 +81,21 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="line-layer" @click="showLineList = false" v-if="showLineList">
|
|
|
- <div class="line-box">
|
|
|
- <div class="line-list">
|
|
|
- <div class="list-item" @click.stop="goLine(i)" v-for="i in 4">
|
|
|
- <div class="content">
|
|
|
- <p class="title">江湖风味游</p>
|
|
|
- <span class="tag">拍照必打卡</span>
|
|
|
- <p class="desc">预计用时:10小时,共7个景点</p>
|
|
|
+ <div class="line-layer" @click="closeLineList()" v-show="showLineList">
|
|
|
+ <transition appear name="fade" enter-active-class="animate__animated animate__slideInUp short faster" leave-active-class="animate__animated animate__slideOutDown short faster">
|
|
|
+ <div class="line-box" v-show="showLineBox">
|
|
|
+ <div class="line-list">
|
|
|
+ <div class="list-item" @click.stop="goLine(i)" v-for="i in 4">
|
|
|
+ <div class="content">
|
|
|
+ <p class="title">江湖风味游</p>
|
|
|
+ <span class="tag">拍照必打卡</span>
|
|
|
+ <p class="desc">预计用时:10小时,共7个景点</p>
|
|
|
+ </div>
|
|
|
+ <div class="ticket"></div>
|
|
|
</div>
|
|
|
- <div class="ticket"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </transition>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -113,8 +116,9 @@ import tagIcon from "@/assets/images/tagIcon.png";
|
|
|
import MarkdownIt from "markdown-it";
|
|
|
// import { mapStores } from "pinia";
|
|
|
import router from "@/router";
|
|
|
-import Hammer from "hammerjs";
|
|
|
const compass = ref(null);
|
|
|
+const showLineList = ref(false);
|
|
|
+const showLineBox = ref(false);
|
|
|
const getDeg = () => {
|
|
|
let deg = 0;
|
|
|
switch (tabType.value) {
|
|
|
@@ -139,15 +143,23 @@ const getDeg = () => {
|
|
|
}
|
|
|
return deg;
|
|
|
};
|
|
|
-// var hammertime = new Hammer(myElement, myOptions);
|
|
|
-// hammertime.on('pan', function(ev) {
|
|
|
-// console.log(ev);
|
|
|
-// });
|
|
|
-
|
|
|
+const slideToView = (path) => {
|
|
|
+ router.replace(path);
|
|
|
+};
|
|
|
+const openLineList = () => {
|
|
|
+ showLineList.value = true;
|
|
|
+ showLineBox.value = true;
|
|
|
+};
|
|
|
+const closeLineList = () => {
|
|
|
+ showLineBox.value = false;
|
|
|
+ setTimeout(() => {
|
|
|
+ showLineList.value = false;
|
|
|
+ }, 100);
|
|
|
+};
|
|
|
const md = new MarkdownIt();
|
|
|
const scrollRef = ref(null);
|
|
|
// console.error(mapData);
|
|
|
-const showLineList = ref(false);
|
|
|
+
|
|
|
const goLine = (id) => {
|
|
|
router.replace(`/line/${id}`);
|
|
|
};
|
|
|
@@ -275,7 +287,7 @@ const chooseItem = (i, index) => {
|
|
|
// marker.clearEvents("mousedown");
|
|
|
// marker.off("mousedown", hanlderMakerEvent);
|
|
|
tabType.value = i.type;
|
|
|
- switchView();
|
|
|
+ switchView(false);
|
|
|
if (markers.length) {
|
|
|
markers.forEach((item) => {
|
|
|
map.remove(item);
|
|
|
@@ -311,6 +323,7 @@ const hanlderMakerEvent = (e) => {
|
|
|
let markers = [];
|
|
|
const setMarker = () => {
|
|
|
let data = mapData.filter((item) => item.type == tabType.value);
|
|
|
+ // switchView(true);
|
|
|
let scale = 0.2;
|
|
|
const markerContent = `<div class="custom-content-marker">
|
|
|
<div class="title">sdasdas</div>
|
|
|
@@ -751,91 +764,32 @@ const weixinConfig = () => {
|
|
|
});
|
|
|
}
|
|
|
);
|
|
|
- // wx.config({
|
|
|
- // debug: false,
|
|
|
- // // appId: data.appId,
|
|
|
- // // timestamp: data.timestamp,
|
|
|
- // // nonceStr: data.nonceStr,
|
|
|
- // // signature: data.signature,
|
|
|
- // appId: "wx6b34086b4f650eb4",
|
|
|
- // timestamp: "1744773687",
|
|
|
- // nonceStr: "Wm3WZYTPz0wzacny",
|
|
|
- // signature: "02342e6621d4a253f8d2a72d5e38cfd15e722859",
|
|
|
- // jsApiList: ["openLocation", "uploadImage", "openLaunchWeapp"],
|
|
|
- // openTagList: ["wx-open-launch-weapp"],
|
|
|
- // });
|
|
|
|
|
|
wx.ready(() => {
|
|
|
console.log("config初始化正确");
|
|
|
});
|
|
|
};
|
|
|
-const openApp = () => {
|
|
|
- // var appid = "wx4cbb8e9d0a6fface"; // 小程序的 AppID
|
|
|
- var appid = "wx0bc995dace29b2ba"; // 小程序的 AppID
|
|
|
-
|
|
|
- var path = "/pages/banner/index"; // 小程序中需要打开的页面路径
|
|
|
-
|
|
|
- var url = "weixin://dl/business/?appid=" + appid + "&path=" + path;
|
|
|
-
|
|
|
- window.location.href = url;
|
|
|
- // wx.ready(() => {
|
|
|
- // console.error("ready");
|
|
|
- // wx.navigateToMiniProgram({
|
|
|
- // appId: appid,
|
|
|
- // path: path,
|
|
|
- // success: function (res) {
|
|
|
- // // 打开成功
|
|
|
- // },
|
|
|
- // });
|
|
|
- // });
|
|
|
-
|
|
|
- // wx.miniProgram.navigateTo({ url: path });
|
|
|
-};
|
|
|
-const switchView = () => {
|
|
|
+//*
|
|
|
+// *effect 是否false 需要过渡
|
|
|
+// /
|
|
|
+const switchView = (effect = true) => {
|
|
|
let data = mapData.filter((item) => item.type == tabType.value);
|
|
|
- let center = [113.236426, 29.138033];
|
|
|
- // if (data.length) {
|
|
|
- // center = [data[0].location.split(",")[0], data[0].location.split(",")[1]];
|
|
|
- // }
|
|
|
- map.setZoomAndCenter(10, center, false, 300);
|
|
|
-};
|
|
|
|
|
|
-// 绘制当前区域 name: 南京市
|
|
|
-const drawBounds = (name) => {
|
|
|
- // const district = new AMap.DistrictSearch({
|
|
|
- // subdistrict: 0, //获取边界不需要返回下级行政区
|
|
|
- // extensions: "all", //返回行政区边界坐标组等具体信息
|
|
|
- // level: "district", //查询行政级别为县区
|
|
|
- // });
|
|
|
- // district.search(name, (state, res) => {
|
|
|
- // this.mapInstance.remove(this.polygons);
|
|
|
- // this.polygons = [];
|
|
|
- // res.districtList[0].boundaries.forEach((q) => {
|
|
|
- // const polygon = new AMap.Polygon({
|
|
|
- // strokeWeight: 1,
|
|
|
- // path: q,
|
|
|
- // fillOpacity: 0.4,
|
|
|
- // fillColor: "#143048",
|
|
|
- // strokeColor: "#0A1A29",
|
|
|
- // });
|
|
|
- // this.polygons.push(polygon);
|
|
|
- // });
|
|
|
- // this.mapInstance.add(this.polygons);
|
|
|
- // this.mapInstance.setFitView(this.polygons); // 自适应缩放比
|
|
|
- // });
|
|
|
- // const district = new AMap.DistrictSearch({subdistrict:0,extensions:'all',level:'province'});
|
|
|
- // AMap.plugin("AMap.DistrictSearch", function () {
|
|
|
- // var districtSearch = new AMap.DistrictSearch({
|
|
|
- // level: "province",
|
|
|
- // subdistrict: 0,
|
|
|
- // extensions: "all", //返回行政区边界坐标组等具体信息
|
|
|
- // });
|
|
|
- // // 搜索所有省/直辖市信息
|
|
|
- // districtSearch.search(name, (status, result) => {
|
|
|
- // // 查询成功时,result即为对应的行政区信息
|
|
|
- // console.error(name, result);
|
|
|
- // });
|
|
|
- // });
|
|
|
+ let center = null;
|
|
|
+ let scale = 11;
|
|
|
+ if (data.length) {
|
|
|
+ center = data[0].location.split(",");
|
|
|
+ switch (tabType.value) {
|
|
|
+ case 1:
|
|
|
+ center = [113.236426, 29.138033];
|
|
|
+ scale = 10;
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ scale = 13;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map.setZoomAndCenter(scale, center, effect, 300);
|
|
|
};
|
|
|
|
|
|
const autoScroll = () => {
|
|
|
@@ -922,15 +876,13 @@ let tabNum = ref(0);
|
|
|
const questW = ref(10000);
|
|
|
onMounted(() => {
|
|
|
initMap();
|
|
|
- // weixinConfig();
|
|
|
nextTick(() => {
|
|
|
initTab();
|
|
|
-
|
|
|
setTimeout(() => {
|
|
|
let questItems = document.querySelectorAll(".quest-item");
|
|
|
let w = 0;
|
|
|
questItems.forEach((item, index) => {
|
|
|
- console.error(item.getBoundingClientRect().width);
|
|
|
+ // console.error(item.getBoundingClientRect().width);
|
|
|
w += item.getBoundingClientRect().width + 10;
|
|
|
});
|
|
|
questW.value = w;
|
|
|
@@ -954,7 +906,7 @@ onMounted(() => {
|
|
|
left: 0;
|
|
|
z-index: 100;
|
|
|
left: 50%;
|
|
|
-
|
|
|
+ pointer-events: none;
|
|
|
transform: translateX(-50%);
|
|
|
.line-btn {
|
|
|
width: 1.4667rem;
|
|
|
@@ -965,6 +917,7 @@ onMounted(() => {
|
|
|
left: 50%;
|
|
|
top: 50%;
|
|
|
transform: translate(-50%, -50%);
|
|
|
+ pointer-events: auto;
|
|
|
}
|
|
|
.circle-box {
|
|
|
display: flex;
|
|
|
@@ -973,6 +926,7 @@ onMounted(() => {
|
|
|
left: 50%;
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
+ pointer-events: none;
|
|
|
// background: #fff;
|
|
|
transform: translateX(-50%);
|
|
|
background: url("@/assets/images/circleBg.png") no-repeat;
|
|
|
@@ -1005,6 +959,7 @@ onMounted(() => {
|
|
|
font-size: 0.32rem;
|
|
|
color: #fff;
|
|
|
text-shadow: 0px 2px 5px #000000;
|
|
|
+ pointer-events: auto;
|
|
|
// writing-mode: vertical-lr;
|
|
|
// transform-origin: bottom center;
|
|
|
// width: auto;
|
|
|
@@ -1480,4 +1435,8 @@ onMounted(() => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+:root {
|
|
|
+ --animate-duration: 300ms;
|
|
|
+}
|
|
|
</style>
|