Browse Source

在buyer页面图片点击时添加登录验证

pull/1/head
徐飞洋 3 months ago
parent
commit
e78e403968
  1. 26
      pages/buyer/index.js

26
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,

Loading…
Cancel
Save