|
@@ -64,7 +64,7 @@ $(function () {
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: PATH + '/mapdata/getMapDataAll',
|
|
|
- // url: "http://192.168.0.230:7777/mapdata/getMapDataAll",
|
|
|
+ // url: "http://192.168.1.253:7777/mapdata/getMapDataAll",
|
|
|
async: false,
|
|
|
success: function (res) {
|
|
|
$.each(res.data.xxs, function(i){
|
|
@@ -402,20 +402,38 @@ $(function () {
|
|
|
|
|
|
// 渲染点击小学等的结果页面样式
|
|
|
function applyClickList(){
|
|
|
- $('.show-first').hide();
|
|
|
- // $('.show-fifth').show();
|
|
|
- $('.show-fifth').fadeIn(500);
|
|
|
- $('.right-map').css('height', hlHeight);
|
|
|
- var rmHeight = window.outerHeight - $('.right-map').innerHeight() - $('.head').innerHeight();
|
|
|
- var windowHeight = $('.right-map').innerHeight() - $('.head').innerHeight() + 45;
|
|
|
- var spWidth = ($('.show-fifth').innerWidth() - $('.wrap_result').innerWidth())/2;
|
|
|
- $('.wrap_result').css({'top': spWidth,'left': spWidth});
|
|
|
- $('.title-second').css({'top':windowHeight,'left': spWidth});
|
|
|
- $('.show-fifth').css('height',rmHeight);
|
|
|
- $('.right-search').hide().css('top', '0px');
|
|
|
- // $('.top_search').show();
|
|
|
- $('.top_search').fadeIn(500);
|
|
|
- $('.wrap_handle').hide()
|
|
|
+ let ran = navigator.userAgent
|
|
|
+ let isIOS = !!ran.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
|
|
|
+ if (isIOS){
|
|
|
+ var hBHeight = (window.outerHeight - $('.head').outerHeight())/2;
|
|
|
+ $('.show-fifth').fadeIn(500).siblings().fadeOut(50);
|
|
|
+ $('.right-map').css('height', hBHeight);
|
|
|
+ var wsHeight = window.outerHeight - $('.right-map').innerHeight() - $('.head').innerHeight() - 11;
|
|
|
+ var windowHeight = window.outerHeight - $('.right-map').innerHeight() - $('.head').innerHeight();
|
|
|
+ var spWidth = ($('.show-fifth').innerWidth() - $('.wrap_result').innerWidth())/2;
|
|
|
+ $('.title-second').css({'top':windowHeight,'left': spWidth});
|
|
|
+ $('.show-fifth').css('height',hBHeight);
|
|
|
+ $('.wrap_result').css('height',wsHeight);
|
|
|
+ $('.right-search').hide().css('top', '0px');
|
|
|
+ $('.top_search').fadeIn(500);
|
|
|
+ $('.wrap_handle').hide();
|
|
|
+ $('body').css('overflow','hidden');
|
|
|
+ }else{
|
|
|
+ $('.show-fifth').fadeIn(500).siblings().fadeOut(50);
|
|
|
+ var rmHeight = window.outerHeight - $('.right-map').innerHeight() - $('.head').innerHeight();
|
|
|
+ var wsHeight = window.outerHeight - $('.right-map').innerHeight() - $('.head').innerHeight() - 11;
|
|
|
+ var windowHeight = $('.right-map').innerHeight() - $('.head').innerHeight() + 45;
|
|
|
+ var spWidth = ($('.show-fifth').innerWidth() - $('.wrap_result').innerWidth())/2;
|
|
|
+ // $('.wrap_result').css({'top': spWidth,'left': spWidth});
|
|
|
+ $('.title-second').css({'top':windowHeight,'left': spWidth});
|
|
|
+ $('.show-fifth').css('height',rmHeight);
|
|
|
+ $('.wrap_result').css('height',wsHeight);
|
|
|
+ $('.right-search').hide().css('top', '0px');
|
|
|
+ // $('.top_search').show();
|
|
|
+ $('.top_search').fadeIn(500);
|
|
|
+ $('.wrap_handle').hide();
|
|
|
+ $('.wrap_result1').scrollTop(0)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 点击弹窗以外的区域隐藏弹窗
|
|
@@ -1972,14 +1990,6 @@ $(function () {
|
|
|
$('.back_top').hide();
|
|
|
});
|
|
|
|
|
|
- // $('input').keyup(function(){
|
|
|
- // var reg = /\s/gi;
|
|
|
- // var val = $(this).val();
|
|
|
- // if (reg.test(val)) {
|
|
|
- // $(this).val($(this).val().replace(reg, ''));
|
|
|
- // }
|
|
|
- // })
|
|
|
-
|
|
|
// 输入框失焦时,地图恢复拖动
|
|
|
$('input').blur(function(){
|
|
|
var rsTop = $('.right-search').css('top');
|
|
@@ -2011,48 +2021,6 @@ $(function () {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- //获取原窗口的高度
|
|
|
- // let originalHeight = document.documentElement.clientHeight || document.body.clientHeight
|
|
|
- // window.onresize = function() {
|
|
|
- // //键盘弹起与隐藏都会引起窗口的高度发生变化
|
|
|
- // let resizeHeight = document.documentElement.clientHeight || document.body.clientHeight
|
|
|
- // if (resizeHeight < originalHeight) {
|
|
|
- // //当键盘弹起,在此处操作
|
|
|
- // // var rmHeight = window.outerHeight - $('.right-map').innerHeight() - $('.head').innerHeight();
|
|
|
- // // $('.show-first').css('height',rmHeight)
|
|
|
- // // $('.show-second').css('height',rmHeight)
|
|
|
- // // $('.show-third').css('height',rmHeight)
|
|
|
- // // $('.show-fourth').css('height',rmHeight)
|
|
|
- // // $('.show-fifth').css('height',rmHeight)
|
|
|
- // // $('.wrap_result').css('height',rmHeight)
|
|
|
- // // $('.wrap_result1').css('height',rmHeight)
|
|
|
- // } else {
|
|
|
- // //当键盘收起,在此处操作
|
|
|
- // var rmHeight = window.outerHeight - $('.right-map').innerHeight() - $('.head').innerHeight();
|
|
|
- // // $('.wrap_result').css('height',rmHeight)
|
|
|
- // // $('.wrap_result1').css('height',rmHeight)
|
|
|
- // $('.show-fourth').css('height',rmHeight)
|
|
|
- // $('.show-fifth').css('height',rmHeight)
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // $(document).on('focusin', function () {
|
|
|
- // // 软键盘弹出的事件处理
|
|
|
- // });
|
|
|
-
|
|
|
- // $(document).on('focusout', function () {
|
|
|
- // // 软键盘收起的事件处理
|
|
|
- // var rmHeight = window.outerHeight - $('.right-map').innerHeight() - $('.head').innerHeight();
|
|
|
- // $('.wrap_result').css('height',rmHeight)
|
|
|
- // $('.wrap_result1').css('height',rmHeight)
|
|
|
- // $('.show-fourth').css('height',rmHeight)
|
|
|
- // $('.show-fifth').css('height',rmHeight)
|
|
|
- // });
|
|
|
-
|
|
|
- // const ua = window.navigator.userAgent.toLocaleLowerCase();
|
|
|
- // const isIOS = /iphone|ipad|ipod/.test(ua);
|
|
|
- // const isAndroid = /android/.test(ua);
|
|
|
-
|
|
|
// 点击头部的公交和自驾时切换
|
|
|
$('.search-change li').click(function(){
|
|
|
var gjzjtext = $(this).text();
|
|
@@ -3037,13 +3005,12 @@ $(function () {
|
|
|
if (searchInp == '' || searchInp == null) {
|
|
|
layer.msg('输入的值不能为空!');
|
|
|
}else{
|
|
|
+ var wsHeight = window.outerHeight - $('.right-map').innerHeight() - $('.head').innerHeight() - 11;
|
|
|
+ var rmHeight = window.outerHeight - $('.right-map').innerHeight() - $('.head').innerHeight();
|
|
|
+ $('.wrap_result1').css('height',wsHeight);
|
|
|
+ $('.show-fourth').css('height',rmHeight);
|
|
|
searchJSON(searchInp);
|
|
|
}
|
|
|
- // var rmHeight = window.outerHeight - $('.right-map').innerHeight() - $('.head').innerHeight();
|
|
|
- // $('.wrap_result').css('height',rmHeight)
|
|
|
- // $('.wrap_result1').css('height',rmHeight)
|
|
|
- // $('.show-fourth').css('height',rmHeight)
|
|
|
- // $('.show-fifth').css('height',rmHeight)
|
|
|
});
|
|
|
|
|
|
$('.inp').bind('keyup',function(event) {
|
|
@@ -3056,25 +3023,16 @@ $(function () {
|
|
|
if (searchInp == '' || searchInp == null) {
|
|
|
layer.msg('输入的值不能为空!');
|
|
|
} else {
|
|
|
+ var wsHeight = window.outerHeight - $('.right-map').innerHeight() - $('.head').innerHeight() - 11;
|
|
|
+ var rmHeight = window.outerHeight - $('.right-map').innerHeight() - $('.head').innerHeight();
|
|
|
+ $('.wrap_result1').css('height',wsHeight);
|
|
|
+ $('.show-fourth').css('height',rmHeight);
|
|
|
searchJSON(searchInp);
|
|
|
}
|
|
|
document.activeElement.blur(); // 关闭软键盘
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- // $('input').keydown(function(e) {
|
|
|
- // if (e.keyCode == 32) {
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // });
|
|
|
- // $('.inp').blur(function(){
|
|
|
- // var rmHeight = window.outerHeight - $('.right-map').innerHeight() - $('.head').innerHeight();
|
|
|
- // $('.wrap_result').css('height',rmHeight)
|
|
|
- // $('.wrap_result1').css('height',rmHeight)
|
|
|
- // $('.show-fourth').css('height',rmHeight)
|
|
|
- // $('.show-fifth').css('height',rmHeight)
|
|
|
- // });
|
|
|
-
|
|
|
function searchJSON(searchInp){
|
|
|
$('.show-fourth').show().siblings().hide();
|
|
|
$('.right-search').hide();
|
|
@@ -3133,14 +3091,14 @@ $(function () {
|
|
|
var rmHeight = window.outerHeight - $('.right-map').innerHeight() - $('.head').innerHeight();
|
|
|
var windowHeight = $('.right-map').innerHeight() - $('.head').innerHeight() + 45;
|
|
|
var spWidth = ($('.show-fourth').innerWidth() - $('.wrap_result1').innerWidth())/2;
|
|
|
- $('.wrap_result1').css({'top': spWidth,'left': spWidth});
|
|
|
+ // $('.wrap_result1').css({'top': spWidth,'left': spWidth});
|
|
|
$('.title-second').css({'top':windowHeight,'left': spWidth});
|
|
|
} else {
|
|
|
$('.show-fourth').show().siblings().hide();
|
|
|
$('.right-map').css('height', hlHeight);
|
|
|
var windowHeight = $('.right-map').innerHeight() - $('.head').innerHeight() + 45;
|
|
|
var spWidth = ($('.show-fourth').innerWidth() - $('.wrap_result1').innerWidth())/2;
|
|
|
- $('.wrap_result1').css({'top': spWidth,'left': spWidth});
|
|
|
+ // $('.wrap_result1').css({'top': spWidth,'left': spWidth});
|
|
|
$('.title-second').css({'top':windowHeight,'left': spWidth});
|
|
|
$('.right-search').hide();
|
|
|
$('.top_search').show();
|
|
@@ -3176,7 +3134,7 @@ $(function () {
|
|
|
$('.show-fourth').show().siblings().hide();
|
|
|
var windowHeight = $('.right-map').innerHeight() - $('.head').innerHeight() + 45;
|
|
|
var spWidth = ($('.show-fourth').innerWidth() - $('.wrap_result1').innerWidth())/2;
|
|
|
- $('.wrap_result1').css({'top': spWidth,'left': spWidth});
|
|
|
+ // $('.wrap_result1').css({'top': spWidth,'left': spWidth});
|
|
|
$('.title-second').css({'top':windowHeight,'left': spWidth});
|
|
|
$('.right-search').hide();
|
|
|
$('.right-map').show().siblings('.top_search').show();
|
|
@@ -3262,7 +3220,7 @@ $(function () {
|
|
|
var rmHeight = window.outerHeight - $('.right-map').innerHeight() - $('.head').innerHeight();
|
|
|
var windowHeight = $('.right-map').innerHeight() - $('.head').innerHeight() + 45;
|
|
|
var spWidth = ($('.show-fourth').innerWidth() - $('.wrap_result1').innerWidth())/2;
|
|
|
- $('.wrap_result1').css({'top': spWidth,'left': spWidth});
|
|
|
+ // $('.wrap_result1').css({'top': spWidth,'left': spWidth});
|
|
|
$('.title-second').css({'top':windowHeight,'left': spWidth});
|
|
|
$('.right-search').hide();
|
|
|
$('.top_search').show();
|