From 3efb4b13a0c22332f75b48af4015541d6833c1fe Mon Sep 17 00:00:00 2001
From: YM <479443481@qq.com>
Date: 星期三, 29 五月 2024 11:17:20 +0800
Subject: [PATCH] 人物详情

---
 src/pages/characterMap/characterMap.vue |  165 +++++++++++++++++++++++++++++++-----------------------
 1 files changed, 95 insertions(+), 70 deletions(-)

diff --git a/src/pages/characterMap/characterMap.vue b/src/pages/characterMap/characterMap.vue
index 8d04186..df06f02 100644
--- a/src/pages/characterMap/characterMap.vue
+++ b/src/pages/characterMap/characterMap.vue
@@ -1,8 +1,8 @@
 <template>
-  <view>
-    <headNav :idIndex="idIndex" text="涓尰浜虹墿鏁版嵁搴�" />
-    <el-button class="getBack" @click="getBack">杩斿洖</el-button>
-    <view class="" style="position: relative">
+  <view style="width: 100%;height: 100%;display: flex;flex-direction: column;">
+    <headNav :idIndex="1 + ''" text="涓尰浜虹墿鏁版嵁搴�" />
+    <el-button class="getBack" @click="goBack">杩斿洖</el-button>
+    <view style="flex: 1;overflow: hidden;">
       <!-- 鍦板浘 -->
       <!-- <view id="spaceTime" style="height: 90vh;width: 100%;position: relative;"></view> -->
       <div id="map"></div>
@@ -78,6 +78,7 @@
 import "echarts/extension/bmap/bmap";
 import { loadBMap } from "@/static/map.js";
 import L from "leaflet";
+import "leaflet.chinatmsproviders";
 import { getPersonInfo } from "@/api/index.js";
 export default {
   data() {
@@ -94,7 +95,7 @@
       spanML: 0,
       cursorML: -0.05,
       activityInfo: {},
-      basicInfo: {},
+      basicInfo: {}
     };
   },
 
@@ -107,7 +108,6 @@
     //   this.aaa();
     // });
     this.$route;
-    console.log(this.$route, "this.$route");
     this.getPersonInfoFun();
     this.getBasicInfo();
   },
@@ -116,33 +116,37 @@
     initMap(info) {
       var map = L.map("map", {
         attributionControl: false,
-        preferCanvas: true,
+        preferCanvas: true
       }).setView([35.91667, 110.41667], 5);
 
       // L.tileLayer(
       //   "http://webrd01.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}"
       // ).addTo(map);
 
-
       L.tileLayer
         .chinaProvider("TianDiTu.Normal.Map", {
           key: "76bc34ead7e30e663a4eded8aeaf5860",
           maxZoom: 18,
-          minZoom: 5,
+          minZoom: 5
         })
         .addTo(map);
       let DefaultIcon1 = L.icon({
         iconUrl: this.icoName,
         iconSize: [24, 41], //  鍥炬爣鐨勫ぇ灏�    銆愬��1锛屽��2銆� 涓哄叿浣撲綘鑷畾涔夊浘鏍囩殑灏哄锛屾瘮濡傛垜鍥炬爣灏哄鏄�32脳52锛岃〃绀鸿鍥炬爣锛氬搴�32鍍忕礌锛岄珮搴︼細52鍍忕礌锛岄偅涔堝��1:灏辨槸32锛屽��2锛氬氨鏄�52
         iconAnchor: [24, 41], //  鍥炬爣灏嗗搴旀爣璁扮偣鐨勪綅缃� 杩欎釜鏄噸鐐癸紝 銆愬��1锛屽��2銆戯紝鍊�1锛氫负鍥炬爣鍧愭爣绗竴涓��(鍗�32)鐨勪竴鍗婏紝鍊�2锛氫负鍥炬爣鍧愭爣绗簩涓��(鍗�52)
-        popupAnchor: [1, -24], // 璇ョ偣鏄浉瀵逛簬iconAnchor寮瑰嚭淇℃伅鐨勪綅缃�  杩欎釜鏄垜鎵嬪姩璋冨嚭鏉ョ殑锛屾枃妗i粯璁ゅ師濮嬪�兼槸[-1锛�-76]锛屾垜鏄幓涓�鍗婂�硷紝鍙栦竴鍗婂�艰皟鍑烘潵鐨�
+        popupAnchor: [1, -24] // 璇ョ偣鏄浉瀵逛簬iconAnchor寮瑰嚭淇℃伅鐨勪綅缃�  杩欎釜鏄垜鎵嬪姩璋冨嚭鏉ョ殑锛屾枃妗i粯璁ゅ師濮嬪�兼槸[-1锛�-76]锛屾垜鏄幓涓�鍗婂�硷紝鍙栦竴鍗婂�艰皟鍑烘潵鐨�
+      });
+      let icon = L.divIcon({
+        html: "<div class='map-circle-name ripple'></div>",
+        iconSize: [80, 80],
+        className: "map-circle"
       });
       this.map = map;
       if (info && info.length) {
         for (let i = 0; i < info.length; i++) {
           const item = info[i];
           const marker1 = L.marker([item.ycoord, item.xcoord], {
-            icon: DefaultIcon1,
+            icon: icon
           }).addTo(map);
           marker1.on("click", (e) => {
             this.menuNav = true;
@@ -153,8 +157,8 @@
     },
 
     // 杩斿洖鎸夐挳
-    getBack() {
-      uni.navigateBack();
+    goBack() {
+      this.$router.go(-1);
     },
     aaa() {
       // 娓叉煋姣嶇嚎
@@ -174,9 +178,8 @@
     getPersonInfoFun() {
       getPersonInfo({
         id: this.$route.query.id,
-        type: "PERSON_SPACE_TIME",
+        type: "PERSON_SPACE_TIME"
       }).then((res) => {
-        console.log(res, "res");
         this.initMap(res.object.personSpaceTimeList);
       });
     },
@@ -184,9 +187,8 @@
     getBasicInfo() {
       getPersonInfo({
         id: this.$route.query.id,
-        type: "PERSON_BASIC",
+        type: "PERSON_BASIC"
       }).then((res) => {
-        console.log(res, "res");
         this.basicInfo.name = res.object.personFieldList.find(
           (f) => f.fieldName == "WEAK_NAME"
         ).content1;
@@ -207,11 +209,9 @@
     },
 
     creatMX(len) {
-      console.log(len);
       let width = len * 50 + 10;
       // this.MX.style.width = `${width}px`
       // this.scales.style.width = `${width}px`
-      // console.log(this.box.style.width);
     },
     creatScale() {
       // for (let i = 0; i < this.yearArr.length; i++) {
@@ -221,7 +221,6 @@
       // 	scale.addEventListener("click", this.scaleClick)
       // 	scales.appendChild(scale)
       // }
-      // console.log(arr[0]);
     },
 
     handleSliderChange(value) {
@@ -229,16 +228,13 @@
     },
     scaleClick(i) {
       // let i = Number(this.getAttribute("data-index"))
-      console.log(i, this.cursorML);
 
       if (i > this.yearIndex) {
         this.cursorML += (i - this.yearIndex + +("0.0" + this.yearIndex)) / 1.9;
         // this.spanML += 50 * (i - this.yearIndex)
-        console.log(i - this.yearIndex + 0.2, "aaaa");
       } else {
         this.cursorML -= (this.yearIndex - i) / 2 + 0.04;
         // this.spanML -= 50 * (this.yearIndex - i)
-        console.log(this.yearIndex, i, "bbbb");
       }
       this.yearIndex = i;
     },
@@ -252,40 +248,40 @@
       const data = [
         {
           name: "娴烽棬",
-          value: 9,
+          value: 9
         },
         {
           name: "閲戞槍",
-          value: 19,
+          value: 19
         },
         {
           name: "娉夊窞",
-          value: 21,
+          value: 21
         },
         {
           name: "琛㈠窞",
-          value: 177,
+          value: 177
         },
         {
           name: "寤婂潑",
-          value: 193,
+          value: 193
         },
         {
           name: "鑿忔辰",
-          value: 194,
+          value: 194
         },
         {
           name: "鍚堣偉",
-          value: 229,
+          value: 229
         },
         {
           name: "姝︽眽",
-          value: 273,
+          value: 273
         },
         {
           name: "鍟婁笁澶х熆鍙婅鍒板簳鏄皝寤哄+澶уか澶у笀鍌呭氨",
-          value: 279,
-        },
+          value: 279
+        }
       ];
       const geoCoordMap = {
         娴烽棬: [121.15, 31.89],
@@ -315,7 +311,7 @@
         鑿忔辰: [115.480656, 35.23375],
         鍚堣偉: [117.27, 31.86],
         姝︽眽: ["浣犲ソ", 30.52],
-        鍟婁笁澶х熆鍙婅鍒板簳鏄皝寤哄+澶уか澶у笀鍌呭氨: [125.03, 46.58],
+        鍟婁笁澶х熆鍙婅鍒板簳鏄皝寤哄+澶уか澶у笀鍌呭氨: [125.03, 46.58]
       };
       const convertData = function (data) {
         var res = [];
@@ -324,7 +320,7 @@
           if (geoCoord) {
             res.push({
               name: data[i].name,
-              value: geoCoord.concat(data[i].value),
+              value: geoCoord.concat(data[i].value)
             });
           }
         }
@@ -332,7 +328,7 @@
       };
       option = {
         tooltip: {
-          trigger: "item",
+          trigger: "item"
         },
         bmap: {
           center: [104.114129, 37.550339], // 璋冩暣鍦板浘涓績鐐逛綅缃�
@@ -344,60 +340,60 @@
                 featureType: "water",
                 elementType: "all",
                 stylers: {
-                  color: "#d1d1d1",
-                },
+                  color: "#d1d1d1"
+                }
               },
               {
                 featureType: "land",
                 elementType: "all",
                 stylers: {
-                  color: "#f3f3f3",
-                },
+                  color: "#f3f3f3"
+                }
               },
               {
                 featureType: "manmade",
                 elementType: "all",
                 stylers: {
-                  color: "#d1d1d1",
-                },
+                  color: "#d1d1d1"
+                }
               },
               {
                 featureType: "local",
                 elementType: "all",
                 stylers: {
-                  color: "#d1d1d1",
-                },
+                  color: "#d1d1d1"
+                }
               },
               {
                 featureType: "arterial",
                 elementType: "labels",
                 stylers: {
-                  visibility: "off",
-                },
+                  visibility: "off"
+                }
               },
               {
                 featureType: "boundary",
                 elementType: "all",
                 stylers: {
-                  color: "#fefefe",
-                },
+                  color: "#fefefe"
+                }
               },
               {
                 featureType: "building",
                 elementType: "all",
                 stylers: {
-                  color: "#d1d1d1",
-                },
+                  color: "#d1d1d1"
+                }
               },
               {
                 featureType: "label",
                 elementType: "labels.text.fill",
                 stylers: {
-                  color: "#999999",
-                },
-              },
-            ],
-          },
+                  color: "#999999"
+                }
+              }
+            ]
+          }
         },
         series: [
           {
@@ -414,11 +410,11 @@
               return val[2] / 10;
             },
             encode: {
-              value: 2,
+              value: 2
             },
             showEffectOn: "render",
             rippleEffect: {
-              brushType: "stroke",
+              brushType: "stroke"
             },
             label: {
               formatter: "{b}",
@@ -436,30 +432,28 @@
               },
               show: true,
               fontSize: 12,
-              borderRadius: 30,
+              borderRadius: 30
             },
             itemStyle: {
               shadowBlur: 10,
-              shadowColor: "#333",
+              shadowColor: "#333"
             },
             emphasis: {
-              scale: true,
+              scale: true
             },
-            zlevel: 1,
-          },
-        ],
+            zlevel: 1
+          }
+        ]
       };
       let menuNav1 = this.menuNav;
       let menuNav2 = this.menuNav;
       // 璁剧疆鐐瑰嚮浜嬩欢鐩戝惉
       myChart.on("click", (params) => {
         // menuNav2 = !menuNav1
-        // console.log(menuNav);
         if (params.componentType === "series") {
           var dataName = params.data.name; // 鑾峰彇鐐瑰嚮鐨勬暟鎹悕绉�
           var dataValue = params.data.value; // 鑾峰彇鐐瑰嚮鐨勬暟鎹��
           // 鍦ㄨ繖閲屽彲浠ユ牴鎹渶瑕佸鐞嗙偣鍑讳簨浠讹紝姣斿寮瑰嚭瀵瑰簲鏁版嵁鐨勮缁嗕俊鎭瓑鎿嶄綔
-          // console.log('鐐瑰嚮浜�', dataName, '鏁版嵁锛屾暟鍊间负', dataValue);
           // 杩欓噷鍙互缂栧啓瑙﹀彂鏃堕棿鑾峰彇瀵瑰簲鏁版嵁淇℃伅鐨勯�昏緫
           this.spaceTimeArr(params);
         }
@@ -472,9 +466,8 @@
       // 淇敼 Vue 缁勪欢鐨勬暟鎹紝渚嬪鏄剧ず鑿滃崟瀵艰埅
       this.menuNav = !this.menuNav;
       // 鏃剁┖鍦板浘鐨勬暟鎹�
-      console.log(Arr);
-    },
-  },
+    }
+  }
 };
 </script>
 
@@ -484,7 +477,7 @@
   width: 0.6rem;
   height: 0.24rem;
   top: 1rem;
-  left: 0.24rem;
+  left: 0.6rem;
   z-index: 99999;
   font-size: 0.12rem;
   display: flex;
@@ -578,9 +571,41 @@
   height: 100%;
 }
 #map {
-  height: 1080px;
+  height: 100%;
   width: 100%;
   margin: 0 auto;
   font-size: 14px !important;
 }
+::v-deep .map-circle-name {
+  width: 20px;
+  height: 20px;
+  border-radius: 50%;
+  background-color: rgb(222, 142, 102);
+}
+
+::v-deep .ripple {
+  border-radius: 50%;
+  position: relative;
+  overflow: hidden;
+}
+
+::v-deep .ripple::before {
+  content: "";
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  width: 150%; /* Ensure it covers the entire parent */
+  height: 150%;
+  background: rgba(255, 255, 255, 0.5);
+  border-radius: 50%;
+  transform: translate(-50%, -50%) scale(1);
+  animation: ripple-animation 1s infinite linear;
+}
+
+@keyframes ripple-animation {
+  to {
+    transform: translate(-50%, -50%) scale(0);
+    opacity: 0;
+  }
+}
 </style>

--
Gitblit v1.9.1