hlyj.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. <!DOCTYPE html>
  2. <html xmlns="https://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>合力亿捷云客服-在线软电话条</title>
  6. <script type="text/javascript" src="https://a6.7x24cc.com/softPhone/javascripts/jquery-1.7.2.min.js"></script>
  7. <script type="text/javascript" src="https://a6.7x24cc.com/softPhone/javascripts/md5.min.js"></script>
  8. <script type="text/javascript" src="https://a6.7x24cc.com/softPhone/javascripts/phone.min.js"></script>
  9. <script type="text/javascript" src="https://a6.7x24cc.com/softPhone/javascripts/aes.js"></script>
  10. <script type="text/javascript" src="https://a6.7x24cc.com/softPhone/javascripts/sip.js"></script>
  11. <link rel="stylesheet" type="text/css" href="https://a6.7x24cc.com/softPhone/stylesheets/global.css">
  12. <meta charset="UTF-8">
  13. <meta name="Generator" content="EditPlus®">
  14. <meta name="Author" content="">
  15. <meta name="Keywords" content="">
  16. <meta name="Description" content="">
  17. <title>Document</title>
  18. </head>
  19. <style>
  20. #softphone-bar {
  21. margin: 0;
  22. width: 100%;
  23. height: 50px;
  24. display: flex;
  25. justify-content: flex-end;
  26. align-items: center;
  27. background: #fff;
  28. transform: scale(1.2);
  29. padding-right: calc(37px + 5%);
  30. }
  31. </style>
  32. <body>
  33. <div id="softphone-bar" class="inline-block clearFix">
  34. <div id="phone_bar" class="clearFix">
  35. <div class="btn-group f-l">
  36. <button id="HoldEnable" type="button" class="btn btn-primary margin-r5" style="display:none;"
  37. onclick="holly.hold();"> 保持 </button>
  38. <button id="HoldGetEnable" type="button" class="btn btn-primary margin-r5" onclick="holly.unHold();"
  39. style="display:none" ;> 恢复 </button>
  40. <button id="TransferEnable" type="button" class="btn btn-primary margin-r5" style="display:none"
  41. onclick="holly.openTransferOrConsult('softphone_transfer');"> 转接 </button>
  42. <button id="ConsultTransferEnable" type="button" class="btn btn-primary margin-r5" style="display:none"
  43. onclick="holly.transfer('9123456', 'number');"> 转接 </button>
  44. <button id="ConsultEnable" type="button" class="btn btn-primary margin-r5" style="display:none"
  45. onclick="holly.openTransferOrConsult('softphone_consult');"> 咨询 </button>
  46. <button id="InvestigateEnable" type="button" class="btn btn-primary margin-r5" style="display:none"
  47. onclick="holly.investigate();"> 转调查 </button>
  48. <button id="ValidateEnable" type="button" class="btn btn-primary margin-r5" style="display:none"
  49. onclick="holly.validate();"> 转验证 </button>
  50. <button id="ThreeWayCallEnable" class="btn btn-primary margin-r5" style="display:none"> 三方 </button>
  51. <button id="ConsultThreeWayCallEnable" type="button" class="btn btn-primary margin-r5" style="display: none"
  52. onclick="holly.threeWayCall('9123456');"> 三方 </button>
  53. <button id="StopConsultEnable" type="button" class="btn btn-danger margin-r5" style="display:none"
  54. onclick="holly.stopConsult();"> 结束咨询 </button>
  55. <button id="HangupEnable" type="button" class="btn btn-danger margin-r5" onclick="holly.hangup();"
  56. style="display:none;"> 挂机 </button>
  57. </div>
  58. <div class="f-l">
  59. <input id="dialout_input" class="span2" type="text" value="" placeholder="请输入电话号码" style="display: none;"
  60. onkeydown="if(event.keyCode==13){holly.dialout($('#dialout_input').val());}">
  61. <button id="DialEnable" class="btn btn-primary margin-r5" type="button"
  62. onclick="phoneCall($('#dialout_input').val())" style="display:none"> 呼叫 </button>
  63. </div>
  64. <div class="state_group f-l clearFix">
  65. <div id="softphone_phonestate" class="f-l state">未签入</div>
  66. <div id="softphone_dropdown" class="f-l state_dropdown"><b id="softphone_dropdown_caret" class="caret"></b>
  67. </div>
  68. <div id="softphone_timer" class="f-l state_time">00:00:00</div>
  69. <div id="softphone_otherstate" class="customer_db"></div>
  70. </div>
  71. <div class="f-l">
  72. <button id="softPhoneBarKick" type="button" class="btn btn-primary margin-r5" style="display:none;"> 签出
  73. </button>
  74. <button id="softPhoneBarPick" type="button" class="btn btn-primary margin-r5" style="display:none;"> 签入
  75. </button>
  76. </div>
  77. <div class="f-l margin-t5" id="softWaitCountTotalDiv" style="display:none;">
  78. 排队数:<span id="softWaitCountTotal">0 </span>
  79. </div>
  80. <!--以下代码仅使用webrtc时,需要引入-->
  81. <!-- <div id="AcceptBellingEnable" style="display:none;" onclick="holly.webRtc.processWebRTCButton('accept')">
  82. <img src="http://a6.7x24cc.com/softPhone/img/webrtc-incoming.png" alt="" style="width: 13px;vertical-align: -2px;background: #0066cc">
  83. </div>
  84. <div id="RefuseBellingEnable" style="display:none;margin-left: 5px" onclick="holly.webRtc.processWebRTCButton('reject')">
  85. <img src="http://a6.7x24cc.com/softPhone/img/hangup.png" alt="" style="vertical-align: -2px">
  86. </div> -->
  87. <!--webrtc拨号盘,可选>
  88. <div class="btn-group-dial" id="DialPlateBtnEnable" style="margin-top: 2px; display:none;">
  89. <button id="" type="button" class="btn btn-primary" onclick="holly.webRtc.showNum()">拨号盘</button>
  90. <!--拨号盘-->
  91. <!-- <div class="dial-wrap" id="dial_plate" style="display:none;">
  92. <div class="dial-phone-num">
  93. <span class="pushed1" onclick="holly.webRtc.processWebRTCButton('dtmf', 1)">1</span>
  94. <span class="pushed2" onclick="holly.webRtc.processWebRTCButton('dtmf', 2)">2</span>
  95. <span class="pushed3" onclick="holly.webRtc.processWebRTCButton('dtmf', 3)">3</span>
  96. <span class="pushed4" onclick="holly.webRtc.processWebRTCButton('dtmf', 4)">4</span>
  97. <span class="pushed5" onclick="holly.webRtc.processWebRTCButton('dtmf', 5)">5</span>
  98. <span class="pushed6" onclick="holly.webRtc.processWebRTCButton('dtmf', 6)">6</span>
  99. <span class="pushed7" onclick="holly.webRtc.processWebRTCButton('dtmf', 7)">7</span>
  100. <span class="pushed8" onclick="holly.webRtc.processWebRTCButton('dtmf', 8)">8</span>
  101. <span class="pushed9" onclick="holly.webRtc.processWebRTCButton('dtmf', 9)">9</span>
  102. <span class="" onclick="holly.webRtc.processWebRTCButton('dtmf', '*')">*</span>
  103. <span class="pushed0" onclick="holly.webRtc.processWebRTCButton('dtmf', 0)">0</span>
  104. <span class="" onclick="holly.webRtc.processWebRTCButton('dtmf', '#')">#</span>
  105. </div>
  106. </div>
  107. </div> -->
  108. <!--拨号盘结束-->
  109. <!--webrtc结束-->
  110. </div>
  111. <div id="softphone-bar-bgdiv" class="softphone-transfer-bg-div"></div>
  112. <div id="softphone_consult" class="softphone-transfer-div"></div>
  113. <!-- <div id="softphone_transfer" class="softphone-transfer-div"></div> -->
  114. <div id="icc_event"></div>
  115. </div>
  116. <script>
  117. // const channel = new BroadcastChannel("example-channel");
  118. // function refreshModel() {
  119. // channel.postMessage({ event: "datachange", data: [{ path: '/CRM/data/tables/事实表/线索/dwd_f_crm_clue_info.tbl' }] })
  120. // }
  121. function refreshModel() {
  122. const value = { event: "datachange", data: [{ path: '/CRM/data/tables/事实表/线索/dwd_f_crm_clue_info.tbl' },{st:new Date}]}
  123. window.localStorage.setItem('example-channel', JSON.stringify(value));
  124. }
  125. function updateIsTalking(is_talking,seatnum){
  126. const value = { event: "datachange", data: [{is_talking:is_talking, phone:phone,seatnum:seatnum},{st:new Date}]}
  127. window.localStorage.setItem('talking-channel', JSON.stringify(value));
  128. }
  129. var hollyglobal = {
  130. loginSuccessCallback: function (peer) { // 软电话条登录成功回调函数
  131. // console.log(peer);
  132. },
  133. loginFailureCallback: function (peer) { // 软电话条登录失败回调函数
  134. // console.log(peer);
  135. },
  136. ringEvent: function (peer) { // 响铃回调函数,可用于实现弹屏。参数请参考“软电话条-》事件API-》坐席振铃事件”
  137. // console.log(peer);
  138. },
  139. talkingEvent: function (peer) { // 接通事件回调函数。参数请参考“软电话条-》事件API-》坐席接通事件”
  140. // console.log(peer);
  141. updateIsTalking('1',seatnum)
  142. },
  143. hangupEvent: function (peer) { // 挂机事件回调函数。参数请参考“软电话条-》事件API-》坐席挂断事件”
  144. var phone = $('#dialout_input').val()
  145. const params = {
  146. phone: phone
  147. }
  148. $.ajax({
  149. type: 'POST',
  150. url: location.origin + '/jyapi/biService/autoFollow',
  151. contentType: "application/json;charset=utf-8",
  152. data: JSON.stringify(params),
  153. success: function (res) {
  154. console.log(res)
  155. refreshModel()
  156. }
  157. })
  158. console.log("updateIsTalking")
  159. updateIsTalking('0','null')
  160. },
  161. queueWaitCountEvent: function (peer) { // 技能组排队数事件回调函数。参数请参考“软电话条-》事件API-》技能组排队数事件”
  162. // console.dir(peer);
  163. },
  164. setBusyEvent: function (peer) { // 坐席切换状态回调
  165. },
  166. queueInfo: function (peer) { // 技能组发生变化回调
  167. },
  168. registered: function (peer) { // 电话条注册成功、通话功能可正常使用回调
  169. },
  170. newWorkRecover: function (peer) { // 坐席恢复连接回调
  171. },
  172. callAgentCount: function (peer) { // 通话坐席数量变化回调,需开启监控权限
  173. },
  174. idleAgentCount: function (peer) { // 空闲坐席数量变化回调,需开启监控权限
  175. },
  176. availableButton: function (state, button) { // 坐席状态和当前页面可用按钮及控件
  177. },
  178. kickEvent: function (peer) { // 坐席被下线
  179. if (peer === "ukick" || peer == "ekick") {
  180. console.log("您的帐号在其他地方登录了")
  181. } else {
  182. console.log("您已被管理员强制签出")
  183. }
  184. },
  185. isDisplayInvestigate: false, // 是否开启转满意功能
  186. isDisplayConsult: false, // 是否开启咨询功能
  187. isDisplayTransfer: false, // 是否开启转接
  188. isDisplayValidate: true, // 是否开启转验证
  189. isHiddenNumber: false, // 是否开启隐藏号码功能
  190. Variable: "", // 自定义外显号码
  191. monitor: 1, //是否开启监控权限,1表示开启、不配置或者其他值表示不开启,开启后将会收到所有的坐席事件并处理
  192. requestType: "http", //请求服务端的方式。http:表示以http方式请求服务端,webSocket:表示使用webSocket方式请求服务端
  193. loginBusyType: "0", //坐席登录后状态。0是空闲,1是忙碌,2是小休,注:该参数不传的情况下,默认为0
  194. clientType: "hollyPhone" //客户端类型。hollyPhone:软电话,需安装客户端使用;webRtc:网页软电话。webRtc必须在https域名下才能正常使用
  195. }
  196. // 获取参数
  197. const queryString = window.location.search
  198. const params = new URLSearchParams(queryString)
  199. const seatnum = params.get('seatnum')
  200. let phone = params.get('phone')
  201. console.log(seatnum, 'seatnum')
  202. // 自动登录
  203. if (seatnum) {
  204. holly.loginPhoneBar(seatnum + '@bjjyxx', '@jianyu360', "sip")
  205. }
  206. function phoneCall(valPhone) {
  207. // 拨打电话
  208. if (valPhone) {
  209. phone = valPhone
  210. }
  211. if (phone) {
  212. const params = {
  213. phone: phone
  214. }
  215. $.ajax({
  216. type: 'POST',
  217. url: location.origin + '/jyapi/biService/call',
  218. contentType: "application/json;charset=utf-8",
  219. data: JSON.stringify(params),
  220. success: function (res) {
  221. console.log(res)
  222. if (res.error_code === 1) {
  223. // 获取业务参数
  224. let interfacedata = JSON.parse(res.data)
  225. interfacedata.jianyu = 'jianyu'
  226. // 使用软电话条呼叫客户
  227. $('#dialout_input').val(phone)
  228. holly.dialout(phone, interfacedata)
  229. }
  230. }
  231. })
  232. }
  233. }
  234. window.onload = function () {
  235. phoneCall()
  236. }
  237. </script>
  238. </body>
  239. </html>