feat(customers): track order meta and OC sync
- add telecart_order_meta table and orders_count column for customers - introduce OcCustomerService and OrderMetaService for syncing OC data - rework OrderCreateService transaction flow, metadata handling and tests - increment telegram customer orders_count and expose it via handlers/UI - update stats dashboard with rub formatting, tooltips and customers count - sync SPA theme colors with Telegram WebApp and fix dark variant behavior - add helpers for RUB formatting and bool casting; simplify logs handler
This commit is contained in:
@@ -38,6 +38,12 @@ const blocks = useBlocksStore();
|
||||
const appLoading = createApp(AppLoading);
|
||||
appLoading.mount('#app');
|
||||
|
||||
function setTelegramUIColors() {
|
||||
const daisyUIBgColor = getCssVarOklchRgb('--color-base-100');
|
||||
window.Telegram.WebApp.setHeaderColor(daisyUIBgColor);
|
||||
window.Telegram.WebApp.setBackgroundColor(daisyUIBgColor);
|
||||
}
|
||||
|
||||
settings.load()
|
||||
.then(() => window.Telegram.WebApp.lockOrientation())
|
||||
.then(() => {
|
||||
@@ -87,18 +93,22 @@ settings.load()
|
||||
if (settings.night_auto) {
|
||||
window.Telegram.WebApp.onEvent('themeChanged', function () {
|
||||
document.documentElement.setAttribute('data-theme', settings.theme[this.colorScheme]);
|
||||
setTelegramUIColors();
|
||||
});
|
||||
}
|
||||
|
||||
const tgColorScheme = getComputedStyle(document.documentElement)
|
||||
.getPropertyValue('--tg-color-scheme')
|
||||
.trim();
|
||||
if (tgColorScheme) {
|
||||
document.documentElement.classList.add(tgColorScheme);
|
||||
}
|
||||
|
||||
for (const key in settings.theme.variables) {
|
||||
document.documentElement.style.setProperty(key, settings.theme.variables[key]);
|
||||
|
||||
}
|
||||
|
||||
const daisyUIBgColor = getCssVarOklchRgb('--color-base-100');
|
||||
window.Telegram.WebApp.setHeaderColor(daisyUIBgColor);
|
||||
window.Telegram.WebApp.setBackgroundColor(daisyUIBgColor);
|
||||
setTelegramUIColors();
|
||||
}
|
||||
)
|
||||
.then(() => new AppMetaInitializer(settings).init())
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@import "tailwindcss";
|
||||
@custom-variant dark (&:where([data-theme=dark], [data-theme=dark] *));
|
||||
@custom-variant dark (&:where(.dark, .dark *));
|
||||
|
||||
@plugin "daisyui" {
|
||||
themes: all;
|
||||
|
||||
Reference in New Issue
Block a user