Ei kuvausta

fillinfo.js 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //注册完成个人信息
  2. mui.ready(function() {
  3. /*定义全局变量*/
  4. var userName = document.getElementById("userName");
  5. var userMechanism = document.getElementById("userMechanism");
  6. var userDepartment = document.getElementById("userDepartment");
  7. var userPosition = document.getElementById("userPosition");
  8. var userTitle = document.getElementById("userTitle");
  9. var goIndex = document.getElementById("goIndex");
  10. mui.plusReady(function() {
  11. var self = plus.webview.currentWebview();
  12. /*校验提交按钮显示状态*/
  13. mui('.basicinfo').on('keyup', "#userName,#userMechanism", function() {
  14. hideButtn(userName,userMechanism,goIndex,"frmactiveok");
  15. });
  16. /*提交个人信息*/
  17. goIndex.addEventListener('tap', function() {
  18. goVal();
  19. });
  20. function goVal() {
  21. var $data = {};
  22. $data.name = userName.value;
  23. $data.orgName = userMechanism.value;
  24. $data.title = userTitle.value;
  25. $data.department = userDepartment.value;
  26. $data.address = userPosition.value;
  27. $data.id = self.userid;
  28. mui.ajax(baseUrl + '/ajax/professor', {
  29. data: $data,
  30. dataType: 'json', //数据格式类型
  31. type: 'POST', //http请求类型
  32. timeout: 10000, //超时设置
  33. success: function(data) {
  34. console.log(data.success);
  35. if(data.success) {
  36. goHome();
  37. var myaccountClose = plus.webview.getWebviewById("html/myaccount.html");
  38. plus.webview.close(myaccountClose);
  39. } else {
  40. plus.nativeUI.toast("提交失败,用户ID失效", toastStyle);
  41. }
  42. },
  43. error: function() {
  44. plus.nativeUI.toast("服务器链接超时", toastStyle);
  45. }
  46. })
  47. }
  48. });
  49. });