From 0aef9e30197c4a401ab657506c78aa81ee93c3f2 Mon Sep 17 00:00:00 2001 From: tping Date: Mon, 21 Dec 2020 15:57:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E4=BC=9A=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SocietyInfoController.class.php | 414 ++++++++++++++++++ .../Admin/Model/SocietyInfoModel.class.php | 11 + Application/Admin/View/SocietyInfo/add.html | 260 +++++++++++ Application/Admin/View/SocietyInfo/edit.html | 288 ++++++++++++ .../Admin/View/SocietyInfo/export.html | 147 +++++++ Application/Admin/View/SocietyInfo/lists.html | 306 +++++++++++++ .../Admin/View/SocietyInfo/timeset.html | 84 ++++ Public/static/area.js | 61 +++ 8 files changed, 1571 insertions(+) create mode 100644 Application/Admin/Controller/SocietyInfoController.class.php create mode 100644 Application/Admin/Model/SocietyInfoModel.class.php create mode 100644 Application/Admin/View/SocietyInfo/add.html create mode 100644 Application/Admin/View/SocietyInfo/edit.html create mode 100644 Application/Admin/View/SocietyInfo/export.html create mode 100644 Application/Admin/View/SocietyInfo/lists.html create mode 100644 Application/Admin/View/SocietyInfo/timeset.html create mode 100644 Public/static/area.js diff --git a/Application/Admin/Controller/SocietyInfoController.class.php b/Application/Admin/Controller/SocietyInfoController.class.php new file mode 100644 index 000000000..f9dd572d5 --- /dev/null +++ b/Application/Admin/Controller/SocietyInfoController.class.php @@ -0,0 +1,414 @@ +admininfo = $_SESSION['onethink_admin']['user_auth']; + parent::_initialize(); + } + //列表 + public function lists() + { + $model = M($this->modelName, 'tab_'); + $map = []; + if ($this->admininfo['username'] == "admin" || isMarketLeader()) { + // admin 和 市场总监可以看所有数据 + } else { + // 其他用户只能看自己的 + $map['create_account'] = $this->admininfo['username']; + } + + $page = intval(I('get.p', 0)); + $page = $page ? $page : 1; //默认显示第一页数据 + $row = intval(I('row', 0)); + $row = empty($row) ? 10 : $row;//每页条数 + + $is_export= false; + if (isset($_REQUEST['export']) && $_REQUEST['export']==1){ + $is_export = true; + } + $config = M('config', 'sys_')->where([ + 'name' => 'SOCIETY_INFO_COMMUNITION_GAP' + ])->find(); + $gap = $config['value']; + + if (I('province') && I('province') != '请选择省份') $map['province'] = I('province'); + if (I('city') && I('city') != '请选择城市') $map['city'] = I('city'); + if (I('game_type') && I('game_type') != '请选择游戏类型') $map['game_type'] = array("exp", "like '%".I('game_type')."%'"); + if (trim(I('interface_person'))) $map['interface_person'] = I('interface_person'); + if (I('time_gap', '') == 1) { + $map['communication_time'] = array('gt', time() - $gap * 86400); + } + if (I('time_gap', -1) == 0) { + $map['communication_time'] = array('elt', time() - $gap * 86400); + } + //获取分页数据 + $query = $model->where($map)->order("id desc"); + $count = $query->count(); + if($is_export){ + $parseData = $query->field("*")->select(); + $this->assign('listData', $parseData); + $GetData = $_GET; + unset($GetData['export']); + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'url'=>U(CONTROLLER_NAME.'/'.ACTION_NAME,$GetData),'menu'=>"推广-公会信息-导出"]); + $this->display("export"); + die(); + } else { + $societyInfos = $model->where($map)->order("id desc")->field("*")->page($page,$row)->select(); + } + + //分页 + $parameter['p'] = $page; + $parameter['row'] = $row; + $page = set_pagination($count, $row, $parameter); + if ($page) { + $this->assign('_page', $page); + } + + foreach ($societyInfos as &$v) { + if (time() - $v['communication_time'] > $gap * 86400) + $v['is_gap_time'] = 1; + } + + $this->checkListOrCountAuthRestMap($map,[]); + $this->assign('timeset_check',$this->checkRule("Admin/SocietyInfo/timeset" ,array('in','1,2'))); + +// $this->assign('time_gap', $config['value']); + $gameTypes = M('game_type', 'tab_')->field("id, type_name")->select(); + $this->assign('game_types', $gameTypes); + $this->assign('listData', $societyInfos); + $this->assign('count', $count); + $this->meta_title = '公会信息登记表(说明:此功能是公会信息内容登记)'; + $this->display(); + } + + // + public function timeset() { + $config = M('config', 'sys_')->where([ + 'name' => 'SOCIETY_INFO_COMMUNITION_GAP' + ])->find(); + $num = $config['value']; + if (IS_POST) { + $num = I('num'); + M('config', 'sys_')->where([ + 'name' => 'SOCIETY_INFO_COMMUNITION_GAP' + ])->save([ + 'value' => $num + ]); + $this->success("设置成功"); + } + + $this->assign('num', $num); + $this->display(); + } + //审核列表 + public function index() + { + $page = intval(I('get.p', 0)); + $page = $page ? $page : 1; //默认显示第一页数据 + $row = intval(I('row', 0)); + $row = empty($row) ? 10 : $row;//每页条数 + $p = $_REQUEST; + + if(!IS_ROOT){ + $this->OpAuthList= getModuleControllerAuth(); + } + + $map = []; + if (!empty(I('partner_name'))) { + $map['partner_name'] = ['like', '%' . I('partner_name') . '%']; + } + if (!empty($p['verify_type'])) { + if($p['verify_type'] == 1){ + $map['partner_id'] = 0; + }else{ + $map['partner_id'] = ["neq",0]; + } + } + if (isset($p['verify_status'])) { + $map['verify_status'] = $p['verify_status']; + } + + if (isset($_REQUEST['timestart']) && isset($_REQUEST['timeend'])) { + $time_start = strtotime($_REQUEST['timestart']); + $time_end = strtotime($_REQUEST['timeend'])+ 86399; + $map["create_time"] =['BETWEEN',[$time_start, $time_end]]; + } elseif (isset($_REQUEST['timestart'])) { + $time_start = strtotime($_REQUEST['timestart']); + $map["create_time"] =['EGT',$time_start]; + } elseif (isset($_REQUEST['timeend'])) { + $time_end = strtotime($_REQUEST['timeend'])+ 86399; + $map["create_time"] = ['ELT',$time_end]; + } + $model = M("partner_verify", 'tab_'); + $data = $model->where($map)->page($page,$row)->order("FIELD(verify_status,0,1,-1),create_time desc")->select(); + foreach ($data as $k => &$v) { + $v['partner_info'] = json_decode($v['partner_info'],true); + if($v['partner_id'] == 0){ + $v['verify_type'] = "新增"; + }else{ + $v['verify_type'] = "修改"; + } + $v['partner_info']['company_type'] = $v['partner_info']['company_type'] == 2 ? '个人' : '公司'; + + + $contract_start_time = $v['partner_info']['contract_start_time'] ? time_format($v['partner_info']['contract_start_time'], 'Y/m/d') : '-'; + if($v['partner_info']['contract_start_time']){ + $contract_end_time = $v['partner_info']['contract_end_time'] ? date('Y/m/d', $v['partner_info']['contract_end_time']) : '永久'; + }else{ + $contract_end_time = $v['partner_info']['contract_end_time'] ? time_format($v['partner_info']['contract_end_time'], 'Y/m/d') : '-'; + } + $v['contract_time'] = $contract_start_time . '-' . $contract_end_time; + + $validity_start_time = $v['partner_info']['validity_start_time'] ? + time_format($v['partner_info']['validity_start_time'], 'Y/m/d') : '-'; + + if($v['partner_info']['validity_start_time']){ + $validity_end_time = $v['partner_info']['validity_end_time'] ? date('Y/m/d', $v['partner_info']['validity_end_time']) : '永久'; + }else{ + $validity_end_time = $v['partner_info']['validity_end_time'] ? time_format($v['partner_info']['validity_end_time'], 'Y/m/d') : '-'; + } + $v['validity_time'] = $validity_start_time . '-' . $validity_end_time; + + $create_time = date("Y-m-d H:i:s",$v["create_time"]); + + $v['verify_log'] = json_decode($v['verify_log'], true); + $v["create"]= "{$v['verify_log']['create_user']}
{$v['verify_log']['create_time']}"; + if(isset($v['verify_log']['verify_user'])){ + if($v['verify_status'] == -1){ + $ts = "审核拒绝"; + }else{ + $ts = "审核通过"; + } + $v["verify"]= "{$ts}({$v['verify_log']['verify_user']})
{$v['verify_log']['verify_time']}"; + }else{ + $v["verify"] = '--'; + } + + } + $count = $model->where($map)->count(); + $page = set_pagination($count, $row); + if ($page) { + $this->assign('_page', $page); + } + $this->assign('menubtn',$this->menuAuth()); + $this->assign('listData', $data); + $this->assign('count', $count); + $this->assign('VerifyStatus', D("PartnerVerify")->VerifyStatus); + $this->meta_title = '上游CP审核列表'; + $this->display(); + } + + //添加 + public function add() + { + $gameTypes = M('game_type', 'tab_')->field("id, type_name")->select(); + $this->assign("game_types", $gameTypes); + $this->assign("interface_person", $this->admininfo['username']); + + if ($_POST) { + $save = I("post."); + $save['create_time'] = time(); + $save['update_time'] = time(); + $save['communication_time'] = time(); + M('society_info', 'tab_')->add($save); + $this->success('保存成功', U('lists')); + } else { + $this->meta_title = '新增公会信息'; + $this->display(); + } + } + + //编辑 + public function edit() + { + $model = M($this->modelName, 'tab_'); + + if ($_POST) { + $save = I("post."); + $id = $save['id']; + foreach ($save['game_types'] as $v) { + $save['game_type'] .= $v . "/"; + } + $save['game_type'] = trim($save['game_type'], '/'); + $save['communication_time'] = time(); + $save['update_time'] = time(); + unset($save['id']); + + $res = M('society_info', 'tab_')->where(['id' => $id])->save($save); + if ($res === false) { + $this->error('保存失败'); + } else { + \Think\Log::actionLog('SocietyInfo/edit', 'SocietyInfo', $id); + addOperationLog(array( + "op_type"=>1, + "key"=>$id, + "url"=>U("SocietyInfo/edit",array("id"=>$id)) + )); + $this->success('保存成功', U('index')); + } + } else { + $id = intval(I('get.id', 0)); + $map['id'] = $id; + $data = $model->find($id); + if (empty($data)) { + $this->error('数据异常', U('lists')); + } + $gameTypes = M('game_type', 'tab_')->field("id, type_name")->select(); + $myGameTypes = explode('/', $data['game_type']); + foreach ($gameTypes as &$v) { + $v['check'] = 0; + foreach ($myGameTypes as $item) { + if ($item == $v['type_name']) { + $v['check'] = 1; + } + } + } + + $this->assign("game_types", $gameTypes); + $this->assign('data', $data); + $this->meta_title = '编辑'; + $this->display(); + } + } + + //删除 + public function del() + { + if (!empty($_POST['ids'])) { + if (!is_array($_POST['ids'])) { + $this->error('参数异常'); + } + + $id = implode(',', $_POST['ids']); + } else { + $id = intval(I('get.id', 0)); + if ($id == 0) { + $this->error('参数异常'); + } + } + $res = M($this->modelName, 'tab_')->delete($id); + if ($res === false) { + $this->error('删除失败'); + } + addOperationLog(array( + "op_type"=>2, + "key"=>$id, + "url"=>U("Society/lists") + )); + $this->success('删除成功', U('lists')); + } + + // 导入 + public function excelImport() { + header("Content-Type:text/html;charset=utf-8"); + $upload = new \Think\Upload();// 实例化上传类 + $upload->maxSize = 3145728 ;// 设置附件上传大小 + $upload->exts = array('xls', 'xlsx');// 设置附件上传类 + $upload->rootPath = './Uploads/'; // 设置附件上传目录 + $upload->savePath = 'excel/'; // 设置附件上传目录 + // 上传文件 + $info = $upload->uploadOne($_FILES['excelData']); + $filename = './Uploads/'.$info['savepath'].$info['savename']; + $exts = $info['ext']; + if(!$info) {// 上传错误提示错误信息 + $this->error($upload->getError()); + } + // 上传成功 + $datas = $this->parseExcelIn($filename, $exts); + $inserts = []; + foreach ($datas as $k => $v) { + foreach ($v as $p) { + if (!$p) { + $this->error("数据不能为空"); + } + } + if ($k == 1) continue; + + $inserts[$k-2]['province'] = $v['A']; + $inserts[$k-2]['city'] = $v['B']; + $inserts[$k-2]['company_name'] = $v['C']; + $inserts[$k-2]['register_capital'] = $v['D']; + $inserts[$k-2]['functionary'] = $v['E']; + $inserts[$k-2]['phone'] = $v['F']; + $inserts[$k-2]['wechat'] = $v['G']; + $inserts[$k-2]['qq'] = $v['H']; + $inserts[$k-2]['game_type'] = $v['I']; + $inserts[$k-2]['game_name'] = $v['J']; + $inserts[$k-2]['join_platform'] = $v['K']; + $inserts[$k-2]['promote_scale'] = $v['L']; + $inserts[$k-2]['turnover'] = $v['M']; + $inserts[$k-2]['address'] = $v['N']; + $inserts[$k-2]['league_info'] = $v['O']; + $inserts[$k-2]['is_potential'] = $v['P']=="是" ? 1 : 0; + $inserts[$k-2]['remark'] = $v['Q']; + $inserts[$k-2]['interface_person'] = $v['R']; + $inserts[$k-2]['create_time'] = time(); + $inserts[$k-2]['update_time'] = time(); + $inserts[$k-2]['communication_time'] = time(); + + $gameTypes = explode('/', $v['I']); + foreach ($gameTypes as $gameType) { + if (!M('game_type', 'tab_')->where(["type_name" => $gameType])->find()) { + $this->error("游戏类型有误:{$gameType}"); + return; + } + } + } + M('society_info', 'tab_')->addAll($inserts); + $this->success("导入成功"); + } + + private function parseExcelIn($filename, $exts) { + //导入PHPExcel类库,因为PHPExcel没有用命名空间,只能inport导入 + //import("Org.Util.PHPExcel"); + vendor("PHPExcel.PHPExcel"); + //创建PHPExcel对象,注意,不能少了\ + $PHPExcel=new \PHPExcel(); + //如果excel文件后缀名为.xls,导入这个类 + if($exts == 'xls'){ + //import("Org.Util.PHPExcel.Reader.Excel5"); + $PHPReader=new \PHPExcel_Reader_Excel5(); + }else if($exts == 'xlsx'){ + //import("Org.Util.PHPExcel.Reader.Excel2007"); + $PHPReader=new \PHPExcel_Reader_Excel2007(); + } + //载入文件 + $PHPExcel=$PHPReader->load($filename); + //获取表中的第一个工作表,如果要获取第二个,把0改为1,依次类推 + $currentSheet=$PHPExcel->getSheet(0); + //获取总列数 + $allColumn=$currentSheet->getHighestColumn(); + //获取总行数 + $allRow=$currentSheet->getHighestRow(); + //循环获取表中的数据,$currentRow表示当前行,从哪行开始读取数据,索引值从0开始 + for($currentRow=1;$currentRow<=$allRow;$currentRow++){ + //从哪列开始,A表示第一列 + for($currentColumn='A';$currentColumn<=$allColumn;$currentColumn++){ + //数据坐标 + $address=$currentColumn.$currentRow; + //读取到的数据,保存到数组$arr中 + $data[$currentRow][$currentColumn]=$currentSheet->getCell($address)->getValue(); + } + + } + + return $data; + } + +} diff --git a/Application/Admin/Model/SocietyInfoModel.class.php b/Application/Admin/Model/SocietyInfoModel.class.php new file mode 100644 index 000000000..0ffb16fca --- /dev/null +++ b/Application/Admin/Model/SocietyInfoModel.class.php @@ -0,0 +1,11 @@ + + + + + + + + + + + + + + + + + +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
省份: + + +
城市: + + +
公司: + +
注册资本: + +
负责人: + +
电话: + +
微信: + +
QQ: + +
游戏类型: + + +
所做游戏: + +
合作平台: + +
推广规模: + +
流水: + +
地址: + +
联盟信息: + +
是否为意向客户: + + + + + +
备注信息: + +
对接人: + +
+
+ +
+
+
+ + + +
+ + + + + + + + + + diff --git a/Application/Admin/View/SocietyInfo/edit.html b/Application/Admin/View/SocietyInfo/edit.html new file mode 100644 index 000000000..d2c8f19fe --- /dev/null +++ b/Application/Admin/View/SocietyInfo/edit.html @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + +
+ + +
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
省份: + + +
城市: + + +
公司: + +
注册资本: + +
负责人: + +
电话: + +
微信: + +
QQ: + +
游戏类型: + + {$vo['type_name']}: checked> + + + +
所做游戏: + +
合作平台: + +
推广规模: + +
流水: + +
地址: + +
联盟信息: + +
是否为意向客户: + + + + + +
备注信息: + +
对接人: + +
+
+ +
+
+
+ + + +
+ + + + + + + + + + diff --git a/Application/Admin/View/SocietyInfo/export.html b/Application/Admin/View/SocietyInfo/export.html new file mode 100644 index 000000000..92cfa476b --- /dev/null +++ b/Application/Admin/View/SocietyInfo/export.html @@ -0,0 +1,147 @@ + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
省份城市公司注册资本负责人电话微信QQ游戏类型所做游戏合作平台推广规模流水地址联盟信息是否为意向客户备注信息对接人录入时间最后沟通时间
aOh! 暂时还没有内容!
{$data.province}{$data.city}{$data.company_name}{$data.register_capital}{$data.functionary}{$data.phone}{$data.wechat}{$data.qq}{$data.game_type}{$data.game_name}{$data.join_platform}{$data.promote_scale}{$data.turnover}{$data.address}{$data.league_info}{$data.is_potential}{$data.remark}{$data.interface_person}{$data.create_time|date='Y-m-d H:i:s', ###}{$data.communication_time|date='Y-m-d H:i:s', ###}
+
+
+
+ {$_page|default=''} +
+ + +
+ + + + + + if(C('COLOR_STYLE')=='blue_color') echo ''; + + + + + + + + diff --git a/Application/Admin/View/SocietyInfo/lists.html b/Application/Admin/View/SocietyInfo/lists.html new file mode 100644 index 000000000..64ff1829b --- /dev/null +++ b/Application/Admin/View/SocietyInfo/lists.html @@ -0,0 +1,306 @@ + + + + + + + + + + + + +
+
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ 搜索 +
+ +
+
+
+ 新增 +
+
+ 导入 +
+
+ + 导出 + +
+ +
+ + + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + style="background: yellow;" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
省份城市公司注册资本负责人电话微信QQ游戏类型所做游戏合作平台推广规模流水地址联盟信息是否为意向客户备注信息对接人录入时间最后沟通时间操作
aOh! 暂时还没有内容!
{$data.province}{$data.city}{$data.company_name}{$data.register_capital}{$data.functionary}{$data.phone}{$data.wechat}{$data.qq}{$data.game_type}{$data.game_name}{$data.join_platform}{$data.promote_scale}{$data.turnover}{$data.address}{$data.league_info}{$data.is_potential}{$data.remark}{$data.interface_person}{$data.create_time|date='Y-m-d H:i:s', ###}{$data.communication_time|date='Y-m-d H:i:s', ###} + 编辑 + 删除 +
+
+
+
+ {$_page|default=''} +
+ + + +
+ + + + + + if(C('COLOR_STYLE')=='blue_color') echo ''; + + + + + + + + diff --git a/Application/Admin/View/SocietyInfo/timeset.html b/Application/Admin/View/SocietyInfo/timeset.html new file mode 100644 index 000000000..3c391c063 --- /dev/null +++ b/Application/Admin/View/SocietyInfo/timeset.html @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + +
+ + + + + + +
未沟通时间超过: + + 天后自动提示
+
+
+
确认添加
+
+
+
+ + + + + diff --git a/Public/static/area.js b/Public/static/area.js new file mode 100644 index 000000000..50d280e14 --- /dev/null +++ b/Public/static/area.js @@ -0,0 +1,61 @@ +var provinces = ['请选择省份','北京市','上海市','天津市','重庆市','河北省','山西省','内蒙古省','辽宁省','吉林省','黑龙江省','江苏省','浙江省','安徽省','福建省','江西省','山东省','河南省','湖北省','湖南省','广东省','广西省','海南省','四川省','贵州省','云南省','西藏省','陕西省','甘肃省','宁夏省','青海省','新疆省','香港','澳门','台湾']; +var citys = [['请选择城市'], + ["东城区", "西城区", "崇文区", "宣武区", "朝阳区", "丰台区", "石景山区", "海淀区", "门头沟区", "房山区", "通州区", "顺义区", "昌平区", "大兴区", "怀柔区", "平谷区", "密云县", "延庆县"], + ["黄浦区", "卢湾区", "徐汇区", "长宁区", "静安区", "普陀区", "虹口区", "杨浦区", "闵行区", "宝山区", "嘉定区", "浦东新区", "金山区", "松江区", "青浦区", "南汇区", "奉贤区", "崇明县"], + ["和平区", "河东区", "河西区", "南开区", "河北区", "红桥区", "塘沽区", "汉沽区", "大港区", "东丽区", "西青区", "津南区", "北辰区", "武清区", "宝坻区", "宁河县", "静海县", "蓟县"], + ["万州区", "涪陵区", "渝中区", "大渡口区", "江北区", "沙坪坝区", "九龙坡区", "南岸区", "北碚区", "万盛区", "双桥区", "渝北区", "巴南区", "黔江区", "长寿区", "綦江县", "潼南县", "铜梁县", "大足县", "荣昌县", "璧山县", "梁平县", "城口县", "丰都县", "垫江县", "武隆县", "忠县", "开县", "云阳县", "奉节县", "巫山县", "巫溪县", "石柱土家族自治县", "秀山土家族苗族自治县", "酉阳土家族苗族自治县", "彭水苗族土家族自治县", "江津市", "合川市", "永川市", "南川市"], + ["石家庄市","张家口市","承德市","秦皇岛市","唐山市","廊坊市","保定市","衡水市","沧州市","邢台市","邯郸市"], + ["太原市","朔州市","大同市","阳泉市","长治市","晋城市","忻州市","晋中市","临汾市","吕梁市","运城市"], + ["呼和浩特市","包头市","乌海市","赤峰市","通辽市","呼伦贝尔市","鄂尔多斯市","乌兰察布市","巴彦淖尔市","兴安盟","锡林郭勒盟","阿拉善盟"], + ["沈阳市","朝阳市","阜新市","铁岭市","抚顺市","本溪市","辽阳市","鞍山市","丹东市","大连市","营口市","盘锦市","锦州市","葫芦岛市"], + ["长春市","白城市","松原市","吉林市","四平市","辽源市","通化市","白山市","延边州"], + ["哈尔滨市","齐齐哈尔市","七台河市","黑河市","大庆市","鹤岗市","伊春市","佳木斯市","双鸭山市","鸡西市","牡丹江市","绥化市","大兴安岭地区"], + ["南京市","徐州市","连云港市","宿迁市","淮安市","盐城市","扬州市","泰州市","南通市","镇江市","常州市","无锡市","苏州市"], + ["杭州市","湖州市","嘉兴市","舟山市","宁波市","绍兴市","衢州市","金华市","台州市","温州市","丽水市"], + ["合肥市","宿州市","淮北市","亳州市","阜阳市","蚌埠市","淮南市","滁州市","马鞍山市","芜湖市","铜陵市","安庆市","黄山市","六安市","巢湖市","池州市","宣城市"], + ["福州市","南平市","莆田市","三明市","泉州市","厦门市","漳州市","龙岩市","宁德市"], + ["南昌市","九江市","景德镇市","鹰潭市","新余市","萍乡市","赣州市","上饶市","抚州市","宜春市","吉安市"], + ["济南市","青岛市","聊城市","德州市","东营市","淄博市","潍坊市","烟台市","威海市","日照市","临沂市","枣庄市","济宁市","泰安市","莱芜市","滨州市","菏泽市"], + ["郑州市","开封市","三门峡市","洛阳市","焦作市","新乡市","鹤壁市","安阳市","濮阳市","商丘市","许昌市","漯河市","平顶山市","南阳市","信阳市","周口市","驻马店市","济源市"], + ["武汉市","十堰市","襄樊市","荆门市","孝感市","黄冈市","鄂州市","黄石市","咸宁市","荆州市","宜昌市","随州市","省直辖县级行政单位","恩施州"], + ["长沙市","张家界市","常德市","益阳市","岳阳市","株洲市","湘潭市","衡阳市","郴州市","永州市","邵阳市","怀化市","娄底市","湘西州"], + ["广州市","深圳市","清远市","韶关市","河源市","梅州市","潮州市","汕头市","揭阳市","汕尾市","惠州市","东莞市","珠海市","中山市","江门市","佛山市","肇庆市","云浮市","阳江市","茂名市","湛江市"], + ["南宁市","桂林市","柳州市","梧州市","贵港市","玉林市","钦州市","北海市","防城港市","崇左市","百色市","河池市","来宾市","贺州市"], + ["海口市","三亚市","省直辖县级行政单位"], + ["成都市","广元市","绵阳市","德阳市","南充市","广安市","遂宁市","内江市","乐山市","自贡市","泸州市","宜宾市","攀枝花市","巴中市","达州市","资阳市","眉山市","雅安市","阿坝州","甘孜州","凉山州"], + ["贵阳市","六盘水市","遵义市","安顺市","毕节地区","铜仁地区","黔东南州","黔南州","黔西南州"], + ["昆明市","曲靖市","玉溪市","保山市","昭通市","丽江市","思茅市","临沧市","德宏州","怒江州","迪庆州","大理州","楚雄州","红河州","文山州","西双版纳州"], + ["拉萨市","那曲地区","昌都地区","林芝地区","山南地区","日喀则地区","阿里地区"], + ["西安市","延安市","铜川市","渭南市","咸阳市","宝鸡市","汉中市","榆林市","安康市","商洛市"], + ["兰州市","嘉峪关市","白银市","天水市","武威市","酒泉市","张掖市","庆阳市","平凉市","定西市","陇南市","临夏州","甘南州"], + ["西宁市","海东地区","海北州","海南州","黄南州","果洛州","玉树州","海西州"], + ["银川市","石嘴山市","吴忠市","固原市","中卫市"], + ["乌鲁木齐市","克拉玛依市","自治区直辖县级行政单位","喀什地区","阿克苏地区","和田地区","吐鲁番地区","哈密地区","克孜勒苏柯州","博尔塔拉州","昌吉州","巴音郭楞州","伊犁州","塔城地区","阿勒泰地区"], + ["香港"], + ["澳门"], + ["台北市","高雄市","台中市","花莲市","基隆市","嘉义市","金门市","连江市","苗栗市","南投市","澎湖市","屏东市","台东市","台南市","桃园市","新竹市","宜兰市","云林市","彰化市"]]; + +function areaInit(){ + // 注意这里是要通过 id 获取元素,而不是通过 class 获取 + var province = document.getElementById('province'); + //给选择框一个高度,可直接写进数据,不然要先创建dom元素option再录值 + province.length=provinces.length; + for(var i=0;i