diff --git a/hunliji-api/hl-api b/hunliji-api/hl-api index 7d21827..a5e690f 100644 Binary files a/hunliji-api/hl-api and b/hunliji-api/hl-api differ diff --git a/vite-tailwindcss/src/components/GiftEffect.vue b/vite-tailwindcss/src/components/GiftEffect.vue index 0d7acdc..2990112 100644 --- a/vite-tailwindcss/src/components/GiftEffect.vue +++ b/vite-tailwindcss/src/components/GiftEffect.vue @@ -5,14 +5,18 @@ diff --git a/vite-tailwindcss/src/utils/giftTypes.js b/vite-tailwindcss/src/utils/giftTypes.js index 4c01658..7a54af0 100644 --- a/vite-tailwindcss/src/utils/giftTypes.js +++ b/vite-tailwindcss/src/utils/giftTypes.js @@ -1,13 +1,13 @@ /** 礼物类型常量表(与后端 giftTypeWhitelist 一致) */ export const GIFT_TYPES = [ - { key: '520', label: '520' }, - { key: '1314', label: '1314' }, - { key: 'forever', label: '长长久久' }, - { key: 'bald', label: '白头偕老' }, - { key: 'concentric', label: '永结同心' }, - { key: 'heaven', label: '天作之合' }, - { key: 'moisten', label: '相濡以沫' }, - { key: 'match', label: '佳偶天成' }, + { key: '520', label: '520', preview: 'linear-gradient(135deg, #ff8da6 0%, #ff2d55 55%, #c41e3a 100%)' }, + { key: '1314', label: '1314', preview: 'linear-gradient(135deg, #fff3b0 0%, #ffd700 50%, #e6a000 100%)' }, + { key: 'forever', label: '长长久久', preview: 'linear-gradient(135deg, #ffb3c1 0%, #c41e3a 55%, #6b0f1a 100%)' }, + { key: 'bald', label: '白头偕老', preview: 'linear-gradient(135deg, #ffffff 0%, #e8e4d9 45%, #b8a878 100%)' }, + { key: 'concentric', label: '永结同心', preview: 'linear-gradient(135deg, #f5dcc4 0%, #d4a574 50%, #b76e79 100%)' }, + { key: 'heaven', label: '天作之合', preview: 'linear-gradient(135deg, #cce4ff 0%, #5ba3ff 50%, #1a5bb5 100%)' }, + { key: 'moisten', label: '相濡以沫', preview: 'linear-gradient(135deg, #c5f5ef 0%, #40b4a6 50%, #165e5a 100%)' }, + { key: 'match', label: '佳偶天成', preview: 'linear-gradient(135deg, #ffd4a8 0%, #e85d75 50%, #b5475a 100%)' }, ] export const GIFT_LABEL_MAP = Object.fromEntries(GIFT_TYPES.map((g) => [g.key, g.label])) diff --git a/vite-tailwindcss/src/views/index/index.vue b/vite-tailwindcss/src/views/index/index.vue index f9b97a6..31a0210 100644 --- a/vite-tailwindcss/src/views/index/index.vue +++ b/vite-tailwindcss/src/views/index/index.vue @@ -291,16 +291,16 @@
-
- 送一份心意 - +
+ 送一份心意 +
-
+
还可赠送 {{ giftQuota.remain }} 赠送次数已用完,再点赞 {{ giftQuota.likes_to_next }} 次可多送 1 次 已送 {{ giftQuota.gift_used }} / {{ giftQuota.gift_allow }} · 点赞 {{ giftQuota.my_likes }}(每 {{ giftQuota.likes_per_gift }} 赞 +1 次) @@ -308,7 +308,7 @@
@@ -1538,7 +1541,11 @@ const openGiftPanel = async () => { } catch { /* ignore */ } } -const onGiftPlayStart = ({ giftType, name, count }) => { +const onGiftPlayStart = ({ giftType, name, count, phase }) => { + if (phase === 'mult') { + giftFeedRef.value?.revealCount(giftType, count) + return + } giftFeedRef.value?.push(name, giftType, count) } @@ -1552,7 +1559,14 @@ const replayGiftFeedOnly = (list) => { const it = items[i] i += 1 giftFeedRef.value?.push(it.name, it.giftType, it.count) - if (i < items.length) setTimeout(tick, 900) + if (it.count > 1) { + setTimeout(() => { + giftFeedRef.value?.revealCount(it.giftType, it.count) + if (i < items.length) setTimeout(tick, 500) + }, 900) + } else if (i < items.length) { + setTimeout(tick, 900) + } } tick() } @@ -1583,7 +1597,7 @@ const handleSendGift = async (giftType) => { if (showGiftFx.value) { giftEffectRef.value?.play({ giftType, name, count: 1 }) } else { - giftFeedRef.value?.push(name, giftType, 1) + giftFeedRef.value?.bumpOrPush(name, giftType) } toast.success('心意已送达') } catch (e) { @@ -1901,73 +1915,100 @@ watch( .gift-fab.busy { opacity: 0.7; pointer-events: none; } .gift-icon { font-size: 16px; color: #a88c6b; line-height: 1; } .gift-panel { - max-height: min(52dvh, 380px); + max-height: min(56dvh, 420px); overflow-y: auto; - padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); + padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); + background: rgba(55, 55, 60, 0.94); + color: #e8e6e2; } .gift-panel-handle { - width: 36px; - height: 4px; + width: 32px; + height: 3px; border-radius: 999px; - background: rgba(168, 140, 107, 0.28); - margin: 0 auto 10px; + background: rgba(255, 255, 255, 0.22); + margin: 0 auto 8px; } .gift-quota { display: flex; flex-direction: column; - gap: 2px; - padding: 8px 10px; - border-radius: 10px; - background: rgba(168, 140, 107, 0.08); - color: #7a6550; - font-size: 11px; - line-height: 1.45; + gap: 1px; + padding: 6px 8px; + border-radius: 8px; + background: rgba(255, 255, 255, 0.06); + color: rgba(232, 230, 226, 0.78); + font-size: 10px; + line-height: 1.4; letter-spacing: 0.04em; } -.gift-quota b { color: #a88c6b; font-weight: 600; } +.gift-quota b { color: #f0e6c8; font-weight: 600; } .gift-quota-sub { - font-size: 10px; - color: #8A8680; + font-size: 9px; + color: rgba(232, 230, 226, 0.48); letter-spacing: 0.02em; } +.gift-name-input { + background: rgba(255, 255, 255, 0.08); + border: 0.5px solid rgba(255, 255, 255, 0.14); + color: #f5f3ef; +} +.gift-name-input::placeholder { + color: rgba(232, 230, 226, 0.4); +} +.gift-name-input:focus { + border-color: rgba(240, 230, 200, 0.45); +} .gift-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); - gap: 6px; + gap: 4px; } .gift-item { display: flex; flex-direction: column; align-items: center; - justify-content: center; - gap: 2px; - min-height: 52px; - padding: 6px 4px; + justify-content: flex-start; + gap: 1px; + min-height: 72px; + padding: 6px 2px 4px; border-radius: 10px; - border: 0.5px solid rgba(168, 140, 107, 0.22); - background: #fff; - color: #5c4a35; + border: 0.5px solid rgba(255, 255, 255, 0.1); + background: rgba(255, 255, 255, 0.06); + color: #e8e6e2; cursor: pointer; transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease; } .gift-item:active { transform: scale(0.96); } -.gift-item:disabled { opacity: 0.6; pointer-events: none; } -.gift-item-label { - font-size: 14px; - line-height: 1.15; - color: #a88c6b; +.gift-item:disabled { opacity: 0.45; pointer-events: none; } +.gift-item-preview { + display: block; + width: 100%; + min-height: 40px; + line-height: 1.1; + font-size: 24px; letter-spacing: 0.04em; text-align: center; + background-clip: text; + -webkit-background-clip: text; + color: transparent; + -webkit-text-fill-color: transparent; + filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)); } -.gift-item-count { - font-size: 10px; - color: #8A8680; - letter-spacing: 0.04em; +.gift-item-caption { + font-size: 8px; + line-height: 1.15; + color: rgba(232, 230, 226, 0.5); + letter-spacing: 0.03em; + text-align: center; + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } @media (max-width: 360px) { - .gift-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } - .gift-item { min-height: 48px; } - .gift-item-label { font-size: 15px; } + .gift-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; } + .gift-item { min-height: 80px; } + .gift-item-preview { font-size: 28px; min-height: 46px; } + .gift-item-caption { font-size: 9px; } } .action-comment-row { position: relative;