feat: add customer messaging interface in shop

- Add shop messages API endpoints (/api/v1/shop/messages)
- Add shop messages page routes (/shop/account/messages)
- Add messages.html template for customer account
- Add Messages card to account dashboard with unread badge
- Customers can view/reply to vendor_customer conversations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-21 14:10:38 +01:00
parent abceffb7b8
commit 2f98c4389d
5 changed files with 1125 additions and 1 deletions

View File

@@ -71,6 +71,30 @@
</div>
</div>
</a>
<!-- Messages Card -->
<a href="{{ base_url }}shop/account/messages"
class="block bg-white dark:bg-gray-800 rounded-lg shadow hover:shadow-lg transition-shadow p-6 border border-gray-200 dark:border-gray-700"
x-data="{ unreadCount: 0 }"
x-init="fetch('/api/v1/shop/messages/unread-count').then(r => r.json()).then(d => unreadCount = d.unread_count).catch(() => {})">
<div class="flex items-center mb-4">
<div class="flex-shrink-0 relative">
<svg class="h-8 w-8 text-primary" style="color: var(--color-primary)" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" />
</svg>
<span x-show="unreadCount > 0"
class="absolute -top-1 -right-1 inline-flex items-center justify-center px-1.5 py-0.5 text-xs font-bold leading-none text-white bg-red-600 rounded-full"
x-text="unreadCount > 9 ? '9+' : unreadCount"></span>
</div>
<div class="ml-4">
<h3 class="text-lg font-semibold text-gray-900 dark:text-white">Messages</h3>
<p class="text-sm text-gray-600 dark:text-gray-400">Contact support</p>
</div>
</div>
<div x-show="unreadCount > 0">
<p class="text-sm text-primary font-medium" style="color: var(--color-primary)" x-text="unreadCount + ' unread message' + (unreadCount > 1 ? 's' : '')"></p>
</div>
</a>
</div>
<!-- Account Summary -->