feat: add debug mode for developers. Logs improvements
This commit is contained in:
@@ -308,6 +308,7 @@ class ControllerExtensionModuleTgshop extends Controller
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'module_tgshop_status' => 1,
|
'module_tgshop_status' => 1,
|
||||||
|
'module_tgshop_debug' => 0,
|
||||||
'module_tgshop_app_name' => $this->config->get('config_meta_title'),
|
'module_tgshop_app_name' => $this->config->get('config_meta_title'),
|
||||||
'module_tgshop_app_icon' => $this->config->get('config_image') ?: $this->model_tool_image->resize(
|
'module_tgshop_app_icon' => $this->config->get('config_image') ?: $this->model_tool_image->resize(
|
||||||
'no_image.png',
|
'no_image.png',
|
||||||
@@ -415,6 +416,15 @@ TEXT,
|
|||||||
'options' => static::$themes,
|
'options' => static::$themes,
|
||||||
'help' => 'Выберите стиль, который будет использоваться при отображении вашего магазина в Telegram для ночного режима. <a href="https://daisyui.com/docs/themes/#list-of-themes" target="_blank">Посмотреть как выглядят темы</a>',
|
'help' => 'Выберите стиль, который будет использоваться при отображении вашего магазина в Telegram для ночного режима. <a href="https://daisyui.com/docs/themes/#list-of-themes" target="_blank">Посмотреть как выглядят темы</a>',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'module_tgshop_debug' => [
|
||||||
|
'type' => 'select',
|
||||||
|
'options' => [
|
||||||
|
0 => 'Выключено',
|
||||||
|
1 => 'Включено',
|
||||||
|
],
|
||||||
|
'help' => 'Режим разработчика. Рекомендуется включать только по необходимости. В остальных случаях, для нормальной работы магазина, должен быть выключен.',
|
||||||
|
],
|
||||||
],
|
],
|
||||||
'telegram' => [
|
'telegram' => [
|
||||||
'module_tgshop_mini_app_url' => [
|
'module_tgshop_mini_app_url' => [
|
||||||
@@ -457,9 +467,9 @@ HTML,
|
|||||||
'statistics' => [
|
'statistics' => [
|
||||||
'module_tgshop_yandex_metrika' => [
|
'module_tgshop_yandex_metrika' => [
|
||||||
'type' => 'textarea',
|
'type' => 'textarea',
|
||||||
'placeholder' => 'Вставьте код счётчика Яндекс Метрики',
|
'placeholder' => 'Вставьте код счётчика Яндекс Метрики.',
|
||||||
'rows' => 15,
|
'rows' => 15,
|
||||||
'help' => ''
|
'help' => 'Для проверки интеграции через кнопку "Проверить" в интерфейсе Яндекс Метрики, необходимо сначала включить "Режим разработчика" на вкладке "Общие".'
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ $_['lbl_module_tgshop_enable_store'] = 'Разрешить покупки';
|
|||||||
$_['lbl_module_tgshop_feature_coupons'] = 'Промокоды';
|
$_['lbl_module_tgshop_feature_coupons'] = 'Промокоды';
|
||||||
$_['lbl_module_tgshop_feature_vouchers'] = 'Подарочные сертификаты';
|
$_['lbl_module_tgshop_feature_vouchers'] = 'Подарочные сертификаты';
|
||||||
$_['lbl_module_tgshop_home_banner_id'] = 'Баннер на главной';
|
$_['lbl_module_tgshop_home_banner_id'] = 'Баннер на главной';
|
||||||
|
$_['lbl_module_tgshop_debug'] = 'Режим разработчика';
|
||||||
|
|
||||||
// Entry
|
// Entry
|
||||||
$_['entry_status'] = 'Статус';
|
$_['entry_status'] = 'Статус';
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use Cart\Currency;
|
|||||||
use Cart\Tax;
|
use Cart\Tax;
|
||||||
use Openguru\OpenCartFramework\ImageTool\ImageTool;
|
use Openguru\OpenCartFramework\ImageTool\ImageTool;
|
||||||
use Openguru\OpenCartFramework\ImageTool\ImageToolInterface;
|
use Openguru\OpenCartFramework\ImageTool\ImageToolInterface;
|
||||||
|
use Openguru\OpenCartFramework\Logger\LoggerInterface;
|
||||||
use Openguru\OpenCartFramework\Logger\OpenCartLogAdapter;
|
use Openguru\OpenCartFramework\Logger\OpenCartLogAdapter;
|
||||||
use Openguru\OpenCartFramework\OpenCart\Decorators\OcRegistryDecorator;
|
use Openguru\OpenCartFramework\OpenCart\Decorators\OcRegistryDecorator;
|
||||||
|
|
||||||
@@ -37,8 +38,11 @@ class ControllerExtensionTgshopHandle extends Controller
|
|||||||
{
|
{
|
||||||
$this->session->data['language'] = $this->config->get('config_language');
|
$this->session->data['language'] = $this->config->get('config_language');
|
||||||
|
|
||||||
|
$appDebug = filter_var($this->config->get('module_tgshop_debug'), FILTER_VALIDATE_BOOLEAN);
|
||||||
|
|
||||||
$app = ApplicationFactory::create([
|
$app = ApplicationFactory::create([
|
||||||
'app_enabled' => filter_var($this->config->get('module_tgshop_status'), FILTER_VALIDATE_BOOLEAN),
|
'app_enabled' => filter_var($this->config->get('module_tgshop_status'), FILTER_VALIDATE_BOOLEAN),
|
||||||
|
'app_debug' => $appDebug,
|
||||||
'oc_config_tax' => $this->config->get('config_tax'),
|
'oc_config_tax' => $this->config->get('config_tax'),
|
||||||
'oc_default_currency' => $this->config->get('config_currency'),
|
'oc_default_currency' => $this->config->get('config_currency'),
|
||||||
// ID группы покупателей, которая будет использоаваться в заказах через Телеграм.
|
// ID группы покупателей, которая будет использоаваться в заказах через Телеграм.
|
||||||
@@ -107,7 +111,13 @@ class ControllerExtensionTgshopHandle extends Controller
|
|||||||
$app->singleton(Log::class, fn() => $this->log);
|
$app->singleton(Log::class, fn() => $this->log);
|
||||||
|
|
||||||
$app
|
$app
|
||||||
->withLogger(fn() => new OpenCartLogAdapter($this->log, 'TeleCart'))
|
->withLogger(
|
||||||
|
fn() => new OpenCartLogAdapter(
|
||||||
|
$this->log,
|
||||||
|
'TeleCart',
|
||||||
|
$appDebug ? LoggerInterface::LEVEL_DEBUG : LoggerInterface::LEVEL_WARNING,
|
||||||
|
)
|
||||||
|
)
|
||||||
->bootAndHandleRequest();
|
->bootAndHandleRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -92,4 +92,27 @@ final class Request
|
|||||||
|
|
||||||
return $headers[mb_strtolower($name)] ?? null;
|
return $headers[mb_strtolower($name)] ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array|string $key
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function has($key): bool
|
||||||
|
{
|
||||||
|
if (is_array($key)) {
|
||||||
|
foreach ($key as $k) {
|
||||||
|
if ($this->has($k)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($key, $this->query)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->json($key) !== null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,4 +81,9 @@ class Logger implements LoggerInterface
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function debug(string $message): void
|
||||||
|
{
|
||||||
|
$this->log($message, LoggerInterface::LEVEL_DEBUG);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,15 @@ use Throwable;
|
|||||||
|
|
||||||
interface LoggerInterface
|
interface LoggerInterface
|
||||||
{
|
{
|
||||||
|
public const LEVEL_DEBUG = 0;
|
||||||
public const LEVEL_INFO = 1;
|
public const LEVEL_INFO = 1;
|
||||||
public const LEVEL_WARNING = 2;
|
public const LEVEL_WARNING = 2;
|
||||||
public const LEVEL_ERROR = 3;
|
public const LEVEL_ERROR = 3;
|
||||||
|
|
||||||
public function log($message, $level = self::LEVEL_INFO);
|
public function log($message, $level = self::LEVEL_INFO);
|
||||||
|
|
||||||
|
public function debug(string $message): void;
|
||||||
|
|
||||||
public function info(string $message): void;
|
public function info(string $message): void;
|
||||||
|
|
||||||
public function warning(string $message): void;
|
public function warning(string $message): void;
|
||||||
|
|||||||
@@ -9,15 +9,21 @@ class OpenCartLogAdapter implements LoggerInterface
|
|||||||
{
|
{
|
||||||
private Log $ocLogger;
|
private Log $ocLogger;
|
||||||
private string $namespace;
|
private string $namespace;
|
||||||
|
private int $minLogLevel;
|
||||||
|
|
||||||
public function __construct(Log $ocLogger, string $namespace)
|
public function __construct(Log $ocLogger, string $namespace, int $minLogLevel = LoggerInterface::LEVEL_WARNING)
|
||||||
{
|
{
|
||||||
$this->ocLogger = $ocLogger;
|
$this->ocLogger = $ocLogger;
|
||||||
$this->namespace = $namespace;
|
$this->namespace = $namespace;
|
||||||
|
$this->minLogLevel = $minLogLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function log($message, $level = self::LEVEL_INFO): void
|
public function log($message, $level = LoggerInterface::LEVEL_INFO): void
|
||||||
{
|
{
|
||||||
|
if ($level < $this->minLogLevel) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$this->ocLogger->write(
|
$this->ocLogger->write(
|
||||||
sprintf(
|
sprintf(
|
||||||
"[%s] [%s] %s\n",
|
"[%s] [%s] %s\n",
|
||||||
@@ -35,12 +41,12 @@ class OpenCartLogAdapter implements LoggerInterface
|
|||||||
|
|
||||||
public function warning(string $message): void
|
public function warning(string $message): void
|
||||||
{
|
{
|
||||||
$this->log($message, self::LEVEL_WARNING);
|
$this->log($message, LoggerInterface::LEVEL_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function error(string $message): void
|
public function error(string $message): void
|
||||||
{
|
{
|
||||||
$this->log($message, self::LEVEL_ERROR);
|
$this->log($message, LoggerInterface::LEVEL_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function logException(Throwable $exception): void
|
public function logException(Throwable $exception): void
|
||||||
@@ -59,6 +65,8 @@ class OpenCartLogAdapter implements LoggerInterface
|
|||||||
private function getLevelString($level): string
|
private function getLevelString($level): string
|
||||||
{
|
{
|
||||||
switch ($level) {
|
switch ($level) {
|
||||||
|
case LoggerInterface::LEVEL_DEBUG:
|
||||||
|
return 'DEBUG';
|
||||||
case LoggerInterface::LEVEL_INFO:
|
case LoggerInterface::LEVEL_INFO:
|
||||||
return 'INFO';
|
return 'INFO';
|
||||||
case LoggerInterface::LEVEL_WARNING:
|
case LoggerInterface::LEVEL_WARNING:
|
||||||
@@ -69,4 +77,9 @@ class OpenCartLogAdapter implements LoggerInterface
|
|||||||
return 'UNKNOWN';
|
return 'UNKNOWN';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function debug(string $message): void
|
||||||
|
{
|
||||||
|
$this->log($message, LoggerInterface::LEVEL_DEBUG);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,20 +2,31 @@
|
|||||||
|
|
||||||
namespace Openguru\OpenCartFramework\Telegram;
|
namespace Openguru\OpenCartFramework\Telegram;
|
||||||
|
|
||||||
|
use Openguru\OpenCartFramework\Config\Settings;
|
||||||
use Openguru\OpenCartFramework\Http\Request;
|
use Openguru\OpenCartFramework\Http\Request;
|
||||||
|
use Openguru\OpenCartFramework\Logger\LoggerInterface;
|
||||||
use Openguru\OpenCartFramework\Telegram\Exceptions\TelegramInvalidSignatureException;
|
use Openguru\OpenCartFramework\Telegram\Exceptions\TelegramInvalidSignatureException;
|
||||||
|
|
||||||
class SignatureValidator
|
class SignatureValidator
|
||||||
{
|
{
|
||||||
private ?string $botToken;
|
private ?string $botToken;
|
||||||
|
private Settings $settings;
|
||||||
|
private LoggerInterface $logger;
|
||||||
|
|
||||||
public function __construct(?string $botToken = null)
|
public function __construct(Settings $settings, LoggerInterface $logger, ?string $botToken = null)
|
||||||
{
|
{
|
||||||
$this->botToken = $botToken;
|
$this->botToken = $botToken;
|
||||||
|
$this->settings = $settings;
|
||||||
|
$this->logger = $logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function validate(Request $request): void
|
public function validate(Request $request): void
|
||||||
{
|
{
|
||||||
|
if ($this->settings->get('app_debug')) {
|
||||||
|
$this->logger->warning('Dev Mode is enabled. Ignoring Signature Validation.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (! $this->botToken) {
|
if (! $this->botToken) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,9 @@
|
|||||||
namespace Openguru\OpenCartFramework\Telegram;
|
namespace Openguru\OpenCartFramework\Telegram;
|
||||||
|
|
||||||
use Openguru\OpenCartFramework\Application;
|
use Openguru\OpenCartFramework\Application;
|
||||||
|
use Openguru\OpenCartFramework\Config\Settings;
|
||||||
use Openguru\OpenCartFramework\Container\ServiceProvider;
|
use Openguru\OpenCartFramework\Container\ServiceProvider;
|
||||||
|
use Openguru\OpenCartFramework\Logger\LoggerInterface;
|
||||||
|
|
||||||
class TelegramServiceProvider extends ServiceProvider
|
class TelegramServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
@@ -16,6 +18,8 @@ class TelegramServiceProvider extends ServiceProvider
|
|||||||
|
|
||||||
$this->container->singleton(SignatureValidator::class, function (Application $app) {
|
$this->container->singleton(SignatureValidator::class, function (Application $app) {
|
||||||
return new SignatureValidator(
|
return new SignatureValidator(
|
||||||
|
$app->get(Settings::class),
|
||||||
|
$app->get(LoggerInterface::class),
|
||||||
$app->getConfigValue('telegram.bot_token'),
|
$app->getConfigValue('telegram.bot_token'),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ class SettingsHandler
|
|||||||
|
|
||||||
return new JsonResponse([
|
return new JsonResponse([
|
||||||
'app_name' => $this->settings->get('app_name'),
|
'app_name' => $this->settings->get('app_name'),
|
||||||
|
'app_debug' => $this->settings->get('app_debug'),
|
||||||
'app_icon' => $appIcon ?? '',
|
'app_icon' => $appIcon ?? '',
|
||||||
'app_icon192' => $icons['icon192'] ?? '',
|
'app_icon192' => $icons['icon192'] ?? '',
|
||||||
'app_icon180' => $icons['icon180'] ?? '',
|
'app_icon180' => $icons['icon180'] ?? '',
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Unit;
|
||||||
|
|
||||||
|
use Openguru\OpenCartFramework\Http\Request;
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
|
class RequestTest extends TestCase
|
||||||
|
{
|
||||||
|
public function testHasQueryParam(): void
|
||||||
|
{
|
||||||
|
$request = new Request(
|
||||||
|
['foo' => 'bar'],
|
||||||
|
[],
|
||||||
|
[],
|
||||||
|
[],
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->assertTrue($request->has('foo'));
|
||||||
|
$this->assertFalse($request->has('xyz'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testHasJsonParam(): void
|
||||||
|
{
|
||||||
|
$request = new Request(
|
||||||
|
[],
|
||||||
|
[],
|
||||||
|
[],
|
||||||
|
[],
|
||||||
|
[],
|
||||||
|
[],
|
||||||
|
'{"foo":"bar"}'
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->assertTrue($request->has('foo'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testHasAtLeastOne(): void
|
||||||
|
{
|
||||||
|
$request = new Request(
|
||||||
|
['foo' => 'bar'],
|
||||||
|
[],
|
||||||
|
[],
|
||||||
|
[],
|
||||||
|
[],
|
||||||
|
[],
|
||||||
|
'{"xyz":"bar"}'
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->assertTrue($request->has([
|
||||||
|
'foo',
|
||||||
|
'xyz',
|
||||||
|
'some_other'
|
||||||
|
]));
|
||||||
|
|
||||||
|
$this->assertFalse($request->has([
|
||||||
|
'abc',
|
||||||
|
'some_other'
|
||||||
|
]));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,6 +10,9 @@
|
|||||||
|
|
||||||
<section class="telecart-main-section">
|
<section class="telecart-main-section">
|
||||||
<FullscreenViewport v-if="platform === 'ios' || platform === 'android'" />
|
<FullscreenViewport v-if="platform === 'ios' || platform === 'android'" />
|
||||||
|
|
||||||
|
<AppDebugMessage v-if="settings.app_debug"/>
|
||||||
|
|
||||||
<RouterView v-slot="{ Component, route }">
|
<RouterView v-slot="{ Component, route }">
|
||||||
<KeepAlive include="Home" :key="filtersStore.paramsHashForRouter">
|
<KeepAlive include="Home" :key="filtersStore.paramsHashForRouter">
|
||||||
<component :is="Component" :key="route.fullPath" />
|
<component :is="Component" :key="route.fullPath" />
|
||||||
@@ -43,6 +46,7 @@ import {useProductFiltersStore} from "@/stores/ProductFiltersStore.js";
|
|||||||
import CartButton from "@/components/CartButton.vue";
|
import CartButton from "@/components/CartButton.vue";
|
||||||
import Dock from "@/components/Dock.vue";
|
import Dock from "@/components/Dock.vue";
|
||||||
import Navbar from "@/components/Navbar.vue";
|
import Navbar from "@/components/Navbar.vue";
|
||||||
|
import AppDebugMessage from "@/components/AppDebugMessage.vue";
|
||||||
|
|
||||||
const tg = useMiniApp();
|
const tg = useMiniApp();
|
||||||
const platform = ref();
|
const platform = ref();
|
||||||
|
|||||||
9
spa/src/components/AppDebugMessage.vue
Normal file
9
spa/src/components/AppDebugMessage.vue
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<template>
|
||||||
|
<div role="alert" class="alert alert-warning rounded-none">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 shrink-0 stroke-current" fill="none" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||||
|
d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>
|
||||||
|
</svg>
|
||||||
|
<span>Включен режим разработчика!</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -73,8 +73,8 @@ function onDockItemClick() {
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.telecart-dock {
|
.telecart-dock {
|
||||||
padding-bottom: calc(var(--tg-safe-area-inset-bottom) + 5px);
|
padding-bottom: calc(var(--tg-safe-area-inset-bottom, 0px) + 5px);
|
||||||
height: calc(70px + var(--tg-safe-area-inset-bottom));
|
height: calc(70px + var(--tg-safe-area-inset-bottom, 0px));
|
||||||
}
|
}
|
||||||
|
|
||||||
.telecart-dock-inner {
|
.telecart-dock-inner {
|
||||||
|
|||||||
@@ -74,6 +74,6 @@ function onClose() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.fullscreen-image-viewer .swiper-pagination-fraction {
|
.fullscreen-image-viewer .swiper-pagination-fraction {
|
||||||
bottom: calc(var(--tg-safe-area-inset-bottom, 0) + var(--tg-content-safe-area-inset-bottom, 0));
|
bottom: calc(var(--tg-safe-area-inset-bottom, 0px) + var(--tg-content-safe-area-inset-bottom, px));
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ const appLoading = createApp(AppLoading);
|
|||||||
appLoading.mount('#app');
|
appLoading.mount('#app');
|
||||||
|
|
||||||
settings.load()
|
settings.load()
|
||||||
|
.then(() => window.Telegram.WebApp.lockOrientation())
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
console.debug('Load default filters for the main page');
|
console.debug('Load default filters for the main page');
|
||||||
const filtersStore = useProductFiltersStore();
|
const filtersStore = useProductFiltersStore();
|
||||||
@@ -63,7 +64,6 @@ settings.load()
|
|||||||
.then(() => { appLoading.unmount(); app.mount('#app'); })
|
.then(() => { appLoading.unmount(); app.mount('#app'); })
|
||||||
.then(() => window.Telegram.WebApp.ready())
|
.then(() => window.Telegram.WebApp.ready())
|
||||||
.then(() => settings.ya_metrika_enabled && injectYaMetrika())
|
.then(() => settings.ya_metrika_enabled && injectYaMetrika())
|
||||||
.then(() => window.Telegram.WebApp.lockOrientation())
|
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
const errorApp = createApp(ApplicationError, {error});
|
const errorApp = createApp(ApplicationError, {error});
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {fetchSettings} from "@/utils/ftch.js";
|
|||||||
export const useSettingsStore = defineStore('settings', {
|
export const useSettingsStore = defineStore('settings', {
|
||||||
state: () => ({
|
state: () => ({
|
||||||
app_enabled: true,
|
app_enabled: true,
|
||||||
|
app_debug: false,
|
||||||
store_enabled: true,
|
store_enabled: true,
|
||||||
app_name: 'OpenCart Telegram магазин',
|
app_name: 'OpenCart Telegram магазин',
|
||||||
app_icon: '',
|
app_icon: '',
|
||||||
@@ -39,6 +40,7 @@ export const useSettingsStore = defineStore('settings', {
|
|||||||
this.theme.dark = settings.theme_dark;
|
this.theme.dark = settings.theme_dark;
|
||||||
this.ya_metrika_enabled = settings.ya_metrika_enabled;
|
this.ya_metrika_enabled = settings.ya_metrika_enabled;
|
||||||
this.app_enabled = settings.app_enabled;
|
this.app_enabled = settings.app_enabled;
|
||||||
|
this.app_debug = settings.app_debug;
|
||||||
this.store_enabled = settings.store_enabled;
|
this.store_enabled = settings.store_enabled;
|
||||||
this.feature_coupons = settings.feature_coupons;
|
this.feature_coupons = settings.feature_coupons;
|
||||||
this.feature_vouchers = settings.feature_vouchers;
|
this.feature_vouchers = settings.feature_vouchers;
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ html {
|
|||||||
|
|
||||||
.app-container {
|
.app-container {
|
||||||
/*padding-top: calc(var(--tg-content-safe-area-inset-top) + var(--tg-safe-area-inset-top));*/
|
/*padding-top: calc(var(--tg-content-safe-area-inset-top) + var(--tg-safe-area-inset-top));*/
|
||||||
padding-bottom: var(--tg-safe-area-inset-bottom);
|
padding-bottom: var(--tg-safe-area-inset-bottom, 0px);
|
||||||
padding-left: var(--tg-safe-area-inset-left);
|
padding-left: var(--tg-safe-area-inset-left, 0px);
|
||||||
padding-right: var(--tg-safe-area-inset-right);
|
padding-right: var(--tg-safe-area-inset-right, 0px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.safe-top {
|
.safe-top {
|
||||||
@@ -57,7 +57,7 @@ html {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.telecart-main-section {
|
.telecart-main-section {
|
||||||
padding-top: calc(var(--tg-content-safe-area-inset-top) + var(--tg-safe-area-inset-top) + var(--tc-navbar-min-height));
|
padding-top: calc(var(--tg-content-safe-area-inset-top, 0rem) + var(--tg-safe-area-inset-top, 0rem) + var(--tc-navbar-min-height));
|
||||||
}
|
}
|
||||||
|
|
||||||
.swiper-pagination-bullets > .swiper-pagination-bullet {
|
.swiper-pagination-bullets > .swiper-pagination-bullet {
|
||||||
|
|||||||
@@ -174,6 +174,6 @@ onMounted(async () => {
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.btn-checkout {
|
.btn-checkout {
|
||||||
bottom: calc(var(--spacing) * 22 + var(--tg-safe-area-inset-bottom))
|
bottom: calc(var(--spacing, 0px) * 22px + var(--tg-safe-area-inset-bottom, 0px))
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<Banner/>
|
<Banner/>
|
||||||
|
|
||||||
<div class="px-5 fixed z-50 w-full opacity-90" style="bottom: calc(var(--tg-safe-area-inset-bottom) + 80px);">
|
<div class="px-5 fixed z-50 w-full opacity-90" style="bottom: calc(var(--tg-safe-area-inset-bottom, 0px) + 80px);">
|
||||||
<div class="flex justify-center">
|
<div class="flex justify-center">
|
||||||
<button
|
<button
|
||||||
@click="showFilters"
|
@click="showFilters"
|
||||||
|
|||||||
Reference in New Issue
Block a user