From 61243b8dd4d32bf92ca94aadf22a52a31d160067 Mon Sep 17 00:00:00 2001
From: ZF sun <34314687@qq.com>
Date: Sat, 30 May 2026 15:37:11 +0800
Subject: [PATCH] feat(merch/detail): add scroll hint for long product
description
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
1. 新增商品详情长描述滚动提示组件,展开长描述时显示3秒
2. 调整描述文本容器底部内边距避免提示遮挡内容
3. 替换原有自动滚动动画为上下弹跳提示动画
4. 优化展开描述的逻辑,展开长文本时触发提示显示
---
pages_promotion/merch/detail.vue | 51 +++++++++++++++++++++++++++-----
1 file changed, 44 insertions(+), 7 deletions(-)
diff --git a/pages_promotion/merch/detail.vue b/pages_promotion/merch/detail.vue
index a0e60dd..ecdb08a 100644
--- a/pages_promotion/merch/detail.vue
+++ b/pages_promotion/merch/detail.vue
@@ -24,7 +24,13 @@
- {{ merch.desc }}
+
+ {{ merch.desc }}
+
+ ↓
+ 上滑查看更多
+
+
{{ isDescExpanded ? '↑ 收起' : '↓ 展开' }}
@@ -329,7 +335,8 @@ export default {
screenWidth: uni.getSystemInfoSync().windowWidth,
changeStyleDebounce: null,
headerHeightInited: false,
- isDescExpanded: false
+ isDescExpanded: false,
+ isShowScrollHint: false
};
},
mixins: [list],
@@ -364,6 +371,12 @@ export default {
toggleDesc() {
if (!this.merch.desc) return;
this.isDescExpanded = !this.isDescExpanded;
+ if (this.isDescExpanded && this.merch.desc.length > 200) {
+ this.isShowScrollHint = true;
+ setTimeout(() => {
+ this.isShowScrollHint = false;
+ }, 3000);
+ }
},
initHeaderHeight() {
if (!this.merch || !this.merch.merch_name) return;
@@ -457,13 +470,37 @@ export default {
-webkit-box-orient: unset;
max-height: 300rpx;
word-break: break-all;
+ padding-bottom: 80rpx;
}
-@keyframes autoScroll {
- 0% { transform: translateY(0); }
- 30% { transform: translateY(-100rpx); }
- 60% { transform: translateY(-200rpx); }
- 100% { transform: translateY(0); }
+.scroll-hint {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 16rpx 0;
+ background: linear-gradient(to top, rgba(255,255,255,0.95), rgba(255,255,255,0.8));
+ z-index: 12;
+}
+
+.scroll-icon {
+ font-size: 28rpx;
+ color: #666;
+ margin-right: 8rpx;
+ animation: bounceDown 1s ease-in-out infinite;
+}
+
+.scroll-text {
+ font-size: 24rpx;
+ color: #666;
+}
+
+@keyframes bounceDown {
+ 0%, 100% { transform: translateY(0); }
+ 50% { transform: translateY(8rpx); }
}
.expand-tip {