|
|
@@ -43,7 +43,13 @@ var productos = {
|
|
|
template: '#productos',
|
|
|
data: function () {
|
|
|
return {
|
|
|
- titulo: 'Productos'
|
|
|
+ titulo: 'Productos',
|
|
|
+ categories: Object.keys(productsByCategory).map(function (p) {
|
|
|
+ return {
|
|
|
+ path: p,
|
|
|
+ name: p
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -81,6 +87,59 @@ Vue.directive('scroller', {
|
|
|
Vue.component('empresa', empresa);
|
|
|
Vue.component('productos', productos);
|
|
|
|
|
|
+var productsByCategory = {
|
|
|
+ higiene: [{
|
|
|
+ name: 'Exfoliating scrub',
|
|
|
+ shortDescription: 'Piel fresca, descongestiva y limpia. Prepara a la piel para recibir el tratamiento posterior',
|
|
|
+ img: 'https://especificosba.com.ar/Images/thumbs/exfoliating_scrub.png'
|
|
|
+ }, {
|
|
|
+ name: 'Emulsion de higiene',
|
|
|
+ shortDescription: 'Emulsión de limpieza, demaquillante, de PH neutro, hipoalergénica. Indicada para todo tipo de piel',
|
|
|
+ img: 'https://especificosba.com.ar/Images/thumbs/emulsion_higiene.png'
|
|
|
+ }],
|
|
|
+ mascaras: [{
|
|
|
+ name: 'Dynamic Do All 1',
|
|
|
+ shortDescription: 'Laboris officia adipisicing voluptate magna fugiat deserunt magna.',
|
|
|
+ img: 'https://especificosba.com.ar/Images/thumbs/dda_1.png'
|
|
|
+ },{
|
|
|
+ name: 'Dynamic Do All 2',
|
|
|
+ shortDescription: 'Id officia ex laboris consectetur duis do quis.',
|
|
|
+ img: 'https://especificosba.com.ar/Images/thumbs/dda_2.png'
|
|
|
+ }, {
|
|
|
+ name: 'Refreshing mask',
|
|
|
+ shortDescription: 'Dolore adipisicing laborum elit proident ipsum quis voluptate duis.',
|
|
|
+ img: 'https://especificosba.com.ar/Images/thumbs/refreshing_mask.png'
|
|
|
+ }, {
|
|
|
+ name: 'Specific mask',
|
|
|
+ shortDescription: 'Pariatur deserunt quis minim eu enim excepteur non sit cillum commodo labore est nulla consectetur.',
|
|
|
+ img: 'https://especificosba.com.ar/Images/thumbs/specific_mask.png'
|
|
|
+ }],
|
|
|
+}
|
|
|
+
|
|
|
+function getProducts(category) {
|
|
|
+ return productsByCategory[category]
|
|
|
+}
|
|
|
+
|
|
|
+function categoryComponent(categoryName) {
|
|
|
+ return Vue.component(categoryName, {
|
|
|
+ template: '#category',
|
|
|
+ data: function () {
|
|
|
+ return {
|
|
|
+ category: categoryName,
|
|
|
+ products: getProducts(categoryName)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+var productChildren = Object.keys(productsByCategory).map(function (p) {
|
|
|
+ return {
|
|
|
+ path: p,
|
|
|
+ name: p,
|
|
|
+ component: categoryComponent(p)
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
var routes = [{
|
|
|
path: '/',
|
|
|
component: empresa
|
|
|
@@ -93,7 +152,8 @@ var routes = [{
|
|
|
{
|
|
|
path: '/productos',
|
|
|
component: productos,
|
|
|
- text: 'Productos'
|
|
|
+ text: 'Productos',
|
|
|
+ children: productChildren
|
|
|
}
|
|
|
]
|
|
|
|