From e78e403968c52e066b028ad45ccb7a6fa29dd8e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E9=A3=9E=E6=B4=8B?= <15778543+xufeiyang6017@user.noreply.gitee.com> Date: Fri, 5 Dec 2025 09:28:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8buyer=E9=A1=B5=E9=9D=A2=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E7=82=B9=E5=87=BB=E6=97=B6=E6=B7=BB=E5=8A=A0=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/buyer/index.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/pages/buyer/index.js b/pages/buyer/index.js index 6608e8a..ca2c941 100644 --- a/pages/buyer/index.js +++ b/pages/buyer/index.js @@ -1211,6 +1211,19 @@ Page({ // 预览图片 previewImage(e) { + // 登录验证 + const userInfo = wx.getStorageSync('userInfo') || null + const userId = wx.getStorageSync('userId') || null + if (!userInfo || !userId) { + // 未登录,显示授权登录弹窗 + this.setData({ + showAuthModal: true, + pendingUserType: 'buyer' + }) + return + } + + // 已登录,执行图片预览 const { urls, index } = e.currentTarget.dataset this.setData({ showImagePreview: true, @@ -1221,6 +1234,19 @@ Page({ // 预览图片 previewImage(e) { + // 登录验证 + const userInfo = wx.getStorageSync('userInfo') || null + const userId = wx.getStorageSync('userId') || null + if (!userInfo || !userId) { + // 未登录,显示授权登录弹窗 + this.setData({ + showAuthModal: true, + pendingUserType: 'buyer' + }) + return + } + + // 已登录,执行图片预览 const { urls, index } = e.currentTarget.dataset this.setData({ showImagePreview: true,