1405/03/31-apk link

This commit is contained in:
2026-06-21 13:05:56 +03:30
parent f2bf58f4db
commit 499b0b1e77
7 changed files with 69 additions and 23 deletions
-10
View File
@@ -1,10 +0,0 @@
[
{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "ir.samingold.app",
"sha256_cert_fingerprints": ["60:54:C6:C1:22:6C:2E:EA:A1:05:02:B1:17:F5:7D:49:1A:C0:84:FF:4C:ED:FD:42:D9:7F:DF:B2:70:37:8E:03"]
}
}
]
View File
+14 -1
View File
@@ -83,11 +83,24 @@ function applyTenantThemeVars() {
document.documentElement.style.setProperty('--App-background-color', backgroundColor)
}
}
function detectTWA() {
const fromReferrer = document.referrer.startsWith('android-app://');
const fromParam = new URLSearchParams(window.location.search).get('source') === 'twa';
if (fromReferrer || fromParam) {
sessionStorage.setItem('appMode', 'twa');
// پاک کردن پارامتر از URL
if (fromParam) {
const url = new URL(window.location.href);
url.searchParams.delete('source');
window.history.replaceState({}, '', url);
}
}
}
export async function bootstrapApp() {
try {
detectTWA()
const config = await withTimeout(loadAppConfig(), 20000, 'Config loading timeout')
setAppConfig(config)
applyTenantThemeVars()
startPwaManifest(config)
+8 -1
View File
@@ -224,7 +224,14 @@ export function applyProjectFont() {
document.documentElement.classList.add('font-dana')
}
}
export function isTWA() {
if (sessionStorage.getItem('appMode') === 'twa') return true;
if (document.referrer.startsWith('android-app://')) {
sessionStorage.setItem('appMode', 'twa');
return true;
}
return false;
}
export function applyProjectTheme() {
applyProjectFont()
+30 -6
View File
@@ -186,7 +186,7 @@
</BasicButton>
<template v-if="config.config?.name === 'garoosi'">
<div class="dauth-actions-row">
<div v-if="!isTWA()" class="dauth-actions-row">
<a
class="dauth-link-btn dauth-link-btn--primary"
download="Garoosi.apk"
@@ -194,7 +194,7 @@
>
دانلود اپ اندروید
</a>
<button type="button" class="dauth-link-btn" @click="installWebApp">
<button type="button" class="dauth-link-btn" @click="installWebApp">
نصب نسخه وب اپ
</button>
</div>
@@ -205,6 +205,15 @@
درباره ما
</button>
</template>
<div v-else-if="!isTWA() && !!setting.getSettingByKey('apk_download_link')" class="mt-1">
<a
class="dauth-link-btn dauth-link-btn--primary !hover:text-primary "
:href="setting.getSettingByKey('apk_download_link')"
>
دانلود اپ اندروید
</a>
</div>
</div>
<div
@@ -239,8 +248,9 @@
ورود با اثر انگشت
</div>
</BasicButton>
<template v-if="config.config?.name === 'garoosi'">
<div class="flex w-full gap-2 mb-2 mt-2">
<div v-if="!isTWA()" class="flex w-full gap-2 mb-2 mt-2">
<a
class="flex w-full items-center justify-center rounded py-2 text-white bg-primary border-none cursor-pointer no-underline"
download="Garoosi.apk"
@@ -261,10 +271,17 @@
</div>
</BasicButton>
</template>
<div v-else-if="!isTWA() && !!setting.getSettingByKey('apk_download_link')" class=" mt-1">
<a
class="dauth-link-btn dauth-link-btn--primary !hover:text-primary "
:href="setting.getSettingByKey('apk_download_link')"
>
دانلود اپ اندروید
</a>
</div>
<div
v-if="isRegister"
class="cursor-pointer flex gap-1 justify-center mt-5 text-xs"
class="cursor-pointer flex gap-1 justify-center mt-5 text-xs "
@click="$emit('register', true)"
>
اگر حساب کاربری ندارید
@@ -360,7 +377,13 @@ import { useWalletStore } from '@/store/walletStore'
import { useSettingsStore } from '@/store/settingsStore'
import { setTruth } from '@/app/authBoot'
import {useConfigStore} from "@/store/configStore";
import {getConfigApp, getProjectLoginLogo, getProjectLoginTaglineLines, hasCustomLoginLogoLayout} from "@/utils/config";
import {
getConfigApp,
getProjectLoginLogo,
getProjectLoginTaglineLines,
hasCustomLoginLogoLayout,
isTWA
} from "@/utils/config";
import BasicActionSheet from "@/components/BasicPacks/BasicActionSheet.vue";
import {getConfig} from "@/api/config";
import shareAppleIcon from '@/assets/img/share-apple.png'
@@ -390,6 +413,7 @@ const stepTwoVerify = ref<boolean>(false)
const formRef = ref<FormInstance>()
const userStore = useUserStore()
const walletStore = useWalletStore()
const setting=useSettingsStore()
const data = reactive(['ورود با پیامک', 'ورود با کلمه عبور'])
const value = ref(data[0])
const refOtpInput = ref<InstanceType<typeof OtpInput> | null>(null)
@@ -8,11 +8,14 @@ import { useConfigStore } from '@/store/configStore'
import { useLoginPageContext } from '../../composables/useLoginPage'
import DesktopPwaGuideModal from './DesktopPwaGuideModal.vue'
import router from '@/router'
import {isTWA} from "@/utils/config";
import {useUserStore} from "@/store/userStore";
import {useSettingsStore} from "@/store/settingsStore";
const emit = defineEmits<{
register: [val: boolean]
}>()
const setting=useSettingsStore()
const config = useConfigStore()
const {
time,
@@ -170,7 +173,7 @@ function goToAboutUs() {
</BasicButton>
<template v-if="config.config?.name === 'garoosi'">
<div class="dauth-actions-row">
<div v-if="!isTWA()" class="dauth-actions-row">
<a
class="dauth-link-btn dauth-link-btn--primary"
download="Garoosi.apk"
@@ -189,6 +192,15 @@ function goToAboutUs() {
درباره ما
</button>
</template>
<div v-else-if="!isTWA() && !!setting.getSettingByKey('apk_download_link')" class="dauth-actions-row ">
<a
class="dauth-link-btn dauth-link-btn--primary !hover:text-primary "
:href="setting.getSettingByKey('apk_download_link')"
>
دانلود اپ اندروید
</a>
</div>
</div>
<div v-if="isRegister" class="dauth-switch">
+3 -3
View File
@@ -1081,10 +1081,10 @@
resolved "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz#255e81fb289b101026131858ab99fba63dcf0071"
integrity sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==
"@esbuild/linux-x64@0.18.20":
"@esbuild/win32-x64@0.18.20":
version "0.18.20"
resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz"
integrity sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==
resolved "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz"
integrity sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==
"@esbuild/netbsd-x64@0.18.20":
version "0.18.20"