解决登录显示、首页显示bug
This commit is contained in:
@@ -1,12 +1,6 @@
|
||||
<!-- 机构端 - 服务订单管理页面 -->
|
||||
<template>
|
||||
<view class="orders-page">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="mp-tab-navbar">
|
||||
<text class="mp-tab-title">服务订单</text>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- 一级切换:服务订单 / 取消售后 -->
|
||||
<view class="lvl1-tabs">
|
||||
<view
|
||||
@@ -348,6 +342,7 @@
|
||||
<script lang="uts">
|
||||
import supa from '@/components/supadb/aksupainstance.uts'
|
||||
import MerchantTabBar from '@/components/merchant-tabbar/MerchantTabBar.uvue'
|
||||
import { requireMerchantAuth } from '@/utils/merchantAuth.uts'
|
||||
import { USE_MOCK, MOCK_MERCHANT_ID, getMockOrdersByStatus, getMockAftersaleByStatus, getMockOrderTabCounts, getMockAftersaleTabCounts } from '@/pages/mall/merchant/mock/merchant-mock-data.uts'
|
||||
|
||||
type OrderItemType = {
|
||||
@@ -475,16 +470,27 @@
|
||||
},
|
||||
|
||||
onShow() {
|
||||
if (this.merchantId) {
|
||||
this.refreshCurrentTab()
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
this.refreshCurrentTab()
|
||||
}, 500)
|
||||
}
|
||||
this.handlePageShow()
|
||||
},
|
||||
|
||||
methods: {
|
||||
async ensureMerchantAuth(): Promise<boolean> {
|
||||
if (USE_MOCK) return true
|
||||
const result = await requireMerchantAuth({ redirectOnFail: true, toastOnFail: true })
|
||||
if (!result.ok) {
|
||||
this.merchantId = ''
|
||||
return false
|
||||
}
|
||||
this.merchantId = result.userInfo != null && result.userInfo.id != null ? result.userInfo.id : ''
|
||||
return this.merchantId !== ''
|
||||
},
|
||||
|
||||
async handlePageShow() {
|
||||
const passed = await this.ensureMerchantAuth()
|
||||
if (!passed) return
|
||||
this.refreshCurrentTab()
|
||||
},
|
||||
|
||||
// 计算底部安全区
|
||||
initSafeArea() {
|
||||
// #ifdef MP-WEIXIN
|
||||
@@ -1062,6 +1068,7 @@
|
||||
.lvl1-tabs {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
padding-top: var(--status-bar-height);
|
||||
background-color: #ffffff;
|
||||
border-bottom-width: 1rpx;
|
||||
border-bottom-style: solid;
|
||||
|
||||
Reference in New Issue
Block a user