Browse Source

修复seller页面登录后表单内容丢失问题

pull/1/head
徐飞洋 3 months ago
parent
commit
eecdc357c4
  1. 6
      pages/seller/index.js

6
pages/seller/index.js

@ -1211,10 +1211,12 @@ Page({
wx.switchTab({ url: '/pages/buyer/index' })
} else {
// 卖家登录成功后,重新显示创建货源弹窗
// 从本地存储加载保存的表单数据
const savedSupply = wx.getStorageSync('newSupplyDraft') || { name: '', price: '', minOrder: '', yolk: '', spec: '', imageUrls: [] };
this.setData({
showImagePreview: false,
showModal: true,
newSupply: { name: '', price: '', minOrder: '', yolk: '', spec: '', imageUrls: [] }
newSupply: savedSupply
});
this.disablePageScroll();
}
@ -1401,6 +1403,8 @@ Page({
if (!userId || !openid || !userInfo) {
console.log('用户未登录,显示登录提示');
// 登录前保存当前表单数据到本地存储
wx.setStorageSync('newSupplyDraft', this.data.newSupply);
// 用户未登录,显示未授权提示弹窗
wx.showModal({
title: '登录提示',

Loading…
Cancel
Save