Procházet zdrojové kódy

Merge branch 'master' of http://192.168.1.222:3000/lihai/ZZDianXin_UI

# Conflicts:
#	CallCenterWeb.UI/Script/Common/huayi.config.js
duhongyu %!s(int64=6) %!d(string=před) roky
rodič
revize
7b82498fff

+ 8 - 6
CallCenterWeb.UI/Script/Common/huayi.config.js

@@ -2,11 +2,13 @@
2 2
     var huayi = {};
3 3
 }
4 4
 huayi.config = {
5
-    callcenter_url: "http://localhost:7456/",         //生产环境 前端Web站IP和端口
6
-  //  callcenter_url: "http://139.224.236.21:4029/",      //生产环境 前端Web站IP和端口
7
-    socket_ip: "192.168.8.4",//WebSocket通讯ip
8
-    socket_port: "8081",    //WebSocket通讯端口
5
+    //callcenter_url: "http://localhost:7456/",         //生产环境 前端Web站IP和端口
6
+    callcenter_url: "https://api.zzdx.800100.com.cn:8033/",      //生产环境 前端Web站IP和端口
7
+    socket_ip: "sip.800100.com.cn",//WebSocket通讯ip
8
+    socket_port: "9443",    //WebSocket通讯端口
9 9
     menuworktime: 30000,    //菜单工单数量刷新间隔
10
-    indextime: 60000         //首页报表刷新间隔
11
-
10
+    indextime: 60000,     //首页报表刷新间隔
11
+	sip_uri_:"sip:"+$.cookie("extno")+"@sip.800100.com.cn", 
12
+	sip_password_:$.cookie("extno"), 
13
+	ws_uri_:"wss://sip.800100.com.cn:7443"
12 14
 };

+ 1 - 0
CallCenterWeb.UI/callScreen/call.js

@@ -120,6 +120,7 @@ $(document).ready(function () {
120 120
             },
121 121
             success: function (result) {
122 122
                 if (result.state.toLowerCase() == "success") {
123
+                	
123 124
                     $("#name").val(result.data.F_Name);
124 125
                     $("#tel").val(result.data.F_Phone);
125 126
                     $("#khid").val(result.data.F_Id);

+ 1 - 1
CallCenterWeb.UI/callScreen/callScreen.html

@@ -589,7 +589,7 @@
589 589
 							<li><span style="font-size: 25px;" class="tel"></span></li>
590 590
 							<li><span style="font-size: 15px;" class="khgsd"></span></li>
591 591
 							<!--<li class="nikeName"><i></i><span class="ldname">未知</span><i></i></li>-->
592
-							<li style="color: #4cd964;">当前通话时长:<span class="thsc">00:00</span></li>
592
+							<!--<li style="color: #4cd964;">当前通话时长:<span class="thsc">00:00</span></li>-->
593 593
 							<li class="lahei">
594 594
 								<div class="la-before"><i class="push"></i> 移至黑名单</div>
595 595
 								<div class="la-after" style="display: none;">

+ 9 - 1
CallCenterWeb.UI/css/index.css

@@ -851,7 +851,15 @@ ul.ztree {
851 851
 	right: 10%;
852 852
 	cursor: pointer;
853 853
 }
854
-
854
+.phTooltipResult{
855
+	width: 100%;
856
+	border: none;
857
+	outline: none;
858
+	height: 65%;
859
+	background: #CCCCCC;
860
+	line-height: 30px;
861
+	padding-left: 15px;
862
+}
855 863
 
856 864
 
857 865
 

+ 11 - 35
CallCenterWeb.UI/index.html

@@ -116,32 +116,7 @@
116 116
                             </ul>
117 117
                         </div>
118 118
                         <div class="nav closed">
119
-                            <!--左边-->
120
-                            <!--头像显示-->
121
-                            <!--<div class="text-center max-box">
122
-            <ul class="fl maxOpen animated" style="display: none;">
123
-                <li>
124
-                    <h3 class="size-12 ldname">未知</h3>
125
-                    <h3 class="size-12 ldtel" style="margin-bottom: 0;"></h3>
126
-                </li>
127
-                <li>
128
-                    <div class="photo">
129
-                        <img src="" alt="" />
130
-                    </div>
131
-                </li>
132
-            </ul>
133
-        </div>-->
134
-
135
-
136 119
                             <div style="text-align: center;margin-top: 5px;">
137
-                                <!--<ul class="zts" style="display:none;">
138
-                <li>话机状态: </li>
139
-                <li class="quan fwzt lx br"> </li>
140
-                <li>坐席状态: </li>
141
-                <li class="quan zxzt lx br"></li>
142
-                <li><span class="hwzt" style="color:red;"></span></li>
143
-
144
-            </ul>-->
145 120
                                 <span>话机状态: </span>
146 121
                                 <span class="quan fwzt lx br" style="display: inline-block;height: 20px;line-height: 20px;"> </span>
147 122
                                 <span>坐席状态: </span>
@@ -586,21 +561,20 @@
586 561
     <!--软电话弹框-->
587 562
     <div class="softphone-box">
588 563
     	<div class="phone_tooltip">
589
-    		<p>呼叫……</p>
590
-    		<p class="phTooltipResult" id="sip_phone_number"></p>
564
+    		<p class="tooltip_text">呼叫……</p>
565
+    		<input class="phTooltipResult" type="text" id="sip_phone_number"/>
591 566
     	</div>
592 567
     	<div class="phone_btn_div">
593 568
     		<ul>
594
-    			<li onclick="testStart()">初始</li>
595
-    			<li onclick="reg()" style="background: #24c792;">注册</li>
596
-    			<li onclick="unReg()">注销</li>
569
+    			<li class="testStart" onclick="testStart()">初始</li>
570
+    			<li class="reg" onclick="reg()" style="background: #24c792;">注册</li>
571
+    			<li class="unReg" onclick="unReg()">注销</li>
597 572
     		</ul>
598 573
     	</div>
599 574
         <input hidden="hidden" id="sip_uri" type="text" value="sip:1009@sip.800100.com.cn"/></td>
600 575
         <input hidden="hidden" id="sip_password" type="password" value="1009"/></td>
601 576
         <input hidden="hidden" id="ws_uri" class="last unset" type="text" value="wss://sip.800100.com.cn:7443"/>
602
-        <input hidden="hidden" id="sip_phone_number" type="text" value="1010">
603
-    	
577
+        <!--<input hidden="hidden" id="sip_phone_number" type="text" value="1010">-->
604 578
 		<div class="phoneNum_box">
605 579
             <ul class="phoneNum_ul">
606 580
                 <li>1</li>
@@ -618,12 +592,14 @@
618 592
             </ul>
619 593
         </div>
620 594
         <div class="phone_btn_bot">
621
-    		<div class="posbtn1" onclick="testCall()"><img src="img/call_out-icon.png"/></div>
595
+    		<div class="posbtn1 testCall" onclick="testCall()"><img src="img/call_out-icon.png"/></div>
622 596
     		<div class="posbtn2 phoneNum_clear">清除</div>
623
-    		<div class="posbtn3" onclick="hangup()"><img src="img/hangu-iconp.png"/></div>
597
+    		<div class="posbtn3 hangup" onclick="hangup()"><img src="img/hangu-iconp.png"/></div>
624 598
     	</div>
625 599
     </div>
626
-    
600
+    <div class="stringData"></div>
601
+    <div class="stringData1"></div>
602
+     <div class="stringData2"></div>
627 603
     <script src="./js/plugins/pace/pace.min.js"></script>
628 604
     <script src="./js/plugins/iCheck/icheck.min.js"></script>
629 605
     <script src="./css/laydate/laydate.js"></script>

+ 30 - 23
CallCenterWeb.UI/js/index.js

@@ -26,11 +26,11 @@ $(document).ready(function() {
26 26
 			if(result.data.role) {
27 27
 				$(".rolename").text(result.data.role.F_RoleName);
28 28
 			}
29
-//			$(".yhtx").attr("src", huayi.config.callcenter_url.substr(0, huayi.config.callcenter_url.length - 1) + result.data.user.F_See);
30
-			$(".yhtx").attr("src", result.data.FileUrl[0].F_Url);
29
+			if(result.data.FileUrl[0]){
30
+				$(".yhtx").attr("src", result.data.FileUrl[0].F_Url);
31
+			}
31 32
 			obj.AgentGroup = result.data.user.F_SeartGroupID;
32 33
 			obj.AgentID = result.data.user.F_UserCode;
33
-			//obj.AgentExten = result.data.user.F_WorkNumber;
34 34
 			if(result.data.user.F_SeatFlag) {
35 35
 				Connect();
36 36
 				$("#top-search").show();
@@ -54,27 +54,21 @@ $(document).ready(function() {
54 54
 						Send();
55 55
 						break; //签入
56 56
 					case "MakeCall":
57
-//						obj.Type = "SayFree";
58
-//						Send(); //备注:用户要求外呼立刻置闲
59 57
 						$(".hidCallID").val("");
60 58
 						$("#hidwhtype").val(fun);
61 59
 						whtp();
62
-						//obj.DestinationNumber = "1012";
63 60
 						break; //外呼
64 61
 					case "Meeting":
65 62
 						$("#hidwhtype").val(fun);
66 63
 						whtp();
67
-						//obj.DestinationNumber = "1012";
68 64
 						break; //多方通话
69 65
 					case "Transfer":
70 66
 						$("#hidwhtype").val(fun);
71 67
 						whtp();
72
-						//obj.DestinationNumber = "1012";
73 68
 						break; //转移
74 69
 					default:
75 70
 						Send();
76 71
 						break;
77
-
78 72
 				}
79 73
 			}
80 74
 		}
@@ -227,10 +221,10 @@ $(document).ready(function() {
227 221
 	//加载左侧导航菜单
228 222
 	loadMenu();
229 223
 
230
-	//workcount();
231
-	//setInterval(function() {
232
-	//	workcount();
233
-	//}, huayi.config.menuworktime);
224
+	workcount();
225
+	setInterval(function() {
226
+		workcount();
227
+	}, huayi.config.menuworktime);
234 228
 
235 229
 	//关闭录音弹出
236 230
 	$(".setwin").click(function() {
@@ -516,9 +510,9 @@ function workcount() {
516 510
 		"token": $.cookie("token")
517 511
 	}, function(result) {
518 512
 		if(result.state.toLowerCase() == "success") {
519
-			$(".dpd").text(result.data.dpd);
520
-			$(".djd").text(result.data.djd);
521
-			//   $(".dcl").text(result.data.dcl);
513
+			$(".dcl").text(result.data.dcl);
514
+			$(".ycl").text(result.data.ycl);
515
+			$(".zhcx").text(result.data.zhcx);
522 516
 		}
523 517
 	})
524 518
 }
@@ -984,25 +978,38 @@ $('.open-softphone').click(function () {
984 978
     	$(".softphone-box").css("display","none");
985 979
     	$(".softphone-box").removeClass("active fadeInRight animated");
986 980
     }else{
987
-    	$(".softphone-box").css("display","block");
988
-    	$(".softphone-box").addClass("active fadeInRight animated");
981
+    	testStart();
982
+    	$(".tooltip_text").text("分机号:"+$.cookie("extno"))
983
+		$(".softphone-box").css("display","block");
984
+		$(".softphone-box").addClass("active fadeInRight animated");
985
+    	
989 986
     }
990 987
 })
991 988
 
992 989
 //电话号码显示
993 990
 $(".phoneNum_box ul li").click(function() {
994
-	var pTR = $(".phTooltipResult").text() + "";
991
+	var pTR = $(".phTooltipResult").val() + "";
995 992
 	if(pTR.length < 18) {
996 993
 		pTR = pTR + $(this).text();
997
-		$(".phTooltipResult").text(pTR);
994
+		$(".phTooltipResult").val(pTR);
998 995
 	}
999 996
 });
1000 997
 //清楚电话号码
1001 998
 $(".phoneNum_clear").click(function() {
1002
-	var phToolResult = $(".phTooltipResult").text() + "";
999
+	var phToolResult = $(".phTooltipResult").val() + "";
1003 1000
 	phToolResult = phToolResult.substr(0, phToolResult.length - 1);
1004
-	$(".phTooltipResult").text(phToolResult);
1001
+	$(".phTooltipResult").val(phToolResult);
1005 1002
 	
1006 1003
 })
1007
-
1004
+$(".phTooltipResult").focus(function () {
1005
+	//键盘事件外呼
1006
+	document.onkeydown = function(e) {
1007
+		
1008
+		var theEvent = window.event || e;
1009
+		var code = theEvent.keyCode || theEvent.which;
1010
+		if(code == 13) {
1011
+			testCall()
1012
+		}
1013
+	}
1014
+});
1008 1015
 

+ 5 - 21
CallCenterWeb.UI/js/main.js

@@ -27,11 +27,11 @@ function Connect() {
27 27
 
28 28
 			cls = 0;
29 29
 			$(".Login").addClass("active");
30
-			//自动签入
31
-			lasttime = new Date().getTime();
32
-			obj.Type = "Login";
33
-			obj.AgentType = "0";
34
-			Send(); /*2018-05-19zhangshaungnan注释*/
30
+//			//自动签入
31
+//			lasttime = new Date().getTime();
32
+//			obj.Type = "Login";
33
+//			obj.AgentType = "0";
34
+//			Send(); /*2018-05-19zhangshaungnan注释*/
35 35
 		};
36 36
 		//接收到消息的回调方法
37 37
 		ws.onmessage = function(evt) {
@@ -279,11 +279,6 @@ function DropCallBack() {
279 279
 	$(".SayBusy").addClass("active");
280 280
 	$(".MakeCall").addClass("active");
281 281
 	var obj = $("iframe:visible")
282
-//  if (obj.attr("data-id") == './callScreen/callScreen.html?tel=' + hidTel + '&CallID=' + hidCallID + '') {
283
-//	        window.frames[obj.attr("name")].$(".td-call").hide();
284
-//	        window.frames['iframe'+ hidCallID +''].$(".td-call").hide();
285
-//	    }
286
-
287 282
 	if(window.frames['iframe'+ hidCallID +'']){
288 283
 		 window.frames['iframe'+ hidCallID +''].$(".td-call").hide();
289 284
 	}
@@ -383,10 +378,6 @@ function LineStateAgentBack(data) {
383 378
 		$(".Transfer").addClass("active");
384 379
 		$(".Meeting").addClass("active");
385 380
 		if(data.CallDirection=="in"){
386
-//			window.frames['iframe'+ hidCallID +''].window.onload = function(){
387
-//				var callingFun = window.frames['iframe'+ hidCallID +''].window.calling;
388
-//				callingFun();
389
-//			}
390 381
 //			if (objiframe.attr("data-id") == './callScreen/callScreen.html?tel=' + hidTel + '&CallID=' + hidCallID + '') {
391 382
 				setTimeout (window.frames['iframe'+ hidCallID +''].calling(),500);/*2018-05-19 zhangshuangnan 修改  ps: 因软电话设置为 自动应答 通话时间不计时问题*/
392 383
 //		    }
@@ -410,8 +401,6 @@ function toDub(i) {
410 401
 function MakeCallBack() {
411 402
 	$("#top-search li i").removeClass("active");
412 403
 	$(".DropCall").addClass("active");
413
-//	alert('1');
414
-//	 window.frames[obj.attr("name")].calling();
415 404
 }
416 405
 
417 406
 //置忙置闲
@@ -422,7 +411,6 @@ function SetState(obj) {
422 411
 		$(".zxzt").removeClass("bl").addClass("br");
423 412
 		$(".hwzt").text('置忙');
424 413
 		$("#isml").val(1)
425
-
426 414
 	}
427 415
 	if(obj.State == '2') {
428 416
 		$(".SayBusy").addClass("active");
@@ -479,10 +467,6 @@ function SubScribeBack() {
479 467
 }
480 468
 //取消监测
481 469
 function SubScribeCancelBack() {
482
-//	var obj = $("iframe:visible")
483
-//	if(obj.attr("data-id") == "./TelCall/SeatMonitor.html") {
484
-//		window.frames[obj.attr("name")].();
485
-//	}
486 470
 	$('#content-main .J_iframeNew').each(function(i,n){
487 471
 		if($(this).attr('data-id') == "./TelCall/SeatMonitor.html"){
488 472
 			window.frames[$(this).attr("name")].Stop();

+ 51 - 20
CallCenterWeb.UI/js/softphone.js

@@ -11,6 +11,7 @@
11 11
  		maxHeight: 360
12 12
  	}
13 13
  };
14
+
14 15
  URL = window.URL || window.webkitURL;
15 16
 
16 17
  var localStream = null;
@@ -38,25 +39,32 @@
38 39
 
39 40
  	//注册成功
40 41
  	userAgent.on('registered', function(data) {
42
+ 		$(".tooltip_text").text("初始化成功...");
43
+ 		//setTimeout(function(){$(".tooltip_text").text("分机号:"+$.cookie("extno")"); }, 3000);
41 44
  		console.info("registered: ", data.response.status_code, ",", data.response.reason_phrase);
42 45
  	});
43 46
 
44 47
  	//注册失败
45 48
  	userAgent.on('registrationFailed', function(data) {
49
+ 		$(".tooltip_text").text("注册失败...")
46 50
  		console.log("registrationFailed, ", data);
47 51
  		//console.warn("registrationFailed, ", data.response.status_code, ",", data.response.reason_phrase, " cause - ", data.cause);
48 52
  	});
49 53
 
50 54
  	//注册超时
51 55
  	userAgent.on('registrationExpiring', function() {
56
+ 		$(".tooltip_text").text("注册超时...")
52 57
  		console.warn("registrationExpiring");
53 58
  	});
54 59
 
55 60
  	userAgent.on('newRTCSession', function(data) {
56 61
  		console.info('onNewRTCSession: ', data);
57
-
62
+ 		
58 63
  		//通话呼入
59 64
  		if(data.originator == 'remote') {
65
+ 			if(data.request.data.split("Extension ")[1]){
66
+				var stringHr_1=data.request.data.split("Extension ")[1].split('"')[0]
67
+			}
60 68
  			console.info("incomingSession, answer the call----------------------");
61 69
  			incomingSession = data.session;
62 70
  			data.session.answer({
@@ -84,15 +92,23 @@
84 92
  			if(data.originator == 'remote' && currentSession == null) {
85 93
  				currentSession = incomingSession;
86 94
  				incomingSession = null;
87
- 				console.info("setCurrentSession - ", currentSession);
95
+ 				//layer.msg("setCurrentSession - ", currentSession);
88 96
  			}
89 97
  		});
90 98
  		data.session.on('confirmed', function(data) {
99
+ 			$(".tooltip_text").text("通话中...") //呼入建立
100
+ 			if(stringHr_1){
101
+ 				var p = '<a href="javascript:;" class="active J_menuTab" data-id="./callScreen/callScreen.html?Number=' + stringHr_1+'">来电弹屏<i class="fa fa-times-circle"></i></a>';
102
+				$(".J_menuTab").removeClass("active");
103
+				var nif = '<iframe class="J_iframe J_iframeNew" name="iframe"  width="100%" height="100%" src="./callScreen/callScreen.html?Number=' + stringHr_1+'"></iframe>';
104
+				$(".J_mainContent").find("iframe.J_iframe").hide().parents(".J_mainContent").append(nif);
105
+				$(".J_menuTabs .page-tabs-content").append(p);
106
+ 			}
91 107
  			console.info('onConfirmed - ', data);
92 108
  			if(data.originator == 'remote' && currentSession == null) {
93 109
  				currentSession = incomingSession;
94 110
  				incomingSession = null;
95
- 				console.info("setCurrentSession - ", currentSession);
111
+ 				//layer.msg("setCurrentSession - ", currentSession);
96 112
  			}
97 113
  		});
98 114
  		data.session.on('sdp', function(data) {
@@ -100,16 +116,18 @@
100 116
  		});
101 117
 
102 118
  		data.session.on('progress', function(data) {
103
- 			console.info('onProgress - ', data.originator);
119
+ 			$(".tooltip_text").text("呼入振铃...")
120
+ 			//layer.msg('onProgress - ', data.originator);
104 121
  			if(data.originator == 'remote') {
105
- 				console.info('onProgress, response - ', data.response);
122
+ 				//layer.msg('onProgress, response - ', data.response);
106 123
  			}
107 124
  		});
108 125
  		data.session.on('peerconnection', function(data) {
109
- 			console.info('onPeerconnection - ', data.peerconnection);
126
+ 			$(".tooltip_text").text("呼叫建立...")//呼入建立
127
+ 			//layer.msg('onPeerconnection - ', data.peerconnection);
110 128
  			data.peerconnection.onaddstream = function(ev) {
111
- 				console.info('onaddstream from remote ----------- ', ev);
112
- 				//                <!--  videoView.src = URL.createObjectURL(ev.stream); -->
129
+ 				//layer.msg('onaddstream from remote ----------- ', ev);
130
+ 				//<!--  videoView.src = URL.createObjectURL(ev.stream); -->
113 131
  				videoView.srcObject = ev.stream;
114 132
  			};
115 133
  		});
@@ -123,29 +141,30 @@
123 141
  		}
124 142
  	});
125 143
 
126
- 	console.info("call register");
144
+ 	//console.info("call register");
127 145
 
128 146
  	userAgent.start();
129 147
  }
130
-
131
- // Register callbacks to desired call events
132 148
  var eventHandlers = {
133 149
  	'progress': function(e) {
134
- 		console.log('call is in progress');
150
+ 		$(".tooltip_text").text("呼出振铃...");
135 151
  	},
136 152
  	'failed': function(e) {
137
- 		console.log('call failed: ', e);
153
+ 		$(".tooltip_text").text("呼叫失败...");
154
+ 		//layer.msg('呼叫失败', e);
138 155
  	},
139 156
  	'ended': function(e) {
140
- 		console.log('call ended : ', e);
157
+ 		$(".tooltip_text").text("通话结束...");
158
+ 		//layer.msg('呼叫结束', e); //对方挂机,通话结束
141 159
  	},
142 160
  	'confirmed': function(e) {
143
- 		console.log('call confirmed');
161
+ 		$(".tooltip_text").text("呼叫建立...");
162
+ 		//layer.msg('呼叫建立');
144 163
  	}
145 164
  };
146 165
 
147 166
  function testCall() {
148
- 	var sip_phone_number_ = document.getElementById("sip_phone_number").innerHTML.toString();
167
+ 	var sip_phone_number_ = document.getElementById("sip_phone_number").value.toString();
149 168
  	var options = {
150 169
  		'eventHandlers': eventHandlers,
151 170
  		'mediaConstraints': {
@@ -159,19 +178,31 @@
159 178
  		'mediaStream': localStream
160 179
  	};
161 180
  	outgoingSession = userAgent.call(sip_phone_number_, options);
181
+ 	
182
+ 	var p = '<a  style="background: #24c792; color: #FFFFFF;" href="javascript:;" class="active J_menuTab" data-id="./callScreen/callScreen.html?Number=' + sip_phone_number_+'">外呼弹屏<i class="fa fa-times-circle"></i></a>';
183
+	$(".J_menuTab").removeClass("active");
184
+	var nif = '<iframe class="J_iframe J_iframeNew" name="iframe"  width="100%" height="100%" src="./callScreen/callScreen.html?Number=' + sip_phone_number_+'"></iframe>';
185
+	$(".J_mainContent").find("iframe.J_iframe").hide().parents(".J_mainContent").append(nif);
186
+	$(".J_menuTabs .page-tabs-content").append(p);
162 187
  }
163 188
 
164 189
  function reg() {
165
- 	console.log('register----------->');
190
+ 	$(".tooltip_text").text("注册...");
191
+ 	//console.log('register----------->');
166 192
  	userAgent.register();
167 193
  }
168 194
 
169 195
  function unReg() {
170
- 	console.log('unregister----------->');
196
+ 	$(".tooltip_text").text("注销...");
197
+ 	//console.log('unregister----------->');
171 198
  	userAgent.unregister(true);
172 199
  }
173 200
 
174 201
  function hangup() {
175
- 	console.log('hangup----------->');
202
+ 	debugger
203
+ 	//window.frames[1].clearInter();
204
+ 	$(".tooltip_text").text("挂断...");
205
+ 	//console.log('hangup----------->');
176 206
  	userAgent.terminateSessions();
177
- }
207
+ }
208
+ 

+ 1 - 1
CallCenterWeb.UI/login.html

@@ -48,7 +48,7 @@
48 48
     <div class="signin_bg row">
49 49
         <div class="signin_bg_left col-md-5"></div>
50 50
         <div class="signin_bg_mask"></div>
51
-           <div class="left_word"></div>
51
+        <div class="left_word"></div>
52 52
     </div>
53 53
     <div class="container">
54 54
         <div class="row clearfix">