feat: H5 查价结果渐入渐出,助手发送钮对齐首页圆钮
Some checks failed
Build and Deploy Front / deploy (push) Failing after 7s
Some checks failed
Build and Deploy Front / deploy (push) Failing after 7s
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
ab8663607f
commit
3bde663e43
@ -239,10 +239,19 @@
|
|||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
class="ai-composer-send"
|
class="ai-composer-send"
|
||||||
|
:class="{ 'is-empty': roundSend && !inputText.trim() }"
|
||||||
:aria-label="t('nanaAssistant.send')"
|
:aria-label="t('nanaAssistant.send')"
|
||||||
:disabled="!canSend"
|
:disabled="roundSend ? chatLoading : !canSend"
|
||||||
>
|
>
|
||||||
<icon-send />
|
<svg
|
||||||
|
v-if="roundSend"
|
||||||
|
class="ai-composer-send__mark"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
<path d="M12 19V5M6.5 10.5 12 5l5.5 5.5" />
|
||||||
|
</svg>
|
||||||
|
<icon-send v-else />
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<div class="ai-composer-footer">
|
<div class="ai-composer-footer">
|
||||||
@ -368,6 +377,14 @@ import { resolveTextModelId } from '@/views/system/aiAssistant/providerCatalog';
|
|||||||
import NanaAvatar from './NanaAvatar.vue';
|
import NanaAvatar from './NanaAvatar.vue';
|
||||||
import logoImg from '@/assets/logo2.png';
|
import logoImg from '@/assets/logo2.png';
|
||||||
|
|
||||||
|
withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
/** 发送钮用首页提问卡的圆钮:空态浅灰,有内容黑底上箭头 */
|
||||||
|
roundSend?: boolean;
|
||||||
|
}>(),
|
||||||
|
{ roundSend: false },
|
||||||
|
);
|
||||||
|
|
||||||
type QuickTagDef = {
|
type QuickTagDef = {
|
||||||
id: string;
|
id: string;
|
||||||
icon: typeof IconStorage;
|
icon: typeof IconStorage;
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="h5-assistant-shell">
|
<div class="h5-assistant-shell">
|
||||||
<AiAdvisorShell ref="shellRef" />
|
<AiAdvisorShell ref="shellRef" round-send />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -338,35 +338,61 @@ function promptGuestRegister() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
:deep(.ai-composer-send) {
|
:deep(.ai-composer-send) {
|
||||||
width: 40px;
|
width: 32px;
|
||||||
height: 40px;
|
height: 32px;
|
||||||
border-radius: 12px;
|
border: none;
|
||||||
background: var(--app-primary-color);
|
border-radius: 999px;
|
||||||
|
background: #0d0d0d;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
box-shadow: none;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
transform: none;
|
||||||
|
filter: none;
|
||||||
|
|
||||||
.arco-icon,
|
.ai-composer-send__mark,
|
||||||
svg {
|
svg {
|
||||||
width: 1.15em;
|
display: block;
|
||||||
height: 1.15em;
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
fill: none;
|
||||||
|
stroke: currentColor;
|
||||||
|
stroke-width: 2.25;
|
||||||
|
stroke-linecap: round;
|
||||||
|
stroke-linejoin: round;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.is-empty,
|
||||||
|
&.is-empty:hover {
|
||||||
|
background: #ececec;
|
||||||
|
color: #9a9a9a;
|
||||||
|
cursor: default;
|
||||||
|
transform: none;
|
||||||
|
filter: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover:not(:disabled):not(.is-empty) {
|
||||||
|
background: #2f2f2f;
|
||||||
|
transform: none;
|
||||||
|
filter: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus-visible {
|
||||||
|
outline: 2px solid #0d0d0d;
|
||||||
|
outline-offset: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:disabled:not(.is-empty) {
|
||||||
|
background: #0d0d0d;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
fill: currentColor;
|
opacity: 0.45;
|
||||||
}
|
|
||||||
|
|
||||||
&:disabled {
|
|
||||||
background: #e5e6eb;
|
|
||||||
color: #c9cdd4;
|
|
||||||
opacity: 1;
|
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
|
transform: none;
|
||||||
.arco-icon,
|
filter: none;
|
||||||
svg {
|
|
||||||
color: #c9cdd4;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&:not(:disabled):active {
|
&:not(:disabled):not(.is-empty):active {
|
||||||
filter: brightness(1.05);
|
background: #2f2f2f;
|
||||||
|
filter: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -218,40 +218,20 @@
|
|||||||
class="h5-price-results"
|
class="h5-price-results"
|
||||||
:aria-busy="queryLoading"
|
:aria-busy="queryLoading"
|
||||||
>
|
>
|
||||||
<div v-if="sortedResults.length && !queryLoading" class="h5-results-bar h5-results-bar--in">
|
<!-- 骨架 ↔ 报价:同时渐出 / 渐入,离开层脱离文档流避免高度叠加 -->
|
||||||
<div class="h5-results-bar__row">
|
<Transition name="h5-stage">
|
||||||
<p class="h5-results-tip" :title="resultsBarTipFull">
|
|
||||||
<span>{{ t('h5.price.resultCount', { n: sortedResults.length }) }}</span>
|
|
||||||
<span class="h5-results-tip__dot">·</span>
|
|
||||||
<span>{{ resultsBarTip }}</span>
|
|
||||||
</p>
|
|
||||||
<div class="h5-sort">
|
|
||||||
<button
|
|
||||||
v-for="mode in sortModes"
|
|
||||||
:key="mode"
|
|
||||||
type="button"
|
|
||||||
class="h5-sort__btn"
|
|
||||||
:class="{ 'is-active': sortMode === mode }"
|
|
||||||
@click="sortMode = mode"
|
|
||||||
>
|
|
||||||
{{ t(`h5.price.sort.${mode}`) }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 查价中:骨架占位(飞猪/携程式),避免整页 Spin 生硬切换 -->
|
|
||||||
<div
|
<div
|
||||||
v-if="queryLoading"
|
v-if="queryLoading"
|
||||||
class="h5-quote-skel-list"
|
key="loading"
|
||||||
|
class="h5-quote-stage"
|
||||||
aria-live="polite"
|
aria-live="polite"
|
||||||
:aria-label="t('h5.price.querying')"
|
:aria-label="t('h5.price.querying')"
|
||||||
>
|
>
|
||||||
|
<div class="h5-quote-skel-list">
|
||||||
<div
|
<div
|
||||||
v-for="i in 3"
|
v-for="i in 3"
|
||||||
:key="`skel-${resultsRevealEpoch}-${i}`"
|
:key="`skel-${resultsRevealEpoch}-${i}`"
|
||||||
class="h5-quote-skel"
|
class="h5-quote-skel"
|
||||||
:style="{ '--i': i - 1 }"
|
|
||||||
>
|
>
|
||||||
<div class="h5-quote-skel__head">
|
<div class="h5-quote-skel__head">
|
||||||
<div class="h5-quote-skel__col">
|
<div class="h5-quote-skel__col">
|
||||||
@ -271,10 +251,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-else-if="!sortedResults.length"
|
v-else-if="!sortedResults.length"
|
||||||
class="h5-empty h5-empty--no-quote h5-empty--in"
|
key="empty"
|
||||||
|
class="h5-empty h5-empty--no-quote"
|
||||||
>
|
>
|
||||||
<div class="h5-empty__icon" aria-hidden="true">
|
<div class="h5-empty__icon" aria-hidden="true">
|
||||||
<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
|
<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
|
||||||
@ -367,16 +349,36 @@
|
|||||||
</a-button>
|
</a-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<template v-else>
|
<div v-else key="results" class="h5-quote-stage">
|
||||||
|
<div class="h5-results-bar">
|
||||||
|
<div class="h5-results-bar__row">
|
||||||
|
<p class="h5-results-tip" :title="resultsBarTipFull">
|
||||||
|
<span>{{ t('h5.price.resultCount', { n: sortedResults.length }) }}</span>
|
||||||
|
<span class="h5-results-tip__dot">·</span>
|
||||||
|
<span>{{ resultsBarTip }}</span>
|
||||||
|
</p>
|
||||||
|
<div class="h5-sort">
|
||||||
|
<button
|
||||||
|
v-for="mode in sortModes"
|
||||||
|
:key="mode"
|
||||||
|
type="button"
|
||||||
|
class="h5-sort__btn"
|
||||||
|
:class="{ 'is-active': sortMode === mode }"
|
||||||
|
@click="sortMode = mode"
|
||||||
|
>
|
||||||
|
{{ t(`h5.price.sort.${mode}`) }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<article
|
<article
|
||||||
v-for="(item, idx) in sortedResults"
|
v-for="item in sortedResults"
|
||||||
:key="`${resultsRevealEpoch}-${item.rowKey}`"
|
:key="`${resultsRevealEpoch}-${item.rowKey}`"
|
||||||
:ref="(el) => setQuoteRef(item.rowKey, el)"
|
:ref="(el) => setQuoteRef(item.rowKey, el)"
|
||||||
class="h5-quote h5-quote--reveal"
|
class="h5-quote"
|
||||||
:class="{
|
:class="{
|
||||||
'h5-quote--ai': item.rowKey === recommendedRowKey,
|
'h5-quote--ai': item.rowKey === recommendedRowKey,
|
||||||
}"
|
}"
|
||||||
:style="{ '--i': Math.min(idx, 7) }"
|
|
||||||
@click="openDetail(item)"
|
@click="openDetail(item)"
|
||||||
>
|
>
|
||||||
<div class="h5-quote__main">
|
<div class="h5-quote__main">
|
||||||
@ -454,10 +456,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
</template>
|
|
||||||
|
|
||||||
<!-- AI 荐线降权:列表之后,默认一条轻入口 -->
|
<!-- AI 荐线降权:列表之后,默认一条轻入口 -->
|
||||||
<div v-if="sortedResults.length && !queryLoading" class="h5-ai-panel h5-ai-panel--in">
|
<div class="h5-ai-panel">
|
||||||
<button
|
<button
|
||||||
v-if="!aiPanelOpen"
|
v-if="!aiPanelOpen"
|
||||||
type="button"
|
type="button"
|
||||||
@ -517,6 +518,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</Transition>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<div v-else-if="isLoggedIn" class="h5-empty h5-price-empty">
|
<div v-else-if="isLoggedIn" class="h5-empty h5-price-empty">
|
||||||
@ -2034,11 +2037,6 @@ onMounted(() => {
|
|||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.h5-ai-panel--in {
|
|
||||||
animation: h5-soft-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
|
|
||||||
animation-delay: 0.18s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.h5-ai-entry {
|
.h5-ai-entry {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
@ -2467,21 +2465,42 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.h5-price-results {
|
.h5-price-results {
|
||||||
|
position: relative;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 查价成功:骨架渐出、报价渐入,同时进行 */
|
||||||
|
.h5-stage-enter-active,
|
||||||
|
.h5-stage-leave-active {
|
||||||
|
transition: opacity 0.42s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.h5-stage-enter-active {
|
||||||
|
z-index: 1;
|
||||||
|
transition-timing-function: ease-out;
|
||||||
|
transition-duration: 0.48s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.h5-stage-leave-active {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 0;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
left: 0;
|
||||||
|
transition-timing-function: ease-in;
|
||||||
|
transition-duration: 0.32s;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.h5-stage-enter-from,
|
||||||
|
.h5-stage-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.h5-results-bar {
|
.h5-results-bar {
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.h5-results-bar--in {
|
|
||||||
animation: h5-soft-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
|
|
||||||
}
|
|
||||||
|
|
||||||
.h5-empty--in {
|
|
||||||
animation: h5-soft-in 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
|
|
||||||
}
|
|
||||||
|
|
||||||
.h5-results-bar__row {
|
.h5-results-bar__row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -2548,8 +2567,6 @@ onMounted(() => {
|
|||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
|
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
|
||||||
animation: h5-soft-in 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
|
|
||||||
animation-delay: calc(var(--i, 0) * 55ms);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.h5-quote-skel__head {
|
.h5-quote-skel__head {
|
||||||
@ -2646,11 +2663,6 @@ onMounted(() => {
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||||
|
|
||||||
&--reveal {
|
|
||||||
animation: h5-quote-reveal 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
|
|
||||||
animation-delay: calc(var(--i, 0) * 48ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
&--ai {
|
&--ai {
|
||||||
box-shadow:
|
box-shadow:
|
||||||
0 0 0 1.5px color-mix(in srgb, var(--app-primary-color) 45%, transparent),
|
0 0 0 1.5px color-mix(in srgb, var(--app-primary-color) 45%, transparent),
|
||||||
@ -2816,7 +2828,6 @@ onMounted(() => {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
font-variant-numeric: tabular-nums;
|
font-variant-numeric: tabular-nums;
|
||||||
line-height: 1.1;
|
line-height: 1.1;
|
||||||
will-change: filter, opacity, transform;
|
|
||||||
|
|
||||||
small {
|
small {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
@ -2830,56 +2841,6 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 价格:模糊 → 清晰(后于卡片半拍) */
|
|
||||||
.h5-quote--reveal .h5-quote__price {
|
|
||||||
animation: h5-price-figure 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
|
|
||||||
animation-delay: calc(var(--i, 0) * 48ms + 90ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
.h5-quote--reveal .ref-label {
|
|
||||||
animation: h5-soft-in 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
|
|
||||||
animation-delay: calc(var(--i, 0) * 48ms + 140ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes h5-soft-in {
|
|
||||||
from {
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateY(6px);
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
opacity: 1;
|
|
||||||
transform: translateY(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes h5-quote-reveal {
|
|
||||||
from {
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateY(10px);
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
opacity: 1;
|
|
||||||
transform: translateY(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes h5-price-figure {
|
|
||||||
from {
|
|
||||||
opacity: 0.25;
|
|
||||||
filter: blur(6px);
|
|
||||||
transform: translateY(3px) scale(0.99);
|
|
||||||
}
|
|
||||||
55% {
|
|
||||||
opacity: 1;
|
|
||||||
filter: blur(1.2px);
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
opacity: 1;
|
|
||||||
filter: blur(0);
|
|
||||||
transform: translateY(0) scale(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes h5-skel-shimmer {
|
@keyframes h5-skel-shimmer {
|
||||||
0% {
|
0% {
|
||||||
background-position: 100% 0;
|
background-position: 100% 0;
|
||||||
@ -2905,22 +2866,15 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-reduced-motion: reduce) {
|
@media (prefers-reduced-motion: reduce) {
|
||||||
.h5-results-bar--in,
|
.h5-stage-enter-active,
|
||||||
.h5-empty--in,
|
.h5-stage-leave-active {
|
||||||
.h5-ai-panel--in,
|
transition: none !important;
|
||||||
.h5-quote-skel,
|
}
|
||||||
.h5-quote--reveal,
|
|
||||||
.h5-quote--reveal .h5-quote__price,
|
|
||||||
.h5-quote--reveal .ref-label,
|
|
||||||
.quote-collapsed__pulse,
|
.quote-collapsed__pulse,
|
||||||
.h5-quote-skel__bone {
|
.h5-quote-skel__bone {
|
||||||
animation: none !important;
|
animation: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.h5-quote--reveal .h5-quote__price {
|
|
||||||
filter: none;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.h5-quote__actions {
|
.h5-quote__actions {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user