From 2a5214df1166caae9071fd642a725b6b9f87277c Mon Sep 17 00:00:00 2001 From: ZF sun <34314687@qq.com> Date: Mon, 26 Jan 2026 14:07:45 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=9B=BE=E7=89=87=E9=A2=84=E8=A7=88):=20?= =?UTF-8?q?=E5=B0=86=E5=9B=BE=E7=89=87=E9=A2=84=E8=A7=88=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=8F=90=E5=8F=96=E5=88=B0mixin=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 重构图片预览功能,将其从diy-picture组件移至mixin实现,便于复用 优化diy-rubik-cube组件的点击处理逻辑,支持无链接时预览图片 统一处理图片预览和页面跳转的条件判断 --- components-diy/diy-picture.vue | 15 +++-------- components-diy/diy-rubik-cube.vue | 42 ++++++++++++++++--------------- components-diy/minx.js | 13 ++++++++++ 3 files changed, 38 insertions(+), 32 deletions(-) diff --git a/components-diy/diy-picture.vue b/components-diy/diy-picture.vue index c17b371..54a9ea8 100644 --- a/components-diy/diy-picture.vue +++ b/components-diy/diy-picture.vue @@ -52,17 +52,6 @@ export default { } }, methods: { - previewImg(img) { - // #ifdef MP-WEIXIN - uni.previewImage({ - current: 0, - urls: [this.$util.img(img)], - success: function (res) { }, - fail: function (res) { }, - complete: function (res) { }, - }) - // #endif - }, redirectTo(link) { if (link.wap_url) { if (this.$util.getCurrRoute() == this.$util.MEMBER_PAGE_URL && !this.storeToken) { @@ -77,7 +66,9 @@ export default { await this.__$emitEvent({ eventName: 'picture-tap', data: item, promiseCallback: (event, handler, awaitedResult) => { if (!awaitedResult) return; - if (item.link.wap_url) { + + const link = item.link; + if (link?.name || link?.wap_url || link?.appid) { this.redirectTo(item.link); } else { this.previewImg(item.imageUrl); diff --git a/components-diy/diy-rubik-cube.vue b/components-diy/diy-rubik-cube.vue index d69f916..3bfa275 100644 --- a/components-diy/diy-rubik-cube.vue +++ b/components-diy/diy-rubik-cube.vue @@ -8,9 +8,8 @@