feat: add app launching functionality and update related components

This commit is contained in:
Elysia
2026-01-31 18:21:16 +08:00
parent 39e40ff946
commit 6154d75fa6
5 changed files with 140 additions and 14 deletions

View File

@@ -15,7 +15,7 @@
<AppDetailModal data-app-modal="detail" :show="showModal" :app="currentApp" :screenshots="screenshots"
:isinstalled="currentAppIsInstalled" @close="closeDetail" @install="handleInstall" @remove="requestUninstallFromDetail"
@open-preview="openScreenPreview" />
@open-preview="openScreenPreview" @open-app="openDownloadedApp" />
<ScreenPreview :show="showPreview" :screenshots="screenshots" :current-screen-index="currentScreenIndex"
@close="closeScreenPreview" @prev="prevScreen" @next="nextScreen" />
@@ -536,11 +536,12 @@ const closeDownloadDetail = () => {
currentDownload.value = null;
};
const openDownloadedApp = (download: DownloadItem) => {
const encodedPkg = encodeURIComponent(download.pkgname);
openApmStoreUrl(`apmstore://launch?pkg=${encodedPkg}`, {
fallbackText: `打开应用: ${download.pkgname}`
});
const openDownloadedApp = (pkgname: string) => {
// const encodedPkg = encodeURIComponent(download.pkgname);
// openApmStoreUrl(`apmstore://launch?pkg=${encodedPkg}`, {
// fallbackText: `打开应用: ${download.pkgname}`
// });
window.ipcRenderer.invoke('launch-app', pkgname);
};
const loadCategories = async () => {