CHAT-ACTIVATION-TEST-TOOL.html 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>会话激活页面测试工具</title>
  7. <style>
  8. * {
  9. margin: 0;
  10. padding: 0;
  11. box-sizing: border-box;
  12. }
  13. body {
  14. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  15. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  16. min-height: 100vh;
  17. display: flex;
  18. align-items: center;
  19. justify-content: center;
  20. padding: 20px;
  21. }
  22. .container {
  23. background: white;
  24. border-radius: 20px;
  25. padding: 40px;
  26. max-width: 600px;
  27. width: 100%;
  28. box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  29. }
  30. h1 {
  31. font-size: 28px;
  32. font-weight: 700;
  33. color: #222428;
  34. margin-bottom: 12px;
  35. text-align: center;
  36. }
  37. .subtitle {
  38. font-size: 14px;
  39. color: #92949c;
  40. text-align: center;
  41. margin-bottom: 32px;
  42. }
  43. .section {
  44. margin-bottom: 32px;
  45. }
  46. .section-title {
  47. font-size: 16px;
  48. font-weight: 600;
  49. color: #222428;
  50. margin-bottom: 16px;
  51. display: flex;
  52. align-items: center;
  53. gap: 8px;
  54. }
  55. .section-title svg {
  56. width: 20px;
  57. height: 20px;
  58. fill: #667eea;
  59. }
  60. .form-group {
  61. margin-bottom: 16px;
  62. }
  63. label {
  64. display: block;
  65. font-size: 14px;
  66. font-weight: 600;
  67. color: #222428;
  68. margin-bottom: 8px;
  69. }
  70. input {
  71. width: 100%;
  72. padding: 12px 16px;
  73. border: 2px solid #e5e7eb;
  74. border-radius: 12px;
  75. font-size: 14px;
  76. color: #222428;
  77. outline: none;
  78. transition: all 0.3s;
  79. }
  80. input:focus {
  81. border-color: #667eea;
  82. box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  83. }
  84. .hint {
  85. font-size: 12px;
  86. color: #92949c;
  87. margin-top: 6px;
  88. }
  89. .btn-group {
  90. display: flex;
  91. gap: 12px;
  92. }
  93. button {
  94. flex: 1;
  95. padding: 14px 24px;
  96. border: none;
  97. border-radius: 12px;
  98. font-size: 15px;
  99. font-weight: 600;
  100. cursor: pointer;
  101. transition: all 0.3s;
  102. display: flex;
  103. align-items: center;
  104. justify-content: center;
  105. gap: 8px;
  106. }
  107. .btn-primary {
  108. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  109. color: white;
  110. box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  111. }
  112. .btn-primary:hover {
  113. transform: translateY(-2px);
  114. box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
  115. }
  116. .btn-primary:active {
  117. transform: translateY(0);
  118. }
  119. .btn-secondary {
  120. background: #f4f5f8;
  121. color: #222428;
  122. }
  123. .btn-secondary:hover {
  124. background: #e8e9ed;
  125. }
  126. .info-box {
  127. background: rgba(61, 194, 255, 0.1);
  128. border-left: 4px solid #3dc2ff;
  129. padding: 16px;
  130. border-radius: 8px;
  131. margin-top: 24px;
  132. }
  133. .info-box-title {
  134. font-size: 14px;
  135. font-weight: 600;
  136. color: #3dc2ff;
  137. margin-bottom: 8px;
  138. }
  139. .info-box-content {
  140. font-size: 13px;
  141. color: #4b5563;
  142. line-height: 1.6;
  143. }
  144. .url-display {
  145. background: #f9fafb;
  146. border: 2px solid #e5e7eb;
  147. border-radius: 12px;
  148. padding: 12px 16px;
  149. font-size: 13px;
  150. color: #667eea;
  151. word-break: break-all;
  152. margin-top: 12px;
  153. font-family: 'Courier New', monospace;
  154. }
  155. @media (max-width: 640px) {
  156. .container {
  157. padding: 24px;
  158. }
  159. h1 {
  160. font-size: 24px;
  161. }
  162. .btn-group {
  163. flex-direction: column;
  164. }
  165. }
  166. </style>
  167. </head>
  168. <body>
  169. <div class="container">
  170. <h1>🎯 会话激活页面测试工具</h1>
  171. <p class="subtitle">快速访问和测试会话激活功能</p>
  172. <div class="section">
  173. <div class="section-title">
  174. <svg viewBox="0 0 512 512">
  175. <path d="M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm0 62.5a52.5 52.5 0 1152.5 52.5A52.5 52.5 0 01256 110.5zm80 291.5H176a16 16 0 010-32h28v-88h-16a16 16 0 010-32h40a16 16 0 0116 16v104h28a16 16 0 010 32z"/>
  176. </svg>
  177. <span>配置参数</span>
  178. </div>
  179. <div class="form-group">
  180. <label for="cid">公司ID (cid)</label>
  181. <input
  182. type="text"
  183. id="cid"
  184. placeholder="例如: cDL6R1hgSi"
  185. value="cDL6R1hgSi"
  186. />
  187. <p class="hint">企业微信公司标识符</p>
  188. </div>
  189. <div class="form-group">
  190. <label for="chatId">群聊ID (chatId)</label>
  191. <input
  192. type="text"
  193. id="chatId"
  194. placeholder="例如: wrgKCxBwAALwOgUC9jMwdHiVTFmyXs_A"
  195. value="wrgKCxBwAALwOgUC9jMwdHiVTFmyXs_A"
  196. />
  197. <p class="hint">支持Parse objectId或企微chat_id(以wr开头)</p>
  198. </div>
  199. </div>
  200. <div class="btn-group">
  201. <button class="btn-primary" onclick="openChatActivation()">
  202. <svg width="20" height="20" viewBox="0 0 512 512">
  203. <path fill="white" d="M408 64H104a56.16 56.16 0 00-56 56v192a56.16 56.16 0 0056 56h40v80l93.72-78.14a8 8 0 015.13-1.86H408a56.16 56.16 0 0056-56V120a56.16 56.16 0 00-56-56z"/>
  204. </svg>
  205. <span>打开会话激活页面</span>
  206. </button>
  207. <button class="btn-secondary" onclick="copyUrl()">
  208. <svg width="18" height="18" viewBox="0 0 512 512">
  209. <rect x="128" y="128" width="336" height="336" rx="57" ry="57" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"/>
  210. <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M383.5 128l.5-24a56.16 56.16 0 00-56-56H112a64.19 64.19 0 00-64 64v216a56.16 56.16 0 0056 56h24"/>
  211. </svg>
  212. <span>复制URL</span>
  213. </button>
  214. </div>
  215. <div class="info-box">
  216. <div class="info-box-title">📋 功能说明</div>
  217. <div class="info-box-content">
  218. <strong>会话激活页面包含以下功能:</strong><br>
  219. • 📊 回复信息汇总 - 查看往期聊天记录<br>
  220. • 🔗 入群方式 - 二维码、链接、自动介绍文案<br>
  221. • 🤖 AI回复建议 - 针对技术人员不擅长沟通的问题<br>
  222. • ⚠️ 未回复提醒 - 超过10分钟未回复自动提醒<br>
  223. • 🎨 精美UI设计 - 支持移动端适配<br><br>
  224. <strong>💡 支持两种ID类型:</strong><br>
  225. • Parse objectId(10位字符)<br>
  226. • 企微chat_id(以wr开头的长ID)
  227. </div>
  228. <div class="url-display" id="urlDisplay">
  229. URL将在这里显示...
  230. </div>
  231. </div>
  232. </div>
  233. <script>
  234. function getUrl() {
  235. const cid = document.getElementById('cid').value.trim();
  236. const chatId = document.getElementById('chatId').value.trim();
  237. if (!cid || !chatId) {
  238. alert('请填写完整的参数!');
  239. return null;
  240. }
  241. const baseUrl = window.location.origin;
  242. return `${baseUrl}/wxwork/${cid}/chat-activation/${chatId}`;
  243. }
  244. function updateUrlDisplay() {
  245. const url = getUrl();
  246. if (url) {
  247. document.getElementById('urlDisplay').textContent = url;
  248. }
  249. }
  250. function openChatActivation() {
  251. const url = getUrl();
  252. if (url) {
  253. console.log('🚀 打开会话激活页面:', url);
  254. window.open(url, '_blank');
  255. }
  256. }
  257. function copyUrl() {
  258. const url = getUrl();
  259. if (url) {
  260. navigator.clipboard.writeText(url).then(() => {
  261. alert('✅ URL已复制到剪贴板!');
  262. }).catch(() => {
  263. alert('❌ 复制失败,请手动复制');
  264. });
  265. }
  266. }
  267. // 监听输入变化
  268. document.getElementById('cid').addEventListener('input', updateUrlDisplay);
  269. document.getElementById('chatId').addEventListener('input', updateUrlDisplay);
  270. // 初始化显示
  271. updateUrlDisplay();
  272. </script>
  273. </body>
  274. </html>