This commit is contained in:
汪汇 2024-01-12 11:27:37 +08:00
parent db97a3e78a
commit e55214dbba
3 changed files with 125 additions and 155 deletions

View File

@ -1,15 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>优享地图</title>
</head>
<script type="text/javascript" src="http://api.tianditu.gov.cn/api?v=4.0&tk=4e6d9067f64ad8101ca0f4ceb7cb4083"></script>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>优享地图</title>
</head>
<script type="text/javascript" src="http://api.tianditu.gov.cn/api?v=4.0&tk=4e6d9067f64ad8101ca0f4ceb7cb4083" crossorigin></script>
<!-- <script src="https://cdn.bootcss.com/vConsole/3.3.0/vconsole.min.js" crossorigin></script> -->
<script>
// var vConsole = new VConsole();
</script>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

View File

@ -41,6 +41,7 @@
shape="round"
background="#4fc08d00"
placeholder=""
@change="getlist(dropdown.serch)"
/>
<van-dropdown-menu>
<van-dropdown-item
@ -65,22 +66,18 @@
>
<img class="imgse" :src="item.img" alt="" />
<div class="bodys">
<div class="bt">{{ item.name }}</div>
<div class="bt">{{ item.fu_wu_ti_gong_dan_wei_ming_chen }}</div>
<div class="dz">
<div class="tp">
<img class="ims" src="../assets/home/dz.png" alt="" />
</div>
<div class="zl">{{ item.jl }}</div>
<div class="xxdz">{{ item.dz }}</div>
<!-- <div class="tp">
<img class="ims" src="../assets/home/dz.png" alt="" />
</div> -->
<!-- <div class="zl">{{ 100 }}</div> -->
<div class="xxdz">{{ item.xiang_xi_di_zhi }}</div>
</div>
<div class="bq">
<van-tag
v-for="(items, index) in item.tag"
:key="index"
plain
type="primary"
>{{ items }}</van-tag
>
<van-tag plain type="primary">{{
item.fu_wu_ti_gong_dan_wei_lei_xing
}}</van-tag>
</div>
</div>
</div>
@ -91,7 +88,7 @@
<script setup>
import http from "@/utils/request";
import { onMounted, ref, reactive } from "vue";
import { onMounted, ref, reactive, nextTick } from "vue";
import img1 from "@/assets/home/yysy.png";
import img2 from "@/assets/home/yysyxz.png";
import img3 from "@/assets/home/xyyj.png";
@ -110,7 +107,7 @@ import img15 from "@/assets/home/yxfw.png";
import img16 from "@/assets/home/yxfwxz.png";
import img17 from "@/assets/home/yy.png";
import img18 from "@/assets/home/wdwz.png";
const kisty = ref(false);
var map = null;
var control = null;
var T = window.T;
@ -125,109 +122,13 @@ const dropdown = reactive({
option1: [{ text: "智能排序", value: 0 }],
option2: [{ text: "位置距离", value: 0 }],
option3: [{ text: "其他筛选", value: 0 }],
rmyy: [
{
name: "象山第一人民医院",
img: "http://store.is.autonavi.com/showpic/756391e986455206891ae6d6c27ac430?type=pic",
tag: ["综合医院", "二级甲等"],
dz: "宁波市象山县东谷路289-291",
jl: "1公里",
zb: [121.88637, 29.47231],
},
{
name: "象山县中医医院(新院区)",
img: "https://aos-comment.amap.com/B0FFKGTE0P/headerImg/40db9d22bfd0099a2e3418da8f3e9c5b_2048_2048_80.jpg",
tag: ["中医医院"],
dz: "宁波市象山县南部新城兴洋路7号",
jl: "6.7公里",
zb: [121.90277, 29.43579],
},
{
name: "象山第三人民医院",
img: "http://store.is.autonavi.com/showpic/a0ff397c63274b1438755089ccc972d1?type=pic",
tag: ["综合医院", "二级医院"],
dz: "宁波市象山县丹西街道樟树下村",
jl: "3.8公里",
zb: [121.89218, 29.44957],
},
{
name: "丹城中心卫生院",
img: "http://store.is.autonavi.com/showpic/fee5ebf4dd4ccae1908faf4993d557bf?type=pic",
tag: ["卫生院"],
dz: "宁波市象山县上吴村254-2号",
jl: "2.5公里",
zb: [121.892122, 29.449637],
},
{
name: "象山爱尔眼科医院",
img: "http://store.is.autonavi.com/showpic/1d00880c0dce4c237df8499b20eda61d?type=pic",
tag: ["眼科医院"],
dz: "宁波市象山县丹西街道象山港路118号",
jl: "3.4公里",
zb: [121.86596, 29.4603],
},
{
name: "西港村卫生室",
img: "http://store.is.autonavi.com/showpic/aeec5aeacbb4deebb2530a060b37091a?type=pic",
tag: ["卫生院"],
dz: "宁波市象山县规划路与滨海大道交叉口东460米",
jl: "7.5公里",
zb: [121.910589, 29.422593],
},
{
name: "翁敬堂骨伤医院",
img: "http://store.is.autonavi.com/showpic/eb553882ac643ce7edba3074d2b27516?type=pic",
tag: ["骨科医院"],
dz: "宁波市象山县新丰路298号",
jl: "2.6公里",
zb: [121.87011, 29.46552],
},
{
name: "宁波口腔医院象山分院",
img: "http://store.is.autonavi.com/showpic/0ada714ce414813321099165da07151d?type=pic",
tag: ["口腔医院"],
dz: "宁波市象山县丹河东路1098号",
jl: "1.6公里",
zb: [121.898524, 29.461311],
},
{
name: "星城医院",
img: "http://store.is.autonavi.com/showpic/89bfcbf76b4b197a4fb94b10d49b7bf4?type=pic",
tag: ["综合医院"],
dz: "宁波市象山县丹河东路1086号",
jl: "1.7公里",
zb: [121.89456, 29.46375],
},
{
name: "宁波港城口腔医院",
img: "http://store.is.autonavi.com/showpic/d77f446fcacc052f9d1aed8554d125c8?type=pic",
tag: ["口腔医院"],
dz: "宁波市象山县丹东街道新华路269号",
jl: "1.6公里",
zb: [121.88508, 29.46631],
},
{
name: "益民口腔",
img: "http://store.is.autonavi.com/showpic/b742650078a06ec8443c31c94fa4c32c?type=pic",
tag: ["口腔诊所"],
dz: "台州市天台县和合北路161-17号",
jl: "917米",
zb: [121.89336, 29.47956],
},
{
name: "象山妇幼保健院",
img: "http://store.is.autonavi.com/showpic/b742650078a06ec8443c31c94fa4c32c?type=pic",
tag: ["妇幼医院"],
dz: "宁波市象山县城东路1号",
jl: "3公里",
zb: [121.87026, 29.48092],
},
],
rmyy: [],
serch: null,
});
const list = reactive({
page: 1,
size: 20,
size: 140,
show: true,
index: 0,
yxfw: [
@ -285,26 +186,60 @@ const list = reactive({
const init = () => {
map = new T.Map("mapDiv");
// map.setMapType(window.TMAP_SATELLITE_MAP);
map.centerAndZoom(new T.LngLat(121.89248, 29.47474), 12);
control = new T.Control.Zoom();
//
map.addControl(control);
control.setPosition(T_ANCHOR_TOP_RIGHT);
// var lo = new T.Geolocation();
// lo.getCurrentPosition(fn);
};
const fn = function (e) {
var icon = new T.Icon({
iconUrl: img18,
iconSize: new T.Point(28, 28),
iconAnchor: new T.Point(28, 28),
});
//
var marker = new T.Marker(new T.LngLat(121.89248, 29.47474), { icon: icon });
map.addOverLay(marker);
yxf();
let geocoder;
console.log(this.getStatus());
if (this.getStatus() == 0) {
map.centerAndZoom(e.lnglat, 15);
var marker = new T.Marker(e.lnglat, { icon: icon });
geocoder = new T.Geocoder();
geocoder.getLocation(e.lnglat, searchResult);
map.addOverLay(marker);
}
if (this.getStatus() == 1) {
map.centerAndZoom(e.lnglat, e.level);
var marker = new T.Marker(e.lnglat, { icon: icon });
geocoder = new T.Geocoder();
geocoder.getLocation(e.lnglat, searchResult);
map.addOverLay(marker);
}
if (this.getStatus() == 3) {
console.log(this.getStatus());
map.centerAndZoom(e.lnglat, 15);
var marker = new T.Marker(e.lnglat, { icon: icon });
geocoder = new T.Geocoder();
geocoder.getLocation(e.lnglat, searchResult);
map.addOverLay(marker);
}
};
const searchResult = function (result) {
if (result.getStatus() == 0) {
console.log(result.getAddress());
console.log("定位3成功信息", result.getAddress());
} else {
alert(result.getMsg());
console.log(result.getMsg());
}
};
const yxfwxz = (e) => {
list.index = e.id;
getlist(e.columnName);
dropdown.serch = e;
getlist(dropdown.serch);
list.page = 1;
};
const touchmove = (event) => {
@ -324,7 +259,8 @@ const yxf = () => {
iconSize: new T.Point(28, 28),
iconAnchor: new T.Point(28, 28),
});
var LngLats = new T.Marker(new T.LngLat(item.zb[0], item.zb[1]), {
let ss = item.xiang_xi_di_zhi_jing_wei_du.split(",");
var LngLats = new T.Marker(new T.LngLat(ss[0], ss[1]), {
icon: icons,
});
map.addOverLay(LngLats);
@ -333,33 +269,34 @@ const yxf = () => {
onMounted(() => {
init();
getlist();
columnList();
});
const columnList = (e) => {
http.get(`/srv/platform/map/columnList`).then((res) => {
if (res.code == 200) {
list.yxfw.forEach((elements, indexs) => {
list.yxfw[indexs].ids = res.data[elements.columnName];
});
}
getlist();
});
};
const getlist = (e) => {
let paly = {
// dataSearchDTO: {
column_id: 0,
keyword: "",
data_query: [
{
field: "",
condition: "",
value: "",
},
],
data_sorts: [
{
field: "",
sort_type: "",
},
],
// },
column_id: "",
keyword: dropdown.sesh,
data_query: [],
data_sorts: [],
};
let patle = "";
console.log();
if (!e) {
patle = "Childcare";
patle = list.yxfw[0].columnName;
paly.column_id = list.yxfw[0].ids;
} else {
patle = e;
patle = e.columnName;
paly.column_id = e.ids;
}
http
.post(
@ -368,7 +305,9 @@ const getlist = (e) => {
)
.then((res) => {
if (res.code == 200) {
console.log(res.data);
dropdown.rmyy = res.data;
map.clearOverLays();
yxf();
}
});
};
@ -377,6 +316,7 @@ const getlist = (e) => {
.home_body {
position: relative;
}
#mapDiv {
margin: 0px;
padding: 0px;
@ -384,6 +324,7 @@ const getlist = (e) => {
height: 80vh;
z-index: 0;
}
.yxfw {
margin-top: 15px;
margin-left: 16px;
@ -396,11 +337,13 @@ const getlist = (e) => {
text-align: center;
padding-bottom: 5px;
padding-top: 3px;
.yxfwtp {
width: 18px;
height: 18px;
margin: 2px auto 0;
}
.yxfwwz {
font-size: 8px;
font-family: PingFang SC, PingFang SC;
@ -408,6 +351,7 @@ const getlist = (e) => {
color: #4379ff;
line-height: 5px;
}
.yxfwwzs {
font-size: 8px;
font-family: PingFang SC, PingFang SC;
@ -416,6 +360,7 @@ const getlist = (e) => {
line-height: 5px;
}
}
.yxfwnr {
margin-top: 72px;
margin-left: 16px;
@ -425,12 +370,14 @@ const getlist = (e) => {
border-radius: 6px 6px 6px 6px;
opacity: 1;
text-align: center;
.fgx {
width: 50%;
height: 5px;
border-bottom: 1px solid #f1f1f1;
margin: 0 auto 3px;
}
.yxfws {
z-index: 2;
width: 40px;
@ -444,6 +391,7 @@ const getlist = (e) => {
height: 18px;
margin: 4px auto 0;
}
.yxfwwz {
font-size: 8px;
font-family: PingFang SC, PingFang SC;
@ -451,6 +399,7 @@ const getlist = (e) => {
color: #4379ff;
line-height: 8px;
}
.yxfwwzs {
font-size: 8px;
font-family: PingFang SC, PingFang SC;
@ -460,22 +409,26 @@ const getlist = (e) => {
}
}
}
.card {
width: 100%;
height: calc(100% - 132px);
overflow: auto;
padding-bottom: 80px;
.cardlist {
background-color: #fff;
padding: 14px 16px 0;
width: 100%;
height: 80px;
display: flex;
.imgse {
width: 100px;
border-radius: 3px;
height: 68px;
}
.bodys {
border-bottom: 1px solid #f1f1f1;
height: 68px;
@ -489,10 +442,12 @@ const getlist = (e) => {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
.van-tag--primary.van-tag--plain {
margin-right: 2px;
}
}
.bt {
font-size: 14px;
font-family: PingFang SC, PingFang SC;
@ -503,6 +458,7 @@ const getlist = (e) => {
white-space: nowrap;
text-overflow: ellipsis;
}
.dz {
font-size: 12px;
font-family: PingFang SC, PingFang SC;
@ -514,15 +470,18 @@ const getlist = (e) => {
text-overflow: ellipsis;
padding-top: 2px;
display: flex;
.tp {
width: 12px;
}
.xxdz {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
width: 170px;
}
.zl {
padding-right: 5px;
}
@ -535,10 +494,12 @@ const getlist = (e) => {
}
}
}
:deep(.van-dropdown-menu__bar) {
box-shadow: 0 0px 0px rgba(100, 101, 102, 0.12);
border-bottom: 1px solid #f1f1f1;
}
.tzhz {
width: 100px;
height: 6px;
@ -548,9 +509,11 @@ const getlist = (e) => {
margin: 10px auto 10px;
background-color: #eaeaea;
}
:deep(.tdt-bar a, .tdt-bar a:hover) {
color: #cacaca;
}
:deep(.van-search) {
padding: 0px 12px 10px;
}

View File

@ -13,7 +13,7 @@ export default defineConfig({
// changeOrigin: true,
// },
'/srv': {
target: 'http://192.168.1.98:10001/',//沈涛
target: 'http://36.140.118.172:88',//沈涛
changeOrigin: true,
},