feat: H5 查价结果渐入渐出,助手发送钮对齐首页圆钮
Some checks failed
Build and Deploy Front / deploy (push) Failing after 7s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zzh 2026-11-07 15:39:00 +08:00
parent ab8663607f
commit 3bde663e43
3 changed files with 136 additions and 139 deletions

View File

@ -239,10 +239,19 @@
<button
type="submit"
class="ai-composer-send"
:class="{ 'is-empty': roundSend && !inputText.trim() }"
: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>
</form>
<div class="ai-composer-footer">
@ -368,6 +377,14 @@ import { resolveTextModelId } from '@/views/system/aiAssistant/providerCatalog';
import NanaAvatar from './NanaAvatar.vue';
import logoImg from '@/assets/logo2.png';
withDefaults(
defineProps<{
/** 发送钮用首页提问卡的圆钮:空态浅灰,有内容黑底上箭头 */
roundSend?: boolean;
}>(),
{ roundSend: false },
);
type QuickTagDef = {
id: string;
icon: typeof IconStorage;

View File

@ -24,7 +24,7 @@
</div>
<div class="h5-assistant-shell">
<AiAdvisorShell ref="shellRef" />
<AiAdvisorShell ref="shellRef" round-send />
</div>
</div>
</template>
@ -338,35 +338,61 @@ function promptGuestRegister() {
}
:deep(.ai-composer-send) {
width: 40px;
height: 40px;
border-radius: 12px;
background: var(--app-primary-color);
width: 32px;
height: 32px;
border: none;
border-radius: 999px;
background: #0d0d0d;
color: #fff;
box-shadow: none;
opacity: 1;
transform: none;
filter: none;
.arco-icon,
.ai-composer-send__mark,
svg {
width: 1.15em;
height: 1.15em;
display: block;
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;
fill: currentColor;
}
&:disabled {
background: #e5e6eb;
color: #c9cdd4;
opacity: 1;
opacity: 0.45;
cursor: not-allowed;
.arco-icon,
svg {
color: #c9cdd4;
}
transform: none;
filter: none;
}
&:not(:disabled):active {
filter: brightness(1.05);
&:not(:disabled):not(.is-empty):active {
background: #2f2f2f;
filter: none;
}
}

View File

@ -218,40 +218,20 @@
class="h5-price-results"
:aria-busy="queryLoading"
>
<div v-if="sortedResults.length && !queryLoading" class="h5-results-bar h5-results-bar--in">
<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>
<!-- 查价中:骨架占位(飞猪/携程式),避免整页 Spin 生硬切换 -->
<!-- 骨架 ↔ 报价:同时渐出 / 渐入,离开层脱离文档流避免高度叠加 -->
<Transition name="h5-stage">
<div
v-if="queryLoading"
class="h5-quote-skel-list"
key="loading"
class="h5-quote-stage"
aria-live="polite"
:aria-label="t('h5.price.querying')"
>
<div class="h5-quote-skel-list">
<div
v-for="i in 3"
:key="`skel-${resultsRevealEpoch}-${i}`"
class="h5-quote-skel"
:style="{ '--i': i - 1 }"
>
<div class="h5-quote-skel__head">
<div class="h5-quote-skel__col">
@ -271,10 +251,12 @@
</div>
</div>
</div>
</div>
<div
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">
<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
@ -367,16 +349,36 @@
</a-button>
</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
v-for="(item, idx) in sortedResults"
v-for="item in sortedResults"
:key="`${resultsRevealEpoch}-${item.rowKey}`"
:ref="(el) => setQuoteRef(item.rowKey, el)"
class="h5-quote h5-quote--reveal"
class="h5-quote"
:class="{
'h5-quote--ai': item.rowKey === recommendedRowKey,
}"
:style="{ '--i': Math.min(idx, 7) }"
@click="openDetail(item)"
>
<div class="h5-quote__main">
@ -454,10 +456,9 @@
</div>
</div>
</article>
</template>
<!-- AI 荐线降权:列表之后,默认一条轻入口 -->
<div v-if="sortedResults.length && !queryLoading" class="h5-ai-panel h5-ai-panel--in">
<div class="h5-ai-panel">
<button
v-if="!aiPanelOpen"
type="button"
@ -517,6 +518,8 @@
</div>
</template>
</div>
</div>
</Transition>
</section>
<div v-else-if="isLoggedIn" class="h5-empty h5-price-empty">
@ -2034,11 +2037,6 @@ onMounted(() => {
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 {
width: 100%;
height: 40px;
@ -2467,21 +2465,42 @@ onMounted(() => {
}
.h5-price-results {
position: relative;
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 {
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 {
display: flex;
align-items: center;
@ -2548,8 +2567,6 @@ onMounted(() => {
border-radius: 16px;
background: #fff;
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 {
@ -2646,11 +2663,6 @@ onMounted(() => {
text-align: left;
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 {
box-shadow:
0 0 0 1.5px color-mix(in srgb, var(--app-primary-color) 45%, transparent),
@ -2816,7 +2828,6 @@ onMounted(() => {
white-space: nowrap;
font-variant-numeric: tabular-nums;
line-height: 1.1;
will-change: filter, opacity, transform;
small {
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 {
0% {
background-position: 100% 0;
@ -2905,22 +2866,15 @@ onMounted(() => {
}
@media (prefers-reduced-motion: reduce) {
.h5-results-bar--in,
.h5-empty--in,
.h5-ai-panel--in,
.h5-quote-skel,
.h5-quote--reveal,
.h5-quote--reveal .h5-quote__price,
.h5-quote--reveal .ref-label,
.h5-stage-enter-active,
.h5-stage-leave-active {
transition: none !important;
}
.quote-collapsed__pulse,
.h5-quote-skel__bone {
animation: none !important;
}
.h5-quote--reveal .h5-quote__price {
filter: none;
opacity: 1;
}
}
.h5-quote__actions {