1
0
réplica de https://github.com/ialley-workshop-open/uni-halo.git sincronizado 2026-06-12 13:19:31 +08:00

fix: 修复个人图库分类少于2条不显示问题,修复图片预览问题

Este cometimento está contido em:
小莫唐尼
2024-05-22 22:29:13 +08:00
ascendente 512a4013b9
cometimento 8d610473b3
+5 -6
Ver ficheiro
@@ -1,12 +1,12 @@
<template> <template>
<view class="app-page"> <view class="app-page">
<!-- 顶部切换 --> <!-- 顶部切换 -->
<view class="e-fixed" v-if="category.list.length > 2"> <view class="e-fixed" v-if="category.list.length > 0">
<tm-tabs color="light-blue" v-model="category.activeIndex" range-key="displayName" :list="category.list" <tm-tabs color="light-blue" v-model="category.activeIndex" range-key="displayName" :list="category.list"
align="left" @change="fnOnCategoryChange"></tm-tabs> align="left" @change="fnOnCategoryChange"></tm-tabs>
</view> </view>
<!-- 占位区域 --> <!-- 占位区域 -->
<view style="width: 100vw;height: 90rpx;"></view> <view v-if="category.list.length > 0" style="width: 100vw;height: 90rpx;"></view>
<!-- 加载区域 --> <!-- 加载区域 -->
<view v-if="loading != 'success'" class="loading-wrap"> <view v-if="loading != 'success'" class="loading-wrap">
<tm-skeleton model="card"></tm-skeleton> <tm-skeleton model="card"></tm-skeleton>
@@ -26,7 +26,7 @@
animation-name="fadeUp" :wait="calcAniWait(index)"> animation-name="fadeUp" :wait="calcAniWait(index)">
<view style="border-radius: 12rpx;overflow: hidden;width: 100%;height: 250rpx;"> <view style="border-radius: 12rpx;overflow: hidden;width: 100%;height: 250rpx;">
<image style="width: 100%;height: 100%;" mode="aspectFill" :src="item.spec.cover" <image style="width: 100%;height: 100%;" mode="aspectFill" :src="item.spec.cover"
@click="fnPreview(item)" /> @click="fnPreview(index)" />
</view> </view>
</tm-translate> </tm-translate>
</block> </block>
@@ -194,11 +194,10 @@
console.log('点击数据', data); console.log('点击数据', data);
}, },
// 预览 // 预览
fnPreview(item) { fnPreview(index) {
const index = this.cache.dataList.findIndex(x => x.spec.cover == x.spec.cover);
uni.previewImage({ uni.previewImage({
current: index, current: index,
urls: this.cache.dataList.map(x => x.spec.cover), urls: this.dataList.map(x => x.spec.cover),
indicator: 'number', indicator: 'number',
loop: true loop: true
}); });