代码拉取完成,页面将自动刷新
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./layui/layui-v2.6.8/layui/css/layui.css">
<script src="./layui/layui-v2.6.8/layui/layui.js"></script>
<script src="./js/jquery-3.7.1.min.js"></script>
<style>
body,
ul {
margin: 0;
padding: 0;
}
.w100 {
width: 100%;
}
.w1600 {
width: 65%;
margin: 0 auto;
max-width: 1600px;
}
.chatheaderbox {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 0;
box-sizing: border-box;
}
.chatheaderboxleft {
display: flex;
align-items: center;
gap: 40px;
}
.logo {
width: 106px;
height: 30px;
background-color: chocolate;
}
.titleul {
display: flex;
align-items: center;
gap: 40px;
}
.titleul .titleli {
font-weight: bold;
width: 100px;
height: 30px;
text-align: center;
line-height: 30px;
border-radius: 5px;
}
.switch {
font-weight: bold;
}
.chatheaderboxright {
display: flex;
align-items: center;
gap: 5px;
}
.chatcontent {
display: flex;
width: 100%;
height: calc(100vh - 54px);
/* 视口高度减去.chatheader的高度 */
background-color: #f8f9fe;
}
.chatcontentleft,
.chatcontentright {
flex: 1;
/* 占据父元素剩余空间的1份 */
height: 100%;
text-align: center;
padding: 15px;
box-sizing: border-box;
}
.chatcontentcenter {
flex: 0 0 65%;
/* 固定宽度为1200px,不伸缩 */
height: 100%;
}
.selectionbox {
width: 220px;
height: 40px;
margin: 0 auto;
line-height: 40px;
border-radius: 5px;
cursor: pointer;
margin-top: 20px;
}
.selectionbox:hover {
background-color: #3d6cce;
color: #fff;
}
.titleliactive {
background-color: #ecf2ff;
color: #fff;
}
.titleliactive a {
color: #3d6cce;
}
.active {
background-color: #3d6cce;
color: #fff;
}
.user {
background-color: #fff;
padding: 15px;
margin-top: 20px;
}
.user img {
width: 40px;
height: 40px;
background-color: green;
}
.smartchat {
background-color: #fff;
padding: 15px;
margin: 20px 0;
}
.smartchat img {
width: 40px;
height: 40px;
background-color: green;
}
.dialogbox {
height: 650px;
/* 或者使用 max-height */
overflow-y: auto;
/* 当内容超出时显示垂直滚动条 */
}
.chatting {
margin-top: 20px;
height: 200px;
width: 100%;
background-color: #fff;
padding: 15px;
box-sizing: border-box;
}
.chattingbox {
display: flex;
width: 100%;
height: 100%;
box-shadow: 1px 1px 10px #e1dede;
border-radius: 5px;
}
.chattingleft {
flex: 1;
height: 100%;
}
.chattingright {
display: flex;
justify-content: center;
/* 水平居中 */
align-items: center;
/* 垂直居中 */
flex: 0 0 60px;
height: 100%;
}
.chattingbutton {
width: 40px;
height: 40px;
border-radius: 100px;
display: flex;
align-items: center;
justify-content: center;
background-color: #3d6cce;
}
.layui-textarea {
width: 100%;
height: 100%;
resize: none;
border: none;
}
.layui-input:focus,
.layui-textarea:focus {
border: none;
}
/* 垂直滚动条 */
::-webkit-scrollbar {
width: 10px;
/* 设置滚动条宽度 */
}
::-webkit-scrollbar-track {
background-color: #f1f1f1;
/* 设置滚动条背景颜色 */
}
::-webkit-scrollbar-thumb {
background-color: #888;
/* 设置滚动条拖动块颜色 */
border-radius: 5px;
/* 设置拖动块的圆角 */
}
::-webkit-scrollbar-thumb:hover {
background-color: #555;
/* 设置拖动块的悬停颜色 */
}
</style>
</head>
<body>
<div class="chatheader w100">
<div class="chatheaderbox w1600">
<div class="chatheaderboxleft">
<div class="logo">
<img src="" alt="">
</div>
<div class="switch">切换知识库</div>
<div class="headertitle">
<ul class="titleul">
<li class="titleli "><a href="">档案库回答</a></li>
<li class="titleli"><a href="">文件库回答</a></li>
<li class="titleli titleliactive"><a href="./chat.html">知识库回答</a></li>
<li class="titleli"><a href="./selfservice.html">自助回答</a></li>
</ul>
</div>
</div>
<div class="chatheaderboxright">
<i class="layui-icon layui-icon-username" style="font-size: 30px; color: #000;"></i> 系统管理员
</div>
</div>
</div>
<div class="chatcontent">
<div class="chatcontentleft">
<div class="selectionbar">
<div class="selectionbox">
如何开启teams录屏
</div>
</div>
<div class="selectionbar">
<div class="selectionbox">
如何开启teams录屏
</div>
</div>
<div class="selectionbar">
<div class="selectionbox">
如何开启teams录屏
</div>
</div>
<div class="selectionbar">
<div class="selectionbox">
如何开启teams录屏
</div>
</div>
</div>
<div class="chatcontentcenter">
<div class="module" style="display: none;">
<div class="dialogbox">
<div class="user">
<img src=""> <span>您好请问有什么可以帮助您?</span>
</div>
<div class="smartchat">
<img src=""><span>eq(index) 和index()有什么区别</span>
</div>
<div class="user">
<img src=""> <span>您好请问有什么可以帮助您?</span>
</div>
<div class="smartchat">
<img src=""><span>eq(index) 和index()有什么区别</span>
</div>
<div class="user">
<img src=""> <span>您好请问有什么可以帮助您?</span>
</div>
<div class="smartchat">
<img src=""><span>eq(index) 和index()有什么区别</span>
</div>
<div class="user">
<img src=""> <span>您好请问有什么可以帮助您?</span>
</div>
<div class="smartchat">
<img src=""><span>eq(index) 和index()有什么区别</span>
</div>
<div class="user">
<img src=""> <span>您好请问有什么可以帮助您?</span>
</div>
<div class="smartchat">
<img src=""><span>eq(index) 和index()有什么区别</span>
</div>
<div class="user">
<img src=""> <span>您好请问有什么可以帮助您?</span>
</div>
<div class="smartchat">
<img src=""><span>eq(index) 和index()有什么区别</span>
</div>
<div class="user">
<img src=""> <span>您好请问有什么可以帮助您?</span>
</div>
<div class="smartchat">
<img src=""><span>eq(index) 和index()有什么区别</span>
</div>
<div class="user">
<img src=""> <span>您好请问有什么可以帮助您?</span>
</div>
<div class="smartchat">
<img src=""><span>eq(index) 和index()有什么区别</span>
</div>
<div class="user">
<img src=""> <span>您好请问有什么可以帮助您?</span>
</div>
<div class="smartchat">
<img src=""><span>eq(index) 和index()有什么区别</span>
</div>
<div class="user">
<img src=""> <span>您好请问有什么可以帮助您?</span>
</div>
<div class="smartchat">
<img src=""><span>eq(index) 和index()有什么区别</span>
</div>
<div class="user">
<img src=""> <span>您好请问有什么可以帮助您?</span>
</div>
<div class="smartchat">
<img src=""><span>eq(index) 和index()有什么区别</span>
</div>
</div>
<div class="chatting">
<div class="chattingbox">
<div class="chattingleft">
<textarea name="" placeholder="请输入您的问题" class="layui-textarea"></textarea>
</div>
<div class="chattingright">
<div class="chattingbutton">
<i class="layui-icon layui-icon-release" style="font-size: 20px; color: #fff;"></i>
</div>
</div>
</div>
</div>
</div>
<div class="module" style="display: none;"></div>
</div>
<div class="chatcontentright">
</div>
</div>
</body>
<script>
$(document).ready(function () {
$('.selectionbar').click(function () {
var index = $(this).index(); // 获取当前点击的selectionbar的索引
// 移除所有selectionbar的active类,并隐藏所有模块
$('.selectionbar .selectionbox').removeClass('active');
$('.module').hide();
// 激活当前点击的selectionbar并显示对应索引的模块
$(this).find('.selectionbox').addClass('active');
$('.module').eq(index).show();
});
// 默认激活第一个按钮
$('.selectionbar').first().click();
});
</script>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。