From f5d9e92b5c28e33c86f017dd4c02fea41093fa77 Mon Sep 17 00:00:00 2001 From: ManjaroOne666 Date: Tue, 12 Feb 2019 12:18:35 +0000 Subject: [PATCH] services api calls --- TODO.md | 33 +++++++++++++++++++++++++++++++++ components/SiteMenu.vue | 4 ---- pages/services.vue | 41 +++++------------------------------------ 3 files changed, 38 insertions(+), 40 deletions(-) diff --git a/TODO.md b/TODO.md index e744099..3c7318b 100644 --- a/TODO.md +++ b/TODO.md @@ -40,4 +40,37 @@ 'a fleeting eternity', 'I imagine myself', ], + +//services + imageUrl: "https://via.placeholder.com/1920x1080", + services: [ + { + 'heading': 'Portraits', + 'imageUrl': 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/services-portraits.jpg', + 'backgroundImageUrl': 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/services-portraits.jpg', + 'html': '

Corporate portraits and publicity photos for printed materials, including annual reports and newsletters.

', + 'linkUrl': '/galleries?gallery=0', + }, + { + 'heading': 'Dance', + 'imageUrl': 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/services-dance.jpg', + 'backgroundImageUrl': 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/services-dance.jpg', + 'html': '

Photography and video production of dancers and performances for print, web, and promotion.

', + 'linkUrl': '/galleries?gallery=1', + }, + { + 'heading': 'Music', + 'imageUrl': 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/services-music.jpg', + 'backgroundImageUrl': 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/services-music.jpg', + 'html': '

Photography and video of musical performances and portraits for print and the web, CD covers, and publicity photos.

', + 'linkUrl': '/galleries?gallery=2', + }, + { + 'heading': 'Events', + 'imageUrl': 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/services-events.jpg', + 'backgroundImageUrl': 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/services-events.jpg', + 'html': '

Photography and video production for your corporate, organisational and personal events and celebrations.

', + 'linkUrl': '/galleries?gallery=3', + }, + ] ``` diff --git a/components/SiteMenu.vue b/components/SiteMenu.vue index 45cd6cd..c3558de 100644 --- a/components/SiteMenu.vue +++ b/components/SiteMenu.vue @@ -96,10 +96,6 @@ export default { }, }, - created () { - // this.$store.dispatch('navigation/load') - }, - mounted () { const mq = window.matchMedia("(min-width: 40em)") this.loadMenuImages = mq.matches diff --git a/pages/services.vue b/pages/services.vue index 6286930..9b087ad 100644 --- a/pages/services.vue +++ b/pages/services.vue @@ -86,42 +86,11 @@ export default { }, }, - asyncData () { - return new Promise((resolve, reject) => { - resolve({ - imageUrl: "https://via.placeholder.com/1920x1080", - services: [ - { - 'heading': 'Portraits', - 'imageUrl': 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/services-portraits.jpg', - 'backgroundImageUrl': 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/services-portraits.jpg', - 'html': '

Corporate portraits and publicity photos for printed materials, including annual reports and newsletters.

', - 'linkUrl': '/galleries?gallery=0', - }, - { - 'heading': 'Dance', - 'imageUrl': 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/services-dance.jpg', - 'backgroundImageUrl': 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/services-dance.jpg', - 'html': '

Photography and video production of dancers and performances for print, web, and promotion.

', - 'linkUrl': '/galleries?gallery=1', - }, - { - 'heading': 'Music', - 'imageUrl': 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/services-music.jpg', - 'backgroundImageUrl': 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/services-music.jpg', - 'html': '

Photography and video of musical performances and portraits for print and the web, CD covers, and publicity photos.

', - 'linkUrl': '/galleries?gallery=2', - }, - { - 'heading': 'Events', - 'imageUrl': 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/services-events.jpg', - 'backgroundImageUrl': 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/services-events.jpg', - 'html': '

Photography and video production for your corporate, organisational and personal events and celebrations.

', - 'linkUrl': '/galleries?gallery=3', - }, - ] - }) - }) + async asyncData ({ $axios }) { + let { services } = await $axios.$get('api/v1/services') + let { imageUrl } = await $axios.$get('api/v1/page/services') + + return { services, imageUrl } }, }