WYXD左右滑动翻页
This commit is contained in:
@@ -210,10 +210,6 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部锚点:两个交替切换,确保流式时每次都能触发滚动到底部 -->
|
||||
<!-- <view>
|
||||
<view id="chat-bottom-a" style="height: 0rpx;width: 1rpx;"></view>
|
||||
<view id="chat-bottom-b" style="height: 0rpx;width: 1rpx;"></view>
|
||||
</view> -->
|
||||
<view id="chat-bottom-a" style="height: 1rpx;"></view>
|
||||
<view id="chat-bottom-b" style="height: 1rpx;"></view>
|
||||
</scroll-view>
|
||||
|
||||
@@ -32,9 +32,14 @@
|
||||
|
||||
<!-- 幻灯片 -->
|
||||
<view v-else class="wyxd-slide-area">
|
||||
<scroll-view class="wyxd-slide-scroll" scroll-y :show-scrollbar="false">
|
||||
<view class="wyxd-slide-card" v-html="currentSlide.html"></view>
|
||||
</scroll-view>
|
||||
<swiper class="wyxd-swiper" :current="currentIndex"
|
||||
@change="onSwiperChange" :duration="250" easing-function="easeOutCubic">
|
||||
<swiper-item v-for="(slide, idx) in slides" :key="idx">
|
||||
<scroll-view class="wyxd-slide-scroll" scroll-y :show-scrollbar="false">
|
||||
<view class="wyxd-slide-card" v-html="slide.html"></view>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -89,10 +94,12 @@ const statusText = computed(() => {
|
||||
|
||||
const displayName = computed(() => fileName.value || '未命名文档')
|
||||
|
||||
const currentSlide = computed(() => slides.value[currentIndex.value] || { html: '' })
|
||||
|
||||
const pad = (n) => String(n).padStart(2, '0')
|
||||
|
||||
const onSwiperChange = (e) => {
|
||||
currentIndex.value = e.detail.current
|
||||
}
|
||||
|
||||
const goBack = () => {
|
||||
uni.navigateBack()
|
||||
}
|
||||
@@ -247,6 +254,11 @@ onLoad((options) => {
|
||||
/* padding: 20rpx; */
|
||||
}
|
||||
|
||||
.wyxd-swiper {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.wyxd-slide-scroll {
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
|
||||
Reference in New Issue
Block a user