Fix PWA registration, font loading, and Safari slider interactions.
Configure module service worker registration, remove duplicate SW hook, correct IRANSans Black font path, and improve touch slider handling in trade and wallet forms. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Vendored
+4
-1
@@ -8,7 +8,6 @@ export {}
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
AButton: typeof import('ant-design-vue/es')['Button']
|
||||
ACheckbox: typeof import('ant-design-vue/es')['Checkbox']
|
||||
ADivider: typeof import('ant-design-vue/es')['Divider']
|
||||
AForm: typeof import('ant-design-vue/es')['Form']
|
||||
AFormItem: typeof import('ant-design-vue/es')['FormItem']
|
||||
@@ -16,14 +15,17 @@ declare module 'vue' {
|
||||
AInputPassword: typeof import('ant-design-vue/es')['InputPassword']
|
||||
AModal: typeof import('ant-design-vue/es')['Modal']
|
||||
AppCreditLink: typeof import('./src/components/AppCreditLink.vue')['default']
|
||||
ARadio: typeof import('ant-design-vue/es')['Radio']
|
||||
ARadioButton: typeof import('ant-design-vue/es')['RadioButton']
|
||||
ARadioGroup: typeof import('ant-design-vue/es')['RadioGroup']
|
||||
ASelect: typeof import('ant-design-vue/es')['Select']
|
||||
ASelectOption: typeof import('ant-design-vue/es')['SelectOption']
|
||||
ASlider: typeof import('ant-design-vue/es')['Slider']
|
||||
ASpin: typeof import('ant-design-vue/es')['Spin']
|
||||
ASwitch: typeof import('ant-design-vue/es')['Switch']
|
||||
ATag: typeof import('ant-design-vue/es')['Tag']
|
||||
ATextarea: typeof import('ant-design-vue/es')['Textarea']
|
||||
ATooltip: typeof import('ant-design-vue/es')['Tooltip']
|
||||
BaseDatePicker: typeof import('./src/components/BasicPacks/BaseDatePicker/src/BaseDatePicker.vue')['default']
|
||||
Basic: typeof import('./src/components/BasicPacks/BaseDatePicker/src/datePick/demo/basic.vue')['default']
|
||||
BasicActionSheet: typeof import('./src/components/BasicPacks/BasicActionSheet.vue')['default']
|
||||
@@ -68,5 +70,6 @@ declare module 'vue' {
|
||||
TransactionSkeleton: typeof import('./src/components/TransactionSkeleton.vue')['default']
|
||||
VanActionSheet: typeof import('vant/es')['ActionSheet']
|
||||
VanDialog: typeof import('vant/es')['Dialog']
|
||||
VanField: typeof import('vant/es')['Field']
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,6 @@
|
||||
<script lang="ts" setup>
|
||||
import pkg from '../package.json'
|
||||
import { getDisplayAppVersion } from '@/config/config-cache'
|
||||
import {useRegisterSW} from 'virtual:pwa-register/vue'
|
||||
import {computed, defineAsyncComponent, h, onMounted, ref, watch} from 'vue'
|
||||
import img_topGradiant from '@/views/login/assets/img/gr_top_white.svg'
|
||||
import img_pattern from '@/views/login/assets/img/pattern.svg'
|
||||
@@ -127,7 +126,6 @@ const showDesktopFloatingCredit = computed(() => {
|
||||
return route.name === 'login' || !!route.meta.hideMenu
|
||||
})
|
||||
|
||||
useRegisterSW()
|
||||
const displayVersion = getDisplayAppVersion(pkg.version)
|
||||
const config = useConfigStore()
|
||||
const splashIndicator = computed(() => h(LoadingOutlined, {
|
||||
|
||||
@@ -156,11 +156,26 @@
|
||||
//}
|
||||
|
||||
/* =================== Slider =================== */
|
||||
.app-touch-slider {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
touch-action: none;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
padding-block: 0.375rem;
|
||||
}
|
||||
|
||||
.ant-slider {
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
.ant-slider-track {
|
||||
background-color: @App-primary-color !important;
|
||||
}
|
||||
.ant-slider-handle {
|
||||
border-color: @App-primary-color !important;
|
||||
touch-action: none;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
/* =================== Menu =================== */
|
||||
|
||||
@@ -30,14 +30,14 @@
|
||||
|
||||
@font-face {
|
||||
font-family: @prefixCls-font-family;
|
||||
src: url("../fonts/iranSans/woff2/IRANSansWeb(FaNum)_Bold.woff2") format("woff");
|
||||
src: url("../fonts/iranSans/woff2/IRANSansWeb(FaNum)_Bold.woff2") format("woff2");
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: @prefixCls-font-family;
|
||||
src: url("../fonts/iranSans/woff2/IRANSansWeb(FaNum)_primary.woff2") format("woff");
|
||||
src: url("../fonts/iranSans/woff2/IRANSansWeb(FaNum)_Black.woff2") format("woff2");
|
||||
font-weight: 900;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@ import img_pattern from "@/assets/img/dollar_pattern.svg";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex absolute w-full top-0 right-0 left-0 bottom-0">
|
||||
<img :src="img_right" alt="" class=" absolute z-5 w-screen h-full object-cover">
|
||||
<img :src="img_pattern" alt="" class=" w-full object-cover">
|
||||
<div class="bg-main-decor flex absolute w-full top-0 right-0 left-0 bottom-0 pointer-events-none">
|
||||
<img :src="img_right" alt="" class="absolute z-5 w-screen h-full object-cover">
|
||||
<img :src="img_pattern" alt="" class="w-full object-cover">
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -69,14 +69,21 @@
|
||||
<Transition mode="out-in" name="fade">
|
||||
<a-form-item v-if="walletStore?.walletInfo" class="!mt-3 ">
|
||||
<!-- {{ isBuy }}-->
|
||||
<a-slider v-model:value="form.percentWallet"
|
||||
:disabled="isBuy? cashWalletBalance <= 0: false"
|
||||
:max="100"
|
||||
:min="0"
|
||||
:step="10"
|
||||
:tip-formatter="null"
|
||||
class="!my-1"
|
||||
@change="percentChange" />
|
||||
<div
|
||||
class="app-touch-slider"
|
||||
@touchstart.stop
|
||||
@touchmove.stop
|
||||
@pointerdown.stop
|
||||
>
|
||||
<a-slider v-model:value="form.percentWallet"
|
||||
:disabled="isBuy? cashWalletBalance <= 0: false"
|
||||
:max="100"
|
||||
:min="0"
|
||||
:step="10"
|
||||
:tip-formatter="null"
|
||||
class="!my-1"
|
||||
@change="percentChange" />
|
||||
</div>
|
||||
</a-form-item>
|
||||
</Transition>
|
||||
<!-- <Transition mode="out-in" name="fade">
|
||||
@@ -444,7 +451,7 @@ onMounted(async () => {
|
||||
const form = ref<Gold>({
|
||||
goldCash: undefined,
|
||||
goldValue: undefined,
|
||||
percentWallet: undefined
|
||||
percentWallet: 0,
|
||||
})
|
||||
const allowedAsciiCodeFloat = [46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57]
|
||||
const allowedAsciiCodeInt = [48, 49, 50, 51, 52, 53, 54, 55, 56, 57]
|
||||
@@ -683,7 +690,7 @@ async function ok() {
|
||||
form.value = {
|
||||
goldValue: undefined,
|
||||
goldCash: undefined,
|
||||
percentWallet: undefined,
|
||||
percentWallet: 0,
|
||||
method: 'cash'
|
||||
}
|
||||
await fundStore.getMyFund()
|
||||
|
||||
@@ -92,14 +92,21 @@
|
||||
<Transition mode="out-in" name="fade">
|
||||
<a-form-item v-if="walletStore?.walletInfo" class="!mt-3 ">
|
||||
<!-- {{ isBuy }}-->
|
||||
<a-slider v-model:value="form.percentWallet"
|
||||
:disabled="isBuy? cashWalletBalance <= 0: false"
|
||||
:max="100"
|
||||
:min="0"
|
||||
:step="10"
|
||||
:tip-formatter="null"
|
||||
class="!my-1"
|
||||
@change="percentChange" />
|
||||
<div
|
||||
class="app-touch-slider"
|
||||
@touchstart.stop
|
||||
@touchmove.stop
|
||||
@pointerdown.stop
|
||||
>
|
||||
<a-slider v-model:value="form.percentWallet"
|
||||
:disabled="isBuy? cashWalletBalance <= 0: false"
|
||||
:max="100"
|
||||
:min="0"
|
||||
:step="10"
|
||||
:tip-formatter="null"
|
||||
class="!my-1"
|
||||
@change="percentChange" />
|
||||
</div>
|
||||
</a-form-item>
|
||||
</Transition>
|
||||
</div>
|
||||
@@ -608,7 +615,7 @@ onMounted(async () => {
|
||||
const form = ref<Gold>({
|
||||
goldCash: undefined,
|
||||
goldValue: undefined,
|
||||
percentWallet: undefined
|
||||
percentWallet: 0,
|
||||
})
|
||||
const allowedAsciiCodeFloat = [46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57]
|
||||
const allowedAsciiCodeInt = [48, 49, 50, 51, 52, 53, 54, 55, 56, 57]
|
||||
@@ -811,7 +818,7 @@ async function ok() {
|
||||
form.value = {
|
||||
goldValue: undefined,
|
||||
goldCash: undefined,
|
||||
percentWallet: undefined
|
||||
percentWallet: 0,
|
||||
}
|
||||
inputLock.value = null
|
||||
message.success('سفارش شما با موفقیت انجام شد')
|
||||
|
||||
@@ -62,15 +62,22 @@
|
||||
{{ formatCashWalletBalanceText(usePriceWithoutType(walletStore?.walletInfo?.cash ?? 0)) }}
|
||||
</p>
|
||||
<a-form-item v-if="walletStore?.walletInfo" class="!mt-3">
|
||||
<a-slider
|
||||
v-model:value="form.percentWallet"
|
||||
:disabled="walletStore?.walletInfo?.cash <= 0"
|
||||
:max="100"
|
||||
:min="0"
|
||||
:step="10"
|
||||
:tip-formatter="formatter"
|
||||
@change="percentChange"
|
||||
/>
|
||||
<div
|
||||
class="app-touch-slider"
|
||||
@touchstart.stop
|
||||
@touchmove.stop
|
||||
@pointerdown.stop
|
||||
>
|
||||
<a-slider
|
||||
v-model:value="form.percentWallet"
|
||||
:disabled="walletStore?.walletInfo?.cash <= 0"
|
||||
:max="100"
|
||||
:min="0"
|
||||
:step="10"
|
||||
:tip-formatter="formatter"
|
||||
@change="percentChange"
|
||||
/>
|
||||
</div>
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div v-else key="deposit" class="dwallet-form__extras">
|
||||
|
||||
@@ -66,15 +66,22 @@
|
||||
{{ formatCashWalletBalanceText(usePriceWithoutType(walletStore?.walletInfo?.cash ?? 0)) }}
|
||||
</div>
|
||||
<a-form-item v-if="walletStore?.walletInfo" class="!mt-3">
|
||||
<a-slider
|
||||
v-model:value="form.percentWallet"
|
||||
:disabled="walletStore?.walletInfo?.cash <= 0"
|
||||
:max="100"
|
||||
:min="0"
|
||||
:step="10"
|
||||
:tip-formatter="formatter"
|
||||
@change="percentChange"
|
||||
/>
|
||||
<div
|
||||
class="app-touch-slider"
|
||||
@touchstart.stop
|
||||
@touchmove.stop
|
||||
@pointerdown.stop
|
||||
>
|
||||
<a-slider
|
||||
v-model:value="form.percentWallet"
|
||||
:disabled="walletStore?.walletInfo?.cash <= 0"
|
||||
:max="100"
|
||||
:min="0"
|
||||
:step="10"
|
||||
:tip-formatter="formatter"
|
||||
@change="percentChange"
|
||||
/>
|
||||
</div>
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div v-else class="mt-3">
|
||||
|
||||
+4
-4
@@ -18,21 +18,21 @@ export default defineConfig({
|
||||
vue(),
|
||||
vueJsx(),
|
||||
VitePWA({
|
||||
//registerType: 'autoUpdate',
|
||||
registerType: 'autoUpdate',
|
||||
devOptions: {
|
||||
enabled: true
|
||||
enabled: true,
|
||||
type: 'module',
|
||||
},
|
||||
workbox: {
|
||||
cleanupOutdatedCaches: true,
|
||||
clientsClaim: true,
|
||||
skipWaiting: true
|
||||
},
|
||||
mode: 'development',
|
||||
strategies: 'injectManifest',
|
||||
base: '/',
|
||||
srcDir: 'src',
|
||||
filename: 'sw.ts',
|
||||
includeAssets: ['/favicon.png'],
|
||||
strategies: 'injectManifest',
|
||||
manifest: {
|
||||
name: ``,
|
||||
short_name: ``,
|
||||
|
||||
Reference in New Issue
Block a user