Sin descripción

choose.html 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"/>
  6. <meta name="apple-mobile-web-app-capable" content="yes">
  7. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  8. <meta name="format-detection" content="telephone=no">
  9. <title>选择城市</title>
  10. <style type="text/css">
  11. * { font-size: .12rem;color: #444;padding: 0; }
  12. body{background:#F3F3F3;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0);max-width: 600px;margin: 0 auto;
  13. font-family: "PingFang SC,Microsoft YaHei,SourceHanSansCN-Normal,HiraginoSansGB,HiraginoSans-W3,Helvetica Neue,Helvetica,STHeiTi,sans-serif";}
  14. html{overflow-x:hidden;-webkit-text-size-adjust:none;}
  15. ul,li,dl,dt,dd{display:block;list-style:none;}
  16. img{border:0;max-width:100%;height: auto;}
  17. .clear{background:none;border:0;clear:both;display:block;float:none;font-size:0;overflow:hidden;visibility:hidden;width:0;height:0;}
  18. a{text-decoration:none;outline:none;}
  19. /*城市弹层*/
  20. .container{width:100%;margin-top: .5rem;}
  21. .letter{width:.1rem;overflow:hidden;position:fixed;bottom:15%;right:.05rem;text-align:center;}
  22. .letter ul li a{text-decoration:none;color: #5D7DFF;font-size: .1rem;}
  23. .city{overflow:hidden;padding:.1rem;background: #fff;}
  24. .city-list{width:100%;overflow:hidden;position: relative;}
  25. .city-list:after {content: "";display: inline-block;width: 95%;height: .01rem;margin: auto;background: #D8D8D8;opacity: .3;position: absolute;bottom: 0;left: 50%;transform: translate(-50%,0);}
  26. .city-list .city-letter{color:#222;font-size:.16rem;display:inline-block;padding-top:15px;padding-bottom:5px;width:100%;}
  27. .city-list p{color:#222;width:95%;height: .2rem;line-height:.2rem;font-size: .14rem;margin:.1rem 0;cursor:pointer;}
  28. .top {width: 100%;height: .5rem;position: fixed;top: 0;left: 0;background: #f7f7f7;z-index: 999;}
  29. .top img {width: .2rem;height: .2rem;position: absolute;left: .1rem;top: 50%;transform: translate(0,-50%);}
  30. .top h1 {font-size: .14rem;position: absolute;left: 50%;top: 50%;transform: translate(-50%,-50%);margin: 0;}
  31. .title {height: .37rem;line-height: .37rem;padding-left: .1rem;background: #F3F3F3;color: #444;font-size: .12rem;}
  32. .hot {margin-bottom: .1rem;background: #fff;}
  33. .list {margin-top: -.04rem;padding-bottom: .1rem;padding-left: .28rem;display: flex;flex-wrap: wrap;}
  34. .list li {display: inline-block;width: .8rem;height: .3rem;margin-right: .3rem;border-radius: .04rem;line-height: .3rem;text-align: center;background: #F3F3F3;color: #222;font-size: .12rem;margin-top: .14rem;overflow: scroll;}
  35. </style>
  36. <script>
  37. document.documentElement.style.fontSize=document.documentElement.clientWidth/375*100+"px";
  38. window.onresize=function(){
  39. document.documentElement.style.fontSize=document.documentElement.clientWidth/375*100+"px";
  40. }
  41. </script>
  42. </head>
  43. <body>
  44. <div class="top">
  45. <img src="./img/back1.png" alt="">
  46. <h1>贷款信息</h1>
  47. </div>
  48. <div class="container">
  49. <div class="hot">
  50. <div class="title">热门城市</div>
  51. <div class="list">
  52. </div>
  53. </div>
  54. <div class="city">
  55. </div>
  56. </div>
  57. <div class="letter">
  58. <ul>
  59. <li><a href="javascript:;">A</a></li>
  60. <li><a href="javascript:;">B</a></li>
  61. <li><a href="javascript:;">C</a></li>
  62. <li><a href="javascript:;">D</a></li>
  63. <li><a href="javascript:;">E</a></li>
  64. <li><a href="javascript:;">F</a></li>
  65. <li><a href="javascript:;">G</a></li>
  66. <li><a href="javascript:;">H</a></li>
  67. <li><a href="javascript:;">J</a></li>
  68. <li><a href="javascript:;">K</a></li>
  69. <li><a href="javascript:;">L</a></li>
  70. <li><a href="javascript:;">M</a></li>
  71. <li><a href="javascript:;">N</a></li>
  72. <li><a href="javascript:;">P</a></li>
  73. <li><a href="javascript:;">Q</a></li>
  74. <li><a href="javascript:;">R</a></li>
  75. <li><a href="javascript:;">S</a></li>
  76. <li><a href="javascript:;">T</a></li>
  77. <li><a href="javascript:;">W</a></li>
  78. <li><a href="javascript:;">X</a></li>
  79. <li><a href="javascript:;">Y</a></li>
  80. <li><a href="javascript:;">Z</a></li>
  81. </ul>
  82. </div>
  83. <script src="./common/jquery-2.1.0.js" type="text/javascript"></script>
  84. <script type="text/javascript">
  85. var hotList=[],hotHtml='',cityhtml='',firstCity=''
  86. $().ready(function(){
  87. getHotList();
  88. getCityList();
  89. })
  90. var params=parseQueryString(window.location.href)
  91. // 选择城市
  92. $('body').on('click', '.city-list p', function () {
  93. $(this).attr("style","color:#5D7DFF");
  94. if(params.typeId) {
  95. window.location="index.html?source="+params.source+"&phone="+params.phone+"&uid="+params.uid+"&token="+params.token+"&city="+$(this).text()+"&typeId="+params.typeId
  96. }else {
  97. window.location="index.html?source="+params.source+"&phone="+params.phone+"&uid="+params.uid+"&token="+params.token+"&city="+$(this).text()
  98. }
  99. });
  100. function check(obj) {
  101. obj.style.color="#5D7DFF";
  102. if(params.typeId) {
  103. window.location="index.html?source="+params.source+"&phone="+params.phone+"&uid="+params.uid+"&token="+params.token+"&city="+$(obj).text()+"&typeId="+params.typeId
  104. }else {
  105. window.location="index.html?source="+params.source+"&phone="+params.phone+"&uid="+params.uid+"&token="+params.token+"&city="+$(obj).text()
  106. }
  107. }
  108. // 单词点击滚动
  109. $('body').on('click', '.letter a', function () {
  110. var s = $(this).html();
  111. $(window).scrollTop($('#' + s + '1').offset().top-50);
  112. });
  113. //获取地址栏参数
  114. function parseQueryString(url) {
  115. var urlObj = {};
  116. var reg = /([^?=&]+)=([^?=&]+)/g;
  117. url.replace(reg, function($0, $1, $2) {
  118. urlObj[$1] = decodeURIComponent($2);
  119. })
  120. return urlObj;
  121. }
  122. // 热门城市
  123. function getHotList(){
  124. $.ajax({
  125. url:'/user/cityList',
  126. type:"get",
  127. success:function(res){
  128. if(res.errno==0&&res.rst) {
  129. hotList=res.rst
  130. for(var i in hotList) {
  131. hotHtml+='<li onclick="check(this)">'+hotList[i]+'</li>'
  132. }
  133. $(".list").html(hotHtml)
  134. }else {
  135. $(".hot").hide();
  136. }
  137. }
  138. })
  139. }
  140. // 城市列表
  141. function getCityList(){
  142. $.ajax({
  143. url:'/user/userCity',
  144. type:"post",
  145. success:function(res){
  146. if(res.errno==0&&res.rst) {
  147. var cityList=res.rst
  148. for(var i in cityList) {
  149. if(cityList[i].date.length!=0) {
  150. cityhtml=""
  151. for(var j in cityList[i].date) {
  152. cityhtml+='<p>'+cityList[i].date[j]+'</p>'
  153. }
  154. firstCity+='<div class="city-list"><span class="city-letter" id="'+(cityList[i].no).toUpperCase()+'1">'+cityList[i].no.toUpperCase()+'</span>'+cityhtml+'</div>'
  155. }
  156. }
  157. $(".city").html(firstCity)
  158. }else {
  159. $(".hot").hide();
  160. }
  161. }
  162. })
  163. }
  164. $(".top img").on("click",function(){
  165. window.history.back(-1);
  166. })
  167. </script>
  168. </div>
  169. </body>
  170. </html>