diff --git a/src/lib/components/chat/Header.svelte b/src/lib/components/chat/Header.svelte index 5d99106..c4a70bf 100644 --- a/src/lib/components/chat/Header.svelte +++ b/src/lib/components/chat/Header.svelte @@ -5,11 +5,15 @@ import { showSidebar, } from '$lib/stores'; + import { t } from 'i18next'; + // 判断是否为移动设备 + const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); let list = [ { title: '工作', - bg: '/img/work.png', + bg: `/img${isMobile?'/phone':''}/work.png`, id: '3', + title_color:'#40b0bb', buttons: [ { label: '工作总结', @@ -34,8 +38,9 @@ }, { title: '知识库', - bg: '/img/knowledge.png', + bg: `/img${isMobile?'/phone':''}/knowledge.png`, id: '2', + title_color:'#4ea2eb', buttons: [ { label: '检索知识库', @@ -52,8 +57,9 @@ }, { title: '使用记录', - bg: '/img/record.png', + bg:`/img${isMobile?'/phone':''}/record.png`, id: '1', + title_color:'#696ed0', buttons: [ { label: '历史消息', @@ -70,7 +76,6 @@ } ]; -
@@ -79,24 +84,24 @@

需要我帮您做点什么?

-
+
{#each list as item, itemIndex (item.id)}
-

{item.title}

+

{item.title}

+ {#if !isMobile}
{#each item.introduce as itemP, index (index)}

{itemP.label}

{/each}
-
+ {/if} +
{#each item.buttons as but, index (index)} {/each} @@ -144,4 +148,38 @@ position: relative; bottom: 122px; } + .main_box{ + justify-content: space-around; + } + @media (max-width: 768px) { + .main_box{ + justify-content: space-around; + } + .header_box { + height: auto; + padding: 20px; + width: 100%; + bottom: 0; + padding: 0; + } + + .top { + display: none; + h1{ + font-size: 25px; + } + } + + .top img { + margin-bottom: 10px; + } + + .flex.justify-around { + flex-direction: column; + } + + .flex.justify-around > div { + margin-bottom: 20px; + } + } diff --git a/src/lib/components/chat/Messages.svelte b/src/lib/components/chat/Messages.svelte index 2492b4e..8e3f85b 100644 --- a/src/lib/components/chat/Messages.svelte +++ b/src/lib/components/chat/Messages.svelte @@ -11,7 +11,7 @@ } from '$lib/stores'; import { tick, getContext, onMount, createEventDispatcher } from 'svelte'; const dispatch = createEventDispatcher(); - + const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); import { toast } from 'svelte-sonner'; import { getChatList, updateChatById } from '$lib/apis/chats'; import { copyToClipboard, findWordIndices } from '$lib/utils'; @@ -24,7 +24,7 @@ const i18n = getContext('i18n'); - export let className = 'h-full flex pt-17'; + export let className = 'h-full flex pt-17 bg-gray-50'; export let chatId = ''; export let user = $_user; @@ -344,7 +344,10 @@ } }; - + + + +
{#if Object.keys(history?.messages ?? {}).length == 0} {/if}
+ diff --git a/src/lib/components/chat/Messages/Citations.svelte b/src/lib/components/chat/Messages/Citations.svelte index 2d8b904..ae344e5 100644 --- a/src/lib/components/chat/Messages/Citations.svelte +++ b/src/lib/components/chat/Messages/Citations.svelte @@ -95,11 +95,9 @@ {showRelevance} /> -{#if citations.length > 0}
- {#if citations.length <= 3}
- {#each citations as citation, idx} +
- {:else}
- {#each citations.slice(0, 2) as citation, idx} +
@@ -178,7 +175,7 @@
- {#each citations as citation, idx} +
- {/if}
-{/if} diff --git a/src/lib/components/chat/Placeholder.svelte b/src/lib/components/chat/Placeholder.svelte index 2c64423..5988ab1 100644 --- a/src/lib/components/chat/Placeholder.svelte +++ b/src/lib/components/chat/Placeholder.svelte @@ -6,6 +6,7 @@ import { blur, fade } from 'svelte/transition'; const dispatch = createEventDispatcher(); + const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); import { config, user, models as _models, temporaryChatEnabled } from '$lib/stores'; import { sanitizeResponseContent, findWordIndices } from '$lib/utils'; @@ -88,7 +89,11 @@ onMount(() => {}); -
+
+ {#if isMobile} + + + {/if} {#if $temporaryChatEnabled} -
-
+
{ autofill = val.detail; }} >
-
-
{#if models[selectedModelIdx]?.info?.meta?.description ?? null} diff --git a/static/img/logo.gif b/static/img/logo.gif new file mode 100644 index 0000000..dc3291e Binary files /dev/null and b/static/img/logo.gif differ diff --git a/static/img/phone.png b/static/img/phone.png new file mode 100644 index 0000000..b6cf762 Binary files /dev/null and b/static/img/phone.png differ diff --git a/static/img/phone/knowledge.png b/static/img/phone/knowledge.png new file mode 100644 index 0000000..8fb8449 Binary files /dev/null and b/static/img/phone/knowledge.png differ diff --git a/static/img/phone/record.png b/static/img/phone/record.png new file mode 100644 index 0000000..12e5d48 Binary files /dev/null and b/static/img/phone/record.png differ diff --git a/static/img/phone/work.png b/static/img/phone/work.png new file mode 100644 index 0000000..f970793 Binary files /dev/null and b/static/img/phone/work.png differ diff --git a/static/img/phone/事件@2x.png b/static/img/phone/事件@2x.png new file mode 100644 index 0000000..e89fd32 Binary files /dev/null and b/static/img/phone/事件@2x.png differ diff --git a/static/img/phone/加@2x.png b/static/img/phone/加@2x.png new file mode 100644 index 0000000..49942f6 Binary files /dev/null and b/static/img/phone/加@2x.png differ diff --git a/static/img/phone/历史消息-紫@2x.png b/static/img/phone/历史消息-紫@2x.png new file mode 100644 index 0000000..5c3ce18 Binary files /dev/null and b/static/img/phone/历史消息-紫@2x.png differ diff --git a/static/img/phone/历史消息@2x.png b/static/img/phone/历史消息@2x.png new file mode 100644 index 0000000..cf73418 Binary files /dev/null and b/static/img/phone/历史消息@2x.png differ diff --git a/static/img/phone/发送@2x.png b/static/img/phone/发送@2x.png new file mode 100644 index 0000000..633b53b Binary files /dev/null and b/static/img/phone/发送@2x.png differ diff --git a/static/img/phone/图层 1493@2x.png b/static/img/phone/图层 1493@2x.png new file mode 100644 index 0000000..13c3f83 Binary files /dev/null and b/static/img/phone/图层 1493@2x.png differ diff --git a/static/img/phone/工作任务_line@2x.png b/static/img/phone/工作任务_line@2x.png new file mode 100644 index 0000000..8fdaef0 Binary files /dev/null and b/static/img/phone/工作任务_line@2x.png differ diff --git a/static/img/phone/工作总结 @2x.png b/static/img/phone/工作总结 @2x.png new file mode 100644 index 0000000..eee4437 Binary files /dev/null and b/static/img/phone/工作总结 @2x.png differ diff --git a/static/img/phone/工作总结-绿@2x.png b/static/img/phone/工作总结-绿@2x.png new file mode 100644 index 0000000..a2b4909 Binary files /dev/null and b/static/img/phone/工作总结-绿@2x.png differ diff --git a/static/img/phone/检索知识库-蓝@2x.png b/static/img/phone/检索知识库-蓝@2x.png new file mode 100644 index 0000000..1da129e Binary files /dev/null and b/static/img/phone/检索知识库-蓝@2x.png differ diff --git a/static/img/phone/检索知识库@2x.png b/static/img/phone/检索知识库@2x.png new file mode 100644 index 0000000..069df84 Binary files /dev/null and b/static/img/phone/检索知识库@2x.png differ diff --git a/static/img/phone/语音@2x.png b/static/img/phone/语音@2x.png new file mode 100644 index 0000000..9ad70c1 Binary files /dev/null and b/static/img/phone/语音@2x.png differ