Brak opisu

superviseMan.js 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. var formatDateTime = function (date) {
  2. var date = new Date();
  3. var y = date.getFullYear().toString();
  4. var m = date.getMonth() + 1;
  5. m = m < 10 ? ('0' + m) : m;
  6. var d = date.getDate();
  7. d = d < 10 ? ('0' + d) : d;
  8. return y + m + d
  9. // +' '+h+':'+minute+':'+second;
  10. };
  11. var extenNum = helper.request.queryString("extenNum");
  12. var telephone = helper.request.queryString("telephone");
  13. var acceptExtenNum = helper.request.queryString("fjh");
  14. $(function(){
  15. if($(".superviseBtn").text()=="我是市民"){
  16. $(".registStatus").html('点击下方登录按钮');
  17. $(".loginbtn").show();
  18. $(".videoCall").hide();
  19. }
  20. if(acceptExtenNum){
  21. $(".registStatus").html('点击下方登录按钮');
  22. $("#account").val(acceptExtenNum)
  23. $("#account").attr("disabled",true)
  24. $(".superviseBtn").hide()
  25. }
  26. })
  27. $(".superviseVideoCall").click(function(){
  28. dbCallVideoState =true;
  29. $(".videoMy").show();
  30. $(".leftText").html("连接中");
  31. videoSize();
  32. captureLocalMediaVideo();
  33. localMediaStream();
  34. })
  35. if(extenNum){
  36. $("#account").val(extenNum)
  37. $("#telephone").val(telephone)
  38. setTimeout(function(){
  39. loginSuper()
  40. },2000)
  41. }
  42. function loginSuper(){
  43. $(".registStatus").show()
  44. superviseMan = true;
  45. if (!extenNum) {
  46. $(".registStatus").html('请输入账号');
  47. } else if((extenNum>2067||extenNum<2001)&&(extenNum<1005||extenNum>1010)){
  48. $(".registStatus").html('账号不正确');
  49. }else{
  50. var signcode ="api/addrelation+"+formatDateTime()
  51. console.log(signcode)
  52. var telPhone = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
  53. if (!telPhone.test($("#telephone").val())) {
  54. $(".registStatus").text("手机号格式不正确");
  55. } else {
  56. $(".registStatus").text("登录成功");
  57. $(".loginbtn").hide()
  58. $(".superviseVideoCall").show()
  59. $(".superviseVideoMeetCall").show()
  60. sip_uri_ = "sip:"+$("#account").val()+"@"+huayi.config.socket_ip;
  61. sip_password_ = "123456";
  62. ws_uri_ = huayi.config.ws_uri_; //wss://sip.800100.com.cn:7443 218.29.229.185:8011
  63. contact_uri = huayi.config.contact_uri
  64. testStart();
  65. // $.ajax({
  66. // type: "get",
  67. // url: "https://12345sp.jbdu.cn:9002/Api/AddRelation",
  68. // dataType: "json",
  69. // async: true,
  70. // data: {
  71. // ext:$("#account").val(),
  72. // telephone: $("#telephone").val(),
  73. // signcode: $.md5(signcode).toUpperCase()
  74. // },
  75. // success: function(data) {
  76. // if (data.state =="success") {
  77. //
  78. //
  79. //
  80. // }else{
  81. //
  82. // $(".registStatus").text("关联失败");
  83. //
  84. // }
  85. //
  86. //
  87. // }
  88. // })
  89. }
  90. }
  91. }
  92. $(".loginbtn").click(function(){
  93. extenNum = $("#account").val();
  94. loginSuper()
  95. // setTimeout(function(){
  96. // window.location.href="superviseMan.html?extenNum="+$("#account").val()+"&telephone="+$("#telephone").val()
  97. // },2000)
  98. })