feat: add customer account page with profile information and actions
- Create Account.vue page component with user profile display - Add account route to router.js - Update Navbar.vue to remove avatar button (moved to Dock) - Add avatar icon to Dock.vue for account page navigation - Implement 'Contact us' action that opens manager chat via Telegram - Implement 'Add to home screen' feature using Telegram Web App API 8.0+ - Add home screen status checking with checkHomeScreenStatus API - Display customer registration date and days with us counter - Add Russian language declension for days word (день/дня/дней) - Update TelegramCustomerHandler to return created_at in saveOrUpdate response - Add getByTelegramUserId method to TelecartCustomerService - Store customer_created_at in Pulse store during app initialization - Update App.vue to show Dock on account page - Remove unused getCurrentCustomer API endpoint and function
This commit is contained in:
@@ -60,6 +60,22 @@
|
||||
</div>
|
||||
<span class="dock-label">Корзина</span>
|
||||
</RouterLink>
|
||||
|
||||
<RouterLink
|
||||
:to="{name: 'account'}"
|
||||
:class="{'dock-active': route.name === 'account'}"
|
||||
@click="onDockItemClick"
|
||||
>
|
||||
<div v-if="tgData?.user?.photo_url" class="w-6 h-6 rounded-full overflow-hidden">
|
||||
<img :src="tgData?.user?.photo_url" alt="avatar" class="w-full h-full object-cover"/>
|
||||
</div>
|
||||
<div v-else class="bg-primary text-primary-content w-6 h-6 rounded-full flex items-center justify-center">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z" />
|
||||
</svg>
|
||||
</div>
|
||||
<span class="dock-label">Профиль</span>
|
||||
</RouterLink>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -67,10 +83,12 @@
|
||||
import {useRoute} from "vue-router";
|
||||
import {useCartStore} from "@/stores/CartStore.js";
|
||||
import {useSettingsStore} from "@/stores/SettingsStore.js";
|
||||
import {useTgData} from "@/composables/useTgData.js";
|
||||
|
||||
const route = useRoute();
|
||||
const cart = useCartStore();
|
||||
const settings = useSettingsStore();
|
||||
const tgData = useTgData();
|
||||
const haptic = window.Telegram.WebApp.HapticFeedback;
|
||||
|
||||
function onDockItemClick() {
|
||||
|
||||
Reference in New Issue
Block a user