Explorar el Código

公积金第二版本

xiuli.gao %!s(int64=6) %!d(string=hace) años
padre
commit
a1173a6aac

+ 40 - 0
fund_h5/choice_city.html

@@ -0,0 +1,40 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+
4
+<head>
5
+    <meta charset="UTF-8">
6
+    <title>选择城市</title>
7
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
8
+    <link rel="stylesheet" href="./css/reset.css">
9
+    <link rel="stylesheet" href="./css/choice_city.css?v=10">
10
+    <script type="text/javascript" src="kuxuan/api-url.js"></script>
11
+    <script src="./js/jquery.min.js"></script>
12
+    <div style="display: none;">
13
+    	<script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1274146775'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s13.cnzz.com/z_stat.php%3Fid%3D1274146775' type='text/javascript'%3E%3C/script%3E"));</script>
14
+    </div>
15
+    <script src="./js/common.js?vv=2"></script>
16
+</head>
17
+
18
+<body>
19
+    <nav>
20
+        <i id='back'></i>
21
+        <p>选择城市</p>
22
+    </nav>
23
+    <div class="container">
24
+	    <div class="search">
25
+	    	<i></i>
26
+	    	<input type="text" placeholder="请输入城市名称"  autofocus="autofocus"/>
27
+	    	<em onclick="deleteSearch()"></em>
28
+	    </div>
29
+    	<ul>
30
+    	</ul>
31
+    </div>
32
+    <div class="alert-info" style="display: none;">
33
+        <!-- tip提示,3s后消失 -->
34
+        <p></p>
35
+    </div>
36
+    <script src="./js/auto_size.js"></script>
37
+    <script src="./js/choice_city.js?v=10"></script>
38
+</body>
39
+
40
+</html>

+ 8 - 4
fund_h5/choose_city.html

@@ -6,7 +6,7 @@
6 6
     <title>选择城市</title>
7 7
     <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
8 8
     <link rel="stylesheet" href="./css/reset.css">
9
-    <link rel="stylesheet" href="./css/choose_city.css">
9
+    <link rel="stylesheet" href="./css/choose_city.css?v=10">
10 10
     <script src="./js/jquery.min.js"></script>
11 11
     <script src="./js/common.js"></script>
12 12
 </head>
@@ -16,11 +16,15 @@
16 16
         <i id='back'></i>
17 17
         <p>选择城市</p>
18 18
     </nav>
19
+    <div class="search">
20
+    	<i></i>
21
+    	<input type="text" onclick="searchCity()" placeholder="请输入城市名称" />
22
+    </div>
19 23
     <div class="current-city-wrapper" id="top">
20 24
         <p>当前定位城市</p>
21 25
         <div class="current-city">
26
+        	<i></i>
22 27
             <span data-code='00111000'>北京</span>
23
-            <i></i>
24 28
         </div>
25 29
     </div>
26 30
     <div class="city-list-wrapper">
@@ -40,8 +44,8 @@
40 44
         <p></p>
41 45
     </div>
42 46
     <script src="./js/auto_size.js"></script>
43
-    <script src="./js/city_picker.js"></script>
44
-    <script src="./js/choose_city.js"></script>
47
+    <script src="./js/city_picker.js?v=10"></script>
48
+    <script src="./js/choose_city.js?v=10"></script>
45 49
 </body>
46 50
 
47 51
 </html>

+ 8 - 4
fund_h5/choose_city02.html

@@ -6,7 +6,7 @@
6 6
     <title>选择城市</title>
7 7
     <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
8 8
     <link rel="stylesheet" href="./css/reset.css">
9
-    <link rel="stylesheet" href="./css/choose_city.css">
9
+    <link rel="stylesheet" href="./css/choose_city.css?v=10">
10 10
     <script src="./js/jquery.min.js"></script>
11 11
     <script src="./js/common.js"></script>
12 12
 </head>
@@ -16,11 +16,15 @@
16 16
         <i id='back'></i>
17 17
         <p>选择城市</p>
18 18
     </nav>
19
+    <div class="search">
20
+    	<i></i>
21
+    	<input type="text" onclick="searchCity()" placeholder="请输入城市名称" />
22
+    </div>
19 23
     <div class="current-city-wrapper" id="top">
20 24
         <p>当前定位城市</p>
21 25
         <div class="current-city">
26
+        	<i></i>
22 27
             <span data-code='00111000'>北京</span>
23
-            <i></i>
24 28
         </div>
25 29
     </div>
26 30
     <div class="city-list-wrapper">
@@ -40,8 +44,8 @@
40 44
         <p></p>
41 45
     </div>
42 46
     <script src="./js/auto_size.js"></script>
43
-    <script src="./js/city_picker2.js"></script>
44
-    <script src="./js/choose_city2.js"></script>
47
+    <script src="./js/city_picker2.js?v=10"></script>
48
+    <script src="./js/choose_city2.js?v=10"></script>
45 49
 </body>
46 50
 
47 51
 </html>

+ 112 - 0
fund_h5/css/choice_city.css

@@ -0,0 +1,112 @@
1
+html {
2
+    background-color: #F3F3F3;
3
+    font-size: 100px;
4
+}
5
+
6
+nav {
7
+    position: fixed;
8
+    top: 0;
9
+    left: 0;
10
+    z-index: 9999;
11
+    font-size: 0rem;
12
+    height: 0.44rem;
13
+    width: 100%;
14
+    background-color: #5d7dff;
15
+}
16
+
17
+nav i {
18
+    display: inline-block;
19
+    width: 0.16rem;
20
+    height: 0.16rem;
21
+    line-height: 0.44rem;
22
+    margin-left: 0.1rem;
23
+    background-image: url(../img/back.png);
24
+    background-repeat: no-repeat;
25
+    background-size: 100% auto;
26
+}
27
+
28
+nav p {
29
+    display: inline-block;
30
+    width: 90%;
31
+    text-align: center;
32
+    line-height: 0.44rem;
33
+    color: #fff;
34
+    font-size: 0.17rem;
35
+}
36
+/*search*/
37
+.search{
38
+    height: 0.35rem;
39
+    margin: 0 0.1rem;
40
+    margin-top: 0.1rem;
41
+    background: #F3F3F3;
42
+    border-radius: 0.06rem;
43
+    display: flex;
44
+    align-items: center;
45
+}
46
+.search i{
47
+	display: inline-block;
48
+    width: 0.17rem;
49
+    height: 0.17rem;
50
+    background: url(../img/search.png) no-repeat;
51
+    background-size:100% ;
52
+    margin-left: 0.1rem;
53
+}
54
+.search em{
55
+	display: block;
56
+	width: 0.17rem;
57
+	height: 0.17rem;
58
+	background: url(../img/delete.png) no-repeat;
59
+	background-size:100% ;
60
+	margin-right: 0.09rem;
61
+	display: none;
62
+}
63
+.search input{
64
+	border: none;
65
+    outline: none;
66
+    font-size: 0.16rem;
67
+    margin-left: 0.08rem;
68
+    flex: 1;
69
+    background: #F3F3F3;
70
+}
71
+.container{
72
+	background: #FFFFFF;
73
+	padding-top: 0.44rem;
74
+}
75
+.container ul {
76
+	padding-top: 0.1rem;
77
+}
78
+.container ul li{
79
+	height: 0.52rem;
80
+	border-top: 0.01rem solid #D8D8D8;
81
+	line-height: 0.52rem;
82
+	font-size: 0.16rem;
83
+	color: #222222;
84
+	padding-left: 0.2rem;
85
+}
86
+.container ul li:nth-of-type(1){
87
+	border-top: none;
88
+}
89
+.container ul .searchActive{
90
+	text-align: center;
91
+	color: #D8D8D8;
92
+	padding-left: 0;
93
+}
94
+.alert-info {
95
+    position: absolute;
96
+    top: 1.74rem;
97
+    right: 0;
98
+    left: 0;
99
+    bottom: 0;
100
+    text-align: center;
101
+}
102
+
103
+.alert-info p {
104
+    display: inline-block;
105
+    height: 0.38rem;
106
+    color: #fff;
107
+    font-size: 0.14rem;
108
+    line-height: 0.38rem;
109
+    padding: 0 0.10rem;
110
+    background-color: rgba(0, 0, 0, 0.7);
111
+    border-radius: 5px;
112
+}

+ 55 - 15
fund_h5/css/choose_city.css

@@ -36,7 +36,7 @@ nav p {
36 36
 
37 37
 .current-city-wrapper {
38 38
     margin: 0.54rem 0.10rem 0;
39
-    margin-top: 0.54rem;
39
+    margin-top: 0rem;
40 40
 }
41 41
 
42 42
 .current-city-wrapper>p {
@@ -52,26 +52,26 @@ nav p {
52 52
     background-color: #fff;
53 53
     position: relative;
54 54
     font-size: 0;
55
+    border-radius: 0.04rem;
55 56
 }
56 57
 
57 58
 .current-city span {
58
-    margin-left: 0.10rem;
59
+    margin-left: 0.06rem;
59 60
     font-size: 0.16rem;
60 61
     line-height: 0.40rem;
61
-    color: #222;
62
+    color: #5D7DFF;
62 63
     font-weight: bold;
64
+    vertical-align: middle;
63 65
 }
64 66
 
65 67
 .current-city i {
66 68
     display: inline-block;
67
-    background-image: url(../img/location2.png);
69
+    background: url(../img/location3.png) no-repeat;
68 70
     background-size: 100%;
69
-    width: 0.26rem;
70
-    height: 0.26rem;
71
-    position: absolute;
72
-    right: 0.10rem;
73
-    top: 50%;
74
-    transform: translateY(-50%);
71
+    width: 0.17rem;
72
+    height: 0.17rem;
73
+    vertical-align: middle;
74
+    margin-left: 0.09rem;
75 75
 }
76 76
 
77 77
 .city-list-wrapper {
@@ -91,17 +91,27 @@ nav p {
91 91
 .city-list-hot {
92 92
     margin-top: 0.12rem;
93 93
     width: 100%;
94
-    height: 0.94rem;
94
+    /*height: 0.94rem;*/
95
+   	margin-bottom: 0.12rem;
96
+   	padding-bottom: 0.1rem;
95 97
     background-color: #fff;
98
+    border-radius: 0.04rem;
99
+}
100
+.city-list-hot:after{
101
+	content: ".";
102
+    clear: both;
103
+    display: block;
104
+    overflow: hidden;
105
+    font-size: 0;
106
+    height: 0;
96 107
 }
97
-
98 108
 .city-list-hot li {
99 109
     width: 0.80rem;
100 110
     height: 0.30rem;
101
-    float: left;
111
+    margin: auto;
102 112
     margin-top: 0.1rem;
103
-    margin-right: 0.15rem;
104
-    margin-left: 0.15rem;
113
+    /*margin-right: 0.15rem;*/
114
+    /*margin-left: 0.15rem;*/
105 115
     font-size: 0.12rem;
106 116
     color: #222;
107 117
     text-align: center;
@@ -109,6 +119,11 @@ nav p {
109 119
     background-color: #f3f3f3;
110 120
 }
111 121
 
122
+.city-list-hot div{
123
+	width: 33.33%;
124
+	float: left;
125
+}
126
+
112 127
 .city-list {
113 128
     width: 100%;
114 129
     margin-top: 0.10rem;
@@ -202,4 +217,29 @@ nav p {
202 217
     padding: 0 0.10rem;
203 218
     background-color: rgba(0, 0, 0, 0.7);
204 219
     border-radius: 5px;
220
+}
221
+/*search*/
222
+.search{
223
+    height: 0.35rem;
224
+    margin: 0 0.1rem;
225
+    margin-top: 0.54rem;
226
+    background: #FFFFFF;
227
+    border-radius: 0.06rem;
228
+    display: flex;
229
+    align-items: center;
230
+}
231
+.search i{
232
+	display: inline-block;
233
+    width: 0.17rem;
234
+    height: 0.17rem;
235
+    background: url(../img/search.png) no-repeat;
236
+    background-size:100% ;
237
+    margin-left: 0.1rem;
238
+}
239
+.search input{
240
+	border: none;
241
+    outline: none;
242
+    font-size: 0.16rem;
243
+    margin-left: 0.08rem;
244
+    flex: 1;
205 245
 }

+ 2 - 2
fund_h5/css/fund_h5_api.css

@@ -378,6 +378,6 @@ nav p span{
378 378
 	margin: 0.12rem 0;
379 379
 }
380 380
 .obtainPwd a{
381
-   color: #999999;
382
-	border-bottom: 0.01rem solid #999999;
381
+  	color: #5D7DFF;
382
+    font-size: 0.15rem;
383 383
 }

+ 5 - 5
fund_h5/fund_h5_api.html

@@ -6,7 +6,7 @@
6 6
     <title>公积金查询</title>
7 7
     <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
8 8
     <link rel="stylesheet" href="./css/reset.css">
9
-    <link rel="stylesheet" href="./css/fund_h5_api.css?v=3">
9
+    <link rel="stylesheet" href="./css/fund_h5_api.css?v=10">
10 10
     <script src="./js/jquery.min.js"></script>
11 11
     <script type="text/javascript" src="kuxuan/api-url.js"></script>
12 12
     <script src="./js/common.js"></script>
@@ -48,9 +48,9 @@
48 48
                 </div>
49 49
             </div>
50 50
         </div>
51
-        <div class="tips">
52
-            <!-- 常见问题 -->
53
-        </div>
51
+        <!--<div class="tips">
52
+                                    常见问题 
53
+        </div>-->
54 54
         <div class="mask" style="display: none;">
55 55
             <!-- 弹窗提示 -->
56 56
             <div class="dialog-wrapper">
@@ -88,7 +88,7 @@
88 88
     </div>
89 89
     <script src="./js/auto_size.js"></script>
90 90
     <script src="./js/tips.js"></script>
91
-    <script src="./js/fund_h5_api.js"></script>
91
+    <script src="./js/fund_h5_api.js?v=10"></script>
92 92
 </body>
93 93
 
94 94
 </html>

BIN
fund_h5/img/delete.png


BIN
fund_h5/img/location3.png


BIN
fund_h5/img/search.png


+ 118 - 0
fund_h5/js/choice_city.js

@@ -0,0 +1,118 @@
1
+
2
+var token = '';
3
+var path = '';
4
+var qs = parseQueryString(window.location.href);
5
+var cityList = [];
6
+if (qs.token) {
7
+    token = qs.token;
8
+}
9
+if(qs.path){
10
+	path = qs.path;
11
+}
12
+
13
+//自动唤起键盘
14
+$(".search input").trigger("click").focus()
15
+
16
+//返回上一页
17
+$("nav #back").click(function () {
18
+	window.history.go(-1)
19
+})
20
+
21
+
22
+function deleteSearch () {
23
+	$(".search input").val("")
24
+	$(".container ul").html("")
25
+}
26
+
27
+/**
28
+ * [getLoginInfo 获取城市登录信息]
29
+ */
30
+function getLoginInfo() {
31
+    var regionCode = $('.city-name').attr('data-code');
32
+    $.ajax({
33
+        type: "GET",
34
+        url: BASEURL + '/city_list?type=fund&sort=true&token=' + token + '&time=' + Math.round(Date.now() / 1000),
35
+        contentType: 'application/json;charset=utf-8',
36
+        success: function(data) {
37
+        	cityList = data;
38
+            return renderLoginInfo(cityList);
39
+        },
40
+        error: function(err) {
41
+            return showMsg('获取城市信息失败:' + JSON.parse(err.responseText).error);
42
+        }
43
+    });
44
+}
45
+/**
46
+ * [renderLoginInfo 渲染城市登录信息]
47
+ * @param  {[type]} cityInfo [城市登录信息]
48
+ */
49
+function renderLoginInfo(cityInfo) {
50
+	var bind_name = 'input';
51
+	if (navigator.userAgent.indexOf("MSIE") != -1){
52
+	    bind_name = 'propertychange';
53
+	}
54
+	$(".search input").bind(bind_name, function(){
55
+		var searchName = $(".search input").val().trim();
56
+		var html = '';
57
+		if(searchName != ""){
58
+			$(".search em").css("display","block")
59
+			for(key in cityInfo){
60
+				if(key != "hot"){
61
+					cityInfo[key].forEach(function (item,index) {
62
+						if(item.region.indexOf(searchName) != -1){
63
+							html +=  `<li data-code=${item.regionCode}>${item.region}</li>`
64
+						}else if(item.pinyin.indexOf(searchName) != -1){
65
+							html +=  `<li data-code=${item.regionCode}>${item.region}</li>`
66
+						}
67
+					})
68
+				}
69
+			}
70
+			if(html != ""){
71
+				$(".container ul").html(html)
72
+			}else{
73
+				html += `<li class="searchActive">无结果</li>`;
74
+				$(".container ul").html(html)
75
+			}
76
+		}else{
77
+			$(".search em").css("display","none")
78
+			$(".container ul").html(html)
79
+		}
80
+	}) 
81
+	$(".container ul").on("click", function(e) {
82
+	    var target = e.target;
83
+	    if ($(target).is("li")) {
84
+	    	if($(target).attr("class") != "searchActive"){
85
+			      var city = $(target).text().trim();
86
+			      var code = $(target).attr('data-code');
87
+			      if(path == "choose_city02"){
88
+			      		var choose_city02_data = {
89
+							name: city,
90
+							code: code
91
+						}
92
+					    window.webkit.messageHandlers.CityLocationMessageHandler.postMessage(choose_city02_data);
93
+			      }else{
94
+			      	if (document.referrer.indexOf('&name=') === -1) {
95
+			      	    window.location.href = './fund_h5_api.html?token=' + token + '&name=' + city + '&code=' + code;
96
+			      	} else {
97
+			      	    window.location.href = document.referrer.replace(/&name=[^&]+&code=[^&]+/, '&name=' + city + '&code=' + code);
98
+			      	}
99
+			      }
100
+	    	}
101
+	    }
102
+	});
103
+}
104
+/**
105
+ * [showMsg 提示各种错误信息,3s后消失]
106
+ */
107
+function showMsg(msg) {
108
+    var msgBox = $('.alert-info');
109
+    msgBox.children('p').text(msg);
110
+    msgBox.show();
111
+
112
+    setTimeout(function() {
113
+        msgBox.hide();
114
+    }, 3000);
115
+}
116
+$().ready(function () {
117
+	getLoginInfo()
118
+})

+ 4 - 0
fund_h5/js/choose_city.js

@@ -79,3 +79,7 @@ function getCityListAndRender() {
79 79
         }
80 80
     });
81 81
 }
82
+//搜索
83
+function searchCity () {
84
+	window.location.href = "choice_city.html?token=" + token;
85
+}

+ 4 - 0
fund_h5/js/choose_city2.js

@@ -81,3 +81,7 @@ function getCityListAndRender() {
81 81
         }
82 82
     });
83 83
 }
84
+//搜索
85
+function searchCity () {
86
+	window.location.href = "choice_city.html?token=" + token + "&path=choose_city02";
87
+}

+ 1 - 1
fund_h5/js/city_picker.js

@@ -39,7 +39,7 @@
39 39
     p.renderHotCityList = function() {
40 40
         var hotCitiesStr = '';
41 41
         for (var city of this.hotCities) {
42
-            hotCitiesStr += "<li data-code='" + city.regionCode + "'>" + city.region + "</li>"
42
+            hotCitiesStr += "<div><li data-code='" + city.regionCode + "'>" + city.region + "</li></div>"
43 43
         }
44 44
         $('.city-list-hot').html(hotCitiesStr);
45 45
     };

+ 1 - 1
fund_h5/js/city_picker2.js

@@ -39,7 +39,7 @@
39 39
     p.renderHotCityList = function() {
40 40
         var hotCitiesStr = '';
41 41
         for (var city of this.hotCities) {
42
-            hotCitiesStr += "<li data-code='" + city.regionCode + "'>" + city.region + "</li>"
42
+            hotCitiesStr += "<div><li data-code='" + city.regionCode + "'>" + city.region + "</li></div>"
43 43
         }
44 44
         $('.city-list-hot').html(hotCitiesStr);
45 45
     };

+ 19 - 8
fund_h5/js/fund_h5_api.js

@@ -249,14 +249,16 @@ function renderLoginInfo(cityInfo) {
249 249
 
250 250
     for (var index in cityInfo.loginTypes) {
251 251
         var loginType = cityInfo.loginTypes[index];
252
-        if (index === '0') {
253
-            tabsHtmlStr += '<div class="tab-tab tab-tab-active" data-id ="' + loginType.loginTypeId + '"><p class="tab-title">' + loginType.loginLabel + '</p><i class="hr-active"></i></div>';
254
-            tabConHtmlStr += '<div data-id="' + loginType.loginTypeId + '" style="display:block">';
255
-        } else {
256
-            tabsHtmlStr += '<div class="tab-tab" data-id ="' + loginType.loginTypeId + '"><p class="tab-title">' + loginType.loginLabel + '</p><i class="hr-active"></i></div>';
257
-            tabConHtmlStr += '<div data-id="' + loginType.loginTypeId + '" style="display:none">';
258
-        }
259
-
252
+//  	if(cityInfo.loginTypes.length != 1){
253
+	        if (index === '0') {
254
+	            tabsHtmlStr += '<div class="tab-tab tab-tab-active" data-id ="' + loginType.loginTypeId + '"><p class="tab-title">' + loginType.loginLabel + '</p><i class="hr-active"></i></div>';
255
+	            tabConHtmlStr += '<div data-id="' + loginType.loginTypeId + '" style="display:block">';
256
+	        } else {
257
+	            tabsHtmlStr += '<div class="tab-tab" data-id ="' + loginType.loginTypeId + '"><p class="tab-title">' + loginType.loginLabel + '</p><i class="hr-active"></i></div>';
258
+	            tabConHtmlStr += '<div data-id="' + loginType.loginTypeId + '" style="display:none">';
259
+	        }
260
+//		}
261
+    	
260 262
         for (var loginField of loginType.loginFields) {
261 263
             var type = '';
262 264
             var placeStr = '';
@@ -279,6 +281,15 @@ function renderLoginInfo(cityInfo) {
279 281
     }
280 282
     tabWrapper.html(tabsHtmlStr);
281 283
     tabConWrapper.html(tabConHtmlStr);
284
+    console.log(cityInfo)
285
+    if(cityInfo.loginTypes !=undefined){
286
+	   	if(cityInfo.loginTypes.length == 1){
287
+			$(".tab-tab").css({
288
+				'position':'absolute',
289
+				'left':'-5000px'
290
+			})
291
+		}
292
+    }
282 293
 
283 294
     renderTips($('.city-name').text());
284 295
     initEvent(); // 各种事件绑定

+ 2 - 2
fund_h5/queryHelp.html

@@ -5,7 +5,7 @@
5 5
 	    <title>查询帮助</title>
6 6
 	    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
7 7
 	    <link rel="stylesheet" href="./css/reset.css">
8
-	    <link rel="stylesheet" href="./css/query-help.css">
8
+	    <link rel="stylesheet" href="./css/query-help.css?v=10">
9 9
 	    <script src="./js/jquery.min.js"></script>
10 10
 	    <script src="./js/common.js"></script>
11 11
 	</head>
@@ -23,4 +23,4 @@
23 23
 </html>
24 24
 <script src="./js/auto_size.js"></script>
25 25
 <script src="./js/tips.js"></script>
26
-<script type="text/javascript" src="js/queryHelp.js"></script>
26
+<script type="text/javascript" src="js/queryHelp.js?v=10"></script>

+ 2 - 2
fund_h5/typeChoice.html

@@ -5,7 +5,7 @@
5 5
 	    <title>类型选择</title>
6 6
 	    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
7 7
 	    <link rel="stylesheet" href="./css/reset.css">
8
-	    <link rel="stylesheet" href="./css/typeChoice.css">
8
+	    <link rel="stylesheet" href="./css/typeChoice.css?v=10">
9 9
 	    <script src="./js/jquery.min.js"></script>
10 10
 	    <script type="text/javascript" src="kuxuan/api-url.js"></script>
11 11
 	    <script src="./js/common.js"></script>
@@ -34,4 +34,4 @@
34 34
 </html>
35 35
 <script src="./js/auto_size.js"></script>
36 36
 <script src="./js/tips.js"></script>
37
-<script type="text/javascript" src="js/typeChoice.js"></script>
37
+<script type="text/javascript" src="js/typeChoice.js?v=10"></script>

+ 5 - 5
fund_h5_01/choice_city.html

@@ -5,8 +5,9 @@
5 5
     <meta charset="UTF-8">
6 6
     <title>选择城市</title>
7 7
     <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
8
-    <link rel="stylesheet" href="./css/reset.css?vv=1">
9
-    <link rel="stylesheet" href="./css/choice_city.css?vv=1">
8
+    <link rel="stylesheet" href="./css/reset.css">
9
+    <link rel="stylesheet" href="./css/choice_city.css?v=10">
10
+    <script type="text/javascript" src="kuxuan/api-url.js"></script>
10 11
     <script src="./js/jquery.min.js"></script>
11 12
     <script src="./js/jquery.cookie.js"></script>
12 13
     <div style="display: none;">
@@ -29,9 +30,8 @@
29 30
     	<ul>
30 31
     	</ul>
31 32
     </div>
32
-    <script src="./js/auto_size.js?vv=1"></script>
33
-    <script src="../fund_h5/js/tips.js?vv=1"></script>
34
-    <script src="./js/choice_city.js?vv=2"></script>
33
+    <script src="./js/auto_size.js"></script>
34
+    <script src="./js/choice_city.js?v=10"></script>
35 35
 </body>
36 36
 
37 37
 </html>

+ 6 - 6
fund_h5_01/fund_h5_api.html

@@ -5,10 +5,10 @@
5 5
     <meta charset="UTF-8">
6 6
     <title>公积金查询</title>
7 7
     <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
8
-    <link rel="stylesheet" href="./css/reset.css?vv=2">
9
-    <link rel="stylesheet" href="./css/fund_h5_api.css?vv=3">
8
+    <link rel="stylesheet" href="./css/reset.css">
9
+    <link rel="stylesheet" href="./css/fund_h5_api.css?v=10">
10 10
     <script src="./js/jquery.min.js"></script>
11
-    <script type="text/javascript" src="kuxuan/api-url.js?vv=8"></script>
11
+    <script type="text/javascript" src="kuxuan/api-url.js"></script>
12 12
     <div style="display: none;">
13 13
    	 <script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1274146775'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s13.cnzz.com/z_stat.php%3Fid%3D1274146775' type='text/javascript'%3E%3C/script%3E"));</script>
14 14
    	</div>
@@ -96,9 +96,9 @@
96 96
         <img src="./img/loading.gif" alt="">
97 97
         <p>公积金数据查询中<span class='process'>0%</span>···</p>
98 98
     </div>
99
-    <script src="./js/auto_size.js?vv=2"></script>
100
-    <script src="./js/tips.js?vv=2"></script>
101
-    <script src="./js/fund_h5_api.js?vv=3"></script>
99
+    <script src="./js/auto_size.js"></script>
100
+    <script src="./js/tips.js"></script>
101
+    <script src="./js/fund_h5_api.js?v=10"></script>
102 102
 </body>
103 103
 
104 104
 </html>

+ 81 - 37
fund_h5_01/js/choice_city.js

@@ -1,6 +1,7 @@
1 1
 
2 2
 var token = '';
3 3
 var qs = parseQueryString(window.location.href);
4
+var cityList = [];
4 5
 if (qs.token) {
5 6
     token = qs.token;
6 7
 }
@@ -16,48 +17,91 @@ $("nav #back").click(function () {
16 17
 
17 18
 function deleteSearch () {
18 19
 	$(".search input").val("")
20
+	$(".container ul").html("")
19 21
 }
20 22
 
21
-
22
-var bind_name = 'input';
23
-if (navigator.userAgent.indexOf("MSIE") != -1){
24
-    bind_name = 'propertychange';
23
+/**
24
+ * [getLoginInfo 获取城市登录信息]
25
+ */
26
+function getLoginInfo() {
27
+    var regionCode = $('.city-name').attr('data-code');
28
+    $.ajax({
29
+        type: "GET",
30
+        url: BASEURL + '/city_list?type=fund&sort=true&token=' + token + '&time=' + Math.round(Date.now() / 1000),
31
+        contentType: 'application/json;charset=utf-8',
32
+        success: function(data) {
33
+        	cityList = data;
34
+            return renderLoginInfo(cityList);
35
+        },
36
+        error: function(err) {
37
+            return showMsg('获取城市信息失败:' + JSON.parse(err.responseText).error);
38
+        }
39
+    });
25 40
 }
26
-
27
-$(".search input").bind(bind_name, function(){
28
-	var searchName = $(".search input").val().trim();
29
-	var html = '';
30
-	if(searchName != ""){
31
-		$(".search em").css("display","block")
32
-		tips.find(function(item, index) {
33
-			if(item.region.indexOf(searchName) != -1){
34
-				html +=  `<li data-code=${item.regionCode}>${item.region}</li>`
41
+/**
42
+ * [renderLoginInfo 渲染城市登录信息]
43
+ * @param  {[type]} cityInfo [城市登录信息]
44
+ */
45
+function renderLoginInfo(cityInfo) {
46
+	var bind_name = 'input';
47
+	if (navigator.userAgent.indexOf("MSIE") != -1){
48
+	    bind_name = 'propertychange';
49
+	}
50
+	$(".search input").bind(bind_name, function(){
51
+		var searchName = $(".search input").val().trim();
52
+		var html = '';
53
+		if(searchName != ""){
54
+			$(".search em").css("display","block")
55
+			for(key in cityInfo){
56
+				if(key != "hot"){
57
+					cityInfo[key].forEach(function (item,index) {
58
+						if(item.region.indexOf(searchName) != -1){
59
+							html +=  `<li data-code=${item.regionCode}>${item.region}</li>`
60
+						}else if(item.pinyin.indexOf(searchName) != -1){
61
+							html +=  `<li data-code=${item.regionCode}>${item.region}</li>`
62
+						}
63
+					})
64
+				}
65
+			}
66
+			if(html != ""){
67
+				$(".container ul").html(html)
68
+			}else{
69
+				html += `<li class="searchActive">无结果</li>`;
70
+				$(".container ul").html(html)
35 71
 			}
36
-		})
37
-		if(html != ""){
38
-			$(".container ul").html(html)
39 72
 		}else{
40
-			html += `<li class="searchActive">无结果</li>`;
73
+			$(".search em").css("display","none")
41 74
 			$(".container ul").html(html)
42 75
 		}
43
-	}else{
44
-		$(".search em").css("display","none")
45
-		$(".container ul").html(html)
46
-	}
47
-}) 
76
+	}) 
77
+	$(".container ul").on("click", function(e) {
78
+	    var target = e.target;
79
+	    if ($(target).is("li")) {
80
+	    	if($(target).attr("class") != "searchActive"){
81
+			      var city = $(target).text().trim();
82
+			      var code = $(target).attr('data-code');
83
+			      if (document.referrer.indexOf('&name=') === -1) {
84
+			          window.location.href = './fund_h5_api.html?token=' + token + '&name=' + city + '&code=' + code;
85
+			      } else {
86
+			          window.location.href = document.referrer.replace(/&name=[^&]+&code=[^&]+/, '&name=' + city + '&code=' + code);
87
+			      }
88
+	    		
89
+	    	}
90
+	    }
91
+	});
92
+}
93
+/**
94
+ * [showMsg 提示各种错误信息,3s后消失]
95
+ */
96
+function showMsg(msg) {
97
+    var msgBox = $('.alert-info');
98
+    msgBox.children('p').text(msg);
99
+    msgBox.show();
48 100
 
49
- $(".container ul").on("click", function(e) {
50
-    var target = e.target;
51
-    if ($(target).is("li")) {
52
-    	if($(target).attr("class") != "searchActive"){
53
-		      var city = $(target).text().trim();
54
-		      var code = $(target).attr('data-code');
55
-		      if (document.referrer.indexOf('&name=') === -1) {
56
-		          window.location.href = './fund_h5_api.html?token=' + token + '&name=' + city + '&code=' + code;
57
-		      } else {
58
-		          window.location.href = document.referrer.replace(/&name=[^&]+&code=[^&]+/, '&name=' + city + '&code=' + code);
59
-		      }
60
-    		
61
-    	}
62
-    }
63
-});
101
+    setTimeout(function() {
102
+        msgBox.hide();
103
+    }, 3000);
104
+}
105
+$().ready(function () {
106
+	getLoginInfo()
107
+})

+ 10 - 3
fund_h5_01/js/fund_h5_api.js

@@ -267,7 +267,7 @@ function renderLoginInfo(cityInfo) {
267 267
 
268 268
     for (var index in cityInfo.loginTypes) {
269 269
         var loginType = cityInfo.loginTypes[index];
270
-    	if(cityInfo.loginTypes.length != 1){
270
+//  	if(cityInfo.loginTypes.length != 1){
271 271
     		 if (index === '0') {
272 272
 	            tabsHtmlStr += '<div class="tab-tab tab-tab-active" data-id ="' + loginType.loginTypeId + '"><p class="tab-title">' + loginType.loginLabel + '</p><i class="hr-active"></i></div>';
273 273
 	            tabConHtmlStr += '<div data-id="' + loginType.loginTypeId + '" style="display:block">';
@@ -275,7 +275,7 @@ function renderLoginInfo(cityInfo) {
275 275
 	            tabsHtmlStr += '<div class="tab-tab" data-id ="' + loginType.loginTypeId + '"><p class="tab-title">' + loginType.loginLabel + '</p><i class="hr-active"></i></div>';
276 276
 	            tabConHtmlStr += '<div data-id="' + loginType.loginTypeId + '" style="display:none">';
277 277
 	        }
278
-    	}
278
+//  	}
279 279
        
280 280
 
281 281
         for (var loginField of loginType.loginFields) {
@@ -300,7 +300,14 @@ function renderLoginInfo(cityInfo) {
300 300
     }
301 301
     tabWrapper.html(tabsHtmlStr);
302 302
     tabConWrapper.html(tabConHtmlStr);
303
-
303
+    if(cityInfo.loginTypes !=undefined){
304
+	    if(cityInfo.loginTypes.length == 1){
305
+			$(".tab-tab").css({
306
+				'position':'absolute',
307
+				'left':'-5000px'
308
+			})
309
+		}
310
+	}
304 311
     renderTips($('.city-name').text());
305 312
     initEvent(); // 各种事件绑定
306 313
     checkToken();