Browse Source

修改样式,同时添加一个起点自动定位

李雪梅 2 years ago
parent
commit
0a87510cb9

+ 13 - 11
nngkxxdp/src/main/resources/static/district/css/sy_mobile_new.css

@@ -235,7 +235,11 @@ a {
 	justify-content: center;
 }
 .img_tab{
+	display: flex;
+	flex-wrap: wrap;
+	justify-content: center;
 	position: relative;
+	margin-bottom: 5px;
 }
 .gn_img{
 	width: 10.66666vw;
@@ -267,10 +271,8 @@ a {
     border-bottom: 2px solid #176AB7;
 }
 .flex_text{
-	width: 181%;
-	position: absolute;
-	top: 55%;
-	left: -41%;
+	/* width: 181%; */
+	/* position: absolute; */
 	text-align: center;
 	font-size: 12px;
 	font-family: Microsoft YaHei;
@@ -283,10 +285,10 @@ a {
 	position: absolute;
 	z-index: 9999;
 	border-top: 3px solid #2775CC;
-	top: 84%;
+	top: 109%;
 }
 .lineFour{
-	right: -85%;
+	right: -18%;
 }
 .lineFour::after{
 	content: '';
@@ -300,7 +302,7 @@ a {
 	right: 12.5%;
 }
 .lineThree{
-	right: -286%;
+	right: -119%;
 }
 .lineThree::after{
 	content: '';
@@ -314,7 +316,7 @@ a {
 	right: 35.5%;
 }
 .lineTwo{
-	left: -286%;
+	left: -119%;
 }
 .lineTwo::after{
 	content: '';
@@ -328,7 +330,7 @@ a {
 	left: 35.5%;
 }
 .lineOne{
-	left: -85%;
+	left: -18%;
 }
 .lineOne::after{
 	content: '';
@@ -1066,9 +1068,9 @@ a {
     margin-bottom: 2.53333vw;
 	box-shadow: 0px 0px;
 }
-@media screen and (max-width: 374px) {
+/* @media screen and (max-width: 374px) {
 	.flex_text{
 		width: 213%;
 		left: -55%;
 	}
-}
+} */

+ 17 - 1
nngkxxdp/src/main/resources/static/district/js/sy_mobile.js

@@ -1953,7 +1953,7 @@ $(function () {
                 }
             }, '重庆市')
         })
-    })
+    });
 
     // 触发输入框时,地图不被拖动
     $('input').focus(function(){
@@ -2985,4 +2985,20 @@ $(function () {
     $('.show-fifth .back_top').click(function() {
         $('.wrap_result').scrollTop(0)
     });
+    
+    var geolocation = new BMap.Geolocation();
+    geolocation.getCurrentPosition(function(r){
+        if(this.getStatus() == BMAP_STATUS_SUCCESS){
+            var mk = new BMap.Marker(r.point);
+            map.addOverlay(mk);
+            map.panTo(r.point);
+            myGeo.getLocation(r.point, function(rs){
+                var addComp = rs.addressComponents;
+                $('#gj-one').val(addComp.district + addComp.street + addComp.streetNumber);
+                $('#zj-one').val(addComp.city+addComp.district+addComp.street + addComp.streetNumber);
+            })
+        } else {
+            // alert('未能获得您的定位,请手动输入起点');
+        }
+    }); 
 })