Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 
 

351 строка
13 KiB

  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>报名</title>
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <link href="css/mui.min.css" rel="stylesheet" />
  8. <link href="css/style.css" rel="stylesheet" />
  9. <link rel="stylesheet" type="text/css" href="css/mui.picker.min.css" />
  10. <style>
  11. .mui-table-view {
  12. margin-top: 10px;
  13. }
  14. .span3 {
  15. color: #0193DF;
  16. margin: 10px;
  17. line-height: 38px;
  18. }
  19. .span2 {
  20. color: #c70f1a;
  21. font-size: 13px;
  22. line-height: 24px;
  23. }
  24. .mui-ellipsis {
  25. line-height: 30px;
  26. }
  27. .mui-content-padded {
  28. margin-top: 10px;
  29. text-align: center;
  30. }
  31. .mui-content {
  32. background-color: #FFFFFF;
  33. }
  34. .mui-btn-blue {
  35. background-color: #0193df;
  36. border: #0193DF;
  37. margin-top: 25px;
  38. }
  39. .mui-input-row {
  40. border-bottom: 1px #EEEEEE solid;
  41. }
  42. .mui-input-row .mui-btn {
  43. width: 65%;
  44. border: 1px #000000 solid;
  45. border: none;
  46. float: left;
  47. }
  48. .dj {
  49. font-size: 14px;
  50. color: #999999;
  51. padding: 10px;
  52. }
  53. .mui-btn-block {
  54. width: 65%;
  55. float: right;
  56. margin: 0px;
  57. height: 40px;
  58. }
  59. #info {
  60. float: left;
  61. margin: 0px;
  62. }
  63. #sextext,
  64. #birthText,
  65. #provincetext {
  66. line-height: 40px;
  67. text-overflow: ellipsis;
  68. overflow: hidden;
  69. }
  70. </style>
  71. </head>
  72. <body>
  73. <header class="mui-bar mui-bar-nav">
  74. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
  75. <h1 class="mui-title">报名</h1>
  76. </header>
  77. <div class="mui-content">
  78. <ul class="mui-table-view">
  79. <li class="mui-table-view-cell mui-media">
  80. <a>
  81. <div class="mui-media-body">
  82. <p class='mui-ellipsis' id="pname"></p>
  83. <p class='mui-ellipsis' id="schoolname"></p>
  84. <p class='mui-ellipsis' id="pObject"></p>
  85. </div>
  86. </a>
  87. </li>
  88. <li class="mui-table-view-cell mui-media">
  89. <a>
  90. <div class="mui-media-body">
  91. <div class="mui-input-row">
  92. <label>姓&nbsp;&nbsp;&nbsp;名</label>
  93. <input type="hidden" id="schoolid" />
  94. <input type="hidden" id="departid" />
  95. <input type="hidden" id="cultureid" />
  96. <input id='username' type="text" class="mui-input-clear mui-input" placeholder="请输入姓名">
  97. </div>
  98. <div class="mui-input-row" id="selsex">
  99. <label>性&nbsp;&nbsp;&nbsp;别</label>
  100. <input type="hidden" id="sexid" />
  101. <span id="sextext">请选择</span><span class="mui-pull-right mui-navigate-right"></span>
  102. </div>
  103. <div class="mui-input-row" id="selbirth">
  104. <label>出生日期</label>
  105. <input type="hidden" id="birth" />
  106. <span id="birthText">请选择</span><span class="mui-pull-right mui-navigate-right"></span>
  107. </div>
  108. <div class="mui-input-row">
  109. <label>手&nbsp;机&nbsp;号</label>
  110. <input id='phone' type="number" class="mui-input" disabled="disabled">
  111. </div>
  112. <div class="mui-input-row" id="selprovince">
  113. <label>省市县/区</label>
  114. <input type="hidden" id="provinceid" />
  115. <input type="hidden" id="cityid" />
  116. <input type="hidden" id="areaid" />
  117. <span id="provincetext">请选择</span><span class="mui-pull-right mui-navigate-right"></span>
  118. </div>
  119. <div class="mui-input-row">
  120. <label>家庭住址</label>
  121. <input id='address' type="text" class="mui-input-clear mui-input" placeholder="">
  122. </div>
  123. <div class="mui-input-row">
  124. <label>身份证号</label>
  125. <input id='ids' type="text" class="mui-input-clear mui-input" placeholder="" maxlength="18" min="15">
  126. </div>
  127. <div class="mui-input-row">
  128. <label>推荐老师</label>
  129. <input id='teacherphone' type="number" class="mui-input-clear mui-input-numbox" placeholder="老师手机号">
  130. </div>
  131. </div>
  132. <div class="mui-content-padded">
  133. <button type="button" class="mui-btn mui-btn-blue" id="reg">下一步</button>
  134. </div>
  135. </a>
  136. </li>
  137. </ul>
  138. </div>
  139. <script src="js/mui.min.js "></script>
  140. <script src="js/serverurl.js"></script>
  141. <script src="js/tools.js"></script>
  142. <script src="js/userinfos.js"></script>
  143. <script src="js/mui.picker.min.js"></script>
  144. <script src="js/city.data-3.js" type="text/javascript" charset="utf-8"></script>
  145. <script type="text/javascript">
  146. function OpenSexPicker() {
  147. userPickersex.show(function(items) {
  148. document.getElementById("sextext").innerText = items[0].text;
  149. document.getElementById("sexid").value = items[0].value;
  150. });
  151. }
  152. function OpenSelectedDate(inputobj, typename) {
  153. var optionsJson = '{"type":"' + typename + '","beginYear":1910,"endYear":2100}';
  154. var options = JSON.parse(optionsJson);
  155. var picker = new mui.DtPicker(options);
  156. picker.show(function(rs) {
  157. //input赋值
  158. document.getElementById(inputobj).value = rs.text;
  159. if(typename == "date") {
  160. document.getElementById(inputobj + "Text").innerText = rs.text;
  161. }
  162. picker.dispose();
  163. });
  164. }
  165. var userPickersex;
  166. var provincePicker;
  167. var _getParam = function(obj, param) {
  168. return obj[param] || '';
  169. };
  170. var userid ;
  171. mui.plusReady(function() {
  172. CheckLogin();
  173. document.getElementById("username").value=users.username;
  174. document.getElementById("ids").value=users.ids;
  175. userPickersex = new mui.PopPicker();
  176. var provincePicker = new mui.PopPicker({
  177. layer: 3
  178. });
  179. provincePicker.setData(cityData3);
  180. var showCityPickerButton = document.getElementById('selprovince');
  181. showCityPickerButton.addEventListener('tap', function(event) {
  182. provincePicker.show(function(items) {
  183. document.getElementById("provinceid").value = _getParam(items[0], 'text');
  184. document.getElementById("cityid").value = _getParam(items[1], 'text');
  185. document.getElementById("areaid").value = _getParam(items[2], 'text');
  186. document.getElementById("provincetext").innerText = _getParam(items[0], 'text') + " " + _getParam(items[1], 'text') + " " + _getParam(items[2], 'text');
  187. //返回 false 可以阻止选择框的关闭
  188. //return false;
  189. });
  190. }, false);
  191. GetDictionaryData(userPickersex, "100009100006000000");
  192. document.getElementById("selsex").addEventListener("tap", function() {
  193. OpenSexPicker();
  194. });
  195. document.getElementById("selbirth").addEventListener("tap", function() {
  196. OpenSelectedDate("birth", "date");
  197. });
  198. var departID = plus.webview.currentWebview().departID;
  199. document.getElementById("phone").value=users.phone;
  200. GetData(departID);
  201. document.getElementById("departid").value = departID;
  202. document.getElementById("reg").addEventListener("tap", function() {
  203. if(document.getElementById("username").value == "" || document.getElementById("sexid").value == "" || document.getElementById("birth").value == "" ||
  204. document.getElementById("address").value == "" || document.getElementById("provinceid").value == "" ||
  205. document.getElementById("cityid").value == "" || document.getElementById("areaid").value == "" || document.getElementById("phone").value == "") {
  206. plus.nativeUI.toast("提交失败!请您填写完整表单信息。");
  207. return;
  208. }
  209. if(!isIdCardNo(document.getElementById("ids").value)) {
  210. plus.nativeUI.toast("请您填写正确的身份证号。");
  211. return;
  212. }
  213. var phonereg = /(^0?[1][3578][0-9]{9}$)/;
  214. if(!phonereg.test(document.getElementById("phone").value)) {
  215. plus.nativeUI.toast("请您填写正确的手机号。");
  216. return;
  217. }
  218. if(document.getElementById("teacherphone").value != '') {
  219. if(!phonereg.test(document.getElementById("teacherphone").value)) {
  220. plus.nativeUI.toast("请您填写正确的老师手机号。");
  221. return;
  222. }
  223. }
  224. if(userid != undefined && userid != null) {
  225. var xhr = new plus.net.XMLHttpRequest();
  226. xhr.responseType = "json";
  227. xhr.onreadystatechange = function() {
  228. switch(xhr.readyState) {
  229. case 4:
  230. if(xhr.status == 200) {
  231. plus.nativeUI.closeWaiting();
  232. if(xhr.response.result == "ok") {
  233. plus.nativeUI.toast("修改成功。");
  234. } else {
  235. plus.nativeUI.toast("操作失败,请重试。");
  236. }
  237. } else {
  238. plus.nativeUI.closeWaiting();
  239. plus.nativeUI.toast("操作失败,请重试。");
  240. }
  241. break;
  242. default:
  243. break;
  244. }
  245. }
  246. xhr.open("GET", encodeURI(serverdomain + "/WebService/UserService.ashx?Action=registerupdate&content={'username':'" + document.getElementById("username").value + "'," +
  247. "'sex':'" + document.getElementById("sexid").value + "','phone':'" + document.getElementById("phone").value + "','address':'" + document.getElementById("address").value + "'," +
  248. "'culture':'" + document.getElementById("cultureid").value + "','school':'" + document.getElementById("schoolid").value + "','depart':'" + document.getElementById("departid").value + "'," +
  249. "'rTeacher':'" + document.getElementById("teacherphone").value + "','ids':'" + document.getElementById("ids").value + "'," +
  250. "'ID':'" + userid + "','province':'" + document.getElementById("provinceid").value + "','birthDate':'" + document.getElementById("birth").value + "'," +
  251. "'city':'" + document.getElementById("cityid").value + "','county':'" + document.getElementById("areaid").value + "'}"));
  252. xhr.send();
  253. plus.nativeUI.showWaiting("加载中...");
  254. } else {
  255. var xhr = new plus.net.XMLHttpRequest();
  256. xhr.responseType = "json";
  257. xhr.onreadystatechange = function() {
  258. switch(xhr.readyState) {
  259. case 4:
  260. if(xhr.status == 200) {
  261. plus.nativeUI.closeWaiting();
  262. if(xhr.response.result == "ok") {
  263. plus.nativeUI.toast("报名成功。");
  264. RefreshUserData();
  265. //RefreshBaoming
  266. plus.webview.getWebviewById("apply.html").evalJS("RefreshBaoming();");
  267. //RefreshContactTeacher
  268. plus.webview.getWebviewById("interact.html").evalJS("RefreshContactTeacher();");
  269. plus.webview.currentWebview().opener().opener().opener().close();
  270. plus.webview.currentWebview().opener().opener().close();
  271. plus.webview.currentWebview().opener().close();
  272. plus.webview.currentWebview().close();
  273. } else if(xhr.response.result == "register") {
  274. plus.nativeUI.toast("操作失败,该身份证号码已注册。");
  275. } else {
  276. plus.nativeUI.toast("操作失败,请重试。");
  277. }
  278. } else {
  279. plus.nativeUI.closeWaiting();
  280. plus.nativeUI.toast("操作失败,请重试。");
  281. }
  282. break;
  283. default:
  284. break;
  285. }
  286. }
  287. xhr.open("GET", encodeURI(serverdomain + "/WebService/UserService.ashx?Action=register&content={'username':'" + document.getElementById("username").value + "'," +
  288. "'sex':'" + document.getElementById("sexid").value + "','phone':'" + document.getElementById("phone").value + "','address':'" + document.getElementById("address").value + "'," +
  289. "'culture':'" + document.getElementById("cultureid").value + "','school':'" + document.getElementById("schoolid").value + "','depart':'" + document.getElementById("departid").value + "'," +
  290. "'rTeacher':'" + document.getElementById("teacherphone").value + "','ids':'" + document.getElementById("ids").value + "'," +
  291. "'province':'" + document.getElementById("provinceid").value + "','birthDate':'" + document.getElementById("birth").value + "'," +
  292. "'city':'" + document.getElementById("cityid").value + "','county':'" + document.getElementById("areaid").value + "'}"));
  293. xhr.send();
  294. plus.nativeUI.showWaiting("加载中...");
  295. }
  296. });
  297. //绑定数据
  298. if(userid != undefined && userid != null) {
  299. //GetData(userid);
  300. }
  301. });
  302. function GetData(departID) {
  303. var xhr = new plus.net.XMLHttpRequest();
  304. xhr.responseType = "json";
  305. xhr.onreadystatechange = function() {
  306. switch(xhr.readyState) {
  307. case 4:
  308. if(xhr.status == 200) {
  309. if(xhr.response.result == "ok") {
  310. var dataobject = xhr.response.msg;
  311. document.getElementById("pname").innerText = '报名专业:' + dataobject.name + '';
  312. document.getElementById("schoolname").innerText = '所属校区:' + dataobject.schoolName;
  313. document.getElementById("pObject").innerText = '文化程度:' + dataobject.pObjectName;
  314. document.getElementById("schoolid").value = dataobject.schoolID;
  315. document.getElementById("cultureid").value = dataobject.pObjectID;
  316. plus.nativeUI.closeWaiting();
  317. }
  318. } else {
  319. plus.nativeUI.closeWaiting();
  320. plus.nativeUI.toast('世界上最遥远的距离就是没有网络。');
  321. }
  322. break;
  323. default:
  324. break;
  325. }
  326. }
  327. xhr.open("GET", encodeURI(serverdomain + "/WebService/UserService.ashx?Action=getProfession&content={'profession':'" + departID + "','app':'1'}"));
  328. xhr.send();
  329. }
  330. </script>
  331. </body>
  332. </html>