From 1e8fc6f27416ef8b0e75e02d22bac201a7491778 Mon Sep 17 00:00:00 2001 From: didiyu <1293722656@qq.com> Date: 星期一, 19 十一月 2018 16:26:00 +0800 Subject: [PATCH] 加选择市,县的页面 --- gx_tieta/WebRoot/selectcounty.html | 150 +++++++++++++++++++++++++ gx_tieta/WebRoot/mobil/js/battNav.js | 4 gx_tieta/WebRoot/mobil/selectcity.html | 149 ++++++++++++++++++++++++ 3 files changed, 303 insertions(+), 0 deletions(-) diff --git a/gx_tieta/WebRoot/mobil/js/battNav.js b/gx_tieta/WebRoot/mobil/js/battNav.js index 12caf90..78867f6 100644 --- a/gx_tieta/WebRoot/mobil/js/battNav.js +++ b/gx_tieta/WebRoot/mobil/js/battNav.js @@ -15,6 +15,10 @@ setCookie("pages","1"); window.location.href="machineroomM.html"; } +function JumpcityPage(){ + setCookie("pages","3"); + window.location.href="selectcity.html"; +} //璺宠浆鍒扮數姹犵粍灞� function JumpThirdPage(){ diff --git a/gx_tieta/WebRoot/mobil/selectcity.html b/gx_tieta/WebRoot/mobil/selectcity.html new file mode 100644 index 0000000..8c330d6 --- /dev/null +++ b/gx_tieta/WebRoot/mobil/selectcity.html @@ -0,0 +1,149 @@ +<!doctype html> +<html> +<head> +<meta charset="utf-8"> +<title></title> +<meta name="viewport" content="width=device-width,initial-scale=1"> +<link rel="stylesheet" href="mobilCss/jquery.mobile-1.4.5.min.css"/> +<link rel="stylesheet" href="css/breadcrumb.css"> +<link rel="stylesheet" type="text/css" href="css/defined.popup.css"/> +<script type="text/javascript" src="mobilJs/jquery-1.8.2.js"></script> +<script type="text/javascript" src="mobilJs/jquery.mobile-1.4.5.min.js"></script> +<script type="text/javascript" src="mobilJs/base.js"></script> +</head> + <body> + <div data-role="page" tabindex="0" id="page0"> + <div data-role="header" data-position="fixed"> + <a href="machineroomM.html" target="_top" style="padding-top:0.7em;padding-bottom:0.7em;">杩斿洖</a> + <h1>甯�</h1> + </div> + + <div data-role="content"> + <ul class="breadcrumb"></ul> + <div id="battList"></div> + </div> + <div data-role="popup" id="myPopup" class="defined-popup"> + <div class="popup-container"> + <div class="popup-title">鏌ヨ鏁版嵁澶辫触</div> + <div class="popup-content"> + <div class="set-option"> + <p>璇疯缃尯/鍘�</p> + </div> + </div> + <div class="popup-footer"> + <div class="footer-float footer-left"> + <button type="button" id="right" data-mini="true" style="visibility: hidden;">纭畾</button> + </div> + <div class="footer-float footer-right"> + <button type="button" id="hidePopup" data-mini="true">鍙栨秷</button> + </div> + </div> + </div> + </div> + <div data-role="footer" data-position="fixed"> + <!-- <h1>绂忓厜鐢靛瓙鏈夐檺鍏徃</h1> --> + </div> + </div> + </body> + <script type="text/javascript" src="js/battNav.js"></script> + <script type="text/javascript"> + var citylist = new Array(); + + // 鍒濆鍖栭〉闈㈠唴瀹� + $(document).ready(function(){ + setCookie("city",null); + setCookie("county",null); + seachAllCity(); + }); + + // 鐐瑰嚮鍩庡競浜嬩欢 + $(function () { + var aLi = -1; + $('#battList').on('click', 'ul li', function () { + aLi = $(this).index(); + city = getbatt(citylist,aLi); + + var json=window.JSON.stringify(city); + setCookie("city",json); + window.location.href="selectcounty.html"; + }); + + }); + + // 瀹氫箟闈㈠寘灞戝鑸潯 + $(function(){ + var data = [ + {url: 'javascript:JumpHomePage();', txt: '棣栭〉'}, + {url: 'javascript:JumpFirstPage();', txt: '鐪�'}, + {url: 'javascript:;', txt: '甯�'} + ]; + addBreadCrumb($('.breadcrumb').eq(0),data); + }); + + //鏌ヨ鎵�鏈夋満鎴� + function seachAllCity(){ + loadshow(); + $.ajax({ + type: "post", + url: "", + async:true, + dataType:'text', + data:null, + success: function(data){ + data = eval('('+data+')'); + var model = eval('('+data.result+')'); + console.info(model); + if(model.code == 1){ + citylist = model.data; + createUl($('#battList'),model.data); + }else { + //alert(213); + $('#myPopup').popup('open'); + } + loadclose(); + }, + error:function(){ + loadclose(); + } + }); + } + + /* + 澹版槑涓�涓嚱鏁癱reateUl,鐢ㄤ簬鐢熸垚ul鍜宭i + @param ulCon ul鐨勫鍣� + @param dataList ul鐨勬暟鎹唴瀹� + */ + function createUl(ulCon, dataList) { + //console.info(index); + // 娓呯悊瀹瑰櫒涓嬬殑ul + ulCon.find('ul').remove(); + + // 鍒涘缓ul + var _ul = $('<ul data-role="listview" data-inset="true"></ul>'); + + // 閬嶅巻dataList鐢熸垚li鍜宎 + for (var i = 0; i < dataList.length; i++){ + var _li = $('<li></li'); + + var _a = $('<a href="#page1" value="" data-transition="slide">'+dataList[i].StationName+'</a>'); + + // 灏哶a娣诲姞鍒癬li锛屽皢_li娣诲姞鍒癬ul涓� + _li.append(_a); + _ul.append(_li); + } + + // 灏哶ul娣诲姞鍒板鍣ㄤ腑 + ulCon.append(_ul).trigger('create'); + loadclose(); + } + + //鑾峰彇褰撳墠閫変腑鐨刢ity + function getbatt(arr,index){ + if(arr.length>index){ + return arr[index]; + } + return undefined; + }; + </script> + +</html> \ No newline at end of file diff --git a/gx_tieta/WebRoot/selectcounty.html b/gx_tieta/WebRoot/selectcounty.html new file mode 100644 index 0000000..ddfba49 --- /dev/null +++ b/gx_tieta/WebRoot/selectcounty.html @@ -0,0 +1,150 @@ +<!doctype html> +<html> +<head> +<meta charset="utf-8"> +<title></title> +<meta name="viewport" content="width=device-width,initial-scale=1"> +<link rel="stylesheet" href="mobilCss/jquery.mobile-1.4.5.min.css"/> +<link rel="stylesheet" href="css/breadcrumb.css"> +<link rel="stylesheet" type="text/css" href="css/defined.popup.css"/> +<script type="text/javascript" src="mobilJs/jquery-1.8.2.js"></script> +<script type="text/javascript" src="mobilJs/jquery.mobile-1.4.5.min.js"></script> +<script type="text/javascript" src="mobilJs/base.js"></script> +</head> + <body> + <div data-role="page" tabindex="0" id="page0"> + <div data-role="header" data-position="fixed"> + <a href="selectcity.html" target="_top" style="padding-top:0.7em;padding-bottom:0.7em;">杩斿洖</a> + <h1>鍖�/鍘�</h1> + </div> + + <div data-role="content"> + <ul class="breadcrumb"></ul> + <div id="battList"></div> + </div> + <div data-role="popup" id="myPopup" class="defined-popup"> + <div class="popup-container"> + <div class="popup-title">鏌ヨ鏁版嵁澶辫触</div> + <div class="popup-content"> + <div class="set-option"> + <p>璇疯缃寘鏈虹粍</p> + </div> + </div> + <div class="popup-footer"> + <div class="footer-float footer-left"> + <button type="button" id="right" data-mini="true" style="visibility: hidden;">纭畾</button> + </div> + <div class="footer-float footer-right"> + <button type="button" id="hidePopup" data-mini="true">鍙栨秷</button> + </div> + </div> + </div> + </div> + <div data-role="footer" data-position="fixed"> + <!-- <h1>绂忓厜鐢靛瓙鏈夐檺鍏徃</h1> --> + </div> + </div> + </body> + <script type="text/javascript" src="js/battNav.js"></script> + <script type="text/javascript"> + var countylist = new Array(); + + // 鍒濆鍖栭〉闈㈠唴瀹� + $(document).ready(function(){ + setCookie("county",null); + setCookie("batt",null); + seachAllCounty(); + }); + + // 鐐瑰嚮鍩庡競浜嬩欢 + $(function () { + var aLi = -1; + $('#battList').on('click', 'ul li', function () { + aLi = $(this).index(); + county = getbatt(countrylist,aLi); + + var json=window.JSON.stringify(county); + setCookie("county",json); + window.location.href="battM.html"; + }); + + }); + + // 瀹氫箟闈㈠寘灞戝鑸潯 + $(function(){ + var data = [ + {url: 'javascript:JumpHomePage();', txt: '棣栭〉'}, + {url: 'javascript:JumpFirstPage();', txt: '鐪�'}, + {url: 'javascript:JumpcityPage();', txt: '甯�'}, + {url: 'javascript:;', txt: '鍖�/鍘�'} + ]; + addBreadCrumb($('.breadcrumb').eq(0),data); + }); + + //鏌ヨ鎵�鏈夋満鎴� + function seachAllCounty(){ + loadshow(); + $.ajax({ + type: "post", + url: "", + async:true, + dataType:'text', + data:null, + success: function(data){ + data = eval('('+data+')'); + var model = eval('('+data.result+')'); + console.info(model); + if(model.code == 1){ + countylist = model.data; + createUl($('#battList'),model.data); + }else { + //alert(213); + $('#myPopup').popup('open'); + } + loadclose(); + }, + error:function(){ + loadclose(); + } + }); + } + + /* + 澹版槑涓�涓嚱鏁癱reateUl,鐢ㄤ簬鐢熸垚ul鍜宭i + @param ulCon ul鐨勫鍣� + @param dataList ul鐨勬暟鎹唴瀹� + */ + function createUl(ulCon, dataList) { + //console.info(index); + // 娓呯悊瀹瑰櫒涓嬬殑ul + ulCon.find('ul').remove(); + + // 鍒涘缓ul + var _ul = $('<ul data-role="listview" data-inset="true"></ul>'); + + // 閬嶅巻dataList鐢熸垚li鍜宎 + for (var i = 0; i < dataList.length; i++){ + var _li = $('<li></li'); + + var _a = $('<a href="#page1" value="" data-transition="slide">'+dataList[i].StationName+'</a>'); + + // 灏哶a娣诲姞鍒癬li锛屽皢_li娣诲姞鍒癬ul涓� + _li.append(_a); + _ul.append(_li); + } + + // 灏哶ul娣诲姞鍒板鍣ㄤ腑 + ulCon.append(_ul).trigger('create'); + loadclose(); + } + + //鑾峰彇褰撳墠閫変腑鐨刢ounty + function getbatt(arr,index){ + if(arr.length>index){ + return arr[index]; + } + return undefined; + }; + </script> + +</html> \ No newline at end of file -- Gitblit v1.9.1