Skip to content

Commit

Permalink
style: 优化ai聊天界面
Browse files Browse the repository at this point in the history
  • Loading branch information
rehiy committed Mar 29, 2024
1 parent 47f4fb3 commit 58e8549
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
16 changes: 9 additions & 7 deletions webview/src/apps/welcome/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<layout-header></layout-header>

<div class="container-xl mb-3">
<div class="row g-3">
<div class="main row g-3">

<div class="col-md-4">
<div class="col-md-5 col-lg-4">
<div class="card p-3 mb-3">
<form class="row gy-3" (ngSubmit)="submitForm()" #myform="ngForm">
<div class="col-12">
Expand All @@ -20,19 +20,21 @@
</div>

@if (!islogin && loginqr) {
<div class="container-xl mb-3">
<div class="card d-flex justify-content-center align-items-center p-3 mb-3">
@if (loginqr.result) {
<qr-code [value]="loginqr.result" [size]="300" [margin]="0"></qr-code>
<qr-code [value]="loginqr.result" [size]="260" [margin]="0"></qr-code>
<div>间隔 200 秒自动刷新</div>
} @else {
<div>未获取到二维码,稍后自动重试</div>
}
</div>
}

@if (islogin && user && avatar) {
<div class="card mb-3">
@if (islogin && user) {
<div class="card">
@if (avatar) {
<img [src]="avatar.big_head_img_url" class="card-img-top" />
}
<ul class="list-group list-group-flush">
<li class="list-group-item text-truncate">
<b>Wxid</b> {{user.wxid}}
Expand All @@ -51,7 +53,7 @@
}
</div>

<div class="col-md-8 mb-3">
<div class="col-md-7 col-lg-8">
<layout-aichat></layout-aichat>
</div>

Expand Down
5 changes: 5 additions & 0 deletions webview/src/apps/welcome/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.main>div {
height: calc(100vh - 88px);
overflow: hidden;
}

.list-group-item b {
width: 60px;
display: inline-block;
Expand Down
1 change: 1 addition & 0 deletions webview/src/layouts/aichat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export class LayoutAichatComponent implements OnDestroy {
// 请求结果
return SundryApi.aichatText({ wxid: 'webui', message: this.content }).then((data) => {
aiwait.content = data || '未知错误';
this.content = '';
}).catch((err) => {
aiwait.content = err || '未知错误';
}).finally(() => {
Expand Down

0 comments on commit 58e8549

Please sign in to comment.