BottomScrollTip.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <view v-if="visible" class="bottom-scroll-tip" :style="wrapStyle">
  3. <view class="tip-pill">
  4. <text class="tip-text">{{ text }}</text>
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. name: "BottomScrollTip",
  11. props: {
  12. text: { type: String, default: "滑动查看更多内容" },
  13. visible: { type: Boolean, default: true },
  14. bottom: { type: String, default: "" }, // 可选:自定义距离底部(不含安全区)
  15. },
  16. computed: {
  17. wrapStyle() {
  18. if (this.bottom) {
  19. return {
  20. bottom: `calc(${this.bottom} + env(safe-area-inset-bottom))`,
  21. };
  22. }
  23. return {};
  24. },
  25. },
  26. };
  27. </script>
  28. <style scoped>
  29. .bottom-scroll-tip {
  30. position: fixed;
  31. left: 0;
  32. right: 0;
  33. bottom: env(safe-area-inset-bottom);
  34. z-index: 90;
  35. display: flex;
  36. justify-content: center;
  37. pointer-events: none;
  38. padding: 10rpx 24rpx 18rpx;
  39. }
  40. .tip-pill {
  41. pointer-events: none;
  42. padding: 10rpx 20rpx;
  43. border-radius: 999rpx;
  44. background: rgba(0, 0, 0, 0.45);
  45. backdrop-filter: blur(6rpx);
  46. }
  47. .tip-text {
  48. font-size: 24rpx;
  49. color: #fff;
  50. letter-spacing: 1rpx;
  51. }
  52. </style>