修复小程序登录店铺选择流程
This commit is contained in:
@@ -320,6 +320,10 @@ Page({
|
|||||||
|
|
||||||
async openLoginShopSelector() {
|
async openLoginShopSelector() {
|
||||||
const shopOptions = await this.loadLoginShopOptions()
|
const shopOptions = await this.loadLoginShopOptions()
|
||||||
|
if (shopOptions.length === 1) {
|
||||||
|
await this.loginWithSelectedShop(shopOptions[0].id)
|
||||||
|
return
|
||||||
|
}
|
||||||
this.setData({
|
this.setData({
|
||||||
shopOptions,
|
shopOptions,
|
||||||
shopSelectVisible: true,
|
shopSelectVisible: true,
|
||||||
@@ -436,7 +440,7 @@ Page({
|
|||||||
this.saveLoginPreference()
|
this.saveLoginPreference()
|
||||||
wx.reLaunch({ url: '/pages/planning/index' })
|
wx.reLaunch({ url: '/pages/planning/index' })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (isShopSelectionRequiredError(error) || await this.tryOpenLoginShopSelector()) {
|
if (isShopSelectionRequiredError(error)) {
|
||||||
try {
|
try {
|
||||||
if (!this.data.shopSelectVisible) {
|
if (!this.data.shopSelectVisible) {
|
||||||
await this.openLoginShopSelector()
|
await this.openLoginShopSelector()
|
||||||
|
|||||||
Reference in New Issue
Block a user