修复店务小程序登录选店弹窗

This commit is contained in:
2026-07-16 14:27:03 +08:00
parent a9a23bfa6d
commit 62a7684e79
2 changed files with 12 additions and 10 deletions
+5 -10
View File
@@ -321,6 +321,10 @@ Page({
async openLoginShopSelector() {
const shopOptions = await this.loadLoginShopOptions()
if (shopOptions.length === 1) {
await this.loginWithSelectedShop(shopOptions[0].id)
return
}
this.setData({
shopOptions,
shopSelectVisible: true,
@@ -336,15 +340,6 @@ Page({
})
},
async tryOpenLoginShopSelector() {
try {
await this.openLoginShopSelector()
return true
} catch (error) {
return false
}
},
async selectLoginShop(event) {
if (this.data.switchingShop) {
return
@@ -437,7 +432,7 @@ Page({
this.saveLoginPreference()
wx.reLaunch({ url: '/pages/planning/index' })
} catch (error) {
if (isShopSelectionRequiredError(error) || await this.tryOpenLoginShopSelector()) {
if (isShopSelectionRequiredError(error)) {
try {
if (!this.data.shopSelectVisible) {
await this.openLoginShopSelector()