解决微信小程序首页空白问题。

This commit is contained in:
cst61
2026-02-01 09:21:11 +08:00
parent 80d6d46182
commit cc01c4dc47
454 changed files with 404 additions and 62235 deletions

View File

@@ -155,7 +155,12 @@
})
// #endif
this.searchText = getApp().globalData.searchText;
try {
const app = getApp({ allowDefault: true });
this.searchText = app && app.globalData ? app.globalData.searchText : '';
} catch (e) {
this.searchText = '';
}
},
computed: {
associativeShow() {
@@ -298,7 +303,14 @@
this.loadList(item.title);
},
loadList(text = '') {
getApp().globalData.searchText = text;
try {
const app = getApp({ allowDefault: true });
if (app && app.globalData) {
app.globalData.searchText = text;
}
} catch (e) {
// 静默失败
}
uni.switchTab({
url:'/pages/list/list'
})
@@ -318,7 +330,14 @@
})
} else {
this.associativeList.length = 0;
getApp().globalData.searchText = '';
try {
const app = getApp({ allowDefault: true });
if (app && app.globalData) {
app.globalData.searchText = '';
}
} catch (e) {
// 静默失败
}
}
}, 100)
}