實現效果: 圖片素材: --> 首先, 城市數據位元組放在 Json 文件, 就不網路獲取了. city.json 存放 Json 數據: 1 { 2 "result": "0", 3 "message": "介面通信成功!", 4 "responseData": { 5 "History": [], ...
實現效果:
圖片素材:
--> 首先, 城市數據位元組放在 Json 文件, 就不網路獲取了.
city.json 存放 Json 數據:
1 { 2 "result": "0", 3 "message": "介面通信成功!", 4 "responseData": { 5 "History": [], 6 "Recent": [], 7 "Hot": [ 8 { 9 "id": "226", 10 "cityName": "上海" 11 }, 12 { 13 "id": "447", 14 "cityName": "北京" 15 }, 16 { 17 "id": "221", 18 "cityName": "南京" 19 }, 20 { 21 "id": "220", 22 "cityName": "蘇州" 23 }, 24 { 25 "id": "261", 26 "cityName": "杭州" 27 }, 28 { 29 "id": "476", 30 "cityName": "天津" 31 } 32 ], 33 "Common": [ 34 { 35 "title": "A", 36 "items": [ 37 { 38 "id": 664, 39 "cityName": "安慶" 40 }, 41 { 42 "id": 3590, 43 "cityName": "安吉縣" 44 } 45 ] 46 }, 47 { 48 "title": "B", 49 "items": [ 50 { 51 "id": 3612, 52 "cityName": "巴州" 53 }, 54 { 55 "id": 3366, 56 "cityName": "白銀" 57 }, 58 { 59 "id": 910, 60 "cityName": "蚌埠" 61 }, 62 { 63 "id": 2818, 64 "cityName": "保定" 65 }, 66 { 67 "id": 1068, 68 "cityName": "北海" 69 }, 70 { 71 "id": 447, 72 "cityName": "北京" 73 }, 74 { 75 "id": 882, 76 "cityName": "濱州" 77 }, 78 { 79 "id": 2119, 80 "cityName": "亳州" 81 }, 82 { 83 "id": 3449, 84 "cityName": "博爾塔拉蒙古自治州" 85 }, 86 { 87 "id": 2202, 88 "cityName": "濱海縣" 89 }, 90 { 91 "id": 2462, 92 "cityName": "濱海新區大港" 93 }, 94 { 95 "id": 2463, 96 "cityName": "濱海新區塘沽" 97 }, 98 { 99 "id": 2464, 100 "cityName": "濱海新區漢沽" 101 }, 102 { 103 "id": 2788, 104 "cityName": "寶應縣" 105 }, 106 { 107 "id": 3452, 108 "cityName": "博樂" 109 }, 110 { 111 "id": 3487, 112 "cityName": "霸州" 113 } 114 ] 115 }, 116 { 117 "title": "C", 118 "items": [ 119 { 120 "id": 1889, 121 "cityName": "滄州" 122 }, 123 { 124 "id": 2611, 125 "cityName": "昌吉自治州" 126 }, 127 { 128 "id": 2329, 129 "cityName": "長春" 130 }, 131 { 132 "id": 651, 133 "cityName": "長沙" 134 }, 135 { 136 "id": 2926, 137 "cityName": "長治" 138 }, 139 { 140 "id": 237, 141 "cityName": "常州" 142 }, 143 { 144 "id": 1959, 145 "cityName": "朝陽" 146 }, 147 { 148 "id": 3339, 149 "cityName": "潮州" 150 }, 151 { 152 "id": 279, 153 "cityName": "成都" 154 }, 155 { 156 "id": 3527, 157 "cityName": "承德" 158 }, 159 { 160 "id": 2095, 161 "cityName": "池州" 162 }, 163 { 164 "id": 2303, 165 "cityName": "赤峰" 166 }, 167 { 168 "id": 901, 169 "cityName": "滁州" 170 }, 171 { 172 "id": 621, 173 "cityName": "重慶" 174 }, 175 { 176 "id": 920, 177 "cityName": "崇明縣" 178 }, 179 { 180 "id": 2275, 181 "cityName": "曹縣" 182 }, 183 { 184 "id": 2620, 185 "cityName": "慈溪" 186 }, 187 { 188 "id": 2709, 189 "cityName": "常熟" 190 }, 191 { 192 "id": 2779, 193 "cityName": "茌平縣" 194 }, 195 { 196 "id": 3066, 197 "cityName": "巢湖" 198 }, 199 { 200 "id": 3135, 201 "cityName": "長豐縣" 202 }, 203 { 204 "id": 3630, 205 "cityName": "昌黎縣" 206 }, 207 { 208 "id": 3640, 209 "cityName": "章丘" 210 }, 211 { 212 "id": 3657, 213 "cityName": "崇州" 214 } 215 ] 216 }, 217 { 218 "title": "D", 219 "items": [ 220 { 221 "id": 3384, 222 "cityName": "達卡(孟加拉國)" 223 }, 224 { 225 "id": 1699, 226 "cityName": "大連" 227 }, 228 { 229 "id": 2700, 230 "cityName": "大慶" 231 }, 232 { 233 "id": 2290, 234 "cityName": "大同" 235 }, 236 { 237 "id": 579, 238 "cityName": "德州" 239 }, 240 { 241 "id": 3351, 242 "cityName": "定州" 243 }, 244 { 245 "id": 254, 246 "cityName": "東莞" 247 }, 248 { 249 "id": 1748, 250 "cityName": "東營" 251 }, 252 { 253 "id": 2208, 254 "cityName": "德清縣" 255 }, 256 { 257 "id": 2286, 258 "cityName": "東海縣" 259 }, 260 { 261 "id": 2608, 262 "cityName": "定遠縣" 263 }, 264 { 265 "id": 2715, 266 "cityName": "東台" 267 }, 268 { 269 "id": 3101, 270 "cityName": "碭山縣" 271 }, 272 { 273 "id": 3150, 274 "cityName": "大廠縣" 275 }, 276 { 277 "id": 3166, 278 "cityName": "東鄉縣" 279 }, 280 { 281 "id": 3281, 282 "cityName": "丹陽" 283 }, 284 { 285 "id": 3406, 286 "cityName": "東明縣" 287 }, 288 { 289 "id": 3618, 290 "cityName": "大悟縣" 291 }, 292 { 293 "id": 3643, 294 "cityName": "敦煌" 295 }, 296 { 297 "id": 3661, 298 "cityName": "大名縣" 299 } 300 ] 301 }, 302 { 303 "title": "F", 304 "items": [ 305 { 306 "id": 2176, 307 "cityName": "佛山" 308 }, 309 { 310 "id": 801, 311 "cityName": "福州" 312 }, 313 { 314 "id": 3165, 315 "cityName": "撫州" 316 }, 317 { 318 "id": 2881, 319 "cityName": "阜陽" 320 }, 321 { 322 "id": 2262, 323 "cityName": "富錦" 324 }, 325 { 326 "id": 2399, 327 "cityName": "鳳陽縣" 328 }, 329 { 330 "id": 3157, 331 "cityName": "繁峙縣" 332 }, 333 { 334 "id": 3162, 335 "cityName": "豐縣" 336 }, 337 { 338 "id": 3297, 339 "cityName": "阜南縣" 340 }, 341 { 342 "id": 3441, 343 "cityName": "奉化" 344 }, 345 { 346 "id": 3508, 347 "cityName": "阜寧縣" 348 }, 349 { 350 "id": 3509, 351 "cityName": "肥東縣" 352 }, 353 { 354 "id": 3541, 355 "cityName": "肥西縣" 356 }, 357 { 358 "id": 3544, 359 "cityName": "鳳台縣" 360 } 361 ] 362 }, 363 { 364 "title": "G", 365 "items": [ 366 { 367 "id": 2976, 368 "cityName": "贛州" 369 }, 370 { 371 "id": 3472, 372 "cityName": "廣元" 373 }, 374 { 375 "id": 1969, 376 "cityName": "廣州" 377 }, 378 { 379 "id": 709, 380 "cityName": "貴陽" 381 }, 382 { 383 "id": 898, 384 "cityName": "桂林" 385 }, 386 { 387 "id": 2002, 388 "cityName": "高唐縣" 389 }, 390 { 391 "id": 2129, 392 "cityName": "灌南縣" 393 }, 394 { 395 "id": 2224, 396 "cityName": "固始縣" 397 }, 398 { 399 "id": 2518, 400 "cityName": "贛榆縣" 401 }, 402 { 403 "id": 2734, 404 "cityName": "高密" 405 }, 406 { 407 "id": 2746, 408 "cityName": "高郵" 409 }, 410 { 411 "id": 2752, 412 "cityName": "灌雲縣" 413 }, 414 { 415 "id": 2819, 416 "cityName": "高碑店" 417 }, 418 { 419 "id": 3060, 420 "cityName": "古交" 421 }, 422 { 423 "id": 3385, 424 "cityName": "孤山1" 425 }, 426 { 427 "id": 3455, 428 "cityName": "沽源縣" 429 }, 430 { 431 "id": 3490, 432 "cityName": "固鎮縣" 433 }, 434 { 435 "id": 3502, 436 "cityName": "貴溪" 437 }, 438 { 439 "id": 3589, 440 "cityName": "瓜州縣" 441 }, 442 { 443 "id": 3614, 444 "cityName": "廣德縣" 445 }, 446 { 447 "id": 3619, 448 "cityName": "古田縣" 449 }, 450 { 451 "id": 3634, 452 "cityName": "格爾木" 453 }, 454 { 455 "id": 3699, 456 "cityName": "高安" 457 } 458 ] 459 }, 460 { 461 "title": "H", 462 "items": [ 463 { 464 "id": 558, 465 "cityName": "哈爾濱" 466 }, 467 { 468 "id": 2104, 469 "cityName": "海口" 470 }, 471 { 472 "id": 3633, 473 "cityName": "海西蒙古族藏族自治州" 474 }, 475 { 476 "id": 2233, 477 "cityName": "邯鄲" 478 }, 479 { 480 "id": 3652, 481 "cityName": "南韓首爾" 482 }, 483 { 484 "id": 2845, 485 "cityName": "漢中" 486 }, 487 { 488 "id": 261, 489 "cityName": "杭州" 490 }, 491 { 492 "id": 639, 493 "cityName": "合肥" 494 }, 495 { 496 "id": 895, 497 "cityName": "菏澤" 498 }, 499 { 500 "id": 1074, 501 "cityName": "賀州" 502 }, 503 { 504 "id": 3372, 505 "cityName": "鶴壁" 506 }, 507 { 508 "id": 3611, 509 "cityName": "衡陽" 510 }, 511 { 512 "id": 645, 513 "cityName": "呼和浩特" 514 }, 515 { 516 "id": 2205, 517 "cityName": "湖州" 518 }, 519 { 520 "id": 3397, 521 "cityName": "葫蘆島" 522 }, 523 { 524 "id": 594, 525 "cityName": "淮安" 526 }, 527 { 528 "id": 699, 529 "cityName": "淮北" 530 }, 531 { 532 "id": 1953, 533 "cityName": "淮南" 534 }, 535 { 536 "id": 3124, 537 "cityName": "黃岡" 538 }, 539 { 540 "id": 2451, 541 "cityName": "黃山" 542 }, 543 { 544 "id": 255, 545 "cityName": "惠州" 546 }, 547 { 548 "id": 1774, 549 "cityName": "海安縣" 550 }, 551 { 552 "id": 1840, 553 "cityName": "海陽" 554 }, 555 { 556 "id": 2347, 557 "cityName": "海門" 558 }, 559 { 560 "id": 2356, 561 "cityName": "黃驊" 562 }, 563 { 564 "id": 2878, 565 "cityName": "霍山縣" 566 }, 567 { 568 "id": 3125, 569 "cityName": "紅安縣" 570 }, 571 { 572 "id": 3266, 573 "cityName": "洪澤縣" 574 }, 575 { 576 "id": 3291, 577 "cityName": "懷來縣" 578 }, 579 { 580 "id": 3494, 581 "cityName": "霍邱縣" 582 } 583 ] 584 }, 585 { 586 "title": "J", 587 "items": [ 588 { 589 "id": 771, 590 "cityName": "吉林" 591 }, 592 { 593 "id": 470, 594 "cityName": "濟南" 595 }, 596 { 597 "id": 996, 598 "cityName": "濟寧" 599 }, 600 { 601 "id": 2230, 602 "cityName": "佳木斯" 603 }, 604 { 605 "id": 1536, 606 "cityName": "嘉興" 607 }, 608 { 609 "id": 1777, 610 "cityName": "嘉峪關" 611 }, 612 { 613 "id": 2242, 614 "cityName": "焦作" 615 }, 616 { 617 "id": 2893, 618 "cityName": "揭陽" 619 }, 620 { 621 "id": 654, 622 "cityName": "金華" 623