CahtRoom.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>设置</title>
  6. <meta name="renderer" content="webkit">
  7. <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  8. <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  9. <meta http-equiv="pragma" content="no-cache">
  10. <meta http-equiv="Cache" content="no-cache">
  11. <meta http-equiv="cache-control" content="no-cache, must-revalidate">
  12. <meta http-equiv="expires" content="0">
  13. <meta name="viewport"
  14. content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  15. <link rel="stylesheet" href="../../css/element.css">
  16. <link rel="stylesheet" href="../../css/style.css">
  17. <link rel="stylesheet" id="linkSource" href="../../css/base.css">
  18. <script src="../../js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
  19. <script src="../../js/yz/init.js" type="text/javascript" charset="utf-8"></script>
  20. <script src="../../js/yz/caht.js" type="text/javascript" charset="utf-8"></script>
  21. <script>
  22. checkLogin();
  23. </script>
  24. </head>
  25. <style type="text/css">
  26. *{
  27. margin: 0;
  28. padding: 0;
  29. }
  30. body {
  31. height: 100vh;
  32. background-color: #103151;
  33. }
  34. div,button{
  35. box-sizing: border-box;
  36. }
  37. .topBox .icon-Time{
  38. position: absolute;
  39. right: 10px;
  40. top: 8px;
  41. font-size: 20px;
  42. z-index: 4446;
  43. }
  44. #ContTxt li{
  45. list-style: none;
  46. margin:6px 0 13px;
  47. }
  48. .sendTxt{
  49. position: fixed;
  50. bottom: 0;
  51. left:0;
  52. width: 100%;
  53. display: flex;
  54. align-items: flex-end;
  55. padding: 8px;
  56. background-color: #1b2a46;
  57. }
  58. .sendTxt textarea{
  59. width:calc(100% - 90px) !important;
  60. height: 26px;
  61. padding: 6px;
  62. color:#8799a3;
  63. font-size: 13px;
  64. line-height: 18px;
  65. border: none;
  66. outline: none;
  67. resize: none;
  68. background-color: rgba(255,255,255,0.2);
  69. border-radius: 4px;
  70. }
  71. .sendTxt textarea::-webkit-input-placeholder{
  72. color:#8799a3;
  73. }
  74. .sendTxt button{
  75. width: 50px;
  76. text-align: center;
  77. padding: 4px 0;
  78. border-radius: 3px;
  79. }
  80. .sendTxt .iconfont{
  81. font-size: 24px;
  82. margin:0 10px;
  83. }
  84. .yz-chat-text{
  85. background-color: #fff;
  86. }
  87. .yz-chat-text::after{
  88. border-top-color: #fff;
  89. }
  90. </style>
  91. <body>
  92. <div class="topParen">
  93. <div class="topBox">
  94. <i class="iconfont icon-left" onclick="navBack()"></i>
  95. <div id="reName"></div>
  96. <i class="iconfont icon-Time"></i>
  97. </div>
  98. <div style="padding: 4px 17px;max-height: calc(100% - 50px);overflow: auto;">
  99. <ul id="ContTxt">
  100. </ul>
  101. </div>
  102. <div class="sendTxt">
  103. <textarea placeholder="请输入您的消息(长度小宇30位的字符)"></textarea>
  104. <span class="iconfont icon-yangshi_icon_tongyong_settings"></span>
  105. <button type="button" class="bg-blue">发送</button>
  106. </div>
  107. </div>
  108. </body>
  109. <script src="../../js/yz/mqttws31.js"></script>
  110. <script src="../../js/yz/sendMag.js" type="text/javascript" charset="utf-8"></script>
  111. <script>
  112. $(document).ready(function(){
  113. sendMsg("mainPh");
  114. nowStr = JSON.parse(localStorage.getItem("nowStr"));
  115. $("#reName").text(nowStr.nickName);
  116. getChatData(nowStr,"mainPh");
  117. })
  118. // 发送消息
  119. $(document).on("click",".sendTxt .bg-blue",function(){
  120. let _txt = $(".sendTxt textarea").val();
  121. sendContent(_txt,"mainPh");
  122. })
  123. $(document).on("click",".topBox .icon-Time",function(){
  124. top.location.href='./CahtHis.html'
  125. })
  126. $(document).on("click",".sendTxt .iconfont",function(){
  127. top.location.href='./BindPhone.html?id='+nowStr.username;
  128. })
  129. function navBack(){
  130. sendAlread();
  131. top.location.href = "../MainPh.html?sn=2";
  132. }
  133. </script>
  134. </html>