d8d35593630eed0363667d0e16d30b55.php 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
  2. <html lang="zh-CN" style="background:#fff;">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  7. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
  8. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.3.0/font/bootstrap-icons.css">
  9. <link rel="stylesheet" type="text/css" href="/Public/Static/css/base2.css" />
  10. <link rel="stylesheet" type="text/css" href="/Public/Static/css/nologed.css" />
  11. <link rel="stylesheet" href="/Public/Static/Icoinfont/iconfont.css">
  12. <script src="/Public/Static/Icoinfont/iconfont.js"></script>
  13. <title><?php echo ($webname); ?></title>
  14. <style>
  15. ::-webkit-input-placeholder {color: #b5b5b5;font-size: 12px;}
  16. ::-moz-placeholder {color: #b5b5b5;font-size: 12px;}
  17. input:focus{background:#ebecf0;outline: 1px solid #ebecf0;}
  18. textarea:focus{background:#fff;outline: 1px solid #f5f5f5;}
  19. a:hover,a:link,a:visited,a:active{color:#707A8A;text-decoration:none;}
  20. .no_header{position: fixed;z-index: 9999;background:#fff;padding:0px 10px;top:0px;box-shadow: 0 2px 10px 0 rgb(0 0 0 / 10%);}
  21. .txtl{line-height:50px;width:10%;}
  22. .txtbox{width:100%;height:80px;background:#fff;bottom: 0px;position: fixed;border-top: 1px solid #ccc;padding: 10px;}
  23. .textbox_1{width:70%;height:60px;float:left;}
  24. .textbox_2{width:25%;height:60px;line-height:60px;float:right;text-align:center;background: linear-gradient(to left,#eeb80d,#ffe35b);border-radius:5px;}
  25. .textbox_3{width:100%;height:60px;padding:5px;border:1px solid #f5f5f5;border-radius:5px;}
  26. textarea{background:#fff;color:#707A8A;}
  27. .emptybox{width:100%;height:200px;}
  28. .headertitle{width:100%;height:90px;margin-top:50px;padding:10px 20px;border-bottom:1px solid #f5f5f5;position: fixed;background: #fff;top: 0px;}
  29. .contentbox{width:100%;margin-top:155px;padding:10px 20px;}
  30. .contentbox_1{width:100%;margin-bottom:15px;}
  31. .contentbox_2{min-width:50%;max-width:80%;background:#f5f5f5;float:right;padding:5px 10px;border-radius:5px;margin-bottom: 15px;}
  32. .contentbox_3{min-width:50%;max-width:80%;background:#f5f5f5;float:right;padding:5px 10px;border-radius:5px;margin-bottom: 15px;float:left;}
  33. .msgbox{width:100%;padding:5px 0px;}
  34. .msgbox_left{max-width:70%;min-height:40px;background:#f5f5f5;border-radius:5px;padding:10px;word-wrap:break-word;word-break:normal;}
  35. .msgbox_right{max-width:70%;min-height:40px;background:#f5f5f5;border-radius:10px;padding:10px;word-wrap:break-word;word-break:normal;margin-left:30%;}
  36. </style>
  37. </head>
  38. <body style="background:#fff;">
  39. <div class="container-fluid " style="padding:0px;width:100vw;">
  40. <div class="no_header">
  41. <div class="fl allhg txtl">
  42. <i class="bi bi-arrow-left fcc fw" onclick="goback()" style="font-size: 24px;"></i>
  43. </div>
  44. <div class="fl allhg" id="centerbox" style="width:80%;text-align:center;line-height:50px;">
  45. <span class="fcc fzmmm"><?php echo L('在线客服');?></span>
  46. </div>
  47. <div class="fr allhg txtr" style="line-height:50px;width:10%;">
  48. </div>
  49. </div>
  50. <div class="headertitle">
  51. <div style="width:25%;height:70px;float:left;">
  52. <img src="/Public/Static/img/kfheader.png" style="height:70px;" />
  53. </div>
  54. <div style="width:75%;height:70px;float:right;">
  55. <div style="width:100%;height:40px;line-height:50px;">
  56. <span class="fcc" style="font-size:20px;font-weight:bold;">Josn</span>
  57. </div>
  58. <div style="width:100%;height:30px;line-height:20px;">
  59. <span class="fcy fzmm"><?php echo L('在线');?></span>
  60. </div>
  61. </div>
  62. </div>
  63. <div class="contentbox">
  64. <div class="contentbox_1" style="height:40px;margin-bottom:0px;">
  65. <div class="contentbox_2" style="float:left;">
  66. <span class="fcc fzmm"><?php echo L('您好,请问有什么可以帮您?');?></span>
  67. </div>
  68. </div>
  69. <!---信息盒子--->
  70. <div style="width:100%;min-height:360px;overflow-y:scroll;margin-bottom:100px;" id="msgbox">
  71. </div>
  72. </div>
  73. <div class="txtbox">
  74. <input type="hidden" id="flag" value="1" />
  75. <div class="textbox_1">
  76. <textarea class="textbox_3" id="content" placeholder="<?php echo L('请输入信息内容');?>"></textarea>
  77. </div>
  78. <div class="textbox_2" id="sendbtn">
  79. <span class="fch fzmmm"><?php echo L('发送');?></span>
  80. </div>
  81. </div>
  82. </div>
  83. </body>
  84. <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
  85. <script type="text/javascript" src="/Public/Static/js/layer/layer.js" ></script>
  86. <script type="text/javascript">
  87. $(function(){
  88. getchatlist();
  89. });
  90. setInterval(function () {
  91. getchatlist();
  92. }, 1000);
  93. </script>
  94. <script type="text/javascript">
  95. function getchatlist(){
  96. $.post("<?php echo U('User/getlineinfo');?>",
  97. function(data){
  98. if(data.code = 1){
  99. $("#msgbox").empty();
  100. var html = '';
  101. if(data.data == '' || data.data == null){
  102. $("#msgbox").empty();
  103. }else{
  104. $.each(data.data,function(key,val){
  105. if(val.type == 1){
  106. html+='<div class="msgbox">'+
  107. '<div class="msgbox_left">'+
  108. '<span></span>'+
  109. '<span style="font-size:14px;color:#707A8A;">' + val.content +'</span>'+
  110. '<span style="float:right;color:#FCD535;font-size:14px;">'+ val.time +'</span>'+
  111. '</div>'+
  112. '</div>';
  113. }else if(val.type == 2){
  114. html+='<div class="msgbox">'+
  115. '<div class="msgbox_right">'+
  116. '<span></span>'+
  117. '<span style="font-size:14px;color:#707A8A;">' + val.content +'</span>'+
  118. '<span style="float:right;color:#FCD535;font-size:14px;">'+ val.time +'</span>'+
  119. '</div>'+
  120. '</div>';
  121. }
  122. });
  123. $("#msgbox").append(html);
  124. }
  125. $('#msgbox').children("div:last-child")[0].scrollIntoView();
  126. }else{
  127. console.log();return false;
  128. }
  129. });
  130. }
  131. </script>
  132. <script type="text/javascript">
  133. $("#sendbtn").click(function(){
  134. var flag = $("#flag").val();
  135. if(flag == 2){
  136. return false;
  137. }
  138. var txt = $("#content").val();
  139. if(txt == '' || txt == null){
  140. layer.msg("<?php echo L('请输入信息内容');?>");return false;
  141. }
  142. $("#flag").val(2);
  143. $.post("<?php echo U('User/uptxt');?>",
  144. {'txt':txt},
  145. function(data){
  146. if(data.code == 1){
  147. $("#content").val("");
  148. }else{
  149. layer.msg(data.info);return false;
  150. }
  151. });
  152. });
  153. </script>
  154. <script type="text/javascript">
  155. function goback(){
  156. window.history.go(-1);
  157. }
  158. </script>
  159. </html>