nuxt-layer-core 1.0.7 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/layers/solution/app/components/DynamicPageSections.vue +43 -9
- package/app/layers/solution/app/components/LinuxVersionsSection.vue +349 -331
- package/app/layers/solution/app/components/RegistrationForm.vue +285 -283
- package/app/layers/solution/app/composables/useCrmApi.ts +35 -32
- package/package.json +1 -1
|
@@ -24,6 +24,25 @@ const parseValue = (value: unknown) => {
|
|
|
24
24
|
|
|
25
25
|
const toCamelCase = (key: string) => key.replace(/_([a-z0-9])/gi, (_, c) => c.toUpperCase())
|
|
26
26
|
|
|
27
|
+
// Gói cần tư vấn được mang theo qua query (vd từ CoursesSection/PricingPlansSection ở trang khác) khi
|
|
28
|
+
// người dùng bấm "Liên hệ tư vấn" cho 1 slug cụ thể - áp dụng cho mọi slug, không riêng gì 1 trang nào
|
|
29
|
+
const route = useRoute()
|
|
30
|
+
|
|
31
|
+
const queryPlan = computed(() => {
|
|
32
|
+
const id = route.query.plan
|
|
33
|
+
if (!id) return null
|
|
34
|
+
|
|
35
|
+
return {
|
|
36
|
+
id: String(id),
|
|
37
|
+
name: String(route.query.name || ''),
|
|
38
|
+
level: String(route.query.level || ''),
|
|
39
|
+
duration: String(route.query.duration || ''),
|
|
40
|
+
price: String(route.query.price || ''),
|
|
41
|
+
description: String(route.query.description || ''),
|
|
42
|
+
icon: 'lucide:server',
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
|
|
27
46
|
// Gom các item_id_0M_groups_0N (M: 1-3) của 1 group cụ thể thành mảng item hợp lệ
|
|
28
47
|
const pickGroupItems = (sectionProps: Record<string, any> | undefined, groupSuffix: string) => {
|
|
29
48
|
if (!sectionProps) return []
|
|
@@ -82,16 +101,31 @@ const sections = computed(() => {
|
|
|
82
101
|
: null
|
|
83
102
|
|
|
84
103
|
return list.map((section) => {
|
|
85
|
-
if (section.component
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
104
|
+
if (section.component === 'CtaSection') {
|
|
105
|
+
return {
|
|
106
|
+
...section,
|
|
107
|
+
props: {
|
|
108
|
+
...section.props,
|
|
109
|
+
courses,
|
|
110
|
+
pricingPlans,
|
|
111
|
+
},
|
|
112
|
+
}
|
|
94
113
|
}
|
|
114
|
+
|
|
115
|
+
// RegistrationSection: nếu URL có sẵn ?plan=... (đến từ nút "Liên hệ tư vấn" ở trang khác)
|
|
116
|
+
// thì hiển thị đúng gói đó thay vì danh sách trống do CMS không có data theo query
|
|
117
|
+
if (section.component === 'RegistrationSection' && queryPlan.value) {
|
|
118
|
+
return {
|
|
119
|
+
...section,
|
|
120
|
+
props: {
|
|
121
|
+
...section.props,
|
|
122
|
+
plans: [queryPlan.value],
|
|
123
|
+
selectedPlanId: queryPlan.value.id,
|
|
124
|
+
},
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return section
|
|
95
129
|
})
|
|
96
130
|
})
|
|
97
131
|
</script>
|