Нет описания

customerServiceChat.html 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <script src="./js/laydate/laydate.js"></script>
  6. <script src="./Script/Common/huayi.load.js"></script>
  7. <script src="./Script/Common/huayi.config.js"></script>
  8. <link rel="stylesheet" href="./css/init.css" />
  9. <title>微信多客服聊天</title>
  10. <style>
  11. .clearfix:after {
  12. content: "";
  13. display: block;
  14. clear: both;
  15. }
  16. .toolBar {
  17. padding: 15px 0;
  18. border-bottom: 1px solid #ccc;
  19. margin-bottom: 25px;
  20. padding-right: 45px;
  21. }
  22. .toolBar input {
  23. width: 145px;
  24. padding: 2px 2PX 2PX 10PX;
  25. height: 28px;
  26. border: 1px solid #ebebeb;
  27. color: #1ab394;
  28. outline: none;
  29. vertical-align: middle;
  30. }
  31. .model {
  32. position: fixed;
  33. top: 0;
  34. right: 0;
  35. bottom: 0;
  36. left: 0;
  37. height: 100%;
  38. width: 100%;
  39. background: rgba(0, 0, 0, 0.48);
  40. z-index: 100;
  41. display: none;
  42. }
  43. .delModel .box {
  44. width: 22%;
  45. }
  46. .box {
  47. width: 30%;
  48. margin: 0 auto;
  49. margin-top: 5%;
  50. }
  51. .box .btop {
  52. height: 35px;
  53. background: #1ab394;
  54. color: #fff;
  55. line-height: 35px;
  56. padding: 0 15px;
  57. /*margin-bottom: 15px;*/
  58. }
  59. .box .btop p.btl {
  60. float: left;
  61. margin: 0;
  62. }
  63. .box .btop p.btr {
  64. float: right;
  65. cursor: pointer;
  66. margin: 0;
  67. font-size: 20px;
  68. }
  69. .box>input {
  70. display: block;
  71. height: 34px;
  72. padding: 6px 12px;
  73. font-size: 14px;
  74. line-height: 1.42857143;
  75. color: #555;
  76. background-color: #fff;
  77. background-image: none;
  78. border: 1px solid #ccc;
  79. border-radius: 4px;
  80. margin: 35px auto;
  81. }
  82. .boxCon {
  83. width: 100%;
  84. background: #fff;
  85. text-align: center;
  86. padding: 10px 15px;
  87. height: auto;
  88. overflow-y: auto;
  89. }
  90. .boxCon>div {
  91. padding: 15px 0;
  92. }
  93. .boxCon table th {
  94. padding: 5px 8px 5px 0;
  95. text-align: right;
  96. width: 32%;
  97. }
  98. .boxCon table td {
  99. padding: 6px 0 5px 10px;
  100. text-align: left;
  101. color: #717171;
  102. line-height: 200%;
  103. }
  104. .kong {
  105. display: none;
  106. }
  107. </style>
  108. </head>
  109. <body>
  110. <div class="container-fluid">
  111. <div class="daoHang clearfix">
  112. <div class="dhLeft">
  113. <sapn><i class="syIcon"></i>位置:
  114. <a href="../index.html">首页</a>&gt;
  115. <!--<a href="javaScript:;">客户管理</a>&gt;-->
  116. <a href="" style="color: #000;">微信多客服聊天</a>
  117. </sapn>
  118. </div>
  119. </div>
  120. <div class="toolBar clearfix">
  121. <div class="toolRight" style="float: right;">
  122. <span>开始时间:<input type="text" id="startTime"/></span>
  123. <span>结束时间:<input type="text" id="endTime"/></span>
  124. <button class="btns search">搜索</button>
  125. </div>
  126. </div>
  127. <div class="tableBox">
  128. <table id="table1" class="table table-hover table-striped table-bordered table-condensed">
  129. <thead>
  130. <tr>
  131. <th>ID</th>
  132. <th>粉丝openID</th>
  133. <th>发送方</th>
  134. <th>接收方</th>
  135. <th>消息时间</th>
  136. <th>消息内容</th>
  137. </tr>
  138. </thead>
  139. <tbody>
  140. </tbody>
  141. </table>
  142. <button class="btns pageLast" onclick="goLast(0);"><i class="fa fa-angle-left" style="margin-right: 5px;"></i>上一页</button>
  143. <button class="btns pageNext" onclick="goLast(1);">下一页<i class="fa fa-angle-right" style="margin-left: 5px;"></i></button>
  144. </div>
  145. </div>
  146. <script>
  147. var token = $.cookie("token");
  148. var pageIndex = 1;//页数
  149. var page_count;//请求后数据条数
  150. var starttime;
  151. var endtime;
  152. var start;
  153. laydate.render({
  154. elem: '#startTime',
  155. event: 'focus',
  156. type: 'datetime',
  157. theme: 'molv'
  158. });
  159. laydate.render({
  160. elem: '#endTime',
  161. event: 'focus',
  162. type: 'datetime',
  163. theme: 'molv'
  164. // change: function(value, date, endDate){
  165. // console.log(value); //得到日期生成的值,如:2017-08-18
  166. // console.log(date); //得到日期时间对象:{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
  167. // start=$('#startTime').val();
  168. // }
  169. });
  170. $('.search').click(function(){
  171. getTR(pageIndex);
  172. })
  173. var table = $('#table1');
  174. getTR(pageIndex)
  175. function getTR(pageIndex) {
  176. $.ajax({
  177. type: "get",
  178. url: huayi.config.callcenter_url + "WxCustom/GetRecordList",
  179. async: true,
  180. dataType: 'json',
  181. data: {
  182. token: $.cookie("token"),
  183. starttime: $('#startTime').val(),
  184. endtime: $('#endTime').val(),
  185. pagesize: 10,
  186. pageindex: pageIndex
  187. },
  188. success: function(data) {
  189. var con = data.rows;
  190. $('#table1 tbody').html('');
  191. $(con).each(function(i, n) {
  192. $('<tr>' +
  193. '<td>' + parseInt(i + 1) + '</td>' +
  194. '<td>' + n.openid + '</td>' +
  195. '<td>' + n.sender + '</td>' +
  196. '<td>' + n.receiver + '</td>' +
  197. '<td>' + n.time + '</td>' +
  198. '<td>' + n.text + '</td>' +
  199. '</tr>').appendTo('#table1 tbody')
  200. })
  201. page_count=con.length;
  202. if(con.length==0){
  203. page_count=0;
  204. $('<tr>' +
  205. '<td colspan="6" style="text-align: center;">已无数据!请返回上一页...</td>' +
  206. '</tr>').appendTo('#table1 tbody')
  207. }
  208. }
  209. });
  210. }
  211. function goLast(action) {
  212. console.log(page_count);
  213. if(action == 0) {
  214. //上一页
  215. pageIndex--;
  216. if(pageIndex == 0)
  217. pageIndex = 1;
  218. } else if(action == 1) {
  219. //下一页
  220. if(page_count==0){
  221. pageIndex=pageIndex;
  222. }else{
  223. pageIndex++;
  224. }
  225. }
  226. getTR(pageIndex);
  227. }
  228. </script>
  229. </body>
  230. </html>