123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
-
- // 城市选择框显示
- var inCity = new Object();
- inCity.cssParents = function(){ //城市显示
- inCity.top = placeThis.offset().top+27; //城市选择框 top位置
- inCity.left = placeThis.offset().left; //城市选择框 left位置
- $(inCity.id).css({"top":inCity.top+"px","left":inCity.left+"px","width":inCity.width+"px","height":inCity.height+"px"});
-
- $('#in_city_bak').show();
- }
- inCity.place = function (e) {
- e.click(function(){
- placeThis = $(this);
- //城市显示
- inCity.cssParents();
- $(inCity.id).show();
-
- $('#in_city_bak').show();
- return false;
- })
- }
- inCity.destination = function (e){
- e.click(function(){
- placeThis = $(this);
- //城市显示
- inCity.cssParents();
- $(inCity.id).show();
-
- $('#in_city_bak').show();
-
- return false;
- })
- }
-
- /* 城市HTML模板 */
- inCity._template = [
- '<span style="display:block;width:100px;cursor:pointer;" id="quxiao">取消</span>',
- '<div class="screen">',
- '<a href="javascript:void(0)" class="shar">热门</a>',
- '<a href="javascript:void(0)">ABCDEFG</a>',
- '<a href="javascript:void(0)">HIJKL</a>',
- '<a href="javascript:void(0)">MNOPQRST</a>',
- '<a href="javascript:void(0)">WXYZ</a>',
- '</div>',
- '<div class="city_pos">',
- '<div class="city_a_le1">',
- '</div>',
- '<div class="city_a_le1" style="display: none">',
- '</div>',
- '<div class="city_a_le1" style="display: none">',
- '</div>',
- '<div class="city_a_le1" style="display: none">',
- '</div>',
- '<div class="city_a_le1" style="display: none">',
- '</div>',
- '</div>'
- ];
-
- /*,'鞍山市|anshan|as','安庆市|anqing|aq','安阳市|anyang|ay','阿坝州|abazhou|abz','安顺市|anshun|as','阿里地区|alidiqu|aldq','安康市|ankang|ak','阿克苏地区|akesudiqu|aksdq','阿勒泰地区|aletaidiqu|altdq','澳门半岛|aomenbandao|ambd','北京市|beijing|bj','保定市|baoding|bd','包头市|baotou|bt','巴彦淖尔市|bayannaoer|byne','本溪市|benxi|bx','白山市|baishan|bs','白城市|baicheng|bc','蚌埠市|bengbu|bb','滨州市|binzhou|bz','北海市|beihai|bh','百色市|baise|bs','白沙县|baishaxian|bsx','保亭县|baotingxian|btx','巴中市|bazhong|bz','毕节地区|bijiediqu|bjdq','保山市|baoshan|bs','宝鸡市|baoji|bj','白银市|baiyin|by','博州|bozhou|bz','巴州|bazhou|bz','承德市|chengde|cd','沧州市|cangzhou|cz','长治市|changzhi|cz','赤峰市|chifeng|cf','朝阳市|zhaoyang|zy','长春市|changchun|cc','常州市|changzhou|cz','滁州市|chuzhou|cz','巢湖市|chaohu|ch','池州市|chizhou|cz','长沙市|changsha|cs','常德市|changde|cd','郴州市|chenzhou|cz','潮州市|chaozhou|cz','崇左市|chongzuo|cz','澄迈县|chengmaixian|cmx','昌江县|changjiangxian|cjx','重庆市|chongqing|cq','成都市|chengdu|cd','楚雄州|chuxiongzhou|cxz','昌都地区|changdudiqu|cddq','昌吉州|changjizhou|cjz','大同市|datong|dt','大连市|dalian|dl','丹东市|dandong|dd','大庆市|daqing|dq','大兴安岭地区|daxinganlingdiqu|dxaldq','东营市|dongying|dy','德州市|dezhou|dz','东莞市|dongguan|dg','儋州市|danzhou|dz','东方市|dongfang|df','定安县|dinganxian|dax','德阳市|deyang|dy','达州市|dazhou|dz','大理州|dalizhou|dlz','德宏州|dehongzhou|dhz','迪庆州|diqingzhou|dqz','定西市|dingxi|dx','鄂尔多斯市|eerduosi|eeds','鄂州市|ezhou|ez','恩施州|enshizhou|esz','抚顺市|fushun|fs','阜新市|fuxin|fx','阜阳市|fuyang|fy','福州市|fuzhou|fz','抚州市|fuzhou|fz','佛山市|foshan|fs','防城港市|fangchenggang|fcg','赣州市|ganzhou|gz','广州市|guangzhou|gz','桂林市|guilin|gl','贵港市|guigang|gg','广元市|guangyuan|gy','广安市|guangan|ga','甘孜州|ganzizhou|gzz','贵阳市|guiyang|gy','甘南州|gannanzhou|gnz','果洛州|guoluozhou|glz','固原市|guyuan|gy','高雄市|gaoxiong|gx','邯郸市|handan|hd','衡水市|hengshui|hs','呼和浩特市|huhehaote|hhht','呼伦贝尔市|hulunbeier|hlbe','葫芦岛市|huludao|hld','哈尔滨市|haerbin|heb','鹤岗市|hegang|hg','黑河市|heihe|hh','淮安市|huaian|ha','杭州市|hangzhou|hz','湖州市|huzhou|hz','合肥市|hefei|hf','淮南市|huainan|hn','淮北市|huaibei|hb','黄山市|huangshan|hs','亳州市|bozhou|bz','菏泽市|heze|hz','鹤壁市|hebi|hb','黄石市|huangshi|hs','黄冈市|huanggang|hg','衡阳市|hengyang|hy','怀化市|huaihua|hh','惠州市|huizhou|hz','河源市|heyuan|hy','贺州市|hezhou|hz','河池市|hechi|hc','海口市|haikou|hk','红河州|honghezhou|hhz','汉中市|hanzhong|hz','海东地区|haidongdiqu|hddq','海北州|haibeizhou|hbz','黄南州|huangnanzhou|hnz','海南州|hainanzhou|hnz','海西州|haixizhou|hxz','哈密地区|hamidiqu|hmdq','和田地区|hetiandiqu|htdq','花莲县|hualianxian|hlx','海外|haiwai|hw','晋城市|jincheng|jc','晋中市|jinzhong|jz','锦州市|jinzhou|jz','吉林市|jilin|jl','鸡西市|jixi|jx','佳木斯市|jiamusi|jms','嘉兴市|jiaxing|jx','金华市|jinhua|jh','景德镇市|jingdezhen|jdz','九江市|jiujiang|jj','吉安市|jian|ja','济南市|jinan|jn','济宁市|jining|jn','济源市|jiyuan|jy','焦作市|jiaozuo|jz','荆门市|jingmen|jm','荆州市|jingzhou|jz','江门市|jiangmen|jm','揭阳市|jieyang|jy','嘉峪关市|jiayuguan|jyg','金昌市|jinchang|jc','酒泉市|jiuquan|jq','基隆市|jilong|jl','嘉义市|jiayi|jy','嘉义县|jiayixian|jyx','金门县|jinmenxian|jmx','九龙|jiulong|jl','开封市|kaifeng|kf','昆明市|kunming|km','克拉玛依市|kelamayi|klmy','克州|kezhou|kz','喀什地区|kashidiqu|ksdq','廊坊市|langfang|lf','临汾市|linfen|lf','吕梁市|lyuliang|ll','辽阳市|liaoyang|ly','辽源市|liaoyuan|ly','连云港市|lianyungang|lyg','丽水市|lishui|ls','六安市|luan|la','龙岩市|longyan|ly','莱芜市|laiwu|lw','临沂市|linyi|ly','聊城市|liaocheng|lc','洛阳市|luoyang|ly','漯河市|tahe|th','娄底市|loudi|ld','柳州市|liuzhou|lz','来宾市|laibin|lb','临高县|lingaoxian|lgx','乐东县|ledongxian|ldx','陵水县|lingshuixian|lsx','泸州市|luzhou|lz','乐山市|leshan|ls','凉山州|liangshanzhou|lsz','六盘水市|liupanshui|lps','丽江市|lijiang|lj','临沧市|lincang|lc','拉萨市|lasa|ls','林芝地区|linzhidiqu|lzdq','兰州市|lanzhou|lz','陇南市|longnan|ln','临夏州|linxiazhou|lxz','连江县|lianjiangxian|ljx','离岛|lidao|ld','牡丹江市|mudanjiang|mdj','马鞍山市|maanshan|mas','茂名市|maoming|mm','梅州市|meizhou|mz','绵阳市|mianyang|my','眉山市|meishan|ms','苗栗县|miaolixian|mlx','南京市|nanjing|nj','南通市|nantong|nt','宁波市|ningbo|nb','南平市|nanping|np','宁德市 |ningde|nd','南昌市|nanchang|nc','南阳市|nanyang|ny','南宁市|nanning|nn','内江市|neijiang|nj','南充市|nanchong|nc','怒江州|nujiangzhou|njz','那曲地区|naqudiqu|nqdq','南投县|nantouxian|ntx','盘锦市|panjin|pj','莆田市|putian|pt','萍乡市|pingxiang|px','平顶山市|pingdingshan|pds','濮阳市|puyang|py','攀枝花市|panzhihua|pzh','平凉市|pingliang|pl','澎湖县|penghuxian|phx','屏东县|pingdongxian|pdx','秦皇岛市|qinhuangdao|qhd','齐齐哈尔市|qiqihaer|qqhe','七台河市|qitaihe|qth','衢州市|quzhou|qz','泉州市|quanzhou|qz','青岛市|qingdao|qd','清远市|qingyuan|qy','钦州市|qinzhou|qz','琼海市|qionghai|qh','琼中县|qiongzhongxian|qzx','黔西南州|qianxinanzhou|qxnz','黔东南州|qiandongnanzhou|qdnz','黔南州|qiannanzhou|qnz','曲靖市|qujing|qj','庆阳市|qingyang|qy','日照市|rizhao|rz','日喀则地区|rikazediqu|rkzdq','石家庄市|shijiazhuang|sjz','朔州市|shuozhou|sz','沈阳市|shenyang|sy','四平市|siping|sp','松原市|songyuan|sy','双鸭山市|shuangyashan|sys','绥化市|suihua|sh','上海市|shanghai|sh','苏州市|suzhou|sz','宿迁市|suqian|sq','绍兴市|shaoxing|sx','宿州市|suzhou|sz','三明市|sanming|sm','上饶市|shangrao|sr','三门峡市|sanmenxia|smx','商丘市|shangqiu|sq','十堰市|shiyan|sy','随州市|suizhou|sz','省直辖行政单位|shengzhixiaxingzhengdanwei|szxxzdw','邵阳市|shaoyang|sy','韶关市|shaoguan|sg','深圳市|shenzhen|sz','汕头市|shantou|st','汕尾市|shanwei|sw','三亚市|sanya|sy','三沙市|sansha|ss','遂宁市|suining|sn','思茅市|simao|sm','山南地区|shannandiqu|sndq','商洛市|shangluo|sl','石嘴山市|shizuishan|szs','省直辖行政单位|shengzhixiaxingzhengdanwei|szxxzdw','天津市|tianjin|tj','唐山市|tangshan|ts','太原市|taiyuan|ty','通辽市|tongliao|tl','铁岭市|tieling|tl','通化市|tonghua|th','泰州市|taizhou|tz','台州市|taizhou|tz','铜陵市|tongling|tl','泰安市|taian|ta','屯昌县|tunchangxian|tcx','铜仁地区|tongrendiqu|trdq','铜川市|tongchuan|tc','天水市|tianshui|ts','吐鲁番地区|tulufandiqu|tlfdq','塔城地区|tachengdiqu|tcdq','台北市|taibei|tb','台东县|taidongxian|tdx','台南市|tainan|tn','台中市|taizhong|tz','桃园市|taoyuan|ty','乌海市|wuhai|wh','乌兰察布市|wulanchabu|wlcb','无锡市|wuxi|wx','温州市|wenzhou|wz','芜湖市|wuhu|wh','潍坊市|weifang|wf','威海市|weihai|wh','武汉市|wuhan|wh','梧州市|wuzhou|wz','五指山市|wuzhishan|wzs','文昌市|wenchang|wc','万宁市|wanning|wn','文山州|wenshanzhou|wsz','渭南市|weinan|wn','武威市|wuwei|ww','吴忠市|wuzhong|wz','乌鲁木齐市|wulumuqi|wlmq','邢台市|xingtai|xt','忻州市|xinzhou|xz','兴安盟|xinganmeng|xam','锡林郭勒盟|xilinguolemeng|xlglm','徐州市|xuzhou|xz','宣城市|xuancheng|xc','厦门市|xiamen|xm','新余市|xinyu|xy','新乡市|xinxiang|xx','许昌市|xuchang|xc','信阳市|xinyang|xy','襄樊市|xiangfan|xf','孝感市|xiaogan|xg','咸宁市|xianning|xn','湘潭市|xiangtan|xt','湘西州|xiangxizhou|xxz','县|xian|x','西双版纳州|xishuangbannazhou|xsbnz','西安市|xian|xa','咸阳市|xianyang|xy','西宁市|xining|xn','新北市|xinbei|xb','新竹市|xinzhu|xz','新竹县|xinzhuxian|xzx','香港岛|xianggangdao|xgd','新界|xinjie|xj','阳泉市|yangquan|yq','运城市|yuncheng|yc','营口市|yingkou|yk','延边州|yanbianzhou|ybz','伊春市|yichun|yc','盐城市|yancheng|yc','扬州市|yangzhou|yz','鹰潭市|yingtan|yt','宜春市|yichun|yc','烟台市|yantai|yt','宜昌市|yichang|yc','岳阳市|yueyang|yy','益阳市|yiyang|yy','永州市|yongzhou|yz','阳江市|yangjiang|yj','云浮市|yunfu|yf','玉林市|yulin|yl','宜宾市|yibin|yb','雅安市|yaan|ya','玉溪市|yuxi|yx','延安市|yanan|ya','榆林市|yulin|yl','玉树州|yushuzhou|ysz','银川市|yinchuan|yc','伊犁州|yilizhou|ylz','宜兰县|yilanxian|ylx','云林县|yunlinxian|ylx','张家口市|zhangjiakou|zjk','镇江市|zhenjiang|zj','舟山市|zhoushan|zs','漳州市|zhangzhou|zz','淄博市|zibo|zb','枣庄市|zaozhuang|zz','郑州市|zhengzhou|zz','周口市|zhoukou|zk','驻马店市|zhumadian|zmd','株洲市|zhuzhou|zz','张家界市|zhangjiajie|zjj','珠海市|zhuhai|zh','湛江市|zhanjiang|zj','肇庆市|zhaoqing|zq','中山市|zhongshan|zs','自贡市|zigong|zg','资阳市|ziyang|zy','遵义市|zunyi|zy','昭通市|zhaotong|zt','张掖市|zhangye|zy','中卫市|zhongwei|zw','彰化县|zhanghuaxian|zhx'
-
- */
- /* 所有城市数据,可以按照格式自行添加(北京|beijing|bj),前16条为热门城市 */
-
- inCity.allCity = ['北京|beijing|bj','上海|shanghai|sh', '重庆|chongqing|cq', '深圳|shenzhen|sz', '广州|guangzhou|gz', '杭州|hangzhou|hz',
- '南京|nanjing|nj', '苏州|shuzhou|sz', '天津|tianjin|tj', '成都|chengdu|cd', '南昌|nanchang|nc', '三亚|sanya|sy','青岛|qingdao|qd',
- '厦门|xiamen|xm', '西安|xian|xa','长沙|changsha|cs','合肥|hefei|hf','西藏|xizang|xz', '内蒙古|neimenggu|nmg','阿拉善盟|alashanmeng|alsm','鞍山市|anshan|as','安庆市|anqing|aq','安阳市|anyang|ay','阿坝州|abazhou|abz','安顺市|anshun|as','阿里地区|alidiqu|aldq','安康市|ankang|ak','阿克苏地区|akesudiqu|aksdq','阿勒泰地区|aletaidiqu|altdq','澳门半岛|aomenbandao|ambd','北京市|beijing|bj','保定市|baoding|bd','包头市|baotou|bt','巴彦淖尔市|bayannaoer|byne','本溪市|benxi|bx','白山市|baishan|bs','白城市|baicheng|bc','蚌埠市|bengbu|bb','滨州市|binzhou|bz','北海市|beihai|bh','百色市|baise|bs','白沙县|baishaxian|bsx','保亭县|baotingxian|btx','巴中市|bazhong|bz','毕节地区|bijiediqu|bjdq','保山市|baoshan|bs','宝鸡市|baoji|bj','白银市|baiyin|by','博州|bozhou|bz','巴州|bazhou|bz','承德市|chengde|cd','沧州市|cangzhou|cz','长治市|changzhi|cz','赤峰市|chifeng|cf','朝阳市|zhaoyang|zy','长春市|changchun|cc','常州市|changzhou|cz','滁州市|chuzhou|cz','巢湖市|chaohu|ch','池州市|chizhou|cz','长沙市|changsha|cs','常德市|changde|cd','郴州市|chenzhou|cz','潮州市|chaozhou|cz','崇左市|chongzuo|cz','澄迈县|chengmaixian|cmx','昌江县|changjiangxian|cjx','重庆市|chongqing|cq','成都市|chengdu|cd','楚雄州|chuxiongzhou|cxz','昌都地区|changdudiqu|cddq','昌吉州|changjizhou|cjz','大同市|datong|dt','大连市|dalian|dl','丹东市|dandong|dd','大庆市|daqing|dq','大兴安岭地区|daxinganlingdiqu|dxaldq','东营市|dongying|dy','德州市|dezhou|dz','东莞市|dongguan|dg','儋州市|danzhou|dz','东方市|dongfang|df','定安县|dinganxian|dax','德阳市|deyang|dy','达州市|dazhou|dz','大理州|dalizhou|dlz','德宏州|dehongzhou|dhz','迪庆州|diqingzhou|dqz','定西市|dingxi|dx','鄂尔多斯市|eerduosi|eeds','鄂州市|ezhou|ez','恩施州|enshizhou|esz','抚顺市|fushun|fs','阜新市|fuxin|fx','阜阳市|fuyang|fy','福州市|fuzhou|fz','抚州市|fuzhou|fz','佛山市|foshan|fs','防城港市|fangchenggang|fcg','赣州市|ganzhou|gz','广州市|guangzhou|gz','桂林市|guilin|gl','贵港市|guigang|gg','广元市|guangyuan|gy','广安市|guangan|ga','甘孜州|ganzizhou|gzz','贵阳市|guiyang|gy','甘南州|gannanzhou|gnz','果洛州|guoluozhou|glz','固原市|guyuan|gy','高雄市|gaoxiong|gx','邯郸市|handan|hd','衡水市|hengshui|hs','呼和浩特市|huhehaote|hhht','呼伦贝尔市|hulunbeier|hlbe','葫芦岛市|huludao|hld','哈尔滨市|haerbin|heb','鹤岗市|hegang|hg','黑河市|heihe|hh','淮安市|huaian|ha','杭州市|hangzhou|hz','湖州市|huzhou|hz','合肥市|hefei|hf','淮南市|huainan|hn','淮北市|huaibei|hb','黄山市|huangshan|hs','亳州市|bozhou|bz','菏泽市|heze|hz','鹤壁市|hebi|hb','黄石市|huangshi|hs','黄冈市|huanggang|hg','衡阳市|hengyang|hy','怀化市|huaihua|hh','惠州市|huizhou|hz','河源市|heyuan|hy','贺州市|hezhou|hz','河池市|hechi|hc','海口市|haikou|hk','红河州|honghezhou|hhz','汉中市|hanzhong|hz','海东地区|haidongdiqu|hddq','海北州|haibeizhou|hbz','黄南州|huangnanzhou|hnz','海南州|hainanzhou|hnz','海西州|haixizhou|hxz','哈密地区|hamidiqu|hmdq','和田地区|hetiandiqu|htdq','花莲县|hualianxian|hlx','海外|haiwai|hw','晋城市|jincheng|jc','晋中市|jinzhong|jz','锦州市|jinzhou|jz','吉林市|jilin|jl','鸡西市|jixi|jx','佳木斯市|jiamusi|jms','嘉兴市|jiaxing|jx','金华市|jinhua|jh','景德镇市|jingdezhen|jdz','九江市|jiujiang|jj','吉安市|jian|ja','济南市|jinan|jn','济宁市|jining|jn','济源市|jiyuan|jy','焦作市|jiaozuo|jz','荆门市|jingmen|jm','荆州市|jingzhou|jz','江门市|jiangmen|jm','揭阳市|jieyang|jy','嘉峪关市|jiayuguan|jyg','金昌市|jinchang|jc','酒泉市|jiuquan|jq','基隆市|jilong|jl','嘉义市|jiayi|jy','嘉义县|jiayixian|jyx','金门县|jinmenxian|jmx','九龙|jiulong|jl','开封市|kaifeng|kf','昆明市|kunming|km','克拉玛依市|kelamayi|klmy','克州|kezhou|kz','喀什地区|kashidiqu|ksdq','廊坊市|langfang|lf','临汾市|linfen|lf','吕梁市|lyuliang|ll','辽阳市|liaoyang|ly','辽源市|liaoyuan|ly','连云港市|lianyungang|lyg','丽水市|lishui|ls','六安市|luan|la','龙岩市|longyan|ly','莱芜市|laiwu|lw','临沂市|linyi|ly','聊城市|liaocheng|lc','洛阳市|luoyang|ly','漯河市|tahe|th','娄底市|loudi|ld','柳州市|liuzhou|lz','来宾市|laibin|lb','临高县|lingaoxian|lgx','乐东县|ledongxian|ldx','陵水县|lingshuixian|lsx','泸州市|luzhou|lz','乐山市|leshan|ls','凉山州|liangshanzhou|lsz','六盘水市|liupanshui|lps','丽江市|lijiang|lj','临沧市|lincang|lc','拉萨市|lasa|ls','林芝地区|linzhidiqu|lzdq','兰州市|lanzhou|lz','陇南市|longnan|ln','临夏州|linxiazhou|lxz','连江县|lianjiangxian|ljx','离岛|lidao|ld','牡丹江市|mudanjiang|mdj','马鞍山市|maanshan|mas','茂名市|maoming|mm','梅州市|meizhou|mz','绵阳市|mianyang|my','眉山市|meishan|ms','苗栗县|miaolixian|mlx','南京市|nanjing|nj','南通市|nantong|nt','宁波市|ningbo|nb','南平市|nanping|np','宁德市|ningde|nd','南昌市|nanchang|nc','南阳市|nanyang|ny','南宁市|nanning|nn','内江市|neijiang|nj','南充市|nanchong|nc','怒江州|nujiangzhou|njz','那曲地区|naqudiqu|nqdq','南投县|nantouxian|ntx','盘锦市|panjin|pj','莆田市|putian|pt','萍乡市|pingxiang|px','平顶山市|pingdingshan|pds','濮阳市|puyang|py','攀枝花市|panzhihua|pzh','平凉市|pingliang|pl','澎湖县|penghuxian|phx','屏东县|pingdongxian|pdx','秦皇岛市|qinhuangdao|qhd','齐齐哈尔市|qiqihaer|qqhe','七台河市|qitaihe|qth','衢州市|quzhou|qz','泉州市|quanzhou|qz','青岛市|qingdao|qd','清远市|qingyuan|qy','钦州市|qinzhou|qz','琼海市|qionghai|qh','琼中县|qiongzhongxian|qzx','黔西南州|qianxinanzhou|qxnz','黔东南州|qiandongnanzhou|qdnz','黔南州|qiannanzhou|qnz','曲靖市|qujing|qj','庆阳市|qingyang|qy','日照市|rizhao|rz','日喀则地区|rikazediqu|rkzdq','石家庄市|shijiazhuang|sjz','朔州市|shuozhou|sz','沈阳市|shenyang|sy','四平市|siping|sp','松原市|songyuan|sy','双鸭山市|shuangyashan|sys','绥化市|suihua|sh','上海市|shanghai|sh','苏州市|suzhou|sz','宿迁市|suqian|sq','绍兴市|shaoxing|sx','宿州市|suzhou|sz','三明市|sanming|sm','上饶市|shangrao|sr','三门峡市|sanmenxia|smx','商丘市|shangqiu|sq','十堰市|shiyan|sy','随州市|suizhou|sz','省直辖行政单位|shengzhixiaxingzhengdanwei|szxxzdw','邵阳市|shaoyang|sy','韶关市|shaoguan|sg','深圳市|shenzhen|sz','汕头市|shantou|st','汕尾市|shanwei|sw','三亚市|sanya|sy','三沙市|sansha|ss','遂宁市|suining|sn','思茅市|simao|sm','山南地区|shannandiqu|sndq','商洛市|shangluo|sl','石嘴山市|shizuishan|szs','省直辖行政单位|shengzhixiaxingzhengdanwei|szxxzdw','天津市|tianjin|tj','唐山市|tangshan|ts','太原市|taiyuan|ty','通辽市|tongliao|tl','铁岭市|tieling|tl','通化市|tonghua|th','泰州市|taizhou|tz','台州市|taizhou|tz','铜陵市|tongling|tl','泰安市|taian|ta','屯昌县|tunchangxian|tcx','铜仁地区|tongrendiqu|trdq','铜川市|tongchuan|tc','天水市|tianshui|ts','吐鲁番地区|tulufandiqu|tlfdq','塔城地区|tachengdiqu|tcdq','台北市|taibei|tb','台东县|taidongxian|tdx','台南市|tainan|tn','台中市|taizhong|tz','桃园市|taoyuan|ty','乌海市|wuhai|wh','乌兰察布市|wulanchabu|wlcb','无锡市|wuxi|wx','温州市|wenzhou|wz','芜湖市|wuhu|wh','潍坊市|weifang|wf','威海市|weihai|wh','武汉市|wuhan|wh','梧州市|wuzhou|wz','五指山市|wuzhishan|wzs','文昌市|wenchang|wc','万宁市|wanning|wn','文山州|wenshanzhou|wsz','渭南市|weinan|wn','武威市|wuwei|ww','吴忠市|wuzhong|wz','乌鲁木齐市|wulumuqi|wlmq','邢台市|xingtai|xt','忻州市|xinzhou|xz','兴安盟|xinganmeng|xam','锡林郭勒盟|xilinguolemeng|xlglm','徐州市|xuzhou|xz','宣城市|xuancheng|xc','厦门市|xiamen|xm','新余市|xinyu|xy','新乡市|xinxiang|xx','许昌市|xuchang|xc','信阳市|xinyang|xy','襄樊市|xiangfan|xf','孝感市|xiaogan|xg','咸宁市|xianning|xn','湘潭市|xiangtan|xt','湘西州|xiangxizhou|xxz','县|xian|x','西双版纳州|xishuangbannazhou|xsbnz','西安市|xian|xa','咸阳市|xianyang|xy','西宁市|xining|xn','新北市|xinbei|xb','新竹市|xinzhu|xz','新竹县|xinzhuxian|xzx','香港岛|xianggangdao|xgd','新界|xinjie|xj','阳泉市|yangquan|yq','运城市|yuncheng|yc','营口市|yingkou|yk','延边州|yanbianzhou|ybz','伊春市|yichun|yc','盐城市|yancheng|yc','扬州市|yangzhou|yz','鹰潭市|yingtan|yt','宜春市|yichun|yc','烟台市|yantai|yt','宜昌市|yichang|yc','岳阳市|yueyang|yy','益阳市|yiyang|yy','永州市|yongzhou|yz','阳江市|yangjiang|yj','云浮市|yunfu|yf','玉林市|yulin|yl','宜宾市|yibin|yb','雅安市|yaan|ya','玉溪市|yuxi|yx','延安市|yanan|ya','榆林市|yulin|yl','玉树州|yushuzhou|ysz','银川市|yinchuan|yc','伊犁州|yilizhou|ylz','宜兰县|yilanxian|ylx','云林县|yunlinxian|ylx','张家口市|zhangjiakou|zjk','镇江市|zhenjiang|zj','舟山市|zhoushan|zs','漳州市|zhangzhou|zz','淄博市|zibo|zb','枣庄市|zaozhuang|zz','郑州市|zhengzhou|zz','周口市|zhoukou|zk','驻马店市|zhumadian|zmd','株洲市|zhuzhou|zz','张家界市|zhangjiajie|zjj','珠海市|zhuhai|zh','湛江市|zhanjiang|zj','肇庆市|zhaoqing|zq','中山市|zhongshan|zs','自贡市|zigong|zg','资阳市|ziyang|zy','遵义市|zunyi|zy','昭通市|zhaotong|zt','张掖市|zhangye|zy','中卫市|zhongwei|zw','彰化县|zhanghuaxian|zhx'];
-
- /* 正则表达式 筛选中文城市名、拼音、首字母 */
-
- inCity.regEx = /^([\u4E00-\u9FA5\uf900-\ufa2d]+)\|(\w+)\|(\w)\w*$/i;
- inCity.regExChiese = /([\u4E00-\u9FA5\uf900-\ufa2d]+)/;
-
- (function () {
- var citys = inCity.allCity, match, letter,
- regEx = inCity.regEx,
- reg2 = /^[a-g]$/i, reg3 = /^[h-l]$/i, reg4 = /^[m-t]$/i, reg5 = /^[w-z]$/i;
- if (!inCity.oCity) {
- inCity.oCity = {hot:{},ABCDEFG:{}, HIJKL:{}, MNOPQRST:{}, WXYZ:{}};
- //console.log(citys.length);
- for (var i = 0, n = citys.length; i < n; i++) {
- match = regEx.exec(citys[i]); //exec
- console.log(match);
- letter = match[3].toUpperCase(); //转换字母为大写
-
- if (reg2.test(letter)) { //test检测一个字符串是否匹配某个模式
- if (!inCity.oCity.ABCDEFG[letter]) inCity.oCity.ABCDEFG[letter] = [];
- inCity.oCity.ABCDEFG[letter].push(match[1]);
- } else if (reg3.test(letter)) {
- if (!inCity.oCity.HIJKL[letter]) inCity.oCity.HIJKL[letter] = [];
- inCity.oCity.HIJKL[letter].push(match[1]);
- } else if (reg4.test(letter)) {
- if (!inCity.oCity.MNOPQRST[letter]) inCity.oCity.MNOPQRST[letter] = [];
- inCity.oCity.MNOPQRST[letter].push(match[1]);
- } else if (reg5.test(letter)) {
- if (!inCity.oCity.WXYZ[letter]) inCity.oCity.WXYZ[letter] = [];
- inCity.oCity.WXYZ[letter].push(match[1]);
- }
- /* 热门城市 前16条 */
- if(i<16){
- if(!inCity.oCity.hot['hot']) inCity.oCity.hot['hot'] = [];
- inCity.oCity.hot['hot'].push(match[1]);
- }
- }
- }
- })();
- // 热门城市
- inCity.Hot = function(cityA){
- var ckey,odda,sortKey,str,odda=[],abc=[],key,regEx = inCity.regEx,oCity = inCity.oCity,len,leni;
- for(key in oCity){
- sortKey=[];
- for(ckey in oCity[key]){
- sortKey.push(ckey);
- // ckey按照ABCDEDG顺序排序
- sortKey.sort();
- }
- for(var j=0,k = sortKey.length;j<k;j++){
- odda = [];
- abc=[];
- for(var i=0,n=oCity[key][sortKey[j]].length;i<n;i++){
-
- if(key == 'hot'){
- $(inCity.id).find(inCity.Children).eq(0).append('<a target="_blank" href="javascript:void(0)">' + oCity[key][sortKey[j]][i] + '</a>');
- odda.push(str);
- }else{
- str = '<a target="_blank" href="javascript:void(0)">' + oCity[key][sortKey[j]][i] + '</a>';
- inCity.arrRepeat(abc,sortKey,j); //获取字母
- odda.push(str);
- len = n;
- leni = i;
- }
-
- }
- inCity.cityPinyin(leni,len,key,abc,odda);
- }
- }
- }
-
- // 按拼音排序
- inCity.cityPinyin = function(leni,len,key,abc,odda){
- if(leni != undefined && key != 'hot'){
- if(len-1 == leni){
- var one;
- switch (key)
- {
- case 'ABCDEFG':
- one = 1;
- break;
- case 'HIJKL':
- one = 2;
- break;
- case 'MNOPQRST':
- one = 3;
- break;
- case 'WXYZ':
- one = 4;
- break;
- }
- $(inCity.id).find(inCity.Children).eq(one).append('<div class="Letter">'
- +'<span>'+abc[0]+'</span>'
- +'<div>'
- +odda.join('')
- +'</div>'
- +'</div>');
- }
- }
- }
-
- // 数组去重
- inCity.arrRepeat = function(abc,sortKey,j){
- var nab = sortKey[j];
- for(var i in abc){
- if(abc[i] == nab){
- return nab = 1;
- }
- }
- if(nab != 1){
- abc.push(sortKey[j])
- }
- }
- // 城市切换
- inCity.payment = function($this){
- var ind = $this.index();
- $this.siblings().removeClass("shar");
- $this.addClass("shar");
- $this.parent().next().children().hide();
- $this.parent().next().children().eq(ind).show();
-
- $('#in_city_bak').show();
- }
- // 给input赋值
- inCity.cityClick = function ($this) {
- $(".city_a_le1 a").click(function () {
- var a_city = $(this).text(); //当前选择的城市
- $(inCity.id).hide(); //隐藏城市选择框
- placeThis.val(a_city); //赋值
-
-
- $('#in_city_bak').hide();
-
- return false;
- })
- }
|