From d5f572496c5fb12fec2fe346b847bf58331299c9 Mon Sep 17 00:00:00 2001 From: YM <479443481@qq.com> Date: 星期三, 17 七月 2024 15:56:51 +0800 Subject: [PATCH] 1 --- src/pages/characterMap/characterMap.vue | 83 +++++++++++++++++++++-------------------- 1 files changed, 43 insertions(+), 40 deletions(-) diff --git a/src/pages/characterMap/characterMap.vue b/src/pages/characterMap/characterMap.vue index 84100fd..a4f33a5 100644 --- a/src/pages/characterMap/characterMap.vue +++ b/src/pages/characterMap/characterMap.vue @@ -1,8 +1,10 @@ <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> @@ -12,7 +14,7 @@ <view class="font-family" style="font-size: 0.26rem; padding-top: 0.16rem; font-weight: bold" - >{{ activityInfo.participants }}</view + >{{ basicInfo.name }}</view > <ul style=" @@ -23,15 +25,15 @@ line-height: 0.28rem; " > - <li>鍑虹敓浜巤{ basicInfo.nativePlace }}</li> + <li>鍑虹敓浜巤{ basicInfo.nativePlace || "-" }}</li> <li> - {{ - basicInfo.birthYear + - basicInfo.nativePlace + - "(浠�" + - basicInfo.nowPlace + - ")" - }} + <span v-if="basicInfo.birthYear">{{ basicInfo.birthYear }}</span> + <span v-if="basicInfo.nativePlace">{{ + basicInfo.nativePlace + }}</span> + <span v-if="basicInfo.nowPlace" + >锛堜粖{{ basicInfo.nowPlace }}锛�</span + > </li> </ul> <ul @@ -42,18 +44,18 @@ line-height: 0.28rem; " > - <li>娲诲姩鍚嶇О锛歿{ activityInfo.activityName }}</li> - <li>娲诲姩鍦扮偣锛歿{ activityInfo.activityAddr }}</li> - <li>娲诲姩鍖洪棿锛歿{ activityInfo.time }}</li> - <li>娲诲姩鎻忚堪锛歿{ activityInfo.desc }}</li> - <li>鍙備笌浜哄憳锛歿{ activityInfo.participants }}</li> + <li>娲诲姩鍚嶇О锛歿{ activityInfo.activityName || "-" }}</li> + <li>娲诲姩鍦扮偣锛歿{ activityInfo.activityAddr || "-" }}</li> + <li>娲诲姩鍖洪棿锛歿{ activityInfo.time || "-" }}</li> + <li>娲诲姩鎻忚堪锛歿{ activityInfo.desc || "-" }}</li> + <li>鍙備笌浜哄憳锛歿{ activityInfo.participants || "-" }}</li> </ul> <!-- <img style="width: 100%; height: 2rem" src="https://img0.baidu.com/it/u=1845740325,2917001370&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1711731600&t=0b208ab46e1d33aa81ac31dd6bf627be" alt="" /> --> - <div class="box" style="width: 80%"> + <!-- <div class="box" style="width: 80%"> <span class="span" :style="{ marginLeft: spanML + 'rem' }" >{{ span }}骞�</span > @@ -67,7 +69,7 @@ </div> <div class="MX"></div> <div class="cursor" :style="{ marginLeft: cursorML + 'rem' }"></div> - </div> + </div> --> </el-dialog> </view> </view> @@ -77,8 +79,8 @@ import * as echarts from "echarts"; import "echarts/extension/bmap/bmap"; import { loadBMap } from "@/static/map.js"; -import "leaflet.chinatmsproviders"; import L from "leaflet"; +import "leaflet.chinatmsproviders"; import { getPersonInfo } from "@/api/index.js"; export default { data() { @@ -95,7 +97,13 @@ spanML: 0, cursorML: -0.05, activityInfo: {}, - basicInfo: {}, + basicInfo: { + name: "", + birthYear: "", + deathYear: "", + nativePlace: "", + nowPlace: "", + }, }; }, @@ -108,7 +116,6 @@ // this.aaa(); // }); this.$route; - console.log(this.$route, "this.$route"); this.getPersonInfoFun(); this.getBasicInfo(); }, @@ -129,6 +136,13 @@ key: "76bc34ead7e30e663a4eded8aeaf5860", maxZoom: 18, minZoom: 5, + }) + .addTo(map); + L.tileLayer + .chinaProvider("TianDiTu.Normal.Annotion", { + key: "76bc34ead7e30e663a4eded8aeaf5860", + maxZoom: 18, + minZoom: 3, }) .addTo(map); let DefaultIcon1 = L.icon({ @@ -158,8 +172,8 @@ }, // 杩斿洖鎸夐挳 - getBack() { - uni.navigateBack(); + goBack() { + this.$router.go(-1); }, aaa() { // 娓叉煋姣嶇嚎 @@ -181,7 +195,6 @@ id: this.$route.query.id, type: "PERSON_SPACE_TIME", }).then((res) => { - console.log(res, "res"); this.initMap(res.object.personSpaceTimeList); }); }, @@ -191,7 +204,6 @@ id: this.$route.query.id, type: "PERSON_BASIC", }).then((res) => { - console.log(res, "res"); this.basicInfo.name = res.object.personFieldList.find( (f) => f.fieldName == "WEAK_NAME" ).content1; @@ -207,16 +219,14 @@ this.basicInfo.nowPlace = res.object.personFieldList.find( (f) => f.fieldName == "NATIVE_PLACE" ).content2; - // this.initMap(res.object.personSpaceTimeList); + console.log(this.basicInfo); }); }, 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++) { @@ -226,7 +236,6 @@ // scale.addEventListener("click", this.scaleClick) // scales.appendChild(scale) // } - // console.log(arr[0]); }, handleSliderChange(value) { @@ -234,16 +243,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; }, @@ -459,12 +465,10 @@ // 璁剧疆鐐瑰嚮浜嬩欢鐩戝惉 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); } @@ -477,7 +481,6 @@ // 淇敼 Vue 缁勪欢鐨勬暟鎹紝渚嬪鏄剧ず鑿滃崟瀵艰埅 this.menuNav = !this.menuNav; // 鏃剁┖鍦板浘鐨勬暟鎹� - console.log(Arr); }, }, }; @@ -489,7 +492,7 @@ width: 0.6rem; height: 0.24rem; top: 1rem; - left: 0.24rem; + left: 0.6rem; z-index: 99999; font-size: 0.12rem; display: flex; @@ -567,9 +570,9 @@ margin: 0 !important; position: absolute; right: 0; - top: 0; + top: 86px; + bottom: 0; width: 4rem; - height: 100%; } .particulars ::v-deep .el-dialog__header { -- Gitblit v1.9.1