diff --git a/frontend/src/views/StrategicAnalytics.vue b/frontend/src/views/StrategicAnalytics.vue
index c87b2a5..94aff6e 100644
--- a/frontend/src/views/StrategicAnalytics.vue
+++ b/frontend/src/views/StrategicAnalytics.vue
@@ -206,43 +206,92 @@
ads_click
Impacto de Aliados Comerciales
-
-
-
-
- | Negocio |
- Visitas |
- Interacciones (R/LL/M) |
- Cupones |
- Favoritos |
- Salud |
-
-
-
-
- | {{ name }} |
- {{ data.views }} |
-
-
- S: {{ data.social }}
- L: {{ data.calls }}
- M: {{ data.location }}
-
- |
- {{ data.promos }} |
-
-
- favorite {{ data.favs }}
-
- |
-
+
+
+
+
+
+
+
+
+ visibility
+
+ {{ data.views }}
+ Vistas del Local
+
+
+
+ chat
+
+ {{ data.social }}
+ Redes / WP
+
+
+
+ phone
+
+ {{ data.calls }}
+ Llamadas Directas
+
+
+
+ place
+
+ {{ data.location }}
+ Usos del Mapa
+
+
+
+ favorite
+
+ {{ data.favs }}
+ Veces Favorito
+
+
+
+
+
+
+ |
-
-
-
+
+
+
+
+
+
+ local_offer
+ {{ couponName }}
+
+
+ visibility {{ couponData.views }}
+ place {{ couponData.location }}
+
+
+
+
+
+ info No hay promociones generadas.
+
+
+
+
@@ -442,7 +491,7 @@ onMounted(async () => {
if (allBusinesses) {
for (const b of allBusinesses) {
if (b.name) {
- bizStats[b.name] = { views: 0, promos: 0, favs: 0, social: 0, location: 0, calls: 0 }
+ bizStats[b.name] = { views: 0, promos: 0, favs: 0, social: 0, location: 0, calls: 0, coupons: {} }
}
}
}
@@ -478,7 +527,7 @@ onMounted(async () => {
} else if (ev.entity_type === 'business') {
if (!bizStats[nameKey]) {
- bizStats[nameKey] = { views: 0, promos: 0, favs: 0, social: 0, location: 0, calls: 0 }
+ bizStats[nameKey] = { views: 0, promos: 0, favs: 0, social: 0, location: 0, calls: 0, coupons: {} }
}
if (ev.event_name === 'view_details') {
@@ -500,14 +549,20 @@ onMounted(async () => {
// Los cupones se suman a la parte del negocio correspondiente
const bizName = ev.properties?.business || nameKey
if (!bizStats[bizName]) {
- bizStats[bizName] = { views: 0, promos: 0, favs: 0, social: 0, location: 0, calls: 0 }
+ bizStats[bizName] = { views: 0, promos: 0, favs: 0, social: 0, location: 0, calls: 0, coupons: {} }
+ }
+
+ if (!bizStats[bizName].coupons[nameKey]) {
+ bizStats[bizName].coupons[nameKey] = { views: 0, location: 0 }
}
if (ev.event_name === 'promo_view') {
bizStats[bizName].promos++
+ bizStats[bizName].coupons[nameKey].views++
total_promo_clicks++
} else if (ev.event_name === 'location_click') {
bizStats[bizName].location++
+ bizStats[bizName].coupons[nameKey].location++
}
}
}
@@ -604,6 +659,38 @@ h1 { font-size: 2.2rem; font-weight: 900; margin: 0; }
.status-pill.good { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.status-pill.low { background: rgba(244, 63, 94, 0.1); color: #f43f5e; }
+/* BUSINESS LIST CARDS */
+.business-list { display: flex; flex-direction: column; gap: 20px; }
+.business-card-analytics { background: var(--card-bg); border-radius: 20px; border: 1px solid var(--border-color); padding: 24px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
+
+.business-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border-color); }
+.business-title-info { display: flex; align-items: center; gap: 12px; }
+.biz-icon-box { background: rgba(254,231,21,0.1); color: #fee715; width: 44px; height: 44px; border-radius: 12px; display: flex; justify-content: center; align-items: center; }
+.business-title-info h3 { margin: 0; font-size: 1.3rem; font-weight: 800; color: var(--text-primary); }
+.business-total-badge { background: #1e293b; color: white; padding: 6px 14px; border-radius: 20px; display: flex; align-items: center; gap: 6px; font-size: 0.85rem; }
+.business-total-badge .material-icons { font-size: 16px; color: #fee715; }
+
+.business-details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px; margin-bottom: 24px; }
+.detail-item { display: flex; align-items: center; gap: 12px; background: var(--bg-secondary); padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border-color); }
+.detail-item .material-icons { font-size: 20px; }
+.detail-info { display: flex; flex-direction: column; }
+.detail-value { font-size: 1.2rem; font-weight: 900; color: var(--text-primary); }
+.detail-label { font-size: 0.65rem; color: var(--text-secondary); text-transform: uppercase; font-weight: 700; margin-top:2px; }
+
+.business-coupons-section { background: var(--bg-secondary); border-radius: 16px; padding: 20px; border: 1px solid var(--border-color); }
+.business-coupons-section.has-coupons { border-color: rgba(254,231,21,0.3); background: rgba(254,231,21,0.02); }
+.coupons-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
+.business-coupons-section h4 { margin: 0; font-size: 1rem; font-weight: 800; color: var(--text-primary); }
+.coupon-list { display: flex; flex-direction: column; gap: 10px; }
+.coupon-item { display: flex; justify-content: space-between; align-items: center; background: var(--card-bg); padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border-color); box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
+.coupon-name-box { display: flex; align-items: center; gap: 8px; }
+.coupon-name { font-weight: 700; font-size: 0.9rem; color: var(--text-primary); }
+.coupon-stats { display: flex; gap: 16px; font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
+.coupon-stats .stat { display: flex; align-items: center; gap: 4px; background: var(--bg-secondary); padding: 4px 10px; border-radius: 8px;}
+.coupon-stats .stat .material-icons { font-size: 14px; color: var(--text-secondary); }
+
+.no-coupons { font-size: 0.85rem; color: var(--text-secondary); display:flex; align-items:center; gap:8px; font-weight:600;}
+
/* ANIMATIONS */
.animate-fade { animation: fadeIn 0.4s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }