From c99cfa08505196fd6ba4d0ea8bd4dcf7a1fb268e Mon Sep 17 00:00:00 2001
From: YM <479443481@qq.com>
Date: 星期五, 07 六月 2024 16:27:53 +0800
Subject: [PATCH] 1

---
 src/pages/character/detail.vue |   63 +++++++++++++++++++++++++------
 1 files changed, 50 insertions(+), 13 deletions(-)

diff --git a/src/pages/character/detail.vue b/src/pages/character/detail.vue
index 0cc491b..e2f199c 100644
--- a/src/pages/character/detail.vue
+++ b/src/pages/character/detail.vue
@@ -416,7 +416,7 @@
   getPersonRelationAtSchool,
   getSpaceTime
 } from "@/api/index.js";
-import { getImg, getFile } from "@/static/tool.js";
+import { getImg } from "@/static/tool.js";
 import L from "leaflet";
 import "leaflet.chinatmsproviders";
 
@@ -541,7 +541,8 @@
   },
   methods: {
     copyText() {
-      const textToCopy = this.biogData[0].content + "\n鏉ユ簮锛氫腑鍖诲尰瀛︿汉鐗╃煡璇嗗簱";
+      const textToCopy =
+        this.biogData[0].content + "\n鏉ユ簮锛氫腑鍖诲尰瀛︿汉鐗╃煡璇嗗簱";
       const textarea = document.createElement("textarea");
       textarea.value = textToCopy;
       document.body.appendChild(textarea);
@@ -559,7 +560,7 @@
         window.open(item.url);
       }
       if (item.filePath) {
-        window.open(getFile(item.filePath));
+        window.open(getImg(item.filePath));
       }
     },
     getData() {
@@ -642,7 +643,14 @@
             },
             {
               name: "鎵�澶勬椂鏈�",
-              value: obj.dynastyDesc || "-"
+              value: obj.dynastyDesc || "-",
+              valueClick: () => {
+                uni.navigateTo({
+                  url:
+                    "/pages/knowledgeBase/knowledgeBase?dynasty=" +
+                    obj.dynastyId
+                });
+              }
             },
             {
               name: "姘戞棌",
@@ -662,7 +670,14 @@
             },
             {
               name: "鑱屽畼",
-              value: obj.official || "-"
+              value: obj.official || "-",
+              valueClick: () => {
+                uni.navigateTo({
+                  url:
+                    "/pages/knowledgeBase/knowledgeBase?isAdvancedSearch=1&official=" +
+                    obj.official
+                });
+              }
             },
             {
               name: "娴佹淳",
@@ -838,16 +853,23 @@
         personId: this.detailId
       }).then((res) => {
         if (res.list && res.list.length) {
-          const data = res.list.map((item) => {
-            return {
-              name: item.activityName,
-              value: [item.xcoord, item.ycoord]
-            };
-          });
+          const data = [];
+          for (let i = 0; i < res.list.length; i++) {
+            const item = res.list[i];
+            if (item.xcoord && item.ycoord) {
+              const obj = {
+                name: item.activityName,
+                value: [item.xcoord, item.ycoord]
+              };
+              data.push(obj);
+            }
+          }
           this.markerList = data;
           // 鏃剁┖鍦板浘
           // 杩欓噷鍙彇浜嗙涓�鏉★紝闇�瑕佸叏閮ㄦ暟鎹�
-          this.initMap(data[0]);
+          if (data && data.length) {
+            this.initMap(data);
+          }
         }
 
         // loadBMap("1NJdwrI1CfT6lrykVhDkmWgsO6O2bjQK").then(() => {
@@ -859,9 +881,16 @@
       var map = L.map("spaceTime", {
         preferCanvas: true,
         attributionControl: false
-      }).setView([markerList.value[1], markerList.value[0]], 13);
+      }).setView([markerList[0].value[1], markerList[0].value[0]], 13);
       L.tileLayer
         .chinaProvider("TianDiTu.Normal.Map", {
+          key: "76bc34ead7e30e663a4eded8aeaf5860",
+          maxZoom: 18,
+          minZoom: 3
+        })
+        .addTo(map);
+      L.tileLayer
+        .chinaProvider("TianDiTu.Normal.Annotion", {
           key: "76bc34ead7e30e663a4eded8aeaf5860",
           maxZoom: 18,
           minZoom: 3
@@ -876,6 +905,14 @@
       const temp_mark = L.marker([markerList.value[1], markerList.value[0]], {
         icon: icon
       }).addTo(map);
+      if (markerList.length) {
+        for (let i = 0; i < markerList.length; i++) {
+          const item = markerList[i];
+          const temp_mark = L.marker([item.value[1], item.value[0]], {
+            icon: icon
+          }).addTo(map);
+        }
+      }
     },
     // 鏀惧ぇ鍦板浘璺宠浆
     fangdaClick(index) {

--
Gitblit v1.9.1