edit_usermanage.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. window.onload = function () {
  2. // 省市区回显
  3. if($('#provinceHide').val() != ''){
  4. $("#province10").val($('#provinceHide').val());
  5. $("#province10").trigger("change");
  6. $("#city10").val($('#cityHide').val());
  7. $("#city10").trigger("change");
  8. $("#district10").val($('#areaHide').val());
  9. $("#district10").trigger("change");
  10. }
  11. if ($('.content').height() > 750) {
  12. $('#iframe-main', parent.document).css('height', $('.content').height() + 20)
  13. } else {
  14. $('#iframe-main', parent.document).css('height', '750px')
  15. }
  16. var group_name = $('#group_name').val();
  17. $('#user_groups option').each(function(){
  18. if($(this).html() == group_name){
  19. $(this).attr("selected", true);
  20. }
  21. })
  22. if($('#user_logo').val() != 'None'){
  23. var groupsSelect = $('#user_logo').val()
  24. }else{
  25. var groupsSelect = 0
  26. }
  27. $('#user_groups').val(groupsSelect)
  28. }
  29. $('#email').on('click',function(){
  30. layer.msg("邮箱地址禁止修改!");
  31. })
  32. $('#username').on('click',function(){
  33. layer.msg("用户名禁止修改!");
  34. })
  35. function sub() {
  36. var username = $("#username").val();
  37. // var email = $("#useremail").val();
  38. var user_phone = $("#userphone").val();
  39. var province = $("#province10").val();
  40. var city = $("#city10").val();
  41. var area = $("#district10").val();
  42. var remark = $("#userremark").val();
  43. var type = $("#user_type").val();
  44. if (username == "") {
  45. layer.msg("请将信息填写完整!", { time: 2000 });
  46. return false;
  47. }else if (user_phone != "") {
  48. var user_phoneRegexp = /^1[3|4|5|8][0-9]\d{4,8}$/;
  49. var strPhone = user_phoneRegexp.test(user_phone);
  50. if (strPhone != true) {
  51. layer.msg("手机格式不正确!!!", { time: 2000 });
  52. return false;
  53. }
  54. }else{
  55. return true;
  56. }
  57. }