|
- <!doctype html>
- <html>
-
- <head>
- <meta charset="UTF-8">
- <title>报名</title>
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
- <link href="css/mui.min.css" rel="stylesheet" />
- <link href="css/style.css" rel="stylesheet" />
- <link rel="stylesheet" type="text/css" href="css/mui.picker.min.css" />
- <style>
- .mui-table-view {
- margin-top: 10px;
- }
-
- .span3 {
- color: #0193DF;
- margin: 10px;
- line-height: 38px;
- }
-
- .span2 {
- color: #c70f1a;
- font-size: 13px;
- line-height: 24px;
- }
-
- .mui-ellipsis {
- line-height: 30px;
- }
-
- .mui-content-padded {
- margin-top: 10px;
- text-align: center;
- }
-
- .mui-content {
- background-color: #FFFFFF;
- }
-
- .mui-btn-blue {
- background-color: #0193df;
- border: #0193DF;
- margin-top: 25px;
- }
-
- .mui-input-row {
- border-bottom: 1px #EEEEEE solid;
- }
-
- .mui-input-row .mui-btn {
- width: 65%;
- border: 1px #000000 solid;
- border: none;
- float: left;
- }
-
- .dj {
- font-size: 14px;
- color: #999999;
- padding: 10px;
- }
-
- .mui-btn-block {
- width: 65%;
- float: right;
- margin: 0px;
- height: 40px;
- }
-
- #info {
- float: left;
- margin: 0px;
- }
-
- #sextext,
- #birthText,
- #provincetext {
- line-height: 40px;
- text-overflow: ellipsis;
- overflow: hidden;
- }
- </style>
- </head>
-
- <body>
- <header class="mui-bar mui-bar-nav">
- <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
- <h1 class="mui-title">报名</h1>
- </header>
- <div class="mui-content">
- <ul class="mui-table-view">
- <li class="mui-table-view-cell mui-media">
- <a>
- <div class="mui-media-body">
- <p class='mui-ellipsis' id="pname"></p>
- <p class='mui-ellipsis' id="schoolname"></p>
- <p class='mui-ellipsis' id="pObject"></p>
- </div>
- </a>
- </li>
-
- <li class="mui-table-view-cell mui-media">
- <a>
- <div class="mui-media-body">
- <div class="mui-input-row">
- <label>姓 名</label>
- <input type="hidden" id="schoolid" />
- <input type="hidden" id="departid" />
- <input type="hidden" id="cultureid" />
- <input id='username' type="text" class="mui-input-clear mui-input" placeholder="请输入姓名">
- </div>
- <div class="mui-input-row" id="selsex">
- <label>性 别</label>
- <input type="hidden" id="sexid" />
- <span id="sextext">请选择</span><span class="mui-pull-right mui-navigate-right"></span>
- </div>
- <div class="mui-input-row" id="selbirth">
- <label>出生日期</label>
- <input type="hidden" id="birth" />
- <span id="birthText">请选择</span><span class="mui-pull-right mui-navigate-right"></span>
- </div>
- <div class="mui-input-row">
- <label>手 机 号</label>
- <input id='phone' type="number" class="mui-input" disabled="disabled">
- </div>
- <div class="mui-input-row" id="selprovince">
- <label>省市县/区</label>
- <input type="hidden" id="provinceid" />
- <input type="hidden" id="cityid" />
- <input type="hidden" id="areaid" />
- <span id="provincetext">请选择</span><span class="mui-pull-right mui-navigate-right"></span>
- </div>
- <div class="mui-input-row">
- <label>家庭住址</label>
- <input id='address' type="text" class="mui-input-clear mui-input" placeholder="">
- </div>
- <div class="mui-input-row">
- <label>身份证号</label>
- <input id='ids' type="text" class="mui-input-clear mui-input" placeholder="" maxlength="18" min="15">
- </div>
- <div class="mui-input-row">
- <label>推荐老师</label>
- <input id='teacherphone' type="number" class="mui-input-clear mui-input-numbox" placeholder="老师手机号">
- </div>
- </div>
- <div class="mui-content-padded">
- <button type="button" class="mui-btn mui-btn-blue" id="reg">下一步</button>
- </div>
- </a>
- </li>
- </ul>
- </div>
- <script src="js/mui.min.js "></script>
- <script src="js/serverurl.js"></script>
- <script src="js/tools.js"></script>
- <script src="js/userinfos.js"></script>
- <script src="js/mui.picker.min.js"></script>
- <script src="js/city.data-3.js" type="text/javascript" charset="utf-8"></script>
- <script type="text/javascript">
- function OpenSexPicker() {
- userPickersex.show(function(items) {
- document.getElementById("sextext").innerText = items[0].text;
- document.getElementById("sexid").value = items[0].value;
- });
- }
-
- function OpenSelectedDate(inputobj, typename) {
- var optionsJson = '{"type":"' + typename + '","beginYear":1910,"endYear":2100}';
- var options = JSON.parse(optionsJson);
- var picker = new mui.DtPicker(options);
- picker.show(function(rs) {
- //input赋值
- document.getElementById(inputobj).value = rs.text;
- if(typename == "date") {
- document.getElementById(inputobj + "Text").innerText = rs.text;
- }
- picker.dispose();
- });
- }
- var userPickersex;
- var provincePicker;
- var _getParam = function(obj, param) {
- return obj[param] || '';
- };
- var userid ;
- mui.plusReady(function() {
- CheckLogin();
- document.getElementById("username").value=users.username;
- document.getElementById("ids").value=users.ids;
- userPickersex = new mui.PopPicker();
- var provincePicker = new mui.PopPicker({
- layer: 3
- });
- provincePicker.setData(cityData3);
- var showCityPickerButton = document.getElementById('selprovince');
- showCityPickerButton.addEventListener('tap', function(event) {
- provincePicker.show(function(items) {
- document.getElementById("provinceid").value = _getParam(items[0], 'text');
- document.getElementById("cityid").value = _getParam(items[1], 'text');
- document.getElementById("areaid").value = _getParam(items[2], 'text');
- document.getElementById("provincetext").innerText = _getParam(items[0], 'text') + " " + _getParam(items[1], 'text') + " " + _getParam(items[2], 'text');
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
- GetDictionaryData(userPickersex, "100009100006000000");
- document.getElementById("selsex").addEventListener("tap", function() {
- OpenSexPicker();
- });
- document.getElementById("selbirth").addEventListener("tap", function() {
- OpenSelectedDate("birth", "date");
- });
- var departID = plus.webview.currentWebview().departID;
- document.getElementById("phone").value=users.phone;
- GetData(departID);
- document.getElementById("departid").value = departID;
- document.getElementById("reg").addEventListener("tap", function() {
- if(document.getElementById("username").value == "" || document.getElementById("sexid").value == "" || document.getElementById("birth").value == "" ||
- document.getElementById("address").value == "" || document.getElementById("provinceid").value == "" ||
- document.getElementById("cityid").value == "" || document.getElementById("areaid").value == "" || document.getElementById("phone").value == "") {
- plus.nativeUI.toast("提交失败!请您填写完整表单信息。");
- return;
- }
- if(!isIdCardNo(document.getElementById("ids").value)) {
- plus.nativeUI.toast("请您填写正确的身份证号。");
- return;
- }
- var phonereg = /(^0?[1][3578][0-9]{9}$)/;
- if(!phonereg.test(document.getElementById("phone").value)) {
- plus.nativeUI.toast("请您填写正确的手机号。");
- return;
- }
- if(document.getElementById("teacherphone").value != '') {
- if(!phonereg.test(document.getElementById("teacherphone").value)) {
- plus.nativeUI.toast("请您填写正确的老师手机号。");
- return;
- }
- }
- if(userid != undefined && userid != null) {
- var xhr = new plus.net.XMLHttpRequest();
- xhr.responseType = "json";
- xhr.onreadystatechange = function() {
- switch(xhr.readyState) {
- case 4:
- if(xhr.status == 200) {
- plus.nativeUI.closeWaiting();
- if(xhr.response.result == "ok") {
- plus.nativeUI.toast("修改成功。");
- } else {
- plus.nativeUI.toast("操作失败,请重试。");
- }
- } else {
- plus.nativeUI.closeWaiting();
- plus.nativeUI.toast("操作失败,请重试。");
- }
- break;
- default:
- break;
- }
- }
- xhr.open("GET", encodeURI(serverdomain + "/WebService/UserService.ashx?Action=registerupdate&content={'username':'" + document.getElementById("username").value + "'," +
- "'sex':'" + document.getElementById("sexid").value + "','phone':'" + document.getElementById("phone").value + "','address':'" + document.getElementById("address").value + "'," +
- "'culture':'" + document.getElementById("cultureid").value + "','school':'" + document.getElementById("schoolid").value + "','depart':'" + document.getElementById("departid").value + "'," +
- "'rTeacher':'" + document.getElementById("teacherphone").value + "','ids':'" + document.getElementById("ids").value + "'," +
- "'ID':'" + userid + "','province':'" + document.getElementById("provinceid").value + "','birthDate':'" + document.getElementById("birth").value + "'," +
- "'city':'" + document.getElementById("cityid").value + "','county':'" + document.getElementById("areaid").value + "'}"));
- xhr.send();
- plus.nativeUI.showWaiting("加载中...");
- } else {
- var xhr = new plus.net.XMLHttpRequest();
- xhr.responseType = "json";
- xhr.onreadystatechange = function() {
- switch(xhr.readyState) {
- case 4:
- if(xhr.status == 200) {
- plus.nativeUI.closeWaiting();
- if(xhr.response.result == "ok") {
- plus.nativeUI.toast("报名成功。");
- RefreshUserData();
- //RefreshBaoming
- plus.webview.getWebviewById("apply.html").evalJS("RefreshBaoming();");
- //RefreshContactTeacher
- plus.webview.getWebviewById("interact.html").evalJS("RefreshContactTeacher();");
- plus.webview.currentWebview().opener().opener().opener().close();
- plus.webview.currentWebview().opener().opener().close();
- plus.webview.currentWebview().opener().close();
- plus.webview.currentWebview().close();
- } else if(xhr.response.result == "register") {
- plus.nativeUI.toast("操作失败,该身份证号码已注册。");
- } else {
- plus.nativeUI.toast("操作失败,请重试。");
- }
- } else {
- plus.nativeUI.closeWaiting();
- plus.nativeUI.toast("操作失败,请重试。");
- }
- break;
- default:
- break;
- }
- }
- xhr.open("GET", encodeURI(serverdomain + "/WebService/UserService.ashx?Action=register&content={'username':'" + document.getElementById("username").value + "'," +
- "'sex':'" + document.getElementById("sexid").value + "','phone':'" + document.getElementById("phone").value + "','address':'" + document.getElementById("address").value + "'," +
- "'culture':'" + document.getElementById("cultureid").value + "','school':'" + document.getElementById("schoolid").value + "','depart':'" + document.getElementById("departid").value + "'," +
- "'rTeacher':'" + document.getElementById("teacherphone").value + "','ids':'" + document.getElementById("ids").value + "'," +
- "'province':'" + document.getElementById("provinceid").value + "','birthDate':'" + document.getElementById("birth").value + "'," +
- "'city':'" + document.getElementById("cityid").value + "','county':'" + document.getElementById("areaid").value + "'}"));
- xhr.send();
- plus.nativeUI.showWaiting("加载中...");
- }
-
- });
- //绑定数据
- if(userid != undefined && userid != null) {
- //GetData(userid);
- }
- });
-
- function GetData(departID) {
- var xhr = new plus.net.XMLHttpRequest();
- xhr.responseType = "json";
- xhr.onreadystatechange = function() {
- switch(xhr.readyState) {
- case 4:
- if(xhr.status == 200) {
- if(xhr.response.result == "ok") {
- var dataobject = xhr.response.msg;
- document.getElementById("pname").innerText = '报名专业:' + dataobject.name + '';
- document.getElementById("schoolname").innerText = '所属校区:' + dataobject.schoolName;
- document.getElementById("pObject").innerText = '文化程度:' + dataobject.pObjectName;
- document.getElementById("schoolid").value = dataobject.schoolID;
- document.getElementById("cultureid").value = dataobject.pObjectID;
- plus.nativeUI.closeWaiting();
- }
- } else {
- plus.nativeUI.closeWaiting();
- plus.nativeUI.toast('世界上最遥远的距离就是没有网络。');
- }
- break;
- default:
- break;
- }
- }
- xhr.open("GET", encodeURI(serverdomain + "/WebService/UserService.ashx?Action=getProfession&content={'profession':'" + departID + "','app':'1'}"));
- xhr.send();
- }
- </script>
- </body>
-
- </html>
|