From d4ccc9b7d6bc5773db9a7ed4f088cb46926aaa82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=8E=AB=E5=94=90=E5=B0=BC?= <1431128779@qq.com> Date: Fri, 5 Jul 2024 17:41:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9B=BE=E5=BA=93?= =?UTF-8?q?=E7=80=91=E5=B8=83=E6=B5=81bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/tabbar/gallery/gallery.vue | 52 ++--- .../tm-flowLayout-custom.vue | 219 ++++++++++++++++++ 2 files changed, 234 insertions(+), 37 deletions(-) create mode 100644 tm-vuetify/components/tm-flowLayout-custom/tm-flowLayout-custom.vue diff --git a/pages/tabbar/gallery/gallery.vue b/pages/tabbar/gallery/gallery.vue index adbb1f4..e32a677 100644 --- a/pages/tabbar/gallery/gallery.vue +++ b/pages/tabbar/gallery/gallery.vue @@ -23,24 +23,7 @@ - - - - + @@ -48,7 +31,7 @@ style="box-sizing: border-box;padding: 6rpx;width: 50%;height: 250rpx;" animation-name="fadeUp" :wait="calcAniWait(index)"> - @@ -70,10 +53,13 @@ import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue'; import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue'; import tmIcons from '@/tm-vuetify/components/tm-icons/tm-icons.vue'; import tmImages from '@/tm-vuetify/components/tm-images/tm-images.vue'; -import tmFlowLayout from '@/tm-vuetify/components/tm-flowLayout/tm-flowLayout.vue'; +import tmFlowLayoutCustom from '@/tm-vuetify/components/tm-flowLayout-custom/tm-flowLayout-custom.vue'; import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue'; export default { + options: { + multipleSlots: true + }, components: { tmSkeleton, tmTranslate, @@ -82,7 +68,7 @@ export default { tmEmpty, tmIcons, tmImages, - tmFlowLayout, + tmFlowLayoutCustom, tmTabs }, data() { @@ -107,7 +93,7 @@ export default { }, computed: { galleryConfig() { - return this.$tm.vx.getters().getConfigs?.pageConfig?.galleryConfig; + return this.$tm.vx.getters().getConfigs.pageConfig.galleryConfig; } }, watch: { @@ -159,7 +145,7 @@ export default { fnGetCategory() { this.$httpApi.v2.getPhotoGroupList({ page: 1, - size: 9999 + size: 0 }).then(res => { this.category.list = res.items.map(item => { return { @@ -186,7 +172,7 @@ export default { this.loading = 'success'; if (res.items.length !== 0) { const _list = res.items.map((item, index) => { - item.spec.cover = this.$utils.checkImageUrl(item.spec.cover); + item.spec.url = this.$utils.checkImageUrl(item.spec.url || item.spec.cover); return item; }); if (this.isLoadMore) { @@ -196,7 +182,6 @@ export default { } if (this.galleryConfig.useWaterfall) { this.$nextTick(() => { - console.log('_list', _list) this.$refs.wafll.pushData(_list) }) } @@ -215,12 +200,14 @@ export default { }, 500); }); }, - + fnOnFlowClick({item}) { + this.fnPreview(item) + }, // 预览 fnPreview(data) { uni.previewImage({ current: this.dataList.findIndex(x => x.metadata.name === data.metadata.name), - urls: this.dataList.map(x => x.spec.cover), + urls: this.dataList.map(x => x.spec.url), indicator: 'number', loop: true }); @@ -237,18 +224,13 @@ export default { flex-direction: column; padding-bottom: 24rpx; background-color: #fafafa; - - &.is-balck { - background-color: #212121; - } } .content { display: flex; flex-wrap: wrap; box-sizing: border-box; - padding: 0 24rpx; - padding-top: 24rpx; + padding: 24rpx 24rpx 0; gap: 12rpx 0; .content-empty { @@ -265,10 +247,6 @@ export default { padding: 24rpx; } -.card { - box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.03); -} - .load-text { width: 100%; text-align: center; diff --git a/tm-vuetify/components/tm-flowLayout-custom/tm-flowLayout-custom.vue b/tm-vuetify/components/tm-flowLayout-custom/tm-flowLayout-custom.vue new file mode 100644 index 0000000..9973884 --- /dev/null +++ b/tm-vuetify/components/tm-flowLayout-custom/tm-flowLayout-custom.vue @@ -0,0 +1,219 @@ + + + + +