| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- var formatDateTime = function (date) {
-
- var date = new Date();
- var y = date.getFullYear().toString();
- var m = date.getMonth() + 1;
- m = m < 10 ? ('0' + m) : m;
- var d = date.getDate();
- d = d < 10 ? ('0' + d) : d;
- return y + m + d
- // +' '+h+':'+minute+':'+second;
- };
- var extenNum = helper.request.queryString("extenNum");
- var telephone = helper.request.queryString("telephone");
- var acceptExtenNum = helper.request.queryString("fjh");
- $(function(){
- if($(".superviseBtn").text()=="我是市民"){
- $(".registStatus").html('点击下方登录按钮');
- $(".loginbtn").show();
- $(".videoCall").hide();
- }
- if(acceptExtenNum){
- $(".registStatus").html('点击下方登录按钮');
- $("#account").val(acceptExtenNum)
- $("#account").attr("disabled",true)
- $(".superviseBtn").hide()
- }
- })
- $(".superviseVideoCall").click(function(){
- dbCallVideoState =true;
- $(".videoMy").show();
- $(".leftText").html("连接中");
- videoSize();
- captureLocalMediaVideo();
- localMediaStream();
-
- })
- if(extenNum){
- $("#account").val(extenNum)
- $("#telephone").val(telephone)
- setTimeout(function(){
- loginSuper()
- },2000)
-
-
- }
-
-
- function loginSuper(){
- $(".registStatus").show()
- superviseMan = true;
- if (!extenNum) {
- $(".registStatus").html('请输入账号');
- } else if((extenNum>2067||extenNum<2001)&&(extenNum<1005||extenNum>1010)){
- $(".registStatus").html('账号不正确');
- }else{
-
- var signcode = "index/addrelation+" + formatDateTime()
- console.log(signcode)
- var telPhone = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
- if (!telPhone.test($("#telephone").val())) {
- $(".registStatus").text("手机号格式不正确");
-
- } else {
-
-
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url +"index/addrelation",,
- dataType: "json",
- async: true,
- data: {
- ext:$("#account").val(),
- telephone: $("#telephone").val(),
- signcode: $.md5(signcode).toUpperCase()
- },
- success: function(data) {
- if (data.state =="success") {
- $(".registStatus").text("登录成功");
- $(".loginbtn").hide()
- $(".superviseVideoCall").show()
- $(".superviseVideoMeetCall").show()
- sip_uri_ = "sip:"+$("#account").val()+"@"+huayi.config.socket_ip;
- sip_password_ = huayi.config.sip_password_;
- ws_uri_ = huayi.config.ws_uri_; //wss://sip.800100.com.cn:7443 218.29.229.185:8011
- contact_uri = huayi.config.contact_uri
- testStart();
- }else{
-
- $(".registStatus").text("关联失败");
-
- }
-
-
- }
- })
-
- }
-
-
-
- }
- }
- $(".loginbtn").click(function(){
- extenNum = $("#account").val();
- loginSuper()
- // setTimeout(function(){
- // window.location.href="superviseMan.html?extenNum="+$("#account").val()+"&telephone="+$("#telephone").val()
- // },2000)
-
- })
|