Skip to content

Commit

Permalink
fix: 世界地图
Browse files Browse the repository at this point in the history
  • Loading branch information
TiAmo authored and TiAmo committed Mar 19, 2024
1 parent 6130802 commit f84ec43
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
3 changes: 3 additions & 0 deletions src/assets/css/design/map.less
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
width: 110px;
height: 60px;
margin-bottom: 2px;
object-fit: cover;
}
.u-text {
color: white;
Expand Down Expand Up @@ -252,6 +253,8 @@
transform: translateX(-50%) translateY(-50%);
white-space: nowrap;
font-weight: bold;
-webkit-text-stroke: 1px rgba(0, 0, 0, 0.8);
// text-shadow: 0px 0px 5px black;
}
&:hover {
.u-item_bg {
Expand Down
4 changes: 2 additions & 2 deletions src/components/design/dragWrap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ export default {
if (delta < 0) {
// 向上滚动,放大元素
this.scale += scaleNum;
if (this.scale > 1.8) {
this.scale = 1.8;
if (this.scale > 1) {
this.scale = 1;
}
} else {
// 向下滚动,缩小元素
Expand Down
20 changes: 13 additions & 7 deletions src/components/design/map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,11 @@
<div
class="m-resource-box"
:class="{
'm-resource-box__hide': !(visible && produce[selectMapOptions.actId]),
'm-resource-box__hide': !visible,
}"
v-if="selectMap.city.length"
>
<template v-for="(val, key) in produce[selectMapOptions.actId]">
<template v-for="(val, key) in produce[selectMap.city[0].dwMapID]">
<div class="m-resource__item" :key="key">
<div class="u-item__title">
<span>{{ key }}</span>
Expand Down Expand Up @@ -274,7 +275,7 @@ export default {
children: [],
visible: false,
scale: { x: -122, y: -1400, scale: 0.35 },
scale: { x: -122, y: -1400, scale: 0.7 },
selectMap: {
city: [],
Expand Down Expand Up @@ -402,10 +403,11 @@ export default {
for (const key in list) {
if (list.hasOwnProperty(key)) {
// 将tips单独解析出来
const tip = extractTextContent(list[key]["Tip"])[0]?.text + "";
let tip = extractTextContent(list[key]["Tip"])[0]?.text + "";
tip = tip.replace(/\\/g, "");
// 以折行分组
const _list = tip.split("\\\\\\n").filter(Boolean);
// 找到对应的索引位置
const _list = tip.split("n").filter(Boolean);
// // 找到对应的索引位置
const _result = {};
let mineralIndex = _list.indexOf("矿物:");
let herbIndex = _list.indexOf("草药:");
Expand All @@ -425,7 +427,11 @@ export default {
},
showChild({ szChildCityMaps, szChildCopyMaps, Left, Top }, itemIndex) {
// 定位地图位置到当前选择位置
this.scale = { x: 4920 - Left - 2444, y: 3456 - Top - 2979, scale: 1 };
if (this.isIpad) {
this.scale = { x: 4920 - Left - 2550, y: 3456 - Top - 3150, scale: 1 };
} else {
this.scale = { x: 4920 - Left - 2444, y: 3456 - Top - 3150, scale: 1 };
}
let city = [];
let fb = [];
if (szChildCityMaps && szChildCityMaps.length) {
Expand Down

0 comments on commit f84ec43

Please sign in to comment.