修复传参bug;解压显示bug

This commit is contained in:
2026-07-24 18:28:42 +08:00
parent cded249ab9
commit 48452cec2e
10 changed files with 3911 additions and 133 deletions

View File

@@ -42,7 +42,7 @@
<view class="wyxd-pager" v-if="slides.length > 1">
<view class="wyxd-pager-inner">
<view class="wyxd-nav-btn" :class="{ disabled: currentIndex <= 0 }" @click="prevSlide">
<view class="iconfont icon-fanhui" style="transform:rotate(180deg);font-size:24rpx;"></view>
<view class="iconfont icon-fanhui" style="font-size:24rpx;"></view>
</view>
<view class="wyxd-page-indicator">
<text class="wyxd-current">{{ pad(currentIndex + 1) }}</text>
@@ -50,7 +50,7 @@
<text class="wyxd-total">{{ pad(slides.length) }}</text>
</view>
<view class="wyxd-nav-btn" :class="{ disabled: currentIndex >= slides.length - 1 }" @click="nextSlide">
<view class="iconfont icon-fanhui" style="font-size:24rpx;"></view>
<view class="iconfont icon-fanhui" style="transform:rotate(180deg);font-size:24rpx;"></view>
</view>
</view>
</view>
@@ -131,12 +131,17 @@ const startDownload = async () => {
currentIndex.value = 0
status.value = 'downloading'
console.log("userToken.value",userToken.value);
console.log("workspaceId.value",workspaceId.value);
console.log("filePath.value",filePath.value);
const tempPath = await downloadWyxdAsZip(
userToken.value, workspaceId.value, filePath.value
)
console.log("获取到的下载地址:",tempPath);
status.value = 'extracting'
const extracted = await extractWyxd(tempPath)
console.log("extracted",extracted);
status.value = 'parsing'
const slideList = parseSlides(extracted.html, extracted.header, extracted.images)
@@ -165,9 +170,16 @@ const startDownload = async () => {
onLoad((options) => {
workspaceId.value = options.workspaceId || ''
filePath.value = options.filePath || ''
fileName.value = options.fileName || '未命名文档'
userToken.value = options.userToken || uni.getStorageSync('user_token') || ''
filePath.value = options?.filePath ? decodeURIComponent(options.filePath) : ''
fileName.value = options?.fileName ? decodeURIComponent(options.fileName) : '未命名文档'
userToken.value = options?.userToken ?? uni.getStorageSync('user_token') ?? ''
console.log('页面接收options原始参数', options)
console.log('最终赋值变量:', {
workspaceId: workspaceId.value,
filePath: filePath.value,
fileName: fileName.value,
userToken: userToken.value
})
if (isWyxdCached(workspaceId.value, filePath.value)) {
loadFromCache()