明树Git Lab

Commit f421ec49 authored by yangyajing's avatar yangyajing

增加发送按钮

parent 5d7b9c51
......@@ -50,17 +50,27 @@ body, html{
}
.container .input-wrap{
margin-top: 0.625rem;
display: flex;
align-items: center;
}
.container .input-wrap input{
width: 100%;
flex: 1;
width: 0;
border: 1px solid #aaa;
height: 1.875rem;
line-height: 1.875rem;
border-radius: 0.25rem;
height: 2.5rem;
line-height: 2.5rem;
border-radius: 0.5rem;
padding: 0 0.75rem;
box-sizing: border-box;
outline: none;
}
.container .input-wrap .send-button{
padding: 5px 15px;
background-color: #1FC67E;
color: #fff;
border-radius: 6px;
margin-left: 15px;
}
.mask-container{
position: fixed;
width: 100%;
......
......@@ -11,6 +11,7 @@
</div>
<div class="input-wrap">
<input type="text" id="question-input" placeholder="给deepseek发送消息">
<div class="send-button">发送</div>
</div>
</div>
<div class="mask-container">
......
......@@ -78,10 +78,8 @@ $(function () {
})
}
// 提交问答
$("#question-input").keypress(function(event) {
if (event.key === "Enter" || event.keyCode === 13) {
event.preventDefault();
question = $(this).val();
$(".send-button").on("click", function() {
question = $("#question-input").val();
if (question) {
async function handleAsk () {
try {
......@@ -160,7 +158,7 @@ $(function () {
</div>`;
$('.conversation-wrap')[0].insertBefore(div, $('.conversation-loading')[0]);
$('.conversation-loading').show();
$(this).attr("disabled", true);
$("#question-input").attr("disabled", true);
handleAsk();
// $.ajax({
// url: "https://dashscope.aliyuncs.com/api/v1/apps/6de1065c75074ee1a11238ab90c1aa34/completion",
......@@ -200,7 +198,6 @@ $(function () {
// }
// })
}
}
});
// 保存当前问答
function saveConversation () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment