From 6c2a92977d3cb781879a3dadf136a661d65d8b11 Mon Sep 17 00:00:00 2001 From: "shihua.lei" Date: Tue, 15 Apr 2025 17:10:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BC=B9=E5=87=BA=E6=A1=86V1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 44 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 4f6482c..fbb0373 100644 --- a/index.html +++ b/index.html @@ -63,7 +63,7 @@ } - +
@@ -262,8 +262,9 @@ var scrollTop = 0; var click = false; var size = 100;// 每次加载数量 + var tipsIndex = null; - // 添加窗口大小变化的事件监听器 + // 添加窗口大小变化的事件监听器 window.addEventListener('resize', function() { var headContent = document.getElementById("headContent"); var bottomContent = document.getElementById("bottomContent"); @@ -670,13 +671,34 @@ var msgHistory = window.localStorage ? window.localStorage.getItem('msgHistory') : undefined; if(msgHistory){ var items = JSON.parse(msgHistory); - var lis = ''; + var lis = ''; for (var msgHistoryKey in items) { var item = items[msgHistoryKey]; - lis += '
'+item+'
'; + lis += '
'+item+'
'; } console.log(lis) - layer.tips(lis, '#msg',{tips:[3, '#ffffff']}); + var tipsIndex1 = layer.tips(lis, '#msg',{tips:[3, '#ffffff']}); + $("#666").focus(); + $("#666").blur(function() { + layer.close(tipsIndex1); + }); + } + }); + // 消息历史记录单机显示 + $('#msgAdd').on('click', function(){ + var msgHistory = window.localStorage ? window.localStorage.getItem('msgHistory') : undefined; + if(msgHistory){ + var items = JSON.parse(msgHistory); + var lis = ''; + for (var msgHistoryKey in items) { + var item = items[msgHistoryKey]; + lis += '
'+item+'
'; + } + var tipsIndex2 = layer.tips(lis, '#msgAdd',{tips:[3, '#ffffff']}); + $("#666777").focus(); + $("#666777").blur(function() { + layer.close(tipsIndex2); + }); } }); // 线程历史记录单机显示 @@ -684,12 +706,16 @@ var threadHistory = window.localStorage ? window.localStorage.getItem('threadHistory') : undefined; if(threadHistory){ var items = JSON.parse(threadHistory); - var lis = ''; + var lis = ''; for (var msgHistoryKey in items) { var item = items[msgHistoryKey]; lis += '
'+item+'
'; } - layer.tips(lis, '#thread',{tips:[3, '#ffffff']}); + var tipsIndex3 = layer.tips(lis, '#thread',{tips:[3, '#ffffff']}); + $("#666777888").focus(); + $("#666777888").blur(function() { + layer.close(tipsIndex3); + }); } }); } @@ -702,11 +728,11 @@ } layer.closeAll(); }; - function setMsgHistory(index){ + function setMsgHistory(id,index){ var msgHistory = window.localStorage ? window.localStorage.getItem('msgHistory') : undefined; if(msgHistory) { var items = JSON.parse(msgHistory); - $('#msg').val(items[index]+''); + $('#'+id).val(items[index]+''); } layer.closeAll(); };