修正用户名显示逻辑进入服务列表页面自动刷新
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
<template>
|
||||
<view class="subpackage-host">
|
||||
<FurnitureReceptionImpl v-if="implReady" :incomingTab="incomingTab" />
|
||||
<FurnitureReceptionImpl
|
||||
v-if="implReady"
|
||||
ref="furnitureReceptionImpl"
|
||||
:incomingTab="incomingTab"
|
||||
/>
|
||||
<view v-else class="loading">
|
||||
<text v-if="error">{{ error }}</text>
|
||||
<text v-else>正在加载接待模块...</text>
|
||||
@@ -9,11 +13,16 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 微信小程序:pages.json 的 componentPlaceholder 注册分包组件(requiredComponents / 分包异步化)
|
||||
// #ifndef MP-WEIXIN
|
||||
import FurnitureReceptionImpl from '@/pages-subpackage/furniture_reception/furniture_reception-impl.vue';
|
||||
// #endif
|
||||
|
||||
export default {
|
||||
components: {
|
||||
// #ifndef MP-WEIXIN
|
||||
FurnitureReceptionImpl
|
||||
// #endif
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -41,6 +50,8 @@ export default {
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
// 底部 tab 等场景下页面会被缓存,子组件 mounted 不会再次执行,需每次显示时拉取最新数据
|
||||
this.refreshImplDataIfReady();
|
||||
},
|
||||
methods: {
|
||||
loadSubPackagePagesSubpackage() {
|
||||
@@ -67,10 +78,23 @@ export default {
|
||||
try {
|
||||
await this.loadSubPackagePagesSubpackage();
|
||||
this.implReady = true;
|
||||
await this.$nextTick();
|
||||
this.refreshImplDataIfReady();
|
||||
} catch (e) {
|
||||
console.error('[FurnitureReceptionHost] loadImpl failed:', e);
|
||||
this.error = '接待模块加载失败,请重试';
|
||||
}
|
||||
},
|
||||
refreshImplDataIfReady() {
|
||||
if (!this.implReady) {
|
||||
return;
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
const impl = this.$refs.furnitureReceptionImpl;
|
||||
if (impl && typeof impl.refreshPageData === 'function') {
|
||||
impl.refreshPageData();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user